azure-maps-control 3.0.0-preview.9 → 3.0.0
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.
- package/ReadMe.md +3 -3
- package/dist/atlas-core-bare-snr-min.js +1 -1
- package/dist/atlas-core-bare-snr.js +2337 -1616
- package/dist/atlas-core-bare.js +5368 -4629
- package/dist/atlas-core-bare.min.js +1 -1
- package/dist/atlas-core-snr.js +51664 -50918
- package/dist/atlas-core.js +69969 -69205
- package/dist/atlas-core.min.js +3 -3
- package/dist/atlas-internal.min.js +1 -1
- package/dist/atlas.js +85213 -76764
- package/dist/atlas.min.js +3 -3
- package/package.json +33 -29
- package/thirdpartynotices.txt +0 -0
|
@@ -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(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("azuremaps-maplibre-gl")):"function"==typeof define&&define.amd?define(["exports","azuremaps-maplibre-gl"],t):t((e=e||self).atlas=e.atlas||{},e.maplibregl)}(this,function(c,u){"use strict";u=u&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u;var e="atlas.microsoft.com",t="atlas.microsoft.com",r="styling",o="2022-08-05",n="https://login.microsoftonline.com/",l="api-version",i="Authorization",s="Bearer ",a="jwt-sas ",h="{{azMapsDomain}}",p="{azMapsDomain}",d="{{azMapsView}}",f="view",g="{{azMapsLanguage}}",y="{{azMapsStylingPath}}",m="{{azMapsStylePath}}",v="styling",_="styles",w="2.0",b="Map-Agent",C="x-ms-client-id",E="Ms-Am-Request-Origin",S="MapControl",T="https://atlas.microsoft.com/.default",I="Session-Id",A=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},k=(P.prototype.merge=function(){for(var t,e,r,o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];try{for(var i=A(o),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 P?this[c].merge(a[c]):this[c]=a[c]:(r=r||new(Object.getPrototypeOf(this).constructor),this[c]=r[c]))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return this},P);function P(){}var O,x,R=window&&window.__extends||(O=function(e,t){return(O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}O(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),M=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},N=(R(L,x=k),L);function L(){var e=null!==x&&x.apply(this,arguments)||this;return e.domain=void 0,e.headers={},e.path="",e.protocol="https",e.queryParams={},e.subdomain="",e}var D=(q.prototype.get=function(){return fetch(this.toString(),{method:"GET",mode:"cors",headers:new Headers(this.options.headers)}).then(function(e){if(e.ok)return e.json();throw new Error("HTTP "+e.status+": "+e.statusText)})},q.prototype.toString=function(){var e=this,t=Object.entries(e.options.queryParams).map(function(e){e=M(e,2);return e[0]+"="+e[1]}).join("&"),r=[],o=e.options.path||"";return q.protoRegEx.test(o)?r.push(o):(e.options.domain&&(q.protoRegEx.test(e.options.domain)||(r.push(e.options.protocol+"://"),r.push(e.options.subdomain?e.options.subdomain+".":"")),r.push(e.options.domain)),r.push(e.options.path?"/"+o:"")),r.push(t?"?"+t:""),r.join("")},q.protoRegEx=new RegExp(/^(((file|http|https):\/\/)|blob:)/i),q);function q(e){this.options=(new N).merge(e)}var j="3.0.0-preview.9",U=(H.getFullVersion=function(){return j},H.getEndpointVersion=function(){var e=j.indexOf(".");return-1===(e=j.indexOf(".",e+1))?j:j.substring(0,e)},H);function H(){}function z(e){var t=document.createElement("span");return t.innerText=e,t.classList.add("tooltiptext"),-1!=navigator.userAgent.indexOf("Edg")?t.classList.add("edge"):-1!=navigator.userAgent.indexOf("Chrome")?t.classList.add("chrome"):-1!=navigator.userAgent.indexOf("Safari")?t.classList.add("safari"):-1!=navigator.userAgent.indexOf("Firefox")&&t.classList.add("firefox"),-1!=navigator.userAgent.indexOf("Windows")?t.classList.add("win"):-1!=navigator.userAgent.indexOf("Macintosh")&&t.classList.add("mac"),t}function B(n,i,s){function e(e){var t=i.getBoundingClientRect(),r=n.getBoundingClientRect(),o=t.x+r.width>window.innerWidth?window.innerWidth-r.width:t.x,r=t.y+t.height+r.height+4>window.innerHeight?t.y-r.height-4:t.y+t.height+4;s&&i.parentElement&&(t=i.parentElement?i.parentElement.getBoundingClientRect():null,n.style.position="absolute",o-=t.x,r-=t.y),n.style.transform="translate("+o+"px, "+r+"px)"}void 0===s&&(s=!1),i.addEventListener("mouseover",e),i.addEventListener("focusin",e)}var F,K=window&&window.__extends||(F=function(e,t){return(F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}F(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});(xe=c.ControlPosition||(c.ControlPosition={})).TopLeft="top-left",xe.TopRight="top-right",xe.BottomLeft="bottom-left",xe.BottomRight="bottom-right",xe.NonFixed="non-fixed";var G,Y=(K(Z,G=k),Z);function Z(){var e=null!==G&&G.apply(this,arguments)||this;return e.position=c.ControlPosition.NonFixed,e}var W=(V.prototype.getLuminosity=function(){for(var e=[this.r,this.g,this.b],t=[],r=0;r<e.length;r++){var o=e[r]/255;t[r]=o<=.03928?o/12.92:Math.pow((.055+o)/1.055,2.4)}return.2126*t[0]+.7152*t[1]+.0722*t[2]},V.prototype.getRBGA=function(e){var t=document.createElement("canvas").getContext("2d");t.globalAlpha=1,t.fillStyle=e,t.fillRect(0,0,1,1);t=t.getImageData(0,0,1,1).data;return[t[0],t[1],t[2],t[3]]},V);function V(e){var t;e&&(t=void 0,3<=(t="string"==typeof e?this.getRBGA(e):e).length&&(this.r=t[0],this.g=t[1],this.b=t[2],3<t.length&&(this.a=t[3])))}(Ne=c.ControlStyle||(c.ControlStyle={})).light="light",Ne.dark="dark",Ne.auto="auto";var J=Map,Q=(X.prototype._addEventListener=function(e,t,r){this.listeners.has(e)||this.listeners.set(e,new J),this.listeners.get(e).set(t,r)},X.prototype._removeEventListener=function(e,t){this.listeners.has(e)&&this.listeners.get(e).delete(t)},X.prototype._invokeEvent=function(r,o){var n=this;this.listeners.has(r)&&this.listeners.get(r).forEach(function(e,t){e&&n._removeEventListener(r,t);try{t(o)}catch(e){console.error(e)}})},X);function X(){this.listeners=new J}var $,ee,te=Object.freeze({__proto__:null,EventEmitter:Q}),re=((window&&window.__extends||($=function(e,t){return($=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}$(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(oe,ee=Q),oe.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},oe.prototype.buildContainer=function(e,t,r,o){return this._map=e,this._container=document.createElement(o||"div"),this._container.classList.add("azure-maps-control-container"),"string"==typeof r&&this._container.setAttribute("aria-label",r),t.toLowerCase()===c.ControlStyle.auto?this._map&&this._map.events.add("stylechanged",this._onStyleChange):this._container.classList.add(t),this._container},oe.prototype._setTheme=function(e){this._theme!==e&&(this._container.classList.remove(this._theme),this._container.classList.add(e),this._theme=e)},oe.activateClickDelay=100,oe);function oe(){var t=null!==ee&&ee.apply(this,arguments)||this;return t._onStyleChange=function(){t._map.getStyle().style.toLowerCase().startsWith("blank")?t._observer||(t._onBackgroundChange(),t._observer=new MutationObserver(t._onBackgroundChange),t._observer.observe(t._map.getMapContainer(),{attributes:!0,attributeFilter:["style"]})):(t._observer&&(t._observer.disconnect(),delete t._observer),t._map.styles.getThemeAsync(t._map.getStyle()).then(function(e){t._setTheme(e)}))},t._onBackgroundChange=function(){var e=new W(t._map.getMapContainer().style.backgroundColor).getLuminosity(),e=isNaN(e)||.5<e?c.ControlStyle.light:c.ControlStyle.dark;t._setTheme(e)},t}var ne,ie,se=((window&&window.__extends||(ne=function(e,t){return(ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ne(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ae,ie=k),ae);function ae(){var e=null!==ie&&ie.apply(this,arguments)||this;return e.rotationDegreesDelta=15,e.style=c.ControlStyle.light,e.inverted=!1,e}var ce,ue,le=((window&&window.__extends||(ce=function(e,t){return(ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ce(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(he,ue=re),he.prototype.onAdd=function(e,t){var r=this,o=this.buildContainer(e,this.options.style,"Rotation Control"),n=this.constructRotationButton(e),i=this.constructRotationGrid(e,t),e=z("Reset to Default Rotation");return o.addEventListener("mouseover",function(e){r.lastActiveTime=r.lastActiveTime||e.timeStamp,r.hasMouse=!0,o.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),o.addEventListener("focusin",function(e){r.lastActiveTime=r.lastActiveTime||e.timeStamp,r.hasFocus=!0,o.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),o.addEventListener("mouseleave",function(){r.hasMouse=!1,r.hasFocus||(delete r.lastActiveTime,o.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),o.addEventListener("focusout",function(e){e.relatedTarget instanceof Node&&o.contains(e.relatedTarget)||(r.hasFocus=!1,r.hasMouse||(delete r.lastActiveTime,o.classList.remove("in-use"),i.classList.add("hidden-accessible-element")))}),i.addEventListener("keydown",function(e){"Escape"!==e.key&&"Esc"!==e.key||(e.stopPropagation(),n.focus(),o.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),t&&he.InvertOrderPositions.includes(t.position)?(o.appendChild(i),o.appendChild(n),o.appendChild(e),B(e,n)):(o.appendChild(n),o.appendChild(e),B(e,n),o.appendChild(i)),o},he.prototype.constructRotationGrid=function(e,t){var r=document.createElement("div");r.classList.add("sub-container"),r.classList.add("hidden-accessible-element");var o=this.constructRightRotationButton(e),n=this.constructLeftRotationButton(e),i=z("Rotate Left"),e=z("Rotate Right");return t&&he.InvertOrderPositions.includes(t.position)?(r.appendChild(o),r.appendChild(e),B(e,o),r.appendChild(n),r.appendChild(i),B(i,n)):(r.appendChild(n),r.appendChild(i),B(i,n),r.appendChild(o),r.appendChild(e),B(e,o)),r},he.prototype.constructRotationButton=function(t){var r=this,e=document.createElement("button");e.classList.add("azure-maps-control-button"),e.classList.add("rotation"),e.setAttribute("aria-label","Reset to Default Rotation"),e.setAttribute("alt","Reset to Default Rotation"),e.setAttribute("type","button");var o=document.createElement("div");return e.appendChild(o),e.addEventListener("click",function(e){e.timeStamp-r.lastActiveTime>re.activateClickDelay&&t.setCamera({bearing:he.DefaultRotation},!0)}),t.events.add("rotate",function(e){o.style.transform="rotate("+-e.map.getCamera().bearing+"deg)"}),e},he.prototype.constructRightRotationButton=function(e){var t=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("rotation-right"),r.setAttribute("aria-label","Rotate Right"),r.setAttribute("alt","Rotate Right"),r.setAttribute("type","button"),r.addEventListener("click",function(){e.setCamera({bearing:e.getCamera().bearing-(t.options.inverted?-1:1)*t.options.rotationDegreesDelta,duration:he.RotationDuration,type:"ease"},!0)}),r},he.prototype.constructLeftRotationButton=function(e){var t=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("rotation-left"),r.setAttribute("aria-label","Rotate Left"),r.setAttribute("alt","Rotate Left"),r.setAttribute("type","button"),r.addEventListener("click",function(){e.setCamera({bearing:e.getCamera().bearing+(t.options.inverted?-1:1)*t.options.rotationDegreesDelta,duration:he.RotationDuration,type:"ease"},!0)}),r},he.DefaultRotation=0,he.RotationDuration=100,he.InvertOrderPositions=[c.ControlPosition.BottomRight,c.ControlPosition.TopRight],he);function he(e){var t=ue.call(this)||this;return t.hasMouse=!1,t.hasFocus=!1,t.options=(new se).merge(e),t}var pe,de,fe=((window&&window.__extends||(pe=function(e,t){return(pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}pe(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ge,de=k),ge);function ge(){var e=null!==de&&de.apply(this,arguments)||this;return e.pitchDegreesDelta=10,e.style=c.ControlStyle.light,e.inverted=!1,e}var ye,me,ve=((window&&window.__extends||(ye=function(e,t){return(ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ye(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(_e,me=re),_e.prototype.onAdd=function(e,t){var r=this,o=this.buildContainer(e,this.options.style,"Pitch Control"),n=this.constructPitchButton(e),i=this.constructPitchGrid(e,t),s=z("Reset to Default Pitch");return o.addEventListener("mouseover",function(e){r.lastActiveTime=r.lastActiveTime||e.timeStamp,r.hasMouse=!0,o.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),o.addEventListener("focusin",function(e){r.lastActiveTime=r.lastActiveTime||e.timeStamp,r.hasFocus=!0,o.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),o.addEventListener("mouseleave",function(){r.hasMouse=!1,r.hasFocus||(delete r.lastActiveTime,o.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),o.addEventListener("focusout",function(e){e.relatedTarget instanceof Node&&o.contains(e.relatedTarget)||(r.hasFocus=!1,r.hasMouse||(delete r.lastActiveTime,o.classList.remove("in-use"),i.classList.add("hidden-accessible-element")))}),i.addEventListener("keydown",function(e){"Escape"!==e.key&&"Esc"!==e.key||(e.stopPropagation(),n.focus(),o.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),t&&_e.INVERT_ORDER_POSITIONS.includes(t.position)?(o.appendChild(i),o.appendChild(n),o.appendChild(s),B(s,o)):(o.appendChild(n),o.appendChild(s),B(s,o),o.appendChild(i)),this.map=e,this.container=o,this.pitchButton=n,e.events.add("pitch",this.pitchChanged),this.updatePitchButtonsState(),o},_e.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)},_e.prototype.constructPitchGrid=function(e,t){var r=document.createElement("div");r.classList.add("sub-container"),r.classList.add("hidden-accessible-element"),this.pitchIncrementButton=this.constructPitchIncrementButton(e),this.pitchDecrementButton=this.constructPitchDecrementButton(e);var o=z("Increase Pitch"),e=z("Decrease Pitch");return t&&_e.INVERT_ORDER_POSITIONS.includes(t.position)?(r.appendChild(this.pitchDecrementButton),r.appendChild(e),B(e,this.pitchDecrementButton),r.appendChild(this.pitchIncrementButton),r.appendChild(o),B(o,this.pitchIncrementButton)):(r.appendChild(this.pitchIncrementButton),r.appendChild(o),B(o,this.pitchIncrementButton),r.appendChild(this.pitchDecrementButton),r.appendChild(e),B(e,this.pitchDecrementButton)),r},_e.prototype.constructPitchButton=function(e){var t=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("pitch"),r.setAttribute("aria-label","Reset to Default Pitch"),r.setAttribute("alt","Reset to Default Pitch"),r.setAttribute("type","button"),r.addEventListener("click",function(){event.timeStamp-t.lastActiveTime>re.activateClickDelay&&e.setCamera({pitch:_e.DEFAULT_PITCH},!0)}),r},_e.prototype.constructPitchDecrementButton=function(e){var t=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("pitch-down"),r.setAttribute("aria-label","Decrease Pitch"),r.setAttribute("alt","Decrease Pitch"),r.setAttribute("type","button"),r.addEventListener("click",function(){e.setCamera({pitch:e.getCamera().pitch-(t.options.inverted?-1:1)*t.options.pitchDegreesDelta,duration:_e.PITCH_DURATION_MS,type:"ease"},!0)}),r},_e.prototype.constructPitchIncrementButton=function(e){var t=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("pitch-up"),r.setAttribute("aria-label","Increase Pitch"),r.setAttribute("alt","Increase Pitch"),r.setAttribute("type","button"),r.addEventListener("click",function(){e.setCamera({pitch:e.getCamera().pitch+(t.options.inverted?-1:1)*t.options.pitchDegreesDelta,duration:_e.PITCH_DURATION_MS,type:"ease"},!0)}),r},_e.PITCH_DURATION_MS=100,_e.DEFAULT_PITCH=0,_e.INVERT_ORDER_POSITIONS=[c.ControlPosition.BottomRight,c.ControlPosition.TopRight],_e);function _e(e){var r=me.call(this)||this;return r.container=null,r.map=null,r.pitchButton=null,r.pitchIncrementButton=null,r.pitchDecrementButton=null,r.hasMouse=!1,r.hasFocus=!1,r.pitchChanged=function(e){return r.updatePitchButtonsState()},r.updatePitchButtonsState=function(){var e=r.map.getCamera().pitch<=0,t=60<=r.map.getCamera().pitch;r.hasFocus&&r.pitchButton&&(e||t)&&r.pitchButton.focus(),r.options.inverted?(r.pitchIncrementButton&&r.pitchIncrementButton.disabled!=e&&(r.pitchIncrementButton.disabled=e),r.pitchDecrementButton&&r.pitchDecrementButton.disabled!=t&&(r.pitchDecrementButton.disabled=t)):(r.pitchIncrementButton&&r.pitchIncrementButton.disabled!=t&&(r.pitchIncrementButton.disabled=t),r.pitchDecrementButton&&r.pitchDecrementButton.disabled!=e&&(r.pitchDecrementButton.disabled=e))},r.options=(new fe).merge(e),r}var we=function(e,t){return e===t||e!=e&&t!=t};var be=function(e,t){for(var r=e.length;r--;)if(we(e[r][0],t))return r;return-1},Ce=Array.prototype.splice;var Ee=function(e){var t=this.__data__;return!((e=be(t,e))<0)&&(e==t.length-1?t.pop():Ce.call(t,e,1),--this.size,!0)};var Se=function(e){var t=this.__data__;return(e=be(t,e))<0?void 0:t[e][1]};var Te=function(e){return-1<be(this.__data__,e)};var Ie=function(e,t){var r=this.__data__,o=be(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this};function Ae(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}Ae.prototype.clear=function(){this.__data__=[],this.size=0},Ae.prototype.delete=Ee,Ae.prototype.get=Se,Ae.prototype.has=Te,Ae.prototype.set=Ie;var ke=Ae;var Pe=function(){this.__data__=new ke,this.size=0};var Oe=function(e){var t=this.__data__,e=t.delete(e);return this.size=t.size,e};R=function(e){return this.__data__.get(e)};var xe=function(e){return this.__data__.has(e)},K="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Re(e,t){return e(t={exports:{}},t.exports),t.exports}var Me="object"==typeof K&&K&&K.Object===Object&&K,Ne="object"==typeof self&&self&&self.Object===Object&&self,Le=Me||Ne||Function("return this")(),Ee=Le.Symbol,Se=Object.prototype,De=Se.hasOwnProperty,qe=Se.toString,je=Ee?Ee.toStringTag:void 0;var Ue=function(e){var t=De.call(e,je),r=e[je];try{var o=!(e[je]=void 0)}catch(e){}var n=qe.call(e);return o&&(t?e[je]=r:delete e[je]),n},He=Object.prototype.toString;var ze=function(e){return He.call(e)},Be=Ee?Ee.toStringTag:void 0;var Fe=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":(Be&&Be in Object(e)?Ue:ze)(e)};var Ke=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var Ge=function(e){return!!Ke(e)&&("[object Function]"==(e=Fe(e))||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e)},Te=Le["__core-js_shared__"],Ye=(Ie=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||""))?"Symbol(src)_1."+Ie:"";var Ze=function(e){return!!Ye&&Ye in e},We=Function.prototype.toString;var Ve=function(e){if(null!=e){try{return We.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Je=/^\[object .+?Constructor\]$/,K=Function.prototype,Ne=Object.prototype,Se=K.toString,Te=Ne.hasOwnProperty,Qe=RegExp("^"+Se.call(Te).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Xe=function(e){return!(!Ke(e)||Ze(e))&&(Ge(e)?Qe:Je).test(Ve(e))};var $e=function(e,t){return null==e?void 0:e[t]};var et=function(e,t){return t=$e(e,t),Xe(t)?t:void 0},tt=et(Le,"Map"),rt=et(Object,"create");var Ie=function(e){return e=this.has(e)&&delete this.__data__[e],this.size-=e?1:0,e},ot=Object.prototype.hasOwnProperty;var K=function(e){var t=this.__data__;if(rt){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return ot.call(t,e)?t[e]:void 0},nt=Object.prototype.hasOwnProperty;Ne=function(e){var t=this.__data__;return rt?void 0!==t[e]:nt.call(t,e)};Se=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=rt&&void 0===t?"__lodash_hash_undefined__":t,this};function it(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}it.prototype.clear=function(){this.__data__=rt?rt(null):{},this.size=0},it.prototype.delete=Ie,it.prototype.get=K,it.prototype.has=Ne,it.prototype.set=Se;var st=it;Te=function(){this.size=0,this.__data__={hash:new st,map:new(tt||ke),string:new st}};var at=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ct=function(e,t){return e=e.__data__,at(t)?e["string"==typeof t?"string":"hash"]:e.map};Ie=function(e){return e=ct(this,e).delete(e),this.size-=e?1:0,e};K=function(e){return ct(this,e).get(e)};Ne=function(e){return ct(this,e).has(e)};Se=function(e,t){var r=ct(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this};function ut(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}ut.prototype.clear=Te,ut.prototype.delete=Ie,ut.prototype.get=K,ut.prototype.has=Ne,ut.prototype.set=Se;var lt=ut;Ie=function(e,t){var r=this.__data__;if(r instanceof ke){var o=r.__data__;if(!tt||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new lt(o)}return r.set(e,t),this.size=r.size,this};function ht(e){e=this.__data__=new ke(e);this.size=e.size}ht.prototype.clear=Pe,ht.prototype.delete=Oe,ht.prototype.get=R,ht.prototype.has=xe,ht.prototype.set=Ie;var pt=ht;var dt=function(e,t){for(var r=-1,o=null==e?0:e.length;++r<o&&!1!==t(e[r],r,e););return e},ft=function(){try{var e=et(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var gt=function(e,t,r){"__proto__"==t&&ft?ft(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},yt=Object.prototype.hasOwnProperty;var mt=function(e,t,r){var o=e[t];yt.call(e,t)&&we(o,r)&&(void 0!==r||t in e)||gt(e,t,r)};var vt=function(e,t,r,o){var n=!r;r=r||{};for(var i=-1,s=t.length;++i<s;){var a=t[i],c=o?o(r[a],e[a],a,r,e):void 0;void 0===c&&(c=e[a]),(n?gt:mt)(r,a,c)}return r};var _t=function(e,t){for(var r=-1,o=Array(e);++r<e;)o[r]=t(r);return o};var wt=function(e){return null!=e&&"object"==typeof e};var K=function(e){return wt(e)&&"[object Arguments]"==Fe(e)},Ne=Object.prototype,bt=Ne.hasOwnProperty,Ct=Ne.propertyIsEnumerable,Et=K(function(){return arguments}())?K:function(e){return wt(e)&&bt.call(e,"callee")&&!Ct.call(e,"callee")},St=Array.isArray;function Tt(){return!1}var It=Re(function(e,t){var r=t&&!t.nodeType&&t,t=r&&e&&!e.nodeType&&e,r=t&&t.exports===r?Le.Buffer:void 0,r=r?r.isBuffer:void 0;e.exports=r||Tt}),At=/^(?:0|[1-9]\d*)$/;var kt=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&At.test(e))&&-1<e&&e%1==0&&e<t};var Pt=function(e){return"number"==typeof e&&-1<e&&e%1==0&&e<=9007199254740991},Ot={};Ot["[object Float32Array]"]=Ot["[object Float64Array]"]=Ot["[object Int8Array]"]=Ot["[object Int16Array]"]=Ot["[object Int32Array]"]=Ot["[object Uint8Array]"]=Ot["[object Uint8ClampedArray]"]=Ot["[object Uint16Array]"]=Ot["[object Uint32Array]"]=!0,Ot["[object Arguments]"]=Ot["[object Array]"]=Ot["[object ArrayBuffer]"]=Ot["[object Boolean]"]=Ot["[object DataView]"]=Ot["[object Date]"]=Ot["[object Error]"]=Ot["[object Function]"]=Ot["[object Map]"]=Ot["[object Number]"]=Ot["[object Object]"]=Ot["[object RegExp]"]=Ot["[object Set]"]=Ot["[object String]"]=Ot["[object WeakMap]"]=!1;Se=function(e){return wt(e)&&Pt(e.length)&&!!Ot[Fe(e)]};var Pe=function(t){return function(e){return t(e)}},Oe=Re(function(e,t){var t=t&&!t.nodeType&&t,r=t&&e&&!e.nodeType&&e,o=r&&r.exports===t&&Me.process,t=function(){try{var e=r&&r.require&&r.require("util").types;return e?e:o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=t}),R=Oe&&Oe.isTypedArray,xt=R?Pe(R):Se,Rt=Object.prototype.hasOwnProperty;var Mt=function(e,t){var r,o=St(e),n=!o&&Et(e),i=!o&&!n&&It(e),s=!o&&!n&&!i&&xt(e),a=o||n||i||s,c=a?_t(e.length,String):[],u=c.length;for(r in e)!t&&!Rt.call(e,r)||a&&("length"==r||i&&("offset"==r||"parent"==r)||s&&("buffer"==r||"byteLength"==r||"byteOffset"==r)||kt(r,u))||c.push(r);return c},Nt=Object.prototype;var Lt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Nt)};var xe=function(t,r){return function(e){return t(r(e))}},Dt=xe(Object.keys,Object),qt=Object.prototype.hasOwnProperty;var jt=function(e){if(!Lt(e))return Dt(e);var t,r=[];for(t in Object(e))qt.call(e,t)&&"constructor"!=t&&r.push(t);return r};var Ut=function(e){return null!=e&&Pt(e.length)&&!Ge(e)};var Ht=function(e){return(Ut(e)?Mt:jt)(e)};var zt=function(e,t){return e&&vt(t,Ht(t),e)};var Bt=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},Ft=Object.prototype.hasOwnProperty;var Kt=function(e){if(!Ke(e))return Bt(e);var t,r=Lt(e),o=[];for(t in e)("constructor"!=t||!r&&Ft.call(e,t))&&o.push(t);return o};var Gt=function(e){return Ut(e)?Mt(e,!0):Kt(e)};var Yt=function(e,t){return e&&vt(t,Gt(t),e)},Zt=Re(function(e,t){var r=t&&!t.nodeType&&t,t=r&&e&&!e.nodeType&&e,r=t&&t.exports===r?Le.Buffer:void 0,o=r?r.allocUnsafe:void 0;e.exports=function(e,t){return t?e.slice():(t=e.length,t=o?o(t):new e.constructor(t),e.copy(t),t)}});var Wt=function(e,t){var r=-1,o=e.length;for(t=t||Array(o);++r<o;)t[r]=e[r];return t};var Vt=function(e,t){for(var r=-1,o=null==e?0:e.length,n=0,i=[];++r<o;){var s=e[r];t(s,r,e)&&(i[n++]=s)}return i};var Ie=function(){return[]},Jt=Object.prototype.propertyIsEnumerable,Qt=Object.getOwnPropertySymbols,Xt=Qt?function(t){return null==t?[]:(t=Object(t),Vt(Qt(t),function(e){return Jt.call(t,e)}))}:Ie;var $t=function(e,t){return vt(e,Xt(e),t)};var er=function(e,t){for(var r=-1,o=t.length,n=e.length;++r<o;)e[n+r]=t[r];return e},tr=xe(Object.getPrototypeOf,Object),rr=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)er(t,Xt(e)),e=tr(e);return t}:Ie;var or=function(e,t){return vt(e,rr(e),t)};var nr=function(e,t,r){return t=t(e),St(e)?t:er(t,r(e))};var ir=function(e){return nr(e,Ht,Xt)};function sr(e){return nr(e,Gt,rr)}var Ne=et(Le,"DataView"),K=et(Le,"Promise"),R=et(Le,"Set"),Se=et(Le,"WeakMap"),ar="[object Map]",cr="[object Promise]",ur="[object Set]",lr="[object WeakMap]",hr="[object DataView]",pr=Ve(Ne),dr=Ve(tt),fr=Ve(K),gr=Ve(R),yr=Ve(Se),xe=Fe,mr=xe=Ne&&xe(new Ne(new ArrayBuffer(1)))!=hr||tt&&xe(new tt)!=ar||K&&xe(K.resolve())!=cr||R&&xe(new R)!=ur||Se&&xe(new Se)!=lr?function(e){var t=Fe(e),e="[object Object]"==t?e.constructor:void 0,e=e?Ve(e):"";if(e)switch(e){case pr:return hr;case dr:return ar;case fr:return cr;case gr:return ur;case yr:return lr}return t}:xe,vr=Object.prototype.hasOwnProperty;var _r=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&vr.call(e,"index")&&(r.index=e.index,r.input=e.input),r},wr=Le.Uint8Array;var br=function(e){var t=new e.constructor(e.byteLength);return new wr(t).set(new wr(e)),t};var Cr=function(e,t){return t=t?br(e.buffer):e.buffer,new e.constructor(t,e.byteOffset,e.byteLength)},Er=/\w*$/;var Sr=function(e){var t=new e.constructor(e.source,Er.exec(e));return t.lastIndex=e.lastIndex,t},Ie=Ee?Ee.prototype:void 0,Tr=Ie?Ie.valueOf:void 0;var Ir=function(e){return Tr?Object(Tr.call(e)):{}};var Ar=function(e,t){return t=t?br(e.buffer):e.buffer,new e.constructor(t,e.byteOffset,e.length)};var kr=function(e,t,r){var o=e.constructor;switch(t){case"[object ArrayBuffer]":return br(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return Cr(e,r);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 Ar(e,r);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return Sr(e);case"[object Set]":return new o;case"[object Symbol]":return Ir(e)}},Pr=Object.create;function Or(){}var xr=function(e){if(!Ke(e))return{};if(Pr)return Pr(e);Or.prototype=e;e=new Or;return Or.prototype=void 0,e};var Rr=function(e){return"function"!=typeof e.constructor||Lt(e)?{}:xr(tr(e))};var Ne=function(e){return wt(e)&&"[object Map]"==mr(e)},K=Oe&&Oe.isMap,Mr=K?Pe(K):Ne;var R=function(e){return wt(e)&&"[object Set]"==mr(e)},Se=Oe&&Oe.isSet,Nr=Se?Pe(Se):R,Lr="[object Arguments]",Dr="[object Function]",qr="[object Object]",jr={};jr[Lr]=jr["[object Array]"]=jr["[object ArrayBuffer]"]=jr["[object DataView]"]=jr["[object Boolean]"]=jr["[object Date]"]=jr["[object Float32Array]"]=jr["[object Float64Array]"]=jr["[object Int8Array]"]=jr["[object Int16Array]"]=jr["[object Int32Array]"]=jr["[object Map]"]=jr["[object Number]"]=jr[qr]=jr["[object RegExp]"]=jr["[object Set]"]=jr["[object String]"]=jr["[object Symbol]"]=jr["[object Uint8Array]"]=jr["[object Uint8ClampedArray]"]=jr["[object Uint16Array]"]=jr["[object Uint32Array]"]=!0,jr["[object Error]"]=jr[Dr]=jr["[object WeakMap]"]=!1;var Ur=function r(o,n,i,e,t,s){var a,c=1&n,u=2&n,l=4&n;if(void 0!==(a=i?t?i(o,e,t,s):i(o):a))return a;if(!Ke(o))return o;var h=St(o);if(h){if(a=_r(o),!c)return Wt(o,a)}else{var p=mr(o),e=p==Dr||"[object GeneratorFunction]"==p;if(It(o))return Zt(o,c);if(p==qr||p==Lr||e&&!t){if(a=u||e?{}:Rr(o),!c)return u?or(o,Yt(a,o)):$t(o,zt(a,o))}else{if(!jr[p])return t?o:{};a=kr(o,p,c)}}c=(s=s||new pt).get(o);if(c)return c;s.set(o,a),Nr(o)?o.forEach(function(e){a.add(r(e,n,i,e,o,s))}):Mr(o)&&o.forEach(function(e,t){a.set(t,r(e,n,i,t,o,s))});var d=h?void 0:(l?u?sr:ir:u?Gt:Ht)(o);return dt(d||o,function(e,t){d&&(e=o[t=e]),mt(a,t,r(e,n,i,t,o,s))}),a};var Hr=function(e){return Ur(e,5)};var zr=function(e,t,r){(void 0===r||we(e[t],r))&&(void 0!==r||t in e)||gt(e,t,r)};var Br=function(c){return function(e,t,r){for(var o=-1,n=Object(e),i=r(e),s=i.length;s--;){var a=i[c?s:++o];if(!1===t(n[a],a,n))break}return e}}();var Fr=function(e){return wt(e)&&Ut(e)},xe=Function.prototype,Ie=Object.prototype,Kr=xe.toString,Gr=Ie.hasOwnProperty,Yr=Kr.call(Object);var Zr=function(e){return!(!wt(e)||"[object Object]"!=Fe(e))&&(null===(e=tr(e))||"function"==typeof(e=Gr.call(e,"constructor")&&e.constructor)&&e instanceof e&&Kr.call(e)==Yr)};var Wr=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var Vr=function(e){return vt(e,Gt(e))};var Jr=function(e,t,r,o,n,i,s){var a,c,u,l=Wr(e,r),h=Wr(t,r),p=s.get(h);p?zr(e,r,p):((a=void 0===(u=i?i(l,h,r+"",e,t,s):void 0))&&(p=!(c=St(h))&&It(h),t=!c&&!p&&xt(h),u=h,c||p||t?u=St(l)?l:Fr(l)?Wt(l):p?Zt(h,!(a=!1)):t?Ar(h,!(a=!1)):[]:Zr(h)||Et(h)?Et(u=l)?u=Vr(l):Ke(l)&&!Ge(l)||(u=Rr(h)):a=!1),a&&(s.set(h,u),n(u,h,o,i,s),s.delete(h)),zr(e,r,u))};var Qr=function o(n,i,s,a,c){n!==i&&Br(i,function(e,t){var r;c=c||new pt,Ke(e)?Jr(n,i,t,s,o,a,c):(r=a?a(Wr(n,t),e,t+"",n,i,c):void 0,zr(n,t,r=void 0===r?e:r))},Gt)};function Xr(e){return e}var $r=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)},eo=Math.max;var to=function(i,s,a){return s=eo(void 0===s?i.length-1:s,0),function(){for(var e=arguments,t=-1,r=eo(e.length-s,0),o=Array(r);++t<r;)o[t]=e[s+t];for(var t=-1,n=Array(s+1);++t<s;)n[t]=e[t];return n[s]=a(o),$r(i,this,n)}};var ro=function(e){return function(){return e}},oo=Date.now;var no=function(r){var o=0,n=0;return function(){var e=oo(),t=16-(e-n);if(n=e,0<t){if(800<=++o)return arguments[0]}else o=0;return r.apply(void 0,arguments)}}(ft?function(e,t){return ft(e,"toString",{configurable:!0,enumerable:!1,value:ro(t),writable:!0})}:Xr);var io=function(e,t){return no(to(e,t,Xr),e+"")};var so=function(e,t,r){if(!Ke(r))return!1;var o=typeof t;return!!("number"==o?Ut(r)&&kt(t,r.length):"string"==o&&t in r)&&we(r[t],e)};var ao,co,uo=function(a){return io(function(e,t){var r=-1,o=t.length,n=1<o?t[o-1]:void 0,i=2<o?t[2]:void 0,n=3<a.length&&"function"==typeof n?(o--,n):void 0;for(i&&so(t[0],t[1],i)&&(n=o<3?void 0:n,o=1),e=Object(e);++r<o;){var s=t[r];s&&a(e,s,r,n)}return e})}(function(e,t,r){Qr(e,t,r)}),lo=((window&&window.__extends||(ao=function(e,t){return(ao=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ao(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ho,co=k),ho);function ho(){var e=null!==co&&co.apply(this,arguments)||this;return e.layout="icons",e.mapStyles=["road","grayscale_light","grayscale_dark","night","road_shaded_relief"],e.style=c.ControlStyle.light,e.autoSelectionMode=!0,e}var po,fo,K=window&&window.__extends||(po=function(e,t){return(po=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}po(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),go=window&&window.__awaiter||function(e,s,a,c){return new(a=a||Promise)(function(r,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(o,n)}i((c=c.apply(e,s||[])).next())})},yo=window&&window.__generator||function(r,o){var n,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=o.call(r,a)}catch(e){t=[6,e],i=0}finally{n=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},mo=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},Ne=(K(vo,fo=re),vo.prototype.onAdd=function(e,t){var r=this;this.map=e;var o=this.buildContainer(e,this.options.style,"Map Style Control"),n=this.buildStyleOpsGrid();this.styleOpsGrid=n;var i=this.buildCurrStyleBtn(),e=z("Select Style");return n.classList.add(t&&t.position||"top-right"),o.addEventListener("mouseover",function(){r.hasMouse=!0,o.classList.add(vo.Css.inUse),n.classList.remove("hidden-accessible-element")}),o.addEventListener("focusin",function(){r.hasFocus=!0,o.classList.add(vo.Css.inUse),n.classList.remove("hidden-accessible-element")}),o.addEventListener("mouseleave",function(){r.hasMouse=!1,r.hasFocus||(o.classList.remove(vo.Css.inUse),n.classList.add("hidden-accessible-element"))}),o.addEventListener("focusout",function(e){e.target===i&&Array.from(n.children).forEach(function(e){return e.removeAttribute("tabIndex")}),e.relatedTarget instanceof Node&&o.contains(e.relatedTarget)||(r.hasFocus=!1,r.hasMouse||(o.classList.remove(vo.Css.inUse),n.classList.add("hidden-accessible-element")))}),n.addEventListener("keydown",function(e){27===e.keyCode&&(e.stopPropagation(),i.focus(),Array.from(n.children).forEach(function(e){return e.setAttribute("tabIndex","-1")}),o.classList.contains(vo.Css.inUse)&&(o.classList.remove(vo.Css.inUse),n.classList.add("hidden-accessible-element")))}),i.addEventListener("click",function(e){o.classList.contains(vo.Css.inUse)?(o.classList.remove(vo.Css.inUse),n.classList.add("hidden-accessible-element")):(o.classList.add(vo.Css.inUse),n.classList.remove("hidden-accessible-element"),n.firstElementChild&&n.firstElementChild.focus())}),t&&vo.InvertOrderPositions.includes(t.position)?(o.appendChild(n),o.appendChild(i),o.appendChild(e),B(e,i)):(o.appendChild(i),o.appendChild(e),B(e,i),o.appendChild(n)),o},vo.prototype.onRemove=function(){fo.prototype.onRemove.call(this),this.styleOpsGrid=null,this.styleButtons.clear(),this.thumbnailCache.response.clear(),this.thumbnailCache.blob.clear(),this.thumbnailCache.assumedConfiguration=void 0,this.map.events.remove("stylechanged",this.onStyleChange),this.map.events.remove("mapconfigurationchanged",this.onMapConfigurationChange)},vo.prototype.setSelectedStyle=function(r){var t,e,o=this;this.styleIcons.has(r)&&(t=this.currStyleImage,e=this.styleIcons.get(r),t.src!==e&&(t.src=e),Object.entries(this.styleButtons).forEach(function(e){var t=mo(e,2),e=t[0];return t[1].setAttribute("aria-current",e===r?"true":"false")}),this.map.styles.definitions().then(function(e){e=o.mapToFriendlyStyleName(r,e);t.alt!==e&&(t.alt=e),t.parentElement.lastChild instanceof Text&&(t.parentElement.lastChild.textContent=e)}))},vo.prototype.disableStyle=function(e){e=this.styleButtons[e];e&&e.setAttribute("disabled","true")},vo.prototype.enableStyle=function(e){e=this.styleButtons[e];e&&e.removeAttribute("disabled")},vo.prototype.buildSelectStyleBtn=function(r,e,t){var o=this,n=document.createElement("button"),i=this.mapToFriendlyStyleName(r,e);n.setAttribute("aria-label",i),n.setAttribute("type","button");var s=new Image;t.then(function(e){if(o.thumbnailCache.blob.has(e.url))return o.thumbnailCache.blob.get(e.url);var t=e.clone().blob();return o.thumbnailCache.blob.set(e.url,t),t}).then(function(e){e=URL.createObjectURL(e);s.src=e,r===o.map.getStyle().style&&(o.currStyleImage.src=e,o.currStyleImage.alt=i,o.currStyleImage.parentElement.lastChild.nodeType==Node.TEXT_NODE?o.currStyleImage.parentElement.lastChild.textContent=i:o.currStyleImage.parentElement.appendChild(document.createTextNode(i))),o.styleIcons.set(r,e)}),s.setAttribute("aria-hidden","true"),n.appendChild(s),"icons"===this.options.layout?n.classList.add(vo.Css.button):(n.classList.add(vo.Css.listButton),n.classList.add(vo.Css.expanded),n.appendChild(document.createTextNode(i))),n.addEventListener("click",function(){o.hasMouse=!1,o.hasFocus=!1;var e=o.styleButtons[r];e&&!e.hasAttribute("disabled")&&(o._invokeEvent("styleselected",r),o.options.autoSelectionMode&&o.map.setStyle({style:r}),Object.entries(o.styleButtons).forEach(function(e){var t=mo(e,2),e=t[0];return t[1].setAttribute("aria-current",e===r?"true":"false")}))});t=document.createElement("div");return t.classList.add("selected-icon"),n.appendChild(t),n},vo.prototype.buildCurrStyleBtn=function(){var e=document.createElement("button");"icons"==this.options.layout?e.classList.add(vo.Css.button):e.classList.add(vo.Css.listButton),e.classList.add(vo.Css.currentStyle),e.setAttribute("aria-label","Select Style"),e.setAttribute("tabindex","-1"),this.currStyleImage=new Image,e.appendChild(this.currStyleImage);var t=document.createElement("div");return t.classList.add("icon"),e.appendChild(t),e},vo.prototype.buildStyleOpsGrid=function(){var e=this,t=document.createElement("div");return t.classList.add(vo.Css.styleOptions),"icons"===this.options.layout?t.classList.add(this.options.layout):t.classList.add(vo.Css.dropdown),t.setAttribute("aria-label","Style Options"),t.classList.add("hidden-accessible-element"),this.map.styles.definitions().then(function(t){return go(e,void 0,void 0,function(){return yo(this,function(e){return this.onMapConfigurationChange(t),this.map.events.add("stylechanged",this.onStyleChange),[2]})})}),this.map.events.add("mapconfigurationchanged",this.onMapConfigurationChange),t},vo.prototype.populateOpsGridFromDefinitions=function(n){var e,r,i=this;this.styleOpsGrid&&(e=n.configurations,(e=Array.isArray(this.options.mapStyles)?e.filter(function(e){return i.options.mapStyles.includes(e.name.split("_indoor")[0])}):e).forEach(function(e){var t={url:e.thumbnail};e.thumbnail&&i.map.styles._transformStyleRequest(e.thumbnail,t);var r=i.map.getServiceOptions();r.transformRequest&&uo(t,r.transformRequest(t.url,"Thumbnail")),i.thumbnailCache.response.has(t.url)?o=Promise.resolve(i.thumbnailCache.response.get(t.url)):(o=fetch(t.url,{headers:t.headers}),i.thumbnailCache.response.set(t.url,o));var o=i.buildSelectStyleBtn(e.name,n,o);i.styleOpsGrid.appendChild(o),i.styleButtons[e.name]=o,"icons"===i.options.layout&&(e=z(i.mapToFriendlyStyleName(e.name,n)),i.styleOpsGrid.appendChild(e),B(e,o))}),r=this.map.getStyle().style,Object.entries(this.styleButtons).forEach(function(e){var t=mo(e,2),e=t[0];return t[1].setAttribute("aria-current",e===r?"true":"false")}))},vo.InvertOrderPositions=[c.ControlPosition.TopRight,c.ControlPosition.BottomRight],vo.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"},vo);function vo(e){var t=fo.call(this)||this;return t.styleOpsGrid=null,t.hasMouse=!1,t.hasFocus=!1,t.styleButtons=new J,t.styleIcons=new J,t.thumbnailCache={assumedConfiguration:void 0,response:new J,blob:new J},t.onStyleChange=function(){var e;t.options.autoSelectionMode&&(e=t.map.getStyle().style,t.setSelectedStyle(e))},t.onMapConfigurationChange=function(e){t.styleOpsGrid&&(0<t.styleOpsGrid.children.length&&t.thumbnailCache.assumedConfiguration===e||(t.thumbnailCache.assumedConfiguration=e,Array.from(t.styleOpsGrid.children).forEach(function(e){return e.remove()}),t.styleButtons.clear(),t.populateOpsGridFromDefinitions(e)))},t.mapToFriendlyStyleName=function(t,e){e=e.configurations.find(function(e){return e.name===t});return(null==e?void 0:e.displayName)||t},t.options=(new lo).merge(Hr(e)),t}var _o,wo,bo=((window&&window.__extends||(_o=function(e,t){return(_o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}_o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Co,wo=k),Co);function Co(){var e=null!==wo&&wo.apply(this,arguments)||this;return e.flow="none",e.incidents=!1,e}var Eo,So,To=((window&&window.__extends||(Eo=function(e,t){return(Eo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Eo(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Io,So=bo),Io);function Io(){var e=null!==So&&So.apply(this,arguments)||this;return e.isActive=!1,e.style=c.ControlStyle.light,e}var Ao,ko,Po=((window&&window.__extends||(Ao=function(e,t){return(Ao=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ao(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Oo,ko=re),Object.defineProperty(Oo.prototype,"isActive",{get:function(){if(!this.map)return!1;var e=this.map.getTraffic();return"none"!==e.flow||e.incidents},set:function(e){this.map&&this.map.setTraffic({flow:e?this.options.flow:"none",incidents:!!e&&this.options.incidents})},enumerable:!1,configurable:!0}),Oo.prototype.onAdd=function(e){(this.map=e).getTraffic();void 0!==this.initIsActive&&(this.isActive=this.initIsActive),this.container=this.buildContainer(e,this.style,"Traffic Control"),this.container.style.flexDirection="column";var t=this.constructTrafficButton(e);this.container.appendChild(t);e=z("Toggle Traffic Display");return this.container.appendChild(e),B(e,t),this.container},Oo.prototype.onRemove=function(){ko.prototype.onRemove.call(this),this.map=null},Oo.prototype.getOptions=function(){return(new To).merge({isActive:this.isActive,flow:this.options.flow,incidents:this.options.incidents,style:this.style})},Oo.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"))},Oo.prototype.constructTrafficButton=function(e){var t=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("traffic"),r.setAttribute("aria-label","Toggle Traffic Display"),r.setAttribute("alt","Toggle Traffic Display"),r.setAttribute("type","button"),this.trafficButton=r,this.updateButtonState(),r.addEventListener("click",function(){t.isActive=!t.isActive}),r},Oo);function Oo(e){var t,r=ko.call(this)||this;return r.hasMouse=!1,r.hasFocus=!1,r.options=(new bo).merge({flow:"relative",incidents:!0}),r.style=c.ControlStyle.light,r.container=null,r.trafficButton=null,r.map=null,e&&(r.initIsActive=null!==(t=e.isActive)&&void 0!==t&&t,r.options.flow=e.flow||"relative",r.options.incidents=null===(t=e.incidents)||void 0===t||t,r.style=e.style||c.ControlStyle.light),r}var xo,Ro,Oe=window&&window.__extends||(xo=function(e,t){return(xo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}xo(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Mo=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Pe=(Oe(No,Ro=re),No.prototype.onAdd=function(e){this.map=e;var t=this.buildContainer(e,c.ControlStyle.auto,"Traffic Legend"),e=this.buildTrafficLegendDiv(e);return t.setAttribute("role","definition"),t.appendChild(e),t},No.prototype.onRemove=function(){Ro.prototype.onRemove.call(this),this.syncHiddenState&&(this.map.events.remove("styledata",this.syncHiddenState),this.syncHiddenState=null),this.map=null},No.prototype.buildTrafficLegendDiv=function(t){var r,e,o,n,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 u=z("Traffic");c.classList.add("traffic-legend-title"),c.colSpan=6,a.appendChild(c),a.appendChild(u),B(u,c),s.appendChild(a);var l=document.createElement("tr");try{for(var h=Mo(this.table),p=h.next();!p.done;p=h.next()){var d=p.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 g=(o=void 0,Mo(d)),y=g.next();!y.done;y=g.next()){var m=y.value,v=document.createElement("div");v.classList.add(m),f.appendChild(v)}}catch(e){o={error:e}}finally{try{y&&!y.done&&(n=g.return)&&n.call(g)}finally{if(o)throw o.error}}}l.appendChild(f);var _=z(d instanceof Array?"Traffic Legend":d);l.appendChild(_),B(_,f)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(e=h.return)&&e.call(h)}finally{if(r)throw r.error}}return s.appendChild(l),i.appendChild(s),this.syncHiddenState=function(e){"style"===e.dataType&&((e=t.getTraffic()).flow&&"none"!==e.flow?i.classList.remove("hidden"):i.classList.add("hidden"))},this.syncHiddenState({dataType:"style"}),t.events.add("styledata",this.syncHiddenState),i},No);function No(){var e=Ro.call(this)||this;return e.table=["Fast",["green","yellow","red","dark-red"],"Slow"],e.map=null,e.syncHiddenState=null,e}Se=function(e){return this.__data__.has(e)};function Lo(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new lt;++t<r;)this.add(e[t])}Lo.prototype.add=Lo.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Lo.prototype.has=Se;var Do=Lo;var qo=function(e,t){for(var r=-1,o=null==e?0:e.length;++r<o;)if(t(e[r],r,e))return!0;return!1};var jo=function(e,t){return e.has(t)};var Uo=function(e,t,r,o,n,i){var s=1&r,a=e.length,c=t.length;if(a!=c&&!(s&&a<c))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var l=-1,h=!0,p=2&r?new Do:void 0;for(i.set(e,t),i.set(t,e);++l<a;){var d,f=e[l],g=t[l];if(void 0!==(d=o?s?o(g,f,l,t,e,i):o(f,g,l,e,t,i):d)){if(d)continue;h=!1;break}if(p){if(!qo(t,function(e,t){if(!jo(p,t)&&(f===e||n(f,e,r,o,i)))return p.push(t)})){h=!1;break}}else if(f!==g&&!n(f,g,r,o,i)){h=!1;break}}return i.delete(e),i.delete(t),h};function Ho(e){var r=-1,o=Array(e.size);return e.forEach(function(e,t){o[++r]=[t,e]}),o}function zo(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var R=Ee?Ee.prototype:void 0,Bo=R?R.valueOf:void 0;var Fo=function(e,t,r,o,n,i,s){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return e.byteLength==t.byteLength&&i(new wr(e),new wr(t))?!0:!1;case"[object Boolean]":case"[object Date]":case"[object Number]":return we(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=Ho;case"[object Set]":a=a||zo;if(e.size!=t.size&&!(1&o))return!1;var c=s.get(e);if(c)return c==t;o|=2,s.set(e,t);a=Uo(a(e),a(t),o,n,i,s);return s.delete(e),a;case"[object Symbol]":if(Bo)return Bo.call(e)==Bo.call(t)}return!1},Ko=Object.prototype.hasOwnProperty;var Go=function(e,t,r,o,n,i){var s=1&r,a=ir(e),c=a.length;if(c!=ir(t).length&&!s)return!1;for(var u=c;u--;){var l=a[u];if(!(s?l in t:Ko.call(t,l)))return!1}var h=i.get(e),p=i.get(t);if(h&&p)return h==t&&p==e;var d=!0;i.set(e,t),i.set(t,e);for(var f=s;++u<c;){var g,y=e[l=a[u]],m=t[l];if(!(void 0===(g=o?s?o(m,y,l,t,e,i):o(y,m,l,e,t,i):g)?y===m||n(y,m,r,o,i):g)){d=!1;break}f=f||"constructor"==l}return!d||f||(h=e.constructor)!=(p=t.constructor)&&"constructor"in e&&"constructor"in t&&!("function"==typeof h&&h instanceof h&&"function"==typeof p&&p instanceof p)&&(d=!1),i.delete(e),i.delete(t),d},Yo="[object Arguments]",Zo="[object Array]",Wo="[object Object]",Vo=Object.prototype.hasOwnProperty;var Jo=function(e,t,r,o,n,i){var s=St(e),a=St(t),c=s?Zo:mr(e),u=a?Zo:mr(t),l=(c=c==Yo?Wo:c)==Wo,a=(u=u==Yo?Wo:u)==Wo;if((u=c==u)&&It(e)){if(!It(t))return!1;l=!(s=!0)}if(u&&!l)return i=i||new pt,s||xt(e)?Uo(e,t,r,o,n,i):Fo(e,t,c,r,o,n,i);if(!(1&r)){l=l&&Vo.call(e,"__wrapped__"),a=a&&Vo.call(t,"__wrapped__");if(l||a)return n(l?e.value():e,a?t.value():t,r,o,i=i||new pt)}return!!u&&(i=i||new pt,Go(e,t,r,o,n,i))};var Qo=function e(t,r,o,n,i){return t===r||(null==t||null==r||!wt(t)&&!wt(r)?t!=t&&r!=r:Jo(t,r,o,n,e,i))};var Xo,$o=function(e,t){return Qo(e,t)},en=(Xo=Object.freeze({__proto__:null,default:{}}))&&Xo.default||Xo,tn=Re(function(a){!function(){for(var t,r,o=0,n=[],e=0;e<256;e++)n[e]=(e+256).toString(16).substr(1);function i(){var e,e=(e=16,(!t||s.BUFFER_SIZE<o+e)&&(o=0,t=s.randomBytes(s.BUFFER_SIZE)),t.slice(o,o+=e));return e[6]=15&e[6]|64,e[8]=63&e[8]|128,e}function s(){var e=i();return n[e[0]]+n[e[1]]+n[e[2]]+n[e[3]]+"-"+n[e[4]]+n[e[5]]+"-"+n[e[6]]+n[e[7]]+"-"+n[e[8]]+n[e[9]]+"-"+n[e[10]]+n[e[11]]+n[e[12]]+n[e[13]]+n[e[14]]+n[e[15]]}s.BUFFER_SIZE=4096,s.bin=i,s.clearBuffer=function(){t=null,o=0},s.test=function(e){return"string"==typeof e&&/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},"undefined"!=typeof crypto?r=crypto:"undefined"!=typeof window&&void 0!==window.msCrypto&&(r=window.msCrypto),r=r||en,(a.exports=s).randomBytes=function(){if(r){if(r.randomBytes)return r.randomBytes;if(r.getRandomValues)return"function"!=typeof Uint8Array.prototype.slice?function(e){e=new Uint8Array(e);return r.getRandomValues(e),Array.from(e)}:function(e){e=new Uint8Array(e);return r.getRandomValues(e),e}}return function(e){for(var t=[],r=0;r<e;r++)t.push(Math.floor(256*Math.random()));return t}}()}()}),rn=(on.TYPE="Feature",on);function on(e,t,r,o){this.type="Feature",this.type=on.TYPE,this.properties=t||{},this.id=r,this.geometry=e,this.bbox=o}var nn,sn,xe=window&&window.__extends||(nn=function(e,t){return(nn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}nn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),an=(sn=Array,xe(cn,sn),cn.fromData=function(r){var o=NaN,n=NaN,i=new Set(["y"]),s=new Set(["x"]);return Object.keys(r).forEach(function(e){var t=e.toLowerCase();isNaN(o)&&i.has(t)&&"number"==typeof r[e]?o=r[e]:isNaN(n)&&s.has(t)&&"number"==typeof r[e]&&(n=r[e])}),isNaN(o)||isNaN(n)?null:new cn(o,n)},cn.getX=function(e){return 0<e.length?e[0]:NaN},cn.getY=function(e){return 1<e.length?e[1]:NaN},cn.getDestination=function(e,t,r){return new cn(cn.getX(e)+r*Math.cos((t+270)*Math.PI/180),cn.getY(e)+r*Math.sin((t+270)*Math.PI/180))},cn.getDistance=function(e,t){var r=cn.getX(e)-cn.getX(t),t=cn.getY(e)-cn.getY(t);return Math.sqrt(r*r+t*t)},cn.getHeading=function(e,t){var r=cn.getX(t)-cn.getX(e),t=cn.getY(e)-cn.getY(t);return 180*(2.5*Math.PI-Math.atan2(t,r))/Math.PI%360},cn);function cn(e,t){return sn.call(this,e,t)||this}var un=(ln.TYPE="Point",ln);function ln(e){this.type="Point",this.type=ln.TYPE,this.coordinates=e}var hn,pn,dn,fn,gn,yn=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},mn=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},vn=6378137,_n=Math.PI/180,wn=180/Math.PI,bn=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9],Cn=85.0511;function En(e){return e*_n}function Sn(e){return e*wn}function Tn(e,t,r){return Math.min(Math.max(e,t),r)}function In(e,t){var r=En(t[1]-e[1]),o=En(t[0]-e[0]),o=Math.pow(Math.sin(r/2),2)+Math.cos(En(e[1]))*Math.cos(En(t[1]))*Math.pow(Math.sin(o/2),2),o=2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o));return Math.round(vn*o*100)/100}function An(e){if(e)switch(e.toLowerCase()){case"feet":case"foot":case"ft":return pn.feet;case"kilometers":case"kilometer":case"kilometres":case"kilometre":case"km":case"kms":return pn.kilometers;case"miles":case"mile":case"mi":return pn.miles;case"nauticalmiles":case"nauticalmile":case"nms":case"nm":return pn.nauticalMiles;case"yards":case"yard":case"yds":case"yrd":case"yrds":return pn.yards;default:return pn.meters}return pn.meters}function kn(e){if(e)switch(e.toLowerCase()){case"milespersecondsquared":case"milepersecondsquared":case"mi/s^2":case"mi/s2":return gn.milesPerSecondSquared;case"kilometerspersecondsquared":case"kilometrespersecondsquared":case"kilometerpersecondsquared":case"kilometrepersecondsquared":case"km/s^2":case"km/s2":return gn.kilometersPerSecondSquared;case"knotspersecond":case"knotpersecond":case"knts/s":case"kn/s":case"kt/s":return gn.knotsPerSecond;case"standardgravity":case"g":return gn.standardGravity;case"feetpersecondsquared":case"footpersecondsquared":case"ft/s^2":case"ft/s2":return gn.feetPerSecondSquared;case"yardspersecondsquared":case"yardpersecondsquared":case"yds/s^2":case"yds/s2":case"yd/s^2":case"yd/s2":return gn.yardsPerSecondSquared;case"milesperhoursecond":case"mileperhoursecond":case"milesperhourseconds":case"mileperhourseconds":case"mi/h/s":return gn.milesPerHourSecond;case"kilometersperhoursecond":case"kilometrespersoursecond":case"kilometerperhoursecond":case"kilometrepersoursecond":case"kilometersperhourssecond":case"kilometrespersourssecond":case"kilometerperhourssecond":case"kilometrepersourssecond":case"kmhs":case"km/h/s":return gn.kilometersPerHourSecond;default:return gn.metersPerSecondSquared}return gn.metersPerSecondSquared}function Pn(e){if(e)switch(e){case"acres":case"ac":return hn.acres;case"hectares":case"ha":return hn.hectares;case"squareFeet":case"ft^2":case"ft2":return hn.squareFeet;case"squareYards":case"squareYard":case"yds^2":case"yds2":case"yd^2":case"yd2":return hn.squareYards;case"squareKilometers":case"squareKilometres":case"squareKilometer":case"squareKilometre":case"km^2":case"km2":return hn.squareKilometers;case"squareMiles":case"squareMile":case"mi^2":case"mi2":return hn.squareMiles;default:return hn.squareMeters}return hn.squareMeters}function On(e){if(e)switch(e.toLowerCase()){case"feetpersecond":case"footsecond":case"ftps":case"ft/s":return fn.feetPerSecond;case"milesperhour":case"mileperhour":case"mph":case"mi/hr":case"mi/h":return fn.milesPerHour;case"knots":case"knot":case"knts":case"knt":case"kn":case"kt":return fn.knots;case"mach":case"m":return fn.mach;case"kilometersperhour":case"kilometresperhour":case"kmperhour":case"kmph":case"km/hr":case"km/h":return fn.kilometersPerHour;default:return fn.metersPerSecond}return fn.metersPerSecond}function xn(e){if(e)switch(e.toLowerCase()){case"milliseconds":case"ms":return dn.ms;case"minutes":case"minute":case"mins":case"min":return dn.minutes;case"hours":case"hour":case"hr":case"h":return dn.hours;case"days":case"day":case"d":return dn.days;default:return dn.seconds}return dn.seconds}function Rn(e){var t=0;if(e&&0<e.length)for(var t=Math.abs(Mn(e[0])),r=1,o=e.length;r<o;r++)t-=Math.abs(Mn(e[r]));return t}function Mn(e){var t=0;if(3<=e.length){for(var r=void 0,o=void 0,n=0,i=e.length;n<i;n++)t+=(En(e[n===i-2?(r=i-2,o=i-1,0):n===i-1?(r=i-1,o=0,1):(o=(r=n)+1,n+2)][0])-En(e[r][0]))*Math.sin(En(e[o][1]));t=t*vn*vn/2}return t}function Nn(e,t,r){return(e[0]-r[0])*(t[1]-r[1])-(e[1]-r[1])*(t[0]-r[0])}function Ln(e,t,r){if(2<=r.length){for(var o,n,i=1/0,s=null,a=ei(r,22),c=0,u=a.length-1;c<u;c++)n=function(e,t,r){if(t[0]===r[0]&&t[1]===r[1])return t;var o=e[0]-t[0],n=e[1]-t[1],i=r[0]-t[0],e=r[1]-t[1],n=(i*o+e*n)/(i*i+e*e);return n<0?t:1<n?r:[t[0]+i*n,t[1]+e*n]}(t,a[c],a[c+1]),(o=an.getDistance(t,n))<i&&(i=o,s=n);if(s){var l=$n([s],22)[0];return new rn(new un(l),{distance:Un(e,l)})}}else if(1===r.length)return new rn(new un(r[0]),{distance:Un(e,r[0])});return null}function Dn(e,t){var r;return!isNaN(e)&&"number"==typeof t&&0<=t&&(r=void 0,r=t<bn.length?bn[t]:Math.pow(10,t),e=Math.round(e*r)/r),e}function qn(e,t,r,o){switch(An(t)){case pn.meters:e/=1e3;break;case pn.feet:e/=3280.8399;break;case pn.miles:e/=.62137119;break;case pn.yards:e/=1093.6133;break;case pn.nauticalMiles:e/=.5399568;break;case pn.kilometers:}switch(An(r)){case pn.meters:e*=1e3;break;case pn.feet:e*=3280.8399;break;case pn.miles:e*=.62137119;break;case pn.yards:e*=1093.6133;break;case pn.nauticalMiles:e*=.5399568;break;case pn.kilometers:}return"number"==typeof o&&0<=o&&(o=Math.pow(10,o),e=Math.round(e*o)/o),e}function jn(e,t,r,o){o=o||"meters",e=li(e);var n=Hn(o),o=En(e[1]),e=En(e[0]),t=t*_n,r=r/n,n=Math.asin(Math.sin(o)*Math.cos(r)+Math.cos(o)*Math.sin(r)*Math.cos(t)),o=e+Math.atan2(Math.sin(t)*Math.sin(r)*Math.cos(o),Math.cos(r)-Math.sin(o)*Math.sin(n)),n=Tn(Jn(n*wn),-85,85);return[Qn(o*wn),n]}function Un(e,t,r){t=In(e=li(e),t=li(t));return"meters"===r?t:qn(t,"meters",r||"meters")}function Hn(e){e=An(e);return qn(vn,pn.meters,e)}function zn(e,t,r){for(var o=[],n=En(e[1]),i=En(e[0]),s=En(t[1]),a=En(t[0]),c=2*Math.asin(Math.sqrt(Math.pow(Math.sin((n-s)/2),2)+Math.cos(n)*Math.cos(s)*Math.pow(Math.sin((i-a)/2),2))),u=0;u<=r;u++){var l=u/r,h=Math.sin((1-l)*c)/Math.sin(c),p=Math.sin(l*c)/Math.sin(c),d=h*Math.cos(n)*Math.cos(i)+p*Math.cos(s)*Math.cos(a),l=h*Math.cos(n)*Math.sin(i)+p*Math.cos(s)*Math.sin(a),p=h*Math.sin(n)+p*Math.sin(s),p=Math.atan2(p,Math.sqrt(Math.pow(d,2)+Math.pow(l,2))),d=Math.atan2(l,d),p=Tn(p*wn,-85,85);d*=wn,o.push([d,p])}return o}function Bn(e){return(Array.isArray(e)?e:e.coordinates).reduce(function(e,t){var r=0<e.length?e[e.length-1]:null;return r&&180<Math.abs(t[0]-r[0])?(r=r[0]<0?t[0]-360:t[0]+360,e.push([r,t[1]])):e.push(t),e},[])}function Fn(e){for(var t,r,o,n,i,s=Array.isArray(e)?e:e.coordinates,a=[],c=[],u=0;u<s.length;u++)a.push(s[u]),u+1>=s.length||(t=(o=yn(s[u],2))[0],r=o[1],i=(n=yn(s[u+1],2))[0],o=n[1],180<Math.abs(i-t)&&(n=0<t?180:-180,i=Math.abs((0<t?i+360:i-360)-t),i=r+(o-r)*(Math.abs(n-t)/i),a.push([n,i]),c.push(a),a=[[-n,i]]));return c.push(a),c}function Kn(e,t){if(e=li(e),t=li(t),e&&2<=e.length&&t&&2<=t.length){var r=En(e[1]),o=En(t[1]),t=En(t[0]-e[0]),e=Math.sin(t)*Math.cos(o),t=Math.cos(r)*Math.sin(o)-Math.sin(r)*Math.cos(o)*Math.cos(t);return(Sn(Math.atan2(e,t))+360)%360}return NaN}function Gn(e,t){var r,o=0;Array.isArray(e)?r=e:e.type&&"LineString"===e.type&&(r=e.coordinates);for(var n=0,i=r.length-1;n<i;n++)o+=In(r[n],r[n+1]);return qn(o,"meters",t||"meters")}function Yn(e,t,r){r=r||"meters";var o,n,i=0;if(Array.isArray(e)?n=e:e.type&&"LineString"===e.type&&(n=e.coordinates),2<=n.length){for(var s=n.length,a=1;a<s;a++){if(t<=i+(o=Un(n[a-1],n[a],r))){var c=Kn(n[a-1],n[a]);return jn(n[a-1],c,t-i,r)}i+=o}return i<=t?n[s-1]:n[0]}return null}function Zn(e,t,r,o,n){o=o||"meters",n=n||0,e=li(e);for(var i=[],s=360/r,a=0;a<=r;a++)i.push(jn(e,(a*s+n)%360,t,o));return i}function Wn(e,t,r,o,n){return Bn(Zn(e,t,r,o,n))}function Vn(e,t,r){r=void 0===r?.5:r;var o=Un(e=li(e),t=li(t),"kilometers");return jn(e,Kn(e,t),o*r,"kilometers")}function Jn(e){return 90<e?180<(e=(e+90)%360)?90-(e-180):e-90:e<-90?(e=(e-90)%360)<-180?-90-(e+180):e+90:e}function Qn(e){return 180<e?(e+180)%360-180:e<-180?(e-180)%360+180:e}function Xn(e,t,r){if(0===r)return Object.assign({},e);t=li(t);for(var o,n,i=[],s=0,a=e.length;s<a;s++)o=Un(t,e[s]),n=Kn(t,e[s]),i.push(jn(t,n+r,o));return i}function $n(e,t){for(var r,o,n=512*Math.pow(2,t),i=[],s=0,a=e.length;s<a;s++)r=e[s][0]/n-.5,o=.5-e[s][1]/n,i.push([360*r,90-360*Math.atan(Math.exp(2*-o*Math.PI))/Math.PI]);return i}function ei(e,t){for(var r,o,n=512*Math.pow(2,t),i=[],s=0,a=e.length;s<a;s++)o=Math.sin(e[s][1]*Math.PI/180),r=(e[s][0]+180)/360,o=.5-Math.log((1+o)/(1-o))/(4*Math.PI),i.push([Math.round(r*n),Math.round(o*n)]);return i}function ti(e,t,r,o){switch(kn(t)){case gn.kilometersPerHourSecond:e/=3.6;break;case gn.milesPerHourSecond:e/=2.236936292054;break;case gn.knotsPerSecond:e/=1.943844492441;break;case gn.standardGravity:e/=.1019716212978;break;case gn.kilometersPerSecondSquared:e/=.001;break;case gn.milesPerSecondSquared:e/=.000621371192;break;case gn.feetPerSecondSquared:e/=3.280839895012;break;case gn.yardsPerSecondSquared:e/=1.093613298338;break;case gn.metersPerSecondSquared:}switch(kn(r)){case gn.kilometersPerHourSecond:e*=3.6;break;case gn.milesPerHourSecond:e*=2.236936292054;break;case gn.knotsPerSecond:e*=1.943844492441;break;case gn.standardGravity:e*=.1019716212978;break;case gn.kilometersPerSecondSquared:e*=.001;break;case gn.milesPerSecondSquared:e*=.000621371192;break;case gn.feetPerSecondSquared:e*=3.280839895012;break;case gn.yardsPerSecondSquared:e*=1.093613298338;break;case gn.metersPerSecondSquared:}return Dn(e,o)}function ri(e,t,r,o){switch(Pn(t)){case hn.acres:e*=4046.8564224;break;case hn.hectares:e*=1e4;break;case hn.squareFeet:e*=.09290304;break;case hn.squareKilometers:e*=1e6;break;case hn.squareMiles:e*=259e4;break;case hn.squareYards:e*=.83612736;break;case hn.squareMeters:}switch(Pn(r)){case hn.acres:e/=4046.8564224;break;case hn.hectares:e/=1e4;break;case hn.squareFeet:e/=.09290304;break;case hn.squareKilometers:e/=1e6;break;case hn.squareMiles:e/=259e4;break;case hn.squareYards:e/=.83612736;break;case hn.squareMeters:}return Dn(e,o)}function oi(e,t,r,o){switch(On(t)){case fn.feetPerSecond:e*=1.09728;break;case fn.milesPerHour:e*=1.6093;break;case fn.knots:e*=1.852;break;case fn.metersPerSecond:e*=3.6;break;case fn.mach:e*=1234.8;break;case fn.kilometersPerHour:}switch(On(r)){case fn.feetPerSecond:e/=1.09728;break;case fn.milesPerHour:e/=1.6093;break;case fn.knots:e/=1.852;break;case fn.metersPerSecond:e/=3.6;break;case fn.mach:e/=1234.8;break;case fn.kilometersPerHour:}return Dn(e,o)}function ni(e,t,r,o){switch(xn(t)){case dn.ms:e/=1e3;break;case dn.hours:e*=3600;break;case dn.minutes:e*=60;break;case dn.days:e*=86400;break;case dn.seconds:}switch(xn(r)){case dn.ms:e*=1e3;break;case dn.hours:e/=3600;break;case dn.minutes:e/=60;break;case dn.days:e/=86400;break;case dn.seconds:}return Dn(e,o)}function ii(e,t,r,o,n,i,s,a){n=qn(t,n,pn.meters),i=ni(r,i,dn.seconds);return ti(2*(n-oi(e,o,fn.metersPerSecond)*i)/(i*i),gn.metersPerSecondSquared,s,a)}function si(e,t,r,o,n,i,s){e=oi(e,o,fn.metersPerSecond);return ti((oi(t,o,fn.metersPerSecond)-e)/ni(r,n,dn.seconds),gn.metersPerSecondSquared,i,s)}function ai(e,t,r,o){e=ci(e),t=ci(t);return null!=e&&null!=t?ni(t.getTime()-e.getTime(),dn.ms,r,o):NaN}function ci(e){if("[object Date]"===Object.prototype.toString.call(e))return e;if("string"==typeof e){var t=Date.parse(e);if(!isNaN(t))return new Date(t);if(0<=e.indexOf("Date(")){t=0,t=0<(e=e.replace("/Date(","").replace(")/","")).indexOf("+")?parseInt(e.substr(0,e.indexOf("+")),10):0<e.indexOf("-")?parseInt(e.substr(0,e.indexOf("-")),10):parseInt(e,10);return new Date(t)}}else if("number"==typeof e)return new Date(e);return null}function ui(e){var t=[],r=null,o=null;if(Array.isArray(e)&&0<e.length)if(Array.isArray(e[0])&&"number"==typeof e[0][0])t=e;else for(var n=e.length,i=0;i<n;i++)t=t.concat(ui(e[i]));else if(e.type)switch(e.type){case"Point":t=[e.coordinates];break;case"LineString":t=e.coordinates;break;case"Polygon":r=e.coordinates;break;case"MultiPoint":t=e.coordinates;break;case"MultiLineString":r=e.coordinates;break;case"MultiPolygon":o=e.coordinates;break;case"Feature":var s=e,t=Ci._isCircle(s)?Ci._getCirclePositions(s):ui(s.geometry);break;case"FeatureCollection":t=ui(e.features);break;case"GeometryCollection":t=ui(e.geometries)}else if(e instanceof Ci)return ui(e.toJson());if(r)for(n=r.length,i=0;i<n;i++)t=t.concat(r[i]);else if(o)for(var a=o.length,i=0;i<a;i++)for(var c=o[i].length,u=0;u<c;u++)t=t.concat(o[i][u]);return t}function li(e){if(Array.isArray(e)&&"number"==typeof e[0])return e;if(e.type){if("Point"===e.type)return e.coordinates;if("Feature"===e.type&&"Point"===e.geometry.type)return e.geometry.coordinates}else if(e instanceof Ci&&"Point"===e.getType())return e.getCoordinates();return null}function hi(e,t,r){r=r||"meters";var o,n,i=0;if(Array.isArray(e)?n=e:e.type&&"LineString"===e.type&&(n=e.coordinates),2<=n.length){for(var s=n.length,a=1;a<s;a++){if(t<=i+(o=Un(n[a-1],n[a],r))){var c=Kn(n[a-1],n[a]),u=jn(n[a-1],c,t-i,r);return new rn(new un(u),{heading:c})}i+=o}return i<=t?new rn(new un(n[s-1]),{heading:Kn(n[s-2],n[s-1])}):new rn(new un(n[0]),{heading:Kn(n[0],n[1])})}return null}function pi(e,t,r,o){var n=li(e),i=ei([n],22)[0],s=null,a=1/0;switch((t=t instanceof Ci?t.toJson():t).type){case"Feature":return pi(e,t.geometry,r);case"Point":d=[[t.coordinates]];break;case"MultiPoint":for(var c,u=t.coordinates,l=0,h=u.length;l<h;l++)(c=Un(n,u[l]))<a&&(a=c,s=new rn(new un(u[l]),{distance:c}));break;case"LineString":d=[t.coordinates];break;case"Polygon":case"MultiLineString":d=t.coordinates;break;case"MultiPolygon":var p=t.coordinates;if(0<p.length)for(var d=p[0],l=1,h=p.length;l<h;l++)d=d.concat(p[l])}if(d)for(var f,l=0,h=d.length;l<h;l++)(f=Ln(n,i,d[l]))&&f.properties.distance<a&&(a=f.properties.distance,s=f);return s&&(s.properties.distance=qn(s.properties.distance,"meters",r,o)),s}(Ie=hn=hn||{}).squareMeters="squareMeters",Ie.acres="acres",Ie.hectares="hectares",Ie.squareFeet="squareFeet",Ie.squareKilometers="squareKilometers",Ie.squareMiles="squareMiles",Ie.squareYards="squareYards",(K=pn=pn||{}).meters="meters",K.kilometers="kilometers",K.feet="feet",K.miles="miles",K.nauticalMiles="nauticalMiles",K.yards="yards",(Oe=dn=dn||{}).seconds="seconds",Oe.hours="hours",Oe.ms="ms",Oe.minutes="minutes",Oe.days="days",(Se=fn=fn||{}).metersPerSecond="metersPerSecond",Se.kilometersPerHour="kilometersPerHour",Se.feetPerSecond="feetPerSecond",Se.milesPerHour="milesPerHour",Se.knots="knots",Se.mach="mach",(Ee=gn=gn||{}).milesPerSecondSquared="milesPerSecondSquared",Ee.kilometersPerSecondSquared="kilometersPerSecondSquared",Ee.knotsPerSecond="knotsPerSecond",Ee.standardGravity="standardGravity",Ee.feetPerSecondSquared="feetPerSecondSquared",Ee.yardsPerSecondSquared="yardsPerSecondSquared",Ee.milesPerHourSecond="milesPerHourSecond",Ee.kilometersPerHourSecond="kilometersPerHourSecond",Ee.metersPerSecondSquared="metersPerSecondSquared";var di,fi,R=window&&window.__extends||(di=function(e,t){return(di=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}di(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),gi=(fi=Array,R(yi,fi),yi.fromPosition=function(e){return 2===e.length?new yi(e[0],e[1]):2<e.length?new yi(e[0],e[1],e[2]):null},yi.areEqual=function(e,t,r){if(void 0===r&&(r=6),e&&2<=e.length&&t&&2<=t.length){var o=Math.pow(10,r),n=Jn(e[1]),r=Jn(t[1]),e=Qn(e[0]),t=Qn(t[0]);if(0!=Math.round((n-r)*o)/o)return!1;o=Math.round((e-t)*o)/o;return 0!=o&&360!=o?!1:!0}return!1},yi.fromLatLng=function(n,e,t){var i,s,a,c,u,l,r=[];return"number"==typeof n?(r.push(n),"number"==typeof e&&r.push(e),"number"==typeof t&&r.push(t)):Array.isArray(n)?2<=n.length&&"number"==typeof n[0]&&"number"==typeof n[1]&&(3<=n.length&&"number"==typeof n[2]?r.push(n[0],n[1],n[2]):r.push(n[0],n[1])):"object"==typeof n&&(i=["lat","latitude","y"],s=["lng","longitude","lon","x"],a=["elv","elevation","alt","altitude","z"],l=u=c=NaN,Object.keys(n).forEach(function(e,t,r){var o=e.toLowerCase();isNaN(c)&&0<=i.indexOf(o)&&"number"==typeof n[e]?c=n[e]:isNaN(u)&&0<=s.indexOf(o)&&"number"==typeof n[e]?u=n[e]:isNaN(l)&&0<=a.indexOf(o)&&"number"==typeof n[e]&&(l=n[e])}),isNaN(c)||isNaN(u)||(r.push(u,c),isNaN(l)||r.push(l))),2<=r.length?r:null},yi.fromLatLngs=function(e){var t=[];if(Array.isArray(e))for(var r=0,o=e.length;r<o;r++){var n=yi.fromLatLng(e[r]);n&&t.push(n)}return t},yi._getDimensions=function(e){for(var t=0;Array.isArray(e);)e=e[0],t++;return"number"==typeof e&&t--,t},yi);function yi(e,t,r){return r?fi.call(this,e,t,r)||this:fi.call(this,e,t)||this}var mi=(vi.TYPE="Polygon",vi);function vi(e,t){this.type="Polygon",this.type=vi.TYPE,1===gi._getDimensions(e)?this.coordinates=[e]:this.coordinates=e,this.bbox=t}var _i,wi,xe=window&&window.__extends||(_i=function(e,t){return(_i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}_i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),bi=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ci=(xe(Ei,wi=Q),Ei.prototype.addProperty=function(e,t){$o(this.data.properties[e],t)||(this.data.properties[e]=Hr(t),"subType"!==e&&"radius"!==e||this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},Ei.prototype.getBounds=function(){var t,e,r,o,n,i=this.getCoordinates(),s=this.getType();if("Point"===s)n=this.circlePolygon?(a=this.circlePolygon.geometry.coordinates,Ai.fromPositions(a[0])):new Ai(a=i,a);else if("MultiPoint"===s||"LineString"===s){var a=i;n=Ai.fromPositions(a)}else if("Polygon"===s){a=i;n=Ai.fromPositions(a[0])}else if("MultiLineString"===s){a=i;try{for(var c=bi(a),u=c.next();!u.done;u=c.next()){var l=u.value;n=Ai.merge(n,Ai.fromPositions(l))}}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=c.return)&&e.call(c)}finally{if(t)throw t.error}}}else if("MultiPolygon"===s){a=i;try{for(var h=bi(a),p=h.next();!p.done;p=h.next()){var d=p.value;n=Ai.merge(n,Ai.fromPositions(d[0]))}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(r)throw r.error}}}return n},Ei.prototype.getCoordinates=function(){return Hr(this.data.geometry.coordinates)},Ei.prototype.getCircleCoordinates=function(){return this.circlePolygon?Hr(this.circlePolygon.geometry.coordinates[0]):null},Ei.prototype.getId=function(){return this.data.id},Ei.prototype.getProperties=function(){return Hr(this.data.properties)},Ei.prototype.getType=function(){return this.data.geometry.type},Ei.prototype.isCircle=function(){return Ei._isCircle(this.data)},Ei.prototype.isRectangle=function(){return Ei._isRectangle(this.data)},Ei.prototype.setCoordinates=function(e){e="Polygon"===this.getType()&&1===gi._getDimensions(e)?[e]:e;$o(this.data.geometry.coordinates,e)||(this.data.geometry.coordinates=Hr(e),this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},Ei.prototype.setProperties=function(e){e[Ei._shapeIdPropName]=this.data.id,$o(this.data.properties,e)||(this.data.properties=Hr(e),this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},Ei.prototype.toJson=function(){return JSON.parse(JSON.stringify(this.data))},Ei.prototype._toJson=function(){return this.circlePolygon||this.data},Ei.prototype._setDataSource=function(e){void 0===e||null==e?delete this.dataSource:this.dataSource=e},Ei.prototype._handleCircle=function(){var e;this.isCircle()?(e=Ei._getCirclePositions(this.data),this.circlePolygon=new rn(new mi([e]),this.data.properties,this.data.id),this.data.properties.subType="Circle"):delete this.circlePolygon},Ei._isCircle=function(e){return e&&e.geometry&&"Point"===e.geometry.type&&e.geometry.coordinates&&e.properties&&"string"==typeof e.properties.subType&&"circle"===e.properties.subType.toLowerCase()&&"number"==typeof e.properties.radius},Ei._isRectangle=function(e){if("Polygon"===e.geometry.type&&e.geometry.coordinates&&"string"==typeof e.properties.subType&&"rectangle"===e.properties.subType.toLowerCase()){e=e.geometry.coordinates;if(1===e.length){e=e[0];if(5===e.length)return e[0][0]===e[4][0]&&e[0][1]===e[4][1];if(4===e.length)return!0}}return!1},Ei._getCirclePositions=function(e){return Wn(e.geometry.coordinates,e.properties.radius,72,"meters")},Ei._shapeIdPropName="_azureMapsShapeId",Ei);function Ei(e,t,r){var o,n,i=wi.call(this)||this;return"Feature"===e.type?(n=Hr((o=e).geometry),r=o.properties?Hr(o.properties):{},t=null==o.id||""===o.id?tn():o.id):(n=Hr(e),t=null==t||""===t?tn():t,r=r?Hr(r):{}),r[Ei._shapeIdPropName]=t,i.data=new rn(n,r,t),i._handleCircle(),i}var Si,Ti,Ie=window&&window.__extends||(Si=function(e,t){return(Si=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Si(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Ii=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ai=(Ti=Array,Ie(ki,Ti),ki.fromBoundingBox=function(e){var t=ki.getWest(e),r=ki.getSouth(e),o=ki.getEast(e),e=ki.getNorth(e);return new ki([t,r,o,e])},ki.fromDimensions=function(e,t,r){var o=e[0],n=e[1],e=Math.min(Math.max(n+r/2,-85.5),85.5),n=Math.min(Math.max(n-r/2,-85.5),85.5),r=Qn(o+t/2);return new ki([Qn(o-t/2),n,r,e])},ki.fromEdges=function(e,t,r,o){return new ki([e,t,r,o])},ki.containsPosition=function(e,t){var r=ki.getCenter(e),o=Math.abs(r[1]-t[1]),r=Math.abs(r[0]-t[0]);180<r&&(r=360-r);t=ki.getHeight(e),e=ki.getWidth(e);return o<=t/2+1e-8&&r<=e/2+1e-8},ki.containsBoundingBox=function(e,t){var r=e&&4===e.length,o=t&&4===t.length;return!(!r||!o)&&(ki.getWest(e)<ki.getWest(t)&&ki.getWest(t)<ki.getEast(e)&&ki.getWest(e)<ki.getEast(t)&&ki.getEast(t)<ki.getEast(e)&&ki.getSouth(e)<ki.getSouth(t)&&ki.getSouth(t)<ki.getNorth(e)&&ki.getSouth(e)<ki.getNorth(t)&&ki.getNorth(t)<ki.getNorth(e))},ki.crossesAntimeridian=function(e){return Qn(ki.getEast(e))-Qn(ki.getWest(e))<0||ki.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe(e)||ki.isBoundingBoxWithLessThanSixElementsLargerThanGlobe(e)},ki.getCenter=function(e){var t=Qn(ki.getEast(e)),r=Qn(ki.getWest(e));t<r&&(t+=360);r=Qn((r+t)/2),t=Jn(ki.getSouth(e)),e=Jn(ki.getNorth(e));return[r,Jn((t+e)/2)]},ki.getHeight=function(e){e=Jn(ki.getNorth(e))-Jn(ki.getSouth(e));return isNaN(e)?0:e},ki.getWidth=function(e){e=Qn(ki.getEast(e))-Qn(ki.getWest(e));return isNaN(e)?0:e<0?e+360:e},ki.getSouthWest=function(e){var t=this.getSouth(e),e=this.getWest(e);return isNaN(t)||isNaN(e)?null:[e,t]},ki.getNorthEast=function(e){var t=this.getNorth(e),e=this.getEast(e);return isNaN(t)||isNaN(e)?null:[e,t]},ki.getNorthWest=function(e){var t=this.getNorth(e),e=this.getWest(e);return isNaN(t)||isNaN(e)?null:[e,t]},ki.getSouthEast=function(e){var t=this.getSouth(e),e=this.getEast(e);return isNaN(t)||isNaN(e)?null:[e,t]},ki.getSouth=function(e){return e&&4<=e.length?Number(e[1]):NaN},ki.getWest=function(e){return e&&4<=e.length?Number(e[0]):NaN},ki.getNorth=function(e){if(e){if(4===e.length)return Number(e[3]);if(6===e.length)return Number(e[4])}return NaN},ki.getEast=function(e){if(e){if(4===e.length)return Number(e[2]);if(6===e.length)return Number(e[3])}return NaN},ki.intersect=function(e,t){var r=ki.getCenter(e),o=ki.getCenter(t),n=Math.abs(r[1]-o[1]),i=Math.abs(r[0]-o[0]);180<i&&(i=360-i);r=ki.getHeight(e),o=ki.getWidth(e),e=ki.getHeight(t),t=ki.getWidth(t);return n<=r/2+e/2&&i<=o/2+t/2},ki.merge=function(e,t){var r=e&&4===e.length,o=t&&4===t.length;if(r&&!o)return e;if(o&&!r)return t;if(!r&&!o)return null;for(var r=Math.max(Jn(ki.getNorth(e)),Jn(ki.getNorth(t))),o=Math.min(Jn(ki.getSouth(e)),Jn(ki.getSouth(t))),n=[e,t],i=[],s=0,s=0;s<n.length;s++){var a=n[s],c=Qn(ki.getWest(a)),u=Qn(ki.getEast(a));ki.crossesAntimeridian(a)?(i.push([c,180]),i.push([-180,u])):i.push([c,u])}i.sort(function(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]});var l=[],h=i[0];for(s=1;s<i.length;){var p=i[s];h[1]>=p[0]?h[1]=Math.max(h[1],p[1]):(l.push(h),h=p),s++}l.push(h);var d=l.length,f=l[0][0]+360-l[d-1][1],g=[l[d-1][1],l[0][0]];for(s=1;s<d;s++){var y=l[s][0]-l[s-1][1];f<y&&(f=y,g=[l[s-1][1],l[s][0]])}return new ki([g[1],o],[g[0],r])},ki.fromPositions=function(e){for(var t,r,o=NaN,n=NaN,i=NaN,s=NaN,a=e.length,c=new Array(a),u=0;a--;)(r=e[a])&&2<=r.length&&(t=Jn(r[1]),o=isNaN(o)?t:Math.max(o,t),n=isNaN(n)?t:Math.min(n,t),c[u++]=Qn(r[0]));if(u){c.length=u,c.sort(function(e,t){return e-t});for(var l=c[0]+360-c[u-1],h=0,a=1;a<u;a++){var p=c[a]-c[a-1];l<p&&(l=p,h=a)}i=c[h],s=c[(h||u)-1]}return isNaN(i)||isNaN(n)||isNaN(s)||isNaN(o)?null:new ki([i,n,s,o])},ki.fromLatLngs=function(e){return ki.fromPositions(gi.fromLatLngs(e))},ki.fromData=function(e){var t,r,o=null;if(Array.isArray(e)&&0<e.length){try{for(var n=Ii(e),i=n.next();!i.done;i=n.next()){var s,a=i.value;null!=(s=ki.fromData(a))&&(o=null===o?s:ki.merge(o,s))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return o}if(e instanceof Ci)return e.getBounds();if(e&&e.type){var c=e;if(c.bbox&&4===c.bbox.length)return c.bbox;switch(c.type){case"FeatureCollection":return ki.fromData(c.features);case"Feature":return Ci._isCircle(c)?ki.fromPositions(Ci._getCirclePositions(c)):ki.fromData(c.geometry);case"GeometryCollection":return ki.fromData(c.geometries);case"Point":var u=c.coordinates;if(u&&2<=u.length)return[u[0],u[1],u[0],u[1]];break;case"LineString":case"MultiPoint":return ki.fromPositions(c.coordinates);case"Polygon":case"MultiLineString":var l=c.coordinates;if(l&&0<l.length){for(var h=0,p=l.length;h<p;h++)null!=(s=ki.fromPositions(l[h]))&&(o=null===o?s:ki.merge(o,s));if(null!=o)return o}break;case"MultiPolygon":var d=c.coordinates;if(d&&0<d.length){for(h=0,p=d.length;h<p;h++)for(var f=0,g=d[h].length;f<g;f++)null!=(s=ki.fromPositions(d[h][f]))&&(o=null===o?s:ki.merge(o,s));return o}}}return null},ki.splitOnAntimeridian=function(e){var t,r,o,n,i,s,a=[];return ki.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe(e)?[[-180,e[1],e[2],180,e[4],e[5]]]:ki.isBoundingBoxWithLessThanSixElementsLargerThanGlobe(e)?[[-180,e[1],180,e[3]]]:(ki.crossesAntimeridian(e)?(s=t=void 0,r=Qn(ki.getWest(e)),o=Qn(ki.getEast(e)),n=Jn(ki.getNorth(e)),i=Jn(ki.getSouth(e)),s=6<=e.length?(t=[r,i,e[2],180,n,e[5]],[-180,i,e[2],o,n,e[5]]):(t=[r,i,180,n],[-180,i,o,n]),a.push(t,s)):a.push(e),a)},ki.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe=function(e){return 6<=e.length&&360<e[3]-e[0]},ki.isBoundingBoxWithLessThanSixElementsLargerThanGlobe=function(e){return e.length<6&&360<e[2]-e[0]},ki);function ki(e,t){var r,o=this;return e&&t?o=(r=e)[2]&&t[2]?Ti.call(this,r[0],r[1],r[2]||0,t[0],t[1],t[2]||0)||this:Ti.call(this,r[0],r[1],t[0],t[1])||this:!e||(e=e)&&(4===e.length?o=Ti.call(this,e[0],e[1],e[2],e[3])||this:6<=e.length&&(o=Ti.call(this,e[0],e[1],e[2],e[3],e[4],e[5])||this)),o}var Pi=(Oi.TYPE="FeatureCollection",Oi);function Oi(e,t){this.type="FeatureCollection",this.type=Oi.TYPE,this.features=e,this.bbox=t}xi.TYPE="GeometryCollection",K=xi;function xi(e){this.type="GeometryCollection",this.type=xi.TYPE,this.geometries=e}Ri.TYPE="LineString",Oe=Ri;function Ri(e,t){this.type="LineString",this.type=Ri.TYPE,this.coordinates=e,this.bbox=t}Mi.TYPE="MultiLineString",Se=Mi;function Mi(e,t){this.type="MultiLineString",this.type=Mi.TYPE,this.coordinates=e,this.bbox=t}Ni.TYPE="MultiPoint",Ee=Ni;function Ni(e,t){this.type="MultiPoint",this.type=Ni.TYPE,this.coordinates=e,this.bbox=t}Li.TYPE="MultiPolygon",R=Li;function Li(e,t){this.type="MultiPolygon",this.type=Li.TYPE,this.coordinates=e,this.bbox=t}var Di,qi,xe=window&&window.__extends||(Di=function(e,t){return(Di=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Di(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Ie=(qi=Array,xe(ji,qi),ji.fromPosition=function(e){return 2<=e.length?new ji((180+e[0])/360,ji._latToMercatorY(e[1]),3<=e.length?ji._altitudeToMercatorZ(e[2],e[1]):0):[0,0,0]},ji.fromPositions=function(e){for(var t=[],r=0,o=e.length;r<o;r++)t.push(this.fromPosition(e[r]));return t},ji.toFloat32Array=function(e){for(var t=new Float32Array(3*e.length),r=0,o=e.length;r<o;r++){var n=3*r,i=e[r];t[n]=(180+i[0])/360,t[1+n]=ji._latToMercatorY(i[1]),t[2+n]=3<=i.length?ji._altitudeToMercatorZ(i[2],i[1]):0}return t},ji.toPosition=function(e){if(2<=e.length){var t=360/Math.PI*Math.atan(Math.exp((180-360*e[1])*Math.PI/180))-90;return new gi(360*e[0]-180,t,3<=e.length?ji._mercatorZToAltitude(e[2],e[1]):0)}return[0,0,0]},ji.toPositions=function(e){for(var t=[],r=0,o=e.length;r<o;r++)t.push(this.toPosition(e[r]));return t},ji.mercatorScale=function(e){return 1/Math.cos(e*Math.PI/180)},ji.meterInMercatorUnits=function(e){return 1/ji.earthCircumference*ji.mercatorScale(ji._latToMercatorY(e))},ji._circumferenceAtLatitude=function(e){return ji.earthCircumference*Math.cos(e*Math.PI/180)},ji._altitudeToMercatorZ=function(e,t){return e/ji._circumferenceAtLatitude(t)},ji._mercatorZToAltitude=function(e,t){return e*ji._circumferenceAtLatitude(ji._latToMercatorY(t))},ji._latToMercatorY=function(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360},ji.earthCircumference=2*Math.PI*Hn(),ji);function ji(e,t,r){return qi.call(this,e,t,r||0)||this}var Ui,xe=Object.freeze({__proto__:null,Feature:rn,FeatureCollection:Pi,LineString:Oe,Point:un,Polygon:mi,Position:gi,BoundingBox:Ai,MercatorPoint:Ie,MultiLineString:Se,MultiPoint:Ee,MultiPolygon:R,GeometryCollection:K}),Hi=Re(function(e,t){function g(e,t){return e*e+t*t}function i(e,t){for(var r,o,n,i=e[0],s=[i],a=1,c=e.length;a<c;a++)r=e[a],n=i,g((o=r)[0]-n[0],o[1]-n[1])>t&&(s.push(r),i=r);return i!==r&&s.push(r),s}function y(e,t,r,o,n){for(var i,s,a,c,u,l,h,p=o,d=t+1;d<r;d++){var f=(s=e[d],a=e[t],c=e[r],h=l=f=u=void 0,u=a[0],f=a[1],l=c[0]-u,h=c[1]-f,0==l&&0==h||(1<(a=((s[0]-u)*l+(s[1]-f)*h)/g(l,h))?(u=c[0],f=c[1]):0<a&&(u+=l*a,f+=h*a)),g(s[0]-u,s[1]-f));p<f&&(i=d,p=f)}o<p&&(1<i-t&&y(e,t,i,o,n),n.push(e[i]),1<r-i&&y(e,i,r,o,n))}t.__esModule=!0,t.SimplifyAP=function(e,t,r){if(e.length<=2)return e;var o,n=(t=void 0===t?1:t)*t;return e=(r=void 0===r?!1:r)?e:i(e,n),t=(o=e).length-1,r=[o[0]],y(o,0,t,n,r),r.push(o[t]),e=r}});(Ui=Hi)&&Ui.__esModule&&Object.prototype.hasOwnProperty.call(Ui,"default")&&Ui.default;var zi=Hi.SimplifyAP;var Bi=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Fi=(Ki.prototype.toTarget=function(e,t){return this.transformArray(e,this.M,t)},Ki.prototype.toSource=function(e,t){return this.transformArray(e,this.inverseM,t)},Ki.prototype.transformArray=function(e,t,r){var o,n;if(e&&Array.isArray(e)&&Array.isArray(e[0])){var i=[];try{for(var s=Bi(e),a=s.next();!a.done;a=s.next()){var c=a.value;i.push(this.transform(c,t,r))}}catch(e){o={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i}return null},Ki.prototype.transform=function(e,t,r){var o=e[0]*t[0][3]+e[1]*t[1][3]+t[2][3],t=e[0]*t[0][4]+e[1]*t[1][4]+t[2][4];return"number"==typeof r&&0<=r?[Dn(o,r),Dn(t,r)]:[Dn(o,6),Dn(t,6)]},Ki._calculateAffineTransform=function(e,t){if(e.length!==t.length||e.length<1)throw new Error("Error: source and target arrays must have the same length.");var r=Math.min(e[0].length,t[0].length),o=r+1;if(e.length<r)throw new Error("Erorr: At least "+r+" reference points required.");for(var n=[],i=[],s=0;s<o;s++){i[s]=[];for(var a=0;a<o;a++){a<r&&(n[a]=0);for(var c=i[s][a]=0;c<e.length;c++)a<r&&(n[a]+=s<r?e[c][s]*t[c][a]:t[c][a]),i[s][a]+=r<=s&&r<=a?1:r<=s?e[c][a]:r<=a?e[c][s]:e[c][s]*e[c][a]}i[s]=i[s].concat(n)}if(!this._gaussJordanElimination(i))throw new Error("Error: Singular matrix. Points are likely coplanar.");return i},Ki._gaussJordanElimination=function(e){for(var t,r=e.length,o=2*r-1,n=0;n<r;n++){for(var i=n,s=n+1;s<r;s++)Math.abs(e[s][n])>Math.abs(e[i][n])&&(i=s);if(t=e[i],e[i]=e[n],e[n]=t,Math.abs(e[n][n])<=1e-12)return!1;for(var a=n+1;a<r;a++)for(var c=e[a][n]/e[n][n],u=n;u<o;u++)e[a][u]-=e[n][u]*c}for(n=r-1;-1<n;n--){c=e[n][n];for(s=0;s<n;s++)for(var l=o-1;n-1<l;l--)e[s][l]-=e[n][l]*e[s][n]/c;e[n][n]/=c;for(var h=r;h<o;h++)e[n][h]/=c}return!0},Ki);function Ki(e,t){this.M=Ki._calculateAffineTransform(e,t),this.inverseM=Ki._calculateAffineTransform(t,e)}var Gi,Yi,Oe=Object.freeze({__proto__:null,AffineTransform:Fi,WEBMERCATOR_MAXLAT:Cn,_precision:Dn,get AreaUnits(){return hn},get DistanceUnits(){return pn},get TimeUnits(){return dn},get SpeedUnits(){return fn},get AccelerationUnits(){return gn},boundingBoxToPolygon:function(e){var t=Qn(Ai.getWest(e)),r=Qn(Ai.getEast(e)),o=Jn(Ai.getNorth(e)),n=Jn(Ai.getSouth(e)),e=Ai.getCenter(e),o=[[t,o],[t,n],[e[0],n],[r,n],[r,o],[e[0],o],[t,o]];return new mi([o])},convertDistance:qn,getCardinalSpline:function(e,t,r,o){if(!e||e.length<=2)return i;"number"!=typeof t&&(t=.5),("number"!=typeof r||r<=0)&&(r=15);var n=e.length,i=e.slice(0);o?(gi.areEqual(i[0],i[n-1])&&(i.pop(),n--),i.unshift(e[n-1]),i.push(e[0]),i.push(e[1]),n++):(i.unshift(e[0]),i.push(e[n-1]));var s,a,c,u=[];u.push([1,0,0,0]);for(var l=1;l<r-1;l++)u.push([2*(c=(s=l/r)*(a=s*s))-3*a+1,-2*c+3*a,c-2*a+s,c-a]);u.push([0,1,0,0]);for(var h,p,d,f,g,y,m=[],l=1;l<n;l++)for(h=t*(i[l+1][0]-i[l-1][0]),p=t*(i[l+1][1]-i[l-1][1]),d=t*(i[l+2][0]-i[l][0]),f=t*(i[l+2][1]-i[l][1]),s=0;s<r;s++)y=(g=u[s])[0]*i[l][0]+g[1]*i[l+1][0]+g[2]*h+g[3]*d,g=Tn(g[0]*i[l][1]+g[1]*i[l+1][1]+g[2]*p+g[3]*f,-85,85),m.push([y,g]);return m},getDestination:jn,getDistanceTo:Un,getEarthRadius:Hn,getPathDenormalizedAtAntimerian:Bn,getPathSplitByAntimeridian:Fn,getGeodesicPath:function(e,t){var r;(!t||t<=0)&&(t=15),Array.isArray(e)?r=e:e.type&&"LineString"===e.type&&(r=e.coordinates);for(var o=r.length-1,n=[],i=0;i<o;i++)n=n.concat(zn(r[i],r[i+1],t));return Bn(n)},getGeodesicPaths:function(e,t){var r;(!t||t<=0)&&(t=15),Array.isArray(e)?r=e:e.type&&"LineString"===e.type&&(r=e.coordinates);for(var o=r.length-1,n=[],i=[],s=0;s<o;s++)for(var a,c,u,l,h,p=zn(r[s],r[s+1],t),d=0;d<p.length;d++)n.push(p[d]),d+1>=p.length||(a=(u=yn(p[d],2))[0],c=u[1],h=(l=yn(p[d+1],2))[0],u=l[1],180<Math.abs(h-a)&&(l=0<a?180:-180,h=Math.abs((0<a?h+360:h-360)-a),h=c+(u-c)*(Math.abs(l-a)/h),n.push([l,h]),i.push(n),n=[[-l,h]]));return i.push(n),i},getHeading:Kn,getLengthOfPath:Gn,getPositionAlongPath:Yn,getRegularPolygonPath:Wn,getRegularPolygonPaths:function(e,t,r,o,n){return Fn(Zn(e,t,r,o,n))},interpolate:Vn,normalizeLatitude:Jn,normalizeLongitude:Qn,rotatePositions:Xn,getPixelHeading:function(e,t){e=li(e),t=li(t);var e=(r=yn(ei([e,t],21),2))[0],r=(t=r[1])[0]-e[0],t=e[1]-t[1];return(2.5*Math.PI-Math.atan2(t,r))*wn%360},mercatorPixelsToPositions:$n,mercatorPositionsToPixels:ei,convertAcceleration:ti,convertArea:ri,convertSpeed:oi,convertTimespan:ni,getAcceleration:ii,getAccelerationFromSpeeds:si,getAccelerationFromFeatures:function(e,t,r,o,n,i,s){if("string"==typeof r&&"Feature"===e.type&&"Point"===e.geometry.type&&"Feature"===t.type&&"Point"===t.geometry.type){var a=ai(e.properties[r],t.properties[r],dn.seconds);if(!isNaN(a)){var c=0;if(o&&"string"==typeof o){r=e.properties[o],o=t.properties[o];if("number"==typeof r&&(c=r,"number"==typeof o))return si(r,o,a,n,dn.seconds,i,s)}return ii(c,Un(e.geometry.coordinates,t.geometry.coordinates,pn.meters),a,n,pn.meters,dn.seconds,i,s)}}return NaN},getArea:function e(t,r,o){if(t){var n=0;switch((t=t instanceof Ci?t.toJson():t).type){case"Feature":var i=t;if(t.geometry)return e(i.geometry,r,o);break;case"Polygon":(i=t).coordinates&&(n=Rn(i.coordinates));break;case"MultiPolygon":var s=t;if(s.coordinates)for(var a=0,c=s.coordinates.length;a<c;a++)n+=Rn(s.coordinates[a])}return ri(n,hn.squareMeters,r,o)}return 0},getSpeed:function(e,t,r,o,n,i){if(e=li(e),t=li(t),e&&t){o=ni(r,o,dn.seconds);return oi(Un(e,t,pn.meters)/o,fn.metersPerSecond,n,i)}return 0},getSpeedFromFeatures:function(e,t,r,o,n){if("string"==typeof r&&"Feature"===e.type&&"Point"===e.geometry.type&&"Feature"===t.type&&"Point"===t.geometry.type){r=this.getTimespan(e.properties[r],t.properties[r],dn.seconds);if(!isNaN(r)){t=this.getDistanceTo(e.geometry.coordinates,t.geometry.coordinates,pn.meters);return this.convertSpeed(t/r,fn.metersPerSecond,o,n)}}return NaN},getTimespan:ai,getTravelDistance:function(e,t,r,o,n,i,s,a){return t=this.convertTimespan(t,n,dn.seconds),r=(r=this.convertSpeed(r,i,fn.metersPerSecond))*t,"number"==typeof o&&(r+=.5*this.convertAcceleration(o,s,gn.metersPerSecondSquared)*t*t),this.convertDistance(r,pn.meters,e,a)},parseTimestamp:ci,getConvexHull:function(e){var t,r,o=ui(e).map(function(e){return[Qn(e[0]),Jn(e[1])]});o.sort(function(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]});var n=[];try{for(var i=mn(o),s=i.next();!s.done;s=i.next()){for(var a=s.value;2<=n.length&&Nn(n[n.length-2],n[n.length-1],a)<=0;)n.pop();n.push(a)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}for(var c=[],u=o.length-1;0<=u;u--){for(;2<=c.length&&Nn(c[c.length-2],c[c.length-1],o[u])<=0;)c.pop();c.push(o[u])}return new mi([n.concat(c)])},getPositions:ui,getPosition:li,getPositionsAlongPath:function(e,t){if(t<2)return[];for(var r=[],o=Gn(e,pn.meters)/(t-1),n=0;n<t;n++){var i=Yn(e,o*n,pn.meters);null!=i&&r.push(i)}return r},getPointWithHeadingAlongPath:hi,getPointsWithHeadingsAlongPath:function(e,t){if(t<=0)return[];for(var r=[],o=Gn(e,pn.meters)/(t-1),n=0;n<t;n++){var i=hi(e,o*n,pn.meters);null!=i&&r.push(i)}return r},getClosestPointOnGeometry:pi,simplify:function(e,t){return zi(e,t,!0)}}),Zi=((window&&window.__extends||(Gi=function(e,t){return(Gi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Gi(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Wi,Yi=k),Wi);function Wi(){var e=null!==Yi&&Yi.apply(this,arguments)||this;return e.zoomDelta=1,e.style=c.ControlStyle.light,e}var Vi,Ji,Ie=((window&&window.__extends||(Vi=function(e,t){return(Vi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Vi(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Qi,Ji=re),Qi.prototype.onAdd=function(e){this.container=this.buildContainer(e,this.options.style,"Zoom Control"),this.container.style.flexDirection="column",this.zoomInButton=this.constructZoomInButton(e),this.zoomOutButton=this.constructZoomOutButton(e);var t=z("Zoom In"),r=z("Zoom Out");return this.container.appendChild(this.zoomInButton),this.container.appendChild(t),this.container.appendChild(this.zoomOutButton),this.container.appendChild(r),B(t,this.zoomInButton),B(r,this.zoomOutButton),e.events.add("zoom",this.zoomChanged),e.events.add("minzoomchanged",this.minZoomChanged),e.events.add("maxzoomchanged",this.maxZoomChanged),this.map=e,this.container},Qi.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)},Qi.prototype.updateZoomButtonsState=function(){var e=this.map.getCamera().zoom>=this.map._getMap().getMaxZoom(),t=Ai.getSouth(this.map.getCamera().bounds)<=-Cn&&Ai.getNorth(this.map.getCamera().bounds)>=Cn,t=this.map.getCamera().zoom<=this.map._getMap().getMinZoom()||t;this.zoomInButton&&this.zoomInButton.disabled!=e&&(this.zoomInButton.disabled=e,this.zoomInButton.setAttribute("aria-label",e?"Zoom In disabled":"Zoom In")),this.zoomOutButton&&this.zoomOutButton.disabled!=t&&(this.zoomOutButton.disabled=t,this.zoomOutButton.setAttribute("aria-label",e?"Zoom Out disabled":"Zoom Out"))},Qi.prototype.constructZoomInButton=function(e){var t=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("zoom-in"),r.setAttribute("aria-label","Zoom In"),r.setAttribute("alt","Zoom In"),r.setAttribute("type","button"),r.addEventListener("click",function(){e.setCamera({zoom:e.getCamera().zoom+t.options.zoomDelta,duration:Qi.ZOOM_DURATION_MS,type:"ease"},!0)}),r},Qi.prototype.constructZoomOutButton=function(e){var t=this,r=document.createElement("button");return r.classList.add("azure-maps-control-button"),r.classList.add("zoom-out"),r.setAttribute("aria-label","Zoom Out"),r.setAttribute("alt","Zoom Out"),r.setAttribute("type","button"),r.addEventListener("click",function(){e.setCamera({zoom:e.getCamera().zoom-t.options.zoomDelta,duration:Qi.ZOOM_DURATION_MS,type:"ease"},!0)}),r},Qi.ZOOM_DURATION_MS=200,Qi);function Qi(e){var t=Ji.call(this)||this;return t.container=null,t.zoomInButton=null,t.zoomOutButton=null,t.zoomChanged=function(e){return t.updateZoomButtonsState()},t.minZoomChanged=function(e){return t.updateZoomButtonsState()},t.maxZoomChanged=function(e){return t.updateZoomButtonsState()},t.options=(new Zi).merge(e),t}Se=Object.freeze({__proto__:null,ControlBase:re,PitchControl:ve,CompassControl:le,ZoomControl:Ie,StyleControl:Ne,TrafficControl:Po,TrafficLegendControl:Pe});var Xi=function(e,t){return Ur(e,5,t="function"==typeof t?t:void 0)},$i=(es.Css={hidden:"hidden-accessible-element"},es);function es(e){var t=this;this.attach=function(e){t.map!==e&&(t.map&&t.detachFromCurrentMap(),t.map=e,t.map.indicators._getCollectionDiv().appendChild(t.element),t.map.indicators.add(t))},this.remove=function(){t.detachFromCurrentMap(),t.element.remove()},this.getElement=function(){return t.element},this.detachFromCurrentMap=function(){t.map&&(t.map.indicators.remove(t),delete t.map)},this.element=document.createElement("div"),this.element.setAttribute("tabindex","0"),this.element.setAttribute("role","option"),null!=e&&e.setSize&&this.element.setAttribute("aria-setsize",e.setSize.toString()),null!=e&&e.positionInSet&&this.element.setAttribute("aria-posinset",e.positionInSet.toString()),this.element.setAttribute("aria-label","data point"),this.element.classList.add(es.Css.hidden)}var ts,rs,os=((window&&window.__extends||(ts=function(e,t){return(ts=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ts(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ns,rs=k),ns);function ns(){var e=null!==rs&&rs.apply(this,arguments)||this;return e.buffer=128,e.maxZoom=18,e.cluster=!1,e.clusterRadius=50,e.clusterMaxZoom=void 0,e.clusterProperties=void 0,e.lineMetrics=!1,e.tolerance=.375,e.clusterMinPoints=2,e.generateId=!1,e.promoteId=void 0,e.filter=void 0,e}var is,ss,as=((window&&window.__extends||(is=function(e,t){return(is=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}is(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(cs,ss=Q),cs.prototype.getId=function(){return this.id},cs.prototype._setMap=function(e,t){var r;void 0===t&&(t=!0),null==e||void 0===e?(r=this.map,delete this.map,t&&(this._invokeEvent("sourceremoved",this),r&&r.events.invoke("sourceremoved",this))):(this.map=e,t&&(this._invokeEvent("sourceadded",this),this.map.events.invoke("sourceadded",this)))},cs);function cs(e){var t=ss.call(this)||this;return t.id=e||tn(),t}var us,ls,Ee=window&&window.__extends||(us=function(e,t){return(us=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}us(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),hs=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ps=(Ee(ds,ls=as),ds.prototype.add=function(e,t){this._addNoUpdate(e,t),this._updateSource()},ds.prototype.clear=function(){this._clearNoUpdate(),this._updateSource()},ds.prototype.dispose=function(){this.options=null,this.shapes=null,this.shapesMap=null,this.map=null},ds.prototype.getClusterExpansionZoom=function(t){var n=this;return new Promise(function(r,o){var e;n.map?(e=n.map._getMap().getSource(n.getId()))&&"geojson"===e.type&&e.getClusterExpansionZoom(t,function(e,t){e?o(e):"number"==typeof t&&r(t)}):o("The DataSource hasn't been added to a map.")})},ds.prototype.getClusterChildren=function(t){var n=this;return new Promise(function(r,o){var e;n.map?(e=n.map._getMap().getSource(n.getId()))&&"geojson"===e.type&&e.getClusterChildren(t,function(e,t){e?o(e):t&&r(n.map.sources._mapFeaturesToShapes(t,!1,n))}):o("The DataSource hasn't been added to a map.")})},ds.prototype.getClusterLeaves=function(t,n,i){var s=this;return new Promise(function(r,o){var e;s.map?(e=s.map._getMap().getSource(s.getId()))&&"geojson"===e.type&&e.getClusterLeaves(t,n,i,function(e,t){e?o(e):t&&r(s.map.sources._mapFeaturesToShapes(t,!1,s))}):o("The DataSource hasn't been added to a map.")})},ds.prototype.getOptions=function(){return Hr(this.options)},ds.prototype.getShapes=function(){return Array.from(this.shapes)},ds.prototype.importDataFromUrl=function(e){var t=this;return fetch(e,{method:"GET",mode:"cors"}).then(function(e){if(e.ok)return e.json();throw new Error("HTTP "+e.status+": "+e.statusText)}).then(function(e){t.add(e)})},ds.prototype.getShapeById=function(e){return this.shapes[this.shapesMap.get(e)]||null},ds.prototype.remove=function(e){var t,r,e=Array.isArray(e)?e:[e];try{for(var o=hs(e),n=o.next();!n.done;n=o.next()){var i=n.value;"number"==typeof i?this._removeByIndex(i):this._removeById(i)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}this._updateSource()},ds.prototype.removeById=function(e){var t,r,e=Array.isArray(e)?e:[e];try{for(var o=hs(e),n=o.next();!n.done;n=o.next()){var i=n.value;this._removeById(i)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}this._updateSource()},ds.prototype.setOptions=function(e){e=(new os).merge(this.options,Hr(e));$o(this.options,e)||(this._invokeEvent("datasourceupdated",this),this.options=e,this.map&&this.map._rebuildStyle())},ds.prototype.setShapes=function(e){this._clearNoUpdate(),this.add(e)},ds.prototype.toJson=function(){return new Pi(this.shapes.map(function(e){return e.toJson()}))},ds.prototype._toJson=function(){return new Pi(this.shapes.map(function(e){return e._toJson()}))},ds.prototype._buildSource=function(){var e={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,clusterMinPoints:this.options.clusterMinPoints,generateId:this.options.generateId,promoteId:this.options.promoteId,filter:this.options.filter};return"number"==typeof this.options.clusterMaxZoom&&(e.clusterMaxZoom=this.options.clusterMaxZoom),e},ds.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this._buildSource(),e=e._buildSource();return t.type===e.type&&t.maxzoom===e.maxzoom&&t.cluster===e.cluster&&t.clusterRadius===e.clusterRadius&&t.tolerance===e.tolerance&&t.lineMetrics===e.lineMetrics&&JSON.stringify(t.clusterProperties)===JSON.stringify(e.clusterProperties)&&t.buffer===e.buffer&&t.clusterMinPoints===e.clusterMinPoints&&t.generateId===e.generateId&&t.promoteId===e.promoteId&&t.filter===e.filter},ds.prototype._addNoUpdate=function(e,t){var r;e instanceof Ci?(this._addToSources(e,t),r=[e]):Array.isArray(e)?(r=e.map(function(e){return e instanceof Ci?e:new Ci(e)}),this._addToSources(r,t)):"FeatureCollection"===e.type?(r=e.features.map(function(e){return new Ci(e)}),this._addToSources(r,t)):"GeometryCollection"===e.type?(r=e.geometries.map(function(e){return new Ci(e)}),this._addToSources(r,t)):(e=new Ci(e),this._addToSources(e,t),r=[e]),this._invokeEvent("dataadded",r)},ds.prototype._clearNoUpdate=function(){var e=this.shapes;this.shapes=[],this.shapesMap=new J,e&&0<e.length&&this._invokeEvent("dataremoved",e)},ds.prototype._updateSource=function(){var e=this;void 0!==this.requestId||(this.requestId=requestAnimationFrame(function(){e._updateMboxSource(),e.requestId=void 0}))},ds.prototype._addToSources=function(e,t){var r,o,n,i;if(e=Array.isArray(e)?e:[e],"number"!=typeof t)try{for(var s=hs(e),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(e){r={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}else for(var u=e.length-1;0<=u;u--)this.shapes.splice(t,0,e[u]),this._updateShapesMap(t);try{for(var l=hs(e),h=l.next();!h.done;h=l.next())(c=h.value)._setDataSource(this)}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}},ds.prototype._removeById=function(e){var t=e instanceof Ci?e.getId():"string"==typeof e||"number"==typeof e?e:e.id,e=this.shapes[this.shapesMap.get(t)];e&&(e._setDataSource(null),this.shapes.splice(this.shapesMap.get(t),1),this._updateShapesMap(this.shapesMap.get(t)),this.shapesMap.delete(t),this._invokeEvent("dataremoved",[e]))},ds.prototype._removeByIndex=function(e){var t;if(e>=this.shapes.length)throw new Error("The specified remove index '"+e+"' is greater than the maximum possible index '"+(this.shapes.length-1)+"'");t=this.shapes[e],this.shapesMap.delete(t.getId()),t._setDataSource(null),this.shapes.splice(e,1),this._updateShapesMap(e),this._invokeEvent("dataremoved",[t])},ds.prototype._updateShapesMap=function(e){for(var t=e;t<this.shapes.length;t++)this.shapesMap.set(this.shapes[t].getId(),t)},ds.prototype._updateMboxSource=function(){var e;this.map&&this.map._getMap()&&((e=this.map._getMap().getSource(this.getId()))&&"geojson"===e.type&&e.setData(this._toJson()))},ds);function ds(e,t){e=ls.call(this,e)||this;return e.requestId=void 0,e.options=(new os).merge(Hr(t)),e.shapes=[],e.shapesMap=new J,e}var fs,gs,ys=((window&&window.__extends||(fs=function(e,t){return(fs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}fs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ms,gs=k),ms);function ms(){var e=null!==gs&&gs.apply(this,arguments)||this;return e.bounds=void 0,e.minZoom=0,e.maxZoom=22,e.isTMS=!1,e.tiles=void 0,e.url=void 0,e}var vs,_s,ws=((window&&window.__extends||(vs=function(e,t){return(vs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}vs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(bs,_s=as),bs.prototype.getOptions=function(){return Hr(this.options)},bs.prototype.getShape=function(e,t){return this.map._getMap().querySourceFeatures(this.getId(),{sourceLayer:e,filter:t})},bs.prototype._buildSource=function(){var e={type:"vector"};return this.options.bounds&&(e.bounds=this.options.bounds),this.options.tiles?(e.tiles=this.options.tiles,e.minzoom=this.options.minZoom,e.maxzoom=this.options.maxZoom):this.options.url&&(e.url=this.options.url),this.options.isTMS&&(e.scheme="tms"),e},bs.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this._buildSource(),r=e._buildSource();return t.type===r.type&&t.url===r.url&&(void 0===t.tiles&&void 0===r.tiles||t.tiles&&r.tiles&&t.tiles.length===r.tiles.length&&t.tiles.every(function(e,t){return e===r.tiles[t]}))&&t.minzoom===r.minzoom&&t.maxzoom===r.maxzoom&&t.bounds===r.bounds&&t.attribution===r.attribution&&t.promoteId===r.promoteId&&t.scheme===r.scheme},bs);function bs(e,t){e=_s.call(this,e)||this;return e.options=(new ys).merge(Hr(t)),e}var Cs,Es,Ss=((window&&window.__extends||(Cs=function(e,t){return(Cs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Cs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Ts,Es=as),Ts.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this.source,e=e.source;return t.type===e.type&&t.canvas===e.canvas&&JSON.stringify(t.coordinates)===JSON.stringify(e.coordinates)&&t.animate===e.animate},Ts.prototype._buildSource=function(){return this.source},Ts);function Ts(e,t,r){e=Es.call(this,e)||this;return e.source=t,e}var Is,As,ks=((window&&window.__extends||(Is=function(e,t){return(Is=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Is(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Ps,As=as),Ps.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this.source,e=e.source;return t.type===e.type},Ps.prototype._buildSource=function(){return this.source},Ps);function Ps(e,t,r){e=As.call(this,e)||this;return e.source=t,e}var Os,xs,Rs=((window&&window.__extends||(Os=function(e,t){return(Os=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Os(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Ms,xs=as),Ms.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this.source,e=e.source;return t.type===e.type&&JSON.stringify(t.coordinates)===JSON.stringify(e.coordinates)&&t.url===e.url},Ms.prototype._buildSource=function(){return this.source},Ms);function Ms(e,t,r){e=xs.call(this,e)||this;return e.source=t,e}var Ns,Ls,Ds=((window&&window.__extends||(Ns=function(e,t){return(Ns=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ns(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(qs,Ls=as),qs.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this.source,e=e.source;return t.type===e.type&&JSON.stringify(t.coordinates)===JSON.stringify(e.coordinates)&&t.urls===e.urls},qs.prototype._buildSource=function(){return this.source},qs);function qs(e,t,r){e=Ls.call(this,e)||this;return e.source=t,e}var js,Us,R=((window&&window.__extends||(js=function(e,t){return(js=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}js(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Hs,Us=ys),Hs);function Hs(){var e=null!==Us&&Us.apply(this,arguments)||this;return e.tileSize=512,e}var zs,Bs,Fs=((window&&window.__extends||(zs=function(e,t){return(zs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}zs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Ks,Bs=R),Ks);function Ks(){var e=null!==Bs&&Bs.apply(this,arguments)||this;return e.encoding=void 0,e}var Gs,Ys,K=window&&window.__extends||(Gs=function(e,t){return(Gs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Gs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Zs=window&&window.__assign||function(){return(Zs=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},ve=(K(Ws,Ys=as),Ws.prototype.getOptions=function(){return Hr(this.options)},Ws.prototype._buildSource=function(){return Zs({type:"raster-dem",bounds:this.options.bounds,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,tileSize:this.options.tileSize,encoding:this.options.encoding},this.options.tiles?{tiles:this.options.tiles}:{url:this.options.url})},Ws.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;e=e.getOptions();return this.options.url===e.url&&this.options.tiles===e.tiles&&this.options.bounds===e.bounds&&this.options.minZoom===e.minZoom&&this.options.maxZoom===e.maxZoom&&this.options.tileSize===e.tileSize&&this.options.encoding===e.encoding},Ws);function Ws(e,t){e=Ys.call(this,e)||this;return e.options=(new Fs).merge(Hr(t)),e}var Vs,Js,Ie=Object.freeze({__proto__:null,Source:as,DataSource:ps,VectorTileSource:ws,CanvasSource:Ss,ImageSource:Rs,VideoSource:Ds,ElevationTileSource:ve,UnknownSource:ks}),Qs=((window&&window.__extends||(Vs=function(e,t){return(Vs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Vs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Xs,Js=Q),Xs.prototype.getId=function(){return this.id},Xs.prototype.getMap=function(){return this.map||null},Xs.prototype.onAdd=function(e){this.map=e,this._invokeEvent("layeradded",this),this.map.events.invoke("layeradded",this)},Xs.prototype.onRemove=function(){var e=this.map;delete this.map,this._invokeEvent("layerremoved",this),e&&e.events.invoke("layerremoved",this)},Xs._isMBoxEvent=function(e){return!this.LayerEvents.hasOwnProperty(e)},Xs.prototype._updateBaseProperties=function(e,t){this._updateFilter(e.filter,t.filter),this._updateZoomRange(e.minZoom,t.minZoom,e.maxZoom,t.maxZoom),this._updateLayoutProperty("visibility",e.visible,t.visible,e.visible?"visible":"none")},Xs.prototype._updateFilter=function(e,t){$o(e,t)||this.map._getMap().setFilter(this.id,e)},Xs.prototype._updatePaintProperty=function(e,t,r,o){$o(t,r)||this.map._getMap().setPaintProperty(this.id,e,o||t)},Xs.prototype._updateLayoutProperty=function(e,t,r,o){$o(t,r)||this.map._getMap().setLayoutProperty(this.id,e,o||t)},Xs.prototype._updateZoomRange=function(e,t,r,o){e===t&&o===r||this.map._getMap().setLayerZoomRange(this.id,e,r)},Xs.LayerEvents={layeradded:void 0,layerremoved:void 0,focusin:void 0,focusout:void 0},Xs);function Xs(e){var t=Js.call(this)||this;return t.id=e||tn(),t}var $s,ea,Ne=((window&&window.__extends||($s=function(e,t){return($s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}$s(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ta,ea=k),ta._cloneCustomizer=function(e){if(e instanceof as)return e},ta);function ta(){var e=null!==ea&&ea.apply(this,arguments)||this;return e.filter=void 0,e.minZoom=0,e.maxZoom=24,e.visible=!0,e}var ra,oa,na=((window&&window.__extends||(ra=function(e,t){return(ra=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ra(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ia,oa=Ne),ia);function ia(){var e=null!==oa&&oa.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.color="#1A73AA",e.blur=0,e.opacity=1,e.strokeColor="#FFFFFF",e.strokeOpacity=1,e.strokeWidth=2,e.pitchAlignment="viewport",e.radius=8,e.createIndicators=!1,e.accessibilityIdKey=void 0,e}var sa,aa,Pe=window&&window.__extends||(sa=function(e,t){return(sa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}sa(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),ca=window&&window.__awaiter||function(e,s,a,c){return new(a=a||Promise)(function(r,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(o,n)}i((c=c.apply(e,s||[])).next())})},ua=window&&window.__generator||function(r,o){var n,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=o.call(r,a)}catch(e){t=[6,e],i=0}finally{n=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},la=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},ha=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},pa=(Pe(da,aa=Qs),da.prototype.getOptions=function(){return Xi(this.options,na._cloneCustomizer)},da.prototype.getSource=function(){return this.options.source},da.prototype.setOptions=function(e){e=(new na).merge(this.options,Xi(e,na._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);this._updateBaseProperties(e,this.options),this._updatePaintProperty("circle-blur",e.blur,this.options.blur),this._updatePaintProperty("circle-color",e.color,this.options.color),this._updatePaintProperty("circle-opacity",e.opacity,this.options.opacity),this._updatePaintProperty("circle-radius",e.radius,this.options.radius),this._updatePaintProperty("circle-stroke-color",e.strokeColor,this.options.strokeColor),this._updatePaintProperty("circle-stroke-opacity",e.strokeOpacity,this.options.strokeOpacity),this._updatePaintProperty("circle-stroke-width",e.strokeWidth,this.options.strokeWidth),this._updatePaintProperty("circle-pitch-alignment",e.pitchAlignment,this.options.pitchAlignment)}this.options=e},da.prototype.onAdd=function(t){var e,r,o=this;aa.prototype.onAdd.call(this,t),this.options.createIndicators&&(t.events.addOnce("idle",this._setAccessibleIndicator),t.events.add("moveend",this._setAccessibleIndicator),(e=this._getDataSource())?t.events.add("dataadded",e,function(){t.events.addOnce("idle",o._setAccessibleIndicator)}):(r="string"==typeof this.options.source?this.options.source:this.options.source.getId(),t.events.add("sourcedata",function(e){(null===(e=e.source)||void 0===e?void 0:e.getId())!==r||!t._getMap().isSourceLoaded(r)||(e=o._getSourceDataEventCacheKey())!==o.sourceDataEventCacheKey&&(o._setAccessibleIndicator(),o.sourceDataEventCacheKey=e)})))},da.prototype.onRemove=function(){var e;this.options.createIndicators&&(this.map.events.remove("idle",this._setAccessibleIndicator),this.map.events.remove("moveend",this._setAccessibleIndicator),(e=this._getDataSource())?this.map.events.remove("dataadded",e,this._setAccessibleIndicator):this.map.events.remove("sourcedata",this._setAccessibleIndicator)),aa.prototype.onRemove.call(this)},da.prototype._getSourceDataEventCacheKey=function(){if(this.map){var e=this.map.getServiceOptions().mapConfiguration;return ha(ha([],la(this.map.getCamera().bounds)),[this.map.getCamera().zoom,this.map.getCamera().pitch,this.map.getStyle().style,e instanceof Object?e.id:e]).join(",")}},da.prototype._getDataSource=function(){var e="string"==typeof this.options.source?this.map.sources.getById(this.options.source):this.options.source;if(e instanceof ps)return e},da.prototype._buildLayers=function(){var e={id:this.id,type:"circle",source:this.options.source instanceof as?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&&(e.filter=this.options.filter),this.options.sourceLayer&&(e["source-layer"]=this.options.sourceLayer),[e]},da.prototype._getLayerIds=function(){return[this.id]},da.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof as?e.add(this.options.source.getId()):e.add(this.options.source),e},da.prototype.getFirstCoordinate=function(e){return Array.isArray(e[0])?this.getFirstCoordinate(e[0]):e},da);function da(e,t,r){var o=aa.call(this,t)||this;return o.accessibleIndicator=[],o._setAccessibleIndicator=function(){return ca(o,void 0,void 0,function(){var t,c,u,l,h,p,d=this;return ua(this,function(e){return this.accessibleIndicator.forEach(function(e){return e.remove()}),this.accessibleIndicator=[],t=this.map.layers.getRenderedShapes(this.map.getCamera().bounds,this),c=this.options.accessibilityIdKey||(this._getDataSource()?Ci._shapeIdPropName:void 0),u=function(t,r){var o=t[r],n=o instanceof Ci?o.toJson():o,i=new $i({positionInSet:r+1,setSize:t.length}),s=i.getElement(),a=la(d.map.positionsToPixels([d.getFirstCoordinate(n.geometry.coordinates)]),1)[0];return s.addEventListener("focusin",function(e){d.accessibleIndicator.filter(function(e){return e!==i}).forEach(function(e){return e.remove()}),0<=r-1&&l(i,u(t,r-1)),r+1<t.length&&p(u(t,r+1)),2<=r&&r==t.length-1&&h(u(t,0)),0==r&&2<=t.length&&p(u(t,t.length-1)),void 0!==c&&d.map._getMap().setPaintProperty(d.id,"circle-stroke-color",["case",["==",["get",c],n.properties[c]],"#000000",d.options.strokeColor]);e={target:s,type:"focusin",map:d.map,shape:o,originalEvent:e,pixel:a};d._invokeEvent("focusin",e)}),s.addEventListener("focusout",function(e){void 0!==c&&d.map._getMap().setPaintProperty(d.id,"circle-stroke-color",["case",["==",["get",c],n.properties[c]],d.options.strokeColor,d.options.strokeColor]);e={target:s,type:"focusout",map:d.map,shape:o,originalEvent:e,pixel:a};d._invokeEvent("focusout",e)}),d.accessibleIndicator.push(i),i},l=function(e,t){t.attach(d.map);t=t.getElement(),e=e.getElement();e.parentElement.insertBefore(t,e)},h=function(e){e.attach(d.map);var t=e.getElement(),e=t.parentElement;e.insertBefore(t,e.firstElementChild)},p=function(e){e.attach(d.map)},0<t.length&&p(u(t,0)),1<t.length&&p(u(t,t.length-1)),[2]})})},o.options=(new na).merge(Xi(r,na._cloneCustomizer)),o.options.source=e||o.options.source,o}var fa,ga,ya=((window&&window.__extends||(fa=function(e,t){return(fa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}fa(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ma,ga=Ne),ma._cloneCustomizer=function(e){if(e instanceof as)return e},ma);function ma(){var e=null!==ga&&ga.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.color=["interpolate",["linear"],["heatmap-density"],0,"rgba(0,0, 255,0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],e.intensity=1,e.opacity=1,e.radius=30,e.weight=1,e}var va,_a,Ee=((window&&window.__extends||(va=function(e,t){return(va=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}va(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(wa,_a=Qs),wa.prototype.getOptions=function(){return Xi(this.options,ya._cloneCustomizer)},wa.prototype.getSource=function(){return this.options.source},wa.prototype.setOptions=function(e){e=(new ya).merge(this.options,Xi(e,ya._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);this._updateBaseProperties(e,this.options),this._updatePaintProperty("heatmap-color",e.color,this.options.color),this._updatePaintProperty("heatmap-intensity",e.intensity,this.options.intensity),this._updatePaintProperty("heatmap-opacity",e.opacity,this.options.opacity),this._updatePaintProperty("heatmap-radius",e.radius,this.options.radius),this._updatePaintProperty("heatmap-weight",e.weight,this.options.weight)}this.options=e},wa.prototype._buildLayers=function(){var e={id:this.id,type:"heatmap",source:this.options.source instanceof as?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&&(e.filter=this.options.filter),this.options.sourceLayer&&(e["source-layer"]=this.options.sourceLayer),[e]},wa.prototype._getLayerIds=function(){return[this.id]},wa.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof as?e.add(this.options.source.getId()):e.add(this.options.source),e},wa);function wa(e,t,r){t=_a.call(this,t)||this;return t.options=(new ya).merge(Xi(r,ya._cloneCustomizer)),t.options.source=e||t.options.source,t}var ba,Ca,R=((window&&window.__extends||(ba=function(e,t){return(ba=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ba(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Ea,Ca=Ne),Ea);function Ea(){var e=null!==Ca&&Ca.apply(this,arguments)||this;return e.contrast=0,e.fadeDuration=300,e.hueRotation=0,e.maxBrightness=1,e.minBrightness=0,e.opacity=1,e.saturation=0,e}var Sa,Ta,Ia=((window&&window.__extends||(Sa=function(e,t){return(Sa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Sa(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Aa,Ta=R),Aa._cloneCustomizer=function(e){if(e instanceof as)return e},Aa);function Aa(){var e=null!==Ta&&Ta.apply(this,arguments)||this;return e.url=void 0,e.coordinates=void 0,e}var ka,Pa,Oa=((window&&window.__extends||(ka=function(e,t){return(ka=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ka(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(xa,Pa=Qs),xa.prototype._getSourceIds=function(){var e=new Set;return e.add(this._getSourceId()),e},xa.prototype.onAdd=function(e){Pa.prototype.onAdd.call(this,e)},xa);function xa(){return null!==Pa&&Pa.apply(this,arguments)||this}var Ra,Ma,K=((window&&window.__extends||(Ra=function(e,t){return(Ra=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ra(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Na,Ma=Oa),Na.prototype.getOptions=function(){return Xi(this.options,Ia._cloneCustomizer)},Na.prototype.setOptions=function(e){var t=(new Ia).merge(this.options,Xi(e,Ia._cloneCustomizer)),r="string"==typeof e.url&&e.url!==this.getOptions().url,o=void 0!==e.coordinates&&e.coordinates!==this.getOptions().coordinates;this.map&&(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),(e=this.map._getMap().getSource(this._getSourceId()))&&e.updateImage(t)),this.options=t,r?this.reloadImage():o&&this.updateTransform()},Na.prototype.getPositions=function(t){return this.transform.then(function(e){return e.toTarget(t)})},Na.prototype.getPixels=function(t){return this.transform.then(function(e){return e.toSource(t)})},Na.getCoordinatesFromRefPoints=function(e,t,r,o){return new Fi(r,o).toTarget([[0,0],[e,0],[e,t],[0,t]])},Na.getCoordinatesFromEdges=function(e,t,r,o,n){"number"!=typeof n&&(n=0);r=[Math.min(o,r),t,Math.max(o,r),e],e=Ai.getCenter(r);return Xn([Ai.getNorthWest(r),Ai.getNorthEast(r),Ai.getSouthEast(r),Ai.getSouthWest(r)],e,n)},Na.prototype._buildLayers=function(){var e={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&&(e.filter=this.options.filter),[e]},Na.prototype._getLayerIds=function(){return[this.id]},Na.prototype._buildSource=function(){return{type:"image",url:this.options.url,coordinates:this.options.coordinates}},Na.prototype._getSourceId=function(){return this.getId()+"-ImageSource"},Na.prototype.reloadImage=function(){var r=this;this.options.url&&(this.transform=new Promise(function(t,e){r.img.onload=function(){var e=[[0,0],[r.img.width,0],[r.img.width,r.img.height],[0,r.img.height]];t(new Fi(e,r.options.coordinates)),r.isLoading=!1},r.img.onerror=r.img.onabort=function(){e("Failed to load image")},r.isLoading=!0,r.img.src=r.options.url}))},Na.prototype.updateTransform=function(){var e;this.isLoading||(e=[[0,0],[this.img.width,0],[this.img.width,this.img.height],[0,this.img.height]],this.transform=Promise.resolve(new Fi(e,this.options.coordinates)))},Na.prototype._getSourceWrapper=function(){var e=this._getSourceId(),t=this._buildSource();return new Rs(e,t)},Na);function Na(e,t){t=Ma.call(this,t)||this;return t.isLoading=!1,t.options=(new Ia).merge(Xi(e,Ia._cloneCustomizer)),t.img=new Image,t.reloadImage(),t}var La,Da,qa=((window&&window.__extends||(La=function(e,t){return(La=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}La(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(ja,Da=Ne),ja);function ja(){var e=null!==Da&&Da.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.lineCap="round",e.lineJoin="round",e.blur=0,e.strokeColor="#1E90FF",e.strokeDashArray=void 0,e.strokeGradient=void 0,e.offset=0,e.strokeOpacity=1,e.translate=new an(0,0),e.translateAnchor="map",e.strokeWidth=2,e}var Ua,Ha,ve=window&&window.__extends||(Ua=function(e,t){return(Ua=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ua(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),za=window&&window.__assign||function(){return(za=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},Ba=(ve(Fa,Ha=Qs),Fa.prototype.getOptions=function(){return Xi(this.options,qa._cloneCustomizer)},Fa.prototype.getSource=function(){return this.options.source},Fa.prototype.setOptions=function(e){e=(new qa).merge(this.options,Xi(e,qa._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);this._updateBaseProperties(e,this.options),this._updatePaintProperty("line-blur",e.blur,this.options.blur),this._updateLayoutProperty("line-cap",e.lineCap,this.options.lineCap),this._updateLayoutProperty("line-join",e.lineJoin,this.options.lineJoin),this._updatePaintProperty("line-offset",e.offset,this.options.offset),this._updatePaintProperty("line-color",e.strokeColor,this.options.strokeColor),this._updatePaintProperty("line-dasharray",e.strokeDashArray,this.options.strokeDashArray),this._updatePaintProperty("line-gradient",e.strokeGradient,this.options.strokeGradient),this._updatePaintProperty("line-opacity",e.strokeOpacity,this.options.strokeOpacity),this._updatePaintProperty("line-width",e.strokeWidth,this.options.strokeWidth),this._updatePaintProperty("line-translate",e.translate,this.options.translate),this._updatePaintProperty("line-translate-anchor",e.translateAnchor,this.options.translateAnchor)}this.options=e},Fa.prototype._buildLayers=function(){return[za(za(za(za({id:this.id,type:"line"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof as?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:za(za(za({"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})]},Fa.prototype._getLayerIds=function(){return[this.id]},Fa.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof as?e.add(this.options.source.getId()):e.add(this.options.source),e},Fa);function Fa(e,t,r){t=Ha.call(this,t)||this;return t.options=(new qa).merge(Xi(r,qa._cloneCustomizer)),t.options.source=e||t.options.source,t}var Ka,Ga,Ya=((window&&window.__extends||(Ka=function(e,t){return(Ka=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ka(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Za,Ga=Ne),Za);function Za(){var e=null!==Ga&&Ga.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.base=0,e.fillColor="#1E90FF",e.height=0,e.fillOpacity=1,e.fillPattern=void 0,e.translate=new an(0,0),e.translateAnchor="map",e.verticalGradient=!0,e}var Wa,Va,Pe=window&&window.__extends||(Wa=function(e,t){return(Wa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Wa(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Ja=window&&window.__assign||function(){return(Ja=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},ve=(Pe(Qa,Va=Qs),Qa.prototype.getOptions=function(){return Xi(this.options,Ya._cloneCustomizer)},Qa.prototype.getSource=function(){return this.options.source},Qa.prototype.setOptions=function(e){e=(new Ya).merge(this.options,Xi(e,Ya._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);this._updateBaseProperties(e,this.options),this._updatePaintProperty("fill-extrusion-base",e.base,this.options.base),this._updatePaintProperty("fill-extrusion-color",e.fillColor,this.options.fillColor),this._updatePaintProperty("fill-extrusion-height",e.height,this.options.height),this._updatePaintProperty("fill-extrusion-opacity",e.fillOpacity,this.options.fillOpacity),this._updatePaintProperty("fill-extrusion-pattern",e.fillPattern,this.options.fillPattern),this._updatePaintProperty("fill-extrusion-translate",e.translate,this.options.translate),this._updatePaintProperty("fill-extrusion-translate-anchor",e.translateAnchor,this.options.translateAnchor),this._updatePaintProperty("fill-extrusion-vertical-gradient",e.verticalGradient,this.options.verticalGradient)}this.options=e},Qa.prototype._buildLayers=function(){return[Ja(Ja(Ja(Ja({id:this.id,type:"fill-extrusion"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof as?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:Ja(Ja({"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})]},Qa.prototype._getLayerIds=function(){return[this.id]},Qa.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof as?e.add(this.options.source.getId()):e.add(this.options.source),e},Qa);function Qa(e,t,r){t=Va.call(this,t)||this;return t.options=(new Ya).merge(Xi(r,Ya._cloneCustomizer)),t.options.source=e||t.options.source,t}var Xa,$a,Pe=window&&window.__extends||(Xa=function(e,t){return(Xa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Xa(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),ec=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},tc=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},rc=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},oc=(Pe(nc,$a=Ne),nc.prototype.merge=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var o=!1,n=!1;try{for(var i=ec(t),s=i.next();!s.done;s=i.next()){var a=s.value;a&&(a.hasOwnProperty("fillColor")?n=!(o=!0):a.hasOwnProperty("fillPattern")&&(o=!(n=!0)))}}catch(e){c={error:e}}finally{try{s&&!s.done&&(e=i.return)&&e.call(i)}finally{if(c)throw c.error}}var c=$a.prototype.merge.apply(this,rc([],tc(t)));return o?c.fillPattern=void 0:n&&(c.fillColor=void 0),c},nc);function nc(){var e=null!==$a&&$a.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.fillColor="#1E90FF",e.fillOpacity=.5,e.fillPattern=void 0,e}var ic,sc,ac=((window&&window.__extends||(ic=function(e,t){return(ic=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ic(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(cc,sc=Qs),cc.prototype.getOptions=function(){return Xi(this.options,oc._cloneCustomizer)},cc.prototype.getSource=function(){return this.options.source},cc.prototype.setOptions=function(e){e=(new oc).merge(this.options,Xi(e,oc._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);this._updateBaseProperties(e,this.options),this._updatePaintProperty("fill-color",e.fillColor,this.options.fillColor),this._updatePaintProperty("fill-opacity",e.fillOpacity,this.options.fillOpacity),this._updatePaintProperty("fill-pattern",e.fillPattern,this.options.fillPattern)}this.options=e},cc.prototype._buildLayers=function(){var e={id:this.id,type:"fill",source:this.options.source instanceof as?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&&(e.filter=this.options.filter),this.options.sourceLayer&&(e["source-layer"]=this.options.sourceLayer),this.options.fillPattern?e.paint["fill-pattern"]=this.options.fillPattern:e.paint["fill-color"]=this.options.fillColor,[e]},cc.prototype._getLayerIds=function(){return[this.id]},cc.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof as?e.add(this.options.source.getId()):e.add(this.options.source),e},cc);function cc(e,t,r){t=sc.call(this,t)||this;return t.options=(new oc).merge(Xi(r,oc._cloneCustomizer)),t.options.source=e||t.options.source,t}var uc,lc,hc=((window&&window.__extends||(uc=function(e,t){return(uc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}uc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(pc,lc=k),pc);function pc(){var e=null!==lc&&lc.apply(this,arguments)||this;return e.allowOverlap=!1,e.anchor="bottom",e.ignorePlacement=!1,e.image="marker-blue",e.offset=new an(0,0),e.optional=!1,e.padding=2,e.pitchAlignment="auto",e.rotation=0,e.rotationAlignment="auto",e.size=1,e.opacity=1,e}var dc,fc,gc=((window&&window.__extends||(dc=function(e,t){return(dc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}dc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(yc,fc=k),yc);function yc(){var e=null!==fc&&fc.apply(this,arguments)||this;return e.allowOverlap=!1,e.anchor="center",e.textField=void 0,e.font=["StandardFont-Regular"],e.ignorePlacement=!1,e.justify="center",e.offset=new an(0,0),e.optional=!1,e.padding=2,e.pitchAlignment="auto",e.rotation=0,e.rotationAlignment="auto",e.size=16,e.color="#000000",e.haloBlur=0,e.haloColor="rgba(0,0,0,0)",e.haloWidth=0,e.opacity=1,e}var mc,vc,_c=((window&&window.__extends||(mc=function(e,t){return(mc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}mc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(wc,vc=Ne),wc);function wc(){var e=null!==vc&&vc.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.iconOptions=new hc,e.textOptions=new gc,e.placement="point",e.zOrder="auto",e.lineSpacing=250,e}var bc,Cc,Pe=window&&window.__extends||(bc=function(e,t){return(bc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}bc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Ec=window&&window.__assign||function(){return(Ec=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},Sc=(Pe(Tc,Cc=Qs),Tc.prototype.getOptions=function(){return Xi(this.options,_c._cloneCustomizer)},Tc.prototype.getSource=function(){return this.options.source},Tc.prototype.setOptions=function(e){var t=(new _c).merge(this.options,Xi(e,_c._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);var r=this.options,o=t.iconOptions,n=r.iconOptions,i=t.textOptions,e=r.textOptions;this._updateBaseProperties(t,r),this._updateLayoutProperty("symbol-spacing",t.lineSpacing,r.lineSpacing),this._updateLayoutProperty("symbol-placement",t.placement,r.placement),this._updateLayoutProperty("symbol-sort-key",t.sortKey,r.sortKey),this._updateLayoutProperty("symbol-z-order",t.zOrder,r.zOrder),this._updateLayoutProperty("icon-allow-overlap",o.allowOverlap,n.allowOverlap),this._updateLayoutProperty("icon-anchor",o.anchor,n.anchor),this._updateLayoutProperty("icon-ignore-placement",o.ignorePlacement,n.ignorePlacement),this._updateLayoutProperty("icon-image",o.image,n.image),this._updateLayoutProperty("icon-offset",o.offset,n.offset),this._updatePaintProperty("icon-opacity",o.opacity,n.opacity),this._updateLayoutProperty("icon-optional",o.optional,n.optional),this._updateLayoutProperty("icon-padding",o.padding,n.padding),this._updateLayoutProperty("icon-pitch-alignment",o.pitchAlignment,n.pitchAlignment),this._updateLayoutProperty("icon-rotate",o.rotation,n.rotation),this._updateLayoutProperty("icon-rotation-alignment",o.rotationAlignment,n.rotationAlignment),this._updateLayoutProperty("icon-size",o.size,n.size),this._updateLayoutProperty("text-allow-overlap",i.allowOverlap,e.allowOverlap),this._updateLayoutProperty("text-anchor",i.anchor,e.anchor),this._updatePaintProperty("text-color",i.color,e.color),this._updateLayoutProperty("text-font",i.font,e.font),this._updateLayoutProperty("text-ignore-placement",i.ignorePlacement,e.ignorePlacement),this._updateLayoutProperty("text-justify",i.justify,e.justify),this._updatePaintProperty("text-halo-blur",i.haloBlur,e.haloBlur),this._updatePaintProperty("text-halo-color",i.haloColor,e.haloColor),this._updatePaintProperty("text-halo-width",i.haloWidth,e.haloWidth),this._updateLayoutProperty("text-offset",i.offset,e.offset),this._updatePaintProperty("text-opacity",i.opacity,e.opacity),this._updateLayoutProperty("text-optional",i.optional,e.optional),this._updateLayoutProperty("text-padding",i.padding,e.padding),this._updateLayoutProperty("text-pitch-alignment",i.pitchAlignment,e.pitchAlignment),this._updateLayoutProperty("text-radial-offset",i.radialOffset,e.radialOffset),this._updateLayoutProperty("text-rotate",i.rotation,e.rotation),this._updateLayoutProperty("text-rotation-alignment",i.rotationAlignment,e.rotationAlignment),this._updateLayoutProperty("text-size",i.size,e.size),this._updateLayoutProperty("text-variable-anchor",i.variableAnchor,e.variableAnchor),this._updateLayoutProperty("text-field",i.textField,e.textField)}this.options=t},Tc.prototype._buildLayers=function(){var e=Ec(Ec(Ec(Ec({id:this.id,type:"symbol"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof as?this.options.source.getId():this.options.source,layout:Ec(Ec({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&&(e.layout["symbol-sort-key"]=this.options.sortKey),void 0!==this.options.textOptions.radialOffset&&(e.layout["text-radial-offset"]=this.options.textOptions.radialOffset),void 0!==this.options.textOptions.variableAnchor&&(e.layout["text-variable-anchor"]=this.options.textOptions.variableAnchor),[e]},Tc.prototype._getLayerIds=function(){return[this.id]},Tc.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof as?e.add(this.options.source.getId()):e.add(this.options.source),e},Tc);function Tc(e,t,r){t=Cc.call(this,t)||this;return t.options=(new _c).merge(Xi(r,_c._cloneCustomizer)),t.options.source=e||t.options.source,t}var Ic,Ac,Pe=window&&window.__extends||(Ic=function(e,t){return(Ic=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ic(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),kc=window&&window.__assign||function(){return(kc=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},Pc=(Pe(Oc,Ac=as),Oc.prototype._buildSource=function(){return this.source},Oc.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this.source,r=e.source,o=t.type===r.type&&t.url===r.url&&(void 0===t.tiles&&void 0===r.tiles||t.tiles&&r.tiles&&t.tiles.length===r.tiles.length&&t.tiles.every(function(e,t){return e===r.tiles[t]}))&&t.minzoom===r.minzoom&&t.maxzoom===r.maxzoom&&t.bounds===r.bounds&&t.attribution===r.attribution,n="raster"!==t.type||"raster"===t.type&&t.type===r.type&&t.tileSize===r.tileSize&&t.scheme===r.scheme,e="raster-dem"!==t.type||"raster-dem"===t.type&&t.type===r.type&&t.tileSize===r.tileSize&&t.encoding===r.encoding,t="vector"!==t.type||"vector"===t.type&&t.type===r.type&&t.promoteId===r.promoteId&&t.scheme===r.scheme;return o&&n&&e&&t},Oc.prototype._modifySource=function(e,t){if("raster"!==e.type&&"raster-dem"!==e.type&&"vector"!==e.type||!e.tiles){if("raster"!==e.type&&"raster-dem"!==e.type&&"vector"!==e.type||!e.url)throw new Error("Source definition must define a TileJSON 'url' or a 'tiles' array.");e.url="string"==typeof e.url?e.url:new D({domain:h,path:e.url.path,queryParams:kc(kc({},t),e.url.queryParams)}).toString()}else{var r=e.tiles.map(function(e){return"string"==typeof e?e:new D({domain:h,path:e.path,queryParams:kc(kc({},t),e.queryParams)}).toString()});e.tiles=r}return e},Oc);function Oc(e,t,r){e=Ac.call(this,e)||this;return e.source=e._modifySource(t,r),e}var xc,Rc,Mc=((window&&window.__extends||(xc=function(e,t){return(xc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}xc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Nc,Rc=R),Nc);function Nc(){var e=null!==Rc&&Rc.apply(this,arguments)||this;return e.bounds=[-180,-85.0511,180,85.0511],e.minSourceZoom=0,e.maxSourceZoom=22,e.tileSize=512,e.isTMS=!1,e.subdomains=void 0,e.tileUrl=void 0,e}var Lc,Dc,R=window&&window.__extends||(Lc=function(e,t){return(Lc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Lc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),qc=window&&window.__assign||function(){return(qc=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},jc=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Uc=(R(Hc,Dc=Oa),Hc.prototype.getOptions=function(){return Xi(this.options,Mc._cloneCustomizer)},Hc.prototype.setOptions=function(e){e=(new Mc).merge(this.options,Xi(e,Mc._cloneCustomizer));if(this.map){if(!$o(e.bounds,this.options.bounds)||e.isTMS!==this.options.isTMS||e.maxSourceZoom!==this.options.maxSourceZoom||e.minSourceZoom!==this.options.minSourceZoom||!$o(e.subdomains,this.options.subdomains)||e.tileSize!==this.options.tileSize||e.tileUrl!==this.options.tileUrl)return this.options=e,void this.map.layers.add(this);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)}this.options=e},Hc.prototype._setOptionsNoUpdate=function(e){this.options=(new Mc).merge(this.options,Xi(e,Mc._cloneCustomizer))},Hc.prototype._buildLayers=function(){return[qc(qc({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})]},Hc.prototype._getLayerIds=function(){return[this.id]},Hc.prototype._buildSource=function(){var e,t;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 r=[];try{for(var o=jc(this.options.subdomains),n=o.next();!n.done;n=o.next()){var i=n.value;r.push(this.options.tileUrl.replace(/{subdomain}/g,i))}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}t=r}else t=[this.options.tileUrl]}return qc({type:"raster",bounds:this.options.bounds,maxzoom:this.options.maxSourceZoom,minzoom:this.options.minSourceZoom,scheme:this.options.isTMS?"tms":"xyz",tileSize:this.options.tileSize},t&&{tiles:t})},Hc.prototype._getSourceId=function(){return this.getId()+"-RasterSource"},Hc.prototype._getSourceWrapper=function(){var e=this._getSourceId(),t=this._buildSource();return new Pc(e,{name:e,tiles:t.tiles,type:t.type,url:t.url})},Hc);function Hc(e,t){t=Dc.call(this,t)||this;return e&&t.setOptions(e),t}var zc,Bc,Fc=((window&&window.__extends||(zc=function(e,t){return(zc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}zc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Kc,Bc=Ne),Kc);function Kc(){var e=null!==Bc&&Bc.apply(this,arguments)||this;return e.renderer=void 0,e}var Gc,Yc,Zc=((window&&window.__extends||(Gc=function(e,t){return(Gc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Gc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Wc,Yc=Qs),Wc.prototype.getOptions=function(){return Xi(this.options,Fc._cloneCustomizer)},Wc.prototype.setOptions=function(e){e=(new Fc).merge(this.options,Xi(e,Fc._cloneCustomizer));this.map&&this.map.triggerRepaint(),this.options=e},Wc.prototype.onAdd=function(e){var t,r;Yc.prototype.onAdd.call(this,e),this.map.events.add("stylechanged",this._onStyleChange),this.options.renderer&&this.glContext&&null!==(r=(t=this.options.renderer).onAdd)&&void 0!==r&&r.call(t,e,this.glContext)},Wc.prototype.onRemove=function(){var e,t;this.options.renderer&&this.glContext&&null!==(t=(e=this.options.renderer).onRemove)&&void 0!==t&&t.call(e,this.map,this.glContext),this.map.events.remove("stylechanged",this._onStyleChange),this.glContext=null,Yc.prototype.onRemove.call(this)},Wc.prototype._buildLayers=function(){var n=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(e,t){n.glContext=t},onRemove:function(e,t){},prerender:function(e,t){var r,o;n._shouldRender()&&null!==(o=(r=n.options.renderer).prerender)&&void 0!==o&&o.call(r,e,t)},render:function(e,t){n._shouldRender()&&n.options.renderer.render(e,t)}}]},Wc.prototype._getLayerIds=function(){return[this.id]},Wc.prototype._getSourceIds=function(){return(new Set).add(this.source.getId())},Wc.prototype._shouldRender=function(){if(this.map){var e=this.map.getCamera().zoom;return this.options.visible&&this.options.minZoom<=e&&this.options.maxZoom>e}return!1},Wc);function Wc(e,t){var r=Yc.call(this,e)||this;return r._onStyleChange=function(){var e,t;r.map._getMap().getLayer(r.id)||(e=r.map,t=null===(t=r.map.layers._getUserLayers().find(function(e){return e.layer.getId()==r.id}))||void 0===t?void 0:t.before,e.layers.remove(r),e.layers.add(r,t))},r.options=(new Fc).merge(Xi(t,Fc._cloneCustomizer)),r.source=new ps,r}var ve=Object.freeze({__proto__:null,BubbleLayer:pa,Layer:Qs,LineLayer:Ba,PolygonExtrusionLayer:ve,PolygonLayer:ac,SymbolLayer:Sc,TileLayer:Uc,HeatMapLayer:Ee,ImageLayer:K,WebGLLayer:Zc}),Vc=(Jc.convertHtmlString=function(e){if("string"!=typeof e)return e;var t=document.createElement("div");return t.innerHTML=e,t},Jc.parseWithFilter=function(e,t,r,o){var n=this;if(void 0===t&&(t=function(e){return!0}),void 0===r&&(r=function(e){return e}),void 0===o&&(o=function(){return document.createElement("div")}),"string"==typeof e){var i=(new DOMParser).parseFromString(e,"text/html").body;if(0==i.children.length)return r(i.innerHTML);var s,i=1==i.children.length&&1==i.childNodes.length?i.children[0]:(s=o(),Array.from(i.childNodes).map(function(e){return s.append(e)}),s)}else i=e;return Array.from(i.children).forEach(function(e){return n.parseWithFilter(e,t,r)}),t(i)?r(i):(i.parentNode&&i.parentNode.removeChild(i),null)},Jc);function Jc(){}var Qc,Xc,$c=function(e){return wt(e)&&1===e.nodeType&&!Zr(e)},eu=((window&&window.__extends||(Qc=function(e,t){return(Qc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Qc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(tu,Xc=k),tu._cloneCustomizer=function(e){if($c(e))return e},tu);function tu(){var e=null!==Xc&&Xc.apply(this,arguments)||this;return e.anchor="none",e.draggable=!1,e.closeButton=!0,e.content=document.createElement("span"),e.fillColor="#FFFFFF",e.pixelOffset=new an(0,0),e.position=new gi(0,0),e.showPointer=!0,e}var ru,ou,Ee=window&&window.__extends||(ru=function(e,t){return(ru=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ru(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),nu=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},iu=(Ee(su,ou=Q),su.prototype.setPopupOptions=function(e){this.setOptions(e)},su.prototype.setOptions=function(e){var t=(new eu).merge(this.options,Xi(e,eu._cloneCustomizer));t.content!==this.options.content?(this.htmlContent.remove(),this.htmlContent=this._createHtmlContent(t),this.contentDiv.prepend(this.htmlContent)):t.draggable!==this.options.draggable&&this._setDraggable(this.htmlContent,t.draggable),t.closeButton&&!this.closeBtn?(this.closeBtn=this._createCloseButton(),this.contentDiv.appendChild(this.closeBtn),e=z("close"),this.contentDiv.appendChild(e),B(e,this.closeBtn,!0)):!t.closeButton&&this.closeBtn&&(this.contentDiv.removeChild(this.closeBtn),delete this.closeBtn),t.showPointer&&!this.arrowDiv?(this.arrowDiv=this._createArrowDiv(),this.containerDiv.appendChild(this.arrowDiv)):!t.showPointer&&this.arrowDiv&&(this.containerDiv.removeChild(this.arrowDiv),delete this.arrowDiv),t.fillColor!==this.options.fillColor&&(this.containerDiv.style.borderColor=t.fillColor,this.contentDiv.style.backgroundColor=t.fillColor),this.marker&&(t.anchor!==this.options.anchor?"none"===this.options.anchor?(this.autoAnchor!==t.anchor&&this._replaceMarker(this.map,t),this.map.events.remove("move",this._onMove),delete this.autoAnchor):(this._replaceMarker(this.map,t),"none"===t.anchor&&this.map.events.add("move",this._onMove)):($o(t.position,this.options.position)||this.marker.setLngLat(t.position),$o(t.pixelOffset,this.options.pixelOffset)||this.marker.setOffset(t.pixelOffset))),this.options=t},su.prototype.getPopupOptions=function(){return this.getOptions()},su.prototype.getOptions=function(){return Xi(this.options,eu._cloneCustomizer)},su.prototype.getPopupContainer=function(){return this.containerDiv},su.prototype._dragToPixel=function(e){this.dragging||(this.dragging=!0,this.contentDiv.style.pointerEvents="none",this._invokeEvent("dragstart",{type:"dragstart",target:this}));e=[e[0]+this.dragOffset[0],e[1]+this.dragOffset[1]],e=nu(this.map.pixelsToPositions([e]),1)[0];this.options.position=e,this.marker.setLngLat(this.options.position),this._invokeEvent("drag",{type:"drag",target:this})},su.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},su.prototype._createContainerDiv=function(e){var t=this,r=document.createElement("div");r.classList.add(su.Css.container),r.classList.add(su.Css.hidden),r.style.borderColor=e.fillColor,r.setAttribute("role","dialog"),r.setAttribute("aria-label","Map Information Window");var o=!1;return r.addEventListener("keydown",function(e){"Tab"!==e.key&&"Escape"!==e.key&&"Esc"!==e.key||(o=!0)}),r.addEventListener("keyup",function(e){"Tab"!==e.key&&"Escape"!==e.key&&"Esc"!==e.key||(o=!1)}),r.addEventListener("focusin",function(e){t.map&&!t.isOpen()&&(t.open(t.map),e.target instanceof HTMLElement&&e.target.focus())}),r.addEventListener("focusout",function(e){o&&e.relatedTarget instanceof Node&&!r.contains(e.relatedTarget)&&(o=!1,t.isOpen()&&t.close())}),r},su.prototype._createContentDiv=function(e){var t=document.createElement("div");return t.classList.add(su.Css.content),t.style.backgroundColor=e.fillColor,t.setAttribute("tabindex","0"),this.htmlContent=this._createHtmlContent(e),t.appendChild(this.htmlContent),t},su.prototype._createArrowDiv=function(){var e=document.createElement("div");return e.classList.add(su.Css.arrow),e},su.prototype._createCloseButton=function(){var e=document.createElement("button");return e.addEventListener("click",this.close),e.classList.add(su.Css.close),e.setAttribute("aria-label","close"),e.setAttribute("tabindex","0"),e.innerHTML="×",e},su.prototype._createHtmlContent=function(e){var t=Vc.convertHtmlString(e.content);return e.draggable&&this._setDraggable(t,e.draggable),t},su.prototype._createMarker=function(e,t){var r=this.marker?this.marker.getLngLat():e.position,r="none"===e.anchor?(this.autoAnchor=t||"bottom",this.containerDiv.classList.add(this.autoAnchor),new u.Marker({anchor:this.autoAnchor,element:this.containerDiv,offset:e.pixelOffset}).setLngLat(r)):(this.containerDiv.classList.add(e.anchor),new u.Marker({anchor:e.anchor,element:this.containerDiv,offset:e.pixelOffset}).setLngLat(r));return r},su.prototype._getAutoAnchor=function(e,t){var r,o,n,i=this.containerDiv.offsetWidth,s=this.containerDiv.offsetHeight,a=[];return(n=this.marker?(o=(r=e._getMap().project(this.marker.getLngLat())).x,r.y):(n=nu(e.positionsToPixels([t.position]),1),o=(n=nu(n[0],2))[0],n[1]))<s?a.push("top"):n>e.getCanvas().offsetHeight-s&&a.push("bottom"),o<i/2?a.push("left"):o>e.getCanvas().offsetWidth-i/2&&a.push("right"),0<a.length?a.join("-"):"bottom"},su.prototype._replaceMarker=function(e,t,r){var o=this.containerDiv.nextElementSibling;this.marker.remove(),this.containerDiv.classList.remove(this.autoAnchor||this.options.anchor),this.marker=this._createMarker(t,r),this.marker.addTo(e._getMap()),e.popups._getCollectionDiv().insertBefore(this.containerDiv,o||null)},su.prototype._setDraggable=function(e,t){t?(e.addEventListener("mousedown",this._onDown),e.addEventListener("touchstart",this._onDown),e.addEventListener("dragstart",this._onDragStart)):(e.removeEventListener("mousedown",this._onDown),e.removeEventListener("touchstart",this._onDown),e.removeEventListener("dragstart",this._onDragStart))},su.Css={arrow:"popup-arrow",close:"popup-close",container:"popup-container",content:"popup-content-container",hidden:"hidden-accessible-element"},su);function su(e){var r=ou.call(this)||this;return r.attach=function(e){r.map!==e&&(r.map&&r.remove(),r.map=e,r.marker=r._createMarker(r.options),r.marker.addTo(r.map._getMap()),r.map.popups._getCollectionDiv().appendChild(r.containerDiv),r.map.popups.add(r))},r.open=function(e){if(!e&&!r.map)throw new Error("Must specify a map to open on or attach to a map in advance");r.attach(e||r.map),r.containerDiv.classList.remove(su.Css.hidden),r.map.events.add("move",r._onMove),r._onMove(),r._invokeEvent("open",{target:r,type:"open"})},r.close=function(){r.map&&r.map.events.remove("move",r._onMove),r.containerDiv.classList.add(su.Css.hidden),r._invokeEvent("close",{target:r,type:"close"})},r.remove=function(){r.map&&(r.marker.remove(),r.containerDiv.classList.remove(r.autoAnchor||r.options.anchor),r.map.events.remove("move",r._onMove),r.map.popups.remove(r),delete r.map,delete r.marker,delete r.autoAnchor)},r.isOpen=function(){return r.map&&!r.containerDiv.classList.contains(su.Css.hidden)},r._onMove=function(){var e=r._getAutoAnchor(r.map,r.options);e!==r.autoAnchor&&(r._replaceMarker(r.map,r.options,e),r.map.events.add("move",r._onMove))},r._onDown=function(e){r.map.popups._addDraggedPopup(r);var t=nu(r.map.positionsToPixels([r.options.position]),1)[0];"mousedown"===e.type?r.dragOffset=[t[0]-e.clientX,t[1]-e.clientY]:"touchstart"===e.type&&(r.dragOffset=[t[0]-e.touches[0].clientX,t[1]-e.touches[0].clientY])},r._onDragStart=function(e){e.preventDefault()},r.options=(new eu).merge(Xi(e,eu._cloneCustomizer)),r.containerDiv=r._createContainerDiv(r.options),r.contentDiv=r._createContentDiv(r.options),r.containerDiv.appendChild(r.contentDiv),r.options.showPointer&&(r.arrowDiv=r._createArrowDiv(),r.containerDiv.appendChild(r.arrowDiv)),r.options.closeButton&&(r.closeBtn=r._createCloseButton(),r.contentDiv.appendChild(r.closeBtn),e=z("close"),r.contentDiv.appendChild(e),B(e,r.closeBtn,!0)),r}var au,cu,uu=((window&&window.__extends||(au=function(e,t){return(au=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}au(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(lu,cu=k),lu._cloneCustomizer=function(e){if(e instanceof iu||$c(e))return e},lu);function lu(){var e=null!==cu&&cu.apply(this,arguments)||this;return e.anchor="bottom",e.color="#1A73AA",e.draggable=!1,e.htmlContent='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24.5 36.5" id="marker_'+tn()+'" 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>',e.pixelOffset=new an(0,0),e.position=new gi(0,0),e.popup=void 0,e.secondaryColor="white",e.text=void 0,e.visible=!0,e}var hu,pu,du=((window&&window.__extends||(hu=function(e,t){return(hu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}hu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(fu,pu=Q),fu.prototype.getOptions=function(){return Xi(this.options,uu._cloneCustomizer)},fu.prototype.getElement=function(){return this.marker.getElement()},fu.prototype.setOptions=function(e){e=(new uu).merge(this.options,Xi(e,uu._cloneCustomizer));$o(e.htmlContent,this.options.htmlContent)&&e.anchor===this.options.anchor?("string"!=typeof e.htmlContent||e.color===this.options.color&&e.text===this.options.text&&e.secondaryColor===this.options.secondaryColor||(this.element.innerHTML=this._getSubbedHtmlString(e)||""),e.draggable!==this.options.draggable&&(this._setDraggable(e.draggable),this.marker.setDraggable(e.draggable)),$o(e.pixelOffset,this.options.pixelOffset)||this.marker.setOffset(e.pixelOffset),$o(e.position,this.options.position)||this.marker.setLngLat(e.position),e.visible!==this.options.visible&&(e.visible?this.element.classList.remove(fu.hiddenClass):this.element.classList.add(fu.hiddenClass))):(this.marker.remove(),this._buildMarker(e),this.map&&(this.marker.addTo(this.map._getMap()),this._getCollectionContainer().appendChild(this.element))),this.options=e},fu.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)}},fu.prototype._addToMap=function(e,t){this.map&&this.map!==e&&this._removeFromMap(),t&&(this.options.position=Hr(t),this.marker.setLngLat(this.options.position)),this.map!==e&&(this.map=e,this.marker.addTo(e._getMap()),this._getCollectionContainer().appendChild(this.element))},fu.prototype._removeFromMap=function(){this.map&&(this.marker.remove(),delete this.map)},fu.prototype._getId=function(){if(this.element)return("string"==typeof this.options.htmlContent?this.element.firstChild:this.element).id},fu.prototype._buildMarker=function(e){var t;"string"==typeof e.htmlContent?(t=this._getSubbedHtmlString(e)||"",this.element=Vc.convertHtmlString(t)):this.element=e.htmlContent,this.element.classList.add(fu.containerClass),e.draggable&&this._setDraggable(!0),e.visible||this.element.classList.add(fu.hiddenClass),this.marker=new u.Marker({element:this.element,offset:e.pixelOffset,draggable:e.draggable,anchor:e.anchor}).setLngLat(e.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)},fu.prototype._getSubbedHtmlString=function(e){return"string"==typeof e.htmlContent?e.htmlContent.replace(/{color}/gi,e.color||"").replace(/{secondaryColor}/gi,e.secondaryColor||"").replace(/{text}/gi,e.text||""):null},fu.prototype._getCollectionContainer=function(){var e=this.map.getCanvasContainer().querySelector("."+fu.collectionContainerClass);return e||((e=document.createElement("div")).classList.add(fu.collectionContainerClass),this.map.getCanvasContainer().appendChild(e)),e},fu.prototype._setDraggable=function(e){e?this.element.addEventListener("dragstart",this._onEleDragStart):this.element.removeEventListener("dragstart",this._onEleDragStart)},fu.collectionContainerClass="marker-collection-container",fu.hiddenClass="hidden-accessible-element",fu.containerClass="marker-container",fu);function fu(e){var t=pu.call(this)||this;return t._onDrag=function(){var e=t.marker.getLngLat().wrap();t.options.position=new gi(e.lng,e.lat),t._invokeEvent("drag",{type:"drag",target:t})},t._onDragStart=function(){t._invokeEvent("dragstart",{type:"dragstart",target:t})},t._onDragEnd=function(){t._invokeEvent("dragend",{type:"dragend",target:t})},t._bubbleElementEvent=function(e){t._invokeEvent(e.type,{type:e.type,target:t})},t._onEleDragStart=function(e){e.preventDefault()},t.options=(new uu).merge(Xi(e,uu._cloneCustomizer)),t._buildMarker(t.options),t}var gu=(yu.parse=function(e){var t=(e=e.toLowerCase()).lastIndexOf("-");return-1!==t?{code:e,language:e.substring(0,t),region:e.substring(t+1)}:{code:e,language:e}},yu);function yu(){}var mu={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"}}}},vu=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"},_u=(wu.getCode=function(e){var t=gu.parse(e);return-1===mu.sensitiveUserRegions.indexOf(t.region)?this.getLocaleData(t).code:e},wu.getStrings=function(e){e=this.getLocaleData(e);return mu.locales.defaultLanguage.defaultRegion.code===e.code?new Promise(function(e){e(new vu)}):new D({domain:t,path:mu.localizationsPath+"/"+e.strings}).get().then(function(e){return e},function(){return new vu})},wu.getLocaleData=function(e){if("string"==typeof e&&(e=gu.parse(e)),mu.locales[e.code])return mu.locales[e.code].defaultRegion;var t;if(mu.locales[e.language])t=mu.locales[e.language];else{if(-1!==e.language.indexOf("-"))return this.getLocaleData(e.language);t=mu.locales.defaultLanguage}return e.region&&t[e.region]?t[e.region]:t.defaultRegion},wu);function wu(){}var bu=(Cu.getEdgeOrIEVersion=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(0<t)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(0<e.indexOf("Trident/")){var r=e.indexOf("rv:");return parseInt(e.substring(r+3,e.indexOf(".",r)),10)}r=e.indexOf("Edge/");return 0<r?parseInt(e.substring(r+5,e.indexOf(".",r)),10):-1},Cu.isEdgeOrIE=function(){return-1!==this.getEdgeOrIEVersion()},Cu.isIE=function(){var e=this.getEdgeOrIEVersion();return-1!==e&&e<=11},Cu);function Cu(){}var Eu,K=window&&window.__extends||(Eu=function(e,t){return(Eu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Eu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Su=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},Tu=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e};(Ee=c.AuthenticationType||(c.AuthenticationType={})).subscriptionKey="subscriptionKey",Ee.aad="aad",Ee.anonymous="anonymous",Ee.sas="sas";var Iu,Au,ku=(K(Pu,Iu=k),Pu.prototype.setSubscriptionKey=function(e){this.authType=c.AuthenticationType.subscriptionKey,this.subscriptionKey=e},Pu.prototype.setAadProperties=function(e,t,r,o,n){this.authType=c.AuthenticationType.aad,this.authContext=n||this.authContext,this.aadInstance=o||this.aadInstance,this.clientId=e,this.aadAppId=t,this.aadTenant=r},Pu.prototype.setTokenCallbackFunction=function(e){this.authType=c.AuthenticationType.anonymous,this.getToken=e},Pu.prototype.setSasCallbackFunction=function(e){this.authType=c.AuthenticationType.sas,this.getToken=e},Pu.prototype.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Iu.prototype.merge.apply(this,Tu([],Su(e)));return r.authType===c.AuthenticationType.subscriptionKey?r.authContext=r.aadAppId=r.getToken=void 0:r.authType===c.AuthenticationType.aad?r.subscriptionKey=r.getToken=void 0:r.authType===c.AuthenticationType.anonymous?r.subscriptionKey=r.authContext=r.aadAppId=void 0:r.authType===c.AuthenticationType.sas&&(r.authContext=r.subscriptionKey=r.aadAppId=void 0),r},Pu);function Pu(){var e=null!==Iu&&Iu.apply(this,arguments)||this;return e.authType=void 0,e.subscriptionKey=void 0,e.clientId=void 0,e.aadAppId=void 0,e.aadTenant=void 0,e.aadInstance=void 0,e.getToken=void 0,e.sasToken=void 0,e.authContext=void 0,e}var Ou="NGT",xu=tn(),Ru=e,Mu=t,Nu=r,Lu=o,Du=w,qu=new ku,ju=!1,Uu=!1,Hu=!1,zu=!1,Bu=!1,Fu=!1,Ku=!1,Gu=!1,Yu=!1;function Zu(){return Object.assign({},qu)}function Wu(){return Mu}function Vu(){return Ru}function Ju(){return Nu}function Qu(){return Lu}function Xu(){return Du}function $u(){return u.workerCount}function el(){return u.maxParallelImageRequests}function tl(){return Ou}function rl(){return xu}function ol(){return qu.authType===c.AuthenticationType.subscriptionKey?qu.subscriptionKey:void 0}function nl(){return Au}function il(e){qu=(new ku).merge(qu,e),Yu=!0}function sl(e){Ru=e,Uu=!0}function al(e){Nu=e,Hu=!0}function cl(e){0<e&&(u.workerCount=e,Bu=!0)}function ul(e){0<e&&(u.maxParallelImageRequests=e,Fu=!0)}function ll(e){Ou=_u.getCode(e),Ku=!0}function hl(e){xu=e,Gu=!0}function pl(e){qu.setSubscriptionKey(e),Yu=!0}function dl(e){Au=e,ju=!0}function fl(e,t){if(t=Math.abs(t||1),"string"==typeof e&&El[e.toLowerCase()]){for(var r=El[e.toLowerCase()],o=/calc\(([0-9.]+)[px]*\s*\*\s*\{scale\}\)/gi,n=r,i=o.exec(r);i;)n=n.replace(i[0],parseFloat(i[1])*t+""),i=o.exec(r);return n=n.replace("{scale}",t+"")}throw new Error("Invalid templateName.")}function gl(){return Yu}function yl(){return Uu}function ml(){return Hu}function vl(){return Bu}function _l(){return Fu}function wl(){return Ku}function bl(){return Gu}function Cl(){return ju}var El={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>'},Sl=(Tl.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},Tl);function Tl(){}var Il,Al,kl=((window&&window.__extends||(Il=function(e,t){return(Il=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Il(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Pl,Al=k),Pl);function Pl(){var e=null!==Al&&Al.apply(this,arguments)||this;return e.copyrightMessage=void 0,e.copyrightContent=void 0,e.customAttribution=void 0,e.showFeedbackLink=!0,e.showLogo=!0,e}var Ol,xl,Rl=((window&&window.__extends||(Ol=function(e,t){return(Ol=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ol(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Ml,xl=re),Ml.prototype.onAdd=function(e){return this.container=this.buildContainer(e,c.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},Ml.prototype.onRemove=function(){xl.prototype.onRemove.call(this),delete this.container},Ml.prototype.setOptions=function(e){var t=this,r=(new kl).merge(this.options,e);r.copyrightMessage===this.options.copyrightMessage&&r.customAttribution===this.options.customAttribution||(this.copyrightDiv.innerText=this.textAttribution(r)),r.copyrightContent!==this.options.copyrightContent&&(this.options.copyrightContent&&(e=Array.from(this.copyrightDiv.children).find(function(e){return e===t.options.copyrightContent}),this.copyrightDiv.removeChild(e)),0<this.copyrightDiv.childNodes.length?this.copyrightDiv.insertBefore(r.copyrightContent,this.copyrightDiv.childNodes[0]):this.copyrightDiv.appendChild(r.copyrightContent),this.options.copyrightContent=r.copyrightContent),!r.showLogo&&this.logoAnchor?this.addRemoveLogo(!1):r.showLogo&&!this.logoAnchor&&this.addRemoveLogo(!0),!r.showFeedbackLink&&this.feedbackAnchor?this.addRemoveFeedbackDiv(!1):r.showFeedbackLink&&!this.feedbackAnchor&&this.addRemoveFeedbackDiv(!0),this.options=r},Ml.prototype.getDefaultAttributions=function(){var e=(new Date).getFullYear(),t=["©"+e+" TomTom"];return this.options.showLogo||t.push("©"+e+" Microsoft"),t},Ml.prototype.buildCopyrightDiv=function(){var e=document.createElement("div");return e.innerText=this.textAttribution(this.options)||"",e},Ml.prototype.buildFeedbackLink=function(){var e=document.createElement("a");return e.setAttribute("alt","Give Feedback"),e.setAttribute("aria-label","Give Feedback"),e.href="https://feedback.azuremaps.com",e.target="_blank",e.rel="noopener",e.className="azure-map-feedback",e},Ml.prototype.addRemoveFeedbackDiv=function(e){e?(this.feedbackAnchor=this.buildFeedbackLink(),this.tooltip=z("Give Feedback"),this.container.appendChild(this.feedbackAnchor),this.container.appendChild(this.tooltip),B(this.tooltip,this.feedbackAnchor)):(this.feedbackAnchor.remove(),this.tooltip.remove(),delete this.tooltip,delete this.feedbackAnchor)},Ml.prototype.addRemoveLogo=function(e){e?(this.logoAnchor=document.createElement("a"),this.logoAnchor.className="azure-map-logo",this.logoAnchor.href="https://aka.ms/azuremaps",this.logoAnchor.setAttribute("aria-label","Visit azure.microsoft.com"),this.logoAnchor.setAttribute("target","_blank"),this.container.appendChild(this.logoAnchor),this.logoTooltip=z("Visit azure.microsoft.com"),this.container.appendChild(this.logoTooltip),B(this.logoTooltip,this.logoAnchor)):(this.logoAnchor.remove(),this.logoTooltip.remove(),delete this.logoAnchor)},Ml);function Ml(e){var t=xl.call(this)||this;return t.textAttribution=function(e){return[t.options.copyrightMessage,t.options.customAttribution].filter(function(e){return e}).join("")},t.options=(new kl).merge(e),t}var Nl=(Ll.throwOnError=function(e,t){function r(e){throw o.off("error",r),e.error}var o=e instanceof W0?e._getMap():e;o.on("error",r);t=t();return o.off("error",r),t},Ll.tryCatch=function(e,t,r,o){try{return this.throwOnError(e,t)}catch(e){return r(e)}finally{"function"==typeof o&&o()}},Ll.tryFinally=function(e,t,r){try{return this.throwOnError(e,t)}finally{r()}},Ll);function Ll(){}var Dl=window&&window.__assign||function(){return(Dl=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},ql=(jl.prototype.request=function(e){var t={domain:this.map.getServiceOptions().domain,path:"search/address/reverse/json",queryParams:Dl({"api-version":"1.0",language:e.style.language,limit:1,query:Jn(e.position[1])+","+Qn(e.position[0])},e.style.view&&{view:e.style.view})};return new D((null===(e=this.map.authentication)||void 0===e?void 0:e.signRequest(t))||t).get()},jl);function jl(e){this.map=e}var Ul=(Hl.prototype.cache=function(e,t,r,o){o=e+"_"+r[0]+"_"+r[1]+"_"+o;this._labelIdx[t.labelType]||(this._labelIdx[t.labelType]=[],this._labelCache[t.labelType]=[]),-1===this._labelIdx[t.labelType].indexOf(o)&&(this._labelCache[t.labelType].push({name:e,radius:t.radius,minZoom:t.minZoom,maxZoom:t.maxZoom||24,position:r}),this._labelIdx[t.labelType].push(o))},Hl.prototype.getNearestLabel=function(e,t,r){var o=null,n=this._labelCache[e];if(n)for(var i,s=1/0,a=0,c=n.length;a<c;a++)r>=n[a].minZoom&&r<=n[a].maxZoom&&((i=Un(n[a].position,t))<=n[a].radius&&i<=s&&(s=i,o=n[a]));return o},Hl.prototype._preloadCache=function(e){if(!this._preloadedCache.has(e)){this._preloadedCache.add(e);var t={source:[],labelType:"water",minZoom:0,radius:395e4,polygonSources:[]},r=e,o=r.indexOf("-");switch(r=-1!==o?r.substr(0,o):r){case"fr":this.cache("Océan Pacifique",t,[-170,32],e),this.cache("Océan Pacifique",t,[-138,-27],e),this.cache("Océan Atlantique",t,[-40,32],e),this.cache("Océan Atlantique",t,[-17,-29],e);break;case"es":this.cache("Océan Pacifique",t,[-170,32],e),this.cache("Océan Pacifique",t,[-138,-27],e),this.cache("Océano Atlántico",t,[-40,32],e),this.cache("Océano Atlántico",t,[-17,-29],e);break;case"pt":this.cache("Oceano Pacífico",t,[-170,32],e),this.cache("Oceano Pacífico",t,[-138,-27],e),this.cache("Oceano Atlântico",t,[-40,32],e),this.cache("Oceano Atlântico",t,[-17,-29],e);break;case"ja":this.cache("太平洋",t,[-170,32],e),this.cache("太平洋",t,[-138,-27],e);break;case"en":this.cache("Pacific Ocean",t,[-170,32],e),this.cache("Pacific Ocean",t,[-138,-27],e),this.cache("Atlantic Ocean",t,[-40,32],e),this.cache("Atlantic Ocean",t,[-17,-29],e),this.cache("Indian Ocean",t,[77,-26],e)}}},Hl);function Hl(){this._labelCache={},this._labelIdx={},this._preloadedCache=new Set}var zl=window&&window.__awaiter||function(e,s,a,c){return new(a=a||Promise)(function(r,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(o,n)}i((c=c.apply(e,s||[])).next())})},Bl=window&&window.__generator||function(r,o){var n,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=o.call(r,a)}catch(e){t=[6,e],i=0}finally{n=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},Fl=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},Kl=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},Gl=(Yl.prototype.dispose=function(){this._disposed=!0;var e=this._map._getMap();e.off("move",this._onMove),e.off("moveend",this._onMoveEnd),e.off("styledata",this._onStyleData),e.off("rotate",this._onRotate);e=this._map.getCanvas();e.removeEventListener("mousedown",this._onPointerDown),e.removeEventListener("touchstart",this._onPointerDown),this._map.getMapContainer().removeEventListener("keydown",this._shortcutListener)},Yl.prototype._getEventPos=function(e){if("touches"in e){var t=e.touches[0],r=e.target.getBoundingClientRect();return[t.pageX-r.left,t.pageY-r.top]}return[e.offsetX,e.offsetY]},Yl.prototype._checkThresholds=function(e,t){return this._checkZoomThreshold(e.zoom,t.zoom)||this._checkPitchThreshold(e.pitch,t.pitch)||this._checkLocThreshold(e.center,t.center)||this._checkHeadingThreshold(e.bearing,t.bearing)},Yl.prototype._checkZoomThreshold=function(e,t){return this._round(e)!==this._round(t)},Yl.prototype._checkPitchThreshold=function(e,t){return Math.abs(e-t)>=this._pitchThreshold},Yl.prototype._checkLocThreshold=function(e,t){t=Fl(this._map.positionsToPixels([t,e]),2),e=t[0],t=t[1];return an.getDistance(e,t)>=this._moveThreshold},Yl.prototype._checkHeadingThreshold=function(e,t){e<0&&(e+=360),t<0&&(t+=360);t=Math.abs(e-t);return(t=180<t?360-t:t)>=this._headingThreshold},Yl.prototype._getLocDesc=function(h,p,d){return zl(this,void 0,void 0,function(){var t,r,o,n,i,s,a,c,u,l=this;return Bl(this,function(e){switch(e.label){case 0:return"blank"===d?[3,3]:this._map._getMap().loaded()?[3,2]:[4,new Promise(function(e){return l._map._getMap().once("idle",e)})];case 1:e.sent(),e.label=2;case 2:for(t={},r=this._map.positionsToPixels([h.center])[0],Nl.tryCatch(this._map,function(){var t=l._map._getMap();o=t.queryRenderedFeatures(r,{layers:l._polygonStyleLayer.filter(function(e){return t.getLayer(e)}),filter:["==",["geometry-type"],"Polygon"]})},function(){}),n=null,o&&0<o.length&&(n=o[0]),i=null,s=0,a=this._labelConfig.length;s<a;s++)c=this._labelConfig[s],h.zoom>=c.minZoom?c.polygonSources?n&&-1!==c.polygonSources.indexOf(n.layer["source-layer"])?(i=c.labelType,this._getClosestLabel(c,h,p,t,!1)):this._getClosestLabel(c,h,p,t,!0):this._getClosestLabel(c,h,p,t,!1):this._getClosestLabel(c,h,p,t,!0);return 8<=h.zoom&&this._processRoads(t,h,p),this._labelCache.forEach(function(e){t[e]||(u=null,(u="water"!==e&&"majorPoi"!==e||e===i?Yl._labelCache.getNearestLabel(e,h.center,h.zoom):u)&&(t[e]=u.name))}),[2,this._processLocInfo(h,i,t,!0,this._restFallback)];case 3:return[2,this._processLocInfo(h,null,null,!1,!1)]}})})},Yl.prototype._getHeadingDesc=function(e){var t=e.bearing;switch(t<0&&(t+=360),t=this._round(t,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 t+" degrees"}},Yl.prototype._getClosestLabel=function(e,t,r,o,n){for(var i=e.radius,s=0,a=e.source.length;s<a;s++){var c={sourceLayer:e.source[s],filter:["has","name"]},u=this._map._getMap().querySourceFeatures(this._baseVectorTileSourceId,c),l=null,h=1/0,p=this._labelCache.has(e.labelType);if(!n||p)for(var d=0,f=u.length;d<f;d++){var g,y="Point"===u[d].geometry.type?u[d]:pi(t.center,u[d].geometry);n||(g="Point"===u[d].geometry.type?Un(t.center,y.geometry.coordinates):y.properties.distance)<h&&(h=g,l=u[d]),p&&Yl._labelCache.cache(u[d].properties.name,e,y.geometry.coordinates,r)}n||(c=e.labelType+"Dis",l&&h<=i&&("number"!=typeof o[c]||h<=o[c])&&(o[e.labelType]=l.properties.name,o[c]=h))}},Yl.prototype._processRoads=function(e,t,r,o){var n=this._map._getMap().queryRenderedFeatures(o,{filter:["==",["geometry-type"],"LineString"]});if(n){for(var i,s=void 0,a=void 0,c=void 0,u=void 0,l=0,h=n.length;l<h;l++)this._roadLayers.has(n[l].layer["source-layer"])&&n[l].properties.name&&""!==n[l].properties.name&&(i=pi(t.center,n[l]),(!c||i.properties.distance<c.properties.distance)&&(s&&n[l].properties.name===s.properties.name?c=i:s&&n[l].properties.name===s.properties.name?(!u||i.properties.distance<u.properties.distance)&&(u=i,a=n[l]):(u=c,a=s,c=i,s=n[l])));s&&(!e.country&&s.properties.country_code&&(e.country=s.properties.country_code,e.countryDis=0,Yl._labelCache.cache(e.country,{source:[],labelType:"country",radius:5e3,minZoom:0},c.geometry.coordinates,r)),!e.state&&s.properties.country_subdivision&&(e.state=s.properties.country_subdivision,e.stateDis=0,Yl._labelCache.cache(e.state,{source:[],labelType:"state",radius:5e3,minZoom:4},c.geometry.coordinates,r)),15<=t.zoom&&(o=this._map.positionsToPixels([t.center,c.geometry.coordinates]),(an.getDistance(o[0],o[1])<this._roadPixelRadius||c.properties.distance<this._minRoadDistance)&&(e.road=s.properties.name),a&&(r=this._map.positionsToPixels([u.geometry.coordinates]),(an.getDistance(o[0],r[0])<this._minIntersectionPixelDistance||u.properties.distance<this._minRoadDistance)&&(e.secondRoad=a.properties.name,e.secondRoadDis=u.properties.distance))))}},Yl.prototype._getActionDesc=function(e){if(this._lastCam){var t,r,o=[];return this._checkLocThreshold(e.center,this._lastCam.center)&&(r=["panned"],0===(t=Math.round(Kn(this._lastCam.center,e.center)))||360===t?r.push("north"):t<90?r.push("north east"):90===t?r.push("east"):t<180?r.push("south east"):180===t?r.push("south"):t<270?r.push("south west"):270===t?r.push("west"):t<360&&r.push("north west"),t=Un(this._lastCam.center,e.center,pn.meters),r.push(1e3<t?Dn(t/1e3,2)+" kilometers":Dn(t,2)+" meters"),o.push(r.join(" "))),this._checkZoomThreshold(e.zoom,this._lastCam.zoom)&&((r=["zoomed"]).push(this._lastCam.zoom<e.zoom?"in":"out"),1<=(t=Math.abs(this._lastCam.zoom-e.zoom))&&(t=Math.ceil(t),r.push(1<t?t+" levels":t+" level")),this._getCanonicalZoom(this._lastCam.zoom)!==this._getCanonicalZoom(e.zoom)&&r.push("to "+this._getCanonicalZoom(e.zoom)+" level"),e.zoom>=e.maxZoom&&r.push("Zoom In button disabled, maximum zoom level reached"),t=Ai.getSouth(e.bounds)<=-Cn&&Ai.getNorth(e.bounds)>=Cn,(e.zoom<=e.minZoom||t)&&r.push("Zoom Out button disabled, minimum zoom level reached"),o.push(r.join(" "))),this._checkPitchThreshold(e.pitch,this._lastCam.pitch)&&(r=this._round(e.pitch,this._pitchThreshold),o.push("pitched to "+r+" degrees"),60!==e.pitch&&0!==e.pitch||(r=60===e.pitch?"maximum":"minimum",o.push("reached "+r+" of "+e.pitch+" degrees"))),this._checkHeadingThreshold(this._lastCam.bearing,e.bearing)&&o.push("rotated to "+this._getHeadingDesc(e)),o.join(" and ")||null}return null},Yl.prototype._getCanonicalZoom=function(e){return(e=this._round(e))<2?"world":e<5?"country":e<11?"state province":e<15?"city":"street"},Yl.prototype._processLocInfo=function(n,i,s,a,c){var u=this;return new Promise(function(t,e){var r=[];if(a){var o=[];if(s&&(i&&("water"===i&&s.water?o.push(s.water):"majorPoi"===i&&s.majorPoi&&o.push(s.majorPoi)),0===o.length&&(s.majorPoi&&8<=n.zoom?o.push(s.majorPoi):(s.poi&&14<=n.zoom?o.push(s.poi):s.road&&15<=n.zoom&&(s.secondRoad?o.push(s.road+" & "+s.secondRoad):o.push(s.road)),s.neighbourhood&&12<=n.zoom&&o.push(s.neighbourhood),s.city&&6<=n.zoom&&o.push(s.city)),s.state&&4<=n.zoom&&o.push(s.state),0===o.length?s.water?o.push(s.water):s.country&&o.push(s.country):1===o.length&&s.state&&4<=n.zoom&&s.country&&o.push(s.country))),0<o.length)r.push("<p>Location: ",o.join(", "),".</p>");else if(c&&"water"!==i)return void u._reverseGeocodeDescription(n).then(function(e){t(e)},function(){e("<p>Location: unknown</p>")})}u._returnDetailedDescriptions&&(r.push("<p>Zoom: ",Dn(n.zoom,2),".</p>"),r.push("<p>Latitude: ",Dn(n.center[1],5),".</p>"),r.push("<p>Longitude: ",Dn(n.center[0],5),".</p>")),t(r.join(""))})},Yl.prototype._reverseGeocodeDescription=function(n){var i=this;return new Promise(function(r){var o=i._map.getStyle();i._reverseSearch.request({position:n.center,style:o}).then(function(e){var t={};e&&e.addresses&&0<e.addresses.length&&e.addresses[0].address&&((e=e.addresses[0].address).country&&(t.country=e.country,Yl._labelCache.cache(t.country,{source:[],labelType:"country",radius:5e3,minZoom:0},n.center,o.language)),e.countrySubdivision&&(t.state=e.countrySubdivision,Yl._labelCache.cache(t.state,{source:[],labelType:"state",radius:5e3,minZoom:4},n.center,o.language)),e.municipality&&(t.city=e.municipality,Yl._labelCache.cache(t.state,{source:[],labelType:"city",radius:1e3,minZoom:10},n.center,o.language)),e.streetNameAndNumber?t.road=e.streetNameAndNumber:e.street&&(t.road=e.street)),i._processLocInfo(n,null,t,!0,!1).then(function(e){r(e)})},function(e){i._processLocInfo(n,null,null,!0,!1).then(function(e){r(e)})}).catch(function(e){i._processLocInfo(n,null,null,!0,!1).then(function(e){r(e)})})})},Yl.prototype._round=function(e,t){return void 0===t&&(t=1),Math.round(e/t)*t},Yl._baseVectorTileSourceIds=["microsoft.base","vectorTiles","bing-mvt"],Yl._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"]}],Yl._roadLayersBing=new Set(["road"]),Yl);function Yl(e,t){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(n){return zl(i,void 0,void 0,function(){var t,r,o;return Bl(this,function(e){switch(e.label){case 0:return n.altKey&&n.ctrlKey&&68===n.keyCode?(this._returnDetailedDescriptions=!this._returnDetailedDescriptions,t=this._map.getCamera(),o=this._map.getStyle(),r=o.language.toLowerCase(),o=o.style.toLowerCase(),[4,this._getLocDesc(t,r,o)]):[3,2];case 1:o=e.sent(),this._descCallback(o),e.label=2;case 2:return[2]}})})},this._onRotate=function(){i._rotateTimeout||(Date.now()-i._lastHeadingTime>=i._headUpdateLimit?i._rotateTimeout=setTimeout(i._updateHeading,le.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(e){e.fromControl?i._controlTimeout=setTimeout(i._updateCam,i._controlEventDelay):i._updateCam()},this._onStyleData=function(){setTimeout(i._updateStyle)},this._onPointerDown=function(e){i._lastPointerPos=i._getEventPos(e),i._pointerTimeout=setTimeout(function(){return zl(i,void 0,void 0,function(){var t,r,o;return Bl(this,function(e){switch(e.label){case 0:return r=this._map.getStyle(),t=r.language.toLowerCase(),o=r.style.toLowerCase(),(r=this._map.getCamera()).center=this._map.pixelsToPositions([this._lastPointerPos])[0],[4,this._getLocDesc(r,t,o)];case 1:return o=e.sent(),this._descCallback(o),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(e){var t=i._getEventPos(e),e=i._lastPointerPos[0]-t[0],t=i._lastPointerPos[1]-t[1];Math.sqrt(e*e+t*t)>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 e,t=i._map.getCamera();i._lastHead&&!i._checkHeadingThreshold(t.bearing,i._lastHead)||(e=i._getHeadingDesc(t),i._lastHead=t.bearing,i._descCallback("<p>Map heading "+e+".</p>"),i._lastHeadingTime=Date.now()),delete i._rotateTimeout},this._updateStyle=function(){return zl(i,void 0,void 0,function(){var t,r,o,n;return Bl(this,function(e){switch(e.label){case 0:return(t=this._map.getCamera(),o=this._map.getStyle(),r=o.language.toLowerCase(),o=o.style.toLowerCase(),this._lastLang===r)?[3,2]:(Yl._labelCache._preloadCache(r),[4,this._getLocDesc(t,r,o)]);case 1:return n=e.sent(),[3,4];case 2:return this._lastStyle===o||"blank"!==this._lastStyle?[3,4]:[4,this._getLocDesc(t,r,o)];case 3:n=e.sent(),e.label=4;case 4:return this._lastLang=r,this._lastStyle=o,n&&this._descCallback(n),[2]}})})},this._updateCam=function(e){void 0===e&&(e=!1);var r,o,t,n=i._map.getCamera();(!i._lastCam||0<i._actionQueue.length||i._checkThresholds(n,i._lastCam))&&(t=i._map.getStyle(),r=t.language.toLowerCase(),o=t.style.toLowerCase(),(t=i._getActionDesc(n))&&i._actionQueue.push(t),i._lastCam=n,i._moveTimeout&&(clearTimeout(i._moveTimeout),delete i._moveTimeout),i._moveTimeout=setTimeout(function(){return zl(i,void 0,void 0,function(){var t;return Bl(this,function(e){switch(e.label){case 0:return clearTimeout(this._rotateTimeout),delete this._rotateTimeout,[4,this._getLocDesc(n,r,o)];case 1:return t=e.sent(),0<this._actionQueue.length?(this._descCallback("<p>Map "+this._actionQueue.join(", then ")+".</p>"+t),this._actionQueue=[]):this._descCallback(t),[2]}})})},e?0:i._camUpdateDelay))},this._map=e,this._restFallback=e.getServiceOptions().enableAccessibilityLocationFallback,this._descCallback=t,this._reverseSearch=new ql(e),Yl._labelCache||(Yl._labelCache=new Ul),this._lastLang=this._map.getStyle().language.toLowerCase(),Yl._labelCache._preloadCache(this._lastLang),this._map.events.addOnce("idle",function(){var e;i._disposed||(i._updateCam(!0),i._baseVectorTileSourceId=Yl._baseVectorTileSourceIds.find(function(e){return i._map.sources.getById(e)}),"bing-mvt"===i._baseVectorTileSourceId&&(i._labelConfig=Yl._labelConfigBing,i._roadLayers=Yl._roadLayersBing),i._polygonStyleLayer=i._labelConfig.reduce(function(e,t){return t.polygonSources&&e.push.apply(e,Kl([],Fl(t.polygonSources))),e},[]),(e=i._map._getMap()).on("move",i._onMove),e.on("moveend",i._onMoveEnd),e.on("styledata",i._onStyleData),e.on("rotate",i._onRotate),(e=i._map.getCanvas()).addEventListener("mousedown",i._onPointerDown),e.addEventListener("touchstart",i._onPointerDown))}),this._map.getMapContainer().addEventListener("keydown",this._shortcutListener)}var Zl,Wl,Vl,Jl=function(e){var r=this;this.addToMap=function(){null==r.mapViewDesc&&(r.initializeMapLiveStateInfo(),r.initializeMapStyleInfo(),r.createMapKeyBindingInfo(),r.map.getMapContainer().setAttribute("role","application"),r.map.getMapContainer().setAttribute("aria-label","Map Application"),r.map.getCanvasContainer().setAttribute("aria-live","polite"),r.map.getCanvasContainer().setAttribute("aria-describedby","atlas-map-state atlas-map-style"),r.map.getCanvas().setAttribute("aria-label","Interactive Map"),r.map.getCanvas().setAttribute("aria-describedby","atlas-map-shortcuts"),r.map.getCanvas().setAttribute("alt","Interactive Map"))},this.removeFromMap=function(){null!=r.mapViewDesc&&r.mapViewDesc.dispose(),delete r.mapViewDesc,null!=r.atlasMapKeyBindings&&r.map.getCanvasContainer().removeChild(r.atlasMapKeyBindings),delete r.atlasMapKeyBindings,null!=r.atlasMapLiveStateInfo&&r.map.getCanvasContainer().removeChild(r.atlasMapLiveStateInfo),delete r.atlasMapLiveStateInfo,null!=r.atlasMapStyleInfo&&r.map.getCanvasContainer().removeChild(r.atlasMapStyleInfo),delete r.atlasMapStyleInfo,r.map.getMapContainer().removeAttribute("role"),r.map.getMapContainer().removeAttribute("aria-label"),r.map.getCanvasContainer().removeAttribute("aria-live"),r.map.getCanvasContainer().removeAttribute("aria-describedby"),r.map.getCanvas().removeAttribute("aria-label"),r.map.getCanvas().removeAttribute("aria-describedby"),r.map.getCanvas().removeAttribute("alt"),r.map.events.remove("stylechanged",r.updateMapStyle)},this.createMapKeyBindingInfo=function(){r.atlasMapKeyBindings=document.createElement("div"),r.atlasMapKeyBindings.setAttribute("tabindex","-1"),r.atlasMapKeyBindings.setAttribute("aria-hidden","true"),r.atlasMapKeyBindings.id="atlas-map-shortcuts",r.atlasMapKeyBindings.classList.add("hidden-accessible-element"),r.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"),r.map.getCanvasContainer().appendChild(r.atlasMapKeyBindings);var e=[189,187,38,37,39,40],t=r.map._getMap()._canvas;null!=t&&t.addEventListener("keyup",function(t){e.find(function(e){return t.keyCode===e})&&(r.atlasMapKeyBindings.innerHTML="")})},this.initializeMapLiveStateInfo=function(){r.mapViewDesc=new Gl(r.map,r.updateMapState),r.atlasMapLiveStateInfo=document.createElement("div"),r.atlasMapLiveStateInfo.setAttribute("tabindex","-1"),r.atlasMapLiveStateInfo.setAttribute("aria-hidden","true"),r.atlasMapLiveStateInfo.id="atlas-map-state",r.atlasMapLiveStateInfo.classList.add("hidden-accessible-element"),r.map.getCanvasContainer().appendChild(r.atlasMapLiveStateInfo)},this.initializeMapStyleInfo=function(){r.atlasMapStyleInfo=document.createElement("div"),r.atlasMapStyleInfo.setAttribute("tabindex","-1"),r.atlasMapStyleInfo.setAttribute("aria-hidden","true"),r.atlasMapStyleInfo.id="atlas-map-style",r.atlasMapStyleInfo.classList.add("hidden-accessible-element"),r.map.events.add("stylechanged",r.updateMapStyle),r.map.getCanvasContainer().appendChild(r.atlasMapStyleInfo)},this.updateMapStyle=function(){r.atlasMapStyleInfo.innerHTML="<p>Map style: "+r.map.getStyle().style+".</p>"},this.updateMapState=function(e){r.atlasMapLiveStateInfo.innerHTML=e},this.map=e},Ql=function(e){var r=this;this.listenerEnabled=!1,this.lastFlowMode="none",this.addToMap=function(){if(!r.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.");r.listenerEnabled||(r.map.events.add("styledata",r.addToMap),r.listenerEnabled=!0);var e,t=r.map.getTraffic();"none"===t.flow||(e=r.map.layers.getLayerById("traffic_"+t.flow))&&(r.lastFlowMode=t.flow,e._updateLayoutProperty("visibility","visible","none"))},this.removeFromMap=function(){var e;r.map.getTraffic();"none"!=r.lastFlowMode&&((e=r.map.layers.getLayerById("traffic_"+r.lastFlowMode))&&e._updateLayoutProperty("visibility","none","visible"),r.lastFlowMode="none"),r.listenerEnabled&&(r.map.events.remove("styledata",r.addToMap),r.listenerEnabled=!1)},this.map=e},Xl=((window&&window.__extends||(Zl=function(e,t){return(Zl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Zl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))($l,Wl=rn),$l.getIncidentTypeName=function(e,t){switch(e){case 0:return t.Unknown;case 1:return t.Accident;case 2:return t.Fog;case 3:return t.Danger;case 4:return t.Rain;case 5:return t.Ice;case 6:return t.Jam;case 7:return t.LaneClosed;case 8:return t.RoadClosed;case 9:return t.RoadWorks;case 10:return t.Wind;case 11:return t.Flood;case 12:return t.Detour;default:return t.Unknown}},$l.getIncidentTypeIconName=function(e){switch(e){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"}},$l.getSeverityColorName=function(e){switch(e){case 0:return"grey";case 1:return"yellow";case 2:return"orange";case 3:return"red";default:return"grey"}},$l.getSeverityColorHexCode=function(e){switch(e){case 0:return"#B5B6B7";case 1:return"#F4C951";case 2:return"#F4873F";case 3:return"#F04F4E";default:return"#B5B6B7"}},$l);function $l(e,t,r){var o=null!==(n=null!==(o=null!==(n=null!==(o=null!==(n=null!==(o=null!==(n=null!==(o=null!==(n=null!==(o=null!==(n=null!==(o=null!==(n=e.icon_category_12)&&void 0!==n?n:e.icon_category_11)&&void 0!==o?o:e.icon_category_10)&&void 0!==n?n:e.icon_category_9)&&void 0!==o?o:e.icon_category_8)&&void 0!==n?n:e.icon_category_7)&&void 0!==o?o:e.icon_category_6)&&void 0!==n?n:e.icon_category_5)&&void 0!==o?o:e.icon_category_4)&&void 0!==n?n:e.icon_category_3)&&void 0!==o?o:e.icon_category_2)&&void 0!==n?n:e.icon_category_1)&&void 0!==o?o:e.icon_category_0)&&void 0!==n?n:e.icon_category,n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=e.description_12)&&void 0!==n?n:e.description_11)&&void 0!==n?n:e.description_10)&&void 0!==n?n:e.description_9)&&void 0!==n?n:e.description_8)&&void 0!==n?n:e.description_7)&&void 0!==n?n:e.description_6)&&void 0!==n?n:e.description_5)&&void 0!==n?n:e.description_4)&&void 0!==n?n:e.description_3)&&void 0!==n?n:e.description_2)&&void 0!==n?n:e.description_1)&&void 0!==n?n:e.description_0)&&void 0!==n?n:e.description,e={icon:$l.getSeverityColorName(e.magnitude)+"-"+$l.getIncidentTypeIconName(o),incidentType:$l.getIncidentTypeName(o,r),description:n,delay:e.delay,color:$l.getSeverityColorHexCode(e.magnitude),id:e.id};return Wl.call(this,t,e)||this}(o=Vl=Vl||{}).DELAY="delay",o.LENGTH="length",o.FROM="from",o.TO="to";var eh=(th.build=function(e,t){void 0===t&&(t="en-US");var r=document.createElement("div");r.classList.add("incident-popup-title"),r.classList.add("font-segoeui-b"),r.innerText=e.properties.incidentType,r.setAttribute("aria-label","Incident Type "+e.properties.incidentType);var o=document.createElement("div");o.classList.add("incident-popup-subtitle"),o.classList.add("font-segoeui-b"),o.setAttribute("aria-label","Incident Description "+e.properties.description),o.innerText=e.properties.description;var n=document.createElement("div");n.classList.add("incident-popup-header"),n.style.backgroundColor=e.properties.color,n.appendChild(r),n.appendChild(o);var i,s,a,o=document.createElement("div");o.classList.add("incident-popup-body"),e.properties.delay&&(i=Math.floor(e.properties.delay/60)+" min",i=this.createInfoSection(i,Vl.DELAY),o.appendChild(i)),e.properties.length&&(i=new Intl.NumberFormat([t,"en-US"],{maximumFractionDigits:2}),a=void 0,a="en-US"===t?(s=qn(e.properties.length,"meters","miles"),i.format(s)+" miles"):(s=qn(e.properties.length,"meters","kilometers"),i.format(s)+" km"),a=this.createInfoSection(a,Vl.LENGTH),o.appendChild(a)),e.properties.from&&(a=this.createInfoSection(e.properties.from,Vl.FROM),o.appendChild(a)),e.properties.to&&(c=this.createInfoSection(e.properties.to,Vl.TO),o.appendChild(c));var c=document.createElement("div");return c.classList.add("incident-popup-content"),c.appendChild(n),c.appendChild(o),new iu({content:c,position:e.geometry.coordinates})},th.createInfoSection=function(e,t){var r=document.createElement("div");r.classList.add("incident-popup-info");var o=document.createElement("div");o.classList.add("icon"),o.classList.add(t);var n=document.createElement("span");return n.classList.add("message"),n.classList.add("font-segoeui"),n.setAttribute("aria-label","Incident "+t+" "+e),n.innerText=e,r.appendChild(o),r.appendChild(n),r},th);function th(){}var rh=window&&window.__awaiter||function(e,s,a,c){return new(a=a||Promise)(function(r,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(o,n)}i((c=c.apply(e,s||[])).next())})},oh=window&&window.__generator||function(r,o){var n,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=o.call(r,a)}catch(e){t=[6,e],i=0}finally{n=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},nh=(ih.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"]]]},ih);function ih(e){var n=this;this.incidentLayerName="incidents",this.incidentSourceName="mapcontrol_traffic_incident",this.addToMap=function(){n.map.sources.getById(n.incidentSourceName)||n.map.sources.add(n.vectorTileSource),n.map.layers.getLayerById(n.incidentLayerName)||n.map.layers.add(n.incidentLayer,"labels"),n.clickPopup=new iu({position:[0,0],pixelOffset:[0,-18]}),n.map.addEventListener("mouseover",n.incidentLayerName,n.cursorToPointer),n.map.addEventListener("mouseleave",n.incidentLayerName,n.cursorToDefault),n.map.addEventListener("click",n.incidentLayerName,n.openIncidentPopup),n.map.events.addOnce("idle",n.setAccessiblePopups),n.map.events.add("moveend",n.setAccessiblePopups)},this.accessiblePopups=[],this.setAccessiblePopups=function(){return rh(n,void 0,void 0,function(){var t,i,s,a,c,u,l=this;return oh(this,function(e){switch(e.label){case 0:return this.accessiblePopups.forEach(function(e){return e.remove()}),this.accessiblePopups=[],t=this.map.layers.getRenderedShapes(this.map.getCamera().bounds,this.incidentLayer),[4,this.map._getLocalizedStrings()];case 1:return i=e.sent(),s=function(t,r){var e=t[r],o=e.geometry.coordinates,o=new un(new gi(o[0],o[1])),o=new Xl(e.properties,o,i),n=eh.build(o,l.incidentLanguage),o=n.getPopupContainer();return o.addEventListener("focusin",function(e){l.clickPopup.remove(),l.accessiblePopups.filter(function(e){return e!==n}).forEach(function(e){return e.remove()}),0<=r-1&&a(n,s(t,r-1)),r+1<t.length&&u(s(t,r+1)),2<=r&&r==t.length-1&&c(s(t,0)),0==r&&2<=t.length&&u(s(t,t.length-1))}),r==t.length-1&&o.addEventListener("focusout",function(e){null===e.relatedTarget&&n.close()}),l.accessiblePopups.push(n),n},a=function(e,t){t.open(l.map),t.close();t=t.getPopupContainer(),e=e.getPopupContainer();e.parentElement.insertBefore(t,e)},c=function(e){e.open(l.map),e.close();var t=e.getPopupContainer(),e=t.parentElement;e.insertBefore(t,e.firstElementChild)},u=function(e){e.open(l.map),e.close()},0<t.length&&u(s(t,0)),1<t.length&&u(s(t,t.length-1)),[2]}})})},this.removeFromMap=function(){var e;n.map.removeEventListener("mouseover",n.incidentLayerName,n.cursorToPointer),n.map.removeEventListener("mouseleave",n.incidentLayerName,n.cursorToDefault),n.map.removeEventListener("click",n.incidentLayerName,n.openIncidentPopup),n.map.events.remove("idle",n.setAccessiblePopups),n.map.events.remove("moveend",n.setAccessiblePopups),n.accessiblePopups.forEach(function(e){return e.remove()}),n.accessiblePopups=[],null!==(e=n.clickPopup)&&void 0!==e&&e.remove(),null!=n.map.layers.getLayerById(n.incidentLayerName)&&n.map.layers.remove(n.incidentLayerName),null!=n.map.sources.getById(n.incidentSourceName)&&n.map.sources.remove(n.incidentSourceName)},this.cursorToPointer=function(e){n.map.getCanvas().style.cursor="pointer"},this.cursorToDefault=function(e){n.map.getCanvas().style.cursor=""},this.openIncidentPopup=function(e){n.clickPopup.remove(),n.accessiblePopups.forEach(function(e){return e.close()});var r=e.position,o=e.features[0];n.map._getLocalizedStrings().then(function(e){var t=new un(new gi(r[0],r[1])),e=new Xl(o.properties,t,e);n.clickPopup=eh.build(e,n.incidentLanguage),n.clickPopup.open(n.map),n.clickPopup.getPopupContainer().addEventListener("focusout",function(e){null===e.relatedTarget&&n.clickPopup.close()})})},this.map=e,this.vectorTileSource=new ws(this.incidentSourceName,{maxZoom:22,tiles:["https://"+h+"/traffic/incident/tile/pbf?api-version=1.0&zoom={z}&x={x}&y={y}"]});e=this.getIncidentIconImageExpression();this.incidentLayer=new Sc(this.incidentSourceName,this.incidentLayerName,{sourceLayer:"Traffic incident POI",iconOptions:{ignorePlacement:!0,allowOverlap:!0,image:e,size:.75}})}var sh,ah,ch=((window&&window.__extends||(sh=function(e,t){return(sh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}sh(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(uh,ah=k),uh);function uh(){var e=null!==ah&&ah.apply(this,arguments)||this;return e.interactive=!0,e.scrollZoomInteraction=!0,e.boxZoomInteraction=!0,e.dragRotateInteraction=!0,e.dragPanInteraction=!0,e.keyboardInteraction=!0,e.dblClickZoomInteraction=!0,e.touchInteraction=!0,e.touchRotate=!0,e.wheelZoomRate=1/450,e}var lh=(hh.prototype.enable=function(){this.map.getMapContainer().addEventListener("keydown",this._onKeyDown)},hh.prototype.disable=function(){this.map.getMapContainer().removeEventListener("keydown",this._onKeyDown)},hh);function hh(e){var t=this;this._onKeyDown=function(e){27===e.keyCode&&t.map.getCanvas().focus()},this.map=e}var ph=(dh.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)},dh.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)},dh);function dh(e){var t=this;this._onGestureStart=function(e){t.hasTouch||(e.preventDefault(),t.initZoom=t.map.getCamera().zoom)},this._onGestureChange=function(e){t.hasTouch||(e.preventDefault(),t.map.setCamera({zoom:t.initZoom+e.scale-1}))},this._onTouchStart=function(e){t.hasTouch=!0},this._onTouchEnd=function(e){0===e.touches.length&&(t.hasTouch=!1)},this.map=e}var fh=(gh.prototype.addToMap=function(){this.added||(this.added=!0,this._setInteractions(this.options))},gh.prototype.removeFromMap=function(){this.added&&(this.added=!1,this._setInteractions({interactive:!1}))},gh.prototype.setOptions=function(e){this.options=(new ch).merge(this.options,e),this.added&&this._setInteractions(this.options)},gh.prototype.getOptions=function(){return Object.assign({},this.options)},gh.prototype._setInteractions=function(e){var t;e.interactive?(e.boxZoomInteraction?this.map._getMap().boxZoom.enable():this.map._getMap().boxZoom.disable(),e.dblClickZoomInteraction?this.map._getMap().doubleClickZoom.enable():this.map._getMap().doubleClickZoom.disable(),e.dragPanInteraction?this.map._getMap().dragPan.enable():this.map._getMap().dragPan.disable(),e.dragRotateInteraction?this.map._getMap().dragRotate.enable():this.map._getMap().dragRotate.disable(),e.keyboardInteraction?(this.map._getMap().keyboard.enable(),this.focusShortcut.enable()):(this.map._getMap().keyboard.disable(),this.focusShortcut.disable()),e.scrollZoomInteraction?(this.map._getMap().scrollZoom.enable(),this.map._getMap().scrollZoom.setWheelZoomRate(e.wheelZoomRate)):this.map._getMap().scrollZoom.disable(),t=this.map._getMap().touchZoomRotate,e.touchInteraction?(t.enable(),e.touchRotate?t.enableRotation():t.disableRotation()):t.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())},gh);function gh(e,t){this.added=!1,this.map=e,this.focusShortcut=new lh(e),this.pinchZoom=new ph(e),this.options=(new ch).merge(t)}function yh(e,t,r){var o={type:"Feature"};return 0!==(r=void 0===r?{}:r).id&&!r.id||(o.id=r.id),r.bbox&&(o.bbox=r.bbox),o.properties=t||{},o.geometry=e,o}function mh(e){return"Feature"===e.type?e.geometry:e}var vh=Re(function(e,t){e.exports=function(){function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||false;o.configurable=true;if("value"in o)o.writable=true;Object.defineProperty(e,o.key,o)}}function s(e,t,r){if(t)o(e.prototype,t);if(r)o(e,r);return e}var l=function(){function e(e,t){this.next=null;this.key=e;this.data=t;this.left=null;this.right=null}return e}();function t(e,t){return e>t?1:e<t?-1:0}function a(e,t,r){var o=new l(null,null);var n=o;var i=o;while(true){var s=r(e,t.key);if(s<0){if(t.left===null)break;if(r(e,t.left.key)<0){var a=t.left;t.left=a.right;a.right=t;t=a;if(t.left===null)break}i.left=t;i=t;t=t.left}else if(s>0){if(t.right===null)break;if(r(e,t.right.key)>0){var a=t.right;t.right=a.left;a.left=t;t=a;if(t.right===null)break}n.right=t;n=t;t=t.right}else break}n.right=t.left;i.left=t.right;t.left=o.right;t.right=o.left;return t}function c(e,t,r,o){var n=new l(e,t);if(r===null){n.left=n.right=null;return n}r=a(e,r,o);var i=o(e,r.key);if(i<0){n.left=r.left;n.right=r;r.left=null}else if(i>=0){n.right=r.right;n.left=r;r.right=null}return n}function h(e,t,r){var o=null;var n=null;if(t){t=a(e,t,r);var i=r(t.key,e);if(i===0){o=t.left;n=t.right}else if(i<0){n=t.right;t.right=null;o=t}else{o=t.left;t.left=null;n=t}}return{left:o,right:n}}function p(e,t,r){if(t===null)return e;if(e===null)return t;t=a(e.key,t,r);t.left=e;return t}function d(e,t,r,o,n){if(e){o(""+t+(r?"└── ":"├── ")+n(e)+"\n");var i=t+(r?" ":"│ ");if(e.left)d(e.left,i,false,o,n);if(e.right)d(e.right,i,true,o,n)}}var x=function(){function e(e){if(e===void 0)e=t;this._root=null;this._size=0;this._comparator=e}e.prototype.insert=function(e,t){this._size++;return this._root=c(e,t,this._root,this._comparator)};e.prototype.add=function(e,t){var r=new l(e,t);if(this._root===null){r.left=r.right=null;this._size++;this._root=r}var o=this._comparator;var n=a(e,this._root,o);var i=o(e,n.key);if(i===0)this._root=n;else{if(i<0){r.left=n.left;r.right=n;n.left=null}else if(i>0){r.right=n.right;r.left=n;n.right=null}this._size++;this._root=r}return this._root};e.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)};e.prototype._remove=function(e,t,r){var o;if(t===null)return null;t=a(e,t,r);var n=r(e,t.key);if(n===0){if(t.left===null)o=t.right;else{o=a(e,t.left,r);o.right=t.right}this._size--;return o}return t};e.prototype.pop=function(){var e=this._root;if(e){while(e.left)e=e.left;this._root=a(e.key,this._root,this._comparator);this._root=this._remove(e.key,this._root,this._comparator);return{key:e.key,data:e.data}}return null};e.prototype.findStatic=function(e){var t=this._root;var r=this._comparator;while(t){var o=r(e,t.key);if(o===0)return t;else if(o<0)t=t.left;else t=t.right}return null};e.prototype.find=function(e){if(this._root){this._root=a(e,this._root,this._comparator);if(this._comparator(e,this._root.key)!==0)return null}return this._root};e.prototype.contains=function(e){var t=this._root;var r=this._comparator;while(t){var o=r(e,t.key);if(o===0)return true;else if(o<0)t=t.left;else t=t.right}return false};e.prototype.forEach=function(e,t){var r=this._root;var o=[];var n=false;while(!n)if(r!==null){o.push(r);r=r.left}else if(o.length!==0){r=o.pop();e.call(t,r);r=r.right}else n=true;return this};e.prototype.range=function(e,t,r,o){var n=[];var i=this._comparator;var s=this._root;var a;while(n.length!==0||s)if(s){n.push(s);s=s.left}else{s=n.pop();a=i(s.key,t);if(a>0)break;else if(i(s.key,e)>=0)if(r.call(o,s))return this;s=s.right}return this};e.prototype.keys=function(){var r=[];this.forEach(function(e){var t=e.key;return r.push(t)});return r};e.prototype.values=function(){var r=[];this.forEach(function(e){var t=e.data;return r.push(t)});return r};e.prototype.min=function(){if(this._root)return this.minNode(this._root).key;return null};e.prototype.max=function(){if(this._root)return this.maxNode(this._root).key;return null};e.prototype.minNode=function(e){if(e===void 0)e=this._root;if(e)while(e.left)e=e.left;return e};e.prototype.maxNode=function(e){if(e===void 0)e=this._root;if(e)while(e.right)e=e.right;return e};e.prototype.at=function(e){var t=this._root;var r=false;var o=0;var n=[];while(!r)if(t){n.push(t);t=t.left}else if(n.length>0){t=n.pop();if(o===e)return t;o++;t=t.right}else r=true;return null};e.prototype.next=function(e){var t=this._root;var r=null;if(e.right){r=e.right;while(r.left)r=r.left;return r}var o=this._comparator;while(t){var n=o(e.key,t.key);if(n===0)break;else if(n<0){r=t;t=t.left}else t=t.right}return r};e.prototype.prev=function(e){var t=this._root;var r=null;if(e.left!==null){r=e.left;while(r.right)r=r.right;return r}var o=this._comparator;while(t){var n=o(e.key,t.key);if(n===0)break;else if(n<0)t=t.left;else{r=t;t=t.right}}return r};e.prototype.clear=function(){this._root=null;this._size=0;return this};e.prototype.toList=function(){return r(this._root)};e.prototype.load=function(e,t,r){if(t===void 0)t=[];if(r===void 0)r=false;var o=e.length;var n=this._comparator;if(r)v(e,t,0,o-1,n);if(this._root===null){this._root=f(e,t,0,o);this._size=o}else{var i=m(this.toList(),g(e,t),n);o=this._size+o;this._root=y({head:i},0,o)}return this};e.prototype.isEmpty=function(){return this._root===null};Object.defineProperty(e.prototype,"size",{get:function e(){return this._size},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"root",{get:function e(){return this._root},enumerable:true,configurable:true});e.prototype.toString=function(e){if(e===void 0)e=function e(t){return String(t.key)};var t=[];d(this._root,"",true,function(e){return t.push(e)},e);return t.join("")};e.prototype.update=function(e,t,r){var o=this._comparator;var n=h(e,this._root,o),i=n.left,s=n.right;if(o(e,t)<0)s=c(t,r,s,o);else i=c(t,r,i,o);this._root=p(i,s,o)};e.prototype.split=function(e){return h(e,this._root,this._comparator)};return e}();function f(e,t,r,o){var n=o-r;if(n>0){var i=r+Math.floor(n/2);var s=e[i];var a=t[i];var c=new l(s,a);c.left=f(e,t,r,i);c.right=f(e,t,i+1,o);return c}return null}function g(e,t){var r=new l(null,null);var o=r;for(var n=0;n<e.length;n++)o=o.next=new l(e[n],t[n]);o.next=null;return r.next}function r(e){var t=e;var r=[];var o=false;var n=new l(null,null);var i=n;while(!o)if(t){r.push(t);t=t.left}else if(r.length>0){t=i=i.next=r.pop();t=t.right}else o=true;i.next=null;return n.next}function y(e,t,r){var o=r-t;if(o>0){var n=t+Math.floor(o/2);var i=y(e,t,n);var s=e.head;s.left=i;e.head=e.head.next;s.right=y(e,n+1,r);return s}return null}function m(e,t,r){var o=new l(null,null);var n=o;var i=e;var s=t;while(i!==null&&s!==null){if(r(i.key,s.key)<0){n.next=i;i=i.next}else{n.next=s;s=s.next}n=n.next}if(i!==null)n.next=i;else if(s!==null)n.next=s;return o.next}function v(e,t,r,o,n){if(r>=o)return;var i=e[r+o>>1];var s=r-1;var a=o+1;while(true){do{s++}while(n(e[s],i)<0);do{a--}while(n(e[a],i)>0);if(s>=a)break;var c=e[s];e[s]=e[a];e[a]=c;c=t[s];t[s]=t[a];t[a]=c}v(e,t,r,a,n);v(e,t,a+1,o,n)}var _=function e(t,r){return t.ll.x<=r.x&&r.x<=t.ur.x&&t.ll.y<=r.y&&r.y<=t.ur.y},R=function e(t,r){if(r.ur.x<t.ll.x||t.ur.x<r.ll.x||r.ur.y<t.ll.y||t.ur.y<r.ll.y)return null;var o=t.ll.x<r.ll.x?r.ll.x:t.ll.x;var n=t.ur.x<r.ur.x?t.ur.x:r.ur.x;var i=t.ll.y<r.ll.y?r.ll.y:t.ll.y;var s=t.ur.y<r.ur.y?t.ur.y:r.ur.y;return{ll:{x:o,y:i},ur:{x:n,y:s}}},n=Number.EPSILON;if(n===undefined)n=Math.pow(2,-52);var i=n*n,w=function e(t,r){if(-n<t&&t<n)if(-n<r&&r<n)return 0;var o=t-r;if(o*o<i*t*r)return 0;return t<r?-1:1},e=function(){function e(){u(this,e);this.reset()}s(e,[{key:"reset",value:function e(){this.xRounder=new b;this.yRounder=new b}},{key:"round",value:function e(t,r){return{x:this.xRounder.round(t),y:this.yRounder.round(r)}}}]);return e}(),b=function(){function e(){u(this,e);this.tree=new x;this.round(0)}s(e,[{key:"round",value:function e(t){var r=this.tree.add(t);var o=this.tree.prev(r);if(o!==null&&w(r.key,o.key)===0){this.tree.remove(t);return o.key}var n=this.tree.next(r);if(n!==null&&w(r.key,n.key)===0){this.tree.remove(t);return n.key}return t}}]);return e}(),M=new e,C=function e(t,r){return t.x*r.y-t.y*r.x},E=function e(t,r){return t.x*r.x+t.y*r.y},S=function e(t,r,o){var n={x:r.x-t.x,y:r.y-t.y};var i={x:o.x-t.x,y:o.y-t.y};var s=C(n,i);return w(s,0)},T=function e(t){return Math.sqrt(E(t,t))},I=function e(t,r,o){var n={x:r.x-t.x,y:r.y-t.y};var i={x:o.x-t.x,y:o.y-t.y};return C(i,n)/T(i)/T(n)},A=function e(t,r,o){var n={x:r.x-t.x,y:r.y-t.y};var i={x:o.x-t.x,y:o.y-t.y};return E(i,n)/T(i)/T(n)},k=function e(t,r,o){if(r.y===0)return null;return{x:t.x+r.x/r.y*(o-t.y),y:o}},P=function e(t,r,o){if(r.x===0)return null;return{x:o,y:t.y+r.y/r.x*(o-t.x)}},O=function e(t,r,o,n){if(r.x===0)return P(o,n,t.x);if(n.x===0)return P(t,r,o.x);if(r.y===0)return k(o,n,t.y);if(n.y===0)return k(t,r,o.y);var i=C(r,n);if(i==0)return null;var s={x:o.x-t.x,y:o.y-t.y};var a=C(s,r)/i;var c=C(s,n)/i;var u=t.x+c*r.x,l=o.x+a*n.x;var h=t.y+c*r.y,p=o.y+a*n.y;var d=(u+l)/2;var f=(h+p)/2;return{x:d,y:f}},N=function(){s(n,null,[{key:"compare",value:function e(t,r){var o=n.comparePoints(t.point,r.point);if(o!==0)return o;if(t.point!==r.point)t.link(r);if(t.isLeft!==r.isLeft)return t.isLeft?1:-1;return D.compare(t.segment,r.segment)}},{key:"comparePoints",value:function e(t,r){if(t.x<r.x)return-1;if(t.x>r.x)return 1;if(t.y<r.y)return-1;if(t.y>r.y)return 1;return 0}}]);function n(e,t){u(this,n);if(e.events===undefined)e.events=[this];else e.events.push(this);this.point=e;this.isLeft=t}s(n,[{key:"link",value:function e(t){if(t.point===this.point)throw new Error("Tried to link already linked events");var r=t.point.events;for(var o=0,n=r.length;o<n;o++){var i=r[o];this.point.events.push(i);i.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function e(){var t=this.point.events.length;for(var r=0;r<t;r++){var o=this.point.events[r];if(o.segment.consumedBy!==undefined)continue;for(var n=r+1;n<t;n++){var i=this.point.events[n];if(i.consumedBy!==undefined)continue;if(o.otherSE.point.events!==i.otherSE.point.events)continue;o.segment.consume(i.segment)}}}},{key:"getAvailableLinkedEvents",value:function e(){var t=[];for(var r=0,o=this.point.events.length;r<o;r++){var n=this.point.events[r];if(n!==this&&!n.segment.ringOut&&n.segment.isInResult())t.push(n)}return t}},{key:"getLeftmostComparator",value:function e(o){var n=this;var c=new Map;var u=function e(t){var r=t.otherSE;c.set(t,{sine:I(n.point,o.point,r.point),cosine:A(n.point,o.point,r.point)})};return function(e,t){if(!c.has(e))u(e);if(!c.has(t))u(t);var r=c.get(e),o=r.sine,n=r.cosine;var i=c.get(t),s=i.sine,a=i.cosine;if(o>=0&&s>=0){if(n<a)return 1;if(n>a)return-1;return 0}if(o<0&&s<0){if(n<a)return-1;if(n>a)return 1;return 0}if(s<o)return-1;if(s>o)return 1;return 0}}}]);return n}(),L=0,D=function(){s(p,null,[{key:"compare",value:function e(t,r){var o=t.leftSE.point.x;var n=r.leftSE.point.x;var i=t.rightSE.point.x;var s=r.rightSE.point.x;if(s<o)return 1;if(i<n)return-1;var a=t.leftSE.point.y;var c=r.leftSE.point.y;var u=t.rightSE.point.y;var l=r.rightSE.point.y;if(o<n){if(c<a&&c<u)return 1;if(c>a&&c>u)return-1;var h=t.comparePoint(r.leftSE.point);if(h<0)return 1;if(h>0)return-1;var p=r.comparePoint(t.rightSE.point);if(p!==0)return p;return-1}if(o>n){if(a<c&&a<l)return-1;if(a>c&&a>l)return 1;var d=r.comparePoint(t.leftSE.point);if(d!==0)return d;var f=t.comparePoint(r.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 g=r.comparePoint(t.rightSE.point);if(g!==0)return g}if(i>s){var y=t.comparePoint(r.rightSE.point);if(y<0)return 1;if(y>0)return-1}if(i!==s){var m=u-a;var v=i-o;var _=l-c;var w=s-n;if(m>v&&_<w)return 1;if(m<v&&_>w)return-1}if(i>s)return 1;if(i<s)return-1;if(u<l)return-1;if(u>l)return 1;if(t.id<r.id)return-1;if(t.id>r.id)return 1;return 0}}]);function p(e,t,r,o){u(this,p);this.id=++L;this.leftSE=e;e.segment=this;e.otherSE=t;this.rightSE=t;t.segment=this;t.otherSE=e;this.rings=r;this.windings=o}s(p,[{key:"replaceRightSE",value:function e(t){this.rightSE=t;this.rightSE.segment=this;this.rightSE.otherSE=this.leftSE;this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function e(){var t=this.leftSE.point.y;var r=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<r?t:r},ur:{x:this.rightSE.point.x,y:t>r?t:r}}}},{key:"vector",value:function e(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function e(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function e(t){if(this.isAnEndpoint(t))return 0;var r=this.leftSE.point;var o=this.rightSE.point;var n=this.vector();if(r.x===o.x){if(t.x===r.x)return 0;return t.x<r.x?1:-1}var i=(t.y-r.y)/n.y;var s=r.x+i*n.x;if(t.x===s)return 0;var a=(t.x-r.x)/n.x;var c=r.y+a*n.y;if(t.y===c)return 0;return t.y<c?-1:1}},{key:"getIntersection",value:function e(t){var r=this.bbox();var o=t.bbox();var n=R(r,o);if(n===null)return null;var i=this.leftSE.point;var s=this.rightSE.point;var a=t.leftSE.point;var c=t.rightSE.point;var u=_(r,a)&&this.comparePoint(a)===0;var l=_(o,i)&&t.comparePoint(i)===0;var h=_(r,c)&&this.comparePoint(c)===0;var p=_(o,s)&&t.comparePoint(s)===0;if(l&&u){if(p&&!h)return s;if(!p&&h)return c;return null}if(l){if(h)if(i.x===c.x&&i.y===c.y)return null;return i}if(u){if(p)if(s.x===a.x&&s.y===a.y)return null;return a}if(p&&h)return null;if(p)return s;if(h)return c;var d=O(i,this.vector(),a,t.vector());if(d===null)return null;if(!_(n,d))return null;return M.round(d.x,d.y)}},{key:"split",value:function e(t){var r=[];var o=t.events!==undefined;var n=new N(t,true);var i=new N(t,false);var s=this.rightSE;this.replaceRightSE(i);r.push(i);r.push(n);var a=new p(n,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(o){n.checkForConsuming();i.checkForConsuming()}return r}},{key:"swapEvents",value:function e(){var t=this.rightSE;this.rightSE=this.leftSE;this.leftSE=t;this.leftSE.isLeft=true;this.rightSE.isLeft=false;for(var r=0,o=this.windings.length;r<o;r++)this.windings[r]*=-1}},{key:"consume",value:function e(t){var r=this;var o=t;while(r.consumedBy)r=r.consumedBy;while(o.consumedBy)o=o.consumedBy;var n=p.compare(r,o);if(n===0)return;if(n>0){var i=r;r=o;o=i}if(r.prev===o){var s=r;r=o;o=s}for(var a=0,c=o.rings.length;a<c;a++){var u=o.rings[a];var l=o.windings[a];var h=r.rings.indexOf(u);if(h===-1){r.rings.push(u);r.windings.push(l)}else r.windings[h]+=l}o.rings=null;o.windings=null;o.consumedBy=r;o.leftSE.consumedBy=r.leftSE;o.rightSE.consumedBy=r.rightSE}},{key:"prevInResult",value:function e(){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 e(){if(this._beforeState!==undefined)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}},{key:"afterState",value:function e(){if(this._afterState!==undefined)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};var r=this._afterState.rings;var o=this._afterState.windings;var n=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 u=r.indexOf(a);if(u===-1){r.push(a);o.push(c)}else o[u]+=c}var l=[];var h=[];for(var p=0,d=r.length;p<d;p++){if(o[p]===0)continue;var f=r[p];var g=f.poly;if(h.indexOf(g)!==-1)continue;if(f.isExterior)l.push(g);else{if(h.indexOf(g)===-1)h.push(g);var y=l.indexOf(f.poly);if(y!==-1)l.splice(y,1)}}for(var m=0,v=l.length;m<v;m++){var _=l[m].multiPoly;if(n.indexOf(_)===-1)n.push(_)}return this._afterState}},{key:"isInResult",value:function e(){if(this.consumedBy)return false;if(this._isInResult!==undefined)return this._isInResult;var t=this.beforeState().multiPolys;var r=this.afterState().multiPolys;switch(Z.type){case"union":{var o=t.length===0;var n=r.length===0;this._isInResult=o!==n;break}case"intersection":{var i;var s;if(t.length<r.length){i=t.length;s=r.length}else{i=r.length;s=t.length}this._isInResult=s===Z.numMultiPolys&&i<s;break}case"xor":{var a=Math.abs(t.length-r.length);this._isInResult=a%2===1;break}case"difference":{var c=function e(t){return t.length===1&&t[0].isSubject};this._isInResult=c(t)!==c(r);break}default:throw new Error("Unrecognized operation type found ".concat(Z.type))}return this._isInResult}}],[{key:"fromRing",value:function e(t,r,o){var n,i,s;var a=N.comparePoints(t,r);if(a<0){n=t;i=r;s=1}else if(a>0){n=r;i=t;s=-1}else throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));var c=new N(n,true);var u=new N(i,false);return new p(c,u,[o],[s])}}]);return p}(),q=function(){function c(e,t,r){u(this,c);if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.poly=t;this.isExterior=r;this.segments=[];if(typeof e[0][0]!=="number"||typeof e[0][1]!=="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=M.round(e[0][0],e[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};var n=o;for(var i=1,s=e.length;i<s;i++){if(typeof e[i][0]!=="number"||typeof e[i][1]!=="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var a=M.round(e[i][0],e[i][1]);if(a.x===n.x&&a.y===n.y)continue;this.segments.push(D.fromRing(n,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;n=a}if(o.x!==n.x||o.y!==n.y)this.segments.push(D.fromRing(n,o,this))}s(c,[{key:"getSweepEvents",value:function e(){var t=[];for(var r=0,o=this.segments.length;r<o;r++){var n=this.segments[r];t.push(n.leftSE);t.push(n.rightSE)}return t}}]);return c}(),j=function(){function i(e,t){u(this,i);if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new q(e[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 r=1,o=e.length;r<o;r++){var n=new q(e[r],this,false);if(n.bbox.ll.x<this.bbox.ll.x)this.bbox.ll.x=n.bbox.ll.x;if(n.bbox.ll.y<this.bbox.ll.y)this.bbox.ll.y=n.bbox.ll.y;if(n.bbox.ur.x>this.bbox.ur.x)this.bbox.ur.x=n.bbox.ur.x;if(n.bbox.ur.y>this.bbox.ur.y)this.bbox.ur.y=n.bbox.ur.y;this.interiorRings.push(n)}this.multiPoly=t}s(i,[{key:"getSweepEvents",value:function e(){var t=this.exteriorRing.getSweepEvents();for(var r=0,o=this.interiorRings.length;r<o;r++){var n=this.interiorRings[r].getSweepEvents();for(var i=0,s=n.length;i<s;i++)t.push(n[i])}return t}}]);return i}(),U=function(){function i(e,t){u(this,i);if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{if(typeof e[0][0][0]==="number")e=[e]}catch(e){}this.polys=[];this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var r=0,o=e.length;r<o;r++){var n=new j(e[r],this);if(n.bbox.ll.x<this.bbox.ll.x)this.bbox.ll.x=n.bbox.ll.x;if(n.bbox.ll.y<this.bbox.ll.y)this.bbox.ll.y=n.bbox.ll.y;if(n.bbox.ur.x>this.bbox.ur.x)this.bbox.ur.x=n.bbox.ur.x;if(n.bbox.ur.y>this.bbox.ur.y)this.bbox.ur.y=n.bbox.ur.y;this.polys.push(n)}this.isSubject=t}s(i,[{key:"getSweepEvents",value:function e(){var t=[];for(var r=0,o=this.polys.length;r<o;r++){var n=this.polys[r].getSweepEvents();for(var i=0,s=n.length;i<s;i++)t.push(n[i])}return t}}]);return i}(),H=function(){s(b,null,[{key:"factory",value:function e(t){var r=[];for(var o=0,n=t.length;o<n;o++){var i=t[o];if(!i.isInResult()||i.ringOut)continue;var s=null;var a=i.leftSE;var c=i.rightSE;var u=[a];var l=a.point;var h=[];while(true){s=a;a=c;u.push(a);if(a.point===l)break;while(true){var p=a.getAvailableLinkedEvents();if(p.length===0){var d=u[0].point;var f=u[u.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(p.length===1){c=p[0].otherSE;break}var g=null;for(var y=0,m=h.length;y<m;y++)if(h[y].point===a.point){g=y;break}if(g!==null){var v=h.splice(g)[0];var _=u.splice(v.index);_.unshift(_[0].otherSE);r.push(new b(_.reverse()));continue}h.push({index:u.length,point:a.point});var w=a.getLeftmostComparator(s);c=p.sort(w)[0].otherSE;break}}r.push(new b(u))}return r}}]);function b(e){u(this,b);this.events=e;for(var t=0,r=e.length;t<r;t++)e[t].segment.ringOut=this;this.poly=null}s(b,[{key:"getGeom",value:function e(){var t=this.events[0].point;var r=[t];for(var o=1,n=this.events.length-1;o<n;o++){var i=this.events[o].point;var s=this.events[o+1].point;if(S(i,t,s)===0)continue;r.push(i);t=i}if(r.length===1)return null;var a=r[0];var c=r[1];if(S(a,t,c)===0)r.shift();r.push(r[0]);var u=this.isExteriorRing()?1:-1;var l=this.isExteriorRing()?0:r.length-1;var h=this.isExteriorRing()?r.length:-1;var p=[];for(var d=l;d!=h;d+=u)p.push([r[d].x,r[d].y]);return p}},{key:"isExteriorRing",value:function e(){if(this._isExteriorRing===undefined){var t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():true}return this._isExteriorRing}},{key:"enclosingRing",value:function e(){if(this._enclosingRing===undefined)this._enclosingRing=this._calcEnclosingRing();return this._enclosingRing}},{key:"_calcEnclosingRing",value:function e(){var t=this.events[0];for(var r=1,o=this.events.length;r<o;r++){var n=this.events[r];if(N.compare(t,n)>0)t=n}var i=t.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}(),z=function(){function t(e){u(this,t);this.exteriorRing=e;e.poly=this;this.interiorRings=[]}s(t,[{key:"addInterior",value:function e(t){this.interiorRings.push(t);t.poly=this}},{key:"getGeom",value:function e(){var t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(var r=0,o=this.interiorRings.length;r<o;r++){var n=this.interiorRings[r].getGeom();if(n===null)continue;t.push(n)}return t}}]);return t}(),B=function(){function t(e){u(this,t);this.rings=e;this.polys=this._composePolys(e)}s(t,[{key:"getGeom",value:function e(){var t=[];for(var r=0,o=this.polys.length;r<o;r++){var n=this.polys[r].getGeom();if(n===null)continue;t.push(n)}return t}},{key:"_composePolys",value:function e(t){var r=[];for(var o=0,n=t.length;o<n;o++){var i=t[o];if(i.poly)continue;if(i.isExteriorRing())r.push(new z(i));else{var s=i.enclosingRing();if(!s.poly)r.push(new z(s));s.poly.addInterior(i)}}return r}}]);return t}(),F=function(){function r(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:D.compare;u(this,r);this.queue=e;this.tree=new x(t);this.segments=[]}s(r,[{key:"process",value:function e(t){var r=t.segment;var o=[];if(t.consumedBy){if(t.isLeft)this.queue.remove(t.otherSE);else this.tree.remove(r);return o}var n=t.isLeft?this.tree.insert(r):this.tree.find(r);if(!n)throw new Error("Unable to find segment #".concat(r.id," ")+"[".concat(r.leftSE.point.x,", ").concat(r.leftSE.point.y,"] -> ")+"[".concat(r.rightSE.point.x,", ").concat(r.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");var i=n;var s=n;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(t.isLeft){var u=null;if(a){var l=a.getIntersection(r);if(l!==null){if(!r.isAnEndpoint(l))u=l;if(!a.isAnEndpoint(l)){var h=this._splitSafely(a,l);for(var p=0,d=h.length;p<d;p++)o.push(h[p])}}}var f=null;if(c){var g=c.getIntersection(r);if(g!==null){if(!r.isAnEndpoint(g))f=g;if(!c.isAnEndpoint(g)){var y=this._splitSafely(c,g);for(var m=0,v=y.length;m<v;m++)o.push(y[m])}}}if(u!==null||f!==null){var _=null;if(u===null)_=f;else if(f===null)_=u;else{var w=N.comparePoints(u,f);_=w<=0?u:f}this.queue.remove(r.rightSE);o.push(r.rightSE);var b=r.split(_);for(var C=0,E=b.length;C<E;C++)o.push(b[C])}if(o.length>0){this.tree.remove(r);o.push(t)}else{this.segments.push(r);r.prev=a}}else{if(a&&c){var S=a.getIntersection(c);if(S!==null){if(!a.isAnEndpoint(S)){var T=this._splitSafely(a,S);for(var I=0,A=T.length;I<A;I++)o.push(T[I])}if(!c.isAnEndpoint(S)){var k=this._splitSafely(c,S);for(var P=0,O=k.length;P<O;P++)o.push(k[P])}}}this.tree.remove(r)}return o}},{key:"_splitSafely",value:function e(t,r){this.tree.remove(t);var o=t.rightSE;this.queue.remove(o);var n=t.split(r);n.push(o);if(t.consumedBy===undefined)this.tree.insert(t);return n}}]);return r}(),K=typeof process!=="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,G=typeof process!=="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Y,Z=new(function(){function e(){u(this,e)}s(e,[{key:"run",value:function e(t,r,o){Z.type=t;M.reset();var n=[new U(r,true)];for(var i=0,s=o.length;i<s;i++)n.push(new U(o[i],false));Z.numMultiPolys=n.length;if(Z.type==="difference"){var a=n[0];var c=1;while(c<n.length)if(R(n[c].bbox,a.bbox)!==null)c++;else n.splice(c,1)}if(Z.type==="intersection")for(var u=0,l=n.length;u<l;u++){var h=n[u];for(var p=u+1,d=n.length;p<d;p++)if(R(h.bbox,n[p].bbox)===null)return[]}var f=new x(N.compare);for(var g=0,y=n.length;g<y;g++){var m=n[g].getSweepEvents();for(var v=0,_=m.length;v<_;v++){f.insert(m[v]);if(f.size>K)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 F(f);var b=f.size;var C=f.pop();while(C){var E=C.key;if(f.size===b){var S=E.segment;throw new Error("Unable to pop() ".concat(E.isLeft?"left":"right"," SweepEvent ")+"[".concat(E.point.x,", ").concat(E.point.y,"] from segment #").concat(S.id," ")+"[".concat(S.leftSE.point.x,", ").concat(S.leftSE.point.y,"] -> ")+"[".concat(S.rightSE.point.x,", ").concat(S.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(f.size>K)throw new Error("Infinite loop when passing sweep line over endpoints "+"(queue size too big). Please file a bug report.");if(w.segments.length>G)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(E);for(var I=0,A=T.length;I<A;I++){var k=T[I];if(k.consumedBy===undefined)f.insert(k)}b=f.size;C=f.pop()}M.reset();var P=H.factory(w.segments);var O=new B(P);return O.getGeom()}}]);return e}()),W,V,J,Q,X;return{union:function e(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return Z.run("union",t,o)},intersection:function e(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return Z.run("intersection",t,o)},xor:function e(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return Z.run("xor",t,o)},difference:function e(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return Z.run("difference",t,o)}}}()});function _h(e,t,r){void 0===r&&(r={});var o,e=mh(e),t=mh(t),t=vh.intersection(e.coordinates,t.coordinates);return 0===t.length?null:1===t.length?function(e,t,r){void 0===r&&(r={});for(var o=0,n=e;o<n.length;o++){var i=n[o];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 yh({type:"Polygon",coordinates:e},t,r)}(t[0],r.properties):(r=r.properties,yh({type:"MultiPolygon",coordinates:t},r,o=void 0===o?{}:o))}var wh,w=window&&window.__decorate||function(e,t,r,o){var n,i=arguments.length,s=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,o);else for(var a=e.length-1;0<=a;a--)(n=e[a])&&(s=(i<3?n(s):3<i?n(t,r,s):n(t,r))||s);return 3<i&&s&&Object.defineProperty(t,r,s),s},bh=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},Ch=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},Eh=["DIV","SPAN","A"],Sh=["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"],Th=Ch(["href"],bh(Sh)),Ih=(Ah.prototype.equals=function(e){return this.stringRepresentation===e.stringRepresentation},Object.defineProperty(Ah.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(e){return 0<e.length}).join(";")},enumerable:!1,configurable:!0}),Ah.applicable=function(e){return Array.from(e.attributes).map(function(e){return Sh.includes(e.name)}).reduce(function(e,t){return e||t},!1)},Object.defineProperty(Ah.prototype,"minZoom",{get:function(){var e=this.element.attributes.getNamedItem("data-azure-maps-attribution-minzoom");return e&&!isNaN(e.value)?parseInt(e.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Ah.prototype,"maxZoom",{get:function(){var e=this.element.attributes.getNamedItem("data-azure-maps-attribution-maxzoom");return e&&!isNaN(e.value)?parseInt(e.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Ah.prototype,"geometry",{get:function(){var e=this.element.attributes.getNamedItem("data-azure-maps-attribution-geometry");if(e&&e.value)try{return JSON.parse(e.value)}catch(e){return}},enumerable:!1,configurable:!0}),Object.defineProperty(Ah.prototype,"tilesetId",{get:function(){var e=this.element.attributes.getNamedItem("data-azure-maps-attribution-tileset");return e&&e.value?e.value:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Ah.prototype,"order",{get:function(){var e=this.element.attributes.getNamedItem("data-azure-maps-attribution-order");return e&&!isNaN(e.value)?parseInt(e.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Ah.prototype,"dynamic",{get:function(){return null!==this.element.attributes.getNamedItem("data-azure-maps-attribution-dynamic")},enumerable:!1,configurable:!0}),Object.defineProperty(Ah.prototype,"hidesElement",{get:function(){return"none"==this.element.style.display},enumerable:!1,configurable:!0}),Ah.prototype.forceHide=function(){this.element.style.display="none"},Ah.prototype.satisfied=function(e){var t=!this.minZoom||!e.zoom||e.zoom>=this.minZoom,r=!this.maxZoom||!e.zoom||e.zoom<=this.maxZoom,o=!0;return this.geometry&&e.bounds&&(o=null!==_h({type:"Feature",geometry:this.geometry,properties:{}},{type:"Feature",geometry:{type:"Polygon",coordinates:[[Ai.getNorthWest(e.bounds),Ai.getNorthEast(e.bounds),Ai.getSouthEast(e.bounds),Ai.getSouthWest(e.bounds),Ai.getNorthWest(e.bounds)]]},properties:{}})),t&&r&&o},Ah.prototype.apply=function(t,e){var r=this;void 0===e&&(e=null);var o=this.satisfied(t.getCamera()),n=this.dynamic&&this.tilesetId,i=this.hidesElement,e=e&&["dragend","zoomend","pitchend"].includes(e.type);return o||i?o&&(i||n)&&(o&&i&&this.element.style.removeProperty("display"),n&&(e?t.events.addOnce("idle",function(e){return r.fetchAndApplyDynamicAttribution(t)}):this.fetchAndApplyDynamicAttribution(t))):this.element.style.display="none",o===i},Ah.prototype.fetchAndApplyDynamicAttribution=function(o){var t,r,e,n=this,i=o.getCamera();this.lastFetchState&&Ai.containsBoundingBox(this.lastFetchState.bounds,i.bounds)&&Math.floor(this.lastFetchState.zoom)==Math.floor(i.zoom)||(t=Vn(i.center,Ai.getSouthWest(i.bounds),Ah.viewportBufferExpansionRatio),e=((r=Vn(i.center,Ai.getNorthEast(i.bounds),Ah.viewportBufferExpansionRatio))[0]<t[0]?[[t[0],t[1],180,r[1]],[-180,t[1],r[0],r[1]]]:[[t[0],t[1],r[0],r[1]]]).map(function(e){var t=new URLSearchParams({"api-version":"2.1",tilesetId:n.tilesetId,zoom:void 0!==i.zoom?""+Math.floor(i.zoom):void 0,bounds:e.join(",")}),r="https://{{azMapsDomain}}/map/attribution",e={url:r,headers:{}};o._substituteDomainLanguageViewAndSignInRequest(r,e);t=e.url+(e.url.includes("?")?"&":"?")+t.toString();return o._sendRequest(t,"Attribution",e.headers).then(function(e){return e.json()})}),Promise.all(e).then(function(e){n.applyAttributionResponse(e),n.lastFetchState={bounds:new Ai([t[0],t[1],r[0],r[1]]),zoom:i.zoom}}).catch(function(e){return console.error(e)}))},Ah.prototype.applyAttributionResponse=function(e){var t,r,o=this,n=e.map(function(e){return e.copyrights||[]}).reduce(function(e,t){return Ch(Ch([],bh(e)),bh(t))},[]);0!=n.length&&(null!==(e=Vc.parseWithFilter(n.join(""),function(e){return!0},function(e){return e},function(){return o.element.innerHTML="",o.element}))?(e="string"==typeof e?((n=document.createElement("span")).innerHTML=e,n):e,r=e===this.element?(t=document.createElement("span"),Array.from(this.element.childNodes).forEach(function(e){return t.appendChild(e)}),t):e,Array.from(this.element.attributes).filter(function(e){return Sh.includes(e.name)}).forEach(function(e){return r.attributes.setNamedItem(e.cloneNode())}),r.style.display=this.element.style.display,e=this.element.parentElement,this.element.remove(),e.append(r),this.element=r,this.attributionChangeCallback(this)):console.warn("Dynamic attribution is empty after filtering"))},Ah.viewportBufferExpansionRatio=2,w([(wh=1e3,function(e,t,r){var o=r.value,n=new Map;return r.value=function(){var e=this,t=arguments;n.get(e)||!1||(o.apply(e,t),n.set(e,!0),setTimeout(function(){return n.delete(e)},wh))},r})],Ah.prototype,"fetchAndApplyDynamicAttribution",null),Ah);function Ah(e,t){var r=this;this.lastFetchState={bounds:null,zoom:null},this.getElement=function(){return r.element},this.element=e,this.attributionChangeCallback=t}var kh=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},Ph=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},Oh=[/all rights reserved/gi],xh=(Rh.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)},Rh.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)},Rh.prototype.getDefaultAttribution=function(){return this.copyrightControl.getDefaultAttributions().map(function(e){return t=e,(e=document.createElement("a")).textContent=t,e;var t})},Rh);function Rh(e,t,r){var o,a=this;this.rules=[],this.virtualContext=((o=document.createElement("span")).className="azure-map-copyright-context",o),this.renderContext=this.virtualContext.cloneNode(!1),this.addAttributionFromSource=function(e){},this.removeAttributionFromSource=function(e){},this.getMapStyleVisibleSources=function(){var t=a.map._getMap(),r=t.getStyle();return Object.entries(r.sources).filter(function(e){var t=kh(e,1)[0];return r.layers.filter(function(e){return e&&e.source==t}).reduce(function(e,t){return!(t.layout&&"none"===t.layout.visibility||t.paint&&0===t.paint["icon-opacity"]&&0===t.paint["text-opacity"])||e},!1)}).map(function(e){e=kh(e,1)[0];return t.getSource(e)})},this.loadAttributionOnceSourcesLoaded=function(){var e=a.getMapStyleVisibleSources();Promise.all(e.map(function(i){return new Promise(function(r,o){var n;"tiles"in i?r(i):((n=i).on("data",function e(t){"metadata"==t.sourceDataType&&(n.off("data",e),r(i))}),n.on("error",function e(t){n.off("error",e),o(t)}))}).then(function(e){return{status:"fulfilled",value:e}}).catch(function(e){return{status:"rejected",reason:e}})})).then(function(e){a.reloadAttribution()})},this.reloadAttribution=function(){var e=a.getMapStyleVisibleSources(),o=new Set,n={},t=e.filter(function(e){return"attribution"in e&&e.attribution&&"tiles"in e&&e.tiles instanceof Array&&0<e.tiles.length}).map(function(e){return Vc.parseWithFilter(null!==(e=e.attribution)&&void 0!==e?e:"",function(e){return Eh.includes(e.tagName)&&Array.from(e.attributes).map(function(e){return Th.includes(e.name)}).reduce(function(e,t){return e&&t},!0)},function(e){var t,r=null;return e instanceof HTMLElement&&Ih.applicable(e)&&(r=new Ih(e,function(){return a.renderAttribution()}),o.add(r),void 0!==r.order&&(e.style.order=""+r.order)),r&&e instanceof HTMLElement&&((!((t=r.stringRepresentation)in n)||void 0!==r.order&&void 0!==n[t].order&&r.order<n[t].order||void 0!==r.order&&void 0===n[t].order)&&(n[t]=r)),e},function(){return document.createElement("span")})}),r=new Set(Object.values(n)),e=new Set(Ph([],kh(o)).filter(function(e){return!r.has(e)})),i=new Set(Ph([],kh(e)).map(function(e){return e.getElement()}));Ph([],kh(i)).filter(function(e){return null!==e.parentElement}).forEach(function(e){return e.parentElement.removeChild(e)}),a.rules=Object.values(n);var t=t.filter(function(e){return"string"==typeof e||!i.has(e)}).map(function(e){return"string"==typeof e?new Text(e):e}),s=document.createElement("span");0<t.length?t.forEach(function(e){return s.appendChild(e)}):a.getDefaultAttribution().forEach(function(e){return s.appendChild(e)}),a.virtualContext=s,a.copyrightControl.setOptions({copyrightContent:a.renderContext}),a.applyRules(),a.renderAttribution()},this.applyRules=function(r){void 0===r&&(r=null),a.rules.reduce(function(e,t){t=t.apply(a.map,r);return e||t},!1)&&a.renderAttribution()},this.renderAttribution=function(){var t=function(e){return Array.from("none"!=e.style.display?e.children:[]).map(function(e){return t(e)}).reduce(function(e,t){return Ph(Ph([],kh(e)),kh(t))},Array.from("none"!=e.style.display?e.childNodes:[]).filter(function(e){return e.nodeType==e.TEXT_NODE}))},e=a.virtualContext.cloneNode(!0),r=t(e);r.forEach(function(e){return e.textContent=Ph([],kh(Oh)).reduce(function(e,t){return e.replace(t,"").trim()},e.textContent)}),r.reduce(function(e,t){return e.has(t.textContent)?(t.textContent="",t.parentElement&&t.parentElement.removeChild(t)):e.add(t.textContent),e},new Set),a.renderContext.innerHTML="",Array.from(e.childNodes).forEach(function(e){return a.renderContext.appendChild(e)})},this.map=e,this.copyrightControl=t,this.options=r}var Mh=function(e,t){return(Mh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function Nh(e,t){function r(){this.constructor=e}Mh(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var Lh=function(){return(Lh=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function Dh(e,t){var r={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function qh(e,s,a,c){return new(a=a||Promise)(function(r,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(o,n)}i((c=c.apply(e,s||[])).next())})}function jh(r,o){var n,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=o.call(r,a)}catch(e){t=[6,e],i=0}finally{n=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function Uh(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s}(arguments[t]));return e}var Hh=function(e,t){return(Hh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function zh(e,t){function r(){this.constructor=e}Hh(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var Bh=function(){return(Bh=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function Fh(e,s,a,c){return new(a=a||Promise)(function(r,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(o,n)}i((c=c.apply(e,s||[])).next())})}function Kh(r,o){var n,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=o.call(r,a)}catch(e){t=[6,e],i=0}finally{n=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function Gh(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var o=Array(e),n=0,t=0;t<r;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,n++)o[n]=i[s];return o}var Yh,Zh,Wh,Vh,Jh,Qh={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",FRAGMENT_RESPONSE_MODE:"fragment",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",REGIONAL_AUTH_NON_MSI_QUERY_STRING:"allowestsrnonmsi=true",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],TOKEN_RESPONSE_TYPE:"token",ID_TOKEN_RESPONSE_TYPE:"id_token",SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},Xh=[Qh.OPENID_SCOPE,Qh.PROFILE_SCOPE,Qh.OFFLINE_ACCESS_SCOPE],$h=Gh(Xh,[Qh.EMAIL_SCOPE]);(o=Yh=Yh||{}).CONTENT_TYPE="Content-Type",o.RETRY_AFTER="Retry-After",o.CCS_HEADER="X-AnchorMailbox",o.WWWAuthenticate="WWW-Authenticate",o.AuthenticationInfo="Authentication-Info",o.X_MS_REQUEST_ID="x-ms-request-id",(w=Zh=Zh||{}).ID_TOKEN="idtoken",w.CLIENT_INFO="client.info",w.ADAL_ID_TOKEN="adal.idtoken",w.ERROR="error",w.ERROR_DESC="error.description",w.ACTIVE_ACCOUNT="active-account",w.ACTIVE_ACCOUNT_FILTERS="active-account-filters",(o=Wh=Wh||{}).COMMON="common",o.ORGANIZATIONS="organizations",o.CONSUMERS="consumers",(w=Vh=Vh||{}).CLIENT_ID="client_id",w.REDIRECT_URI="redirect_uri",w.RESPONSE_TYPE="response_type",w.RESPONSE_MODE="response_mode",w.GRANT_TYPE="grant_type",w.CLAIMS="claims",w.SCOPE="scope",w.ERROR="error",w.ERROR_DESCRIPTION="error_description",w.ACCESS_TOKEN="access_token",w.ID_TOKEN="id_token",w.REFRESH_TOKEN="refresh_token",w.EXPIRES_IN="expires_in",w.STATE="state",w.NONCE="nonce",w.PROMPT="prompt",w.SESSION_STATE="session_state",w.CLIENT_INFO="client_info",w.CODE="code",w.CODE_CHALLENGE="code_challenge",w.CODE_CHALLENGE_METHOD="code_challenge_method",w.CODE_VERIFIER="code_verifier",w.CLIENT_REQUEST_ID="client-request-id",w.X_CLIENT_SKU="x-client-SKU",w.X_CLIENT_VER="x-client-VER",w.X_CLIENT_OS="x-client-OS",w.X_CLIENT_CPU="x-client-CPU",w.X_CLIENT_CURR_TELEM="x-client-current-telemetry",w.X_CLIENT_LAST_TELEM="x-client-last-telemetry",w.X_MS_LIB_CAPABILITY="x-ms-lib-capability",w.X_APP_NAME="x-app-name",w.X_APP_VER="x-app-ver",w.POST_LOGOUT_URI="post_logout_redirect_uri",w.ID_TOKEN_HINT="id_token_hint",w.DEVICE_CODE="device_code",w.CLIENT_SECRET="client_secret",w.CLIENT_ASSERTION="client_assertion",w.CLIENT_ASSERTION_TYPE="client_assertion_type",w.TOKEN_TYPE="token_type",w.REQ_CNF="req_cnf",w.OBO_ASSERTION="assertion",w.REQUESTED_TOKEN_USE="requested_token_use",w.ON_BEHALF_OF="on_behalf_of",w.FOCI="foci",w.CCS_HEADER="X-AnchorMailbox",w.RETURN_SPA_CODE="return_spa_code",w.NATIVE_BROKER="nativebroker",w.LOGOUT_HINT="logout_hint",(o=Jh=Jh||{}).ACCESS_TOKEN="access_token",o.XMS_CC="xms_cc";var ep,tp={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"};(w=ep=ep||{}).ACCOUNT="account",w.SID="sid",w.LOGIN_HINT="login_hint",w.ID_TOKEN="id_token",w.DOMAIN_HINT="domain_hint",w.ORGANIZATIONS="organizations",w.CONSUMERS="consumers",w.ACCOUNT_ID="accountIdentifier",w.HOMEACCOUNT_ID="homeAccountIdentifier";var rp,op,np,ip,sp,ap,cp,up={PLAIN:"plain",S256:"S256"};(o=rp=rp||{}).QUERY="query",o.FRAGMENT="fragment",o.FORM_POST="form_post",(w=op=op||{}).IMPLICIT_GRANT="implicit",w.AUTHORIZATION_CODE_GRANT="authorization_code",w.CLIENT_CREDENTIALS_GRANT="client_credentials",w.RESOURCE_OWNER_PASSWORD_GRANT="password",w.REFRESH_TOKEN_GRANT="refresh_token",w.DEVICE_CODE_GRANT="device_code",w.JWT_BEARER="urn:ietf:params:oauth:grant-type:jwt-bearer",(o=np=np||{}).MSSTS_ACCOUNT_TYPE="MSSTS",o.ADFS_ACCOUNT_TYPE="ADFS",o.MSAV1_ACCOUNT_TYPE="MSA",o.GENERIC_ACCOUNT_TYPE="Generic",(w=ip=ip||{}).CACHE_KEY_SEPARATOR="-",w.CLIENT_INFO_SEPARATOR=".",(o=sp=sp||{}).ID_TOKEN="IdToken",o.ACCESS_TOKEN="AccessToken",o.ACCESS_TOKEN_WITH_AUTH_SCHEME="AccessToken_With_AuthScheme",o.REFRESH_TOKEN="RefreshToken",(w=ap=ap||{}).ACCOUNT="Account",w.CREDENTIAL="Credential",w.ID_TOKEN="IdToken",w.ACCESS_TOKEN="AccessToken",w.REFRESH_TOKEN="RefreshToken",w.APP_METADATA="AppMetadata",w.TEMPORARY="TempCache",w.TELEMETRY="Telemetry",w.UNDEFINED="Undefined",w.THROTTLING="Throttling",(o=cp=cp||{})[o.ADFS=1001]="ADFS",o[o.MSA=1002]="MSA",o[o.MSSTS=1003]="MSSTS",o[o.GENERIC=1004]="GENERIC",o[o.ACCESS_TOKEN=2001]="ACCESS_TOKEN",o[o.REFRESH_TOKEN=2002]="REFRESH_TOKEN",o[o.ID_TOKEN=2003]="ID_TOKEN",o[o.APP_METADATA=3001]="APP_METADATA",o[o.UNDEFINED=9999]="UNDEFINED";var lp,hp="appmetadata",pp="authority-metadata",dp=86400;(w=lp=lp||{}).CONFIG="config",w.CACHE="cache",w.NETWORK="network",w.HARDCODED_VALUES="hardcoded_values";var fp,gp={SCHEMA_VERSION:5,MAX_CUR_HEADER_BYTES:80,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"};(o=fp=fp||{}).BEARER="Bearer",o.POP="pop",o.SSH="ssh-cert";var yp,mp,vp,_p,wp,bp,Cp=60,Ep=3600,Sp="throttling",Tp="retry-after, h429",Ip="invalid_grant",Ap="client_mismatch";(w=yp=yp||{}).username="username",w.password="password",(o=mp=mp||{})[o.httpSuccess=200]="httpSuccess",o[o.httpBadRequest=400]="httpBadRequest",(w=vp=vp||{}).FAILED_AUTO_DETECTION="1",w.INTERNAL_CACHE="2",w.ENVIRONMENT_VARIABLE="3",w.IMDS="4",(o=_p=_p||{}).CONFIGURED_MATCHES_DETECTED="1",o.CONFIGURED_NO_AUTO_DETECTION="2",o.CONFIGURED_NOT_DETECTED="3",o.AUTO_DETECTION_REQUESTED_SUCCESSFUL="4",o.AUTO_DETECTION_REQUESTED_FAILED="5",(w=wp=wp||{}).NO_CACHE_HIT="0",w.FORCE_REFRESH="1",w.NO_CACHED_ACCESS_TOKEN="2",w.CACHED_ACCESS_TOKEN_EXPIRED="3",w.REFRESH_CACHED_ACCESS_TOKEN="4",(o=bp=bp||{}).Jwt="JWT",o.Jwk="JWK";var kp,Pp={code:"unexpected_error",desc:"Unexpected error in authentication."},Op={code:"post_request_failed",desc:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."},xp=(zh(Rp,kp=Error),Rp.prototype.setCorrelationId=function(e){this.correlationId=e},Rp.createUnexpectedError=function(e){return new Rp(Pp.code,Pp.desc+": "+e)},Rp.createPostRequestFailed=function(e){return new Rp(Op.code,Op.desc+": "+e)},Rp);function Rp(e,t,r){var o=this,o=kp.call(this,t?e+": "+t:e)||this;return Object.setPrototypeOf(o,Rp.prototype),o.errorCode=e||Qh.EMPTY_STRING,o.errorMessage=t||Qh.EMPTY_STRING,o.subError=r||Qh.EMPTY_STRING,o.name="AuthError",o}var Mp,Np={createNewGuid:function(){throw xp.createUnexpectedError("Crypto interface - createNewGuid() has not been implemented")},base64Decode:function(){throw xp.createUnexpectedError("Crypto interface - base64Decode() has not been implemented")},base64Encode:function(){throw xp.createUnexpectedError("Crypto interface - base64Encode() has not been implemented")},generatePkceCodes:function(){return Fh(this,void 0,void 0,function(){return Kh(this,function(e){throw xp.createUnexpectedError("Crypto interface - generatePkceCodes() has not been implemented")})})},getPublicKeyThumbprint:function(){return Fh(this,void 0,void 0,function(){return Kh(this,function(e){throw xp.createUnexpectedError("Crypto interface - getPublicKeyThumbprint() has not been implemented")})})},removeTokenBindingKey:function(){return Fh(this,void 0,void 0,function(){return Kh(this,function(e){throw xp.createUnexpectedError("Crypto interface - removeTokenBindingKey() has not been implemented")})})},clearKeystore:function(){return Fh(this,void 0,void 0,function(){return Kh(this,function(e){throw xp.createUnexpectedError("Crypto interface - clearKeystore() has not been implemented")})})},signJwt:function(){return Fh(this,void 0,void 0,function(){return Kh(this,function(e){throw xp.createUnexpectedError("Crypto interface - signJwt() has not been implemented")})})},hashString:function(){return Fh(this,void 0,void 0,function(){return Kh(this,function(e){throw xp.createUnexpectedError("Crypto interface - hashString() has not been implemented")})})}},Lp={code:"client_info_decoding_error",desc:"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause."},Dp={code:"client_info_empty_error",desc:"The client info was empty. Please review the trace to determine the root cause."},qp={code:"token_parsing_error",desc:"Token cannot be parsed. Please review stack trace to determine root cause."},jp={code:"null_or_empty_token",desc:"The token is null or empty. Please review the trace to determine the root cause."},Up={code:"endpoints_resolution_error",desc:"Error: could not resolve endpoints. Please check network and try again."},Hp={code:"network_error",desc:"Network request failed. Please check network trace to determine root cause."},zp={code:"openid_config_error",desc:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints."},Bp={code:"hash_not_deserialized",desc:"The hash parameters could not be deserialized. Please review the trace to determine the root cause."},Fp={code:"invalid_state",desc:"State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState()."},Kp={code:"state_mismatch",desc:"State mismatch error. Please check your network. Continued requests may cause cache overflow."},Gp={code:"state_not_found",desc:"State not found"},Yp={code:"nonce_mismatch",desc:"Nonce mismatch error. This may be caused by a race condition in concurrent requests."},Zp={code:"nonce_not_found",desc:"nonce not found"},Wp={code:"auth_time_not_found",desc:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information."},Vp={code:"max_age_transpired",desc:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication."},Jp={code:"multiple_matching_tokens",desc:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account."},Qp={code:"multiple_matching_accounts",desc:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account"},Xp={code:"multiple_matching_appMetadata",desc:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata"},$p={code:"request_cannot_be_made",desc:"Token request cannot be made without authorization code or refresh token."},ed={code:"cannot_append_empty_scope",desc:"Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info."},td={code:"cannot_remove_empty_scope",desc:"Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info."},rd={code:"cannot_append_scopeset",desc:"Cannot append ScopeSet due to error."},od={code:"empty_input_scopeset",desc:"Empty input ScopeSet cannot be processed."},nd={code:"device_code_polling_cancelled",desc:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true."},id={code:"device_code_expired",desc:"Device code is expired."},sd={code:"device_code_unknown_error",desc:"Device code stopped polling for unknown reasons."},ad={code:"no_account_in_silent_request",desc:"Please pass an account object, silent flow is not supported without account information"},cd={code:"invalid_cache_record",desc:"Cache record object was null or undefined."},ud={code:"invalid_cache_environment",desc:"Invalid environment when attempting to create cache entry"},ld={code:"no_account_found",desc:"No account found in cache for given key."},hd={code:"no cache plugin set on CacheManager",desc:"ICachePlugin needs to be set before using readFromStorage or writeFromStorage"},pd={code:"no_crypto_object",desc:"No crypto object detected. This is required for the following operation: "},dd={code:"invalid_cache_type",desc:"Invalid cache type"},fd={code:"unexpected_account_type",desc:"Unexpected account type."},gd={code:"unexpected_credential_type",desc:"Unexpected credential type."},yd={code:"invalid_assertion",desc:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515"},md={code:"invalid_client_credential",desc:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential"},vd={code:"token_refresh_required",desc:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired."},_d={code:"user_timeout_reached",desc:"User defined timeout for device code polling reached"},wd={code:"token_claims_cnf_required_for_signedjwt",desc:"Cannot generate a POP jwt if the token_claims are not populated"},bd={code:"authorization_code_missing_from_server_response",desc:"Server response does not contain an authorization code to proceed"},Cd={code:"binding_key_not_removed",desc:"Could not remove the credential's binding key from storage."},Ed={code:"end_session_endpoint_not_supported",desc:"Provided authority does not support logout."},Sd={code:"key_id_missing",desc:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key."},Td=(zh(Id,Mp=xp),Id.createClientInfoDecodingError=function(e){return new Id(Lp.code,Lp.desc+" Failed with error: "+e)},Id.createClientInfoEmptyError=function(){return new Id(Dp.code,""+Dp.desc)},Id.createTokenParsingError=function(e){return new Id(qp.code,qp.desc+" Failed with error: "+e)},Id.createTokenNullOrEmptyError=function(e){return new Id(jp.code,jp.desc+" Raw Token Value: "+e)},Id.createEndpointDiscoveryIncompleteError=function(e){return new Id(Up.code,Up.desc+" Detail: "+e)},Id.createNetworkError=function(e,t){return new Id(Hp.code,Hp.desc+" | Fetch client threw: "+t+" | Attempted to reach: "+e.split("?")[0])},Id.createUnableToGetOpenidConfigError=function(e){return new Id(zp.code,zp.desc+" Attempted to retrieve endpoints from: "+e)},Id.createHashNotDeserializedError=function(e){return new Id(Bp.code,Bp.desc+" Given Object: "+e)},Id.createInvalidStateError=function(e,t){return new Id(Fp.code,Fp.desc+" Invalid State: "+e+", Root Err: "+t)},Id.createStateMismatchError=function(){return new Id(Kp.code,Kp.desc)},Id.createStateNotFoundError=function(e){return new Id(Gp.code,Gp.desc+": "+e)},Id.createNonceMismatchError=function(){return new Id(Yp.code,Yp.desc)},Id.createAuthTimeNotFoundError=function(){return new Id(Wp.code,Wp.desc)},Id.createMaxAgeTranspiredError=function(){return new Id(Vp.code,Vp.desc)},Id.createNonceNotFoundError=function(e){return new Id(Zp.code,Zp.desc+": "+e)},Id.createMultipleMatchingTokensInCacheError=function(){return new Id(Jp.code,Jp.desc+".")},Id.createMultipleMatchingAccountsInCacheError=function(){return new Id(Qp.code,Qp.desc)},Id.createMultipleMatchingAppMetadataInCacheError=function(){return new Id(Xp.code,Xp.desc)},Id.createTokenRequestCannotBeMadeError=function(){return new Id($p.code,$p.desc)},Id.createAppendEmptyScopeToSetError=function(e){return new Id(ed.code,ed.desc+" Given Scope: "+e)},Id.createRemoveEmptyScopeFromSetError=function(e){return new Id(td.code,td.desc+" Given Scope: "+e)},Id.createAppendScopeSetError=function(e){return new Id(rd.code,rd.desc+" Detail Error: "+e)},Id.createEmptyInputScopeSetError=function(){return new Id(od.code,""+od.desc)},Id.createDeviceCodeCancelledError=function(){return new Id(nd.code,""+nd.desc)},Id.createDeviceCodeExpiredError=function(){return new Id(id.code,""+id.desc)},Id.createDeviceCodeUnknownError=function(){return new Id(sd.code,""+sd.desc)},Id.createNoAccountInSilentRequestError=function(){return new Id(ad.code,""+ad.desc)},Id.createNullOrUndefinedCacheRecord=function(){return new Id(cd.code,cd.desc)},Id.createInvalidCacheEnvironmentError=function(){return new Id(ud.code,ud.desc)},Id.createNoAccountFoundError=function(){return new Id(ld.code,ld.desc)},Id.createCachePluginError=function(){return new Id(hd.code,""+hd.desc)},Id.createNoCryptoObjectError=function(e){return new Id(pd.code,""+pd.desc+e)},Id.createInvalidCacheTypeError=function(){return new Id(dd.code,""+dd.desc)},Id.createUnexpectedAccountTypeError=function(){return new Id(fd.code,""+fd.desc)},Id.createUnexpectedCredentialTypeError=function(){return new Id(gd.code,""+gd.desc)},Id.createInvalidAssertionError=function(){return new Id(yd.code,""+yd.desc)},Id.createInvalidCredentialError=function(){return new Id(md.code,""+md.desc)},Id.createRefreshRequiredError=function(){return new Id(vd.code,vd.desc)},Id.createUserTimeoutReachedError=function(){return new Id(_d.code,_d.desc)},Id.createTokenClaimsRequiredError=function(){return new Id(wd.code,wd.desc)},Id.createNoAuthCodeInServerResponseError=function(){return new Id(bd.code,bd.desc)},Id.createBindingKeyNotRemovedError=function(){return new Id(Cd.code,Cd.desc)},Id.createLogoutNotSupportedError=function(){return new Id(Ed.code,Ed.desc)},Id.createKeyIdMissingError=function(){return new Id(Sd.code,Sd.desc)},Id);function Id(e,t){t=Mp.call(this,e,t)||this;return t.name="ClientAuthError",Object.setPrototypeOf(t,Id.prototype),t}var Ad,kd=(Pd.decodeAuthToken=function(e){if(Pd.isEmpty(e))throw Td.createTokenNullOrEmptyError(e);var t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(e);if(!t||t.length<4)throw Td.createTokenParsingError("Given token is malformed: "+JSON.stringify(e));return{header:t[1],JWSPayload:t[2],JWSSig:t[3]}},Pd.isEmpty=function(e){return void 0===e||!e||0===e.length},Pd.isEmptyObj=function(e){if(e&&!Pd.isEmpty(e))try{var t=JSON.parse(e);return 0===Object.keys(t).length}catch(e){}return!0},Pd.startsWith=function(e,t){return 0===e.indexOf(t)},Pd.endsWith=function(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length},Pd.queryStringToObject=function(e){function r(e){return decodeURIComponent(e.replace(/\+/g," "))}var o={},e=e.split("&");return e.forEach(function(e){var t;e.trim()&&(e=(t=e.split(/=(.+)/g,2))[0],t=t[1],e&&t&&(o[r(e)]=r(t)))}),o},Pd.trimArrayEntries=function(e){return e.map(function(e){return e.trim()})},Pd.removeEmptyStringsFromArray=function(e){return e.filter(function(e){return!Pd.isEmpty(e)})},Pd.jsonParseHelper=function(e){try{return JSON.parse(e)}catch(e){return null}},Pd.matchPattern=function(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)},Pd);function Pd(){}(w=Ad=Ad||{})[w.Error=0]="Error",w[w.Warning=1]="Warning",w[w.Info=2]="Info",w[w.Verbose=3]="Verbose",w[w.Trace=4]="Trace";var Od=(xd.prototype.clone=function(e,t,r){return new xd({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:r||this.correlationId},e,t)},xd.prototype.logMessage=function(e,t){var r;t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii||(r=(new Date).toUTCString(),e=(kd.isEmpty(t.correlationId)?kd.isEmpty(this.correlationId)?"["+r+"]":"["+r+"] : ["+this.correlationId+"]":"["+r+"] : ["+t.correlationId+"]")+" : "+this.packageName+"@"+this.packageVersion+" : "+Ad[t.logLevel]+" - "+e,this.executeCallback(t.logLevel,e,t.containsPii||!1))},xd.prototype.executeCallback=function(e,t,r){this.localCallback&&this.localCallback(e,t,r)},xd.prototype.error=function(e,t){this.logMessage(e,{logLevel:Ad.Error,containsPii:!1,correlationId:t||Qh.EMPTY_STRING})},xd.prototype.errorPii=function(e,t){this.logMessage(e,{logLevel:Ad.Error,containsPii:!0,correlationId:t||Qh.EMPTY_STRING})},xd.prototype.warning=function(e,t){this.logMessage(e,{logLevel:Ad.Warning,containsPii:!1,correlationId:t||Qh.EMPTY_STRING})},xd.prototype.warningPii=function(e,t){this.logMessage(e,{logLevel:Ad.Warning,containsPii:!0,correlationId:t||Qh.EMPTY_STRING})},xd.prototype.info=function(e,t){this.logMessage(e,{logLevel:Ad.Info,containsPii:!1,correlationId:t||Qh.EMPTY_STRING})},xd.prototype.infoPii=function(e,t){this.logMessage(e,{logLevel:Ad.Info,containsPii:!0,correlationId:t||Qh.EMPTY_STRING})},xd.prototype.verbose=function(e,t){this.logMessage(e,{logLevel:Ad.Verbose,containsPii:!1,correlationId:t||Qh.EMPTY_STRING})},xd.prototype.verbosePii=function(e,t){this.logMessage(e,{logLevel:Ad.Verbose,containsPii:!0,correlationId:t||Qh.EMPTY_STRING})},xd.prototype.trace=function(e,t){this.logMessage(e,{logLevel:Ad.Trace,containsPii:!1,correlationId:t||Qh.EMPTY_STRING})},xd.prototype.tracePii=function(e,t){this.logMessage(e,{logLevel:Ad.Trace,containsPii:!0,correlationId:t||Qh.EMPTY_STRING})},xd.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled||!1},xd);function xd(e,t,r){this.level=Ad.Info;this.localCallback=e.loggerCallback||function(){},this.piiLoggingEnabled=e.piiLoggingEnabled||!1,this.level="number"==typeof e.logLevel?e.logLevel:Ad.Info,this.correlationId=e.correlationId||Qh.EMPTY_STRING,this.packageName=t||Qh.EMPTY_STRING,this.packageVersion=r||Qh.EMPTY_STRING}var Rd;(o=Rd=Rd||{})[o.None=0]="None",o.AzurePublic="https://login.microsoftonline.com",o.AzurePpe="https://login.windows-ppe.net",o.AzureChina="https://login.chinacloudapi.cn",o.AzureGermany="https://login.microsoftonline.de",o.AzureUsGovernment="https://login.microsoftonline.us";var Md=(Nd.prototype.generateAccountId=function(){return Nd.generateAccountIdForCacheKey(this.homeAccountId,this.environment)},Nd.prototype.generateCredentialId=function(){return Nd.generateCredentialIdForCacheKey(this.credentialType,this.clientId,this.realm,this.familyId)},Nd.prototype.generateTarget=function(){return Nd.generateTargetForCacheKey(this.target)},Nd.prototype.generateCredentialKey=function(){return Nd.generateCredentialCacheKey(this.homeAccountId,this.environment,this.credentialType,this.clientId,this.realm,this.target,this.familyId,this.tokenType,this.requestedClaimsHash)},Nd.prototype.generateType=function(){switch(this.credentialType){case sp.ID_TOKEN:return cp.ID_TOKEN;case sp.ACCESS_TOKEN:case sp.ACCESS_TOKEN_WITH_AUTH_SCHEME:return cp.ACCESS_TOKEN;case sp.REFRESH_TOKEN:return cp.REFRESH_TOKEN;default:throw Td.createUnexpectedCredentialTypeError()}},Nd.getCredentialType=function(e){return-1!==e.indexOf(sp.ACCESS_TOKEN.toLowerCase())?-1!==e.indexOf(sp.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())?sp.ACCESS_TOKEN_WITH_AUTH_SCHEME:sp.ACCESS_TOKEN:-1!==e.indexOf(sp.ID_TOKEN.toLowerCase())?sp.ID_TOKEN:-1!==e.indexOf(sp.REFRESH_TOKEN.toLowerCase())?sp.REFRESH_TOKEN:Qh.NOT_DEFINED},Nd.generateCredentialCacheKey=function(e,t,r,o,n,i,s,a,c){return[this.generateAccountIdForCacheKey(e,t),this.generateCredentialIdForCacheKey(r,o,n,s),this.generateTargetForCacheKey(i),this.generateClaimsHashForCacheKey(c),this.generateSchemeForCacheKey(a)].join(ip.CACHE_KEY_SEPARATOR).toLowerCase()},Nd.generateAccountIdForCacheKey=function(e,t){return[e,t].join(ip.CACHE_KEY_SEPARATOR).toLowerCase()},Nd.generateCredentialIdForCacheKey=function(e,t,r,o){return[e,e===sp.REFRESH_TOKEN&&o||t,r||Qh.EMPTY_STRING].join(ip.CACHE_KEY_SEPARATOR).toLowerCase()},Nd.generateTargetForCacheKey=function(e){return(e||Qh.EMPTY_STRING).toLowerCase()},Nd.generateClaimsHashForCacheKey=function(e){return(e||Qh.EMPTY_STRING).toLowerCase()},Nd.generateSchemeForCacheKey=function(e){return e&&e.toLowerCase()!==fp.BEARER.toLowerCase()?e.toLowerCase():Qh.EMPTY_STRING},Nd);function Nd(){}var Ld,Dd={code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},qd={code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},jd={code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},Ud={code:"authority_uri_insecure",desc:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options"},Hd={code:"url_parse_error",desc:"URL could not be parsed into appropriate segments."},zd={code:"empty_url_error",desc:"URL was empty or null."},Bd={code:"empty_input_scopes_error",desc:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token."},Fd={code:"clientid_input_scopes_error",desc:"Client ID can only be provided as a single scope."},Kd={code:"invalid_prompt_value",desc:"Supported prompt values are 'login', 'select_account', 'consent', 'create', 'none' and 'no_session'. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest"},Gd={code:"invalid_claims",desc:"Given claims parameter must be a stringified JSON object."},Yd={code:"token_request_empty",desc:"Token request was empty and not found in cache."},Zd={code:"logout_request_empty",desc:"The logout request was null or undefined."},Wd={code:"invalid_code_challenge_method",desc:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".'},Vd={code:"pkce_params_missing",desc:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"},Jd={code:"invalid_cloud_discovery_metadata",desc:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields"},Qd={code:"invalid_authority_metadata",desc:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields."},Xd={code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."},$d={code:"invalid_azure_cloud_instance",desc:"Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values"},ef={code:"missing_ssh_jwk",desc:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."},tf={code:"missing_ssh_kid",desc:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme."},rf={code:"missing_nonce_authentication_header",desc:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce."},of={code:"invalid_authentication_header",desc:"Invalid authentication header provided"},nf=(zh(sf,Ld=Td),sf.createRedirectUriEmptyError=function(){return new sf(Dd.code,Dd.desc)},sf.createPostLogoutRedirectUriEmptyError=function(){return new sf(qd.code,qd.desc)},sf.createClaimsRequestParsingError=function(e){return new sf(jd.code,jd.desc+" Given value: "+e)},sf.createInsecureAuthorityUriError=function(e){return new sf(Ud.code,Ud.desc+" Given URI: "+e)},sf.createUrlParseError=function(e){return new sf(Hd.code,Hd.desc+" Given Error: "+e)},sf.createUrlEmptyError=function(){return new sf(zd.code,zd.desc)},sf.createEmptyScopesArrayError=function(){return new sf(Bd.code,""+Bd.desc)},sf.createClientIdSingleScopeError=function(e){return new sf(Fd.code,Fd.desc+" Given Scopes: "+e)},sf.createInvalidPromptError=function(e){return new sf(Kd.code,Kd.desc+" Given value: "+e)},sf.createInvalidClaimsRequestError=function(){return new sf(Gd.code,Gd.desc)},sf.createEmptyLogoutRequestError=function(){return new sf(Zd.code,Zd.desc)},sf.createEmptyTokenRequestError=function(){return new sf(Yd.code,Yd.desc)},sf.createInvalidCodeChallengeMethodError=function(){return new sf(Wd.code,Wd.desc)},sf.createInvalidCodeChallengeParamsError=function(){return new sf(Vd.code,Vd.desc)},sf.createInvalidCloudDiscoveryMetadataError=function(){return new sf(Jd.code,Jd.desc)},sf.createInvalidAuthorityMetadataError=function(){return new sf(Qd.code,Qd.desc)},sf.createUntrustedAuthorityError=function(){return new sf(Xd.code,Xd.desc)},sf.createInvalidAzureCloudInstanceError=function(){return new sf($d.code,$d.desc)},sf.createMissingSshJwkError=function(){return new sf(ef.code,ef.desc)},sf.createMissingSshKidError=function(){return new sf(tf.code,tf.desc)},sf.createMissingNonceAuthenticationHeadersError=function(){return new sf(rf.code,rf.desc)},sf.createInvalidAuthenticationHeaderError=function(e,t){return new sf(of.code,of.desc+". Invalid header: "+e+". Details: "+t)},sf);function sf(e,t){t=Ld.call(this,e,t)||this;return t.name="ClientConfigurationError",Object.setPrototypeOf(t,sf.prototype),t}var af,cf=(uf.fromString=function(e){return new uf((e||Qh.EMPTY_STRING).split(" "))},uf.prototype.validateInputScopes=function(e){if(!e||e.length<1)throw nf.createEmptyScopesArrayError()},uf.prototype.containsScope=function(e){var t=new uf(this.printScopesLowerCase().split(" "));return!kd.isEmpty(e)&&t.scopes.has(e.toLowerCase())},uf.prototype.containsScopeSet=function(e){var t=this;return!(!e||e.scopes.size<=0)&&(this.scopes.size>=e.scopes.size&&e.asArray().every(function(e){return t.containsScope(e)}))},uf.prototype.containsOnlyOIDCScopes=function(){var t=this,r=0;return $h.forEach(function(e){t.containsScope(e)&&(r+=1)}),this.scopes.size===r},uf.prototype.appendScope=function(e){kd.isEmpty(e)||this.scopes.add(e.trim())},uf.prototype.appendScopes=function(e){var t=this;try{e.forEach(function(e){return t.appendScope(e)})}catch(e){throw Td.createAppendScopeSetError(e)}},uf.prototype.removeScope=function(e){if(kd.isEmpty(e))throw Td.createRemoveEmptyScopeFromSetError(e);this.scopes.delete(e.trim())},uf.prototype.removeOIDCScopes=function(){var t=this;$h.forEach(function(e){t.scopes.delete(e)})},uf.prototype.unionScopeSets=function(e){if(!e)throw Td.createEmptyInputScopeSetError();var t=new Set;return e.scopes.forEach(function(e){return t.add(e.toLowerCase())}),this.scopes.forEach(function(e){return t.add(e.toLowerCase())}),t},uf.prototype.intersectingScopeSets=function(e){if(!e)throw Td.createEmptyInputScopeSetError();e.containsOnlyOIDCScopes()||e.removeOIDCScopes();var t=this.unionScopeSets(e),r=e.getScopeCount(),e=this.getScopeCount();return t.size<e+r},uf.prototype.getScopeCount=function(){return this.scopes.size},uf.prototype.asArray=function(){var t=[];return this.scopes.forEach(function(e){return t.push(e)}),t},uf.prototype.printScopes=function(){return this.scopes?this.asArray().join(" "):Qh.EMPTY_STRING},uf.prototype.printScopesLowerCase=function(){return this.printScopes().toLowerCase()},uf);function uf(e){var t=this,e=e?kd.trimArrayEntries(Gh(e)):[],e=e?kd.removeEmptyStringsFromArray(e):[];this.validateInputScopes(e),this.scopes=new Set,e.forEach(function(e){return t.scopes.add(e)})}function lf(e,t){if(kd.isEmpty(e))throw Td.createClientInfoEmptyError();try{var r=t.base64Decode(e);return JSON.parse(r)}catch(e){throw Td.createClientInfoDecodingError(e.message)}}function hf(e){if(kd.isEmpty(e))throw Td.createClientInfoDecodingError("Home account ID was empty.");e=e.split(ip.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?Qh.EMPTY_STRING:e[1]}}(w=af=af||{})[w.Default=0]="Default",w[w.Adfs=1]="Adfs",w[w.Dsts=2]="Dsts";var pf=(df.prototype.generateAccountId=function(){return[this.homeAccountId,this.environment].join(ip.CACHE_KEY_SEPARATOR).toLowerCase()},df.prototype.generateAccountKey=function(){return df.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})},df.prototype.generateType=function(){switch(this.authorityType){case np.ADFS_ACCOUNT_TYPE:return cp.ADFS;case np.MSAV1_ACCOUNT_TYPE:return cp.MSA;case np.MSSTS_ACCOUNT_TYPE:return cp.MSSTS;case np.GENERIC_ACCOUNT_TYPE:return cp.GENERIC;default:throw Td.createUnexpectedAccountTypeError()}},df.prototype.getAccountInfo=function(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,idTokenClaims:this.idTokenClaims,nativeAccountId:this.nativeAccountId}},df.generateAccountCacheKey=function(e){return[e.homeAccountId,e.environment||Qh.EMPTY_STRING,e.tenantId||Qh.EMPTY_STRING].join(ip.CACHE_KEY_SEPARATOR).toLowerCase()},df.createAccount=function(e,t,r,o,n,i,s,a){var c=new df;c.authorityType=np.MSSTS_ACCOUNT_TYPE,c.clientInfo=e,c.homeAccountId=t,c.nativeAccountId=a;var u,o=s||o&&o.getPreferredCache();if(!o)throw Td.createInvalidCacheEnvironmentError();return c.environment=o,c.realm=(null===(o=null==r?void 0:r.claims)||void 0===o?void 0:o.tid)||Qh.EMPTY_STRING,r&&(c.idTokenClaims=r.claims,c.localAccountId=(null===(o=null==r?void 0:r.claims)||void 0===o?void 0:o.oid)||(null===(u=null==r?void 0:r.claims)||void 0===u?void 0:u.sub)||Qh.EMPTY_STRING,u=null===(o=null==r?void 0:r.claims)||void 0===o?void 0:o.preferred_username,o=null!==(o=null==r?void 0:r.claims)&&void 0!==o&&o.emails?r.claims.emails[0]:null,c.username=u||o||Qh.EMPTY_STRING,c.name=null===(r=null==r?void 0:r.claims)||void 0===r?void 0:r.name),c.cloudGraphHostName=n,c.msGraphHost=i,c},df.createGenericAccount=function(e,t,r,o,n,i){var s,a=new df;a.authorityType=r&&r.authorityType===af.Adfs?np.ADFS_ACCOUNT_TYPE:np.GENERIC_ACCOUNT_TYPE,a.homeAccountId=e,a.realm=Qh.EMPTY_STRING;i=i||r&&r.getPreferredCache();if(!i)throw Td.createInvalidCacheEnvironmentError();return t&&(a.localAccountId=(null===(r=null==t?void 0:t.claims)||void 0===r?void 0:r.oid)||(null===(s=null==t?void 0:t.claims)||void 0===s?void 0:s.sub)||Qh.EMPTY_STRING,a.username=(null===(s=null==t?void 0:t.claims)||void 0===s?void 0:s.upn)||Qh.EMPTY_STRING,a.name=(null===(s=null==t?void 0:t.claims)||void 0===s?void 0:s.name)||Qh.EMPTY_STRING,a.idTokenClaims=null==t?void 0:t.claims),a.environment=i,a.cloudGraphHostName=o,a.msGraphHost=n,a},df.generateHomeAccountId=function(e,t,r,o,n){var i,n=null!==(i=null==n?void 0:n.claims)&&void 0!==i&&i.sub?n.claims.sub:Qh.EMPTY_STRING;if(t===af.Adfs||t===af.Dsts)return n;if(e)try{var s=lf(e,o);if(!kd.isEmpty(s.uid)&&!kd.isEmpty(s.utid))return""+s.uid+ip.CLIENT_INFO_SEPARATOR+s.utid}catch(e){}return r.verbose("No client info in response"),n},df.isAccountEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"))},df.accountInfoIsEqual=function(e,t,r){if(!e||!t)return!1;var o,n=!0;return r&&(o=e.idTokenClaims||{},r=t.idTokenClaims||{},n=o.iat===r.iat&&o.nonce===r.nonce),e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&e.nativeAccountId===t.nativeAccountId&&n},df);function df(){}var ff=(gf.extractTokenClaims=function(e,t){e=kd.decodeAuthToken(e);try{var r=e.JWSPayload,o=t.base64Decode(r);return JSON.parse(o)}catch(e){throw Td.createTokenParsingError(e)}},gf.checkMaxAge=function(e,t){if(0===t||Date.now()-3e5>e+t)throw Td.createMaxAgeTranspiredError()},gf);function gf(e,t){if(kd.isEmpty(e))throw Td.createTokenNullOrEmptyError(e);this.rawToken=e,this.claims=gf.extractTokenClaims(e,t)}var yf=(mf.prototype.getAllAccounts=function(){var r=this,t=this.getAccountsFilteredBy(),e=Object.keys(t).map(function(e){return t[e]});return e.length<1?[]:e.map(function(e){var t=mf.toObject(new pf,e).getAccountInfo(),e=r.readIdTokenFromCache(r.clientId,t);return e&&!t.idTokenClaims&&(t.idToken=e.secret,t.idTokenClaims=new ff(e.secret,r.cryptoImpl).claims),t})},mf.prototype.saveCacheRecord=function(t){return Fh(this,void 0,void 0,function(){return Kh(this,function(e){switch(e.label){case 0:if(!t)throw Td.createNullOrUndefinedCacheRecord();return t.account&&this.setAccount(t.account),t.idToken&&this.setIdTokenCredential(t.idToken),t.accessToken?[4,this.saveAccessToken(t.accessToken)]:[3,2];case 1:e.sent(),e.label=2;case 2:return t.refreshToken&&this.setRefreshTokenCredential(t.refreshToken),t.appMetadata&&this.setAppMetadata(t.appMetadata),[2]}})})},mf.prototype.saveAccessToken=function(s){return Fh(this,void 0,void 0,function(){var t,r,o,n,i=this;return Kh(this,function(e){switch(e.label){case 0:return(t=this.getCredentialsFilteredBy({clientId:s.clientId,credentialType:s.credentialType,environment:s.environment,homeAccountId:s.homeAccountId,realm:s.realm,tokenType:s.tokenType,requestedClaimsHash:s.requestedClaimsHash}),r=cf.fromString(s.target),o=Object.keys(t.accessTokens).map(function(e){return t.accessTokens[e]}))?(n=[],o.forEach(function(e){cf.fromString(e.target).intersectingScopeSets(r)&&n.push(i.removeCredential(e))}),[4,Promise.all(n)]):[3,2];case 1:e.sent(),e.label=2;case 2:return this.setAccessTokenCredential(s),[2]}})})},mf.prototype.getAccountsFilteredBy=function(e){return this.getAccountsFilteredByInternal(e?e.homeAccountId:Qh.EMPTY_STRING,e?e.environment:Qh.EMPTY_STRING,e?e.realm:Qh.EMPTY_STRING,e?e.nativeAccountId:Qh.EMPTY_STRING)},mf.prototype.getAccountsFilteredByInternal=function(r,o,n,i){var s=this,e=this.getKeys(),a={};return e.forEach(function(e){var t=s.getAccount(e);t&&(r&&!s.matchHomeAccountId(t,r)||o&&!s.matchEnvironment(t,o)||n&&!s.matchRealm(t,n)||i&&!s.matchNativeAccountId(t,i)||(a[e]=t))}),a},mf.prototype.getCredentialsFilteredBy=function(e){return this.getCredentialsFilteredByInternal(e.homeAccountId,e.environment,e.credentialType,e.clientId,e.familyId,e.realm,e.target,e.userAssertionHash,e.tokenType,e.keyId,e.requestedClaimsHash)},mf.prototype.getCredentialsFilteredByInternal=function(n,i,s,a,c,u,l,h,p,d,f){var g=this,e=this.getKeys(),y={idTokens:{},accessTokens:{},refreshTokens:{}};return e.forEach(function(e){var t=Md.getCredentialType(e);if(t!==Qh.NOT_DEFINED){var r=g.getSpecificCredential(e,t);if(r&&(!h||g.matchUserAssertionHash(r,h))&&("string"!=typeof n||g.matchHomeAccountId(r,n))&&(!i||g.matchEnvironment(r,i))&&(!u||g.matchRealm(r,u))&&(!s||g.matchCredentialType(r,s))&&(!a||g.matchClientId(r,a))&&(!c||g.matchFamilyId(r,c))&&(!l||g.matchTarget(r,l))&&(!f&&!r.requestedClaimsHash||r.requestedClaimsHash===f)){if(s===sp.ACCESS_TOKEN_WITH_AUTH_SCHEME){if(p&&!g.matchTokenType(r,p))return;if(p===fp.SSH&&d&&!g.matchKeyId(r,d))return}var o=g.updateCredentialCacheKey(e,r);switch(t){case sp.ID_TOKEN:y.idTokens[o]=r;break;case sp.ACCESS_TOKEN:case sp.ACCESS_TOKEN_WITH_AUTH_SCHEME:y.accessTokens[o]=r;break;case sp.REFRESH_TOKEN:y.refreshTokens[o]=r}}}}),y},mf.prototype.getAppMetadataFilteredBy=function(e){return this.getAppMetadataFilteredByInternal(e.environment,e.clientId)},mf.prototype.getAppMetadataFilteredByInternal=function(r,o){var n=this,e=this.getKeys(),i={};return e.forEach(function(e){var t;!n.isAppMetadata(e)||(t=n.getAppMetadata(e))&&(r&&!n.matchEnvironment(t,r)||o&&!n.matchClientId(t,o)||(i[e]=t))}),i},mf.prototype.getAuthorityMetadataByAlias=function(t){var r=this,e=this.getAuthorityMetadataKeys(),o=null;return e.forEach(function(e){!r.isAuthorityMetadata(e)||-1===e.indexOf(r.clientId)||(e=r.getAuthorityMetadata(e))&&-1!==e.aliases.indexOf(t)&&(o=e)}),o},mf.prototype.removeAllAccounts=function(){return Fh(this,void 0,void 0,function(){var t,r,o=this;return Kh(this,function(e){switch(e.label){case 0:return t=this.getKeys(),r=[],t.forEach(function(e){o.getAccount(e)&&r.push(o.removeAccount(e))}),[4,Promise.all(r)];case 1:return e.sent(),[2,!0]}})})},mf.prototype.removeAccount=function(r){return Fh(this,void 0,void 0,function(){var t;return Kh(this,function(e){switch(e.label){case 0:if(!(t=this.getAccount(r)))throw Td.createNoAccountFoundError();return[4,this.removeAccountContext(t)];case 1:return[2,e.sent()&&this.removeItem(r,ap.ACCOUNT)]}})})},mf.prototype.removeAccountContext=function(i){return Fh(this,void 0,void 0,function(){var t,r,o,n=this;return Kh(this,function(e){switch(e.label){case 0:return t=this.getKeys(),r=i.generateAccountId(),o=[],t.forEach(function(e){var t=Md.getCredentialType(e);t===Qh.NOT_DEFINED||(t=n.getSpecificCredential(e,t))&&r===t.generateAccountId()&&o.push(n.removeCredential(t))}),[4,Promise.all(o)];case 1:return e.sent(),[2,!0]}})})},mf.prototype.removeCredential=function(o){return Fh(this,void 0,void 0,function(){var t,r;return Kh(this,function(e){switch(e.label){case 0:if(t=o.generateCredentialKey(),o.credentialType.toLowerCase()!==sp.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())return[3,4];if(o.tokenType!==fp.POP)return[3,4];if(!(r=o.keyId))return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.cryptoImpl.removeTokenBindingKey(r)];case 2:return e.sent(),[3,4];case 3:throw e.sent(),Td.createBindingKeyNotRemovedError();case 4:return[2,this.removeItem(t,ap.CREDENTIAL)]}})})},mf.prototype.removeAppMetadata=function(){var t=this;return this.getKeys().forEach(function(e){t.isAppMetadata(e)&&t.removeItem(e,ap.APP_METADATA)}),!0},mf.prototype.readCacheRecord=function(e,t,r,o){var n=this.readAccountFromCache(e),i=this.readIdTokenFromCache(t,e),r=this.readAccessTokenFromCache(t,e,r),e=this.readRefreshTokenFromCache(t,e,!1),t=this.readAppMetadataFromCache(o,t);return n&&i&&(n.idTokenClaims=new ff(i.secret,this.cryptoImpl).claims),{account:n,idToken:i,accessToken:r,refreshToken:e,appMetadata:t}},mf.prototype.readAccountFromCache=function(e){e=pf.generateAccountCacheKey(e);return this.getAccount(e)},mf.prototype.readAccountFromCacheWithNativeAccountId=function(e){var t=this.getAccountsFilteredBy({nativeAccountId:e}),e=Object.keys(t).map(function(e){return t[e]});if(e.length<1)return null;if(1<e.length)throw Td.createMultipleMatchingAccountsInCacheError();return t[0]},mf.prototype.readIdTokenFromCache=function(e,t){var e={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:sp.ID_TOKEN,clientId:e,realm:t.tenantId},r=this.getCredentialsFilteredBy(e),t=Object.keys(r.idTokens).map(function(e){return r.idTokens[e]}),e=t.length;if(e<1)return null;if(1<e)throw Td.createMultipleMatchingTokensInCacheError();return t[0]},mf.prototype.readAccessTokenFromCache=function(e,t,r){var o=new cf(r.scopes||[]),n=r.authenticationScheme||fp.BEARER,i=n&&n.toLowerCase()!==fp.BEARER.toLowerCase()?sp.ACCESS_TOKEN_WITH_AUTH_SCHEME:sp.ACCESS_TOKEN,n={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:i,clientId:e,realm:t.tenantId,target:o.printScopesLowerCase(),tokenType:n,keyId:r.sshKid,requestedClaimsHash:r.requestedClaimsHash},s=this.getCredentialsFilteredBy(n),r=Object.keys(s.accessTokens).map(function(e){return s.accessTokens[e]}),n=r.length;if(n<1)return null;if(1<n)throw Td.createMultipleMatchingTokensInCacheError();return r[0]},mf.prototype.readRefreshTokenFromCache=function(e,t,r){var r={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:sp.REFRESH_TOKEN,clientId:e,familyId:r?"1":void 0},o=this.getCredentialsFilteredBy(r),r=Object.keys(o.refreshTokens).map(function(e){return o.refreshTokens[e]});return r.length<1?null:r[0]},mf.prototype.readAppMetadataFromCache=function(e,t){var r=this.getAppMetadataFilteredBy({environment:e,clientId:t}),e=Object.keys(r).map(function(e){return r[e]}),t=e.length;if(t<1)return null;if(1<t)throw Td.createMultipleMatchingAppMetadataInCacheError();return e[0]},mf.prototype.isAppMetadataFOCI=function(e,t){t=this.readAppMetadataFromCache(e,t);return!(!t||"1"!==t.familyId)},mf.prototype.matchHomeAccountId=function(e,t){return!("string"!=typeof e.homeAccountId||t!==e.homeAccountId)},mf.prototype.matchUserAssertionHash=function(e,t){return!(!e.userAssertionHash||t!==e.userAssertionHash)},mf.prototype.matchEnvironment=function(e,t){t=this.getAuthorityMetadataByAlias(t);return!!(t&&-1<t.aliases.indexOf(e.environment))},mf.prototype.matchCredentialType=function(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()},mf.prototype.matchClientId=function(e,t){return!(!e.clientId||t!==e.clientId)},mf.prototype.matchFamilyId=function(e,t){return!(!e.familyId||t!==e.familyId)},mf.prototype.matchRealm=function(e,t){return!(!e.realm||t!==e.realm)},mf.prototype.matchNativeAccountId=function(e,t){return!(!e.nativeAccountId||t!==e.nativeAccountId)},mf.prototype.matchTarget=function(e,t){if(e.credentialType!==sp.ACCESS_TOKEN&&e.credentialType!==sp.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target)return!1;e=cf.fromString(e.target),t=cf.fromString(t);return t.containsOnlyOIDCScopes()?t.removeScope(Qh.OFFLINE_ACCESS_SCOPE):t.removeOIDCScopes(),e.containsScopeSet(t)},mf.prototype.matchTokenType=function(e,t){return!(!e.tokenType||e.tokenType!==t)},mf.prototype.matchKeyId=function(e,t){return!(!e.keyId||e.keyId!==t)},mf.prototype.isAppMetadata=function(e){return-1!==e.indexOf(hp)},mf.prototype.isAuthorityMetadata=function(e){return-1!==e.indexOf(pp)},mf.prototype.generateAuthorityMetadataCacheKey=function(e){return pp+"-"+this.clientId+"-"+e},mf.prototype.getSpecificCredential=function(e,t){switch(t){case sp.ID_TOKEN:return this.getIdTokenCredential(e);case sp.ACCESS_TOKEN:case sp.ACCESS_TOKEN_WITH_AUTH_SCHEME:return this.getAccessTokenCredential(e);case sp.REFRESH_TOKEN:return this.getRefreshTokenCredential(e);default:return null}},mf.toObject=function(e,t){for(var r in t)e[r]=t[r];return e},mf);function mf(e,t){this.clientId=e,this.cryptoImpl=t}var vf,_f=(zh(wf,vf=yf),wf.prototype.setAccount=function(){throw xp.createUnexpectedError("Storage interface - setAccount() has not been implemented for the cacheStorage interface.")},wf.prototype.getAccount=function(){throw xp.createUnexpectedError("Storage interface - getAccount() has not been implemented for the cacheStorage interface.")},wf.prototype.setIdTokenCredential=function(){throw xp.createUnexpectedError("Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.")},wf.prototype.getIdTokenCredential=function(){throw xp.createUnexpectedError("Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.")},wf.prototype.setAccessTokenCredential=function(){throw xp.createUnexpectedError("Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.")},wf.prototype.getAccessTokenCredential=function(){throw xp.createUnexpectedError("Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.")},wf.prototype.setRefreshTokenCredential=function(){throw xp.createUnexpectedError("Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.")},wf.prototype.getRefreshTokenCredential=function(){throw xp.createUnexpectedError("Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.")},wf.prototype.setAppMetadata=function(){throw xp.createUnexpectedError("Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.")},wf.prototype.getAppMetadata=function(){throw xp.createUnexpectedError("Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.")},wf.prototype.setServerTelemetry=function(){throw xp.createUnexpectedError("Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.")},wf.prototype.getServerTelemetry=function(){throw xp.createUnexpectedError("Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.")},wf.prototype.setAuthorityMetadata=function(){throw xp.createUnexpectedError("Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.")},wf.prototype.getAuthorityMetadata=function(){throw xp.createUnexpectedError("Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.")},wf.prototype.getAuthorityMetadataKeys=function(){throw xp.createUnexpectedError("Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.")},wf.prototype.setThrottlingCache=function(){throw xp.createUnexpectedError("Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.")},wf.prototype.getThrottlingCache=function(){throw xp.createUnexpectedError("Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.")},wf.prototype.removeItem=function(){throw xp.createUnexpectedError("Storage interface - removeItem() has not been implemented for the cacheStorage interface.")},wf.prototype.containsKey=function(){throw xp.createUnexpectedError("Storage interface - containsKey() has not been implemented for the cacheStorage interface.")},wf.prototype.getKeys=function(){throw xp.createUnexpectedError("Storage interface - getKeys() has not been implemented for the cacheStorage interface.")},wf.prototype.clear=function(){return Fh(this,void 0,void 0,function(){return Kh(this,function(e){throw xp.createUnexpectedError("Storage interface - clear() has not been implemented for the cacheStorage interface.")})})},wf.prototype.updateCredentialCacheKey=function(){throw xp.createUnexpectedError("Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.")},wf);function wf(){return null!==vf&&vf.apply(this,arguments)||this}var bf={tokenRenewalOffsetSeconds:300,preventCorsPreflight:!1,proxyUrl:Qh.EMPTY_STRING},Cf={loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:Ad.Info,correlationId:Qh.EMPTY_STRING},Ef={sendGetRequestAsync:function(){return Fh(this,void 0,void 0,function(){return Kh(this,function(e){throw xp.createUnexpectedError("Network interface - sendGetRequestAsync() has not been implemented")})})},sendPostRequestAsync:function(){return Fh(this,void 0,void 0,function(){return Kh(this,function(e){throw xp.createUnexpectedError("Network interface - sendPostRequestAsync() has not been implemented")})})}},Sf={sku:Qh.SKU,version:"9.0.1",cpu:Qh.EMPTY_STRING,os:Qh.EMPTY_STRING},Tf={clientSecret:Qh.EMPTY_STRING,clientAssertion:void 0},If={azureCloudInstance:Rd.None,tenant:""+Qh.DEFAULT_COMMON_TENANT},Af={application:{appName:"",appVersion:""}};function kf(e){var t=e.authOptions,r=e.systemOptions,o=e.loggerOptions,n=e.storageInterface,i=e.networkInterface,s=e.cryptoInterface,a=e.clientCredentials,c=e.libraryInfo,u=e.telemetry,l=e.serverTelemetryManager,h=e.persistencePlugin,e=e.serializableCache,o=Bh(Bh({},Cf),o);return{authOptions:Bh({clientCapabilities:[],azureCloudOptions:If,skipAuthorityMetadataCache:!1},t),systemOptions:Bh(Bh({},bf),r),loggerOptions:o,storageInterface:n||new _f(t.clientId,Np),networkInterface:i||Ef,cryptoInterface:s||Np,clientCredentials:a||Tf,libraryInfo:Bh(Bh({},Sf),c),telemetry:Bh(Bh({},Af),u),serverTelemetryManager:l||null,persistencePlugin:h||null,serializableCache:e||null}}var Pf,Of=(zh(xf,Pf=xp),xf);function xf(e,t,r){r=Pf.call(this,e,t,r)||this;return r.name="ServerError",Object.setPrototypeOf(r,xf.prototype),r}var Rf=(Mf.generateThrottlingStorageKey=function(e){return Sp+"."+JSON.stringify(e)},Mf.preProcess=function(e,t){var r=Mf.generateThrottlingStorageKey(t),o=e.getThrottlingCache(r);if(o){if(!(o.throttleTime<Date.now()))throw new Of((null===(t=o.errorCodes)||void 0===t?void 0:t.join(" "))||Qh.EMPTY_STRING,o.errorMessage,o.subError);e.removeItem(r,ap.THROTTLING)}},Mf.postProcess=function(e,t,r){(Mf.checkResponseStatus(r)||Mf.checkResponseForRetryAfter(r))&&(r={throttleTime:Mf.calculateThrottleTime(parseInt(r.headers[Yh.RETRY_AFTER])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror},e.setThrottlingCache(Mf.generateThrottlingStorageKey(t),r))},Mf.checkResponseStatus=function(e){return 429===e.status||500<=e.status&&e.status<600},Mf.checkResponseForRetryAfter=function(e){return!!e.headers&&(e.headers.hasOwnProperty(Yh.RETRY_AFTER)&&(e.status<200||300<=e.status))},Mf.calculateThrottleTime=function(e){var t=e<=0?0:e,e=Date.now()/1e3;return Math.floor(1e3*Math.min(e+(t||Cp),e+Ep))},Mf.removeThrottle=function(e,t,r,o){r={clientId:t,authority:r.authority,scopes:r.scopes,homeAccountIdentifier:o,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},r=this.generateThrottlingStorageKey(r);return e.removeItem(r,ap.THROTTLING)},Mf);function Mf(){}var Nf,Lf=(Df.prototype.sendPostRequest=function(o,n,i){return Fh(this,void 0,void 0,function(){var t,r;return Kh(this,function(e){switch(e.label){case 0:Rf.preProcess(this.cacheManager,o),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.networkClient.sendPostRequestAsync(n,i)];case 2:return t=e.sent(),[3,4];case 3:throw(r=e.sent())instanceof xp?r:Td.createNetworkError(n,r);case 4:return Rf.postProcess(this.cacheManager,o,t),[2,t]}})})},Df);function Df(e,t){this.networkClient=e,this.cacheManager=t}(o=Nf=Nf||{}).HOME_ACCOUNT_ID="home_account_id",o.UPN="UPN";qf.prototype.createTokenRequestHeaders=function(e){var t={};if(t[Yh.CONTENT_TYPE]=Qh.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Nf.HOME_ACCOUNT_ID:try{var r=hf(e.credential);t[Yh.CCS_HEADER]="Oid:"+r.uid+"@"+r.utid}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Nf.UPN:t[Yh.CCS_HEADER]="UPN: "+e.credential}return t},qf.prototype.executePostToTokenEndpoint=function(r,o,n,i){return Fh(this,void 0,void 0,function(){var t;return Kh(this,function(e){switch(e.label){case 0:return[4,this.networkManager.sendPostRequest(i,r,{body:o,headers:n,proxyUrl:this.config.systemOptions.proxyUrl})];case 1:return t=e.sent(),this.config.serverTelemetryManager&&t.status<500&&429!==t.status&&this.config.serverTelemetryManager.clearTelemetryCache(),[2,t]}})})},qf.prototype.updateAuthority=function(e){if(!e.discoveryComplete())throw Td.createEndpointDiscoveryIncompleteError("Updated authority has not completed endpoint discovery.");this.authority=e},w=qf;function qf(e,t){this.config=kf(e),this.logger=new Od(this.config.loggerOptions,"@azure/msal-common","9.0.1"),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new Lf(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}var jf=(Uf.validateRedirectUri=function(e){if(kd.isEmpty(e))throw nf.createRedirectUriEmptyError()},Uf.validatePrompt=function(e){var t,r=[];for(t in tp)r.push(tp[t]);if(r.indexOf(e)<0)throw nf.createInvalidPromptError(e)},Uf.validateClaims=function(e){try{JSON.parse(e)}catch(e){throw nf.createInvalidClaimsRequestError()}},Uf.validateCodeChallengeParams=function(e,t){if(kd.isEmpty(e)||kd.isEmpty(t))throw nf.createInvalidCodeChallengeParamsError();this.validateCodeChallengeMethod(t)},Uf.validateCodeChallengeMethod=function(e){if([up.PLAIN,up.S256].indexOf(e)<0)throw nf.createInvalidCodeChallengeMethodError()},Uf.sanitizeEQParams=function(r,e){return r?(e.forEach(function(e,t){r[t]&&delete r[t]}),r):{}},Uf);function Uf(){}var Hf=(zf.prototype.addResponseTypeCode=function(){this.parameters.set(Vh.RESPONSE_TYPE,encodeURIComponent(Qh.CODE_RESPONSE_TYPE))},zf.prototype.addResponseTypeForTokenAndIdToken=function(){this.parameters.set(Vh.RESPONSE_TYPE,encodeURIComponent(Qh.TOKEN_RESPONSE_TYPE+" "+Qh.ID_TOKEN_RESPONSE_TYPE))},zf.prototype.addResponseMode=function(e){this.parameters.set(Vh.RESPONSE_MODE,encodeURIComponent(e||rp.QUERY))},zf.prototype.addNativeBroker=function(){this.parameters.set(Vh.NATIVE_BROKER,encodeURIComponent("1"))},zf.prototype.addScopes=function(e,t){e=(t=void 0===t?!0:t)?Gh(e||[],Xh):e||[],e=new cf(e);this.parameters.set(Vh.SCOPE,encodeURIComponent(e.printScopes()))},zf.prototype.addClientId=function(e){this.parameters.set(Vh.CLIENT_ID,encodeURIComponent(e))},zf.prototype.addRedirectUri=function(e){jf.validateRedirectUri(e),this.parameters.set(Vh.REDIRECT_URI,encodeURIComponent(e))},zf.prototype.addPostLogoutRedirectUri=function(e){jf.validateRedirectUri(e),this.parameters.set(Vh.POST_LOGOUT_URI,encodeURIComponent(e))},zf.prototype.addIdTokenHint=function(e){this.parameters.set(Vh.ID_TOKEN_HINT,encodeURIComponent(e))},zf.prototype.addDomainHint=function(e){this.parameters.set(ep.DOMAIN_HINT,encodeURIComponent(e))},zf.prototype.addLoginHint=function(e){this.parameters.set(ep.LOGIN_HINT,encodeURIComponent(e))},zf.prototype.addCcsUpn=function(e){this.parameters.set(Yh.CCS_HEADER,encodeURIComponent("UPN:"+e))},zf.prototype.addCcsOid=function(e){this.parameters.set(Yh.CCS_HEADER,encodeURIComponent("Oid:"+e.uid+"@"+e.utid))},zf.prototype.addSid=function(e){this.parameters.set(ep.SID,encodeURIComponent(e))},zf.prototype.addClaims=function(e,t){t=this.addClientCapabilitiesToClaims(e,t);jf.validateClaims(t),this.parameters.set(Vh.CLAIMS,encodeURIComponent(t))},zf.prototype.addCorrelationId=function(e){this.parameters.set(Vh.CLIENT_REQUEST_ID,encodeURIComponent(e))},zf.prototype.addLibraryInfo=function(e){this.parameters.set(Vh.X_CLIENT_SKU,e.sku),this.parameters.set(Vh.X_CLIENT_VER,e.version),e.os&&this.parameters.set(Vh.X_CLIENT_OS,e.os),e.cpu&&this.parameters.set(Vh.X_CLIENT_CPU,e.cpu)},zf.prototype.addApplicationTelemetry=function(e){null!=e&&e.appName&&this.parameters.set(Vh.X_APP_NAME,e.appName),null!=e&&e.appVersion&&this.parameters.set(Vh.X_APP_VER,e.appVersion)},zf.prototype.addPrompt=function(e){jf.validatePrompt(e),this.parameters.set(""+Vh.PROMPT,encodeURIComponent(e))},zf.prototype.addState=function(e){kd.isEmpty(e)||this.parameters.set(Vh.STATE,encodeURIComponent(e))},zf.prototype.addNonce=function(e){this.parameters.set(Vh.NONCE,encodeURIComponent(e))},zf.prototype.addCodeChallengeParams=function(e,t){if(jf.validateCodeChallengeParams(e,t),!e||!t)throw nf.createInvalidCodeChallengeParamsError();this.parameters.set(Vh.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(Vh.CODE_CHALLENGE_METHOD,encodeURIComponent(t))},zf.prototype.addAuthorizationCode=function(e){this.parameters.set(Vh.CODE,encodeURIComponent(e))},zf.prototype.addDeviceCode=function(e){this.parameters.set(Vh.DEVICE_CODE,encodeURIComponent(e))},zf.prototype.addRefreshToken=function(e){this.parameters.set(Vh.REFRESH_TOKEN,encodeURIComponent(e))},zf.prototype.addCodeVerifier=function(e){this.parameters.set(Vh.CODE_VERIFIER,encodeURIComponent(e))},zf.prototype.addClientSecret=function(e){this.parameters.set(Vh.CLIENT_SECRET,encodeURIComponent(e))},zf.prototype.addClientAssertion=function(e){kd.isEmpty(e)||this.parameters.set(Vh.CLIENT_ASSERTION,encodeURIComponent(e))},zf.prototype.addClientAssertionType=function(e){kd.isEmpty(e)||this.parameters.set(Vh.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))},zf.prototype.addOboAssertion=function(e){this.parameters.set(Vh.OBO_ASSERTION,encodeURIComponent(e))},zf.prototype.addRequestTokenUse=function(e){this.parameters.set(Vh.REQUESTED_TOKEN_USE,encodeURIComponent(e))},zf.prototype.addGrantType=function(e){this.parameters.set(Vh.GRANT_TYPE,encodeURIComponent(e))},zf.prototype.addClientInfo=function(){this.parameters.set("client_info","1")},zf.prototype.addExtraQueryParameters=function(t){var r=this;jf.sanitizeEQParams(t,this.parameters),Object.keys(t).forEach(function(e){r.parameters.set(e,t[e])})},zf.prototype.addClientCapabilitiesToClaims=function(e,t){var r;if(e)try{r=JSON.parse(e)}catch(e){throw nf.createInvalidClaimsRequestError()}else r={};return t&&0<t.length&&(r.hasOwnProperty(Jh.ACCESS_TOKEN)||(r[Jh.ACCESS_TOKEN]={}),r[Jh.ACCESS_TOKEN][Jh.XMS_CC]={values:t}),JSON.stringify(r)},zf.prototype.addUsername=function(e){this.parameters.set(yp.username,encodeURIComponent(e))},zf.prototype.addPassword=function(e){this.parameters.set(yp.password,encodeURIComponent(e))},zf.prototype.addPopToken=function(e){kd.isEmpty(e)||(this.parameters.set(Vh.TOKEN_TYPE,fp.POP),this.parameters.set(Vh.REQ_CNF,encodeURIComponent(e)))},zf.prototype.addSshJwk=function(e){kd.isEmpty(e)||(this.parameters.set(Vh.TOKEN_TYPE,fp.SSH),this.parameters.set(Vh.REQ_CNF,encodeURIComponent(e)))},zf.prototype.addServerTelemetry=function(e){this.parameters.set(Vh.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(Vh.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())},zf.prototype.addThrottling=function(){this.parameters.set(Vh.X_MS_LIB_CAPABILITY,Tp)},zf.prototype.addLogoutHint=function(e){this.parameters.set(Vh.LOGOUT_HINT,encodeURIComponent(e))},zf.prototype.createQueryString=function(){var r=new Array;return this.parameters.forEach(function(e,t){r.push(t+"="+e)}),r.join("&")},zf);function zf(){this.parameters=new Map}var Bf,Ff=(zh(Kf,Bf=Md),Kf.createIdTokenEntity=function(e,t,r,o,n){var i=new Kf;return i.credentialType=sp.ID_TOKEN,i.homeAccountId=e,i.environment=t,i.clientId=o,i.secret=r,i.realm=n,i},Kf.isIdTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===sp.ID_TOKEN)},Kf);function Kf(){return null!==Bf&&Bf.apply(this,arguments)||this}var Gf=(Yf.nowSeconds=function(){return Math.round((new Date).getTime()/1e3)},Yf.isTokenExpired=function(e,t){return(Number(e)||0)<Yf.nowSeconds()+t},Yf.wasClockTurnedBack=function(e){return Number(e)>Yf.nowSeconds()},Yf.delay=function(t,r){return new Promise(function(e){return setTimeout(function(){return e(r)},t)})},Yf);function Yf(){}var Zf,Wf=(zh(Vf,Zf=Md),Vf.createAccessTokenEntity=function(e,t,r,o,n,i,s,a,c,u,l,h,p,d,f){var g,y=new Vf;y.homeAccountId=e,y.credentialType=sp.ACCESS_TOKEN,y.secret=r;e=Gf.nowSeconds();if(y.cachedAt=e.toString(),y.expiresOn=s.toString(),y.extendedExpiresOn=a.toString(),u&&(y.refreshOn=u.toString()),y.environment=t,y.clientId=o,y.realm=n,y.target=i,y.userAssertionHash=h,y.tokenType=kd.isEmpty(l)?fp.BEARER:l,d&&(y.requestedClaims=d,y.requestedClaimsHash=f),(null===(f=y.tokenType)||void 0===f?void 0:f.toLowerCase())!==fp.BEARER.toLowerCase())switch(y.credentialType=sp.ACCESS_TOKEN_WITH_AUTH_SCHEME,y.tokenType){case fp.POP:var m=ff.extractTokenClaims(r,c);if(null===(g=null==m?void 0:m.cnf)||void 0===g||!g.kid)throw Td.createTokenClaimsRequiredError();y.keyId=m.cnf.kid;break;case fp.SSH:y.keyId=p}return y},Vf.isAccessTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.hasOwnProperty("target")&&(e.credentialType===sp.ACCESS_TOKEN||e.credentialType===sp.ACCESS_TOKEN_WITH_AUTH_SCHEME))},Vf);function Vf(){return null!==Zf&&Zf.apply(this,arguments)||this}var Jf,Qf=(zh(Xf,Jf=Md),Xf.createRefreshTokenEntity=function(e,t,r,o,n,i){var s=new Xf;return s.clientId=o,s.credentialType=sp.REFRESH_TOKEN,s.environment=t,s.homeAccountId=e,s.secret=r,s.userAssertionHash=i,n&&(s.familyId=n),s},Xf.isRefreshTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===sp.REFRESH_TOKEN)},Xf);function Xf(){return null!==Jf&&Jf.apply(this,arguments)||this}var $f,eg=["interaction_required","consent_required","login_required"],tg=["message_only","additional_action","basic_action","user_password_expired","consent_required"],rg={code:"no_tokens_found",desc:"No refresh token found in the cache. Please sign-in."},og={code:"native_account_unavailable",desc:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API."},ng=(zh(ig,$f=xp),ig.isInteractionRequiredError=function(e,t,r){var o=!!e&&-1<eg.indexOf(e),e=!!r&&-1<tg.indexOf(r),r=!!t&&eg.some(function(e){return-1<t.indexOf(e)});return o||r||e},ig.createNoTokensFoundError=function(){return new ig(rg.code,rg.desc)},ig.createNativeAccountUnavailableError=function(){return new ig(og.code,og.desc)},ig);function ig(e,t,r){r=$f.call(this,e,t,r)||this;return r.name="InteractionRequiredAuthError",Object.setPrototypeOf(r,ig.prototype),r}var sg=function(e,t,r,o,n){this.account=e||null,this.idToken=t||null,this.accessToken=r||null,this.refreshToken=o||null,this.appMetadata=n||null},ag=(cg.setRequestState=function(e,t,r){r=cg.generateLibraryState(e,r);return kd.isEmpty(t)?r:""+r+Qh.RESOURCE_DELIM+t},cg.generateLibraryState=function(e,t){if(!e)throw Td.createNoCryptoObjectError("generateLibraryState");var r={id:e.createNewGuid()};t&&(r.meta=t);r=JSON.stringify(r);return e.base64Encode(r)},cg.parseRequestState=function(e,t){if(!e)throw Td.createNoCryptoObjectError("parseRequestState");if(kd.isEmpty(t))throw Td.createInvalidStateError(t,"Null, undefined or empty state");try{var r=t.split(Qh.RESOURCE_DELIM),o=r[0],n=1<r.length?r.slice(1).join(Qh.RESOURCE_DELIM):Qh.EMPTY_STRING,i=e.base64Decode(o),s=JSON.parse(i);return{userRequestState:kd.isEmpty(n)?Qh.EMPTY_STRING:n,libraryState:s}}catch(e){throw Td.createInvalidStateError(t,e)}},cg);function cg(){}var ug,lg=(Object.defineProperty(hg.prototype,"urlString",{get:function(){return this._urlString},enumerable:!1,configurable:!0}),hg.canonicalizeUri=function(e){if(e){var t=e.toLowerCase();return kd.endsWith(t,"?")?t=t.slice(0,-1):kd.endsWith(t,"?/")&&(t=t.slice(0,-2)),kd.endsWith(t,"/")||(t+="/"),t}return e},hg.prototype.validateAsUri=function(){var e;try{e=this.getUrlComponents()}catch(e){throw nf.createUrlParseError(e)}if(!e.HostNameAndPort||!e.PathSegments)throw nf.createUrlParseError("Given url string: "+this.urlString);if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw nf.createInsecureAuthorityUriError(this.urlString)},hg.appendQueryString=function(e,t){return kd.isEmpty(t)?e:e.indexOf("?")<0?e+"?"+t:e+"&"+t},hg.removeHashFromUrl=function(e){return hg.canonicalizeUri(e.split("#")[0])},hg.prototype.replaceTenantPath=function(e){var t=this.getUrlComponents(),r=t.PathSegments;return!e||0===r.length||r[0]!==Wh.COMMON&&r[0]!==Wh.ORGANIZATIONS||(r[0]=e),hg.constructAuthorityUriFromObject(t)},hg.prototype.getHash=function(){return hg.parseHash(this.urlString)},hg.prototype.getUrlComponents=function(){var e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw nf.createUrlParseError("Given url string: "+this.urlString);e={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]},t=(t=e.AbsolutePath.split("/")).filter(function(e){return e&&0<e.length});return e.PathSegments=t,!kd.isEmpty(e.QueryString)&&e.QueryString.endsWith("/")&&(e.QueryString=e.QueryString.substring(0,e.QueryString.length-1)),e},hg.getDomainFromUrl=function(e){var t=RegExp("^([^:/?#]+://)?([^/?#]*)"),t=e.match(t);if(!t)throw nf.createUrlParseError("Given url string: "+e);return t[2]},hg.getAbsoluteUrl=function(e,t){if(e[0]!==Qh.FORWARD_SLASH)return e;t=new hg(t).getUrlComponents();return t.Protocol+"//"+t.HostNameAndPort+e},hg.parseHash=function(e){var t=e.indexOf("#"),r=e.indexOf("#/");return-1<r?e.substring(r+2):-1<t?e.substring(t+1):Qh.EMPTY_STRING},hg.parseQueryString=function(e){var t=e.indexOf("?"),r=e.indexOf("/?");return-1<r?e.substring(r+2):-1<t?e.substring(t+1):Qh.EMPTY_STRING},hg.constructAuthorityUriFromObject=function(e){return new hg(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))},hg.getDeserializedHash=function(e){if(kd.isEmpty(e))return{};var t=hg.parseHash(e),t=kd.queryStringToObject(kd.isEmpty(t)?e:t);if(!t)throw Td.createHashNotDeserializedError(JSON.stringify(t));return t},hg.getDeserializedQueryString=function(e){if(kd.isEmpty(e))return{};var t=hg.parseQueryString(e),t=kd.queryStringToObject(kd.isEmpty(t)?e:t);if(!t)throw Td.createHashNotDeserializedError(JSON.stringify(t));return t},hg.hashContainsKnownProperties=function(e){if(kd.isEmpty(e)||e.indexOf("=")<0)return!1;e=hg.getDeserializedHash(e);return!!(e.code||e.error_description||e.error||e.state)},hg);function hg(e){if(this._urlString=e,kd.isEmpty(this._urlString))throw nf.createUrlEmptyError();kd.isEmpty(this.getHash())&&(this._urlString=hg.canonicalizeUri(e))}(o=ug=ug||{}).SW="sw",o.UHW="uhw";var pg=(dg.prototype.generateCnf=function(o){return Fh(this,void 0,void 0,function(){var t,r;return Kh(this,function(e){switch(e.label){case 0:return[4,this.generateKid(o)];case 1:return r=e.sent(),t=this.cryptoUtils.base64Encode(JSON.stringify(r)),r={kid:r.kid,reqCnfString:t},[4,this.cryptoUtils.hashString(t)];case 2:return[2,(r.reqCnfHash=e.sent(),r)]}})})},dg.prototype.generateKid=function(t){return Fh(this,void 0,void 0,function(){return Kh(this,function(e){switch(e.label){case 0:return[4,this.cryptoUtils.getPublicKeyThumbprint(t)];case 1:return[2,{kid:e.sent(),xms_ksl:ug.SW}]}})})},dg.prototype.signPopToken=function(t,r,o){return Fh(this,void 0,void 0,function(){return Kh(this,function(e){return[2,this.signPayload(t,r,o)]})})},dg.prototype.signPayload=function(i,s,a,c){return Fh(this,void 0,void 0,function(){var t,r,o,n;return Kh(this,function(e){switch(e.label){case 0:return t=a.resourceRequestMethod,n=a.resourceRequestUri,r=a.shrClaims,o=a.shrNonce,n=n?new lg(n):void 0,n=null==n?void 0:n.getUrlComponents(),[4,this.cryptoUtils.signJwt(Bh({at:i,ts:Gf.nowSeconds(),m:null==t?void 0:t.toUpperCase(),u:null==n?void 0:n.HostNameAndPort,nonce:o||this.cryptoUtils.createNewGuid(),p:null==n?void 0:n.AbsolutePath,q:null!=n&&n.QueryString?[[],n.QueryString]:void 0,client_claims:r||void 0},c),s,a.correlationId)];case 1:return[2,e.sent()]}})})},dg);function dg(e){this.cryptoUtils=e}var fg=(gg.prototype.generateAppMetadataKey=function(){return gg.generateAppMetadataCacheKey(this.environment,this.clientId)},gg.generateAppMetadataCacheKey=function(e,t){return[hp,e,t].join(ip.CACHE_KEY_SEPARATOR).toLowerCase()},gg.createAppMetadataEntity=function(e,t,r){var o=new gg;return o.clientId=e,o.environment=t,r&&(o.familyId=r),o},gg.isAppMetadataEntity=function(e,t){return!!t&&(0===e.indexOf(hp)&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("environment"))},gg);function gg(){}var yg=(Object.defineProperty(mg.prototype,"cacheHasChanged",{get:function(){return this.hasChanged},enumerable:!1,configurable:!0}),Object.defineProperty(mg.prototype,"tokenCache",{get:function(){return this.cache},enumerable:!1,configurable:!0}),mg);function mg(e,t){this.cache=e,this.hasChanged=t}var vg=(_g.prototype.validateServerAuthorizationCodeResponse=function(e,t,r){if(!e.state||!t)throw e.state?Td.createStateNotFoundError("Cached State"):Td.createStateNotFoundError("Server State");if(decodeURIComponent(e.state)!==decodeURIComponent(t))throw Td.createStateMismatchError();if(e.error||e.error_description||e.suberror){if(ng.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new ng(e.error||Qh.EMPTY_STRING,e.error_description,e.suberror);throw new Of(e.error||Qh.EMPTY_STRING,e.error_description,e.suberror)}e.client_info&&lf(e.client_info,r)},_g.prototype.validateTokenResponse=function(e){if(e.error||e.error_description||e.suberror){if(ng.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new ng(e.error,e.error_description,e.suberror);var t=e.error_codes+" - ["+e.timestamp+"]: "+e.error_description+" - Correlation ID: "+e.correlation_id+" - Trace ID: "+e.trace_id;throw new Of(e.error,t,e.suberror)}},_g.prototype.handleServerTokenResponse=function(s,a,c,u,l,h,p,d,f){return Fh(this,void 0,void 0,function(){var t,r,o,n,i;return Kh(this,function(e){switch(e.label){case 0:if(s.id_token){if(t=new ff(s.id_token||Qh.EMPTY_STRING,this.cryptoObj),l&&!kd.isEmpty(l.nonce)&&t.claims.nonce!==l.nonce)throw Td.createNonceMismatchError();if(u.maxAge||0===u.maxAge){if(!(i=t.claims.auth_time))throw Td.createAuthTimeNotFoundError();ff.checkMaxAge(i,u.maxAge)}}this.homeAccountIdentifier=pf.generateHomeAccountId(s.client_info||Qh.EMPTY_STRING,a.authorityType,this.logger,this.cryptoObj,t),l&&l.state&&(r=ag.parseRequestState(this.cryptoObj,l.state)),s.key_id=s.key_id||u.sshKid||void 0,o=this.generateCacheRecord(s,a,c,u,t,h,l),e.label=1;case 1:return(e.trys.push([1,,5,8]),this.persistencePlugin&&this.serializableCache)?(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),n=new yg(this.serializableCache,!0),[4,this.persistencePlugin.beforeCacheAccess(n)]):[3,3];case 2:e.sent(),e.label=3;case 3:return!p||d||!o.account||(i=o.account.generateAccountKey(),this.cacheStorage.getAccount(i))?[4,this.cacheStorage.saveCacheRecord(o)]:(this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),[2,_g.generateAuthenticationResult(this.cryptoObj,a,o,!1,u,t,r,void 0,f)]);case 4:return e.sent(),[3,8];case 5:return this.persistencePlugin&&this.serializableCache&&n?(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),[4,this.persistencePlugin.afterCacheAccess(n)]):[3,7];case 6:e.sent(),e.label=7;case 7:return[7];case 8:return[2,_g.generateAuthenticationResult(this.cryptoObj,a,o,!1,u,t,r,s.spa_code,f)]}})})},_g.prototype.generateCacheRecord=function(e,t,r,o,n,i,s){var a,c,u=t.getPreferredCache();if(kd.isEmpty(u))throw Td.createInvalidCacheEnvironmentError();!kd.isEmpty(e.id_token)&&n&&(a=Ff.createIdTokenEntity(this.homeAccountIdentifier,u,e.id_token||Qh.EMPTY_STRING,this.clientId,n.claims.tid||Qh.EMPTY_STRING),c=this.generateAccountEntity(e,n,t,s));var l,h,p,d=null;kd.isEmpty(e.access_token)||(l=e.scope?cf.fromString(e.scope):new cf(o.scopes||[]),p=(h=r+(("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0))+(("string"==typeof e.ext_expires_in?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0),s=(s=("string"==typeof e.refresh_in?parseInt(e.refresh_in,10):e.refresh_in)||void 0)&&0<s?r+s:void 0,d=Wf.createAccessTokenEntity(this.homeAccountIdentifier,u,e.access_token||Qh.EMPTY_STRING,this.clientId,n?n.claims.tid||Qh.EMPTY_STRING:t.tenant,l.printScopes(),h,p,this.cryptoObj,s,e.token_type,i,e.key_id,o.claims,o.requestedClaimsHash));o=null;kd.isEmpty(e.refresh_token)||(o=Qf.createRefreshTokenEntity(this.homeAccountIdentifier,u,e.refresh_token||Qh.EMPTY_STRING,this.clientId,e.foci,i));i=null;return kd.isEmpty(e.foci)||(i=fg.createAppMetadataEntity(this.clientId,u,e.foci)),new sg(c,a,d,o,i)},_g.prototype.generateAccountEntity=function(e,t,r,o){var n=r.authorityType,i=o?o.cloud_graph_host_name:Qh.EMPTY_STRING,o=o?o.msgraph_host:Qh.EMPTY_STRING;if(n===af.Adfs)return this.logger.verbose("Authority type is ADFS, creating ADFS account"),pf.createGenericAccount(this.homeAccountIdentifier,t,r,i,o);if(kd.isEmpty(e.client_info)&&"AAD"===r.protocolMode)throw Td.createClientInfoEmptyError();return e.client_info?pf.createAccount(e.client_info,this.homeAccountIdentifier,t,r,i,o):pf.createGenericAccount(this.homeAccountIdentifier,t,r,i,o)},_g.generateAuthenticationResult=function(u,l,h,p,d,f,g,y,m){var v;return Fh(this,void 0,void 0,function(){var t,r,o,n,i,s,a,c;return Kh(this,function(e){switch(e.label){case 0:if(t=Qh.EMPTY_STRING,r=[],o=null,i=Qh.EMPTY_STRING,!h.accessToken)return[3,4];if(h.accessToken.tokenType!==fp.POP)return[3,2];if(s=new pg(u),c=h.accessToken,a=c.secret,!(c=c.keyId))throw Td.createKeyIdMissingError();return[4,s.signPopToken(a,c,d)];case 1:return t=e.sent(),[3,3];case 2:t=h.accessToken.secret,e.label=3;case 3:r=cf.fromString(h.accessToken.target).asArray(),o=new Date(1e3*Number(h.accessToken.expiresOn)),n=new Date(1e3*Number(h.accessToken.extendedExpiresOn)),e.label=4;case 4:return h.appMetadata&&(i="1"===h.appMetadata.familyId?"1":Qh.EMPTY_STRING),a=(null==f?void 0:f.claims.oid)||(null==f?void 0:f.claims.sub)||Qh.EMPTY_STRING,c=(null==f?void 0:f.claims.tid)||Qh.EMPTY_STRING,[2,{authority:l.canonicalAuthority,uniqueId:a,tenantId:c,scopes:r,account:h.account?h.account.getAccountInfo():null,idToken:f?f.rawToken:Qh.EMPTY_STRING,idTokenClaims:f?f.claims:{},accessToken:t,fromCache:p,expiresOn:o,correlationId:d.correlationId,requestId:m||Qh.EMPTY_STRING,extExpiresOn:n,familyId:i,tokenType:(null===(v=h.accessToken)||void 0===v?void 0:v.tokenType)||Qh.EMPTY_STRING,state:g?g.userRequestState:Qh.EMPTY_STRING,cloudGraphHostName:(null===(v=h.account)||void 0===v?void 0:v.cloudGraphHostName)||Qh.EMPTY_STRING,msGraphHost:(null===(v=h.account)||void 0===v?void 0:v.msGraphHost)||Qh.EMPTY_STRING,code:y,fromNativeBroker:!1}]}})})},_g);function _g(e,t,r,o,n,i){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=o,this.serializableCache=n,this.persistencePlugin=i}var wg,bg,Cg,Eg=(zh(Sg,wg=w),Sg.prototype.getAuthCodeUrl=function(r){return Fh(this,void 0,void 0,function(){var t;return Kh(this,function(e){switch(e.label){case 0:return[4,this.createAuthCodeUrlQueryString(r)];case 1:return t=e.sent(),[2,lg.appendQueryString(this.authority.authorizationEndpoint,t)]}})})},Sg.prototype.acquireToken=function(i,s){var a;return Fh(this,void 0,void 0,function(){var t,r,o,n;return Kh(this,function(e){switch(e.label){case 0:if(this.logger.info("in acquireToken call"),!i||kd.isEmpty(i.code))throw Td.createTokenRequestCannotBeMadeError();return t=Gf.nowSeconds(),[4,this.executeTokenRequest(this.authority,i)];case 1:return r=e.sent(),o=null===(a=r.headers)||void 0===a?void 0:a[Yh.X_MS_REQUEST_ID],(n=new vg(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(r.body),[4,n.handleServerTokenResponse(r.body,this.authority,t,i,s,void 0,void 0,void 0,o)];case 2:return[2,e.sent()]}})})},Sg.prototype.handleFragmentResponse=function(e,t){var r=new vg(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null),e=new lg(e),e=lg.getDeserializedHash(e.getHash());if(r.validateServerAuthorizationCodeResponse(e,t,this.cryptoUtils),!e.code)throw Td.createNoAuthCodeInServerResponseError();return Bh(Bh({},e),{code:e.code})},Sg.prototype.getLogoutUri=function(e){if(!e)throw nf.createEmptyLogoutRequestError();e=this.createLogoutUrlQueryString(e);return lg.appendQueryString(this.authority.endSessionEndpoint,e)},Sg.prototype.executeTokenRequest=function(s,a){return Fh(this,void 0,void 0,function(){var t,r,o,n,i;return Kh(this,function(e){switch(e.label){case 0:return t={clientId:this.config.authOptions.clientId,authority:s.canonicalAuthority,scopes:a.scopes,claims:a.claims,authenticationScheme:a.authenticationScheme,resourceRequestMethod:a.resourceRequestMethod,resourceRequestUri:a.resourceRequestUri,shrClaims:a.shrClaims,sshKid:a.sshKid},[4,this.createTokenRequestBody(a)];case 1:if(r=e.sent(),i=this.createTokenQueryParameters(a),n=void 0,a.clientInfo)try{o=lf(a.clientInfo,this.cryptoUtils),n={credential:""+o.uid+ip.CLIENT_INFO_SEPARATOR+o.utid,type:Nf.HOME_ACCOUNT_ID}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}return n=this.createTokenRequestHeaders(n||a.ccsCredential),i=kd.isEmpty(i)?s.tokenEndpoint:s.tokenEndpoint+"?"+i,[2,this.executePostToTokenEndpoint(i,r,n,t)]}})})},Sg.prototype.createTokenQueryParameters=function(e){var t=new Hf;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},Sg.prototype.createTokenRequestBody=function(s){return Fh(this,void 0,void 0,function(){var t,r,o,n,i;return Kh(this,function(e){switch(e.label){case 0:return((t=new Hf).addClientId(this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(s.redirectUri):jf.validateRedirectUri(s.redirectUri),t.addScopes(s.scopes),t.addAuthorizationCode(s.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&t.addServerTelemetry(this.serverTelemetryManager),s.codeVerifier&&t.addCodeVerifier(s.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(r=this.config.clientCredentials.clientAssertion,t.addClientAssertion(r.assertion),t.addClientAssertionType(r.assertionType)),t.addGrantType(op.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),s.authenticationScheme!==fp.POP)?[3,2]:[4,new pg(this.cryptoUtils).generateCnf(s)];case 1:return i=e.sent(),t.addPopToken(i.reqCnfString),[3,3];case 2:if(s.authenticationScheme===fp.SSH){if(!s.sshJwk)throw nf.createMissingSshJwkError();t.addSshJwk(s.sshJwk)}e.label=3;case 3:if(i=s.correlationId||this.config.cryptoInterface.createNewGuid(),t.addCorrelationId(i),(!kd.isEmptyObj(s.claims)||this.config.authOptions.clientCapabilities&&0<this.config.authOptions.clientCapabilities.length)&&t.addClaims(s.claims,this.config.authOptions.clientCapabilities),o=void 0,s.clientInfo)try{n=lf(s.clientInfo,this.cryptoUtils),o={credential:""+n.uid+ip.CLIENT_INFO_SEPARATOR+n.utid,type:Nf.HOME_ACCOUNT_ID}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}else o=s.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&o)switch(o.type){case Nf.HOME_ACCOUNT_ID:try{n=hf(o.credential),t.addCcsOid(n)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Nf.UPN:t.addCcsUpn(o.credential)}return s.tokenBodyParameters&&t.addExtraQueryParameters(s.tokenBodyParameters),!s.enableSpaAuthorizationCode||s.tokenBodyParameters&&s.tokenBodyParameters[Vh.RETURN_SPA_CODE]||t.addExtraQueryParameters(((i={})[Vh.RETURN_SPA_CODE]="1",i)),[2,t.createQueryString()]}})})},Sg.prototype.createAuthCodeUrlQueryString=function(i){return Fh(this,void 0,void 0,function(){var t,r,o,n;return Kh(this,function(e){switch(e.label){case 0:if((t=new Hf).addClientId(this.config.authOptions.clientId),r=Gh(i.scopes||[],i.extraScopesToConsent||[]),t.addScopes(r),t.addRedirectUri(i.redirectUri),r=i.correlationId||this.config.cryptoInterface.createNewGuid(),t.addCorrelationId(r),t.addResponseMode(i.responseMode),t.addResponseTypeCode(),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addClientInfo(),i.codeChallenge&&i.codeChallengeMethod&&t.addCodeChallengeParams(i.codeChallenge,i.codeChallengeMethod),i.prompt&&t.addPrompt(i.prompt),i.domainHint&&t.addDomainHint(i.domainHint),i.prompt!==tp.SELECT_ACCOUNT)if(i.sid&&i.prompt===tp.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),t.addSid(i.sid);else if(i.account){if(n=this.extractAccountSid(i.account),r=this.extractLoginHint(i.account)){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),t.addLoginHint(r);try{o=hf(i.account.homeAccountId),t.addCcsOid(o)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(n&&i.prompt===tp.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),t.addSid(n);try{o=hf(i.account.homeAccountId),t.addCcsOid(o)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(i.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),t.addLoginHint(i.loginHint),t.addCcsUpn(i.loginHint);else if(i.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),t.addLoginHint(i.account.username);try{o=hf(i.account.homeAccountId),t.addCcsOid(o)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else i.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),t.addLoginHint(i.loginHint),t.addCcsUpn(i.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return(i.nonce&&t.addNonce(i.nonce),i.state&&t.addState(i.state),(!kd.isEmpty(i.claims)||this.config.authOptions.clientCapabilities&&0<this.config.authOptions.clientCapabilities.length)&&t.addClaims(i.claims,this.config.authOptions.clientCapabilities),i.extraQueryParameters&&t.addExtraQueryParameters(i.extraQueryParameters),i.nativeBroker)?(t.addNativeBroker(),i.authenticationScheme!==fp.POP?[3,2]:[4,new pg(this.cryptoUtils).generateCnf(i)]):[3,2];case 1:n=e.sent(),t.addPopToken(n.reqCnfHash),e.label=2;case 2:return[2,t.createQueryString()]}})})},Sg.prototype.createLogoutUrlQueryString=function(e){var t=new Hf;return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),t.createQueryString()},Sg.prototype.extractAccountSid=function(e){return(null===(e=e.idTokenClaims)||void 0===e?void 0:e.sid)||null},Sg.prototype.extractLoginHint=function(e){return(null===(e=e.idTokenClaims)||void 0===e?void 0:e.login_hint)||null},Sg);function Sg(e){e=wg.call(this,e)||this;return e.includeRedirectUri=!0,e}(o=bg=bg||{}).AcquireTokenByCode="acquireTokenByCode",o.AcquireTokenByRefreshToken="acquireTokenByRefreshToken",o.AcquireTokenSilent="acquireTokenSilent",o.AcquireTokenSilentAsync="acquireTokenSilentAsync",o.AcquireTokenPopup="acquireTokenPopup",o.CryptoOptsGetPublicKeyThumbprint="cryptoOptsGetPublicKeyThumbprint",o.CryptoOptsSignJwt="cryptoOptsSignJwt",o.SilentCacheClientAcquireToken="silentCacheClientAcquireToken",o.SilentIframeClientAcquireToken="silentIframeClientAcquireToken",o.SilentRefreshClientAcquireToken="silentRefreshClientAcquireToken",o.SsoSilent="ssoSilent",o.StandardInteractionClientGetDiscoveredAuthority="standardInteractionClientGetDiscoveredAuthority",o.FetchAccountIdWithNativeBroker="fetchAccountIdWithNativeBroker",o.NativeInteractionClientAcquireToken="nativeInteractionClientAcquireToken",o.BaseClientCreateTokenRequestHeaders="baseClientCreateTokenRequestHeaders",o.BrokerHandhshake="brokerHandshake",o.AcquireTokenByRefreshTokenInBroker="acquireTokenByRefreshTokenInBroker",o.AcquireTokenByBroker="acquireTokenByBroker",o.RefreshTokenClientExecuteTokenRequest="refreshTokenClientExecuteTokenRequest",o.RefreshTokenClientAcquireToken="refreshTokenClientAcquireToken",o.RefreshTokenClientAcquireTokenWithCachedRefreshToken="refreshTokenClientAcquireTokenWithCachedRefreshToken",(o=Cg=Cg||{})[o.NotStarted=0]="NotStarted",o[o.InProgress=1]="InProgress",o[o.Completed=2]="Completed";var Tg,Ig=(zh(Ag,Tg=w),Ag.prototype.acquireToken=function(a){var c,u;return Fh(this,void 0,void 0,function(){var t,r,o,n,i,s=this;return Kh(this,function(e){switch(e.label){case 0:return t=null===(c=this.performanceClient)||void 0===c?void 0:c.startMeasurement(bg.RefreshTokenClientAcquireToken,a.correlationId),this.logger.verbose("RefreshTokenClientAcquireToken called",a.correlationId),r=Gf.nowSeconds(),[4,this.executeTokenRequest(a,this.authority)];case 1:return o=e.sent(),null!=t&&t.addStaticFields({refreshTokenSize:(null===(u=o.body.refresh_token)||void 0===u?void 0:u.length)||0}),n=null===(u=o.headers)||void 0===u?void 0:u[Yh.X_MS_REQUEST_ID],(i=new vg(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(o.body),[2,i.handleServerTokenResponse(o.body,this.authority,r,a,void 0,void 0,!0,a.forceCache,n).then(function(e){return null!=t&&t.endMeasurement({success:!0}),e}).catch(function(e){throw s.logger.verbose("Error in fetching refresh token",a.correlationId),null!=t&&t.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})]}})})},Ag.prototype.acquireTokenByRefreshToken=function(o){return Fh(this,void 0,void 0,function(){var t,r;return Kh(this,function(e){if(!o)throw nf.createEmptyTokenRequestError();if(!o.account)throw Td.createNoAccountInSilentRequestError();if(this.cacheManager.isAppMetadataFOCI(o.account.environment,this.config.authOptions.clientId))try{return[2,this.acquireTokenWithCachedRefreshToken(o,!0)]}catch(e){if(t=e instanceof ng&&e.errorCode===rg.code,r=e instanceof Of&&e.errorCode===Ip&&e.subError===Ap,t||r)return[2,this.acquireTokenWithCachedRefreshToken(o,!1)];throw e}return[2,this.acquireTokenWithCachedRefreshToken(o,!1)]})})},Ag.prototype.acquireTokenWithCachedRefreshToken=function(o,n){var i;return Fh(this,void 0,void 0,function(){var t,r;return Kh(this,function(e){if(t=null===(i=this.performanceClient)||void 0===i?void 0:i.startMeasurement(bg.RefreshTokenClientAcquireTokenWithCachedRefreshToken,o.correlationId),this.logger.verbose("RefreshTokenClientAcquireTokenWithCachedRefreshToken called",o.correlationId),!(r=this.cacheManager.readRefreshTokenFromCache(this.config.authOptions.clientId,o.account,n)))throw null!=t&&t.discardMeasurement(),ng.createNoTokensFoundError();return null!=t&&t.endMeasurement({success:!0}),r=Bh(Bh({},o),{refreshToken:r.secret,authenticationScheme:o.authenticationScheme||fp.BEARER,ccsCredential:{credential:o.account.homeAccountId,type:Nf.HOME_ACCOUNT_ID}}),[2,this.acquireToken(r)]})})},Ag.prototype.executeTokenRequest=function(s,a){var c;return Fh(this,void 0,void 0,function(){var t,r,o,n,i;return Kh(this,function(e){switch(e.label){case 0:return t=null===(c=this.performanceClient)||void 0===c?void 0:c.startMeasurement(bg.RefreshTokenClientExecuteTokenRequest,s.correlationId),[4,this.createTokenRequestBody(s)];case 1:return r=e.sent(),i=this.createTokenQueryParameters(s),o=this.createTokenRequestHeaders(s.ccsCredential),n={clientId:this.config.authOptions.clientId,authority:a.canonicalAuthority,scopes:s.scopes,claims:s.claims,authenticationScheme:s.authenticationScheme,resourceRequestMethod:s.resourceRequestMethod,resourceRequestUri:s.resourceRequestUri,shrClaims:s.shrClaims,sshKid:s.sshKid},i=lg.appendQueryString(a.tokenEndpoint,i),[2,this.executePostToTokenEndpoint(i,r,o,n).then(function(e){return null!=t&&t.endMeasurement({success:!0}),e}).catch(function(e){throw null!=t&&t.endMeasurement({success:!1}),e})]}})})},Ag.prototype.createTokenQueryParameters=function(e){var t=new Hf;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},Ag.prototype.createTokenRequestBody=function(s){var a;return Fh(this,void 0,void 0,function(){var t,r,o,n,i;return Kh(this,function(e){switch(e.label){case 0:return(t=s.correlationId,r=null===(a=this.performanceClient)||void 0===a?void 0:a.startMeasurement(bg.BaseClientCreateTokenRequestHeaders,t),(o=new Hf).addClientId(this.config.authOptions.clientId),o.addScopes(s.scopes),o.addGrantType(op.REFRESH_TOKEN_GRANT),o.addClientInfo(),o.addLibraryInfo(this.config.libraryInfo),o.addApplicationTelemetry(this.config.telemetry.application),o.addThrottling(),this.serverTelemetryManager&&o.addServerTelemetry(this.serverTelemetryManager),o.addCorrelationId(t),o.addRefreshToken(s.refreshToken),this.config.clientCredentials.clientSecret&&o.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(n=this.config.clientCredentials.clientAssertion,o.addClientAssertion(n.assertion),o.addClientAssertionType(n.assertionType)),s.authenticationScheme!==fp.POP)?[3,2]:[4,new pg(this.cryptoUtils).generateCnf(s)];case 1:return n=e.sent(),o.addPopToken(n.reqCnfString),[3,3];case 2:if(s.authenticationScheme===fp.SSH){if(!s.sshJwk)throw null!=r&&r.endMeasurement({success:!1}),nf.createMissingSshJwkError();o.addSshJwk(s.sshJwk)}e.label=3;case 3:if((!kd.isEmptyObj(s.claims)||this.config.authOptions.clientCapabilities&&0<this.config.authOptions.clientCapabilities.length)&&o.addClaims(s.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&s.ccsCredential)switch(s.ccsCredential.type){case Nf.HOME_ACCOUNT_ID:try{i=hf(s.ccsCredential.credential),o.addCcsOid(i)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Nf.UPN:o.addCcsUpn(s.ccsCredential.credential)}return null!=r&&r.endMeasurement({success:!0}),[2,o.createQueryString()]}})})},Ag);function Ag(e,t){return Tg.call(this,e,t)||this}var kg,Pg=(zh(Og,kg=w),Og.prototype.acquireToken=function(r){return Fh(this,void 0,void 0,function(){var t;return Kh(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.acquireCachedToken(r)];case 1:return[2,e.sent()];case 2:if((t=e.sent())instanceof Td&&t.errorCode===vd.code)return[2,new Ig(this.config,this.performanceClient).acquireTokenByRefreshToken(r)];throw t;case 3:return[2]}})})},Og.prototype.acquireCachedToken=function(r){var o,n;return Fh(this,void 0,void 0,function(){var t;return Kh(this,function(e){switch(e.label){case 0:if(!r)throw nf.createEmptyTokenRequestError();if(r.forceRefresh)throw null!==(o=this.serverTelemetryManager)&&void 0!==o&&o.setCacheOutcome(wp.FORCE_REFRESH),this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true."),Td.createRefreshRequiredError();if(!r.account)throw Td.createNoAccountInSilentRequestError();if(t=r.authority||this.authority.getPreferredCache(),!(t=this.cacheManager.readCacheRecord(r.account,this.config.authOptions.clientId,r,t)).accessToken)throw null!==(o=this.serverTelemetryManager)&&void 0!==o&&o.setCacheOutcome(wp.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties."),Td.createRefreshRequiredError();if(Gf.wasClockTurnedBack(t.accessToken.cachedAt)||Gf.isTokenExpired(t.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw null!==(n=this.serverTelemetryManager)&&void 0!==n&&n.setCacheOutcome(wp.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within "+this.config.systemOptions.tokenRenewalOffsetSeconds+" seconds."),Td.createRefreshRequiredError();if(t.accessToken.refreshOn&&Gf.isTokenExpired(t.accessToken.refreshOn,0))throw null!==(n=this.serverTelemetryManager)&&void 0!==n&&n.setCacheOutcome(wp.REFRESH_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'."),Td.createRefreshRequiredError();return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[4,this.generateResultFromCacheRecord(t,r)];case 1:return[2,e.sent()]}})})},Og.prototype.generateResultFromCacheRecord=function(o,n){return Fh(this,void 0,void 0,function(){var t,r;return Kh(this,function(e){switch(e.label){case 0:if(o.idToken&&(t=new ff(o.idToken.secret,this.config.cryptoInterface)),n.maxAge||0===n.maxAge){if(!(r=null==t?void 0:t.claims.auth_time))throw Td.createAuthTimeNotFoundError();ff.checkMaxAge(r,n.maxAge)}return[4,vg.generateAuthenticationResult(this.cryptoUtils,this.authority,o,!0,n,t)];case 1:return[2,e.sent()]}})})},Og);function Og(e,t){return kg.call(this,e,t)||this}var xg,Rg={"https://login.microsoftonline.com/common/":{token_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/common/":{token_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/common/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/common/":{token_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/consumers/":{token_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/consumers/":{token_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/consumers/":{token_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/organizations/":{token_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/organizations/":{token_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/organizations/":{token_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"}},Mg={"https://login.microsoftonline.com/common/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/common/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/common/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.com/consumers/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/consumers/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/consumers/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.com/organizations/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/organizations/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/organizations/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}};(o=xg=xg||{}).AAD="AAD",o.OIDC="OIDC";var Ng=(Lg.prototype.updateCloudDiscoveryMetadata=function(e,t){this.aliases=e.aliases,this.preferred_cache=e.preferred_cache,this.preferred_network=e.preferred_network,this.aliasesFromNetwork=t},Lg.prototype.updateEndpointMetadata=function(e,t){this.authorization_endpoint=e.authorization_endpoint,this.token_endpoint=e.token_endpoint,this.end_session_endpoint=e.end_session_endpoint,this.issuer=e.issuer,this.endpointsFromNetwork=t,this.jwks_uri=e.jwks_uri},Lg.prototype.updateCanonicalAuthority=function(e){this.canonical_authority=e},Lg.prototype.resetExpiresAt=function(){this.expiresAt=Gf.nowSeconds()+dp},Lg.prototype.isExpired=function(){return this.expiresAt<=Gf.nowSeconds()},Lg.isAuthorityMetadataEntity=function(e,t){return!!t&&(0===e.indexOf(pp)&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri"))},Lg);function Lg(){this.expiresAt=Gf.nowSeconds()+dp}var Dg=(qg.prototype.detectRegion=function(i,s,a){return Fh(this,void 0,void 0,function(){var t,r,o,n;return Kh(this,function(e){switch(e.label){case 0:if(t=i)return[3,8];r=qg.IMDS_OPTIONS,a&&(r.proxyUrl=a),e.label=1;case 1:return e.trys.push([1,6,,7]),[4,this.getRegionFromIMDS(Qh.IMDS_VERSION,r)];case 2:return(o=e.sent()).status===mp.httpSuccess&&(t=o.body,s.region_source=vp.IMDS),o.status!==mp.httpBadRequest?[3,5]:[4,this.getCurrentVersion(r)];case 3:return(n=e.sent())?[4,this.getRegionFromIMDS(n,r)]:(s.region_source=vp.FAILED_AUTO_DETECTION,[2,null]);case 4:(n=e.sent()).status===mp.httpSuccess&&(t=n.body,s.region_source=vp.IMDS),e.label=5;case 5:return[3,7];case 6:return e.sent(),s.region_source=vp.FAILED_AUTO_DETECTION,[2,null];case 7:return[3,9];case 8:s.region_source=vp.ENVIRONMENT_VARIABLE,e.label=9;case 9:return t||(s.region_source=vp.FAILED_AUTO_DETECTION),[2,t||null]}})})},qg.prototype.getRegionFromIMDS=function(t,r){return Fh(this,void 0,void 0,function(){return Kh(this,function(e){return[2,this.networkInterface.sendGetRequestAsync(Qh.IMDS_ENDPOINT+"?api-version="+t+"&format=text",r,Qh.IMDS_TIMEOUT)]})})},qg.prototype.getCurrentVersion=function(r){return Fh(this,void 0,void 0,function(){var t;return Kh(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.networkInterface.sendGetRequestAsync(Qh.IMDS_ENDPOINT+"?format=json",r)];case 1:return(t=e.sent()).status===mp.httpBadRequest&&t.body&&t.body["newest-versions"]&&0<t.body["newest-versions"].length?[2,t.body["newest-versions"][0]]:[2,null];case 2:return e.sent(),[2,null];case 3:return[2]}})})},qg.IMDS_OPTIONS={headers:{Metadata:"true"}},qg);function qg(e){this.networkInterface=e}var jg=(Object.defineProperty(Ug.prototype,"authorityType",{get:function(){var e=this.canonicalAuthorityUrlComponents.PathSegments;if(e.length)switch(e[0].toLowerCase()){case Qh.ADFS:return af.Adfs;case Qh.DSTS:return af.Dsts}return af.Default},enumerable:!1,configurable:!0}),Object.defineProperty(Ug.prototype,"protocolMode",{get:function(){return this.authorityOptions.protocolMode},enumerable:!1,configurable:!0}),Object.defineProperty(Ug.prototype,"options",{get:function(){return this.authorityOptions},enumerable:!1,configurable:!0}),Object.defineProperty(Ug.prototype,"canonicalAuthority",{get:function(){return this._canonicalAuthority.urlString},set:function(e){this._canonicalAuthority=new lg(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null},enumerable:!1,configurable:!0}),Object.defineProperty(Ug.prototype,"canonicalAuthorityUrlComponents",{get:function(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents},enumerable:!1,configurable:!0}),Object.defineProperty(Ug.prototype,"hostnameAndPort",{get:function(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(Ug.prototype,"tenant",{get:function(){return this.canonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!1,configurable:!0}),Object.defineProperty(Ug.prototype,"authorizationEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.authorization_endpoint);return this.replaceTenant(e)}throw Td.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(Ug.prototype,"tokenEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint);return this.replaceTenant(e)}throw Td.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(Ug.prototype,"deviceCodeEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));return this.replaceTenant(e)}throw Td.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(Ug.prototype,"endSessionEndpoint",{get:function(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw Td.createLogoutNotSupportedError();var e=this.replacePath(this.metadata.end_session_endpoint);return this.replaceTenant(e)}throw Td.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(Ug.prototype,"selfSignedJwtAudience",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.issuer);return this.replaceTenant(e)}throw Td.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(Ug.prototype,"jwksUri",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.jwks_uri);return this.replaceTenant(e)}throw Td.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Ug.prototype.replaceTenant=function(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)},Ug.prototype.replacePath=function(e){var r=e,o=new lg(this.metadata.canonical_authority).getUrlComponents().PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach(function(e,t){t=o[t];e!==t&&(r=r.replace("/"+t+"/","/"+e+"/"))}),r},Object.defineProperty(Ug.prototype,"defaultOpenIdConfigurationEndpoint",{get:function(){return this.authorityType===af.Adfs||this.authorityType===af.Dsts||this.protocolMode===xg.OIDC?this.canonicalAuthority+".well-known/openid-configuration":this.canonicalAuthority+"v2.0/.well-known/openid-configuration"},enumerable:!1,configurable:!0}),Ug.prototype.discoveryComplete=function(){return!!this.metadata},Ug.prototype.resolveEndpointsAsync=function(){return Fh(this,void 0,void 0,function(){var t,r,o;return Kh(this,function(e){switch(e.label){case 0:return(t=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort))||(t=new Ng).updateCanonicalAuthority(this.canonicalAuthority),[4,this.updateCloudDiscoveryMetadata(t)];case 1:return r=e.sent(),this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,t.preferred_network),[4,this.updateEndpointMetadata(t)];case 2:return o=e.sent(),r!==lp.CACHE&&o!==lp.CACHE&&(t.resetExpiresAt(),t.updateCanonicalAuthority(this.canonicalAuthority)),o=this.cacheManager.generateAuthorityMetadataCacheKey(t.preferred_cache),this.cacheManager.setAuthorityMetadata(o,t),this.metadata=t,[2]}})})},Ug.prototype.updateEndpointMetadata=function(o){var n;return Fh(this,void 0,void 0,function(){var t,r;return Kh(this,function(e){switch(e.label){case 0:return(t=this.getEndpointMetadataFromConfig())?(o.updateEndpointMetadata(t,!1),[2,lp.CONFIG]):this.isAuthoritySameType(o)&&o.endpointsFromNetwork&&!o.isExpired()?[2,lp.CACHE]:(r=this.getEndpointMetadataFromHardcodedValues(),[4,this.getEndpointMetadataFromNetwork()]);case 1:return(t=e.sent())?null!==(n=this.authorityOptions.azureRegionConfiguration)&&void 0!==n&&n.azureRegion?[4,this.updateMetadataWithRegionalInformation(t)]:[3,3]:[3,4];case 2:t=e.sent(),e.label=3;case 3:return o.updateEndpointMetadata(t,!0),[2,lp.NETWORK];case 4:return!r||this.authorityOptions.skipAuthorityMetadataCache?[3,7]:null!==(n=this.authorityOptions.azureRegionConfiguration)&&void 0!==n&&n.azureRegion?[4,this.updateMetadataWithRegionalInformation(r)]:[3,6];case 5:r=e.sent(),e.label=6;case 6:return o.updateEndpointMetadata(r,!1),[2,lp.HARDCODED_VALUES];case 7:throw Td.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint)}})})},Ug.prototype.isAuthoritySameType=function(e){return new lg(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length},Ug.prototype.getEndpointMetadataFromConfig=function(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch(e){throw nf.createInvalidAuthorityMetadataError()}return null},Ug.prototype.getEndpointMetadataFromNetwork=function(){return Fh(this,void 0,void 0,function(){var r,o;return Kh(this,function(e){switch(e.label){case 0:r={},this.proxyUrl&&(r.proxyUrl=this.proxyUrl),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint,r)];case 2:return o=e.sent(),[2,(t=o.body).hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")?o.body:null];case 3:return e.sent(),[2,null];case 4:return[2]}var t})})},Ug.prototype.getEndpointMetadataFromHardcodedValues=function(){return this.canonicalAuthority in Rg?Rg[this.canonicalAuthority]:null},Ug.prototype.updateMetadataWithRegionalInformation=function(o){var n,i;return Fh(this,void 0,void 0,function(){var t,r;return Kh(this,function(e){switch(e.label){case 0:return[4,this.regionDiscovery.detectRegion(null===(n=this.authorityOptions.azureRegionConfiguration)||void 0===n?void 0:n.environmentRegion,this.regionDiscoveryMetadata,this.proxyUrl)];case 1:return t=e.sent(),r=(null===(n=this.authorityOptions.azureRegionConfiguration)||void 0===n?void 0:n.azureRegion)===Qh.AZURE_REGION_AUTO_DISCOVER_FLAG?t:null===(i=this.authorityOptions.azureRegionConfiguration)||void 0===i?void 0:i.azureRegion,(null===(i=this.authorityOptions.azureRegionConfiguration)||void 0===i?void 0:i.azureRegion)===Qh.AZURE_REGION_AUTO_DISCOVER_FLAG?this.regionDiscoveryMetadata.region_outcome=t?_p.AUTO_DETECTION_REQUESTED_SUCCESSFUL:_p.AUTO_DETECTION_REQUESTED_FAILED:this.regionDiscoveryMetadata.region_outcome=t?(null===(i=this.authorityOptions.azureRegionConfiguration)||void 0===i?void 0:i.azureRegion)===t?_p.CONFIGURED_MATCHES_DETECTED:_p.CONFIGURED_NOT_DETECTED:_p.CONFIGURED_NO_AUTO_DETECTION,r?(this.regionDiscoveryMetadata.region_used=r,[2,Ug.replaceWithRegionalInformation(o,r)]):[2,o]}})})},Ug.prototype.updateCloudDiscoveryMetadata=function(o){return Fh(this,void 0,void 0,function(){var t,r;return Kh(this,function(e){switch(e.label){case 0:return(this.logger.verbose("Attempting to get cloud discovery metadata in the config"),this.logger.verbosePii("Known Authorities: "+(this.authorityOptions.knownAuthorities||Qh.NOT_APPLICABLE)),this.logger.verbosePii("Authority Metadata: "+(this.authorityOptions.authorityMetadata||Qh.NOT_APPLICABLE)),this.logger.verbosePii("Canonical Authority: "+(o.canonical_authority||Qh.NOT_APPLICABLE)),t=this.getCloudDiscoveryMetadataFromConfig())?(this.logger.verbose("Found cloud discovery metadata in the config."),o.updateCloudDiscoveryMetadata(t,!1),[2,lp.CONFIG]):(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the cache."),r=o.isExpired(),this.isAuthoritySameType(o)&&o.aliasesFromNetwork&&!r?(this.logger.verbose("Found metadata in the cache."),[2,lp.CACHE]):(r&&this.logger.verbose("The metadata entity is expired."),this.logger.verbose("Did not find cloud discovery metadata in the cache... Attempting to get cloud discovery metadata from the network."),[4,this.getCloudDiscoveryMetadataFromNetwork()]));case 1:if(t=e.sent())return this.logger.verbose("cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()"),o.updateCloudDiscoveryMetadata(t,!0),[2,lp.NETWORK];if(this.logger.verbose("Did not find cloud discovery metadata from the network... Attempting to get cloud discovery metadata from hardcoded values."),(r=this.getCloudDiscoveryMetadataFromHarcodedValues())&&!this.options.skipAuthorityMetadataCache)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),o.updateCloudDiscoveryMetadata(r,!1),[2,lp.HARDCODED_VALUES];throw this.logger.error("Did not find cloud discovery metadata from hardcoded values... Metadata could not be obtained from config, cache, network or hardcoded values. Throwing Untrusted Authority Error."),nf.createUntrustedAuthorityError()}})})},Ug.prototype.getCloudDiscoveryMetadataFromConfig=function(){if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");var e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),t=Ug.getCloudDiscoveryMetadataFromNetworkResponse(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),t)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),t;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch(e){throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),nf.createInvalidCloudDiscoveryMetadataError()}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),Ug.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null},Ug.prototype.getCloudDiscoveryMetadataFromNetwork=function(){return Fh(this,void 0,void 0,function(){var r,o,n,i,s,a;return Kh(this,function(e){switch(e.label){case 0:r=""+Qh.AAD_INSTANCE_DISCOVERY_ENDPT+this.canonicalAuthority+"oauth2/v2.0/authorize",o={},this.proxyUrl&&(o.proxyUrl=this.proxyUrl),n=null,e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(r,o)];case 2:if(i=e.sent(),a=s=void 0,(t=i.body).hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata"))s=i.body,a=s.metadata,this.logger.verbosePii("tenant_discovery_endpoint is: "+s.tenant_discovery_endpoint);else{if(!(t=i.body).hasOwnProperty("error")||!t.hasOwnProperty("error_description"))return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),[2,null];if(this.logger.warning("A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: "+i.status),(s=i.body).error===Qh.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),[2,null];this.logger.warning("The CloudInstanceDiscoveryErrorResponse error is "+s.error),this.logger.warning("The CloudInstanceDiscoveryErrorResponse error description is "+s.error_description),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),a=[]}return this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),n=Ug.getCloudDiscoveryMetadataFromNetworkResponse(a,this.hostnameAndPort),[3,4];case 3:return(a=e.sent())instanceof xp?this.logger.error("There was a network error while attempting to get the cloud discovery instance metadata.\nError: "+a.errorCode+"\nError Description: "+a.errorMessage):this.logger.error("A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\nError: "+a.name+"\nError Description: "+a.message),[2,null];case 4:return n||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),n=Ug.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),[2,n]}var t})})},Ug.prototype.getCloudDiscoveryMetadataFromHarcodedValues=function(){return this.canonicalAuthority in Mg?Mg[this.canonicalAuthority]:null},Ug.prototype.isInKnownAuthorities=function(){var t=this;return 0<this.authorityOptions.knownAuthorities.filter(function(e){return lg.getDomainFromUrl(e).toLowerCase()===t.hostnameAndPort}).length},Ug.generateAuthority=function(e,t){var r;return t&&t.azureCloudInstance!==Rd.None&&(r=t.tenant||Qh.DEFAULT_COMMON_TENANT,r=t.azureCloudInstance+"/"+r+"/"),r||e},Ug.createCloudDiscoveryMetadataFromHost=function(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}},Ug.getCloudDiscoveryMetadataFromNetworkResponse=function(e,t){for(var r=0;r<e.length;r++){var o=e[r];if(-1<o.aliases.indexOf(t))return o}return null},Ug.prototype.getPreferredCache=function(){if(this.discoveryComplete())return this.metadata.preferred_cache;throw Td.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},Ug.prototype.isAlias=function(e){return-1<this.metadata.aliases.indexOf(e)},Ug.isPublicCloudAuthority=function(e){return 0<=Qh.KNOWN_PUBLIC_CLOUDS.indexOf(e)},Ug.buildRegionalAuthorityString=function(e,t,r){var o=new lg(e);o.validateAsUri();var n=o.getUrlComponents(),e=t+"."+n.HostNameAndPort;this.isPublicCloudAuthority(n.HostNameAndPort)&&(e=t+"."+Qh.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX);e=lg.constructAuthorityUriFromObject(Bh(Bh({},o.getUrlComponents()),{HostNameAndPort:e})).urlString;return r?e+"?"+r:e},Ug.replaceWithRegionalInformation=function(e,t){return e.authorization_endpoint=Ug.buildRegionalAuthorityString(e.authorization_endpoint,t),e.token_endpoint=Ug.buildRegionalAuthorityString(e.token_endpoint,t,Qh.REGIONAL_AUTH_NON_MSI_QUERY_STRING),e.end_session_endpoint&&(e.end_session_endpoint=Ug.buildRegionalAuthorityString(e.end_session_endpoint,t)),e},Ug);function Ug(e,t,r,o,n,i){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=r,this.authorityOptions=o,this.regionDiscovery=new Dg(t),this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.proxyUrl=i||Qh.EMPTY_STRING,this.logger=n}var Hg=(zg.createDiscoveredInstance=function(o,n,i,s,a,c){return Fh(this,void 0,void 0,function(){var t,r;return Kh(this,function(e){switch(e.label){case 0:t=zg.createInstance(o,n,i,s,a,c),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,t.resolveEndpointsAsync()];case 2:return e.sent(),[2,t];case 3:throw r=e.sent(),Td.createEndpointDiscoveryIncompleteError(r);case 4:return[2]}})})},zg.createInstance=function(e,t,r,o,n,i){if(kd.isEmpty(e))throw nf.createUrlEmptyError();return new jg(e,t,r,o,n,i)},zg);function zg(){}var Bg=(Fg.isServerTelemetryEntity=function(e,t){var r=0===e.indexOf(gp.CACHE_KEY),e=!0;return t&&(e=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),r&&e},Fg);function Fg(){this.failedRequests=[],this.errors=[],this.cacheHits=0}var Kg=(Gg.isThrottlingEntity=function(e,t){var r=!1;e&&(r=0===e.indexOf(Sp));e=!0;return t&&(e=t.hasOwnProperty("throttleTime")),r&&e},Gg);function Gg(){}var Yg,Zg={sendGetRequestAsync:function(){return Promise.reject(xp.createUnexpectedError("Network interface - sendGetRequestAsync() has not been implemented for the Network interface."))},sendPostRequestAsync:function(){return Promise.reject(xp.createUnexpectedError("Network interface - sendPostRequestAsync() has not been implemented for the Network interface."))}},Wg={code:"missing_kid_error",desc:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided."},Vg={code:"missing_alg_error",desc:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."},Jg=(zh(Qg,Yg=xp),Qg.createMissingKidError=function(){return new Qg(Wg.code,Wg.desc)},Qg.createMissingAlgError=function(){return new Qg(Vg.code,Vg.desc)},Qg);function Qg(e,t){t=Yg.call(this,e,t)||this;return t.name="JoseHeaderError",Object.setPrototypeOf(t,Qg.prototype),t}var Xg=($g.getShrHeaderString=function(e){if(!e.kid)throw Jg.createMissingKidError();if(!e.alg)throw Jg.createMissingAlgError();e=new $g({typ:e.typ||bp.Jwt,kid:e.kid,alg:e.alg});return JSON.stringify(e)},$g);function $g(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}var ey=(ty.prototype.generateCurrentRequestHeaderValue=function(){var e=""+this.apiId+gp.VALUE_SEPARATOR+this.cacheOutcome,t=[this.wrapperSKU,this.wrapperVer].join(gp.VALUE_SEPARATOR),e=[e,this.getRegionDiscoveryFields()].join(gp.VALUE_SEPARATOR);return[gp.SCHEMA_VERSION,e,t].join(gp.CATEGORY_SEPARATOR)},ty.prototype.generateLastRequestHeaderValue=function(){var e=this.getLastRequests(),t=ty.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join(gp.VALUE_SEPARATOR),o=e.errors.slice(0,t).join(gp.VALUE_SEPARATOR),n=e.errors.length,n=[n,t<n?gp.OVERFLOW_TRUE:gp.OVERFLOW_FALSE].join(gp.VALUE_SEPARATOR);return[gp.SCHEMA_VERSION,e.cacheHits,r,o,n].join(gp.CATEGORY_SEPARATOR)},ty.prototype.cacheFailedRequest=function(e){var t=this.getLastRequests();t.errors.length>=gp.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),kd.isEmpty(e.subError)?kd.isEmpty(e.errorCode)?e&&e.toString()?t.errors.push(e.toString()):t.errors.push(gp.UNKNOWN_ERROR):t.errors.push(e.errorCode):t.errors.push(e.subError),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)},ty.prototype.incrementCacheHits=function(){var e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits},ty.prototype.getLastRequests=function(){var e=new Bg;return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e},ty.prototype.clearTelemetryCache=function(){var e,t=this.getLastRequests(),r=ty.maxErrorsToSend(t);r===t.errors.length?this.cacheManager.removeItem(this.telemetryCacheKey):((e=new Bg).failedRequests=t.failedRequests.slice(2*r),e.errors=t.errors.slice(r),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e))},ty.maxErrorsToSend=function(e){for(var t=0,r=0,o=e.errors.length,n=0;n<o;n++){var i=e.failedRequests[2*n]||Qh.EMPTY_STRING,s=e.failedRequests[2*n+1]||Qh.EMPTY_STRING,a=e.errors[n]||Qh.EMPTY_STRING;if(!((r+=i.toString().length+s.toString().length+a.length+3)<gp.MAX_LAST_HEADER_BYTES))break;t+=1}return t},ty.prototype.getRegionDiscoveryFields=function(){var e=[];return e.push(this.regionUsed||Qh.EMPTY_STRING),e.push(this.regionSource||Qh.EMPTY_STRING),e.push(this.regionOutcome||Qh.EMPTY_STRING),e.join(",")},ty.prototype.updateRegionDiscoveryMetadata=function(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome},ty.prototype.setCacheOutcome=function(e){this.cacheOutcome=e},ty);function ty(e,t){this.cacheOutcome=wp.NO_CACHE_HIT,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||Qh.EMPTY_STRING,this.wrapperVer=e.wrapperVer||Qh.EMPTY_STRING,this.telemetryCacheKey=gp.CACHE_KEY+ip.CACHE_KEY_SEPARATOR+e.clientId}ry.prototype.startMeasurement=function(e,t){var r=this,o=t||this.generateId();t||this.logger.info("PerformanceClient: No correlation id provided for "+e+", generating",o),this.logger.trace("PerformanceClient: Performance measurement started for "+e,o);t=this.startPerformanceMeasuremeant(e,o);t.startMeasurement();var n={eventId:this.generateId(),status:Cg.InProgress,authority:this.authority,libraryName:this.libraryName,libraryVersion:this.libraryVersion,clientId:this.clientId,name:e,startTimeMs:Date.now(),correlationId:o};this.cacheEventByCorrelationId(n);e={appName:null===(e=this.applicationTelemetry)||void 0===e?void 0:e.appName,appVersion:null===(e=this.applicationTelemetry)||void 0===e?void 0:e.appVersion};return this.addStaticFields(e,o),this.cacheMeasurement(n,t),{endMeasurement:function(e){e=r.endMeasurement(Bh(Bh({},n),e));return e&&r.cacheEventByCorrelationId(e),e},flushMeasurement:function(){return r.flushMeasurements(n.name,n.correlationId)},discardMeasurement:function(){return r.discardMeasurements(n.correlationId)},addStaticFields:function(e){return r.addStaticFields(e,n.correlationId)},measurement:t,event:n}},ry.prototype.endMeasurement=function(e){var t=this.measurementsById.get(e.eventId);if(t){this.measurementsById.delete(e.eventId),t.endMeasurement();t=t.flushMeasurement();if(null!==t)return this.logger.trace("PerformanceClient: Performance measurement ended for "+e.name+": "+t+" ms",e.correlationId),Bh(Bh({durationMs:Math.round(t)},e),{status:Cg.Completed});this.logger.trace("PerformanceClient: Performance measurement not taken",e.correlationId)}else this.logger.trace("PerformanceClient: Measurement not found for "+e.eventId,e.correlationId);return null},ry.prototype.addStaticFields=function(e,t){var r=this.staticFieldsByCorrelationId.get(t);r?(this.logger.trace("PerformanceClient: Updating static fields"),this.staticFieldsByCorrelationId.set(t,Bh(Bh({},r),e))):(this.logger.trace("PerformanceClient: Adding static fields"),this.staticFieldsByCorrelationId.set(t,e))},ry.prototype.cacheEventByCorrelationId=function(e){var t=this.eventsByCorrelationId.get(e.correlationId);t?(this.logger.trace("PerformanceClient: Performance measurement for "+e.name+" added/updated",e.correlationId),t.set(e.eventId,e)):(this.logger.trace("PerformanceClient: Performance measurement for "+e.name+" started",e.correlationId),this.eventsByCorrelationId.set(e.correlationId,(new Map).set(e.eventId,e)))},ry.prototype.cacheMeasurement=function(e,t){this.measurementsById.set(e.eventId,t)},ry.prototype.flushMeasurements=function(o,n){var i=this;this.logger.trace("PerformanceClient: Performance measurements flushed for "+o,n);var r,e,t=this.eventsByCorrelationId.get(n);t?(this.discardMeasurements(n),r=[],t.forEach(function(e){var t;e.name!==o&&e.status!==Cg.Completed&&(i.logger.trace("PerformanceClient: Incomplete submeasurement "+e.name+" found for "+o,n),(t=i.endMeasurement(e))&&r.push(t)),r.push(e)}),0<(t=(e=r.sort(function(e,t){return e.startTimeMs-t.startTimeMs})).filter(function(e){return e.name===o&&e.status===Cg.Completed})).length?(1<t.length&&this.logger.verbose("PerformanceClient: Multiple distinct top-level performance events found, using the first",n),t=t[0],this.logger.verbose("PerformanceClient: Measurement found for "+o,n),e=e.reduce(function(e,t){var r;return t.name!==o&&(i.logger.trace("PerformanceClient: Complete submeasurement found for "+t.name,n),e[r=t.name+"DurationMs"]?i.logger.verbose("PerformanceClient: Submeasurement for "+o+" already exists for "+t.name+", ignoring",n):e[r]=t.durationMs),e},t),t=this.staticFieldsByCorrelationId.get(n),t=Bh(Bh({},e),t),this.emitEvents([t],e.correlationId)):this.logger.verbose("PerformanceClient: No completed top-level measurements found for "+o,n)):this.logger.verbose("PerformanceClient: No measurements found",n)},ry.prototype.discardMeasurements=function(e){this.logger.trace("PerformanceClient: Performance measurements discarded",e),this.eventsByCorrelationId.delete(e)},ry.prototype.addPerformanceCallback=function(e){var t=this.generateId();return this.callbacks.set(t,e),this.logger.verbose("PerformanceClient: Performance callback registered with id: "+t),t},ry.prototype.removePerformanceCallback=function(e){var t=this.callbacks.delete(e);return t?this.logger.verbose("PerformanceClient: Performance callback "+e+" removed."):this.logger.verbose("PerformanceClient: Performance callback "+e+" not removed."),t},ry.prototype.emitEvents=function(r,o){var n=this;this.logger.verbose("PerformanceClient: Emitting performance events",o),this.callbacks.forEach(function(e,t){n.logger.trace("PerformanceClient: Emitting event to callback "+t,o),e.apply(null,[r])})},w=ry;function ry(e,t,r,o,n,i){this.authority=t,this.libraryName=o,this.libraryVersion=n,this.applicationTelemetry=i,this.clientId=e,this.logger=r,this.callbacks=new Map,this.eventsByCorrelationId=new Map,this.staticFieldsByCorrelationId=new Map,this.measurementsById=new Map}var oy=(ny.prototype.startMeasurement=function(){},ny.prototype.endMeasurement=function(){},ny.prototype.flushMeasurement=function(){return null},ny);function ny(){}var iy,sy=(zh(ay,iy=w),ay.prototype.generateId=function(){return"callback-id"},ay.prototype.startPerformanceMeasuremeant=function(){return new oy},ay);function ay(){return null!==iy&&iy.apply(this,arguments)||this}var cy,uy={code:"pkce_not_created",desc:"The PKCE code challenge and verifier could not be generated."},ly={code:"crypto_nonexistent",desc:"The crypto object or function is not available."},hy={code:"http_method_not_implemented",desc:"The HTTP method given has not been implemented in this library."},py={code:"empty_navigate_uri",desc:"Navigation URI is empty. Please check stack trace for more info."},dy={code:"hash_empty_error",desc:"Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. For more visit: aka.ms/msaljs/browser-errors."},fy={code:"no_state_in_hash",desc:"Hash does not contain state. Please verify that the request originated from msal."},gy={code:"hash_does_not_contain_known_properties",desc:"Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. For more visit: aka.ms/msaljs/browser-errors."},yy={code:"unable_to_parse_state",desc:"Unable to parse state. Please verify that the request originated from msal."},my={code:"state_interaction_type_mismatch",desc:"Hash contains state but the interaction type does not match the caller."},vy={code:"interaction_in_progress",desc:"Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. For more visit: aka.ms/msaljs/browser-errors."},_y={code:"popup_window_error",desc:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser."},wy={code:"empty_window_error",desc:"window.open returned null or undefined window object."},by={code:"user_cancelled",desc:"User cancelled the flow."},Cy={code:"monitor_window_timeout",desc:"Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},Ey={code:"monitor_window_timeout",desc:"Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},Sy={code:"redirect_in_iframe",desc:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs."},Ty={code:"block_iframe_reload",desc:"Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors"},Iy={code:"block_nested_popups",desc:"Request was blocked inside a popup because MSAL detected it was running in a popup."},Ay={code:"iframe_closed_prematurely",desc:"The iframe being monitored was closed prematurely."},ky={code:"silent_logout_unsupported",desc:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead."},Py={code:"no_account_error",desc:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request."},Oy={code:"silent_prompt_value_error",desc:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'."},xy={code:"no_token_request_cache_error",desc:"No token request found in cache."},Ry={code:"unable_to_parse_token_request_cache_error",desc:"The cached token request could not be parsed."},My={code:"no_cached_authority_error",desc:"No cached authority found."},Ny={code:"auth_request_not_set_error",desc:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler"},Ly={code:"invalid_cache_type",desc:"Invalid cache type"},Dy={code:"non_browser_environment",desc:"Login and token requests are not supported in non-browser environments."},qy={code:"database_not_open",desc:"Database is not open!"},jy={code:"no_network_connectivity",desc:"No network connectivity. Check your internet connection."},Uy={code:"post_request_failed",desc:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'"},Hy={code:"get_request_failed",desc:"Network request failed. Please check the network trace to determine root cause."},zy={code:"failed_to_parse_response",desc:"Failed to parse network response. Check network trace."},By={code:"unable_to_load_token",desc:"Error loading token to cache."},Fy={code:"crypto_key_not_found",desc:"Cryptographic Key or Keypair not found in browser storage."},Ky={code:"auth_code_required",desc:"An authorization code must be provided (as the `code` property on the request) to this flow."},Gy={code:"auth_code_or_nativeAccountId_required",desc:"An authorization code or nativeAccountId must be provided to this flow."},Yy={code:"database_unavailable",desc:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts."},Zy={code:"unable_to_acquire_token_from_native_platform",desc:"Unable to acquire token from native platform. For a list of possible reasons visit aka.ms/msaljs/browser-errors."},Wy={code:"native_handshake_timeout",desc:"Timed out while attempting to establish connection to browser extension"},Vy={code:"native_extension_not_installed",desc:"Native extension is not installed. If you think this is a mistake call the initialize function."},Jy={code:"native_connection_not_established",desc:"Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). For more please visit aka.ms/msaljs/browser-errors."},Qy={code:"native_broker_called_before_initialize",desc:"You must call and await the initialize function before attempting to call any other MSAL API when native brokering is enabled. For more please visit aka.ms/msaljs/browser-errors."},Xy={code:"native_prompt_not_supported",desc:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow."},$y=(Nh(em,cy=xp),em.createPkceNotGeneratedError=function(e){return new em(uy.code,uy.desc+" Detail:"+e)},em.createCryptoNotAvailableError=function(e){return new em(ly.code,ly.desc+" Detail:"+e)},em.createHttpMethodNotImplementedError=function(e){return new em(hy.code,hy.desc+" Given Method: "+e)},em.createEmptyNavigationUriError=function(){return new em(py.code,py.desc)},em.createEmptyHashError=function(e){return new em(dy.code,dy.desc+" Given Url: "+e)},em.createHashDoesNotContainStateError=function(){return new em(fy.code,fy.desc)},em.createHashDoesNotContainKnownPropertiesError=function(){return new em(gy.code,gy.desc)},em.createUnableToParseStateError=function(){return new em(yy.code,yy.desc)},em.createStateInteractionTypeMismatchError=function(){return new em(my.code,my.desc)},em.createInteractionInProgressError=function(){return new em(vy.code,vy.desc)},em.createPopupWindowError=function(e){var t=_y.desc,t=kd.isEmpty(e)?t:t+" Details: "+e;return new em(_y.code,t)},em.createEmptyWindowCreatedError=function(){return new em(wy.code,wy.desc)},em.createUserCancelledError=function(){return new em(by.code,by.desc)},em.createMonitorPopupTimeoutError=function(){return new em(Cy.code,Cy.desc)},em.createMonitorIframeTimeoutError=function(){return new em(Ey.code,Ey.desc)},em.createRedirectInIframeError=function(e){return new em(Sy.code,Sy.desc+" (window.parent !== window) => "+e)},em.createBlockReloadInHiddenIframeError=function(){return new em(Ty.code,Ty.desc)},em.createBlockAcquireTokenInPopupsError=function(){return new em(Iy.code,Iy.desc)},em.createIframeClosedPrematurelyError=function(){return new em(Ay.code,Ay.desc)},em.createSilentLogoutUnsupportedError=function(){return new em(ky.code,ky.desc)},em.createNoAccountError=function(){return new em(Py.code,Py.desc)},em.createSilentPromptValueError=function(e){return new em(Oy.code,Oy.desc+" Given value: "+e)},em.createUnableToParseTokenRequestCacheError=function(){return new em(Ry.code,Ry.desc)},em.createNoTokenRequestCacheError=function(){return new em(xy.code,xy.desc)},em.createAuthRequestNotSetError=function(){return new em(Ny.code,Ny.desc)},em.createNoCachedAuthorityError=function(){return new em(My.code,My.desc)},em.createInvalidCacheTypeError=function(){return new em(Ly.code,""+Ly.desc)},em.createNonBrowserEnvironmentError=function(){return new em(Dy.code,Dy.desc)},em.createDatabaseNotOpenError=function(){return new em(qy.code,qy.desc)},em.createNoNetworkConnectivityError=function(){return new em(jy.code,jy.desc)},em.createPostRequestFailedError=function(e,t){return new em(Uy.code,Uy.desc+" | Network client threw: "+e+" | Attempted to reach: "+t.split("?")[0])},em.createGetRequestFailedError=function(e,t){return new em(Hy.code,Hy.desc+" | Network client threw: "+e+" | Attempted to reach: "+t.split("?")[0])},em.createFailedToParseNetworkResponseError=function(e){return new em(zy.code,zy.desc+" | Attempted to reach: "+e.split("?")[0])},em.createUnableToLoadTokenError=function(e){return new em(By.code,By.desc+" | "+e)},em.createSigningKeyNotFoundInStorageError=function(e){return new em(Fy.code,Fy.desc+" | No match found for KeyId: "+e)},em.createAuthCodeRequiredError=function(){return new em(Ky.code,Ky.desc)},em.createAuthCodeOrNativeAccountIdRequiredError=function(){return new em(Gy.code,Gy.desc)},em.createDatabaseUnavailableError=function(){return new em(Yy.code,Yy.desc)},em.createUnableToAcquireTokenFromNativePlatformError=function(){return new em(Zy.code,Zy.desc)},em.createNativeHandshakeTimeoutError=function(){return new em(Wy.code,Wy.desc)},em.createNativeExtensionNotInstalledError=function(){return new em(Vy.code,Vy.desc)},em.createNativeConnectionNotEstablishedError=function(){return new em(Jy.code,Jy.desc)},em.createNativeBrokerCalledBeforeInitialize=function(){return new em(Qy.code,Qy.desc)},em.createNativePromptParameterNotSupportedError=function(){return new em(Xy.code,Xy.desc)},em);function em(e,t){t=cy.call(this,e,t)||this;return Object.setPrototypeOf(t,em.prototype),t.name="BrowserAuthError",t}var tm,rm,om,nm,im,sm,am,cm={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},um="53ee284d-920a-4b59-9d30-a60315b26836",lm="ppnbnpeolgkicgegkbkbjmhlideopiji",hm="MATS";(o=tm=tm||{}).HandshakeRequest="Handshake",o.HandshakeResponse="HandshakeResponse",o.GetToken="GetToken",o.Response="Response",(o=rm=rm||{}).LocalStorage="localStorage",o.SessionStorage="sessionStorage",o.MemoryStorage="memoryStorage",(o=om=om||{}).GET="GET",o.POST="POST",(o=nm=nm||{}).AUTHORITY="authority",o.ACQUIRE_TOKEN_ACCOUNT="acquireToken.account",o.SESSION_STATE="session.state",o.REQUEST_STATE="request.state",o.NONCE_IDTOKEN="nonce.id_token",o.ORIGIN_URI="request.origin",o.RENEW_STATUS="token.renew.status",o.URL_HASH="urlHash",o.REQUEST_PARAMS="request.params",o.SCOPES="scopes",o.INTERACTION_STATUS_KEY="interaction.status",o.CCS_CREDENTIAL="ccs.credential",o.CORRELATION_ID="request.correlationId",o.NATIVE_REQUEST="request.native",o.REDIRECT_CONTEXT="request.redirect.context",(o=im=im||{}).WRAPPER_SKU="wrapper.sku",o.WRAPPER_VER="wrapper.version",(o=sm=sm||{})[o.acquireTokenRedirect=861]="acquireTokenRedirect",o[o.acquireTokenPopup=862]="acquireTokenPopup",o[o.ssoSilent=863]="ssoSilent",o[o.acquireTokenSilent_authCode=864]="acquireTokenSilent_authCode",o[o.handleRedirectPromise=865]="handleRedirectPromise",o[o.acquireTokenByCode=866]="acquireTokenByCode",o[o.acquireTokenSilent_silentFlow=61]="acquireTokenSilent_silentFlow",o[o.logout=961]="logout",o[o.logoutPopup=962]="logoutPopup",(o=am=am||{}).Redirect="redirect",o.Popup="popup",o.Silent="silent",o.None="none",(o=Ym=Ym||{}).Startup="startup",o.Login="login",o.Logout="logout",o.AcquireToken="acquireToken",o.SsoSilent="ssoSilent",o.HandleRedirect="handleRedirect",o.None="none";var pm={scopes:Xh},dm="jwk";(Ym=Fm=Fm||{}).React="@azure/msal-react",Ym.Angular="@azure/msal-angular";var fm,gm="msal.db";(o=fm=fm||{})[o.Default=0]="Default",o[o.AccessToken=1]="AccessToken",o[o.AccessTokenAndRefreshToken=2]="AccessTokenAndRefreshToken",o[o.RefreshToken=3]="RefreshToken",o[o.RefreshTokenAndNetwork=4]="RefreshTokenAndNetwork",o[o.Skip=5]="Skip";var ym,mm={code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},vm={code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},_m={code:"storage_not_supported",desc:"Given storage configuration option was not supported."},wm={code:"no_redirect_callbacks",desc:"No redirect callbacks have been set. Please call setRedirectCallbacks() with the appropriate function arguments before continuing. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},bm={code:"stubbed_public_client_application_called",desc:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors"},Cm={code:"in_mem_redirect_unavailable",desc:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."},Em={code:"entropy_not_provided",desc:"The available browser crypto interface requires entropy set via system.cryptoOptions.entropy configuration option."},Sm=(Nh(Tm,ym=xp),Tm.createRedirectUriEmptyError=function(){return new Tm(mm.code,mm.desc)},Tm.createPostLogoutRedirectUriEmptyError=function(){return new Tm(vm.code,vm.desc)},Tm.createStorageNotSupportedError=function(e){return new Tm(_m.code,_m.desc+" Given Location: "+e)},Tm.createRedirectCallbacksNotSetError=function(){return new Tm(wm.code,wm.desc)},Tm.createStubPcaInstanceCalledError=function(){return new Tm(bm.code,bm.desc)},Tm.createInMemoryRedirectUnavailableError=function(){return new Tm(Cm.code,Cm.desc)},Tm.createEntropyNotProvided=function(){return new Tm(Em.code,Em.desc)},Tm);function Tm(e,t){t=ym.call(this,e,t)||this;return t.name="BrowserConfigurationAuthError",Object.setPrototypeOf(t,Tm.prototype),t}var Im=(Am.prototype.validateWindowStorage=function(e){if(e!==rm.LocalStorage&&e!==rm.SessionStorage)throw Sm.createStorageNotSupportedError(e);if(!!!window[e])throw Sm.createStorageNotSupportedError(e)},Am.prototype.getItem=function(e){return this.windowStorage.getItem(e)},Am.prototype.setItem=function(e,t){this.windowStorage.setItem(e,t)},Am.prototype.removeItem=function(e){this.windowStorage.removeItem(e)},Am.prototype.getKeys=function(){return Object.keys(this.windowStorage)},Am.prototype.containsKey=function(e){return this.windowStorage.hasOwnProperty(e)},Am);function Am(e){this.validateWindowStorage(e),this.windowStorage=window[e]}var km=(Pm.prototype.getItem=function(e){return this.cache.get(e)||null},Pm.prototype.setItem=function(e,t){this.cache.set(e,t)},Pm.prototype.removeItem=function(e){this.cache.delete(e)},Pm.prototype.getKeys=function(){var r=[];return this.cache.forEach(function(e,t){r.push(t)}),r},Pm.prototype.containsKey=function(e){return this.cache.has(e)},Pm.prototype.clear=function(){this.cache.clear()},Pm);function Pm(){this.cache=new Map}var Om=(xm.extractBrowserRequestState=function(e,t){if(kd.isEmpty(t))return null;try{return ag.parseRequestState(e,t).libraryState.meta}catch(e){throw Td.createInvalidStateError(t,e)}},xm.parseServerResponseFromHash=function(e){if(!e)return{};e=new lg(e);return lg.getDeserializedHash(e.getHash())},xm);function xm(){}var Rm,Mm=(Nh(Nm,Rm=yf),Nm.prototype.setupBrowserStorage=function(e){switch(e){case rm.LocalStorage:case rm.SessionStorage:try{return new Im(e)}catch(e){this.logger.verbose(e);break}}return this.cacheConfig.cacheLocation=rm.MemoryStorage,new km},Nm.prototype.setupTemporaryCacheStorage=function(e){switch(e){case rm.LocalStorage:case rm.SessionStorage:try{return new Im(rm.SessionStorage)}catch(e){return this.logger.verbose(e),this.internalStorage}case rm.MemoryStorage:default:return this.internalStorage}},Nm.prototype.migrateCacheEntries=function(){var r=this,e=Qh.CACHE_PREFIX+"."+Zh.ID_TOKEN,t=Qh.CACHE_PREFIX+"."+Zh.CLIENT_INFO,o=Qh.CACHE_PREFIX+"."+Zh.ERROR,n=Qh.CACHE_PREFIX+"."+Zh.ERROR_DESC,i=[this.browserStorage.getItem(e),this.browserStorage.getItem(t),this.browserStorage.getItem(o),this.browserStorage.getItem(n)];[Zh.ID_TOKEN,Zh.CLIENT_INFO,Zh.ERROR,Zh.ERROR_DESC].forEach(function(e,t){return r.migrateCacheEntry(e,i[t])})},Nm.prototype.migrateCacheEntry=function(e,t){t&&this.setTemporaryCache(e,t,!0)},Nm.prototype.validateAndParseJson=function(e){try{var t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch(e){return null}},Nm.prototype.getItem=function(e){return this.browserStorage.getItem(e)},Nm.prototype.setItem=function(e,t){this.browserStorage.setItem(e,t)},Nm.prototype.getAccount=function(e){e=this.getItem(e);if(!e)return null;e=this.validateAndParseJson(e);return e&&pf.isAccountEntity(e)?yf.toObject(new pf,e):null},Nm.prototype.setAccount=function(e){this.logger.trace("BrowserCacheManager.setAccount called");var t=e.generateAccountKey();this.setItem(t,JSON.stringify(e))},Nm.prototype.getIdTokenCredential=function(e){e=this.getItem(e);if(!e)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null;e=this.validateAndParseJson(e);return e&&Ff.isIdTokenEntity(e)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),yf.toObject(new Ff,e)):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null)},Nm.prototype.setIdTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},Nm.prototype.getAccessTokenCredential=function(e){e=this.getItem(e);if(!e)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null;e=this.validateAndParseJson(e);return e&&Wf.isAccessTokenEntity(e)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),yf.toObject(new Wf,e)):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null)},Nm.prototype.setAccessTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},Nm.prototype.getRefreshTokenCredential=function(e){e=this.getItem(e);if(!e)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null;e=this.validateAndParseJson(e);return e&&Qf.isRefreshTokenEntity(e)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),yf.toObject(new Qf,e)):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null)},Nm.prototype.setRefreshTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},Nm.prototype.getAppMetadata=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;t=this.validateAndParseJson(t);return t&&fg.isAppMetadataEntity(e,t)?(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),yf.toObject(new fg,t)):(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null)},Nm.prototype.setAppMetadata=function(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");var t=e.generateAppMetadataKey();this.setItem(t,JSON.stringify(e))},Nm.prototype.getServerTelemetry=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;t=this.validateAndParseJson(t);return t&&Bg.isServerTelemetryEntity(e,t)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),yf.toObject(new Bg,t)):(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null)},Nm.prototype.setServerTelemetry=function(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))},Nm.prototype.getAuthorityMetadata=function(e){var t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;t=this.validateAndParseJson(t);return t&&Ng.isAuthorityMetadataEntity(e,t)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),yf.toObject(new Ng,t)):null},Nm.prototype.getAuthorityMetadataKeys=function(){var t=this;return this.internalStorage.getKeys().filter(function(e){return t.isAuthorityMetadata(e)})},Nm.prototype.setWrapperMetadata=function(e,t){this.internalStorage.setItem(im.WRAPPER_SKU,e),this.internalStorage.setItem(im.WRAPPER_VER,t)},Nm.prototype.getWrapperMetadata=function(){return[this.internalStorage.getItem(im.WRAPPER_SKU)||Qh.EMPTY_STRING,this.internalStorage.getItem(im.WRAPPER_VER)||Qh.EMPTY_STRING]},Nm.prototype.setAuthorityMetadata=function(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))},Nm.prototype.getActiveAccount=function(){var e=this.generateCacheKey(Zh.ACTIVE_ACCOUNT_FILTERS),t=this.getItem(e);if(!t){this.logger.trace("No active account filters cache schema found, looking for legacy schema");e=this.generateCacheKey(Zh.ACTIVE_ACCOUNT),e=this.getItem(e);if(!e)return this.logger.trace("No active account found"),null;e=this.getAccountInfoByFilter({localAccountId:e})[0]||null;return e?(this.logger.trace("Legacy active account cache schema found"),this.logger.trace("Adding active account filters cache schema"),this.setActiveAccount(e),e):null}t=this.validateAndParseJson(t);return t?(this.logger.trace("Active account filters schema found"),this.getAccountInfoByFilter({homeAccountId:t.homeAccountId,localAccountId:t.localAccountId})[0]||null):(this.logger.trace("No active account found"),null)},Nm.prototype.setActiveAccount=function(e){var t,r=this.generateCacheKey(Zh.ACTIVE_ACCOUNT_FILTERS),o=this.generateCacheKey(Zh.ACTIVE_ACCOUNT);e?(this.logger.verbose("setActiveAccount: Active account set"),t={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId},this.browserStorage.setItem(r,JSON.stringify(t)),this.browserStorage.setItem(o,e.localAccountId)):(this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(r),this.browserStorage.removeItem(o))},Nm.prototype.getAccountInfoByFilter=function(t){return this.getAllAccounts().filter(function(e){return(!t.username||t.username.toLowerCase()===e.username.toLowerCase())&&((!t.homeAccountId||t.homeAccountId===e.homeAccountId)&&((!t.localAccountId||t.localAccountId===e.localAccountId)&&((!t.tenantId||t.tenantId===e.tenantId)&&(!t.environment||t.environment===e.environment))))})},Nm.prototype.getAccountInfoByHints=function(r,o){var e=this.getAllAccounts().filter(function(e){if(o){var t=e.idTokenClaims&&e.idTokenClaims.sid;return o===t}return!!r&&r===e.username});if(1===e.length)return e[0];if(1<e.length)throw Td.createMultipleMatchingAccountsInCacheError();return null},Nm.prototype.getThrottlingCache=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;t=this.validateAndParseJson(t);return t&&Kg.isThrottlingEntity(e,t)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),yf.toObject(new Kg,t)):(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null)},Nm.prototype.setThrottlingCache=function(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))},Nm.prototype.getTemporaryCache=function(e,t){e=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){var r=this.getItemCookie(e);if(r)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),r}r=this.temporaryCacheStorage.getItem(e);if(r)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),r;if(this.cacheConfig.cacheLocation===rm.LocalStorage){e=this.browserStorage.getItem(e);if(e)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),e}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null},Nm.prototype.setTemporaryCache=function(e,t,r){e=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(e,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(e,t))},Nm.prototype.removeItem=function(e){return this.browserStorage.removeItem(e),this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(e)),!0},Nm.prototype.containsKey=function(e){return this.browserStorage.containsKey(e)||this.temporaryCacheStorage.containsKey(e)},Nm.prototype.getKeys=function(){return Uh(this.browserStorage.getKeys(),this.temporaryCacheStorage.getKeys())},Nm.prototype.clear=function(){return qh(this,void 0,void 0,function(){var t=this;return jh(this,function(e){switch(e.label){case 0:return[4,this.removeAllAccounts()];case 1:return e.sent(),this.removeAppMetadata(),this.getKeys().forEach(function(e){!t.browserStorage.containsKey(e)&&!t.temporaryCacheStorage.containsKey(e)||-1===e.indexOf(Qh.CACHE_PREFIX)&&-1===e.indexOf(t.clientId)||t.removeItem(e)}),this.internalStorage.clear(),[2]}})})},Nm.prototype.setItemCookie=function(e,t,r){t=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/;SameSite=Lax;";r&&(t+="expires="+this.getCookieExpirationTime(r)+";"),this.cacheConfig.secureCookies&&(t+="Secure;"),document.cookie=t},Nm.prototype.getItemCookie=function(e){for(var t=encodeURIComponent(e)+"=",r=document.cookie.split(";"),o=0;o<r.length;o++){for(var n=r[o];" "===n.charAt(0);)n=n.substring(1);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}return Qh.EMPTY_STRING},Nm.prototype.clearMsalCookies=function(){var r=this,o=Qh.CACHE_PREFIX+"."+this.clientId;document.cookie.split(";").forEach(function(e){for(;" "===e.charAt(0);)e=e.substring(1);var t;0===e.indexOf(o)&&(t=e.split("=")[0],r.clearItemCookie(t))})},Nm.prototype.clearItemCookie=function(e){this.setItemCookie(e,Qh.EMPTY_STRING,-1)},Nm.prototype.getCookieExpirationTime=function(e){var t=new Date;return new Date(t.getTime()+e*this.COOKIE_LIFE_MULTIPLIER).toUTCString()},Nm.prototype.getCache=function(){return this.browserStorage},Nm.prototype.setCache=function(){},Nm.prototype.generateCacheKey=function(e){return this.validateAndParseJson(e)?JSON.stringify(e):kd.startsWith(e,Qh.CACHE_PREFIX)||kd.startsWith(e,Zh.ADAL_ID_TOKEN)?e:Qh.CACHE_PREFIX+"."+this.clientId+"."+e},Nm.prototype.generateAuthorityKey=function(e){e=ag.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(nm.AUTHORITY+"."+e)},Nm.prototype.generateNonceKey=function(e){e=ag.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(nm.NONCE_IDTOKEN+"."+e)},Nm.prototype.generateStateKey=function(e){e=ag.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(nm.REQUEST_STATE+"."+e)},Nm.prototype.getCachedAuthority=function(e){e=this.generateStateKey(e),e=this.getTemporaryCache(e);if(!e)return null;e=this.generateAuthorityKey(e);return this.getTemporaryCache(e)},Nm.prototype.updateCacheEntries=function(e,t,r,o,n){this.logger.trace("BrowserCacheManager.updateCacheEntries called");var i=this.generateStateKey(e);this.setTemporaryCache(i,e,!1);i=this.generateNonceKey(e);this.setTemporaryCache(i,t,!1);var s,e=this.generateAuthorityKey(e);this.setTemporaryCache(e,r,!1),n?(s={credential:n.homeAccountId,type:Nf.HOME_ACCOUNT_ID},this.setTemporaryCache(nm.CCS_CREDENTIAL,JSON.stringify(s),!0)):kd.isEmpty(o)||(s={credential:o,type:Nf.UPN},this.setTemporaryCache(nm.CCS_CREDENTIAL,JSON.stringify(s),!0))},Nm.prototype.resetRequestCache=function(t){var r=this;this.logger.trace("BrowserCacheManager.resetRequestCache called"),kd.isEmpty(t)||this.getKeys().forEach(function(e){-1!==e.indexOf(t)&&r.removeItem(e)}),t&&(this.removeItem(this.generateStateKey(t)),this.removeItem(this.generateNonceKey(t)),this.removeItem(this.generateAuthorityKey(t))),this.removeItem(this.generateCacheKey(nm.REQUEST_PARAMS)),this.removeItem(this.generateCacheKey(nm.ORIGIN_URI)),this.removeItem(this.generateCacheKey(nm.URL_HASH)),this.removeItem(this.generateCacheKey(nm.CORRELATION_ID)),this.removeItem(this.generateCacheKey(nm.CCS_CREDENTIAL)),this.removeItem(this.generateCacheKey(nm.NATIVE_REQUEST)),this.setInteractionInProgress(!1)},Nm.prototype.cleanRequestByState=function(e){this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e&&(e=this.generateStateKey(e),e=this.temporaryCacheStorage.getItem(e),this.logger.infoPii("BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: "+e),this.resetRequestCache(e||Qh.EMPTY_STRING)),this.clearMsalCookies()},Nm.prototype.cleanRequestByInteractionType=function(r){var o=this;this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.getKeys().forEach(function(e){var t;-1!==e.indexOf(nm.REQUEST_STATE)&&(!(t=o.temporaryCacheStorage.getItem(e))||(e=Om.extractBrowserRequestState(o.cryptoImpl,t))&&e.interactionType===r&&(o.logger.infoPii("BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: "+t),o.resetRequestCache(t)))}),this.clearMsalCookies(),this.setInteractionInProgress(!1)},Nm.prototype.cacheCodeRequest=function(e,t){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");e=t.base64Encode(JSON.stringify(e));this.setTemporaryCache(nm.REQUEST_PARAMS,e,!0)},Nm.prototype.getCachedRequest=function(e,t){this.logger.trace("BrowserCacheManager.getCachedRequest called");var r=this.getTemporaryCache(nm.REQUEST_PARAMS,!0);if(!r)throw $y.createNoTokenRequestCacheError();r=this.validateAndParseJson(t.base64Decode(r));if(!r)throw $y.createUnableToParseTokenRequestCacheError();if(this.removeItem(this.generateCacheKey(nm.REQUEST_PARAMS)),kd.isEmpty(r.authority)){e=this.generateAuthorityKey(e),e=this.getTemporaryCache(e);if(!e)throw $y.createNoCachedAuthorityError();r.authority=e}return r},Nm.prototype.getCachedNativeRequest=function(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");var e=this.getTemporaryCache(nm.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;e=this.validateAndParseJson(e);return e||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)},Nm.prototype.isInteractionInProgress=function(e){var t=this.getInteractionInProgress();return e?t===this.clientId:!!t},Nm.prototype.getInteractionInProgress=function(){var e=Qh.CACHE_PREFIX+"."+nm.INTERACTION_STATUS_KEY;return this.getTemporaryCache(e,!1)},Nm.prototype.setInteractionInProgress=function(e){var t=Qh.CACHE_PREFIX+"."+nm.INTERACTION_STATUS_KEY;if(e){if(this.getInteractionInProgress())throw $y.createInteractionInProgressError();this.setTemporaryCache(t,this.clientId,!1)}else this.getInteractionInProgress()!==this.clientId||this.removeItem(t)},Nm.prototype.getLegacyLoginHint=function(){var e=this.getTemporaryCache(Zh.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(Zh.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));var t=this.getTemporaryCache(Zh.ID_TOKEN,!0);t&&(this.removeItem(this.generateCacheKey(Zh.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));e=t||e;if(e){e=new ff(e,this.cryptoImpl);if(e.claims&&e.claims.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),e.claims.preferred_username;if(e.claims&&e.claims.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),e.claims.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null},Nm.prototype.updateCredentialCacheKey=function(e,t){var r=t.generateCredentialKey();if(e!==r){var o=this.getItem(e);if(o)return this.removeItem(e),this.setItem(r,o),this.logger.verbose("Updated an outdated "+t.credentialType+" cache key"),r;this.logger.error("Attempted to update an outdated "+t.credentialType+" cache key but no item matching the outdated key was found in storage")}return e},Nm.prototype.getRedirectRequestContext=function(){return this.getTemporaryCache(nm.REDIRECT_CONTEXT,!0)},Nm.prototype.setRedirectRequestContext=function(e){this.setTemporaryCache(nm.REDIRECT_CONTEXT,e,!0)},Nm);function Nm(e,t,r,o){r=Rm.call(this,e,r)||this;return r.COOKIE_LIFE_MULTIPLIER=864e5,r.cacheConfig=t,r.logger=o,r.internalStorage=new km,r.browserStorage=r.setupBrowserStorage(r.cacheConfig.cacheLocation),r.temporaryCacheStorage=r.setupTemporaryCacheStorage(r.cacheConfig.cacheLocation),r.migrateCacheEntries(),r}var Lm="@azure/msal-browser",Dm="2.32.1",qm=(jm.prototype.sendGetRequestAsync=function(n,i){return qh(this,void 0,void 0,function(){var t,r,o;return jh(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,fetch(n,{method:om.GET,headers:this.getFetchHeaders(i)})];case 1:return t=e.sent(),[3,3];case 2:throw r=e.sent(),window.navigator.onLine?$y.createGetRequestFailedError(r,n):$y.createNoNetworkConnectivityError();case 3:return e.trys.push([3,5,,6]),o={headers:this.getHeaderDict(t.headers)},[4,t.json()];case 4:return[2,(o.body=e.sent(),o.status=t.status,o)];case 5:throw e.sent(),$y.createFailedToParseNetworkResponseError(n);case 6:return[2]}})})},jm.prototype.sendPostRequestAsync=function(i,s){return qh(this,void 0,void 0,function(){var t,r,o,n;return jh(this,function(e){switch(e.label){case 0:t=s&&s.body||Qh.EMPTY_STRING,e.label=1;case 1:return e.trys.push([1,3,,4]),[4,fetch(i,{method:om.POST,headers:this.getFetchHeaders(s),body:t})];case 2:return r=e.sent(),[3,4];case 3:throw o=e.sent(),window.navigator.onLine?$y.createPostRequestFailedError(o,i):$y.createNoNetworkConnectivityError();case 4:return e.trys.push([4,6,,7]),n={headers:this.getHeaderDict(r.headers)},[4,r.json()];case 5:return[2,(n.body=e.sent(),n.status=r.status,n)];case 6:throw e.sent(),$y.createFailedToParseNetworkResponseError(i);case 7:return[2]}})})},jm.prototype.getFetchHeaders=function(e){var t=new Headers;if(!e||!e.headers)return t;var r=e.headers;return Object.keys(r).forEach(function(e){t.append(e,r[e])}),t},jm.prototype.getHeaderDict=function(e){var r={};return e.forEach(function(e,t){r[t]=e}),r},jm);function jm(){}var Um=(Hm.prototype.sendGetRequestAsync=function(t,r){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,this.sendRequestAsync(t,om.GET,r)]})})},Hm.prototype.sendPostRequestAsync=function(t,r){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,this.sendRequestAsync(t,om.POST,r)]})})},Hm.prototype.sendRequestAsync=function(i,s,e){var a=this;return new Promise(function(r,o){var n=new XMLHttpRequest;if(n.open(s,i,!0),a.setXhrHeaders(n,e),n.onload=function(){(n.status<200||300<=n.status)&&(s===om.POST?o($y.createPostRequestFailedError("Failed with status "+n.status,i)):o($y.createGetRequestFailedError("Failed with status "+n.status,i)));try{var e=JSON.parse(n.responseText),t={headers:a.getHeaderDict(n),body:e,status:n.status};r(t)}catch(e){o($y.createFailedToParseNetworkResponseError(i))}},n.onerror=function(){window.navigator.onLine?s===om.POST?o($y.createPostRequestFailedError("Failed with status "+n.status,i)):o($y.createGetRequestFailedError("Failed with status "+n.status,i)):o($y.createNoNetworkConnectivityError())},s===om.POST&&e&&e.body)n.send(e.body);else{if(s!==om.GET)throw $y.createHttpMethodNotImplementedError(s);n.send()}})},Hm.prototype.setXhrHeaders=function(t,e){var r;e&&e.headers&&(r=e.headers,Object.keys(r).forEach(function(e){t.setRequestHeader(e,r[e])}))},Hm.prototype.getHeaderDict=function(e){var e=e.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};return e.forEach(function(e){var t=e.split(": "),e=t.shift(),t=t.join(": ");e&&t&&(r[e]=t)}),r},Hm);function Hm(){}var zm=(Bm.clearHash=function(e){e.location.hash=Qh.EMPTY_STRING,"function"==typeof e.history.replaceState&&e.history.replaceState(null,Qh.EMPTY_STRING,""+e.location.origin+e.location.pathname+e.location.search)},Bm.replaceHash=function(e){e=e.split("#");e.shift(),window.location.hash=0<e.length?e.join("#"):Qh.EMPTY_STRING},Bm.isInIframe=function(){return window.parent!==window},Bm.isInPopup=function(){return"undefined"!=typeof window&&!!window.opener&&window.opener!==window&&"string"==typeof window.name&&0===window.name.indexOf(cm.POPUP_NAME_PREFIX+".")},Bm.getCurrentUri=function(){return window.location.href.split("?")[0].split("#")[0]},Bm.getHomepage=function(){var e=new lg(window.location.href).getUrlComponents();return e.Protocol+"//"+e.HostNameAndPort+"/"},Bm.getBrowserNetworkClient=function(){return new(window.fetch&&window.Headers?qm:Um)},Bm.blockReloadInHiddenIframes=function(){if(lg.hashContainsKnownProperties(window.location.hash)&&Bm.isInIframe())throw $y.createBlockReloadInHiddenIframeError()},Bm.blockRedirectInIframe=function(e,t){var r=Bm.isInIframe();if(e===am.Redirect&&r&&!t)throw $y.createRedirectInIframeError(r)},Bm.blockAcquireTokenInPopups=function(){if(Bm.isInPopup())throw $y.createBlockAcquireTokenInPopupsError()},Bm.blockNonBrowserEnvironment=function(e){if(!e)throw $y.createNonBrowserEnvironmentError()},Bm.blockNativeBrokerCalledBeforeInitialized=function(e,t){if(e&&!t)throw $y.createNativeBrokerCalledBeforeInitialize()},Bm.detectIEOrEdge=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE "),r=e.indexOf("Trident/"),e=e.indexOf("Edge/");return 0<t||0<r||0<e},Bm);function Bm(){}var Fm=(Km.prototype.clearCacheOnLogout=function(t){return qh(this,void 0,void 0,function(){return jh(this,function(e){switch(e.label){case 0:if(!t)return[3,5];pf.accountInfoIsEqual(t,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null)),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.browserStorage.removeAccount(pf.generateAccountCacheKey(t))];case 2:return e.sent(),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request."),[3,4];case 3:return e.sent(),this.logger.error("Account provided in logout request was not found. Local cache unchanged."),[3,4];case 4:return[3,9];case 5:return e.trys.push([5,8,,9]),this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),[4,this.browserStorage.clear()];case 6:return e.sent(),[4,this.browserCrypto.clearKeystore()];case 7:return e.sent(),[3,9];case 8:return e.sent(),this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged."),[3,9];case 9:return[2]}})})},Km.prototype.initializeBaseRequest=function(n){return qh(this,void 0,void 0,function(){var t,r,o;return jh(this,function(e){switch(e.label){case 0:if(this.logger.verbose("Initializing BaseAuthRequest"),t=n.authority||this.config.auth.authority,r=Uh(n&&n.scopes||[]),(r=Lh(Lh({},n),{correlationId:this.correlationId,authority:t,scopes:r})).authenticationScheme){if(r.authenticationScheme===fp.SSH){if(!n.sshJwk)throw nf.createMissingSshJwkError();if(!n.sshKid)throw nf.createMissingSshKidError()}this.logger.verbose('Authentication Scheme set to "'+r.authenticationScheme+'" as configured in Auth request')}else r.authenticationScheme=fp.BEARER,this.logger.verbose('Authentication Scheme wasn\'t explicitly set in request, defaulting to "Bearer" request');return!n.claims||kd.isEmpty(n.claims)?[3,2]:(o=r,[4,this.browserCrypto.hashString(n.claims)]);case 1:o.requestedClaimsHash=e.sent(),e.label=2;case 2:return[2,r]}})})},Km.prototype.getRedirectUri=function(e){this.logger.verbose("getRedirectUri called");e=e||this.config.auth.redirectUri||zm.getCurrentUri();return lg.getAbsoluteUrl(e,zm.getCurrentUri())},Km.prototype.initializeServerTelemetryManager=function(e,t){this.logger.verbose("initializeServerTelemetryManager called");t={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new ey(t,this.browserStorage)},Km.prototype.getDiscoveredAuthority=function(r){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){switch(e.label){case 0:return(this.logger.verbose("getDiscoveredAuthority called"),t={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata},r)?(this.logger.verbose("Creating discovered authority with request authority"),[4,Hg.createDiscoveredInstance(r,this.config.system.networkClient,this.browserStorage,t,this.logger)]):[3,2];case 1:return[2,e.sent()];case 2:return this.logger.verbose("Creating discovered authority with configured authority"),[4,Hg.createDiscoveredInstance(this.config.auth.authority,this.config.system.networkClient,this.browserStorage,t,this.logger)];case 3:return[2,e.sent()]}})})},Km);function Km(e,t,r,o,n,i,s,a,c){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=n,this.navigationClient=i,this.nativeMessageHandler=a,this.correlationId=c||this.browserCrypto.createNewGuid(),this.logger=o.clone(cm.MSAL_SKU,Dm,this.correlationId),this.performanceClient=s}var Gm,Ym=(Nh(Zm,Gm=Fm),Zm.prototype.initializeAuthorizationCodeRequest=function(o){return qh(this,void 0,void 0,function(){var t,r;return jh(this,function(e){switch(e.label){case 0:return this.logger.verbose("initializeAuthorizationRequest called",o.correlationId),[4,this.browserCrypto.generatePkceCodes()];case 1:return t=e.sent(),r=Lh(Lh({},o),{redirectUri:o.redirectUri,code:Qh.EMPTY_STRING,codeVerifier:t.verifier}),o.codeChallenge=t.challenge,o.codeChallengeMethod=Qh.S256_CODE_CHALLENGE_METHOD,[2,r]}})})},Zm.prototype.initializeLogoutRequest=function(e){this.logger.verbose("initializeLogoutRequest called",null==e?void 0:e.correlationId);var t,r=Lh({correlationId:this.correlationId||this.browserCrypto.createNewGuid()},e);return e?e.logoutHint?this.logger.verbose("logoutHint has already been set in logoutRequest"):e.account?(t=this.getLogoutHintFromIdTokenClaims(e.account))&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),r.logoutHint=t):this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set"):this.logger.verbose("logoutHint will not be set since no logout request was configured"),e&&null===e.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",r.correlationId):e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",r.correlationId),r.postLogoutRedirectUri=lg.getAbsoluteUrl(e.postLogoutRedirectUri,zm.getCurrentUri())):null===this.config.auth.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",r.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",r.correlationId),r.postLogoutRedirectUri=lg.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,zm.getCurrentUri())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",r.correlationId),r.postLogoutRedirectUri=lg.getAbsoluteUrl(zm.getCurrentUri(),zm.getCurrentUri())),r},Zm.prototype.getLogoutHintFromIdTokenClaims=function(e){e=e.idTokenClaims;if(e){if(e.login_hint)return e.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null},Zm.prototype.createAuthCodeClient=function(r,o,n){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){switch(e.label){case 0:return[4,this.getClientConfiguration(r,o,n)];case 1:return t=e.sent(),[2,new Eg(t)]}})})},Zm.prototype.getClientConfiguration=function(r,o,n){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){switch(e.label){case 0:return this.logger.verbose("getClientConfiguration called",this.correlationId),[4,this.getDiscoveredAuthority(o,n)];case 1:return t=e.sent(),[2,{authOptions:{clientId:this.config.auth.clientId,authority:t,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,logLevel:this.config.system.loggerOptions.logLevel,correlationId:this.correlationId},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:r,libraryInfo:{sku:cm.MSAL_SKU,version:Dm,cpu:Qh.EMPTY_STRING,os:Qh.EMPTY_STRING},telemetry:this.config.telemetry}]}})})},Zm.prototype.validateAndExtractStateFromHash=function(e,t,r){if(this.logger.verbose("validateAndExtractStateFromHash called",r),!e.state)throw $y.createHashDoesNotContainStateError();var o=Om.extractBrowserRequestState(this.browserCrypto,e.state);if(!o)throw $y.createUnableToParseStateError();if(o.interactionType!==t)throw $y.createStateInteractionTypeMismatchError();return this.logger.verbose("Returning state from hash",r),e.state},Zm.prototype.getDiscoveredAuthority=function(n,i){return qh(this,void 0,void 0,function(){var t,r,o;return jh(this,function(e){switch(e.label){case 0:return this.logger.verbose("getDiscoveredAuthority called",this.correlationId),t=this.performanceClient.startMeasurement(bg.StandardInteractionClientGetDiscoveredAuthority,this.correlationId),r={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},o=n||this.config.auth.authority,o=jg.generateAuthority(o,i||this.config.auth.azureCloudOptions),this.logger.verbose("Creating discovered authority with configured authority",this.correlationId),[4,Hg.createDiscoveredInstance(o,this.config.system.networkClient,this.browserStorage,r,this.logger).then(function(e){return t.endMeasurement({success:!0}),e}).catch(function(e){throw t.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})];case 1:return[2,e.sent()]}})})},Zm.prototype.initializeAuthorizationRequest=function(a,c){return qh(this,void 0,void 0,function(){var t,r,o,n,i,s;return jh(this,function(e){switch(e.label){case 0:return this.logger.verbose("initializeAuthorizationRequest called",this.correlationId),t=this.getRedirectUri(a.redirectUri),i={interactionType:c},r=ag.setRequestState(this.browserCrypto,a&&a.state||Qh.EMPTY_STRING,i),n=[{}],[4,this.initializeBaseRequest(a)];case 1:return o=Lh.apply(void 0,[Lh.apply(void 0,n.concat([e.sent()])),{redirectUri:t,state:r,nonce:a.nonce||this.browserCrypto.createNewGuid(),responseMode:rp.FRAGMENT}]),(i=a.account||this.browserStorage.getActiveAccount())&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii("Setting validated request account: "+i.homeAccountId,this.correlationId),o.account=i),kd.isEmpty(o.loginHint)&&!i&&(s=this.browserStorage.getLegacyLoginHint())&&(o.loginHint=s),[2,o]}})})},Zm);function Zm(){return null!==Gm&&Gm.apply(this,arguments)||this}var Wm=(Vm.prototype.handleCodeResponseFromHash=function(o,n,i,s){return qh(this,void 0,void 0,function(){var t,r;return jh(this,function(e){if(this.logger.verbose("InteractionHandler.handleCodeResponse called"),kd.isEmpty(o))throw $y.createEmptyHashError(o);if(t=this.browserStorage.generateStateKey(n),!(t=this.browserStorage.getTemporaryCache(t)))throw Td.createStateNotFoundError("Cached State");try{r=this.authModule.handleFragmentResponse(o,t)}catch(e){throw e instanceof Of&&e.subError===by.code?$y.createUserCancelledError():e}return[2,this.handleCodeResponseFromServer(r,n,i,s)]})})},Vm.prototype.handleCodeResponseFromServer=function(n,i,s,a,c){return void 0===c&&(c=!0),qh(this,void 0,void 0,function(){var t,r,o;return jh(this,function(e){switch(e.label){case 0:if(this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),r=this.browserStorage.generateStateKey(i),!(t=this.browserStorage.getTemporaryCache(r)))throw Td.createStateNotFoundError("Cached State");return r=this.browserStorage.generateNonceKey(t),r=this.browserStorage.getTemporaryCache(r),this.authCodeRequest.code=n.code,n.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(n.cloud_instance_host_name,s,a)]:[3,2];case 1:e.sent(),e.label=2;case 2:return c&&(n.nonce=r||void 0),n.state=t,n.client_info?this.authCodeRequest.clientInfo=n.client_info:(o=this.checkCcsCredentials())&&(this.authCodeRequest.ccsCredential=o),[4,this.authModule.acquireToken(this.authCodeRequest,n)];case 3:return o=e.sent(),this.browserStorage.cleanRequestByState(i),[2,o]}})})},Vm.prototype.updateTokenEndpointAuthority=function(r,o,n){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){switch(e.label){case 0:return t="https://"+r+"/"+o.tenant+"/",[4,Hg.createDiscoveredInstance(t,n,this.browserStorage,o.options,this.logger)];case 1:return t=e.sent(),this.authModule.updateAuthority(t),[2]}})})},Vm.prototype.checkCcsCredentials=function(){var t=this.browserStorage.getTemporaryCache(nm.CCS_CREDENTIAL,!0);if(t)try{return JSON.parse(t)}catch(e){this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii("Cache credential could not be parsed: "+t)}return null},Vm);function Vm(e,t,r,o){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o}var Jm,Qm,Xm,$m=(Nh(ev,Jm=Wm),ev.prototype.initiateAuthRequest=function(r,o){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){switch(e.label){case 0:return(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),kd.isEmpty(r))?[3,7]:(o.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(nm.ORIGIN_URI,o.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(nm.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest,this.browserCrypto),this.logger.infoPii("RedirectHandler.initiateAuthRequest: Navigate to: "+r),t={apiId:sm.acquireTokenRedirect,timeout:o.redirectTimeout,noHistory:!1},"function"!=typeof o.onRedirectNavigate?[3,4]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),!1===o.onRedirectNavigate(r)?[3,2]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),[4,o.navigationClient.navigateExternal(r,t)])));case 1:return e.sent(),[2];case 2:return this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation"),[2];case 3:return[3,6];case 4:return this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),[4,o.navigationClient.navigateExternal(r,t)];case 5:return e.sent(),[2];case 6:return[3,8];case 7:throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),$y.createEmptyNavigationUriError();case 8:return[2]}})})},ev.prototype.handleCodeResponseFromHash=function(i,s,a,c){return qh(this,void 0,void 0,function(){var t,r,o,n;return jh(this,function(e){switch(e.label){case 0:if(this.logger.verbose("RedirectHandler.handleCodeResponse called"),kd.isEmpty(i))throw $y.createEmptyHashError(i);if(this.browserStorage.setInteractionInProgress(!1),o=this.browserStorage.generateStateKey(s),!(t=this.browserStorage.getTemporaryCache(o)))throw Td.createStateNotFoundError("Cached State");try{r=this.authModule.handleFragmentResponse(i,t)}catch(e){throw e instanceof Of&&e.subError===by.code?$y.createUserCancelledError():e}return o=this.browserStorage.generateNonceKey(t),o=this.browserStorage.getTemporaryCache(o),this.authCodeRequest.code=r.code,r.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(r.cloud_instance_host_name,a,c)]:[3,2];case 1:e.sent(),e.label=2;case 2:return r.nonce=o||void 0,r.state=t,r.client_info?this.authCodeRequest.clientInfo=r.client_info:(n=this.checkCcsCredentials())&&(this.authCodeRequest.ccsCredential=n),[4,this.authModule.acquireToken(this.authCodeRequest,r)];case 3:return n=e.sent(),this.browserStorage.cleanRequestByState(s),[2,n]}})})},ev);function ev(e,t,r,o,n){o=Jm.call(this,e,t,r,o)||this;return o.browserCrypto=n,o}(o=Qm=Qm||{}).INITIALIZE_START="msal:initializeStart",o.INITIALIZE_END="msal:initializeEnd",o.ACCOUNT_ADDED="msal:accountAdded",o.ACCOUNT_REMOVED="msal:accountRemoved",o.LOGIN_START="msal:loginStart",o.LOGIN_SUCCESS="msal:loginSuccess",o.LOGIN_FAILURE="msal:loginFailure",o.ACQUIRE_TOKEN_START="msal:acquireTokenStart",o.ACQUIRE_TOKEN_SUCCESS="msal:acquireTokenSuccess",o.ACQUIRE_TOKEN_FAILURE="msal:acquireTokenFailure",o.ACQUIRE_TOKEN_NETWORK_START="msal:acquireTokenFromNetworkStart",o.SSO_SILENT_START="msal:ssoSilentStart",o.SSO_SILENT_SUCCESS="msal:ssoSilentSuccess",o.SSO_SILENT_FAILURE="msal:ssoSilentFailure",o.ACQUIRE_TOKEN_BY_CODE_START="msal:acquireTokenByCodeStart",o.ACQUIRE_TOKEN_BY_CODE_SUCCESS="msal:acquireTokenByCodeSuccess",o.ACQUIRE_TOKEN_BY_CODE_FAILURE="msal:acquireTokenByCodeFailure",o.HANDLE_REDIRECT_START="msal:handleRedirectStart",o.HANDLE_REDIRECT_END="msal:handleRedirectEnd",o.POPUP_OPENED="msal:popupOpened",o.LOGOUT_START="msal:logoutStart",o.LOGOUT_SUCCESS="msal:logoutSuccess",o.LOGOUT_FAILURE="msal:logoutFailure",o.LOGOUT_END="msal:logoutEnd",(o=Xm=Xm||{}).USER_INTERACTION_REQUIRED="USER_INTERACTION_REQUIRED",o.USER_CANCEL="USER_CANCEL",o.NO_NETWORK="NO_NETWORK",o.TRANSIENT_ERROR="TRANSIENT_ERROR",o.PERSISTENT_ERROR="PERSISTENT_ERROR",o.DISABLED="DISABLED",o.ACCOUNT_UNAVAILABLE="ACCOUNT_UNAVAILABLE";var tv,rv={code:"ContentError"},ov={code:"user_switch",desc:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."},nv={code:"tokens_not_found_in_internal_memory_cache",desc:"Tokens not cached in MSAL JS internal memory, please make the WAM request"},iv=(Nh(sv,tv=xp),sv.prototype.isFatal=function(){return!(!this.ext||!this.ext.status||this.ext.status!==Xm.PERSISTENT_ERROR&&this.ext.status!==Xm.DISABLED)||this.errorCode===rv.code},sv.createError=function(e,t,r){if(r&&r.status)switch(r.status){case Xm.ACCOUNT_UNAVAILABLE:return ng.createNativeAccountUnavailableError();case Xm.USER_INTERACTION_REQUIRED:return new ng(e,t);case Xm.USER_CANCEL:return $y.createUserCancelledError();case Xm.NO_NETWORK:return $y.createNoNetworkConnectivityError()}return new sv(e,t,r)},sv.createUserSwitchError=function(){return new sv(ov.code,ov.desc)},sv.createTokensNotFoundInCacheError=function(){return new sv(nv.code,nv.desc)},sv);function sv(e,t,r){t=tv.call(this,e,t)||this;return Object.setPrototypeOf(t,sv.prototype),t.name="NativeAuthError",t.ext=r,t}var av,cv=(Nh(uv,av=Ym),uv.prototype.acquireToken=function(i){return qh(this,void 0,void 0,function(){var t,r,o,n;return jh(this,function(e){switch(e.label){case 0:return t=this.performanceClient.startMeasurement(bg.SilentCacheClientAcquireToken,i.correlationId),r=this.initializeServerTelemetryManager(sm.acquireTokenSilent_silentFlow),[4,this.createSilentFlowClient(r,i.authority,i.azureCloudOptions)];case 1:o=e.sent(),this.logger.verbose("Silent auth client created"),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,o.acquireCachedToken(i)];case 3:return n=e.sent(),t.endMeasurement({success:!0,fromCache:!0}),[2,n];case 4:throw(n=e.sent())instanceof $y&&n.errorCode===Fy.code&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),t.endMeasurement({errorCode:n instanceof xp&&n.errorCode||void 0,subErrorCode:n instanceof xp&&n.subError||void 0,success:!1}),n;case 5:return[2]}})})},uv.prototype.logout=function(){return Promise.reject($y.createSilentLogoutUnsupportedError())},uv.prototype.createSilentFlowClient=function(r,o,n){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){switch(e.label){case 0:return[4,this.getClientConfiguration(r,o,n)];case 1:return t=e.sent(),[2,new Pg(t,this.performanceClient)]}})})},uv.prototype.initializeSilentRequest=function(r,o){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){switch(e.label){case 0:return t=[Lh({},r)],[4,this.initializeBaseRequest(r)];case 1:return[2,Lh.apply(void 0,[Lh.apply(void 0,t.concat([e.sent()])),{account:o,forceRefresh:r.forceRefresh||!1}])]}})})},uv);function uv(){return null!==av&&av.apply(this,arguments)||this}var lv,hv=(Nh(pv,lv=Fm),pv.prototype.acquireToken=function(s){return qh(this,void 0,void 0,function(){var t,r,o,n,i;return jh(this,function(e){switch(e.label){case 0:return this.logger.trace("NativeInteractionClient - acquireToken called."),t=this.performanceClient.startMeasurement(bg.NativeInteractionClientAcquireToken,s.correlationId),r=Gf.nowSeconds(),[4,this.initializeNativeRequest(s)];case 1:o=e.sent(),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,this.acquireTokensFromCache(this.accountId,o)];case 3:return n=e.sent(),t.endMeasurement({success:!0,isNativeBroker:!1,fromCache:!0}),[2,n];case 4:return e.sent(),this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call"),[3,5];case 5:return i={method:tm.GetToken,request:o},[4,this.nativeMessageHandler.sendMessage(i)];case 6:return i=e.sent(),i=this.validateNativeResponse(i),[2,this.handleNativeResponse(i,o,r).then(function(e){return t.endMeasurement({success:!0,isNativeBroker:!0,requestId:e.requestId}),e}).catch(function(e){throw t.endMeasurement({success:!1,errorCode:e.errorCode,subErrorCode:e.subError,isNativeBroker:!0}),e})]}})})},pv.prototype.createSilentCacheRequest=function(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:cf.fromString(e.scope).asArray(),account:t,forceRefresh:!1}},pv.prototype.acquireTokensFromCache=function(o,n){return qh(this,void 0,void 0,function(){var t,r;return jh(this,function(e){switch(e.label){case 0:if(!(r=this.browserStorage.readAccountFromCacheWithNativeAccountId(o)))throw Td.createNoAccountFoundError();t=r.getAccountInfo(),e.label=1;case 1:return e.trys.push([1,3,,4]),r=this.createSilentCacheRequest(n,t),[4,this.silentCacheClient.acquireToken(r)];case 2:return[2,e.sent()];case 3:throw e.sent();case 4:return[2]}})})},pv.prototype.acquireTokenRedirect=function(i){return qh(this,void 0,void 0,function(){var t,r,o,n;return jh(this,function(e){switch(e.label){case 0:return this.logger.trace("NativeInteractionClient - acquireTokenRedirect called."),[4,this.initializeNativeRequest(i)];case 1:t=e.sent(),r={method:tm.GetToken,request:t},e.label=2;case 2:return e.trys.push([2,4,,5]),[4,this.nativeMessageHandler.sendMessage(r)];case 3:return o=e.sent(),this.validateNativeResponse(o),[3,5];case 4:if((n=e.sent())instanceof iv&&n.isFatal())throw n;return[3,5];case 5:return this.browserStorage.setTemporaryCache(nm.NATIVE_REQUEST,JSON.stringify(t),!0),o={apiId:sm.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},n=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(i.redirectUri),[4,this.navigationClient.navigateExternal(n,o)];case 6:return e.sent(),[2]}})})},pv.prototype.handleRedirectPromise=function(){return qh(this,void 0,void 0,function(){var t,r,o,n;return jh(this,function(e){switch(e.label){case 0:if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(!(r=this.browserStorage.getCachedNativeRequest()))return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),[2,null];o=r.prompt,t=Dh(r,["prompt"]),o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(nm.NATIVE_REQUEST)),r={method:tm.GetToken,request:t},o=Gf.nowSeconds(),e.label=1;case 1:return e.trys.push([1,3,,4]),this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker."),[4,this.nativeMessageHandler.sendMessage(r)];case 2:return n=e.sent(),this.validateNativeResponse(n),n=this.handleNativeResponse(n,t,o),this.browserStorage.setInteractionInProgress(!1),[2,n];case 3:throw n=e.sent(),this.browserStorage.setInteractionInProgress(!1),n;case 4:return[2]}})})},pv.prototype.logout=function(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")},pv.prototype.handleNativeResponse=function(f,g,y){return qh(this,void 0,void 0,function(){var t,r,o,n,i,s,a,c,u,l,h,p,d=this;return jh(this,function(e){switch(e.label){case 0:if(this.logger.trace("NativeInteractionClient - handleNativeResponse called."),t=this.getMATSFromResponse(f),this.performanceClient.addStaticFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t?t.broker_version:void 0,matsAccountJoinOnStart:t?t.account_join_on_start:void 0,matsAccountJoinOnEnd:t?t.account_join_on_end:void 0,matsDeviceJoin:t?t.device_join:void 0,matsPromptBehavior:t?t.prompt_behavior:void 0,matsApiErrorCode:t?t.api_error_code:void 0,matsUiVisible:t?t.ui_visible:void 0,matsSilentCode:t?t.silent_code:void 0,matsSilentBiSubCode:t?t.silent_bi_sub_code:void 0,matsSilentMessage:t?t.silent_message:void 0,matsSilentStatus:t?t.silent_status:void 0,matsHttpStatus:t?t.http_status:void 0,matsHttpEventCount:t?t.http_event_count:void 0},this.correlationId),f.account.id!==g.accountId)throw iv.createUserSwitchError();return r=new ff(f.id_token||Qh.EMPTY_STRING,this.browserCrypto),[4,this.getDiscoveredAuthority(g.authority)];case 1:return o=e.sent(),c=o.getPreferredCache(),n=pf.generateHomeAccountId(f.client_info||Qh.EMPTY_STRING,af.Default,this.logger,this.browserCrypto,r),i=pf.createAccount(f.client_info,n,r,void 0,void 0,void 0,c,f.account.id),this.browserStorage.setAccount(i),s=f.scope?cf.fromString(f.scope):cf.fromString(g.scope),l=f.account.properties||{},a=l.UID||r.claims.oid||r.claims.sub||Qh.EMPTY_STRING,c=l.TenantId||r.claims.tid||Qh.EMPTY_STRING,l=fp.BEARER,g.tokenType===fp.POP?[3,2]:[3,4];case 2:if(l=fp.POP,f.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),u=f.shr,[3,5];if(h=new pg(this.browserCrypto),p={resourceRequestMethod:g.resourceRequestMethod,resourceRequestUri:g.resourceRequestUri,shrClaims:g.shrClaims,shrNonce:g.shrNonce},!g.keyId)throw Td.createKeyIdMissingError();return[4,h.signPopToken(f.access_token,g.keyId,p)];case 3:return u=e.sent(),[3,5];case 4:u=f.access_token,e.label=5;case 5:return h={authority:o.canonicalAuthority,uniqueId:a,tenantId:c,scopes:s.asArray(),account:i.getAccountInfo(),idToken:f.id_token,idTokenClaims:r.claims,accessToken:u,fromCache:!!t&&this.isResponseFromCache(t),expiresOn:new Date(1e3*Number(y+f.expires_in)),tokenType:l,correlationId:this.correlationId,state:f.state,fromNativeBroker:!0},p=Ff.createIdTokenEntity(n,g.authority,f.id_token||Qh.EMPTY_STRING,g.clientId,r.claims.tid||Qh.EMPTY_STRING),this.nativeStorageManager.setIdTokenCredential(p),p=l===fp.POP?Qh.SHR_NONCE_VALIDITY:("string"==typeof f.expires_in?parseInt(f.expires_in,10):f.expires_in)||0,p=y+p,p=Wf.createAccessTokenEntity(n,g.authority,u,g.clientId,c,s.printScopes(),p,0,this.browserCrypto),this.nativeStorageManager.setAccessTokenCredential(p),this.browserStorage.removeAccountContext(i).catch(function(e){d.logger.error("Error occurred while removing account context from browser storage. "+e)}),[2,h]}})})},pv.prototype.validateNativeResponse=function(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw iv.createUnexpectedError("Response missing expected properties.")},pv.prototype.getMATSFromResponse=function(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch(e){this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null},pv.prototype.isResponseFromCache=function(e){return void 0===e.is_cached?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached},pv.prototype.initializeNativeRequest=function(a){return qh(this,void 0,void 0,function(){var t,r,o,n,i,s=this;return jh(this,function(e){switch(e.label){case 0:return(this.logger.trace("NativeInteractionClient - initializeNativeRequest called"),o=a.authority||this.config.auth.authority,(t=new lg(o)).validateAsUri(),n=a.scopes,r=Dh(a,["scopes"]),(o=new cf(n||[])).appendScopes(Xh),n=function(){switch(s.apiId){case sm.ssoSilent:case sm.acquireTokenSilent_silentFlow:return s.logger.trace("initializeNativeRequest: silent request sets prompt to none"),tp.NONE}if(a.prompt)switch(a.prompt){case tp.NONE:case tp.CONSENT:case tp.LOGIN:return s.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),a.prompt;default:throw s.logger.trace("initializeNativeRequest: prompt = "+a.prompt+" is not compatible with native flow"),$y.createNativePromptParameterNotSupportedError()}else s.logger.trace("initializeNativeRequest: prompt was not provided")},n=Lh(Lh({},r),{accountId:this.accountId,clientId:this.config.auth.clientId,authority:t.urlString,scope:o.printScopes(),redirectUri:this.getRedirectUri(a.redirectUri),prompt:n(),correlationId:this.correlationId,tokenType:a.authenticationScheme,windowTitleSubstring:document.title,extraParameters:Lh(Lh(Lh({},a.extraQueryParameters),a.tokenQueryParameters),{telemetry:hm}),extendedExpiryToken:!1}),a.authenticationScheme!==fp.POP)?[3,2]:(i={resourceRequestUri:a.resourceRequestUri,resourceRequestMethod:a.resourceRequestMethod,shrClaims:a.shrClaims,shrNonce:a.shrNonce},[4,new pg(this.browserCrypto).generateCnf(i)]);case 1:i=e.sent(),n.reqCnf=i.reqCnfHash,n.keyId=i.kid,e.label=2;case 2:return[2,n]}})})},pv);function pv(e,t,r,o,n,i,s,a,c,u,l,h){t=lv.call(this,e,t,r,o,n,i,a,c,h)||this;return t.apiId=s,t.accountId=u,t.nativeMessageHandler=c,t.nativeStorageManager=l,t.silentCacheClient=new cv(e,t.nativeStorageManager,r,o,n,i,a,c,h),t}var dv=(fv.prototype.sendMessage=function(t){return qh(this,void 0,void 0,function(){var r,o=this;return jh(this,function(e){return this.logger.trace("NativeMessageHandler - sendMessage called."),r={channel:um,extensionId:this.extensionId,responseId:this.responseId++,body:t},this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii("NativeMessageHandler - Sending request to browser extension: "+JSON.stringify(r)),this.messageChannel.port1.postMessage(r),[2,new Promise(function(e,t){o.resolvers.set(r.responseId,{resolve:e,reject:t})})]})})},fv.createProvider=function(o,n){return qh(this,void 0,void 0,function(){var t,r;return jh(this,function(e){switch(e.label){case 0:o.trace("NativeMessageHandler - createProvider called."),e.label=1;case 1:return e.trys.push([1,3,,5]),[4,(t=new fv(o,n,lm)).sendHandshakeRequest()];case 2:return e.sent(),[2,t];case 3:return e.sent(),[4,(r=new fv(o,n)).sendHandshakeRequest()];case 4:return e.sent(),[2,r];case 5:return[2]}})})},fv.prototype.sendHandshakeRequest=function(){return qh(this,void 0,void 0,function(){var r,o=this;return jh(this,function(e){return this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1),r={channel:um,extensionId:this.extensionId,responseId:this.responseId++,body:{method:tm.HandshakeRequest}},this.messageChannel.port1.onmessage=function(e){o.onChannelMessage(e)},window.postMessage(r,window.origin,[this.messageChannel.port2]),[2,new Promise(function(e,t){o.handshakeResolvers.set(r.responseId,{resolve:e,reject:t}),o.timeoutId=window.setTimeout(function(){window.removeEventListener("message",o.windowListener,!1),o.messageChannel.port1.close(),o.messageChannel.port2.close(),t($y.createNativeHandshakeTimeoutError()),o.handshakeResolvers.delete(r.responseId)},o.handshakeTimeoutMs)})]})})},fv.prototype.onWindowMessage=function(e){this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window||(e=e.data).channel&&e.channel===um&&(e.extensionId&&e.extensionId!==this.extensionId||e.body.method===tm.HandshakeRequest&&(this.logger.verbose(e.extensionId?"Extension with id: "+e.extensionId+" not installed":"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),(e=this.handshakeResolvers.get(e.responseId))&&e.reject($y.createNativeExtensionNotInstalledError())))},fv.prototype.onChannelMessage=function(t){this.logger.trace("NativeMessageHandler - onChannelMessage called.");var e=t.data,r=this.resolvers.get(e.responseId),o=this.handshakeResolvers.get(e.responseId);try{var n=e.body.method;if(n===tm.Response){if(!r)return;var i=e.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii("NativeMessageHandler - Received response from browser extension: "+JSON.stringify(i)),"Success"!==i.status)r.reject(iv.createError(i.code,i.description,i.ext));else{if(!i.result)throw xp.createUnexpectedError("Event does not contain result.");i.result.code&&i.result.description?r.reject(iv.createError(i.result.code,i.result.description,i.result.ext)):r.resolve(i.result)}this.resolvers.delete(e.responseId)}else if(n===tm.HandshakeResponse){if(!o)return;clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=e.extensionId,this.extensionVersion=e.body.version,this.logger.verbose("NativeMessageHandler - Received HandshakeResponse from extension: "+this.extensionId),o.resolve(),this.handshakeResolvers.delete(e.responseId)}}catch(e){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii("Error parsing response from WAM Extension: "+e.toString()),this.logger.errorPii("Unable to parse "+t),r?r.reject(e):o&&o.reject(e)}},fv.prototype.getExtensionId=function(){return this.extensionId},fv.prototype.getExtensionVersion=function(){return this.extensionVersion},fv.isNativeAvailable=function(e,t,r,o){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!r)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(o)switch(o){case fp.BEARER:case fp.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0},fv);function fv(e,t,r){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=r,this.resolvers=new Map,this.handshakeResolvers=new Map,this.responseId=0,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this)}var gv,yv=(Nh(mv,gv=Ym),mv.prototype.acquireToken=function(u){return qh(this,void 0,void 0,function(){var t,r,o,n,i,s,a,c=this;return jh(this,function(e){switch(e.label){case 0:return[4,this.initializeAuthorizationRequest(u,am.Redirect)];case 1:t=e.sent(),this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||Qh.EMPTY_STRING,t.account||null),r=this.initializeServerTelemetryManager(sm.acquireTokenRedirect),o=function(e){e.persisted&&(c.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),c.browserStorage.cleanRequestByState(t.state))},e.label=2;case 2:return e.trys.push([2,7,,8]),[4,this.initializeAuthorizationCodeRequest(t)];case 3:return n=e.sent(),[4,this.createAuthCodeClient(r,t.authority,t.azureCloudOptions)];case 4:return s=e.sent(),this.logger.verbose("Auth code client created"),i=new $m(s,this.browserStorage,n,this.logger,this.browserCrypto),[4,s.getAuthCodeUrl(Lh(Lh({},t),{nativeBroker:dv.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,u.authenticationScheme)}))];case 5:return s=e.sent(),a=this.getRedirectStartPage(u.redirectStartPage),this.logger.verbosePii("Redirect start page: "+a),window.addEventListener("pageshow",o),[4,i.initiateAuthRequest(s,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:a,onRedirectNavigate:u.onRedirectNavigate})];case 6:return[2,e.sent()];case 7:throw(a=e.sent())instanceof xp&&a.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",o),r.cacheFailedRequest(a),this.browserStorage.cleanRequestByState(t.state),a;case 8:return[2]}})})},mv.prototype.handleRedirectPromise=function(h){return qh(this,void 0,void 0,function(){var t,r,o,n,i,s,a,c,u,l;return jh(this,function(e){switch(e.label){case 0:t=this.initializeServerTelemetryManager(sm.handleRedirectPromise),e.label=1;case 1:if(e.trys.push([1,10,,11]),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(!(r=this.getRedirectResponseHash(h||window.location.hash)))return this.logger.info("handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(am.Redirect),[2,null];o=void 0;try{n=lg.getDeserializedHash(r),o=this.validateAndExtractStateFromHash(n,am.Redirect),this.logger.verbose("State extracted from hash")}catch(e){return this.logger.info("handleRedirectPromise was unable to extract state due to: "+e),this.browserStorage.cleanRequestByInteractionType(am.Redirect),[2,null]}return(i=this.browserStorage.getTemporaryCache(nm.ORIGIN_URI,!0)||Qh.EMPTY_STRING,s=lg.removeHashFromUrl(i),a=lg.removeHashFromUrl(window.location.href),s===a&&this.config.auth.navigateToLoginRequestUrl)?(this.logger.verbose("Current page is loginRequestUrl, handling hash"),[4,this.handleHash(r,o,t)]):[3,3];case 2:return a=e.sent(),-1<i.indexOf("#")&&zm.replaceHash(i),[2,a];case 3:return this.config.auth.navigateToLoginRequestUrl?[3,4]:(this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash"),[2,this.handleHash(r,o,t)]);case 4:return zm.isInIframe()&&!this.config.system.allowRedirectInIframe?[3,9]:(this.browserStorage.setTemporaryCache(nm.URL_HASH,r,!0),c={apiId:sm.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0},u=!0,i&&"null"!==i?[3,6]:(l=zm.getHomepage(),this.browserStorage.setTemporaryCache(nm.ORIGIN_URI,l,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),[4,this.navigationClient.navigateInternal(l,c)]));case 5:return u=e.sent(),[3,8];case 6:return this.logger.verbose("Navigating to loginRequestUrl: "+i),[4,this.navigationClient.navigateInternal(i,c)];case 7:u=e.sent(),e.label=8;case 8:if(!u)return[2,this.handleHash(r,o,t)];e.label=9;case 9:return[2,null];case 10:throw(l=e.sent())instanceof xp&&l.setCorrelationId(this.correlationId),t.cacheFailedRequest(l),this.browserStorage.cleanRequestByInteractionType(am.Redirect),l;case 11:return[2]}})})},mv.prototype.getRedirectResponseHash=function(e){if(this.logger.verbose("getRedirectResponseHash called"),lg.hashContainsKnownProperties(e))return zm.clearHash(window),this.logger.verbose("Hash contains known properties, returning response hash"),e;e=this.browserStorage.getTemporaryCache(nm.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(nm.URL_HASH)),this.logger.verbose("Hash does not contain known properties, returning cached hash"),e},mv.prototype.handleHash=function(i,s,a){return qh(this,void 0,void 0,function(){var t,r,o,n=this;return jh(this,function(e){switch(e.label){case 0:if(t=this.browserStorage.getCachedRequest(s,this.browserCrypto),this.logger.verbose("handleHash called, retrieved cached request"),(r=lg.getDeserializedHash(i)).accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw $y.createNativeConnectionNotEstablishedError();return r=new hv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,sm.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,r.accountId,this.browserStorage,t.correlationId),o=ag.parseRequestState(this.browserCrypto,s).userRequestState,[2,r.acquireToken(Lh(Lh({},t),{state:o,prompt:void 0})).finally(function(){n.browserStorage.cleanRequestByState(s)})]}if(!(o=this.browserStorage.getCachedAuthority(s)))throw $y.createNoCachedAuthorityError();return[4,this.createAuthCodeClient(a,o)];case 1:return o=e.sent(),this.logger.verbose("Auth code client created"),Rf.removeThrottle(this.browserStorage,this.config.auth.clientId,t),[4,new $m(o,this.browserStorage,t,this.logger,this.browserCrypto).handleCodeResponseFromHash(i,s,o.authority,this.networkClient)];case 2:return[2,e.sent()]}})})},mv.prototype.logout=function(s){return qh(this,void 0,void 0,function(){var t,r,o,n,i;return jh(this,function(e){switch(e.label){case 0:this.logger.verbose("logoutRedirect called"),t=this.initializeLogoutRequest(s),r=this.initializeServerTelemetryManager(sm.logout),e.label=1;case 1:return e.trys.push([1,10,,11]),this.eventHandler.emitEvent(Qm.LOGOUT_START,am.Redirect,s),[4,this.clearCacheOnLogout(t.account)];case 2:return e.sent(),o={apiId:sm.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},[4,this.createAuthCodeClient(r,s&&s.authority)];case 3:return(i=e.sent(),this.logger.verbose("Auth code client created"),n=i.getLogoutUri(t),this.eventHandler.emitEvent(Qm.LOGOUT_SUCCESS,am.Redirect,t),s&&"function"==typeof s.onRedirectNavigate)?!1===s.onRedirectNavigate(n)?[3,5]:(this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(n,o)]):[3,7];case 4:return e.sent(),[2];case 5:this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation"),e.label=6;case 6:return[3,9];case 7:return this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(n,o)];case 8:return e.sent(),[2];case 9:return[3,11];case 10:throw(i=e.sent())instanceof xp&&i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i),this.eventHandler.emitEvent(Qm.LOGOUT_FAILURE,am.Redirect,null,i),this.eventHandler.emitEvent(Qm.LOGOUT_END,am.Redirect),i;case 11:return this.eventHandler.emitEvent(Qm.LOGOUT_END,am.Redirect),[2]}})})},mv.prototype.getRedirectStartPage=function(e){e=e||window.location.href;return lg.getAbsoluteUrl(e,zm.getCurrentUri())},mv);function mv(e,t,r,o,n,i,s,a,c,u){u=gv.call(this,e,t,r,o,n,i,s,c,u)||this;return u.nativeStorage=a,u}var vv,_v=(Nh(wv,vv=Ym),wv.prototype.acquireToken=function(e){try{var t=this.generatePopupName(e.scopes||Xh,e.authority||this.config.auth.authority),r=e.popupWindowAttributes||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,t,r);this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");var o=this.openSizedPopup("about:blank",t,r);return this.acquireTokenPopupAsync(e,t,r,o)}catch(e){return Promise.reject(e)}},wv.prototype.logout=function(e){try{this.logger.verbose("logoutPopup called");var t=this.initializeLogoutRequest(e),r=this.generateLogoutPopupName(t),o=e&&e.authority,n=e&&e.mainWindowRedirectUri,i=(null==e?void 0:e.popupWindowAttributes)||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,i,o,void 0,n);this.logger.verbose("asyncPopup set to false, opening popup");var s=this.openSizedPopup("about:blank",r,i);return this.logoutPopupAsync(t,r,i,o,s,n)}catch(e){return Promise.reject(e)}},wv.prototype.acquireTokenPopupAsync=function(d,f,g,y){return qh(this,void 0,void 0,function(){var t,r,o,n,i,s,a,c,u,l,h,p=this;return jh(this,function(e){switch(e.label){case 0:return this.logger.verbose("acquireTokenPopupAsync called"),t=this.initializeServerTelemetryManager(sm.acquireTokenPopup),[4,this.initializeAuthorizationRequest(d,am.Popup)];case 1:r=e.sent(),this.browserStorage.updateCacheEntries(r.state,r.nonce,r.authority,r.loginHint||Qh.EMPTY_STRING,r.account||null),e.label=2;case 2:return e.trys.push([2,8,,9]),[4,this.initializeAuthorizationCodeRequest(r)];case 3:return o=e.sent(),[4,this.createAuthCodeClient(t,r.authority,r.azureCloudOptions)];case 4:return n=e.sent(),this.logger.verbose("Auth code client created"),i=dv.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,d.authenticationScheme),s=void 0,i&&(s=this.performanceClient.startMeasurement(bg.FetchAccountIdWithNativeBroker,d.correlationId)),[4,n.getAuthCodeUrl(Lh(Lh({},r),{nativeBroker:i}))];case 5:return u=e.sent(),a=new Wm(n,this.browserStorage,o,this.logger),l={popup:y,popupName:f,popupWindowAttributes:g},u=this.initiateAuthRequest(u,l),this.eventHandler.emitEvent(Qm.POPUP_OPENED,am.Popup,{popupWindow:u},null),[4,this.monitorPopupForHash(u)];case 6:if(h=e.sent(),l=lg.getDeserializedHash(h),c=this.validateAndExtractStateFromHash(l,am.Popup,r.correlationId),Rf.removeThrottle(this.browserStorage,this.config.auth.clientId,o),l.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),s&&s.endMeasurement({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw $y.createNativeConnectionNotEstablishedError();return u=new hv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,sm.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,l.accountId,this.nativeStorage,r.correlationId),l=ag.parseRequestState(this.browserCrypto,c).userRequestState,[2,u.acquireToken(Lh(Lh({},r),{state:l,prompt:void 0})).finally(function(){p.browserStorage.cleanRequestByState(c)})]}return[4,a.handleCodeResponseFromHash(h,c,n.authority,this.networkClient)];case 7:return[2,e.sent()];case 8:throw h=e.sent(),y&&y.close(),h instanceof xp&&h.setCorrelationId(this.correlationId),t.cacheFailedRequest(h),this.browserStorage.cleanRequestByState(r.state),h;case 9:return[2]}})})},wv.prototype.logoutPopupAsync=function(n,i,s,a,c,u){return qh(this,void 0,void 0,function(){var t,r,o;return jh(this,function(e){switch(e.label){case 0:this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(Qm.LOGOUT_START,am.Popup,n),t=this.initializeServerTelemetryManager(sm.logoutPopup),e.label=1;case 1:return e.trys.push([1,5,,6]),[4,this.clearCacheOnLogout(n.account)];case 2:return e.sent(),[4,this.createAuthCodeClient(t,a)];case 3:return r=e.sent(),this.logger.verbose("Auth code client created"),r=r.getLogoutUri(n),this.eventHandler.emitEvent(Qm.LOGOUT_SUCCESS,am.Popup,n),r=this.openPopup(r,{popupName:i,popupWindowAttributes:s,popup:c}),this.eventHandler.emitEvent(Qm.POPUP_OPENED,am.Popup,{popupWindow:r},null),[4,this.waitForLogoutPopup(r)];case 4:return e.sent(),u?(o={apiId:sm.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},r=lg.getAbsoluteUrl(u,zm.getCurrentUri()),this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii("Redirecting main window to: "+r),this.navigationClient.navigateInternal(r,o)):this.logger.verbose("No main window navigation requested"),[3,6];case 5:throw o=e.sent(),c&&c.close(),o instanceof xp&&o.setCorrelationId(this.correlationId),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(Qm.LOGOUT_FAILURE,am.Popup,null,o),this.eventHandler.emitEvent(Qm.LOGOUT_END,am.Popup),t.cacheFailedRequest(o),o;case 6:return this.eventHandler.emitEvent(Qm.LOGOUT_END,am.Popup),[2]}})})},wv.prototype.initiateAuthRequest=function(e,t){if(kd.isEmpty(e))throw this.logger.error("Navigate url is empty"),$y.createEmptyNavigationUriError();return this.logger.infoPii("Navigate to: "+e),this.openPopup(e,t)},wv.prototype.monitorPopupForHash=function(a){var c=this;return new Promise(function(r,o){var n=c.config.system.windowHashTimeout/c.config.system.pollIntervalMilliseconds,i=0;c.logger.verbose("PopupHandler.monitorPopupForHash - polling started");var s=setInterval(function(){if(a.closed)return c.logger.error("PopupHandler.monitorPopupForHash - window closed"),c.cleanPopup(),clearInterval(s),void o($y.createUserCancelledError());var e=Qh.EMPTY_STRING,t=Qh.EMPTY_STRING;try{e=a.location.href,t=a.location.hash}catch(e){}kd.isEmpty(e)||"about:blank"===e||(c.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),i++,t?(c.logger.verbose("PopupHandler.monitorPopupForHash - found hash in url"),clearInterval(s),c.cleanPopup(a),lg.hashContainsKnownProperties(t)?(c.logger.verbose("PopupHandler.monitorPopupForHash - hash contains known properties, returning."),r(t)):(c.logger.error("PopupHandler.monitorPopupForHash - found hash in url but it does not contain known properties. Check that your router is not changing the hash prematurely."),c.logger.errorPii("PopupHandler.monitorPopupForHash - hash found: "+t),o($y.createHashDoesNotContainKnownPropertiesError()))):n<i&&(c.logger.error("PopupHandler.monitorPopupForHash - unable to find hash in url, timing out"),clearInterval(s),o($y.createMonitorPopupTimeoutError())))},c.config.system.pollIntervalMilliseconds)})},wv.prototype.waitForLogoutPopup=function(o){var n=this;return new Promise(function(t){n.logger.verbose("PopupHandler.waitForLogoutPopup - polling started");var r=setInterval(function(){o.closed&&(n.logger.error("PopupHandler.waitForLogoutPopup - window closed"),n.cleanPopup(),clearInterval(r),t());var e=Qh.EMPTY_STRING;try{e=o.location.href}catch(e){}kd.isEmpty(e)||"about:blank"===e||(n.logger.verbose("PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing."),clearInterval(r),n.cleanPopup(o),t())},n.config.system.pollIntervalMilliseconds)})},wv.prototype.openPopup=function(e,t){try{var r=void 0;if(t.popup?(r=t.popup,this.logger.verbosePii("Navigating popup window to: "+e),r.location.assign(e)):void 0===t.popup&&(this.logger.verbosePii("Opening popup window to: "+e),r=this.openSizedPopup(e,t.popupName,t.popupWindowAttributes)),!r)throw $y.createEmptyWindowCreatedError();return r.focus&&r.focus(),this.currentWindow=r,window.addEventListener("beforeunload",this.unloadWindow),r}catch(e){throw this.logger.error("error opening popup "+e.message),this.browserStorage.setInteractionInProgress(!1),$y.createPopupWindowError(e.toString())}},wv.prototype.openSizedPopup=function(e,t,r){var o=window.screenLeft||window.screenX,n=window.screenTop||window.screenY,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,s=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,a=null===(c=r.popupSize)||void 0===c?void 0:c.width,c=null===(u=r.popupSize)||void 0===u?void 0:u.height,u=null===(u=r.popupPosition)||void 0===u?void 0:u.top,r=null===(r=r.popupPosition)||void 0===r?void 0:r.left;return(!a||a<0||i<a)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),a=cm.POPUP_WIDTH),(!c||c<0||s<c)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),c=cm.POPUP_HEIGHT),(!u||u<0||s<u)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),u=Math.max(0,s/2-cm.POPUP_HEIGHT/2+n)),(!r||r<0||i<r)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),r=Math.max(0,i/2-cm.POPUP_WIDTH/2+o)),window.open(e,t,"width="+a+", height="+c+", top="+u+", left="+r+", scrollbars=yes")},wv.prototype.unloadWindow=function(e){this.browserStorage.cleanRequestByInteractionType(am.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()},wv.prototype.cleanPopup=function(e){e&&e.close(),window.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)},wv.prototype.generatePopupName=function(e,t){return cm.POPUP_NAME_PREFIX+"."+this.config.auth.clientId+"."+e.join("-")+"."+t+"."+this.correlationId},wv.prototype.generateLogoutPopupName=function(e){e=e.account&&e.account.homeAccountId;return cm.POPUP_NAME_PREFIX+"."+this.config.auth.clientId+"."+e+"."+this.correlationId},wv);function wv(e,t,r,o,n,i,s,a,c,u){u=vv.call(this,e,t,r,o,n,i,s,c,u)||this;return u.unloadWindow=u.unloadWindow.bind(u),u.nativeStorage=a,u}var bv=(Cv.prototype.navigateInternal=function(e,t){return Cv.defaultNavigateWindow(e,t)},Cv.prototype.navigateExternal=function(e,t){return Cv.defaultNavigateWindow(e,t)},Cv.defaultNavigateWindow=function(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(function(e){setTimeout(function(){e(!0)},t.timeout)})},Cv);function Cv(){}var Ev=6e4,Sv=6e3,Tv=3e4,Iv=2e3;var Av,kv=(Nh(Pv,Av=Wm),Pv.prototype.initiateAuthRequest=function(r){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){switch(e.label){case 0:if(kd.isEmpty(r))throw this.logger.info("Navigate url is empty"),$y.createEmptyNavigationUriError();return this.navigateFrameWait?[4,this.loadFrame(r)]:[3,2];case 1:return t=e.sent(),[3,3];case 2:t=this.loadFrameSync(r),e.label=3;case 3:return[2,t]}})})},Pv.prototype.monitorIframeForHash=function(s,e){var a=this;return new Promise(function(r,o){e<Sv&&a.logger.warning("system.loadFrameTimeout or system.iframeHashTimeout set to lower ("+e+"ms) than the default ("+Sv+"ms). This may result in timeouts.");var n=window.performance.now()+e,i=setInterval(function(){if(window.performance.now()>n)return a.removeHiddenIframe(s),clearInterval(i),void o($y.createMonitorIframeTimeoutError());var e=Qh.EMPTY_STRING,t=s.contentWindow;try{e=t?t.location.href:Qh.EMPTY_STRING}catch(e){}kd.isEmpty(e)||(t=t?t.location.hash:Qh.EMPTY_STRING,lg.hashContainsKnownProperties(t)&&(a.removeHiddenIframe(s),clearInterval(i),r(t)))},a.pollIntervalMilliseconds)})},Pv.prototype.loadFrame=function(o){var n=this;return new Promise(function(e,t){var r=n.createHiddenIframe();setTimeout(function(){r?(r.src=o,e(r)):t("Unable to load iframe")},n.navigateFrameWait)})},Pv.prototype.loadFrameSync=function(e){var t=this.createHiddenIframe();return t.src=e,t},Pv.prototype.createHiddenIframe=function(){var e=document.createElement("iframe");return e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height="0",e.style.border="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(e),e},Pv.prototype.removeHiddenIframe=function(e){document.body===e.parentNode&&document.body.removeChild(e)},Pv);function Pv(e,t,r,o,n){o=Av.call(this,e,t,r,o)||this;return o.navigateFrameWait=n.navigateFrameWait,o.pollIntervalMilliseconds=n.pollIntervalMilliseconds,o}var Ov,xv=(Nh(Rv,Ov=Ym),Rv.prototype.acquireToken=function(i){return qh(this,void 0,void 0,function(){var t,r,o,n;return jh(this,function(e){switch(e.label){case 0:if(this.logger.verbose("acquireTokenByIframe called"),t=this.performanceClient.startMeasurement(bg.SilentIframeClientAcquireToken,i.correlationId),kd.isEmpty(i.loginHint)&&kd.isEmpty(i.sid)&&(!i.account||kd.isEmpty(i.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),i.prompt&&i.prompt!==tp.NONE&&i.prompt!==tp.NO_SESSION)throw t.endMeasurement({success:!1}),$y.createSilentPromptValueError(i.prompt);return[4,this.initializeAuthorizationRequest(Lh(Lh({},i),{prompt:i.prompt||tp.NONE}),am.Silent)];case 1:r=e.sent(),this.browserStorage.updateCacheEntries(r.state,r.nonce,r.authority,r.loginHint||Qh.EMPTY_STRING,r.account||null),o=this.initializeServerTelemetryManager(this.apiId),e.label=2;case 2:return e.trys.push([2,5,,6]),[4,this.createAuthCodeClient(o,r.authority,r.azureCloudOptions)];case 3:return n=e.sent(),this.logger.verbose("Auth code client created"),[4,this.silentTokenHelper(n,r).then(function(e){return t.endMeasurement({success:!0,fromCache:!1,requestId:e.requestId}),e})];case 4:return[2,e.sent()];case 5:throw(n=e.sent())instanceof xp&&n.setCorrelationId(this.correlationId),o.cacheFailedRequest(n),this.browserStorage.cleanRequestByState(r.state),t.endMeasurement({errorCode:n instanceof xp&&n.errorCode||void 0,subErrorCode:n instanceof xp&&n.subError||void 0,success:!1}),n;case 6:return[2]}})})},Rv.prototype.logout=function(){return Promise.reject($y.createSilentLogoutUnsupportedError())},Rv.prototype.silentTokenHelper=function(c,u){return qh(this,void 0,void 0,function(){var t,r,o,n,i,s,a=this;return jh(this,function(e){switch(e.label){case 0:return[4,this.initializeAuthorizationCodeRequest(u)];case 1:return t=e.sent(),[4,c.getAuthCodeUrl(Lh(Lh({},u),{nativeBroker:dv.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,u.authenticationScheme)}))];case 2:return s=e.sent(),[4,(r=new kv(c,this.browserStorage,t,this.logger,this.config.system)).initiateAuthRequest(s)];case 3:return i=e.sent(),[4,r.monitorIframeForHash(i,this.config.system.iframeHashTimeout)];case 4:if(o=e.sent(),s=lg.getDeserializedHash(o),n=this.validateAndExtractStateFromHash(s,am.Silent,t.correlationId),s.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw $y.createNativeConnectionNotEstablishedError();return i=new hv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,s.accountId,this.browserStorage,this.correlationId),s=ag.parseRequestState(this.browserCrypto,n).userRequestState,[2,i.acquireToken(Lh(Lh({},u),{state:s,prompt:u.prompt||tp.NONE})).finally(function(){a.browserStorage.cleanRequestByState(n)})]}return[2,r.handleCodeResponseFromHash(o,n,c.authority,this.networkClient)]}})})},Rv);function Rv(e,t,r,o,n,i,s,a,c,u,l){l=Ov.call(this,e,t,r,o,n,i,a,u,l)||this;return l.apiId=s,l.nativeStorage=c,l}var Mv,Nv=(Nh(Lv,Mv=Ym),Lv.prototype.acquireToken=function(a){return qh(this,void 0,void 0,function(){var t,r,o,n,i,s=this;return jh(this,function(e){switch(e.label){case 0:return r=[Lh({},a)],[4,this.initializeBaseRequest(a)];case 1:return t=Lh.apply(void 0,r.concat([e.sent()])),o=this.performanceClient.startMeasurement(bg.SilentRefreshClientAcquireToken,t.correlationId),n=this.initializeServerTelemetryManager(sm.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(n,t.authority,t.azureCloudOptions)];case 2:return i=e.sent(),this.logger.verbose("Refresh token client created"),[2,i.acquireTokenByRefreshToken(t).then(function(e){return o.endMeasurement({success:!0,fromCache:e.fromCache,requestId:e.requestId}),e}).catch(function(e){throw e instanceof xp&&e.setCorrelationId(s.correlationId),n.cacheFailedRequest(e),o.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})]}})})},Lv.prototype.logout=function(){return Promise.reject($y.createSilentLogoutUnsupportedError())},Lv.prototype.createRefreshTokenClient=function(r,o,n){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){switch(e.label){case 0:return[4,this.getClientConfiguration(r,o,n)];case 1:return t=e.sent(),[2,new Ig(t,this.performanceClient)]}})})},Lv);function Lv(){return null!==Mv&&Mv.apply(this,arguments)||this}var Dv=(qv.prototype.addEventCallback=function(e){if("undefined"==typeof window)return null;var t=this.browserCrypto.createNewGuid();return this.eventCallbacks.set(t,e),this.logger.verbose("Event callback registered with id: "+t),t},qv.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},qv.prototype.enableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))},qv.prototype.disableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))},qv.prototype.emitEvent=function(r,e,t,o){var n,i=this;"undefined"!=typeof window&&(n={eventType:r,interactionType:e||null,payload:t||null,error:o||null,timestamp:Date.now()},this.logger.info("Emitting event: "+r),this.eventCallbacks.forEach(function(e,t){i.logger.verbose("Emitting event to callback "+t+": "+r),e.apply(null,[n])}))},qv.prototype.handleAccountCacheChange=function(e){try{var t=e.newValue||e.oldValue;if(!t)return;var r=JSON.parse(t);if("object"!=typeof r||!pf.isAccountEntity(r))return;var o=yf.toObject(new pf,r).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(Qm.ACCOUNT_ADDED,void 0,o)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(Qm.ACCOUNT_REMOVED,void 0,o))}catch(e){return}},qv);function qv(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}var jv=(Uv.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},Uv);function Uv(){}var Hv=(zv.prototype.generateGuid=function(){try{var e=new Uint8Array(16);return this.cryptoObj.getRandomValues(e),e[6]|=64,e[6]&=79,e[8]|=128,e[8]&=191,jv.decimalToHex(e[0])+jv.decimalToHex(e[1])+jv.decimalToHex(e[2])+jv.decimalToHex(e[3])+"-"+jv.decimalToHex(e[4])+jv.decimalToHex(e[5])+"-"+jv.decimalToHex(e[6])+jv.decimalToHex(e[7])+"-"+jv.decimalToHex(e[8])+jv.decimalToHex(e[9])+"-"+jv.decimalToHex(e[10])+jv.decimalToHex(e[11])+jv.decimalToHex(e[12])+jv.decimalToHex(e[13])+jv.decimalToHex(e[14])+jv.decimalToHex(e[15])}catch(e){for(var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",r="0123456789abcdef",o=0,n=Qh.EMPTY_STRING,i=0;i<36;i++)"-"!==t[i]&&"4"!==t[i]&&(o=16*Math.random()|0),"x"===t[i]?n+=r[o]:"y"===t[i]?(o&=3,n+=r[o|=8]):n+=t[i];return n}},zv.prototype.isGuid=function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},zv);function zv(e){this.cryptoObj=e}var Bv=(Fv.stringToUtf8Arr=function(e){for(var t,r=0,o=e.length,n=0;n<o;n++)r+=(t=e.charCodeAt(n))<128?1:t<2048?2:t<65536?3:t<2097152?4:t<67108864?5:6;for(var i=new Uint8Array(r),s=0,a=0;s<r;a++)(t=e.charCodeAt(a))<128?i[s++]=t:(t<2048?i[s++]=192+(t>>>6):(t<65536?i[s++]=224+(t>>>12):(t<2097152?i[s++]=240+(t>>>18):(t<67108864?i[s++]=248+(t>>>24):(i[s++]=252+(t>>>30),i[s++]=128+(t>>>24&63)),i[s++]=128+(t>>>18&63)),i[s++]=128+(t>>>12&63)),i[s++]=128+(t>>>6&63)),i[s++]=128+(63&t));return i},Fv.stringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),o=0;o<e.length;o++)r[o]=e.charCodeAt(o);return t},Fv.utf8ArrToString=function(e){for(var t,r=Qh.EMPTY_STRING,o=e.length,n=0;n<o;n++)t=e[n],r+=String.fromCharCode(251<t&&t<254&&n+5<o?1073741824*(t-252)+(e[++n]-128<<24)+(e[++n]-128<<18)+(e[++n]-128<<12)+(e[++n]-128<<6)+e[++n]-128:247<t&&t<252&&n+4<o?(t-248<<24)+(e[++n]-128<<18)+(e[++n]-128<<12)+(e[++n]-128<<6)+e[++n]-128:239<t&&t<248&&n+3<o?(t-240<<18)+(e[++n]-128<<12)+(e[++n]-128<<6)+e[++n]-128:223<t&&t<240&&n+2<o?(t-224<<12)+(e[++n]-128<<6)+e[++n]-128:191<t&&t<224&&n+1<o?(t-192<<6)+e[++n]-128:t);return r},Fv.getSortedObjectString=function(e){return JSON.stringify(e,Object.keys(e).sort())},Fv);function Fv(){}var Kv=(Gv.prototype.urlEncode=function(e){return encodeURIComponent(this.encode(e).replace(/=/g,Qh.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_"))},Gv.prototype.urlEncodeArr=function(e){return this.base64EncArr(e).replace(/=/g,Qh.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_")},Gv.prototype.encode=function(e){e=Bv.stringToUtf8Arr(e);return this.base64EncArr(e)},Gv.prototype.base64EncArr=function(e){for(var t,r=(3-e.length%3)%3,o=Qh.EMPTY_STRING,n=e.length,i=0,s=0;s<n;s++)i|=e[s]<<(16>>>(t=s%3)&24),2!=t&&e.length-s!=1||(o+=String.fromCharCode(this.uint6ToB64(i>>>18&63),this.uint6ToB64(i>>>12&63),this.uint6ToB64(i>>>6&63),this.uint6ToB64(63&i)),i=0);return 0==r?o:o.substring(0,o.length-r)+(1==r?"=":"==")},Gv.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:62===e?43:63===e?47:65},Gv);function Gv(){}var Yv=(Zv.prototype.decode=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Invalid base64 string")}e=this.base64DecToArr(t);return Bv.utf8ArrToString(e)},Zv.prototype.base64DecToArr=function(e,t){for(var r,o=e.replace(/[^A-Za-z0-9\+\/]/g,Qh.EMPTY_STRING),n=o.length,i=t?Math.ceil((3*n+1>>>2)/t)*t:3*n+1>>>2,s=new Uint8Array(i),a=void 0,c=0,u=0,l=0;l<n;l++)if(r=3&l,c|=this.b64ToUint6(o.charCodeAt(l))<<18-6*r,3==r||n-l==1){for(a=0;a<3&&u<i;a++,u++)s[u]=c>>>(16>>>a&24)&255;c=0}return s},Zv.prototype.b64ToUint6=function(e){return 64<e&&e<91?e-65:96<e&&e<123?e-71:47<e&&e<58?e+4:43===e?62:47===e?63:0},Zv);function Zv(){}var Wv=(Vv.prototype.generateCodes=function(){return qh(this,void 0,void 0,function(){var t,r;return jh(this,function(e){switch(e.label){case 0:return t=this.generateCodeVerifier(),[4,this.generateCodeChallengeFromVerifier(t)];case 1:return r=e.sent(),[2,{verifier:t,challenge:r}]}})})},Vv.prototype.generateCodeVerifier=function(){try{var e=new Uint8Array(32);return this.cryptoObj.getRandomValues(e),this.base64Encode.urlEncodeArr(e)}catch(e){throw $y.createPkceNotGeneratedError(e)}},Vv.prototype.generateCodeChallengeFromVerifier=function(r){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.cryptoObj.sha256Digest(r)];case 1:return t=e.sent(),[2,this.base64Encode.urlEncodeArr(new Uint8Array(t))];case 2:throw t=e.sent(),$y.createPkceNotGeneratedError(t);case 3:return[2]}})})},Vv);function Vv(e){this.base64Encode=new Kv,this.cryptoObj=e}var Jv=(Qv.prototype.getRandomValues=function(e){return window.crypto.getRandomValues(e)},Qv.prototype.generateKey=function(t,r,o){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,window.crypto.subtle.generateKey(t,r,o)]})})},Qv.prototype.exportKey=function(t){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,window.crypto.subtle.exportKey(dm,t)]})})},Qv.prototype.importKey=function(t,r,o,n){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,window.crypto.subtle.importKey(dm,t,r,o,n)]})})},Qv.prototype.sign=function(t,r,o){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,window.crypto.subtle.sign(t,r,o)]})})},Qv.prototype.digest=function(t,r){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,window.crypto.subtle.digest(t,r)]})})},Qv);function Qv(){}var Xv=($v.prototype.initPrng=function(e){return window.msrCrypto.initPrng(Uh(e))},$v.prototype.getRandomValues=function(e){return window.msrCrypto.getRandomValues(e)},$v.prototype.generateKey=function(t,r,o){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,window.msrCrypto.subtle.generateKey(t,r,o)]})})},$v.prototype.exportKey=function(t){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,window.msrCrypto.subtle.exportKey(dm,t)]})})},$v.prototype.importKey=function(t,r,o,n){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,window.msrCrypto.subtle.importKey(dm,t,r,o,n)]})})},$v.prototype.sign=function(t,r,o){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,window.msrCrypto.subtle.sign(t,r,o)]})})},$v.prototype.digest=function(t,r){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,window.msrCrypto.subtle.digest(t,r)]})})},$v);function $v(){}var e_=(t_.prototype.getRandomValues=function(e){return window.msCrypto.getRandomValues(e)},t_.prototype.generateKey=function(o,n,i){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,new Promise(function(t,r){var e=window.msCrypto.subtle.generateKey(o,n,i);e.addEventListener("complete",function(e){t(e.target.result)}),e.addEventListener("error",function(e){r(e)})})]})})},t_.prototype.exportKey=function(t){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,new Promise(function(r,o){var e=window.msCrypto.subtle.exportKey(dm,t);e.addEventListener("complete",function(e){var t=e.target.result,t=Bv.utf8ArrToString(new Uint8Array(t)).replace(/\r/g,Qh.EMPTY_STRING).replace(/\n/g,Qh.EMPTY_STRING).replace(/\t/g,Qh.EMPTY_STRING).split(" ").join(Qh.EMPTY_STRING).replace("\0",Qh.EMPTY_STRING);try{r(JSON.parse(t))}catch(e){o(e)}}),e.addEventListener("error",function(e){o(e)})})]})})},t_.prototype.importKey=function(r,n,i,s){return qh(this,void 0,void 0,function(){var t,o;return jh(this,function(e){return t=Bv.getSortedObjectString(r),o=Bv.stringToArrayBuffer(t),[2,new Promise(function(t,r){var e=window.msCrypto.subtle.importKey(dm,o,n,i,s);e.addEventListener("complete",function(e){t(e.target.result)}),e.addEventListener("error",function(e){r(e)})})]})})},t_.prototype.sign=function(o,n,i){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,new Promise(function(t,r){var e=window.msCrypto.subtle.sign(o,n,i);e.addEventListener("complete",function(e){t(e.target.result)}),e.addEventListener("error",function(e){r(e)})})]})})},t_.prototype.digest=function(o,n){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,new Promise(function(t,r){var e=window.msCrypto.subtle.digest(o,n.buffer);e.addEventListener("complete",function(e){t(e.target.result)}),e.addEventListener("error",function(e){r(e)})})]})})},t_);function t_(){}var r_="SHA-256",o_=new Uint8Array([1,0,1]),n_=(i_.prototype.hasIECrypto=function(){return"msCrypto"in window},i_.prototype.hasBrowserCrypto=function(){return"crypto"in window},i_.prototype.hasMsrCrypto=function(){return"msrCrypto"in window},i_.prototype.sha256Digest=function(r){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){return t=Bv.stringToUtf8Arr(r),[2,this.subtleCrypto.digest({name:r_},t)]})})},i_.prototype.getRandomValues=function(e){return this.subtleCrypto.getRandomValues(e)},i_.prototype.generateKeyPair=function(t,r){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,this.subtleCrypto.generateKey(this.keygenAlgorithmOptions,t,r)]})})},i_.prototype.exportJwk=function(t){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,this.subtleCrypto.exportKey(t)]})})},i_.prototype.importJwk=function(t,r,o){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,this.subtleCrypto.importKey(t,this.keygenAlgorithmOptions,r,o)]})})},i_.prototype.sign=function(t,r){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,this.subtleCrypto.sign(this.keygenAlgorithmOptions,t,r)]})})},i_);function i_(e,t){var r;if(this.logger=e,this.cryptoOptions=t,this.hasBrowserCrypto())this.logger.verbose("BrowserCrypto: modern crypto interface available"),this.subtleCrypto=new Jv;else if(this.hasIECrypto())this.logger.verbose("BrowserCrypto: MS crypto interface available"),this.subtleCrypto=new e_;else{if(!this.hasMsrCrypto()||null===(r=this.cryptoOptions)||void 0===r||!r.useMsrCrypto)throw this.hasMsrCrypto()&&this.logger.info("BrowserCrypto: MSR Crypto interface available but system.cryptoOptions.useMsrCrypto not enabled"),this.logger.error("BrowserCrypto: No crypto interfaces available."),$y.createCryptoNotAvailableError("Browser crypto, msCrypto, or msrCrypto interfaces not available.");this.logger.verbose("BrowserCrypto: MSR crypto interface available"),this.subtleCrypto=new Xv}if(this.subtleCrypto.initPrng){if(this.logger.verbose("BrowserCrypto: Interface requires entropy"),null===(r=this.cryptoOptions)||void 0===r||!r.entropy)throw this.logger.error("BrowserCrypto: Interface requires entropy but none provided."),Sm.createEntropyNotProvided();this.logger.verbose("BrowserCrypto: Entropy provided"),this.subtleCrypto.initPrng(this.cryptoOptions.entropy)}this.keygenAlgorithmOptions={name:"RSASSA-PKCS1-v1_5",hash:r_,modulusLength:2048,publicExponent:o_}}var s_=(a_.prototype.open=function(){return qh(this,void 0,void 0,function(){var o=this;return jh(this,function(e){return[2,new Promise(function(t,e){var r=window.indexedDB.open(o.dbName,o.version);r.addEventListener("upgradeneeded",function(e){e.target.result.createObjectStore(o.tableName)}),r.addEventListener("success",function(e){o.db=e.target.result,o.dbOpen=!0,t()}),r.addEventListener("error",function(){return e($y.createDatabaseUnavailableError())})})]})})},a_.prototype.closeConnection=function(){var e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)},a_.prototype.validateDbIsOpen=function(){return qh(this,void 0,void 0,function(){return jh(this,function(e){switch(e.label){case 0:return this.dbOpen?[3,2]:[4,this.open()];case 1:return[2,e.sent()];case 2:return[2]}})})},a_.prototype.getItem=function(n){return qh(this,void 0,void 0,function(){var o=this;return jh(this,function(e){switch(e.label){case 0:return[4,this.validateDbIsOpen()];case 1:return e.sent(),[2,new Promise(function(t,r){if(!o.db)return r($y.createDatabaseNotOpenError());var e=o.db.transaction([o.tableName],"readonly").objectStore(o.tableName).get(n);e.addEventListener("success",function(e){o.closeConnection(),t(e.target.result)}),e.addEventListener("error",function(e){o.closeConnection(),r(e)})})]}})})},a_.prototype.setItem=function(n,i){return qh(this,void 0,void 0,function(){var o=this;return jh(this,function(e){switch(e.label){case 0:return[4,this.validateDbIsOpen()];case 1:return e.sent(),[2,new Promise(function(e,t){if(!o.db)return t($y.createDatabaseNotOpenError());var r=o.db.transaction([o.tableName],"readwrite").objectStore(o.tableName).put(i,n);r.addEventListener("success",function(){o.closeConnection(),e()}),r.addEventListener("error",function(e){o.closeConnection(),t(e)})})]}})})},a_.prototype.removeItem=function(n){return qh(this,void 0,void 0,function(){var o=this;return jh(this,function(e){switch(e.label){case 0:return[4,this.validateDbIsOpen()];case 1:return e.sent(),[2,new Promise(function(e,t){if(!o.db)return t($y.createDatabaseNotOpenError());var r=o.db.transaction([o.tableName],"readwrite").objectStore(o.tableName).delete(n);r.addEventListener("success",function(){o.closeConnection(),e()}),r.addEventListener("error",function(e){o.closeConnection(),t(e)})})]}})})},a_.prototype.getKeys=function(){return qh(this,void 0,void 0,function(){var o=this;return jh(this,function(e){switch(e.label){case 0:return[4,this.validateDbIsOpen()];case 1:return e.sent(),[2,new Promise(function(t,r){if(!o.db)return r($y.createDatabaseNotOpenError());var e=o.db.transaction([o.tableName],"readonly").objectStore(o.tableName).getAllKeys();e.addEventListener("success",function(e){o.closeConnection(),t(e.target.result)}),e.addEventListener("error",function(e){o.closeConnection(),r(e)})})]}})})},a_.prototype.containsKey=function(n){return qh(this,void 0,void 0,function(){var o=this;return jh(this,function(e){switch(e.label){case 0:return[4,this.validateDbIsOpen()];case 1:return e.sent(),[2,new Promise(function(t,r){if(!o.db)return r($y.createDatabaseNotOpenError());var e=o.db.transaction([o.tableName],"readonly").objectStore(o.tableName).count(n);e.addEventListener("success",function(e){o.closeConnection(),t(1===e.target.result)}),e.addEventListener("error",function(e){o.closeConnection(),r(e)})})]}})})},a_.prototype.deleteDatabase=function(){return qh(this,void 0,void 0,function(){return jh(this,function(e){return this.db&&this.dbOpen&&this.closeConnection(),[2,new Promise(function(e,t){var r=window.indexedDB.deleteDatabase(gm);r.addEventListener("success",function(){return e(!0)}),r.addEventListener("blocked",function(){return e(!0)}),r.addEventListener("error",function(){return t(!1)})})]})})},a_);function a_(){this.dbName=gm,this.version=1,this.tableName="msal.db.keys",this.dbOpen=!1}var c_,u_=(l_.prototype.handleDatabaseAccessError=function(e){if(!(e instanceof $y&&e.errorCode===Yy.code))throw e;this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.")},l_.prototype.getItem=function(o){return qh(this,void 0,void 0,function(){var t,r;return jh(this,function(e){switch(e.label){case 0:if(t=this.inMemoryCache.getItem(o))return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.getItem(o)];case 2:return[2,e.sent()];case 3:return r=e.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,t]}})})},l_.prototype.setItem=function(r,o){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){switch(e.label){case 0:this.inMemoryCache.setItem(r,o),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.indexedDBCache.setItem(r,o)];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2]}})})},l_.prototype.removeItem=function(r){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){switch(e.label){case 0:this.inMemoryCache.removeItem(r),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.indexedDBCache.removeItem(r)];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2]}})})},l_.prototype.getKeys=function(){return qh(this,void 0,void 0,function(){var t,r;return jh(this,function(e){switch(e.label){case 0:if(0!==(t=this.inMemoryCache.getKeys()).length)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),this.logger.verbose("In-memory cache is empty, now querying persistent storage."),[4,this.indexedDBCache.getKeys()];case 2:return[2,e.sent()];case 3:return r=e.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,t]}})})},l_.prototype.containsKey=function(o){return qh(this,void 0,void 0,function(){var t,r;return jh(this,function(e){switch(e.label){case 0:if(t=this.inMemoryCache.containsKey(o))return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.containsKey(o)];case 2:return[2,e.sent()];case 3:return r=e.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,t]}})})},l_.prototype.clearInMemory=function(){this.logger.verbose("Deleting in-memory keystore "+this.storeName),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore "+this.storeName+" deleted")},l_.prototype.clearPersistent=function(){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this.logger.verbose("Deleting persistent keystore"),[4,this.indexedDBCache.deleteDatabase()];case 1:return(t=e.sent())&&this.logger.verbose("Persistent keystore deleted"),[2,t];case 2:return t=e.sent(),this.handleDatabaseAccessError(t),[2,!1];case 3:return[2]}})})},l_);function l_(e,t){this.inMemoryCache=new km,this.indexedDBCache=new s_,this.logger=e,this.storeName=t}(Fm=c_=c_||{}).asymmetricKeys="asymmetricKeys",Fm.symmetricKeys="symmetricKeys";var h_=(p_.prototype.clear=function(){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){switch(e.label){case 0:this.asymmetricKeys.clearInMemory(),this.symmetricKeys.clearInMemory(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.asymmetricKeys.clearPersistent()];case 2:return e.sent(),[2,!0];case 3:return(t=e.sent())instanceof Error?this.logger.error("Clearing keystore failed with error: "+t.message):this.logger.error("Clearing keystore failed with unknown error"),[2,!1];case 4:return[2]}})})},p_);function p_(e){this.logger=e,this.asymmetricKeys=new u_(this.logger,c_.asymmetricKeys),this.symmetricKeys=new u_(this.logger,c_.symmetricKeys)}var d_=(f_.prototype.createNewGuid=function(){return this.guidGenerator.generateGuid()},f_.prototype.base64Encode=function(e){return this.b64Encode.encode(e)},f_.prototype.base64Decode=function(e){return this.b64Decode.decode(e)},f_.prototype.generatePkceCodes=function(){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,this.pkceGenerator.generateCodes()]})})},f_.prototype.getPublicKeyThumbprint=function(s){var a;return qh(this,void 0,void 0,function(){var t,r,o,n,i;return jh(this,function(e){switch(e.label){case 0:return t=null===(a=this.performanceClient)||void 0===a?void 0:a.startMeasurement(bg.CryptoOptsGetPublicKeyThumbprint,s.correlationId),[4,this.browserCrypto.generateKeyPair(f_.EXTRACTABLE,f_.POP_KEY_USAGES)];case 1:return r=e.sent(),[4,this.browserCrypto.exportJwk(r.publicKey)];case 2:return o=e.sent(),o={e:o.e,kty:o.kty,n:o.n},o=Bv.getSortedObjectString(o),[4,this.hashString(o)];case 3:return n=e.sent(),[4,this.browserCrypto.exportJwk(r.privateKey)];case 4:return i=e.sent(),[4,this.browserCrypto.importJwk(i,!1,["sign"])];case 5:return i=e.sent(),[4,this.cache.asymmetricKeys.setItem(n,{privateKey:i,publicKey:r.publicKey,requestMethod:s.resourceRequestMethod,requestUri:s.resourceRequestUri})];case 6:return e.sent(),t&&t.endMeasurement({success:!0}),[2,n]}})})},f_.prototype.removeTokenBindingKey=function(t){return qh(this,void 0,void 0,function(){return jh(this,function(e){switch(e.label){case 0:return[4,this.cache.asymmetricKeys.removeItem(t)];case 1:return e.sent(),[4,this.cache.asymmetricKeys.containsKey(t)];case 2:return[2,!e.sent()]}})})},f_.prototype.clearKeystore=function(){return qh(this,void 0,void 0,function(){return jh(this,function(e){switch(e.label){case 0:return[4,this.cache.clear()];case 1:return[2,e.sent()]}})})},f_.prototype.signJwt=function(s,a,c){var u;return qh(this,void 0,void 0,function(){var t,r,o,n,i;return jh(this,function(e){switch(e.label){case 0:return t=null===(u=this.performanceClient)||void 0===u?void 0:u.startMeasurement(bg.CryptoOptsSignJwt,c),[4,this.cache.asymmetricKeys.getItem(a)];case 1:if(!(r=e.sent()))throw $y.createSigningKeyNotFoundInStorageError(a);return[4,this.browserCrypto.exportJwk(r.publicKey)];case 2:return n=e.sent(),i=Bv.getSortedObjectString(n),o=this.b64Encode.urlEncode(JSON.stringify({kid:a})),n=Xg.getShrHeaderString({kid:o,alg:n.alg}),n=this.b64Encode.urlEncode(n),s.cnf={jwk:JSON.parse(i)},i=this.b64Encode.urlEncode(JSON.stringify(s)),n=n+"."+i,i=Bv.stringToArrayBuffer(n),[4,this.browserCrypto.sign(r.privateKey,i)];case 3:return i=e.sent(),i=this.b64Encode.urlEncodeArr(new Uint8Array(i)),i=n+"."+i,t&&t.endMeasurement({success:!0}),[2,i]}})})},f_.prototype.hashString=function(r){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){switch(e.label){case 0:return[4,this.browserCrypto.sha256Digest(r)];case 1:return t=e.sent(),t=new Uint8Array(t),[2,this.b64Encode.urlEncodeArr(t)]}})})},f_.POP_KEY_USAGES=["sign","verify"],f_.EXTRACTABLE=!0,f_);function f_(e,t,r){this.logger=e,this.browserCrypto=new n_(this.logger,r),this.b64Encode=new Kv,this.b64Decode=new Yv,this.guidGenerator=new Hv(this.browserCrypto),this.pkceGenerator=new Wv(this.browserCrypto),this.cache=new h_(this.logger),this.performanceClient=t}var g_=(y_.prototype.loadExternalTokens=function(e,t,r){if(this.logger.info("TokenCache - loadExternalTokens called"),!t.id_token)throw $y.createUnableToLoadTokenError("Please ensure server response includes id token.");var o=new ff(t.id_token,this.cryptoObj);if(e.account)var n=this.loadAccount(o,e.account.environment,void 0,void 0,e.account.homeAccountId),i=new sg(n,this.loadIdToken(o,n.homeAccountId,e.account.environment,e.account.tenantId),this.loadAccessToken(e,t,n.homeAccountId,e.account.environment,e.account.tenantId,r),this.loadRefreshToken(e,t,n.homeAccountId,e.account.environment));else{if(!e.authority)throw $y.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");var s=jg.generateAuthority(e.authority,e.azureCloudOptions),a={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=new jg(s,this.config.system.networkClient,this.storage,a,this.logger);if(r.clientInfo){this.logger.trace("TokenCache - homeAccountId from options");n=this.loadAccount(o,a.hostnameAndPort,r.clientInfo,a.authorityType);i=new sg(n,this.loadIdToken(o,n.homeAccountId,a.hostnameAndPort,a.tenant),this.loadAccessToken(e,t,n.homeAccountId,a.hostnameAndPort,a.tenant,r),this.loadRefreshToken(e,t,n.homeAccountId,a.hostnameAndPort))}else{if(!t.client_info)throw $y.createUnableToLoadTokenError("Please provide clientInfo in the response or options.");this.logger.trace("TokenCache - homeAccountId from response");n=this.loadAccount(o,a.hostnameAndPort,t.client_info,a.authorityType);i=new sg(n,this.loadIdToken(o,n.homeAccountId,a.hostnameAndPort,a.tenant),this.loadAccessToken(e,t,n.homeAccountId,a.hostnameAndPort,a.tenant,r),this.loadRefreshToken(e,t,n.homeAccountId,a.hostnameAndPort))}}return this.generateAuthenticationResult(e,o,i,a)},y_.prototype.loadAccount=function(e,t,r,o,n){var i;if(n?i=n:void 0!==o&&r&&(i=pf.generateHomeAccountId(r,o,this.logger,this.cryptoObj,e)),!i)throw $y.createUnableToLoadTokenError("Unexpected missing homeAccountId");t=r?pf.createAccount(r,i,e,void 0,void 0,void 0,t):pf.createGenericAccount(i,e,void 0,void 0,void 0,t);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading account"),this.storage.setAccount(t),t;throw $y.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},y_.prototype.loadIdToken=function(e,t,r,o){o=Ff.createIdTokenEntity(t,r,e.rawToken,this.config.auth.clientId,o);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading id token"),this.storage.setIdTokenCredential(o),o;throw $y.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},y_.prototype.loadAccessToken=function(e,t,r,o,n,i){if(!t.access_token)return this.logger.verbose("TokenCache - No access token provided for caching"),null;if(!t.expires_in)throw $y.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");if(!i.extendedExpiresOn)throw $y.createUnableToLoadTokenError("Please provide an extendedExpiresOn value in the options.");var s=new cf(e.scopes).printScopes(),e=i.expiresOn||t.expires_in+(new Date).getTime()/1e3,i=i.extendedExpiresOn,i=Wf.createAccessTokenEntity(r,o,t.access_token,this.config.auth.clientId,n,s,e,i,this.cryptoObj);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(i),i;throw $y.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},y_.prototype.loadRefreshToken=function(e,t,r,o){if(!t.refresh_token)return this.logger.verbose("TokenCache - No refresh token provided for caching"),null;t=Qf.createRefreshTokenEntity(r,o,t.refresh_token,this.config.auth.clientId);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading refresh token"),this.storage.setRefreshTokenCredential(t),t;throw $y.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},y_.prototype.generateAuthenticationResult=function(e,t,r,o){var n,i=Qh.EMPTY_STRING,s=[],a=null;null!=r&&r.accessToken&&(i=r.accessToken.secret,s=cf.fromString(r.accessToken.target).asArray(),a=new Date(1e3*Number(r.accessToken.expiresOn)),n=new Date(1e3*Number(r.accessToken.extendedExpiresOn)));var c=(null==t?void 0:t.claims.oid)||(null==t?void 0:t.claims.sub)||Qh.EMPTY_STRING,u=(null==t?void 0:t.claims.tid)||Qh.EMPTY_STRING;return{authority:o?o.canonicalAuthority:Qh.EMPTY_STRING,uniqueId:c,tenantId:u,scopes:s,account:null!=r&&r.account?r.account.getAccountInfo():null,idToken:t?t.rawToken:Qh.EMPTY_STRING,idTokenClaims:t?t.claims:{},accessToken:i,fromCache:!0,expiresOn:a,correlationId:e.correlationId||Qh.EMPTY_STRING,requestId:Qh.EMPTY_STRING,extExpiresOn:n,familyId:Qh.EMPTY_STRING,tokenType:(null===(n=null==r?void 0:r.accessToken)||void 0===n?void 0:n.tokenType)||Qh.EMPTY_STRING,state:Qh.EMPTY_STRING,cloudGraphHostName:(null===(n=null==r?void 0:r.account)||void 0===n?void 0:n.cloudGraphHostName)||Qh.EMPTY_STRING,msGraphHost:(null===(r=null==r?void 0:r.account)||void 0===r?void 0:r.msGraphHost)||Qh.EMPTY_STRING,code:void 0,fromNativeBroker:!1}},y_);function y_(e,t,r,o){this.isBrowserEnvironment="undefined"!=typeof window,this.config=e,this.storage=t,this.logger=r,this.cryptoObj=o}var m_,v_=(Nh(__,m_=Eg),__);function __(e){e=m_.call(this,e)||this;return e.includeRedirectUri=!1,e}var w_,b_=(Nh(C_,w_=Ym),C_.prototype.acquireToken=function(i){return qh(this,void 0,void 0,function(){var t,r,o,n;return jh(this,function(e){switch(e.label){case 0:if(this.logger.trace("SilentAuthCodeClient.acquireToken called"),!i.code)throw $y.createAuthCodeRequiredError();return[4,this.initializeAuthorizationRequest(i,am.Silent)];case 1:t=e.sent(),this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||Qh.EMPTY_STRING,t.account||null),r=this.initializeServerTelemetryManager(this.apiId),e.label=2;case 2:return e.trys.push([2,4,,5]),o=Lh(Lh({},t),{code:i.code}),[4,this.getClientConfiguration(r,t.authority)];case 3:return n=e.sent(),n=new v_(n),this.logger.verbose("Auth code client created"),[2,new kv(n,this.browserStorage,o,this.logger,this.config.system).handleCodeResponseFromServer({code:i.code,msgraph_host:i.msGraphHost,cloud_graph_host_name:i.cloudGraphHostName,cloud_instance_host_name:i.cloudInstanceHostName},t.state,n.authority,this.networkClient,!1)];case 4:throw(n=e.sent())instanceof xp&&n.setCorrelationId(this.correlationId),r.cacheFailedRequest(n),this.browserStorage.cleanRequestByState(t.state),n;case 5:return[2]}})})},C_.prototype.logout=function(){return Promise.reject($y.createSilentLogoutUnsupportedError())},C_);function C_(e,t,r,o,n,i,s,a,c,u){u=w_.call(this,e,t,r,o,n,i,a,c,u)||this;return u.apiId=s,u}var E_=(S_.supportsBrowserPerformance=function(){return"undefined"!=typeof window&&void 0!==window.performance&&"function"==typeof window.performance.mark&&"function"==typeof window.performance.measure&&"function"==typeof window.performance.clearMarks&&"function"==typeof window.performance.clearMeasures&&"function"==typeof window.performance.getEntriesByName},S_.prototype.startMeasurement=function(){if(S_.supportsBrowserPerformance())try{window.performance.mark(this.startMark)}catch(e){}},S_.prototype.endMeasurement=function(){if(S_.supportsBrowserPerformance())try{window.performance.mark(this.endMark),window.performance.measure(this.measureName,this.startMark,this.endMark)}catch(e){}},S_.prototype.flushMeasurement=function(){if(S_.supportsBrowserPerformance())try{var e=window.performance.getEntriesByName(this.measureName,"measure");if(0<e.length){var t=e[0].duration;return window.performance.clearMeasures(this.measureName),window.performance.clearMarks(this.startMark),window.performance.clearMarks(this.endMark),t}}catch(e){}return null},S_);function S_(e,t){this.correlationId=t,this.measureName="msal.measure."+e+"."+this.correlationId,this.startMark="msal.start."+e+"."+this.correlationId,this.endMark="msal.end."+e+"."+this.correlationId}var T_,I_=(Nh(A_,T_=w),A_.prototype.startPerformanceMeasuremeant=function(e,t){return new E_(e,t)},A_.prototype.generateId=function(){return this.guidGenerator.generateGuid()},A_.prototype.getPageVisibility=function(){var e;return(null===(e=document.visibilityState)||void 0===e?void 0:e.toString())||null},A_.prototype.startMeasurement=function(e,t){var r=this,o=this.getPageVisibility(),n=T_.prototype.startMeasurement.call(this,e,t);return Lh(Lh({},n),{endMeasurement:function(e){return n.endMeasurement(Lh({startPageVisibility:o,endPageVisibility:r.getPageVisibility()},e))}})},A_);function A_(e,t,r,o,n,i,s){i=T_.call(this,e,t,r,o,n,i)||this;return i.browserCrypto=new n_(i.logger,s),i.guidGenerator=new Hv(i.browserCrypto),i}k_.prototype.initialize=function(){return qh(this,void 0,void 0,function(){var t,r;return jh(this,function(e){switch(e.label){case 0:if(this.logger.trace("initialize called"),this.initialized)return this.logger.info("initialize has already been called, exiting early."),[2];if(this.eventHandler.emitEvent(Qm.INITIALIZE_START),!this.config.system.allowNativeBroker)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),t=this,[4,dv.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout)];case 2:return t.nativeExtensionProvider=e.sent(),[3,4];case 3:return r=e.sent(),this.logger.verbose(r),[3,4];case 4:return this.initialized=!0,this.eventHandler.emitEvent(Qm.INITIALIZE_END),[2]}})})},k_.prototype.handleRedirectPromise=function(a){return qh(this,void 0,void 0,function(){var t,r,o,n,i,s=this;return jh(this,function(e){return this.logger.verbose("handleRedirectPromise called"),zm.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),t=this.getAllAccounts(),this.isBrowserEnvironment?(r=a||Qh.EMPTY_STRING,void 0===(o=this.redirectResponse.get(r))?(this.eventHandler.emitEvent(Qm.HANDLE_REDIRECT_START,am.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise"),i=this.browserStorage.getCachedNativeRequest(),n=void 0,n=i&&dv.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!a?(this.logger.trace("handleRedirectPromise - acquiring token from native platform"),new hv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,sm.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,i.accountId,this.nativeInternalStorage,i.correlationId).handleRedirectPromise()):(this.logger.trace("handleRedirectPromise - acquiring token from web flow"),i=this.browserStorage.getTemporaryCache(nm.CORRELATION_ID,!0)||Qh.EMPTY_STRING,this.createRedirectClient(i).handleRedirectPromise(a)),o=n.then(function(e){return e&&(t.length<s.getAllAccounts().length?(s.eventHandler.emitEvent(Qm.LOGIN_SUCCESS,am.Redirect,e),s.logger.verbose("handleRedirectResponse returned result, login success")):(s.eventHandler.emitEvent(Qm.ACQUIRE_TOKEN_SUCCESS,am.Redirect,e),s.logger.verbose("handleRedirectResponse returned result, acquire token success"))),s.eventHandler.emitEvent(Qm.HANDLE_REDIRECT_END,am.Redirect),e}).catch(function(e){throw 0<t.length?s.eventHandler.emitEvent(Qm.ACQUIRE_TOKEN_FAILURE,am.Redirect,null,e):s.eventHandler.emitEvent(Qm.LOGIN_FAILURE,am.Redirect,null,e),s.eventHandler.emitEvent(Qm.HANDLE_REDIRECT_END,am.Redirect),e}),this.redirectResponse.set(r,o)):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),[2,o]):(this.logger.verbose("handleRedirectPromise returns null, not browser environment"),[2,null])})})},k_.prototype.acquireTokenRedirect=function(n){return qh(this,void 0,void 0,function(){var t,r,o=this;return jh(this,function(e){return t=this.getRequestCorrelationId(n),this.logger.verbose("acquireTokenRedirect called",t),this.preflightBrowserEnvironmentCheck(am.Redirect),(r=0<this.getAllAccounts().length)?this.eventHandler.emitEvent(Qm.ACQUIRE_TOKEN_START,am.Redirect,n):this.eventHandler.emitEvent(Qm.LOGIN_START,am.Redirect,n),[2,(this.nativeExtensionProvider&&this.canUseNative(n)?new hv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,sm.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(n),this.nativeInternalStorage,n.correlationId).acquireTokenRedirect(n).catch(function(e){if(e instanceof iv&&e.isFatal())return o.nativeExtensionProvider=void 0,o.createRedirectClient(n.correlationId).acquireToken(n);if(e instanceof ng)return o.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),o.createRedirectClient(n.correlationId).acquireToken(n);throw o.browserStorage.setInteractionInProgress(!1),e}):this.createRedirectClient(n.correlationId).acquireToken(n)).catch(function(e){throw r?o.eventHandler.emitEvent(Qm.ACQUIRE_TOKEN_FAILURE,am.Redirect,null,e):o.eventHandler.emitEvent(Qm.LOGIN_FAILURE,am.Redirect,null,e),e})]})})},k_.prototype.acquireTokenPopup=function(t){var r=this,e=this.getRequestCorrelationId(t),o=this.performanceClient.startMeasurement(bg.AcquireTokenPopup,e);try{this.logger.verbose("acquireTokenPopup called",e),this.preflightBrowserEnvironmentCheck(am.Popup)}catch(e){return Promise.reject(e)}var n=this.getAllAccounts();return 0<n.length?this.eventHandler.emitEvent(Qm.ACQUIRE_TOKEN_START,am.Popup,t):this.eventHandler.emitEvent(Qm.LOGIN_START,am.Popup,t),(this.canUseNative(t)?this.acquireTokenNative(t,sm.acquireTokenPopup).then(function(e){return r.browserStorage.setInteractionInProgress(!1),o.endMeasurement({success:!0,isNativeBroker:!0,requestId:e.requestId}),o.flushMeasurement(),e}).catch(function(e){if(e instanceof iv&&e.isFatal())return r.nativeExtensionProvider=void 0,r.createPopupClient(t.correlationId).acquireToken(t);if(e instanceof ng)return r.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),r.createPopupClient(t.correlationId).acquireToken(t);throw r.browserStorage.setInteractionInProgress(!1),e}):this.createPopupClient(t.correlationId).acquireToken(t)).then(function(e){return n.length<r.getAllAccounts().length?r.eventHandler.emitEvent(Qm.LOGIN_SUCCESS,am.Popup,e):r.eventHandler.emitEvent(Qm.ACQUIRE_TOKEN_SUCCESS,am.Popup,e),o.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),o.endMeasurement({success:!0,requestId:e.requestId}),o.flushMeasurement(),e}).catch(function(e){return 0<n.length?r.eventHandler.emitEvent(Qm.ACQUIRE_TOKEN_FAILURE,am.Popup,null,e):r.eventHandler.emitEvent(Qm.LOGIN_FAILURE,am.Popup,null,e),o.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),o.flushMeasurement(),Promise.reject(e)})},k_.prototype.ssoSilent=function(i){return qh(this,void 0,void 0,function(){var t,r,o,n=this;return jh(this,function(e){return t=this.getRequestCorrelationId(i),r=Lh(Lh({},i),{prompt:i.prompt,correlationId:t}),this.preflightBrowserEnvironmentCheck(am.Silent),o=this.performanceClient.startMeasurement(bg.SsoSilent,t),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(Qm.SSO_SILENT_START,am.Silent,r),[2,(this.canUseNative(r)?this.acquireTokenNative(r,sm.ssoSilent).catch(function(e){if(e instanceof iv&&e.isFatal())return n.nativeExtensionProvider=void 0,n.createSilentIframeClient(r.correlationId).acquireToken(r);throw e}):this.createSilentIframeClient(r.correlationId).acquireToken(r)).then(function(e){return n.eventHandler.emitEvent(Qm.SSO_SILENT_SUCCESS,am.Silent,e),o.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),o.endMeasurement({success:!0,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),o.flushMeasurement(),e}).catch(function(e){throw n.eventHandler.emitEvent(Qm.SSO_SILENT_FAILURE,am.Silent,null,e),o.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),o.flushMeasurement(),e})]})})},k_.prototype.acquireTokenByCode=function(s){return qh(this,void 0,void 0,function(){var t,r,o,n,i=this;return jh(this,function(e){t=this.getRequestCorrelationId(s),this.preflightBrowserEnvironmentCheck(am.Silent),this.logger.trace("acquireTokenByCode called",t),this.eventHandler.emitEvent(Qm.ACQUIRE_TOKEN_BY_CODE_START,am.Silent,s),r=this.performanceClient.startMeasurement(bg.AcquireTokenByCode,s.correlationId);try{if(s.code)return o=s.code,(n=this.hybridAuthCodeResponses.get(o))?(this.logger.verbose("Existing acquireTokenByCode request found",s.correlationId),r.endMeasurement({success:!0}),r.discardMeasurement()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),n=this.acquireTokenByCodeAsync(Lh(Lh({},s),{correlationId:t})).then(function(e){return i.eventHandler.emitEvent(Qm.ACQUIRE_TOKEN_BY_CODE_SUCCESS,am.Silent,e),i.hybridAuthCodeResponses.delete(o),r.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),r.endMeasurement({success:!0,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),r.flushMeasurement(),e}).catch(function(e){throw i.hybridAuthCodeResponses.delete(o),i.eventHandler.emitEvent(Qm.ACQUIRE_TOKEN_BY_CODE_FAILURE,am.Silent,null,e),r.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),r.flushMeasurement(),e}),this.hybridAuthCodeResponses.set(o,n)),[2,n];if(s.nativeAccountId){if(this.canUseNative(s,s.nativeAccountId))return[2,this.acquireTokenNative(s,sm.acquireTokenByCode,s.nativeAccountId).catch(function(e){throw e instanceof iv&&e.isFatal()&&(i.nativeExtensionProvider=void 0),e})];throw $y.createUnableToAcquireTokenFromNativePlatformError()}throw $y.createAuthCodeOrNativeAccountIdRequiredError()}catch(e){throw this.eventHandler.emitEvent(Qm.ACQUIRE_TOKEN_BY_CODE_FAILURE,am.Silent,null,e),r.endMeasurement({errorCode:e instanceof xp&&e.errorCode||void 0,subErrorCode:e instanceof xp&&e.subError||void 0,success:!1}),e}return[2]})})},k_.prototype.acquireTokenByCodeAsync=function(t){return qh(this,void 0,void 0,function(){return jh(this,function(e){switch(e.label){case 0:return this.logger.trace("acquireTokenByCodeAsync called",t.correlationId),[4,this.createSilentAuthCodeClient(t.correlationId).acquireToken(t)];case 1:return[2,e.sent()]}})})},k_.prototype.acquireTokenFromCache=function(t,r,o){return qh(this,void 0,void 0,function(){return jh(this,function(e){switch(o.cacheLookupPolicy){case fm.Default:case fm.AccessToken:case fm.AccessTokenAndRefreshToken:return[2,t.acquireToken(r)];default:throw Td.createRefreshRequiredError()}return[2]})})},k_.prototype.acquireTokenByRefreshToken=function(t,r){return qh(this,void 0,void 0,function(){return jh(this,function(e){switch(r.cacheLookupPolicy){case fm.Default:case fm.AccessTokenAndRefreshToken:case fm.RefreshToken:case fm.RefreshTokenAndNetwork:return[2,this.createSilentRefreshClient(t.correlationId).acquireToken(t)];default:throw Td.createRefreshRequiredError()}return[2]})})},k_.prototype.acquireTokenBySilentIframe=function(t){return qh(this,void 0,void 0,function(){return jh(this,function(e){return[2,this.createSilentIframeClient(t.correlationId).acquireToken(t)]})})},k_.prototype.logout=function(r){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){return t=this.getRequestCorrelationId(r),this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),[2,this.logoutRedirect(Lh({correlationId:t},r))]})})},k_.prototype.logoutRedirect=function(r){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){return t=this.getRequestCorrelationId(r),this.preflightBrowserEnvironmentCheck(am.Redirect),[2,this.createRedirectClient(t).logout(r)]})})},k_.prototype.logoutPopup=function(e){try{var t=this.getRequestCorrelationId(e);return this.preflightBrowserEnvironmentCheck(am.Popup),this.createPopupClient(t).logout(e)}catch(e){return Promise.reject(e)}},k_.prototype.getAllAccounts=function(){return this.logger.verbose("getAllAccounts called"),this.isBrowserEnvironment?this.browserStorage.getAllAccounts():[]},k_.prototype.getAccountByUsername=function(t){var e=this.getAllAccounts();return!kd.isEmpty(t)&&e&&e.length?(this.logger.verbose("Account matching username found, returning"),this.logger.verbosePii("Returning signed-in accounts matching username: "+t),e.filter(function(e){return e.username.toLowerCase()===t.toLowerCase()})[0]||null):(this.logger.verbose("getAccountByUsername: No matching account found, returning null"),null)},k_.prototype.getAccountByHomeId=function(t){var e=this.getAllAccounts();return!kd.isEmpty(t)&&e&&e.length?(this.logger.verbose("Account matching homeAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching homeAccountId: "+t),e.filter(function(e){return e.homeAccountId===t})[0]||null):(this.logger.verbose("getAccountByHomeId: No matching account found, returning null"),null)},k_.prototype.getAccountByLocalId=function(t){var e=this.getAllAccounts();return!kd.isEmpty(t)&&e&&e.length?(this.logger.verbose("Account matching localAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching localAccountId: "+t),e.filter(function(e){return e.localAccountId===t})[0]||null):(this.logger.verbose("getAccountByLocalId: No matching account found, returning null"),null)},k_.prototype.setActiveAccount=function(e){this.browserStorage.setActiveAccount(e)},k_.prototype.getActiveAccount=function(){return this.browserStorage.getActiveAccount()},k_.prototype.preflightBrowserEnvironmentCheck=function(e,t){if(void 0===t&&(t=!0),this.logger.verbose("preflightBrowserEnvironmentCheck started"),zm.blockNonBrowserEnvironment(this.isBrowserEnvironment),zm.blockRedirectInIframe(e,this.config.system.allowRedirectInIframe),zm.blockReloadInHiddenIframes(),zm.blockAcquireTokenInPopups(),zm.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),e===am.Redirect&&this.config.cache.cacheLocation===rm.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw Sm.createInMemoryRedirectUnavailableError();e!==am.Redirect&&e!==am.Popup||this.preflightInteractiveRequest(t)},k_.prototype.preflightInteractiveRequest=function(e){this.logger.verbose("preflightInteractiveRequest called, validating app environment"),zm.blockReloadInHiddenIframes(),e&&this.browserStorage.setInteractionInProgress(!0)},k_.prototype.acquireTokenNative=function(t,r,o){return qh(this,void 0,void 0,function(){return jh(this,function(e){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw $y.createNativeConnectionNotEstablishedError();return[2,new hv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,r,this.performanceClient,this.nativeExtensionProvider,o||this.getNativeAccountId(t),this.nativeInternalStorage,t.correlationId).acquireToken(t)]})})},k_.prototype.canUseNative=function(e,t){if(this.logger.trace("canUseNative called"),!dv.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case tp.NONE:case tp.CONSENT:case tp.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace("canUseNative: prompt = "+e.prompt+" is not compatible with native flow, returning false"),!1}return!(!t&&!this.getNativeAccountId(e))||(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1)},k_.prototype.getNativeAccountId=function(e){e=e.account||this.browserStorage.getAccountInfoByHints(e.loginHint,e.sid)||this.getActiveAccount();return e&&e.nativeAccountId||""},k_.prototype.createPopupClient=function(e){return new _v(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},k_.prototype.createRedirectClient=function(e){return new yv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},k_.prototype.createSilentIframeClient=function(e){return new xv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,sm.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},k_.prototype.createSilentCacheClient=function(e){return new cv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},k_.prototype.createSilentRefreshClient=function(e){return new Nv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},k_.prototype.createSilentAuthCodeClient=function(e){return new b_(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,sm.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)},k_.prototype.addEventCallback=function(e){return this.eventHandler.addEventCallback(e)},k_.prototype.removeEventCallback=function(e){this.eventHandler.removeEventCallback(e)},k_.prototype.addPerformanceCallback=function(e){return this.performanceClient.addPerformanceCallback(e)},k_.prototype.removePerformanceCallback=function(e){return this.performanceClient.removePerformanceCallback(e)},k_.prototype.enableAccountStorageEvents=function(){this.eventHandler.enableAccountStorageEvents()},k_.prototype.disableAccountStorageEvents=function(){this.eventHandler.disableAccountStorageEvents()},k_.prototype.getTokenCache=function(){return this.tokenCache},k_.prototype.getLogger=function(){return this.logger},k_.prototype.setLogger=function(e){this.logger=e},k_.prototype.initializeWrapperLibrary=function(e,t){this.browserStorage.setWrapperMetadata(e,t)},k_.prototype.setNavigationClient=function(e){this.navigationClient=e},k_.prototype.getConfiguration=function(){return this.config},k_.prototype.getRequestCorrelationId=function(e){return null!=e&&e.correlationId?e.correlationId:this.isBrowserEnvironment?this.browserCrypto.createNewGuid():Qh.EMPTY_STRING},w=k_;function k_(e){var t,r,o,n,i,s,a;this.isBrowserEnvironment="undefined"!=typeof window,this.config=(t=e,s=this.isBrowserEnvironment,r=t.auth,o=t.cache,n=t.system,a=t.telemetry,i={clientId:Qh.EMPTY_STRING,authority:""+Qh.DEFAULT_AUTHORITY,knownAuthorities:[],cloudDiscoveryMetadata:Qh.EMPTY_STRING,authorityMetadata:Qh.EMPTY_STRING,redirectUri:Qh.EMPTY_STRING,postLogoutRedirectUri:Qh.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:xg.AAD,azureCloudOptions:{azureCloudInstance:Rd.None,tenant:Qh.EMPTY_STRING},skipAuthorityMetadataCache:!1},e={cacheLocation:rm.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1},t={loggerCallback:function(){},logLevel:Ad.Info,piiLoggingEnabled:!1},t=Lh(Lh({},bf),{loggerOptions:t,networkClient:s?zm.getBrowserNetworkClient():Zg,navigationClient:new bv,loadFrameTimeout:0,windowHashTimeout:(null==n?void 0:n.loadFrameTimeout)||Ev,iframeHashTimeout:(null==n?void 0:n.loadFrameTimeout)||Sv,navigateFrameWait:s&&zm.detectIEOrEdge()?500:0,redirectNavigationTimeout:Tv,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(null==n?void 0:n.nativeBrokerHandshakeTimeout)||Iv,pollIntervalMilliseconds:cm.DEFAULT_POLL_INTERVAL_MS,cryptoOptions:{useMsrCrypto:!1,entropy:void 0}}),s={application:{appName:Qh.EMPTY_STRING,appVersion:Qh.EMPTY_STRING}},{auth:Lh(Lh({},i),r),cache:Lh(Lh({},e),o),system:Lh(Lh({},t),n),telemetry:Lh(Lh({},s),a)}),this.initialized=!1,this.logger=new Od(this.config.system.loggerOptions,Lm,Dm),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.isBrowserEnvironment?new I_(this.config.auth.clientId,this.config.auth.authority,this.logger,Lm,Dm,this.config.telemetry.application,this.config.system.cryptoOptions):new sy(this.config.auth.clientId,this.config.auth.authority,this.logger,Lm,Dm,this.config.telemetry.application),this.browserCrypto=this.isBrowserEnvironment?new d_(this.logger,this.performanceClient,this.config.system.cryptoOptions):Np,this.eventHandler=new Dv(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new Mm(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger):(s=this.config.auth.clientId,c=this.logger,a={cacheLocation:rm.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1},new Mm(s,a,Np,c));var c={cacheLocation:rm.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1};this.nativeInternalStorage=new Mm(this.config.auth.clientId,c,this.browserCrypto,this.logger),this.tokenCache=new g_(this.config,this.browserStorage,this.logger,this.browserCrypto)}var P_,O_=(Nh(x_,P_=w),x_.prototype.loginRedirect=function(r){return qh(this,void 0,void 0,function(){var t;return jh(this,function(e){return t=this.getRequestCorrelationId(r),this.logger.verbose("loginRedirect called",t),[2,this.acquireTokenRedirect(Lh({correlationId:t},r||pm))]})})},x_.prototype.loginPopup=function(e){var t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup(Lh({correlationId:t},e||pm))},x_.prototype.acquireTokenSilent=function(a){return qh(this,void 0,void 0,function(){var t,r,o,n,i,s=this;return jh(this,function(e){if(t=this.getRequestCorrelationId(a),(r=this.performanceClient.startMeasurement(bg.AcquireTokenSilent,t)).addStaticFields({cacheLookupPolicy:a.cacheLookupPolicy}),this.preflightBrowserEnvironmentCheck(am.Silent),this.logger.verbose("acquireTokenSilent called",t),!(i=a.account||this.getActiveAccount()))throw $y.createNoAccountError();return n={clientId:this.config.auth.clientId,authority:a.authority||Qh.EMPTY_STRING,scopes:a.scopes,homeAccountIdentifier:i.homeAccountId,claims:a.claims,authenticationScheme:a.authenticationScheme,resourceRequestMethod:a.resourceRequestMethod,resourceRequestUri:a.resourceRequestUri,shrClaims:a.shrClaims,sshKid:a.sshKid},o=JSON.stringify(n),void 0===(n=this.activeSilentTokenRequests.get(o))?(this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t),i=this.acquireTokenSilentAsync(Lh(Lh({},a),{correlationId:t}),i).then(function(e){return s.activeSilentTokenRequests.delete(o),r.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),r.endMeasurement({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),r.flushMeasurement(),e}).catch(function(e){throw s.activeSilentTokenRequests.delete(o),r.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),r.flushMeasurement(),e}),this.activeSilentTokenRequests.set(o,i),[2,i]):(this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),r.endMeasurement({success:!0}),r.discardMeasurement(),[2,n])})})},x_.prototype.acquireTokenSilentAsync=function(a,c){return qh(this,void 0,void 0,function(){var t,r,o,n,i,s=this;return jh(this,function(e){switch(e.label){case 0:return(this.eventHandler.emitEvent(Qm.ACQUIRE_TOKEN_START,am.Silent,a),t=this.performanceClient.startMeasurement(bg.AcquireTokenSilentAsync,a.correlationId),dv.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,a.authenticationScheme)&&c.nativeAccountId)?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),r=Lh(Lh({},a),{account:c}),r=this.acquireTokenNative(r,sm.acquireTokenSilent_silentFlow).catch(function(t){return qh(s,void 0,void 0,function(){return jh(this,function(e){if(t instanceof iv&&t.isFatal())return this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,[2,this.createSilentIframeClient(a.correlationId).acquireToken(a)];throw t})})}),[3,3]):[3,1];case 1:return this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),[4,(o=this.createSilentCacheClient(a.correlationId)).initializeSilentRequest(a,c)];case 2:n=e.sent(),i=Lh(Lh({},a),{cacheLookupPolicy:a.cacheLookupPolicy||fm.Default}),r=this.acquireTokenFromCache(o,n,i).catch(function(e){if(i.cacheLookupPolicy===fm.AccessToken)throw e;return zm.blockReloadInHiddenIframes(),s.eventHandler.emitEvent(Qm.ACQUIRE_TOKEN_NETWORK_START,am.Silent,n),s.acquireTokenByRefreshToken(n,i).catch(function(e){var t=e instanceof Of,r=e.errorCode===cm.INVALID_GRANT_ERROR;if((!t||!r||e instanceof ng||i.cacheLookupPolicy===fm.AccessTokenAndRefreshToken||i.cacheLookupPolicy===fm.RefreshToken)&&i.cacheLookupPolicy!==fm.Skip)throw e;return s.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",a.correlationId),s.acquireTokenBySilentIframe(n)})}),e.label=3;case 3:return[2,r.then(function(e){return s.eventHandler.emitEvent(Qm.ACQUIRE_TOKEN_SUCCESS,am.Silent,e),t.endMeasurement({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),e}).catch(function(e){throw s.eventHandler.emitEvent(Qm.ACQUIRE_TOKEN_FAILURE,am.Silent,null,e),t.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})]}})})},x_);function x_(e){e=P_.call(this,e)||this;return e.activeSilentTokenRequests=new Map,e}function R_(e){this.message=e}(R_.prototype=new Error).name="InvalidCharacterError";var M_="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new R_("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,o,n=0,i=0,s="";o=t.charAt(i++);~o&&(r=n%4?64*r+o:o,n++%4)&&(s+=String.fromCharCode(255&r>>(-2*n&6))))o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return s};function N_(e){this.message=e}function L_(e,t){if("string"!=typeof e)throw new N_("Invalid token specified");t=!0===(t=t||{}).header?0:1;try{return JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return decodeURIComponent(M_(t).replace(/(.)/g,function(e,t){t=t.charCodeAt(0).toString(16).toUpperCase();return"%"+(t=t.length<2?"0"+t:t)}))}catch(e){return M_(t)}}(e.split(".")[t]))}catch(e){throw new N_("Invalid token specified: "+e.message)}}(N_.prototype=new Error).name="InvalidTokenError";var D_=(q_.prototype.initialize=function(){var o=this;return this.initPromise||(this.initPromise=new Promise(function(e,t){if(o.options.authType===c.AuthenticationType.subscriptionKey)e();else if(o.options.authType===c.AuthenticationType.aad)o.options.authContext=o.options.authContext||q_.getDefaultAuthContext(o.options),o.options.authContext.handleRedirectPromise().then(function(){setTimeout(function(){return o._loginAndAcquireTokenForAAD(e,t)})}).catch(function(e){t(new Error("Error logging in the AAD users: "+e))});else if(o.options.authType===c.AuthenticationType.anonymous)e(o._triggerTokenFetch(!0));else if(o.options.authType===c.AuthenticationType.sas){if(o.options.sasToken){var r=-1;try{r=o._getTokenExpiry(o.options.sasToken)}catch(e){return void t(new Error("An invalid sasToken was provided."))}if(r>q_.constants.tokenRefreshClockSkew)return o._storeToken(o.options.sasToken),o._setTimeoutTokenFetch(r-q_.constants.tokenRefreshClockSkew),void e()}e(o._triggerTokenFetch())}else t(new Error("An invalid authentication type was specified."))})),this.initPromise},q_.prototype.dispose=function(){this.tokenTimeOutHandle&&(clearTimeout(this.tokenTimeOutHandle),this.tokenTimeOutHandle=null)},q_.getDefaultAuthContext=function(e){if(!e.aadAppId)throw new Error("No AAD app ID was specified.");if(!e.aadTenant)throw new Error("No AAD tenant was specified.");return this.defaultAuthContext||(this.defaultAuthContext=new O_({auth:{authority:""+(e.aadInstance||n)+e.aadTenant,clientId:e.aadAppId},cache:{cacheLocation:this.constants.preferredCacheLocation}})),this.defaultAuthContext},q_.prototype._loginAndAcquireTokenForAAD=function(e,t){var r=(null===(r=this.options.authContext)||void 0===r?void 0:r.getAllAccounts())||[];0===r.length?(this.options.authContext.loginRedirect(),e()):(this.options.authContext.setActiveAccount(r[0]),this._acquireTokenForAAD(e,t))},q_.prototype._acquireTokenForAAD=function(r,t){var o=this,n={scopes:[T]};this.options.authContext.acquireTokenSilent(n).then(function(e){o._saveItem(q_.constants.storage.tokenKey,e.accessToken);var t={map:o.map,type:q_.constants.events.tokenAcquired};o.map.events.invoke(q_.constants.events.tokenAcquired,t),clearTimeout(o.tokenTimeOutHandle);e=new Date(e.expiresOn).getTime()-Date.now();o.tokenTimeOutHandle=setTimeout(function(){return o._acquireTokenForAAD()},e),null!=r&&r()}).catch(function(e){return e instanceof ng?(o.options.authContext.acquireTokenRedirect(n),null==r?void 0:r()):void(null!=t&&t(e))})},q_.prototype.getAuthType=function(){return this.options.authType},q_.prototype.getClientId=function(){return this.options.clientId},q_.prototype.getToken=function(){if(this.options.authType===c.AuthenticationType.aad)return this._getItem(q_.constants.storage.tokenKey);if(this.options.authType!==c.AuthenticationType.anonymous&&this.options.authType!==c.AuthenticationType.sas)return this.options.authType===c.AuthenticationType.subscriptionKey?this.options.subscriptionKey:void 0;var e=this._getItem(q_.constants.storage.tokenKey);if(e){var t=this._getTokenExpiry(e);if(t<300&&0<t)this._triggerTokenFetch();else if(t<=0)throw this._saveItem(q_.constants.storage.tokenKey,""),new Error(q_.constants.errors.tokenExpired)}else this._triggerTokenFetch();return e},q_.prototype._getTokenExpiry=function(e){var t=L_(e).exp,e=this._getCurrentTime();return 0<t-e?t-e:-1},q_.prototype._storeToken=function(e){this._saveItem(q_.constants.storage.tokenKey,e);e={map:this.map,type:q_.constants.events.tokenAcquired};this.map.events.invoke(q_.constants.events.tokenAcquired,e)},q_.prototype._saveItem=function(e,t){return this._supportsLocalStorage()?localStorage.setItem(e,t):this._supportsSessionStorage()?sessionStorage.setItem(e,t):this.fallbackStorage[e]=t,!0},q_.prototype._getItem=function(e){return this._supportsLocalStorage()?localStorage.getItem(e):this._supportsSessionStorage()?sessionStorage.getItem(e):e in this.fallbackStorage?this.fallbackStorage[e]:null},q_.prototype._supportsLocalStorage=function(){try{return window.localStorage?(window.localStorage.setItem(q_.constants.storage.testStorageKey,"A"),"A"===window.localStorage.getItem(q_.constants.storage.testStorageKey)&&(window.localStorage.removeItem(q_.constants.storage.testStorageKey),!window.localStorage.getItem(q_.constants.storage.testStorageKey))):!1}catch(e){return!1}},q_.prototype._supportsSessionStorage=function(){try{return window.sessionStorage?(window.sessionStorage.setItem(q_.constants.storage.testStorageKey,"A"),"A"===window.sessionStorage.getItem(q_.constants.storage.testStorageKey)&&(window.sessionStorage.removeItem(q_.constants.storage.testStorageKey),!window.sessionStorage.getItem(q_.constants.storage.testStorageKey))):!1}catch(e){return!1}},q_.prototype._getCurrentTime=function(){return Math.round((new Date).getTime()/1e3)},q_.prototype.signRequest=function(e){e.headers=e.headers||{},e.headers[I]=this.sessionId,e.headers[E]=S,e.headers[b]="MapControl/"+j+" (Web)";var t=this.getToken();switch(this.options.authType){case c.AuthenticationType.aad:case c.AuthenticationType.anonymous:e.headers[C]=this.options.clientId,e.headers[i]=s+t;break;case c.AuthenticationType.sas:e.headers[i]=a+t;break;case c.AuthenticationType.subscriptionKey:e.headers["subscription-key"]=t;break;default:throw new Error("An invalid authentication type was specified")}return e},q_.constants={preferredCacheLocation:"localStorage",storage:{tokenKey:"access.token.key",testStorageKey:"testStorage"},events:{tokenAcquired:"tokenacquired"},tokenExpiresIn:3599,tokenRefreshClockSkew:300,errors:{tokenExpired:"Token Expired, Try again"}},q_);function q_(e){var n=this;this.fallbackStorage={},this._triggerTokenFetch=function(e){return void 0===e&&(e=!1),new Promise(function(r,o){"function"==typeof n.options.getToken?n.options.getToken(function(e){try{var t=n._getTokenExpiry(e)-q_.constants.tokenRefreshClockSkew;n._storeToken(e),n._setTimeoutTokenFetch(t),r()}catch(e){o(new Error("Invalid token returned by getToken function"))}},function(e){o(e)},n.map):o(new Error("Token cannot be "+(e?"fetched":"renewed")+" because getToken was not set or is not a function."))})},this._setTimeoutTokenFetch=function(e){clearTimeout(n.tokenTimeOutHandle),n.tokenTimeOutHandle=setTimeout(n._triggerTokenFetch,Math.min(1e3*e,2147483647))};var t=e.getServiceOptions();this.options=t.authOptions,this.sessionId=t.sessionId,this.map=e}var j_=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},U_=(H_.prototype.add=function(e,t){var r,o;if(Array.isArray(e))try{for(var n=j_(e),i=n.next();!i.done;i=n.next()){var s=i.value;this._add(s,t)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(r)throw r.error}}else this._add(e,t)},H_.prototype.getControls=function(){return Array.from(this.controls)},H_.prototype.remove=function(e){var t,r;if(Array.isArray(e))try{for(var o=j_(e),n=o.next();!n.done;n=o.next()){var i=n.value;this._remove(i)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}else this._remove(e)},H_.prototype._add=function(e,t){this.controls.add(e);var r=(new Y).merge(t),e=e.onAdd(this.map,t),t=this.controlContainer.getElementsByClassName(r.position);if(!(0<t.length))throw new Error("Control position "+r.position+" does not exist.");t.item(0).appendChild(e)},H_.prototype._remove=function(e){e.onRemove(),this.controls.delete(e)},H_);function H_(e){for(var t in this.map=e,this.controlContainer=document.createElement("div"),this.controlContainer.classList.add("atlas-control-container"),c.ControlPosition){var r;c.ControlPosition.hasOwnProperty(t)&&((r=document.createElement("div")).classList.add(c.ControlPosition[t]),r.classList.add("subcontrol-container"),this.controlContainer.appendChild(r))}this.map.getMapContainer().appendChild(this.controlContainer),this.controls=new Set}var z_=window&&window.__assign||function(){return(z_=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},B_=(F_.prototype.addCallback=function(s,a,c,e,u){var t,l,h=this;if(e)t=function(e){var t=e.lngLat?new gi(e.lngLat.lng,e.lngLat.lat):void 0,r=e.point?[e.point.x,e.point.y]:void 0,o=e.features?e.features.map(function(e){return new rn(e.geometry,e.properties,e.id)}):[],o={type:e.type,originalEvent:e.originalEvent,position:t,coordinate:r,features:o};c(o)};else switch(s){case"data":case"sourcedata":case"styledata":t=function(e){e=z_(z_({dataType:e.dataType},"source"===e.dataType&&z_(z_(z_({isSourceLoaded:e.isSourceLoaded},e.sourceDataType&&{sourceDataType:e.sourceDataType}),{source:h.map.sources.getById(e.sourceId)}),e.tile&&{tile:{id:{x:e.tile.tileID.canonical.x,y:e.tile.tileID.canonical.y,z:e.tile.tileID.canonical.z},size:e.tile.tileSize,state:e.tile.state}})),{map:h.map,type:e.type});u&&h.map.events._removeListener(s,a,c),c(e)};break;case"error":t=function(e){e={error:e.error,map:h.map,type:e.type};u&&h.map.events._removeListener(s,a,c),c(e)};break;case"touchstart":case"touchend":case"touchmove":case"touchcancel":t=function(e){if(e.originalEvent){if(e.originalEvent===l)return;l=e.originalEvent}var t=e.point?new an(e.point.x,e.point.y):void 0,r=e.points?e.points.map(function(e){return new an(e.x,e.y)}):[],o=e.lngLat?new gi(e.lngLat.lng,e.lngLat.lat):void 0,n=e.lngLats?e.lngLats.map(function(e){return new gi(e.lng,e.lat)}):[],i=o?h.map.layers.getRenderedShapes(new un(o),a?[a]:void 0):[],i={map:h.map,originalEvent:e.originalEvent,pixel:t,pixels:r,position:o,positions:n,shapes:i,layerId:a||void 0,preventDefault:function(){return e.preventDefault()},type:e.type};u&&h.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":t=function(e){if(e.originalEvent){if(e.originalEvent===l)return;l=e.originalEvent}var t=e.lngLat?new gi(e.lngLat.lng,e.lngLat.lat):void 0,r=e.point?new an(e.point.x,e.point.y):void 0,o=t?h.map.layers.getRenderedShapes(new un(t),a?[a]:void 0):[],o={map:h.map,originalEvent:e.originalEvent,position:t,pixel:r,preventDefault:function(){return e.preventDefault()},shapes:o,layerId:a||void 0,type:e.type};u&&h.map.events._removeListener(s,a,c),c(o)};break;case"styleimagemissing":t=function(e){u&&h.map.events._removeListener(s,a,c),c(e.id)};break;case"wheel":t=function(e){if(e.originalEvent){if(e.originalEvent===l)return;l=e.originalEvent}var t={map:h.map,originalEvent:e.originalEvent,preventDefault:function(){return e.preventDefault()},type:e.type};u&&h.map.events._removeListener(s,a,c),c(t)};break;case"resize":t=function(e){var t,r={map:h.map,type:e.type};for(t in e)"type"!==t&&"target"!==t&&(r[t]=e[t]);u&&h.map.events._removeListener(s,a,c),c(r)};break;default:t=function(e){var t={map:h.map,type:e.type};e.originalEvent&&(t.originalEvent=e.originalEvent),u&&h.map.events._removeListener(s,a,c),c(t)}}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,[t,u])},F_.prototype.removeCallback=function(e,t,r){this.callbacks.has(t)&&this.callbacks.get(t).has(e)&&this.callbacks.get(t).get(e).has(r)&&this.callbacks.get(t).get(e).delete(r)},F_.prototype.getModifiedCallback=function(e,t,r){if(this.callbacks.has(t)&&this.callbacks.get(t).has(e)&&this.callbacks.get(t).get(e).has(r))return this.callbacks.get(t).get(e).get(r)[0]},F_.prototype.getLayerCallbacks=function(e){if(this.callbacks.has(e))return this.callbacks.get(e)},F_.prototype.getEventCallbacks=function(e,t){if(this.callbacks.has(t)){t=this.callbacks.get(t);if(t.has(e))return t.get(e)}},F_);function F_(e){this.callbacks=new J,this.map=e}var K_=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},G_=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},Y_=["maxzoomchanged","minzoomchanged","mapconfigurationchanged"],Z_=(W_.prototype.add=function(e,t,r){var o,n;if("function"==typeof t)this._addGlobalListener(e,t,!1,!1);else{t=Array.isArray(t)?t:[t];try{for(var i=K_(t),s=i.next();!s.done;s=i.next()){var a=s.value;a instanceof Qs&&Qs._isMBoxEvent(e)?this._addLayerListener(e,a,r,!1,!1):a._addEventListener(e,r,!1)}}catch(e){o={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}}},W_.prototype.addOnce=function(e,t,r){"function"==typeof t?this._addGlobalListener(e,t,!1,!0):t instanceof Qs&&Qs._isMBoxEvent(e)?this._addLayerListener(e,t,r,!1,!0):t._addEventListener(e,r,!0)},W_.prototype._addLegacy=function(e,t,r){"function"==typeof t?this._addGlobalListener(e,t,!0,!1):this._addLayerListener(e,t,r,!0,!1)},W_.prototype._addLayerListener=function(e,t,r,o,n){var i,s,a,c,u=t instanceof Qs?t.getId():t,t=this.map.layers.getLayerById(u),l=this.mapCallbackHandler.getModifiedCallback(e,u,r);if(l&&t)try{for(var h=K_(t._getLayerIds()),p=h.next();!p.done;p=h.next()){var d=p.value;this.map._getMap().off(e,d,l)}}catch(e){i={error:e}}finally{try{p&&!p.done&&(s=h.return)&&s.call(h)}finally{if(i)throw i.error}}if(this.mapCallbackHandler.addCallback(e,u,r,o,n),t){l=this.mapCallbackHandler.getModifiedCallback(e,u,r);try{for(var f=K_(t._getLayerIds()),g=f.next();!g.done;g=f.next()){d=g.value;this.map._getMap().on(e,d,l)}}catch(e){a={error:e}}finally{try{g&&!g.done&&(c=f.return)&&c.call(f)}finally{if(a)throw a.error}}}},W_.prototype._addGlobalListener=function(e,t,r,o){var n,i,s,a;Y_.includes(e)?this.map._addEventListener(e,t,o):(n=this.mapCallbackHandler.getModifiedCallback(e,"",t),this.mapCallbackHandler.addCallback(e,"",t,r,o),i=this.mapCallbackHandler.getModifiedCallback(e,"",t),"load"===e&&this.map._isLoaded()?(s={type:"load",map:this.map},setTimeout(function(){return i(s)})):"ready"===e?this.map._isReady()&&(a={type:"ready",map:this.map},setTimeout(function(){return i(a)})):(n&&this.map._getMap().off(e,n),this.map._getMap().on(e,i)))},W_.prototype.invoke=function(e,t,r){if(void 0===r)this._invokeListeners(e,"",t);else if(t instanceof Qs&&Qs._isMBoxEvent(e))this._invokeListeners(e,t.getId(),r);else{if(!(t instanceof Q))throw new Error("The invoke target is invalid.");t._invokeEvent(e,r)}},W_.prototype._invokeListeners=function(r,o,n){var i=this,e=new J(this.mapCallbackHandler.getEventCallbacks(r,o));e?e.forEach(function(e,t){e=G_(e,2),e[0];e[1]&&i._removeListener(r,o,t),t(n)}):"error"===r&&console.error("error"in n?n.error:n)},W_.prototype.remove=function(e,t,r){var o,n;if("function"==typeof t)this._removeListener(e,"",t);else{t=Array.isArray(t)?t:[t];try{for(var i=K_(t),s=i.next();!s.done;s=i.next()){var a=s.value;a instanceof Qs&&Qs._isMBoxEvent(e)?this._removeListener(e,a,r):null!=a&&a._removeEventListener(e,r)}}catch(e){o={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}}},W_.prototype._removeLegacy=function(e,t,r){"function"==typeof t?this._removeListener(e,"",t):this._removeListener(e,t,r)},W_.prototype._removeListener=function(e,t,r){var o,n;if(Y_.includes(e))this.map._removeEventListener(e,r);else{var i=t instanceof Qs?t.getId():t,s=this.mapCallbackHandler.getModifiedCallback(e,i,r);if(s)if(i){t=this.map.layers.getLayerById(i);if(t)try{for(var a=K_(t._getLayerIds()),c=a.next();!c.done;c=a.next()){var u=c.value;this.map._getMap().off(e,u,s)}}catch(e){o={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}}else this.map._getMap().off(e,s);this.mapCallbackHandler.removeCallback(e,i,r)}},W_.prototype._enableLayerEvents=function(c){var u=this,e=this.mapCallbackHandler.getLayerCallbacks(c.getId());e&&e.forEach(function(e,a){e.forEach(function(e){var t,r,o=G_(e,1)[0];try{for(var n=K_(c._getLayerIds()),i=n.next();!i.done;i=n.next()){var s=i.value;u.map._getMap().on(a,s,o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}})})},W_.prototype._disableLayerEvents=function(c){var u=this,e=this.mapCallbackHandler.getLayerCallbacks(c.getId());e&&e.forEach(function(e,a){e.forEach(function(e){var t,r,o=G_(e,1)[0];try{for(var n=K_(c._getLayerIds()),i=n.next();!i.done;i=n.next()){var s=i.value;u.map._getMap().off(a,s,o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}})})},W_);function W_(e){this.map=e,this.mapCallbackHandler=new B_(this.map)}var V_=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},J_=(Q_.prototype.add=function(e,t){var r,o;if(Array.isArray(e))try{for(var n=V_(e),i=n.next();!i.done;i=n.next()){var s=i.value;this._addMarker(s,t)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(r)throw r.error}}else this._addMarker(e,t)},Q_.prototype._addMarker=function(e,t){e._addToMap(this.map,t),this.markers.add(e)},Q_.prototype.getMarkers=function(){return Array.from(this.markers)},Q_.prototype.remove=function(e){var t,r;if(Array.isArray(e))try{for(var o=V_(e),n=o.next();!n.done;n=o.next()){var i=n.value;this._removeMarker(i)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}else this._removeMarker(e)},Q_.prototype._removeMarker=function(t){var r=this;t instanceof du?(t._removeFromMap(),this.markers.delete(t)):this.markers.forEach(function(e){e._getId()===t&&(e._removeFromMap(),r.markers.delete(e))})},Q_.prototype.clear=function(){var t=this;this.markers.forEach(function(e){e._removeFromMap(),t.markers.delete(e)})},Q_);function Q_(e){this.markers=new Set,this.map=e}var X_=($_.prototype.add=function(s,t,a){var c=this;return new Promise(function(r,o){var n,e,i;c.userImages.has(s)?r():t instanceof HTMLImageElement||t instanceof ImageData?(c.map._getMap().addImage(s,t,a),c.userImages.set(s,{image:t,meta:a}),r()):"string"==typeof t&&(e=void 0,e=/<svg/i.test(t)&&!/^data:/i.test(t)?"data:image/svg+xml;base64,"+window.btoa(t):t,i=!1,c.map._sendRequest(e,"Image").then(function(e){return i?void 0:e.blob()}).then(function(e){var t;!i&&e&&(clearTimeout(n),(t=new Image).onload=function(){c.map._getMap().addImage(s,t,a),c.userImages.set(s,{image:t,meta:a}),r()},t.onerror=t.onabort=function(){o("Failed to load image into HTML element.")},t.src=URL.createObjectURL(e))}).catch(function(){i||(clearTimeout(n),o("Failed to load image into HTML element."))}),n=setTimeout(function(){i=!0,o("Failed to load image within specified timeout: "+c.imageLoadTimeout+" ms.")},c.imageLoadTimeout))})},$_.prototype.clear=function(){var r=this;this.userImages.forEach(function(e,t){r.map._getMap().removeImage(t)}),this.userImages.clear()},$_.prototype.getImageIds=function(){var r=[];return this.userImages.forEach(function(e,t){r.push(t)}),r},$_.prototype.createFromTemplate=function(e,t,r,o,n){r=r||"#1A73AA",o=o||"#fff";n=(n=fl(t,n)).replace(/{color}/g,r).replace(/{secondaryColor}/g,o).replace(/{text}/g,"");return this.add(e,n)},$_.prototype.hasImage=function(e){return this.userImages.has(e)},$_.prototype.remove=function(e){this.map._getMap().removeImage(e),this.userImages.delete(e)},$_.prototype._restoreImages=function(){var r=this;this.userImages.forEach(function(e,t){r.map._getMap().hasImage(t)||r.map._getMap().addImage(t,e.image,e.meta)})},$_);function $_(e){this.userImages=new J,this.imageLoadTimeout=5e3,this.map=e}var ew,tw,w=window&&window.__extends||(ew=function(e,t){return(ew=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ew(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),rw=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ow=(w(nw,tw=Qs),nw.prototype._buildLayers=function(){return this.layers},nw.prototype._getLayerIds=function(){return this.layers.map(function(e){return e.id})},nw.prototype._getSourceIds=function(){var t,e,r=new Set;try{for(var o=rw(this.layers),n=o.next();!n.done;n=o.next()){var i=n.value;"source"in i&&"string"==typeof i.source?r.add(i.source):"source"in i&&i.source&&r.add(i.id)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return r},nw.prototype._updateLayoutProperty=function(t,r,e,o){var n;$o(r,e)||(n=this.map._getMap(),this.layers.forEach(function(e){n.getLayer(e.id)?n.setLayoutProperty(e.id,t,o||r):console.warn("Could not update layout property "+t+" for layer "+e.id+" to "+(o||r))}))},nw);function nw(e,t){t=tw.call(this,t)||this;return t.layers=e,t}var iw=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},sw=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},aw=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},cw=(uw.prototype.add=function(e,t){var r,o,n=t instanceof Qs?t.getId():t;if(Array.isArray(e))try{for(var i=iw(e),s=i.next();!s.done;s=i.next()){var a=s.value;this._addLayer(a,n)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}else this._addLayer(e,n)},uw.prototype._addLayer=function(t,r){if(!(this.map._isReady()||t instanceof ow))throw new Error("The layer '"+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 layer to it.");var e,o,n,i;r!==t.getId()&&this.layerIndex.find(function(e){return r===e.getId()})?this._getMapboxLayerExists(t)?(o=this.layerIndex.findIndex(function(e){return e.getId()===t.getId()}),n=this.userLayers.findIndex(function(e){return e.layer.getId()===t.getId()}),this._removeMapboxLayers(t),this._addMapboxLayers(t,r),(i=this.layerIndex[o])&&this.map.events._disableLayerEvents(i),this.map.events._enableLayerEvents(t),this.layerIndex.splice(o,1),e=this.layerIndex.findIndex(function(e){return e.getId()===r}),this.layerIndex.splice(e,0,t),t instanceof ow||(this.userLayers[n]={layer:t,before:r}),i&&i.onRemove()):(this._addMapboxLayers(t,r),this.map.events._enableLayerEvents(t),e=this.layerIndex.findIndex(function(e){return e.getId()===r}),this.layerIndex.splice(e,0,t),t instanceof ow||this.userLayers.push({layer:t,before:r})):(o=this.layerIndex.findIndex(function(e){return e.getId()===t.getId()}),n=this.userLayers.findIndex(function(e){return e.layer.getId()===t.getId()}),0<=o&&0<=n?(i=this.layerIndex[o],this._removeMapboxLayers(i),this._addMapboxLayers(t,o+1),this.map.events._disableLayerEvents(i),this.map.events._enableLayerEvents(t),(this.layerIndex[o]=t)instanceof ow||(this.userLayers[n]={layer:t,before:void 0}),i.onRemove()):(this._addMapboxLayers(t),this.map.events._enableLayerEvents(t),this.layerIndex.push(t),t instanceof ow||this.userLayers.push({layer:t,before:r}))),t.onAdd(this.map)},uw.prototype._addMapboxLayers=function(e,t){var r,o;if(!(e instanceof Uc)||e.getOptions().tileUrl)if(e instanceof ow)this.map.events._enableLayerEvents(e);else{e instanceof Oa&&(this.map._getMap().addSource(e._getSourceId(),e._buildSource()),this.map.sources.setSourceState(e._getSourceWrapper()));var n=this._getMapboxBefore(t);try{for(var i=iw(e._buildLayers()),s=i.next();!s.done;s=i.next()){var a=s.value;this.map._getMap().addLayer(a,n)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}this.map.events._enableLayerEvents(e)}},uw.prototype._removeMapboxLayers=function(e,t){var r,o;if(e instanceof ow&&!t)this.map.events._disableLayerEvents(e);else{try{for(var n=iw(e._getLayerIds()),i=n.next();!i.done;i=n.next()){var s=i.value;this.map._getMap().getLayer(s)&&this.map._getMap().removeLayer(s)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(r)throw r.error}}this.map.events._disableLayerEvents(e),e instanceof Oa&&this.map._getMap().getSource(e._getSourceId())&&this.map._getMap().removeSource(e._getSourceId())}},uw.prototype._getMapboxLayerExists=function(t){var r=this,o=!1;return"string"==typeof t?!!(t=this.layerIndex.find(function(e){return e.getId()===t})):(t._getLayerIds().forEach(function(e){r.map._getMap().getLayer(e)&&(o=!0)}),o)},uw.prototype._getMapboxBefore=function(t){var r,e,o,n;if("string"==typeof t){var i=this.layerIndex.find(function(e){return e.getId()===t});if(!i)return;try{for(var s=iw(i._getLayerIds()),a=s.next();!a.done;a=s.next()){var c=a.value;if(this.map._getMap().getLayer(c))return c}}catch(e){r={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(r)throw r.error}}t=this.layerIndex.findIndex(function(e){return e.getId()===t})+1}for(var u=t;u<this.layerIndex.length;u++)try{for(var l=(o=void 0,iw(this.layerIndex[u]._getLayerIds())),h=l.next();!h.done;h=l.next()){c=h.value;if(this.map._getMap().getLayer(c))return c}}catch(e){o={error:e}}finally{try{h&&!h.done&&(n=l.return)&&n.call(l)}finally{if(o)throw o.error}}},uw.prototype.clear=function(){for(var e=this.layerIndex.length-1;0<=e;e--){var t=this.layerIndex[e];t&&(this._removeMapboxLayers(t,!0),this.layerIndex.splice(e,1),t.onRemove())}this.userLayers=[]},uw.prototype.getLayerById=function(t){var e=this.layerIndex.find(function(e){return e.getId()===t});if(e)return e},uw.prototype.getLayers=function(){return this.layerIndex.slice(0)},uw.prototype._getSourceIds=function(){var t,e,r=new Set;try{for(var o=iw(this.layerIndex),n=o.next();!n.done;n=o.next())n.value._getSourceIds().forEach(function(e){return r.add(e)})}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return r},uw.prototype._getUserLayers=function(){return Array.from(this.userLayers)},uw.prototype.move=function(e,t){var r=e instanceof Qs?e.getId():e,o=t instanceof Qs?t.getId():t;if(!this.layerIndex.find(function(e){return e.getId()===r}))throw new Error("The layer '"+r+"' has not been added to the map and cannot be moved.");t=this.layerIndex.findIndex(function(e){return e.getId()===r});this._moveMapboxLayers(this.layerIndex[t],o),e=this.layerIndex[t],this.layerIndex.splice(t,1);t=this.layerIndex.findIndex(function(e){return e.getId()===o});-1<t?this.layerIndex.splice(t,0,e):this.layerIndex.push(e);e=this.userLayers.find(function(e){return e.layer.getId()===r});e&&(e.before=o)},uw.prototype._moveMapboxLayers=function(e,t){var r,o,n=this._getMapboxBefore(t);try{for(var i=iw(e._getLayerIds()),s=i.next();!s.done;s=i.next()){var a=s.value;this.map._getMap().moveLayer(a,n)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}},uw.prototype.getRenderedShapes=function(e,t,r){var o,n,i,s=this;if(e=e||[-180,-85.0511,180,85.0511],Array.isArray(e)?4===e.length||6===e.length?i=this.map.positionsToPixels([Ai.getSouthWest(e),Ai.getNorthEast(e)]):2!==e.length&&3!==e.length||(i=this.map.positionsToPixels([e])[0]):i=this.map.positionsToPixels([e.coordinates])[0],t){t=Array.isArray(t)?t:[t];var a=[],c=this;try{for(var u=iw(t),l=u.next();!l.done;l=u.next())!function(e){var t=e instanceof Qs?e.getId():e,e=c.layerIndex.findIndex(function(e){return e.getId()===t});if(!(-1<e))throw new Error("The layer '"+t+"' has not been added to the map and its rendered features cannot be retrieved.");a.push.apply(a,aw([],sw(c.layerIndex[e]._getLayerIds().filter(function(e){return!!s.map._getMap().getLayer(e)}))))}(l.value)}catch(e){o={error:e}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}}r=this.map._getMap().queryRenderedFeatures(i,{layers:a,filter:r});return this.map.sources._mapFeaturesToShapes(r)},uw.prototype.remove=function(e){var t,r;if(Array.isArray(e))try{for(var o=iw(e),n=o.next();!n.done;n=o.next()){var i=n.value;this._removeLayer(i)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}else this._removeLayer(e)},uw.prototype._removeLayer=function(e){var t=e instanceof Qs?e.getId():e,r=this.layerIndex.findIndex(function(e){return e.getId()===t});if(-1==r)throw new Error("The layer '"+t+"' has not been added to the map and cannot be removed.");var o=this.layerIndex[r];this._removeMapboxLayers(o),this.layerIndex.splice(r,1);r=this.userLayers.findIndex(function(e){return e.layer.getId()===t});-1!=r&&this.userLayers.splice(r,1),e instanceof Oa&&this.map.sources.unsetSourceState(e._getSourceId()),o.onRemove()},uw);function uw(e){this.layerIndex=[],this.userLayers=[],this.map=e}var lw=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},hw=(pw.prototype.add=function(e){var t,r;e=Array.isArray(e)?e:[e];try{for(var o=lw(e),n=o.next();!n.done;n=o.next()){var i=n.value;this.popups.has(i)||(this.popups.add(i),i.attach(this.map))}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},pw.prototype.clear=function(){var t=this;this.popups.forEach(function(e){t.popups.delete(e),e.remove()})},pw.prototype.remove=function(e){var t,r;e=Array.isArray(e)?e:[e];try{for(var o=lw(e),n=o.next();!n.done;n=o.next()){var i=n.value;this.popups.has(i)&&(this.popups.delete(i),i.remove())}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},pw.prototype.getPopups=function(){return Array.from(this.popups)},pw.prototype._getCollectionDiv=function(){var e=this.map.getMapContainer().querySelector("."+pw.Css.collection);return e||((e=document.createElement("div")).classList.add(pw.Css.collection),e.setAttribute("aria-label","Map Information"),this.map.getMapContainer().appendChild(e)),e},pw.prototype._addDraggedPopup=function(e){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(e)},pw.Css={collection:"popup-collection-container"},pw);function pw(e){var o=this;this._onDrag=function(e){var t,r;"mousemove"===e.type?(t=e.clientX,r=e.clientY):"touchmove"===e.type&&(t=e.touches[0].clientX,r=e.touches[0].clientY),o.draggedPopups.forEach(function(e){e._dragToPixel([t,r])})},this._onUp=function(){o.map.getMapContainer().removeEventListener("mousemove",o._onDrag),o.map.getMapContainer().removeEventListener("touchmove",o._onDrag),o.map.getMapContainer().removeEventListener("mouseup",o._onUp),o.map.getMapContainer().removeEventListener("touchend",o._onUp),o.draggedPopups.forEach(function(e){o.draggedPopups.delete(e),e._onUp()})},this.map=e,this.popups=new Set,this.draggedPopups=new Set}var dw=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},fw=(gw.prototype.add=function(e,t){var r,o;if(void 0===t&&(t=!0),Array.isArray(e))try{for(var n=dw(e),i=n.next();!i.done;i=n.next()){var s=i.value;this._addSource(s,t)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(r)throw r.error}}else this._addSource(e,t)},gw.prototype.getRenderedShapes=function(e,t,r){e="string"==typeof e?e:e.getId(),t=this.map._getMap().querySourceFeatures(e,{sourceLayer:r,filter:t});return this.map.sources._mapFeaturesToShapes(t,!0,this.sources.get(e))},gw.prototype._buildSources=function(){var t={};return this.sources.forEach(function(e){t[e.getId()]=e._buildSource()}),t},gw.prototype.clear=function(){var t=this;this.sources.forEach(function(e){t.remove(e)})},gw.prototype.getById=function(e){return this.sources.get(e)},gw.prototype.getSources=function(){return Array.from(this.sources.values())},gw.prototype.isSourceLoaded=function(e){e=e instanceof as?e.getId():e;return this.map._getMap().isSourceLoaded(e)},gw.prototype.remove=function(e,t){var r,o;if(void 0===t&&(t=!0),Array.isArray(e))try{for(var n=dw(e),i=n.next();!i.done;i=n.next()){var s=i.value;this._removeSource(s,t)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(r)throw r.error}}else this._removeSource(e,t)},gw.prototype.setSourceState=function(e,t){void 0===t&&(t=!0),this.sources.set(e.getId(),e),e._setMap(this.map,t)},gw.prototype.unsetSourceState=function(e){this.sources.has(e)&&(this.sources.get(e)._setMap(null),this.sources.delete(e))},gw.prototype._removeSource=function(e,t){e=e instanceof as?e.getId():e;if(!this.sources.has(e))throw new Error("'"+e+"' is not added to the map");if(this.map._getMap().getSource(e)&&t&&this.map._getMap().removeSource(e),this.map._getMap().getSource(e)&&t)throw new Error("One or more layers have a dependency on the source '"+e+"'");this.unsetSourceState(e)},gw.prototype._addSource=function(e,t){if(this.sources.has(e.getId())){if(t)throw new Error("'"+e.getId()+"' is already added to the map");this.unsetSourceState(e.getId())}if(t){if(!this.map._isReady())throw new Error("The source '"+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 source to it.");this.map._getMap().addSource(e.getId(),e._buildSource())}this.setSourceState(e)},gw.prototype._mapFeaturesToShapes=function(e,t,r){var o,n,i=[];try{for(var s=dw(e),a=s.next();!a.done;a=s.next()){var c=a.value;if((r||"string"==typeof c.source)&&"string"==typeof c.properties[Ci._shapeIdPropName]){var u=r||this.sources.get(c.source);if(u instanceof ps){var l=u.getShapeById(c.properties[Ci._shapeIdPropName]);if(l instanceof Ci){i.push(l);continue}}}t||i.push(c)}}catch(e){o={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},gw.prototype._syncSources=function(n){var o=this;n?(Object.keys(n).map(function(e){var t,r=n[e];switch(r.type){case"vector":case"raster":case"raster-dem":t=new Pc(e,{name:e,tiles:r.tiles,type:r.type,url:r.url,tileSize:"tileSize"in r?r.tileSize:void 0});break;case"canvas":t=new Ss(e,r);break;case"geojson":var o=new ps(e,{maxZoom:r.maxzoom,cluster:r.cluster,clusterRadius:r.clusterRadius,tolerance:r.tolerance,lineMetrics:r.lineMetrics,clusterProperties:r.clusterProperties,buffer:r.buffer,clusterMinPoints:r.clusterMinPoints,generateId:r.generateId,promoteId:r.promoteId,filter:r.filter});"string"!=typeof r.data&&void 0!==r.data&&o._addNoUpdate(r.data),t=o;break;case"image":t=new Rs(e,r);break;case"video":t=new Ds(e,r);break;default:t=new ks(e,r)}return t}).forEach(function(e){var t=o.sources.get(e.getId()),r=t&&e._isDeepEqual(t);!r&&t&&o.unsetSourceState(t.getId()),o.setSourceState(e,!r)}),Array.from(this.sources.keys()).filter(function(e){return!(e in n)}).forEach(function(e){return o.unsetSourceState(e)})):console.warn("syncSources called with no style sources which is unexpected.")},gw);function gw(e){this.map=e,this.sources=new J}var yw,mw,vw=((window&&window.__extends||(yw=function(e,t){return(yw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}yw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(_w,mw=k),_w);function _w(){var e=null!==mw&&mw.apply(this,arguments)||this;return e.duration=1e3,e.type="jump",e}var ww,bw,Cw=((window&&window.__extends||(ww=function(e,t){return(ww=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ww(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Ew,bw=k),Ew);function Ew(){var e=null!==bw&&bw.apply(this,arguments)||this;return e.bottom=0,e.left=0,e.right=0,e.top=0,e}var Sw,Tw,w=window&&window.__extends||(Sw=function(e,t){return(Sw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Sw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Iw=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Aw=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},kw=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},Pw=(w(Ow,Tw=k),Ow.prototype.merge=function(){for(var t,e,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];try{for(var n=Iw(r),i=n.next();!i.done;i=n.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(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return Tw.prototype.merge.apply(this,kw([],Aw(r)))},Ow);function Ow(){var e=null!==Tw&&Tw.apply(this,arguments)||this;return e.bounds=[-180,-89,180,90],e.maxBounds=void 0,e.maxZoom=20,e.offset=new an(0,0),e.padding=new Cw,e}var xw,Rw,Mw=((window&&window.__extends||(xw=function(e,t){return(xw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}xw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Nw,Rw=k),Nw);function Nw(){var e=null!==Rw&&Rw.apply(this,arguments)||this;return e.zoom=1,e.center=new gi(0,0),e.centerOffset=new an(0,0),e.bearing=0,e.pitch=0,e.minZoom=1,e.maxZoom=20,e.minPitch=0,e.maxPitch=60,e.maxBounds=void 0,e}var Lw,Dw,w=((window&&window.__extends||(Lw=function(e,t){return(Lw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Lw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(qw,Dw=k),qw);function qw(){var e=null!==Dw&&Dw.apply(this,arguments)||this;return e.name=void 0,e.before=void 0,e.minZoom=1,e.maxZoom=20,e.overwrite=!1,e.opacity=1,e}var jw,Uw,Hw=((window&&window.__extends||(jw=function(e,t){return(jw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}jw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(zw,Uw=w),zw);function zw(){var e=null!==Uw&&Uw.apply(this,arguments)||this;return e.color="rgba(0,0,0,.5)",e.outlineColor="#000",e.radius=1,e.outlineWidth=5,e.name="default-circles",e}var Bw,Fw,Kw=((window&&window.__extends||(Bw=function(e,t){return(Bw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Bw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Gw,Fw=w),Gw);function Gw(){var e=null!==Fw&&Fw.apply(this,arguments)||this;return e.cap="butt",e.join="miter",e.name="default-linestrings",e.color="#000",e.width=1,e}var Yw,Zw,Ww=((window&&window.__extends||(Yw=function(e,t){return(Yw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Yw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(Vw,Zw=w),Vw);function Vw(){var e=null!==Zw&&Zw.apply(this,arguments)||this;return e.iconSize=1,e.fontSize=14,e.fontColor="#000",e.textFont="SegoeUi-Regular",e.cluster=!0,e.clusterIcon=void 0,e.textOffset=[0,0],e.name="default-pins",e.icon="pin-darkblue",e.title="",e}var Jw,Qw,Xw=((window&&window.__extends||(Jw=function(e,t){return(Jw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Jw(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))($w,Qw=w),$w);function $w(){var e=null!==Qw&&Qw.apply(this,arguments)||this;return e.color="rgba(0,0,0,.5)",e.outlineColor="#000",e.name="default-polygons",e}var e0,t0,r0=((window&&window.__extends||(e0=function(e,t){return(e0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}e0(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(o0,t0=w),o0);function o0(){var e=null!==t0&&t0.apply(this,arguments)||this;return e.name="default-raster",e}var n0,i0,s0=((window&&window.__extends||(n0=function(e,t){return(n0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n0(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}))(a0,i0=k),a0);function a0(){var e=null!==i0&&i0.apply(this,arguments)||this;return e.anchor="map",e.color="#FFFFFF",e.intensity=.5,e.position=[1.15,210,30],e}var c0,u0,w=window&&window.__extends||(c0=function(e,t){return(c0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}c0(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),l0=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},h0=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},p0=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},d0=(w(f0,u0=k),f0.prototype.merge=function(){for(var t,e,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];try{for(var n=l0(r),i=n.next();!i.done;i=n.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=_u.getCode(s.language)))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return u0.prototype.merge.apply(this,p0([],h0(r)))},f0);function f0(){var e=null!==u0&&u0.apply(this,arguments)||this;return e.antialias=void 0,e.autoResize=!0,e.language=Ou,e.light=new s0,e.preserveDrawingBuffer=!1,e.progressiveLoading=!1,e.progressiveLoadingInitialLayerGroups=["base"],e.renderWorldCopies=!0,e.showBuildingModels=!1,e.showFeedbackLink=!0,e.showLogo=!0,e.showLabels=!0,e.customAttribution=void 0,e.showTileBoundaries=!1,e.style=void 0,e.view=Au,e.userRegion=e.view,e.customStyleTransform=void 0,e}function g0(e){return 0==e.length?void 0:e.slice(1).reduce(function(r,o){return function(e,t){e=r(e,t);return v0(v0({},e),o(e.url,t))}},e[0])}var y0,m0,w=window&&window.__extends||(y0=function(e,t){return(y0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}y0(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),v0=window&&window.__assign||function(){return(v0=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},_0=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},w0=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},b0=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},C0=(w(E0,m0=k),E0.prototype.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{for(var r=_0(e),o=r.next();!o.done;o=r.next()){var n=o.value;n&&(n.authOptions?"string"==typeof n.authOptions.subscriptionKey&&(n.subscriptionKey=n["subscription-key"]=n.authOptions.subscriptionKey):"string"==typeof n.subscriptionKey?(n["subscription-key"]=n.subscriptionKey,n.authOptions={authType:c.AuthenticationType.subscriptionKey,subscriptionKey:n.subscriptionKey}):"string"==typeof n["subscription-key"]&&(n.subscriptionKey=n["subscription-key"],n.authOptions={authType:c.AuthenticationType.subscriptionKey,subscriptionKey:n["subscription-key"]}),"string"==typeof n.sessionId?n["session-id"]=n.sessionId:"string"==typeof n["session-id"]&&(n.sessionId=n["session-id"]),"boolean"==typeof n.disableTelemetry?n["disable-telemetry"]=n.disableTelemetry:"boolean"==typeof n["disable-telemetry"]&&(n.disableTelemetry=n["disable-telemetry"]),"boolean"==typeof n.enableAccessibility?n["enable-accessibility"]=n.enableAccessibility:"boolean"==typeof n["enable-accessibility"]&&(n.enableAccessibility=n["enable-accessibility"]))}}catch(e){a={error:e}}finally{try{o&&!o.done&&(s=r.return)&&s.call(r)}finally{if(a)throw a.error}}var i=this._transformers,s=e?e.filter(function(e){return void 0!==e}).reduce(function(e,t){return b0(b0([],w0(e)),w0(t._transformers||[]))},[]):[],a=m0.prototype.merge.apply(this,b0([],w0(e)));return a.authOptions.authType!==c.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=v0(v0({},a.mapConfiguration),{defaultConfiguration:a.mapConfiguration.defaultConfiguration||a.mapConfiguration.defaultStyle,configurations:a.mapConfiguration.configurations||a.mapConfiguration.styles})),this._transformers=b0(b0([],w0(i||[])),w0(s.filter(function(e){return!i.includes(e)}))),this.transformRequest&&!this._transformers.includes(this.transformRequest)&&this._transformers.push(this.transformRequest),this.transformRequest=g0(this._transformers),a},E0.prototype.addTransformer=function(e){this._transformers||(this._transformers=[]),this._transformers.push(e),this.transformRequest=g0(this._transformers)},E0.prototype.removeTransformer=function(t){this._transformers&&(this._transformers=this._transformers.filter(function(e){return t!==e}),this.transformRequest=g0(this._transformers))},E0._cloneCustomizer=function(e){if("object"==typeof e)return Object.assign({},e)},E0);function E0(){var e=null!==m0&&m0.apply(this,arguments)||this;return e.authOptions=Zu(),e.disableTelemetry=!1,e["disable-telemetry"]=e.disableTelemetry,e.domain=Ru,e.staticAssetsDomain=Mu,e.styleDefinitionsPath=Nu,e.styleDefinitionsVersion=Lu,e.styleAPIVersion=Du,e.mapConfiguration=void 0,e.styleSet=void 0,e.enableAccessibility=!0,e["enable-accessibility"]=e.enableAccessibility,e.enableAccessibilityLocationFallback=!0,e.maxParallelImageRequests=el(),e.refreshExpiredTiles=!0,e.subscriptionKey=ol(),e["subscription-key"]=e.subscriptionKey,e.sessionId=xu,e["session-id"]=e.sessionId,e._transformers=[],e.transformRequest=void 0,e.workerCount=$u(),e.fadeDuration=300,e.localIdeographFontFamily="sans-serif",e.validateStyle=!1,e}var S0=(T0.getLayerGroup=function(e){if("string"!=typeof e&&e.metadata&&e.metadata["microsoft.maps:layerGroup"])return e.metadata["microsoft.maps:layerGroup"];e="string"!=typeof e?e.id:e;if(e.startsWith("microsoft.")){e=e.split(".");return 4<=e.length?e[3]:void 0}},T0);function T0(){}var I0=(A0.resolve=function(e){return new A0(Promise.resolve(e))},A0.reject=function(e){return new A0(Promise.reject(e))},A0.prototype.then=function(e,t){var r=this;return new Promise(function(e,t){r._resolve=e,r._reject=t,r._thenResolver(e,t)}).then(e,t)},A0.prototype.catch=function(e){var r=this;return new Promise(function(e,t){r._resolve=e,r._reject=t,r._thenResolver(e,t)}).catch(e)},A0.prototype.finally=function(e){var r=this;return new Promise(function(e,t){r._resolve=e,r._reject=t,r._thenResolver(e,t)}).finally(e)},A0.prototype.hijackAndResolve=function(e){this._hijackedToResolve=e,this._resolve&&this._resolve(e)},A0.prototype.hijackAndReject=function(e){this._hijackedToReject=e,this._reject&&this._reject(e)},A0.prototype.switchWith=function(e){this.origin=e,this._toResolve=void 0,this._toReject=void 0},A0);function A0(e){var n=this;this.isHijacked=function(){return void 0!==n._hijackedToResolve||void 0!==n._hijackedToReject},this.isResolved=function(){return void 0!==n._hijackedToResolve||void 0!==n._toResolve},this.isRejected=function(){return void 0!==n._hijackedToReject||void 0!==n._toReject},this.resultIfResolved=function(){return n._hijackedToResolve||n._toResolve},this.errorIfRejected=function(){return n._hijackedToReject||n._toReject},this._thenResolver=function(t,r){var o;n._hijackedToResolve?t(n._hijackedToResolve):n._hijackedToReject?r(n._hijackedToReject):(o=n.origin,n.origin.then(function(e){n.isHijacked()||(o!==n.origin?n._thenResolver(t,r):(n._toResolve=e,t(e)))}).catch(function(e){n.isHijacked()||(o!==n.origin?n._thenResolver(t,r):(n._toReject=e,r(e)))}))},this.origin=e,this[Symbol.toStringTag]=this.origin[Symbol.toStringTag]}var k0={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)"},P0=window&&window.__assign||function(){return(P0=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},O0=window&&window.__awaiter||function(e,s,a,c){return new(a=a||Promise)(function(r,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(o,n)}i((c=c.apply(e,s||[])).next())})},x0=window&&window.__generator||function(r,o){var n,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=o.call(r,a)}catch(e){t=[6,e],i=0}finally{n=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},R0=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},M0=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},N0=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},L0=(D0.prototype.updateIndoorState=function(e,t){var r,o,n=this,i=this.map.styles.getMapConfiguration();i?(this.preservedPreindoorMapConfiguration=i,r=this.map.getStyle().style?this.map.getStyle().style+"_indoor"+("dark"===e?"_dark":"")+"_tileset_"+t:void 0,this.map.styles.setMapConfiguration("defaultIndoor_"+t,"microsoft-maps:default"===i?r:void 0)):(o=(null===(r=this.indoorState)||void 0===r?void 0:r.tilesetId)!==t,this.indoorState={tilesetId:t,theme:e},this.initStyleset(),this.definitions().then(function(e){var t=(n.map.getStyle().style||e.defaultConfiguration).replace("_indoor_dark","").replace("_indoor","")+"_indoor",e=e.configurations.find(function(e){return e.name.startsWith(t)});e&&n.map.setStyle({style:e.name},!o)}))},D0.prototype.unsetIndoorState=function(){var r=this,e=this.preservedPreindoorMapConfiguration;e?this.map.styles.setMapConfiguration(e):(this.indoorState=void 0,this.initStyleset(),this.definitions().then(function(e){var t=r.map.getStyle().style;t.includes("_indoor")&&t.split("_indoor")[0]?r.map.setStyle({style:t.split("_indoor")[0]}):r.map.setStyle({style:void 0})}))},D0.prototype.initStyleset=function(){var e,r=this;return e=this.serviceOptions.mapConfiguration?"string"==typeof this.serviceOptions.mapConfiguration?(e=this.map.authentication?this.map.authentication.initialize():Promise.resolve(),new I0(e.then(function(){return r._request(r.serviceOptions.domain,_+"/mapconfigurations/metadata/"+r.serviceOptions.mapConfiguration,"StyleDefinitions").then(function(e){return P0(P0({},e),{defaultConfiguration:e.defaultConfiguration||e.defaultStyle,configurations:e.configurations||e.styles})})}))):I0.resolve(this.serviceOptions.mapConfiguration):(e=this.map.authentication?this.map.authentication.initialize():Promise.resolve(),new I0(e.then(function(){return r._request(r.serviceOptions.staticAssetsDomain,v+"/"+_,"StyleDefinitions",{version:r.serviceOptions.styleDefinitionsVersion}).then(function(t){return{version:isNaN(t.version)?0:parseFloat(t.version),defaultConfiguration:t.defaultStyle,configurations:t.styles.filter(function(e){return r.indoorState?"auto"===r.indoorState.theme?e.name.endsWith("dark"===e.theme?"_indoor_dark":"_indoor"):e.name.endsWith("dark"===r.indoorState.theme?"_indoor_dark":"_indoor"):!e.name.includes("indoor")}).map(function(e){return{copyright:e.copyright.join(" "),name:e.name,displayName:function(e){e=r.indoorState&&e.includes("_indoor")?e.split("_indoor")[0]:e;return e in k0?k0[e]:e}(e.name),theme:e.theme,thumbnail:new D({domain:r.serviceOptions.staticAssetsDomain,path:e.thumbnail,protocol:"https"}).toString(),url:new D({domain:r.serviceOptions.staticAssetsDomain,path:v+"/"+_+"/"+e.name,queryParams:{styleVersion:void 0!==t.version&&null!==t.version?t.version:r.serviceOptions.styleDefinitionsVersion},protocol:"https"}).toString()}})}})}))),this.initPromise&&this.initPromise.switchWith(e),this.initPromise=e,this.initPromise.then(function(e){return r.map._invokeEvent("mapconfigurationchanged",e)}),this.initPromise},D0.prototype.getStyle=function(e){e=this._lookUp(e);if(!e)throw Error("Style definition is not available.");if(e.url)return e.url;if(e.style)return e.style;throw Error("Style definition neither contains URL nor style object.")},D0.prototype.deriveNewStyleAndLayerGroups=function(e,t){for(var r,o,n,i=this.map.getStyle(),s=this.map.getTraffic(),a={},c=0;c<t.layers.length;c++){var u=t.layers[c],l=S0.getLayerGroup(u);l?(a[l]||(a[l]=[]),a[l].push(u),i.showBuildingModels||"fill-extrusion"!==u.type?"fill-extrusion"===u.type&&(u.layout=null!==(r=u.layout)&&void 0!==r?r:{},u.layout.visibility="visible"):(u.layout=null!==(o=u.layout)&&void 0!==o?o:{},u.layout.visibility="none"),"none"!==s.flow&&l&&l==="traffic_"+s.flow&&"line"==u.type&&(u.layout=null!==(o=u.layout)&&void 0!==o?o:{},u.layout.visibility="visible"),"labels"!==l&&"labels_places"!==l&&"labels_indoor"!==l||"symbol"!==u.type||(i.showLabels&&"none"!==(null===(l=u.layout)||void 0===l?void 0:l.visibility)?(u.layout=null!==(n=u.layout)&&void 0!==n?n:{},u.layout.visibility="visible"):(u.layout=null!==(n=u.layout)&&void 0!==n?n:{},u.layout.visibility="none"))):a[u.id]=[u]}return[t,a]},D0.prototype.injectUserLayersIntoStyle=function(s,a,c){return s?this.map.layers._getUserLayers().reduce(function(r,t){if(t.layer instanceof Zc)return r;var e,o=c[t.before]&&0<c[t.before].length?c[t.before][0]:void 0,n=s.layers.find(function(e){return e.id===t.layer.getId()}),i=a.layers.findIndex(function(e){return e.id===t.layer.getId()});return-1<i&&a.layers.splice(i,1),n&&(e=new Set(Array.from(t.layer._getSourceIds()).map(function(e){return s.sources[e]?{source:s.sources[e],id:e}:void 0}).filter(function(e){return void 0!==e})),-1<(i=o?r.layers.findIndex(function(e){return e.id===o.id}):-1)?r.layers.splice(i,0,n):r.layers.push(n),e.forEach(function(e){var t=e.source,e=e.id;r.sources[e]=t})),r},P0({},a)):a},D0.prototype.setStyle=function(n,e){var i=this;void 0===e&&(e=!0);var t=this._lookUp(n);if(!t)throw Error("Style definition "+n.style+" is not available.");if(!t.url&&!t.style)throw Error("Style definition neither contains URL nor style object.");var r=function(){return i._onStyleData(t)},s=function(){i.map.events.remove("styledata",r),i.map.events.addOnce("styledata",r)},o=n&&n.customStyleTransform?function(e,t){t=n.customStyleTransform(e,t);return s(),t}:function(e,t){var r=P0(P0({},t),{layers:M0([],R0(t.layers)),sources:P0({},t.sources)}),o=n.progressiveLoading&&!i.map._isLoaded();o&&Array.isArray(null==t?void 0:t.layers)&&((r=P0({},t)).layers=r.layers.map(function(e){var t=P0({},e);return e.layout&&(t.layout=P0({},e.layout)),t}));t=R0(i.deriveNewStyleAndLayerGroups(e,r),2),r=t[0],t=t[1];o&&(o=n.progressiveLoadingInitialLayerGroups,Array.isArray(o)&&0<o.length&&i._deferLayerGroupVisibilities(t,o));r=i.injectUserLayersIntoStyle(e,r,t),t=Object.entries(t).map(function(e){var t=R0(e,2),e=t[0],t=t[1];return i._buildFundamentalLayerFrom(t,e)}),t=i.map.layers._getUserLayers().reduce(function(e,t){var r=t.before?e.findIndex(function(e){return e.getId()===t.before}):-1;return-1<r?e.splice(r,0,t.layer):e.push(t.layer),e},t);return i.map.layers.layerIndex=t,i.map.sources._syncSources(r.sources),s(),r};this.map._getMap().setStyle(t.url||t.style,{diff:e,validate:this.serviceOptions.validateStyle,transformStyle:o})},D0.prototype.getTheme=function(e){e=this._lookUp(e);if(e)return e.theme.toLowerCase()},D0.prototype.getThemeAsync=function(t){return O0(this,void 0,void 0,function(){return x0(this,function(e){switch(e.label){case 0:return[4,this._lookUpAsync(t)];case 1:return[2,e.sent().theme]}})})},D0.prototype.setMapConfiguration=function(e,r){var o=this;"string"==typeof(this.serviceOptions.mapConfiguration=e)?this.initStyleset():this.initPromise?this.initPromise.hijackAndResolve(e):this.initPromise=I0.resolve(e),this.definitions().then(function(e){var t=e.defaultConfiguration;e.configurations.find(function(e){return e.name===r})&&(t=r),o.map.setStyle({style:t})})},D0.prototype.getMapConfiguration=function(){return this.serviceOptions.mapConfiguration},D0.prototype.setStyleSet=function(e){this.updateIndoorState("indoor_dark"===e?"dark":"light",null)},D0.prototype.getStyleSet=function(){return void 0!==this.indoorState?"dark"===this.indoorState.theme?"indoor_dark":"indoor":"base"},D0.prototype.clearStyleSet=function(){this.unsetIndoorState()},D0.prototype._buildFundamentalLayerFrom=function(e,t){if(e&&0<e.length){e=new ow(e,t);return e.onAdd(this.map),e}throw new Error("Unable to construct fundamental map layer for ID: "+t+".")},D0.prototype._transformStyleRequest=function(e,t){e.includes(h)&&(t.url=t.url.replace(h,this.serviceOptions.domain)),e.includes(y)&&(t.url=t.url.replace(y,v)),e.includes(m)&&(t.url=t.url.replace(m,_)),(t.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase())||t.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase()))&&((e=new URL(t.url)).searchParams.get(l)||(e.searchParams.set(l,this.serviceOptions.styleAPIVersion),t.url=e.href),null!==(e=this.map.authentication)&&void 0!==e&&e.signRequest(t))},D0.prototype._request=function(o,n,i,s){var a;return void 0===s&&(s={}),O0(this,void 0,void 0,function(){var t,r;return x0(this,function(e){switch(e.label){case 0:return t={url:new D({protocol:"https",domain:o,path:n,queryParams:P0(((r={})[l]=this.serviceOptions.styleAPIVersion,r.hash=D0._hashCode(null===(a=this.map.authentication)||void 0===a?void 0:a.getToken()),r),s)}).toString()},"function"==typeof this.serviceOptions.transformRequest&&i&&(t=this.serviceOptions.transformRequest(t.url,i)),null!==(a=this.map.authentication)&&void 0!==a&&a.signRequest(t),r={method:"GET",mode:"cors"},t.credentials&&(r.credentials=t.credentials),t.headers&&(r.headers=t.headers),[4,fetch(t.url,r).then(function(e){if(e.ok)return e.json();throw new Error("HTTP "+e.status+": "+e.statusText+" ")})];case 1:return[2,e.sent()]}})})},D0._hashCode=function(e){var t=0;if(!(e=void 0===e?"":e))return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t},D0);function D0(e,t){var l=this;this.definitions=function(){var e=l.initPromise||l.initStyleset();return e},this.indoorState=void 0,this.preservedPreindoorMapConfiguration=void 0,this._progressiveLoadingState={mapStyle:void 0,pendingVisibilityChange:void 0},this._deferLayerGroupVisibilities=function(t,e){var r,n,o,i,s=e.filter(function(e){return e in t});0!==s.length&&(r=l.map._getMap(),n=r.getZoom(),o=l.map.getStyle().style,l._progressiveLoadingState.pendingVisibilityChange&&(l.map.events.remove("load",l._progressiveLoadingState.pendingVisibilityChange),l._progressiveLoadingState.pendingVisibilityChange=null),l._progressiveLoadingState.mapStyle=o,(i=Object.entries(t).reduce(function(e,t){var r=R0(t,2),t=r[0],r=r[1],o=s.includes(t);return M0(M0([],R0(e)),R0(r.filter(function(e){if("custom"===e.type)return!1;if(o)if("number"==typeof e.maxzoom&&"number"==typeof e.minzoom){if(n<=e.maxzoom&&n>=e.minzoom)return!1}else if("number"==typeof e.minzoom){if(n>=e.minzoom)return!1}else{if("number"!=typeof e.maxzoom)return!1;if(n<=e.maxzoom)return!1}return"none"!==(null===(e=e.layout)||void 0===e?void 0:e.visibility)})))},[])).forEach(function(e){e.layout=e.layout||{},e.layout.visibility="none"}),l._progressiveLoadingState.pendingVisibilityChange=function(){l._progressiveLoadingState.pendingVisibilityChange=null;var e=l.map.getStyle().style;o===e&&i.forEach(function(e){e.layout.visibility="visible",r.setLayoutProperty(e.id,"visibility","visible")})},l.map.events.addOnce("load",l._progressiveLoadingState.pendingVisibilityChange))},this._onStyleData=function(e){l.map.events.invoke("stylechanged",{style:e.name,map:l.map,type:"stylechanged"})},this._lookUp=function(e){var t,r,o=l.definitions(),n=o.errorIfRejected(),i=o.resultIfResolved();if(n)return null;if(i){var n=i.configurations,s=void 0;try{for(var a=N0(n),c=a.next();!c.done;c=a.next()){var u=c.value;if(u.name===e.style)return u;u.name!==i.defaultConfiguration||s||(s=u)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return s=s||n[0]}return null},this._lookUpAsync=function(r){return O0(l,void 0,void 0,function(){var t;return x0(this,function(e){switch(e.label){case 0:return[4,this.definitions()];case 1:return t=e.sent(),[2,t.configurations.find(function(e){return e.name===(r.style||t.defaultConfiguration)})||t.configurations.find(function(e){return e.name===t.defaultConfiguration})||t.configurations[0]]}})})},this.map=e,this.serviceOptions=t}var q0=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},j0=(U0.prototype.add=function(e){var t,r;e=Array.isArray(e)?e:[e];try{for(var o=q0(e),n=o.next();!n.done;n=o.next()){var i=n.value;this.indicators.has(i)||(this.indicators.add(i),i.attach(this.map))}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},U0.prototype.clear=function(){var t=this;this.indicators.forEach(function(e){t.indicators.delete(e),e.remove()})},U0.prototype.remove=function(e){var t,r;e=Array.isArray(e)?e:[e];try{for(var o=q0(e),n=o.next();!n.done;n=o.next()){var i=n.value;this.indicators.has(i)&&(this.indicators.delete(i),i.remove())}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},U0.prototype.getIndicators=function(){return Array.from(this.indicators)},U0.prototype._getCollectionDiv=function(){var e=this.map.getMapContainer().querySelector("."+U0.Css.collection);return e||((e=document.createElement("div")).setAttribute("aria-label","map data"),e.setAttribute("role","listbox"),e.classList.add(U0.Css.collection),this.map.getMapContainer().appendChild(e)),e},U0.Css={collection:"accessible-indicator-collection-container"},U0);function U0(e){this.map=e,this.indicators=new Set}var H0,z0,w=window&&window.__extends||(H0=function(e,t){return(H0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}H0(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),B0=window&&window.__assign||function(){return(B0=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},F0=window&&window.__awaiter||function(e,s,a,c){return new(a=a||Promise)(function(r,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(o,n)}i((c=c.apply(e,s||[])).next())})},K0=window&&window.__generator||function(r,o){var n,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=o.call(r,a)}catch(e){t=[6,e],i=0}finally{n=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},G0=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},Y0=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},Z0=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&o>=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},W0=(w(V0,z0=Q),Object.defineProperty(V0.prototype,"isDisposed",{get:function(){return this.removed},enumerable:!1,configurable:!0}),V0.prototype.getCanvas=function(){return this.map.getCanvas()},V0.prototype.getCanvasContainer=function(){return this.map.getCanvasContainer()},V0.prototype.getMapContainer=function(){return this.map.getContainer()},V0.prototype.getServiceOptions=function(){return Xi(this.serviceOptions,C0._cloneCustomizer)},V0.prototype.setServiceOptions=function(e){this.serviceOptions=(new C0).merge(this.serviceOptions,e),this.serviceOptions["enable-accessibility"]?this.accessibleMapDelegate.addToMap():this.accessibleMapDelegate.removeFromMap();e=this.styles.serviceOptions.mapConfiguration!==this.serviceOptions.mapConfiguration||this.styles.serviceOptions.staticAssetsDomain!==this.serviceOptions.staticAssetsDomain||this.styles.serviceOptions.styleDefinitionsVersion!==this.serviceOptions.styleDefinitionsVersion||this.styles.serviceOptions.domain!==this.serviceOptions.domain||this.styles.serviceOptions.styleAPIVersion!==this.serviceOptions.styleAPIVersion;this.styles.serviceOptions=this.serviceOptions,e&&(this.styles.initPromise=null,this.setStyle({}))},V0.prototype.addRequestTransformer=function(e){this.serviceOptions.addTransformer(e)},V0.prototype.removeRequestTransformer=function(e){this.serviceOptions.removeTransformer(e)},V0.prototype.setCamera=function(e,t){if(void 0===t&&(t=!1),"padding"in e||"offset"in e||"bounds"in e){var r,o=(new Pw).merge({maxZoom:this.getCamera().maxZoom},e),n=this._generateSafeBounds(o.bounds),i={padding:o.padding,offset:o.offset,maxZoom:o.maxZoom};if(!(r=this.map.cameraForBounds(n,i))){var s=null===(s=this.map)||void 0===s?void 0:s.getContainer(),s={message:"The map cannot be fit to the current canvas with the given CameraBoundsOptions.",containerWidth:null==s?void 0:s.clientWidth,containerHeight:null==s?void 0:s.clientHeight,safeBounds:n,cameraForBoundsOptions:i};throw new Error(JSON.stringify(s))}"pitch"in e&&(r.pitch=e.pitch),"bearing"in e&&(r.bearing=e.bearing),"minPitch"in e&&this.map.setMinPitch(e.minPitch),"maxPitch"in e&&this.map.setMaxPitch(e.maxPitch),this.map.setMaxZoom(o.maxZoom),this._invokeEvent("maxzoomchanged",this.map.getMaxZoom()),n=this._generateSafeBounds(o.maxBounds)}else{i=(new Mw).merge(this.getCamera(),e);i.centerOffset&&2<=i.centerOffset.length&&(s=i.centerOffset,(o=ei([i.center],i.zoom))[0][0]+=s[0],o[0][1]+=s[1],i.center=$n(o,i.zoom)[0]),r={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),i.minPitch&&this.map.setMinPitch(i.minPitch),i.maxPitch&&this.map.setMaxPitch(i.maxPitch),this._invokeEvent("minzoomchanged",this.map.getMinZoom()),this._invokeEvent("maxzoomchanged",this.map.getMaxZoom()),n=this._generateSafeBounds(i.maxBounds)}n?this.map.setMaxBounds(n):this.map.setMaxBounds(null);n=(new vw).merge(e),e={duration:n.duration,easing:function(e){return e},offset:[0,0],animate:!0},t={fromControl:t};"jump"===n.type?this.map.jumpTo(r,t):"ease"===n.type?this.map.easeTo(B0(B0({},r),e),t):"fly"===n.type&&this.map.flyTo(B0(B0({},r),e),t)},V0.prototype.setCameraBounds=function(e){this.setCamera(e)},V0.prototype.getCamera=function(){var e=this.map.getBounds().getSouthWest().toArray(),t=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 Ai(e,t),minZoom:this.map.getMinZoom(),maxZoom:this.map.getMaxZoom()}},V0.prototype.setStyle=function(e,t){void 0===t&&(t=!0),delete e.preserveDrawingBuffer;e=(new d0).merge(this.styleOptions,e);e.autoResize!==this.styleOptions.autoResize&&this._setAutoResize(e.autoResize),e.language!==this.styleOptions.language&&(this.localizedStringsPromise=_u.getStrings(e.language)),e.renderWorldCopies!==this.styleOptions.renderWorldCopies&&this.map.setRenderWorldCopies(e.renderWorldCopies),e.showFeedbackLink!==this.styleOptions.showFeedbackLink&&this.copyrightControl.setOptions({showFeedbackLink:e.showFeedbackLink}),e.customAttribution!==this.styleOptions.customAttribution&&this.copyrightControl.setOptions({customAttribution:e.customAttribution}),e.showLogo!==this.styleOptions.showLogo&&this.copyrightControl.setOptions({showLogo:e.showLogo}),e.showTileBoundaries!==this.styleOptions.showTileBoundaries&&(this.map.showTileBoundaries=e.showTileBoundaries),e.showBuildingModels&&console.warn("showBuildingModels is deprecated.");t=t&&this.styleOptions.language===e.language&&this.styleOptions.view===e.view;this.styleOptions=e,this._setStyleComponents(e,t)},V0.prototype.getStyle=function(){return Hr(this.styleOptions)},V0.prototype.addIcon=function(e,t){this.imageSprite.add(e,t)},V0.prototype.addPins=function(e,t){var r,o=(new Ww).merge(t),n=this.layers.getLayerById(o.name),i=!1;if(n||(i=!0,n=new Sc(o.name+"-source",o.name,{source:o.name+"-source",minZoom:o.minZoom,maxZoom:o.maxZoom,iconOptions:{anchor:"center",size:o.iconSize,image:["case",["has","icon"],["get","icon"],o.icon],ignorePlacement:!o.cluster,opacity:o.opacity},textOptions:{anchor:"center",textField:["case",["has","point_count"],["to-string",["get","point_count"]],["has","title"],["to-string",["get","title"]],o.title],font:["case",["has","point_count"],["literal",["StandardFontCondensed-Bold"]],["literal",[o.textFont]]],size:["case",["has","point_count"],20,o.fontSize],ignorePlacement:!o.cluster,opacity:o.opacity,offset:["case",["has","point_count"],["literal",[.5,-.45]],["literal",[o.textOffset[0]/16,o.textOffset[1]/16]]],color:o.fontColor}})),!(n instanceof Sc))throw new Error("A layer with name '"+o.name+"' already exists but it is not a SymbolLayer.A SymbolLayer should be used for rendering pins.");var s=n.getSource();"string"==typeof s?(r=s,s=this.sources.getById(r)):r=s.getId();t=!1;if(s||(t=!0,s=new ps(r,{cluster:o.cluster})),!(s instanceof ps))throw new Error("The source with name '"+r+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");t&&this.sources.add(s),i&&this.layers.add(n,o.before);e=new Pi(e);o.overwrite?s.setShapes(e):s.add(e)},V0.prototype.addCircles=function(e,t){var r,o=(new Hw).merge(t),n=this.layers.getLayerById(o.name),i=!1;if(n||(i=!0,n=new pa(o.name+"-source",o.name,{source:o.name+"-source",minZoom:o.minZoom,maxZoom:o.maxZoom,opacity:o.opacity,radius:["case",["has","radius"],["get","radius"],o.radius],color:["case",["has","color"],["get","color"],o.color],strokeColor:["case",["has","outlineColor"],["get","outlineColor"],o.outlineColor],strokeWidth:["case",["has","outlineWidth"],["get","outlineWidth"],o.outlineWidth]})),!(n instanceof pa))throw new Error("A layer with name '"+o.name+"' already exists but it is not a BubbleLayer.A BubbleLayer should be used for rendering circles.");var s=n.getSource();"string"==typeof s?(r=s,s=this.sources.getById(r)):r=s.getId();t=!1;if(s||(t=!0,s=new ps(r)),!(s instanceof ps))throw new Error("The source with name '"+r+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");t&&this.sources.add(s),i&&this.layers.add(n,o.before);e=new Pi(e);o.overwrite?s.setShapes(e):s.add(e)},V0.prototype.addLinestrings=function(e,t){var r,o=(new Kw).merge(t),n=this.layers.getLayerById(o.name),i=!1;if(n||(i=!0,n=new Ba(o.name+"-source",o.name,{source:o.name+"-source",minZoom:o.minZoom,maxZoom:o.maxZoom,lineCap:o.cap,lineJoin:o.join,strokeOpacity:o.opacity,strokeColor:["case",["has","color"],["get","color"],o.color],strokeWidth:["case",["has","width"],["get","width"],o.width]})),!(n instanceof Ba))throw new Error("A layer with name '"+o.name+"' already exists but it is not a LineLayer.A LineLayer should be used for rendering linestrings.");var s=n.getSource();"string"==typeof s?(r=s,s=this.sources.getById(r)):r=s.getId();t=!1;if(s||(t=!0,s=new ps(r)),!(s instanceof ps))throw new Error("The source with name '"+r+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");t&&this.sources.add(s),i&&this.layers.add(n,o.before);e=new Pi(e);o.overwrite?s.setShapes(e):s.add(e)},V0.prototype.addPolygons=function(e,t){var r,o=(new Xw).merge(t),n=this.layers.getLayerById(o.name),i=!1;if(n||(i=!0,n=new ac(o.name+"-source",o.name,{source:o.name+"-source",minZoom:o.minZoom,maxZoom:o.maxZoom,fillOpacity:o.opacity,fillColor:["case",["has","color"],["get","color"],o.color]})),!(n instanceof ac))throw new Error("A layer with name '"+o.name+"' already exists but it is not a PolygonLayer.A PolygonLayer should be used for rendering linestrings.");var s=n.getSource();"string"==typeof s?(r=s,s=this.sources.getById(r)):r=s.getId();t=!1;if(s||(t=!0,s=new ps(r)),!(s instanceof ps))throw new Error("The source with name '"+r+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");t&&this.sources.add(s),i&&this.layers.add(n,o.before);e=new Pi(e);o.overwrite?s.setShapes(e):s.add(e)},V0.prototype.addRaster=function(e,t){var r=(new r0).merge(t),o=this.layers.getLayerById(r.name);if(!((o=o||new Uc({maxZoom:r.maxZoom,minZoom:r.minZoom,opacity:r.opacity,tileSize:256,tileUrl:"{subdomain}"},r.name))instanceof Uc))throw new Error("A layer with name '"+r.name+"' already exists but it is not a TileLayer.A TileLayer should be used for rendering raster images.");if("{subdomain}"!==o.getOptions().tileUrl)throw new Error("A TileLayer with name '"+r.name+"' already exists but was configured for a single tile url [default for new TileLayer(...)].");(t=!r.overwrite&&o.getOptions().subdomains||[]).push.apply(t,Y0([],G0(e))),o._setOptionsNoUpdate({subdomains:t}),this.layers.add(o,r.before)},V0.prototype.getLayers=function(){return this.layers.getLayers().map(function(e){return e.getId()})},V0.prototype.removeLayers=function(e){var t,r;try{for(var o=Z0(e),n=o.next();!n.done;n=o.next()){var i,s=n.value;this.layers.getLayerById(s)&&(this.layers.remove(s),i=s+"-source",this.sources.getById(i)&&this.sources.remove(i))}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},V0.prototype.addHtml=function(e,t){e.id||(e.id="marker_"+tn());var r=new du({htmlContent:e});return this.markers.add(r,t),e.id},V0.prototype.removeHtml=function(e){this.markers.remove(e)},V0.prototype.addEventListener=function(e,t,r){this.events._addLegacy(e,t,r)},V0.prototype.removeEventListener=function(e,t,r){this.events._removeLegacy(e,t,r)},V0.prototype.setUserInteraction=function(e){this.userInteractionDelegate.setOptions(e)},V0.prototype.getUserInteraction=function(){return this.userInteractionDelegate.getOptions()},V0.prototype.addControl=function(e,t){this.controls.add(e,t)},V0.prototype.removeControl=function(e){this.controls.remove(e)},V0.prototype.setTraffic=function(e){var t=this.trafficOptions.incidents,r=this.trafficOptions.flow;if(this.trafficOptions=(new bo).merge(this.trafficOptions,e),this.controls.getControls().filter(function(e){return e instanceof Po}).forEach(function(e){return e.updateButtonState()}),this.incidentDelegate&&(this.trafficOptions.incidents?t||this.incidentDelegate.addToMap():this.incidentDelegate.removeFromMap()),this.trafficOptions.flow&&"none"!==this.trafficOptions.flow){["absolute","relative-delay"].includes(this.trafficOptions.flow)&&console.warn("The 'absolute' and 'relative-delay' flow options are deprecated. Please use 'relative' instead.");try{this.trafficOptions.flow!==r&&this.flowDelegate.addToMap()}catch(e){throw this.trafficOptions.flow=r,e}}else this.flowDelegate.removeFromMap()},V0.prototype.getTraffic=function(){return Hr(this.trafficOptions)},V0.prototype.remove=function(){this.dispose()},V0.prototype.clear=function(){this.popups.clear(),this.layers.clear(),this.sources.clear(),this.markers.clear(),this.indicators.clear()},V0.prototype.dispose=function(){var e;for(this.clear(),this.map.remove(),null!==(e=this.authentication)&&void 0!==e&&e.dispose(),this.removed=!0,window.removeEventListener("resize",this._windowResizeCallback);this.getMapContainer().firstChild;){var t=this.getMapContainer().firstChild;this.getMapContainer().removeChild(t)}},V0.prototype.resize=function(e,t,r){"number"!=typeof e&&"string"!=typeof e||"number"!=typeof t&&"string"!=typeof t?r=e:(e=e,this.getMapContainer().style.height="number"==typeof e?e+"px":e,this.getMapContainer().style.width="number"==typeof t?t+"px":t);t=this.getMapContainer().style.overflow;this.getMapContainer().style.overflow="hidden",this.map.resize(r),this.getMapContainer().style.overflow=t},V0.prototype.pixelsToPositions=function(e){var t,r,o=[];try{for(var n=Z0(e),i=n.next();!i.done;i=n.next()){var s=i.value,a=this.map.unproject(s);o.push(new gi(a.lng,a.lat))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return o},V0.prototype.positionsToPixels=function(e){var t,r,o=[];try{for(var n=Z0(e),i=n.next();!i.done;i=n.next()){var s=i.value,a=this.map.project(s);o.push(new an(a.x,a.y))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return o},V0.prototype.areTilesLoaded=function(){return this.map.areTilesLoaded()},V0.prototype.stop=function(){this.map.stop()},V0.prototype.triggerRepaint=function(){this.map.triggerRepaint()},V0.prototype.enableElevation=function(e,t){this.map.setTerrain("string"==typeof e?{source:e,exaggeration:t}:{source:e.getId(),exaggeration:t})},V0.prototype.disableElevation=function(){this.map.setTerrain(null)},V0.prototype._getMap=function(){return this.map},V0.prototype._rebuildStyle=function(t){return void 0===t&&(t=!0),F0(this,void 0,void 0,function(){return K0(this,function(e){return this.styles.setStyle(this.styleOptions,t),this.imageSprite._restoreImages(),[2]})})},V0.prototype._isLoaded=function(){return this.loaded},V0.prototype._isReady=function(){return this.ready},V0.prototype._getLocalizedStrings=function(){return this.localizedStringsPromise},V0.prototype._sendRequest=function(e,t,r){var o;return(o="function"==typeof this.serviceOptions.transformRequest?this.serviceOptions.transformRequest(e,t):o)?fetch(o.url||e,{credentials:o.credentials,headers:B0(B0({},r),o.headers),method:"GET",mode:"cors"}):fetch(e,{headers:r,method:"GET",mode:"cors"})},V0.prototype._substituteDomainLanguageViewAndSignInRequest=function(e,t){var r,o;(e.includes(p)||e.includes(h))&&(o=new RegExp("[^{]"+p+"[^}]"),e.match(o)&&(t.url=t.url.replace(p,h)),D.protoRegEx.test(this.serviceOptions.domain)?(o=t.url.indexOf(h),t.url=this.serviceOptions.domain+t.url.substring(o+h.length)):t.url=t.url.replace(h,this.serviceOptions.domain)),(t.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase())||t.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase()))&&null!==(r=this.authentication)&&void 0!==r&&r.signRequest(t),e.includes(g)&&(t.url=t.url.replace(g,this.styleOptions.language)),e.includes(d)&&(t.url=this.styleOptions.view?t.url.replace(d,this.styleOptions.view):t.url.replace(d,"").replace("&"+f+"=",""))},V0.prototype._setAutoResize=function(e){e?window.addEventListener("resize",this._windowResizeCallback):window.removeEventListener("resize",this._windowResizeCallback)},V0.prototype._setStyleComponents=function(a,c){var u=this;void 0===c&&(c=!0),this.removed||this.styles.definitions().then(function(e){var t,r,o=!0;if(u.styleOptions.style)try{for(var n=Z0(e.configurations),i=n.next();!i.done;i=n.next()){var s=i.value;if(u.styleOptions.style===s.name){o=!1;break}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}o&&(u.styleOptions.style=e.defaultConfiguration),u.styleOptions=a,u._rebuildStyle(c)})},V0.prototype._updateGlobalDefaults=function(e){e&&(e.authOptions&&!Yu&&il(e.authOptions),e.domain&&!Uu&&sl(e.domain),e.styleDefinitionsPath&&!Hu&&al(e.styleDefinitionsPath),e.workerCount&&!Bu&&cl(e.workerCount),e.maxParallelImageRequests&&!Fu&&ul(e.maxParallelImageRequests),!e.subscriptionKey&&!e["subscription-key"]||Yu||pl(e.subscriptionKey||e["subscription-key"]),!e.sessionId&&!e["session-id"]||Gu||hl(e.sessionId||e["session-id"]),e.language&&!Ku&&ll(e.language),!e.userRegion&&!e.view||ju||dl(e.userRegion||e.view))},V0.prototype._generateSafeBounds=function(e){if(e){var t=Ai.getSouth(e),r=Ai.getWest(e),o=Ai.getNorth(e),n=Ai.getEast(e);if(!(isFinite(t)&&isFinite(r)&&isFinite(o)&&isFinite(n)))throw new Error("The bounds specified are invalid: ["+e+"]");for(;n<r;)n+=360;return new Ai([r,t,n,o])}return e},V0.prototype._detectHighContrast=function(){var e,t;switch(Sl.getHighContrastMode()){case"invert":case"light":e=V0.Css.hcLight,t="high_contrast_light";break;case"dark":e=V0.Css.hcDark,t="high_contrast_dark"}e&&this.map.getContainer().classList.add(e),t&&"road"===this.styleOptions.style&&(this.styleOptions.style=t)},V0.Css={canvasContainer:"atlas-map-canvas-container",canvas:"atlas-map-canvas",container:"atlas-map",hcDark:"high-contrast-dark",hcLight:"high-contrast-light"},V0);function V0(e,t){var r,o,n=z0.call(this)||this;n.removed=!1,n.loaded=!1,n.ready=!1,n._windowResizeCallback=function(){return n.resize()},n._updateGlobalDefaults(t),n.serviceOptions=(new C0).merge(t),n.styleOptions=(new d0).merge(t),n.trafficOptions=new bo,n.styles=new L0(n,n.serviceOptions),n.serviceOptions.authOptions.subscriptionKey&&(n.serviceOptions.authOptions.subscriptionKey=encodeURIComponent(n.serviceOptions.authOptions.subscriptionKey)),r=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,r),arguments[2]&&"ENVIRONMENT"in window&&window.ENVIRONMENT.hmr?(o=arguments[2],n.ready=!0,n.loaded=!0):(e={antialias:n.styleOptions.antialias,attributionControl:!1,container:e,fadeDuration:n.serviceOptions.fadeDuration,localIdeographFontFamily:n.serviceOptions.localIdeographFontFamily,preserveDrawingBuffer:n.styleOptions.preserveDrawingBuffer,refreshExpiredTiles:n.serviceOptions.refreshExpiredTiles,renderWorldCopies:n.styleOptions.renderWorldCopies,trackResize:!1,transformRequest:function(e,t){var r={url:e};return"Tile"===t||"Source"===t?(e.includes(p)&&n.insights&&n.insights.trackEvent({name:"TileLoad"}),n._substituteDomainLanguageViewAndSignInRequest(e,r)):"Style"!==t&&"SpriteJSON"!==t&&"SpriteImage"!==t&&"Glyphs"!==t||n.styles._transformStyleRequest(e,r),n.serviceOptions.transformRequest&&uo(r,n.serviceOptions.transformRequest(r.url,t)),r}},o=new u.Map(e));try{n.map=o,n.authentication=new D_(n),n.controls=new U_(n),n.events=new Z_(n),n.imageSprite=new X_(n),n.layers=new cw(n),n.markers=new J_(n),n.sources=new fw(n),n.popups=new hw(n),n.indicators=new j0(n),n.map.getContainer().classList.add(V0.Css.container),n.map.getCanvasContainer().classList.add(V0.Css.canvasContainer),n.map.getCanvas().classList.add(V0.Css.canvas),n._detectHighContrast(),n.copyrightControl=new Rl({showFeedbackLink:n.styleOptions.showFeedbackLink,showLogo:n.styleOptions.showLogo,customAttribution:n.styleOptions.customAttribution}),n.controls.add(n.copyrightControl,{position:c.ControlPosition.NonFixed});var i=n.authentication?n.authentication.initialize():Promise.resolve();if(n.removed)return n;var s=function(){n.loaded=!0,n.map.off("load",s)};n.map.on("load",s);var a=function(){n.ready=!0,n.map.off("styledata",a),n.events.invoke("ready",{map:n,type:"ready"})};n.map.on("styledata",a),n._setAutoResize(n.styleOptions.autoResize),n.map.showTileBoundaries=n.styleOptions.showTileBoundaries,n.localizedStringsPromise=_u.getStrings(n.styleOptions.language),i.then(function(){return n.styles.definitions()}).then(function(e){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(e){e=e instanceof Error?e:new Error(e);n.events.invoke("error",{map:n,type:"error",error:e})}),n.setCamera(B0(B0({minZoom:1},t),{type:"jump",duration:0})),n.incidentDelegate=new nh(n),n.flowDelegate=new Ql(n),n.accessibleMapDelegate=new Jl(n),n.userInteractionDelegate=new fh(n,t),n.userInteractionDelegate.addToMap(),n.copyrightDelegate=new xh(n,n.copyrightControl,n.styleOptions)}catch(e){throw e}return n}var J0=window&&window.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},Q0=window&&window.__spreadArray||function(e,t){for(var r=0,o=t.length,n=e.length;r<o;r++,n++)e[n]=t[r];return e},k=(X0.applyTemplate=function(t,r){var o,n,e,i=this,s=document.createElement("div");return s.classList.add(X0.Css.template),t&&("boolean"!=typeof(r=r||{}).singleDescription&&(r.singleDescription=!0),r.sandboxContent="boolean"!=typeof r.sandboxContent||r.sandboxContent,r.title&&"string"==typeof r.content&&(r.content.includes("{title}")||r.content.includes("{name}"))||(t.title?r.title="{title}":t.name&&(r.title="{name}")),"boolean"!=typeof r.detectHyperlinks&&(r.detectHyperlinks=!0),"boolean"!=typeof r.parsePropertyPaths&&(r.parsePropertyPaths=!0),r.textColor&&(s.style.color=r.textColor),r.fillColor&&(s.style.backgroundColor=r.fillColor),r.title&&((e=this._applyStringTemplate(t,r.title,r)).innerText=e.textContent||e.innerText||"",this._appendChild(s,e,X0.Css.title)),(o=document.createElement("div")).classList.add(X0.Css.content),Array.isArray(r.content)?0<r.content.length&&r.content[0].propertyPath?this._appendChild(o,this._generateContent(t,r.content,r),X0.Css.item):r.content.forEach(function(e){i._appendChild(o,i._generateContent(t,e,r),X0.Css.item)}):(n=0,t.description&&Object.keys(t).forEach(function(e){i._ignoreProperty(e,t[e])||n++}),e=void 0,1===n||r.singleDescription&&t.description||2===n&&t.Snippet?(e=document.createElement("div")).innerHTML=t.description:e=this._generateContent(t,r.content,r),this._appendChild(o,e,X0.Css.item)),""!==o.innerHTML&&(r.sandboxContent?s.appendChild(X0._createSandboxedIframe(o,r)):s.appendChild(o))),s},X0._createSandboxedIframe=function(e,t){var r=document.createElement("iframe");r.sandbox.add("allow-popups");var o=e.innerHTML,n=!1,i=100,s=550,a=10,c=0;document.body.scrollWidth<=340&&(s=300,i=50);var u=o.split(/<(tr|div|br|li|h[0-9]|p>)/),c=Math.max.apply(Math,Q0([],J0(u.map(function(e){return e.replace(/<[a-zA-Z0-9\s=\/]+>/g,"").length}))))-1,e=Math.ceil(3.5*c);e<s&&(s=e,i=c),o.includes("<img")||o.includes("<video")?(n=!0,r.width="550px"):(c=-1<o.indexOf(X0.Css.table)?25:20,a+=Math.max(.5*u.length*c,Math.ceil(o.replace(/<[a-zA-Z0-9\s=\/]+>/g,"").length/i)*c)),r.width=s+"px",r.height=n||280<a?"280px":a+"px";a=t.textColor?"color:"+t.textColor+";":"",t=t.fillColor?"background-color:"+t.fillColor+";":"",o='<html><head><title></title><meta charset="utf-8" /><meta http-equiv="x-ua-compatible" content="IE=Edge" /><link rel="stylesheet" href="'+X0._cssUrl+'" type="text/css"/><style>html, body{margin:0;padding:0;'+a+t+'}</style></head><body><div class="'+X0.Css.template+'" style="padding:0;width:'+(s-20)+'px">'+o+"</div></body></html>";return void 0===r.srcdoc?r.src="data:text/html;charset=utf-8,"+encodeURI(o):r.srcdoc=o,r},X0._appendChild=function(e,t,r){t&&(r&&(t.className=(t.className?t.className+" ":"")+r),e.appendChild(t))},X0._generateContent=function(e,t,r){if(t)return Array.isArray(t)?this._generatePropertyInfoTable(e,t,r):this._applyStringTemplate(e,t,r);e=this._generateDynamicTableHtml(e,null,r);if(e){r=document.createElement("div");return r.innerHTML=e,r}return null},X0._applyStringTemplate=function(e,t,r){if(t){for(var o,n=t,i=this._placeholderRx.exec(t);i;)2<=i.length&&(o=this._getPropertyValue(e,i[1],r),n=n.replace(i[0],o)),i=this._placeholderRx.exec(t);if(n){(n=n.trim()).includes("<")&&(n=n.replace(/[\r\n]+/g,"<br/>"));var s=document.createElement("div");return s.innerHTML=n,s}}return null},X0._getPropertyValue=function(e,t,r,o){var n=r.parsePropertyPaths?t.split("/"):[t],i=n.length;if(0<i&&e){var s=n[0],a=e[s];if(r.detectHyperlinks&&"link"===t&&(!o||o.hyperlinkFormat)){var c,u=[];if(Array.isArray(a)?a.forEach(function(e){e.href?u.push(e):"string"==typeof e&&u.push({href:e})}):a.href&&u.push(a),0<u.length){o&&o.hyperlinkFormat?c=o.hyperlinkFormat:r&&r.hyperlinkFormat&&(c=r.hyperlinkFormat);var l=c&&c.target?c.target:"_blank",h=[];return u.forEach(function(e){e.title||c&&c.label||!e.rel||h.push(e.rel," - "),h.push('<a href="',e.href,'" target="',l,'">'),e.title?h.push(e.title):c&&c.label?h.push(c.label):h.push(e.href),h.push("</a>","<br/>")}),h.pop(),h.join("")}}if(null!=a){for(var p=void 0,p=1;p<i&&(a=a[n[p]],s=n[p],null!=a);p++);if(p===i&&null!=a){var d=void 0;if((d=void 0!==a.value?a.value:a)instanceof Date)return o&&o.dateFormat?d.toLocaleString(void 0,o.dateFormat):r.dateFormat?d.toLocaleString(void 0,r.dateFormat):d.toISOString();if("object"==typeof d)return(g=this._generateDynamicTableHtml(d,n.slice(1),r))||"";if("number"==typeof d){if(o){if(o.dateFormat)return new Date(d).toLocaleString(void 0,o.dateFormat);if(o.numberFormat)return d.toLocaleString(void 0,o.numberFormat)}else if(/(timestamp|date)/gi.test(s))return new Date(d).toISOString();return d.toLocaleString(void 0,r.numberFormat)}if("string"==typeof d&&""!==d&&!/[\n\r<>\s]/g.test(d)&&(r.detectHyperlinks||o&&o.hyperlinkFormat)){var d=d.trim(),f=this._isUrlRx.test(d)||o&&o.hyperlinkFormat,e=this._isImageUrlRx.test(d)&&(f||d.startsWith("data:image")),t=this._emailRx.test(d);if(f||e||t){f=void 0;o&&o.hyperlinkFormat?f=o.hyperlinkFormat:r&&r.hyperlinkFormat&&(f=r.hyperlinkFormat);var g=void 0;g=f&&f.target?' target="'+f.target+'"':' target="_blank"';r=""+(f&&f.label?f.label:d);f&&f.scheme?d=f.scheme+d:t&&(d="mailto:"+d);t=f&&f.label?' alt="'+f.label+'"':"";return'<a href="'+d+'"'+g+">"+(r=f&&f.isImage||e?'<img src="'+d+'" style="max-width:100%"'+t+'"/>':r)+"</a>"}}return d.toString()}}}return""},X0._generatePropertyInfoTable=function(r,e,o){if(r&&e&&0<e.length){var n=[],i=this;n.push('<table class="'+i.Css.table+'">'),e.forEach(function(e){var t=i._getPropertyValue(r,e.propertyPath,o,e);e.hideLabel?n.push('<tr><td colspan="2">',t,"</td></tr>"):(e=e.label||e.propertyPath.split("/")[0],n.push("<tr><th>",e,"</th><td>",t,"</td></tr>"))}),n.push("</table>");e=document.createElement("div");return e.innerHTML=n.join(""),e}return null},X0._generateDynamicTableHtml=function(t,e,r){var o=this;if(t){var n=[],i=this;n.push('<table class="'+i.Css.table+'">');var s=e&&0<e.length?e.join("/")+"/":"",a=0;return(Object.keys(t).forEach(function(e){o._ignoreProperty(e,t[e])||(n.push("<tr><th>",e,"</th><td>",i._getPropertyValue(t,s+e,r),"</td></tr>"),a++)}),0===a)?null:(n.push("</table>"),n.join(""))}return null},X0._ignoreProperty=function(e,t){switch(e){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===e.indexOf("_")||null==t||""===t)return!0}return!1},X0._placeholderRx=/\{([a-zA-Z0-9_\/\s]+)\}/gi,X0._isUrlRx=/^(http|https|ftp|tel|mailto):\/\//i,X0._isImageUrlRx=/(^data:image|.png$|.jpg$|.jpeg$|.gif$|.bmp$|.svg|.tif|.tiff$)/i,X0._emailRx=/^[^\.\s@:](?:[^\s@:]*[^\s@:\.])?@[^\.\s@]+(?:\.[^\.\s@]+)*$/,X0._cssUrl=new D({domain:t,path:"sdk/javascript/mapcontrol/"+U.getEndpointVersion()+"/atlas.min.css"}).toString(),X0.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"},X0);function X0(){this.detectHyperlinks=!0,this.parsePropertyPaths=!0}w=new D({domain:t,path:"sdk/javascript/mapcontrol/"+U.getEndpointVersion()+"/mapbox-gl-rtl-text.min.js"});u.setRTLTextPlugin(w.toString(),function(e){e&&console.warn(e)},!0),c.HtmlMarker=du,c.Map=W0,c.Pixel=an,c.Popup=iu,c.PopupTemplate=k,c.Shape=Ci,c._getAssetDomain=function(){return e},c._getDomain=function(){return Ru},c._hasMaxParallelImageRequests=_l,c._hasSetAuthenticationOptions=gl,c._hasSetDomain=yl,c._hasSetLanguage=wl,c._hasSetSessionId=bl,c._hasSetStyleDefinitionsPath=ml,c._hasSetStyleDefinitionsVersion=function(){return zu},c._hasSetView=Cl,c._hasWorkerCount=vl,c.addImageTemplate=function(e,t,r){!r&&El[e.toLowerCase()]||(El[e.toLowerCase()]=t)},c.clearPrewarmedResources=function(){u.clearPrewarmedResources()},c.control=Se,c.data=xe,c.getAllImageTemplateNames=function(){return Object.keys(El)},c.getAuthenticationOptions=Zu,c.getDomain=Vu,c.getImageTemplate=fl,c.getLanguage=tl,c.getMaxParallelImageRequests=el,c.getSessionId=rl,c.getStaticAssetsDomain=Wu,c.getStyleAPIVersion=Xu,c.getStyleDefinitionsPath=Ju,c.getStyleDefinitionsVersion=Qu,c.getSubscriptionKey=ol,c.getUserRegion=function(){return Au},c.getVersion=function(){return U.getFullVersion()},c.getView=nl,c.getWorkerCount=$u,c.internal=te,c.isSupported=function(e){return!bu.isIE()},c.layer=ve,c.math=Oe,c.prewarm=function(){u.prewarm()},c.setAuthenticationOptions=il,c.setDomain=sl,c.setLanguage=ll,c.setMaxParallelImageRequests=ul,c.setSessionId=hl,c.setStyleAPIVersion=function(e){Du=e},c.setStyleDefinitionsPath=al,c.setStyleDefinitionsVersion=function(e){Lu=e,zu=!0},c.setSubscriptionKey=pl,c.setUserRegion=dl,c.setView=function(e){Au=e,ju=!0},c.setWorkerCount=cl,c.source=Ie,Object.defineProperty(c,"__esModule",{value:!0})});
|
|
55
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("azuremaps-maplibre-gl")):"function"==typeof define&&define.amd?define(["exports","azuremaps-maplibre-gl"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).atlas=e.atlas||{},e.maplibregl)}(this,function(l,c){"use strict";var e="atlas.microsoft.com",t="atlas.microsoft.com",o="styling",r="2023-01-01",n="https://login.microsoftonline.com/",u="api-version",i="Authorization",a="Bearer ",s="jwt-sas ",h="{{azMapsDomain}}",p="{azMapsDomain}",d="{{azMapsView}}",f="view",g="{{azMapsLanguage}}",y="{{azMapsStylingPath}}",m="{{azMapsStylePath}}",v="styling",_="styles",w="2.0",b="Map-Agent",C="x-ms-client-id",E="Ms-Am-Request-Origin",S="MapControl",T="https://atlas.microsoft.com/.default",I="Session-Id",A=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},k=(O.prototype.merge=function(){for(var t,e,o,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];try{for(var i=A(r),a=i.next();!a.done;a=i.next()){var s=a.value;if(s)for(var c in s)s.hasOwnProperty(c)&&this.hasOwnProperty(c)&&(void 0!==s[c]&&null!=s[c]?this[c]instanceof O?this[c].merge(s[c]):this[c]=s[c]:(o=o||new(Object.getPrototypeOf(this).constructor),this[c]=o[c]))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return this},O);function O(){}var P,x,R=window&&window.__extends||(P=function(e,t){return(P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}P(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),M=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},N=(R(L,x=k),L);function L(){var e=null!==x&&x.apply(this,arguments)||this;return e.domain=void 0,e.headers={},e.path="",e.protocol="https",e.queryParams={},e.subdomain="",e}var D=(q.prototype.get=function(){return fetch(this.toString(),{method:"GET",mode:"cors",headers:new Headers(this.options.headers)}).then(function(e){if(e.ok)return e.json();throw new Error("HTTP ".concat(e.status,": ").concat(e.statusText))})},q.prototype.toString=function(){var e=this,t=Object.entries(e.options.queryParams).map(function(e){var t=M(e,2),e=t[0],t=t[1];return"".concat(e,"=").concat(t)}).join("&"),o=[],r=e.options.path||"";return q.protoRegEx.test(r)?o.push(r):(e.options.domain&&(q.protoRegEx.test(e.options.domain)||(o.push("".concat(e.options.protocol,"://")),o.push(e.options.subdomain?"".concat(e.options.subdomain,"."):"")),o.push(e.options.domain)),o.push(e.options.path?"/".concat(r):"")),o.push(t?"?".concat(t):""),o.join("")},q.protoRegEx=new RegExp(/^(((file|http|https):\/\/)|blob:)/i),q);function q(e){this.options=(new N).merge(e)}var j="3.0.0",U=(H.getFullVersion=function(){return j},H.getEndpointVersion=function(){var e=j.indexOf(".");return-1===(e=j.indexOf(".",e+1))?j:j.substring(0,e)},H);function H(){}function z(e){var t=document.createElement("span");return t.innerText=e,t.classList.add("tooltiptext"),-1!=navigator.userAgent.indexOf("Edg")?t.classList.add("edge"):-1!=navigator.userAgent.indexOf("Chrome")?t.classList.add("chrome"):-1!=navigator.userAgent.indexOf("Safari")?t.classList.add("safari"):-1!=navigator.userAgent.indexOf("Firefox")&&t.classList.add("firefox"),-1!=navigator.userAgent.indexOf("Windows")?t.classList.add("win"):-1!=navigator.userAgent.indexOf("Macintosh")&&t.classList.add("mac"),t}function B(n,i,a){function e(e){var t=i.getBoundingClientRect(),o=n.getBoundingClientRect(),r=t.x+o.width>window.innerWidth?window.innerWidth-o.width:t.x,o=t.y+t.height+o.height+4>window.innerHeight?t.y-o.height-4:t.y+t.height+4;a&&i.parentElement&&(t=i.parentElement?i.parentElement.getBoundingClientRect():null,n.style.position="absolute",r-=t.x,o-=t.y),n.style.transform="translate(".concat(r,"px, ").concat(o,"px)")}void 0===a&&(a=!1),i.addEventListener("mouseover",e),i.addEventListener("focusin",e)}var F,K=window&&window.__extends||(F=function(e,t){return(F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}F(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)});l.ControlPosition=void 0,(Yt=l.ControlPosition||(l.ControlPosition={})).TopLeft="top-left",Yt.TopRight="top-right",Yt.BottomLeft="bottom-left",Yt.BottomRight="bottom-right",Yt.NonFixed="non-fixed";var G,Y=(K(Z,G=k),Z);function Z(){var e=null!==G&&G.apply(this,arguments)||this;return e.position=l.ControlPosition.NonFixed,e}var W=(V.prototype.getLuminosity=function(){for(var e=[this.r,this.g,this.b],t=[],o=0;o<e.length;o++){var r=e[o]/255;t[o]=r<=.03928?r/12.92:Math.pow((.055+r)/1.055,2.4)}return.2126*t[0]+.7152*t[1]+.0722*t[2]},V.prototype.getRBGA=function(e){var t=document.createElement("canvas").getContext("2d");t.globalAlpha=1,t.fillStyle=e,t.fillRect(0,0,1,1);t=t.getImageData(0,0,1,1).data;return[t[0],t[1],t[2],t[3]]},V);function V(e){var t;e&&(t=void 0,3<=(t="string"==typeof e?this.getRBGA(e):e).length&&(this.r=t[0],this.g=t[1],this.b=t[2],3<t.length&&(this.a=t[3])))}l.ControlStyle=void 0,(Wt=l.ControlStyle||(l.ControlStyle={})).light="light",Wt.dark="dark",Wt.auto="auto";var J=Map,Q=(X.prototype._addEventListener=function(e,t,o){this.listeners.has(e)||this.listeners.set(e,new J),this.listeners.get(e).set(t,o)},X.prototype._removeEventListener=function(e,t){this.listeners.has(e)&&this.listeners.get(e).delete(t)},X.prototype._invokeEvent=function(o,r){var n=this;this.listeners.has(o)&&this.listeners.get(o).forEach(function(e,t){e&&n._removeEventListener(o,t);try{t(r)}catch(e){console.error(e)}})},X);function X(){this.listeners=new J}var $,ee,te=Object.freeze({__proto__:null,EventEmitter:Q}),oe=((window&&window.__extends||($=function(e,t){return($=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}$(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(re,ee=Q),re.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},re.prototype.buildContainer=function(e,t,o,r){return this._map=e,this._container=document.createElement(r||"div"),this._container.classList.add("azure-maps-control-container"),"string"==typeof o&&this._container.setAttribute("aria-label",o),t.toLowerCase()===l.ControlStyle.auto?this._map&&this._map.events.add("stylechanged",this._onStyleChange):this._container.classList.add(t),this._container},re.prototype._setTheme=function(e){this._theme!==e&&(this._container.classList.remove(this._theme),this._container.classList.add(e),this._theme=e)},re.activateClickDelay=100,re);function re(){var t=null!==ee&&ee.apply(this,arguments)||this;return t._onStyleChange=function(){t._map.getStyle().style.toLowerCase().startsWith("blank")?t._observer||(t._onBackgroundChange(),t._observer=new MutationObserver(t._onBackgroundChange),t._observer.observe(t._map.getMapContainer(),{attributes:!0,attributeFilter:["style"]})):(t._observer&&(t._observer.disconnect(),delete t._observer),t._map.styles.getThemeAsync(t._map.getStyle()).then(function(e){t._setTheme(e)}))},t._onBackgroundChange=function(){var e=new W(t._map.getMapContainer().style.backgroundColor).getLuminosity(),e=isNaN(e)||.5<e?l.ControlStyle.light:l.ControlStyle.dark;t._setTheme(e)},t}var ne,ie,ae=((window&&window.__extends||(ne=function(e,t){return(ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}ne(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(se,ie=k),se);function se(){var e=null!==ie&&ie.apply(this,arguments)||this;return e.rotationDegreesDelta=15,e.style=l.ControlStyle.light,e.inverted=!1,e}var ce,ue,le=((window&&window.__extends||(ce=function(e,t){return(ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}ce(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(he,ue=oe),he.prototype.onAdd=function(e,t){var o=this,r=this.buildContainer(e,this.options.style,"Rotation Control"),n=this.constructRotationButton(e),i=this.constructRotationGrid(e,t),e=z("Reset to Default Rotation");return r.addEventListener("mouseover",function(e){o.lastActiveTime=o.lastActiveTime||e.timeStamp,o.hasMouse=!0,r.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),r.addEventListener("focusin",function(e){o.lastActiveTime=o.lastActiveTime||e.timeStamp,o.hasFocus=!0,r.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),r.addEventListener("mouseleave",function(){o.hasMouse=!1,o.hasFocus||(delete o.lastActiveTime,r.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),r.addEventListener("focusout",function(e){e.relatedTarget instanceof Node&&r.contains(e.relatedTarget)||(o.hasFocus=!1,o.hasMouse||(delete o.lastActiveTime,r.classList.remove("in-use"),i.classList.add("hidden-accessible-element")))}),i.addEventListener("keydown",function(e){"Escape"!==e.key&&"Esc"!==e.key||(e.stopPropagation(),n.focus(),r.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),t&&he.InvertOrderPositions.includes(t.position)?(r.appendChild(i),r.appendChild(n),r.appendChild(e),B(e,n)):(r.appendChild(n),r.appendChild(e),B(e,n),r.appendChild(i)),r},he.prototype.constructRotationGrid=function(e,t){var o=document.createElement("div");o.classList.add("sub-container"),o.classList.add("hidden-accessible-element");var r=this.constructRightRotationButton(e),n=this.constructLeftRotationButton(e),i=z("Rotate Left"),e=z("Rotate Right");return t&&he.InvertOrderPositions.includes(t.position)?(o.appendChild(r),o.appendChild(e),B(e,r),o.appendChild(n),o.appendChild(i),B(i,n)):(o.appendChild(n),o.appendChild(i),B(i,n),o.appendChild(r),o.appendChild(e),B(e,r)),o},he.prototype.constructRotationButton=function(t){var o=this,e=document.createElement("button");e.classList.add("azure-maps-control-button"),e.classList.add("rotation"),e.setAttribute("aria-label","Reset to Default Rotation"),e.setAttribute("alt","Reset to Default Rotation"),e.setAttribute("type","button");var r=document.createElement("div");return e.appendChild(r),e.addEventListener("click",function(e){e.timeStamp-o.lastActiveTime>oe.activateClickDelay&&t.setCamera({bearing:he.DefaultRotation},!0)}),t.events.add("rotate",function(e){r.style.transform="rotate(".concat(-e.map.getCamera().bearing,"deg)")}),e},he.prototype.constructRightRotationButton=function(e){var t=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(){e.setCamera({bearing:e.getCamera().bearing-(t.options.inverted?-1:1)*t.options.rotationDegreesDelta,duration:he.RotationDuration,type:"ease"},!0)}),o},he.prototype.constructLeftRotationButton=function(e){var t=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(){e.setCamera({bearing:e.getCamera().bearing+(t.options.inverted?-1:1)*t.options.rotationDegreesDelta,duration:he.RotationDuration,type:"ease"},!0)}),o},he.DefaultRotation=0,he.RotationDuration=100,he.InvertOrderPositions=[l.ControlPosition.BottomRight,l.ControlPosition.TopRight],he);function he(e){var t=ue.call(this)||this;return t.hasMouse=!1,t.hasFocus=!1,t.options=(new ae).merge(e),t}var pe,de,fe=((window&&window.__extends||(pe=function(e,t){return(pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}pe(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(ge,de=k),ge);function ge(){var e=null!==de&&de.apply(this,arguments)||this;return e.pitchDegreesDelta=10,e.style=l.ControlStyle.light,e.inverted=!1,e}var ye,me,ve=((window&&window.__extends||(ye=function(e,t){return(ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}ye(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(_e,me=oe),_e.prototype.onAdd=function(e,t){var o=this,r=this.buildContainer(e,this.options.style,"Pitch Control"),n=this.constructPitchButton(e),i=this.constructPitchGrid(e,t),a=z("Reset to Default Pitch");return r.addEventListener("mouseover",function(e){o.lastActiveTime=o.lastActiveTime||e.timeStamp,o.hasMouse=!0,r.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),r.addEventListener("focusin",function(e){o.lastActiveTime=o.lastActiveTime||e.timeStamp,o.hasFocus=!0,r.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),r.addEventListener("mouseleave",function(){o.hasMouse=!1,o.hasFocus||(delete o.lastActiveTime,r.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),r.addEventListener("focusout",function(e){e.relatedTarget instanceof Node&&r.contains(e.relatedTarget)||(o.hasFocus=!1,o.hasMouse||(delete o.lastActiveTime,r.classList.remove("in-use"),i.classList.add("hidden-accessible-element")))}),i.addEventListener("keydown",function(e){"Escape"!==e.key&&"Esc"!==e.key||(e.stopPropagation(),n.focus(),r.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),t&&_e.INVERT_ORDER_POSITIONS.includes(t.position)?(r.appendChild(i),r.appendChild(n),r.appendChild(a),B(a,r)):(r.appendChild(n),r.appendChild(a),B(a,r),r.appendChild(i)),this.map=e,this.container=r,this.pitchButton=n,e.events.add("pitch",this.pitchChanged),this.updatePitchButtonsState(),r},_e.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)},_e.prototype.constructPitchGrid=function(e,t){var o=document.createElement("div");o.classList.add("sub-container"),o.classList.add("hidden-accessible-element"),this.pitchIncrementButton=this.constructPitchIncrementButton(e),this.pitchDecrementButton=this.constructPitchDecrementButton(e);var r=z("Increase Pitch"),e=z("Decrease Pitch");return t&&_e.INVERT_ORDER_POSITIONS.includes(t.position)?(o.appendChild(this.pitchDecrementButton),o.appendChild(e),B(e,this.pitchDecrementButton),o.appendChild(this.pitchIncrementButton),o.appendChild(r),B(r,this.pitchIncrementButton)):(o.appendChild(this.pitchIncrementButton),o.appendChild(r),B(r,this.pitchIncrementButton),o.appendChild(this.pitchDecrementButton),o.appendChild(e),B(e,this.pitchDecrementButton)),o},_e.prototype.constructPitchButton=function(e){var t=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-t.lastActiveTime>oe.activateClickDelay&&e.setCamera({pitch:_e.DEFAULT_PITCH},!0)}),o},_e.prototype.constructPitchDecrementButton=function(e){var t=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(){e.setCamera({pitch:e.getCamera().pitch-(t.options.inverted?-1:1)*t.options.pitchDegreesDelta,duration:_e.PITCH_DURATION_MS,type:"ease"},!0)}),o},_e.prototype.constructPitchIncrementButton=function(e){var t=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(){e.setCamera({pitch:e.getCamera().pitch+(t.options.inverted?-1:1)*t.options.pitchDegreesDelta,duration:_e.PITCH_DURATION_MS,type:"ease"},!0)}),o},_e.PITCH_DURATION_MS=100,_e.DEFAULT_PITCH=0,_e.INVERT_ORDER_POSITIONS=[l.ControlPosition.BottomRight,l.ControlPosition.TopRight],_e);function _e(e){var o=me.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(e){return o.updatePitchButtonsState()},o.updatePitchButtonsState=function(){var e=o.map.getCamera().pitch<=0,t=60<=o.map.getCamera().pitch;o.hasFocus&&o.pitchButton&&(e||t)&&o.pitchButton.focus(),o.options.inverted?(o.pitchIncrementButton&&o.pitchIncrementButton.disabled!=e&&(o.pitchIncrementButton.disabled=e),o.pitchDecrementButton&&o.pitchDecrementButton.disabled!=t&&(o.pitchDecrementButton.disabled=t)):(o.pitchIncrementButton&&o.pitchIncrementButton.disabled!=t&&(o.pitchIncrementButton.disabled=t),o.pitchDecrementButton&&o.pitchDecrementButton.disabled!=e&&(o.pitchDecrementButton.disabled=e))},o.options=(new fe).merge(e),o}var we="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function be(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ce(o){if(o.__esModule)return o;var r,t=o.default;return"function"==typeof t?(r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)}).prototype=t.prototype:r={},Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(o).forEach(function(e){var t=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(r,e,t.get?t:{enumerable:!0,get:function(){return o[e]}})}),r}function Ee(e,t){return e===t||e!=e&&t!=t}var Se=Ee;var Te=function(e,t){for(var o=e.length;o--;)if(Se(e[o][0],t))return o;return-1},Ie=Te,Ae=Array.prototype.splice;var ke=Te;var Oe=Te;var Pe=Te;var xe=function(e){var t=this.__data__;return!((e=Ie(t,e))<0)&&(e==t.length-1?t.pop():Ae.call(t,e,1),--this.size,!0)},Re=function(e){var t=this.__data__;return(e=ke(t,e))<0?void 0:t[e][1]},Me=function(e){return-1<Oe(this.__data__,e)},Ne=function(e,t){var o=this.__data__,r=Pe(o,e);return r<0?(++this.size,o.push([e,t])):o[r][1]=t,this};function Le(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var r=e[t];this.set(r[0],r[1])}}Le.prototype.clear=function(){this.__data__=[],this.size=0},Le.prototype.delete=xe,Le.prototype.get=Re,Le.prototype.has=Me,Le.prototype.set=Ne;var De=Le,qe=De;var je=function(){this.__data__=new qe,this.size=0};var Ue=function(e){var t=this.__data__,e=t.delete(e);return this.size=t.size,e};var He=function(e){return this.__data__.get(e)};var ze=function(e){return this.__data__.has(e)},Be="object"==typeof we&&we&&we.Object===Object&&we,Fe="object"==typeof self&&self&&self.Object===Object&&self,Ke=Be||Fe||Function("return this")(),Ge=Ke.Symbol,Ye=Object.prototype,Ze=Ye.hasOwnProperty,We=Ye.toString,Ve=Ge?Ge.toStringTag:void 0;var Je=Object.prototype.toString;var Qe=function(e){var t=Ze.call(e,Ve),o=e[Ve];try{var r=!(e[Ve]=void 0)}catch(e){}var n=We.call(e);return r&&(t?e[Ve]=o:delete e[Ve]),n},Xe=function(e){return Je.call(e)},$e=Ge?Ge.toStringTag:void 0;var et=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":($e&&$e in Object(e)?Qe:Xe)(e)};var tt=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},ot=et,rt=tt;function nt(e){return!!rt(e)&&("[object Function]"==(e=ot(e))||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e)}var it=Ke["__core-js_shared__"],at=(so=/[^.]+$/.exec(it&&it.keys&&it.keys.IE_PROTO||""))?"Symbol(src)_1."+so:"";var st=Function.prototype.toString;var ct=function(e){if(null!=e){try{return st.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ut=nt,lt=function(e){return!!at&&at in e},ht=tt,pt=ct,dt=/^\[object .+?Constructor\]$/,ft=Function.prototype,gt=Object.prototype,yt=ft.toString,mt=gt.hasOwnProperty,vt=RegExp("^"+yt.call(mt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var _t=function(e){return!(!ht(e)||lt(e))&&(ut(e)?vt:dt).test(pt(e))},wt=function(e,t){return null==e?void 0:e[t]};var bt=function(e,t){return t=wt(e,t),_t(t)?t:void 0},Ct=bt(Ke,"Map"),Et=bt(Object,"create"),St=Et;var Tt=Et,It=Object.prototype.hasOwnProperty;var At=Et,kt=Object.prototype.hasOwnProperty;var Ot=Et;var Pt=function(e){return e=this.has(e)&&delete this.__data__[e],this.size-=e?1:0,e},xt=function(e){var t=this.__data__;if(Tt){var o=t[e];return"__lodash_hash_undefined__"===o?void 0:o}return It.call(t,e)?t[e]:void 0},Rt=function(e){var t=this.__data__;return At?void 0!==t[e]:kt.call(t,e)},Mt=function(e,t){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=Ot&&void 0===t?"__lodash_hash_undefined__":t,this};function Nt(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var r=e[t];this.set(r[0],r[1])}}Nt.prototype.clear=function(){this.__data__=St?St(null):{},this.size=0},Nt.prototype.delete=Pt,Nt.prototype.get=xt,Nt.prototype.has=Rt,Nt.prototype.set=Mt;var Lt=Nt,Dt=De,qt=Ct;var jt=function(){this.size=0,this.__data__={hash:new Lt,map:new(qt||Dt),string:new Lt}};var Ut=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Ht=function(e,t){return e=e.__data__,Ut(t)?e["string"==typeof t?"string":"hash"]:e.map},zt=Ht;var Bt=Ht;var Ft=Ht;var Kt=Ht;var Gt=function(e){return e=zt(this,e).delete(e),this.size-=e?1:0,e},R=function(e){return Bt(this,e).get(e)},Yt=function(e){return Ft(this,e).has(e)},K=function(e,t){var o=Kt(this,e),r=o.size;return o.set(e,t),this.size+=o.size==r?0:1,this};function Zt(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var r=e[t];this.set(r[0],r[1])}}Zt.prototype.clear=jt,Zt.prototype.delete=Gt,Zt.prototype.get=R,Zt.prototype.has=Yt,Zt.prototype.set=K;var Wt=Zt,Vt=De,Jt=Ct,Qt=Wt;var Xt=De,Te=Ue,xe=He,Re=ze,Me=function(e,t){var o=this.__data__;if(o instanceof Vt){var r=o.__data__;if(!Jt||r.length<199)return r.push([e,t]),this.size=++o.size,this;o=this.__data__=new Qt(r)}return o.set(e,t),this.size=o.size,this};function $t(e){e=this.__data__=new Xt(e);this.size=e.size}$t.prototype.clear=je,$t.prototype.delete=Te,$t.prototype.get=xe,$t.prototype.has=Re,$t.prototype.set=Me;Ne=$t;var we=function(e,t){for(var o=-1,r=null==e?0:e.length;++o<r&&!1!==t(e[o],o,e););return e},eo=bt,Fe=function(){try{var e=eo(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),to=Fe;var Ye=function(e,t,o){"__proto__"==t&&to?to(e,t,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[t]=o},oo=Ye,ro=Ee,no=Object.prototype.hasOwnProperty;var it=function(e,t,o){var r=e[t];no.call(e,t)&&ro(r,o)&&(void 0!==o||t in e)||oo(e,t,o)},io=it,ao=Ye;var so=function(e,t,o,r){var n=!o;o=o||{};for(var i=-1,a=t.length;++i<a;){var s=t[i],c=r?r(o[s],e[s],s,o,e):void 0;void 0===c&&(c=e[s]),(n?ao:io)(o,s,c)}return o};ft=function(e,t){for(var o=-1,r=Array(e);++o<e;)r[o]=t(o);return r};var gt=function(e){return null!=e&&"object"==typeof e},co=et,uo=gt;var yt=function(e){return uo(e)&&"[object Arguments]"==co(e)},lo=gt,mt=Object.prototype,ho=mt.hasOwnProperty,po=mt.propertyIsEnumerable,Et=yt(function(){return arguments}())?yt:function(e){return lo(e)&&ho.call(e,"callee")&&!po.call(e,"callee")},Pt=Array.isArray,xt={exports:{}};Ht=(Ht=(Mt=(Ht=(Mt=(Rt=xt).exports)&&!Mt.nodeType&&Mt)&&Rt&&!Rt.nodeType&&Rt)&&Mt.exports===Ht?Ke.Buffer:void 0)?Ht.isBuffer:void 0,Rt.exports=Ht||function(){return!1};var jt=xt.exports,fo=/^(?:0|[1-9]\d*)$/;Gt=function(e,t){var o=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==o||"symbol"!=o&&fo.test(e))&&-1<e&&e%1==0&&e<t};var R=function(e){return"number"==typeof e&&-1<e&&e%1==0&&e<=9007199254740991},go=et,yo=R,mo=gt,vo={};vo["[object Float32Array]"]=vo["[object Float64Array]"]=vo["[object Int8Array]"]=vo["[object Int16Array]"]=vo["[object Int32Array]"]=vo["[object Uint8Array]"]=vo["[object Uint8ClampedArray]"]=vo["[object Uint16Array]"]=vo["[object Uint32Array]"]=!0,vo["[object Arguments]"]=vo["[object Array]"]=vo["[object ArrayBuffer]"]=vo["[object Boolean]"]=vo["[object DataView]"]=vo["[object Date]"]=vo["[object Error]"]=vo["[object Function]"]=vo["[object Map]"]=vo["[object Number]"]=vo["[object Object]"]=vo["[object RegExp]"]=vo["[object Set]"]=vo["[object String]"]=vo["[object WeakMap]"]=!1;Yt=function(e){return mo(e)&&yo(e.length)&&!!vo[go(e)]};var _o,wo,K=function(t){return function(e){return t(e)}},De={exports:{}};He=(He=(Ue=De).exports)&&!He.nodeType&&He,_o=He&&Ue&&!Ue.nodeType&&Ue,wo=_o&&_o.exports===He&&Be.process,He=function(){try{var e=_o&&_o.require&&_o.require("util").types;return e?e:wo&&wo.binding&&wo.binding("util")}catch(e){}}(),Ue.exports=He;var ze=De.exports,je=Yt,Te=K,xe=ze&&ze.isTypedArray,Re=xe?Te(xe):je,bo=ft,Co=Et,Eo=Pt,So=jt,To=Gt,Io=Re,Ao=Object.prototype.hasOwnProperty;var Me=function(e,t){var o,r=Eo(e),n=!r&&Co(e),i=!r&&!n&&So(e),a=!r&&!n&&!i&&Io(e),s=r||n||i||a,c=s?bo(e.length,String):[],u=c.length;for(o in e)!t&&!Ao.call(e,o)||s&&("length"==o||i&&("offset"==o||"parent"==o)||a&&("buffer"==o||"byteLength"==o||"byteOffset"==o)||To(o,u))||c.push(o);return c},ko=Object.prototype;mt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ko)};var yt=function(t,o){return function(e){return t(o(e))}},Mt=yt(Object.keys,Object),Oo=mt,Po=Mt,xo=Object.prototype.hasOwnProperty;var Ro=nt,Mo=R;var Rt=function(e){return null!=e&&Mo(e.length)&&!Ro(e)},No=Me,Lo=function(e){if(!Oo(e))return Po(e);var t,o=[];for(t in Object(e))xo.call(e,t)&&"constructor"!=t&&o.push(t);return o},Do=Rt;var Ht=function(e){return(Do(e)?No:Lo)(e)},qo=so,jo=Ht;xt=function(e,t){return e&&qo(t,jo(t),e)};var Uo=tt,Ho=mt,zo=function(e){var t=[];if(null!=e)for(var o in Object(e))t.push(o);return t},Bo=Object.prototype.hasOwnProperty;var Fo=Me,Ko=function(e){if(!Uo(e))return zo(e);var t,o=Ho(e),r=[];for(t in e)("constructor"!=t||!o&&Bo.call(e,t))&&r.push(t);return r},Go=Rt;var Be=function(e){return Go(e)?Fo(e,!0):Ko(e)},Yo=so,Zo=Be;var Wo,Ue=function(e,t){return e&&Yo(t,Zo(t),e)},He={exports:{}};Te=(Yt=(Te=(Yt=(De=He).exports)&&!Yt.nodeType&&Yt)&&De&&!De.nodeType&&De)&&Yt.exports===Te?Ke.Buffer:void 0,Wo=Te?Te.allocUnsafe:void 0,De.exports=function(e,t){return t?e.slice():(t=e.length,t=Wo?Wo(t):new e.constructor(t),e.copy(t),t)};xe=He.exports;je=function(e,t){var o=-1,r=e.length;for(t=t||Array(r);++o<r;)t[o]=e[o];return t};var ft=function(){return[]},Vo=function(e,t){for(var o=-1,r=null==e?0:e.length,n=0,i=[];++o<r;){var a=e[o];t(a,o,e)&&(i[n++]=a)}return i},Jo=Object.prototype.propertyIsEnumerable,Qo=Object.getOwnPropertySymbols,Mt=Qo?function(t){return null==t?[]:(t=Object(t),Vo(Qo(t),function(e){return Jo.call(t,e)}))}:ft,Xo=so,$o=Mt;R=function(e,t){return Xo(e,$o(e),t)};var Me=function(e,t){for(var o=-1,r=t.length,n=e.length;++o<r;)e[n+o]=t[o];return e},Yt=yt(Object.getPrototypeOf,Object),er=Me,tr=Yt,or=Mt,Te=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)er(t,or(e)),e=tr(e);return t}:ft,rr=so,nr=Te;var De=function(e,t){return rr(e,nr(e),t)},ir=Me,ar=Pt;var He=function(e,t,o){return t=t(e),ar(e)?t:ir(t,o(e))},sr=He,cr=Mt,ur=Ht;var yt=function(e){return sr(e,ur,cr)},lr=He,hr=Te,pr=Be;var ft=function(e){return lr(e,pr,hr)},Me=bt(Ke,"DataView"),Mt=Ct,He=bt(Ke,"Promise"),Te=bt(Ke,"Set"),Ct=bt(Ke,"WeakMap"),dr=et,fr=ct,gr="[object Map]",yr="[object Promise]",mr="[object Set]",vr="[object WeakMap]",_r="[object DataView]",wr=fr(Me),br=fr(Mt),Cr=fr(He),Er=fr(Te),Sr=fr(Ct),bt=dr,ct=bt=Me&&bt(new Me(new ArrayBuffer(1)))!=_r||Mt&&bt(new Mt)!=gr||He&&bt(He.resolve())!=yr||Te&&bt(new Te)!=mr||Ct&&bt(new Ct)!=vr?function(e){var t=dr(e),e="[object Object]"==t?e.constructor:void 0,e=e?fr(e):"";if(e)switch(e){case wr:return _r;case br:return gr;case Cr:return yr;case Er:return mr;case Sr:return vr}return t}:bt,Tr=Object.prototype.hasOwnProperty;var Me=function(e){var t=e.length,o=new e.constructor(t);return t&&"string"==typeof e[0]&&Tr.call(e,"index")&&(o.index=e.index,o.input=e.input),o},Mt=Ke.Uint8Array,Ir=Mt;var He=function(e){var t=new e.constructor(e.byteLength);return new Ir(t).set(new Ir(e)),t},Ar=He;var kr=/\w*$/;var Te=Ge?Ge.prototype:void 0,Or=Te?Te.valueOf:void 0;var Pr=He;var Ct=function(e,t){return t=t?Pr(e.buffer):e.buffer,new e.constructor(t,e.byteOffset,e.length)},xr=He,Rr=function(e,t){return t=t?Ar(e.buffer):e.buffer,new e.constructor(t,e.byteOffset,e.byteLength)},Mr=function(e){var t=new e.constructor(e.source,kr.exec(e));return t.lastIndex=e.lastIndex,t},Nr=function(e){return Or?Object(Or.call(e)):{}},Lr=Ct;var bt=function(e,t,o){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return xr(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return Rr(e,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 Lr(e,o);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return Mr(e);case"[object Set]":return new r;case"[object Symbol]":return Nr(e)}},Dr=tt,qr=Object.create;function jr(){}var Ur=function(e){if(!Dr(e))return{};if(qr)return qr(e);jr.prototype=e;e=new jr;return jr.prototype=void 0,e},Hr=Yt,zr=mt;var Ke=function(e){return"function"!=typeof e.constructor||zr(e)?{}:Ur(Hr(e))},Br=ct,Fr=gt;var Te=function(e){return Fr(e)&&"[object Map]"==Br(e)},He=K,mt=ze&&ze.isMap,mt=mt?He(mt):Te,Kr=ct,Gr=gt;var Te=function(e){return Gr(e)&&"[object Set]"==Kr(e)},K=K,ze=ze&&ze.isSet,Te=ze?K(ze):Te,Yr=Ne,Zr=we,Wr=it,Vr=xt,Jr=Ue,Qr=xe,Xr=je,$r=R,en=De,tn=yt,on=ft,rn=ct,nn=Me,an=bt,sn=Ke,cn=Pt,un=jt,ln=mt,hn=tt,pn=Te,dn=Ht,fn=Be,gn="[object Arguments]",yn="[object Function]",mn="[object Object]",vn={};vn[gn]=vn["[object Array]"]=vn["[object ArrayBuffer]"]=vn["[object DataView]"]=vn["[object Boolean]"]=vn["[object Date]"]=vn["[object Float32Array]"]=vn["[object Float64Array]"]=vn["[object Int8Array]"]=vn["[object Int16Array]"]=vn["[object Int32Array]"]=vn["[object Map]"]=vn["[object Number]"]=vn[mn]=vn["[object RegExp]"]=vn["[object Set]"]=vn["[object String]"]=vn["[object Symbol]"]=vn["[object Uint8Array]"]=vn["[object Uint8ClampedArray]"]=vn["[object Uint16Array]"]=vn["[object Uint32Array]"]=!0,vn["[object Error]"]=vn[yn]=vn["[object WeakMap]"]=!1;var mt=function o(r,n,i,e,t,a){var s,c=1&n,u=2&n,l=4&n;if(void 0!==(s=i?t?i(r,e,t,a):i(r):s))return s;if(!hn(r))return r;var h=cn(r);if(h){if(s=nn(r),!c)return Xr(r,s)}else{var p=rn(r),e=p==yn||"[object GeneratorFunction]"==p;if(un(r))return Qr(r,c);if(p==mn||p==gn||e&&!t){if(s=u||e?{}:sn(r),!c)return u?en(r,Jr(s,r)):$r(r,Vr(s,r))}else{if(!vn[p])return t?r:{};s=an(r,p,c)}}c=(a=a||new Yr).get(r);if(c)return c;a.set(r,s),pn(r)?r.forEach(function(e){s.add(o(e,n,i,e,r,a))}):ln(r)&&r.forEach(function(e,t){s.set(t,o(e,n,i,t,r,a))});var d=h?void 0:(l?u?on:tn:u?fn:dn)(r);return Zr(d||r,function(e,t){d&&(e=r[t=e]),Wr(s,t,o(e,n,i,t,r,a))}),s},_n=mt;var wn=be(function(e){return _n(e,5)}),bn=Ye,Cn=Ee;Te=function(e,t,o){(void 0===o||Cn(e[t],o))&&(void 0!==o||t in e)||bn(e,t,o)};var Ht=function(c){return function(e,t,o){for(var r=-1,n=Object(e),i=o(e),a=i.length;a--;){var s=i[c?a:++r];if(!1===t(n[s],s,n))break}return e}}(),En=Rt,Sn=gt;var Ye=function(e){return Sn(e)&&En(e)},Tn=et,In=Yt,An=gt,et=Function.prototype,Yt=Object.prototype,kn=et.toString,On=Yt.hasOwnProperty,Pn=kn.call(Object);et=function(e){return!(!An(e)||"[object Object]"!=Tn(e))&&(null===(e=In(e))||"function"==typeof(e=On.call(e,"constructor")&&e.constructor)&&e instanceof e&&kn.call(e)==Pn)};var Yt=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},xn=so,Rn=Be;var Mn=Te,Nn=xe,Ln=Ct,Dn=je,qn=Ke,jn=Et,Un=Pt,Hn=Ye,zn=jt,Bn=nt,Fn=tt,Kn=et,Gn=Re,Yn=Yt,Zn=function(e){return xn(e,Rn(e))};var Wn=Ne,Vn=Te,Jn=Ht,Qn=function(e,t,o,r,n,i,a){var s,c,u,l=Yn(e,o),h=Yn(t,o),p=a.get(h);p?Mn(e,o,p):((s=void 0===(u=i?i(l,h,o+"",e,t,a):void 0))&&(p=!(c=Un(h))&&zn(h),t=!c&&!p&&Gn(h),u=h,c||p||t?u=Un(l)?l:Hn(l)?Dn(l):p?Nn(h,!(s=!1)):t?Ln(h,!(s=!1)):[]:Kn(h)||jn(h)?jn(u=l)?u=Zn(l):Fn(l)&&!Bn(l)||(u=qn(h)):s=!1),s&&(a.set(h,u),n(u,h,r,i,a),a.delete(h)),Mn(e,o,u))},Xn=tt,$n=Be,ei=Yt;Ht=function r(n,i,a,s,c){n!==i&&Jn(i,function(e,t){var o;c=c||new Wn,Xn(e)?Qn(n,i,t,a,r,s,c):(o=s?s(ei(n,t),e,t+"",n,i,c):void 0,Vn(n,t,o=void 0===o?e:o))},$n)};Be=function(e){return e};var ti=function(e,t,o){switch(o.length){case 0:return e.call(t);case 1:return e.call(t,o[0]);case 2:return e.call(t,o[0],o[1]);case 3:return e.call(t,o[0],o[1],o[2])}return e.apply(t,o)},oi=Math.max;Yt=function(i,a,s){return a=oi(void 0===a?i.length-1:a,0),function(){for(var e=arguments,t=-1,o=oi(e.length-a,0),r=Array(o);++t<o;)r[t]=e[a+t];for(var t=-1,n=Array(a+1);++t<a;)n[t]=e[t];return n[a]=s(r),ti(i,this,n)}};var ri=function(e){return function(){return e}},ni=Fe,ii=Date.now;var Fe=function(o){var r=0,n=0;return function(){var e=ii(),t=16-(e-n);if(n=e,0<t){if(800<=++r)return arguments[0]}else r=0;return o.apply(void 0,arguments)}}(ni?function(e,t){return ni(e,"toString",{configurable:!0,enumerable:!1,value:ri(t),writable:!0})}:Be),ai=Be,si=Yt,ci=Fe;var ui=Ee,li=Rt,hi=Gt,pi=tt;var di=function(e,t){return ci(si(e,t,ai),e+"")},fi=function(e,t,o){if(!pi(o))return!1;var r=typeof t;return!!("number"==r?li(o)&&hi(t,o.length):"string"==r&&t in o)&&ui(o[t],e)};var gi,yi,mi=Ht,vi=be(function(s){return di(function(e,t){var o=-1,r=t.length,n=1<r?t[r-1]:void 0,i=2<r?t[2]:void 0,n=3<s.length&&"function"==typeof n?(r--,n):void 0;for(i&&fi(t[0],t[1],i)&&(n=r<3?void 0:n,r=1),e=Object(e);++o<r;){var a=t[o];a&&s(e,a,o,n)}return e})}(function(e,t,o){mi(e,t,o)})),_i=((window&&window.__extends||(gi=function(e,t){return(gi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}gi(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(wi,yi=k),wi);function wi(){var e=null!==yi&&yi.apply(this,arguments)||this;return e.layout="icons",e.mapStyles=["road","grayscale_light","grayscale_dark","night","road_shaded_relief"],e.style=l.ControlStyle.light,e.autoSelectionMode=!0,e}var bi,Ci,tt=window&&window.__extends||(bi=function(e,t){return(bi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}bi(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),Ei=window&&window.__awaiter||function(e,a,s,c){return new(s=s||Promise)(function(o,t){function r(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?o(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(r,n)}i((c=c.apply(e,a||[])).next())})},Si=window&&window.__generator||function(o,r){var n,i,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;c&&t[c=0]&&(s=0),s;)try{if(n=1,i&&(a=2&t[0]?i.return:t[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,t[1])).done)return a;switch(i=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,i=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=r.call(o,s)}catch(e){t=[6,e],i=0}finally{n=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},Ti=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},Ht=(tt(Ii,Ci=oe),Ii.prototype.onAdd=function(e,t){var o=this;this.map=e;var r=this.buildContainer(e,this.options.style,"Map Style Control"),n=this.buildStyleOpsGrid();this.styleOpsGrid=n;var i=this.buildCurrStyleBtn(),e=z("Select Style");return n.classList.add(t&&t.position||"top-right"),r.addEventListener("mouseover",function(){o.hasMouse=!0,r.classList.add(Ii.Css.inUse),n.classList.remove("hidden-accessible-element")}),r.addEventListener("focusin",function(){o.hasFocus=!0,r.classList.add(Ii.Css.inUse),n.classList.remove("hidden-accessible-element")}),r.addEventListener("mouseleave",function(){o.hasMouse=!1,o.hasFocus||(r.classList.remove(Ii.Css.inUse),n.classList.add("hidden-accessible-element"))}),r.addEventListener("focusout",function(e){e.target===i&&Array.from(n.children).forEach(function(e){return e.removeAttribute("tabIndex")}),e.relatedTarget instanceof Node&&r.contains(e.relatedTarget)||(o.hasFocus=!1,o.hasMouse||(r.classList.remove(Ii.Css.inUse),n.classList.add("hidden-accessible-element")))}),n.addEventListener("keydown",function(e){27===e.keyCode&&(e.stopPropagation(),i.focus(),Array.from(n.children).forEach(function(e){return e.setAttribute("tabIndex","-1")}),r.classList.contains(Ii.Css.inUse)&&(r.classList.remove(Ii.Css.inUse),n.classList.add("hidden-accessible-element")))}),i.addEventListener("click",function(e){r.classList.contains(Ii.Css.inUse)?(r.classList.remove(Ii.Css.inUse),n.classList.add("hidden-accessible-element")):(r.classList.add(Ii.Css.inUse),n.classList.remove("hidden-accessible-element"),n.firstElementChild&&n.firstElementChild.focus())}),t&&Ii.InvertOrderPositions.includes(t.position)?(r.appendChild(n),r.appendChild(i),r.appendChild(e),B(e,i)):(r.appendChild(i),r.appendChild(e),B(e,i),r.appendChild(n)),r},Ii.prototype.onRemove=function(){Ci.prototype.onRemove.call(this),this.styleOpsGrid=null,this.styleButtons.clear(),this.thumbnailCache.response.clear(),this.thumbnailCache.blob.clear(),this.thumbnailCache.assumedConfiguration=void 0,this.map.events.remove("stylechanged",this.onStyleChange),this.map.events.remove("mapconfigurationchanged",this.onMapConfigurationChange)},Ii.prototype.setSelectedStyle=function(o){var t,e,r=this;this.styleIcons.has(o)&&(t=this.currStyleImage,e=this.styleIcons.get(o),t.src!==e&&(t.src=e),Object.entries(this.styleButtons).forEach(function(e){var t=Ti(e,2),e=t[0];return t[1].setAttribute("aria-current",e===o?"true":"false")}),this.map.styles.definitions().then(function(e){e=r.mapToFriendlyStyleName(o,e);t.alt!==e&&(t.alt=e),t.parentElement.lastChild instanceof Text&&(t.parentElement.lastChild.textContent=e)}))},Ii.prototype.disableStyle=function(e){e=this.styleButtons[e];e&&e.setAttribute("disabled","true")},Ii.prototype.enableStyle=function(e){e=this.styleButtons[e];e&&e.removeAttribute("disabled")},Ii.prototype.buildSelectStyleBtn=function(o,e,t){var r=this,n=document.createElement("button"),i=this.mapToFriendlyStyleName(o,e);n.setAttribute("aria-label",i),n.setAttribute("type","button");var a=new Image;t.then(function(e){if(r.thumbnailCache.blob.has(e.url))return r.thumbnailCache.blob.get(e.url);var t=e.clone().blob();return r.thumbnailCache.blob.set(e.url,t),t}).then(function(e){e=URL.createObjectURL(e);a.src=e,o===r.map.getStyle().style&&(r.currStyleImage.src=e,r.currStyleImage.alt=i,r.currStyleImage.parentElement.lastChild.nodeType==Node.TEXT_NODE?r.currStyleImage.parentElement.lastChild.textContent=i:r.currStyleImage.parentElement.appendChild(document.createTextNode(i))),r.styleIcons.set(o,e)}),a.setAttribute("aria-hidden","true"),n.appendChild(a),"icons"===this.options.layout?n.classList.add(Ii.Css.button):(n.classList.add(Ii.Css.listButton),n.classList.add(Ii.Css.expanded),n.appendChild(document.createTextNode(i))),n.addEventListener("click",function(){r.hasMouse=!1,r.hasFocus=!1;var e=r.styleButtons[o];e&&!e.hasAttribute("disabled")&&(r._invokeEvent("styleselected",o),r.options.autoSelectionMode&&r.map.setStyle({style:o}),Object.entries(r.styleButtons).forEach(function(e){var t=Ti(e,2),e=t[0];return t[1].setAttribute("aria-current",e===o?"true":"false")}))});t=document.createElement("div");return t.classList.add("selected-icon"),n.appendChild(t),n},Ii.prototype.buildCurrStyleBtn=function(){var e=document.createElement("button");"icons"==this.options.layout?e.classList.add(Ii.Css.button):e.classList.add(Ii.Css.listButton),e.classList.add(Ii.Css.currentStyle),e.setAttribute("aria-label","Select Style"),e.setAttribute("tabindex","-1"),this.currStyleImage=new Image,e.appendChild(this.currStyleImage);var t=document.createElement("div");return t.classList.add("icon"),e.appendChild(t),e},Ii.prototype.buildStyleOpsGrid=function(){var e=this,t=document.createElement("div");return t.classList.add(Ii.Css.styleOptions),"icons"===this.options.layout?t.classList.add(this.options.layout):t.classList.add(Ii.Css.dropdown),t.setAttribute("aria-label","Style Options"),t.classList.add("hidden-accessible-element"),this.map.styles.definitions().then(function(t){return Ei(e,void 0,void 0,function(){return Si(this,function(e){return this.onMapConfigurationChange(t),this.map.events.add("stylechanged",this.onStyleChange),[2]})})}),this.map.events.add("mapconfigurationchanged",this.onMapConfigurationChange),t},Ii.prototype.populateOpsGridFromDefinitions=function(n){var e,o,i=this;this.styleOpsGrid&&(e=n.configurations,(e=Array.isArray(this.options.mapStyles)?e.filter(function(e){return i.options.mapStyles.includes(e.name.split("_indoor")[0])}):e).forEach(function(e){var t={url:e.thumbnail};e.thumbnail&&i.map.styles._transformStyleRequest(e.thumbnail,t);var o=i.map.getServiceOptions();o.transformRequest&&vi(t,o.transformRequest(t.url,"Thumbnail")),i.thumbnailCache.response.has(t.url)?r=Promise.resolve(i.thumbnailCache.response.get(t.url)):(r=fetch(t.url,{headers:t.headers}),i.thumbnailCache.response.set(t.url,r));var r=i.buildSelectStyleBtn(e.name,n,r);i.styleOpsGrid.appendChild(r),i.styleButtons[e.name]=r,"icons"===i.options.layout&&(e=z(i.mapToFriendlyStyleName(e.name,n)),i.styleOpsGrid.appendChild(e),B(e,r))}),o=this.map.getStyle().style,Object.entries(this.styleButtons).forEach(function(e){var t=Ti(e,2),e=t[0];return t[1].setAttribute("aria-current",e===o?"true":"false")}))},Ii.InvertOrderPositions=[l.ControlPosition.TopRight,l.ControlPosition.BottomRight],Ii.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"},Ii);function Ii(e){var t=Ci.call(this)||this;return t.styleOpsGrid=null,t.hasMouse=!1,t.hasFocus=!1,t.styleButtons=new J,t.styleIcons=new J,t.thumbnailCache={assumedConfiguration:void 0,response:new J,blob:new J},t.onStyleChange=function(){var e;t.options.autoSelectionMode&&(e=t.map.getStyle().style,t.setSelectedStyle(e))},t.onMapConfigurationChange=function(e){t.styleOpsGrid&&(0<t.styleOpsGrid.children.length&&t.thumbnailCache.assumedConfiguration===e||(t.thumbnailCache.assumedConfiguration=e,Array.from(t.styleOpsGrid.children).forEach(function(e){return e.remove()}),t.styleButtons.clear(),t.populateOpsGridFromDefinitions(e)))},t.mapToFriendlyStyleName=function(t,e){e=e.configurations.find(function(e){return e.name===t});return(null==e?void 0:e.displayName)||t},t.options=(new _i).merge(wn(e)),t}var Ai,ki,Oi=((window&&window.__extends||(Ai=function(e,t){return(Ai=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Ai(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Pi,ki=k),Pi);function Pi(){var e=null!==ki&&ki.apply(this,arguments)||this;return e.flow="none",e.incidents=!1,e}var xi,Ri,Mi=((window&&window.__extends||(xi=function(e,t){return(xi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}xi(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Ni,Ri=Oi),Ni);function Ni(){var e=null!==Ri&&Ri.apply(this,arguments)||this;return e.isActive=!1,e.style=l.ControlStyle.light,e}var Li,Di,qi=((window&&window.__extends||(Li=function(e,t){return(Li=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Li(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(ji,Di=oe),Object.defineProperty(ji.prototype,"isActive",{get:function(){if(!this.map)return!1;var e=this.map.getTraffic();return"none"!==e.flow||e.incidents},set:function(e){this.map&&this.map.setTraffic({flow:e?this.options.flow:"none",incidents:!!e&&this.options.incidents})},enumerable:!1,configurable:!0}),ji.prototype.onAdd=function(e){(this.map=e).getTraffic(),void 0!==this.initIsActive&&(this.isActive=this.initIsActive),this.container=this.buildContainer(e,this.style,"Traffic Control"),this.container.style.flexDirection="column";var t=this.constructTrafficButton(e);this.container.appendChild(t);e=z("Toggle Traffic Display");return this.container.appendChild(e),B(e,t),this.container},ji.prototype.onRemove=function(){Di.prototype.onRemove.call(this),this.map=null},ji.prototype.getOptions=function(){return(new Mi).merge({isActive:this.isActive,flow:this.options.flow,incidents:this.options.incidents,style:this.style})},ji.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"))},ji.prototype.constructTrafficButton=function(e){var t=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(){t.isActive=!t.isActive}),o},ji);function ji(e){var t,o=this;return(o=Di.call(this)||this).hasMouse=!1,o.hasFocus=!1,o.options=(new Oi).merge({flow:"relative",incidents:!0}),o.style=l.ControlStyle.light,o.container=null,o.trafficButton=null,o.map=null,e&&(o.initIsActive=null!==(t=e.isActive)&&void 0!==t&&t,o.options.flow=e.flow||"relative",o.options.incidents=null===(t=e.incidents)||void 0===t||t,o.style=e.style||l.ControlStyle.light),o}var Ui,Hi,tt=window&&window.__extends||(Ui=function(e,t){return(Ui=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Ui(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),zi=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},tt=(tt(Bi,Hi=oe),Bi.prototype.onAdd=function(e){this.map=e;var t=this.buildContainer(e,l.ControlStyle.auto,"Traffic Legend"),e=this.buildTrafficLegendDiv(e);return t.setAttribute("role","definition"),t.appendChild(e),t},Bi.prototype.onRemove=function(){Hi.prototype.onRemove.call(this),this.syncHiddenState&&(this.map.events.remove("styledata",this.syncHiddenState),this.syncHiddenState=null),this.map=null},Bi.prototype.buildTrafficLegendDiv=function(t){var o,e,r,n,i=document.createElement("div");i.classList.add("traffic-legend","hidden"),i.setAttribute("alt","Traffic Legend");var a=document.createElement("table"),s=document.createElement("tr"),c=document.createElement("td");c.setAttribute("alt","Traffic"),c.appendChild(document.createTextNode("Traffic"));var u=z("Traffic");c.classList.add("traffic-legend-title"),c.colSpan=6,s.appendChild(c),s.appendChild(u),B(u,c),a.appendChild(s);var l=document.createElement("tr");try{for(var h=zi(this.table),p=h.next();!p.done;p=h.next()){var d=p.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 g=(r=void 0,zi(d)),y=g.next();!y.done;y=g.next()){var m=y.value,v=document.createElement("div");v.classList.add(m),f.appendChild(v)}}catch(e){r={error:e}}finally{try{y&&!y.done&&(n=g.return)&&n.call(g)}finally{if(r)throw r.error}}}l.appendChild(f);var _=z(d instanceof Array?"Traffic Legend":d);l.appendChild(_),B(_,f)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(e=h.return)&&e.call(h)}finally{if(o)throw o.error}}return a.appendChild(l),i.appendChild(a),this.syncHiddenState=function(e){"style"===e.dataType&&((e=t.getTraffic()).flow&&"none"!==e.flow?i.classList.remove("hidden"):i.classList.add("hidden"))},this.syncHiddenState({dataType:"style"}),t.events.add("styledata",this.syncHiddenState),i},Bi);function Bi(){var e=Hi.call(this)||this;return e.table=["Fast",["green","yellow","red","dark-red"],"Slow"],e.map=null,e.syncHiddenState=null,e}var Fi=Wt,Wt=function(e){return this.__data__.has(e)};function Ki(e){var t=-1,o=null==e?0:e.length;for(this.__data__=new Fi;++t<o;)this.add(e[t])}Ki.prototype.add=Ki.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ki.prototype.has=Wt;var Gi=Ki,Yi=function(e,t){for(var o=-1,r=null==e?0:e.length;++o<r;)if(t(e[o],o,e))return!0;return!1},Zi=function(e,t){return e.has(t)};Wt=function(e,t,o,r,n,i){var a=1&o,s=e.length,c=t.length;if(s!=c&&!(a&&s<c))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var l=-1,h=!0,p=2&o?new Gi:void 0;for(i.set(e,t),i.set(t,e);++l<s;){var d,f=e[l],g=t[l];if(void 0!==(d=r?a?r(g,f,l,t,e,i):r(f,g,l,e,t,i):d)){if(d)continue;h=!1;break}if(p){if(!Yi(t,function(e,t){if(!Zi(p,t)&&(f===e||n(f,e,o,r,i)))return p.push(t)})){h=!1;break}}else if(f!==g&&!n(f,g,o,r,i)){h=!1;break}}return i.delete(e),i.delete(t),h};function Wi(e){var o=-1,r=Array(e.size);return e.forEach(function(e,t){r[++o]=[t,e]}),r}function Vi(e){var t=-1,o=Array(e.size);return e.forEach(function(e){o[++t]=e}),o}var Ji=Mt,Qi=Ee,Xi=Wt,Ge=Ge?Ge.prototype:void 0,$i=Ge?Ge.valueOf:void 0;var Ge=function(e,t,o,r,n,i,a){switch(o){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return e.byteLength==t.byteLength&&i(new Ji(e),new Ji(t))?!0:!1;case"[object Boolean]":case"[object Date]":case"[object Number]":return Qi(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=Wi;case"[object Set]":s=s||Vi;if(e.size!=t.size&&!(1&r))return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);s=Xi(s(e),s(t),r,n,i,a);return a.delete(e),s;case"[object Symbol]":if($i)return $i.call(e)==$i.call(t)}return!1},ea=yt,ta=Object.prototype.hasOwnProperty;var oa=Ne,ra=Wt,na=Ge,ia=function(e,t,o,r,n,i){var a=1&o,s=ea(e),c=s.length;if(c!=ea(t).length&&!a)return!1;for(var u=c;u--;){var l=s[u];if(!(a?l in t:ta.call(t,l)))return!1}var h=i.get(e),p=i.get(t);if(h&&p)return h==t&&p==e;var d=!0;i.set(e,t),i.set(t,e);for(var f=a;++u<c;){var g,y=e[l=s[u]],m=t[l];if(!(void 0===(g=r?a?r(m,y,l,t,e,i):r(y,m,l,e,t,i):g)?y===m||n(y,m,o,r,i):g)){d=!1;break}f=f||"constructor"==l}return!d||f||(h=e.constructor)!=(p=t.constructor)&&"constructor"in e&&"constructor"in t&&!("function"==typeof h&&h instanceof h&&"function"==typeof p&&p instanceof p)&&(d=!1),i.delete(e),i.delete(t),d},aa=ct,sa=Pt,ca=jt,ua=Re,la="[object Arguments]",ha="[object Array]",pa="[object Object]",da=Object.prototype.hasOwnProperty;var fa=function(e,t,o,r,n,i){var a=sa(e),s=sa(t),c=a?ha:aa(e),u=s?ha:aa(t),l=(c=c==la?pa:c)==pa,s=(u=u==la?pa:u)==pa;if((u=c==u)&&ca(e)){if(!ca(t))return!1;l=!(a=!0)}if(u&&!l)return i=i||new oa,a||ua(e)?ra(e,t,o,r,n,i):na(e,t,c,o,r,n,i);if(!(1&o)){l=l&&da.call(e,"__wrapped__"),s=s&&da.call(t,"__wrapped__");if(l||s)return n(l?e.value():e,s?t.value():t,o,r,i=i||new oa)}return!!u&&(i=i||new oa,ia(e,t,o,r,n,i))},ga=gt;var ya=function e(t,o,r,n,i){return t===o||(null==t||null==o||!ga(t)&&!ga(o)?t!=t&&o!=o:fa(t,o,r,n,e,i))};var ma=be(function(e,t){return ya(e,t)});var va,Wt={exports:{}},_a=Ce(Object.freeze({__proto__:null,default:{}}));va=Wt,function(){for(var t,o,r=0,n=[],e=0;e<256;e++)n[e]=(e+256).toString(16).substr(1);function i(){var e,e=(e=16,(!t||a.BUFFER_SIZE<r+e)&&(r=0,t=a.randomBytes(a.BUFFER_SIZE)),t.slice(r,r+=e));return e[6]=15&e[6]|64,e[8]=63&e[8]|128,e}function a(){var e=i();return n[e[0]]+n[e[1]]+n[e[2]]+n[e[3]]+"-"+n[e[4]]+n[e[5]]+"-"+n[e[6]]+n[e[7]]+"-"+n[e[8]]+n[e[9]]+"-"+n[e[10]]+n[e[11]]+n[e[12]]+n[e[13]]+n[e[14]]+n[e[15]]}a.BUFFER_SIZE=4096,a.bin=i,a.clearBuffer=function(){t=null,r=0},a.test=function(e){return"string"==typeof e&&/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},"undefined"!=typeof crypto?o=crypto:"undefined"!=typeof window&&void 0!==window.msCrypto&&(o=window.msCrypto),o=o||_a,(va.exports=a).randomBytes=function(){if(o){if(o.randomBytes)return o.randomBytes;if(o.getRandomValues)return"function"!=typeof Uint8Array.prototype.slice?function(e){e=new Uint8Array(e);return o.getRandomValues(e),Array.from(e)}:function(e){e=new Uint8Array(e);return o.getRandomValues(e),e}}return function(e){for(var t=[],o=0;o<e;o++)t.push(Math.floor(256*Math.random()));return t}}()}();var wa=be(Wt.exports),ba=(Ca.TYPE="Feature",Ca);function Ca(e,t,o,r){this.type="Feature",this.type=Ca.TYPE,this.properties=t||{},this.id=o,this.geometry=e,this.bbox=r}var Ea,Sa,Ge=window&&window.__extends||(Ea=function(e,t){return(Ea=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Ea(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),Ta=(Sa=Array,Ge(Ia,Sa),Ia.fromData=function(o){var r=NaN,n=NaN,i=new Set(["y"]),a=new Set(["x"]);return Object.keys(o).forEach(function(e){var t=e.toLowerCase();isNaN(r)&&i.has(t)&&"number"==typeof o[e]?r=o[e]:isNaN(n)&&a.has(t)&&"number"==typeof o[e]&&(n=o[e])}),isNaN(r)||isNaN(n)?null:new Ia(r,n)},Ia.getX=function(e){return 0<e.length?e[0]:NaN},Ia.getY=function(e){return 1<e.length?e[1]:NaN},Ia.getDestination=function(e,t,o){return new Ia(Ia.getX(e)+o*Math.cos((t+270)*Math.PI/180),Ia.getY(e)+o*Math.sin((t+270)*Math.PI/180))},Ia.getDistance=function(e,t){var o=Ia.getX(e)-Ia.getX(t),t=Ia.getY(e)-Ia.getY(t);return Math.sqrt(o*o+t*t)},Ia.getHeading=function(e,t){var o=Ia.getX(t)-Ia.getX(e),t=Ia.getY(e)-Ia.getY(t);return 180*(2.5*Math.PI-Math.atan2(t,o))/Math.PI%360},Ia);function Ia(e,t){return Sa.call(this,e,t)||this}var Aa=(ka.TYPE="Point",ka);function ka(e){this.type="Point",this.type=ka.TYPE,this.coordinates=e}var Oa,Pa,xa,Ra,Ma,Na=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},La=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Da=6378137,qa=Math.PI/180,ja=180/Math.PI,Ua=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9],Ha=85.0511;function za(e){return e*qa}function Ba(e){return e*ja}function Fa(e,t,o){return Math.min(Math.max(e,t),o)}function Ka(e,t){var o=za(t[1]-e[1]),r=za(t[0]-e[0]),r=Math.pow(Math.sin(o/2),2)+Math.cos(za(e[1]))*Math.cos(za(t[1]))*Math.pow(Math.sin(r/2),2),r=2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r));return Math.round(Da*r*100)/100}function Ga(e){if(e)switch(e.toLowerCase()){case"feet":case"foot":case"ft":return Pa.feet;case"kilometers":case"kilometer":case"kilometres":case"kilometre":case"km":case"kms":return Pa.kilometers;case"miles":case"mile":case"mi":return Pa.miles;case"nauticalmiles":case"nauticalmile":case"nms":case"nm":return Pa.nauticalMiles;case"yards":case"yard":case"yds":case"yrd":case"yrds":return Pa.yards;default:return Pa.meters}return Pa.meters}function Ya(e){if(e)switch(e.toLowerCase()){case"milespersecondsquared":case"milepersecondsquared":case"mi/s^2":case"mi/s2":return Ma.milesPerSecondSquared;case"kilometerspersecondsquared":case"kilometrespersecondsquared":case"kilometerpersecondsquared":case"kilometrepersecondsquared":case"km/s^2":case"km/s2":return Ma.kilometersPerSecondSquared;case"knotspersecond":case"knotpersecond":case"knts/s":case"kn/s":case"kt/s":return Ma.knotsPerSecond;case"standardgravity":case"g":return Ma.standardGravity;case"feetpersecondsquared":case"footpersecondsquared":case"ft/s^2":case"ft/s2":return Ma.feetPerSecondSquared;case"yardspersecondsquared":case"yardpersecondsquared":case"yds/s^2":case"yds/s2":case"yd/s^2":case"yd/s2":return Ma.yardsPerSecondSquared;case"milesperhoursecond":case"mileperhoursecond":case"milesperhourseconds":case"mileperhourseconds":case"mi/h/s":return Ma.milesPerHourSecond;case"kilometersperhoursecond":case"kilometrespersoursecond":case"kilometerperhoursecond":case"kilometrepersoursecond":case"kilometersperhourssecond":case"kilometrespersourssecond":case"kilometerperhourssecond":case"kilometrepersourssecond":case"kmhs":case"km/h/s":return Ma.kilometersPerHourSecond;default:return Ma.metersPerSecondSquared}return Ma.metersPerSecondSquared}function Za(e){if(e)switch(e){case"acres":case"ac":return Oa.acres;case"hectares":case"ha":return Oa.hectares;case"squareFeet":case"ft^2":case"ft2":return Oa.squareFeet;case"squareYards":case"squareYard":case"yds^2":case"yds2":case"yd^2":case"yd2":return Oa.squareYards;case"squareKilometers":case"squareKilometres":case"squareKilometer":case"squareKilometre":case"km^2":case"km2":return Oa.squareKilometers;case"squareMiles":case"squareMile":case"mi^2":case"mi2":return Oa.squareMiles;default:return Oa.squareMeters}return Oa.squareMeters}function Wa(e){if(e)switch(e.toLowerCase()){case"feetpersecond":case"footsecond":case"ftps":case"ft/s":return Ra.feetPerSecond;case"milesperhour":case"mileperhour":case"mph":case"mi/hr":case"mi/h":return Ra.milesPerHour;case"knots":case"knot":case"knts":case"knt":case"kn":case"kt":return Ra.knots;case"mach":case"m":return Ra.mach;case"kilometersperhour":case"kilometresperhour":case"kmperhour":case"kmph":case"km/hr":case"km/h":return Ra.kilometersPerHour;default:return Ra.metersPerSecond}return Ra.metersPerSecond}function Va(e){if(e)switch(e.toLowerCase()){case"milliseconds":case"ms":return xa.ms;case"minutes":case"minute":case"mins":case"min":return xa.minutes;case"hours":case"hour":case"hr":case"h":return xa.hours;case"days":case"day":case"d":return xa.days;default:return xa.seconds}return xa.seconds}function Ja(e){var t=0;if(e&&0<e.length)for(var t=Math.abs(Qa(e[0])),o=1,r=e.length;o<r;o++)t-=Math.abs(Qa(e[o]));return t}function Qa(e){var t=0;if(3<=e.length){for(var o=void 0,r=void 0,n=0,i=e.length;n<i;n++)t+=(za(e[n===i-2?(o=i-2,r=i-1,0):n===i-1?(o=i-1,r=0,1):(r=(o=n)+1,n+2)][0])-za(e[o][0]))*Math.sin(za(e[r][1]));t=t*Da*Da/2}return t}function Xa(e,t,o){return(e[0]-o[0])*(t[1]-o[1])-(e[1]-o[1])*(t[0]-o[0])}function $a(e,t,o){if(2<=o.length){for(var r,n,i=1/0,a=null,s=vs(o,22),c=0,u=s.length-1;c<u;c++)n=function(e,t,o){if(t[0]===o[0]&&t[1]===o[1])return t;var r=e[0]-t[0],n=e[1]-t[1],i=o[0]-t[0],e=o[1]-t[1],n=(i*r+e*n)/(i*i+e*e);return n<0?t:1<n?o:[t[0]+i*n,t[1]+e*n]}(t,s[c],s[c+1]),(r=Ta.getDistance(t,n))<i&&(i=r,a=n);if(a){var l=ms([a],22)[0];return new ba(new Aa(l),{distance:rs(e,l)})}}else if(1===o.length)return new ba(new Aa(o[0]),{distance:rs(e,o[0])});return null}function es(e,t){var o;return!isNaN(e)&&"number"==typeof t&&0<=t&&(o=void 0,o=t<Ua.length?Ua[t]:Math.pow(10,t),e=Math.round(e*o)/o),e}function ts(e,t,o,r){switch(Ga(t)){case Pa.meters:e/=1e3;break;case Pa.feet:e/=3280.8399;break;case Pa.miles:e/=.62137119;break;case Pa.yards:e/=1093.6133;break;case Pa.nauticalMiles:e/=.5399568;break;case Pa.kilometers:}switch(Ga(o)){case Pa.meters:e*=1e3;break;case Pa.feet:e*=3280.8399;break;case Pa.miles:e*=.62137119;break;case Pa.yards:e*=1093.6133;break;case Pa.nauticalMiles:e*=.5399568;break;case Pa.kilometers:}return"number"==typeof r&&0<=r&&(r=Math.pow(10,r),e=Math.round(e*r)/r),e}function os(e,t,o,r){r=r||"meters",e=ks(e);var n=ns(r),r=za(e[1]),e=za(e[0]),t=t*qa,o=o/n,n=Math.asin(Math.sin(r)*Math.cos(o)+Math.cos(r)*Math.sin(o)*Math.cos(t)),r=e+Math.atan2(Math.sin(t)*Math.sin(o)*Math.cos(r),Math.cos(o)-Math.sin(r)*Math.sin(n)),n=Fa(fs(n*ja),-85,85);return[gs(r*ja),n]}function rs(e,t,o){t=Ka(e=ks(e),t=ks(t));return"meters"===o?t:ts(t,"meters",o||"meters")}function ns(e){e=Ga(e);return ts(Da,Pa.meters,e)}function is(e,t,o){for(var r=[],n=za(e[1]),i=za(e[0]),a=za(t[1]),s=za(t[0]),c=2*Math.asin(Math.sqrt(Math.pow(Math.sin((n-a)/2),2)+Math.cos(n)*Math.cos(a)*Math.pow(Math.sin((i-s)/2),2))),u=0;u<=o;u++){var l=u/o,h=Math.sin((1-l)*c)/Math.sin(c),p=Math.sin(l*c)/Math.sin(c),d=h*Math.cos(n)*Math.cos(i)+p*Math.cos(a)*Math.cos(s),l=h*Math.cos(n)*Math.sin(i)+p*Math.cos(a)*Math.sin(s),p=h*Math.sin(n)+p*Math.sin(a),p=Math.atan2(p,Math.sqrt(Math.pow(d,2)+Math.pow(l,2))),d=Math.atan2(l,d),p=Fa(p*ja,-85,85);d*=ja,r.push([d,p])}return r}function as(e){return(Array.isArray(e)?e:e.coordinates).reduce(function(e,t){var o=0<e.length?e[e.length-1]:null;return o&&180<Math.abs(t[0]-o[0])?(o=o[0]<0?t[0]-360:t[0]+360,e.push([o,t[1]])):e.push(t),e},[])}function ss(e){for(var t,o,r,n,i,a=Array.isArray(e)?e:e.coordinates,s=[],c=[],u=0;u<a.length;u++)s.push(a[u]),u+1>=a.length||(t=(r=Na(a[u],2))[0],o=r[1],i=(n=Na(a[u+1],2))[0],r=n[1],180<Math.abs(i-t)&&(n=0<t?180:-180,i=Math.abs((0<t?i+360:i-360)-t),i=o+(r-o)*(Math.abs(n-t)/i),s.push([n,i]),c.push(s),s=[[-n,i]]));return c.push(s),c}function cs(e,t){if(e=ks(e),t=ks(t),e&&2<=e.length&&t&&2<=t.length){var o=za(e[1]),r=za(t[1]),t=za(t[0]-e[0]),e=Math.sin(t)*Math.cos(r),t=Math.cos(o)*Math.sin(r)-Math.sin(o)*Math.cos(r)*Math.cos(t);return(Ba(Math.atan2(e,t))+360)%360}return NaN}function us(e,t){var o,r=0;Array.isArray(e)?o=e:e.type&&"LineString"===e.type&&(o=e.coordinates);for(var n=0,i=o.length-1;n<i;n++)r+=Ka(o[n],o[n+1]);return ts(r,"meters",t||"meters")}function ls(e,t,o){o=o||"meters";var r,n,i=0;if(Array.isArray(e)?n=e:e.type&&"LineString"===e.type&&(n=e.coordinates),2<=n.length){for(var a=n.length,s=1;s<a;s++){if(t<=i+(r=rs(n[s-1],n[s],o))){var c=cs(n[s-1],n[s]);return os(n[s-1],c,t-i,o)}i+=r}return i<=t?n[a-1]:n[0]}return null}function hs(e,t,o,r,n){r=r||"meters",n=n||0,e=ks(e);for(var i=[],a=360/o,s=0;s<=o;s++)i.push(os(e,(s*a+n)%360,t,r));return i}function ps(e,t,o,r,n){return as(hs(e,t,o,r,n))}function ds(e,t,o){o=void 0===o?.5:o;var r=rs(e=ks(e),t=ks(t),"kilometers");return os(e,cs(e,t),r*o,"kilometers")}function fs(e){return 90<e?180<(e=(e+90)%360)?90-(e-180):e-90:e<-90?(e=(e-90)%360)<-180?-90-(e+180):e+90:e}function gs(e){return 180<e?(e+180)%360-180:e<-180?(e-180)%360+180:e}function ys(e,t,o){if(0===o)return Object.assign({},e);t=ks(t);for(var r,n,i=[],a=0,s=e.length;a<s;a++)r=rs(t,e[a]),n=cs(t,e[a]),i.push(os(t,n+o,r));return i}function ms(e,t){for(var o,r,n=512*Math.pow(2,t),i=[],a=0,s=e.length;a<s;a++)o=e[a][0]/n-.5,r=.5-e[a][1]/n,i.push([360*o,90-360*Math.atan(Math.exp(2*-r*Math.PI))/Math.PI]);return i}function vs(e,t){for(var o,r,n=512*Math.pow(2,t),i=[],a=0,s=e.length;a<s;a++)r=Math.sin(e[a][1]*Math.PI/180),o=(e[a][0]+180)/360,r=.5-Math.log((1+r)/(1-r))/(4*Math.PI),i.push([Math.round(o*n),Math.round(r*n)]);return i}function _s(e,t,o,r){switch(Ya(t)){case Ma.kilometersPerHourSecond:e/=3.6;break;case Ma.milesPerHourSecond:e/=2.236936292054;break;case Ma.knotsPerSecond:e/=1.943844492441;break;case Ma.standardGravity:e/=.1019716212978;break;case Ma.kilometersPerSecondSquared:e/=.001;break;case Ma.milesPerSecondSquared:e/=.000621371192;break;case Ma.feetPerSecondSquared:e/=3.280839895012;break;case Ma.yardsPerSecondSquared:e/=1.093613298338;break;case Ma.metersPerSecondSquared:}switch(Ya(o)){case Ma.kilometersPerHourSecond:e*=3.6;break;case Ma.milesPerHourSecond:e*=2.236936292054;break;case Ma.knotsPerSecond:e*=1.943844492441;break;case Ma.standardGravity:e*=.1019716212978;break;case Ma.kilometersPerSecondSquared:e*=.001;break;case Ma.milesPerSecondSquared:e*=.000621371192;break;case Ma.feetPerSecondSquared:e*=3.280839895012;break;case Ma.yardsPerSecondSquared:e*=1.093613298338;break;case Ma.metersPerSecondSquared:}return es(e,r)}function ws(e,t,o,r){switch(Za(t)){case Oa.acres:e*=4046.8564224;break;case Oa.hectares:e*=1e4;break;case Oa.squareFeet:e*=.09290304;break;case Oa.squareKilometers:e*=1e6;break;case Oa.squareMiles:e*=259e4;break;case Oa.squareYards:e*=.83612736;break;case Oa.squareMeters:}switch(Za(o)){case Oa.acres:e/=4046.8564224;break;case Oa.hectares:e/=1e4;break;case Oa.squareFeet:e/=.09290304;break;case Oa.squareKilometers:e/=1e6;break;case Oa.squareMiles:e/=259e4;break;case Oa.squareYards:e/=.83612736;break;case Oa.squareMeters:}return es(e,r)}function bs(e,t,o,r){switch(Wa(t)){case Ra.feetPerSecond:e*=1.09728;break;case Ra.milesPerHour:e*=1.6093;break;case Ra.knots:e*=1.852;break;case Ra.metersPerSecond:e*=3.6;break;case Ra.mach:e*=1234.8;break;case Ra.kilometersPerHour:}switch(Wa(o)){case Ra.feetPerSecond:e/=1.09728;break;case Ra.milesPerHour:e/=1.6093;break;case Ra.knots:e/=1.852;break;case Ra.metersPerSecond:e/=3.6;break;case Ra.mach:e/=1234.8;break;case Ra.kilometersPerHour:}return es(e,r)}function Cs(e,t,o,r){switch(Va(t)){case xa.ms:e/=1e3;break;case xa.hours:e*=3600;break;case xa.minutes:e*=60;break;case xa.days:e*=86400;break;case xa.seconds:}switch(Va(o)){case xa.ms:e*=1e3;break;case xa.hours:e/=3600;break;case xa.minutes:e/=60;break;case xa.days:e/=86400;break;case xa.seconds:}return es(e,r)}function Es(e,t,o,r,n,i,a,s){n=ts(t,n,Pa.meters),i=Cs(o,i,xa.seconds);return _s(2*(n-bs(e,r,Ra.metersPerSecond)*i)/(i*i),Ma.metersPerSecondSquared,a,s)}function Ss(e,t,o,r,n,i,a){e=bs(e,r,Ra.metersPerSecond);return _s((bs(t,r,Ra.metersPerSecond)-e)/Cs(o,n,xa.seconds),Ma.metersPerSecondSquared,i,a)}function Ts(e,t,o,r){e=Is(e),t=Is(t);return null!=e&&null!=t?Cs(t.getTime()-e.getTime(),xa.ms,o,r):NaN}function Is(e){if("[object Date]"===Object.prototype.toString.call(e))return e;if("string"==typeof e){var t=Date.parse(e);if(!isNaN(t))return new Date(t);if(0<=e.indexOf("Date(")){t=0,t=0<(e=e.replace("/Date(","").replace(")/","")).indexOf("+")?parseInt(e.substr(0,e.indexOf("+")),10):0<e.indexOf("-")?parseInt(e.substr(0,e.indexOf("-")),10):parseInt(e,10);return new Date(t)}}else if("number"==typeof e)return new Date(e);return null}function As(e){var t=[],o=null,r=null;if(Array.isArray(e)&&0<e.length)if(Array.isArray(e[0])&&"number"==typeof e[0][0])t=e;else for(var n=e.length,i=0;i<n;i++)t=t.concat(As(e[i]));else if(e.type)switch(e.type){case"Point":t=[e.coordinates];break;case"LineString":t=e.coordinates;break;case"Polygon":o=e.coordinates;break;case"MultiPoint":t=e.coordinates;break;case"MultiLineString":o=e.coordinates;break;case"MultiPolygon":r=e.coordinates;break;case"Feature":var a=e,t=Hs._isCircle(a)?Hs._getCirclePositions(a):As(a.geometry);break;case"FeatureCollection":t=As(e.features);break;case"GeometryCollection":t=As(e.geometries)}else if(e instanceof Hs)return As(e.toJson());if(o)for(n=o.length,i=0;i<n;i++)t=t.concat(o[i]);else if(r)for(var s=r.length,i=0;i<s;i++)for(var c=r[i].length,u=0;u<c;u++)t=t.concat(r[i][u]);return t}function ks(e){if(Array.isArray(e)&&"number"==typeof e[0])return e;if(e.type){if("Point"===e.type)return e.coordinates;if("Feature"===e.type&&"Point"===e.geometry.type)return e.geometry.coordinates}else if(e instanceof Hs&&"Point"===e.getType())return e.getCoordinates();return null}function Os(e,t,o){o=o||"meters";var r,n,i=0;if(Array.isArray(e)?n=e:e.type&&"LineString"===e.type&&(n=e.coordinates),2<=n.length){for(var a=n.length,s=1;s<a;s++){if(t<=i+(r=rs(n[s-1],n[s],o))){var c=cs(n[s-1],n[s]),u=os(n[s-1],c,t-i,o);return new ba(new Aa(u),{heading:c})}i+=r}return i<=t?new ba(new Aa(n[a-1]),{heading:cs(n[a-2],n[a-1])}):new ba(new Aa(n[0]),{heading:cs(n[0],n[1])})}return null}function Ps(e,t,o,r){var n=ks(e),i=vs([n],22)[0],a=null,s=1/0;switch((t=t instanceof Hs?t.toJson():t).type){case"Feature":return Ps(e,t.geometry,o);case"Point":d=[[t.coordinates]];break;case"MultiPoint":for(var c,u=t.coordinates,l=0,h=u.length;l<h;l++)(c=rs(n,u[l]))<s&&(s=c,a=new ba(new Aa(u[l]),{distance:c}));break;case"LineString":d=[t.coordinates];break;case"Polygon":case"MultiLineString":d=t.coordinates;break;case"MultiPolygon":var p=t.coordinates;if(0<p.length)for(var d=p[0],l=1,h=p.length;l<h;l++)d=d.concat(p[l])}if(d)for(var f,l=0,h=d.length;l<h;l++)(f=$a(n,i,d[l]))&&f.properties.distance<s&&(s=f.properties.distance,a=f);return a&&(a.properties.distance=ts(a.properties.distance,"meters",o,r)),a}(ct=Oa=Oa||{}).squareMeters="squareMeters",ct.acres="acres",ct.hectares="hectares",ct.squareFeet="squareFeet",ct.squareKilometers="squareKilometers",ct.squareMiles="squareMiles",ct.squareYards="squareYards",(Pt=Pa=Pa||{}).meters="meters",Pt.kilometers="kilometers",Pt.feet="feet",Pt.miles="miles",Pt.nauticalMiles="nauticalMiles",Pt.yards="yards",(jt=xa=xa||{}).seconds="seconds",jt.hours="hours",jt.ms="ms",jt.minutes="minutes",jt.days="days",(Re=Ra=Ra||{}).metersPerSecond="metersPerSecond",Re.kilometersPerHour="kilometersPerHour",Re.feetPerSecond="feetPerSecond",Re.milesPerHour="milesPerHour",Re.knots="knots",Re.mach="mach",(Wt=Ma=Ma||{}).milesPerSecondSquared="milesPerSecondSquared",Wt.kilometersPerSecondSquared="kilometersPerSecondSquared",Wt.knotsPerSecond="knotsPerSecond",Wt.standardGravity="standardGravity",Wt.feetPerSecondSquared="feetPerSecondSquared",Wt.yardsPerSecondSquared="yardsPerSecondSquared",Wt.milesPerHourSecond="milesPerHourSecond",Wt.kilometersPerHourSecond="kilometersPerHourSecond",Wt.metersPerSecondSquared="metersPerSecondSquared";var xs,Rs,Ge=window&&window.__extends||(xs=function(e,t){return(xs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}xs(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),Ms=(Rs=Array,Ge(Ns,Rs),Ns.fromPosition=function(e){return 2===e.length?new Ns(e[0],e[1]):2<e.length?new Ns(e[0],e[1],e[2]):null},Ns.areEqual=function(e,t,o){if(void 0===o&&(o=6),e&&2<=e.length&&t&&2<=t.length){var r=Math.pow(10,o),n=fs(e[1]),o=fs(t[1]),e=gs(e[0]),t=gs(t[0]);if(0!=Math.round((n-o)*r)/r)return!1;r=Math.round((e-t)*r)/r;return 0!=r&&360!=r?!1:!0}return!1},Ns.fromLatLng=function(n,e,t){var i,a,s,c,u,l,o=[];return"number"==typeof n?(o.push(n),"number"==typeof e&&o.push(e),"number"==typeof t&&o.push(t)):Array.isArray(n)?2<=n.length&&"number"==typeof n[0]&&"number"==typeof n[1]&&(3<=n.length&&"number"==typeof n[2]?o.push(n[0],n[1],n[2]):o.push(n[0],n[1])):"object"==typeof n&&(i=["lat","latitude","y"],a=["lng","longitude","lon","x"],s=["elv","elevation","alt","altitude","z"],l=u=c=NaN,Object.keys(n).forEach(function(e,t,o){var r=e.toLowerCase();isNaN(c)&&0<=i.indexOf(r)&&"number"==typeof n[e]?c=n[e]:isNaN(u)&&0<=a.indexOf(r)&&"number"==typeof n[e]?u=n[e]:isNaN(l)&&0<=s.indexOf(r)&&"number"==typeof n[e]&&(l=n[e])}),isNaN(c)||isNaN(u)||(o.push(u,c),isNaN(l)||o.push(l))),2<=o.length?o:null},Ns.fromLatLngs=function(e){var t=[];if(Array.isArray(e))for(var o=0,r=e.length;o<r;o++){var n=Ns.fromLatLng(e[o]);n&&t.push(n)}return t},Ns._getDimensions=function(e){for(var t=0;Array.isArray(e);)e=e[0],t++;return"number"==typeof e&&t--,t},Ns);function Ns(e,t,o){return o?Rs.call(this,e,t,o)||this:Rs.call(this,e,t)||this}var Ls=(Ds.TYPE="Polygon",Ds);function Ds(e,t){this.type="Polygon",this.type=Ds.TYPE,1===Ms._getDimensions(e)?this.coordinates=[e]:this.coordinates=e,this.bbox=t}var qs,js,ct=window&&window.__extends||(qs=function(e,t){return(qs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}qs(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),Us=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Hs=(ct(zs,js=Q),zs.prototype.addProperty=function(e,t){ma(this.data.properties[e],t)||(this.data.properties[e]=wn(t),"subType"!==e&&"radius"!==e||this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},zs.prototype.getBounds=function(){var t,e,o,r,n,i=this.getCoordinates(),a=this.getType();if("Point"===a)n=this.circlePolygon?(s=this.circlePolygon.geometry.coordinates,Gs.fromPositions(s[0])):new Gs(s=i,s);else if("MultiPoint"===a||"LineString"===a){var s=i;n=Gs.fromPositions(s)}else if("Polygon"===a){s=i;n=Gs.fromPositions(s[0])}else if("MultiLineString"===a){s=i;try{for(var c=Us(s),u=c.next();!u.done;u=c.next()){var l=u.value;n=Gs.merge(n,Gs.fromPositions(l))}}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=c.return)&&e.call(c)}finally{if(t)throw t.error}}}else if("MultiPolygon"===a){s=i;try{for(var h=Us(s),p=h.next();!p.done;p=h.next()){var d=p.value;n=Gs.merge(n,Gs.fromPositions(d[0]))}}catch(e){o={error:e}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(o)throw o.error}}}return n},zs.prototype.getCoordinates=function(){return wn(this.data.geometry.coordinates)},zs.prototype.getCircleCoordinates=function(){return this.circlePolygon?wn(this.circlePolygon.geometry.coordinates[0]):null},zs.prototype.getId=function(){return this.data.id},zs.prototype.getProperties=function(){return wn(this.data.properties)},zs.prototype.getType=function(){return this.data.geometry.type},zs.prototype.isCircle=function(){return zs._isCircle(this.data)},zs.prototype.isRectangle=function(){return zs._isRectangle(this.data)},zs.prototype.setCoordinates=function(e){e="Polygon"===this.getType()&&1===Ms._getDimensions(e)?[e]:e;ma(this.data.geometry.coordinates,e)||(this.data.geometry.coordinates=wn(e),this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},zs.prototype.setProperties=function(e){e[zs._shapeIdPropName]=this.data.id,ma(this.data.properties,e)||(this.data.properties=wn(e),this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},zs.prototype.toJson=function(){return JSON.parse(JSON.stringify(this.data))},zs.prototype._toJson=function(){return this.circlePolygon||this.data},zs.prototype._setDataSource=function(e){void 0===e||null==e?delete this.dataSource:this.dataSource=e},zs.prototype._handleCircle=function(){var e;this.isCircle()?(e=zs._getCirclePositions(this.data),this.circlePolygon=new ba(new Ls([e]),this.data.properties,this.data.id),this.data.properties.subType="Circle"):delete this.circlePolygon},zs._isCircle=function(e){return e&&e.geometry&&"Point"===e.geometry.type&&e.geometry.coordinates&&e.properties&&"string"==typeof e.properties.subType&&"circle"===e.properties.subType.toLowerCase()&&"number"==typeof e.properties.radius},zs._isRectangle=function(e){if("Polygon"===e.geometry.type&&e.geometry.coordinates&&"string"==typeof e.properties.subType&&"rectangle"===e.properties.subType.toLowerCase()){e=e.geometry.coordinates;if(1===e.length){e=e[0];if(5===e.length)return e[0][0]===e[4][0]&&e[0][1]===e[4][1];if(4===e.length)return!0}}return!1},zs._getCirclePositions=function(e){return ps(e.geometry.coordinates,e.properties.radius,72,"meters")},zs._shapeIdPropName="_azureMapsShapeId",zs);function zs(e,t,o){var r,n,i=js.call(this)||this;return"Feature"===e.type?(n=wn((r=e).geometry),o=r.properties?wn(r.properties):{},t=null==r.id||""===r.id?wa():r.id):(n=wn(e),t=null==t||""===t?wa():t,o=o?wn(o):{}),o[zs._shapeIdPropName]=t,i.data=new ba(n,o,t),i._handleCircle(),i}var Bs,Fs,Pt=window&&window.__extends||(Bs=function(e,t){return(Bs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Bs(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),Ks=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Gs=(Fs=Array,Pt(Ys,Fs),Ys.fromBoundingBox=function(e){var t=Ys.getWest(e),o=Ys.getSouth(e),r=Ys.getEast(e),e=Ys.getNorth(e);return new Ys([t,o,r,e])},Ys.fromDimensions=function(e,t,o){var r=e[0],n=e[1],e=Math.min(Math.max(n+o/2,-85.5),85.5),n=Math.min(Math.max(n-o/2,-85.5),85.5),o=gs(r+t/2);return new Ys([gs(r-t/2),n,o,e])},Ys.fromEdges=function(e,t,o,r){return new Ys([e,t,o,r])},Ys.containsPosition=function(e,t){var o=Ys.getCenter(e),r=Math.abs(o[1]-t[1]),o=Math.abs(o[0]-t[0]);180<o&&(o=360-o);t=Ys.getHeight(e),e=Ys.getWidth(e);return r<=t/2+1e-8&&o<=e/2+1e-8},Ys.containsBoundingBox=function(e,t){var o=e&&4===e.length,r=t&&4===t.length;return!(!o||!r)&&(Ys.getWest(e)<Ys.getWest(t)&&Ys.getWest(t)<Ys.getEast(e)&&Ys.getWest(e)<Ys.getEast(t)&&Ys.getEast(t)<Ys.getEast(e)&&Ys.getSouth(e)<Ys.getSouth(t)&&Ys.getSouth(t)<Ys.getNorth(e)&&Ys.getSouth(e)<Ys.getNorth(t)&&Ys.getNorth(t)<Ys.getNorth(e))},Ys.crossesAntimeridian=function(e){return gs(Ys.getEast(e))-gs(Ys.getWest(e))<0||Ys.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe(e)||Ys.isBoundingBoxWithLessThanSixElementsLargerThanGlobe(e)},Ys.getCenter=function(e){var t=gs(Ys.getEast(e)),o=gs(Ys.getWest(e));t<o&&(t+=360);o=gs((o+t)/2),t=fs(Ys.getSouth(e)),e=fs(Ys.getNorth(e));return[o,fs((t+e)/2)]},Ys.getHeight=function(e){e=fs(Ys.getNorth(e))-fs(Ys.getSouth(e));return isNaN(e)?0:e},Ys.getWidth=function(e){e=gs(Ys.getEast(e))-gs(Ys.getWest(e));return isNaN(e)?0:e<0?e+360:e},Ys.getSouthWest=function(e){var t=this.getSouth(e),e=this.getWest(e);return isNaN(t)||isNaN(e)?null:[e,t]},Ys.getNorthEast=function(e){var t=this.getNorth(e),e=this.getEast(e);return isNaN(t)||isNaN(e)?null:[e,t]},Ys.getNorthWest=function(e){var t=this.getNorth(e),e=this.getWest(e);return isNaN(t)||isNaN(e)?null:[e,t]},Ys.getSouthEast=function(e){var t=this.getSouth(e),e=this.getEast(e);return isNaN(t)||isNaN(e)?null:[e,t]},Ys.getSouth=function(e){return e&&4<=e.length?Number(e[1]):NaN},Ys.getWest=function(e){return e&&4<=e.length?Number(e[0]):NaN},Ys.getNorth=function(e){if(e){if(4===e.length)return Number(e[3]);if(6===e.length)return Number(e[4])}return NaN},Ys.getEast=function(e){if(e){if(4===e.length)return Number(e[2]);if(6===e.length)return Number(e[3])}return NaN},Ys.intersect=function(e,t){var o=Ys.getCenter(e),r=Ys.getCenter(t),n=Math.abs(o[1]-r[1]),i=Math.abs(o[0]-r[0]);180<i&&(i=360-i);o=Ys.getHeight(e),r=Ys.getWidth(e),e=Ys.getHeight(t),t=Ys.getWidth(t);return n<=o/2+e/2&&i<=r/2+t/2},Ys.merge=function(e,t){var o=e&&4===e.length,r=t&&4===t.length;if(o&&!r)return e;if(r&&!o)return t;if(!o&&!r)return null;for(var o=Math.max(fs(Ys.getNorth(e)),fs(Ys.getNorth(t))),r=Math.min(fs(Ys.getSouth(e)),fs(Ys.getSouth(t))),n=[e,t],i=[],a=0,a=0;a<n.length;a++){var s=n[a],c=gs(Ys.getWest(s)),u=gs(Ys.getEast(s));Ys.crossesAntimeridian(s)?(i.push([c,180]),i.push([-180,u])):i.push([c,u])}i.sort(function(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]});var l=[],h=i[0];for(a=1;a<i.length;){var p=i[a];h[1]>=p[0]?h[1]=Math.max(h[1],p[1]):(l.push(h),h=p),a++}l.push(h);var d=l.length,f=l[0][0]+360-l[d-1][1],g=[l[d-1][1],l[0][0]];for(a=1;a<d;a++){var y=l[a][0]-l[a-1][1];f<y&&(f=y,g=[l[a-1][1],l[a][0]])}return new Ys([g[1],r],[g[0],o])},Ys.fromPositions=function(e){for(var t,o,r=NaN,n=NaN,i=NaN,a=NaN,s=e.length,c=new Array(s),u=0;s--;)(o=e[s])&&2<=o.length&&(t=fs(o[1]),r=isNaN(r)?t:Math.max(r,t),n=isNaN(n)?t:Math.min(n,t),c[u++]=gs(o[0]));if(u){c.length=u,c.sort(function(e,t){return e-t});for(var l=c[0]+360-c[u-1],h=0,s=1;s<u;s++){var p=c[s]-c[s-1];l<p&&(l=p,h=s)}i=c[h],a=c[(h||u)-1]}return isNaN(i)||isNaN(n)||isNaN(a)||isNaN(r)?null:new Ys([i,n,a,r])},Ys.fromLatLngs=function(e){return Ys.fromPositions(Ms.fromLatLngs(e))},Ys.fromData=function(e){var t,o,r=null;if(Array.isArray(e)&&0<e.length){try{for(var n=Ks(e),i=n.next();!i.done;i=n.next()){var a,s=i.value;null!=(a=Ys.fromData(s))&&(r=null===r?a:Ys.merge(r,a))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(t)throw t.error}}return r}if(e instanceof Hs)return e.getBounds();if(e&&e.type){var c=e;if(c.bbox&&4===c.bbox.length)return c.bbox;switch(c.type){case"FeatureCollection":return Ys.fromData(c.features);case"Feature":return Hs._isCircle(c)?Ys.fromPositions(Hs._getCirclePositions(c)):Ys.fromData(c.geometry);case"GeometryCollection":return Ys.fromData(c.geometries);case"Point":var u=c.coordinates;if(u&&2<=u.length)return[u[0],u[1],u[0],u[1]];break;case"LineString":case"MultiPoint":return Ys.fromPositions(c.coordinates);case"Polygon":case"MultiLineString":var l=c.coordinates;if(l&&0<l.length){for(var h=0,p=l.length;h<p;h++)null!=(a=Ys.fromPositions(l[h]))&&(r=null===r?a:Ys.merge(r,a));if(null!=r)return r}break;case"MultiPolygon":var d=c.coordinates;if(d&&0<d.length){for(h=0,p=d.length;h<p;h++)for(var f=0,g=d[h].length;f<g;f++)null!=(a=Ys.fromPositions(d[h][f]))&&(r=null===r?a:Ys.merge(r,a));return r}}}return null},Ys.splitOnAntimeridian=function(e){var t,o,r,n,i,a,s=[];return Ys.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe(e)?[[-180,e[1],e[2],180,e[4],e[5]]]:Ys.isBoundingBoxWithLessThanSixElementsLargerThanGlobe(e)?[[-180,e[1],180,e[3]]]:(Ys.crossesAntimeridian(e)?(a=t=void 0,o=gs(Ys.getWest(e)),r=gs(Ys.getEast(e)),n=fs(Ys.getNorth(e)),i=fs(Ys.getSouth(e)),a=6<=e.length?(t=[o,i,e[2],180,n,e[5]],[-180,i,e[2],r,n,e[5]]):(t=[o,i,180,n],[-180,i,r,n]),s.push(t,a)):s.push(e),s)},Ys.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe=function(e){return 6<=e.length&&360<e[3]-e[0]},Ys.isBoundingBoxWithLessThanSixElementsLargerThanGlobe=function(e){return e.length<6&&360<e[2]-e[0]},Ys);function Ys(e,t){var o,r=this;return e&&t?r=(o=e)[2]&&t[2]?Fs.call(this,o[0],o[1],o[2]||0,t[0],t[1],t[2]||0)||this:Fs.call(this,o[0],o[1],t[0],t[1])||this:!e||(e=e)&&(4===e.length?r=Fs.call(this,e[0],e[1],e[2],e[3])||this:6<=e.length&&(r=Fs.call(this,e[0],e[1],e[2],e[3],e[4],e[5])||this)),r}var Zs=(Ws.TYPE="FeatureCollection",Ws);function Ws(e,t){this.type="FeatureCollection",this.type=Ws.TYPE,this.features=e,this.bbox=t}Vs.TYPE="GeometryCollection",jt=Vs;function Vs(e){this.type="GeometryCollection",this.type=Vs.TYPE,this.geometries=e}Js.TYPE="LineString",Re=Js;function Js(e,t){this.type="LineString",this.type=Js.TYPE,this.coordinates=e,this.bbox=t}Qs.TYPE="MultiLineString",Wt=Qs;function Qs(e,t){this.type="MultiLineString",this.type=Qs.TYPE,this.coordinates=e,this.bbox=t}Xs.TYPE="MultiPoint",Ge=Xs;function Xs(e,t){this.type="MultiPoint",this.type=Xs.TYPE,this.coordinates=e,this.bbox=t}$s.TYPE="MultiPolygon",ct=$s;function $s(e,t){this.type="MultiPolygon",this.type=$s.TYPE,this.coordinates=e,this.bbox=t}var ec,tc,Pt=window&&window.__extends||(ec=function(e,t){return(ec=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}ec(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),Pt=(tc=Array,Pt(oc,tc),oc.fromPosition=function(e){return 2<=e.length?new oc((180+e[0])/360,oc._latToMercatorY(e[1]),3<=e.length?oc._altitudeToMercatorZ(e[2],e[1]):0):[0,0,0]},oc.fromPositions=function(e){for(var t=[],o=0,r=e.length;o<r;o++)t.push(this.fromPosition(e[o]));return t},oc.toFloat32Array=function(e){for(var t=new Float32Array(3*e.length),o=0,r=e.length;o<r;o++){var n=3*o,i=e[o];t[n]=(180+i[0])/360,t[1+n]=oc._latToMercatorY(i[1]),t[2+n]=3<=i.length?oc._altitudeToMercatorZ(i[2],i[1]):0}return t},oc.toPosition=function(e){if(2<=e.length){var t=360/Math.PI*Math.atan(Math.exp((180-360*e[1])*Math.PI/180))-90;return new Ms(360*e[0]-180,t,3<=e.length?oc._mercatorZToAltitude(e[2],e[1]):0)}return[0,0,0]},oc.toPositions=function(e){for(var t=[],o=0,r=e.length;o<r;o++)t.push(this.toPosition(e[o]));return t},oc.mercatorScale=function(e){return 1/Math.cos(e*Math.PI/180)},oc.meterInMercatorUnits=function(e){return 1/oc.earthCircumference*oc.mercatorScale(oc._latToMercatorY(e))},oc._circumferenceAtLatitude=function(e){return oc.earthCircumference*Math.cos(e*Math.PI/180)},oc._altitudeToMercatorZ=function(e,t){return e/oc._circumferenceAtLatitude(t)},oc._mercatorZToAltitude=function(e,t){return e*oc._circumferenceAtLatitude(oc._latToMercatorY(t))},oc._latToMercatorY=function(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360},oc.earthCircumference=2*Math.PI*ns(),oc);function oc(e,t,o){return tc.call(this,e,t,o||0)||this}jt=Object.freeze({__proto__:null,BoundingBox:Gs,Feature:ba,FeatureCollection:Zs,GeometryCollection:jt,LineString:Re,MercatorPoint:Pt,MultiLineString:Wt,MultiPoint:Ge,MultiPolygon:ct,Point:Aa,Polygon:Ls,Position:Ms});function rc(e,t){return e*e+t*t}function nc(e,t){for(var o,r,n,i=e[0],a=[i],s=1,c=e.length;s<c;s++)o=e[s],n=i,rc((r=o)[0]-n[0],r[1]-n[1])>t&&(a.push(o),i=o);return i!==o&&a.push(o),a}function ic(e,t,o,r,n){for(var i,a,s,c,u,l,h,p=r,d=t+1;d<o;d++){var f=(a=e[d],s=e[t],c=e[o],h=l=f=u=void 0,u=s[0],f=s[1],l=c[0]-u,h=c[1]-f,0==l&&0==h||(1<(s=((a[0]-u)*l+(a[1]-f)*h)/rc(l,h))?(u=c[0],f=c[1]):0<s&&(u+=l*s,f+=h*s)),rc(a[0]-u,a[1]-f));p<f&&(i=d,p=f)}r<p&&(1<i-t&&ic(e,t,i,r,n),n.push(e[i]),1<o-i&&ic(e,i,o,r,n))}var ac=function(e,t,o){if(e.length<=2)return e;var r,n=(t=void 0===t?1:t)*t;return e=(o=void 0===o?!1:o)?e:nc(e,n),t=(r=e).length-1,o=[r[0]],ic(r,0,t,n,o),o.push(r[t]),e=o};var sc=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},cc=(uc.prototype.toTarget=function(e,t){return this.transformArray(e,this.M,t)},uc.prototype.toSource=function(e,t){return this.transformArray(e,this.inverseM,t)},uc.prototype.transformArray=function(e,t,o){var r,n;if(e&&Array.isArray(e)&&Array.isArray(e[0])){var i=[];try{for(var a=sc(e),s=a.next();!s.done;s=a.next()){var c=s.value;i.push(this.transform(c,t,o))}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}return null},uc.prototype.transform=function(e,t,o){var r=e[0]*t[0][3]+e[1]*t[1][3]+t[2][3],t=e[0]*t[0][4]+e[1]*t[1][4]+t[2][4];return"number"==typeof o&&0<=o?[es(r,o),es(t,o)]:[es(r,6),es(t,6)]},uc._calculateAffineTransform=function(e,t){if(e.length!==t.length||e.length<1)throw new Error("Error: source and target arrays must have the same length.");var o=Math.min(e[0].length,t[0].length),r=o+1;if(e.length<o)throw new Error("Erorr: At least "+o+" reference points required.");for(var n=[],i=[],a=0;a<r;a++){i[a]=[];for(var s=0;s<r;s++){s<o&&(n[s]=0);for(var c=i[a][s]=0;c<e.length;c++)s<o&&(n[s]+=a<o?e[c][a]*t[c][s]:t[c][s]),i[a][s]+=o<=a&&o<=s?1:o<=a?e[c][s]:o<=s?e[c][a]:e[c][a]*e[c][s]}i[a]=i[a].concat(n)}if(!this._gaussJordanElimination(i))throw new Error("Error: Singular matrix. Points are likely coplanar.");return i},uc._gaussJordanElimination=function(e){for(var t,o=e.length,r=2*o-1,n=0;n<o;n++){for(var i=n,a=n+1;a<o;a++)Math.abs(e[a][n])>Math.abs(e[i][n])&&(i=a);if(t=e[i],e[i]=e[n],e[n]=t,Math.abs(e[n][n])<=1e-12)return!1;for(var s=n+1;s<o;s++)for(var c=e[s][n]/e[n][n],u=n;u<r;u++)e[s][u]-=e[n][u]*c}for(n=o-1;-1<n;n--){c=e[n][n];for(a=0;a<n;a++)for(var l=r-1;n-1<l;l--)e[a][l]-=e[n][l]*e[a][n]/c;e[n][n]/=c;for(var h=o;h<r;h++)e[n][h]/=c}return!0},uc);function uc(e,t){this.M=uc._calculateAffineTransform(e,t),this.inverseM=uc._calculateAffineTransform(t,e)}var lc,hc,Re=Object.freeze({__proto__:null,get AccelerationUnits(){return Ma},AffineTransform:cc,get AreaUnits(){return Oa},get DistanceUnits(){return Pa},get SpeedUnits(){return Ra},get TimeUnits(){return xa},WEBMERCATOR_MAXLAT:Ha,_precision:es,boundingBoxToPolygon:function(e){var t=gs(Gs.getWest(e)),o=gs(Gs.getEast(e)),r=fs(Gs.getNorth(e)),n=fs(Gs.getSouth(e)),e=Gs.getCenter(e),r=[[t,r],[t,n],[e[0],n],[o,n],[o,r],[e[0],r],[t,r]];return new Ls([r])},convertAcceleration:_s,convertArea:ws,convertDistance:ts,convertSpeed:bs,convertTimespan:Cs,getAcceleration:Es,getAccelerationFromFeatures:function(e,t,o,r,n,i,a){if("string"==typeof o&&"Feature"===e.type&&"Point"===e.geometry.type&&"Feature"===t.type&&"Point"===t.geometry.type){var s=Ts(e.properties[o],t.properties[o],xa.seconds);if(!isNaN(s)){var c=0;if(r&&"string"==typeof r){o=e.properties[r],r=t.properties[r];if("number"==typeof o&&(c=o,"number"==typeof r))return Ss(o,r,s,n,xa.seconds,i,a)}return Es(c,rs(e.geometry.coordinates,t.geometry.coordinates,Pa.meters),s,n,Pa.meters,xa.seconds,i,a)}}return NaN},getAccelerationFromSpeeds:Ss,getArea:function e(t,o,r){if(t){var n=0;switch((t=t instanceof Hs?t.toJson():t).type){case"Feature":var i=t;if(t.geometry)return e(i.geometry,o,r);break;case"Polygon":(i=t).coordinates&&(n=Ja(i.coordinates));break;case"MultiPolygon":var a=t;if(a.coordinates)for(var s=0,c=a.coordinates.length;s<c;s++)n+=Ja(a.coordinates[s])}return ws(n,Oa.squareMeters,o,r)}return 0},getCardinalSpline:function(e,t,o,r){if(!e||e.length<=2)return i;"number"!=typeof t&&(t=.5),("number"!=typeof o||o<=0)&&(o=15);var n=e.length,i=e.slice(0);r?(Ms.areEqual(i[0],i[n-1])&&(i.pop(),n--),i.unshift(e[n-1]),i.push(e[0]),i.push(e[1]),n++):(i.unshift(e[0]),i.push(e[n-1]));var a,s,c,u=[];u.push([1,0,0,0]);for(var l=1;l<o-1;l++)u.push([2*(c=(a=l/o)*(s=a*a))-3*s+1,-2*c+3*s,c-2*s+a,c-s]);u.push([0,1,0,0]);for(var h,p,d,f,g,y,m=[],l=1;l<n;l++)for(h=t*(i[l+1][0]-i[l-1][0]),p=t*(i[l+1][1]-i[l-1][1]),d=t*(i[l+2][0]-i[l][0]),f=t*(i[l+2][1]-i[l][1]),a=0;a<o;a++)y=(g=u[a])[0]*i[l][0]+g[1]*i[l+1][0]+g[2]*h+g[3]*d,g=Fa(g[0]*i[l][1]+g[1]*i[l+1][1]+g[2]*p+g[3]*f,-85,85),m.push([y,g]);return m},getClosestPointOnGeometry:Ps,getConvexHull:function(e){var t,o,r=As(e).map(function(e){return[gs(e[0]),fs(e[1])]});r.sort(function(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]});var n=[];try{for(var i=La(r),a=i.next();!a.done;a=i.next()){for(var s=a.value;2<=n.length&&Xa(n[n.length-2],n[n.length-1],s)<=0;)n.pop();n.push(s)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(t)throw t.error}}for(var c=[],u=r.length-1;0<=u;u--){for(;2<=c.length&&Xa(c[c.length-2],c[c.length-1],r[u])<=0;)c.pop();c.push(r[u])}return new Ls([n.concat(c)])},getDestination:os,getDistanceTo:rs,getEarthRadius:ns,getGeodesicPath:function(e,t){var o;(!t||t<=0)&&(t=15),Array.isArray(e)?o=e:e.type&&"LineString"===e.type&&(o=e.coordinates);for(var r=o.length-1,n=[],i=0;i<r;i++)n=n.concat(is(o[i],o[i+1],t));return as(n)},getGeodesicPaths:function(e,t){var o;(!t||t<=0)&&(t=15),Array.isArray(e)?o=e:e.type&&"LineString"===e.type&&(o=e.coordinates);for(var r=o.length-1,n=[],i=[],a=0;a<r;a++)for(var s,c,u,l,h,p=is(o[a],o[a+1],t),d=0;d<p.length;d++)n.push(p[d]),d+1>=p.length||(s=(u=Na(p[d],2))[0],c=u[1],h=(l=Na(p[d+1],2))[0],u=l[1],180<Math.abs(h-s)&&(l=0<s?180:-180,h=Math.abs((0<s?h+360:h-360)-s),h=c+(u-c)*(Math.abs(l-s)/h),n.push([l,h]),i.push(n),n=[[-l,h]]));return i.push(n),i},getHeading:cs,getLengthOfPath:us,getPathDenormalizedAtAntimerian:as,getPathSplitByAntimeridian:ss,getPixelHeading:function(e,t){e=ks(e),t=ks(t);var e=(o=Na(vs([e,t],21),2))[0],o=(t=o[1])[0]-e[0],t=e[1]-t[1];return(2.5*Math.PI-Math.atan2(t,o))*ja%360},getPointWithHeadingAlongPath:Os,getPointsWithHeadingsAlongPath:function(e,t){if(t<=0)return[];for(var o=[],r=us(e,Pa.meters)/(t-1),n=0;n<t;n++){var i=Os(e,r*n,Pa.meters);null!=i&&o.push(i)}return o},getPosition:ks,getPositionAlongPath:ls,getPositions:As,getPositionsAlongPath:function(e,t){if(t<2)return[];for(var o=[],r=us(e,Pa.meters)/(t-1),n=0;n<t;n++){var i=ls(e,r*n,Pa.meters);null!=i&&o.push(i)}return o},getRegularPolygonPath:ps,getRegularPolygonPaths:function(e,t,o,r,n){return ss(hs(e,t,o,r,n))},getSpeed:function(e,t,o,r,n,i){if(e=ks(e),t=ks(t),e&&t){r=Cs(o,r,xa.seconds);return bs(rs(e,t,Pa.meters)/r,Ra.metersPerSecond,n,i)}return 0},getSpeedFromFeatures:function(e,t,o,r,n){if("string"==typeof o&&"Feature"===e.type&&"Point"===e.geometry.type&&"Feature"===t.type&&"Point"===t.geometry.type){o=Ts(e.properties[o],t.properties[o],xa.seconds);if(!isNaN(o))return bs(rs(e.geometry.coordinates,t.geometry.coordinates,Pa.meters)/o,Ra.metersPerSecond,r,n)}return NaN},getTimespan:Ts,getTravelDistance:function(e,t,o,r,n,i,a,s){return t=Cs(t,n,xa.seconds),o=(o=bs(o,i,Ra.metersPerSecond))*t,"number"==typeof r&&(o+=.5*_s(r,a,Ma.metersPerSecondSquared)*t*t),ts(o,Pa.meters,e,s)},interpolate:ds,mercatorPixelsToPositions:ms,mercatorPositionsToPixels:vs,normalizeLatitude:fs,normalizeLongitude:gs,parseTimestamp:Is,rotatePositions:ys,simplify:function(e,t){return ac(e,t,!0)}}),pc=((window&&window.__extends||(lc=function(e,t){return(lc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}lc(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(dc,hc=k),dc);function dc(){var e=null!==hc&&hc.apply(this,arguments)||this;return e.zoomDelta=1,e.style=l.ControlStyle.light,e}var fc,gc,Pt=((window&&window.__extends||(fc=function(e,t){return(fc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}fc(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(yc,gc=oe),yc.prototype.onAdd=function(e){this.container=this.buildContainer(e,this.options.style,"Zoom Control"),this.container.style.flexDirection="column",this.zoomInButton=this.constructZoomInButton(e),this.zoomOutButton=this.constructZoomOutButton(e);var t=z("Zoom In"),o=z("Zoom Out");return this.container.appendChild(this.zoomInButton),this.container.appendChild(t),this.container.appendChild(this.zoomOutButton),this.container.appendChild(o),B(t,this.zoomInButton),B(o,this.zoomOutButton),e.events.add("zoom",this.zoomChanged),e.events.add("minzoomchanged",this.minZoomChanged),e.events.add("maxzoomchanged",this.maxZoomChanged),this.map=e,this.container},yc.prototype.onRemove=function(){gc.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)},yc.prototype.updateZoomButtonsState=function(){var e=this.map.getCamera().zoom>=this.map._getMap().getMaxZoom(),t=Gs.getSouth(this.map.getCamera().bounds)<=-Ha&&Gs.getNorth(this.map.getCamera().bounds)>=Ha,t=this.map.getCamera().zoom<=this.map._getMap().getMinZoom()||t;this.zoomInButton&&this.zoomInButton.disabled!=e&&(this.zoomInButton.disabled=e,this.zoomInButton.setAttribute("aria-label",e?"Zoom In disabled":"Zoom In")),this.zoomOutButton&&this.zoomOutButton.disabled!=t&&(this.zoomOutButton.disabled=t,this.zoomOutButton.setAttribute("aria-label",e?"Zoom Out disabled":"Zoom Out"))},yc.prototype.constructZoomInButton=function(t){var o=this,e=document.createElement("button");return e.classList.add("azure-maps-control-button"),e.classList.add("zoom-in"),e.setAttribute("aria-label","Zoom In"),e.setAttribute("alt","Zoom In"),e.setAttribute("type","button"),e.addEventListener("click",function(){var e;t.setCamera({maxBounds:null===(e=t._getMap().getMaxBounds())||void 0===e?void 0:e.toArray().flat(),zoom:t.getCamera().zoom+o.options.zoomDelta,duration:yc.ZOOM_DURATION_MS,type:"ease"},!0)}),e},yc.prototype.constructZoomOutButton=function(t){var o=this,e=document.createElement("button");return e.classList.add("azure-maps-control-button"),e.classList.add("zoom-out"),e.setAttribute("aria-label","Zoom Out"),e.setAttribute("alt","Zoom Out"),e.setAttribute("type","button"),e.addEventListener("click",function(){var e;t.setCamera({maxBounds:null===(e=t._getMap().getMaxBounds())||void 0===e?void 0:e.toArray().flat(),zoom:t.getCamera().zoom-o.options.zoomDelta,duration:yc.ZOOM_DURATION_MS,type:"ease"},!0)}),e},yc.ZOOM_DURATION_MS=200,yc);function yc(e){var t=gc.call(this)||this;return t.container=null,t.zoomInButton=null,t.zoomOutButton=null,t.zoomChanged=function(e){return t.updateZoomButtonsState()},t.minZoomChanged=function(e){return t.updateZoomButtonsState()},t.maxZoomChanged=function(e){return t.updateZoomButtonsState()},t.options=(new pc).merge(e),t}var Wt=Object.freeze({__proto__:null,CompassControl:le,ControlBase:oe,PitchControl:ve,StyleControl:Ht,TrafficControl:qi,TrafficLegendControl:tt,ZoomControl:Pt}),mc=mt;var vc=be(function(e,t){return mc(e,5,t="function"==typeof t?t:void 0)}),_c=(wc.Css={hidden:"hidden-accessible-element"},wc);function wc(e){var t=this;this.attach=function(e){t.map!==e&&(t.map&&t.detachFromCurrentMap(),t.map=e,t.map.indicators._getCollectionDiv().appendChild(t.element),t.map.indicators.add(t))},this.remove=function(){t.detachFromCurrentMap(),t.element.remove()},this.getElement=function(){return t.element},this.detachFromCurrentMap=function(){t.map&&(t.map.indicators.remove(t),delete t.map)},this.element=document.createElement("div"),this.element.setAttribute("tabindex","0"),this.element.setAttribute("role","option"),null!=e&&e.setSize&&this.element.setAttribute("aria-setsize",e.setSize.toString()),null!=e&&e.positionInSet&&this.element.setAttribute("aria-posinset",e.positionInSet.toString()),this.element.setAttribute("aria-label","data point"),this.element.classList.add(wc.Css.hidden)}var bc,Cc,Ec=((window&&window.__extends||(bc=function(e,t){return(bc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}bc(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Sc,Cc=k),Sc);function Sc(){var e=null!==Cc&&Cc.apply(this,arguments)||this;return e.buffer=128,e.maxZoom=18,e.cluster=!1,e.clusterRadius=50,e.clusterMaxZoom=void 0,e.clusterProperties=void 0,e.lineMetrics=!1,e.tolerance=.375,e.clusterMinPoints=2,e.generateId=!1,e.promoteId=void 0,e.filter=void 0,e}var Tc,Ic,Ac=((window&&window.__extends||(Tc=function(e,t){return(Tc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Tc(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(kc,Ic=Q),kc.prototype.getId=function(){return this.id},kc.prototype._setMap=function(e,t){var o;void 0===t&&(t=!0),null==e||void 0===e?(o=this.map,delete this.map,t&&(this._invokeEvent("sourceremoved",this),o&&o.events.invoke("sourceremoved",this))):(this.map=e,t&&(this._invokeEvent("sourceadded",this),this.map.events.invoke("sourceadded",this)))},kc);function kc(e){var t=Ic.call(this)||this;return t.id=e||wa(),t}var Oc,Pc,Ge=window&&window.__extends||(Oc=function(e,t){return(Oc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Oc(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),xc=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Rc=(Ge(Mc,Pc=Ac),Mc.prototype.add=function(e,t){this._addNoUpdate(e,t),this._updateSource()},Mc.prototype.clear=function(){this._clearNoUpdate(),this._updateSource()},Mc.prototype.dispose=function(){this.options=null,this.shapes=null,this.shapesMap=null,this.map=null},Mc.prototype.getClusterExpansionZoom=function(t){var n=this;return new Promise(function(o,r){var e;n.map?(e=n.map._getMap().getSource(n.getId()))&&"geojson"===e.type&&e.getClusterExpansionZoom(t,function(e,t){e?r(e):"number"==typeof t&&o(t)}):r("The DataSource hasn't been added to a map.")})},Mc.prototype.getClusterChildren=function(t){var n=this;return new Promise(function(o,r){var e;n.map?(e=n.map._getMap().getSource(n.getId()))&&"geojson"===e.type&&e.getClusterChildren(t,function(e,t){e?r(e):t&&o(n.map.sources._mapFeaturesToShapes(t,!1,n))}):r("The DataSource hasn't been added to a map.")})},Mc.prototype.getClusterLeaves=function(t,n,i){var a=this;return new Promise(function(o,r){var e;a.map?(e=a.map._getMap().getSource(a.getId()))&&"geojson"===e.type&&e.getClusterLeaves(t,n,i,function(e,t){e?r(e):t&&o(a.map.sources._mapFeaturesToShapes(t,!1,a))}):r("The DataSource hasn't been added to a map.")})},Mc.prototype.getOptions=function(){return wn(this.options)},Mc.prototype.getShapes=function(){return Array.from(this.shapes)},Mc.prototype.importDataFromUrl=function(e){var t=this;return fetch(e,{method:"GET",mode:"cors"}).then(function(e){if(e.ok)return e.json();throw new Error("HTTP ".concat(e.status,": ").concat(e.statusText))}).then(function(e){t.add(e)})},Mc.prototype.getShapeById=function(e){return this.shapes[this.shapesMap.get(e)]||null},Mc.prototype.remove=function(e){var t,o,e=Array.isArray(e)?e:[e];try{for(var r=xc(e),n=r.next();!n.done;n=r.next()){var i=n.value;"number"==typeof i?this._removeByIndex(i):this._removeById(i)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(t)throw t.error}}this._updateSource()},Mc.prototype.removeById=function(e){var t,o,e=Array.isArray(e)?e:[e];try{for(var r=xc(e),n=r.next();!n.done;n=r.next()){var i=n.value;this._removeById(i)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(t)throw t.error}}this._updateSource()},Mc.prototype.setOptions=function(e){e=(new Ec).merge(this.options,wn(e));ma(this.options,e)||(this._invokeEvent("datasourceupdated",this),this.options=e,this.map&&this.map._rebuildStyle())},Mc.prototype.setShapes=function(e){this._clearNoUpdate(),this.add(e)},Mc.prototype.toJson=function(){return new Zs(this.shapes.map(function(e){return e.toJson()}))},Mc.prototype._toJson=function(){return new Zs(this.shapes.map(function(e){return e._toJson()}))},Mc.prototype._buildSource=function(){var e={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,clusterMinPoints:this.options.clusterMinPoints,generateId:this.options.generateId,promoteId:this.options.promoteId,filter:this.options.filter};return"number"==typeof this.options.clusterMaxZoom&&(e.clusterMaxZoom=this.options.clusterMaxZoom),e},Mc.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this._buildSource(),e=e._buildSource();return t.type===e.type&&t.maxzoom===e.maxzoom&&t.cluster===e.cluster&&t.clusterRadius===e.clusterRadius&&t.tolerance===e.tolerance&&t.lineMetrics===e.lineMetrics&&JSON.stringify(t.clusterProperties)===JSON.stringify(e.clusterProperties)&&t.buffer===e.buffer&&t.clusterMinPoints===e.clusterMinPoints&&t.generateId===e.generateId&&t.promoteId===e.promoteId&&t.filter===e.filter},Mc.prototype._addNoUpdate=function(e,t){var o;e instanceof Hs?(this._addToSources(e,t),o=[e]):Array.isArray(e)?(o=e.map(function(e){return e instanceof Hs?e:new Hs(e)}),this._addToSources(o,t)):"FeatureCollection"===e.type?(o=e.features.map(function(e){return new Hs(e)}),this._addToSources(o,t)):"GeometryCollection"===e.type?(o=e.geometries.map(function(e){return new Hs(e)}),this._addToSources(o,t)):(e=new Hs(e),this._addToSources(e,t),o=[e]),this._invokeEvent("dataadded",o)},Mc.prototype._clearNoUpdate=function(){var e=this.shapes;this.shapes=[],this.shapesMap=new J,e&&0<e.length&&this._invokeEvent("dataremoved",e)},Mc.prototype._updateSource=function(){var e=this;void 0!==this.requestId||(this.requestId=requestAnimationFrame(function(){e._updateMboxSource(),e.requestId=void 0}))},Mc.prototype._addToSources=function(e,t){var o,r,n,i;if(e=Array.isArray(e)?e:[e],"number"!=typeof t)try{for(var a=xc(e),s=a.next();!s.done;s=a.next()){var c=s.value;this.shapes.push(c),this.shapesMap.set(c.getId(),this.shapes.length-1)}}catch(e){o={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}else for(var u=e.length-1;0<=u;u--)this.shapes.splice(t,0,e[u]),this._updateShapesMap(t);try{for(var l=xc(e),h=l.next();!h.done;h=l.next())(c=h.value)._setDataSource(this)}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}},Mc.prototype._removeById=function(e){var t=e instanceof Hs?e.getId():"string"==typeof e||"number"==typeof e?e:e.id,e=this.shapes[this.shapesMap.get(t)];e&&(e._setDataSource(null),this.shapes.splice(this.shapesMap.get(t),1),this._updateShapesMap(this.shapesMap.get(t)),this.shapesMap.delete(t),this._invokeEvent("dataremoved",[e]))},Mc.prototype._removeByIndex=function(e){var t;if(e>=this.shapes.length)throw new Error("The specified remove index '".concat(e,"' ")+"is greater than the maximum possible index '".concat(this.shapes.length-1,"'"));t=this.shapes[e],this.shapesMap.delete(t.getId()),t._setDataSource(null),this.shapes.splice(e,1),this._updateShapesMap(e),this._invokeEvent("dataremoved",[t])},Mc.prototype._updateShapesMap=function(e){for(var t=e;t<this.shapes.length;t++)this.shapesMap.set(this.shapes[t].getId(),t)},Mc.prototype._updateMboxSource=function(){var e;this.map&&this.map._getMap()&&((e=this.map._getMap().getSource(this.getId()))&&"geojson"===e.type&&e.setData(this._toJson()))},Mc);function Mc(e,t){e=Pc.call(this,e)||this;return e.requestId=void 0,e.options=(new Ec).merge(wn(t)),e.shapes=[],e.shapesMap=new J,e}var Nc,Lc,Dc=((window&&window.__extends||(Nc=function(e,t){return(Nc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Nc(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(qc,Lc=k),qc);function qc(){var e=null!==Lc&&Lc.apply(this,arguments)||this;return e.bounds=void 0,e.minZoom=0,e.maxZoom=22,e.isTMS=!1,e.tiles=void 0,e.url=void 0,e}var jc,Uc,Hc=((window&&window.__extends||(jc=function(e,t){return(jc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}jc(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(zc,Uc=Ac),zc.prototype.getOptions=function(){return wn(this.options)},zc.prototype.getShape=function(e,t){return this.map._getMap().querySourceFeatures(this.getId(),{sourceLayer:e,filter:t})},zc.prototype._buildSource=function(){var e={type:"vector"};return this.options.bounds&&(e.bounds=this.options.bounds),this.options.tiles?(e.tiles=this.options.tiles,e.minzoom=this.options.minZoom,e.maxzoom=this.options.maxZoom):this.options.url&&(e.url=this.options.url),this.options.isTMS&&(e.scheme="tms"),e},zc.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this._buildSource(),o=e._buildSource();return t.type===o.type&&t.url===o.url&&(void 0===t.tiles&&void 0===o.tiles||t.tiles&&o.tiles&&t.tiles.length===o.tiles.length&&t.tiles.every(function(e,t){return e===o.tiles[t]}))&&t.minzoom===o.minzoom&&t.maxzoom===o.maxzoom&&t.bounds===o.bounds&&t.attribution===o.attribution&&t.promoteId===o.promoteId&&t.scheme===o.scheme},zc);function zc(e,t){e=Uc.call(this,e)||this;return e.options=(new Dc).merge(wn(t)),e}var Bc,Fc,Kc=((window&&window.__extends||(Bc=function(e,t){return(Bc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Bc(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Gc,Fc=Ac),Gc.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this.source,e=e.source;return t.type===e.type&&t.canvas===e.canvas&&JSON.stringify(t.coordinates)===JSON.stringify(e.coordinates)&&t.animate===e.animate},Gc.prototype._buildSource=function(){return this.source},Gc);function Gc(e,t,o){e=Fc.call(this,e)||this;return e.source=t,e}var Yc,Zc,Wc=((window&&window.__extends||(Yc=function(e,t){return(Yc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Yc(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Vc,Zc=Ac),Vc.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this.source,e=e.source;return t.type===e.type},Vc.prototype._buildSource=function(){return this.source},Vc);function Vc(e,t,o){e=Zc.call(this,e)||this;return e.source=t,e}var Jc,Qc,Xc=((window&&window.__extends||(Jc=function(e,t){return(Jc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Jc(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))($c,Qc=Ac),$c.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this.source,e=e.source;return t.type===e.type&&JSON.stringify(t.coordinates)===JSON.stringify(e.coordinates)&&t.url===e.url},$c.prototype._buildSource=function(){return this.source},$c);function $c(e,t,o){e=Qc.call(this,e)||this;return e.source=t,e}var eu,tu,ou=((window&&window.__extends||(eu=function(e,t){return(eu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}eu(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(ru,tu=Ac),ru.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this.source,e=e.source;return t.type===e.type&&JSON.stringify(t.coordinates)===JSON.stringify(e.coordinates)&&t.urls===e.urls},ru.prototype._buildSource=function(){return this.source},ru);function ru(e,t,o){e=tu.call(this,e)||this;return e.source=t,e}var nu,iu,ct=((window&&window.__extends||(nu=function(e,t){return(nu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}nu(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(au,iu=Dc),au);function au(){var e=null!==iu&&iu.apply(this,arguments)||this;return e.tileSize=512,e}var su,cu,uu=((window&&window.__extends||(su=function(e,t){return(su=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}su(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(lu,cu=ct),lu);function lu(){var e=null!==cu&&cu.apply(this,arguments)||this;return e.encoding=void 0,e}var hu,pu,ve=window&&window.__extends||(hu=function(e,t){return(hu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}hu(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),du=window&&window.__assign||function(){return(du=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},Ht=(ve(fu,pu=Ac),fu.prototype.getOptions=function(){return wn(this.options)},fu.prototype._buildSource=function(){return du({type:"raster-dem",bounds:this.options.bounds,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,tileSize:this.options.tileSize,encoding:this.options.encoding},this.options.tiles?{tiles:this.options.tiles}:{url:this.options.url})},fu.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;e=e.getOptions();return this.options.url===e.url&&this.options.tiles===e.tiles&&this.options.bounds===e.bounds&&this.options.minZoom===e.minZoom&&this.options.maxZoom===e.maxZoom&&this.options.tileSize===e.tileSize&&this.options.encoding===e.encoding},fu);function fu(e,t){e=pu.call(this,e)||this;return e.options=(new uu).merge(wn(t)),e}var gu,yu,tt=Object.freeze({__proto__:null,CanvasSource:Kc,DataSource:Rc,ElevationTileSource:Ht,ImageSource:Xc,Source:Ac,UnknownSource:Wc,VectorTileSource:Hc,VideoSource:ou}),mu=((window&&window.__extends||(gu=function(e,t){return(gu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}gu(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(vu,yu=Q),vu.prototype.getId=function(){return this.id},vu.prototype.getMap=function(){return this.map||null},vu.prototype.onAdd=function(e){this.map=e,this._invokeEvent("layeradded",this),this.map.events.invoke("layeradded",this)},vu.prototype.onRemove=function(){var e=this.map;delete this.map,this._invokeEvent("layerremoved",this),e&&e.events.invoke("layerremoved",this)},vu._isMBoxEvent=function(e){return!this.LayerEvents.hasOwnProperty(e)},vu.prototype._updateBaseProperties=function(e,t){this._updateFilter(e.filter,t.filter),this._updateZoomRange(e.minZoom,t.minZoom,e.maxZoom,t.maxZoom),this._updateLayoutProperty("visibility",e.visible,t.visible,e.visible?"visible":"none")},vu.prototype._updateFilter=function(e,t){ma(e,t)||this.map._getMap().setFilter(this.id,e)},vu.prototype._updatePaintProperty=function(e,t,o,r){ma(t,o)||this.map._getMap().setPaintProperty(this.id,e,r||t)},vu.prototype._updateLayoutProperty=function(e,t,o,r){ma(t,o)||this.map._getMap().setLayoutProperty(this.id,e,r||t)},vu.prototype._updateZoomRange=function(e,t,o,r){e===t&&r===o||this.map._getMap().setLayerZoomRange(this.id,e,o)},vu.LayerEvents={layeradded:void 0,layerremoved:void 0,focusin:void 0,focusout:void 0},vu);function vu(e){var t=yu.call(this)||this;return t.id=e||wa(),t}var _u,wu,Pt=((window&&window.__extends||(_u=function(e,t){return(_u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}_u(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(bu,wu=k),bu._cloneCustomizer=function(e){if(e instanceof Ac)return e},bu);function bu(){var e=null!==wu&&wu.apply(this,arguments)||this;return e.filter=void 0,e.minZoom=0,e.maxZoom=24,e.visible=!0,e}var Cu,Eu,Su=((window&&window.__extends||(Cu=function(e,t){return(Cu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Cu(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Tu,Eu=Pt),Tu);function Tu(){var e=null!==Eu&&Eu.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.color="#1A73AA",e.blur=0,e.opacity=1,e.strokeColor="#FFFFFF",e.strokeOpacity=1,e.strokeWidth=2,e.pitchAlignment="viewport",e.radius=8,e.createIndicators=!1,e.accessibilityIdKey=void 0,e}var Iu,Au,mt=window&&window.__extends||(Iu=function(e,t){return(Iu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Iu(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),ku=window&&window.__awaiter||function(e,a,s,c){return new(s=s||Promise)(function(o,t){function r(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?o(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(r,n)}i((c=c.apply(e,a||[])).next())})},Ou=window&&window.__generator||function(o,r){var n,i,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;c&&t[c=0]&&(s=0),s;)try{if(n=1,i&&(a=2&t[0]?i.return:t[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,t[1])).done)return a;switch(i=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,i=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=r.call(o,s)}catch(e){t=[6,e],i=0}finally{n=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},Pu=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},xu=window&&window.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},Ru=(mt(Mu,Au=mu),Mu.prototype.getOptions=function(){return vc(this.options,Su._cloneCustomizer)},Mu.prototype.getSource=function(){return this.options.source},Mu.prototype.setOptions=function(e){e=(new Su).merge(this.options,vc(e,Su._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);this._updateBaseProperties(e,this.options),this._updatePaintProperty("circle-blur",e.blur,this.options.blur),this._updatePaintProperty("circle-color",e.color,this.options.color),this._updatePaintProperty("circle-opacity",e.opacity,this.options.opacity),this._updatePaintProperty("circle-radius",e.radius,this.options.radius),this._updatePaintProperty("circle-stroke-color",e.strokeColor,this.options.strokeColor),this._updatePaintProperty("circle-stroke-opacity",e.strokeOpacity,this.options.strokeOpacity),this._updatePaintProperty("circle-stroke-width",e.strokeWidth,this.options.strokeWidth),this._updatePaintProperty("circle-pitch-alignment",e.pitchAlignment,this.options.pitchAlignment)}this.options=e},Mu.prototype.onAdd=function(t){var e,o,r=this;Au.prototype.onAdd.call(this,t),this.options.createIndicators&&(t.events.addOnce("idle",this._setAccessibleIndicator),t.events.add("moveend",this._setAccessibleIndicator),(e=this._getDataSource())?t.events.add("dataadded",e,function(){t.events.addOnce("idle",r._setAccessibleIndicator)}):(o="string"==typeof this.options.source?this.options.source:this.options.source.getId(),t.events.add("sourcedata",function(e){(null===(e=e.source)||void 0===e?void 0:e.getId())!==o||!t._getMap().isSourceLoaded(o)||(e=r._getSourceDataEventCacheKey())!==r.sourceDataEventCacheKey&&(r._setAccessibleIndicator(),r.sourceDataEventCacheKey=e)})))},Mu.prototype.onRemove=function(){var e;this.options.createIndicators&&(this.map.events.remove("idle",this._setAccessibleIndicator),this.map.events.remove("moveend",this._setAccessibleIndicator),(e=this._getDataSource())?this.map.events.remove("dataadded",e,this._setAccessibleIndicator):this.map.events.remove("sourcedata",this._setAccessibleIndicator)),Au.prototype.onRemove.call(this)},Mu.prototype._getSourceDataEventCacheKey=function(){if(this.map){var e=this.map.getServiceOptions().mapConfiguration;return xu(xu([],Pu(this.map.getCamera().bounds),!1),[this.map.getCamera().zoom,this.map.getCamera().pitch,this.map.getStyle().style,e instanceof Object?e.id:e],!1).join(",")}},Mu.prototype._getDataSource=function(){var e="string"==typeof this.options.source?this.map.sources.getById(this.options.source):this.options.source;if(e instanceof Rc)return e},Mu.prototype._buildLayers=function(){var e={id:this.id,type:"circle",source:this.options.source instanceof Ac?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&&(e.filter=this.options.filter),this.options.sourceLayer&&(e["source-layer"]=this.options.sourceLayer),[e]},Mu.prototype._getLayerIds=function(){return[this.id]},Mu.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof Ac?e.add(this.options.source.getId()):e.add(this.options.source),e},Mu.prototype.getFirstCoordinate=function(e){return Array.isArray(e[0])?this.getFirstCoordinate(e[0]):e},Mu);function Mu(e,t,o){var r=Au.call(this,t)||this;return r.accessibleIndicator=[],r._setAccessibleIndicator=function(){return ku(r,void 0,void 0,function(){var t,c,u,l,h,p,d=this;return Ou(this,function(e){return this.accessibleIndicator.forEach(function(e){return e.remove()}),this.accessibleIndicator=[],t=this.map.layers.getRenderedShapes(this.map.getCamera().bounds,this),c=this.options.accessibilityIdKey||(this._getDataSource()?Hs._shapeIdPropName:void 0),u=function(t,o){var r=t[o],n=r instanceof Hs?r.toJson():r,i=new _c({positionInSet:o+1,setSize:t.length}),a=i.getElement(),s=Pu(d.map.positionsToPixels([d.getFirstCoordinate(n.geometry.coordinates)]),1)[0];return a.addEventListener("focusin",function(e){d.accessibleIndicator.filter(function(e){return e!==i}).forEach(function(e){return e.remove()}),0<=o-1&&l(i,u(t,o-1)),o+1<t.length&&p(u(t,o+1)),2<=o&&o==t.length-1&&h(u(t,0)),0==o&&2<=t.length&&p(u(t,t.length-1)),void 0!==c&&d.map._getMap().setPaintProperty(d.id,"circle-stroke-color",["case",["==",["get",c],n.properties[c]],"#000000",d.options.strokeColor]);e={target:a,type:"focusin",map:d.map,shape:r,originalEvent:e,pixel:s};d._invokeEvent("focusin",e)}),a.addEventListener("focusout",function(e){void 0!==c&&d.map._getMap().setPaintProperty(d.id,"circle-stroke-color",["case",["==",["get",c],n.properties[c]],d.options.strokeColor,d.options.strokeColor]);e={target:a,type:"focusout",map:d.map,shape:r,originalEvent:e,pixel:s};d._invokeEvent("focusout",e)}),d.accessibleIndicator.push(i),i},l=function(e,t){t.attach(d.map);t=t.getElement(),e=e.getElement();e.parentElement.insertBefore(t,e)},h=function(e){e.attach(d.map);var t=e.getElement(),e=t.parentElement;e.insertBefore(t,e.firstElementChild)},p=function(e){e.attach(d.map)},0<t.length&&p(u(t,0)),1<t.length&&p(u(t,t.length-1)),[2]})})},r.options=(new Su).merge(vc(o,Su._cloneCustomizer)),r.options.source=e||r.options.source,r}var Nu,Lu,Du=((window&&window.__extends||(Nu=function(e,t){return(Nu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Nu(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(qu,Lu=Pt),qu._cloneCustomizer=function(e){if(e instanceof Ac)return e},qu);function qu(){var e=null!==Lu&&Lu.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.color=["interpolate",["linear"],["heatmap-density"],0,"rgba(0,0, 255,0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],e.intensity=1,e.opacity=1,e.radius=30,e.weight=1,e}var ju,Uu,Ge=((window&&window.__extends||(ju=function(e,t){return(ju=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}ju(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Hu,Uu=mu),Hu.prototype.getOptions=function(){return vc(this.options,Du._cloneCustomizer)},Hu.prototype.getSource=function(){return this.options.source},Hu.prototype.setOptions=function(e){e=(new Du).merge(this.options,vc(e,Du._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);this._updateBaseProperties(e,this.options),this._updatePaintProperty("heatmap-color",e.color,this.options.color),this._updatePaintProperty("heatmap-intensity",e.intensity,this.options.intensity),this._updatePaintProperty("heatmap-opacity",e.opacity,this.options.opacity),this._updatePaintProperty("heatmap-radius",e.radius,this.options.radius),this._updatePaintProperty("heatmap-weight",e.weight,this.options.weight)}this.options=e},Hu.prototype._buildLayers=function(){var e={id:this.id,type:"heatmap",source:this.options.source instanceof Ac?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&&(e.filter=this.options.filter),this.options.sourceLayer&&(e["source-layer"]=this.options.sourceLayer),[e]},Hu.prototype._getLayerIds=function(){return[this.id]},Hu.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof Ac?e.add(this.options.source.getId()):e.add(this.options.source),e},Hu);function Hu(e,t,o){t=Uu.call(this,t)||this;return t.options=(new Du).merge(vc(o,Du._cloneCustomizer)),t.options.source=e||t.options.source,t}var zu,Bu,ct=((window&&window.__extends||(zu=function(e,t){return(zu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}zu(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Fu,Bu=Pt),Fu);function Fu(){var e=null!==Bu&&Bu.apply(this,arguments)||this;return e.contrast=0,e.fadeDuration=300,e.hueRotation=0,e.maxBrightness=1,e.minBrightness=0,e.opacity=1,e.saturation=0,e}var Ku,Gu,Yu=((window&&window.__extends||(Ku=function(e,t){return(Ku=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Ku(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Zu,Gu=ct),Zu._cloneCustomizer=function(e){if(e instanceof Ac)return e},Zu);function Zu(){var e=null!==Gu&&Gu.apply(this,arguments)||this;return e.url=void 0,e.coordinates=void 0,e}var Wu,Vu,Ju=((window&&window.__extends||(Wu=function(e,t){return(Wu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Wu(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Qu,Vu=mu),Qu.prototype._getSourceIds=function(){var e=new Set;return e.add(this._getSourceId()),e},Qu.prototype.onAdd=function(e){Vu.prototype.onAdd.call(this,e)},Qu);function Qu(){return null!==Vu&&Vu.apply(this,arguments)||this}var Xu,$u,ve=((window&&window.__extends||(Xu=function(e,t){return(Xu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Xu(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(el,$u=Ju),el.prototype.getOptions=function(){return vc(this.options,Yu._cloneCustomizer)},el.prototype.setOptions=function(e){var t=(new Yu).merge(this.options,vc(e,Yu._cloneCustomizer)),o="string"==typeof e.url&&e.url!==this.getOptions().url,r=void 0!==e.coordinates&&e.coordinates!==this.getOptions().coordinates;this.map&&(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),(e=this.map._getMap().getSource(this._getSourceId()))&&e.updateImage(t)),this.options=t,o?this.reloadImage():r&&this.updateTransform()},el.prototype.getPositions=function(t){return this.transform.then(function(e){return e.toTarget(t)})},el.prototype.getPixels=function(t){return this.transform.then(function(e){return e.toSource(t)})},el.getCoordinatesFromRefPoints=function(e,t,o,r){return new cc(o,r).toTarget([[0,0],[e,0],[e,t],[0,t]])},el.getCoordinatesFromEdges=function(e,t,o,r,n){"number"!=typeof n&&(n=0);o=[Math.min(r,o),t,Math.max(r,o),e],e=Gs.getCenter(o);return ys([Gs.getNorthWest(o),Gs.getNorthEast(o),Gs.getSouthEast(o),Gs.getSouthWest(o)],e,n)},el.prototype._buildLayers=function(){var e={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&&(e.filter=this.options.filter),[e]},el.prototype._getLayerIds=function(){return[this.id]},el.prototype._buildSource=function(){return{type:"image",url:this.options.url,coordinates:this.options.coordinates}},el.prototype._getSourceId=function(){return"".concat(this.getId(),"-ImageSource")},el.prototype.reloadImage=function(){var o=this;this.options.url&&(this.transform=new Promise(function(t,e){o.img.onload=function(){var e=[[0,0],[o.img.width,0],[o.img.width,o.img.height],[0,o.img.height]];t(new cc(e,o.options.coordinates)),o.isLoading=!1},o.img.onerror=o.img.onabort=function(){e("Failed to load image")},o.isLoading=!0,o.img.src=o.options.url}))},el.prototype.updateTransform=function(){var e;this.isLoading||(e=[[0,0],[this.img.width,0],[this.img.width,this.img.height],[0,this.img.height]],this.transform=Promise.resolve(new cc(e,this.options.coordinates)))},el.prototype._getSourceWrapper=function(){var e=this._getSourceId(),t=this._buildSource();return new Xc(e,t)},el);function el(e,t){t=$u.call(this,t)||this;return t.isLoading=!1,t.options=(new Yu).merge(vc(e,Yu._cloneCustomizer)),t.img=new Image,t.reloadImage(),t}var tl,ol,rl=((window&&window.__extends||(tl=function(e,t){return(tl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}tl(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(nl,ol=Pt),nl);function nl(){var e=null!==ol&&ol.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.lineCap="round",e.lineJoin="round",e.blur=0,e.strokeColor="#1E90FF",e.strokeDashArray=void 0,e.strokeGradient=void 0,e.offset=0,e.strokeOpacity=1,e.translate=new Ta(0,0),e.translateAnchor="map",e.strokeWidth=2,e}var il,al,Ht=window&&window.__extends||(il=function(e,t){return(il=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}il(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),sl=window&&window.__assign||function(){return(sl=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},cl=(Ht(ul,al=mu),ul.prototype.getOptions=function(){return vc(this.options,rl._cloneCustomizer)},ul.prototype.getSource=function(){return this.options.source},ul.prototype.setOptions=function(e){e=(new rl).merge(this.options,vc(e,rl._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);this._updateBaseProperties(e,this.options),this._updatePaintProperty("line-blur",e.blur,this.options.blur),this._updateLayoutProperty("line-cap",e.lineCap,this.options.lineCap),this._updateLayoutProperty("line-join",e.lineJoin,this.options.lineJoin),this._updatePaintProperty("line-offset",e.offset,this.options.offset),this._updatePaintProperty("line-color",e.strokeColor,this.options.strokeColor),this._updatePaintProperty("line-dasharray",e.strokeDashArray,this.options.strokeDashArray),this._updatePaintProperty("line-gradient",e.strokeGradient,this.options.strokeGradient),this._updatePaintProperty("line-opacity",e.strokeOpacity,this.options.strokeOpacity),this._updatePaintProperty("line-width",e.strokeWidth,this.options.strokeWidth),this._updatePaintProperty("line-translate",e.translate,this.options.translate),this._updatePaintProperty("line-translate-anchor",e.translateAnchor,this.options.translateAnchor)}this.options=e},ul.prototype._buildLayers=function(){return[sl(sl(sl(sl({id:this.id,type:"line"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof Ac?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:sl(sl(sl({"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})]},ul.prototype._getLayerIds=function(){return[this.id]},ul.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof Ac?e.add(this.options.source.getId()):e.add(this.options.source),e},ul);function ul(e,t,o){t=al.call(this,t)||this;return t.options=(new rl).merge(vc(o,rl._cloneCustomizer)),t.options.source=e||t.options.source,t}var ll,hl,pl=((window&&window.__extends||(ll=function(e,t){return(ll=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}ll(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(dl,hl=Pt),dl);function dl(){var e=null!==hl&&hl.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.base=0,e.fillColor="#1E90FF",e.height=0,e.fillOpacity=1,e.fillPattern=void 0,e.translate=new Ta(0,0),e.translateAnchor="map",e.verticalGradient=!0,e}var fl,gl,mt=window&&window.__extends||(fl=function(e,t){return(fl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}fl(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),yl=window&&window.__assign||function(){return(yl=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},Ht=(mt(ml,gl=mu),ml.prototype.getOptions=function(){return vc(this.options,pl._cloneCustomizer)},ml.prototype.getSource=function(){return this.options.source},ml.prototype.setOptions=function(e){e=(new pl).merge(this.options,vc(e,pl._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);this._updateBaseProperties(e,this.options),this._updatePaintProperty("fill-extrusion-base",e.base,this.options.base),this._updatePaintProperty("fill-extrusion-color",e.fillColor,this.options.fillColor),this._updatePaintProperty("fill-extrusion-height",e.height,this.options.height),this._updatePaintProperty("fill-extrusion-opacity",e.fillOpacity,this.options.fillOpacity),this._updatePaintProperty("fill-extrusion-pattern",e.fillPattern,this.options.fillPattern),this._updatePaintProperty("fill-extrusion-translate",e.translate,this.options.translate),this._updatePaintProperty("fill-extrusion-translate-anchor",e.translateAnchor,this.options.translateAnchor),this._updatePaintProperty("fill-extrusion-vertical-gradient",e.verticalGradient,this.options.verticalGradient)}this.options=e},ml.prototype._buildLayers=function(){return[yl(yl(yl(yl({id:this.id,type:"fill-extrusion"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof Ac?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:yl(yl({"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})]},ml.prototype._getLayerIds=function(){return[this.id]},ml.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof Ac?e.add(this.options.source.getId()):e.add(this.options.source),e},ml);function ml(e,t,o){t=gl.call(this,t)||this;return t.options=(new pl).merge(vc(o,pl._cloneCustomizer)),t.options.source=e||t.options.source,t}var vl,_l,mt=window&&window.__extends||(vl=function(e,t){return(vl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}vl(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),wl=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},bl=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},Cl=window&&window.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},El=(mt(Sl,_l=Pt),Sl.prototype.merge=function(){for(var e,t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];var r=!1,n=!1;try{for(var i=wl(t),a=i.next();!a.done;a=i.next()){var s=a.value;s&&(s.hasOwnProperty("fillColor")?n=!(r=!0):s.hasOwnProperty("fillPattern")&&(r=!(n=!0)))}}catch(e){c={error:e}}finally{try{a&&!a.done&&(e=i.return)&&e.call(i)}finally{if(c)throw c.error}}var c=_l.prototype.merge.apply(this,Cl([],bl(t),!1));return r?c.fillPattern=void 0:n&&(c.fillColor=void 0),c},Sl);function Sl(){var e=null!==_l&&_l.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.fillColor="#1E90FF",e.fillOpacity=.5,e.fillPattern=void 0,e}var Tl,Il,Al=((window&&window.__extends||(Tl=function(e,t){return(Tl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Tl(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(kl,Il=mu),kl.prototype.getOptions=function(){return vc(this.options,El._cloneCustomizer)},kl.prototype.getSource=function(){return this.options.source},kl.prototype.setOptions=function(e){e=(new El).merge(this.options,vc(e,El._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);this._updateBaseProperties(e,this.options),this._updatePaintProperty("fill-color",e.fillColor,this.options.fillColor),this._updatePaintProperty("fill-opacity",e.fillOpacity,this.options.fillOpacity),this._updatePaintProperty("fill-pattern",e.fillPattern,this.options.fillPattern)}this.options=e},kl.prototype._buildLayers=function(){var e={id:this.id,type:"fill",source:this.options.source instanceof Ac?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&&(e.filter=this.options.filter),this.options.sourceLayer&&(e["source-layer"]=this.options.sourceLayer),this.options.fillPattern?e.paint["fill-pattern"]=this.options.fillPattern:e.paint["fill-color"]=this.options.fillColor,[e]},kl.prototype._getLayerIds=function(){return[this.id]},kl.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof Ac?e.add(this.options.source.getId()):e.add(this.options.source),e},kl);function kl(e,t,o){t=Il.call(this,t)||this;return t.options=(new El).merge(vc(o,El._cloneCustomizer)),t.options.source=e||t.options.source,t}var Ol,Pl,xl=((window&&window.__extends||(Ol=function(e,t){return(Ol=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Ol(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Rl,Pl=k),Rl);function Rl(){var e=null!==Pl&&Pl.apply(this,arguments)||this;return e.allowOverlap=!1,e.anchor="bottom",e.ignorePlacement=!1,e.image="marker-blue",e.offset=new Ta(0,0),e.optional=!1,e.padding=2,e.pitchAlignment="auto",e.rotation=0,e.rotationAlignment="auto",e.size=1,e.opacity=1,e}var Ml,Nl,Ll=((window&&window.__extends||(Ml=function(e,t){return(Ml=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Ml(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Dl,Nl=k),Dl);function Dl(){var e=null!==Nl&&Nl.apply(this,arguments)||this;return e.allowOverlap=!1,e.anchor="center",e.textField=void 0,e.font=["StandardFont-Regular"],e.ignorePlacement=!1,e.justify="center",e.offset=new Ta(0,0),e.optional=!1,e.padding=2,e.pitchAlignment="auto",e.radialOffset=void 0,e.rotation=0,e.rotationAlignment="auto",e.variableAnchor=void 0,e.size=16,e.color="#000000",e.haloBlur=0,e.haloColor="rgba(0,0,0,0)",e.haloWidth=0,e.opacity=1,e}var ql,jl,Ul=((window&&window.__extends||(ql=function(e,t){return(ql=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}ql(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Hl,jl=Pt),Hl);function Hl(){var e=null!==jl&&jl.apply(this,arguments)||this;return e.source=void 0,e.sourceLayer=void 0,e.iconOptions=new xl,e.textOptions=new Ll,e.placement="point",e.sortKey=void 0,e.zOrder="auto",e.lineSpacing=250,e}var zl,Bl,mt=window&&window.__extends||(zl=function(e,t){return(zl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}zl(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),Fl=window&&window.__assign||function(){return(Fl=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},Kl=(mt(Gl,Bl=mu),Gl.prototype.getOptions=function(){return vc(this.options,Ul._cloneCustomizer)},Gl.prototype.getSource=function(){return this.options.source},Gl.prototype.setOptions=function(e){var t=(new Ul).merge(this.options,vc(e,Ul._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);var o=this.options,r=t.iconOptions,n=o.iconOptions,i=t.textOptions,e=o.textOptions;this._updateBaseProperties(t,o),this._updateLayoutProperty("symbol-spacing",t.lineSpacing,o.lineSpacing),this._updateLayoutProperty("symbol-placement",t.placement,o.placement),this._updateLayoutProperty("symbol-sort-key",t.sortKey,o.sortKey),this._updateLayoutProperty("symbol-z-order",t.zOrder,o.zOrder),this._updateLayoutProperty("icon-allow-overlap",r.allowOverlap,n.allowOverlap),this._updateLayoutProperty("icon-anchor",r.anchor,n.anchor),this._updateLayoutProperty("icon-ignore-placement",r.ignorePlacement,n.ignorePlacement),this._updateLayoutProperty("icon-image",r.image,n.image),this._updateLayoutProperty("icon-offset",r.offset,n.offset),this._updatePaintProperty("icon-opacity",r.opacity,n.opacity),this._updateLayoutProperty("icon-optional",r.optional,n.optional),this._updateLayoutProperty("icon-padding",r.padding,n.padding),this._updateLayoutProperty("icon-pitch-alignment",r.pitchAlignment,n.pitchAlignment),this._updateLayoutProperty("icon-rotate",r.rotation,n.rotation),this._updateLayoutProperty("icon-rotation-alignment",r.rotationAlignment,n.rotationAlignment),this._updateLayoutProperty("icon-size",r.size,n.size),this._updateLayoutProperty("text-allow-overlap",i.allowOverlap,e.allowOverlap),this._updateLayoutProperty("text-anchor",i.anchor,e.anchor),this._updatePaintProperty("text-color",i.color,e.color),this._updateLayoutProperty("text-font",i.font,e.font),this._updateLayoutProperty("text-ignore-placement",i.ignorePlacement,e.ignorePlacement),this._updateLayoutProperty("text-justify",i.justify,e.justify),this._updatePaintProperty("text-halo-blur",i.haloBlur,e.haloBlur),this._updatePaintProperty("text-halo-color",i.haloColor,e.haloColor),this._updatePaintProperty("text-halo-width",i.haloWidth,e.haloWidth),this._updateLayoutProperty("text-offset",i.offset,e.offset),this._updatePaintProperty("text-opacity",i.opacity,e.opacity),this._updateLayoutProperty("text-optional",i.optional,e.optional),this._updateLayoutProperty("text-padding",i.padding,e.padding),this._updateLayoutProperty("text-pitch-alignment",i.pitchAlignment,e.pitchAlignment),this._updateLayoutProperty("text-radial-offset",i.radialOffset,e.radialOffset),this._updateLayoutProperty("text-rotate",i.rotation,e.rotation),this._updateLayoutProperty("text-rotation-alignment",i.rotationAlignment,e.rotationAlignment),this._updateLayoutProperty("text-size",i.size,e.size),this._updateLayoutProperty("text-variable-anchor",i.variableAnchor,e.variableAnchor),this._updateLayoutProperty("text-field",i.textField,e.textField)}this.options=t},Gl.prototype._buildLayers=function(){var e=Fl(Fl(Fl(Fl({id:this.id,type:"symbol"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof Ac?this.options.source.getId():this.options.source,layout:Fl(Fl({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&&(e.layout["symbol-sort-key"]=this.options.sortKey),void 0!==this.options.textOptions.radialOffset&&(e.layout["text-radial-offset"]=this.options.textOptions.radialOffset),void 0!==this.options.textOptions.variableAnchor&&(e.layout["text-variable-anchor"]=this.options.textOptions.variableAnchor),[e]},Gl.prototype._getLayerIds=function(){return[this.id]},Gl.prototype._getSourceIds=function(){var e=new Set;return this.options.source instanceof Ac?e.add(this.options.source.getId()):e.add(this.options.source),e},Gl);function Gl(e,t,o){t=Bl.call(this,t)||this;return t.options=(new Ul).merge(vc(o,Ul._cloneCustomizer)),t.options.source=e||t.options.source,t}var Yl,Zl,mt=window&&window.__extends||(Yl=function(e,t){return(Yl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Yl(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),Wl=window&&window.__assign||function(){return(Wl=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},Vl=(mt(Jl,Zl=Ac),Jl.prototype._buildSource=function(){return this.source},Jl.prototype._isDeepEqual=function(e){if(this.constructor!==e.constructor)return!1;var t=this.source,o=e.source,r=t.type===o.type&&t.url===o.url&&(void 0===t.tiles&&void 0===o.tiles||t.tiles&&o.tiles&&t.tiles.length===o.tiles.length&&t.tiles.every(function(e,t){return e===o.tiles[t]}))&&t.minzoom===o.minzoom&&t.maxzoom===o.maxzoom&&t.bounds===o.bounds&&t.attribution===o.attribution,n="raster"!==t.type||"raster"===t.type&&t.type===o.type&&t.tileSize===o.tileSize&&t.scheme===o.scheme,e="raster-dem"!==t.type||"raster-dem"===t.type&&t.type===o.type&&t.tileSize===o.tileSize&&t.encoding===o.encoding,t="vector"!==t.type||"vector"===t.type&&t.type===o.type&&t.promoteId===o.promoteId&&t.scheme===o.scheme;return r&&n&&e&&t},Jl.prototype._modifySource=function(e,t){if("raster"!==e.type&&"raster-dem"!==e.type&&"vector"!==e.type||!e.tiles){if("raster"!==e.type&&"raster-dem"!==e.type&&"vector"!==e.type||!e.url)throw new Error("Source definition must define a TileJSON 'url' or a 'tiles' array.");e.url="string"==typeof e.url?e.url:new D({domain:h,path:e.url.path,queryParams:Wl(Wl({},t),e.url.queryParams)}).toString()}else{var o=e.tiles.map(function(e){return"string"==typeof e?e:new D({domain:h,path:e.path,queryParams:Wl(Wl({},t),e.queryParams)}).toString()});e.tiles=o}return e},Jl);function Jl(e,t,o){e=Zl.call(this,e)||this;return e.source=e._modifySource(t,o),e}var Ql,Xl,$l=((window&&window.__extends||(Ql=function(e,t){return(Ql=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Ql(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(eh,Xl=ct),eh);function eh(){var e=null!==Xl&&Xl.apply(this,arguments)||this;return e.bounds=[-180,-85.0511,180,85.0511],e.minSourceZoom=0,e.maxSourceZoom=22,e.tileSize=512,e.isTMS=!1,e.subdomains=void 0,e.tileUrl=void 0,e}var th,oh,ct=window&&window.__extends||(th=function(e,t){return(th=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}th(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),rh=window&&window.__assign||function(){return(rh=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},nh=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ih=(ct(ah,oh=Ju),ah.prototype.getOptions=function(){return vc(this.options,$l._cloneCustomizer)},ah.prototype.setOptions=function(e){e=(new $l).merge(this.options,vc(e,$l._cloneCustomizer));if(this.map){if(!ma(e.bounds,this.options.bounds)||e.isTMS!==this.options.isTMS||e.maxSourceZoom!==this.options.maxSourceZoom||e.minSourceZoom!==this.options.minSourceZoom||!ma(e.subdomains,this.options.subdomains)||e.tileSize!==this.options.tileSize||e.tileUrl!==this.options.tileUrl)return this.options=e,void this.map.layers.add(this);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)}this.options=e},ah.prototype._setOptionsNoUpdate=function(e){this.options=(new $l).merge(this.options,vc(e,$l._cloneCustomizer))},ah.prototype._buildLayers=function(){return[rh(rh({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})]},ah.prototype._getLayerIds=function(){return[this.id]},ah.prototype._buildSource=function(){var e,t;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 r=nh(this.options.subdomains),n=r.next();!n.done;n=r.next()){var i=n.value;o.push(this.options.tileUrl.replace(/{subdomain}/g,i))}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}t=o}else t=[this.options.tileUrl]}return rh({type:"raster",bounds:this.options.bounds,maxzoom:this.options.maxSourceZoom,minzoom:this.options.minSourceZoom,scheme:this.options.isTMS?"tms":"xyz",tileSize:this.options.tileSize},t&&{tiles:t})},ah.prototype._getSourceId=function(){return"".concat(this.getId(),"-RasterSource")},ah.prototype._getSourceWrapper=function(){var e=this._getSourceId(),t=this._buildSource();return new Vl(e,{name:e,tiles:t.tiles,type:t.type,url:t.url})},ah);function ah(e,t){t=oh.call(this,t)||this;return e&&t.setOptions(e),t}var sh,ch,uh=((window&&window.__extends||(sh=function(e,t){return(sh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}sh(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(lh,ch=Pt),lh);function lh(){var e=null!==ch&&ch.apply(this,arguments)||this;return e.renderer=void 0,e}var hh,ph,dh=((window&&window.__extends||(hh=function(e,t){return(hh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}hh(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(fh,ph=mu),fh.prototype.getOptions=function(){return vc(this.options,uh._cloneCustomizer)},fh.prototype.setOptions=function(e){e=(new uh).merge(this.options,vc(e,uh._cloneCustomizer));this.map&&this.map.triggerRepaint(),this.options=e},fh.prototype.onAdd=function(e){var t,o;ph.prototype.onAdd.call(this,e),this.map.events.add("stylechanged",this._onStyleChange),this.options.renderer&&this.glContext&&null!==(o=(t=this.options.renderer).onAdd)&&void 0!==o&&o.call(t,e,this.glContext)},fh.prototype.onRemove=function(){var e,t;this.options.renderer&&this.glContext&&null!==(t=(e=this.options.renderer).onRemove)&&void 0!==t&&t.call(e,this.map,this.glContext),this.map.events.remove("stylechanged",this._onStyleChange),this.glContext=null,ph.prototype.onRemove.call(this)},fh.prototype._buildLayers=function(){var n=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(e,t){n.glContext=t},onRemove:function(e,t){},prerender:function(e,t){var o,r;n._shouldRender()&&null!==(r=(o=n.options.renderer).prerender)&&void 0!==r&&r.call(o,e,t)},render:function(e,t){n._shouldRender()&&n.options.renderer.render(e,t)}}]},fh.prototype._getLayerIds=function(){return[this.id]},fh.prototype._getSourceIds=function(){return(new Set).add(this.source.getId())},fh.prototype._shouldRender=function(){if(this.map){var e=this.map.getCamera().zoom;return this.options.visible&&this.options.minZoom<=e&&this.options.maxZoom>e}return!1},fh);function fh(e,t){var o=ph.call(this,e)||this;return o._onStyleChange=function(){var e,t;o.map._getMap().getLayer(o.id)||(e=o.map,t=null===(t=o.map.layers._getUserLayers().find(function(e){return e.layer.getId()==o.id}))||void 0===t?void 0:t.before,e.layers.remove(o),e.layers.add(o,t))},o.options=(new uh).merge(vc(t,uh._cloneCustomizer)),o.source=new Rc,o}var Ht=Object.freeze({__proto__:null,BubbleLayer:Ru,HeatMapLayer:Ge,ImageLayer:ve,Layer:mu,LineLayer:cl,PolygonExtrusionLayer:Ht,PolygonLayer:Al,SymbolLayer:Kl,TileLayer:ih,WebGLLayer:dh}),gh=(yh.convertHtmlString=function(e){if("string"!=typeof e)return e;var t=document.createElement("div");return t.innerHTML=e,t},yh.parseWithFilter=function(e,t,o,r){var n=this;if(void 0===t&&(t=function(e){return!0}),void 0===o&&(o=function(e){return e}),void 0===r&&(r=function(){return document.createElement("div")}),"string"==typeof e){var i=(new DOMParser).parseFromString(e,"text/html").body;if(0==i.children.length)return o(i.innerHTML);var a,i=1==i.children.length&&1==i.childNodes.length?i.children[0]:(a=r(),Array.from(i.childNodes).map(function(e){return a.append(e)}),a)}else i=e;return Array.from(i.children).forEach(function(e){return n.parseWithFilter(e,t,o)}),t(i)?o(i):(i.parentNode&&i.parentNode.removeChild(i),null)},yh);function yh(){}var mh=gt,vh=et;var _h,wh,bh=be(function(e){return mh(e)&&1===e.nodeType&&!vh(e)}),Ch=((window&&window.__extends||(_h=function(e,t){return(_h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}_h(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Eh,wh=k),Eh._cloneCustomizer=function(e){if(bh(e))return e},Eh);function Eh(){var e=null!==wh&&wh.apply(this,arguments)||this;return e.anchor="none",e.draggable=!1,e.closeButton=!0,e.content=document.createElement("span"),e.fillColor="#FFFFFF",e.pixelOffset=new Ta(0,0),e.position=new Ms(0,0),e.showPointer=!0,e}var Sh,Th,gt=window&&window.__extends||(Sh=function(e,t){return(Sh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Sh(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),Ih=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},Ah=(gt(kh,Th=Q),kh.prototype.setPopupOptions=function(e){this.setOptions(e)},kh.prototype.setOptions=function(e){var t=(new Ch).merge(this.options,vc(e,Ch._cloneCustomizer));t.content!==this.options.content?(this.htmlContent.remove(),this.htmlContent=this._createHtmlContent(t),this.contentDiv.prepend(this.htmlContent)):t.draggable!==this.options.draggable&&this._setDraggable(this.htmlContent,t.draggable),t.closeButton&&!this.closeBtn?(this.closeBtn=this._createCloseButton(),this.contentDiv.appendChild(this.closeBtn),e=z("close"),this.contentDiv.appendChild(e),B(e,this.closeBtn,!0)):!t.closeButton&&this.closeBtn&&(this.contentDiv.removeChild(this.closeBtn),delete this.closeBtn),t.showPointer&&!this.arrowDiv?(this.arrowDiv=this._createArrowDiv(),this.containerDiv.appendChild(this.arrowDiv)):!t.showPointer&&this.arrowDiv&&(this.containerDiv.removeChild(this.arrowDiv),delete this.arrowDiv),t.fillColor!==this.options.fillColor&&(this.containerDiv.style.borderColor=t.fillColor,this.contentDiv.style.backgroundColor=t.fillColor),this.marker&&(t.anchor!==this.options.anchor?"none"===this.options.anchor?(this.autoAnchor!==t.anchor&&this._replaceMarker(this.map,t),this.map.events.remove("move",this._onMove),delete this.autoAnchor):(this._replaceMarker(this.map,t),"none"===t.anchor&&this.map.events.add("move",this._onMove)):(ma(t.position,this.options.position)||this.marker.setLngLat(t.position),ma(t.pixelOffset,this.options.pixelOffset)||this.marker.setOffset(t.pixelOffset))),this.options=t},kh.prototype.getPopupOptions=function(){return this.getOptions()},kh.prototype.getOptions=function(){return vc(this.options,Ch._cloneCustomizer)},kh.prototype.getPopupContainer=function(){return this.containerDiv},kh.prototype._dragToPixel=function(e){this.dragging||(this.dragging=!0,this.contentDiv.style.pointerEvents="none",this._invokeEvent("dragstart",{type:"dragstart",target:this}));e=[e[0]+this.dragOffset[0],e[1]+this.dragOffset[1]],e=Ih(this.map.pixelsToPositions([e]),1)[0];this.options.position=e,this.marker.setLngLat(this.options.position),this._invokeEvent("drag",{type:"drag",target:this})},kh.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},kh.prototype._createContainerDiv=function(e){var t=this,o=document.createElement("div");o.classList.add(kh.Css.container),o.classList.add(kh.Css.hidden),o.style.borderColor=e.fillColor,o.setAttribute("role","dialog"),o.setAttribute("aria-label","Map Information Window");var r=!1;return o.addEventListener("keydown",function(e){"Tab"!==e.key&&"Escape"!==e.key&&"Esc"!==e.key||(r=!0)}),o.addEventListener("keyup",function(e){"Tab"!==e.key&&"Escape"!==e.key&&"Esc"!==e.key||(r=!1)}),o.addEventListener("focusin",function(e){t.map&&!t.isOpen()&&(t.open(t.map),e.target instanceof HTMLElement&&e.target.focus())}),o.addEventListener("focusout",function(e){r&&e.relatedTarget instanceof Node&&!o.contains(e.relatedTarget)&&(r=!1,t.isOpen()&&t.close())}),o},kh.prototype._createContentDiv=function(e){var t=document.createElement("div");return t.classList.add(kh.Css.content),t.style.backgroundColor=e.fillColor,t.setAttribute("tabindex","0"),this.htmlContent=this._createHtmlContent(e),t.appendChild(this.htmlContent),t},kh.prototype._createArrowDiv=function(){var e=document.createElement("div");return e.classList.add(kh.Css.arrow),e},kh.prototype._createCloseButton=function(){var e=document.createElement("button");return e.addEventListener("click",this.close),e.classList.add(kh.Css.close),e.setAttribute("aria-label","close"),e.setAttribute("tabindex","0"),e.innerHTML="×",e},kh.prototype._createHtmlContent=function(e){var t=gh.convertHtmlString(e.content);return e.draggable&&this._setDraggable(t,e.draggable),t},kh.prototype._createMarker=function(e,t){var o=this.marker?this.marker.getLngLat():e.position,o="none"===e.anchor?(this.autoAnchor=t||"bottom",this.containerDiv.classList.add(this.autoAnchor),new c.Marker({anchor:this.autoAnchor,element:this.containerDiv,offset:e.pixelOffset}).setLngLat(o)):(this.containerDiv.classList.add(e.anchor),new c.Marker({anchor:e.anchor,element:this.containerDiv,offset:e.pixelOffset}).setLngLat(o));return o},kh.prototype._getAutoAnchor=function(e,t){var o,r,n,i=this.containerDiv.offsetWidth,a=this.containerDiv.offsetHeight,s=[];return(n=this.marker?(r=(o=e._getMap().project(this.marker.getLngLat())).x,o.y):(r=(n=Ih(e.positionsToPixels([t.position]),1),(n=Ih(n[0],2))[0]),n[1]))<a?s.push("top"):n>e.getCanvas().offsetHeight-a&&s.push("bottom"),r<i/2?s.push("left"):r>e.getCanvas().offsetWidth-i/2&&s.push("right"),0<s.length?s.join("-"):"bottom"},kh.prototype._replaceMarker=function(e,t,o){var r=this.containerDiv.nextElementSibling;this.marker.remove(),this.containerDiv.classList.remove(this.autoAnchor||this.options.anchor),this.marker=this._createMarker(t,o),this.marker.addTo(e._getMap()),e.popups._getCollectionDiv().insertBefore(this.containerDiv,r||null)},kh.prototype._setDraggable=function(e,t){t?(e.addEventListener("mousedown",this._onDown),e.addEventListener("touchstart",this._onDown),e.addEventListener("dragstart",this._onDragStart)):(e.removeEventListener("mousedown",this._onDown),e.removeEventListener("touchstart",this._onDown),e.removeEventListener("dragstart",this._onDragStart))},kh.Css={arrow:"popup-arrow",close:"popup-close",container:"popup-container",content:"popup-content-container",hidden:"hidden-accessible-element"},kh);function kh(e){var o=Th.call(this)||this;return o.attach=function(e){o.map!==e&&(o.map&&o.remove(),o.map=e,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(e){if(!e&&!o.map)throw new Error("Must specify a map to open on or attach to a map in advance");o.attach(e||o.map),o.containerDiv.classList.remove(kh.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(kh.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(kh.Css.hidden)},o._onMove=function(){var e=o._getAutoAnchor(o.map,o.options);e!==o.autoAnchor&&(o._replaceMarker(o.map,o.options,e),o.map.events.add("move",o._onMove))},o._onDown=function(e){o.map.popups._addDraggedPopup(o);var t=Ih(o.map.positionsToPixels([o.options.position]),1)[0];"mousedown"===e.type?o.dragOffset=[t[0]-e.clientX,t[1]-e.clientY]:"touchstart"===e.type&&(o.dragOffset=[t[0]-e.touches[0].clientX,t[1]-e.touches[0].clientY])},o._onDragStart=function(e){e.preventDefault()},o.options=(new Ch).merge(vc(e,Ch._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),e=z("close"),o.contentDiv.appendChild(e),B(e,o.closeBtn,!0)),o}var Oh,Ph,xh=((window&&window.__extends||(Oh=function(e,t){return(Oh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Oh(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Rh,Ph=k),Rh._cloneCustomizer=function(e){if(e instanceof Ah||bh(e))return e},Rh);function Rh(){var e=null!==Ph&&Ph.apply(this,arguments)||this;return e.anchor="bottom",e.color="#1A73AA",e.draggable=!1,e.htmlContent='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24.5 36.5" id="marker_'.concat(wa(),'" 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>'),e.pixelOffset=new Ta(0,0),e.position=new Ms(0,0),e.popup=void 0,e.secondaryColor="white",e.text=void 0,e.visible=!0,e}var Mh,Nh,Lh=((window&&window.__extends||(Mh=function(e,t){return(Mh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Mh(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Dh,Nh=Q),Dh.prototype.getOptions=function(){return vc(this.options,xh._cloneCustomizer)},Dh.prototype.getElement=function(){return this.marker.getElement()},Dh.prototype.setOptions=function(e){e=(new xh).merge(this.options,vc(e,xh._cloneCustomizer));ma(e.htmlContent,this.options.htmlContent)&&e.anchor===this.options.anchor?("string"!=typeof e.htmlContent||e.color===this.options.color&&e.text===this.options.text&&e.secondaryColor===this.options.secondaryColor||(this.element.innerHTML=this._getSubbedHtmlString(e)||""),e.draggable!==this.options.draggable&&(this._setDraggable(e.draggable),this.marker.setDraggable(e.draggable)),ma(e.pixelOffset,this.options.pixelOffset)||this.marker.setOffset(e.pixelOffset),ma(e.position,this.options.position)||this.marker.setLngLat(e.position),e.visible!==this.options.visible&&(e.visible?this.element.classList.remove(Dh.hiddenClass):this.element.classList.add(Dh.hiddenClass))):(this.marker.remove(),this._buildMarker(e),this.map&&(this.marker.addTo(this.map._getMap()),this._getCollectionContainer().appendChild(this.element))),this.options=e},Dh.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)}},Dh.prototype._addToMap=function(e,t){this.map&&this.map!==e&&this._removeFromMap(),t&&(this.options.position=wn(t),this.marker.setLngLat(this.options.position)),this.map!==e&&(this.map=e,this.marker.addTo(e._getMap()),this._getCollectionContainer().appendChild(this.element))},Dh.prototype._removeFromMap=function(){this.map&&(this.marker.remove(),delete this.map)},Dh.prototype._getId=function(){if(this.element)return("string"==typeof this.options.htmlContent?this.element.firstChild:this.element).id},Dh.prototype._buildMarker=function(e){var t;"string"==typeof e.htmlContent?(t=this._getSubbedHtmlString(e)||"",this.element=gh.convertHtmlString(t)):this.element=e.htmlContent,this.element.classList.add(Dh.containerClass),e.draggable&&this._setDraggable(!0),e.visible||this.element.classList.add(Dh.hiddenClass),this.marker=new c.Marker({element:this.element,offset:e.pixelOffset,draggable:e.draggable,anchor:e.anchor}).setLngLat(e.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)},Dh.prototype._getSubbedHtmlString=function(e){return"string"==typeof e.htmlContent?e.htmlContent.replace(/{color}/gi,e.color||"").replace(/{secondaryColor}/gi,e.secondaryColor||"").replace(/{text}/gi,e.text||""):null},Dh.prototype._getCollectionContainer=function(){var e=this.map.getCanvasContainer().querySelector(".".concat(Dh.collectionContainerClass));return e||((e=document.createElement("div")).classList.add(Dh.collectionContainerClass),this.map.getCanvasContainer().appendChild(e)),e},Dh.prototype._setDraggable=function(e){e?this.element.addEventListener("dragstart",this._onEleDragStart):this.element.removeEventListener("dragstart",this._onEleDragStart)},Dh.collectionContainerClass="marker-collection-container",Dh.hiddenClass="hidden-accessible-element",Dh.containerClass="marker-container",Dh);function Dh(e){var t=Nh.call(this)||this;return t._onDrag=function(){var e=t.marker.getLngLat().wrap();t.options.position=new Ms(e.lng,e.lat),t._invokeEvent("drag",{type:"drag",target:t})},t._onDragStart=function(){t._invokeEvent("dragstart",{type:"dragstart",target:t})},t._onDragEnd=function(){t._invokeEvent("dragend",{type:"dragend",target:t})},t._bubbleElementEvent=function(e){t._invokeEvent(e.type,{type:e.type,target:t})},t._onEleDragStart=function(e){e.preventDefault()},t.options=(new xh).merge(vc(e,xh._cloneCustomizer)),t._buildMarker(t.options),t}var qh=(jh.parse=function(e){var t=(e=e.toLowerCase()).lastIndexOf("-");return-1!==t?{code:e,language:e.substring(0,t),region:e.substring(t+1)}:{code:e,language:e}},jh);function jh(){}var Uh={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"}}}},Hh=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"},zh=(Bh.getCode=function(e){var t=qh.parse(e);return-1===Uh.sensitiveUserRegions.indexOf(t.region)?this.getLocaleData(t).code:e},Bh.getStrings=function(e){e=this.getLocaleData(e);return Uh.locales.defaultLanguage.defaultRegion.code===e.code?new Promise(function(e){e(new Hh)}):new D({domain:t,path:"".concat(Uh.localizationsPath,"/").concat(e.strings)}).get().then(function(e){return e},function(){return new Hh})},Bh.getLocaleData=function(e){if("string"==typeof e&&(e=qh.parse(e)),Uh.locales[e.code])return Uh.locales[e.code].defaultRegion;var t;if(Uh.locales[e.language])t=Uh.locales[e.language];else{if(-1!==e.language.indexOf("-"))return this.getLocaleData(e.language);t=Uh.locales.defaultLanguage}return e.region&&t[e.region]?t[e.region]:t.defaultRegion},Bh);function Bh(){}var Fh=(Kh.getEdgeOrIEVersion=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(0<t)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(0<e.indexOf("Trident/")){var o=e.indexOf("rv:");return parseInt(e.substring(o+3,e.indexOf(".",o)),10)}o=e.indexOf("Edge/");return 0<o?parseInt(e.substring(o+5,e.indexOf(".",o)),10):-1},Kh.isEdgeOrIE=function(){return-1!==this.getEdgeOrIEVersion()},Kh.isIE=function(){var e=this.getEdgeOrIEVersion();return-1!==e&&e<=11},Kh);function Kh(){}var Gh,et=window&&window.__extends||(Gh=function(e,t){return(Gh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Gh(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),Yh=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},Zh=window&&window.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))};l.AuthenticationType=void 0,(gt=l.AuthenticationType||(l.AuthenticationType={})).subscriptionKey="subscriptionKey",gt.aad="aad",gt.anonymous="anonymous",gt.sas="sas";var Wh,Vh,Jh=(et(Qh,Wh=k),Qh.prototype.setSubscriptionKey=function(e){this.authType=l.AuthenticationType.subscriptionKey,this.subscriptionKey=e},Qh.prototype.setAadProperties=function(e,t,o,r,n){this.authType=l.AuthenticationType.aad,this.authContext=n||this.authContext,this.aadInstance=r||this.aadInstance,this.clientId=e,this.aadAppId=t,this.aadTenant=o},Qh.prototype.setTokenCallbackFunction=function(e){this.authType=l.AuthenticationType.anonymous,this.getToken=e},Qh.prototype.setSasCallbackFunction=function(e){this.authType=l.AuthenticationType.sas,this.getToken=e},Qh.prototype.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var o=Wh.prototype.merge.apply(this,Zh([],Yh(e),!1));return o.authType===l.AuthenticationType.subscriptionKey?o.authContext=o.aadAppId=o.getToken=void 0:o.authType===l.AuthenticationType.aad?o.subscriptionKey=o.getToken=void 0:o.authType===l.AuthenticationType.anonymous?o.subscriptionKey=o.authContext=o.aadAppId=void 0:o.authType===l.AuthenticationType.sas&&(o.authContext=o.subscriptionKey=o.aadAppId=void 0),o},Qh);function Qh(){var e=null!==Wh&&Wh.apply(this,arguments)||this;return e.authType=void 0,e.subscriptionKey=void 0,e.clientId=void 0,e.aadAppId=void 0,e.aadTenant=void 0,e.aadInstance=void 0,e.getToken=void 0,e.sasToken=void 0,e.authContext=void 0,e}var Xh="NGT",$h=wa(),ep=e,tp=t,op=o,rp=r,np=w,ip=new Jh,ap=!1,sp=!1,cp=!1,up=!1,lp=!1,hp=!1,pp=!1,dp=!1,fp=!1;function gp(){return Object.assign({},ip)}function yp(){return tp}function mp(){return ep}function vp(){return op}function _p(){return rp}function wp(){return np}function bp(){return c.workerCount}function Cp(){return c.maxParallelImageRequests}function Ep(){return Xh}function Sp(){return $h}function Tp(){return ip.authType===l.AuthenticationType.subscriptionKey?ip.subscriptionKey:void 0}function Ip(){return Vh}function Ap(e){ip=(new Jh).merge(ip,e),fp=!0}function kp(e){ep=e,sp=!0}function Op(e){op=e,cp=!0}function Pp(e){0<e&&(c.workerCount=e,lp=!0)}function xp(e){0<e&&(c.maxParallelImageRequests=e,hp=!0)}function Rp(e){Xh=zh.getCode(e),pp=!0}function Mp(e){$h=e,dp=!0}function Np(e){ip.setSubscriptionKey(e),fp=!0}function Lp(e){Vh=e,ap=!0}function Dp(e,t){if(t=Math.abs(t||1),"string"==typeof e&&Gp[e.toLowerCase()]){for(var o=Gp[e.toLowerCase()],r=/calc\(([0-9.]+)[px]*\s*\*\s*\{scale\}\)/gi,n=o,i=r.exec(o);i;)n=n.replace(i[0],parseFloat(i[1])*t+""),i=r.exec(o);return n=n.replace("{scale}",t+"")}throw new Error("Invalid templateName.")}function qp(){return fp}function jp(){return sp}function Up(){return cp}function Hp(){return lp}function zp(){return hp}function Bp(){return pp}function Fp(){return dp}function Kp(){return ap}var Gp={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>'},Yp=(Zp.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},Zp);function Zp(){}var Wp,Vp,Jp=((window&&window.__extends||(Wp=function(e,t){return(Wp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Wp(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Qp,Vp=k),Qp);function Qp(){var e=null!==Vp&&Vp.apply(this,arguments)||this;return e.copyrightMessage=void 0,e.copyrightContent=void 0,e.customAttribution=void 0,e.showFeedbackLink=!0,e.showLogo=!0,e}var Xp,$p,ed=((window&&window.__extends||(Xp=function(e,t){return(Xp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Xp(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(td,$p=oe),td.prototype.onAdd=function(e){return this.container=this.buildContainer(e,l.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},td.prototype.onRemove=function(){$p.prototype.onRemove.call(this),delete this.container},td.prototype.setOptions=function(e){var t=this,o=(new Jp).merge(this.options,e);o.copyrightMessage===this.options.copyrightMessage&&o.customAttribution===this.options.customAttribution||(this.copyrightDiv.innerText=this.textAttribution(o)),o.copyrightContent!==this.options.copyrightContent&&(this.options.copyrightContent&&(e=Array.from(this.copyrightDiv.children).find(function(e){return e===t.options.copyrightContent}),this.copyrightDiv.removeChild(e)),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},td.prototype.getDefaultAttributions=function(){var e=(new Date).getFullYear(),t=["©".concat(e," TomTom")];return this.options.showLogo||t.push("©".concat(e," Microsoft")),t},td.prototype.buildCopyrightDiv=function(){var e=document.createElement("div");return e.innerText=this.textAttribution(this.options)||"",e},td.prototype.buildFeedbackLink=function(){var e=document.createElement("a");return e.setAttribute("alt","Give Feedback"),e.setAttribute("aria-label","Give Feedback"),e.href="https://feedback.azuremaps.com",e.target="_blank",e.rel="noopener",e.className="azure-map-feedback",e},td.prototype.addRemoveFeedbackDiv=function(e){e?(this.feedbackAnchor=this.buildFeedbackLink(),this.tooltip=z("Give Feedback"),this.container.appendChild(this.feedbackAnchor),this.container.appendChild(this.tooltip),B(this.tooltip,this.feedbackAnchor)):(this.feedbackAnchor.remove(),this.tooltip.remove(),delete this.tooltip,delete this.feedbackAnchor)},td.prototype.addRemoveLogo=function(e){e?(this.logoAnchor=document.createElement("a"),this.logoAnchor.className="azure-map-logo",this.logoAnchor.href="https://aka.ms/azuremaps",this.logoAnchor.setAttribute("aria-label","Visit azure.microsoft.com"),this.logoAnchor.setAttribute("target","_blank"),this.container.appendChild(this.logoAnchor),this.logoTooltip=z("Visit azure.microsoft.com"),this.container.appendChild(this.logoTooltip),B(this.logoTooltip,this.logoAnchor)):(this.logoAnchor.remove(),this.logoTooltip.remove(),delete this.logoAnchor)},td);function td(e){var t=$p.call(this)||this;return t.textAttribution=function(e){return[t.options.copyrightMessage,t.options.customAttribution].filter(function(e){return e}).join("")},t.options=(new Jp).merge(e),t}var od=(rd.throwOnError=function(e,t){function o(e){throw r.off("error",o),e.error}var r=e instanceof yE?e._getMap():e;r.on("error",o);t=t();return r.off("error",o),t},rd.tryCatch=function(e,t,o,r){try{return this.throwOnError(e,t)}catch(e){return o(e)}finally{"function"==typeof r&&r()}},rd.tryFinally=function(e,t,o){try{return this.throwOnError(e,t)}finally{o()}},rd);function rd(){}var nd=window&&window.__assign||function(){return(nd=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},id=(ad.prototype.request=function(e){var t={domain:this.map.getServiceOptions().domain,path:"search/address/reverse/json",queryParams:nd({"api-version":"1.0",language:e.style.language,limit:1,query:"".concat(fs(e.position[1]),",").concat(gs(e.position[0]))},e.style.view&&{view:e.style.view})};return new D((null===(e=this.map.authentication)||void 0===e?void 0:e.signRequest(t))||t).get()},ad);function ad(e){this.map=e}var sd=(cd.prototype.cache=function(e,t,o,r){r="".concat(e,"_").concat(o[0],"_").concat(o[1],"_").concat(r);this._labelIdx[t.labelType]||(this._labelIdx[t.labelType]=[],this._labelCache[t.labelType]=[]),-1===this._labelIdx[t.labelType].indexOf(r)&&(this._labelCache[t.labelType].push({name:e,radius:t.radius,minZoom:t.minZoom,maxZoom:t.maxZoom||24,position:o}),this._labelIdx[t.labelType].push(r))},cd.prototype.getNearestLabel=function(e,t,o){var r=null,n=this._labelCache[e];if(n)for(var i,a=1/0,s=0,c=n.length;s<c;s++)o>=n[s].minZoom&&o<=n[s].maxZoom&&((i=rs(n[s].position,t))<=n[s].radius&&i<=a&&(a=i,r=n[s]));return r},cd.prototype._preloadCache=function(e){if(!this._preloadedCache.has(e)){this._preloadedCache.add(e);var t={source:[],labelType:"water",minZoom:0,radius:395e4,polygonSources:[]},o=e,r=o.indexOf("-");switch(o=-1!==r?o.substr(0,r):o){case"fr":this.cache("Océan Pacifique",t,[-170,32],e),this.cache("Océan Pacifique",t,[-138,-27],e),this.cache("Océan Atlantique",t,[-40,32],e),this.cache("Océan Atlantique",t,[-17,-29],e);break;case"es":this.cache("Océan Pacifique",t,[-170,32],e),this.cache("Océan Pacifique",t,[-138,-27],e),this.cache("Océano Atlántico",t,[-40,32],e),this.cache("Océano Atlántico",t,[-17,-29],e);break;case"pt":this.cache("Oceano Pacífico",t,[-170,32],e),this.cache("Oceano Pacífico",t,[-138,-27],e),this.cache("Oceano Atlântico",t,[-40,32],e),this.cache("Oceano Atlântico",t,[-17,-29],e);break;case"ja":this.cache("太平洋",t,[-170,32],e),this.cache("太平洋",t,[-138,-27],e);break;case"en":this.cache("Pacific Ocean",t,[-170,32],e),this.cache("Pacific Ocean",t,[-138,-27],e),this.cache("Atlantic Ocean",t,[-40,32],e),this.cache("Atlantic Ocean",t,[-17,-29],e),this.cache("Indian Ocean",t,[77,-26],e)}}},cd);function cd(){this._labelCache={},this._labelIdx={},this._preloadedCache=new Set}var ud=window&&window.__awaiter||function(e,a,s,c){return new(s=s||Promise)(function(o,t){function r(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?o(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(r,n)}i((c=c.apply(e,a||[])).next())})},ld=window&&window.__generator||function(o,r){var n,i,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;c&&t[c=0]&&(s=0),s;)try{if(n=1,i&&(a=2&t[0]?i.return:t[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,t[1])).done)return a;switch(i=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,i=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=r.call(o,s)}catch(e){t=[6,e],i=0}finally{n=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},hd=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},pd=window&&window.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},dd=(fd.prototype.dispose=function(){this._disposed=!0;var e=this._map._getMap();e.off("move",this._onMove),e.off("moveend",this._onMoveEnd),e.off("styledata",this._onStyleData),e.off("rotate",this._onRotate);e=this._map.getCanvas();e.removeEventListener("mousedown",this._onPointerDown),e.removeEventListener("touchstart",this._onPointerDown),this._map.getMapContainer().removeEventListener("keydown",this._shortcutListener)},fd.prototype._getEventPos=function(e){if("touches"in e){var t=e.touches[0],o=e.target.getBoundingClientRect();return[t.pageX-o.left,t.pageY-o.top]}return[e.offsetX,e.offsetY]},fd.prototype._checkThresholds=function(e,t){return this._checkZoomThreshold(e.zoom,t.zoom)||this._checkPitchThreshold(e.pitch,t.pitch)||this._checkLocThreshold(e.center,t.center)||this._checkHeadingThreshold(e.bearing,t.bearing)},fd.prototype._checkZoomThreshold=function(e,t){return this._round(e)!==this._round(t)},fd.prototype._checkPitchThreshold=function(e,t){return Math.abs(e-t)>=this._pitchThreshold},fd.prototype._checkLocThreshold=function(e,t){e=(t=hd(this._map.positionsToPixels([t,e]),2))[0],t=t[1];return Ta.getDistance(e,t)>=this._moveThreshold},fd.prototype._checkHeadingThreshold=function(e,t){e<0&&(e+=360),t<0&&(t+=360);t=Math.abs(e-t);return(t=180<t?360-t:t)>=this._headingThreshold},fd.prototype._getLocDesc=function(h,p,d){return ud(this,void 0,void 0,function(){var t,o,r,n,i,a,s,c,u,l=this;return ld(this,function(e){switch(e.label){case 0:return"blank"===d?[3,3]:this._map._getMap().loaded()?[3,2]:[4,new Promise(function(e){return l._map._getMap().once("idle",e)})];case 1:e.sent(),e.label=2;case 2:for(t={},o=this._map.positionsToPixels([h.center])[0],od.tryCatch(this._map,function(){var t=l._map._getMap();r=t.queryRenderedFeatures(o,{layers:l._polygonStyleLayer.filter(function(e){return t.getLayer(e)}),filter:["==",["geometry-type"],"Polygon"]})},function(){}),n=null,r&&0<r.length&&(n=r[0]),i=null,a=0,s=this._labelConfig.length;a<s;a++)c=this._labelConfig[a],h.zoom>=c.minZoom?c.polygonSources?n&&-1!==c.polygonSources.indexOf(n.layer["source-layer"])?(i=c.labelType,this._getClosestLabel(c,h,p,t,!1)):this._getClosestLabel(c,h,p,t,!0):this._getClosestLabel(c,h,p,t,!1):this._getClosestLabel(c,h,p,t,!0);return 8<=h.zoom&&this._processRoads(t,h,p),this._labelCache.forEach(function(e){t[e]||(u=null,(u="water"!==e&&"majorPoi"!==e||e===i?fd._labelCache.getNearestLabel(e,h.center,h.zoom):u)&&(t[e]=u.name))}),[2,this._processLocInfo(h,i,t,!0,this._restFallback)];case 3:return[2,this._processLocInfo(h,null,null,!1,!1)]}})})},fd.prototype._getHeadingDesc=function(e){var t=e.bearing;switch(t<0&&(t+=360),t=this._round(t,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"".concat(t," degrees")}},fd.prototype._getClosestLabel=function(e,t,o,r,n){for(var i=e.radius,a=0,s=e.source.length;a<s;a++){var c={sourceLayer:e.source[a],filter:["has","name"]},u=this._map._getMap().querySourceFeatures(this._baseVectorTileSourceId,c),l=null,h=1/0,p=this._labelCache.has(e.labelType);if(!n||p)for(var d=0,f=u.length;d<f;d++){var g,y="Point"===u[d].geometry.type?u[d]:Ps(t.center,u[d].geometry);n||(g="Point"===u[d].geometry.type?rs(t.center,y.geometry.coordinates):y.properties.distance)<h&&(h=g,l=u[d]),p&&fd._labelCache.cache(u[d].properties.name,e,y.geometry.coordinates,o)}n||(c=e.labelType+"Dis",l&&h<=i&&("number"!=typeof r[c]||h<=r[c])&&(r[e.labelType]=l.properties.name,r[c]=h))}},fd.prototype._processRoads=function(e,t,o,r){var n=this._map._getMap().queryRenderedFeatures(r,{filter:["==",["geometry-type"],"LineString"]});if(n){for(var i,a=void 0,s=void 0,c=void 0,u=void 0,l=0,h=n.length;l<h;l++)this._roadLayers.has(n[l].layer["source-layer"])&&n[l].properties.name&&""!==n[l].properties.name&&(i=Ps(t.center,n[l]),(!c||i.properties.distance<c.properties.distance)&&(a&&n[l].properties.name===a.properties.name?c=i:a&&n[l].properties.name===a.properties.name?(!u||i.properties.distance<u.properties.distance)&&(u=i,s=n[l]):(u=c,s=a,c=i,a=n[l])));a&&(!e.country&&a.properties.country_code&&(e.country=a.properties.country_code,e.countryDis=0,fd._labelCache.cache(e.country,{source:[],labelType:"country",radius:5e3,minZoom:0},c.geometry.coordinates,o)),!e.state&&a.properties.country_subdivision&&(e.state=a.properties.country_subdivision,e.stateDis=0,fd._labelCache.cache(e.state,{source:[],labelType:"state",radius:5e3,minZoom:4},c.geometry.coordinates,o)),15<=t.zoom&&(r=this._map.positionsToPixels([t.center,c.geometry.coordinates]),(Ta.getDistance(r[0],r[1])<this._roadPixelRadius||c.properties.distance<this._minRoadDistance)&&(e.road=a.properties.name),s&&(o=this._map.positionsToPixels([u.geometry.coordinates]),(Ta.getDistance(r[0],o[0])<this._minIntersectionPixelDistance||u.properties.distance<this._minRoadDistance)&&(e.secondRoad=s.properties.name,e.secondRoadDis=u.properties.distance))))}},fd.prototype._getActionDesc=function(e){if(this._lastCam){var t,o,r=[];return this._checkLocThreshold(e.center,this._lastCam.center)&&(o=["panned"],0===(t=Math.round(cs(this._lastCam.center,e.center)))||360===t?o.push("north"):t<90?o.push("north east"):90===t?o.push("east"):t<180?o.push("south east"):180===t?o.push("south"):t<270?o.push("south west"):270===t?o.push("west"):t<360&&o.push("north west"),t=rs(this._lastCam.center,e.center,Pa.meters),o.push(1e3<t?"".concat(es(t/1e3,2)," kilometers"):"".concat(es(t,2)," meters")),r.push(o.join(" "))),this._checkZoomThreshold(e.zoom,this._lastCam.zoom)&&((o=["zoomed"]).push(this._lastCam.zoom<e.zoom?"in":"out"),1<=(t=Math.abs(this._lastCam.zoom-e.zoom))&&(t=Math.ceil(t),o.push("".concat(t,1<t?" levels":" level"))),this._getCanonicalZoom(this._lastCam.zoom)!==this._getCanonicalZoom(e.zoom)&&o.push("to ".concat(this._getCanonicalZoom(e.zoom)," level")),e.zoom>=e.maxZoom&&o.push("Zoom In button disabled, maximum zoom level reached"),t=Gs.getSouth(e.bounds)<=-Ha&&Gs.getNorth(e.bounds)>=Ha,(e.zoom<=e.minZoom||t)&&o.push("Zoom Out button disabled, minimum zoom level reached"),r.push(o.join(" "))),this._checkPitchThreshold(e.pitch,this._lastCam.pitch)&&(o=this._round(e.pitch,this._pitchThreshold),r.push("pitched to ".concat(o," degrees")),60!==e.pitch&&0!==e.pitch||(o=60===e.pitch?"maximum":"minimum",r.push("reached ".concat(o," of ").concat(e.pitch," degrees")))),this._checkHeadingThreshold(this._lastCam.bearing,e.bearing)&&r.push("rotated to ".concat(this._getHeadingDesc(e))),r.join(" and ")||null}return null},fd.prototype._getCanonicalZoom=function(e){return(e=this._round(e))<2?"world":e<5?"country":e<11?"state province":e<15?"city":"street"},fd.prototype._processLocInfo=function(n,i,a,s,c){var u=this;return new Promise(function(t,e){var o=[];if(s){var r=[];if(a&&(i&&("water"===i&&a.water?r.push(a.water):"majorPoi"===i&&a.majorPoi&&r.push(a.majorPoi)),0===r.length&&(a.majorPoi&&8<=n.zoom?r.push(a.majorPoi):(a.poi&&14<=n.zoom?r.push(a.poi):a.road&&15<=n.zoom&&(a.secondRoad?r.push(a.road+" & "+a.secondRoad):r.push(a.road)),a.neighbourhood&&12<=n.zoom&&r.push(a.neighbourhood),a.city&&6<=n.zoom&&r.push(a.city)),a.state&&4<=n.zoom&&r.push(a.state),0===r.length?a.water?r.push(a.water):a.country&&r.push(a.country):1===r.length&&a.state&&4<=n.zoom&&a.country&&r.push(a.country))),0<r.length)o.push("<p>Location: ",r.join(", "),".</p>");else if(c&&"water"!==i)return void u._reverseGeocodeDescription(n).then(function(e){t(e)},function(){e("<p>Location: unknown</p>")})}u._returnDetailedDescriptions&&(o.push("<p>Zoom: ",es(n.zoom,2),".</p>"),o.push("<p>Latitude: ",es(n.center[1],5),".</p>"),o.push("<p>Longitude: ",es(n.center[0],5),".</p>")),t(o.join(""))})},fd.prototype._reverseGeocodeDescription=function(n){var i=this;return new Promise(function(o){var r=i._map.getStyle();i._reverseSearch.request({position:n.center,style:r}).then(function(e){var t={};e&&e.addresses&&0<e.addresses.length&&e.addresses[0].address&&((e=e.addresses[0].address).country&&(t.country=e.country,fd._labelCache.cache(t.country,{source:[],labelType:"country",radius:5e3,minZoom:0},n.center,r.language)),e.countrySubdivision&&(t.state=e.countrySubdivision,fd._labelCache.cache(t.state,{source:[],labelType:"state",radius:5e3,minZoom:4},n.center,r.language)),e.municipality&&(t.city=e.municipality,fd._labelCache.cache(t.state,{source:[],labelType:"city",radius:1e3,minZoom:10},n.center,r.language)),e.streetNameAndNumber?t.road=e.streetNameAndNumber:e.street&&(t.road=e.street)),i._processLocInfo(n,null,t,!0,!1).then(function(e){o(e)})},function(e){i._processLocInfo(n,null,null,!0,!1).then(function(e){o(e)})}).catch(function(e){i._processLocInfo(n,null,null,!0,!1).then(function(e){o(e)})})})},fd.prototype._round=function(e,t){return void 0===t&&(t=1),Math.round(e/t)*t},fd._baseVectorTileSourceIds=["microsoft.base","vectorTiles","bing-mvt"],fd._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"]}],fd._roadLayersBing=new Set(["road"]),fd);function fd(e,t){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(n){return ud(i,void 0,void 0,function(){var t,o,r;return ld(this,function(e){switch(e.label){case 0:return n.altKey&&n.ctrlKey&&68===n.keyCode?(this._returnDetailedDescriptions=!this._returnDetailedDescriptions,t=this._map.getCamera(),r=this._map.getStyle(),o=r.language.toLowerCase(),r=r.style.toLowerCase(),[4,this._getLocDesc(t,o,r)]):[3,2];case 1:r=e.sent(),this._descCallback(r),e.label=2;case 2:return[2]}})})},this._onRotate=function(){i._rotateTimeout||(Date.now()-i._lastHeadingTime>=i._headUpdateLimit?i._rotateTimeout=setTimeout(i._updateHeading,le.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(e){e.fromControl?i._controlTimeout=setTimeout(i._updateCam,i._controlEventDelay):i._updateCam()},this._onStyleData=function(){setTimeout(i._updateStyle)},this._onPointerDown=function(e){i._lastPointerPos=i._getEventPos(e),i._pointerTimeout=setTimeout(function(){return ud(i,void 0,void 0,function(){var t,o,r;return ld(this,function(e){switch(e.label){case 0:return o=this._map.getStyle(),t=o.language.toLowerCase(),r=o.style.toLowerCase(),(o=this._map.getCamera()).center=this._map.pixelsToPositions([this._lastPointerPos])[0],[4,this._getLocDesc(o,t,r)];case 1:return r=e.sent(),this._descCallback(r),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(e){var t=i._getEventPos(e),e=i._lastPointerPos[0]-t[0],t=i._lastPointerPos[1]-t[1];Math.sqrt(e*e+t*t)>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 e,t=i._map.getCamera();i._lastHead&&!i._checkHeadingThreshold(t.bearing,i._lastHead)||(e=i._getHeadingDesc(t),i._lastHead=t.bearing,i._descCallback("<p>Map heading ".concat(e,".</p>")),i._lastHeadingTime=Date.now()),delete i._rotateTimeout},this._updateStyle=function(){return ud(i,void 0,void 0,function(){var t,o,r,n;return ld(this,function(e){switch(e.label){case 0:return(t=this._map.getCamera(),r=this._map.getStyle(),o=r.language.toLowerCase(),r=r.style.toLowerCase(),this._lastLang===o)?[3,2]:(fd._labelCache._preloadCache(o),[4,this._getLocDesc(t,o,r)]);case 1:return n=e.sent(),[3,4];case 2:return this._lastStyle===r||"blank"!==this._lastStyle?[3,4]:[4,this._getLocDesc(t,o,r)];case 3:n=e.sent(),e.label=4;case 4:return this._lastLang=o,this._lastStyle=r,n&&this._descCallback(n),[2]}})})},this._updateCam=function(e){void 0===e&&(e=!1);var o,r,t,n=i._map.getCamera();(!i._lastCam||0<i._actionQueue.length||i._checkThresholds(n,i._lastCam))&&(t=i._map.getStyle(),o=t.language.toLowerCase(),r=t.style.toLowerCase(),(t=i._getActionDesc(n))&&i._actionQueue.push(t),i._lastCam=n,i._moveTimeout&&(clearTimeout(i._moveTimeout),delete i._moveTimeout),i._moveTimeout=setTimeout(function(){return ud(i,void 0,void 0,function(){var t;return ld(this,function(e){switch(e.label){case 0:return clearTimeout(this._rotateTimeout),delete this._rotateTimeout,[4,this._getLocDesc(n,o,r)];case 1:return t=e.sent(),0<this._actionQueue.length?(this._descCallback("<p>Map ".concat(this._actionQueue.join(", then "),".</p>").concat(t)),this._actionQueue=[]):this._descCallback(t),[2]}})})},e?0:i._camUpdateDelay))},this._map=e,this._restFallback=e.getServiceOptions().enableAccessibilityLocationFallback,this._descCallback=t,this._reverseSearch=new id(e),fd._labelCache||(fd._labelCache=new sd),this._lastLang=this._map.getStyle().language.toLowerCase(),fd._labelCache._preloadCache(this._lastLang),this._map.events.addOnce("idle",function(){var e;i._disposed||(i._updateCam(!0),i._baseVectorTileSourceId=fd._baseVectorTileSourceIds.find(function(e){return i._map.sources.getById(e)}),"bing-mvt"===i._baseVectorTileSourceId&&(i._labelConfig=fd._labelConfigBing,i._roadLayers=fd._roadLayersBing),i._polygonStyleLayer=i._labelConfig.reduce(function(e,t){return t.polygonSources&&e.push.apply(e,pd([],hd(t.polygonSources),!1)),e},[]),(e=i._map._getMap()).on("move",i._onMove),e.on("moveend",i._onMoveEnd),e.on("styledata",i._onStyleData),e.on("rotate",i._onRotate),(e=i._map.getCanvas()).addEventListener("mousedown",i._onPointerDown),e.addEventListener("touchstart",i._onPointerDown))}),this._map.getMapContainer().addEventListener("keydown",this._shortcutListener)}var gd,yd,md,vd=function(e){var o=this;this.addToMap=function(){null==o.mapViewDesc&&(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 e=[189,187,38,37,39,40],t=o.map._getMap()._canvas;null!=t&&t.addEventListener("keyup",function(t){e.find(function(e){return t.keyCode===e})&&(o.atlasMapKeyBindings.innerHTML="")})},this.initializeMapLiveStateInfo=function(){o.mapViewDesc=new dd(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: ".concat(o.map.getStyle().style,".</p>")},this.updateMapState=function(e){o.atlasMapLiveStateInfo.innerHTML=e},this.map=e},_d=function(e){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 e,t=o.map.getTraffic();"none"===t.flow||(e=o.map.layers.getLayerById("traffic_".concat(t.flow)))&&(o.lastFlowMode=t.flow,e._updateLayoutProperty("visibility","visible","none"))},this.removeFromMap=function(){var e;o.map.getTraffic(),"none"!=o.lastFlowMode&&((e=o.map.layers.getLayerById("traffic_".concat(o.lastFlowMode)))&&e._updateLayoutProperty("visibility","none","visible"),o.lastFlowMode="none"),o.listenerEnabled&&(o.map.events.remove("styledata",o.addToMap),o.listenerEnabled=!1)},this.map=e},wd=((window&&window.__extends||(gd=function(e,t){return(gd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}gd(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(bd,yd=ba),bd.getIncidentTypeName=function(e,t){switch(e){case 0:return t.Unknown;case 1:return t.Accident;case 2:return t.Fog;case 3:return t.Danger;case 4:return t.Rain;case 5:return t.Ice;case 6:return t.Jam;case 7:return t.LaneClosed;case 8:return t.RoadClosed;case 9:return t.RoadWorks;case 10:return t.Wind;case 11:return t.Flood;case 12:return t.Detour;default:return t.Unknown}},bd.getIncidentTypeIconName=function(e){switch(e){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"}},bd.getSeverityColorName=function(e){switch(e){case 0:return"grey";case 1:return"yellow";case 2:return"orange";case 3:return"red";default:return"grey"}},bd.getSeverityColorHexCode=function(e){switch(e){case 0:return"#B5B6B7";case 1:return"#F4C951";case 2:return"#F4873F";case 3:return"#F04F4E";default:return"#B5B6B7"}},bd);function bd(e,t,o){var 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=null!==(n=e.icon_category_12)&&void 0!==n?n:e.icon_category_11)&&void 0!==r?r:e.icon_category_10)&&void 0!==n?n:e.icon_category_9)&&void 0!==r?r:e.icon_category_8)&&void 0!==n?n:e.icon_category_7)&&void 0!==r?r:e.icon_category_6)&&void 0!==n?n:e.icon_category_5)&&void 0!==r?r:e.icon_category_4)&&void 0!==n?n:e.icon_category_3)&&void 0!==r?r:e.icon_category_2)&&void 0!==n?n:e.icon_category_1)&&void 0!==r?r:e.icon_category_0)&&void 0!==n?n:e.icon_category,n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=null!==(n=e.description_12)&&void 0!==n?n:e.description_11)&&void 0!==n?n:e.description_10)&&void 0!==n?n:e.description_9)&&void 0!==n?n:e.description_8)&&void 0!==n?n:e.description_7)&&void 0!==n?n:e.description_6)&&void 0!==n?n:e.description_5)&&void 0!==n?n:e.description_4)&&void 0!==n?n:e.description_3)&&void 0!==n?n:e.description_2)&&void 0!==n?n:e.description_1)&&void 0!==n?n:e.description_0)&&void 0!==n?n:e.description,e={icon:"".concat(bd.getSeverityColorName(e.magnitude),"-").concat(bd.getIncidentTypeIconName(r)),incidentType:bd.getIncidentTypeName(r,o),description:n,delay:e.delay,color:bd.getSeverityColorHexCode(e.magnitude),id:e.id};return yd.call(this,t,e)||this}(r=md=md||{}).DELAY="delay",r.LENGTH="length",r.FROM="from",r.TO="to";var Cd=(Ed.build=function(e,t){void 0===t&&(t="en-US");var o=document.createElement("div");o.classList.add("incident-popup-title"),o.classList.add("font-segoeui-b"),o.innerText=e.properties.incidentType,o.setAttribute("aria-label","Incident Type ".concat(e.properties.incidentType));var r=document.createElement("div");r.classList.add("incident-popup-subtitle"),r.classList.add("font-segoeui-b"),r.setAttribute("aria-label","Incident Description ".concat(e.properties.description)),r.innerText=e.properties.description;var n=document.createElement("div");n.classList.add("incident-popup-header"),n.style.backgroundColor=e.properties.color,n.appendChild(o),n.appendChild(r);var i,a,s,r=document.createElement("div");r.classList.add("incident-popup-body"),e.properties.delay&&(i="".concat(Math.floor(e.properties.delay/60)," min"),i=this.createInfoSection(i,md.DELAY),r.appendChild(i)),e.properties.length&&(i=new Intl.NumberFormat([t,"en-US"],{maximumFractionDigits:2}),s=void 0,s="en-US"===t?(a=ts(e.properties.length,"meters","miles"),"".concat(i.format(a)," miles")):(a=ts(e.properties.length,"meters","kilometers"),"".concat(i.format(a)," km")),s=this.createInfoSection(s,md.LENGTH),r.appendChild(s)),e.properties.from&&(s=this.createInfoSection(e.properties.from,md.FROM),r.appendChild(s)),e.properties.to&&(c=this.createInfoSection(e.properties.to,md.TO),r.appendChild(c));var c=document.createElement("div");return c.classList.add("incident-popup-content"),c.appendChild(n),c.appendChild(r),new Ah({content:c,position:e.geometry.coordinates})},Ed.createInfoSection=function(e,t){var o=document.createElement("div");o.classList.add("incident-popup-info");var r=document.createElement("div");r.classList.add("icon"),r.classList.add(t);var n=document.createElement("span");return n.classList.add("message"),n.classList.add("font-segoeui"),n.setAttribute("aria-label","Incident ".concat(t," ").concat(e)),n.innerText=e,o.appendChild(r),o.appendChild(n),o},Ed);function Ed(){}var Sd=window&&window.__awaiter||function(e,a,s,c){return new(s=s||Promise)(function(o,t){function r(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?o(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(r,n)}i((c=c.apply(e,a||[])).next())})},Td=window&&window.__generator||function(o,r){var n,i,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;c&&t[c=0]&&(s=0),s;)try{if(n=1,i&&(a=2&t[0]?i.return:t[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,t[1])).done)return a;switch(i=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,i=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=r.call(o,s)}catch(e){t=[6,e],i=0}finally{n=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},Id=(Ad.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"]]]},Ad);function Ad(e){var n=this;this.incidentLayerName="incidents",this.incidentSourceName="mapcontrol_traffic_incident",this.addToMap=function(){n.map.sources.getById(n.incidentSourceName)||n.map.sources.add(n.vectorTileSource),n.map.layers.getLayerById(n.incidentLayerName)||n.map.layers.add(n.incidentLayer,"labels"),n.clickPopup=new Ah({position:[0,0],pixelOffset:[0,-18]}),n.map.addEventListener("mouseover",n.incidentLayerName,n.cursorToPointer),n.map.addEventListener("mouseleave",n.incidentLayerName,n.cursorToDefault),n.map.addEventListener("click",n.incidentLayerName,n.openIncidentPopup),n.map.events.addOnce("idle",n.setAccessiblePopups),n.map.events.add("moveend",n.setAccessiblePopups)},this.accessiblePopups=[],this.setAccessiblePopups=function(){return Sd(n,void 0,void 0,function(){var t,i,a,s,c,u,l=this;return Td(this,function(e){switch(e.label){case 0:return this.accessiblePopups.forEach(function(e){return e.remove()}),this.accessiblePopups=[],t=this.map.layers.getRenderedShapes(this.map.getCamera().bounds,this.incidentLayer),[4,this.map._getLocalizedStrings()];case 1:return i=e.sent(),a=function(t,o){var e=t[o],r=e.geometry.coordinates,r=new Aa(new Ms(r[0],r[1])),r=new wd(e.properties,r,i),n=Cd.build(r,l.incidentLanguage),r=n.getPopupContainer();return r.addEventListener("focusin",function(e){l.clickPopup.remove(),l.accessiblePopups.filter(function(e){return e!==n}).forEach(function(e){return e.remove()}),0<=o-1&&s(n,a(t,o-1)),o+1<t.length&&u(a(t,o+1)),2<=o&&o==t.length-1&&c(a(t,0)),0==o&&2<=t.length&&u(a(t,t.length-1))}),o==t.length-1&&r.addEventListener("focusout",function(e){null===e.relatedTarget&&n.close()}),l.accessiblePopups.push(n),n},s=function(e,t){t.open(l.map),t.close();t=t.getPopupContainer(),e=e.getPopupContainer();e.parentElement.insertBefore(t,e)},c=function(e){e.open(l.map),e.close();var t=e.getPopupContainer(),e=t.parentElement;e.insertBefore(t,e.firstElementChild)},u=function(e){e.open(l.map),e.close()},0<t.length&&u(a(t,0)),1<t.length&&u(a(t,t.length-1)),[2]}})})},this.removeFromMap=function(){var e;n.map.removeEventListener("mouseover",n.incidentLayerName,n.cursorToPointer),n.map.removeEventListener("mouseleave",n.incidentLayerName,n.cursorToDefault),n.map.removeEventListener("click",n.incidentLayerName,n.openIncidentPopup),n.map.events.remove("idle",n.setAccessiblePopups),n.map.events.remove("moveend",n.setAccessiblePopups),n.accessiblePopups.forEach(function(e){return e.remove()}),n.accessiblePopups=[],null!==(e=n.clickPopup)&&void 0!==e&&e.remove(),null!=n.map.layers.getLayerById(n.incidentLayerName)&&n.map.layers.remove(n.incidentLayerName),null!=n.map.sources.getById(n.incidentSourceName)&&n.map.sources.remove(n.incidentSourceName)},this.cursorToPointer=function(e){n.map.getCanvas().style.cursor="pointer"},this.cursorToDefault=function(e){n.map.getCanvas().style.cursor=""},this.openIncidentPopup=function(e){n.clickPopup.remove(),n.accessiblePopups.forEach(function(e){return e.close()});var o=e.position,r=e.features[0];n.map._getLocalizedStrings().then(function(e){var t=new Aa(new Ms(o[0],o[1])),e=new wd(r.properties,t,e);n.clickPopup=Cd.build(e,n.incidentLanguage),n.clickPopup.open(n.map),n.clickPopup.getPopupContainer().addEventListener("focusout",function(e){null===e.relatedTarget&&n.clickPopup.close()})})},this.map=e,this.vectorTileSource=new Hc(this.incidentSourceName,{maxZoom:22,tiles:["https://".concat(h,"/traffic/incident/tile/pbf?api-version=1.0&zoom={z}&x={x}&y={y}")]});e=this.getIncidentIconImageExpression();this.incidentLayer=new Kl(this.incidentSourceName,this.incidentLayerName,{sourceLayer:"Traffic incident POI",iconOptions:{ignorePlacement:!0,allowOverlap:!0,image:e,size:.75}})}var kd,Od,Pd=((window&&window.__extends||(kd=function(e,t){return(kd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}kd(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(xd,Od=k),xd);function xd(){var e=null!==Od&&Od.apply(this,arguments)||this;return e.interactive=!0,e.scrollZoomInteraction=!0,e.boxZoomInteraction=!0,e.dragRotateInteraction=!0,e.dragPanInteraction=!0,e.keyboardInteraction=!0,e.dblClickZoomInteraction=!0,e.touchInteraction=!0,e.touchRotate=!0,e.wheelZoomRate=1/450,e}var Rd=(Md.prototype.enable=function(){this.map.getMapContainer().addEventListener("keydown",this._onKeyDown)},Md.prototype.disable=function(){this.map.getMapContainer().removeEventListener("keydown",this._onKeyDown)},Md);function Md(e){var t=this;this._onKeyDown=function(e){27===e.keyCode&&t.map.getCanvas().focus()},this.map=e}var Nd=(Ld.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)},Ld.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)},Ld);function Ld(e){var t=this;this._onGestureStart=function(e){t.hasTouch||(e.preventDefault(),t.initZoom=t.map.getCamera().zoom)},this._onGestureChange=function(e){t.hasTouch||(e.preventDefault(),t.map.setCamera({zoom:t.initZoom+e.scale-1}))},this._onTouchStart=function(e){t.hasTouch=!0},this._onTouchEnd=function(e){0===e.touches.length&&(t.hasTouch=!1)},this.map=e}var Dd=(qd.prototype.addToMap=function(){this.added||(this.added=!0,this._setInteractions(this.options))},qd.prototype.removeFromMap=function(){this.added&&(this.added=!1,this._setInteractions({interactive:!1}))},qd.prototype.setOptions=function(e){this.options=(new Pd).merge(this.options,e),this.added&&this._setInteractions(this.options)},qd.prototype.getOptions=function(){return Object.assign({},this.options)},qd.prototype._setInteractions=function(e){var t;e.interactive?(e.boxZoomInteraction?this.map._getMap().boxZoom.enable():this.map._getMap().boxZoom.disable(),e.dblClickZoomInteraction?this.map._getMap().doubleClickZoom.enable():this.map._getMap().doubleClickZoom.disable(),e.dragPanInteraction?this.map._getMap().dragPan.enable():this.map._getMap().dragPan.disable(),e.dragRotateInteraction?this.map._getMap().dragRotate.enable():this.map._getMap().dragRotate.disable(),e.keyboardInteraction?(this.map._getMap().keyboard.enable(),this.focusShortcut.enable()):(this.map._getMap().keyboard.disable(),this.focusShortcut.disable()),e.scrollZoomInteraction?(this.map._getMap().scrollZoom.enable(),this.map._getMap().scrollZoom.setWheelZoomRate(e.wheelZoomRate)):this.map._getMap().scrollZoom.disable(),t=this.map._getMap().touchZoomRotate,e.touchInteraction?(t.enable(),e.touchRotate?t.enableRotation():t.disableRotation()):t.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())},qd);function qd(e,t){this.added=!1,this.map=e,this.focusShortcut=new Rd(e),this.pinchZoom=new Nd(e),this.options=(new Pd).merge(t)}function jd(e,t,o){var r={type:"Feature"};return 0!==(o=void 0===o?{}:o).id&&!o.id||(r.id=o.id),o.bbox&&(r.bbox=o.bbox),r.properties=t||{},r.geometry=e,r}function Ud(e){return"Feature"===e.type?e.geometry:e}var w={exports:{}},Hd=be(w.exports=function(){function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function a(e,t,o){if(t)r(e.prototype,t);if(o)r(e,o);return e}var l=function(){function e(e,t){this.next=null;this.key=e;this.data=t;this.left=null;this.right=null}return e}();function t(e,t){return e>t?1:e<t?-1:0}function s(e,t,o){var r=new l(null,null);var n=r;var i=r;while(true){var a=o(e,t.key);if(a<0){if(t.left===null)break;if(o(e,t.left.key)<0){var s=t.left;t.left=s.right;s.right=t;t=s;if(t.left===null)break}i.left=t;i=t;t=t.left}else if(a>0){if(t.right===null)break;if(o(e,t.right.key)>0){var s=t.right;t.right=s.left;s.left=t;t=s;if(t.right===null)break}n.right=t;n=t;t=t.right}else break}n.right=t.left;i.left=t.right;t.left=r.right;t.right=r.left;return t}function c(e,t,o,r){var n=new l(e,t);if(o===null){n.left=n.right=null;return n}o=s(e,o,r);var i=r(e,o.key);if(i<0){n.left=o.left;n.right=o;o.left=null}else if(i>=0){n.right=o.right;n.left=o;o.right=null}return n}function h(e,t,o){var r=null;var n=null;if(t){t=s(e,t,o);var i=o(t.key,e);if(i===0){r=t.left;n=t.right}else if(i<0){n=t.right;t.right=null;r=t}else{r=t.left;t.left=null;n=t}}return{left:r,right:n}}function p(e,t,o){if(t===null)return e;if(e===null)return t;t=s(e.key,t,o);t.left=e;return t}function d(e,t,o,r,n){if(e){r(""+t+(o?"└── ":"├── ")+n(e)+"\n");var i=t+(o?" ":"│ ");if(e.left)d(e.left,i,false,r,n);if(e.right)d(e.right,i,true,r,n)}}var x=function(){function e(e){if(e===void 0)e=t;this._root=null;this._size=0;this._comparator=e}e.prototype.insert=function(e,t){this._size++;return this._root=c(e,t,this._root,this._comparator)};e.prototype.add=function(e,t){var o=new l(e,t);if(this._root===null){o.left=o.right=null;this._size++;this._root=o}var r=this._comparator;var n=s(e,this._root,r);var i=r(e,n.key);if(i===0)this._root=n;else{if(i<0){o.left=n.left;o.right=n;n.left=null}else if(i>0){o.right=n.right;o.left=n;n.right=null}this._size++;this._root=o}return this._root};e.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)};e.prototype._remove=function(e,t,o){var r;if(t===null)return null;t=s(e,t,o);var n=o(e,t.key);if(n===0){if(t.left===null)r=t.right;else{r=s(e,t.left,o);r.right=t.right}this._size--;return r}return t};e.prototype.pop=function(){var e=this._root;if(e){while(e.left)e=e.left;this._root=s(e.key,this._root,this._comparator);this._root=this._remove(e.key,this._root,this._comparator);return{key:e.key,data:e.data}}return null};e.prototype.findStatic=function(e){var t=this._root;var o=this._comparator;while(t){var r=o(e,t.key);if(r===0)return t;else if(r<0)t=t.left;else t=t.right}return null};e.prototype.find=function(e){if(this._root){this._root=s(e,this._root,this._comparator);if(this._comparator(e,this._root.key)!==0)return null}return this._root};e.prototype.contains=function(e){var t=this._root;var o=this._comparator;while(t){var r=o(e,t.key);if(r===0)return true;else if(r<0)t=t.left;else t=t.right}return false};e.prototype.forEach=function(e,t){var o=this._root;var r=[];var n=false;while(!n)if(o!==null){r.push(o);o=o.left}else if(r.length!==0){o=r.pop();e.call(t,o);o=o.right}else n=true;return this};e.prototype.range=function(e,t,o,r){var n=[];var i=this._comparator;var a=this._root;var s;while(n.length!==0||a)if(a){n.push(a);a=a.left}else{a=n.pop();s=i(a.key,t);if(s>0)break;else if(i(a.key,e)>=0)if(o.call(r,a))return this;a=a.right}return this};e.prototype.keys=function(){var o=[];this.forEach(function(e){var t=e.key;return o.push(t)});return o};e.prototype.values=function(){var o=[];this.forEach(function(e){var t=e.data;return o.push(t)});return o};e.prototype.min=function(){if(this._root)return this.minNode(this._root).key;return null};e.prototype.max=function(){if(this._root)return this.maxNode(this._root).key;return null};e.prototype.minNode=function(e){if(e===void 0)e=this._root;if(e)while(e.left)e=e.left;return e};e.prototype.maxNode=function(e){if(e===void 0)e=this._root;if(e)while(e.right)e=e.right;return e};e.prototype.at=function(e){var t=this._root;var o=false;var r=0;var n=[];while(!o)if(t){n.push(t);t=t.left}else if(n.length>0){t=n.pop();if(r===e)return t;r++;t=t.right}else o=true;return null};e.prototype.next=function(e){var t=this._root;var o=null;if(e.right){o=e.right;while(o.left)o=o.left;return o}var r=this._comparator;while(t){var n=r(e.key,t.key);if(n===0)break;else if(n<0){o=t;t=t.left}else t=t.right}return o};e.prototype.prev=function(e){var t=this._root;var o=null;if(e.left!==null){o=e.left;while(o.right)o=o.right;return o}var r=this._comparator;while(t){var n=r(e.key,t.key);if(n===0)break;else if(n<0)t=t.left;else{o=t;t=t.right}}return o};e.prototype.clear=function(){this._root=null;this._size=0;return this};e.prototype.toList=function(){return o(this._root)};e.prototype.load=function(e,t,o){if(t===void 0)t=[];if(o===void 0)o=false;var r=e.length;var n=this._comparator;if(o)v(e,t,0,r-1,n);if(this._root===null){this._root=f(e,t,0,r);this._size=r}else{var i=m(this.toList(),g(e,t),n);r=this._size+r;this._root=y({head:i},0,r)}return this};e.prototype.isEmpty=function(){return this._root===null};Object.defineProperty(e.prototype,"size",{get:function e(){return this._size},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"root",{get:function e(){return this._root},enumerable:true,configurable:true});e.prototype.toString=function(e){if(e===void 0)e=function e(t){return String(t.key)};var t=[];d(this._root,"",true,function(e){return t.push(e)},e);return t.join("")};e.prototype.update=function(e,t,o){var r=this._comparator;var n=h(e,this._root,r),i=n.left,a=n.right;if(r(e,t)<0)a=c(t,o,a,r);else i=c(t,o,i,r);this._root=p(i,a,r)};e.prototype.split=function(e){return h(e,this._root,this._comparator)};return e}();function f(e,t,o,r){var n=r-o;if(n>0){var i=o+Math.floor(n/2);var a=e[i];var s=t[i];var c=new l(a,s);c.left=f(e,t,o,i);c.right=f(e,t,i+1,r);return c}return null}function g(e,t){var o=new l(null,null);var r=o;for(var n=0;n<e.length;n++)r=r.next=new l(e[n],t[n]);r.next=null;return o.next}function o(e){var t=e;var o=[];var r=false;var n=new l(null,null);var i=n;while(!r)if(t){o.push(t);t=t.left}else if(o.length>0){t=i=i.next=o.pop();t=t.right}else r=true;i.next=null;return n.next}function y(e,t,o){var r=o-t;if(r>0){var n=t+Math.floor(r/2);var i=y(e,t,n);var a=e.head;a.left=i;e.head=e.head.next;a.right=y(e,n+1,o);return a}return null}function m(e,t,o){var r=new l(null,null);var n=r;var i=e;var a=t;while(i!==null&&a!==null){if(o(i.key,a.key)<0){n.next=i;i=i.next}else{n.next=a;a=a.next}n=n.next}if(i!==null)n.next=i;else if(a!==null)n.next=a;return r.next}function v(e,t,o,r,n){if(o>=r)return;var i=e[o+r>>1];var a=o-1;var s=r+1;while(true){do{a++}while(n(e[a],i)<0);do{s--}while(n(e[s],i)>0);if(a>=s)break;var c=e[a];e[a]=e[s];e[s]=c;c=t[a];t[a]=t[s];t[s]=c}v(e,t,o,s,n);v(e,t,s+1,r,n)}var _=function e(t,o){return t.ll.x<=o.x&&o.x<=t.ur.x&&t.ll.y<=o.y&&o.y<=t.ur.y},R=function e(t,o){if(o.ur.x<t.ll.x||t.ur.x<o.ll.x||o.ur.y<t.ll.y||t.ur.y<o.ll.y)return null;var r=t.ll.x<o.ll.x?o.ll.x:t.ll.x;var n=t.ur.x<o.ur.x?t.ur.x:o.ur.x;var i=t.ll.y<o.ll.y?o.ll.y:t.ll.y;var a=t.ur.y<o.ur.y?t.ur.y:o.ur.y;return{ll:{x:r,y:i},ur:{x:n,y:a}}},n=Number.EPSILON;if(n===undefined)n=Math.pow(2,-52);var i=n*n,w=function e(t,o){if(-n<t&&t<n)if(-n<o&&o<n)return 0;var r=t-o;if(r*r<i*t*o)return 0;return t<o?-1:1},e=function(){function e(){u(this,e);this.reset()}a(e,[{key:"reset",value:function e(){this.xRounder=new b;this.yRounder=new b}},{key:"round",value:function e(t,o){return{x:this.xRounder.round(t),y:this.yRounder.round(o)}}}]);return e}(),b=function(){function e(){u(this,e);this.tree=new x;this.round(0)}a(e,[{key:"round",value:function e(t){var o=this.tree.add(t);var r=this.tree.prev(o);if(r!==null&&w(o.key,r.key)===0){this.tree.remove(t);return r.key}var n=this.tree.next(o);if(n!==null&&w(o.key,n.key)===0){this.tree.remove(t);return n.key}return t}}]);return e}(),M=new e,C=function e(t,o){return t.x*o.y-t.y*o.x},E=function e(t,o){return t.x*o.x+t.y*o.y},S=function e(t,o,r){var n={x:o.x-t.x,y:o.y-t.y};var i={x:r.x-t.x,y:r.y-t.y};var a=C(n,i);return w(a,0)},T=function e(t){return Math.sqrt(E(t,t))},I=function e(t,o,r){var n={x:o.x-t.x,y:o.y-t.y};var i={x:r.x-t.x,y:r.y-t.y};return C(i,n)/T(i)/T(n)},A=function e(t,o,r){var n={x:o.x-t.x,y:o.y-t.y};var i={x:r.x-t.x,y:r.y-t.y};return E(i,n)/T(i)/T(n)},k=function e(t,o,r){if(o.y===0)return null;return{x:t.x+o.x/o.y*(r-t.y),y:r}},O=function e(t,o,r){if(o.x===0)return null;return{x:r,y:t.y+o.y/o.x*(r-t.x)}},P=function e(t,o,r,n){if(o.x===0)return O(r,n,t.x);if(n.x===0)return O(t,o,r.x);if(o.y===0)return k(r,n,t.y);if(n.y===0)return k(t,o,r.y);var i=C(o,n);if(i==0)return null;var a={x:r.x-t.x,y:r.y-t.y};var s=C(a,o)/i;var c=C(a,n)/i;var u=t.x+c*o.x,l=r.x+s*n.x;var h=t.y+c*o.y,p=r.y+s*n.y;var d=(u+l)/2;var f=(h+p)/2;return{x:d,y:f}},N=function(){a(n,null,[{key:"compare",value:function e(t,o){var r=n.comparePoints(t.point,o.point);if(r!==0)return r;if(t.point!==o.point)t.link(o);if(t.isLeft!==o.isLeft)return t.isLeft?1:-1;return D.compare(t.segment,o.segment)}},{key:"comparePoints",value:function e(t,o){if(t.x<o.x)return-1;if(t.x>o.x)return 1;if(t.y<o.y)return-1;if(t.y>o.y)return 1;return 0}}]);function n(e,t){u(this,n);if(e.events===undefined)e.events=[this];else e.events.push(this);this.point=e;this.isLeft=t}a(n,[{key:"link",value:function e(t){if(t.point===this.point)throw new Error("Tried to link already linked events");var o=t.point.events;for(var r=0,n=o.length;r<n;r++){var i=o[r];this.point.events.push(i);i.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function e(){var t=this.point.events.length;for(var o=0;o<t;o++){var r=this.point.events[o];if(r.segment.consumedBy!==undefined)continue;for(var n=o+1;n<t;n++){var i=this.point.events[n];if(i.consumedBy!==undefined)continue;if(r.otherSE.point.events!==i.otherSE.point.events)continue;r.segment.consume(i.segment)}}}},{key:"getAvailableLinkedEvents",value:function e(){var t=[];for(var o=0,r=this.point.events.length;o<r;o++){var n=this.point.events[o];if(n!==this&&!n.segment.ringOut&&n.segment.isInResult())t.push(n)}return t}},{key:"getLeftmostComparator",value:function e(r){var n=this;var c=new Map;var u=function e(t){var o=t.otherSE;c.set(t,{sine:I(n.point,r.point,o.point),cosine:A(n.point,r.point,o.point)})};return function(e,t){if(!c.has(e))u(e);if(!c.has(t))u(t);var o=c.get(e),r=o.sine,n=o.cosine;var i=c.get(t),a=i.sine,s=i.cosine;if(r>=0&&a>=0){if(n<s)return 1;if(n>s)return-1;return 0}if(r<0&&a<0){if(n<s)return-1;if(n>s)return 1;return 0}if(a<r)return-1;if(a>r)return 1;return 0}}}]);return n}(),L=0,D=function(){a(p,null,[{key:"compare",value:function e(t,o){var r=t.leftSE.point.x;var n=o.leftSE.point.x;var i=t.rightSE.point.x;var a=o.rightSE.point.x;if(a<r)return 1;if(i<n)return-1;var s=t.leftSE.point.y;var c=o.leftSE.point.y;var u=t.rightSE.point.y;var l=o.rightSE.point.y;if(r<n){if(c<s&&c<u)return 1;if(c>s&&c>u)return-1;var h=t.comparePoint(o.leftSE.point);if(h<0)return 1;if(h>0)return-1;var p=o.comparePoint(t.rightSE.point);if(p!==0)return p;return-1}if(r>n){if(s<c&&s<l)return-1;if(s>c&&s>l)return 1;var d=o.comparePoint(t.leftSE.point);if(d!==0)return d;var f=t.comparePoint(o.rightSE.point);if(f<0)return 1;if(f>0)return-1;return 1}if(s<c)return-1;if(s>c)return 1;if(i<a){var g=o.comparePoint(t.rightSE.point);if(g!==0)return g}if(i>a){var y=t.comparePoint(o.rightSE.point);if(y<0)return 1;if(y>0)return-1}if(i!==a){var m=u-s;var v=i-r;var _=l-c;var w=a-n;if(m>v&&_<w)return 1;if(m<v&&_>w)return-1}if(i>a)return 1;if(i<a)return-1;if(u<l)return-1;if(u>l)return 1;if(t.id<o.id)return-1;if(t.id>o.id)return 1;return 0}}]);function p(e,t,o,r){u(this,p);this.id=++L;this.leftSE=e;e.segment=this;e.otherSE=t;this.rightSE=t;t.segment=this;t.otherSE=e;this.rings=o;this.windings=r}a(p,[{key:"replaceRightSE",value:function e(t){this.rightSE=t;this.rightSE.segment=this;this.rightSE.otherSE=this.leftSE;this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function e(){var t=this.leftSE.point.y;var o=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<o?t:o},ur:{x:this.rightSE.point.x,y:t>o?t:o}}}},{key:"vector",value:function e(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function e(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function e(t){if(this.isAnEndpoint(t))return 0;var o=this.leftSE.point;var r=this.rightSE.point;var n=this.vector();if(o.x===r.x){if(t.x===o.x)return 0;return t.x<o.x?1:-1}var i=(t.y-o.y)/n.y;var a=o.x+i*n.x;if(t.x===a)return 0;var s=(t.x-o.x)/n.x;var c=o.y+s*n.y;if(t.y===c)return 0;return t.y<c?-1:1}},{key:"getIntersection",value:function e(t){var o=this.bbox();var r=t.bbox();var n=R(o,r);if(n===null)return null;var i=this.leftSE.point;var a=this.rightSE.point;var s=t.leftSE.point;var c=t.rightSE.point;var u=_(o,s)&&this.comparePoint(s)===0;var l=_(r,i)&&t.comparePoint(i)===0;var h=_(o,c)&&this.comparePoint(c)===0;var p=_(r,a)&&t.comparePoint(a)===0;if(l&&u){if(p&&!h)return a;if(!p&&h)return c;return null}if(l){if(h)if(i.x===c.x&&i.y===c.y)return null;return i}if(u){if(p)if(a.x===s.x&&a.y===s.y)return null;return s}if(p&&h)return null;if(p)return a;if(h)return c;var d=P(i,this.vector(),s,t.vector());if(d===null)return null;if(!_(n,d))return null;return M.round(d.x,d.y)}},{key:"split",value:function e(t){var o=[];var r=t.events!==undefined;var n=new N(t,true);var i=new N(t,false);var a=this.rightSE;this.replaceRightSE(i);o.push(i);o.push(n);var s=new p(n,a,this.rings.slice(),this.windings.slice());if(N.comparePoints(s.leftSE.point,s.rightSE.point)>0)s.swapEvents();if(N.comparePoints(this.leftSE.point,this.rightSE.point)>0)this.swapEvents();if(r){n.checkForConsuming();i.checkForConsuming()}return o}},{key:"swapEvents",value:function e(){var t=this.rightSE;this.rightSE=this.leftSE;this.leftSE=t;this.leftSE.isLeft=true;this.rightSE.isLeft=false;for(var o=0,r=this.windings.length;o<r;o++)this.windings[o]*=-1}},{key:"consume",value:function e(t){var o=this;var r=t;while(o.consumedBy)o=o.consumedBy;while(r.consumedBy)r=r.consumedBy;var n=p.compare(o,r);if(n===0)return;if(n>0){var i=o;o=r;r=i}if(o.prev===r){var a=o;o=r;r=a}for(var s=0,c=r.rings.length;s<c;s++){var u=r.rings[s];var l=r.windings[s];var h=o.rings.indexOf(u);if(h===-1){o.rings.push(u);o.windings.push(l)}else o.windings[h]+=l}r.rings=null;r.windings=null;r.consumedBy=o;r.leftSE.consumedBy=o.leftSE;r.rightSE.consumedBy=o.rightSE}},{key:"prevInResult",value:function e(){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 e(){if(this._beforeState!==undefined)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}},{key:"afterState",value:function e(){if(this._afterState!==undefined)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};var o=this._afterState.rings;var r=this._afterState.windings;var n=this._afterState.multiPolys;for(var i=0,a=this.rings.length;i<a;i++){var s=this.rings[i];var c=this.windings[i];var u=o.indexOf(s);if(u===-1){o.push(s);r.push(c)}else r[u]+=c}var l=[];var h=[];for(var p=0,d=o.length;p<d;p++){if(r[p]===0)continue;var f=o[p];var g=f.poly;if(h.indexOf(g)!==-1)continue;if(f.isExterior)l.push(g);else{if(h.indexOf(g)===-1)h.push(g);var y=l.indexOf(f.poly);if(y!==-1)l.splice(y,1)}}for(var m=0,v=l.length;m<v;m++){var _=l[m].multiPoly;if(n.indexOf(_)===-1)n.push(_)}return this._afterState}},{key:"isInResult",value:function e(){if(this.consumedBy)return false;if(this._isInResult!==undefined)return this._isInResult;var t=this.beforeState().multiPolys;var o=this.afterState().multiPolys;switch(Z.type){case"union":{var r=t.length===0;var n=o.length===0;this._isInResult=r!==n;break}case"intersection":{var i;var a;if(t.length<o.length){i=t.length;a=o.length}else{i=o.length;a=t.length}this._isInResult=a===Z.numMultiPolys&&i<a;break}case"xor":{var s=Math.abs(t.length-o.length);this._isInResult=s%2===1;break}case"difference":{var c=function e(t){return t.length===1&&t[0].isSubject};this._isInResult=c(t)!==c(o);break}default:throw new Error("Unrecognized operation type found ".concat(Z.type))}return this._isInResult}}],[{key:"fromRing",value:function e(t,o,r){var n,i,a;var s=N.comparePoints(t,o);if(s<0){n=t;i=o;a=1}else if(s>0){n=o;i=t;a=-1}else throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));var c=new N(n,true);var u=new N(i,false);return new p(c,u,[r],[a])}}]);return p}(),q=function(){function c(e,t,o){u(this,c);if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.poly=t;this.isExterior=o;this.segments=[];if(typeof e[0][0]!=="number"||typeof e[0][1]!=="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var r=M.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};var n=r;for(var i=1,a=e.length;i<a;i++){if(typeof e[i][0]!=="number"||typeof e[i][1]!=="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var s=M.round(e[i][0],e[i][1]);if(s.x===n.x&&s.y===n.y)continue;this.segments.push(D.fromRing(n,s,this));if(s.x<this.bbox.ll.x)this.bbox.ll.x=s.x;if(s.y<this.bbox.ll.y)this.bbox.ll.y=s.y;if(s.x>this.bbox.ur.x)this.bbox.ur.x=s.x;if(s.y>this.bbox.ur.y)this.bbox.ur.y=s.y;n=s}if(r.x!==n.x||r.y!==n.y)this.segments.push(D.fromRing(n,r,this))}a(c,[{key:"getSweepEvents",value:function e(){var t=[];for(var o=0,r=this.segments.length;o<r;o++){var n=this.segments[o];t.push(n.leftSE);t.push(n.rightSE)}return t}}]);return c}(),j=function(){function i(e,t){u(this,i);if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new q(e[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,r=e.length;o<r;o++){var n=new q(e[o],this,false);if(n.bbox.ll.x<this.bbox.ll.x)this.bbox.ll.x=n.bbox.ll.x;if(n.bbox.ll.y<this.bbox.ll.y)this.bbox.ll.y=n.bbox.ll.y;if(n.bbox.ur.x>this.bbox.ur.x)this.bbox.ur.x=n.bbox.ur.x;if(n.bbox.ur.y>this.bbox.ur.y)this.bbox.ur.y=n.bbox.ur.y;this.interiorRings.push(n)}this.multiPoly=t}a(i,[{key:"getSweepEvents",value:function e(){var t=this.exteriorRing.getSweepEvents();for(var o=0,r=this.interiorRings.length;o<r;o++){var n=this.interiorRings[o].getSweepEvents();for(var i=0,a=n.length;i<a;i++)t.push(n[i])}return t}}]);return i}(),U=function(){function i(e,t){u(this,i);if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{if(typeof e[0][0][0]==="number")e=[e]}catch(e){}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,r=e.length;o<r;o++){var n=new j(e[o],this);if(n.bbox.ll.x<this.bbox.ll.x)this.bbox.ll.x=n.bbox.ll.x;if(n.bbox.ll.y<this.bbox.ll.y)this.bbox.ll.y=n.bbox.ll.y;if(n.bbox.ur.x>this.bbox.ur.x)this.bbox.ur.x=n.bbox.ur.x;if(n.bbox.ur.y>this.bbox.ur.y)this.bbox.ur.y=n.bbox.ur.y;this.polys.push(n)}this.isSubject=t}a(i,[{key:"getSweepEvents",value:function e(){var t=[];for(var o=0,r=this.polys.length;o<r;o++){var n=this.polys[o].getSweepEvents();for(var i=0,a=n.length;i<a;i++)t.push(n[i])}return t}}]);return i}(),H=function(){a(b,null,[{key:"factory",value:function e(t){var o=[];for(var r=0,n=t.length;r<n;r++){var i=t[r];if(!i.isInResult()||i.ringOut)continue;var a=null;var s=i.leftSE;var c=i.rightSE;var u=[s];var l=s.point;var h=[];while(true){a=s;s=c;u.push(s);if(s.point===l)break;while(true){var p=s.getAvailableLinkedEvents();if(p.length===0){var d=u[0].point;var f=u[u.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(p.length===1){c=p[0].otherSE;break}var g=null;for(var y=0,m=h.length;y<m;y++)if(h[y].point===s.point){g=y;break}if(g!==null){var v=h.splice(g)[0];var _=u.splice(v.index);_.unshift(_[0].otherSE);o.push(new b(_.reverse()));continue}h.push({index:u.length,point:s.point});var w=s.getLeftmostComparator(a);c=p.sort(w)[0].otherSE;break}}o.push(new b(u))}return o}}]);function b(e){u(this,b);this.events=e;for(var t=0,o=e.length;t<o;t++)e[t].segment.ringOut=this;this.poly=null}a(b,[{key:"getGeom",value:function e(){var t=this.events[0].point;var o=[t];for(var r=1,n=this.events.length-1;r<n;r++){var i=this.events[r].point;var a=this.events[r+1].point;if(S(i,t,a)===0)continue;o.push(i);t=i}if(o.length===1)return null;var s=o[0];var c=o[1];if(S(s,t,c)===0)o.shift();o.push(o[0]);var u=this.isExteriorRing()?1:-1;var l=this.isExteriorRing()?0:o.length-1;var h=this.isExteriorRing()?o.length:-1;var p=[];for(var d=l;d!=h;d+=u)p.push([o[d].x,o[d].y]);return p}},{key:"isExteriorRing",value:function e(){if(this._isExteriorRing===undefined){var t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():true}return this._isExteriorRing}},{key:"enclosingRing",value:function e(){if(this._enclosingRing===undefined)this._enclosingRing=this._calcEnclosingRing();return this._enclosingRing}},{key:"_calcEnclosingRing",value:function e(){var t=this.events[0];for(var o=1,r=this.events.length;o<r;o++){var n=this.events[o];if(N.compare(t,n)>0)t=n}var i=t.segment.prevInResult();var a=i?i.prevInResult():null;while(true){if(!i)return null;if(!a)return i.ringOut;if(a.ringOut!==i.ringOut)if(a.ringOut.enclosingRing()!==i.ringOut)return i.ringOut;else return i.ringOut.enclosingRing();i=a.prevInResult();a=i?i.prevInResult():null}}}]);return b}(),z=function(){function t(e){u(this,t);this.exteriorRing=e;e.poly=this;this.interiorRings=[]}a(t,[{key:"addInterior",value:function e(t){this.interiorRings.push(t);t.poly=this}},{key:"getGeom",value:function e(){var t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(var o=0,r=this.interiorRings.length;o<r;o++){var n=this.interiorRings[o].getGeom();if(n===null)continue;t.push(n)}return t}}]);return t}(),B=function(){function t(e){u(this,t);this.rings=e;this.polys=this._composePolys(e)}a(t,[{key:"getGeom",value:function e(){var t=[];for(var o=0,r=this.polys.length;o<r;o++){var n=this.polys[o].getGeom();if(n===null)continue;t.push(n)}return t}},{key:"_composePolys",value:function e(t){var o=[];for(var r=0,n=t.length;r<n;r++){var i=t[r];if(i.poly)continue;if(i.isExteriorRing())o.push(new z(i));else{var a=i.enclosingRing();if(!a.poly)o.push(new z(a));a.poly.addInterior(i)}}return o}}]);return t}(),F=function(){function o(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:D.compare;u(this,o);this.queue=e;this.tree=new x(t);this.segments=[]}a(o,[{key:"process",value:function e(t){var o=t.segment;var r=[];if(t.consumedBy){if(t.isLeft)this.queue.remove(t.otherSE);else this.tree.remove(o);return r}var n=t.isLeft?this.tree.insert(o):this.tree.find(o);if(!n)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=n;var a=n;var s=undefined;var c=undefined;while(s===undefined){i=this.tree.prev(i);if(i===null)s=null;else if(i.key.consumedBy===undefined)s=i.key}while(c===undefined){a=this.tree.next(a);if(a===null)c=null;else if(a.key.consumedBy===undefined)c=a.key}if(t.isLeft){var u=null;if(s){var l=s.getIntersection(o);if(l!==null){if(!o.isAnEndpoint(l))u=l;if(!s.isAnEndpoint(l)){var h=this._splitSafely(s,l);for(var p=0,d=h.length;p<d;p++)r.push(h[p])}}}var f=null;if(c){var g=c.getIntersection(o);if(g!==null){if(!o.isAnEndpoint(g))f=g;if(!c.isAnEndpoint(g)){var y=this._splitSafely(c,g);for(var m=0,v=y.length;m<v;m++)r.push(y[m])}}}if(u!==null||f!==null){var _=null;if(u===null)_=f;else if(f===null)_=u;else{var w=N.comparePoints(u,f);_=w<=0?u:f}this.queue.remove(o.rightSE);r.push(o.rightSE);var b=o.split(_);for(var C=0,E=b.length;C<E;C++)r.push(b[C])}if(r.length>0){this.tree.remove(o);r.push(t)}else{this.segments.push(o);o.prev=s}}else{if(s&&c){var S=s.getIntersection(c);if(S!==null){if(!s.isAnEndpoint(S)){var T=this._splitSafely(s,S);for(var I=0,A=T.length;I<A;I++)r.push(T[I])}if(!c.isAnEndpoint(S)){var k=this._splitSafely(c,S);for(var O=0,P=k.length;O<P;O++)r.push(k[O])}}}this.tree.remove(o)}return r}},{key:"_splitSafely",value:function e(t,o){this.tree.remove(t);var r=t.rightSE;this.queue.remove(r);var n=t.split(o);n.push(r);if(t.consumedBy===undefined)this.tree.insert(t);return n}}]);return o}(),K=typeof process!=="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,G=typeof process!=="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Y,Z=new(function(){function e(){u(this,e)}a(e,[{key:"run",value:function e(t,o,r){Z.type=t;M.reset();var n=[new U(o,true)];for(var i=0,a=r.length;i<a;i++)n.push(new U(r[i],false));Z.numMultiPolys=n.length;if(Z.type==="difference"){var s=n[0];var c=1;while(c<n.length)if(R(n[c].bbox,s.bbox)!==null)c++;else n.splice(c,1)}if(Z.type==="intersection")for(var u=0,l=n.length;u<l;u++){var h=n[u];for(var p=u+1,d=n.length;p<d;p++)if(R(h.bbox,n[p].bbox)===null)return[]}var f=new x(N.compare);for(var g=0,y=n.length;g<y;g++){var m=n[g].getSweepEvents();for(var v=0,_=m.length;v<_;v++){f.insert(m[v]);if(f.size>K)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 F(f);var b=f.size;var C=f.pop();while(C){var E=C.key;if(f.size===b){var S=E.segment;throw new Error("Unable to pop() ".concat(E.isLeft?"left":"right"," SweepEvent ")+"[".concat(E.point.x,", ").concat(E.point.y,"] from segment #").concat(S.id," ")+"[".concat(S.leftSE.point.x,", ").concat(S.leftSE.point.y,"] -> ")+"[".concat(S.rightSE.point.x,", ").concat(S.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(f.size>K)throw new Error("Infinite loop when passing sweep line over endpoints "+"(queue size too big). Please file a bug report.");if(w.segments.length>G)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(E);for(var I=0,A=T.length;I<A;I++){var k=T[I];if(k.consumedBy===undefined)f.insert(k)}b=f.size;C=f.pop()}M.reset();var O=H.factory(w.segments);var P=new B(O);return P.getGeom()}}]);return e}()),W,V,J,Q,X;return{union:function e(t){for(var o=arguments.length,r=new Array(o>1?o-1:0),n=1;n<o;n++)r[n-1]=arguments[n];return Z.run("union",t,r)},intersection:function e(t){for(var o=arguments.length,r=new Array(o>1?o-1:0),n=1;n<o;n++)r[n-1]=arguments[n];return Z.run("intersection",t,r)},xor:function e(t){for(var o=arguments.length,r=new Array(o>1?o-1:0),n=1;n<o;n++)r[n-1]=arguments[n];return Z.run("xor",t,r)},difference:function e(t){for(var o=arguments.length,r=new Array(o>1?o-1:0),n=1;n<o;n++)r[n-1]=arguments[n];return Z.run("difference",t,r)}}}());function zd(e,t,o){void 0===o&&(o={});var r,e=Ud(e),t=Ud(t),t=Hd.intersection(e.coordinates,t.coordinates);return 0===t.length?null:1===t.length?function(e,t,o){void 0===o&&(o={});for(var r=0,n=e;r<n.length;r++){var i=n[r];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<i[i.length-1].length;a++)if(i[i.length-1][a]!==i[0][a])throw new Error("First and last Position are not equivalent.")}return jd({type:"Polygon",coordinates:e},t,o)}(t[0],o.properties):(o=o.properties,jd({type:"MultiPolygon",coordinates:t},o,r=void 0===r?{}:r))}var Bd,r=window&&window.__decorate||function(e,t,o,r){var n,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(i<3?n(a):3<i?n(t,o,a):n(t,o))||a);return 3<i&&a&&Object.defineProperty(t,o,a),a},Fd=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},Kd=window&&window.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},Gd=["DIV","SPAN","A"],Yd=["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"],Zd=Kd(["href"],Fd(Yd),!1),Wd=(Vd.prototype.equals=function(e){return this.stringRepresentation===e.stringRepresentation},Object.defineProperty(Vd.prototype,"stringRepresentation",{get:function(){return[void 0!==this.minZoom?"minzoom=".concat(this.minZoom):"",void 0!==this.maxZoom?"maxzoom=".concat(this.maxZoom):"",void 0!==this.geometry?this.element.attributes.getNamedItem("data-azure-maps-attribution-geometry").value:"",void 0!==this.tilesetId?"tilesetId=".concat(this.tilesetId):"",this.dynamic?"dynamic":""].filter(function(e){return 0<e.length}).join(";")},enumerable:!1,configurable:!0}),Vd.applicable=function(e){return Array.from(e.attributes).map(function(e){return Yd.includes(e.name)}).reduce(function(e,t){return e||t},!1)},Object.defineProperty(Vd.prototype,"minZoom",{get:function(){var e=this.element.attributes.getNamedItem("data-azure-maps-attribution-minzoom");return e&&!isNaN(e.value)?parseInt(e.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Vd.prototype,"maxZoom",{get:function(){var e=this.element.attributes.getNamedItem("data-azure-maps-attribution-maxzoom");return e&&!isNaN(e.value)?parseInt(e.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Vd.prototype,"geometry",{get:function(){var e=this.element.attributes.getNamedItem("data-azure-maps-attribution-geometry");if(e&&e.value)try{return JSON.parse(e.value)}catch(e){return}},enumerable:!1,configurable:!0}),Object.defineProperty(Vd.prototype,"tilesetId",{get:function(){var e=this.element.attributes.getNamedItem("data-azure-maps-attribution-tileset");return e&&e.value?e.value:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Vd.prototype,"order",{get:function(){var e=this.element.attributes.getNamedItem("data-azure-maps-attribution-order");return e&&!isNaN(e.value)?parseInt(e.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Vd.prototype,"dynamic",{get:function(){return null!==this.element.attributes.getNamedItem("data-azure-maps-attribution-dynamic")},enumerable:!1,configurable:!0}),Object.defineProperty(Vd.prototype,"hidesElement",{get:function(){return"none"==this.element.style.display},enumerable:!1,configurable:!0}),Vd.prototype.forceHide=function(){this.element.style.display="none"},Vd.prototype.satisfied=function(e){var t=!this.minZoom||!e.zoom||e.zoom>=this.minZoom,o=!this.maxZoom||!e.zoom||e.zoom<=this.maxZoom,r=!0;return this.geometry&&e.bounds&&(r=null!==zd({type:"Feature",geometry:this.geometry,properties:{}},{type:"Feature",geometry:{type:"Polygon",coordinates:[[Gs.getNorthWest(e.bounds),Gs.getNorthEast(e.bounds),Gs.getSouthEast(e.bounds),Gs.getSouthWest(e.bounds),Gs.getNorthWest(e.bounds)]]},properties:{}})),t&&o&&r},Vd.prototype.apply=function(t,e){var o=this;void 0===e&&(e=null);var r=this.satisfied(t.getCamera()),n=this.dynamic&&this.tilesetId,i=this.hidesElement,e=e&&["dragend","zoomend","pitchend"].includes(e.type);return r||i?r&&(i||n)&&(r&&i&&this.element.style.removeProperty("display"),n&&(e?t.events.addOnce("idle",function(e){return o.fetchAndApplyDynamicAttribution(t)}):this.fetchAndApplyDynamicAttribution(t))):this.element.style.display="none",r===i},Vd.prototype.fetchAndApplyDynamicAttribution=function(r){var t,o,e,n=this,i=r.getCamera();this.lastFetchState&&Gs.containsBoundingBox(this.lastFetchState.bounds,i.bounds)&&Math.floor(this.lastFetchState.zoom)==Math.floor(i.zoom)||(t=ds(i.center,Gs.getSouthWest(i.bounds),Vd.viewportBufferExpansionRatio),e=((o=ds(i.center,Gs.getNorthEast(i.bounds),Vd.viewportBufferExpansionRatio))[0]<t[0]?[[t[0],t[1],180,o[1]],[-180,t[1],o[0],o[1]]]:[[t[0],t[1],o[0],o[1]]]).map(function(e){var t=new URLSearchParams({"api-version":"2.1",tilesetId:n.tilesetId,zoom:void 0!==i.zoom?"".concat(Math.floor(i.zoom)):void 0,bounds:e.join(",")}),o="".concat("https://{{azMapsDomain}}","/map/attribution"),e={url:o,headers:{}};r._substituteDomainLanguageViewAndSignInRequest(o,e);t="".concat(e.url).concat(e.url.includes("?")?"&":"?").concat(t.toString());return r._sendRequest(t,"Attribution",e.headers).then(function(e){return e.json()})}),Promise.all(e).then(function(e){n.applyAttributionResponse(e),n.lastFetchState={bounds:new Gs([t[0],t[1],o[0],o[1]]),zoom:i.zoom}}).catch(function(e){return console.error(e)}))},Vd.prototype.applyAttributionResponse=function(e){var t,o,r=this,n=e.map(function(e){return e.copyrights||[]}).reduce(function(e,t){return Kd(Kd([],Fd(e),!1),Fd(t),!1)},[]);0!=n.length&&(null!==(e=gh.parseWithFilter(n.join(""),function(e){return!0},function(e){return e},function(){return r.element.innerHTML="",r.element}))?(e="string"==typeof e?((n=document.createElement("span")).innerHTML=e,n):e,o=e===this.element?(t=document.createElement("span"),Array.from(this.element.childNodes).forEach(function(e){return t.appendChild(e)}),t):e,Array.from(this.element.attributes).filter(function(e){return Yd.includes(e.name)}).forEach(function(e){return o.attributes.setNamedItem(e.cloneNode())}),o.style.display=this.element.style.display,e=this.element.parentElement,this.element.remove(),e.append(o),this.element=o,this.attributionChangeCallback(this)):console.warn("Dynamic attribution is empty after filtering"))},Vd.viewportBufferExpansionRatio=2,r([(Bd=1e3,function(e,t,o){var r=o.value,n=new Map;return o.value=function(){var e=this,t=arguments;n.get(e)||!1||(r.apply(e,t),n.set(e,!0),setTimeout(function(){return n.delete(e)},Bd))},o})],Vd.prototype,"fetchAndApplyDynamicAttribution",null),Vd);function Vd(e,t){var o=this;this.lastFetchState={bounds:null,zoom:null},this.getElement=function(){return o.element},this.element=e,this.attributionChangeCallback=t}var Jd=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},Qd=window&&window.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},Xd=[/all rights reserved/gi],$d=(ef.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)},ef.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)},ef.prototype.getDefaultAttribution=function(){return this.copyrightControl.getDefaultAttributions().map(function(e){return t=e,(e=document.createElement("a")).textContent=t,e;var t})},ef);function ef(e,t,o){var r,s=this;this.rules=[],this.virtualContext=((r=document.createElement("span")).className="azure-map-copyright-context",r),this.renderContext=this.virtualContext.cloneNode(!1),this.addAttributionFromSource=function(e){},this.removeAttributionFromSource=function(e){},this.getMapStyleVisibleSources=function(){var t=s.map._getMap(),o=t.getStyle();return Object.entries(o.sources).filter(function(e){var t=Jd(e,1)[0];return o.layers.filter(function(e){return e&&e.source==t}).reduce(function(e,t){return!(t.layout&&"none"===t.layout.visibility||t.paint&&0===t.paint["icon-opacity"]&&0===t.paint["text-opacity"])||e},!1)}).map(function(e){e=Jd(e,1)[0];return t.getSource(e)})},this.loadAttributionOnceSourcesLoaded=function(){var e=s.getMapStyleVisibleSources();Promise.all(e.map(function(i){return new Promise(function(o,r){var n;"tiles"in i?o(i):((n=i).on("data",function e(t){"metadata"==t.sourceDataType&&(n.off("data",e),o(i))}),n.on("error",function e(t){n.off("error",e),r(t)}))}).then(function(e){return{status:"fulfilled",value:e}}).catch(function(e){return{status:"rejected",reason:e}})})).then(function(e){s.reloadAttribution()})},this.reloadAttribution=function(){var e=s.getMapStyleVisibleSources(),r=new Set,n={},t=e.filter(function(e){return"attribution"in e&&e.attribution&&"tiles"in e&&e.tiles instanceof Array&&0<e.tiles.length}).map(function(e){return gh.parseWithFilter(null!==(e=e.attribution)&&void 0!==e?e:"",function(e){return Gd.includes(e.tagName)&&Array.from(e.attributes).map(function(e){return Zd.includes(e.name)}).reduce(function(e,t){return e&&t},!0)},function(e){var t,o=null;return e instanceof HTMLElement&&Wd.applicable(e)&&(o=new Wd(e,function(){return s.renderAttribution()}),r.add(o),void 0!==o.order&&(e.style.order="".concat(o.order))),o&&e instanceof HTMLElement&&((!((t=o.stringRepresentation)in n)||void 0!==o.order&&void 0!==n[t].order&&o.order<n[t].order||void 0!==o.order&&void 0===n[t].order)&&(n[t]=o)),e},function(){return document.createElement("span")})}),o=new Set(Object.values(n)),e=new Set(Qd([],Jd(r),!1).filter(function(e){return!o.has(e)})),i=new Set(Qd([],Jd(e),!1).map(function(e){return e.getElement()}));Qd([],Jd(i),!1).filter(function(e){return null!==e.parentElement}).forEach(function(e){return e.parentElement.removeChild(e)}),s.rules=Object.values(n);var t=t.filter(function(e){return"string"==typeof e||!i.has(e)}).map(function(e){return"string"==typeof e?new Text(e):e}),a=document.createElement("span");0<t.length?t.forEach(function(e){return a.appendChild(e)}):s.getDefaultAttribution().forEach(function(e){return a.appendChild(e)}),s.virtualContext=a,s.copyrightControl.setOptions({copyrightContent:s.renderContext}),s.applyRules(),s.renderAttribution()},this.applyRules=function(o){void 0===o&&(o=null),s.rules.reduce(function(e,t){t=t.apply(s.map,o);return e||t},!1)&&s.renderAttribution()},this.renderAttribution=function(){var t=function(e){return Array.from("none"!=e.style.display?e.children:[]).map(function(e){return t(e)}).reduce(function(e,t){return Qd(Qd([],Jd(e),!1),Jd(t),!1)},Array.from("none"!=e.style.display?e.childNodes:[]).filter(function(e){return e.nodeType==e.TEXT_NODE}))},e=s.virtualContext.cloneNode(!0),o=t(e);o.forEach(function(e){return e.textContent=Qd([],Jd(Xd),!1).reduce(function(e,t){return e.replace(t,"").trim()},e.textContent)}),o.reduce(function(e,t){return e.has(t.textContent)?(t.textContent="",t.parentElement&&t.parentElement.removeChild(t)):e.add(t.textContent),e},new Set),s.renderContext.innerHTML="",Array.from(e.childNodes).forEach(function(e){return s.renderContext.appendChild(e)})},this.map=e,this.copyrightControl=t,this.options=o}var tf=function(e,t){return(tf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)};function of(e,t){function o(){this.constructor=e}tf(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var rf=function(){return(rf=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function nf(e,t){var o={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]]);return o}function af(e,a,s,c){return new(s=s||Promise)(function(o,t){function r(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?o(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(r,n)}i((c=c.apply(e,a||[])).next())})}function sf(o,r){var n,i,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(a=2&t[0]?i.return:t[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,t[1])).done)return a;switch(i=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,i=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=r.call(o,s)}catch(e){t=[6,e],i=0}finally{n=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function cf(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a}(arguments[t]));return e}var uf=function(e,t){return(uf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)};function lf(e,t){function o(){this.constructor=e}uf(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var hf=function(){return(hf=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function pf(e,a,s,c){return new(s=s||Promise)(function(o,t){function r(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?o(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(r,n)}i((c=c.apply(e,a||[])).next())})}function df(o,r){var n,i,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(a=2&t[0]?i.return:t[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,t[1])).done)return a;switch(i=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,i=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=r.call(o,s)}catch(e){t=[6,e],i=0}finally{n=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function ff(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;for(var r=Array(e),n=0,t=0;t<o;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,n++)r[n]=i[a];return r}var gf,yf,mf,vf,_f,wf={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",FRAGMENT_RESPONSE_MODE:"fragment",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",REGIONAL_AUTH_NON_MSI_QUERY_STRING:"allowestsrnonmsi=true",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],TOKEN_RESPONSE_TYPE:"token",ID_TOKEN_RESPONSE_TYPE:"id_token",SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},bf=[wf.OPENID_SCOPE,wf.PROFILE_SCOPE,wf.OFFLINE_ACCESS_SCOPE],Cf=ff(bf,[wf.EMAIL_SCOPE]);(w=gf=gf||{}).CONTENT_TYPE="Content-Type",w.RETRY_AFTER="Retry-After",w.CCS_HEADER="X-AnchorMailbox",w.WWWAuthenticate="WWW-Authenticate",w.AuthenticationInfo="Authentication-Info",w.X_MS_REQUEST_ID="x-ms-request-id",(r=yf=yf||{}).ID_TOKEN="idtoken",r.CLIENT_INFO="client.info",r.ADAL_ID_TOKEN="adal.idtoken",r.ERROR="error",r.ERROR_DESC="error.description",r.ACTIVE_ACCOUNT="active-account",r.ACTIVE_ACCOUNT_FILTERS="active-account-filters",(w=mf=mf||{}).COMMON="common",w.ORGANIZATIONS="organizations",w.CONSUMERS="consumers",(r=vf=vf||{}).CLIENT_ID="client_id",r.REDIRECT_URI="redirect_uri",r.RESPONSE_TYPE="response_type",r.RESPONSE_MODE="response_mode",r.GRANT_TYPE="grant_type",r.CLAIMS="claims",r.SCOPE="scope",r.ERROR="error",r.ERROR_DESCRIPTION="error_description",r.ACCESS_TOKEN="access_token",r.ID_TOKEN="id_token",r.REFRESH_TOKEN="refresh_token",r.EXPIRES_IN="expires_in",r.STATE="state",r.NONCE="nonce",r.PROMPT="prompt",r.SESSION_STATE="session_state",r.CLIENT_INFO="client_info",r.CODE="code",r.CODE_CHALLENGE="code_challenge",r.CODE_CHALLENGE_METHOD="code_challenge_method",r.CODE_VERIFIER="code_verifier",r.CLIENT_REQUEST_ID="client-request-id",r.X_CLIENT_SKU="x-client-SKU",r.X_CLIENT_VER="x-client-VER",r.X_CLIENT_OS="x-client-OS",r.X_CLIENT_CPU="x-client-CPU",r.X_CLIENT_CURR_TELEM="x-client-current-telemetry",r.X_CLIENT_LAST_TELEM="x-client-last-telemetry",r.X_MS_LIB_CAPABILITY="x-ms-lib-capability",r.X_APP_NAME="x-app-name",r.X_APP_VER="x-app-ver",r.POST_LOGOUT_URI="post_logout_redirect_uri",r.ID_TOKEN_HINT="id_token_hint",r.DEVICE_CODE="device_code",r.CLIENT_SECRET="client_secret",r.CLIENT_ASSERTION="client_assertion",r.CLIENT_ASSERTION_TYPE="client_assertion_type",r.TOKEN_TYPE="token_type",r.REQ_CNF="req_cnf",r.OBO_ASSERTION="assertion",r.REQUESTED_TOKEN_USE="requested_token_use",r.ON_BEHALF_OF="on_behalf_of",r.FOCI="foci",r.CCS_HEADER="X-AnchorMailbox",r.RETURN_SPA_CODE="return_spa_code",r.NATIVE_BROKER="nativebroker",r.LOGOUT_HINT="logout_hint",(w=_f=_f||{}).ACCESS_TOKEN="access_token",w.XMS_CC="xms_cc";var Ef,Sf={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"};(r=Ef=Ef||{}).ACCOUNT="account",r.SID="sid",r.LOGIN_HINT="login_hint",r.ID_TOKEN="id_token",r.DOMAIN_HINT="domain_hint",r.ORGANIZATIONS="organizations",r.CONSUMERS="consumers",r.ACCOUNT_ID="accountIdentifier",r.HOMEACCOUNT_ID="homeAccountIdentifier";var Tf,If,Af,kf,Of,Pf,xf,Rf={PLAIN:"plain",S256:"S256"};(w=Tf=Tf||{}).QUERY="query",w.FRAGMENT="fragment",w.FORM_POST="form_post",(r=If=If||{}).IMPLICIT_GRANT="implicit",r.AUTHORIZATION_CODE_GRANT="authorization_code",r.CLIENT_CREDENTIALS_GRANT="client_credentials",r.RESOURCE_OWNER_PASSWORD_GRANT="password",r.REFRESH_TOKEN_GRANT="refresh_token",r.DEVICE_CODE_GRANT="device_code",r.JWT_BEARER="urn:ietf:params:oauth:grant-type:jwt-bearer",(w=Af=Af||{}).MSSTS_ACCOUNT_TYPE="MSSTS",w.ADFS_ACCOUNT_TYPE="ADFS",w.MSAV1_ACCOUNT_TYPE="MSA",w.GENERIC_ACCOUNT_TYPE="Generic",(r=kf=kf||{}).CACHE_KEY_SEPARATOR="-",r.CLIENT_INFO_SEPARATOR=".",(w=Of=Of||{}).ID_TOKEN="IdToken",w.ACCESS_TOKEN="AccessToken",w.ACCESS_TOKEN_WITH_AUTH_SCHEME="AccessToken_With_AuthScheme",w.REFRESH_TOKEN="RefreshToken",(r=Pf=Pf||{}).ACCOUNT="Account",r.CREDENTIAL="Credential",r.ID_TOKEN="IdToken",r.ACCESS_TOKEN="AccessToken",r.REFRESH_TOKEN="RefreshToken",r.APP_METADATA="AppMetadata",r.TEMPORARY="TempCache",r.TELEMETRY="Telemetry",r.UNDEFINED="Undefined",r.THROTTLING="Throttling",(w=xf=xf||{})[w.ADFS=1001]="ADFS",w[w.MSA=1002]="MSA",w[w.MSSTS=1003]="MSSTS",w[w.GENERIC=1004]="GENERIC",w[w.ACCESS_TOKEN=2001]="ACCESS_TOKEN",w[w.REFRESH_TOKEN=2002]="REFRESH_TOKEN",w[w.ID_TOKEN=2003]="ID_TOKEN",w[w.APP_METADATA=3001]="APP_METADATA",w[w.UNDEFINED=9999]="UNDEFINED";var Mf,Nf="appmetadata",Lf="authority-metadata",Df=86400;(r=Mf=Mf||{}).CONFIG="config",r.CACHE="cache",r.NETWORK="network",r.HARDCODED_VALUES="hardcoded_values";var qf,jf={SCHEMA_VERSION:5,MAX_CUR_HEADER_BYTES:80,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"};(w=qf=qf||{}).BEARER="Bearer",w.POP="pop",w.SSH="ssh-cert";var Uf,Hf,zf,Bf,Ff,Kf,Gf=60,Yf=3600,Zf="throttling",Wf="retry-after, h429",Vf="invalid_grant",Jf="client_mismatch";(r=Uf=Uf||{}).username="username",r.password="password",(w=Hf=Hf||{})[w.httpSuccess=200]="httpSuccess",w[w.httpBadRequest=400]="httpBadRequest",(r=zf=zf||{}).FAILED_AUTO_DETECTION="1",r.INTERNAL_CACHE="2",r.ENVIRONMENT_VARIABLE="3",r.IMDS="4",(w=Bf=Bf||{}).CONFIGURED_MATCHES_DETECTED="1",w.CONFIGURED_NO_AUTO_DETECTION="2",w.CONFIGURED_NOT_DETECTED="3",w.AUTO_DETECTION_REQUESTED_SUCCESSFUL="4",w.AUTO_DETECTION_REQUESTED_FAILED="5",(r=Ff=Ff||{}).NO_CACHE_HIT="0",r.FORCE_REFRESH="1",r.NO_CACHED_ACCESS_TOKEN="2",r.CACHED_ACCESS_TOKEN_EXPIRED="3",r.REFRESH_CACHED_ACCESS_TOKEN="4",(w=Kf=Kf||{}).Jwt="JWT",w.Jwk="JWK";var Qf,Xf={code:"unexpected_error",desc:"Unexpected error in authentication."},$f={code:"post_request_failed",desc:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."},eg=(lf(tg,Qf=Error),tg.prototype.setCorrelationId=function(e){this.correlationId=e},tg.createUnexpectedError=function(e){return new tg(Xf.code,Xf.desc+": "+e)},tg.createPostRequestFailed=function(e){return new tg($f.code,$f.desc+": "+e)},tg);function tg(e,t,o){var r=this,r=Qf.call(this,t?e+": "+t:e)||this;return Object.setPrototypeOf(r,tg.prototype),r.errorCode=e||wf.EMPTY_STRING,r.errorMessage=t||wf.EMPTY_STRING,r.subError=o||wf.EMPTY_STRING,r.name="AuthError",r}var og,rg={createNewGuid:function(){throw eg.createUnexpectedError("Crypto interface - createNewGuid() has not been implemented")},base64Decode:function(){throw eg.createUnexpectedError("Crypto interface - base64Decode() has not been implemented")},base64Encode:function(){throw eg.createUnexpectedError("Crypto interface - base64Encode() has not been implemented")},generatePkceCodes:function(){return pf(this,void 0,void 0,function(){return df(this,function(e){throw eg.createUnexpectedError("Crypto interface - generatePkceCodes() has not been implemented")})})},getPublicKeyThumbprint:function(){return pf(this,void 0,void 0,function(){return df(this,function(e){throw eg.createUnexpectedError("Crypto interface - getPublicKeyThumbprint() has not been implemented")})})},removeTokenBindingKey:function(){return pf(this,void 0,void 0,function(){return df(this,function(e){throw eg.createUnexpectedError("Crypto interface - removeTokenBindingKey() has not been implemented")})})},clearKeystore:function(){return pf(this,void 0,void 0,function(){return df(this,function(e){throw eg.createUnexpectedError("Crypto interface - clearKeystore() has not been implemented")})})},signJwt:function(){return pf(this,void 0,void 0,function(){return df(this,function(e){throw eg.createUnexpectedError("Crypto interface - signJwt() has not been implemented")})})},hashString:function(){return pf(this,void 0,void 0,function(){return df(this,function(e){throw eg.createUnexpectedError("Crypto interface - hashString() has not been implemented")})})}},ng={code:"client_info_decoding_error",desc:"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause."},ig={code:"client_info_empty_error",desc:"The client info was empty. Please review the trace to determine the root cause."},ag={code:"token_parsing_error",desc:"Token cannot be parsed. Please review stack trace to determine root cause."},sg={code:"null_or_empty_token",desc:"The token is null or empty. Please review the trace to determine the root cause."},cg={code:"endpoints_resolution_error",desc:"Error: could not resolve endpoints. Please check network and try again."},ug={code:"network_error",desc:"Network request failed. Please check network trace to determine root cause."},lg={code:"openid_config_error",desc:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints."},hg={code:"hash_not_deserialized",desc:"The hash parameters could not be deserialized. Please review the trace to determine the root cause."},pg={code:"invalid_state",desc:"State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState()."},dg={code:"state_mismatch",desc:"State mismatch error. Please check your network. Continued requests may cause cache overflow."},fg={code:"state_not_found",desc:"State not found"},gg={code:"nonce_mismatch",desc:"Nonce mismatch error. This may be caused by a race condition in concurrent requests."},yg={code:"nonce_not_found",desc:"nonce not found"},mg={code:"auth_time_not_found",desc:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information."},vg={code:"max_age_transpired",desc:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication."},_g={code:"multiple_matching_tokens",desc:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account."},wg={code:"multiple_matching_accounts",desc:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account"},bg={code:"multiple_matching_appMetadata",desc:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata"},Cg={code:"request_cannot_be_made",desc:"Token request cannot be made without authorization code or refresh token."},Eg={code:"cannot_append_empty_scope",desc:"Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info."},Sg={code:"cannot_remove_empty_scope",desc:"Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info."},Tg={code:"cannot_append_scopeset",desc:"Cannot append ScopeSet due to error."},Ig={code:"empty_input_scopeset",desc:"Empty input ScopeSet cannot be processed."},Ag={code:"device_code_polling_cancelled",desc:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true."},kg={code:"device_code_expired",desc:"Device code is expired."},Og={code:"device_code_unknown_error",desc:"Device code stopped polling for unknown reasons."},Pg={code:"no_account_in_silent_request",desc:"Please pass an account object, silent flow is not supported without account information"},xg={code:"invalid_cache_record",desc:"Cache record object was null or undefined."},Rg={code:"invalid_cache_environment",desc:"Invalid environment when attempting to create cache entry"},Mg={code:"no_account_found",desc:"No account found in cache for given key."},Ng={code:"no cache plugin set on CacheManager",desc:"ICachePlugin needs to be set before using readFromStorage or writeFromStorage"},Lg={code:"no_crypto_object",desc:"No crypto object detected. This is required for the following operation: "},Dg={code:"invalid_cache_type",desc:"Invalid cache type"},qg={code:"unexpected_account_type",desc:"Unexpected account type."},jg={code:"unexpected_credential_type",desc:"Unexpected credential type."},Ug={code:"invalid_assertion",desc:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515"},Hg={code:"invalid_client_credential",desc:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential"},zg={code:"token_refresh_required",desc:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired."},Bg={code:"user_timeout_reached",desc:"User defined timeout for device code polling reached"},Fg={code:"token_claims_cnf_required_for_signedjwt",desc:"Cannot generate a POP jwt if the token_claims are not populated"},Kg={code:"authorization_code_missing_from_server_response",desc:"Server response does not contain an authorization code to proceed"},Gg={code:"binding_key_not_removed",desc:"Could not remove the credential's binding key from storage."},Yg={code:"end_session_endpoint_not_supported",desc:"Provided authority does not support logout."},Zg={code:"key_id_missing",desc:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key."},Wg=(lf(Vg,og=eg),Vg.createClientInfoDecodingError=function(e){return new Vg(ng.code,ng.desc+" Failed with error: "+e)},Vg.createClientInfoEmptyError=function(){return new Vg(ig.code,""+ig.desc)},Vg.createTokenParsingError=function(e){return new Vg(ag.code,ag.desc+" Failed with error: "+e)},Vg.createTokenNullOrEmptyError=function(e){return new Vg(sg.code,sg.desc+" Raw Token Value: "+e)},Vg.createEndpointDiscoveryIncompleteError=function(e){return new Vg(cg.code,cg.desc+" Detail: "+e)},Vg.createNetworkError=function(e,t){return new Vg(ug.code,ug.desc+" | Fetch client threw: "+t+" | Attempted to reach: "+e.split("?")[0])},Vg.createUnableToGetOpenidConfigError=function(e){return new Vg(lg.code,lg.desc+" Attempted to retrieve endpoints from: "+e)},Vg.createHashNotDeserializedError=function(e){return new Vg(hg.code,hg.desc+" Given Object: "+e)},Vg.createInvalidStateError=function(e,t){return new Vg(pg.code,pg.desc+" Invalid State: "+e+", Root Err: "+t)},Vg.createStateMismatchError=function(){return new Vg(dg.code,dg.desc)},Vg.createStateNotFoundError=function(e){return new Vg(fg.code,fg.desc+": "+e)},Vg.createNonceMismatchError=function(){return new Vg(gg.code,gg.desc)},Vg.createAuthTimeNotFoundError=function(){return new Vg(mg.code,mg.desc)},Vg.createMaxAgeTranspiredError=function(){return new Vg(vg.code,vg.desc)},Vg.createNonceNotFoundError=function(e){return new Vg(yg.code,yg.desc+": "+e)},Vg.createMultipleMatchingTokensInCacheError=function(){return new Vg(_g.code,_g.desc+".")},Vg.createMultipleMatchingAccountsInCacheError=function(){return new Vg(wg.code,wg.desc)},Vg.createMultipleMatchingAppMetadataInCacheError=function(){return new Vg(bg.code,bg.desc)},Vg.createTokenRequestCannotBeMadeError=function(){return new Vg(Cg.code,Cg.desc)},Vg.createAppendEmptyScopeToSetError=function(e){return new Vg(Eg.code,Eg.desc+" Given Scope: "+e)},Vg.createRemoveEmptyScopeFromSetError=function(e){return new Vg(Sg.code,Sg.desc+" Given Scope: "+e)},Vg.createAppendScopeSetError=function(e){return new Vg(Tg.code,Tg.desc+" Detail Error: "+e)},Vg.createEmptyInputScopeSetError=function(){return new Vg(Ig.code,""+Ig.desc)},Vg.createDeviceCodeCancelledError=function(){return new Vg(Ag.code,""+Ag.desc)},Vg.createDeviceCodeExpiredError=function(){return new Vg(kg.code,""+kg.desc)},Vg.createDeviceCodeUnknownError=function(){return new Vg(Og.code,""+Og.desc)},Vg.createNoAccountInSilentRequestError=function(){return new Vg(Pg.code,""+Pg.desc)},Vg.createNullOrUndefinedCacheRecord=function(){return new Vg(xg.code,xg.desc)},Vg.createInvalidCacheEnvironmentError=function(){return new Vg(Rg.code,Rg.desc)},Vg.createNoAccountFoundError=function(){return new Vg(Mg.code,Mg.desc)},Vg.createCachePluginError=function(){return new Vg(Ng.code,""+Ng.desc)},Vg.createNoCryptoObjectError=function(e){return new Vg(Lg.code,""+Lg.desc+e)},Vg.createInvalidCacheTypeError=function(){return new Vg(Dg.code,""+Dg.desc)},Vg.createUnexpectedAccountTypeError=function(){return new Vg(qg.code,""+qg.desc)},Vg.createUnexpectedCredentialTypeError=function(){return new Vg(jg.code,""+jg.desc)},Vg.createInvalidAssertionError=function(){return new Vg(Ug.code,""+Ug.desc)},Vg.createInvalidCredentialError=function(){return new Vg(Hg.code,""+Hg.desc)},Vg.createRefreshRequiredError=function(){return new Vg(zg.code,zg.desc)},Vg.createUserTimeoutReachedError=function(){return new Vg(Bg.code,Bg.desc)},Vg.createTokenClaimsRequiredError=function(){return new Vg(Fg.code,Fg.desc)},Vg.createNoAuthCodeInServerResponseError=function(){return new Vg(Kg.code,Kg.desc)},Vg.createBindingKeyNotRemovedError=function(){return new Vg(Gg.code,Gg.desc)},Vg.createLogoutNotSupportedError=function(){return new Vg(Yg.code,Yg.desc)},Vg.createKeyIdMissingError=function(){return new Vg(Zg.code,Zg.desc)},Vg);function Vg(e,t){t=og.call(this,e,t)||this;return t.name="ClientAuthError",Object.setPrototypeOf(t,Vg.prototype),t}var Jg,Qg=(Xg.decodeAuthToken=function(e){if(Xg.isEmpty(e))throw Wg.createTokenNullOrEmptyError(e);var t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(e);if(!t||t.length<4)throw Wg.createTokenParsingError("Given token is malformed: "+JSON.stringify(e));return{header:t[1],JWSPayload:t[2],JWSSig:t[3]}},Xg.isEmpty=function(e){return void 0===e||!e||0===e.length},Xg.isEmptyObj=function(e){if(e&&!Xg.isEmpty(e))try{var t=JSON.parse(e);return 0===Object.keys(t).length}catch(e){}return!0},Xg.startsWith=function(e,t){return 0===e.indexOf(t)},Xg.endsWith=function(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length},Xg.queryStringToObject=function(e){function o(e){return decodeURIComponent(e.replace(/\+/g," "))}var r={},e=e.split("&");return e.forEach(function(e){var t;e.trim()&&(e=(t=e.split(/=(.+)/g,2))[0],t=t[1],e&&t&&(r[o(e)]=o(t)))}),r},Xg.trimArrayEntries=function(e){return e.map(function(e){return e.trim()})},Xg.removeEmptyStringsFromArray=function(e){return e.filter(function(e){return!Xg.isEmpty(e)})},Xg.jsonParseHelper=function(e){try{return JSON.parse(e)}catch(e){return null}},Xg.matchPattern=function(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)},Xg);function Xg(){}(r=Jg=Jg||{})[r.Error=0]="Error",r[r.Warning=1]="Warning",r[r.Info=2]="Info",r[r.Verbose=3]="Verbose",r[r.Trace=4]="Trace";var $g=(ey.prototype.clone=function(e,t,o){return new ey({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:o||this.correlationId},e,t)},ey.prototype.logMessage=function(e,t){var o;t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii||(o=(new Date).toUTCString(),e=(Qg.isEmpty(t.correlationId)?Qg.isEmpty(this.correlationId)?"["+o+"]":"["+o+"] : ["+this.correlationId+"]":"["+o+"] : ["+t.correlationId+"]")+" : "+this.packageName+"@"+this.packageVersion+" : "+Jg[t.logLevel]+" - "+e,this.executeCallback(t.logLevel,e,t.containsPii||!1))},ey.prototype.executeCallback=function(e,t,o){this.localCallback&&this.localCallback(e,t,o)},ey.prototype.error=function(e,t){this.logMessage(e,{logLevel:Jg.Error,containsPii:!1,correlationId:t||wf.EMPTY_STRING})},ey.prototype.errorPii=function(e,t){this.logMessage(e,{logLevel:Jg.Error,containsPii:!0,correlationId:t||wf.EMPTY_STRING})},ey.prototype.warning=function(e,t){this.logMessage(e,{logLevel:Jg.Warning,containsPii:!1,correlationId:t||wf.EMPTY_STRING})},ey.prototype.warningPii=function(e,t){this.logMessage(e,{logLevel:Jg.Warning,containsPii:!0,correlationId:t||wf.EMPTY_STRING})},ey.prototype.info=function(e,t){this.logMessage(e,{logLevel:Jg.Info,containsPii:!1,correlationId:t||wf.EMPTY_STRING})},ey.prototype.infoPii=function(e,t){this.logMessage(e,{logLevel:Jg.Info,containsPii:!0,correlationId:t||wf.EMPTY_STRING})},ey.prototype.verbose=function(e,t){this.logMessage(e,{logLevel:Jg.Verbose,containsPii:!1,correlationId:t||wf.EMPTY_STRING})},ey.prototype.verbosePii=function(e,t){this.logMessage(e,{logLevel:Jg.Verbose,containsPii:!0,correlationId:t||wf.EMPTY_STRING})},ey.prototype.trace=function(e,t){this.logMessage(e,{logLevel:Jg.Trace,containsPii:!1,correlationId:t||wf.EMPTY_STRING})},ey.prototype.tracePii=function(e,t){this.logMessage(e,{logLevel:Jg.Trace,containsPii:!0,correlationId:t||wf.EMPTY_STRING})},ey.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled||!1},ey);function ey(e,t,o){this.level=Jg.Info;this.localCallback=e.loggerCallback||function(){},this.piiLoggingEnabled=e.piiLoggingEnabled||!1,this.level="number"==typeof e.logLevel?e.logLevel:Jg.Info,this.correlationId=e.correlationId||wf.EMPTY_STRING,this.packageName=t||wf.EMPTY_STRING,this.packageVersion=o||wf.EMPTY_STRING}var ty;(w=ty=ty||{})[w.None=0]="None",w.AzurePublic="https://login.microsoftonline.com",w.AzurePpe="https://login.windows-ppe.net",w.AzureChina="https://login.chinacloudapi.cn",w.AzureGermany="https://login.microsoftonline.de",w.AzureUsGovernment="https://login.microsoftonline.us";var oy=(ry.prototype.generateAccountId=function(){return ry.generateAccountIdForCacheKey(this.homeAccountId,this.environment)},ry.prototype.generateCredentialId=function(){return ry.generateCredentialIdForCacheKey(this.credentialType,this.clientId,this.realm,this.familyId)},ry.prototype.generateTarget=function(){return ry.generateTargetForCacheKey(this.target)},ry.prototype.generateCredentialKey=function(){return ry.generateCredentialCacheKey(this.homeAccountId,this.environment,this.credentialType,this.clientId,this.realm,this.target,this.familyId,this.tokenType,this.requestedClaimsHash)},ry.prototype.generateType=function(){switch(this.credentialType){case Of.ID_TOKEN:return xf.ID_TOKEN;case Of.ACCESS_TOKEN:case Of.ACCESS_TOKEN_WITH_AUTH_SCHEME:return xf.ACCESS_TOKEN;case Of.REFRESH_TOKEN:return xf.REFRESH_TOKEN;default:throw Wg.createUnexpectedCredentialTypeError()}},ry.getCredentialType=function(e){return-1!==e.indexOf(Of.ACCESS_TOKEN.toLowerCase())?-1!==e.indexOf(Of.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())?Of.ACCESS_TOKEN_WITH_AUTH_SCHEME:Of.ACCESS_TOKEN:-1!==e.indexOf(Of.ID_TOKEN.toLowerCase())?Of.ID_TOKEN:-1!==e.indexOf(Of.REFRESH_TOKEN.toLowerCase())?Of.REFRESH_TOKEN:wf.NOT_DEFINED},ry.generateCredentialCacheKey=function(e,t,o,r,n,i,a,s,c){return[this.generateAccountIdForCacheKey(e,t),this.generateCredentialIdForCacheKey(o,r,n,a),this.generateTargetForCacheKey(i),this.generateClaimsHashForCacheKey(c),this.generateSchemeForCacheKey(s)].join(kf.CACHE_KEY_SEPARATOR).toLowerCase()},ry.generateAccountIdForCacheKey=function(e,t){return[e,t].join(kf.CACHE_KEY_SEPARATOR).toLowerCase()},ry.generateCredentialIdForCacheKey=function(e,t,o,r){return[e,e===Of.REFRESH_TOKEN&&r||t,o||wf.EMPTY_STRING].join(kf.CACHE_KEY_SEPARATOR).toLowerCase()},ry.generateTargetForCacheKey=function(e){return(e||wf.EMPTY_STRING).toLowerCase()},ry.generateClaimsHashForCacheKey=function(e){return(e||wf.EMPTY_STRING).toLowerCase()},ry.generateSchemeForCacheKey=function(e){return e&&e.toLowerCase()!==qf.BEARER.toLowerCase()?e.toLowerCase():wf.EMPTY_STRING},ry);function ry(){}var ny,iy={code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},ay={code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},sy={code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},cy={code:"authority_uri_insecure",desc:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options"},uy={code:"url_parse_error",desc:"URL could not be parsed into appropriate segments."},ly={code:"empty_url_error",desc:"URL was empty or null."},hy={code:"empty_input_scopes_error",desc:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token."},py={code:"clientid_input_scopes_error",desc:"Client ID can only be provided as a single scope."},dy={code:"invalid_prompt_value",desc:"Supported prompt values are 'login', 'select_account', 'consent', 'create', 'none' and 'no_session'. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest"},fy={code:"invalid_claims",desc:"Given claims parameter must be a stringified JSON object."},gy={code:"token_request_empty",desc:"Token request was empty and not found in cache."},yy={code:"logout_request_empty",desc:"The logout request was null or undefined."},my={code:"invalid_code_challenge_method",desc:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".'},vy={code:"pkce_params_missing",desc:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"},_y={code:"invalid_cloud_discovery_metadata",desc:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields"},wy={code:"invalid_authority_metadata",desc:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields."},by={code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."},Cy={code:"invalid_azure_cloud_instance",desc:"Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values"},Ey={code:"missing_ssh_jwk",desc:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."},Sy={code:"missing_ssh_kid",desc:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme."},Ty={code:"missing_nonce_authentication_header",desc:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce."},Iy={code:"invalid_authentication_header",desc:"Invalid authentication header provided"},Ay=(lf(ky,ny=Wg),ky.createRedirectUriEmptyError=function(){return new ky(iy.code,iy.desc)},ky.createPostLogoutRedirectUriEmptyError=function(){return new ky(ay.code,ay.desc)},ky.createClaimsRequestParsingError=function(e){return new ky(sy.code,sy.desc+" Given value: "+e)},ky.createInsecureAuthorityUriError=function(e){return new ky(cy.code,cy.desc+" Given URI: "+e)},ky.createUrlParseError=function(e){return new ky(uy.code,uy.desc+" Given Error: "+e)},ky.createUrlEmptyError=function(){return new ky(ly.code,ly.desc)},ky.createEmptyScopesArrayError=function(){return new ky(hy.code,""+hy.desc)},ky.createClientIdSingleScopeError=function(e){return new ky(py.code,py.desc+" Given Scopes: "+e)},ky.createInvalidPromptError=function(e){return new ky(dy.code,dy.desc+" Given value: "+e)},ky.createInvalidClaimsRequestError=function(){return new ky(fy.code,fy.desc)},ky.createEmptyLogoutRequestError=function(){return new ky(yy.code,yy.desc)},ky.createEmptyTokenRequestError=function(){return new ky(gy.code,gy.desc)},ky.createInvalidCodeChallengeMethodError=function(){return new ky(my.code,my.desc)},ky.createInvalidCodeChallengeParamsError=function(){return new ky(vy.code,vy.desc)},ky.createInvalidCloudDiscoveryMetadataError=function(){return new ky(_y.code,_y.desc)},ky.createInvalidAuthorityMetadataError=function(){return new ky(wy.code,wy.desc)},ky.createUntrustedAuthorityError=function(){return new ky(by.code,by.desc)},ky.createInvalidAzureCloudInstanceError=function(){return new ky(Cy.code,Cy.desc)},ky.createMissingSshJwkError=function(){return new ky(Ey.code,Ey.desc)},ky.createMissingSshKidError=function(){return new ky(Sy.code,Sy.desc)},ky.createMissingNonceAuthenticationHeadersError=function(){return new ky(Ty.code,Ty.desc)},ky.createInvalidAuthenticationHeaderError=function(e,t){return new ky(Iy.code,Iy.desc+". Invalid header: "+e+". Details: "+t)},ky);function ky(e,t){t=ny.call(this,e,t)||this;return t.name="ClientConfigurationError",Object.setPrototypeOf(t,ky.prototype),t}var Oy,Py=(xy.fromString=function(e){return new xy((e||wf.EMPTY_STRING).split(" "))},xy.prototype.validateInputScopes=function(e){if(!e||e.length<1)throw Ay.createEmptyScopesArrayError()},xy.prototype.containsScope=function(e){var t=new xy(this.printScopesLowerCase().split(" "));return!Qg.isEmpty(e)&&t.scopes.has(e.toLowerCase())},xy.prototype.containsScopeSet=function(e){var t=this;return!(!e||e.scopes.size<=0)&&(this.scopes.size>=e.scopes.size&&e.asArray().every(function(e){return t.containsScope(e)}))},xy.prototype.containsOnlyOIDCScopes=function(){var t=this,o=0;return Cf.forEach(function(e){t.containsScope(e)&&(o+=1)}),this.scopes.size===o},xy.prototype.appendScope=function(e){Qg.isEmpty(e)||this.scopes.add(e.trim())},xy.prototype.appendScopes=function(e){var t=this;try{e.forEach(function(e){return t.appendScope(e)})}catch(e){throw Wg.createAppendScopeSetError(e)}},xy.prototype.removeScope=function(e){if(Qg.isEmpty(e))throw Wg.createRemoveEmptyScopeFromSetError(e);this.scopes.delete(e.trim())},xy.prototype.removeOIDCScopes=function(){var t=this;Cf.forEach(function(e){t.scopes.delete(e)})},xy.prototype.unionScopeSets=function(e){if(!e)throw Wg.createEmptyInputScopeSetError();var t=new Set;return e.scopes.forEach(function(e){return t.add(e.toLowerCase())}),this.scopes.forEach(function(e){return t.add(e.toLowerCase())}),t},xy.prototype.intersectingScopeSets=function(e){if(!e)throw Wg.createEmptyInputScopeSetError();e.containsOnlyOIDCScopes()||e.removeOIDCScopes();var t=this.unionScopeSets(e),o=e.getScopeCount(),e=this.getScopeCount();return t.size<e+o},xy.prototype.getScopeCount=function(){return this.scopes.size},xy.prototype.asArray=function(){var t=[];return this.scopes.forEach(function(e){return t.push(e)}),t},xy.prototype.printScopes=function(){return this.scopes?this.asArray().join(" "):wf.EMPTY_STRING},xy.prototype.printScopesLowerCase=function(){return this.printScopes().toLowerCase()},xy);function xy(e){var t=this,e=e?Qg.trimArrayEntries(ff(e)):[],e=e?Qg.removeEmptyStringsFromArray(e):[];this.validateInputScopes(e),this.scopes=new Set,e.forEach(function(e){return t.scopes.add(e)})}function Ry(e,t){if(Qg.isEmpty(e))throw Wg.createClientInfoEmptyError();try{var o=t.base64Decode(e);return JSON.parse(o)}catch(e){throw Wg.createClientInfoDecodingError(e.message)}}function My(e){if(Qg.isEmpty(e))throw Wg.createClientInfoDecodingError("Home account ID was empty.");e=e.split(kf.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?wf.EMPTY_STRING:e[1]}}(r=Oy=Oy||{})[r.Default=0]="Default",r[r.Adfs=1]="Adfs",r[r.Dsts=2]="Dsts";var Ny=(Ly.prototype.generateAccountId=function(){return[this.homeAccountId,this.environment].join(kf.CACHE_KEY_SEPARATOR).toLowerCase()},Ly.prototype.generateAccountKey=function(){return Ly.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})},Ly.prototype.generateType=function(){switch(this.authorityType){case Af.ADFS_ACCOUNT_TYPE:return xf.ADFS;case Af.MSAV1_ACCOUNT_TYPE:return xf.MSA;case Af.MSSTS_ACCOUNT_TYPE:return xf.MSSTS;case Af.GENERIC_ACCOUNT_TYPE:return xf.GENERIC;default:throw Wg.createUnexpectedAccountTypeError()}},Ly.prototype.getAccountInfo=function(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,idTokenClaims:this.idTokenClaims,nativeAccountId:this.nativeAccountId}},Ly.generateAccountCacheKey=function(e){return[e.homeAccountId,e.environment||wf.EMPTY_STRING,e.tenantId||wf.EMPTY_STRING].join(kf.CACHE_KEY_SEPARATOR).toLowerCase()},Ly.createAccount=function(e,t,o,r,n,i,a,s){var c=new Ly;c.authorityType=Af.MSSTS_ACCOUNT_TYPE,c.clientInfo=e,c.homeAccountId=t,c.nativeAccountId=s;var u,r=a||r&&r.getPreferredCache();if(!r)throw Wg.createInvalidCacheEnvironmentError();return c.environment=r,c.realm=(null===(r=null==o?void 0:o.claims)||void 0===r?void 0:r.tid)||wf.EMPTY_STRING,o&&(c.idTokenClaims=o.claims,c.localAccountId=(null===(r=null==o?void 0:o.claims)||void 0===r?void 0:r.oid)||(null===(u=null==o?void 0:o.claims)||void 0===u?void 0:u.sub)||wf.EMPTY_STRING,u=null===(r=null==o?void 0:o.claims)||void 0===r?void 0:r.preferred_username,r=null!==(r=null==o?void 0:o.claims)&&void 0!==r&&r.emails?o.claims.emails[0]:null,c.username=u||r||wf.EMPTY_STRING,c.name=null===(o=null==o?void 0:o.claims)||void 0===o?void 0:o.name),c.cloudGraphHostName=n,c.msGraphHost=i,c},Ly.createGenericAccount=function(e,t,o,r,n,i){var a,s=new Ly;s.authorityType=o&&o.authorityType===Oy.Adfs?Af.ADFS_ACCOUNT_TYPE:Af.GENERIC_ACCOUNT_TYPE,s.homeAccountId=e,s.realm=wf.EMPTY_STRING;i=i||o&&o.getPreferredCache();if(!i)throw Wg.createInvalidCacheEnvironmentError();return t&&(s.localAccountId=(null===(o=null==t?void 0:t.claims)||void 0===o?void 0:o.oid)||(null===(a=null==t?void 0:t.claims)||void 0===a?void 0:a.sub)||wf.EMPTY_STRING,s.username=(null===(a=null==t?void 0:t.claims)||void 0===a?void 0:a.upn)||wf.EMPTY_STRING,s.name=(null===(a=null==t?void 0:t.claims)||void 0===a?void 0:a.name)||wf.EMPTY_STRING,s.idTokenClaims=null==t?void 0:t.claims),s.environment=i,s.cloudGraphHostName=r,s.msGraphHost=n,s},Ly.generateHomeAccountId=function(e,t,o,r,n){var i,n=null!==(i=null==n?void 0:n.claims)&&void 0!==i&&i.sub?n.claims.sub:wf.EMPTY_STRING;if(t===Oy.Adfs||t===Oy.Dsts)return n;if(e)try{var a=Ry(e,r);if(!Qg.isEmpty(a.uid)&&!Qg.isEmpty(a.utid))return""+a.uid+kf.CLIENT_INFO_SEPARATOR+a.utid}catch(e){}return o.verbose("No client info in response"),n},Ly.isAccountEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"))},Ly.accountInfoIsEqual=function(e,t,o){if(!e||!t)return!1;var r,n=!0;return o&&(r=e.idTokenClaims||{},o=t.idTokenClaims||{},n=r.iat===o.iat&&r.nonce===o.nonce),e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&e.nativeAccountId===t.nativeAccountId&&n},Ly);function Ly(){}var Dy=(qy.extractTokenClaims=function(e,t){e=Qg.decodeAuthToken(e);try{var o=e.JWSPayload,r=t.base64Decode(o);return JSON.parse(r)}catch(e){throw Wg.createTokenParsingError(e)}},qy.checkMaxAge=function(e,t){if(0===t||Date.now()-3e5>e+t)throw Wg.createMaxAgeTranspiredError()},qy);function qy(e,t){if(Qg.isEmpty(e))throw Wg.createTokenNullOrEmptyError(e);this.rawToken=e,this.claims=qy.extractTokenClaims(e,t)}var jy=(Uy.prototype.getAllAccounts=function(){var o=this,t=this.getAccountsFilteredBy(),e=Object.keys(t).map(function(e){return t[e]});return e.length<1?[]:e.map(function(e){var t=Uy.toObject(new Ny,e).getAccountInfo(),e=o.readIdTokenFromCache(o.clientId,t);return e&&!t.idTokenClaims&&(t.idToken=e.secret,t.idTokenClaims=new Dy(e.secret,o.cryptoImpl).claims),t})},Uy.prototype.saveCacheRecord=function(t){return pf(this,void 0,void 0,function(){return df(this,function(e){switch(e.label){case 0:if(!t)throw Wg.createNullOrUndefinedCacheRecord();return t.account&&this.setAccount(t.account),t.idToken&&this.setIdTokenCredential(t.idToken),t.accessToken?[4,this.saveAccessToken(t.accessToken)]:[3,2];case 1:e.sent(),e.label=2;case 2:return t.refreshToken&&this.setRefreshTokenCredential(t.refreshToken),t.appMetadata&&this.setAppMetadata(t.appMetadata),[2]}})})},Uy.prototype.saveAccessToken=function(a){return pf(this,void 0,void 0,function(){var t,o,r,n,i=this;return df(this,function(e){switch(e.label){case 0:return(t=this.getCredentialsFilteredBy({clientId:a.clientId,credentialType:a.credentialType,environment:a.environment,homeAccountId:a.homeAccountId,realm:a.realm,tokenType:a.tokenType,requestedClaimsHash:a.requestedClaimsHash}),o=Py.fromString(a.target),r=Object.keys(t.accessTokens).map(function(e){return t.accessTokens[e]}))?(n=[],r.forEach(function(e){Py.fromString(e.target).intersectingScopeSets(o)&&n.push(i.removeCredential(e))}),[4,Promise.all(n)]):[3,2];case 1:e.sent(),e.label=2;case 2:return this.setAccessTokenCredential(a),[2]}})})},Uy.prototype.getAccountsFilteredBy=function(e){return this.getAccountsFilteredByInternal(e?e.homeAccountId:wf.EMPTY_STRING,e?e.environment:wf.EMPTY_STRING,e?e.realm:wf.EMPTY_STRING,e?e.nativeAccountId:wf.EMPTY_STRING)},Uy.prototype.getAccountsFilteredByInternal=function(o,r,n,i){var a=this,e=this.getKeys(),s={};return e.forEach(function(e){var t=a.getAccount(e);t&&(o&&!a.matchHomeAccountId(t,o)||r&&!a.matchEnvironment(t,r)||n&&!a.matchRealm(t,n)||i&&!a.matchNativeAccountId(t,i)||(s[e]=t))}),s},Uy.prototype.getCredentialsFilteredBy=function(e){return this.getCredentialsFilteredByInternal(e.homeAccountId,e.environment,e.credentialType,e.clientId,e.familyId,e.realm,e.target,e.userAssertionHash,e.tokenType,e.keyId,e.requestedClaimsHash)},Uy.prototype.getCredentialsFilteredByInternal=function(n,i,a,s,c,u,l,h,p,d,f){var g=this,e=this.getKeys(),y={idTokens:{},accessTokens:{},refreshTokens:{}};return e.forEach(function(e){var t=oy.getCredentialType(e);if(t!==wf.NOT_DEFINED){var o=g.getSpecificCredential(e,t);if(o&&(!h||g.matchUserAssertionHash(o,h))&&("string"!=typeof n||g.matchHomeAccountId(o,n))&&(!i||g.matchEnvironment(o,i))&&(!u||g.matchRealm(o,u))&&(!a||g.matchCredentialType(o,a))&&(!s||g.matchClientId(o,s))&&(!c||g.matchFamilyId(o,c))&&(!l||g.matchTarget(o,l))&&(!f&&!o.requestedClaimsHash||o.requestedClaimsHash===f)){if(a===Of.ACCESS_TOKEN_WITH_AUTH_SCHEME){if(p&&!g.matchTokenType(o,p))return;if(p===qf.SSH&&d&&!g.matchKeyId(o,d))return}var r=g.updateCredentialCacheKey(e,o);switch(t){case Of.ID_TOKEN:y.idTokens[r]=o;break;case Of.ACCESS_TOKEN:case Of.ACCESS_TOKEN_WITH_AUTH_SCHEME:y.accessTokens[r]=o;break;case Of.REFRESH_TOKEN:y.refreshTokens[r]=o}}}}),y},Uy.prototype.getAppMetadataFilteredBy=function(e){return this.getAppMetadataFilteredByInternal(e.environment,e.clientId)},Uy.prototype.getAppMetadataFilteredByInternal=function(o,r){var n=this,e=this.getKeys(),i={};return e.forEach(function(e){var t;!n.isAppMetadata(e)||(t=n.getAppMetadata(e))&&(o&&!n.matchEnvironment(t,o)||r&&!n.matchClientId(t,r)||(i[e]=t))}),i},Uy.prototype.getAuthorityMetadataByAlias=function(t){var o=this,e=this.getAuthorityMetadataKeys(),r=null;return e.forEach(function(e){!o.isAuthorityMetadata(e)||-1===e.indexOf(o.clientId)||(e=o.getAuthorityMetadata(e))&&-1!==e.aliases.indexOf(t)&&(r=e)}),r},Uy.prototype.removeAllAccounts=function(){return pf(this,void 0,void 0,function(){var t,o,r=this;return df(this,function(e){switch(e.label){case 0:return t=this.getKeys(),o=[],t.forEach(function(e){r.getAccount(e)&&o.push(r.removeAccount(e))}),[4,Promise.all(o)];case 1:return e.sent(),[2,!0]}})})},Uy.prototype.removeAccount=function(o){return pf(this,void 0,void 0,function(){var t;return df(this,function(e){switch(e.label){case 0:if(!(t=this.getAccount(o)))throw Wg.createNoAccountFoundError();return[4,this.removeAccountContext(t)];case 1:return[2,e.sent()&&this.removeItem(o,Pf.ACCOUNT)]}})})},Uy.prototype.removeAccountContext=function(i){return pf(this,void 0,void 0,function(){var t,o,r,n=this;return df(this,function(e){switch(e.label){case 0:return t=this.getKeys(),o=i.generateAccountId(),r=[],t.forEach(function(e){var t=oy.getCredentialType(e);t===wf.NOT_DEFINED||(t=n.getSpecificCredential(e,t))&&o===t.generateAccountId()&&r.push(n.removeCredential(t))}),[4,Promise.all(r)];case 1:return e.sent(),[2,!0]}})})},Uy.prototype.removeCredential=function(r){return pf(this,void 0,void 0,function(){var t,o;return df(this,function(e){switch(e.label){case 0:if(t=r.generateCredentialKey(),r.credentialType.toLowerCase()!==Of.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())return[3,4];if(r.tokenType!==qf.POP)return[3,4];if(!(o=r.keyId))return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.cryptoImpl.removeTokenBindingKey(o)];case 2:return e.sent(),[3,4];case 3:throw e.sent(),Wg.createBindingKeyNotRemovedError();case 4:return[2,this.removeItem(t,Pf.CREDENTIAL)]}})})},Uy.prototype.removeAppMetadata=function(){var t=this;return this.getKeys().forEach(function(e){t.isAppMetadata(e)&&t.removeItem(e,Pf.APP_METADATA)}),!0},Uy.prototype.readCacheRecord=function(e,t,o,r){var n=this.readAccountFromCache(e),i=this.readIdTokenFromCache(t,e),o=this.readAccessTokenFromCache(t,e,o),e=this.readRefreshTokenFromCache(t,e,!1),t=this.readAppMetadataFromCache(r,t);return n&&i&&(n.idTokenClaims=new Dy(i.secret,this.cryptoImpl).claims),{account:n,idToken:i,accessToken:o,refreshToken:e,appMetadata:t}},Uy.prototype.readAccountFromCache=function(e){e=Ny.generateAccountCacheKey(e);return this.getAccount(e)},Uy.prototype.readAccountFromCacheWithNativeAccountId=function(e){var t=this.getAccountsFilteredBy({nativeAccountId:e}),e=Object.keys(t).map(function(e){return t[e]});if(e.length<1)return null;if(1<e.length)throw Wg.createMultipleMatchingAccountsInCacheError();return t[0]},Uy.prototype.readIdTokenFromCache=function(e,t){var e={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:Of.ID_TOKEN,clientId:e,realm:t.tenantId},o=this.getCredentialsFilteredBy(e),t=Object.keys(o.idTokens).map(function(e){return o.idTokens[e]}),e=t.length;if(e<1)return null;if(1<e)throw Wg.createMultipleMatchingTokensInCacheError();return t[0]},Uy.prototype.readAccessTokenFromCache=function(e,t,o){var r=new Py(o.scopes||[]),n=o.authenticationScheme||qf.BEARER,i=n&&n.toLowerCase()!==qf.BEARER.toLowerCase()?Of.ACCESS_TOKEN_WITH_AUTH_SCHEME:Of.ACCESS_TOKEN,n={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:i,clientId:e,realm:t.tenantId,target:r.printScopesLowerCase(),tokenType:n,keyId:o.sshKid,requestedClaimsHash:o.requestedClaimsHash},a=this.getCredentialsFilteredBy(n),o=Object.keys(a.accessTokens).map(function(e){return a.accessTokens[e]}),n=o.length;if(n<1)return null;if(1<n)throw Wg.createMultipleMatchingTokensInCacheError();return o[0]},Uy.prototype.readRefreshTokenFromCache=function(e,t,o){var o={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:Of.REFRESH_TOKEN,clientId:e,familyId:o?"1":void 0},r=this.getCredentialsFilteredBy(o),o=Object.keys(r.refreshTokens).map(function(e){return r.refreshTokens[e]});return o.length<1?null:o[0]},Uy.prototype.readAppMetadataFromCache=function(e,t){var o=this.getAppMetadataFilteredBy({environment:e,clientId:t}),e=Object.keys(o).map(function(e){return o[e]}),t=e.length;if(t<1)return null;if(1<t)throw Wg.createMultipleMatchingAppMetadataInCacheError();return e[0]},Uy.prototype.isAppMetadataFOCI=function(e,t){t=this.readAppMetadataFromCache(e,t);return!(!t||"1"!==t.familyId)},Uy.prototype.matchHomeAccountId=function(e,t){return!("string"!=typeof e.homeAccountId||t!==e.homeAccountId)},Uy.prototype.matchUserAssertionHash=function(e,t){return!(!e.userAssertionHash||t!==e.userAssertionHash)},Uy.prototype.matchEnvironment=function(e,t){t=this.getAuthorityMetadataByAlias(t);return!!(t&&-1<t.aliases.indexOf(e.environment))},Uy.prototype.matchCredentialType=function(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()},Uy.prototype.matchClientId=function(e,t){return!(!e.clientId||t!==e.clientId)},Uy.prototype.matchFamilyId=function(e,t){return!(!e.familyId||t!==e.familyId)},Uy.prototype.matchRealm=function(e,t){return!(!e.realm||t!==e.realm)},Uy.prototype.matchNativeAccountId=function(e,t){return!(!e.nativeAccountId||t!==e.nativeAccountId)},Uy.prototype.matchTarget=function(e,t){if(e.credentialType!==Of.ACCESS_TOKEN&&e.credentialType!==Of.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target)return!1;e=Py.fromString(e.target),t=Py.fromString(t);return t.containsOnlyOIDCScopes()?t.removeScope(wf.OFFLINE_ACCESS_SCOPE):t.removeOIDCScopes(),e.containsScopeSet(t)},Uy.prototype.matchTokenType=function(e,t){return!(!e.tokenType||e.tokenType!==t)},Uy.prototype.matchKeyId=function(e,t){return!(!e.keyId||e.keyId!==t)},Uy.prototype.isAppMetadata=function(e){return-1!==e.indexOf(Nf)},Uy.prototype.isAuthorityMetadata=function(e){return-1!==e.indexOf(Lf)},Uy.prototype.generateAuthorityMetadataCacheKey=function(e){return Lf+"-"+this.clientId+"-"+e},Uy.prototype.getSpecificCredential=function(e,t){switch(t){case Of.ID_TOKEN:return this.getIdTokenCredential(e);case Of.ACCESS_TOKEN:case Of.ACCESS_TOKEN_WITH_AUTH_SCHEME:return this.getAccessTokenCredential(e);case Of.REFRESH_TOKEN:return this.getRefreshTokenCredential(e);default:return null}},Uy.toObject=function(e,t){for(var o in t)e[o]=t[o];return e},Uy);function Uy(e,t){this.clientId=e,this.cryptoImpl=t}var Hy,zy=(lf(By,Hy=jy),By.prototype.setAccount=function(){throw eg.createUnexpectedError("Storage interface - setAccount() has not been implemented for the cacheStorage interface.")},By.prototype.getAccount=function(){throw eg.createUnexpectedError("Storage interface - getAccount() has not been implemented for the cacheStorage interface.")},By.prototype.setIdTokenCredential=function(){throw eg.createUnexpectedError("Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.")},By.prototype.getIdTokenCredential=function(){throw eg.createUnexpectedError("Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.")},By.prototype.setAccessTokenCredential=function(){throw eg.createUnexpectedError("Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.")},By.prototype.getAccessTokenCredential=function(){throw eg.createUnexpectedError("Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.")},By.prototype.setRefreshTokenCredential=function(){throw eg.createUnexpectedError("Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.")},By.prototype.getRefreshTokenCredential=function(){throw eg.createUnexpectedError("Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.")},By.prototype.setAppMetadata=function(){throw eg.createUnexpectedError("Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.")},By.prototype.getAppMetadata=function(){throw eg.createUnexpectedError("Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.")},By.prototype.setServerTelemetry=function(){throw eg.createUnexpectedError("Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.")},By.prototype.getServerTelemetry=function(){throw eg.createUnexpectedError("Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.")},By.prototype.setAuthorityMetadata=function(){throw eg.createUnexpectedError("Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.")},By.prototype.getAuthorityMetadata=function(){throw eg.createUnexpectedError("Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.")},By.prototype.getAuthorityMetadataKeys=function(){throw eg.createUnexpectedError("Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.")},By.prototype.setThrottlingCache=function(){throw eg.createUnexpectedError("Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.")},By.prototype.getThrottlingCache=function(){throw eg.createUnexpectedError("Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.")},By.prototype.removeItem=function(){throw eg.createUnexpectedError("Storage interface - removeItem() has not been implemented for the cacheStorage interface.")},By.prototype.containsKey=function(){throw eg.createUnexpectedError("Storage interface - containsKey() has not been implemented for the cacheStorage interface.")},By.prototype.getKeys=function(){throw eg.createUnexpectedError("Storage interface - getKeys() has not been implemented for the cacheStorage interface.")},By.prototype.clear=function(){return pf(this,void 0,void 0,function(){return df(this,function(e){throw eg.createUnexpectedError("Storage interface - clear() has not been implemented for the cacheStorage interface.")})})},By.prototype.updateCredentialCacheKey=function(){throw eg.createUnexpectedError("Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.")},By);function By(){return null!==Hy&&Hy.apply(this,arguments)||this}var Fy={tokenRenewalOffsetSeconds:300,preventCorsPreflight:!1,proxyUrl:wf.EMPTY_STRING},Ky={loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:Jg.Info,correlationId:wf.EMPTY_STRING},Gy={sendGetRequestAsync:function(){return pf(this,void 0,void 0,function(){return df(this,function(e){throw eg.createUnexpectedError("Network interface - sendGetRequestAsync() has not been implemented")})})},sendPostRequestAsync:function(){return pf(this,void 0,void 0,function(){return df(this,function(e){throw eg.createUnexpectedError("Network interface - sendPostRequestAsync() has not been implemented")})})}},Yy={sku:wf.SKU,version:"9.0.1",cpu:wf.EMPTY_STRING,os:wf.EMPTY_STRING},Zy={clientSecret:wf.EMPTY_STRING,clientAssertion:void 0},Wy={azureCloudInstance:ty.None,tenant:""+wf.DEFAULT_COMMON_TENANT},Vy={application:{appName:"",appVersion:""}};function Jy(e){var t=e.authOptions,o=e.systemOptions,r=e.loggerOptions,n=e.storageInterface,i=e.networkInterface,a=e.cryptoInterface,s=e.clientCredentials,c=e.libraryInfo,u=e.telemetry,l=e.serverTelemetryManager,h=e.persistencePlugin,e=e.serializableCache,r=hf(hf({},Ky),r);return{authOptions:hf({clientCapabilities:[],azureCloudOptions:Wy,skipAuthorityMetadataCache:!1},t),systemOptions:hf(hf({},Fy),o),loggerOptions:r,storageInterface:n||new zy(t.clientId,rg),networkInterface:i||Gy,cryptoInterface:a||rg,clientCredentials:s||Zy,libraryInfo:hf(hf({},Yy),c),telemetry:hf(hf({},Vy),u),serverTelemetryManager:l||null,persistencePlugin:h||null,serializableCache:e||null}}var Qy,Xy=(lf($y,Qy=eg),$y);function $y(e,t,o){o=Qy.call(this,e,t,o)||this;return o.name="ServerError",Object.setPrototypeOf(o,$y.prototype),o}var em=(tm.generateThrottlingStorageKey=function(e){return Zf+"."+JSON.stringify(e)},tm.preProcess=function(e,t){var o=tm.generateThrottlingStorageKey(t),r=e.getThrottlingCache(o);if(r){if(!(r.throttleTime<Date.now()))throw new Xy((null===(t=r.errorCodes)||void 0===t?void 0:t.join(" "))||wf.EMPTY_STRING,r.errorMessage,r.subError);e.removeItem(o,Pf.THROTTLING)}},tm.postProcess=function(e,t,o){(tm.checkResponseStatus(o)||tm.checkResponseForRetryAfter(o))&&(o={throttleTime:tm.calculateThrottleTime(parseInt(o.headers[gf.RETRY_AFTER])),error:o.body.error,errorCodes:o.body.error_codes,errorMessage:o.body.error_description,subError:o.body.suberror},e.setThrottlingCache(tm.generateThrottlingStorageKey(t),o))},tm.checkResponseStatus=function(e){return 429===e.status||500<=e.status&&e.status<600},tm.checkResponseForRetryAfter=function(e){return!!e.headers&&(e.headers.hasOwnProperty(gf.RETRY_AFTER)&&(e.status<200||300<=e.status))},tm.calculateThrottleTime=function(e){var t=e<=0?0:e,e=Date.now()/1e3;return Math.floor(1e3*Math.min(e+(t||Gf),e+Yf))},tm.removeThrottle=function(e,t,o,r){o={clientId:t,authority:o.authority,scopes:o.scopes,homeAccountIdentifier:r,claims:o.claims,authenticationScheme:o.authenticationScheme,resourceRequestMethod:o.resourceRequestMethod,resourceRequestUri:o.resourceRequestUri,shrClaims:o.shrClaims,sshKid:o.sshKid},o=this.generateThrottlingStorageKey(o);return e.removeItem(o,Pf.THROTTLING)},tm);function tm(){}var om,rm=(nm.prototype.sendPostRequest=function(r,n,i){return pf(this,void 0,void 0,function(){var t,o;return df(this,function(e){switch(e.label){case 0:em.preProcess(this.cacheManager,r),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.networkClient.sendPostRequestAsync(n,i)];case 2:return t=e.sent(),[3,4];case 3:throw(o=e.sent())instanceof eg?o:Wg.createNetworkError(n,o);case 4:return em.postProcess(this.cacheManager,r,t),[2,t]}})})},nm);function nm(e,t){this.networkClient=e,this.cacheManager=t}(w=om=om||{}).HOME_ACCOUNT_ID="home_account_id",w.UPN="UPN";im.prototype.createTokenRequestHeaders=function(e){var t={};if(t[gf.CONTENT_TYPE]=wf.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case om.HOME_ACCOUNT_ID:try{var o=My(e.credential);t[gf.CCS_HEADER]="Oid:"+o.uid+"@"+o.utid}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case om.UPN:t[gf.CCS_HEADER]="UPN: "+e.credential}return t},im.prototype.executePostToTokenEndpoint=function(o,r,n,i){return pf(this,void 0,void 0,function(){var t;return df(this,function(e){switch(e.label){case 0:return[4,this.networkManager.sendPostRequest(i,o,{body:r,headers:n,proxyUrl:this.config.systemOptions.proxyUrl})];case 1:return t=e.sent(),this.config.serverTelemetryManager&&t.status<500&&429!==t.status&&this.config.serverTelemetryManager.clearTelemetryCache(),[2,t]}})})},im.prototype.updateAuthority=function(e){if(!e.discoveryComplete())throw Wg.createEndpointDiscoveryIncompleteError("Updated authority has not completed endpoint discovery.");this.authority=e},r=im;function im(e,t){this.config=Jy(e),this.logger=new $g(this.config.loggerOptions,"@azure/msal-common","9.0.1"),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new rm(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}var am=(sm.validateRedirectUri=function(e){if(Qg.isEmpty(e))throw Ay.createRedirectUriEmptyError()},sm.validatePrompt=function(e){var t,o=[];for(t in Sf)o.push(Sf[t]);if(o.indexOf(e)<0)throw Ay.createInvalidPromptError(e)},sm.validateClaims=function(e){try{JSON.parse(e)}catch(e){throw Ay.createInvalidClaimsRequestError()}},sm.validateCodeChallengeParams=function(e,t){if(Qg.isEmpty(e)||Qg.isEmpty(t))throw Ay.createInvalidCodeChallengeParamsError();this.validateCodeChallengeMethod(t)},sm.validateCodeChallengeMethod=function(e){if([Rf.PLAIN,Rf.S256].indexOf(e)<0)throw Ay.createInvalidCodeChallengeMethodError()},sm.sanitizeEQParams=function(o,e){return o?(e.forEach(function(e,t){o[t]&&delete o[t]}),o):{}},sm);function sm(){}var cm=(um.prototype.addResponseTypeCode=function(){this.parameters.set(vf.RESPONSE_TYPE,encodeURIComponent(wf.CODE_RESPONSE_TYPE))},um.prototype.addResponseTypeForTokenAndIdToken=function(){this.parameters.set(vf.RESPONSE_TYPE,encodeURIComponent(wf.TOKEN_RESPONSE_TYPE+" "+wf.ID_TOKEN_RESPONSE_TYPE))},um.prototype.addResponseMode=function(e){this.parameters.set(vf.RESPONSE_MODE,encodeURIComponent(e||Tf.QUERY))},um.prototype.addNativeBroker=function(){this.parameters.set(vf.NATIVE_BROKER,encodeURIComponent("1"))},um.prototype.addScopes=function(e,t){e=(t=void 0===t?!0:t)?ff(e||[],bf):e||[],e=new Py(e);this.parameters.set(vf.SCOPE,encodeURIComponent(e.printScopes()))},um.prototype.addClientId=function(e){this.parameters.set(vf.CLIENT_ID,encodeURIComponent(e))},um.prototype.addRedirectUri=function(e){am.validateRedirectUri(e),this.parameters.set(vf.REDIRECT_URI,encodeURIComponent(e))},um.prototype.addPostLogoutRedirectUri=function(e){am.validateRedirectUri(e),this.parameters.set(vf.POST_LOGOUT_URI,encodeURIComponent(e))},um.prototype.addIdTokenHint=function(e){this.parameters.set(vf.ID_TOKEN_HINT,encodeURIComponent(e))},um.prototype.addDomainHint=function(e){this.parameters.set(Ef.DOMAIN_HINT,encodeURIComponent(e))},um.prototype.addLoginHint=function(e){this.parameters.set(Ef.LOGIN_HINT,encodeURIComponent(e))},um.prototype.addCcsUpn=function(e){this.parameters.set(gf.CCS_HEADER,encodeURIComponent("UPN:"+e))},um.prototype.addCcsOid=function(e){this.parameters.set(gf.CCS_HEADER,encodeURIComponent("Oid:"+e.uid+"@"+e.utid))},um.prototype.addSid=function(e){this.parameters.set(Ef.SID,encodeURIComponent(e))},um.prototype.addClaims=function(e,t){t=this.addClientCapabilitiesToClaims(e,t);am.validateClaims(t),this.parameters.set(vf.CLAIMS,encodeURIComponent(t))},um.prototype.addCorrelationId=function(e){this.parameters.set(vf.CLIENT_REQUEST_ID,encodeURIComponent(e))},um.prototype.addLibraryInfo=function(e){this.parameters.set(vf.X_CLIENT_SKU,e.sku),this.parameters.set(vf.X_CLIENT_VER,e.version),e.os&&this.parameters.set(vf.X_CLIENT_OS,e.os),e.cpu&&this.parameters.set(vf.X_CLIENT_CPU,e.cpu)},um.prototype.addApplicationTelemetry=function(e){null!=e&&e.appName&&this.parameters.set(vf.X_APP_NAME,e.appName),null!=e&&e.appVersion&&this.parameters.set(vf.X_APP_VER,e.appVersion)},um.prototype.addPrompt=function(e){am.validatePrompt(e),this.parameters.set(""+vf.PROMPT,encodeURIComponent(e))},um.prototype.addState=function(e){Qg.isEmpty(e)||this.parameters.set(vf.STATE,encodeURIComponent(e))},um.prototype.addNonce=function(e){this.parameters.set(vf.NONCE,encodeURIComponent(e))},um.prototype.addCodeChallengeParams=function(e,t){if(am.validateCodeChallengeParams(e,t),!e||!t)throw Ay.createInvalidCodeChallengeParamsError();this.parameters.set(vf.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(vf.CODE_CHALLENGE_METHOD,encodeURIComponent(t))},um.prototype.addAuthorizationCode=function(e){this.parameters.set(vf.CODE,encodeURIComponent(e))},um.prototype.addDeviceCode=function(e){this.parameters.set(vf.DEVICE_CODE,encodeURIComponent(e))},um.prototype.addRefreshToken=function(e){this.parameters.set(vf.REFRESH_TOKEN,encodeURIComponent(e))},um.prototype.addCodeVerifier=function(e){this.parameters.set(vf.CODE_VERIFIER,encodeURIComponent(e))},um.prototype.addClientSecret=function(e){this.parameters.set(vf.CLIENT_SECRET,encodeURIComponent(e))},um.prototype.addClientAssertion=function(e){Qg.isEmpty(e)||this.parameters.set(vf.CLIENT_ASSERTION,encodeURIComponent(e))},um.prototype.addClientAssertionType=function(e){Qg.isEmpty(e)||this.parameters.set(vf.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))},um.prototype.addOboAssertion=function(e){this.parameters.set(vf.OBO_ASSERTION,encodeURIComponent(e))},um.prototype.addRequestTokenUse=function(e){this.parameters.set(vf.REQUESTED_TOKEN_USE,encodeURIComponent(e))},um.prototype.addGrantType=function(e){this.parameters.set(vf.GRANT_TYPE,encodeURIComponent(e))},um.prototype.addClientInfo=function(){this.parameters.set("client_info","1")},um.prototype.addExtraQueryParameters=function(t){var o=this;am.sanitizeEQParams(t,this.parameters),Object.keys(t).forEach(function(e){o.parameters.set(e,t[e])})},um.prototype.addClientCapabilitiesToClaims=function(e,t){var o;if(e)try{o=JSON.parse(e)}catch(e){throw Ay.createInvalidClaimsRequestError()}else o={};return t&&0<t.length&&(o.hasOwnProperty(_f.ACCESS_TOKEN)||(o[_f.ACCESS_TOKEN]={}),o[_f.ACCESS_TOKEN][_f.XMS_CC]={values:t}),JSON.stringify(o)},um.prototype.addUsername=function(e){this.parameters.set(Uf.username,encodeURIComponent(e))},um.prototype.addPassword=function(e){this.parameters.set(Uf.password,encodeURIComponent(e))},um.prototype.addPopToken=function(e){Qg.isEmpty(e)||(this.parameters.set(vf.TOKEN_TYPE,qf.POP),this.parameters.set(vf.REQ_CNF,encodeURIComponent(e)))},um.prototype.addSshJwk=function(e){Qg.isEmpty(e)||(this.parameters.set(vf.TOKEN_TYPE,qf.SSH),this.parameters.set(vf.REQ_CNF,encodeURIComponent(e)))},um.prototype.addServerTelemetry=function(e){this.parameters.set(vf.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(vf.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())},um.prototype.addThrottling=function(){this.parameters.set(vf.X_MS_LIB_CAPABILITY,Wf)},um.prototype.addLogoutHint=function(e){this.parameters.set(vf.LOGOUT_HINT,encodeURIComponent(e))},um.prototype.createQueryString=function(){var o=new Array;return this.parameters.forEach(function(e,t){o.push(t+"="+e)}),o.join("&")},um);function um(){this.parameters=new Map}var lm,hm=(lf(pm,lm=oy),pm.createIdTokenEntity=function(e,t,o,r,n){var i=new pm;return i.credentialType=Of.ID_TOKEN,i.homeAccountId=e,i.environment=t,i.clientId=r,i.secret=o,i.realm=n,i},pm.isIdTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===Of.ID_TOKEN)},pm);function pm(){return null!==lm&&lm.apply(this,arguments)||this}var dm=(fm.nowSeconds=function(){return Math.round((new Date).getTime()/1e3)},fm.isTokenExpired=function(e,t){return(Number(e)||0)<fm.nowSeconds()+t},fm.wasClockTurnedBack=function(e){return Number(e)>fm.nowSeconds()},fm.delay=function(t,o){return new Promise(function(e){return setTimeout(function(){return e(o)},t)})},fm);function fm(){}var gm,ym=(lf(mm,gm=oy),mm.createAccessTokenEntity=function(e,t,o,r,n,i,a,s,c,u,l,h,p,d,f){var g,y=new mm;y.homeAccountId=e,y.credentialType=Of.ACCESS_TOKEN,y.secret=o;e=dm.nowSeconds();if(y.cachedAt=e.toString(),y.expiresOn=a.toString(),y.extendedExpiresOn=s.toString(),u&&(y.refreshOn=u.toString()),y.environment=t,y.clientId=r,y.realm=n,y.target=i,y.userAssertionHash=h,y.tokenType=Qg.isEmpty(l)?qf.BEARER:l,d&&(y.requestedClaims=d,y.requestedClaimsHash=f),(null===(f=y.tokenType)||void 0===f?void 0:f.toLowerCase())!==qf.BEARER.toLowerCase())switch(y.credentialType=Of.ACCESS_TOKEN_WITH_AUTH_SCHEME,y.tokenType){case qf.POP:var m=Dy.extractTokenClaims(o,c);if(null===(g=null==m?void 0:m.cnf)||void 0===g||!g.kid)throw Wg.createTokenClaimsRequiredError();y.keyId=m.cnf.kid;break;case qf.SSH:y.keyId=p}return y},mm.isAccessTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.hasOwnProperty("target")&&(e.credentialType===Of.ACCESS_TOKEN||e.credentialType===Of.ACCESS_TOKEN_WITH_AUTH_SCHEME))},mm);function mm(){return null!==gm&&gm.apply(this,arguments)||this}var vm,_m=(lf(wm,vm=oy),wm.createRefreshTokenEntity=function(e,t,o,r,n,i){var a=new wm;return a.clientId=r,a.credentialType=Of.REFRESH_TOKEN,a.environment=t,a.homeAccountId=e,a.secret=o,a.userAssertionHash=i,n&&(a.familyId=n),a},wm.isRefreshTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===Of.REFRESH_TOKEN)},wm);function wm(){return null!==vm&&vm.apply(this,arguments)||this}var bm,Cm=["interaction_required","consent_required","login_required"],Em=["message_only","additional_action","basic_action","user_password_expired","consent_required"],Sm={code:"no_tokens_found",desc:"No refresh token found in the cache. Please sign-in."},Tm={code:"native_account_unavailable",desc:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API."},Im=(lf(Am,bm=eg),Am.isInteractionRequiredError=function(e,t,o){var r=!!e&&-1<Cm.indexOf(e),e=!!o&&-1<Em.indexOf(o),o=!!t&&Cm.some(function(e){return-1<t.indexOf(e)});return r||o||e},Am.createNoTokensFoundError=function(){return new Am(Sm.code,Sm.desc)},Am.createNativeAccountUnavailableError=function(){return new Am(Tm.code,Tm.desc)},Am);function Am(e,t,o){o=bm.call(this,e,t,o)||this;return o.name="InteractionRequiredAuthError",Object.setPrototypeOf(o,Am.prototype),o}var km=function(e,t,o,r,n){this.account=e||null,this.idToken=t||null,this.accessToken=o||null,this.refreshToken=r||null,this.appMetadata=n||null},Om=(Pm.setRequestState=function(e,t,o){o=Pm.generateLibraryState(e,o);return Qg.isEmpty(t)?o:""+o+wf.RESOURCE_DELIM+t},Pm.generateLibraryState=function(e,t){if(!e)throw Wg.createNoCryptoObjectError("generateLibraryState");var o={id:e.createNewGuid()};t&&(o.meta=t);o=JSON.stringify(o);return e.base64Encode(o)},Pm.parseRequestState=function(e,t){if(!e)throw Wg.createNoCryptoObjectError("parseRequestState");if(Qg.isEmpty(t))throw Wg.createInvalidStateError(t,"Null, undefined or empty state");try{var o=t.split(wf.RESOURCE_DELIM),r=o[0],n=1<o.length?o.slice(1).join(wf.RESOURCE_DELIM):wf.EMPTY_STRING,i=e.base64Decode(r),a=JSON.parse(i);return{userRequestState:Qg.isEmpty(n)?wf.EMPTY_STRING:n,libraryState:a}}catch(e){throw Wg.createInvalidStateError(t,e)}},Pm);function Pm(){}var xm,Rm=(Object.defineProperty(Mm.prototype,"urlString",{get:function(){return this._urlString},enumerable:!1,configurable:!0}),Mm.canonicalizeUri=function(e){if(e){var t=e.toLowerCase();return Qg.endsWith(t,"?")?t=t.slice(0,-1):Qg.endsWith(t,"?/")&&(t=t.slice(0,-2)),Qg.endsWith(t,"/")||(t+="/"),t}return e},Mm.prototype.validateAsUri=function(){var e;try{e=this.getUrlComponents()}catch(e){throw Ay.createUrlParseError(e)}if(!e.HostNameAndPort||!e.PathSegments)throw Ay.createUrlParseError("Given url string: "+this.urlString);if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw Ay.createInsecureAuthorityUriError(this.urlString)},Mm.appendQueryString=function(e,t){return Qg.isEmpty(t)?e:e.indexOf("?")<0?e+"?"+t:e+"&"+t},Mm.removeHashFromUrl=function(e){return Mm.canonicalizeUri(e.split("#")[0])},Mm.prototype.replaceTenantPath=function(e){var t=this.getUrlComponents(),o=t.PathSegments;return!e||0===o.length||o[0]!==mf.COMMON&&o[0]!==mf.ORGANIZATIONS||(o[0]=e),Mm.constructAuthorityUriFromObject(t)},Mm.prototype.getHash=function(){return Mm.parseHash(this.urlString)},Mm.prototype.getUrlComponents=function(){var e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw Ay.createUrlParseError("Given url string: "+this.urlString);e={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]},t=(t=e.AbsolutePath.split("/")).filter(function(e){return e&&0<e.length});return e.PathSegments=t,!Qg.isEmpty(e.QueryString)&&e.QueryString.endsWith("/")&&(e.QueryString=e.QueryString.substring(0,e.QueryString.length-1)),e},Mm.getDomainFromUrl=function(e){var t=RegExp("^([^:/?#]+://)?([^/?#]*)"),t=e.match(t);if(!t)throw Ay.createUrlParseError("Given url string: "+e);return t[2]},Mm.getAbsoluteUrl=function(e,t){if(e[0]!==wf.FORWARD_SLASH)return e;t=new Mm(t).getUrlComponents();return t.Protocol+"//"+t.HostNameAndPort+e},Mm.parseHash=function(e){var t=e.indexOf("#"),o=e.indexOf("#/");return-1<o?e.substring(o+2):-1<t?e.substring(t+1):wf.EMPTY_STRING},Mm.parseQueryString=function(e){var t=e.indexOf("?"),o=e.indexOf("/?");return-1<o?e.substring(o+2):-1<t?e.substring(t+1):wf.EMPTY_STRING},Mm.constructAuthorityUriFromObject=function(e){return new Mm(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))},Mm.getDeserializedHash=function(e){if(Qg.isEmpty(e))return{};var t=Mm.parseHash(e),t=Qg.queryStringToObject(Qg.isEmpty(t)?e:t);if(!t)throw Wg.createHashNotDeserializedError(JSON.stringify(t));return t},Mm.getDeserializedQueryString=function(e){if(Qg.isEmpty(e))return{};var t=Mm.parseQueryString(e),t=Qg.queryStringToObject(Qg.isEmpty(t)?e:t);if(!t)throw Wg.createHashNotDeserializedError(JSON.stringify(t));return t},Mm.hashContainsKnownProperties=function(e){if(Qg.isEmpty(e)||e.indexOf("=")<0)return!1;e=Mm.getDeserializedHash(e);return!!(e.code||e.error_description||e.error||e.state)},Mm);function Mm(e){if(this._urlString=e,Qg.isEmpty(this._urlString))throw Ay.createUrlEmptyError();Qg.isEmpty(this.getHash())&&(this._urlString=Mm.canonicalizeUri(e))}(w=xm=xm||{}).SW="sw",w.UHW="uhw";var Nm=(Lm.prototype.generateCnf=function(r){return pf(this,void 0,void 0,function(){var t,o;return df(this,function(e){switch(e.label){case 0:return[4,this.generateKid(r)];case 1:return o=e.sent(),t=this.cryptoUtils.base64Encode(JSON.stringify(o)),o={kid:o.kid,reqCnfString:t},[4,this.cryptoUtils.hashString(t)];case 2:return[2,(o.reqCnfHash=e.sent(),o)]}})})},Lm.prototype.generateKid=function(t){return pf(this,void 0,void 0,function(){return df(this,function(e){switch(e.label){case 0:return[4,this.cryptoUtils.getPublicKeyThumbprint(t)];case 1:return[2,{kid:e.sent(),xms_ksl:xm.SW}]}})})},Lm.prototype.signPopToken=function(t,o,r){return pf(this,void 0,void 0,function(){return df(this,function(e){return[2,this.signPayload(t,o,r)]})})},Lm.prototype.signPayload=function(i,a,s,c){return pf(this,void 0,void 0,function(){var t,o,r,n;return df(this,function(e){switch(e.label){case 0:return t=s.resourceRequestMethod,n=s.resourceRequestUri,o=s.shrClaims,r=s.shrNonce,n=n?new Rm(n):void 0,n=null==n?void 0:n.getUrlComponents(),[4,this.cryptoUtils.signJwt(hf({at:i,ts:dm.nowSeconds(),m:null==t?void 0:t.toUpperCase(),u:null==n?void 0:n.HostNameAndPort,nonce:r||this.cryptoUtils.createNewGuid(),p:null==n?void 0:n.AbsolutePath,q:null!=n&&n.QueryString?[[],n.QueryString]:void 0,client_claims:o||void 0},c),a,s.correlationId)];case 1:return[2,e.sent()]}})})},Lm);function Lm(e){this.cryptoUtils=e}var Dm=(qm.prototype.generateAppMetadataKey=function(){return qm.generateAppMetadataCacheKey(this.environment,this.clientId)},qm.generateAppMetadataCacheKey=function(e,t){return[Nf,e,t].join(kf.CACHE_KEY_SEPARATOR).toLowerCase()},qm.createAppMetadataEntity=function(e,t,o){var r=new qm;return r.clientId=e,r.environment=t,o&&(r.familyId=o),r},qm.isAppMetadataEntity=function(e,t){return!!t&&(0===e.indexOf(Nf)&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("environment"))},qm);function qm(){}var jm=(Object.defineProperty(Um.prototype,"cacheHasChanged",{get:function(){return this.hasChanged},enumerable:!1,configurable:!0}),Object.defineProperty(Um.prototype,"tokenCache",{get:function(){return this.cache},enumerable:!1,configurable:!0}),Um);function Um(e,t){this.cache=e,this.hasChanged=t}var Hm=(zm.prototype.validateServerAuthorizationCodeResponse=function(e,t,o){if(!e.state||!t)throw e.state?Wg.createStateNotFoundError("Cached State"):Wg.createStateNotFoundError("Server State");if(decodeURIComponent(e.state)!==decodeURIComponent(t))throw Wg.createStateMismatchError();if(e.error||e.error_description||e.suberror){if(Im.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new Im(e.error||wf.EMPTY_STRING,e.error_description,e.suberror);throw new Xy(e.error||wf.EMPTY_STRING,e.error_description,e.suberror)}e.client_info&&Ry(e.client_info,o)},zm.prototype.validateTokenResponse=function(e){if(e.error||e.error_description||e.suberror){if(Im.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new Im(e.error,e.error_description,e.suberror);var t=e.error_codes+" - ["+e.timestamp+"]: "+e.error_description+" - Correlation ID: "+e.correlation_id+" - Trace ID: "+e.trace_id;throw new Xy(e.error,t,e.suberror)}},zm.prototype.handleServerTokenResponse=function(a,s,c,u,l,h,p,d,f){return pf(this,void 0,void 0,function(){var t,o,r,n,i;return df(this,function(e){switch(e.label){case 0:if(a.id_token){if(t=new Dy(a.id_token||wf.EMPTY_STRING,this.cryptoObj),l&&!Qg.isEmpty(l.nonce)&&t.claims.nonce!==l.nonce)throw Wg.createNonceMismatchError();if(u.maxAge||0===u.maxAge){if(!(i=t.claims.auth_time))throw Wg.createAuthTimeNotFoundError();Dy.checkMaxAge(i,u.maxAge)}}this.homeAccountIdentifier=Ny.generateHomeAccountId(a.client_info||wf.EMPTY_STRING,s.authorityType,this.logger,this.cryptoObj,t),l&&l.state&&(o=Om.parseRequestState(this.cryptoObj,l.state)),a.key_id=a.key_id||u.sshKid||void 0,r=this.generateCacheRecord(a,s,c,u,t,h,l),e.label=1;case 1:return(e.trys.push([1,,5,8]),this.persistencePlugin&&this.serializableCache)?(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),n=new jm(this.serializableCache,!0),[4,this.persistencePlugin.beforeCacheAccess(n)]):[3,3];case 2:e.sent(),e.label=3;case 3:return!p||d||!r.account||(i=r.account.generateAccountKey(),this.cacheStorage.getAccount(i))?[4,this.cacheStorage.saveCacheRecord(r)]:(this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),[2,zm.generateAuthenticationResult(this.cryptoObj,s,r,!1,u,t,o,void 0,f)]);case 4:return e.sent(),[3,8];case 5:return this.persistencePlugin&&this.serializableCache&&n?(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),[4,this.persistencePlugin.afterCacheAccess(n)]):[3,7];case 6:e.sent(),e.label=7;case 7:return[7];case 8:return[2,zm.generateAuthenticationResult(this.cryptoObj,s,r,!1,u,t,o,a.spa_code,f)]}})})},zm.prototype.generateCacheRecord=function(e,t,o,r,n,i,a){var s,c,u=t.getPreferredCache();if(Qg.isEmpty(u))throw Wg.createInvalidCacheEnvironmentError();!Qg.isEmpty(e.id_token)&&n&&(s=hm.createIdTokenEntity(this.homeAccountIdentifier,u,e.id_token||wf.EMPTY_STRING,this.clientId,n.claims.tid||wf.EMPTY_STRING),c=this.generateAccountEntity(e,n,t,a));var l,h,p,d=null;Qg.isEmpty(e.access_token)||(l=e.scope?Py.fromString(e.scope):new Py(r.scopes||[]),p=(h=o+(("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0))+(("string"==typeof e.ext_expires_in?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0),a=(a=("string"==typeof e.refresh_in?parseInt(e.refresh_in,10):e.refresh_in)||void 0)&&0<a?o+a:void 0,d=ym.createAccessTokenEntity(this.homeAccountIdentifier,u,e.access_token||wf.EMPTY_STRING,this.clientId,n?n.claims.tid||wf.EMPTY_STRING:t.tenant,l.printScopes(),h,p,this.cryptoObj,a,e.token_type,i,e.key_id,r.claims,r.requestedClaimsHash));r=null;Qg.isEmpty(e.refresh_token)||(r=_m.createRefreshTokenEntity(this.homeAccountIdentifier,u,e.refresh_token||wf.EMPTY_STRING,this.clientId,e.foci,i));i=null;return Qg.isEmpty(e.foci)||(i=Dm.createAppMetadataEntity(this.clientId,u,e.foci)),new km(c,s,d,r,i)},zm.prototype.generateAccountEntity=function(e,t,o,r){var n=o.authorityType,i=r?r.cloud_graph_host_name:wf.EMPTY_STRING,r=r?r.msgraph_host:wf.EMPTY_STRING;if(n===Oy.Adfs)return this.logger.verbose("Authority type is ADFS, creating ADFS account"),Ny.createGenericAccount(this.homeAccountIdentifier,t,o,i,r);if(Qg.isEmpty(e.client_info)&&"AAD"===o.protocolMode)throw Wg.createClientInfoEmptyError();return e.client_info?Ny.createAccount(e.client_info,this.homeAccountIdentifier,t,o,i,r):Ny.createGenericAccount(this.homeAccountIdentifier,t,o,i,r)},zm.generateAuthenticationResult=function(u,l,h,p,d,f,g,y,m){var v;return pf(this,void 0,void 0,function(){var t,o,r,n,i,a,s,c;return df(this,function(e){switch(e.label){case 0:if(t=wf.EMPTY_STRING,o=[],r=null,i=wf.EMPTY_STRING,!h.accessToken)return[3,4];if(h.accessToken.tokenType!==qf.POP)return[3,2];if(a=new Nm(u),c=h.accessToken,s=c.secret,!(c=c.keyId))throw Wg.createKeyIdMissingError();return[4,a.signPopToken(s,c,d)];case 1:return t=e.sent(),[3,3];case 2:t=h.accessToken.secret,e.label=3;case 3:o=Py.fromString(h.accessToken.target).asArray(),r=new Date(1e3*Number(h.accessToken.expiresOn)),n=new Date(1e3*Number(h.accessToken.extendedExpiresOn)),e.label=4;case 4:return h.appMetadata&&(i="1"===h.appMetadata.familyId?"1":wf.EMPTY_STRING),s=(null==f?void 0:f.claims.oid)||(null==f?void 0:f.claims.sub)||wf.EMPTY_STRING,c=(null==f?void 0:f.claims.tid)||wf.EMPTY_STRING,[2,{authority:l.canonicalAuthority,uniqueId:s,tenantId:c,scopes:o,account:h.account?h.account.getAccountInfo():null,idToken:f?f.rawToken:wf.EMPTY_STRING,idTokenClaims:f?f.claims:{},accessToken:t,fromCache:p,expiresOn:r,correlationId:d.correlationId,requestId:m||wf.EMPTY_STRING,extExpiresOn:n,familyId:i,tokenType:(null===(v=h.accessToken)||void 0===v?void 0:v.tokenType)||wf.EMPTY_STRING,state:g?g.userRequestState:wf.EMPTY_STRING,cloudGraphHostName:(null===(v=h.account)||void 0===v?void 0:v.cloudGraphHostName)||wf.EMPTY_STRING,msGraphHost:(null===(v=h.account)||void 0===v?void 0:v.msGraphHost)||wf.EMPTY_STRING,code:y,fromNativeBroker:!1}]}})})},zm);function zm(e,t,o,r,n,i){this.clientId=e,this.cacheStorage=t,this.cryptoObj=o,this.logger=r,this.serializableCache=n,this.persistencePlugin=i}var Bm,Fm,Km,Gm=(lf(Ym,Bm=r),Ym.prototype.getAuthCodeUrl=function(o){return pf(this,void 0,void 0,function(){var t;return df(this,function(e){switch(e.label){case 0:return[4,this.createAuthCodeUrlQueryString(o)];case 1:return t=e.sent(),[2,Rm.appendQueryString(this.authority.authorizationEndpoint,t)]}})})},Ym.prototype.acquireToken=function(i,a){var s;return pf(this,void 0,void 0,function(){var t,o,r,n;return df(this,function(e){switch(e.label){case 0:if(this.logger.info("in acquireToken call"),!i||Qg.isEmpty(i.code))throw Wg.createTokenRequestCannotBeMadeError();return t=dm.nowSeconds(),[4,this.executeTokenRequest(this.authority,i)];case 1:return o=e.sent(),r=null===(s=o.headers)||void 0===s?void 0:s[gf.X_MS_REQUEST_ID],(n=new Hm(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(o.body),[4,n.handleServerTokenResponse(o.body,this.authority,t,i,a,void 0,void 0,void 0,r)];case 2:return[2,e.sent()]}})})},Ym.prototype.handleFragmentResponse=function(e,t){var o=new Hm(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null),e=new Rm(e),e=Rm.getDeserializedHash(e.getHash());if(o.validateServerAuthorizationCodeResponse(e,t,this.cryptoUtils),!e.code)throw Wg.createNoAuthCodeInServerResponseError();return hf(hf({},e),{code:e.code})},Ym.prototype.getLogoutUri=function(e){if(!e)throw Ay.createEmptyLogoutRequestError();e=this.createLogoutUrlQueryString(e);return Rm.appendQueryString(this.authority.endSessionEndpoint,e)},Ym.prototype.executeTokenRequest=function(a,s){return pf(this,void 0,void 0,function(){var t,o,r,n,i;return df(this,function(e){switch(e.label){case 0:return t={clientId:this.config.authOptions.clientId,authority:a.canonicalAuthority,scopes:s.scopes,claims:s.claims,authenticationScheme:s.authenticationScheme,resourceRequestMethod:s.resourceRequestMethod,resourceRequestUri:s.resourceRequestUri,shrClaims:s.shrClaims,sshKid:s.sshKid},[4,this.createTokenRequestBody(s)];case 1:if(o=e.sent(),i=this.createTokenQueryParameters(s),n=void 0,s.clientInfo)try{r=Ry(s.clientInfo,this.cryptoUtils),n={credential:""+r.uid+kf.CLIENT_INFO_SEPARATOR+r.utid,type:om.HOME_ACCOUNT_ID}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}return n=this.createTokenRequestHeaders(n||s.ccsCredential),i=Qg.isEmpty(i)?a.tokenEndpoint:a.tokenEndpoint+"?"+i,[2,this.executePostToTokenEndpoint(i,o,n,t)]}})})},Ym.prototype.createTokenQueryParameters=function(e){var t=new cm;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},Ym.prototype.createTokenRequestBody=function(a){return pf(this,void 0,void 0,function(){var t,o,r,n,i;return df(this,function(e){switch(e.label){case 0:return((t=new cm).addClientId(this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(a.redirectUri):am.validateRedirectUri(a.redirectUri),t.addScopes(a.scopes),t.addAuthorizationCode(a.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&t.addServerTelemetry(this.serverTelemetryManager),a.codeVerifier&&t.addCodeVerifier(a.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(o=this.config.clientCredentials.clientAssertion,t.addClientAssertion(o.assertion),t.addClientAssertionType(o.assertionType)),t.addGrantType(If.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),a.authenticationScheme!==qf.POP)?[3,2]:[4,new Nm(this.cryptoUtils).generateCnf(a)];case 1:return i=e.sent(),t.addPopToken(i.reqCnfString),[3,3];case 2:if(a.authenticationScheme===qf.SSH){if(!a.sshJwk)throw Ay.createMissingSshJwkError();t.addSshJwk(a.sshJwk)}e.label=3;case 3:if(i=a.correlationId||this.config.cryptoInterface.createNewGuid(),t.addCorrelationId(i),(!Qg.isEmptyObj(a.claims)||this.config.authOptions.clientCapabilities&&0<this.config.authOptions.clientCapabilities.length)&&t.addClaims(a.claims,this.config.authOptions.clientCapabilities),r=void 0,a.clientInfo)try{n=Ry(a.clientInfo,this.cryptoUtils),r={credential:""+n.uid+kf.CLIENT_INFO_SEPARATOR+n.utid,type:om.HOME_ACCOUNT_ID}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}else r=a.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case om.HOME_ACCOUNT_ID:try{n=My(r.credential),t.addCcsOid(n)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case om.UPN:t.addCcsUpn(r.credential)}return a.tokenBodyParameters&&t.addExtraQueryParameters(a.tokenBodyParameters),!a.enableSpaAuthorizationCode||a.tokenBodyParameters&&a.tokenBodyParameters[vf.RETURN_SPA_CODE]||t.addExtraQueryParameters(((i={})[vf.RETURN_SPA_CODE]="1",i)),[2,t.createQueryString()]}})})},Ym.prototype.createAuthCodeUrlQueryString=function(i){return pf(this,void 0,void 0,function(){var t,o,r,n;return df(this,function(e){switch(e.label){case 0:if((t=new cm).addClientId(this.config.authOptions.clientId),o=ff(i.scopes||[],i.extraScopesToConsent||[]),t.addScopes(o),t.addRedirectUri(i.redirectUri),o=i.correlationId||this.config.cryptoInterface.createNewGuid(),t.addCorrelationId(o),t.addResponseMode(i.responseMode),t.addResponseTypeCode(),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addClientInfo(),i.codeChallenge&&i.codeChallengeMethod&&t.addCodeChallengeParams(i.codeChallenge,i.codeChallengeMethod),i.prompt&&t.addPrompt(i.prompt),i.domainHint&&t.addDomainHint(i.domainHint),i.prompt!==Sf.SELECT_ACCOUNT)if(i.sid&&i.prompt===Sf.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),t.addSid(i.sid);else if(i.account){if(n=this.extractAccountSid(i.account),o=this.extractLoginHint(i.account)){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),t.addLoginHint(o);try{r=My(i.account.homeAccountId),t.addCcsOid(r)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(n&&i.prompt===Sf.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),t.addSid(n);try{r=My(i.account.homeAccountId),t.addCcsOid(r)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(i.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),t.addLoginHint(i.loginHint),t.addCcsUpn(i.loginHint);else if(i.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),t.addLoginHint(i.account.username);try{r=My(i.account.homeAccountId),t.addCcsOid(r)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else i.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),t.addLoginHint(i.loginHint),t.addCcsUpn(i.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return(i.nonce&&t.addNonce(i.nonce),i.state&&t.addState(i.state),(!Qg.isEmpty(i.claims)||this.config.authOptions.clientCapabilities&&0<this.config.authOptions.clientCapabilities.length)&&t.addClaims(i.claims,this.config.authOptions.clientCapabilities),i.extraQueryParameters&&t.addExtraQueryParameters(i.extraQueryParameters),i.nativeBroker)?(t.addNativeBroker(),i.authenticationScheme!==qf.POP?[3,2]:[4,new Nm(this.cryptoUtils).generateCnf(i)]):[3,2];case 1:n=e.sent(),t.addPopToken(n.reqCnfHash),e.label=2;case 2:return[2,t.createQueryString()]}})})},Ym.prototype.createLogoutUrlQueryString=function(e){var t=new cm;return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),t.createQueryString()},Ym.prototype.extractAccountSid=function(e){return(null===(e=e.idTokenClaims)||void 0===e?void 0:e.sid)||null},Ym.prototype.extractLoginHint=function(e){return(null===(e=e.idTokenClaims)||void 0===e?void 0:e.login_hint)||null},Ym);function Ym(e){e=Bm.call(this,e)||this;return e.includeRedirectUri=!0,e}(w=Fm=Fm||{}).AcquireTokenByCode="acquireTokenByCode",w.AcquireTokenByRefreshToken="acquireTokenByRefreshToken",w.AcquireTokenSilent="acquireTokenSilent",w.AcquireTokenSilentAsync="acquireTokenSilentAsync",w.AcquireTokenPopup="acquireTokenPopup",w.CryptoOptsGetPublicKeyThumbprint="cryptoOptsGetPublicKeyThumbprint",w.CryptoOptsSignJwt="cryptoOptsSignJwt",w.SilentCacheClientAcquireToken="silentCacheClientAcquireToken",w.SilentIframeClientAcquireToken="silentIframeClientAcquireToken",w.SilentRefreshClientAcquireToken="silentRefreshClientAcquireToken",w.SsoSilent="ssoSilent",w.StandardInteractionClientGetDiscoveredAuthority="standardInteractionClientGetDiscoveredAuthority",w.FetchAccountIdWithNativeBroker="fetchAccountIdWithNativeBroker",w.NativeInteractionClientAcquireToken="nativeInteractionClientAcquireToken",w.BaseClientCreateTokenRequestHeaders="baseClientCreateTokenRequestHeaders",w.BrokerHandhshake="brokerHandshake",w.AcquireTokenByRefreshTokenInBroker="acquireTokenByRefreshTokenInBroker",w.AcquireTokenByBroker="acquireTokenByBroker",w.RefreshTokenClientExecuteTokenRequest="refreshTokenClientExecuteTokenRequest",w.RefreshTokenClientAcquireToken="refreshTokenClientAcquireToken",w.RefreshTokenClientAcquireTokenWithCachedRefreshToken="refreshTokenClientAcquireTokenWithCachedRefreshToken",(w=Km=Km||{})[w.NotStarted=0]="NotStarted",w[w.InProgress=1]="InProgress",w[w.Completed=2]="Completed";var Zm,Wm=(lf(Vm,Zm=r),Vm.prototype.acquireToken=function(s){var c,u;return pf(this,void 0,void 0,function(){var t,o,r,n,i,a=this;return df(this,function(e){switch(e.label){case 0:return t=null===(c=this.performanceClient)||void 0===c?void 0:c.startMeasurement(Fm.RefreshTokenClientAcquireToken,s.correlationId),this.logger.verbose("RefreshTokenClientAcquireToken called",s.correlationId),o=dm.nowSeconds(),[4,this.executeTokenRequest(s,this.authority)];case 1:return r=e.sent(),null!=t&&t.addStaticFields({refreshTokenSize:(null===(u=r.body.refresh_token)||void 0===u?void 0:u.length)||0}),n=null===(u=r.headers)||void 0===u?void 0:u[gf.X_MS_REQUEST_ID],(i=new Hm(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(r.body),[2,i.handleServerTokenResponse(r.body,this.authority,o,s,void 0,void 0,!0,s.forceCache,n).then(function(e){return null!=t&&t.endMeasurement({success:!0}),e}).catch(function(e){throw a.logger.verbose("Error in fetching refresh token",s.correlationId),null!=t&&t.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})]}})})},Vm.prototype.acquireTokenByRefreshToken=function(r){return pf(this,void 0,void 0,function(){var t,o;return df(this,function(e){if(!r)throw Ay.createEmptyTokenRequestError();if(!r.account)throw Wg.createNoAccountInSilentRequestError();if(this.cacheManager.isAppMetadataFOCI(r.account.environment,this.config.authOptions.clientId))try{return[2,this.acquireTokenWithCachedRefreshToken(r,!0)]}catch(e){if(t=e instanceof Im&&e.errorCode===Sm.code,o=e instanceof Xy&&e.errorCode===Vf&&e.subError===Jf,t||o)return[2,this.acquireTokenWithCachedRefreshToken(r,!1)];throw e}return[2,this.acquireTokenWithCachedRefreshToken(r,!1)]})})},Vm.prototype.acquireTokenWithCachedRefreshToken=function(r,n){var i;return pf(this,void 0,void 0,function(){var t,o;return df(this,function(e){if(t=null===(i=this.performanceClient)||void 0===i?void 0:i.startMeasurement(Fm.RefreshTokenClientAcquireTokenWithCachedRefreshToken,r.correlationId),this.logger.verbose("RefreshTokenClientAcquireTokenWithCachedRefreshToken called",r.correlationId),!(o=this.cacheManager.readRefreshTokenFromCache(this.config.authOptions.clientId,r.account,n)))throw null!=t&&t.discardMeasurement(),Im.createNoTokensFoundError();return null!=t&&t.endMeasurement({success:!0}),o=hf(hf({},r),{refreshToken:o.secret,authenticationScheme:r.authenticationScheme||qf.BEARER,ccsCredential:{credential:r.account.homeAccountId,type:om.HOME_ACCOUNT_ID}}),[2,this.acquireToken(o)]})})},Vm.prototype.executeTokenRequest=function(a,s){var c;return pf(this,void 0,void 0,function(){var t,o,r,n,i;return df(this,function(e){switch(e.label){case 0:return t=null===(c=this.performanceClient)||void 0===c?void 0:c.startMeasurement(Fm.RefreshTokenClientExecuteTokenRequest,a.correlationId),[4,this.createTokenRequestBody(a)];case 1:return o=e.sent(),i=this.createTokenQueryParameters(a),r=this.createTokenRequestHeaders(a.ccsCredential),n={clientId:this.config.authOptions.clientId,authority:s.canonicalAuthority,scopes:a.scopes,claims:a.claims,authenticationScheme:a.authenticationScheme,resourceRequestMethod:a.resourceRequestMethod,resourceRequestUri:a.resourceRequestUri,shrClaims:a.shrClaims,sshKid:a.sshKid},i=Rm.appendQueryString(s.tokenEndpoint,i),[2,this.executePostToTokenEndpoint(i,o,r,n).then(function(e){return null!=t&&t.endMeasurement({success:!0}),e}).catch(function(e){throw null!=t&&t.endMeasurement({success:!1}),e})]}})})},Vm.prototype.createTokenQueryParameters=function(e){var t=new cm;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},Vm.prototype.createTokenRequestBody=function(a){var s;return pf(this,void 0,void 0,function(){var t,o,r,n,i;return df(this,function(e){switch(e.label){case 0:return(t=a.correlationId,o=null===(s=this.performanceClient)||void 0===s?void 0:s.startMeasurement(Fm.BaseClientCreateTokenRequestHeaders,t),(r=new cm).addClientId(this.config.authOptions.clientId),r.addScopes(a.scopes),r.addGrantType(If.REFRESH_TOKEN_GRANT),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addApplicationTelemetry(this.config.telemetry.application),r.addThrottling(),this.serverTelemetryManager&&r.addServerTelemetry(this.serverTelemetryManager),r.addCorrelationId(t),r.addRefreshToken(a.refreshToken),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(n=this.config.clientCredentials.clientAssertion,r.addClientAssertion(n.assertion),r.addClientAssertionType(n.assertionType)),a.authenticationScheme!==qf.POP)?[3,2]:[4,new Nm(this.cryptoUtils).generateCnf(a)];case 1:return n=e.sent(),r.addPopToken(n.reqCnfString),[3,3];case 2:if(a.authenticationScheme===qf.SSH){if(!a.sshJwk)throw null!=o&&o.endMeasurement({success:!1}),Ay.createMissingSshJwkError();r.addSshJwk(a.sshJwk)}e.label=3;case 3:if((!Qg.isEmptyObj(a.claims)||this.config.authOptions.clientCapabilities&&0<this.config.authOptions.clientCapabilities.length)&&r.addClaims(a.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&a.ccsCredential)switch(a.ccsCredential.type){case om.HOME_ACCOUNT_ID:try{i=My(a.ccsCredential.credential),r.addCcsOid(i)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case om.UPN:r.addCcsUpn(a.ccsCredential.credential)}return null!=o&&o.endMeasurement({success:!0}),[2,r.createQueryString()]}})})},Vm);function Vm(e,t){return Zm.call(this,e,t)||this}var Jm,Qm=(lf(Xm,Jm=r),Xm.prototype.acquireToken=function(o){return pf(this,void 0,void 0,function(){var t;return df(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.acquireCachedToken(o)];case 1:return[2,e.sent()];case 2:if((t=e.sent())instanceof Wg&&t.errorCode===zg.code)return[2,new Wm(this.config,this.performanceClient).acquireTokenByRefreshToken(o)];throw t;case 3:return[2]}})})},Xm.prototype.acquireCachedToken=function(o){var r,n;return pf(this,void 0,void 0,function(){var t;return df(this,function(e){switch(e.label){case 0:if(!o)throw Ay.createEmptyTokenRequestError();if(o.forceRefresh)throw null!==(r=this.serverTelemetryManager)&&void 0!==r&&r.setCacheOutcome(Ff.FORCE_REFRESH),this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true."),Wg.createRefreshRequiredError();if(!o.account)throw Wg.createNoAccountInSilentRequestError();if(t=o.authority||this.authority.getPreferredCache(),!(t=this.cacheManager.readCacheRecord(o.account,this.config.authOptions.clientId,o,t)).accessToken)throw null!==(r=this.serverTelemetryManager)&&void 0!==r&&r.setCacheOutcome(Ff.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties."),Wg.createRefreshRequiredError();if(dm.wasClockTurnedBack(t.accessToken.cachedAt)||dm.isTokenExpired(t.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw null!==(n=this.serverTelemetryManager)&&void 0!==n&&n.setCacheOutcome(Ff.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within "+this.config.systemOptions.tokenRenewalOffsetSeconds+" seconds."),Wg.createRefreshRequiredError();if(t.accessToken.refreshOn&&dm.isTokenExpired(t.accessToken.refreshOn,0))throw null!==(n=this.serverTelemetryManager)&&void 0!==n&&n.setCacheOutcome(Ff.REFRESH_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'."),Wg.createRefreshRequiredError();return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[4,this.generateResultFromCacheRecord(t,o)];case 1:return[2,e.sent()]}})})},Xm.prototype.generateResultFromCacheRecord=function(r,n){return pf(this,void 0,void 0,function(){var t,o;return df(this,function(e){switch(e.label){case 0:if(r.idToken&&(t=new Dy(r.idToken.secret,this.config.cryptoInterface)),n.maxAge||0===n.maxAge){if(!(o=null==t?void 0:t.claims.auth_time))throw Wg.createAuthTimeNotFoundError();Dy.checkMaxAge(o,n.maxAge)}return[4,Hm.generateAuthenticationResult(this.cryptoUtils,this.authority,r,!0,n,t)];case 1:return[2,e.sent()]}})})},Xm);function Xm(e,t){return Jm.call(this,e,t)||this}var $m,ev={"https://login.microsoftonline.com/common/":{token_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/common/":{token_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/common/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/common/":{token_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/consumers/":{token_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/consumers/":{token_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/consumers/":{token_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/organizations/":{token_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/organizations/":{token_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/organizations/":{token_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"}},tv={"https://login.microsoftonline.com/common/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/common/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/common/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.com/consumers/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/consumers/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/consumers/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.com/organizations/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/organizations/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/organizations/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}};(w=$m=$m||{}).AAD="AAD",w.OIDC="OIDC";var ov=(rv.prototype.updateCloudDiscoveryMetadata=function(e,t){this.aliases=e.aliases,this.preferred_cache=e.preferred_cache,this.preferred_network=e.preferred_network,this.aliasesFromNetwork=t},rv.prototype.updateEndpointMetadata=function(e,t){this.authorization_endpoint=e.authorization_endpoint,this.token_endpoint=e.token_endpoint,this.end_session_endpoint=e.end_session_endpoint,this.issuer=e.issuer,this.endpointsFromNetwork=t,this.jwks_uri=e.jwks_uri},rv.prototype.updateCanonicalAuthority=function(e){this.canonical_authority=e},rv.prototype.resetExpiresAt=function(){this.expiresAt=dm.nowSeconds()+Df},rv.prototype.isExpired=function(){return this.expiresAt<=dm.nowSeconds()},rv.isAuthorityMetadataEntity=function(e,t){return!!t&&(0===e.indexOf(Lf)&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri"))},rv);function rv(){this.expiresAt=dm.nowSeconds()+Df}var nv=(iv.prototype.detectRegion=function(i,a,s){return pf(this,void 0,void 0,function(){var t,o,r,n;return df(this,function(e){switch(e.label){case 0:if(t=i)return[3,8];o=iv.IMDS_OPTIONS,s&&(o.proxyUrl=s),e.label=1;case 1:return e.trys.push([1,6,,7]),[4,this.getRegionFromIMDS(wf.IMDS_VERSION,o)];case 2:return(r=e.sent()).status===Hf.httpSuccess&&(t=r.body,a.region_source=zf.IMDS),r.status!==Hf.httpBadRequest?[3,5]:[4,this.getCurrentVersion(o)];case 3:return(n=e.sent())?[4,this.getRegionFromIMDS(n,o)]:(a.region_source=zf.FAILED_AUTO_DETECTION,[2,null]);case 4:(n=e.sent()).status===Hf.httpSuccess&&(t=n.body,a.region_source=zf.IMDS),e.label=5;case 5:return[3,7];case 6:return e.sent(),a.region_source=zf.FAILED_AUTO_DETECTION,[2,null];case 7:return[3,9];case 8:a.region_source=zf.ENVIRONMENT_VARIABLE,e.label=9;case 9:return t||(a.region_source=zf.FAILED_AUTO_DETECTION),[2,t||null]}})})},iv.prototype.getRegionFromIMDS=function(t,o){return pf(this,void 0,void 0,function(){return df(this,function(e){return[2,this.networkInterface.sendGetRequestAsync(wf.IMDS_ENDPOINT+"?api-version="+t+"&format=text",o,wf.IMDS_TIMEOUT)]})})},iv.prototype.getCurrentVersion=function(o){return pf(this,void 0,void 0,function(){var t;return df(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.networkInterface.sendGetRequestAsync(wf.IMDS_ENDPOINT+"?format=json",o)];case 1:return(t=e.sent()).status===Hf.httpBadRequest&&t.body&&t.body["newest-versions"]&&0<t.body["newest-versions"].length?[2,t.body["newest-versions"][0]]:[2,null];case 2:return e.sent(),[2,null];case 3:return[2]}})})},iv.IMDS_OPTIONS={headers:{Metadata:"true"}},iv);function iv(e){this.networkInterface=e}var av=(Object.defineProperty(sv.prototype,"authorityType",{get:function(){var e=this.canonicalAuthorityUrlComponents.PathSegments;if(e.length)switch(e[0].toLowerCase()){case wf.ADFS:return Oy.Adfs;case wf.DSTS:return Oy.Dsts}return Oy.Default},enumerable:!1,configurable:!0}),Object.defineProperty(sv.prototype,"protocolMode",{get:function(){return this.authorityOptions.protocolMode},enumerable:!1,configurable:!0}),Object.defineProperty(sv.prototype,"options",{get:function(){return this.authorityOptions},enumerable:!1,configurable:!0}),Object.defineProperty(sv.prototype,"canonicalAuthority",{get:function(){return this._canonicalAuthority.urlString},set:function(e){this._canonicalAuthority=new Rm(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null},enumerable:!1,configurable:!0}),Object.defineProperty(sv.prototype,"canonicalAuthorityUrlComponents",{get:function(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents},enumerable:!1,configurable:!0}),Object.defineProperty(sv.prototype,"hostnameAndPort",{get:function(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(sv.prototype,"tenant",{get:function(){return this.canonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!1,configurable:!0}),Object.defineProperty(sv.prototype,"authorizationEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.authorization_endpoint);return this.replaceTenant(e)}throw Wg.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(sv.prototype,"tokenEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint);return this.replaceTenant(e)}throw Wg.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(sv.prototype,"deviceCodeEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));return this.replaceTenant(e)}throw Wg.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(sv.prototype,"endSessionEndpoint",{get:function(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw Wg.createLogoutNotSupportedError();var e=this.replacePath(this.metadata.end_session_endpoint);return this.replaceTenant(e)}throw Wg.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(sv.prototype,"selfSignedJwtAudience",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.issuer);return this.replaceTenant(e)}throw Wg.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(sv.prototype,"jwksUri",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.jwks_uri);return this.replaceTenant(e)}throw Wg.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),sv.prototype.replaceTenant=function(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)},sv.prototype.replacePath=function(e){var o=e,r=new Rm(this.metadata.canonical_authority).getUrlComponents().PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach(function(e,t){t=r[t];e!==t&&(o=o.replace("/"+t+"/","/"+e+"/"))}),o},Object.defineProperty(sv.prototype,"defaultOpenIdConfigurationEndpoint",{get:function(){return this.authorityType===Oy.Adfs||this.authorityType===Oy.Dsts||this.protocolMode===$m.OIDC?this.canonicalAuthority+".well-known/openid-configuration":this.canonicalAuthority+"v2.0/.well-known/openid-configuration"},enumerable:!1,configurable:!0}),sv.prototype.discoveryComplete=function(){return!!this.metadata},sv.prototype.resolveEndpointsAsync=function(){return pf(this,void 0,void 0,function(){var t,o,r;return df(this,function(e){switch(e.label){case 0:return(t=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort))||(t=new ov).updateCanonicalAuthority(this.canonicalAuthority),[4,this.updateCloudDiscoveryMetadata(t)];case 1:return o=e.sent(),this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,t.preferred_network),[4,this.updateEndpointMetadata(t)];case 2:return r=e.sent(),o!==Mf.CACHE&&r!==Mf.CACHE&&(t.resetExpiresAt(),t.updateCanonicalAuthority(this.canonicalAuthority)),r=this.cacheManager.generateAuthorityMetadataCacheKey(t.preferred_cache),this.cacheManager.setAuthorityMetadata(r,t),this.metadata=t,[2]}})})},sv.prototype.updateEndpointMetadata=function(r){var n;return pf(this,void 0,void 0,function(){var t,o;return df(this,function(e){switch(e.label){case 0:return(t=this.getEndpointMetadataFromConfig())?(r.updateEndpointMetadata(t,!1),[2,Mf.CONFIG]):this.isAuthoritySameType(r)&&r.endpointsFromNetwork&&!r.isExpired()?[2,Mf.CACHE]:(o=this.getEndpointMetadataFromHardcodedValues(),[4,this.getEndpointMetadataFromNetwork()]);case 1:return(t=e.sent())?null!==(n=this.authorityOptions.azureRegionConfiguration)&&void 0!==n&&n.azureRegion?[4,this.updateMetadataWithRegionalInformation(t)]:[3,3]:[3,4];case 2:t=e.sent(),e.label=3;case 3:return r.updateEndpointMetadata(t,!0),[2,Mf.NETWORK];case 4:return!o||this.authorityOptions.skipAuthorityMetadataCache?[3,7]:null!==(n=this.authorityOptions.azureRegionConfiguration)&&void 0!==n&&n.azureRegion?[4,this.updateMetadataWithRegionalInformation(o)]:[3,6];case 5:o=e.sent(),e.label=6;case 6:return r.updateEndpointMetadata(o,!1),[2,Mf.HARDCODED_VALUES];case 7:throw Wg.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint)}})})},sv.prototype.isAuthoritySameType=function(e){return new Rm(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length},sv.prototype.getEndpointMetadataFromConfig=function(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch(e){throw Ay.createInvalidAuthorityMetadataError()}return null},sv.prototype.getEndpointMetadataFromNetwork=function(){return pf(this,void 0,void 0,function(){var o,r;return df(this,function(e){switch(e.label){case 0:o={},this.proxyUrl&&(o.proxyUrl=this.proxyUrl),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint,o)];case 2:return r=e.sent(),[2,(t=r.body).hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")?r.body:null];case 3:return e.sent(),[2,null];case 4:return[2]}var t})})},sv.prototype.getEndpointMetadataFromHardcodedValues=function(){return this.canonicalAuthority in ev?ev[this.canonicalAuthority]:null},sv.prototype.updateMetadataWithRegionalInformation=function(r){var n,i;return pf(this,void 0,void 0,function(){var t,o;return df(this,function(e){switch(e.label){case 0:return[4,this.regionDiscovery.detectRegion(null===(n=this.authorityOptions.azureRegionConfiguration)||void 0===n?void 0:n.environmentRegion,this.regionDiscoveryMetadata,this.proxyUrl)];case 1:return t=e.sent(),o=(null===(n=this.authorityOptions.azureRegionConfiguration)||void 0===n?void 0:n.azureRegion)===wf.AZURE_REGION_AUTO_DISCOVER_FLAG?t:null===(i=this.authorityOptions.azureRegionConfiguration)||void 0===i?void 0:i.azureRegion,(null===(i=this.authorityOptions.azureRegionConfiguration)||void 0===i?void 0:i.azureRegion)===wf.AZURE_REGION_AUTO_DISCOVER_FLAG?this.regionDiscoveryMetadata.region_outcome=t?Bf.AUTO_DETECTION_REQUESTED_SUCCESSFUL:Bf.AUTO_DETECTION_REQUESTED_FAILED:this.regionDiscoveryMetadata.region_outcome=t?(null===(i=this.authorityOptions.azureRegionConfiguration)||void 0===i?void 0:i.azureRegion)===t?Bf.CONFIGURED_MATCHES_DETECTED:Bf.CONFIGURED_NOT_DETECTED:Bf.CONFIGURED_NO_AUTO_DETECTION,o?(this.regionDiscoveryMetadata.region_used=o,[2,sv.replaceWithRegionalInformation(r,o)]):[2,r]}})})},sv.prototype.updateCloudDiscoveryMetadata=function(r){return pf(this,void 0,void 0,function(){var t,o;return df(this,function(e){switch(e.label){case 0:return(this.logger.verbose("Attempting to get cloud discovery metadata in the config"),this.logger.verbosePii("Known Authorities: "+(this.authorityOptions.knownAuthorities||wf.NOT_APPLICABLE)),this.logger.verbosePii("Authority Metadata: "+(this.authorityOptions.authorityMetadata||wf.NOT_APPLICABLE)),this.logger.verbosePii("Canonical Authority: "+(r.canonical_authority||wf.NOT_APPLICABLE)),t=this.getCloudDiscoveryMetadataFromConfig())?(this.logger.verbose("Found cloud discovery metadata in the config."),r.updateCloudDiscoveryMetadata(t,!1),[2,Mf.CONFIG]):(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the cache."),o=r.isExpired(),this.isAuthoritySameType(r)&&r.aliasesFromNetwork&&!o?(this.logger.verbose("Found metadata in the cache."),[2,Mf.CACHE]):(o&&this.logger.verbose("The metadata entity is expired."),this.logger.verbose("Did not find cloud discovery metadata in the cache... Attempting to get cloud discovery metadata from the network."),[4,this.getCloudDiscoveryMetadataFromNetwork()]));case 1:if(t=e.sent())return this.logger.verbose("cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()"),r.updateCloudDiscoveryMetadata(t,!0),[2,Mf.NETWORK];if(this.logger.verbose("Did not find cloud discovery metadata from the network... Attempting to get cloud discovery metadata from hardcoded values."),(o=this.getCloudDiscoveryMetadataFromHarcodedValues())&&!this.options.skipAuthorityMetadataCache)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),r.updateCloudDiscoveryMetadata(o,!1),[2,Mf.HARDCODED_VALUES];throw this.logger.error("Did not find cloud discovery metadata from hardcoded values... Metadata could not be obtained from config, cache, network or hardcoded values. Throwing Untrusted Authority Error."),Ay.createUntrustedAuthorityError()}})})},sv.prototype.getCloudDiscoveryMetadataFromConfig=function(){if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");var e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),t=sv.getCloudDiscoveryMetadataFromNetworkResponse(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),t)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),t;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch(e){throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),Ay.createInvalidCloudDiscoveryMetadataError()}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),sv.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null},sv.prototype.getCloudDiscoveryMetadataFromNetwork=function(){return pf(this,void 0,void 0,function(){var o,r,n,i,a,s;return df(this,function(e){switch(e.label){case 0:o=""+wf.AAD_INSTANCE_DISCOVERY_ENDPT+this.canonicalAuthority+"oauth2/v2.0/authorize",r={},this.proxyUrl&&(r.proxyUrl=this.proxyUrl),n=null,e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(o,r)];case 2:if(i=e.sent(),s=a=void 0,(t=i.body).hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata"))a=i.body,s=a.metadata,this.logger.verbosePii("tenant_discovery_endpoint is: "+a.tenant_discovery_endpoint);else{if(!(t=i.body).hasOwnProperty("error")||!t.hasOwnProperty("error_description"))return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),[2,null];if(this.logger.warning("A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: "+i.status),(a=i.body).error===wf.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),[2,null];this.logger.warning("The CloudInstanceDiscoveryErrorResponse error is "+a.error),this.logger.warning("The CloudInstanceDiscoveryErrorResponse error description is "+a.error_description),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),s=[]}return this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),n=sv.getCloudDiscoveryMetadataFromNetworkResponse(s,this.hostnameAndPort),[3,4];case 3:return(s=e.sent())instanceof eg?this.logger.error("There was a network error while attempting to get the cloud discovery instance metadata.\nError: "+s.errorCode+"\nError Description: "+s.errorMessage):this.logger.error("A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\nError: "+s.name+"\nError Description: "+s.message),[2,null];case 4:return n||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),n=sv.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),[2,n]}var t})})},sv.prototype.getCloudDiscoveryMetadataFromHarcodedValues=function(){return this.canonicalAuthority in tv?tv[this.canonicalAuthority]:null},sv.prototype.isInKnownAuthorities=function(){var t=this;return 0<this.authorityOptions.knownAuthorities.filter(function(e){return Rm.getDomainFromUrl(e).toLowerCase()===t.hostnameAndPort}).length},sv.generateAuthority=function(e,t){var o;return t&&t.azureCloudInstance!==ty.None&&(o=t.tenant||wf.DEFAULT_COMMON_TENANT,o=t.azureCloudInstance+"/"+o+"/"),o||e},sv.createCloudDiscoveryMetadataFromHost=function(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}},sv.getCloudDiscoveryMetadataFromNetworkResponse=function(e,t){for(var o=0;o<e.length;o++){var r=e[o];if(-1<r.aliases.indexOf(t))return r}return null},sv.prototype.getPreferredCache=function(){if(this.discoveryComplete())return this.metadata.preferred_cache;throw Wg.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},sv.prototype.isAlias=function(e){return-1<this.metadata.aliases.indexOf(e)},sv.isPublicCloudAuthority=function(e){return 0<=wf.KNOWN_PUBLIC_CLOUDS.indexOf(e)},sv.buildRegionalAuthorityString=function(e,t,o){var r=new Rm(e);r.validateAsUri();var n=r.getUrlComponents(),e=t+"."+n.HostNameAndPort;this.isPublicCloudAuthority(n.HostNameAndPort)&&(e=t+"."+wf.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX);e=Rm.constructAuthorityUriFromObject(hf(hf({},r.getUrlComponents()),{HostNameAndPort:e})).urlString;return o?e+"?"+o:e},sv.replaceWithRegionalInformation=function(e,t){return e.authorization_endpoint=sv.buildRegionalAuthorityString(e.authorization_endpoint,t),e.token_endpoint=sv.buildRegionalAuthorityString(e.token_endpoint,t,wf.REGIONAL_AUTH_NON_MSI_QUERY_STRING),e.end_session_endpoint&&(e.end_session_endpoint=sv.buildRegionalAuthorityString(e.end_session_endpoint,t)),e},sv);function sv(e,t,o,r,n,i){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=o,this.authorityOptions=r,this.regionDiscovery=new nv(t),this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.proxyUrl=i||wf.EMPTY_STRING,this.logger=n}var cv=(uv.createDiscoveredInstance=function(r,n,i,a,s,c){return pf(this,void 0,void 0,function(){var t,o;return df(this,function(e){switch(e.label){case 0:t=uv.createInstance(r,n,i,a,s,c),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,t.resolveEndpointsAsync()];case 2:return e.sent(),[2,t];case 3:throw o=e.sent(),Wg.createEndpointDiscoveryIncompleteError(o);case 4:return[2]}})})},uv.createInstance=function(e,t,o,r,n,i){if(Qg.isEmpty(e))throw Ay.createUrlEmptyError();return new av(e,t,o,r,n,i)},uv);function uv(){}var lv=(hv.isServerTelemetryEntity=function(e,t){var o=0===e.indexOf(jf.CACHE_KEY),e=!0;return t&&(e=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),o&&e},hv);function hv(){this.failedRequests=[],this.errors=[],this.cacheHits=0}var pv=(dv.isThrottlingEntity=function(e,t){var o=!1;e&&(o=0===e.indexOf(Zf));e=!0;return t&&(e=t.hasOwnProperty("throttleTime")),o&&e},dv);function dv(){}var fv,gv={sendGetRequestAsync:function(){return Promise.reject(eg.createUnexpectedError("Network interface - sendGetRequestAsync() has not been implemented for the Network interface."))},sendPostRequestAsync:function(){return Promise.reject(eg.createUnexpectedError("Network interface - sendPostRequestAsync() has not been implemented for the Network interface."))}},yv={code:"missing_kid_error",desc:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided."},mv={code:"missing_alg_error",desc:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."},vv=(lf(_v,fv=eg),_v.createMissingKidError=function(){return new _v(yv.code,yv.desc)},_v.createMissingAlgError=function(){return new _v(mv.code,mv.desc)},_v);function _v(e,t){t=fv.call(this,e,t)||this;return t.name="JoseHeaderError",Object.setPrototypeOf(t,_v.prototype),t}var wv=(bv.getShrHeaderString=function(e){if(!e.kid)throw vv.createMissingKidError();if(!e.alg)throw vv.createMissingAlgError();e=new bv({typ:e.typ||Kf.Jwt,kid:e.kid,alg:e.alg});return JSON.stringify(e)},bv);function bv(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}var Cv=(Ev.prototype.generateCurrentRequestHeaderValue=function(){var e=""+this.apiId+jf.VALUE_SEPARATOR+this.cacheOutcome,t=[this.wrapperSKU,this.wrapperVer].join(jf.VALUE_SEPARATOR),e=[e,this.getRegionDiscoveryFields()].join(jf.VALUE_SEPARATOR);return[jf.SCHEMA_VERSION,e,t].join(jf.CATEGORY_SEPARATOR)},Ev.prototype.generateLastRequestHeaderValue=function(){var e=this.getLastRequests(),t=Ev.maxErrorsToSend(e),o=e.failedRequests.slice(0,2*t).join(jf.VALUE_SEPARATOR),r=e.errors.slice(0,t).join(jf.VALUE_SEPARATOR),n=e.errors.length,n=[n,t<n?jf.OVERFLOW_TRUE:jf.OVERFLOW_FALSE].join(jf.VALUE_SEPARATOR);return[jf.SCHEMA_VERSION,e.cacheHits,o,r,n].join(jf.CATEGORY_SEPARATOR)},Ev.prototype.cacheFailedRequest=function(e){var t=this.getLastRequests();t.errors.length>=jf.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),Qg.isEmpty(e.subError)?Qg.isEmpty(e.errorCode)?e&&e.toString()?t.errors.push(e.toString()):t.errors.push(jf.UNKNOWN_ERROR):t.errors.push(e.errorCode):t.errors.push(e.subError),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)},Ev.prototype.incrementCacheHits=function(){var e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits},Ev.prototype.getLastRequests=function(){var e=new lv;return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e},Ev.prototype.clearTelemetryCache=function(){var e,t=this.getLastRequests(),o=Ev.maxErrorsToSend(t);o===t.errors.length?this.cacheManager.removeItem(this.telemetryCacheKey):((e=new lv).failedRequests=t.failedRequests.slice(2*o),e.errors=t.errors.slice(o),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e))},Ev.maxErrorsToSend=function(e){for(var t=0,o=0,r=e.errors.length,n=0;n<r;n++){var i=e.failedRequests[2*n]||wf.EMPTY_STRING,a=e.failedRequests[2*n+1]||wf.EMPTY_STRING,s=e.errors[n]||wf.EMPTY_STRING;if(!((o+=i.toString().length+a.toString().length+s.length+3)<jf.MAX_LAST_HEADER_BYTES))break;t+=1}return t},Ev.prototype.getRegionDiscoveryFields=function(){var e=[];return e.push(this.regionUsed||wf.EMPTY_STRING),e.push(this.regionSource||wf.EMPTY_STRING),e.push(this.regionOutcome||wf.EMPTY_STRING),e.join(",")},Ev.prototype.updateRegionDiscoveryMetadata=function(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome},Ev.prototype.setCacheOutcome=function(e){this.cacheOutcome=e},Ev);function Ev(e,t){this.cacheOutcome=Ff.NO_CACHE_HIT,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||wf.EMPTY_STRING,this.wrapperVer=e.wrapperVer||wf.EMPTY_STRING,this.telemetryCacheKey=jf.CACHE_KEY+kf.CACHE_KEY_SEPARATOR+e.clientId}Sv.prototype.startMeasurement=function(e,t){var o=this,r=t||this.generateId();t||this.logger.info("PerformanceClient: No correlation id provided for "+e+", generating",r),this.logger.trace("PerformanceClient: Performance measurement started for "+e,r);t=this.startPerformanceMeasuremeant(e,r);t.startMeasurement();var n={eventId:this.generateId(),status:Km.InProgress,authority:this.authority,libraryName:this.libraryName,libraryVersion:this.libraryVersion,clientId:this.clientId,name:e,startTimeMs:Date.now(),correlationId:r};this.cacheEventByCorrelationId(n);e={appName:null===(e=this.applicationTelemetry)||void 0===e?void 0:e.appName,appVersion:null===(e=this.applicationTelemetry)||void 0===e?void 0:e.appVersion};return this.addStaticFields(e,r),this.cacheMeasurement(n,t),{endMeasurement:function(e){e=o.endMeasurement(hf(hf({},n),e));return e&&o.cacheEventByCorrelationId(e),e},flushMeasurement:function(){return o.flushMeasurements(n.name,n.correlationId)},discardMeasurement:function(){return o.discardMeasurements(n.correlationId)},addStaticFields:function(e){return o.addStaticFields(e,n.correlationId)},measurement:t,event:n}},Sv.prototype.endMeasurement=function(e){var t=this.measurementsById.get(e.eventId);if(t){this.measurementsById.delete(e.eventId),t.endMeasurement();t=t.flushMeasurement();if(null!==t)return this.logger.trace("PerformanceClient: Performance measurement ended for "+e.name+": "+t+" ms",e.correlationId),hf(hf({durationMs:Math.round(t)},e),{status:Km.Completed});this.logger.trace("PerformanceClient: Performance measurement not taken",e.correlationId)}else this.logger.trace("PerformanceClient: Measurement not found for "+e.eventId,e.correlationId);return null},Sv.prototype.addStaticFields=function(e,t){var o=this.staticFieldsByCorrelationId.get(t);o?(this.logger.trace("PerformanceClient: Updating static fields"),this.staticFieldsByCorrelationId.set(t,hf(hf({},o),e))):(this.logger.trace("PerformanceClient: Adding static fields"),this.staticFieldsByCorrelationId.set(t,e))},Sv.prototype.cacheEventByCorrelationId=function(e){var t=this.eventsByCorrelationId.get(e.correlationId);t?(this.logger.trace("PerformanceClient: Performance measurement for "+e.name+" added/updated",e.correlationId),t.set(e.eventId,e)):(this.logger.trace("PerformanceClient: Performance measurement for "+e.name+" started",e.correlationId),this.eventsByCorrelationId.set(e.correlationId,(new Map).set(e.eventId,e)))},Sv.prototype.cacheMeasurement=function(e,t){this.measurementsById.set(e.eventId,t)},Sv.prototype.flushMeasurements=function(r,n){var i=this;this.logger.trace("PerformanceClient: Performance measurements flushed for "+r,n);var o,e,t=this.eventsByCorrelationId.get(n);t?(this.discardMeasurements(n),o=[],t.forEach(function(e){var t;e.name!==r&&e.status!==Km.Completed&&(i.logger.trace("PerformanceClient: Incomplete submeasurement "+e.name+" found for "+r,n),(t=i.endMeasurement(e))&&o.push(t)),o.push(e)}),0<(t=(e=o.sort(function(e,t){return e.startTimeMs-t.startTimeMs})).filter(function(e){return e.name===r&&e.status===Km.Completed})).length?(1<t.length&&this.logger.verbose("PerformanceClient: Multiple distinct top-level performance events found, using the first",n),t=t[0],this.logger.verbose("PerformanceClient: Measurement found for "+r,n),e=e.reduce(function(e,t){var o;return t.name!==r&&(i.logger.trace("PerformanceClient: Complete submeasurement found for "+t.name,n),e[o=t.name+"DurationMs"]?i.logger.verbose("PerformanceClient: Submeasurement for "+r+" already exists for "+t.name+", ignoring",n):e[o]=t.durationMs),e},t),t=this.staticFieldsByCorrelationId.get(n),t=hf(hf({},e),t),this.emitEvents([t],e.correlationId)):this.logger.verbose("PerformanceClient: No completed top-level measurements found for "+r,n)):this.logger.verbose("PerformanceClient: No measurements found",n)},Sv.prototype.discardMeasurements=function(e){this.logger.trace("PerformanceClient: Performance measurements discarded",e),this.eventsByCorrelationId.delete(e)},Sv.prototype.addPerformanceCallback=function(e){var t=this.generateId();return this.callbacks.set(t,e),this.logger.verbose("PerformanceClient: Performance callback registered with id: "+t),t},Sv.prototype.removePerformanceCallback=function(e){var t=this.callbacks.delete(e);return t?this.logger.verbose("PerformanceClient: Performance callback "+e+" removed."):this.logger.verbose("PerformanceClient: Performance callback "+e+" not removed."),t},Sv.prototype.emitEvents=function(o,r){var n=this;this.logger.verbose("PerformanceClient: Emitting performance events",r),this.callbacks.forEach(function(e,t){n.logger.trace("PerformanceClient: Emitting event to callback "+t,r),e.apply(null,[o])})},r=Sv;function Sv(e,t,o,r,n,i){this.authority=t,this.libraryName=r,this.libraryVersion=n,this.applicationTelemetry=i,this.clientId=e,this.logger=o,this.callbacks=new Map,this.eventsByCorrelationId=new Map,this.staticFieldsByCorrelationId=new Map,this.measurementsById=new Map}var Tv=(Iv.prototype.startMeasurement=function(){},Iv.prototype.endMeasurement=function(){},Iv.prototype.flushMeasurement=function(){return null},Iv);function Iv(){}var Av,kv=(lf(Ov,Av=r),Ov.prototype.generateId=function(){return"callback-id"},Ov.prototype.startPerformanceMeasuremeant=function(){return new Tv},Ov);function Ov(){return null!==Av&&Av.apply(this,arguments)||this}var Pv,xv={code:"pkce_not_created",desc:"The PKCE code challenge and verifier could not be generated."},Rv={code:"crypto_nonexistent",desc:"The crypto object or function is not available."},Mv={code:"http_method_not_implemented",desc:"The HTTP method given has not been implemented in this library."},Nv={code:"empty_navigate_uri",desc:"Navigation URI is empty. Please check stack trace for more info."},Lv={code:"hash_empty_error",desc:"Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. For more visit: aka.ms/msaljs/browser-errors."},Dv={code:"no_state_in_hash",desc:"Hash does not contain state. Please verify that the request originated from msal."},qv={code:"hash_does_not_contain_known_properties",desc:"Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. For more visit: aka.ms/msaljs/browser-errors."},jv={code:"unable_to_parse_state",desc:"Unable to parse state. Please verify that the request originated from msal."},Uv={code:"state_interaction_type_mismatch",desc:"Hash contains state but the interaction type does not match the caller."},Hv={code:"interaction_in_progress",desc:"Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. For more visit: aka.ms/msaljs/browser-errors."},zv={code:"popup_window_error",desc:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser."},Bv={code:"empty_window_error",desc:"window.open returned null or undefined window object."},Fv={code:"user_cancelled",desc:"User cancelled the flow."},Kv={code:"monitor_window_timeout",desc:"Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},Gv={code:"monitor_window_timeout",desc:"Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},Yv={code:"redirect_in_iframe",desc:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs."},Zv={code:"block_iframe_reload",desc:"Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors"},Wv={code:"block_nested_popups",desc:"Request was blocked inside a popup because MSAL detected it was running in a popup."},Vv={code:"iframe_closed_prematurely",desc:"The iframe being monitored was closed prematurely."},Jv={code:"silent_logout_unsupported",desc:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead."},Qv={code:"no_account_error",desc:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request."},Xv={code:"silent_prompt_value_error",desc:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'."},$v={code:"no_token_request_cache_error",desc:"No token request found in cache."},e_={code:"unable_to_parse_token_request_cache_error",desc:"The cached token request could not be parsed."},t_={code:"no_cached_authority_error",desc:"No cached authority found."},o_={code:"auth_request_not_set_error",desc:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler"},r_={code:"invalid_cache_type",desc:"Invalid cache type"},n_={code:"non_browser_environment",desc:"Login and token requests are not supported in non-browser environments."},i_={code:"database_not_open",desc:"Database is not open!"},a_={code:"no_network_connectivity",desc:"No network connectivity. Check your internet connection."},s_={code:"post_request_failed",desc:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'"},c_={code:"get_request_failed",desc:"Network request failed. Please check the network trace to determine root cause."},u_={code:"failed_to_parse_response",desc:"Failed to parse network response. Check network trace."},l_={code:"unable_to_load_token",desc:"Error loading token to cache."},h_={code:"crypto_key_not_found",desc:"Cryptographic Key or Keypair not found in browser storage."},p_={code:"auth_code_required",desc:"An authorization code must be provided (as the `code` property on the request) to this flow."},d_={code:"auth_code_or_nativeAccountId_required",desc:"An authorization code or nativeAccountId must be provided to this flow."},f_={code:"database_unavailable",desc:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts."},g_={code:"unable_to_acquire_token_from_native_platform",desc:"Unable to acquire token from native platform. For a list of possible reasons visit aka.ms/msaljs/browser-errors."},y_={code:"native_handshake_timeout",desc:"Timed out while attempting to establish connection to browser extension"},m_={code:"native_extension_not_installed",desc:"Native extension is not installed. If you think this is a mistake call the initialize function."},v_={code:"native_connection_not_established",desc:"Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). For more please visit aka.ms/msaljs/browser-errors."},__={code:"native_broker_called_before_initialize",desc:"You must call and await the initialize function before attempting to call any other MSAL API when native brokering is enabled. For more please visit aka.ms/msaljs/browser-errors."},w_={code:"native_prompt_not_supported",desc:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow."},b_=(of(C_,Pv=eg),C_.createPkceNotGeneratedError=function(e){return new C_(xv.code,xv.desc+" Detail:"+e)},C_.createCryptoNotAvailableError=function(e){return new C_(Rv.code,Rv.desc+" Detail:"+e)},C_.createHttpMethodNotImplementedError=function(e){return new C_(Mv.code,Mv.desc+" Given Method: "+e)},C_.createEmptyNavigationUriError=function(){return new C_(Nv.code,Nv.desc)},C_.createEmptyHashError=function(e){return new C_(Lv.code,Lv.desc+" Given Url: "+e)},C_.createHashDoesNotContainStateError=function(){return new C_(Dv.code,Dv.desc)},C_.createHashDoesNotContainKnownPropertiesError=function(){return new C_(qv.code,qv.desc)},C_.createUnableToParseStateError=function(){return new C_(jv.code,jv.desc)},C_.createStateInteractionTypeMismatchError=function(){return new C_(Uv.code,Uv.desc)},C_.createInteractionInProgressError=function(){return new C_(Hv.code,Hv.desc)},C_.createPopupWindowError=function(e){var t=zv.desc,t=Qg.isEmpty(e)?t:t+" Details: "+e;return new C_(zv.code,t)},C_.createEmptyWindowCreatedError=function(){return new C_(Bv.code,Bv.desc)},C_.createUserCancelledError=function(){return new C_(Fv.code,Fv.desc)},C_.createMonitorPopupTimeoutError=function(){return new C_(Kv.code,Kv.desc)},C_.createMonitorIframeTimeoutError=function(){return new C_(Gv.code,Gv.desc)},C_.createRedirectInIframeError=function(e){return new C_(Yv.code,Yv.desc+" (window.parent !== window) => "+e)},C_.createBlockReloadInHiddenIframeError=function(){return new C_(Zv.code,Zv.desc)},C_.createBlockAcquireTokenInPopupsError=function(){return new C_(Wv.code,Wv.desc)},C_.createIframeClosedPrematurelyError=function(){return new C_(Vv.code,Vv.desc)},C_.createSilentLogoutUnsupportedError=function(){return new C_(Jv.code,Jv.desc)},C_.createNoAccountError=function(){return new C_(Qv.code,Qv.desc)},C_.createSilentPromptValueError=function(e){return new C_(Xv.code,Xv.desc+" Given value: "+e)},C_.createUnableToParseTokenRequestCacheError=function(){return new C_(e_.code,e_.desc)},C_.createNoTokenRequestCacheError=function(){return new C_($v.code,$v.desc)},C_.createAuthRequestNotSetError=function(){return new C_(o_.code,o_.desc)},C_.createNoCachedAuthorityError=function(){return new C_(t_.code,t_.desc)},C_.createInvalidCacheTypeError=function(){return new C_(r_.code,""+r_.desc)},C_.createNonBrowserEnvironmentError=function(){return new C_(n_.code,n_.desc)},C_.createDatabaseNotOpenError=function(){return new C_(i_.code,i_.desc)},C_.createNoNetworkConnectivityError=function(){return new C_(a_.code,a_.desc)},C_.createPostRequestFailedError=function(e,t){return new C_(s_.code,s_.desc+" | Network client threw: "+e+" | Attempted to reach: "+t.split("?")[0])},C_.createGetRequestFailedError=function(e,t){return new C_(c_.code,c_.desc+" | Network client threw: "+e+" | Attempted to reach: "+t.split("?")[0])},C_.createFailedToParseNetworkResponseError=function(e){return new C_(u_.code,u_.desc+" | Attempted to reach: "+e.split("?")[0])},C_.createUnableToLoadTokenError=function(e){return new C_(l_.code,l_.desc+" | "+e)},C_.createSigningKeyNotFoundInStorageError=function(e){return new C_(h_.code,h_.desc+" | No match found for KeyId: "+e)},C_.createAuthCodeRequiredError=function(){return new C_(p_.code,p_.desc)},C_.createAuthCodeOrNativeAccountIdRequiredError=function(){return new C_(d_.code,d_.desc)},C_.createDatabaseUnavailableError=function(){return new C_(f_.code,f_.desc)},C_.createUnableToAcquireTokenFromNativePlatformError=function(){return new C_(g_.code,g_.desc)},C_.createNativeHandshakeTimeoutError=function(){return new C_(y_.code,y_.desc)},C_.createNativeExtensionNotInstalledError=function(){return new C_(m_.code,m_.desc)},C_.createNativeConnectionNotEstablishedError=function(){return new C_(v_.code,v_.desc)},C_.createNativeBrokerCalledBeforeInitialize=function(){return new C_(__.code,__.desc)},C_.createNativePromptParameterNotSupportedError=function(){return new C_(w_.code,w_.desc)},C_);function C_(e,t){t=Pv.call(this,e,t)||this;return Object.setPrototypeOf(t,C_.prototype),t.name="BrowserAuthError",t}var E_,S_,T_,I_,A_,k_,O_,P_={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},x_="53ee284d-920a-4b59-9d30-a60315b26836",R_="ppnbnpeolgkicgegkbkbjmhlideopiji",M_="MATS";(w=E_=E_||{}).HandshakeRequest="Handshake",w.HandshakeResponse="HandshakeResponse",w.GetToken="GetToken",w.Response="Response",(w=S_=S_||{}).LocalStorage="localStorage",w.SessionStorage="sessionStorage",w.MemoryStorage="memoryStorage",(w=T_=T_||{}).GET="GET",w.POST="POST",(w=I_=I_||{}).AUTHORITY="authority",w.ACQUIRE_TOKEN_ACCOUNT="acquireToken.account",w.SESSION_STATE="session.state",w.REQUEST_STATE="request.state",w.NONCE_IDTOKEN="nonce.id_token",w.ORIGIN_URI="request.origin",w.RENEW_STATUS="token.renew.status",w.URL_HASH="urlHash",w.REQUEST_PARAMS="request.params",w.SCOPES="scopes",w.INTERACTION_STATUS_KEY="interaction.status",w.CCS_CREDENTIAL="ccs.credential",w.CORRELATION_ID="request.correlationId",w.NATIVE_REQUEST="request.native",w.REDIRECT_CONTEXT="request.redirect.context",(w=A_=A_||{}).WRAPPER_SKU="wrapper.sku",w.WRAPPER_VER="wrapper.version",(w=k_=k_||{})[w.acquireTokenRedirect=861]="acquireTokenRedirect",w[w.acquireTokenPopup=862]="acquireTokenPopup",w[w.ssoSilent=863]="ssoSilent",w[w.acquireTokenSilent_authCode=864]="acquireTokenSilent_authCode",w[w.handleRedirectPromise=865]="handleRedirectPromise",w[w.acquireTokenByCode=866]="acquireTokenByCode",w[w.acquireTokenSilent_silentFlow=61]="acquireTokenSilent_silentFlow",w[w.logout=961]="logout",w[w.logoutPopup=962]="logoutPopup",(w=O_=O_||{}).Redirect="redirect",w.Popup="popup",w.Silent="silent",w.None="none",(w=fw=fw||{}).Startup="startup",w.Login="login",w.Logout="logout",w.AcquireToken="acquireToken",w.SsoSilent="ssoSilent",w.HandleRedirect="handleRedirect",w.None="none";var N_={scopes:bf},L_="jwk";(fw=hw=hw||{}).React="@azure/msal-react",fw.Angular="@azure/msal-angular";var D_,q_="msal.db";(w=D_=D_||{})[w.Default=0]="Default",w[w.AccessToken=1]="AccessToken",w[w.AccessTokenAndRefreshToken=2]="AccessTokenAndRefreshToken",w[w.RefreshToken=3]="RefreshToken",w[w.RefreshTokenAndNetwork=4]="RefreshTokenAndNetwork",w[w.Skip=5]="Skip";var j_,U_={code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},H_={code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},z_={code:"storage_not_supported",desc:"Given storage configuration option was not supported."},B_={code:"no_redirect_callbacks",desc:"No redirect callbacks have been set. Please call setRedirectCallbacks() with the appropriate function arguments before continuing. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},F_={code:"stubbed_public_client_application_called",desc:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors"},K_={code:"in_mem_redirect_unavailable",desc:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."},G_={code:"entropy_not_provided",desc:"The available browser crypto interface requires entropy set via system.cryptoOptions.entropy configuration option."},Y_=(of(Z_,j_=eg),Z_.createRedirectUriEmptyError=function(){return new Z_(U_.code,U_.desc)},Z_.createPostLogoutRedirectUriEmptyError=function(){return new Z_(H_.code,H_.desc)},Z_.createStorageNotSupportedError=function(e){return new Z_(z_.code,z_.desc+" Given Location: "+e)},Z_.createRedirectCallbacksNotSetError=function(){return new Z_(B_.code,B_.desc)},Z_.createStubPcaInstanceCalledError=function(){return new Z_(F_.code,F_.desc)},Z_.createInMemoryRedirectUnavailableError=function(){return new Z_(K_.code,K_.desc)},Z_.createEntropyNotProvided=function(){return new Z_(G_.code,G_.desc)},Z_);function Z_(e,t){t=j_.call(this,e,t)||this;return t.name="BrowserConfigurationAuthError",Object.setPrototypeOf(t,Z_.prototype),t}var W_=(V_.prototype.validateWindowStorage=function(e){if(e!==S_.LocalStorage&&e!==S_.SessionStorage)throw Y_.createStorageNotSupportedError(e);if(!!!window[e])throw Y_.createStorageNotSupportedError(e)},V_.prototype.getItem=function(e){return this.windowStorage.getItem(e)},V_.prototype.setItem=function(e,t){this.windowStorage.setItem(e,t)},V_.prototype.removeItem=function(e){this.windowStorage.removeItem(e)},V_.prototype.getKeys=function(){return Object.keys(this.windowStorage)},V_.prototype.containsKey=function(e){return this.windowStorage.hasOwnProperty(e)},V_);function V_(e){this.validateWindowStorage(e),this.windowStorage=window[e]}var J_=(Q_.prototype.getItem=function(e){return this.cache.get(e)||null},Q_.prototype.setItem=function(e,t){this.cache.set(e,t)},Q_.prototype.removeItem=function(e){this.cache.delete(e)},Q_.prototype.getKeys=function(){var o=[];return this.cache.forEach(function(e,t){o.push(t)}),o},Q_.prototype.containsKey=function(e){return this.cache.has(e)},Q_.prototype.clear=function(){this.cache.clear()},Q_);function Q_(){this.cache=new Map}var X_=($_.extractBrowserRequestState=function(e,t){if(Qg.isEmpty(t))return null;try{return Om.parseRequestState(e,t).libraryState.meta}catch(e){throw Wg.createInvalidStateError(t,e)}},$_.parseServerResponseFromHash=function(e){if(!e)return{};e=new Rm(e);return Rm.getDeserializedHash(e.getHash())},$_);function $_(){}var ew,tw=(of(ow,ew=jy),ow.prototype.setupBrowserStorage=function(e){switch(e){case S_.LocalStorage:case S_.SessionStorage:try{return new W_(e)}catch(e){this.logger.verbose(e);break}}return this.cacheConfig.cacheLocation=S_.MemoryStorage,new J_},ow.prototype.setupTemporaryCacheStorage=function(e){switch(e){case S_.LocalStorage:case S_.SessionStorage:try{return new W_(S_.SessionStorage)}catch(e){return this.logger.verbose(e),this.internalStorage}case S_.MemoryStorage:default:return this.internalStorage}},ow.prototype.migrateCacheEntries=function(){var o=this,e=wf.CACHE_PREFIX+"."+yf.ID_TOKEN,t=wf.CACHE_PREFIX+"."+yf.CLIENT_INFO,r=wf.CACHE_PREFIX+"."+yf.ERROR,n=wf.CACHE_PREFIX+"."+yf.ERROR_DESC,i=[this.browserStorage.getItem(e),this.browserStorage.getItem(t),this.browserStorage.getItem(r),this.browserStorage.getItem(n)];[yf.ID_TOKEN,yf.CLIENT_INFO,yf.ERROR,yf.ERROR_DESC].forEach(function(e,t){return o.migrateCacheEntry(e,i[t])})},ow.prototype.migrateCacheEntry=function(e,t){t&&this.setTemporaryCache(e,t,!0)},ow.prototype.validateAndParseJson=function(e){try{var t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch(e){return null}},ow.prototype.getItem=function(e){return this.browserStorage.getItem(e)},ow.prototype.setItem=function(e,t){this.browserStorage.setItem(e,t)},ow.prototype.getAccount=function(e){e=this.getItem(e);if(!e)return null;e=this.validateAndParseJson(e);return e&&Ny.isAccountEntity(e)?jy.toObject(new Ny,e):null},ow.prototype.setAccount=function(e){this.logger.trace("BrowserCacheManager.setAccount called");var t=e.generateAccountKey();this.setItem(t,JSON.stringify(e))},ow.prototype.getIdTokenCredential=function(e){e=this.getItem(e);if(!e)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null;e=this.validateAndParseJson(e);return e&&hm.isIdTokenEntity(e)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),jy.toObject(new hm,e)):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null)},ow.prototype.setIdTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},ow.prototype.getAccessTokenCredential=function(e){e=this.getItem(e);if(!e)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null;e=this.validateAndParseJson(e);return e&&ym.isAccessTokenEntity(e)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),jy.toObject(new ym,e)):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null)},ow.prototype.setAccessTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},ow.prototype.getRefreshTokenCredential=function(e){e=this.getItem(e);if(!e)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null;e=this.validateAndParseJson(e);return e&&_m.isRefreshTokenEntity(e)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),jy.toObject(new _m,e)):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null)},ow.prototype.setRefreshTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},ow.prototype.getAppMetadata=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;t=this.validateAndParseJson(t);return t&&Dm.isAppMetadataEntity(e,t)?(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),jy.toObject(new Dm,t)):(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null)},ow.prototype.setAppMetadata=function(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");var t=e.generateAppMetadataKey();this.setItem(t,JSON.stringify(e))},ow.prototype.getServerTelemetry=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;t=this.validateAndParseJson(t);return t&&lv.isServerTelemetryEntity(e,t)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),jy.toObject(new lv,t)):(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null)},ow.prototype.setServerTelemetry=function(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))},ow.prototype.getAuthorityMetadata=function(e){var t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;t=this.validateAndParseJson(t);return t&&ov.isAuthorityMetadataEntity(e,t)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),jy.toObject(new ov,t)):null},ow.prototype.getAuthorityMetadataKeys=function(){var t=this;return this.internalStorage.getKeys().filter(function(e){return t.isAuthorityMetadata(e)})},ow.prototype.setWrapperMetadata=function(e,t){this.internalStorage.setItem(A_.WRAPPER_SKU,e),this.internalStorage.setItem(A_.WRAPPER_VER,t)},ow.prototype.getWrapperMetadata=function(){return[this.internalStorage.getItem(A_.WRAPPER_SKU)||wf.EMPTY_STRING,this.internalStorage.getItem(A_.WRAPPER_VER)||wf.EMPTY_STRING]},ow.prototype.setAuthorityMetadata=function(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))},ow.prototype.getActiveAccount=function(){var e=this.generateCacheKey(yf.ACTIVE_ACCOUNT_FILTERS),t=this.getItem(e);if(!t){this.logger.trace("No active account filters cache schema found, looking for legacy schema");e=this.generateCacheKey(yf.ACTIVE_ACCOUNT),e=this.getItem(e);if(!e)return this.logger.trace("No active account found"),null;e=this.getAccountInfoByFilter({localAccountId:e})[0]||null;return e?(this.logger.trace("Legacy active account cache schema found"),this.logger.trace("Adding active account filters cache schema"),this.setActiveAccount(e),e):null}t=this.validateAndParseJson(t);return t?(this.logger.trace("Active account filters schema found"),this.getAccountInfoByFilter({homeAccountId:t.homeAccountId,localAccountId:t.localAccountId})[0]||null):(this.logger.trace("No active account found"),null)},ow.prototype.setActiveAccount=function(e){var t,o=this.generateCacheKey(yf.ACTIVE_ACCOUNT_FILTERS),r=this.generateCacheKey(yf.ACTIVE_ACCOUNT);e?(this.logger.verbose("setActiveAccount: Active account set"),t={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId},this.browserStorage.setItem(o,JSON.stringify(t)),this.browserStorage.setItem(r,e.localAccountId)):(this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(o),this.browserStorage.removeItem(r))},ow.prototype.getAccountInfoByFilter=function(t){return this.getAllAccounts().filter(function(e){return(!t.username||t.username.toLowerCase()===e.username.toLowerCase())&&((!t.homeAccountId||t.homeAccountId===e.homeAccountId)&&((!t.localAccountId||t.localAccountId===e.localAccountId)&&((!t.tenantId||t.tenantId===e.tenantId)&&(!t.environment||t.environment===e.environment))))})},ow.prototype.getAccountInfoByHints=function(o,r){var e=this.getAllAccounts().filter(function(e){if(r){var t=e.idTokenClaims&&e.idTokenClaims.sid;return r===t}return!!o&&o===e.username});if(1===e.length)return e[0];if(1<e.length)throw Wg.createMultipleMatchingAccountsInCacheError();return null},ow.prototype.getThrottlingCache=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;t=this.validateAndParseJson(t);return t&&pv.isThrottlingEntity(e,t)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),jy.toObject(new pv,t)):(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null)},ow.prototype.setThrottlingCache=function(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))},ow.prototype.getTemporaryCache=function(e,t){e=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){var o=this.getItemCookie(e);if(o)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),o}o=this.temporaryCacheStorage.getItem(e);if(o)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o;if(this.cacheConfig.cacheLocation===S_.LocalStorage){e=this.browserStorage.getItem(e);if(e)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),e}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null},ow.prototype.setTemporaryCache=function(e,t,o){e=o?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(e,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(e,t))},ow.prototype.removeItem=function(e){return this.browserStorage.removeItem(e),this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(e)),!0},ow.prototype.containsKey=function(e){return this.browserStorage.containsKey(e)||this.temporaryCacheStorage.containsKey(e)},ow.prototype.getKeys=function(){return cf(this.browserStorage.getKeys(),this.temporaryCacheStorage.getKeys())},ow.prototype.clear=function(){return af(this,void 0,void 0,function(){var t=this;return sf(this,function(e){switch(e.label){case 0:return[4,this.removeAllAccounts()];case 1:return e.sent(),this.removeAppMetadata(),this.getKeys().forEach(function(e){!t.browserStorage.containsKey(e)&&!t.temporaryCacheStorage.containsKey(e)||-1===e.indexOf(wf.CACHE_PREFIX)&&-1===e.indexOf(t.clientId)||t.removeItem(e)}),this.internalStorage.clear(),[2]}})})},ow.prototype.setItemCookie=function(e,t,o){t=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/;SameSite=Lax;";o&&(t+="expires="+this.getCookieExpirationTime(o)+";"),this.cacheConfig.secureCookies&&(t+="Secure;"),document.cookie=t},ow.prototype.getItemCookie=function(e){for(var t=encodeURIComponent(e)+"=",o=document.cookie.split(";"),r=0;r<o.length;r++){for(var n=o[r];" "===n.charAt(0);)n=n.substring(1);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}return wf.EMPTY_STRING},ow.prototype.clearMsalCookies=function(){var o=this,r=wf.CACHE_PREFIX+"."+this.clientId;document.cookie.split(";").forEach(function(e){for(;" "===e.charAt(0);)e=e.substring(1);var t;0===e.indexOf(r)&&(t=e.split("=")[0],o.clearItemCookie(t))})},ow.prototype.clearItemCookie=function(e){this.setItemCookie(e,wf.EMPTY_STRING,-1)},ow.prototype.getCookieExpirationTime=function(e){var t=new Date;return new Date(t.getTime()+e*this.COOKIE_LIFE_MULTIPLIER).toUTCString()},ow.prototype.getCache=function(){return this.browserStorage},ow.prototype.setCache=function(){},ow.prototype.generateCacheKey=function(e){return this.validateAndParseJson(e)?JSON.stringify(e):Qg.startsWith(e,wf.CACHE_PREFIX)||Qg.startsWith(e,yf.ADAL_ID_TOKEN)?e:wf.CACHE_PREFIX+"."+this.clientId+"."+e},ow.prototype.generateAuthorityKey=function(e){e=Om.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(I_.AUTHORITY+"."+e)},ow.prototype.generateNonceKey=function(e){e=Om.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(I_.NONCE_IDTOKEN+"."+e)},ow.prototype.generateStateKey=function(e){e=Om.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(I_.REQUEST_STATE+"."+e)},ow.prototype.getCachedAuthority=function(e){e=this.generateStateKey(e),e=this.getTemporaryCache(e);if(!e)return null;e=this.generateAuthorityKey(e);return this.getTemporaryCache(e)},ow.prototype.updateCacheEntries=function(e,t,o,r,n){this.logger.trace("BrowserCacheManager.updateCacheEntries called");var i=this.generateStateKey(e);this.setTemporaryCache(i,e,!1);i=this.generateNonceKey(e);this.setTemporaryCache(i,t,!1);var a,e=this.generateAuthorityKey(e);this.setTemporaryCache(e,o,!1),n?(a={credential:n.homeAccountId,type:om.HOME_ACCOUNT_ID},this.setTemporaryCache(I_.CCS_CREDENTIAL,JSON.stringify(a),!0)):Qg.isEmpty(r)||(a={credential:r,type:om.UPN},this.setTemporaryCache(I_.CCS_CREDENTIAL,JSON.stringify(a),!0))},ow.prototype.resetRequestCache=function(t){var o=this;this.logger.trace("BrowserCacheManager.resetRequestCache called"),Qg.isEmpty(t)||this.getKeys().forEach(function(e){-1!==e.indexOf(t)&&o.removeItem(e)}),t&&(this.removeItem(this.generateStateKey(t)),this.removeItem(this.generateNonceKey(t)),this.removeItem(this.generateAuthorityKey(t))),this.removeItem(this.generateCacheKey(I_.REQUEST_PARAMS)),this.removeItem(this.generateCacheKey(I_.ORIGIN_URI)),this.removeItem(this.generateCacheKey(I_.URL_HASH)),this.removeItem(this.generateCacheKey(I_.CORRELATION_ID)),this.removeItem(this.generateCacheKey(I_.CCS_CREDENTIAL)),this.removeItem(this.generateCacheKey(I_.NATIVE_REQUEST)),this.setInteractionInProgress(!1)},ow.prototype.cleanRequestByState=function(e){this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e&&(e=this.generateStateKey(e),e=this.temporaryCacheStorage.getItem(e),this.logger.infoPii("BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: "+e),this.resetRequestCache(e||wf.EMPTY_STRING)),this.clearMsalCookies()},ow.prototype.cleanRequestByInteractionType=function(o){var r=this;this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.getKeys().forEach(function(e){var t;-1!==e.indexOf(I_.REQUEST_STATE)&&(!(t=r.temporaryCacheStorage.getItem(e))||(e=X_.extractBrowserRequestState(r.cryptoImpl,t))&&e.interactionType===o&&(r.logger.infoPii("BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: "+t),r.resetRequestCache(t)))}),this.clearMsalCookies(),this.setInteractionInProgress(!1)},ow.prototype.cacheCodeRequest=function(e,t){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");e=t.base64Encode(JSON.stringify(e));this.setTemporaryCache(I_.REQUEST_PARAMS,e,!0)},ow.prototype.getCachedRequest=function(e,t){this.logger.trace("BrowserCacheManager.getCachedRequest called");var o=this.getTemporaryCache(I_.REQUEST_PARAMS,!0);if(!o)throw b_.createNoTokenRequestCacheError();o=this.validateAndParseJson(t.base64Decode(o));if(!o)throw b_.createUnableToParseTokenRequestCacheError();if(this.removeItem(this.generateCacheKey(I_.REQUEST_PARAMS)),Qg.isEmpty(o.authority)){e=this.generateAuthorityKey(e),e=this.getTemporaryCache(e);if(!e)throw b_.createNoCachedAuthorityError();o.authority=e}return o},ow.prototype.getCachedNativeRequest=function(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");var e=this.getTemporaryCache(I_.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;e=this.validateAndParseJson(e);return e||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)},ow.prototype.isInteractionInProgress=function(e){var t=this.getInteractionInProgress();return e?t===this.clientId:!!t},ow.prototype.getInteractionInProgress=function(){var e=wf.CACHE_PREFIX+"."+I_.INTERACTION_STATUS_KEY;return this.getTemporaryCache(e,!1)},ow.prototype.setInteractionInProgress=function(e){var t=wf.CACHE_PREFIX+"."+I_.INTERACTION_STATUS_KEY;if(e){if(this.getInteractionInProgress())throw b_.createInteractionInProgressError();this.setTemporaryCache(t,this.clientId,!1)}else this.getInteractionInProgress()!==this.clientId||this.removeItem(t)},ow.prototype.getLegacyLoginHint=function(){var e=this.getTemporaryCache(yf.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(yf.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));var t=this.getTemporaryCache(yf.ID_TOKEN,!0);t&&(this.removeItem(this.generateCacheKey(yf.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));e=t||e;if(e){e=new Dy(e,this.cryptoImpl);if(e.claims&&e.claims.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),e.claims.preferred_username;if(e.claims&&e.claims.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),e.claims.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null},ow.prototype.updateCredentialCacheKey=function(e,t){var o=t.generateCredentialKey();if(e!==o){var r=this.getItem(e);if(r)return this.removeItem(e),this.setItem(o,r),this.logger.verbose("Updated an outdated "+t.credentialType+" cache key"),o;this.logger.error("Attempted to update an outdated "+t.credentialType+" cache key but no item matching the outdated key was found in storage")}return e},ow.prototype.getRedirectRequestContext=function(){return this.getTemporaryCache(I_.REDIRECT_CONTEXT,!0)},ow.prototype.setRedirectRequestContext=function(e){this.setTemporaryCache(I_.REDIRECT_CONTEXT,e,!0)},ow);function ow(e,t,o,r){o=ew.call(this,e,o)||this;return o.COOKIE_LIFE_MULTIPLIER=864e5,o.cacheConfig=t,o.logger=r,o.internalStorage=new J_,o.browserStorage=o.setupBrowserStorage(o.cacheConfig.cacheLocation),o.temporaryCacheStorage=o.setupTemporaryCacheStorage(o.cacheConfig.cacheLocation),o.migrateCacheEntries(),o}var rw="@azure/msal-browser",nw="2.32.1",iw=(aw.prototype.sendGetRequestAsync=function(n,i){return af(this,void 0,void 0,function(){var t,o,r;return sf(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,fetch(n,{method:T_.GET,headers:this.getFetchHeaders(i)})];case 1:return t=e.sent(),[3,3];case 2:throw o=e.sent(),window.navigator.onLine?b_.createGetRequestFailedError(o,n):b_.createNoNetworkConnectivityError();case 3:return e.trys.push([3,5,,6]),r={headers:this.getHeaderDict(t.headers)},[4,t.json()];case 4:return[2,(r.body=e.sent(),r.status=t.status,r)];case 5:throw e.sent(),b_.createFailedToParseNetworkResponseError(n);case 6:return[2]}})})},aw.prototype.sendPostRequestAsync=function(i,a){return af(this,void 0,void 0,function(){var t,o,r,n;return sf(this,function(e){switch(e.label){case 0:t=a&&a.body||wf.EMPTY_STRING,e.label=1;case 1:return e.trys.push([1,3,,4]),[4,fetch(i,{method:T_.POST,headers:this.getFetchHeaders(a),body:t})];case 2:return o=e.sent(),[3,4];case 3:throw r=e.sent(),window.navigator.onLine?b_.createPostRequestFailedError(r,i):b_.createNoNetworkConnectivityError();case 4:return e.trys.push([4,6,,7]),n={headers:this.getHeaderDict(o.headers)},[4,o.json()];case 5:return[2,(n.body=e.sent(),n.status=o.status,n)];case 6:throw e.sent(),b_.createFailedToParseNetworkResponseError(i);case 7:return[2]}})})},aw.prototype.getFetchHeaders=function(e){var t=new Headers;if(!e||!e.headers)return t;var o=e.headers;return Object.keys(o).forEach(function(e){t.append(e,o[e])}),t},aw.prototype.getHeaderDict=function(e){var o={};return e.forEach(function(e,t){o[t]=e}),o},aw);function aw(){}var sw=(cw.prototype.sendGetRequestAsync=function(t,o){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,this.sendRequestAsync(t,T_.GET,o)]})})},cw.prototype.sendPostRequestAsync=function(t,o){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,this.sendRequestAsync(t,T_.POST,o)]})})},cw.prototype.sendRequestAsync=function(i,a,e){var s=this;return new Promise(function(o,r){var n=new XMLHttpRequest;if(n.open(a,i,!0),s.setXhrHeaders(n,e),n.onload=function(){(n.status<200||300<=n.status)&&(a===T_.POST?r(b_.createPostRequestFailedError("Failed with status "+n.status,i)):r(b_.createGetRequestFailedError("Failed with status "+n.status,i)));try{var e=JSON.parse(n.responseText),t={headers:s.getHeaderDict(n),body:e,status:n.status};o(t)}catch(e){r(b_.createFailedToParseNetworkResponseError(i))}},n.onerror=function(){window.navigator.onLine?a===T_.POST?r(b_.createPostRequestFailedError("Failed with status "+n.status,i)):r(b_.createGetRequestFailedError("Failed with status "+n.status,i)):r(b_.createNoNetworkConnectivityError())},a===T_.POST&&e&&e.body)n.send(e.body);else{if(a!==T_.GET)throw b_.createHttpMethodNotImplementedError(a);n.send()}})},cw.prototype.setXhrHeaders=function(t,e){var o;e&&e.headers&&(o=e.headers,Object.keys(o).forEach(function(e){t.setRequestHeader(e,o[e])}))},cw.prototype.getHeaderDict=function(e){var e=e.getAllResponseHeaders().trim().split(/[\r\n]+/),o={};return e.forEach(function(e){var t=e.split(": "),e=t.shift(),t=t.join(": ");e&&t&&(o[e]=t)}),o},cw);function cw(){}var uw=(lw.clearHash=function(e){e.location.hash=wf.EMPTY_STRING,"function"==typeof e.history.replaceState&&e.history.replaceState(null,wf.EMPTY_STRING,""+e.location.origin+e.location.pathname+e.location.search)},lw.replaceHash=function(e){e=e.split("#");e.shift(),window.location.hash=0<e.length?e.join("#"):wf.EMPTY_STRING},lw.isInIframe=function(){return window.parent!==window},lw.isInPopup=function(){return"undefined"!=typeof window&&!!window.opener&&window.opener!==window&&"string"==typeof window.name&&0===window.name.indexOf(P_.POPUP_NAME_PREFIX+".")},lw.getCurrentUri=function(){return window.location.href.split("?")[0].split("#")[0]},lw.getHomepage=function(){var e=new Rm(window.location.href).getUrlComponents();return e.Protocol+"//"+e.HostNameAndPort+"/"},lw.getBrowserNetworkClient=function(){return new(window.fetch&&window.Headers?iw:sw)},lw.blockReloadInHiddenIframes=function(){if(Rm.hashContainsKnownProperties(window.location.hash)&&lw.isInIframe())throw b_.createBlockReloadInHiddenIframeError()},lw.blockRedirectInIframe=function(e,t){var o=lw.isInIframe();if(e===O_.Redirect&&o&&!t)throw b_.createRedirectInIframeError(o)},lw.blockAcquireTokenInPopups=function(){if(lw.isInPopup())throw b_.createBlockAcquireTokenInPopupsError()},lw.blockNonBrowserEnvironment=function(e){if(!e)throw b_.createNonBrowserEnvironmentError()},lw.blockNativeBrokerCalledBeforeInitialized=function(e,t){if(e&&!t)throw b_.createNativeBrokerCalledBeforeInitialize()},lw.detectIEOrEdge=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE "),o=e.indexOf("Trident/"),e=e.indexOf("Edge/");return 0<t||0<o||0<e},lw);function lw(){}var hw=(pw.prototype.clearCacheOnLogout=function(t){return af(this,void 0,void 0,function(){return sf(this,function(e){switch(e.label){case 0:if(!t)return[3,5];Ny.accountInfoIsEqual(t,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null)),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.browserStorage.removeAccount(Ny.generateAccountCacheKey(t))];case 2:return e.sent(),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request."),[3,4];case 3:return e.sent(),this.logger.error("Account provided in logout request was not found. Local cache unchanged."),[3,4];case 4:return[3,9];case 5:return e.trys.push([5,8,,9]),this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),[4,this.browserStorage.clear()];case 6:return e.sent(),[4,this.browserCrypto.clearKeystore()];case 7:return e.sent(),[3,9];case 8:return e.sent(),this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged."),[3,9];case 9:return[2]}})})},pw.prototype.initializeBaseRequest=function(n){return af(this,void 0,void 0,function(){var t,o,r;return sf(this,function(e){switch(e.label){case 0:if(this.logger.verbose("Initializing BaseAuthRequest"),t=n.authority||this.config.auth.authority,o=cf(n&&n.scopes||[]),(o=rf(rf({},n),{correlationId:this.correlationId,authority:t,scopes:o})).authenticationScheme){if(o.authenticationScheme===qf.SSH){if(!n.sshJwk)throw Ay.createMissingSshJwkError();if(!n.sshKid)throw Ay.createMissingSshKidError()}this.logger.verbose('Authentication Scheme set to "'+o.authenticationScheme+'" as configured in Auth request')}else o.authenticationScheme=qf.BEARER,this.logger.verbose('Authentication Scheme wasn\'t explicitly set in request, defaulting to "Bearer" request');return!n.claims||Qg.isEmpty(n.claims)?[3,2]:(r=o,[4,this.browserCrypto.hashString(n.claims)]);case 1:r.requestedClaimsHash=e.sent(),e.label=2;case 2:return[2,o]}})})},pw.prototype.getRedirectUri=function(e){this.logger.verbose("getRedirectUri called");e=e||this.config.auth.redirectUri||uw.getCurrentUri();return Rm.getAbsoluteUrl(e,uw.getCurrentUri())},pw.prototype.initializeServerTelemetryManager=function(e,t){this.logger.verbose("initializeServerTelemetryManager called");t={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new Cv(t,this.browserStorage)},pw.prototype.getDiscoveredAuthority=function(o){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){switch(e.label){case 0:return(this.logger.verbose("getDiscoveredAuthority called"),t={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata},o)?(this.logger.verbose("Creating discovered authority with request authority"),[4,cv.createDiscoveredInstance(o,this.config.system.networkClient,this.browserStorage,t,this.logger)]):[3,2];case 1:return[2,e.sent()];case 2:return this.logger.verbose("Creating discovered authority with configured authority"),[4,cv.createDiscoveredInstance(this.config.auth.authority,this.config.system.networkClient,this.browserStorage,t,this.logger)];case 3:return[2,e.sent()]}})})},pw);function pw(e,t,o,r,n,i,a,s,c){this.config=e,this.browserStorage=t,this.browserCrypto=o,this.networkClient=this.config.system.networkClient,this.eventHandler=n,this.navigationClient=i,this.nativeMessageHandler=s,this.correlationId=c||this.browserCrypto.createNewGuid(),this.logger=r.clone(P_.MSAL_SKU,nw,this.correlationId),this.performanceClient=a}var dw,fw=(of(gw,dw=hw),gw.prototype.initializeAuthorizationCodeRequest=function(r){return af(this,void 0,void 0,function(){var t,o;return sf(this,function(e){switch(e.label){case 0:return this.logger.verbose("initializeAuthorizationRequest called",r.correlationId),[4,this.browserCrypto.generatePkceCodes()];case 1:return t=e.sent(),o=rf(rf({},r),{redirectUri:r.redirectUri,code:wf.EMPTY_STRING,codeVerifier:t.verifier}),r.codeChallenge=t.challenge,r.codeChallengeMethod=wf.S256_CODE_CHALLENGE_METHOD,[2,o]}})})},gw.prototype.initializeLogoutRequest=function(e){this.logger.verbose("initializeLogoutRequest called",null==e?void 0:e.correlationId);var t,o=rf({correlationId:this.correlationId||this.browserCrypto.createNewGuid()},e);return e?e.logoutHint?this.logger.verbose("logoutHint has already been set in logoutRequest"):e.account?(t=this.getLogoutHintFromIdTokenClaims(e.account))&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),o.logoutHint=t):this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set"):this.logger.verbose("logoutHint will not be set since no logout request was configured"),e&&null===e.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",o.correlationId):e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",o.correlationId),o.postLogoutRedirectUri=Rm.getAbsoluteUrl(e.postLogoutRedirectUri,uw.getCurrentUri())):null===this.config.auth.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",o.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",o.correlationId),o.postLogoutRedirectUri=Rm.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,uw.getCurrentUri())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",o.correlationId),o.postLogoutRedirectUri=Rm.getAbsoluteUrl(uw.getCurrentUri(),uw.getCurrentUri())),o},gw.prototype.getLogoutHintFromIdTokenClaims=function(e){e=e.idTokenClaims;if(e){if(e.login_hint)return e.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null},gw.prototype.createAuthCodeClient=function(o,r,n){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){switch(e.label){case 0:return[4,this.getClientConfiguration(o,r,n)];case 1:return t=e.sent(),[2,new Gm(t)]}})})},gw.prototype.getClientConfiguration=function(o,r,n){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){switch(e.label){case 0:return this.logger.verbose("getClientConfiguration called",this.correlationId),[4,this.getDiscoveredAuthority(r,n)];case 1:return t=e.sent(),[2,{authOptions:{clientId:this.config.auth.clientId,authority:t,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,logLevel:this.config.system.loggerOptions.logLevel,correlationId:this.correlationId},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:o,libraryInfo:{sku:P_.MSAL_SKU,version:nw,cpu:wf.EMPTY_STRING,os:wf.EMPTY_STRING},telemetry:this.config.telemetry}]}})})},gw.prototype.validateAndExtractStateFromHash=function(e,t,o){if(this.logger.verbose("validateAndExtractStateFromHash called",o),!e.state)throw b_.createHashDoesNotContainStateError();var r=X_.extractBrowserRequestState(this.browserCrypto,e.state);if(!r)throw b_.createUnableToParseStateError();if(r.interactionType!==t)throw b_.createStateInteractionTypeMismatchError();return this.logger.verbose("Returning state from hash",o),e.state},gw.prototype.getDiscoveredAuthority=function(n,i){return af(this,void 0,void 0,function(){var t,o,r;return sf(this,function(e){switch(e.label){case 0:return this.logger.verbose("getDiscoveredAuthority called",this.correlationId),t=this.performanceClient.startMeasurement(Fm.StandardInteractionClientGetDiscoveredAuthority,this.correlationId),o={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},r=n||this.config.auth.authority,r=av.generateAuthority(r,i||this.config.auth.azureCloudOptions),this.logger.verbose("Creating discovered authority with configured authority",this.correlationId),[4,cv.createDiscoveredInstance(r,this.config.system.networkClient,this.browserStorage,o,this.logger).then(function(e){return t.endMeasurement({success:!0}),e}).catch(function(e){throw t.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})];case 1:return[2,e.sent()]}})})},gw.prototype.initializeAuthorizationRequest=function(s,c){return af(this,void 0,void 0,function(){var t,o,r,n,i,a;return sf(this,function(e){switch(e.label){case 0:return this.logger.verbose("initializeAuthorizationRequest called",this.correlationId),t=this.getRedirectUri(s.redirectUri),i={interactionType:c},o=Om.setRequestState(this.browserCrypto,s&&s.state||wf.EMPTY_STRING,i),n=[{}],[4,this.initializeBaseRequest(s)];case 1:return r=rf.apply(void 0,[rf.apply(void 0,n.concat([e.sent()])),{redirectUri:t,state:o,nonce:s.nonce||this.browserCrypto.createNewGuid(),responseMode:Tf.FRAGMENT}]),(i=s.account||this.browserStorage.getActiveAccount())&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii("Setting validated request account: "+i.homeAccountId,this.correlationId),r.account=i),Qg.isEmpty(r.loginHint)&&!i&&(a=this.browserStorage.getLegacyLoginHint())&&(r.loginHint=a),[2,r]}})})},gw);function gw(){return null!==dw&&dw.apply(this,arguments)||this}var yw=(mw.prototype.handleCodeResponseFromHash=function(r,n,i,a){return af(this,void 0,void 0,function(){var t,o;return sf(this,function(e){if(this.logger.verbose("InteractionHandler.handleCodeResponse called"),Qg.isEmpty(r))throw b_.createEmptyHashError(r);if(t=this.browserStorage.generateStateKey(n),!(t=this.browserStorage.getTemporaryCache(t)))throw Wg.createStateNotFoundError("Cached State");try{o=this.authModule.handleFragmentResponse(r,t)}catch(e){throw e instanceof Xy&&e.subError===Fv.code?b_.createUserCancelledError():e}return[2,this.handleCodeResponseFromServer(o,n,i,a)]})})},mw.prototype.handleCodeResponseFromServer=function(n,i,a,s,c){return void 0===c&&(c=!0),af(this,void 0,void 0,function(){var t,o,r;return sf(this,function(e){switch(e.label){case 0:if(this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),o=this.browserStorage.generateStateKey(i),!(t=this.browserStorage.getTemporaryCache(o)))throw Wg.createStateNotFoundError("Cached State");return o=this.browserStorage.generateNonceKey(t),o=this.browserStorage.getTemporaryCache(o),this.authCodeRequest.code=n.code,n.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(n.cloud_instance_host_name,a,s)]:[3,2];case 1:e.sent(),e.label=2;case 2:return c&&(n.nonce=o||void 0),n.state=t,n.client_info?this.authCodeRequest.clientInfo=n.client_info:(r=this.checkCcsCredentials())&&(this.authCodeRequest.ccsCredential=r),[4,this.authModule.acquireToken(this.authCodeRequest,n)];case 3:return r=e.sent(),this.browserStorage.cleanRequestByState(i),[2,r]}})})},mw.prototype.updateTokenEndpointAuthority=function(o,r,n){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){switch(e.label){case 0:return t="https://"+o+"/"+r.tenant+"/",[4,cv.createDiscoveredInstance(t,n,this.browserStorage,r.options,this.logger)];case 1:return t=e.sent(),this.authModule.updateAuthority(t),[2]}})})},mw.prototype.checkCcsCredentials=function(){var t=this.browserStorage.getTemporaryCache(I_.CCS_CREDENTIAL,!0);if(t)try{return JSON.parse(t)}catch(e){this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii("Cache credential could not be parsed: "+t)}return null},mw);function mw(e,t,o,r){this.authModule=e,this.browserStorage=t,this.authCodeRequest=o,this.logger=r}var vw,_w,ww,bw=(of(Cw,vw=yw),Cw.prototype.initiateAuthRequest=function(o,r){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){switch(e.label){case 0:return(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),Qg.isEmpty(o))?[3,7]:(r.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(I_.ORIGIN_URI,r.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(I_.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest,this.browserCrypto),this.logger.infoPii("RedirectHandler.initiateAuthRequest: Navigate to: "+o),t={apiId:k_.acquireTokenRedirect,timeout:r.redirectTimeout,noHistory:!1},"function"!=typeof r.onRedirectNavigate?[3,4]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),!1===r.onRedirectNavigate(o)?[3,2]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),[4,r.navigationClient.navigateExternal(o,t)])));case 1:return e.sent(),[2];case 2:return this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation"),[2];case 3:return[3,6];case 4:return this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),[4,r.navigationClient.navigateExternal(o,t)];case 5:return e.sent(),[2];case 6:return[3,8];case 7:throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),b_.createEmptyNavigationUriError();case 8:return[2]}})})},Cw.prototype.handleCodeResponseFromHash=function(i,a,s,c){return af(this,void 0,void 0,function(){var t,o,r,n;return sf(this,function(e){switch(e.label){case 0:if(this.logger.verbose("RedirectHandler.handleCodeResponse called"),Qg.isEmpty(i))throw b_.createEmptyHashError(i);if(this.browserStorage.setInteractionInProgress(!1),r=this.browserStorage.generateStateKey(a),!(t=this.browserStorage.getTemporaryCache(r)))throw Wg.createStateNotFoundError("Cached State");try{o=this.authModule.handleFragmentResponse(i,t)}catch(e){throw e instanceof Xy&&e.subError===Fv.code?b_.createUserCancelledError():e}return r=this.browserStorage.generateNonceKey(t),r=this.browserStorage.getTemporaryCache(r),this.authCodeRequest.code=o.code,o.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(o.cloud_instance_host_name,s,c)]:[3,2];case 1:e.sent(),e.label=2;case 2:return o.nonce=r||void 0,o.state=t,o.client_info?this.authCodeRequest.clientInfo=o.client_info:(n=this.checkCcsCredentials())&&(this.authCodeRequest.ccsCredential=n),[4,this.authModule.acquireToken(this.authCodeRequest,o)];case 3:return n=e.sent(),this.browserStorage.cleanRequestByState(a),[2,n]}})})},Cw);function Cw(e,t,o,r,n){r=vw.call(this,e,t,o,r)||this;return r.browserCrypto=n,r}(w=_w=_w||{}).INITIALIZE_START="msal:initializeStart",w.INITIALIZE_END="msal:initializeEnd",w.ACCOUNT_ADDED="msal:accountAdded",w.ACCOUNT_REMOVED="msal:accountRemoved",w.LOGIN_START="msal:loginStart",w.LOGIN_SUCCESS="msal:loginSuccess",w.LOGIN_FAILURE="msal:loginFailure",w.ACQUIRE_TOKEN_START="msal:acquireTokenStart",w.ACQUIRE_TOKEN_SUCCESS="msal:acquireTokenSuccess",w.ACQUIRE_TOKEN_FAILURE="msal:acquireTokenFailure",w.ACQUIRE_TOKEN_NETWORK_START="msal:acquireTokenFromNetworkStart",w.SSO_SILENT_START="msal:ssoSilentStart",w.SSO_SILENT_SUCCESS="msal:ssoSilentSuccess",w.SSO_SILENT_FAILURE="msal:ssoSilentFailure",w.ACQUIRE_TOKEN_BY_CODE_START="msal:acquireTokenByCodeStart",w.ACQUIRE_TOKEN_BY_CODE_SUCCESS="msal:acquireTokenByCodeSuccess",w.ACQUIRE_TOKEN_BY_CODE_FAILURE="msal:acquireTokenByCodeFailure",w.HANDLE_REDIRECT_START="msal:handleRedirectStart",w.HANDLE_REDIRECT_END="msal:handleRedirectEnd",w.POPUP_OPENED="msal:popupOpened",w.LOGOUT_START="msal:logoutStart",w.LOGOUT_SUCCESS="msal:logoutSuccess",w.LOGOUT_FAILURE="msal:logoutFailure",w.LOGOUT_END="msal:logoutEnd",(w=ww=ww||{}).USER_INTERACTION_REQUIRED="USER_INTERACTION_REQUIRED",w.USER_CANCEL="USER_CANCEL",w.NO_NETWORK="NO_NETWORK",w.TRANSIENT_ERROR="TRANSIENT_ERROR",w.PERSISTENT_ERROR="PERSISTENT_ERROR",w.DISABLED="DISABLED",w.ACCOUNT_UNAVAILABLE="ACCOUNT_UNAVAILABLE";var Ew,Sw={code:"ContentError"},Tw={code:"user_switch",desc:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."},Iw={code:"tokens_not_found_in_internal_memory_cache",desc:"Tokens not cached in MSAL JS internal memory, please make the WAM request"},Aw=(of(kw,Ew=eg),kw.prototype.isFatal=function(){return!(!this.ext||!this.ext.status||this.ext.status!==ww.PERSISTENT_ERROR&&this.ext.status!==ww.DISABLED)||this.errorCode===Sw.code},kw.createError=function(e,t,o){if(o&&o.status)switch(o.status){case ww.ACCOUNT_UNAVAILABLE:return Im.createNativeAccountUnavailableError();case ww.USER_INTERACTION_REQUIRED:return new Im(e,t);case ww.USER_CANCEL:return b_.createUserCancelledError();case ww.NO_NETWORK:return b_.createNoNetworkConnectivityError()}return new kw(e,t,o)},kw.createUserSwitchError=function(){return new kw(Tw.code,Tw.desc)},kw.createTokensNotFoundInCacheError=function(){return new kw(Iw.code,Iw.desc)},kw);function kw(e,t,o){t=Ew.call(this,e,t)||this;return Object.setPrototypeOf(t,kw.prototype),t.name="NativeAuthError",t.ext=o,t}var Ow,Pw=(of(xw,Ow=fw),xw.prototype.acquireToken=function(i){return af(this,void 0,void 0,function(){var t,o,r,n;return sf(this,function(e){switch(e.label){case 0:return t=this.performanceClient.startMeasurement(Fm.SilentCacheClientAcquireToken,i.correlationId),o=this.initializeServerTelemetryManager(k_.acquireTokenSilent_silentFlow),[4,this.createSilentFlowClient(o,i.authority,i.azureCloudOptions)];case 1:r=e.sent(),this.logger.verbose("Silent auth client created"),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,r.acquireCachedToken(i)];case 3:return n=e.sent(),t.endMeasurement({success:!0,fromCache:!0}),[2,n];case 4:throw(n=e.sent())instanceof b_&&n.errorCode===h_.code&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),t.endMeasurement({errorCode:n instanceof eg&&n.errorCode||void 0,subErrorCode:n instanceof eg&&n.subError||void 0,success:!1}),n;case 5:return[2]}})})},xw.prototype.logout=function(){return Promise.reject(b_.createSilentLogoutUnsupportedError())},xw.prototype.createSilentFlowClient=function(o,r,n){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){switch(e.label){case 0:return[4,this.getClientConfiguration(o,r,n)];case 1:return t=e.sent(),[2,new Qm(t,this.performanceClient)]}})})},xw.prototype.initializeSilentRequest=function(o,r){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){switch(e.label){case 0:return t=[rf({},o)],[4,this.initializeBaseRequest(o)];case 1:return[2,rf.apply(void 0,[rf.apply(void 0,t.concat([e.sent()])),{account:r,forceRefresh:o.forceRefresh||!1}])]}})})},xw);function xw(){return null!==Ow&&Ow.apply(this,arguments)||this}var Rw,Mw=(of(Nw,Rw=hw),Nw.prototype.acquireToken=function(a){return af(this,void 0,void 0,function(){var t,o,r,n,i;return sf(this,function(e){switch(e.label){case 0:return this.logger.trace("NativeInteractionClient - acquireToken called."),t=this.performanceClient.startMeasurement(Fm.NativeInteractionClientAcquireToken,a.correlationId),o=dm.nowSeconds(),[4,this.initializeNativeRequest(a)];case 1:r=e.sent(),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,this.acquireTokensFromCache(this.accountId,r)];case 3:return n=e.sent(),t.endMeasurement({success:!0,isNativeBroker:!1,fromCache:!0}),[2,n];case 4:return e.sent(),this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call"),[3,5];case 5:return i={method:E_.GetToken,request:r},[4,this.nativeMessageHandler.sendMessage(i)];case 6:return i=e.sent(),i=this.validateNativeResponse(i),[2,this.handleNativeResponse(i,r,o).then(function(e){return t.endMeasurement({success:!0,isNativeBroker:!0,requestId:e.requestId}),e}).catch(function(e){throw t.endMeasurement({success:!1,errorCode:e.errorCode,subErrorCode:e.subError,isNativeBroker:!0}),e})]}})})},Nw.prototype.createSilentCacheRequest=function(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:Py.fromString(e.scope).asArray(),account:t,forceRefresh:!1}},Nw.prototype.acquireTokensFromCache=function(r,n){return af(this,void 0,void 0,function(){var t,o;return sf(this,function(e){switch(e.label){case 0:if(!(o=this.browserStorage.readAccountFromCacheWithNativeAccountId(r)))throw Wg.createNoAccountFoundError();t=o.getAccountInfo(),e.label=1;case 1:return e.trys.push([1,3,,4]),o=this.createSilentCacheRequest(n,t),[4,this.silentCacheClient.acquireToken(o)];case 2:return[2,e.sent()];case 3:throw e.sent();case 4:return[2]}})})},Nw.prototype.acquireTokenRedirect=function(i){return af(this,void 0,void 0,function(){var t,o,r,n;return sf(this,function(e){switch(e.label){case 0:return this.logger.trace("NativeInteractionClient - acquireTokenRedirect called."),[4,this.initializeNativeRequest(i)];case 1:t=e.sent(),o={method:E_.GetToken,request:t},e.label=2;case 2:return e.trys.push([2,4,,5]),[4,this.nativeMessageHandler.sendMessage(o)];case 3:return r=e.sent(),this.validateNativeResponse(r),[3,5];case 4:if((n=e.sent())instanceof Aw&&n.isFatal())throw n;return[3,5];case 5:return this.browserStorage.setTemporaryCache(I_.NATIVE_REQUEST,JSON.stringify(t),!0),r={apiId:k_.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},n=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(i.redirectUri),[4,this.navigationClient.navigateExternal(n,r)];case 6:return e.sent(),[2]}})})},Nw.prototype.handleRedirectPromise=function(){return af(this,void 0,void 0,function(){var t,o,r,n;return sf(this,function(e){switch(e.label){case 0:if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(!(o=this.browserStorage.getCachedNativeRequest()))return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),[2,null];r=o.prompt,t=nf(o,["prompt"]),r&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(I_.NATIVE_REQUEST)),o={method:E_.GetToken,request:t},r=dm.nowSeconds(),e.label=1;case 1:return e.trys.push([1,3,,4]),this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker."),[4,this.nativeMessageHandler.sendMessage(o)];case 2:return n=e.sent(),this.validateNativeResponse(n),n=this.handleNativeResponse(n,t,r),this.browserStorage.setInteractionInProgress(!1),[2,n];case 3:throw n=e.sent(),this.browserStorage.setInteractionInProgress(!1),n;case 4:return[2]}})})},Nw.prototype.logout=function(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")},Nw.prototype.handleNativeResponse=function(f,g,y){return af(this,void 0,void 0,function(){var t,o,r,n,i,a,s,c,u,l,h,p,d=this;return sf(this,function(e){switch(e.label){case 0:if(this.logger.trace("NativeInteractionClient - handleNativeResponse called."),t=this.getMATSFromResponse(f),this.performanceClient.addStaticFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t?t.broker_version:void 0,matsAccountJoinOnStart:t?t.account_join_on_start:void 0,matsAccountJoinOnEnd:t?t.account_join_on_end:void 0,matsDeviceJoin:t?t.device_join:void 0,matsPromptBehavior:t?t.prompt_behavior:void 0,matsApiErrorCode:t?t.api_error_code:void 0,matsUiVisible:t?t.ui_visible:void 0,matsSilentCode:t?t.silent_code:void 0,matsSilentBiSubCode:t?t.silent_bi_sub_code:void 0,matsSilentMessage:t?t.silent_message:void 0,matsSilentStatus:t?t.silent_status:void 0,matsHttpStatus:t?t.http_status:void 0,matsHttpEventCount:t?t.http_event_count:void 0},this.correlationId),f.account.id!==g.accountId)throw Aw.createUserSwitchError();return o=new Dy(f.id_token||wf.EMPTY_STRING,this.browserCrypto),[4,this.getDiscoveredAuthority(g.authority)];case 1:return r=e.sent(),c=r.getPreferredCache(),n=Ny.generateHomeAccountId(f.client_info||wf.EMPTY_STRING,Oy.Default,this.logger,this.browserCrypto,o),i=Ny.createAccount(f.client_info,n,o,void 0,void 0,void 0,c,f.account.id),this.browserStorage.setAccount(i),a=f.scope?Py.fromString(f.scope):Py.fromString(g.scope),l=f.account.properties||{},s=l.UID||o.claims.oid||o.claims.sub||wf.EMPTY_STRING,c=l.TenantId||o.claims.tid||wf.EMPTY_STRING,l=qf.BEARER,g.tokenType===qf.POP?[3,2]:[3,4];case 2:if(l=qf.POP,f.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),u=f.shr,[3,5];if(h=new Nm(this.browserCrypto),p={resourceRequestMethod:g.resourceRequestMethod,resourceRequestUri:g.resourceRequestUri,shrClaims:g.shrClaims,shrNonce:g.shrNonce},!g.keyId)throw Wg.createKeyIdMissingError();return[4,h.signPopToken(f.access_token,g.keyId,p)];case 3:return u=e.sent(),[3,5];case 4:u=f.access_token,e.label=5;case 5:return h={authority:r.canonicalAuthority,uniqueId:s,tenantId:c,scopes:a.asArray(),account:i.getAccountInfo(),idToken:f.id_token,idTokenClaims:o.claims,accessToken:u,fromCache:!!t&&this.isResponseFromCache(t),expiresOn:new Date(1e3*Number(y+f.expires_in)),tokenType:l,correlationId:this.correlationId,state:f.state,fromNativeBroker:!0},p=hm.createIdTokenEntity(n,g.authority,f.id_token||wf.EMPTY_STRING,g.clientId,o.claims.tid||wf.EMPTY_STRING),this.nativeStorageManager.setIdTokenCredential(p),p=l===qf.POP?wf.SHR_NONCE_VALIDITY:("string"==typeof f.expires_in?parseInt(f.expires_in,10):f.expires_in)||0,p=y+p,p=ym.createAccessTokenEntity(n,g.authority,u,g.clientId,c,a.printScopes(),p,0,this.browserCrypto),this.nativeStorageManager.setAccessTokenCredential(p),this.browserStorage.removeAccountContext(i).catch(function(e){d.logger.error("Error occurred while removing account context from browser storage. "+e)}),[2,h]}})})},Nw.prototype.validateNativeResponse=function(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw Aw.createUnexpectedError("Response missing expected properties.")},Nw.prototype.getMATSFromResponse=function(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch(e){this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null},Nw.prototype.isResponseFromCache=function(e){return void 0===e.is_cached?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached},Nw.prototype.initializeNativeRequest=function(s){return af(this,void 0,void 0,function(){var t,o,r,n,i,a=this;return sf(this,function(e){switch(e.label){case 0:return(this.logger.trace("NativeInteractionClient - initializeNativeRequest called"),r=s.authority||this.config.auth.authority,(t=new Rm(r)).validateAsUri(),n=s.scopes,o=nf(s,["scopes"]),(r=new Py(n||[])).appendScopes(bf),n=function(){switch(a.apiId){case k_.ssoSilent:case k_.acquireTokenSilent_silentFlow:return a.logger.trace("initializeNativeRequest: silent request sets prompt to none"),Sf.NONE}if(s.prompt)switch(s.prompt){case Sf.NONE:case Sf.CONSENT:case Sf.LOGIN:return a.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),s.prompt;default:throw a.logger.trace("initializeNativeRequest: prompt = "+s.prompt+" is not compatible with native flow"),b_.createNativePromptParameterNotSupportedError()}else a.logger.trace("initializeNativeRequest: prompt was not provided")},n=rf(rf({},o),{accountId:this.accountId,clientId:this.config.auth.clientId,authority:t.urlString,scope:r.printScopes(),redirectUri:this.getRedirectUri(s.redirectUri),prompt:n(),correlationId:this.correlationId,tokenType:s.authenticationScheme,windowTitleSubstring:document.title,extraParameters:rf(rf(rf({},s.extraQueryParameters),s.tokenQueryParameters),{telemetry:M_}),extendedExpiryToken:!1}),s.authenticationScheme!==qf.POP)?[3,2]:(i={resourceRequestUri:s.resourceRequestUri,resourceRequestMethod:s.resourceRequestMethod,shrClaims:s.shrClaims,shrNonce:s.shrNonce},[4,new Nm(this.browserCrypto).generateCnf(i)]);case 1:i=e.sent(),n.reqCnf=i.reqCnfHash,n.keyId=i.kid,e.label=2;case 2:return[2,n]}})})},Nw);function Nw(e,t,o,r,n,i,a,s,c,u,l,h){t=Rw.call(this,e,t,o,r,n,i,s,c,h)||this;return t.apiId=a,t.accountId=u,t.nativeMessageHandler=c,t.nativeStorageManager=l,t.silentCacheClient=new Pw(e,t.nativeStorageManager,o,r,n,i,s,c,h),t}var Lw=(Dw.prototype.sendMessage=function(t){return af(this,void 0,void 0,function(){var o,r=this;return sf(this,function(e){return this.logger.trace("NativeMessageHandler - sendMessage called."),o={channel:x_,extensionId:this.extensionId,responseId:this.responseId++,body:t},this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii("NativeMessageHandler - Sending request to browser extension: "+JSON.stringify(o)),this.messageChannel.port1.postMessage(o),[2,new Promise(function(e,t){r.resolvers.set(o.responseId,{resolve:e,reject:t})})]})})},Dw.createProvider=function(r,n){return af(this,void 0,void 0,function(){var t,o;return sf(this,function(e){switch(e.label){case 0:r.trace("NativeMessageHandler - createProvider called."),e.label=1;case 1:return e.trys.push([1,3,,5]),[4,(t=new Dw(r,n,R_)).sendHandshakeRequest()];case 2:return e.sent(),[2,t];case 3:return e.sent(),[4,(o=new Dw(r,n)).sendHandshakeRequest()];case 4:return e.sent(),[2,o];case 5:return[2]}})})},Dw.prototype.sendHandshakeRequest=function(){return af(this,void 0,void 0,function(){var o,r=this;return sf(this,function(e){return this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1),o={channel:x_,extensionId:this.extensionId,responseId:this.responseId++,body:{method:E_.HandshakeRequest}},this.messageChannel.port1.onmessage=function(e){r.onChannelMessage(e)},window.postMessage(o,window.origin,[this.messageChannel.port2]),[2,new Promise(function(e,t){r.handshakeResolvers.set(o.responseId,{resolve:e,reject:t}),r.timeoutId=window.setTimeout(function(){window.removeEventListener("message",r.windowListener,!1),r.messageChannel.port1.close(),r.messageChannel.port2.close(),t(b_.createNativeHandshakeTimeoutError()),r.handshakeResolvers.delete(o.responseId)},r.handshakeTimeoutMs)})]})})},Dw.prototype.onWindowMessage=function(e){this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window||(e=e.data).channel&&e.channel===x_&&(e.extensionId&&e.extensionId!==this.extensionId||e.body.method===E_.HandshakeRequest&&(this.logger.verbose(e.extensionId?"Extension with id: "+e.extensionId+" not installed":"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),(e=this.handshakeResolvers.get(e.responseId))&&e.reject(b_.createNativeExtensionNotInstalledError())))},Dw.prototype.onChannelMessage=function(t){this.logger.trace("NativeMessageHandler - onChannelMessage called.");var e=t.data,o=this.resolvers.get(e.responseId),r=this.handshakeResolvers.get(e.responseId);try{var n=e.body.method;if(n===E_.Response){if(!o)return;var i=e.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii("NativeMessageHandler - Received response from browser extension: "+JSON.stringify(i)),"Success"!==i.status)o.reject(Aw.createError(i.code,i.description,i.ext));else{if(!i.result)throw eg.createUnexpectedError("Event does not contain result.");i.result.code&&i.result.description?o.reject(Aw.createError(i.result.code,i.result.description,i.result.ext)):o.resolve(i.result)}this.resolvers.delete(e.responseId)}else if(n===E_.HandshakeResponse){if(!r)return;clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=e.extensionId,this.extensionVersion=e.body.version,this.logger.verbose("NativeMessageHandler - Received HandshakeResponse from extension: "+this.extensionId),r.resolve(),this.handshakeResolvers.delete(e.responseId)}}catch(e){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii("Error parsing response from WAM Extension: "+e.toString()),this.logger.errorPii("Unable to parse "+t),o?o.reject(e):r&&r.reject(e)}},Dw.prototype.getExtensionId=function(){return this.extensionId},Dw.prototype.getExtensionVersion=function(){return this.extensionVersion},Dw.isNativeAvailable=function(e,t,o,r){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!o)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(r)switch(r){case qf.BEARER:case qf.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0},Dw);function Dw(e,t,o){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=o,this.resolvers=new Map,this.handshakeResolvers=new Map,this.responseId=0,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this)}var qw,jw=(of(Uw,qw=fw),Uw.prototype.acquireToken=function(u){return af(this,void 0,void 0,function(){var t,o,r,n,i,a,s,c=this;return sf(this,function(e){switch(e.label){case 0:return[4,this.initializeAuthorizationRequest(u,O_.Redirect)];case 1:t=e.sent(),this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||wf.EMPTY_STRING,t.account||null),o=this.initializeServerTelemetryManager(k_.acquireTokenRedirect),r=function(e){e.persisted&&(c.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),c.browserStorage.cleanRequestByState(t.state))},e.label=2;case 2:return e.trys.push([2,7,,8]),[4,this.initializeAuthorizationCodeRequest(t)];case 3:return n=e.sent(),[4,this.createAuthCodeClient(o,t.authority,t.azureCloudOptions)];case 4:return a=e.sent(),this.logger.verbose("Auth code client created"),i=new bw(a,this.browserStorage,n,this.logger,this.browserCrypto),[4,a.getAuthCodeUrl(rf(rf({},t),{nativeBroker:Lw.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,u.authenticationScheme)}))];case 5:return a=e.sent(),s=this.getRedirectStartPage(u.redirectStartPage),this.logger.verbosePii("Redirect start page: "+s),window.addEventListener("pageshow",r),[4,i.initiateAuthRequest(a,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:s,onRedirectNavigate:u.onRedirectNavigate})];case 6:return[2,e.sent()];case 7:throw(s=e.sent())instanceof eg&&s.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",r),o.cacheFailedRequest(s),this.browserStorage.cleanRequestByState(t.state),s;case 8:return[2]}})})},Uw.prototype.handleRedirectPromise=function(h){return af(this,void 0,void 0,function(){var t,o,r,n,i,a,s,c,u,l;return sf(this,function(e){switch(e.label){case 0:t=this.initializeServerTelemetryManager(k_.handleRedirectPromise),e.label=1;case 1:if(e.trys.push([1,10,,11]),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(!(o=this.getRedirectResponseHash(h||window.location.hash)))return this.logger.info("handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(O_.Redirect),[2,null];r=void 0;try{n=Rm.getDeserializedHash(o),r=this.validateAndExtractStateFromHash(n,O_.Redirect),this.logger.verbose("State extracted from hash")}catch(e){return this.logger.info("handleRedirectPromise was unable to extract state due to: "+e),this.browserStorage.cleanRequestByInteractionType(O_.Redirect),[2,null]}return(i=this.browserStorage.getTemporaryCache(I_.ORIGIN_URI,!0)||wf.EMPTY_STRING,a=Rm.removeHashFromUrl(i),s=Rm.removeHashFromUrl(window.location.href),a===s&&this.config.auth.navigateToLoginRequestUrl)?(this.logger.verbose("Current page is loginRequestUrl, handling hash"),[4,this.handleHash(o,r,t)]):[3,3];case 2:return s=e.sent(),-1<i.indexOf("#")&&uw.replaceHash(i),[2,s];case 3:return this.config.auth.navigateToLoginRequestUrl?[3,4]:(this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash"),[2,this.handleHash(o,r,t)]);case 4:return uw.isInIframe()&&!this.config.system.allowRedirectInIframe?[3,9]:(this.browserStorage.setTemporaryCache(I_.URL_HASH,o,!0),c={apiId:k_.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0},u=!0,i&&"null"!==i?[3,6]:(l=uw.getHomepage(),this.browserStorage.setTemporaryCache(I_.ORIGIN_URI,l,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),[4,this.navigationClient.navigateInternal(l,c)]));case 5:return u=e.sent(),[3,8];case 6:return this.logger.verbose("Navigating to loginRequestUrl: "+i),[4,this.navigationClient.navigateInternal(i,c)];case 7:u=e.sent(),e.label=8;case 8:if(!u)return[2,this.handleHash(o,r,t)];e.label=9;case 9:return[2,null];case 10:throw(l=e.sent())instanceof eg&&l.setCorrelationId(this.correlationId),t.cacheFailedRequest(l),this.browserStorage.cleanRequestByInteractionType(O_.Redirect),l;case 11:return[2]}})})},Uw.prototype.getRedirectResponseHash=function(e){if(this.logger.verbose("getRedirectResponseHash called"),Rm.hashContainsKnownProperties(e))return uw.clearHash(window),this.logger.verbose("Hash contains known properties, returning response hash"),e;e=this.browserStorage.getTemporaryCache(I_.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(I_.URL_HASH)),this.logger.verbose("Hash does not contain known properties, returning cached hash"),e},Uw.prototype.handleHash=function(i,a,s){return af(this,void 0,void 0,function(){var t,o,r,n=this;return sf(this,function(e){switch(e.label){case 0:if(t=this.browserStorage.getCachedRequest(a,this.browserCrypto),this.logger.verbose("handleHash called, retrieved cached request"),(o=Rm.getDeserializedHash(i)).accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw b_.createNativeConnectionNotEstablishedError();return o=new Mw(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,k_.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,o.accountId,this.browserStorage,t.correlationId),r=Om.parseRequestState(this.browserCrypto,a).userRequestState,[2,o.acquireToken(rf(rf({},t),{state:r,prompt:void 0})).finally(function(){n.browserStorage.cleanRequestByState(a)})]}if(!(r=this.browserStorage.getCachedAuthority(a)))throw b_.createNoCachedAuthorityError();return[4,this.createAuthCodeClient(s,r)];case 1:return r=e.sent(),this.logger.verbose("Auth code client created"),em.removeThrottle(this.browserStorage,this.config.auth.clientId,t),[4,new bw(r,this.browserStorage,t,this.logger,this.browserCrypto).handleCodeResponseFromHash(i,a,r.authority,this.networkClient)];case 2:return[2,e.sent()]}})})},Uw.prototype.logout=function(a){return af(this,void 0,void 0,function(){var t,o,r,n,i;return sf(this,function(e){switch(e.label){case 0:this.logger.verbose("logoutRedirect called"),t=this.initializeLogoutRequest(a),o=this.initializeServerTelemetryManager(k_.logout),e.label=1;case 1:return e.trys.push([1,10,,11]),this.eventHandler.emitEvent(_w.LOGOUT_START,O_.Redirect,a),[4,this.clearCacheOnLogout(t.account)];case 2:return e.sent(),r={apiId:k_.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},[4,this.createAuthCodeClient(o,a&&a.authority)];case 3:return(i=e.sent(),this.logger.verbose("Auth code client created"),n=i.getLogoutUri(t),this.eventHandler.emitEvent(_w.LOGOUT_SUCCESS,O_.Redirect,t),a&&"function"==typeof a.onRedirectNavigate)?!1===a.onRedirectNavigate(n)?[3,5]:(this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(n,r)]):[3,7];case 4:return e.sent(),[2];case 5:this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation"),e.label=6;case 6:return[3,9];case 7:return this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(n,r)];case 8:return e.sent(),[2];case 9:return[3,11];case 10:throw(i=e.sent())instanceof eg&&i.setCorrelationId(this.correlationId),o.cacheFailedRequest(i),this.eventHandler.emitEvent(_w.LOGOUT_FAILURE,O_.Redirect,null,i),this.eventHandler.emitEvent(_w.LOGOUT_END,O_.Redirect),i;case 11:return this.eventHandler.emitEvent(_w.LOGOUT_END,O_.Redirect),[2]}})})},Uw.prototype.getRedirectStartPage=function(e){e=e||window.location.href;return Rm.getAbsoluteUrl(e,uw.getCurrentUri())},Uw);function Uw(e,t,o,r,n,i,a,s,c,u){u=qw.call(this,e,t,o,r,n,i,a,c,u)||this;return u.nativeStorage=s,u}var Hw,zw=(of(Bw,Hw=fw),Bw.prototype.acquireToken=function(e){try{var t=this.generatePopupName(e.scopes||bf,e.authority||this.config.auth.authority),o=e.popupWindowAttributes||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,t,o);this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");var r=this.openSizedPopup("about:blank",t,o);return this.acquireTokenPopupAsync(e,t,o,r)}catch(e){return Promise.reject(e)}},Bw.prototype.logout=function(e){try{this.logger.verbose("logoutPopup called");var t=this.initializeLogoutRequest(e),o=this.generateLogoutPopupName(t),r=e&&e.authority,n=e&&e.mainWindowRedirectUri,i=(null==e?void 0:e.popupWindowAttributes)||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,o,i,r,void 0,n);this.logger.verbose("asyncPopup set to false, opening popup");var a=this.openSizedPopup("about:blank",o,i);return this.logoutPopupAsync(t,o,i,r,a,n)}catch(e){return Promise.reject(e)}},Bw.prototype.acquireTokenPopupAsync=function(d,f,g,y){return af(this,void 0,void 0,function(){var t,o,r,n,i,a,s,c,u,l,h,p=this;return sf(this,function(e){switch(e.label){case 0:return this.logger.verbose("acquireTokenPopupAsync called"),t=this.initializeServerTelemetryManager(k_.acquireTokenPopup),[4,this.initializeAuthorizationRequest(d,O_.Popup)];case 1:o=e.sent(),this.browserStorage.updateCacheEntries(o.state,o.nonce,o.authority,o.loginHint||wf.EMPTY_STRING,o.account||null),e.label=2;case 2:return e.trys.push([2,8,,9]),[4,this.initializeAuthorizationCodeRequest(o)];case 3:return r=e.sent(),[4,this.createAuthCodeClient(t,o.authority,o.azureCloudOptions)];case 4:return n=e.sent(),this.logger.verbose("Auth code client created"),i=Lw.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,d.authenticationScheme),a=void 0,i&&(a=this.performanceClient.startMeasurement(Fm.FetchAccountIdWithNativeBroker,d.correlationId)),[4,n.getAuthCodeUrl(rf(rf({},o),{nativeBroker:i}))];case 5:return u=e.sent(),s=new yw(n,this.browserStorage,r,this.logger),l={popup:y,popupName:f,popupWindowAttributes:g},u=this.initiateAuthRequest(u,l),this.eventHandler.emitEvent(_w.POPUP_OPENED,O_.Popup,{popupWindow:u},null),[4,this.monitorPopupForHash(u)];case 6:if(h=e.sent(),l=Rm.getDeserializedHash(h),c=this.validateAndExtractStateFromHash(l,O_.Popup,o.correlationId),em.removeThrottle(this.browserStorage,this.config.auth.clientId,r),l.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),a&&a.endMeasurement({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw b_.createNativeConnectionNotEstablishedError();return u=new Mw(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,k_.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,l.accountId,this.nativeStorage,o.correlationId),l=Om.parseRequestState(this.browserCrypto,c).userRequestState,[2,u.acquireToken(rf(rf({},o),{state:l,prompt:void 0})).finally(function(){p.browserStorage.cleanRequestByState(c)})]}return[4,s.handleCodeResponseFromHash(h,c,n.authority,this.networkClient)];case 7:return[2,e.sent()];case 8:throw h=e.sent(),y&&y.close(),h instanceof eg&&h.setCorrelationId(this.correlationId),t.cacheFailedRequest(h),this.browserStorage.cleanRequestByState(o.state),h;case 9:return[2]}})})},Bw.prototype.logoutPopupAsync=function(n,i,a,s,c,u){return af(this,void 0,void 0,function(){var t,o,r;return sf(this,function(e){switch(e.label){case 0:this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(_w.LOGOUT_START,O_.Popup,n),t=this.initializeServerTelemetryManager(k_.logoutPopup),e.label=1;case 1:return e.trys.push([1,5,,6]),[4,this.clearCacheOnLogout(n.account)];case 2:return e.sent(),[4,this.createAuthCodeClient(t,s)];case 3:return o=e.sent(),this.logger.verbose("Auth code client created"),o=o.getLogoutUri(n),this.eventHandler.emitEvent(_w.LOGOUT_SUCCESS,O_.Popup,n),o=this.openPopup(o,{popupName:i,popupWindowAttributes:a,popup:c}),this.eventHandler.emitEvent(_w.POPUP_OPENED,O_.Popup,{popupWindow:o},null),[4,this.waitForLogoutPopup(o)];case 4:return e.sent(),u?(r={apiId:k_.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},o=Rm.getAbsoluteUrl(u,uw.getCurrentUri()),this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii("Redirecting main window to: "+o),this.navigationClient.navigateInternal(o,r)):this.logger.verbose("No main window navigation requested"),[3,6];case 5:throw r=e.sent(),c&&c.close(),r instanceof eg&&r.setCorrelationId(this.correlationId),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(_w.LOGOUT_FAILURE,O_.Popup,null,r),this.eventHandler.emitEvent(_w.LOGOUT_END,O_.Popup),t.cacheFailedRequest(r),r;case 6:return this.eventHandler.emitEvent(_w.LOGOUT_END,O_.Popup),[2]}})})},Bw.prototype.initiateAuthRequest=function(e,t){if(Qg.isEmpty(e))throw this.logger.error("Navigate url is empty"),b_.createEmptyNavigationUriError();return this.logger.infoPii("Navigate to: "+e),this.openPopup(e,t)},Bw.prototype.monitorPopupForHash=function(s){var c=this;return new Promise(function(o,r){var n=c.config.system.windowHashTimeout/c.config.system.pollIntervalMilliseconds,i=0;c.logger.verbose("PopupHandler.monitorPopupForHash - polling started");var a=setInterval(function(){if(s.closed)return c.logger.error("PopupHandler.monitorPopupForHash - window closed"),c.cleanPopup(),clearInterval(a),void r(b_.createUserCancelledError());var e=wf.EMPTY_STRING,t=wf.EMPTY_STRING;try{e=s.location.href,t=s.location.hash}catch(e){}Qg.isEmpty(e)||"about:blank"===e||(c.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),i++,t?(c.logger.verbose("PopupHandler.monitorPopupForHash - found hash in url"),clearInterval(a),c.cleanPopup(s),Rm.hashContainsKnownProperties(t)?(c.logger.verbose("PopupHandler.monitorPopupForHash - hash contains known properties, returning."),o(t)):(c.logger.error("PopupHandler.monitorPopupForHash - found hash in url but it does not contain known properties. Check that your router is not changing the hash prematurely."),c.logger.errorPii("PopupHandler.monitorPopupForHash - hash found: "+t),r(b_.createHashDoesNotContainKnownPropertiesError()))):n<i&&(c.logger.error("PopupHandler.monitorPopupForHash - unable to find hash in url, timing out"),clearInterval(a),r(b_.createMonitorPopupTimeoutError())))},c.config.system.pollIntervalMilliseconds)})},Bw.prototype.waitForLogoutPopup=function(r){var n=this;return new Promise(function(t){n.logger.verbose("PopupHandler.waitForLogoutPopup - polling started");var o=setInterval(function(){r.closed&&(n.logger.error("PopupHandler.waitForLogoutPopup - window closed"),n.cleanPopup(),clearInterval(o),t());var e=wf.EMPTY_STRING;try{e=r.location.href}catch(e){}Qg.isEmpty(e)||"about:blank"===e||(n.logger.verbose("PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing."),clearInterval(o),n.cleanPopup(r),t())},n.config.system.pollIntervalMilliseconds)})},Bw.prototype.openPopup=function(e,t){try{var o=void 0;if(t.popup?(o=t.popup,this.logger.verbosePii("Navigating popup window to: "+e),o.location.assign(e)):void 0===t.popup&&(this.logger.verbosePii("Opening popup window to: "+e),o=this.openSizedPopup(e,t.popupName,t.popupWindowAttributes)),!o)throw b_.createEmptyWindowCreatedError();return o.focus&&o.focus(),this.currentWindow=o,window.addEventListener("beforeunload",this.unloadWindow),o}catch(e){throw this.logger.error("error opening popup "+e.message),this.browserStorage.setInteractionInProgress(!1),b_.createPopupWindowError(e.toString())}},Bw.prototype.openSizedPopup=function(e,t,o){var r=window.screenLeft||window.screenX,n=window.screenTop||window.screenY,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,s=null===(c=o.popupSize)||void 0===c?void 0:c.width,c=null===(u=o.popupSize)||void 0===u?void 0:u.height,u=null===(u=o.popupPosition)||void 0===u?void 0:u.top,o=null===(o=o.popupPosition)||void 0===o?void 0:o.left;return(!s||s<0||i<s)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),s=P_.POPUP_WIDTH),(!c||c<0||a<c)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),c=P_.POPUP_HEIGHT),(!u||u<0||a<u)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),u=Math.max(0,a/2-P_.POPUP_HEIGHT/2+n)),(!o||o<0||i<o)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),o=Math.max(0,i/2-P_.POPUP_WIDTH/2+r)),window.open(e,t,"width="+s+", height="+c+", top="+u+", left="+o+", scrollbars=yes")},Bw.prototype.unloadWindow=function(e){this.browserStorage.cleanRequestByInteractionType(O_.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()},Bw.prototype.cleanPopup=function(e){e&&e.close(),window.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)},Bw.prototype.generatePopupName=function(e,t){return P_.POPUP_NAME_PREFIX+"."+this.config.auth.clientId+"."+e.join("-")+"."+t+"."+this.correlationId},Bw.prototype.generateLogoutPopupName=function(e){e=e.account&&e.account.homeAccountId;return P_.POPUP_NAME_PREFIX+"."+this.config.auth.clientId+"."+e+"."+this.correlationId},Bw);function Bw(e,t,o,r,n,i,a,s,c,u){u=Hw.call(this,e,t,o,r,n,i,a,c,u)||this;return u.unloadWindow=u.unloadWindow.bind(u),u.nativeStorage=s,u}var Fw=(Kw.prototype.navigateInternal=function(e,t){return Kw.defaultNavigateWindow(e,t)},Kw.prototype.navigateExternal=function(e,t){return Kw.defaultNavigateWindow(e,t)},Kw.defaultNavigateWindow=function(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(function(e){setTimeout(function(){e(!0)},t.timeout)})},Kw);function Kw(){}var Gw=6e4,Yw=6e3,Zw=3e4,Ww=2e3;var Vw,Jw=(of(Qw,Vw=yw),Qw.prototype.initiateAuthRequest=function(o){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){switch(e.label){case 0:if(Qg.isEmpty(o))throw this.logger.info("Navigate url is empty"),b_.createEmptyNavigationUriError();return this.navigateFrameWait?[4,this.loadFrame(o)]:[3,2];case 1:return t=e.sent(),[3,3];case 2:t=this.loadFrameSync(o),e.label=3;case 3:return[2,t]}})})},Qw.prototype.monitorIframeForHash=function(a,e){var s=this;return new Promise(function(o,r){e<Yw&&s.logger.warning("system.loadFrameTimeout or system.iframeHashTimeout set to lower ("+e+"ms) than the default ("+Yw+"ms). This may result in timeouts.");var n=window.performance.now()+e,i=setInterval(function(){if(window.performance.now()>n)return s.removeHiddenIframe(a),clearInterval(i),void r(b_.createMonitorIframeTimeoutError());var e=wf.EMPTY_STRING,t=a.contentWindow;try{e=t?t.location.href:wf.EMPTY_STRING}catch(e){}Qg.isEmpty(e)||(t=t?t.location.hash:wf.EMPTY_STRING,Rm.hashContainsKnownProperties(t)&&(s.removeHiddenIframe(a),clearInterval(i),o(t)))},s.pollIntervalMilliseconds)})},Qw.prototype.loadFrame=function(r){var n=this;return new Promise(function(e,t){var o=n.createHiddenIframe();setTimeout(function(){o?(o.src=r,e(o)):t("Unable to load iframe")},n.navigateFrameWait)})},Qw.prototype.loadFrameSync=function(e){var t=this.createHiddenIframe();return t.src=e,t},Qw.prototype.createHiddenIframe=function(){var e=document.createElement("iframe");return e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height="0",e.style.border="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(e),e},Qw.prototype.removeHiddenIframe=function(e){document.body===e.parentNode&&document.body.removeChild(e)},Qw);function Qw(e,t,o,r,n){r=Vw.call(this,e,t,o,r)||this;return r.navigateFrameWait=n.navigateFrameWait,r.pollIntervalMilliseconds=n.pollIntervalMilliseconds,r}var Xw,$w=(of(e0,Xw=fw),e0.prototype.acquireToken=function(i){return af(this,void 0,void 0,function(){var t,o,r,n;return sf(this,function(e){switch(e.label){case 0:if(this.logger.verbose("acquireTokenByIframe called"),t=this.performanceClient.startMeasurement(Fm.SilentIframeClientAcquireToken,i.correlationId),Qg.isEmpty(i.loginHint)&&Qg.isEmpty(i.sid)&&(!i.account||Qg.isEmpty(i.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),i.prompt&&i.prompt!==Sf.NONE&&i.prompt!==Sf.NO_SESSION)throw t.endMeasurement({success:!1}),b_.createSilentPromptValueError(i.prompt);return[4,this.initializeAuthorizationRequest(rf(rf({},i),{prompt:i.prompt||Sf.NONE}),O_.Silent)];case 1:o=e.sent(),this.browserStorage.updateCacheEntries(o.state,o.nonce,o.authority,o.loginHint||wf.EMPTY_STRING,o.account||null),r=this.initializeServerTelemetryManager(this.apiId),e.label=2;case 2:return e.trys.push([2,5,,6]),[4,this.createAuthCodeClient(r,o.authority,o.azureCloudOptions)];case 3:return n=e.sent(),this.logger.verbose("Auth code client created"),[4,this.silentTokenHelper(n,o).then(function(e){return t.endMeasurement({success:!0,fromCache:!1,requestId:e.requestId}),e})];case 4:return[2,e.sent()];case 5:throw(n=e.sent())instanceof eg&&n.setCorrelationId(this.correlationId),r.cacheFailedRequest(n),this.browserStorage.cleanRequestByState(o.state),t.endMeasurement({errorCode:n instanceof eg&&n.errorCode||void 0,subErrorCode:n instanceof eg&&n.subError||void 0,success:!1}),n;case 6:return[2]}})})},e0.prototype.logout=function(){return Promise.reject(b_.createSilentLogoutUnsupportedError())},e0.prototype.silentTokenHelper=function(c,u){return af(this,void 0,void 0,function(){var t,o,r,n,i,a,s=this;return sf(this,function(e){switch(e.label){case 0:return[4,this.initializeAuthorizationCodeRequest(u)];case 1:return t=e.sent(),[4,c.getAuthCodeUrl(rf(rf({},u),{nativeBroker:Lw.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,u.authenticationScheme)}))];case 2:return a=e.sent(),[4,(o=new Jw(c,this.browserStorage,t,this.logger,this.config.system)).initiateAuthRequest(a)];case 3:return i=e.sent(),[4,o.monitorIframeForHash(i,this.config.system.iframeHashTimeout)];case 4:if(r=e.sent(),a=Rm.getDeserializedHash(r),n=this.validateAndExtractStateFromHash(a,O_.Silent,t.correlationId),a.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw b_.createNativeConnectionNotEstablishedError();return i=new Mw(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,a.accountId,this.browserStorage,this.correlationId),a=Om.parseRequestState(this.browserCrypto,n).userRequestState,[2,i.acquireToken(rf(rf({},u),{state:a,prompt:u.prompt||Sf.NONE})).finally(function(){s.browserStorage.cleanRequestByState(n)})]}return[2,o.handleCodeResponseFromHash(r,n,c.authority,this.networkClient)]}})})},e0);function e0(e,t,o,r,n,i,a,s,c,u,l){l=Xw.call(this,e,t,o,r,n,i,s,u,l)||this;return l.apiId=a,l.nativeStorage=c,l}var t0,o0=(of(r0,t0=fw),r0.prototype.acquireToken=function(s){return af(this,void 0,void 0,function(){var t,o,r,n,i,a=this;return sf(this,function(e){switch(e.label){case 0:return o=[rf({},s)],[4,this.initializeBaseRequest(s)];case 1:return t=rf.apply(void 0,o.concat([e.sent()])),r=this.performanceClient.startMeasurement(Fm.SilentRefreshClientAcquireToken,t.correlationId),n=this.initializeServerTelemetryManager(k_.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(n,t.authority,t.azureCloudOptions)];case 2:return i=e.sent(),this.logger.verbose("Refresh token client created"),[2,i.acquireTokenByRefreshToken(t).then(function(e){return r.endMeasurement({success:!0,fromCache:e.fromCache,requestId:e.requestId}),e}).catch(function(e){throw e instanceof eg&&e.setCorrelationId(a.correlationId),n.cacheFailedRequest(e),r.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})]}})})},r0.prototype.logout=function(){return Promise.reject(b_.createSilentLogoutUnsupportedError())},r0.prototype.createRefreshTokenClient=function(o,r,n){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){switch(e.label){case 0:return[4,this.getClientConfiguration(o,r,n)];case 1:return t=e.sent(),[2,new Wm(t,this.performanceClient)]}})})},r0);function r0(){return null!==t0&&t0.apply(this,arguments)||this}var n0=(i0.prototype.addEventCallback=function(e){if("undefined"==typeof window)return null;var t=this.browserCrypto.createNewGuid();return this.eventCallbacks.set(t,e),this.logger.verbose("Event callback registered with id: "+t),t},i0.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},i0.prototype.enableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))},i0.prototype.disableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))},i0.prototype.emitEvent=function(o,e,t,r){var n,i=this;"undefined"!=typeof window&&(n={eventType:o,interactionType:e||null,payload:t||null,error:r||null,timestamp:Date.now()},this.logger.info("Emitting event: "+o),this.eventCallbacks.forEach(function(e,t){i.logger.verbose("Emitting event to callback "+t+": "+o),e.apply(null,[n])}))},i0.prototype.handleAccountCacheChange=function(e){try{var t=e.newValue||e.oldValue;if(!t)return;var o=JSON.parse(t);if("object"!=typeof o||!Ny.isAccountEntity(o))return;var r=jy.toObject(new Ny,o).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(_w.ACCOUNT_ADDED,void 0,r)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(_w.ACCOUNT_REMOVED,void 0,r))}catch(e){return}},i0);function i0(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}var a0=(s0.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},s0);function s0(){}var c0=(u0.prototype.generateGuid=function(){try{var e=new Uint8Array(16);return this.cryptoObj.getRandomValues(e),e[6]|=64,e[6]&=79,e[8]|=128,e[8]&=191,a0.decimalToHex(e[0])+a0.decimalToHex(e[1])+a0.decimalToHex(e[2])+a0.decimalToHex(e[3])+"-"+a0.decimalToHex(e[4])+a0.decimalToHex(e[5])+"-"+a0.decimalToHex(e[6])+a0.decimalToHex(e[7])+"-"+a0.decimalToHex(e[8])+a0.decimalToHex(e[9])+"-"+a0.decimalToHex(e[10])+a0.decimalToHex(e[11])+a0.decimalToHex(e[12])+a0.decimalToHex(e[13])+a0.decimalToHex(e[14])+a0.decimalToHex(e[15])}catch(e){for(var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",o="0123456789abcdef",r=0,n=wf.EMPTY_STRING,i=0;i<36;i++)"-"!==t[i]&&"4"!==t[i]&&(r=16*Math.random()|0),"x"===t[i]?n+=o[r]:"y"===t[i]?(r&=3,n+=o[r|=8]):n+=t[i];return n}},u0.prototype.isGuid=function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},u0);function u0(e){this.cryptoObj=e}var l0=(h0.stringToUtf8Arr=function(e){for(var t,o=0,r=e.length,n=0;n<r;n++)o+=(t=e.charCodeAt(n))<128?1:t<2048?2:t<65536?3:t<2097152?4:t<67108864?5:6;for(var i=new Uint8Array(o),a=0,s=0;a<o;s++)(t=e.charCodeAt(s))<128?i[a++]=t:(t<2048?i[a++]=192+(t>>>6):(t<65536?i[a++]=224+(t>>>12):(t<2097152?i[a++]=240+(t>>>18):(t<67108864?i[a++]=248+(t>>>24):(i[a++]=252+(t>>>30),i[a++]=128+(t>>>24&63)),i[a++]=128+(t>>>18&63)),i[a++]=128+(t>>>12&63)),i[a++]=128+(t>>>6&63)),i[a++]=128+(63&t));return i},h0.stringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),o=new Uint8Array(t),r=0;r<e.length;r++)o[r]=e.charCodeAt(r);return t},h0.utf8ArrToString=function(e){for(var t,o=wf.EMPTY_STRING,r=e.length,n=0;n<r;n++)t=e[n],o+=String.fromCharCode(251<t&&t<254&&n+5<r?1073741824*(t-252)+(e[++n]-128<<24)+(e[++n]-128<<18)+(e[++n]-128<<12)+(e[++n]-128<<6)+e[++n]-128:247<t&&t<252&&n+4<r?(t-248<<24)+(e[++n]-128<<18)+(e[++n]-128<<12)+(e[++n]-128<<6)+e[++n]-128:239<t&&t<248&&n+3<r?(t-240<<18)+(e[++n]-128<<12)+(e[++n]-128<<6)+e[++n]-128:223<t&&t<240&&n+2<r?(t-224<<12)+(e[++n]-128<<6)+e[++n]-128:191<t&&t<224&&n+1<r?(t-192<<6)+e[++n]-128:t);return o},h0.getSortedObjectString=function(e){return JSON.stringify(e,Object.keys(e).sort())},h0);function h0(){}var p0=(d0.prototype.urlEncode=function(e){return encodeURIComponent(this.encode(e).replace(/=/g,wf.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_"))},d0.prototype.urlEncodeArr=function(e){return this.base64EncArr(e).replace(/=/g,wf.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_")},d0.prototype.encode=function(e){e=l0.stringToUtf8Arr(e);return this.base64EncArr(e)},d0.prototype.base64EncArr=function(e){for(var t,o=(3-e.length%3)%3,r=wf.EMPTY_STRING,n=e.length,i=0,a=0;a<n;a++)i|=e[a]<<(16>>>(t=a%3)&24),2!=t&&e.length-a!=1||(r+=String.fromCharCode(this.uint6ToB64(i>>>18&63),this.uint6ToB64(i>>>12&63),this.uint6ToB64(i>>>6&63),this.uint6ToB64(63&i)),i=0);return 0==o?r:r.substring(0,r.length-o)+(1==o?"=":"==")},d0.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:62===e?43:63===e?47:65},d0);function d0(){}var f0=(g0.prototype.decode=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Invalid base64 string")}e=this.base64DecToArr(t);return l0.utf8ArrToString(e)},g0.prototype.base64DecToArr=function(e,t){for(var o,r=e.replace(/[^A-Za-z0-9\+\/]/g,wf.EMPTY_STRING),n=r.length,i=t?Math.ceil((3*n+1>>>2)/t)*t:3*n+1>>>2,a=new Uint8Array(i),s=void 0,c=0,u=0,l=0;l<n;l++)if(o=3&l,c|=this.b64ToUint6(r.charCodeAt(l))<<18-6*o,3==o||n-l==1){for(s=0;s<3&&u<i;s++,u++)a[u]=c>>>(16>>>s&24)&255;c=0}return a},g0.prototype.b64ToUint6=function(e){return 64<e&&e<91?e-65:96<e&&e<123?e-71:47<e&&e<58?e+4:43===e?62:47===e?63:0},g0);function g0(){}var y0=(m0.prototype.generateCodes=function(){return af(this,void 0,void 0,function(){var t,o;return sf(this,function(e){switch(e.label){case 0:return t=this.generateCodeVerifier(),[4,this.generateCodeChallengeFromVerifier(t)];case 1:return o=e.sent(),[2,{verifier:t,challenge:o}]}})})},m0.prototype.generateCodeVerifier=function(){try{var e=new Uint8Array(32);return this.cryptoObj.getRandomValues(e),this.base64Encode.urlEncodeArr(e)}catch(e){throw b_.createPkceNotGeneratedError(e)}},m0.prototype.generateCodeChallengeFromVerifier=function(o){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.cryptoObj.sha256Digest(o)];case 1:return t=e.sent(),[2,this.base64Encode.urlEncodeArr(new Uint8Array(t))];case 2:throw t=e.sent(),b_.createPkceNotGeneratedError(t);case 3:return[2]}})})},m0);function m0(e){this.base64Encode=new p0,this.cryptoObj=e}var v0=(_0.prototype.getRandomValues=function(e){return window.crypto.getRandomValues(e)},_0.prototype.generateKey=function(t,o,r){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,window.crypto.subtle.generateKey(t,o,r)]})})},_0.prototype.exportKey=function(t){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,window.crypto.subtle.exportKey(L_,t)]})})},_0.prototype.importKey=function(t,o,r,n){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,window.crypto.subtle.importKey(L_,t,o,r,n)]})})},_0.prototype.sign=function(t,o,r){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,window.crypto.subtle.sign(t,o,r)]})})},_0.prototype.digest=function(t,o){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,window.crypto.subtle.digest(t,o)]})})},_0);function _0(){}var w0=(b0.prototype.initPrng=function(e){return window.msrCrypto.initPrng(cf(e))},b0.prototype.getRandomValues=function(e){return window.msrCrypto.getRandomValues(e)},b0.prototype.generateKey=function(t,o,r){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,window.msrCrypto.subtle.generateKey(t,o,r)]})})},b0.prototype.exportKey=function(t){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,window.msrCrypto.subtle.exportKey(L_,t)]})})},b0.prototype.importKey=function(t,o,r,n){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,window.msrCrypto.subtle.importKey(L_,t,o,r,n)]})})},b0.prototype.sign=function(t,o,r){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,window.msrCrypto.subtle.sign(t,o,r)]})})},b0.prototype.digest=function(t,o){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,window.msrCrypto.subtle.digest(t,o)]})})},b0);function b0(){}var C0=(E0.prototype.getRandomValues=function(e){return window.msCrypto.getRandomValues(e)},E0.prototype.generateKey=function(r,n,i){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,new Promise(function(t,o){var e=window.msCrypto.subtle.generateKey(r,n,i);e.addEventListener("complete",function(e){t(e.target.result)}),e.addEventListener("error",function(e){o(e)})})]})})},E0.prototype.exportKey=function(t){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,new Promise(function(o,r){var e=window.msCrypto.subtle.exportKey(L_,t);e.addEventListener("complete",function(e){var t=e.target.result,t=l0.utf8ArrToString(new Uint8Array(t)).replace(/\r/g,wf.EMPTY_STRING).replace(/\n/g,wf.EMPTY_STRING).replace(/\t/g,wf.EMPTY_STRING).split(" ").join(wf.EMPTY_STRING).replace("\0",wf.EMPTY_STRING);try{o(JSON.parse(t))}catch(e){r(e)}}),e.addEventListener("error",function(e){r(e)})})]})})},E0.prototype.importKey=function(o,n,i,a){return af(this,void 0,void 0,function(){var t,r;return sf(this,function(e){return t=l0.getSortedObjectString(o),r=l0.stringToArrayBuffer(t),[2,new Promise(function(t,o){var e=window.msCrypto.subtle.importKey(L_,r,n,i,a);e.addEventListener("complete",function(e){t(e.target.result)}),e.addEventListener("error",function(e){o(e)})})]})})},E0.prototype.sign=function(r,n,i){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,new Promise(function(t,o){var e=window.msCrypto.subtle.sign(r,n,i);e.addEventListener("complete",function(e){t(e.target.result)}),e.addEventListener("error",function(e){o(e)})})]})})},E0.prototype.digest=function(r,n){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,new Promise(function(t,o){var e=window.msCrypto.subtle.digest(r,n.buffer);e.addEventListener("complete",function(e){t(e.target.result)}),e.addEventListener("error",function(e){o(e)})})]})})},E0);function E0(){}var S0="SHA-256",T0=new Uint8Array([1,0,1]),I0=(A0.prototype.hasIECrypto=function(){return"msCrypto"in window},A0.prototype.hasBrowserCrypto=function(){return"crypto"in window},A0.prototype.hasMsrCrypto=function(){return"msrCrypto"in window},A0.prototype.sha256Digest=function(o){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){return t=l0.stringToUtf8Arr(o),[2,this.subtleCrypto.digest({name:S0},t)]})})},A0.prototype.getRandomValues=function(e){return this.subtleCrypto.getRandomValues(e)},A0.prototype.generateKeyPair=function(t,o){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,this.subtleCrypto.generateKey(this.keygenAlgorithmOptions,t,o)]})})},A0.prototype.exportJwk=function(t){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,this.subtleCrypto.exportKey(t)]})})},A0.prototype.importJwk=function(t,o,r){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,this.subtleCrypto.importKey(t,this.keygenAlgorithmOptions,o,r)]})})},A0.prototype.sign=function(t,o){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,this.subtleCrypto.sign(this.keygenAlgorithmOptions,t,o)]})})},A0);function A0(e,t){var o;if(this.logger=e,this.cryptoOptions=t,this.hasBrowserCrypto())this.logger.verbose("BrowserCrypto: modern crypto interface available"),this.subtleCrypto=new v0;else if(this.hasIECrypto())this.logger.verbose("BrowserCrypto: MS crypto interface available"),this.subtleCrypto=new C0;else{if(!this.hasMsrCrypto()||null===(o=this.cryptoOptions)||void 0===o||!o.useMsrCrypto)throw this.hasMsrCrypto()&&this.logger.info("BrowserCrypto: MSR Crypto interface available but system.cryptoOptions.useMsrCrypto not enabled"),this.logger.error("BrowserCrypto: No crypto interfaces available."),b_.createCryptoNotAvailableError("Browser crypto, msCrypto, or msrCrypto interfaces not available.");this.logger.verbose("BrowserCrypto: MSR crypto interface available"),this.subtleCrypto=new w0}if(this.subtleCrypto.initPrng){if(this.logger.verbose("BrowserCrypto: Interface requires entropy"),null===(o=this.cryptoOptions)||void 0===o||!o.entropy)throw this.logger.error("BrowserCrypto: Interface requires entropy but none provided."),Y_.createEntropyNotProvided();this.logger.verbose("BrowserCrypto: Entropy provided"),this.subtleCrypto.initPrng(this.cryptoOptions.entropy)}this.keygenAlgorithmOptions={name:"RSASSA-PKCS1-v1_5",hash:S0,modulusLength:2048,publicExponent:T0}}var k0=(O0.prototype.open=function(){return af(this,void 0,void 0,function(){var r=this;return sf(this,function(e){return[2,new Promise(function(t,e){var o=window.indexedDB.open(r.dbName,r.version);o.addEventListener("upgradeneeded",function(e){e.target.result.createObjectStore(r.tableName)}),o.addEventListener("success",function(e){r.db=e.target.result,r.dbOpen=!0,t()}),o.addEventListener("error",function(){return e(b_.createDatabaseUnavailableError())})})]})})},O0.prototype.closeConnection=function(){var e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)},O0.prototype.validateDbIsOpen=function(){return af(this,void 0,void 0,function(){return sf(this,function(e){switch(e.label){case 0:return this.dbOpen?[3,2]:[4,this.open()];case 1:return[2,e.sent()];case 2:return[2]}})})},O0.prototype.getItem=function(n){return af(this,void 0,void 0,function(){var r=this;return sf(this,function(e){switch(e.label){case 0:return[4,this.validateDbIsOpen()];case 1:return e.sent(),[2,new Promise(function(t,o){if(!r.db)return o(b_.createDatabaseNotOpenError());var e=r.db.transaction([r.tableName],"readonly").objectStore(r.tableName).get(n);e.addEventListener("success",function(e){r.closeConnection(),t(e.target.result)}),e.addEventListener("error",function(e){r.closeConnection(),o(e)})})]}})})},O0.prototype.setItem=function(n,i){return af(this,void 0,void 0,function(){var r=this;return sf(this,function(e){switch(e.label){case 0:return[4,this.validateDbIsOpen()];case 1:return e.sent(),[2,new Promise(function(e,t){if(!r.db)return t(b_.createDatabaseNotOpenError());var o=r.db.transaction([r.tableName],"readwrite").objectStore(r.tableName).put(i,n);o.addEventListener("success",function(){r.closeConnection(),e()}),o.addEventListener("error",function(e){r.closeConnection(),t(e)})})]}})})},O0.prototype.removeItem=function(n){return af(this,void 0,void 0,function(){var r=this;return sf(this,function(e){switch(e.label){case 0:return[4,this.validateDbIsOpen()];case 1:return e.sent(),[2,new Promise(function(e,t){if(!r.db)return t(b_.createDatabaseNotOpenError());var o=r.db.transaction([r.tableName],"readwrite").objectStore(r.tableName).delete(n);o.addEventListener("success",function(){r.closeConnection(),e()}),o.addEventListener("error",function(e){r.closeConnection(),t(e)})})]}})})},O0.prototype.getKeys=function(){return af(this,void 0,void 0,function(){var r=this;return sf(this,function(e){switch(e.label){case 0:return[4,this.validateDbIsOpen()];case 1:return e.sent(),[2,new Promise(function(t,o){if(!r.db)return o(b_.createDatabaseNotOpenError());var e=r.db.transaction([r.tableName],"readonly").objectStore(r.tableName).getAllKeys();e.addEventListener("success",function(e){r.closeConnection(),t(e.target.result)}),e.addEventListener("error",function(e){r.closeConnection(),o(e)})})]}})})},O0.prototype.containsKey=function(n){return af(this,void 0,void 0,function(){var r=this;return sf(this,function(e){switch(e.label){case 0:return[4,this.validateDbIsOpen()];case 1:return e.sent(),[2,new Promise(function(t,o){if(!r.db)return o(b_.createDatabaseNotOpenError());var e=r.db.transaction([r.tableName],"readonly").objectStore(r.tableName).count(n);e.addEventListener("success",function(e){r.closeConnection(),t(1===e.target.result)}),e.addEventListener("error",function(e){r.closeConnection(),o(e)})})]}})})},O0.prototype.deleteDatabase=function(){return af(this,void 0,void 0,function(){return sf(this,function(e){return this.db&&this.dbOpen&&this.closeConnection(),[2,new Promise(function(e,t){var o=window.indexedDB.deleteDatabase(q_);o.addEventListener("success",function(){return e(!0)}),o.addEventListener("blocked",function(){return e(!0)}),o.addEventListener("error",function(){return t(!1)})})]})})},O0);function O0(){this.dbName=q_,this.version=1,this.tableName="msal.db.keys",this.dbOpen=!1}var P0,x0=(R0.prototype.handleDatabaseAccessError=function(e){if(!(e instanceof b_&&e.errorCode===f_.code))throw e;this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.")},R0.prototype.getItem=function(r){return af(this,void 0,void 0,function(){var t,o;return sf(this,function(e){switch(e.label){case 0:if(t=this.inMemoryCache.getItem(r))return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.getItem(r)];case 2:return[2,e.sent()];case 3:return o=e.sent(),this.handleDatabaseAccessError(o),[3,4];case 4:return[2,t]}})})},R0.prototype.setItem=function(o,r){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){switch(e.label){case 0:this.inMemoryCache.setItem(o,r),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.indexedDBCache.setItem(o,r)];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2]}})})},R0.prototype.removeItem=function(o){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){switch(e.label){case 0:this.inMemoryCache.removeItem(o),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.indexedDBCache.removeItem(o)];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2]}})})},R0.prototype.getKeys=function(){return af(this,void 0,void 0,function(){var t,o;return sf(this,function(e){switch(e.label){case 0:if(0!==(t=this.inMemoryCache.getKeys()).length)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),this.logger.verbose("In-memory cache is empty, now querying persistent storage."),[4,this.indexedDBCache.getKeys()];case 2:return[2,e.sent()];case 3:return o=e.sent(),this.handleDatabaseAccessError(o),[3,4];case 4:return[2,t]}})})},R0.prototype.containsKey=function(r){return af(this,void 0,void 0,function(){var t,o;return sf(this,function(e){switch(e.label){case 0:if(t=this.inMemoryCache.containsKey(r))return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.containsKey(r)];case 2:return[2,e.sent()];case 3:return o=e.sent(),this.handleDatabaseAccessError(o),[3,4];case 4:return[2,t]}})})},R0.prototype.clearInMemory=function(){this.logger.verbose("Deleting in-memory keystore "+this.storeName),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore "+this.storeName+" deleted")},R0.prototype.clearPersistent=function(){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this.logger.verbose("Deleting persistent keystore"),[4,this.indexedDBCache.deleteDatabase()];case 1:return(t=e.sent())&&this.logger.verbose("Persistent keystore deleted"),[2,t];case 2:return t=e.sent(),this.handleDatabaseAccessError(t),[2,!1];case 3:return[2]}})})},R0);function R0(e,t){this.inMemoryCache=new J_,this.indexedDBCache=new k0,this.logger=e,this.storeName=t}(hw=P0=P0||{}).asymmetricKeys="asymmetricKeys",hw.symmetricKeys="symmetricKeys";var M0=(N0.prototype.clear=function(){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){switch(e.label){case 0:this.asymmetricKeys.clearInMemory(),this.symmetricKeys.clearInMemory(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.asymmetricKeys.clearPersistent()];case 2:return e.sent(),[2,!0];case 3:return(t=e.sent())instanceof Error?this.logger.error("Clearing keystore failed with error: "+t.message):this.logger.error("Clearing keystore failed with unknown error"),[2,!1];case 4:return[2]}})})},N0);function N0(e){this.logger=e,this.asymmetricKeys=new x0(this.logger,P0.asymmetricKeys),this.symmetricKeys=new x0(this.logger,P0.symmetricKeys)}var L0=(D0.prototype.createNewGuid=function(){return this.guidGenerator.generateGuid()},D0.prototype.base64Encode=function(e){return this.b64Encode.encode(e)},D0.prototype.base64Decode=function(e){return this.b64Decode.decode(e)},D0.prototype.generatePkceCodes=function(){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,this.pkceGenerator.generateCodes()]})})},D0.prototype.getPublicKeyThumbprint=function(a){var s;return af(this,void 0,void 0,function(){var t,o,r,n,i;return sf(this,function(e){switch(e.label){case 0:return t=null===(s=this.performanceClient)||void 0===s?void 0:s.startMeasurement(Fm.CryptoOptsGetPublicKeyThumbprint,a.correlationId),[4,this.browserCrypto.generateKeyPair(D0.EXTRACTABLE,D0.POP_KEY_USAGES)];case 1:return o=e.sent(),[4,this.browserCrypto.exportJwk(o.publicKey)];case 2:return r=e.sent(),r={e:r.e,kty:r.kty,n:r.n},r=l0.getSortedObjectString(r),[4,this.hashString(r)];case 3:return n=e.sent(),[4,this.browserCrypto.exportJwk(o.privateKey)];case 4:return i=e.sent(),[4,this.browserCrypto.importJwk(i,!1,["sign"])];case 5:return i=e.sent(),[4,this.cache.asymmetricKeys.setItem(n,{privateKey:i,publicKey:o.publicKey,requestMethod:a.resourceRequestMethod,requestUri:a.resourceRequestUri})];case 6:return e.sent(),t&&t.endMeasurement({success:!0}),[2,n]}})})},D0.prototype.removeTokenBindingKey=function(t){return af(this,void 0,void 0,function(){return sf(this,function(e){switch(e.label){case 0:return[4,this.cache.asymmetricKeys.removeItem(t)];case 1:return e.sent(),[4,this.cache.asymmetricKeys.containsKey(t)];case 2:return[2,!e.sent()]}})})},D0.prototype.clearKeystore=function(){return af(this,void 0,void 0,function(){return sf(this,function(e){switch(e.label){case 0:return[4,this.cache.clear()];case 1:return[2,e.sent()]}})})},D0.prototype.signJwt=function(a,s,c){var u;return af(this,void 0,void 0,function(){var t,o,r,n,i;return sf(this,function(e){switch(e.label){case 0:return t=null===(u=this.performanceClient)||void 0===u?void 0:u.startMeasurement(Fm.CryptoOptsSignJwt,c),[4,this.cache.asymmetricKeys.getItem(s)];case 1:if(!(o=e.sent()))throw b_.createSigningKeyNotFoundInStorageError(s);return[4,this.browserCrypto.exportJwk(o.publicKey)];case 2:return n=e.sent(),i=l0.getSortedObjectString(n),r=this.b64Encode.urlEncode(JSON.stringify({kid:s})),n=wv.getShrHeaderString({kid:r,alg:n.alg}),n=this.b64Encode.urlEncode(n),a.cnf={jwk:JSON.parse(i)},i=this.b64Encode.urlEncode(JSON.stringify(a)),n=n+"."+i,i=l0.stringToArrayBuffer(n),[4,this.browserCrypto.sign(o.privateKey,i)];case 3:return i=e.sent(),i=this.b64Encode.urlEncodeArr(new Uint8Array(i)),i=n+"."+i,t&&t.endMeasurement({success:!0}),[2,i]}})})},D0.prototype.hashString=function(o){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){switch(e.label){case 0:return[4,this.browserCrypto.sha256Digest(o)];case 1:return t=e.sent(),t=new Uint8Array(t),[2,this.b64Encode.urlEncodeArr(t)]}})})},D0.POP_KEY_USAGES=["sign","verify"],D0.EXTRACTABLE=!0,D0);function D0(e,t,o){this.logger=e,this.browserCrypto=new I0(this.logger,o),this.b64Encode=new p0,this.b64Decode=new f0,this.guidGenerator=new c0(this.browserCrypto),this.pkceGenerator=new y0(this.browserCrypto),this.cache=new M0(this.logger),this.performanceClient=t}var q0=(j0.prototype.loadExternalTokens=function(e,t,o){if(this.logger.info("TokenCache - loadExternalTokens called"),!t.id_token)throw b_.createUnableToLoadTokenError("Please ensure server response includes id token.");var r=new Dy(t.id_token,this.cryptoObj);if(e.account)var n=this.loadAccount(r,e.account.environment,void 0,void 0,e.account.homeAccountId),i=new km(n,this.loadIdToken(r,n.homeAccountId,e.account.environment,e.account.tenantId),this.loadAccessToken(e,t,n.homeAccountId,e.account.environment,e.account.tenantId,o),this.loadRefreshToken(e,t,n.homeAccountId,e.account.environment));else{if(!e.authority)throw b_.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");var a=av.generateAuthority(e.authority,e.azureCloudOptions),s={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},s=new av(a,this.config.system.networkClient,this.storage,s,this.logger);if(o.clientInfo){this.logger.trace("TokenCache - homeAccountId from options");n=this.loadAccount(r,s.hostnameAndPort,o.clientInfo,s.authorityType);i=new km(n,this.loadIdToken(r,n.homeAccountId,s.hostnameAndPort,s.tenant),this.loadAccessToken(e,t,n.homeAccountId,s.hostnameAndPort,s.tenant,o),this.loadRefreshToken(e,t,n.homeAccountId,s.hostnameAndPort))}else{if(!t.client_info)throw b_.createUnableToLoadTokenError("Please provide clientInfo in the response or options.");this.logger.trace("TokenCache - homeAccountId from response");n=this.loadAccount(r,s.hostnameAndPort,t.client_info,s.authorityType);i=new km(n,this.loadIdToken(r,n.homeAccountId,s.hostnameAndPort,s.tenant),this.loadAccessToken(e,t,n.homeAccountId,s.hostnameAndPort,s.tenant,o),this.loadRefreshToken(e,t,n.homeAccountId,s.hostnameAndPort))}}return this.generateAuthenticationResult(e,r,i,s)},j0.prototype.loadAccount=function(e,t,o,r,n){var i;if(n?i=n:void 0!==r&&o&&(i=Ny.generateHomeAccountId(o,r,this.logger,this.cryptoObj,e)),!i)throw b_.createUnableToLoadTokenError("Unexpected missing homeAccountId");t=o?Ny.createAccount(o,i,e,void 0,void 0,void 0,t):Ny.createGenericAccount(i,e,void 0,void 0,void 0,t);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading account"),this.storage.setAccount(t),t;throw b_.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},j0.prototype.loadIdToken=function(e,t,o,r){r=hm.createIdTokenEntity(t,o,e.rawToken,this.config.auth.clientId,r);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading id token"),this.storage.setIdTokenCredential(r),r;throw b_.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},j0.prototype.loadAccessToken=function(e,t,o,r,n,i){if(!t.access_token)return this.logger.verbose("TokenCache - No access token provided for caching"),null;if(!t.expires_in)throw b_.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");if(!i.extendedExpiresOn)throw b_.createUnableToLoadTokenError("Please provide an extendedExpiresOn value in the options.");var a=new Py(e.scopes).printScopes(),e=i.expiresOn||t.expires_in+(new Date).getTime()/1e3,i=i.extendedExpiresOn,i=ym.createAccessTokenEntity(o,r,t.access_token,this.config.auth.clientId,n,a,e,i,this.cryptoObj);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(i),i;throw b_.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},j0.prototype.loadRefreshToken=function(e,t,o,r){if(!t.refresh_token)return this.logger.verbose("TokenCache - No refresh token provided for caching"),null;t=_m.createRefreshTokenEntity(o,r,t.refresh_token,this.config.auth.clientId);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading refresh token"),this.storage.setRefreshTokenCredential(t),t;throw b_.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},j0.prototype.generateAuthenticationResult=function(e,t,o,r){var n,i=wf.EMPTY_STRING,a=[],s=null;null!=o&&o.accessToken&&(i=o.accessToken.secret,a=Py.fromString(o.accessToken.target).asArray(),s=new Date(1e3*Number(o.accessToken.expiresOn)),n=new Date(1e3*Number(o.accessToken.extendedExpiresOn)));var c=(null==t?void 0:t.claims.oid)||(null==t?void 0:t.claims.sub)||wf.EMPTY_STRING,u=(null==t?void 0:t.claims.tid)||wf.EMPTY_STRING;return{authority:r?r.canonicalAuthority:wf.EMPTY_STRING,uniqueId:c,tenantId:u,scopes:a,account:null!=o&&o.account?o.account.getAccountInfo():null,idToken:t?t.rawToken:wf.EMPTY_STRING,idTokenClaims:t?t.claims:{},accessToken:i,fromCache:!0,expiresOn:s,correlationId:e.correlationId||wf.EMPTY_STRING,requestId:wf.EMPTY_STRING,extExpiresOn:n,familyId:wf.EMPTY_STRING,tokenType:(null===(n=null==o?void 0:o.accessToken)||void 0===n?void 0:n.tokenType)||wf.EMPTY_STRING,state:wf.EMPTY_STRING,cloudGraphHostName:(null===(n=null==o?void 0:o.account)||void 0===n?void 0:n.cloudGraphHostName)||wf.EMPTY_STRING,msGraphHost:(null===(o=null==o?void 0:o.account)||void 0===o?void 0:o.msGraphHost)||wf.EMPTY_STRING,code:void 0,fromNativeBroker:!1}},j0);function j0(e,t,o,r){this.isBrowserEnvironment="undefined"!=typeof window,this.config=e,this.storage=t,this.logger=o,this.cryptoObj=r}var U0,H0=(of(z0,U0=Gm),z0);function z0(e){e=U0.call(this,e)||this;return e.includeRedirectUri=!1,e}var B0,F0=(of(K0,B0=fw),K0.prototype.acquireToken=function(i){return af(this,void 0,void 0,function(){var t,o,r,n;return sf(this,function(e){switch(e.label){case 0:if(this.logger.trace("SilentAuthCodeClient.acquireToken called"),!i.code)throw b_.createAuthCodeRequiredError();return[4,this.initializeAuthorizationRequest(i,O_.Silent)];case 1:t=e.sent(),this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||wf.EMPTY_STRING,t.account||null),o=this.initializeServerTelemetryManager(this.apiId),e.label=2;case 2:return e.trys.push([2,4,,5]),r=rf(rf({},t),{code:i.code}),[4,this.getClientConfiguration(o,t.authority)];case 3:return n=e.sent(),n=new H0(n),this.logger.verbose("Auth code client created"),[2,new Jw(n,this.browserStorage,r,this.logger,this.config.system).handleCodeResponseFromServer({code:i.code,msgraph_host:i.msGraphHost,cloud_graph_host_name:i.cloudGraphHostName,cloud_instance_host_name:i.cloudInstanceHostName},t.state,n.authority,this.networkClient,!1)];case 4:throw(n=e.sent())instanceof eg&&n.setCorrelationId(this.correlationId),o.cacheFailedRequest(n),this.browserStorage.cleanRequestByState(t.state),n;case 5:return[2]}})})},K0.prototype.logout=function(){return Promise.reject(b_.createSilentLogoutUnsupportedError())},K0);function K0(e,t,o,r,n,i,a,s,c,u){u=B0.call(this,e,t,o,r,n,i,s,c,u)||this;return u.apiId=a,u}var G0=(Y0.supportsBrowserPerformance=function(){return"undefined"!=typeof window&&void 0!==window.performance&&"function"==typeof window.performance.mark&&"function"==typeof window.performance.measure&&"function"==typeof window.performance.clearMarks&&"function"==typeof window.performance.clearMeasures&&"function"==typeof window.performance.getEntriesByName},Y0.prototype.startMeasurement=function(){if(Y0.supportsBrowserPerformance())try{window.performance.mark(this.startMark)}catch(e){}},Y0.prototype.endMeasurement=function(){if(Y0.supportsBrowserPerformance())try{window.performance.mark(this.endMark),window.performance.measure(this.measureName,this.startMark,this.endMark)}catch(e){}},Y0.prototype.flushMeasurement=function(){if(Y0.supportsBrowserPerformance())try{var e=window.performance.getEntriesByName(this.measureName,"measure");if(0<e.length){var t=e[0].duration;return window.performance.clearMeasures(this.measureName),window.performance.clearMarks(this.startMark),window.performance.clearMarks(this.endMark),t}}catch(e){}return null},Y0);function Y0(e,t){this.correlationId=t,this.measureName="msal.measure."+e+"."+this.correlationId,this.startMark="msal.start."+e+"."+this.correlationId,this.endMark="msal.end."+e+"."+this.correlationId}var Z0,W0=(of(V0,Z0=r),V0.prototype.startPerformanceMeasuremeant=function(e,t){return new G0(e,t)},V0.prototype.generateId=function(){return this.guidGenerator.generateGuid()},V0.prototype.getPageVisibility=function(){var e;return(null===(e=document.visibilityState)||void 0===e?void 0:e.toString())||null},V0.prototype.startMeasurement=function(e,t){var o=this,r=this.getPageVisibility(),n=Z0.prototype.startMeasurement.call(this,e,t);return rf(rf({},n),{endMeasurement:function(e){return n.endMeasurement(rf({startPageVisibility:r,endPageVisibility:o.getPageVisibility()},e))}})},V0);function V0(e,t,o,r,n,i,a){i=Z0.call(this,e,t,o,r,n,i)||this;return i.browserCrypto=new I0(i.logger,a),i.guidGenerator=new c0(i.browserCrypto),i}J0.prototype.initialize=function(){return af(this,void 0,void 0,function(){var t,o;return sf(this,function(e){switch(e.label){case 0:if(this.logger.trace("initialize called"),this.initialized)return this.logger.info("initialize has already been called, exiting early."),[2];if(this.eventHandler.emitEvent(_w.INITIALIZE_START),!this.config.system.allowNativeBroker)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),t=this,[4,Lw.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout)];case 2:return t.nativeExtensionProvider=e.sent(),[3,4];case 3:return o=e.sent(),this.logger.verbose(o),[3,4];case 4:return this.initialized=!0,this.eventHandler.emitEvent(_w.INITIALIZE_END),[2]}})})},J0.prototype.handleRedirectPromise=function(s){return af(this,void 0,void 0,function(){var t,o,r,n,i,a=this;return sf(this,function(e){return this.logger.verbose("handleRedirectPromise called"),uw.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),t=this.getAllAccounts(),this.isBrowserEnvironment?(o=s||wf.EMPTY_STRING,void 0===(r=this.redirectResponse.get(o))?(this.eventHandler.emitEvent(_w.HANDLE_REDIRECT_START,O_.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise"),i=this.browserStorage.getCachedNativeRequest(),n=void 0,n=i&&Lw.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!s?(this.logger.trace("handleRedirectPromise - acquiring token from native platform"),new Mw(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,k_.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,i.accountId,this.nativeInternalStorage,i.correlationId).handleRedirectPromise()):(this.logger.trace("handleRedirectPromise - acquiring token from web flow"),i=this.browserStorage.getTemporaryCache(I_.CORRELATION_ID,!0)||wf.EMPTY_STRING,this.createRedirectClient(i).handleRedirectPromise(s)),r=n.then(function(e){return e&&(t.length<a.getAllAccounts().length?(a.eventHandler.emitEvent(_w.LOGIN_SUCCESS,O_.Redirect,e),a.logger.verbose("handleRedirectResponse returned result, login success")):(a.eventHandler.emitEvent(_w.ACQUIRE_TOKEN_SUCCESS,O_.Redirect,e),a.logger.verbose("handleRedirectResponse returned result, acquire token success"))),a.eventHandler.emitEvent(_w.HANDLE_REDIRECT_END,O_.Redirect),e}).catch(function(e){throw 0<t.length?a.eventHandler.emitEvent(_w.ACQUIRE_TOKEN_FAILURE,O_.Redirect,null,e):a.eventHandler.emitEvent(_w.LOGIN_FAILURE,O_.Redirect,null,e),a.eventHandler.emitEvent(_w.HANDLE_REDIRECT_END,O_.Redirect),e}),this.redirectResponse.set(o,r)):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),[2,r]):(this.logger.verbose("handleRedirectPromise returns null, not browser environment"),[2,null])})})},J0.prototype.acquireTokenRedirect=function(n){return af(this,void 0,void 0,function(){var t,o,r=this;return sf(this,function(e){return t=this.getRequestCorrelationId(n),this.logger.verbose("acquireTokenRedirect called",t),this.preflightBrowserEnvironmentCheck(O_.Redirect),(o=0<this.getAllAccounts().length)?this.eventHandler.emitEvent(_w.ACQUIRE_TOKEN_START,O_.Redirect,n):this.eventHandler.emitEvent(_w.LOGIN_START,O_.Redirect,n),[2,(this.nativeExtensionProvider&&this.canUseNative(n)?new Mw(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,k_.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(n),this.nativeInternalStorage,n.correlationId).acquireTokenRedirect(n).catch(function(e){if(e instanceof Aw&&e.isFatal())return r.nativeExtensionProvider=void 0,r.createRedirectClient(n.correlationId).acquireToken(n);if(e instanceof Im)return r.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),r.createRedirectClient(n.correlationId).acquireToken(n);throw r.browserStorage.setInteractionInProgress(!1),e}):this.createRedirectClient(n.correlationId).acquireToken(n)).catch(function(e){throw o?r.eventHandler.emitEvent(_w.ACQUIRE_TOKEN_FAILURE,O_.Redirect,null,e):r.eventHandler.emitEvent(_w.LOGIN_FAILURE,O_.Redirect,null,e),e})]})})},J0.prototype.acquireTokenPopup=function(t){var o=this,e=this.getRequestCorrelationId(t),r=this.performanceClient.startMeasurement(Fm.AcquireTokenPopup,e);try{this.logger.verbose("acquireTokenPopup called",e),this.preflightBrowserEnvironmentCheck(O_.Popup)}catch(e){return Promise.reject(e)}var n=this.getAllAccounts();return 0<n.length?this.eventHandler.emitEvent(_w.ACQUIRE_TOKEN_START,O_.Popup,t):this.eventHandler.emitEvent(_w.LOGIN_START,O_.Popup,t),(this.canUseNative(t)?this.acquireTokenNative(t,k_.acquireTokenPopup).then(function(e){return o.browserStorage.setInteractionInProgress(!1),r.endMeasurement({success:!0,isNativeBroker:!0,requestId:e.requestId}),r.flushMeasurement(),e}).catch(function(e){if(e instanceof Aw&&e.isFatal())return o.nativeExtensionProvider=void 0,o.createPopupClient(t.correlationId).acquireToken(t);if(e instanceof Im)return o.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),o.createPopupClient(t.correlationId).acquireToken(t);throw o.browserStorage.setInteractionInProgress(!1),e}):this.createPopupClient(t.correlationId).acquireToken(t)).then(function(e){return n.length<o.getAllAccounts().length?o.eventHandler.emitEvent(_w.LOGIN_SUCCESS,O_.Popup,e):o.eventHandler.emitEvent(_w.ACQUIRE_TOKEN_SUCCESS,O_.Popup,e),r.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),r.endMeasurement({success:!0,requestId:e.requestId}),r.flushMeasurement(),e}).catch(function(e){return 0<n.length?o.eventHandler.emitEvent(_w.ACQUIRE_TOKEN_FAILURE,O_.Popup,null,e):o.eventHandler.emitEvent(_w.LOGIN_FAILURE,O_.Popup,null,e),r.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),r.flushMeasurement(),Promise.reject(e)})},J0.prototype.ssoSilent=function(i){return af(this,void 0,void 0,function(){var t,o,r,n=this;return sf(this,function(e){return t=this.getRequestCorrelationId(i),o=rf(rf({},i),{prompt:i.prompt,correlationId:t}),this.preflightBrowserEnvironmentCheck(O_.Silent),r=this.performanceClient.startMeasurement(Fm.SsoSilent,t),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(_w.SSO_SILENT_START,O_.Silent,o),[2,(this.canUseNative(o)?this.acquireTokenNative(o,k_.ssoSilent).catch(function(e){if(e instanceof Aw&&e.isFatal())return n.nativeExtensionProvider=void 0,n.createSilentIframeClient(o.correlationId).acquireToken(o);throw e}):this.createSilentIframeClient(o.correlationId).acquireToken(o)).then(function(e){return n.eventHandler.emitEvent(_w.SSO_SILENT_SUCCESS,O_.Silent,e),r.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),r.endMeasurement({success:!0,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),r.flushMeasurement(),e}).catch(function(e){throw n.eventHandler.emitEvent(_w.SSO_SILENT_FAILURE,O_.Silent,null,e),r.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),r.flushMeasurement(),e})]})})},J0.prototype.acquireTokenByCode=function(a){return af(this,void 0,void 0,function(){var t,o,r,n,i=this;return sf(this,function(e){t=this.getRequestCorrelationId(a),this.preflightBrowserEnvironmentCheck(O_.Silent),this.logger.trace("acquireTokenByCode called",t),this.eventHandler.emitEvent(_w.ACQUIRE_TOKEN_BY_CODE_START,O_.Silent,a),o=this.performanceClient.startMeasurement(Fm.AcquireTokenByCode,a.correlationId);try{if(a.code)return r=a.code,(n=this.hybridAuthCodeResponses.get(r))?(this.logger.verbose("Existing acquireTokenByCode request found",a.correlationId),o.endMeasurement({success:!0}),o.discardMeasurement()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),n=this.acquireTokenByCodeAsync(rf(rf({},a),{correlationId:t})).then(function(e){return i.eventHandler.emitEvent(_w.ACQUIRE_TOKEN_BY_CODE_SUCCESS,O_.Silent,e),i.hybridAuthCodeResponses.delete(r),o.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),o.endMeasurement({success:!0,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),o.flushMeasurement(),e}).catch(function(e){throw i.hybridAuthCodeResponses.delete(r),i.eventHandler.emitEvent(_w.ACQUIRE_TOKEN_BY_CODE_FAILURE,O_.Silent,null,e),o.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),o.flushMeasurement(),e}),this.hybridAuthCodeResponses.set(r,n)),[2,n];if(a.nativeAccountId){if(this.canUseNative(a,a.nativeAccountId))return[2,this.acquireTokenNative(a,k_.acquireTokenByCode,a.nativeAccountId).catch(function(e){throw e instanceof Aw&&e.isFatal()&&(i.nativeExtensionProvider=void 0),e})];throw b_.createUnableToAcquireTokenFromNativePlatformError()}throw b_.createAuthCodeOrNativeAccountIdRequiredError()}catch(e){throw this.eventHandler.emitEvent(_w.ACQUIRE_TOKEN_BY_CODE_FAILURE,O_.Silent,null,e),o.endMeasurement({errorCode:e instanceof eg&&e.errorCode||void 0,subErrorCode:e instanceof eg&&e.subError||void 0,success:!1}),e}return[2]})})},J0.prototype.acquireTokenByCodeAsync=function(t){return af(this,void 0,void 0,function(){return sf(this,function(e){switch(e.label){case 0:return this.logger.trace("acquireTokenByCodeAsync called",t.correlationId),[4,this.createSilentAuthCodeClient(t.correlationId).acquireToken(t)];case 1:return[2,e.sent()]}})})},J0.prototype.acquireTokenFromCache=function(t,o,r){return af(this,void 0,void 0,function(){return sf(this,function(e){switch(r.cacheLookupPolicy){case D_.Default:case D_.AccessToken:case D_.AccessTokenAndRefreshToken:return[2,t.acquireToken(o)];default:throw Wg.createRefreshRequiredError()}return[2]})})},J0.prototype.acquireTokenByRefreshToken=function(t,o){return af(this,void 0,void 0,function(){return sf(this,function(e){switch(o.cacheLookupPolicy){case D_.Default:case D_.AccessTokenAndRefreshToken:case D_.RefreshToken:case D_.RefreshTokenAndNetwork:return[2,this.createSilentRefreshClient(t.correlationId).acquireToken(t)];default:throw Wg.createRefreshRequiredError()}return[2]})})},J0.prototype.acquireTokenBySilentIframe=function(t){return af(this,void 0,void 0,function(){return sf(this,function(e){return[2,this.createSilentIframeClient(t.correlationId).acquireToken(t)]})})},J0.prototype.logout=function(o){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){return t=this.getRequestCorrelationId(o),this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),[2,this.logoutRedirect(rf({correlationId:t},o))]})})},J0.prototype.logoutRedirect=function(o){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){return t=this.getRequestCorrelationId(o),this.preflightBrowserEnvironmentCheck(O_.Redirect),[2,this.createRedirectClient(t).logout(o)]})})},J0.prototype.logoutPopup=function(e){try{var t=this.getRequestCorrelationId(e);return this.preflightBrowserEnvironmentCheck(O_.Popup),this.createPopupClient(t).logout(e)}catch(e){return Promise.reject(e)}},J0.prototype.getAllAccounts=function(){return this.logger.verbose("getAllAccounts called"),this.isBrowserEnvironment?this.browserStorage.getAllAccounts():[]},J0.prototype.getAccountByUsername=function(t){var e=this.getAllAccounts();return!Qg.isEmpty(t)&&e&&e.length?(this.logger.verbose("Account matching username found, returning"),this.logger.verbosePii("Returning signed-in accounts matching username: "+t),e.filter(function(e){return e.username.toLowerCase()===t.toLowerCase()})[0]||null):(this.logger.verbose("getAccountByUsername: No matching account found, returning null"),null)},J0.prototype.getAccountByHomeId=function(t){var e=this.getAllAccounts();return!Qg.isEmpty(t)&&e&&e.length?(this.logger.verbose("Account matching homeAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching homeAccountId: "+t),e.filter(function(e){return e.homeAccountId===t})[0]||null):(this.logger.verbose("getAccountByHomeId: No matching account found, returning null"),null)},J0.prototype.getAccountByLocalId=function(t){var e=this.getAllAccounts();return!Qg.isEmpty(t)&&e&&e.length?(this.logger.verbose("Account matching localAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching localAccountId: "+t),e.filter(function(e){return e.localAccountId===t})[0]||null):(this.logger.verbose("getAccountByLocalId: No matching account found, returning null"),null)},J0.prototype.setActiveAccount=function(e){this.browserStorage.setActiveAccount(e)},J0.prototype.getActiveAccount=function(){return this.browserStorage.getActiveAccount()},J0.prototype.preflightBrowserEnvironmentCheck=function(e,t){if(void 0===t&&(t=!0),this.logger.verbose("preflightBrowserEnvironmentCheck started"),uw.blockNonBrowserEnvironment(this.isBrowserEnvironment),uw.blockRedirectInIframe(e,this.config.system.allowRedirectInIframe),uw.blockReloadInHiddenIframes(),uw.blockAcquireTokenInPopups(),uw.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),e===O_.Redirect&&this.config.cache.cacheLocation===S_.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw Y_.createInMemoryRedirectUnavailableError();e!==O_.Redirect&&e!==O_.Popup||this.preflightInteractiveRequest(t)},J0.prototype.preflightInteractiveRequest=function(e){this.logger.verbose("preflightInteractiveRequest called, validating app environment"),uw.blockReloadInHiddenIframes(),e&&this.browserStorage.setInteractionInProgress(!0)},J0.prototype.acquireTokenNative=function(t,o,r){return af(this,void 0,void 0,function(){return sf(this,function(e){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw b_.createNativeConnectionNotEstablishedError();return[2,new Mw(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,o,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(t),this.nativeInternalStorage,t.correlationId).acquireToken(t)]})})},J0.prototype.canUseNative=function(e,t){if(this.logger.trace("canUseNative called"),!Lw.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case Sf.NONE:case Sf.CONSENT:case Sf.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace("canUseNative: prompt = "+e.prompt+" is not compatible with native flow, returning false"),!1}return!(!t&&!this.getNativeAccountId(e))||(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1)},J0.prototype.getNativeAccountId=function(e){e=e.account||this.browserStorage.getAccountInfoByHints(e.loginHint,e.sid)||this.getActiveAccount();return e&&e.nativeAccountId||""},J0.prototype.createPopupClient=function(e){return new zw(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},J0.prototype.createRedirectClient=function(e){return new jw(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},J0.prototype.createSilentIframeClient=function(e){return new $w(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,k_.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},J0.prototype.createSilentCacheClient=function(e){return new Pw(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},J0.prototype.createSilentRefreshClient=function(e){return new o0(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},J0.prototype.createSilentAuthCodeClient=function(e){return new F0(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,k_.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)},J0.prototype.addEventCallback=function(e){return this.eventHandler.addEventCallback(e)},J0.prototype.removeEventCallback=function(e){this.eventHandler.removeEventCallback(e)},J0.prototype.addPerformanceCallback=function(e){return this.performanceClient.addPerformanceCallback(e)},J0.prototype.removePerformanceCallback=function(e){return this.performanceClient.removePerformanceCallback(e)},J0.prototype.enableAccountStorageEvents=function(){this.eventHandler.enableAccountStorageEvents()},J0.prototype.disableAccountStorageEvents=function(){this.eventHandler.disableAccountStorageEvents()},J0.prototype.getTokenCache=function(){return this.tokenCache},J0.prototype.getLogger=function(){return this.logger},J0.prototype.setLogger=function(e){this.logger=e},J0.prototype.initializeWrapperLibrary=function(e,t){this.browserStorage.setWrapperMetadata(e,t)},J0.prototype.setNavigationClient=function(e){this.navigationClient=e},J0.prototype.getConfiguration=function(){return this.config},J0.prototype.getRequestCorrelationId=function(e){return null!=e&&e.correlationId?e.correlationId:this.isBrowserEnvironment?this.browserCrypto.createNewGuid():wf.EMPTY_STRING},r=J0;function J0(e){var t,o,r,n,i,a,s;this.isBrowserEnvironment="undefined"!=typeof window,this.config=(t=e,a=this.isBrowserEnvironment,o=t.auth,r=t.cache,n=t.system,s=t.telemetry,i={clientId:wf.EMPTY_STRING,authority:""+wf.DEFAULT_AUTHORITY,knownAuthorities:[],cloudDiscoveryMetadata:wf.EMPTY_STRING,authorityMetadata:wf.EMPTY_STRING,redirectUri:wf.EMPTY_STRING,postLogoutRedirectUri:wf.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:$m.AAD,azureCloudOptions:{azureCloudInstance:ty.None,tenant:wf.EMPTY_STRING},skipAuthorityMetadataCache:!1},e={cacheLocation:S_.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1},t={loggerCallback:function(){},logLevel:Jg.Info,piiLoggingEnabled:!1},t=rf(rf({},Fy),{loggerOptions:t,networkClient:a?uw.getBrowserNetworkClient():gv,navigationClient:new Fw,loadFrameTimeout:0,windowHashTimeout:(null==n?void 0:n.loadFrameTimeout)||Gw,iframeHashTimeout:(null==n?void 0:n.loadFrameTimeout)||Yw,navigateFrameWait:a&&uw.detectIEOrEdge()?500:0,redirectNavigationTimeout:Zw,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(null==n?void 0:n.nativeBrokerHandshakeTimeout)||Ww,pollIntervalMilliseconds:P_.DEFAULT_POLL_INTERVAL_MS,cryptoOptions:{useMsrCrypto:!1,entropy:void 0}}),a={application:{appName:wf.EMPTY_STRING,appVersion:wf.EMPTY_STRING}},{auth:rf(rf({},i),o),cache:rf(rf({},e),r),system:rf(rf({},t),n),telemetry:rf(rf({},a),s)}),this.initialized=!1,this.logger=new $g(this.config.system.loggerOptions,rw,nw),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.isBrowserEnvironment?new W0(this.config.auth.clientId,this.config.auth.authority,this.logger,rw,nw,this.config.telemetry.application,this.config.system.cryptoOptions):new kv(this.config.auth.clientId,this.config.auth.authority,this.logger,rw,nw,this.config.telemetry.application),this.browserCrypto=this.isBrowserEnvironment?new L0(this.logger,this.performanceClient,this.config.system.cryptoOptions):rg,this.eventHandler=new n0(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new tw(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger):(a=this.config.auth.clientId,c=this.logger,s={cacheLocation:S_.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1},new tw(a,s,rg,c));var c={cacheLocation:S_.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1};this.nativeInternalStorage=new tw(this.config.auth.clientId,c,this.browserCrypto,this.logger),this.tokenCache=new q0(this.config,this.browserStorage,this.logger,this.browserCrypto)}var Q0,X0=(of($0,Q0=r),$0.prototype.loginRedirect=function(o){return af(this,void 0,void 0,function(){var t;return sf(this,function(e){return t=this.getRequestCorrelationId(o),this.logger.verbose("loginRedirect called",t),[2,this.acquireTokenRedirect(rf({correlationId:t},o||N_))]})})},$0.prototype.loginPopup=function(e){var t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup(rf({correlationId:t},e||N_))},$0.prototype.acquireTokenSilent=function(s){return af(this,void 0,void 0,function(){var t,o,r,n,i,a=this;return sf(this,function(e){if(t=this.getRequestCorrelationId(s),(o=this.performanceClient.startMeasurement(Fm.AcquireTokenSilent,t)).addStaticFields({cacheLookupPolicy:s.cacheLookupPolicy}),this.preflightBrowserEnvironmentCheck(O_.Silent),this.logger.verbose("acquireTokenSilent called",t),!(i=s.account||this.getActiveAccount()))throw b_.createNoAccountError();return n={clientId:this.config.auth.clientId,authority:s.authority||wf.EMPTY_STRING,scopes:s.scopes,homeAccountIdentifier:i.homeAccountId,claims:s.claims,authenticationScheme:s.authenticationScheme,resourceRequestMethod:s.resourceRequestMethod,resourceRequestUri:s.resourceRequestUri,shrClaims:s.shrClaims,sshKid:s.sshKid},r=JSON.stringify(n),void 0===(n=this.activeSilentTokenRequests.get(r))?(this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t),i=this.acquireTokenSilentAsync(rf(rf({},s),{correlationId:t}),i).then(function(e){return a.activeSilentTokenRequests.delete(r),o.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),o.endMeasurement({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),o.flushMeasurement(),e}).catch(function(e){throw a.activeSilentTokenRequests.delete(r),o.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),o.flushMeasurement(),e}),this.activeSilentTokenRequests.set(r,i),[2,i]):(this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),o.endMeasurement({success:!0}),o.discardMeasurement(),[2,n])})})},$0.prototype.acquireTokenSilentAsync=function(s,c){return af(this,void 0,void 0,function(){var t,o,r,n,i,a=this;return sf(this,function(e){switch(e.label){case 0:return(this.eventHandler.emitEvent(_w.ACQUIRE_TOKEN_START,O_.Silent,s),t=this.performanceClient.startMeasurement(Fm.AcquireTokenSilentAsync,s.correlationId),Lw.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,s.authenticationScheme)&&c.nativeAccountId)?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),o=rf(rf({},s),{account:c}),o=this.acquireTokenNative(o,k_.acquireTokenSilent_silentFlow).catch(function(t){return af(a,void 0,void 0,function(){return sf(this,function(e){if(t instanceof Aw&&t.isFatal())return this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,[2,this.createSilentIframeClient(s.correlationId).acquireToken(s)];throw t})})}),[3,3]):[3,1];case 1:return this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),[4,(r=this.createSilentCacheClient(s.correlationId)).initializeSilentRequest(s,c)];case 2:n=e.sent(),i=rf(rf({},s),{cacheLookupPolicy:s.cacheLookupPolicy||D_.Default}),o=this.acquireTokenFromCache(r,n,i).catch(function(e){if(i.cacheLookupPolicy===D_.AccessToken)throw e;return uw.blockReloadInHiddenIframes(),a.eventHandler.emitEvent(_w.ACQUIRE_TOKEN_NETWORK_START,O_.Silent,n),a.acquireTokenByRefreshToken(n,i).catch(function(e){var t=e instanceof Xy,o=e.errorCode===P_.INVALID_GRANT_ERROR;if((!t||!o||e instanceof Im||i.cacheLookupPolicy===D_.AccessTokenAndRefreshToken||i.cacheLookupPolicy===D_.RefreshToken)&&i.cacheLookupPolicy!==D_.Skip)throw e;return a.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",s.correlationId),a.acquireTokenBySilentIframe(n)})}),e.label=3;case 3:return[2,o.then(function(e){return a.eventHandler.emitEvent(_w.ACQUIRE_TOKEN_SUCCESS,O_.Silent,e),t.endMeasurement({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),e}).catch(function(e){throw a.eventHandler.emitEvent(_w.ACQUIRE_TOKEN_FAILURE,O_.Silent,null,e),t.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})]}})})},$0);function $0(e){e=Q0.call(this,e)||this;return e.activeSilentTokenRequests=new Map,e}function eb(e){this.message=e}(eb.prototype=new Error).name="InvalidCharacterError";var tb="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new eb("'atob' failed: The string to be decoded is not correctly encoded.");for(var o,r,n=0,i=0,a="";r=t.charAt(i++);~r&&(o=n%4?64*o+r:r,n++%4)&&(a+=String.fromCharCode(255&o>>(-2*n&6))))r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function ob(e){this.message=e}function rb(e,t){if("string"!=typeof e)throw new ob("Invalid token specified");t=!0===(t=t||{}).header?0:1;try{return JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return decodeURIComponent(tb(t).replace(/(.)/g,function(e,t){t=t.charCodeAt(0).toString(16).toUpperCase();return"%"+(t=t.length<2?"0"+t:t)}))}catch(e){return tb(t)}}(e.split(".")[t]))}catch(e){throw new ob("Invalid token specified: "+e.message)}}(ob.prototype=new Error).name="InvalidTokenError";var nb=(ib.prototype.initialize=function(){var r=this;return this.initPromise||(this.initPromise=new Promise(function(e,t){if(r.options.authType===l.AuthenticationType.subscriptionKey)e();else if(r.options.authType===l.AuthenticationType.aad)r.options.authContext=r.options.authContext||ib.getDefaultAuthContext(r.options),r.options.authContext.handleRedirectPromise().then(function(){setTimeout(function(){return r._loginAndAcquireTokenForAAD(e,t)})}).catch(function(e){t(new Error("Error logging in the AAD users: "+e))});else if(r.options.authType===l.AuthenticationType.anonymous)e(r._triggerTokenFetch(!0));else if(r.options.authType===l.AuthenticationType.sas){if(r.options.sasToken){var o=-1;try{o=r._getTokenExpiry(r.options.sasToken)}catch(e){return void t(new Error("An invalid sasToken was provided."))}if(o>ib.constants.tokenRefreshClockSkew)return r._storeToken(r.options.sasToken),r._setTimeoutTokenFetch(o-ib.constants.tokenRefreshClockSkew),void e()}e(r._triggerTokenFetch())}else t(new Error("An invalid authentication type was specified."))})),this.initPromise},ib.prototype.dispose=function(){this.tokenTimeOutHandle&&(clearTimeout(this.tokenTimeOutHandle),this.tokenTimeOutHandle=null)},ib.getDefaultAuthContext=function(e){if(!e.aadAppId)throw new Error("No AAD app ID was specified.");if(!e.aadTenant)throw new Error("No AAD tenant was specified.");return this.defaultAuthContext||(this.defaultAuthContext=new X0({auth:{authority:"".concat(e.aadInstance||n).concat(e.aadTenant),clientId:e.aadAppId},cache:{cacheLocation:this.constants.preferredCacheLocation}})),this.defaultAuthContext},ib.prototype._loginAndAcquireTokenForAAD=function(e,t){var o=(null===(o=this.options.authContext)||void 0===o?void 0:o.getAllAccounts())||[];0===o.length?(this.options.authContext.loginRedirect(),e()):(this.options.authContext.setActiveAccount(o[0]),this._acquireTokenForAAD(e,t))},ib.prototype._acquireTokenForAAD=function(o,t){var r=this,n={scopes:[T]};this.options.authContext.acquireTokenSilent(n).then(function(e){r._saveItem(ib.constants.storage.tokenKey,e.accessToken);var t={map:r.map,type:ib.constants.events.tokenAcquired};r.map.events.invoke(ib.constants.events.tokenAcquired,t),clearTimeout(r.tokenTimeOutHandle);e=new Date(e.expiresOn).getTime()-Date.now();r.tokenTimeOutHandle=setTimeout(function(){return r._acquireTokenForAAD()},e),null!=o&&o()}).catch(function(e){return e instanceof Im?(r.options.authContext.acquireTokenRedirect(n),null==o?void 0:o()):void(null!=t&&t(e))})},ib.prototype.getAuthType=function(){return this.options.authType},ib.prototype.getClientId=function(){return this.options.clientId},ib.prototype.getToken=function(){if(this.options.authType===l.AuthenticationType.aad)return this._getItem(ib.constants.storage.tokenKey);if(this.options.authType!==l.AuthenticationType.anonymous&&this.options.authType!==l.AuthenticationType.sas)return this.options.authType===l.AuthenticationType.subscriptionKey?this.options.subscriptionKey:void 0;var e=this._getItem(ib.constants.storage.tokenKey);if(e){var t=this._getTokenExpiry(e);if(t<300&&0<t)this._triggerTokenFetch();else if(t<=0)throw this._saveItem(ib.constants.storage.tokenKey,""),new Error(ib.constants.errors.tokenExpired)}else this._triggerTokenFetch();return e},ib.prototype._getTokenExpiry=function(e){var t=rb(e).exp,e=this._getCurrentTime();return 0<t-e?t-e:-1},ib.prototype._storeToken=function(e){this._saveItem(ib.constants.storage.tokenKey,e);e={map:this.map,type:ib.constants.events.tokenAcquired};this.map.events.invoke(ib.constants.events.tokenAcquired,e)},ib.prototype._saveItem=function(e,t){return this._supportsLocalStorage()?localStorage.setItem(e,t):this._supportsSessionStorage()?sessionStorage.setItem(e,t):this.fallbackStorage[e]=t,!0},ib.prototype._getItem=function(e){return this._supportsLocalStorage()?localStorage.getItem(e):this._supportsSessionStorage()?sessionStorage.getItem(e):e in this.fallbackStorage?this.fallbackStorage[e]:null},ib.prototype._supportsLocalStorage=function(){try{return window.localStorage?(window.localStorage.setItem(ib.constants.storage.testStorageKey,"A"),"A"===window.localStorage.getItem(ib.constants.storage.testStorageKey)&&(window.localStorage.removeItem(ib.constants.storage.testStorageKey),!window.localStorage.getItem(ib.constants.storage.testStorageKey))):!1}catch(e){return!1}},ib.prototype._supportsSessionStorage=function(){try{return window.sessionStorage?(window.sessionStorage.setItem(ib.constants.storage.testStorageKey,"A"),"A"===window.sessionStorage.getItem(ib.constants.storage.testStorageKey)&&(window.sessionStorage.removeItem(ib.constants.storage.testStorageKey),!window.sessionStorage.getItem(ib.constants.storage.testStorageKey))):!1}catch(e){return!1}},ib.prototype._getCurrentTime=function(){return Math.round((new Date).getTime()/1e3)},ib.prototype.signRequest=function(e){e.headers=e.headers||{},e.headers[I]=this.sessionId,e.headers[E]=S,e.headers[b]="MapControl/".concat(j," (Web)");var t=this.getToken();switch(this.options.authType){case l.AuthenticationType.aad:case l.AuthenticationType.anonymous:e.headers[C]=this.options.clientId,e.headers[i]=a+t;break;case l.AuthenticationType.sas:e.headers[i]=s+t;break;case l.AuthenticationType.subscriptionKey:e.headers["subscription-key"]=t;break;default:throw new Error("An invalid authentication type was specified")}return e},ib.constants={preferredCacheLocation:"localStorage",storage:{tokenKey:"access.token.key",testStorageKey:"testStorage"},events:{tokenAcquired:"tokenacquired"},tokenExpiresIn:3599,tokenRefreshClockSkew:300,errors:{tokenExpired:"Token Expired, Try again"}},ib);function ib(e){var n=this;this.fallbackStorage={},this._triggerTokenFetch=function(e){return void 0===e&&(e=!1),new Promise(function(o,r){"function"==typeof n.options.getToken?n.options.getToken(function(e){try{var t=n._getTokenExpiry(e)-ib.constants.tokenRefreshClockSkew;n._storeToken(e),n._setTimeoutTokenFetch(t),o()}catch(e){r(new Error("Invalid token returned by getToken function"))}},function(e){r(e)},n.map):r(new Error("Token cannot be ".concat(e?"fetched":"renewed"," because getToken was not set or is not a function.")))})},this._setTimeoutTokenFetch=function(e){clearTimeout(n.tokenTimeOutHandle),n.tokenTimeOutHandle=setTimeout(n._triggerTokenFetch,Math.min(1e3*e,2147483647))};var t=e.getServiceOptions();this.options=t.authOptions,this.sessionId=t.sessionId,this.map=e}var ab=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},sb=(cb.prototype.add=function(e,t){var o,r;if(Array.isArray(e))try{for(var n=ab(e),i=n.next();!i.done;i=n.next()){var a=i.value;this._add(a,t)}}catch(e){o={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}else this._add(e,t)},cb.prototype.getControls=function(){return Array.from(this.controls)},cb.prototype.remove=function(e){var t,o;if(Array.isArray(e))try{for(var r=ab(e),n=r.next();!n.done;n=r.next()){var i=n.value;this._remove(i)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(t)throw t.error}}else this._remove(e)},cb.prototype._add=function(e,t){this.controls.add(e);var o=(new Y).merge(t),e=e.onAdd(this.map,t),t=this.controlContainer.getElementsByClassName(o.position);if(!(0<t.length))throw new Error("Control position ".concat(o.position," does not exist."));t.item(0).appendChild(e)},cb.prototype._remove=function(e){e.onRemove(),this.controls.delete(e)},cb);function cb(e){for(var t in this.map=e,this.controlContainer=document.createElement("div"),this.controlContainer.classList.add("atlas-control-container"),l.ControlPosition){var o;l.ControlPosition.hasOwnProperty(t)&&((o=document.createElement("div")).classList.add(l.ControlPosition[t]),o.classList.add("subcontrol-container"),this.controlContainer.appendChild(o))}this.map.getMapContainer().appendChild(this.controlContainer),this.controls=new Set}var ub=window&&window.__assign||function(){return(ub=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},lb=(hb.prototype.addCallback=function(a,s,c,e,u){var t,l,h=this;if(e)t=function(e){var t=e.lngLat?new Ms(e.lngLat.lng,e.lngLat.lat):void 0,o=e.point?[e.point.x,e.point.y]:void 0,r=e.features?e.features.map(function(e){return new ba(e.geometry,e.properties,e.id)}):[],r={type:e.type,originalEvent:e.originalEvent,position:t,coordinate:o,features:r};c(r)};else switch(a){case"data":case"sourcedata":case"styledata":t=function(e){e=ub(ub({dataType:e.dataType},"source"===e.dataType&&ub(ub(ub({isSourceLoaded:e.isSourceLoaded},e.sourceDataType&&{sourceDataType:e.sourceDataType}),{source:h.map.sources.getById(e.sourceId)}),e.tile&&{tile:{id:{x:e.tile.tileID.canonical.x,y:e.tile.tileID.canonical.y,z:e.tile.tileID.canonical.z},size:e.tile.tileSize,state:e.tile.state}})),{map:h.map,type:e.type});u&&h.map.events._removeListener(a,s,c),c(e)};break;case"error":t=function(e){e={error:e.error,map:h.map,type:e.type};u&&h.map.events._removeListener(a,s,c),c(e)};break;case"touchstart":case"touchend":case"touchmove":case"touchcancel":t=function(e){if(e.originalEvent){if(e.originalEvent===l)return;l=e.originalEvent}var t=e.point?new Ta(e.point.x,e.point.y):void 0,o=e.points?e.points.map(function(e){return new Ta(e.x,e.y)}):[],r=e.lngLat?new Ms(e.lngLat.lng,e.lngLat.lat):void 0,n=e.lngLats?e.lngLats.map(function(e){return new Ms(e.lng,e.lat)}):[],i=r?h.map.layers.getRenderedShapes(new Aa(r),s?[s]:void 0):[],i={map:h.map,originalEvent:e.originalEvent,pixel:t,pixels:o,position:r,positions:n,shapes:i,layerId:s||void 0,preventDefault:function(){return e.preventDefault()},type:e.type};u&&h.map.events._removeListener(a,s,c),c(i)};break;case"mousedown":case"mouseup":case"mouseover":case"mousemove":case"click":case"dblclick":case"mouseout":case"mouseenter":case"mouseleave":case"contextmenu":t=function(e){if(e.originalEvent){if(e.originalEvent===l)return;l=e.originalEvent}var t=e.lngLat?new Ms(e.lngLat.lng,e.lngLat.lat):void 0,o=e.point?new Ta(e.point.x,e.point.y):void 0,r=t?h.map.layers.getRenderedShapes(new Aa(t),s?[s]:void 0):[],r={map:h.map,originalEvent:e.originalEvent,position:t,pixel:o,preventDefault:function(){return e.preventDefault()},shapes:r,layerId:s||void 0,type:e.type};u&&h.map.events._removeListener(a,s,c),c(r)};break;case"styleimagemissing":t=function(e){u&&h.map.events._removeListener(a,s,c),c(e.id)};break;case"wheel":t=function(e){if(e.originalEvent){if(e.originalEvent===l)return;l=e.originalEvent}var t={map:h.map,originalEvent:e.originalEvent,preventDefault:function(){return e.preventDefault()},type:e.type};u&&h.map.events._removeListener(a,s,c),c(t)};break;case"resize":t=function(e){var t,o={map:h.map,type:e.type};for(t in e)"type"!==t&&"target"!==t&&(o[t]=e[t]);u&&h.map.events._removeListener(a,s,c),c(o)};break;default:t=function(e){var t={map:h.map,type:e.type};e.originalEvent&&(t.originalEvent=e.originalEvent),u&&h.map.events._removeListener(a,s,c),c(t)}}this.callbacks.has(s)||this.callbacks.set(s,new J),this.callbacks.get(s).has(a)||this.callbacks.get(s).set(a,new Map),this.callbacks.get(s).get(a).set(c,[t,u])},hb.prototype.removeCallback=function(e,t,o){this.callbacks.has(t)&&this.callbacks.get(t).has(e)&&this.callbacks.get(t).get(e).has(o)&&this.callbacks.get(t).get(e).delete(o)},hb.prototype.getModifiedCallback=function(e,t,o){if(this.callbacks.has(t)&&this.callbacks.get(t).has(e)&&this.callbacks.get(t).get(e).has(o))return this.callbacks.get(t).get(e).get(o)[0]},hb.prototype.getLayerCallbacks=function(e){if(this.callbacks.has(e))return this.callbacks.get(e)},hb.prototype.getEventCallbacks=function(e,t){if(this.callbacks.has(t)){t=this.callbacks.get(t);if(t.has(e))return t.get(e)}},hb);function hb(e){this.callbacks=new J,this.map=e}var pb=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},db=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},fb=["maxzoomchanged","minzoomchanged","mapconfigurationchanged"],gb=(yb.prototype.add=function(e,t,o){var r,n;if("function"==typeof t)this._addGlobalListener(e,t,!1,!1);else{t=Array.isArray(t)?t:[t];try{for(var i=pb(t),a=i.next();!a.done;a=i.next()){var s=a.value;s instanceof mu&&mu._isMBoxEvent(e)?this._addLayerListener(e,s,o,!1,!1):s._addEventListener(e,o,!1)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}},yb.prototype.addOnce=function(e,t,o){"function"==typeof t?this._addGlobalListener(e,t,!1,!0):t instanceof mu&&mu._isMBoxEvent(e)?this._addLayerListener(e,t,o,!1,!0):t._addEventListener(e,o,!0)},yb.prototype._addLegacy=function(e,t,o){"function"==typeof t?this._addGlobalListener(e,t,!0,!1):this._addLayerListener(e,t,o,!0,!1)},yb.prototype._addLayerListener=function(e,t,o,r,n){var i,a,s,c,u=t instanceof mu?t.getId():t,t=this.map.layers.getLayerById(u),l=this.mapCallbackHandler.getModifiedCallback(e,u,o);if(l&&t)try{for(var h=pb(t._getLayerIds()),p=h.next();!p.done;p=h.next()){var d=p.value;this.map._getMap().off(e,d,l)}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}if(this.mapCallbackHandler.addCallback(e,u,o,r,n),t){l=this.mapCallbackHandler.getModifiedCallback(e,u,o);try{for(var f=pb(t._getLayerIds()),g=f.next();!g.done;g=f.next()){d=g.value;this.map._getMap().on(e,d,l)}}catch(e){s={error:e}}finally{try{g&&!g.done&&(c=f.return)&&c.call(f)}finally{if(s)throw s.error}}}},yb.prototype._addGlobalListener=function(e,t,o,r){var n,i,a,s;fb.includes(e)?this.map._addEventListener(e,t,r):(n=this.mapCallbackHandler.getModifiedCallback(e,"",t),this.mapCallbackHandler.addCallback(e,"",t,o,r),i=this.mapCallbackHandler.getModifiedCallback(e,"",t),"load"===e&&this.map._isLoaded()?(a={type:"load",map:this.map},setTimeout(function(){return i(a)})):"ready"===e?this.map._isReady()&&(s={type:"ready",map:this.map},setTimeout(function(){return i(s)})):(n&&this.map._getMap().off(e,n),this.map._getMap().on(e,i)))},yb.prototype.invoke=function(e,t,o){if(void 0===o)this._invokeListeners(e,"",t);else if(t instanceof mu&&mu._isMBoxEvent(e))this._invokeListeners(e,t.getId(),o);else{if(!(t instanceof Q))throw new Error("The invoke target is invalid.");t._invokeEvent(e,o)}},yb.prototype._invokeListeners=function(o,r,n){var i=this,e=new J(this.mapCallbackHandler.getEventCallbacks(o,r));e?e.forEach(function(e,t){e=db(e,2);e[0],e[1]&&i._removeListener(o,r,t),t(n)}):"error"===o&&console.error("error"in n?n.error:n)},yb.prototype.remove=function(e,t,o){var r,n;if("function"==typeof t)this._removeListener(e,"",t);else{t=Array.isArray(t)?t:[t];try{for(var i=pb(t),a=i.next();!a.done;a=i.next()){var s=a.value;s instanceof mu&&mu._isMBoxEvent(e)?this._removeListener(e,s,o):null!=s&&s._removeEventListener(e,o)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}},yb.prototype._removeLegacy=function(e,t,o){"function"==typeof t?this._removeListener(e,"",t):this._removeListener(e,t,o)},yb.prototype._removeListener=function(e,t,o){var r,n;if(fb.includes(e))this.map._removeEventListener(e,o);else{var i=t instanceof mu?t.getId():t,a=this.mapCallbackHandler.getModifiedCallback(e,i,o);if(a)if(i){t=this.map.layers.getLayerById(i);if(t)try{for(var s=pb(t._getLayerIds()),c=s.next();!c.done;c=s.next()){var u=c.value;this.map._getMap().off(e,u,a)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}else this.map._getMap().off(e,a);this.mapCallbackHandler.removeCallback(e,i,o)}},yb.prototype._enableLayerEvents=function(c){var u=this,e=this.mapCallbackHandler.getLayerCallbacks(c.getId());e&&e.forEach(function(e,s){e.forEach(function(e){var t,o,r=db(e,1)[0];try{for(var n=pb(c._getLayerIds()),i=n.next();!i.done;i=n.next()){var a=i.value;u.map._getMap().on(s,a,r)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(t)throw t.error}}})})},yb.prototype._disableLayerEvents=function(c){var u=this,e=this.mapCallbackHandler.getLayerCallbacks(c.getId());e&&e.forEach(function(e,s){e.forEach(function(e){var t,o,r=db(e,1)[0];try{for(var n=pb(c._getLayerIds()),i=n.next();!i.done;i=n.next()){var a=i.value;u.map._getMap().off(s,a,r)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(t)throw t.error}}})})},yb);function yb(e){this.map=e,this.mapCallbackHandler=new lb(this.map)}var mb=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},vb=(_b.prototype.add=function(e,t){var o,r;if(Array.isArray(e))try{for(var n=mb(e),i=n.next();!i.done;i=n.next()){var a=i.value;this._addMarker(a,t)}}catch(e){o={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}else this._addMarker(e,t)},_b.prototype._addMarker=function(e,t){e._addToMap(this.map,t),this.markers.add(e)},_b.prototype.getMarkers=function(){return Array.from(this.markers)},_b.prototype.remove=function(e){var t,o;if(Array.isArray(e))try{for(var r=mb(e),n=r.next();!n.done;n=r.next()){var i=n.value;this._removeMarker(i)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(t)throw t.error}}else this._removeMarker(e)},_b.prototype._removeMarker=function(t){var o=this;t instanceof Lh?(t._removeFromMap(),this.markers.delete(t)):this.markers.forEach(function(e){e._getId()===t&&(e._removeFromMap(),o.markers.delete(e))})},_b.prototype.clear=function(){var t=this;this.markers.forEach(function(e){e._removeFromMap(),t.markers.delete(e)})},_b);function _b(e){this.markers=new Set,this.map=e}var wb=(bb.prototype.add=function(a,t,s){var c=this;return new Promise(function(o,r){var n,e,i;c.userImages.has(a)?o():t instanceof HTMLImageElement||t instanceof ImageData?(c.map._getMap().addImage(a,t,s),c.userImages.set(a,{image:t,meta:s}),o()):"string"==typeof t&&(e=void 0,e=/<svg/i.test(t)&&!/^data:/i.test(t)?"data:image/svg+xml;base64,"+window.btoa(t):t,i=!1,c.map._sendRequest(e,"Image").then(function(e){return i?void 0:e.blob()}).then(function(e){var t;!i&&e&&(clearTimeout(n),(t=new Image).onload=function(){c.map._getMap().addImage(a,t,s),c.userImages.set(a,{image:t,meta:s}),o()},t.onerror=t.onabort=function(){r("Failed to load image into HTML element.")},t.src=URL.createObjectURL(e))}).catch(function(){i||(clearTimeout(n),r("Failed to load image into HTML element."))}),n=setTimeout(function(){i=!0,r("Failed to load image within specified timeout: ".concat(c.imageLoadTimeout," ms."))},c.imageLoadTimeout))})},bb.prototype.clear=function(){var o=this;this.userImages.forEach(function(e,t){o.map._getMap().removeImage(t)}),this.userImages.clear()},bb.prototype.getImageIds=function(){var o=[];return this.userImages.forEach(function(e,t){o.push(t)}),o},bb.prototype.createFromTemplate=function(e,t,o,r,n){o=o||"#1A73AA",r=r||"#fff";n=(n=Dp(t,n)).replace(/{color}/g,o).replace(/{secondaryColor}/g,r).replace(/{text}/g,"");return this.add(e,n)},bb.prototype.hasImage=function(e){return this.userImages.has(e)},bb.prototype.remove=function(e){this.map._getMap().removeImage(e),this.userImages.delete(e)},bb.prototype._restoreImages=function(){var o=this;this.userImages.forEach(function(e,t){o.map._getMap().hasImage(t)||o.map._getMap().addImage(t,e.image,e.meta)})},bb);function bb(e){this.userImages=new J,this.imageLoadTimeout=5e3,this.map=e}var Cb,Eb,r=window&&window.__extends||(Cb=function(e,t){return(Cb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Cb(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),Sb=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Tb=(r(Ib,Eb=mu),Ib.prototype._buildLayers=function(){return this.layers},Ib.prototype._getLayerIds=function(){return this.layers.map(function(e){return e.id})},Ib.prototype._getSourceIds=function(){var t,e,o=new Set;try{for(var r=Sb(this.layers),n=r.next();!n.done;n=r.next()){var i=n.value;"source"in i&&"string"==typeof i.source?o.add(i.source):"source"in i&&i.source&&o.add(i.id)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return o},Ib.prototype._updateLayoutProperty=function(t,o,e,r){var n;ma(o,e)||(n=this.map._getMap(),this.layers.forEach(function(e){n.getLayer(e.id)?n.setLayoutProperty(e.id,t,r||o):console.warn("Could not update layout property ".concat(t," for layer ").concat(e.id," to ").concat(r||o))}))},Ib);function Ib(e,t){t=Eb.call(this,t)||this;return t.layers=e,t}var Ab=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},kb=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},Ob=window&&window.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},Pb=(xb.prototype.add=function(e,t){var o,r,n=t instanceof mu?t.getId():t;if(Array.isArray(e))try{for(var i=Ab(e),a=i.next();!a.done;a=i.next()){var s=a.value;this._addLayer(s,n)}}catch(e){o={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}else this._addLayer(e,n)},xb.prototype._addLayer=function(t,o){if(!(this.map._isReady()||t instanceof Tb))throw new Error("The layer '".concat(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 layer to it.");var e,r,n,i;o!==t.getId()&&this.layerIndex.find(function(e){return o===e.getId()})?this._getMapboxLayerExists(t)?(r=this.layerIndex.findIndex(function(e){return e.getId()===t.getId()}),n=this.userLayers.findIndex(function(e){return e.layer.getId()===t.getId()}),this._removeMapboxLayers(t),this._addMapboxLayers(t,o),(i=this.layerIndex[r])&&this.map.events._disableLayerEvents(i),this.map.events._enableLayerEvents(t),this.layerIndex.splice(r,1),e=this.layerIndex.findIndex(function(e){return e.getId()===o}),this.layerIndex.splice(e,0,t),t instanceof Tb||(this.userLayers[n]={layer:t,before:o}),i&&i.onRemove()):(this._addMapboxLayers(t,o),this.map.events._enableLayerEvents(t),e=this.layerIndex.findIndex(function(e){return e.getId()===o}),this.layerIndex.splice(e,0,t),t instanceof Tb||this.userLayers.push({layer:t,before:o})):(r=this.layerIndex.findIndex(function(e){return e.getId()===t.getId()}),n=this.userLayers.findIndex(function(e){return e.layer.getId()===t.getId()}),0<=r&&0<=n?(i=this.layerIndex[r],this._removeMapboxLayers(i),this._addMapboxLayers(t,r+1),this.map.events._disableLayerEvents(i),this.map.events._enableLayerEvents(t),(this.layerIndex[r]=t)instanceof Tb||(this.userLayers[n]={layer:t,before:void 0}),i.onRemove()):(this._addMapboxLayers(t),this.map.events._enableLayerEvents(t),this.layerIndex.push(t),t instanceof Tb||this.userLayers.push({layer:t,before:o}))),t.onAdd(this.map)},xb.prototype._addMapboxLayers=function(e,t){var o,r;if(!(e instanceof ih)||e.getOptions().tileUrl)if(e instanceof Tb)this.map.events._enableLayerEvents(e);else{e instanceof Ju&&(this.map._getMap().addSource(e._getSourceId(),e._buildSource()),this.map.sources.setSourceState(e._getSourceWrapper()));var n=this._getMapboxBefore(t);try{for(var i=Ab(e._buildLayers()),a=i.next();!a.done;a=i.next()){var s=a.value;this.map._getMap().addLayer(s,n)}}catch(e){o={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}this.map.events._enableLayerEvents(e)}},xb.prototype._removeMapboxLayers=function(e,t){var o,r;if(e instanceof Tb&&!t)this.map.events._disableLayerEvents(e);else{try{for(var n=Ab(e._getLayerIds()),i=n.next();!i.done;i=n.next()){var a=i.value;this.map._getMap().getLayer(a)&&this.map._getMap().removeLayer(a)}}catch(e){o={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}this.map.events._disableLayerEvents(e),e instanceof Ju&&this.map._getMap().getSource(e._getSourceId())&&this.map._getMap().removeSource(e._getSourceId())}},xb.prototype._getMapboxLayerExists=function(t){var o=this,r=!1;return"string"==typeof t?!!(t=this.layerIndex.find(function(e){return e.getId()===t})):(t._getLayerIds().forEach(function(e){o.map._getMap().getLayer(e)&&(r=!0)}),r)},xb.prototype._getMapboxBefore=function(t){var o,e,r,n;if("string"==typeof t){var i=this.layerIndex.find(function(e){return e.getId()===t});if(!i)return;try{for(var a=Ab(i._getLayerIds()),s=a.next();!s.done;s=a.next()){var c=s.value;if(this.map._getMap().getLayer(c))return c}}catch(e){o={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}t=this.layerIndex.findIndex(function(e){return e.getId()===t})+1}for(var u=t;u<this.layerIndex.length;u++)try{for(var l=(r=void 0,Ab(this.layerIndex[u]._getLayerIds())),h=l.next();!h.done;h=l.next()){c=h.value;if(this.map._getMap().getLayer(c))return c}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}},xb.prototype.clear=function(){for(var e=this.layerIndex.length-1;0<=e;e--){var t=this.layerIndex[e];t&&(this._removeMapboxLayers(t,!0),this.layerIndex.splice(e,1),t.onRemove())}this.userLayers=[]},xb.prototype.getLayerById=function(t){var e=this.layerIndex.find(function(e){return e.getId()===t});if(e)return e},xb.prototype.getLayers=function(){return this.layerIndex.slice(0)},xb.prototype._getSourceIds=function(){var t,e,o=new Set;try{for(var r=Ab(this.layerIndex),n=r.next();!n.done;n=r.next())n.value._getSourceIds().forEach(function(e){return o.add(e)})}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return o},xb.prototype._getUserLayers=function(){return Array.from(this.userLayers)},xb.prototype.move=function(e,t){var o=e instanceof mu?e.getId():e,r=t instanceof mu?t.getId():t;if(!this.layerIndex.find(function(e){return e.getId()===o}))throw new Error("The layer '".concat(o,"' has not been added to the map and cannot be moved."));t=this.layerIndex.findIndex(function(e){return e.getId()===o});this._moveMapboxLayers(this.layerIndex[t],r),e=this.layerIndex[t],this.layerIndex.splice(t,1);t=this.layerIndex.findIndex(function(e){return e.getId()===r});-1<t?this.layerIndex.splice(t,0,e):this.layerIndex.push(e);e=this.userLayers.find(function(e){return e.layer.getId()===o});e&&(e.before=r)},xb.prototype._moveMapboxLayers=function(e,t){var o,r,n=this._getMapboxBefore(t);try{for(var i=Ab(e._getLayerIds()),a=i.next();!a.done;a=i.next()){var s=a.value;this.map._getMap().moveLayer(s,n)}}catch(e){o={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}},xb.prototype.getRenderedShapes=function(e,t,o){var r,n,i,a=this;if(e=e||[-180,-85.0511,180,85.0511],Array.isArray(e)?4===e.length||6===e.length?i=this.map.positionsToPixels([Gs.getSouthWest(e),Gs.getNorthEast(e)]):2!==e.length&&3!==e.length||(i=this.map.positionsToPixels([e])[0]):i=this.map.positionsToPixels([e.coordinates])[0],t){t=Array.isArray(t)?t:[t];var s=[],c=this;try{for(var u=Ab(t),l=u.next();!l.done;l=u.next())!function(e){var t=e instanceof mu?e.getId():e,e=c.layerIndex.findIndex(function(e){return e.getId()===t});if(!(-1<e))throw new Error("The layer '".concat(t,"' has not been added to the map ")+"and its rendered features cannot be retrieved.");s.push.apply(s,Ob([],kb(c.layerIndex[e]._getLayerIds().filter(function(e){return!!a.map._getMap().getLayer(e)})),!1))}(l.value)}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}}o=this.map._getMap().queryRenderedFeatures(i,{layers:s,filter:o});return this.map.sources._mapFeaturesToShapes(o)},xb.prototype.remove=function(e){var t,o;if(Array.isArray(e))try{for(var r=Ab(e),n=r.next();!n.done;n=r.next()){var i=n.value;this._removeLayer(i)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(t)throw t.error}}else this._removeLayer(e)},xb.prototype._removeLayer=function(e){var t=e instanceof mu?e.getId():e,o=this.layerIndex.findIndex(function(e){return e.getId()===t});if(-1==o)throw new Error("The layer '".concat(t,"' has not been added to the map and cannot be removed."));var r=this.layerIndex[o];this._removeMapboxLayers(r),this.layerIndex.splice(o,1);o=this.userLayers.findIndex(function(e){return e.layer.getId()===t});-1!=o&&this.userLayers.splice(o,1),e instanceof Ju&&this.map.sources.unsetSourceState(e._getSourceId()),r.onRemove()},xb);function xb(e){this.layerIndex=[],this.userLayers=[],this.map=e}var Rb=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Mb=(Nb.prototype.add=function(e){var t,o;e=Array.isArray(e)?e:[e];try{for(var r=Rb(e),n=r.next();!n.done;n=r.next()){var i=n.value;this.popups.has(i)||(this.popups.add(i),i.attach(this.map))}}catch(e){t={error:e}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(t)throw t.error}}},Nb.prototype.clear=function(){var t=this;this.popups.forEach(function(e){t.popups.delete(e),e.remove()})},Nb.prototype.remove=function(e){var t,o;e=Array.isArray(e)?e:[e];try{for(var r=Rb(e),n=r.next();!n.done;n=r.next()){var i=n.value;this.popups.has(i)&&(this.popups.delete(i),i.remove())}}catch(e){t={error:e}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(t)throw t.error}}},Nb.prototype.getPopups=function(){return Array.from(this.popups)},Nb.prototype._getCollectionDiv=function(){var e=this.map.getMapContainer().querySelector(".".concat(Nb.Css.collection));return e||((e=document.createElement("div")).classList.add(Nb.Css.collection),e.setAttribute("aria-label","Map Information"),this.map.getMapContainer().appendChild(e)),e},Nb.prototype._addDraggedPopup=function(e){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(e)},Nb.Css={collection:"popup-collection-container"},Nb);function Nb(e){var r=this;this._onDrag=function(e){var t,o;"mousemove"===e.type?(t=e.clientX,o=e.clientY):"touchmove"===e.type&&(t=e.touches[0].clientX,o=e.touches[0].clientY),r.draggedPopups.forEach(function(e){e._dragToPixel([t,o])})},this._onUp=function(){r.map.getMapContainer().removeEventListener("mousemove",r._onDrag),r.map.getMapContainer().removeEventListener("touchmove",r._onDrag),r.map.getMapContainer().removeEventListener("mouseup",r._onUp),r.map.getMapContainer().removeEventListener("touchend",r._onUp),r.draggedPopups.forEach(function(e){r.draggedPopups.delete(e),e._onUp()})},this.map=e,this.popups=new Set,this.draggedPopups=new Set}var Lb=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Db=(qb.prototype.add=function(e,t){var o,r;if(void 0===t&&(t=!0),Array.isArray(e))try{for(var n=Lb(e),i=n.next();!i.done;i=n.next()){var a=i.value;this._addSource(a,t)}}catch(e){o={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}else this._addSource(e,t)},qb.prototype.getRenderedShapes=function(e,t,o){e="string"==typeof e?e:e.getId(),t=this.map._getMap().querySourceFeatures(e,{sourceLayer:o,filter:t});return this.map.sources._mapFeaturesToShapes(t,!0,this.sources.get(e))},qb.prototype._buildSources=function(){var t={};return this.sources.forEach(function(e){t[e.getId()]=e._buildSource()}),t},qb.prototype.clear=function(){var t=this;this.sources.forEach(function(e){t.remove(e)})},qb.prototype.getById=function(e){return this.sources.get(e)},qb.prototype.getSources=function(){return Array.from(this.sources.values())},qb.prototype.isSourceLoaded=function(e){e=e instanceof Ac?e.getId():e;return this.map._getMap().isSourceLoaded(e)},qb.prototype.remove=function(e,t){var o,r;if(void 0===t&&(t=!0),Array.isArray(e))try{for(var n=Lb(e),i=n.next();!i.done;i=n.next()){var a=i.value;this._removeSource(a,t)}}catch(e){o={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}else this._removeSource(e,t)},qb.prototype.setSourceState=function(e,t){void 0===t&&(t=!0),this.sources.set(e.getId(),e),e._setMap(this.map,t)},qb.prototype.unsetSourceState=function(e){this.sources.has(e)&&(this.sources.get(e)._setMap(null),this.sources.delete(e))},qb.prototype._removeSource=function(e,t){e=e instanceof Ac?e.getId():e;if(!this.sources.has(e))throw new Error("'".concat(e,"' is not added to the map"));if(this.map._getMap().getSource(e)&&t&&this.map._getMap().removeSource(e),this.map._getMap().getSource(e)&&t)throw new Error("One or more layers have a dependency on the source '".concat(e,"'"));this.unsetSourceState(e)},qb.prototype._addSource=function(e,t){if(this.sources.has(e.getId())){if(t)throw new Error("'".concat(e.getId(),"' is already added to the map"));this.unsetSourceState(e.getId())}if(t){if(!this.map._isReady())throw new Error("The source '".concat(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 source to it.");this.map._getMap().addSource(e.getId(),e._buildSource())}this.setSourceState(e)},qb.prototype._mapFeaturesToShapes=function(e,t,o){var r,n,i=[];try{for(var a=Lb(e),s=a.next();!s.done;s=a.next()){var c=s.value;if((o||"string"==typeof c.source)&&"string"==typeof c.properties[Hs._shapeIdPropName]){var u=o||this.sources.get(c.source);if(u instanceof Rc){var l=u.getShapeById(c.properties[Hs._shapeIdPropName]);if(l instanceof Hs){i.push(l);continue}}}t||i.push(c)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i},qb.prototype._syncSources=function(n){var r=this;n?(Object.keys(n).map(function(e){var t,o=n[e];switch(o.type){case"vector":case"raster":case"raster-dem":t=new Vl(e,{name:e,tiles:o.tiles,type:o.type,url:o.url,tileSize:"tileSize"in o?o.tileSize:void 0});break;case"canvas":t=new Kc(e,o);break;case"geojson":var r=new Rc(e,{maxZoom:o.maxzoom,cluster:o.cluster,clusterRadius:o.clusterRadius,tolerance:o.tolerance,lineMetrics:o.lineMetrics,clusterProperties:o.clusterProperties,buffer:o.buffer,clusterMinPoints:o.clusterMinPoints,generateId:o.generateId,promoteId:o.promoteId,filter:o.filter});"string"!=typeof o.data&&void 0!==o.data&&r._addNoUpdate(o.data),t=r;break;case"image":t=new Xc(e,o);break;case"video":t=new ou(e,o);break;default:t=new Wc(e,o)}return t}).forEach(function(e){var t=r.sources.get(e.getId()),o=t&&e._isDeepEqual(t);!o&&t&&r.unsetSourceState(t.getId()),r.setSourceState(e,!o)}),Array.from(this.sources.keys()).filter(function(e){return!(e in n)}).forEach(function(e){return r.unsetSourceState(e)})):console.warn("syncSources called with no style sources which is unexpected.")},qb);function qb(e){this.map=e,this.sources=new J}var jb,Ub,Hb=((window&&window.__extends||(jb=function(e,t){return(jb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}jb(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(zb,Ub=k),zb);function zb(){var e=null!==Ub&&Ub.apply(this,arguments)||this;return e.duration=1e3,e.type="jump",e}var Bb,Fb,Kb=((window&&window.__extends||(Bb=function(e,t){return(Bb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Bb(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(Gb,Fb=k),Gb);function Gb(){var e=null!==Fb&&Fb.apply(this,arguments)||this;return e.bottom=0,e.left=0,e.right=0,e.top=0,e}var Yb,Zb,r=window&&window.__extends||(Yb=function(e,t){return(Yb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}Yb(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),Wb=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Vb=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},Jb=window&&window.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},Qb=(r(Xb,Zb=k),Xb.prototype.merge=function(){for(var t,e,o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];try{for(var n=Wb(o),i=n.next();!i.done;i=n.next()){var a=i.value;a&&"number"==typeof a.padding&&(a.padding={top:a.padding,bottom:a.padding,left:a.padding,right:a.padding})}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return Zb.prototype.merge.apply(this,Jb([],Vb(o),!1))},Xb);function Xb(){var e=null!==Zb&&Zb.apply(this,arguments)||this;return e.bounds=[-180,-89,180,90],e.maxBounds=void 0,e.maxZoom=20,e.offset=new Ta(0,0),e.padding=new Kb,e}var $b,eC,tC=((window&&window.__extends||($b=function(e,t){return($b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}$b(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(oC,eC=k),oC);function oC(){var e=null!==eC&&eC.apply(this,arguments)||this;return e.zoom=1,e.center=new Ms(0,0),e.centerOffset=new Ta(0,0),e.bearing=0,e.pitch=0,e.minZoom=1,e.maxZoom=20,e.minPitch=0,e.maxPitch=60,e.maxBounds=void 0,e}var rC,nC,r=((window&&window.__extends||(rC=function(e,t){return(rC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}rC(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(iC,nC=k),iC);function iC(){var e=null!==nC&&nC.apply(this,arguments)||this;return e.name=void 0,e.before=void 0,e.minZoom=1,e.maxZoom=20,e.overwrite=!1,e.opacity=1,e}var aC,sC,cC=((window&&window.__extends||(aC=function(e,t){return(aC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}aC(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(uC,sC=r),uC);function uC(){var e=null!==sC&&sC.apply(this,arguments)||this;return e.color="rgba(0,0,0,.5)",e.outlineColor="#000",e.radius=1,e.outlineWidth=5,e.name="default-circles",e}var lC,hC,pC=((window&&window.__extends||(lC=function(e,t){return(lC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}lC(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(dC,hC=r),dC);function dC(){var e=null!==hC&&hC.apply(this,arguments)||this;return e.cap="butt",e.join="miter",e.name="default-linestrings",e.color="#000",e.width=1,e}var fC,gC,yC=((window&&window.__extends||(fC=function(e,t){return(fC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}fC(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(mC,gC=r),mC);function mC(){var e=null!==gC&&gC.apply(this,arguments)||this;return e.iconSize=1,e.fontSize=14,e.fontColor="#000",e.textFont="SegoeUi-Regular",e.cluster=!0,e.clusterIcon=void 0,e.textOffset=[0,0],e.name="default-pins",e.icon="pin-darkblue",e.title="",e}var vC,_C,wC=((window&&window.__extends||(vC=function(e,t){return(vC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}vC(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(bC,_C=r),bC);function bC(){var e=null!==_C&&_C.apply(this,arguments)||this;return e.color="rgba(0,0,0,.5)",e.outlineColor="#000",e.name="default-polygons",e}var CC,EC,SC=((window&&window.__extends||(CC=function(e,t){return(CC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}CC(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(TC,EC=r),TC);function TC(){var e=null!==EC&&EC.apply(this,arguments)||this;return e.name="default-raster",e}var IC,AC,kC=((window&&window.__extends||(IC=function(e,t){return(IC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}IC(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}))(OC,AC=k),OC);function OC(){var e=null!==AC&&AC.apply(this,arguments)||this;return e.anchor="map",e.color="#FFFFFF",e.intensity=.5,e.position=[1.15,210,30],e}var PC,xC,r=window&&window.__extends||(PC=function(e,t){return(PC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}PC(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),RC=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},MC=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},NC=window&&window.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},LC=(r(DC,xC=k),DC.prototype.merge=function(){for(var t,e,o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];try{for(var n=RC(o),i=n.next();!i.done;i=n.next()){var a=i.value;a&&(a.hasOwnProperty("view")?a.userRegion=a.view:a.hasOwnProperty("userRegion")&&(a.view=a.userRegion),"string"==typeof a.language&&(a.language=zh.getCode(a.language)))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return xC.prototype.merge.apply(this,NC([],MC(o),!1))},DC);function DC(){var e=null!==xC&&xC.apply(this,arguments)||this;return e.antialias=void 0,e.autoResize=!0,e.language=Xh,e.light=new kC,e.preserveDrawingBuffer=!1,e.progressiveLoading=!1,e.progressiveLoadingInitialLayerGroups=["base"],e.renderWorldCopies=!0,e.showBuildingModels=!1,e.showFeedbackLink=!0,e.showLogo=!0,e.showLabels=!0,e.customAttribution=void 0,e.showTileBoundaries=!1,e.style=void 0,e.view=Vh,e.userRegion=e.view,e.customStyleTransform=void 0,e}function qC(e){return 0==e.length?void 0:e.slice(1).reduce(function(o,r){return function(e,t){e=o(e,t);return HC(HC({},e),r(e.url,t))}},e[0])}var jC,UC,r=window&&window.__extends||(jC=function(e,t){return(jC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}jC(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),HC=window&&window.__assign||function(){return(HC=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},zC=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},BC=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},FC=window&&window.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},KC=(r(GC,UC=k),GC.prototype.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var o=this.styleDefinitionsVersion;try{for(var r=zC(e),n=r.next();!n.done;n=r.next()){var i=n.value;i&&(i.authOptions?"string"==typeof i.authOptions.subscriptionKey&&(i.subscriptionKey=i["subscription-key"]=i.authOptions.subscriptionKey):"string"==typeof i.subscriptionKey?(i["subscription-key"]=i.subscriptionKey,i.authOptions={authType:l.AuthenticationType.subscriptionKey,subscriptionKey:i.subscriptionKey}):"string"==typeof i["subscription-key"]&&(i.subscriptionKey=i["subscription-key"],i.authOptions={authType:l.AuthenticationType.subscriptionKey,subscriptionKey:i["subscription-key"]}),"string"==typeof i.sessionId?i["session-id"]=i.sessionId:"string"==typeof i["session-id"]&&(i.sessionId=i["session-id"]),"boolean"==typeof i.disableTelemetry?i["disable-telemetry"]=i.disableTelemetry:"boolean"==typeof i["disable-telemetry"]&&(i.disableTelemetry=i["disable-telemetry"]),"boolean"==typeof i.enableAccessibility?i["enable-accessibility"]=i.enableAccessibility:"boolean"==typeof i["enable-accessibility"]&&(i.enableAccessibility=i["enable-accessibility"]))}}catch(e){u={error:e}}finally{try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(u)throw u.error}}var a=this._transformers,s=e?e.filter(function(e){return void 0!==e}).reduce(function(e,t){return FC(FC([],BC(e),!1),BC(t._transformers||[]),!1)},[]):[],c=UC.prototype.merge.apply(this,FC([],BC(e),!1));c.authOptions.authType!==l.AuthenticationType.subscriptionKey&&(c["subscription-key"]=c.subscriptionKey=void 0),void 0!==c.styleSet&&void 0===c.mapConfiguration&&(c.mapConfiguration=c.styleSet),c.mapConfiguration&&"string"!=typeof c.mapConfiguration&&(c.mapConfiguration=HC(HC({},c.mapConfiguration),{defaultConfiguration:c.mapConfiguration.defaultConfiguration||c.mapConfiguration.defaultStyle,configurations:c.mapConfiguration.configurations||c.mapConfiguration.styles})),this._transformers=FC(FC([],BC(a||[]),!1),BC(s.filter(function(e){return!a.includes(e)})),!1),this.transformRequest&&!this._transformers.includes(this.transformRequest)&&this._transformers.push(this.transformRequest);var u=new Date(Date.UTC(2023,0)),s=new Date(this.styleDefinitionsVersion);return(isNaN(s.getTime())||s.getTime()<u.getTime())&&(console.warn("Style definition version ".concat(this.styleDefinitionsVersion," is invalid or deprecated, style definition version is unchanged (").concat(o,")")),this.styleDefinitionsVersion=o),this.transformRequest=qC(this._transformers),c},GC.prototype.addTransformer=function(e){this._transformers||(this._transformers=[]),this._transformers.push(e),this.transformRequest=qC(this._transformers)},GC.prototype.removeTransformer=function(t){this._transformers&&(this._transformers=this._transformers.filter(function(e){return t!==e}),this.transformRequest=qC(this._transformers))},GC._cloneCustomizer=function(e){if("object"==typeof e)return Object.assign({},e)},GC);function GC(){var e=null!==UC&&UC.apply(this,arguments)||this;return e.authOptions=gp(),e.disableTelemetry=!1,e["disable-telemetry"]=e.disableTelemetry,e.domain=ep,e.staticAssetsDomain=tp,e.styleDefinitionsPath=op,e.styleDefinitionsVersion=rp,e.styleAPIVersion=np,e.mapConfiguration=void 0,e.styleSet=void 0,e.enableAccessibility=!0,e["enable-accessibility"]=e.enableAccessibility,e.enableAccessibilityLocationFallback=!0,e.maxParallelImageRequests=Cp(),e.refreshExpiredTiles=!0,e.subscriptionKey=Tp(),e["subscription-key"]=e.subscriptionKey,e.sessionId=$h,e["session-id"]=e.sessionId,e._transformers=[],e.transformRequest=void 0,e.workerCount=bp(),e.fadeDuration=300,e.localIdeographFontFamily="sans-serif",e.validateStyle=!1,e}var YC=(ZC.getLayerGroup=function(e){if("string"!=typeof e&&e.metadata&&e.metadata["microsoft.maps:layerGroup"])return e.metadata["microsoft.maps:layerGroup"];e="string"!=typeof e?e.id:e;if(e.startsWith("microsoft.")){e=e.split(".");return 4<=e.length?e[3]:void 0}},ZC);function ZC(){}var WC=(VC.resolve=function(e){return new VC(Promise.resolve(e))},VC.reject=function(e){return new VC(Promise.reject(e))},VC.prototype.then=function(e,t){var o=this;return new Promise(function(e,t){o._resolve=e,o._reject=t,o._thenResolver(e,t)}).then(e,t)},VC.prototype.catch=function(e){var o=this;return new Promise(function(e,t){o._resolve=e,o._reject=t,o._thenResolver(e,t)}).catch(e)},VC.prototype.finally=function(e){var o=this;return new Promise(function(e,t){o._resolve=e,o._reject=t,o._thenResolver(e,t)}).finally(e)},VC.prototype.hijackAndResolve=function(e){this._hijackedToResolve=e,this._resolve&&this._resolve(e)},VC.prototype.hijackAndReject=function(e){this._hijackedToReject=e,this._reject&&this._reject(e)},VC.prototype.switchWith=function(e){this.origin=e,this._toResolve=void 0,this._toReject=void 0},VC);function VC(e){var n=this;this.isHijacked=function(){return void 0!==n._hijackedToResolve||void 0!==n._hijackedToReject},this.isResolved=function(){return void 0!==n._hijackedToResolve||void 0!==n._toResolve},this.isRejected=function(){return void 0!==n._hijackedToReject||void 0!==n._toReject},this.resultIfResolved=function(){return n._hijackedToResolve||n._toResolve},this.errorIfRejected=function(){return n._hijackedToReject||n._toReject},this._thenResolver=function(t,o){var r;n._hijackedToResolve?t(n._hijackedToResolve):n._hijackedToReject?o(n._hijackedToReject):(r=n.origin,n.origin.then(function(e){n.isHijacked()||(r!==n.origin?n._thenResolver(t,o):(n._toResolve=e,t(e)))}).catch(function(e){n.isHijacked()||(r!==n.origin?n._thenResolver(t,o):(n._toReject=e,o(e)))}))},this.origin=e,this[Symbol.toStringTag]=this.origin[Symbol.toStringTag]}var JC={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)"},QC=window&&window.__assign||function(){return(QC=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},XC=window&&window.__awaiter||function(e,a,s,c){return new(s=s||Promise)(function(o,t){function r(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?o(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(r,n)}i((c=c.apply(e,a||[])).next())})},$C=window&&window.__generator||function(o,r){var n,i,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;c&&t[c=0]&&(s=0),s;)try{if(n=1,i&&(a=2&t[0]?i.return:t[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,t[1])).done)return a;switch(i=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,i=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=r.call(o,s)}catch(e){t=[6,e],i=0}finally{n=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},eE=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},tE=window&&window.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},oE=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},rE=(nE.prototype.updateIndoorState=function(e,t){var o,r,n=this,i=this.map.styles.getMapConfiguration();i?(this.preservedPreindoorMapConfiguration=i,o=this.map.getStyle().style?"".concat(this.map.getStyle().style,"_indoor").concat("dark"===e?"_dark":"","_tileset_").concat(t):void 0,this.map.styles.setMapConfiguration("defaultIndoor_".concat(t),"microsoft-maps:default"===i?o:void 0)):(r=(null===(o=this.indoorState)||void 0===o?void 0:o.tilesetId)!==t,this.indoorState={tilesetId:t,theme:e},this.initStyleset(),this.definitions().then(function(e){var t=(n.map.getStyle().style||e.defaultConfiguration).replace("_indoor_dark","").replace("_indoor",""),o="".concat(t,"_indoor"),e=e.configurations.find(function(e){return e.name.startsWith(o)});e&&n.map.setStyle({style:e.name},!r)}))},nE.prototype.unsetIndoorState=function(){var o=this,e=this.preservedPreindoorMapConfiguration;e?this.map.styles.setMapConfiguration(e):(this.indoorState=void 0,this.initStyleset(),this.definitions().then(function(e){var t=o.map.getStyle().style;t.includes("_indoor")&&t.split("_indoor")[0]?o.map.setStyle({style:t.split("_indoor")[0]}):o.map.setStyle({style:void 0})}))},nE.prototype.initStyleset=function(){var e,o=this;return e=this.serviceOptions.mapConfiguration?"string"==typeof this.serviceOptions.mapConfiguration?(e=this.map.authentication?this.map.authentication.initialize():Promise.resolve(),new WC(e.then(function(){return o._request(o.serviceOptions.domain,"".concat(_,"/mapconfigurations/metadata/").concat(o.serviceOptions.mapConfiguration),"StyleDefinitions").then(function(e){return QC(QC({},e),{defaultConfiguration:e.defaultConfiguration||e.defaultStyle,configurations:e.configurations||e.styles})})}))):WC.resolve(this.serviceOptions.mapConfiguration):(e=this.map.authentication?this.map.authentication.initialize():Promise.resolve(),new WC(e.then(function(){return o._request(o.serviceOptions.staticAssetsDomain,"".concat(v,"/").concat(_),"StyleDefinitions",{version:o.serviceOptions.styleDefinitionsVersion,mcv:j.replace(/\./g,"")}).then(function(t){return{version:isNaN(t.version)?0:parseFloat(t.version),defaultConfiguration:t.defaultStyle,configurations:t.styles.filter(function(e){return o.indoorState?"auto"===o.indoorState.theme?e.name.endsWith("dark"===e.theme?"_indoor_dark":"_indoor"):e.name.endsWith("dark"===o.indoorState.theme?"_indoor_dark":"_indoor"):!e.name.includes("indoor")}).map(function(e){return{copyright:e.copyright.join(" "),name:e.name,displayName:function(e){e=o.indoorState&&e.includes("_indoor")?e.split("_indoor")[0]:e;return e in JC?JC[e]:e}(e.name),theme:e.theme,thumbnail:new D({domain:o.serviceOptions.staticAssetsDomain,path:e.thumbnail,protocol:"https"}).toString(),url:new D({domain:o.serviceOptions.staticAssetsDomain,path:"".concat(v,"/").concat(_,"/").concat(e.name),queryParams:{styleVersion:void 0!==t.version&&null!==t.version?t.version:o.serviceOptions.styleDefinitionsVersion,mcv:j.replace(/\./g,"")},protocol:"https"}).toString()}})}})}))),this.initPromise&&this.initPromise.switchWith(e),this.initPromise=e,this.initPromise.then(function(e){return o.map._invokeEvent("mapconfigurationchanged",e)}),this.initPromise},nE.prototype.getStyle=function(e){e=this._lookUp(e);if(!e)throw Error("Style definition is not available.");if(e.url)return e.url;if(e.style)return e.style;throw Error("Style definition neither contains URL nor style object.")},nE.prototype.deriveNewStyleAndLayerGroups=function(e,t){for(var o,r,n,i=this.map.getStyle(),a=this.map.getTraffic(),s={},c=0;c<t.layers.length;c++){var u=t.layers[c],l=YC.getLayerGroup(u);l?(s[l]||(s[l]=[]),s[l].push(u),i.showBuildingModels||"fill-extrusion"!==u.type?"fill-extrusion"===u.type&&(u.layout=null!==(o=u.layout)&&void 0!==o?o:{},u.layout.visibility="visible"):(u.layout=null!==(r=u.layout)&&void 0!==r?r:{},u.layout.visibility="none"),"none"!==a.flow&&l&&l==="traffic_".concat(a.flow)&&"line"==u.type&&(u.layout=null!==(r=u.layout)&&void 0!==r?r:{},u.layout.visibility="visible"),"labels"!==l&&"labels_places"!==l&&"labels_indoor"!==l||"symbol"!==u.type||(i.showLabels&&"none"!==(null===(l=u.layout)||void 0===l?void 0:l.visibility)?(u.layout=null!==(n=u.layout)&&void 0!==n?n:{},u.layout.visibility="visible"):(u.layout=null!==(n=u.layout)&&void 0!==n?n:{},u.layout.visibility="none"))):s[u.id]=[u]}return[t,s]},nE.prototype.injectUserLayersIntoStyle=function(a,s,c){return a?this.map.layers._getUserLayers().reduce(function(o,t){if(t.layer instanceof dh)return o;var e,r=c[t.before]&&0<c[t.before].length?c[t.before][0]:void 0,n=a.layers.find(function(e){return e.id===t.layer.getId()}),i=s.layers.findIndex(function(e){return e.id===t.layer.getId()});return-1<i&&s.layers.splice(i,1),n&&(e=new Set(Array.from(t.layer._getSourceIds()).map(function(e){return a.sources[e]?{source:a.sources[e],id:e}:void 0}).filter(function(e){return void 0!==e})),-1<(i=r?o.layers.findIndex(function(e){return e.id===r.id}):-1)?o.layers.splice(i,0,n):o.layers.push(n),e.forEach(function(e){var t=e.source,e=e.id;o.sources[e]=t})),o},QC({},s)):s},nE.prototype.setStyle=function(n,e){var i=this;void 0===e&&(e=!0);var t=this._lookUp(n);if(!t)throw Error("Style definition ".concat(n.style," is not available."));if(!t.url&&!t.style)throw Error("Style definition neither contains URL nor style object.");var o=function(){return i._onStyleData(t)},a=function(){i.map.events.remove("styledata",o),i.map.events.addOnce("styledata",o)},r=n&&n.customStyleTransform?function(e,t){t=n.customStyleTransform(e,t);return a(),t}:function(e,t){var o=QC(QC({},t),{layers:tE([],eE(t.layers),!1),sources:QC({},t.sources)}),r=n.progressiveLoading&&!i.map._isLoaded();r&&Array.isArray(null==t?void 0:t.layers)&&((o=QC({},t)).layers=o.layers.map(function(e){var t=QC({},e);return e.layout&&(t.layout=QC({},e.layout)),t}));t=eE(i.deriveNewStyleAndLayerGroups(e,o),2),o=t[0],t=t[1];r&&(r=n.progressiveLoadingInitialLayerGroups,Array.isArray(r)&&0<r.length&&i._deferLayerGroupVisibilities(t,r));o=i.injectUserLayersIntoStyle(e,o,t),t=Object.entries(t).map(function(e){var t=eE(e,2),e=t[0],t=t[1];return i._buildFundamentalLayerFrom(t,e)}),t=i.map.layers._getUserLayers().reduce(function(e,t){var o=t.before?e.findIndex(function(e){return e.getId()===t.before}):-1;return-1<o?e.splice(o,0,t.layer):e.push(t.layer),e},t);return i.map.layers.layerIndex=t,i.map.sources._syncSources(o.sources),a(),o};this.map._getMap().setStyle(t.url||t.style,{diff:e,validate:this.serviceOptions.validateStyle,transformStyle:r})},nE.prototype.getTheme=function(e){e=this._lookUp(e);if(e)return e.theme.toLowerCase()},nE.prototype.getThemeAsync=function(t){return XC(this,void 0,void 0,function(){return $C(this,function(e){switch(e.label){case 0:return[4,this._lookUpAsync(t)];case 1:return[2,e.sent().theme]}})})},nE.prototype.setMapConfiguration=function(e,o){var r=this;"string"==typeof(this.serviceOptions.mapConfiguration=e)?this.initStyleset():this.initPromise?this.initPromise.hijackAndResolve(e):this.initPromise=WC.resolve(e),this.definitions().then(function(e){var t=e.defaultConfiguration;e.configurations.find(function(e){return e.name===o})&&(t=o),r.map.setStyle({style:t})})},nE.prototype.getMapConfiguration=function(){return this.serviceOptions.mapConfiguration},nE.prototype.setStyleSet=function(e){this.updateIndoorState("indoor_dark"===e?"dark":"light",null)},nE.prototype.getStyleSet=function(){return void 0!==this.indoorState?"dark"===this.indoorState.theme?"indoor_dark":"indoor":"base"},nE.prototype.clearStyleSet=function(){this.unsetIndoorState()},nE.prototype._buildFundamentalLayerFrom=function(e,t){if(e&&0<e.length){e=new Tb(e,t);return e.onAdd(this.map),e}throw new Error("Unable to construct fundamental map layer for ID: ".concat(t,"."))},nE.prototype._transformStyleRequest=function(e,t){e.includes(h)&&(t.url=t.url.replace(h,this.serviceOptions.domain)),e.includes(y)&&(t.url=t.url.replace(y,v)),e.includes(m)&&(t.url=t.url.replace(m,_)),(t.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase())||t.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase()))&&((e=new URL(t.url)).searchParams.get(u)||(e.searchParams.set(u,this.serviceOptions.styleAPIVersion),t.url=e.href),null!==(e=this.map.authentication)&&void 0!==e&&e.signRequest(t))},nE.prototype._request=function(r,n,i,a){var s;return void 0===a&&(a={}),XC(this,void 0,void 0,function(){var t,o;return $C(this,function(e){switch(e.label){case 0:return t={url:new D({protocol:"https",domain:r,path:n,queryParams:QC(((o={})[u]=this.serviceOptions.styleAPIVersion,o.hash=nE._hashCode(null===(s=this.map.authentication)||void 0===s?void 0:s.getToken()),o),a)}).toString()},"function"==typeof this.serviceOptions.transformRequest&&i&&(t=this.serviceOptions.transformRequest(t.url,i)),null!==(s=this.map.authentication)&&void 0!==s&&s.signRequest(t),o={method:"GET",mode:"cors"},t.credentials&&(o.credentials=t.credentials),t.headers&&(o.headers=t.headers),[4,fetch(t.url,o).then(function(e){if(e.ok)return e.json();throw new Error("HTTP ".concat(e.status,": ").concat(e.statusText," "))})];case 1:return[2,e.sent()]}})})},nE._hashCode=function(e){var t=0;if(!(e=void 0===e?"":e))return t;for(var o=0;o<e.length;o++)t=(t<<5)-t+e.charCodeAt(o),t|=0;return t},nE);function nE(e,t){var l=this;this.definitions=function(){var e=l.initPromise||l.initStyleset();return e},this.indoorState=void 0,this.preservedPreindoorMapConfiguration=void 0,this._progressiveLoadingState={mapStyle:void 0,pendingVisibilityChange:void 0},this._deferLayerGroupVisibilities=function(t,e){var o,n,r,i,a=e.filter(function(e){return e in t});0!==a.length&&(o=l.map._getMap(),n=o.getZoom(),r=l.map.getStyle().style,l._progressiveLoadingState.pendingVisibilityChange&&(l.map.events.remove("load",l._progressiveLoadingState.pendingVisibilityChange),l._progressiveLoadingState.pendingVisibilityChange=null),l._progressiveLoadingState.mapStyle=r,(i=Object.entries(t).reduce(function(e,t){var o=eE(t,2),t=o[0],o=o[1],r=a.includes(t);return tE(tE([],eE(e),!1),eE(o.filter(function(e){if("custom"===e.type)return!1;if(r)if("number"==typeof e.maxzoom&&"number"==typeof e.minzoom){if(n<=e.maxzoom&&n>=e.minzoom)return!1}else if("number"==typeof e.minzoom){if(n>=e.minzoom)return!1}else{if("number"!=typeof e.maxzoom)return!1;if(n<=e.maxzoom)return!1}return"none"!==(null===(e=e.layout)||void 0===e?void 0:e.visibility)})),!1)},[])).forEach(function(e){e.layout=e.layout||{},e.layout.visibility="none"}),l._progressiveLoadingState.pendingVisibilityChange=function(){l._progressiveLoadingState.pendingVisibilityChange=null;var e=l.map.getStyle().style;r===e&&i.forEach(function(e){e.layout.visibility="visible",o.setLayoutProperty(e.id,"visibility","visible")})},l.map.events.addOnce("load",l._progressiveLoadingState.pendingVisibilityChange))},this._onStyleData=function(e){l.map.events.invoke("stylechanged",{style:e.name,map:l.map,type:"stylechanged"})},this._lookUp=function(e){var t,o,r=l.definitions(),n=r.errorIfRejected(),i=r.resultIfResolved();if(n)return null;if(i){var n=i.configurations,a=void 0;try{for(var s=oE(n),c=s.next();!c.done;c=s.next()){var u=c.value;if(u.name===e.style)return u;u.name!==i.defaultConfiguration||a||(a=u)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(t)throw t.error}}return a=a||n[0]}return null},this._lookUpAsync=function(o){return XC(l,void 0,void 0,function(){var t;return $C(this,function(e){switch(e.label){case 0:return[4,this.definitions()];case 1:return t=e.sent(),[2,t.configurations.find(function(e){return e.name===(o.style||t.defaultConfiguration)})||t.configurations.find(function(e){return e.name===t.defaultConfiguration})||t.configurations[0]]}})})},this.map=e,this.serviceOptions=t}var iE=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},aE=(sE.prototype.add=function(e){var t,o;e=Array.isArray(e)?e:[e];try{for(var r=iE(e),n=r.next();!n.done;n=r.next()){var i=n.value;this.indicators.has(i)||(this.indicators.add(i),i.attach(this.map))}}catch(e){t={error:e}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(t)throw t.error}}},sE.prototype.clear=function(){var t=this;this.indicators.forEach(function(e){t.indicators.delete(e),e.remove()})},sE.prototype.remove=function(e){var t,o;e=Array.isArray(e)?e:[e];try{for(var r=iE(e),n=r.next();!n.done;n=r.next()){var i=n.value;this.indicators.has(i)&&(this.indicators.delete(i),i.remove())}}catch(e){t={error:e}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(t)throw t.error}}},sE.prototype.getIndicators=function(){return Array.from(this.indicators)},sE.prototype._getCollectionDiv=function(){var e=this.map.getMapContainer().querySelector(".".concat(sE.Css.collection));return e||((e=document.createElement("div")).setAttribute("aria-label","map data"),e.setAttribute("role","listbox"),e.classList.add(sE.Css.collection),this.map.getMapContainer().appendChild(e)),e},sE.Css={collection:"accessible-indicator-collection-container"},sE);function sE(e){this.map=e,this.indicators=new Set}var cE,uE,r=window&&window.__extends||(cE=function(e,t){return(cE=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}cE(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),lE=window&&window.__assign||function(){return(lE=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},hE=window&&window.__awaiter||function(e,a,s,c){return new(s=s||Promise)(function(o,t){function r(e){try{i(c.next(e))}catch(e){t(e)}}function n(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?o(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(r,n)}i((c=c.apply(e,a||[])).next())})},pE=window&&window.__generator||function(o,r){var n,i,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;c&&t[c=0]&&(s=0),s;)try{if(n=1,i&&(a=2&t[0]?i.return:t[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,t[1])).done)return a;switch(i=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,i=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=r.call(o,s)}catch(e){t=[6,e],i=0}finally{n=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},dE=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},fE=window&&window.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},gE=window&&window.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},yE=(r(mE,uE=Q),Object.defineProperty(mE.prototype,"isDisposed",{get:function(){return this.removed},enumerable:!1,configurable:!0}),mE.prototype.getCanvas=function(){return this.map.getCanvas()},mE.prototype.getCanvasContainer=function(){return this.map.getCanvasContainer()},mE.prototype.getMapContainer=function(){return this.map.getContainer()},mE.prototype.getServiceOptions=function(){return vc(this.serviceOptions,KC._cloneCustomizer)},mE.prototype.setServiceOptions=function(e){this.serviceOptions=(new KC).merge(this.serviceOptions,e),this.serviceOptions["enable-accessibility"]?this.accessibleMapDelegate.addToMap():this.accessibleMapDelegate.removeFromMap();e=this.styles.serviceOptions.mapConfiguration!==this.serviceOptions.mapConfiguration||this.styles.serviceOptions.staticAssetsDomain!==this.serviceOptions.staticAssetsDomain||this.styles.serviceOptions.styleDefinitionsVersion!==this.serviceOptions.styleDefinitionsVersion||this.styles.serviceOptions.domain!==this.serviceOptions.domain||this.styles.serviceOptions.styleAPIVersion!==this.serviceOptions.styleAPIVersion;this.styles.serviceOptions=this.serviceOptions,e&&(this.styles.initPromise=null,this.setStyle({}))},mE.prototype.addRequestTransformer=function(e){this.serviceOptions.addTransformer(e)},mE.prototype.removeRequestTransformer=function(e){this.serviceOptions.removeTransformer(e)},mE.prototype.setCamera=function(e,t){if(void 0===t&&(t=!1),"padding"in e||"offset"in e||"bounds"in e){var o,r=(new Qb).merge({maxZoom:this.getCamera().maxZoom},e),n=this._generateSafeBounds(r.bounds),i={padding:r.padding,offset:r.offset,maxZoom:r.maxZoom};if(!(o=this.map.cameraForBounds(n,i))){var a=null===(a=this.map)||void 0===a?void 0:a.getContainer(),a={message:"The map cannot be fit to the current canvas with the given CameraBoundsOptions.",containerWidth:null==a?void 0:a.clientWidth,containerHeight:null==a?void 0:a.clientHeight,safeBounds:n,cameraForBoundsOptions:i};throw new Error(JSON.stringify(a))}"pitch"in e&&(o.pitch=e.pitch),"bearing"in e&&(o.bearing=e.bearing),"minPitch"in e&&this.map.setMinPitch(e.minPitch),"maxPitch"in e&&this.map.setMaxPitch(e.maxPitch),this.map.setMaxZoom(r.maxZoom),this._invokeEvent("maxzoomchanged",this.map.getMaxZoom()),n=this._generateSafeBounds(r.maxBounds)}else{i=(new tC).merge(this.getCamera(),e);i.centerOffset&&2<=i.centerOffset.length&&(a=i.centerOffset,(r=vs([i.center],i.zoom))[0][0]+=a[0],r[0][1]+=a[1],i.center=ms(r,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),i.minPitch&&this.map.setMinPitch(i.minPitch),i.maxPitch&&this.map.setMaxPitch(i.maxPitch),this._invokeEvent("minzoomchanged",this.map.getMinZoom()),this._invokeEvent("maxzoomchanged",this.map.getMaxZoom()),n=this._generateSafeBounds(i.maxBounds)}n?this.map.setMaxBounds(n):this.map.setMaxBounds(null);n=(new Hb).merge(e),e={duration:n.duration,easing:function(e){return e},offset:[0,0],animate:!0},t={fromControl:t};"jump"===n.type?this.map.jumpTo(o,t):"ease"===n.type?this.map.easeTo(lE(lE({},o),e),t):"fly"===n.type&&this.map.flyTo(lE(lE({},o),e),t)},mE.prototype.setCameraBounds=function(e){this.setCamera(e)},mE.prototype.getCamera=function(){var e=this.map.getBounds().getSouthWest().toArray(),t=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 Gs(e,t),minZoom:this.map.getMinZoom(),maxZoom:this.map.getMaxZoom()}},mE.prototype.setStyle=function(e,t){void 0===t&&(t=!0),delete e.preserveDrawingBuffer;e=(new LC).merge(this.styleOptions,e);e.autoResize!==this.styleOptions.autoResize&&this._setAutoResize(e.autoResize),e.language!==this.styleOptions.language&&(this.localizedStringsPromise=zh.getStrings(e.language)),e.renderWorldCopies!==this.styleOptions.renderWorldCopies&&this.map.setRenderWorldCopies(e.renderWorldCopies),e.showFeedbackLink!==this.styleOptions.showFeedbackLink&&this.copyrightControl.setOptions({showFeedbackLink:e.showFeedbackLink}),e.customAttribution!==this.styleOptions.customAttribution&&this.copyrightControl.setOptions({customAttribution:e.customAttribution}),e.showLogo!==this.styleOptions.showLogo&&this.copyrightControl.setOptions({showLogo:e.showLogo}),e.showTileBoundaries!==this.styleOptions.showTileBoundaries&&(this.map.showTileBoundaries=e.showTileBoundaries),e.showBuildingModels&&console.warn("showBuildingModels is deprecated.");t=t&&this.styleOptions.language===e.language&&this.styleOptions.view===e.view;this.styleOptions=e,this._setStyleComponents(e,t)},mE.prototype.getStyle=function(){return wn(this.styleOptions)},mE.prototype.addIcon=function(e,t){this.imageSprite.add(e,t)},mE.prototype.addPins=function(e,t){var o,r=(new yC).merge(t),n=this.layers.getLayerById(r.name),i=!1;if(n||(i=!0,n=new Kl("".concat(r.name,"-source"),r.name,{source:"".concat(r.name,"-source"),minZoom:r.minZoom,maxZoom:r.maxZoom,iconOptions:{anchor:"center",size:r.iconSize,image:["case",["has","icon"],["get","icon"],r.icon],ignorePlacement:!r.cluster,opacity:r.opacity},textOptions:{anchor:"center",textField:["case",["has","point_count"],["to-string",["get","point_count"]],["has","title"],["to-string",["get","title"]],r.title],font:["case",["has","point_count"],["literal",["StandardFontCondensed-Bold"]],["literal",[r.textFont]]],size:["case",["has","point_count"],20,r.fontSize],ignorePlacement:!r.cluster,opacity:r.opacity,offset:["case",["has","point_count"],["literal",[.5,-.45]],["literal",[r.textOffset[0]/16,r.textOffset[1]/16]]],color:r.fontColor}})),!(n instanceof Kl))throw new Error("A layer with name '".concat(r.name,"' already exists but it is not a SymbolLayer.")+"A SymbolLayer should be used for rendering pins.");var a=n.getSource();"string"==typeof a?(o=a,a=this.sources.getById(o)):o=a.getId();t=!1;if(a||(t=!0,a=new Rc(o,{cluster:r.cluster})),!(a instanceof Rc))throw new Error("The source with name '".concat(o,"' already exists but it is not a DataSource.")+"New data can only be added to a DataSource.");t&&this.sources.add(a),i&&this.layers.add(n,r.before);e=new Zs(e);r.overwrite?a.setShapes(e):a.add(e)},mE.prototype.addCircles=function(e,t){var o,r=(new cC).merge(t),n=this.layers.getLayerById(r.name),i=!1;if(n||(i=!0,n=new Ru("".concat(r.name,"-source"),r.name,{source:"".concat(r.name,"-source"),minZoom:r.minZoom,maxZoom:r.maxZoom,opacity:r.opacity,radius:["case",["has","radius"],["get","radius"],r.radius],color:["case",["has","color"],["get","color"],r.color],strokeColor:["case",["has","outlineColor"],["get","outlineColor"],r.outlineColor],strokeWidth:["case",["has","outlineWidth"],["get","outlineWidth"],r.outlineWidth]})),!(n instanceof Ru))throw new Error("A layer with name '".concat(r.name,"' already exists but it is not a BubbleLayer.")+"A BubbleLayer should be used for rendering circles.");var a=n.getSource();"string"==typeof a?(o=a,a=this.sources.getById(o)):o=a.getId();t=!1;if(a||(t=!0,a=new Rc(o)),!(a instanceof Rc))throw new Error("The source with name '".concat(o,"' already exists but it is not a DataSource.")+"New data can only be added to a DataSource.");t&&this.sources.add(a),i&&this.layers.add(n,r.before);e=new Zs(e);r.overwrite?a.setShapes(e):a.add(e)},mE.prototype.addLinestrings=function(e,t){var o,r=(new pC).merge(t),n=this.layers.getLayerById(r.name),i=!1;if(n||(i=!0,n=new cl("".concat(r.name,"-source"),r.name,{source:"".concat(r.name,"-source"),minZoom:r.minZoom,maxZoom:r.maxZoom,lineCap:r.cap,lineJoin:r.join,strokeOpacity:r.opacity,strokeColor:["case",["has","color"],["get","color"],r.color],strokeWidth:["case",["has","width"],["get","width"],r.width]})),!(n instanceof cl))throw new Error("A layer with name '".concat(r.name,"' already exists but it is not a LineLayer.")+"A LineLayer should be used for rendering linestrings.");var a=n.getSource();"string"==typeof a?(o=a,a=this.sources.getById(o)):o=a.getId();t=!1;if(a||(t=!0,a=new Rc(o)),!(a instanceof Rc))throw new Error("The source with name '".concat(o,"' already exists but it is not a DataSource.")+"New data can only be added to a DataSource.");t&&this.sources.add(a),i&&this.layers.add(n,r.before);e=new Zs(e);r.overwrite?a.setShapes(e):a.add(e)},mE.prototype.addPolygons=function(e,t){var o,r=(new wC).merge(t),n=this.layers.getLayerById(r.name),i=!1;if(n||(i=!0,n=new Al("".concat(r.name,"-source"),r.name,{source:"".concat(r.name,"-source"),minZoom:r.minZoom,maxZoom:r.maxZoom,fillOpacity:r.opacity,fillColor:["case",["has","color"],["get","color"],r.color]})),!(n instanceof Al))throw new Error("A layer with name '".concat(r.name,"' already exists but it is not a PolygonLayer.")+"A PolygonLayer should be used for rendering linestrings.");var a=n.getSource();"string"==typeof a?(o=a,a=this.sources.getById(o)):o=a.getId();t=!1;if(a||(t=!0,a=new Rc(o)),!(a instanceof Rc))throw new Error("The source with name '".concat(o,"' already exists but it is not a DataSource.")+"New data can only be added to a DataSource.");t&&this.sources.add(a),i&&this.layers.add(n,r.before);e=new Zs(e);r.overwrite?a.setShapes(e):a.add(e)},mE.prototype.addRaster=function(e,t){var o=(new SC).merge(t),r=this.layers.getLayerById(o.name);if(!((r=r||new ih({maxZoom:o.maxZoom,minZoom:o.minZoom,opacity:o.opacity,tileSize:256,tileUrl:"{subdomain}"},o.name))instanceof ih))throw new Error("A layer with name '".concat(o.name,"' already exists but it is not a TileLayer.")+"A TileLayer should be used for rendering raster images.");if("{subdomain}"!==r.getOptions().tileUrl)throw new Error("A TileLayer with name '".concat(o.name,"' already exists but was configured ")+"for a single tile url [default for new TileLayer(...)].");(t=!o.overwrite&&r.getOptions().subdomains||[]).push.apply(t,fE([],dE(e),!1)),r._setOptionsNoUpdate({subdomains:t}),this.layers.add(r,o.before)},mE.prototype.getLayers=function(){return this.layers.getLayers().map(function(e){return e.getId()})},mE.prototype.removeLayers=function(e){var t,o;try{for(var r=gE(e),n=r.next();!n.done;n=r.next()){var i,a=n.value;this.layers.getLayerById(a)&&(this.layers.remove(a),i="".concat(a,"-source"),this.sources.getById(i)&&this.sources.remove(i))}}catch(e){t={error:e}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(t)throw t.error}}},mE.prototype.addHtml=function(e,t){e.id||(e.id="marker_".concat(wa()));var o=new Lh({htmlContent:e});return this.markers.add(o,t),e.id},mE.prototype.removeHtml=function(e){this.markers.remove(e)},mE.prototype.addEventListener=function(e,t,o){this.events._addLegacy(e,t,o)},mE.prototype.removeEventListener=function(e,t,o){this.events._removeLegacy(e,t,o)},mE.prototype.setUserInteraction=function(e){this.userInteractionDelegate.setOptions(e)},mE.prototype.getUserInteraction=function(){return this.userInteractionDelegate.getOptions()},mE.prototype.addControl=function(e,t){this.controls.add(e,t)},mE.prototype.removeControl=function(e){this.controls.remove(e)},mE.prototype.setTraffic=function(e){var t=this.trafficOptions.incidents,o=this.trafficOptions.flow;if(this.trafficOptions=(new Oi).merge(this.trafficOptions,e),this.controls.getControls().filter(function(e){return e instanceof qi}).forEach(function(e){return e.updateButtonState()}),this.incidentDelegate&&(this.trafficOptions.incidents?t||this.incidentDelegate.addToMap():this.incidentDelegate.removeFromMap()),this.trafficOptions.flow&&"none"!==this.trafficOptions.flow){["absolute","relative-delay"].includes(this.trafficOptions.flow)&&console.warn("The 'absolute' and 'relative-delay' flow options are deprecated. Please use 'relative' instead.");try{this.trafficOptions.flow!==o&&this.flowDelegate.addToMap()}catch(e){throw this.trafficOptions.flow=o,e}}else this.flowDelegate.removeFromMap()},mE.prototype.getTraffic=function(){return wn(this.trafficOptions)},mE.prototype.remove=function(){this.dispose()},mE.prototype.clear=function(){this.popups.clear(),this.layers.clear(),this.sources.clear(),this.markers.clear(),this.indicators.clear()},mE.prototype.dispose=function(){var e;for(this.clear(),this.map.remove(),null!==(e=this.authentication)&&void 0!==e&&e.dispose(),this.removed=!0,window.removeEventListener("resize",this._windowResizeCallback);this.getMapContainer().firstChild;){var t=this.getMapContainer().firstChild;this.getMapContainer().removeChild(t)}},mE.prototype.resize=function(e,t,o){"number"!=typeof e&&"string"!=typeof e||"number"!=typeof t&&"string"!=typeof t?o=e:(e=e,this.getMapContainer().style.height="number"==typeof e?"".concat(e,"px"):e,this.getMapContainer().style.width="number"==typeof t?"".concat(t,"px"):t);t=this.getMapContainer().style.overflow;this.getMapContainer().style.overflow="hidden",this.map.resize(o),this.getMapContainer().style.overflow=t},mE.prototype.pixelsToPositions=function(e){var t,o,r=[];try{for(var n=gE(e),i=n.next();!i.done;i=n.next()){var a=i.value,s=this.map.unproject(a);r.push(new Ms(s.lng,s.lat))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(t)throw t.error}}return r},mE.prototype.positionsToPixels=function(e){var t,o,r=[];try{for(var n=gE(e),i=n.next();!i.done;i=n.next()){var a=i.value,s=this.map.project(a);r.push(new Ta(s.x,s.y))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(t)throw t.error}}return r},mE.prototype.areTilesLoaded=function(){return this.map.areTilesLoaded()},mE.prototype.stop=function(){this.map.stop()},mE.prototype.triggerRepaint=function(){this.map.triggerRepaint()},mE.prototype.enableElevation=function(e,t){this.map.setTerrain("string"==typeof e?{source:e,exaggeration:t}:{source:e.getId(),exaggeration:t})},mE.prototype.disableElevation=function(){this.map.setTerrain(null)},mE.prototype._getMap=function(){return this.map},mE.prototype._rebuildStyle=function(t){return void 0===t&&(t=!0),hE(this,void 0,void 0,function(){return pE(this,function(e){return this.styles.setStyle(this.styleOptions,t),this.imageSprite._restoreImages(),[2]})})},mE.prototype._isLoaded=function(){return this.loaded},mE.prototype._isReady=function(){return this.ready},mE.prototype._getLocalizedStrings=function(){return this.localizedStringsPromise},mE.prototype._sendRequest=function(e,t,o){var r;return(r="function"==typeof this.serviceOptions.transformRequest?this.serviceOptions.transformRequest(e,t):r)?fetch(r.url||e,{credentials:r.credentials,headers:lE(lE({},o),r.headers),method:"GET",mode:"cors"}):fetch(e,{headers:o,method:"GET",mode:"cors"})},mE.prototype._substituteDomainLanguageViewAndSignInRequest=function(e,t){var o,r;(e.includes(p)||e.includes(h))&&(r=new RegExp("[^{]".concat(p,"[^}]")),e.match(r)&&(t.url=t.url.replace(p,h)),D.protoRegEx.test(this.serviceOptions.domain)?(r=t.url.indexOf(h),t.url=this.serviceOptions.domain+t.url.substring(r+h.length)):t.url=t.url.replace(h,this.serviceOptions.domain)),(t.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase())||t.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase()))&&null!==(o=this.authentication)&&void 0!==o&&o.signRequest(t),e.includes(g)&&(t.url=t.url.replace(g,this.styleOptions.language)),e.includes(d)&&(t.url=this.styleOptions.view?t.url.replace(d,this.styleOptions.view):t.url.replace(d,"").replace("&".concat(f,"="),""))},mE.prototype._setAutoResize=function(e){e?window.addEventListener("resize",this._windowResizeCallback):window.removeEventListener("resize",this._windowResizeCallback)},mE.prototype._setStyleComponents=function(s,c){var u=this;void 0===c&&(c=!0),this.removed||this.styles.definitions().then(function(e){var t,o,r=!0;if(u.styleOptions.style)try{for(var n=gE(e.configurations),i=n.next();!i.done;i=n.next()){var a=i.value;if(u.styleOptions.style===a.name){r=!1;break}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(t)throw t.error}}r&&(u.styleOptions.style=e.defaultConfiguration),u.styleOptions=s,u._rebuildStyle(c)})},mE.prototype._updateGlobalDefaults=function(e){e&&(e.authOptions&&!fp&&Ap(e.authOptions),e.domain&&!sp&&kp(e.domain),e.styleDefinitionsPath&&!cp&&Op(e.styleDefinitionsPath),e.workerCount&&!lp&&Pp(e.workerCount),e.maxParallelImageRequests&&!hp&&xp(e.maxParallelImageRequests),!e.subscriptionKey&&!e["subscription-key"]||fp||Np(e.subscriptionKey||e["subscription-key"]),!e.sessionId&&!e["session-id"]||dp||Mp(e.sessionId||e["session-id"]),e.language&&!pp&&Rp(e.language),!e.userRegion&&!e.view||ap||Lp(e.userRegion||e.view))},mE.prototype._generateSafeBounds=function(e){if(e){var t=Gs.getSouth(e),o=Gs.getWest(e),r=Gs.getNorth(e),n=Gs.getEast(e);if(!(isFinite(t)&&isFinite(o)&&isFinite(r)&&isFinite(n)))throw new Error("The bounds specified are invalid: [".concat(e,"]"));for(;n<o;)n+=360;return new Gs([o,t,n,r])}return e},mE.prototype._detectHighContrast=function(){var e,t;switch(Yp.getHighContrastMode()){case"invert":case"light":e=mE.Css.hcLight,t="high_contrast_light";break;case"dark":e=mE.Css.hcDark,t="high_contrast_dark"}e&&this.map.getContainer().classList.add(e),t&&"road"===this.styleOptions.style&&(this.styleOptions.style=t)},mE.Css={canvasContainer:"atlas-map-canvas-container",canvas:"atlas-map-canvas",container:"atlas-map",hcDark:"high-contrast-dark",hcLight:"high-contrast-light"},mE);function mE(e,t){var o,r,n=uE.call(this)||this;n.removed=!1,n.loaded=!1,n.ready=!1,n._windowResizeCallback=function(){return n.resize()},n._updateGlobalDefaults(t),n.serviceOptions=(new KC).merge(t),n.styleOptions=(new LC).merge(t),n.trafficOptions=new Oi,n.styles=new rE(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):(e={antialias:n.styleOptions.antialias,attributionControl:!1,container:e,fadeDuration:n.serviceOptions.fadeDuration,localIdeographFontFamily:n.serviceOptions.localIdeographFontFamily,preserveDrawingBuffer:n.styleOptions.preserveDrawingBuffer,refreshExpiredTiles:n.serviceOptions.refreshExpiredTiles,renderWorldCopies:n.styleOptions.renderWorldCopies,trackResize:!1,transformRequest:function(e,t){var o={url:e};return"Tile"===t||"Source"===t?(e.includes(p)&&n.insights&&n.insights.trackEvent({name:"TileLoad"}),n._substituteDomainLanguageViewAndSignInRequest(e,o)):"Style"!==t&&"SpriteJSON"!==t&&"SpriteImage"!==t&&"Glyphs"!==t||n.styles._transformStyleRequest(e,o),n.serviceOptions.transformRequest&&vi(o,n.serviceOptions.transformRequest(o.url,t)),o}},r=new c.Map(e));try{n.map=r,n.authentication=new nb(n),n.controls=new sb(n),n.events=new gb(n),n.imageSprite=new wb(n),n.layers=new Pb(n),n.markers=new vb(n),n.sources=new Db(n),n.popups=new Mb(n),n.indicators=new aE(n),n.map.getContainer().classList.add(mE.Css.container),n.map.getCanvasContainer().classList.add(mE.Css.canvasContainer),n.map.getCanvas().classList.add(mE.Css.canvas),n._detectHighContrast(),n.copyrightControl=new ed({showFeedbackLink:n.styleOptions.showFeedbackLink,showLogo:n.styleOptions.showLogo,customAttribution:n.styleOptions.customAttribution}),n.controls.add(n.copyrightControl,{position:l.ControlPosition.NonFixed});var i=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 s=function(){n.ready=!0,n.map.off("styledata",s),n.events.invoke("ready",{map:n,type:"ready"})};n.map.on("styledata",s),n._setAutoResize(n.styleOptions.autoResize),n.map.showTileBoundaries=n.styleOptions.showTileBoundaries,n.localizedStringsPromise=zh.getStrings(n.styleOptions.language),i.then(function(){return n.styles.definitions()}).then(function(e){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(e){e=e instanceof Error?e:new Error(e);n.events.invoke("error",{map:n,type:"error",error:e})}),n.setCamera(lE(lE({minZoom:1},t),{type:"jump",duration:0})),n.incidentDelegate=new Id(n),n.flowDelegate=new _d(n),n.accessibleMapDelegate=new vd(n),n.userInteractionDelegate=new Dd(n,t),n.userInteractionDelegate.addToMap(),n.copyrightDelegate=new $d(n,n.copyrightControl,n.styleOptions)}catch(e){throw e}return n}var vE=window&&window.__read||function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},_E=window&&window.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||((r=r||Array.prototype.slice.call(t,0,n))[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},k=(wE.applyTemplate=function(t,o){var r,n,e,i=this,a=document.createElement("div");return a.classList.add(wE.Css.template),t&&("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}"))||(t.title?o.title="{title}":t.name&&(o.title="{name}")),"boolean"!=typeof o.detectHyperlinks&&(o.detectHyperlinks=!0),"boolean"!=typeof o.parsePropertyPaths&&(o.parsePropertyPaths=!0),o.textColor&&(a.style.color=o.textColor),o.fillColor&&(a.style.backgroundColor=o.fillColor),o.title&&((e=this._applyStringTemplate(t,o.title,o)).innerText=e.textContent||e.innerText||"",this._appendChild(a,e,wE.Css.title)),(r=document.createElement("div")).classList.add(wE.Css.content),Array.isArray(o.content)?0<o.content.length&&o.content[0].propertyPath?this._appendChild(r,this._generateContent(t,o.content,o),wE.Css.item):o.content.forEach(function(e){i._appendChild(r,i._generateContent(t,e,o),wE.Css.item)}):(n=0,t.description&&Object.keys(t).forEach(function(e){i._ignoreProperty(e,t[e])||n++}),e=void 0,1===n||o.singleDescription&&t.description||2===n&&t.Snippet?(e=document.createElement("div")).innerHTML=t.description:e=this._generateContent(t,o.content,o),this._appendChild(r,e,wE.Css.item)),""!==r.innerHTML&&(o.sandboxContent?a.appendChild(wE._createSandboxedIframe(r,o)):a.appendChild(r))),a},wE._createSandboxedIframe=function(e,t){var o=document.createElement("iframe");o.sandbox.add("allow-popups");var r=e.innerHTML,n=!1,i=100,a=550,s=10,c=0;document.body.scrollWidth<=340&&(a=300,i=50);var u=r.split(/<(tr|div|br|li|h[0-9]|p>)/),c=Math.max.apply(Math,_E([],vE(u.map(function(e){return e.replace(/<[a-zA-Z0-9\s=\/]+>/g,"").length})),!1))-1,e=Math.ceil(3.5*c);e<a&&(a=e,i=c),r.includes("<img")||r.includes("<video")?(n=!0,o.width="550px"):(c=-1<r.indexOf(wE.Css.table)?25:20,s+=Math.max(.5*u.length*c,Math.ceil(r.replace(/<[a-zA-Z0-9\s=\/]+>/g,"").length/i)*c)),o.width=a+"px",o.height=n||280<s?"280px":s+"px";s=t.textColor?"color:".concat(t.textColor,";"):"",t=t.fillColor?"background-color:".concat(t.fillColor,";"):"",r='<html><head><title></title><meta charset="utf-8" /><meta http-equiv="x-ua-compatible" content="IE=Edge" />'+'<link rel="stylesheet" href="'.concat(wE._cssUrl,'" type="text/css"/>')+"<style>html, body{margin:0;padding:0;".concat(s).concat(t,"}</style></head>")+'<body><div class="'.concat(wE.Css.template,'" style="padding:0;width:').concat(a-20,'px">').concat(r,"</div></body></html>");return void 0===o.srcdoc?o.src="data:text/html;charset=utf-8,"+encodeURI(r):o.srcdoc=r,o},wE._appendChild=function(e,t,o){t&&(o&&(t.className=(t.className?t.className+" ":"")+o),e.appendChild(t))},wE._generateContent=function(e,t,o){if(t)return Array.isArray(t)?this._generatePropertyInfoTable(e,t,o):this._applyStringTemplate(e,t,o);e=this._generateDynamicTableHtml(e,null,o);if(e){o=document.createElement("div");return o.innerHTML=e,o}return null},wE._applyStringTemplate=function(e,t,o){if(t){for(var r,n=t,i=this._placeholderRx.exec(t);i;)2<=i.length&&(r=this._getPropertyValue(e,i[1],o),n=n.replace(i[0],r)),i=this._placeholderRx.exec(t);if(n){(n=n.trim()).includes("<")&&(n=n.replace(/[\r\n]+/g,"<br/>"));var a=document.createElement("div");return a.innerHTML=n,a}}return null},wE._getPropertyValue=function(e,t,o,r){var n=o.parsePropertyPaths?t.split("/"):[t],i=n.length;if(0<i&&e){var a=n[0],s=e[a];if(o.detectHyperlinks&&"link"===t&&(!r||r.hyperlinkFormat)){var c,u=[];if(Array.isArray(s)?s.forEach(function(e){e.href?u.push(e):"string"==typeof e&&u.push({href:e})}):s.href&&u.push(s),0<u.length){r&&r.hyperlinkFormat?c=r.hyperlinkFormat:o&&o.hyperlinkFormat&&(c=o.hyperlinkFormat);var l=c&&c.target?c.target:"_blank",h=[];return u.forEach(function(e){e.title||c&&c.label||!e.rel||h.push(e.rel," - "),h.push('<a href="',e.href,'" target="',l,'">'),e.title?h.push(e.title):c&&c.label?h.push(c.label):h.push(e.href),h.push("</a>","<br/>")}),h.pop(),h.join("")}}if(null!=s){for(var p=void 0,p=1;p<i&&(s=s[n[p]],a=n[p],null!=s);p++);if(p===i&&null!=s){var d=void 0;if((d=void 0!==s.value?s.value:s)instanceof Date)return r&&r.dateFormat?d.toLocaleString(void 0,r.dateFormat):o.dateFormat?d.toLocaleString(void 0,o.dateFormat):d.toISOString();if("object"==typeof d)return(g=this._generateDynamicTableHtml(d,n.slice(1),o))||"";if("number"==typeof d){if(r){if(r.dateFormat)return new Date(d).toLocaleString(void 0,r.dateFormat);if(r.numberFormat)return d.toLocaleString(void 0,r.numberFormat)}else if(/(timestamp|date)/gi.test(a))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||r&&r.hyperlinkFormat)){var d=d.trim(),f=this._isUrlRx.test(d)||r&&r.hyperlinkFormat,e=this._isImageUrlRx.test(d)&&(f||d.startsWith("data:image")),t=this._emailRx.test(d);if(f||e||t){f=void 0;r&&r.hyperlinkFormat?f=r.hyperlinkFormat:o&&o.hyperlinkFormat&&(f=o.hyperlinkFormat);var g=void 0;g=f&&f.target?' target="'.concat(f.target,'"'):' target="_blank"';o="".concat(f&&f.label?f.label:d);f&&f.scheme?d=f.scheme+d:t&&(d="mailto:"+d);t=f&&f.label?' alt="'.concat(f.label,'"'):"";return(f&&f.isImage||e)&&(o='<img src="'.concat(d,'" style="max-width:100%"').concat(t,'"/>')),'<a href="'.concat(d,'"').concat(g,">").concat(o,"</a>")}}return d.toString()}}}return""},wE._generatePropertyInfoTable=function(o,e,r){if(o&&e&&0<e.length){var n=[],i=this;n.push('<table class="'.concat(i.Css.table,'">')),e.forEach(function(e){var t=i._getPropertyValue(o,e.propertyPath,r,e);e.hideLabel?n.push('<tr><td colspan="2">',t,"</td></tr>"):(e=e.label||e.propertyPath.split("/")[0],n.push("<tr><th>",e,"</th><td>",t,"</td></tr>"))}),n.push("</table>");e=document.createElement("div");return e.innerHTML=n.join(""),e}return null},wE._generateDynamicTableHtml=function(t,e,o){var r=this;if(t){var n=[],i=this;n.push('<table class="'.concat(i.Css.table,'">'));var a=e&&0<e.length?e.join("/")+"/":"",s=0;return(Object.keys(t).forEach(function(e){r._ignoreProperty(e,t[e])||(n.push("<tr><th>",e,"</th><td>",i._getPropertyValue(t,a+e,o),"</td></tr>"),s++)}),0===s)?null:(n.push("</table>"),n.join(""))}return null},wE._ignoreProperty=function(e,t){switch(e){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===e.indexOf("_")||null==t||""===t)return!0}return!1},wE._placeholderRx=/\{([a-zA-Z0-9_\/\s]+)\}/gi,wE._isUrlRx=/^(http|https|ftp|tel|mailto):\/\//i,wE._isImageUrlRx=/(^data:image|.png$|.jpg$|.jpeg$|.gif$|.bmp$|.svg|.tif|.tiff$)/i,wE._emailRx=/^[^\.\s@:](?:[^\s@:]*[^\s@:\.])?@[^\.\s@]+(?:\.[^\.\s@]+)*$/,wE._cssUrl=new D({domain:t,path:"sdk/javascript/mapcontrol/".concat(U.getEndpointVersion(),"/atlas.min.css")}).toString(),wE.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"},wE);function wE(){this.detectHyperlinks=!0,this.parsePropertyPaths=!0}r=new D({domain:t,path:"sdk/javascript/mapcontrol/".concat(U.getEndpointVersion(),"/mapbox-gl-rtl-text.min.js")});c.setRTLTextPlugin(r.toString(),function(e){e&&console.warn(e)},!0),l.HtmlMarker=Lh,l.Map=yE,l.Pixel=Ta,l.Popup=Ah,l.PopupTemplate=k,l.Shape=Hs,l._getAssetDomain=function(){return e},l._getDomain=function(){return ep},l._hasMaxParallelImageRequests=zp,l._hasSetAuthenticationOptions=qp,l._hasSetDomain=jp,l._hasSetLanguage=Bp,l._hasSetSessionId=Fp,l._hasSetStyleDefinitionsPath=Up,l._hasSetStyleDefinitionsVersion=function(){return up},l._hasSetView=Kp,l._hasWorkerCount=Hp,l.addImageTemplate=function(e,t,o){!o&&Gp[e.toLowerCase()]||(Gp[e.toLowerCase()]=t)},l.clearPrewarmedResources=function(){c.clearPrewarmedResources()},l.control=Wt,l.data=jt,l.getAllImageTemplateNames=function(){return Object.keys(Gp)},l.getAuthenticationOptions=gp,l.getDomain=mp,l.getImageTemplate=Dp,l.getLanguage=Ep,l.getMaxParallelImageRequests=Cp,l.getSessionId=Sp,l.getStaticAssetsDomain=yp,l.getStyleAPIVersion=wp,l.getStyleDefinitionsPath=vp,l.getStyleDefinitionsVersion=_p,l.getSubscriptionKey=Tp,l.getUserRegion=function(){return Vh},l.getVersion=function(){return U.getFullVersion()},l.getView=Ip,l.getWorkerCount=bp,l.internal=te,l.isSupported=function(e){return!Fh.isIE()},l.layer=Ht,l.math=Re,l.prewarm=function(){c.prewarm()},l.setAuthenticationOptions=Ap,l.setDomain=kp,l.setLanguage=Rp,l.setMaxParallelImageRequests=xp,l.setSessionId=Mp,l.setStyleAPIVersion=function(e){np=e},l.setStyleDefinitionsPath=Op,l.setStyleDefinitionsVersion=function(e){rp=e,up=!0},l.setSubscriptionKey=Np,l.setUserRegion=Lp,l.setView=function(e){Vh=e,ap=!0},l.setWorkerCount=Pp,l.source=tt});
|