@mappedin/mappedin-js 4.0.18 → 4.0.21

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.
@@ -1 +1 @@
1
- var Js=Object.create,_t=Object.defineProperty,Ws=Object.getOwnPropertyDescriptor,Ks=Object.getOwnPropertyNames,Xs=Object.getPrototypeOf,Zs=Object.prototype.hasOwnProperty,Ys=(t,e,n)=>e in t?_t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ga=t=>_t(t,"__esModule",{value:!0}),ya=(t,e)=>()=>(t&&(e=t(t=0)),e),V=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Qs=(t,e)=>{for(var n in ga(t),e)_t(t,n,{get:e[n],enumerable:!0})},eu=(t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of Ks(e))!Zs.call(t,i)&&"default"!==i&&_t(t,i,{get:()=>e[i],enumerable:!(n=Ws(e,i))||n.enumerable});return t},va=t=>eu(ga(_t(null!=t?Js(Xs(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),p=(t,e,n)=>(Ys(t,"symbol"!=typeof e?e+"":e,n),n),ma=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},v=(t,e,n)=>(ma(t,e,"read from private field"),n?n.call(t):e.get(t)),E=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},G=(t,e,n,i)=>(ma(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n),h=ya((()=>{})),Ma=V(((t,e)=>{h(),function(n){var i="object"==typeof t&&t,r="object"==typeof e&&e&&e.exports==i&&e,a="object"==typeof global&&global;(a.global===a||a.window===a)&&(n=a);var o=function(t){this.message=t};(o.prototype=new Error).name="InvalidCharacterError";var s=function(t){throw new o(t)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,h={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,i,r,a=t.length%3,o="",u=-1,h=t.length-a;++u<h;)e=t.charCodeAt(u)<<16,n=t.charCodeAt(++u)<<8,i=t.charCodeAt(++u),o+=l.charAt((r=e+n+i)>>18&63)+l.charAt(r>>12&63)+l.charAt(r>>6&63)+l.charAt(63&r);return 2==a?(e=t.charCodeAt(u)<<8,n=t.charCodeAt(++u),o+=l.charAt((r=e+n)>>10)+l.charAt(r>>4&63)+l.charAt(r<<2&63)+"="):1==a&&(r=t.charCodeAt(u),o+=l.charAt(r>>2)+l.charAt(r<<4&63)+"=="),o},decode:function(t){var e=(t=String(t).replace(u,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var n,i,r=0,a="",o=-1;++o<e;)i=l.indexOf(t.charAt(o)),n=r%4?64*n+i:i,r++%4&&(a+=String.fromCharCode(255&n>>(-2*r&6)));return a},version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return h}));else if(i&&!i.nodeType)if(r)r.exports=h;else for(var c in h)h.hasOwnProperty(c)&&(i[c]=h[c]);else n.base64=h}(t)})),ie=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.areaConversion=t.timeConversion=t.distanceConversion=t.altitudeKeys=t.latitudeKeys=t.longitudeKeys=t.MAXLON=t.MINLON=t.MAXLAT=t.MINLAT=t.earthRadius=t.sexagesimalPattern=void 0;t.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/;t.earthRadius=6378137;t.MINLAT=-90;t.MAXLAT=90;t.MINLON=-180;t.MAXLON=180;t.longitudeKeys=["lng","lon","longitude",0];t.latitudeKeys=["lat","latitude",1];t.altitudeKeys=["alt","altitude","elevation","elev",2];t.distanceConversion={m:1,km:.001,cm:100,mm:1e3,mi:1/1609.344,sm:1/1852.216,ft:100/30.48,in:100/2.54,yd:1/.9144};t.timeConversion={m:60,h:3600,d:86400};var e={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};t.areaConversion=e,e.sqm=e.m2,e.sqkm=e.km2,e.sqft=e.ft2,e.sqyd=e.yd2,e.sqin=e.in2})),At=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t,e){return e.reduce((function(e,n){if(null==t)throw new Error("'".concat(t,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(t,n)&&void 0!==n&&void 0===e?(e=n,n):e}),void 0)};t.default=e})),Lt=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){var e=t.toString().trim();return!isNaN(parseFloat(e))&&parseFloat(e)===Number(e)};t.default=e})),Dt=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ie(),n=function(t){return e.sexagesimalPattern.test(t.toString().trim())};t.default=n})),Bt=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ie(),n=function(t){var n=new RegExp(e.sexagesimalPattern).exec(t);if(null==n)throw new Error("Given value is not in sexagesimal format");var i=Number(n[2])/60||0,r=Number(n[4])/3600||0,a=parseFloat(n[1])+i+r;return["S","W"].includes(n[7])?-a:a};t.default=n})),An=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=ie(),i=(e=At())&&e.__esModule?e:{default:e};function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:n.longitudeKeys,latitude:n.latitudeKeys,altitude:n.altitudeKeys},r=(0,i.default)(t,e.longitude),o=(0,i.default)(t,e.latitude),s=(0,i.default)(t,e.altitude);return a({latitude:o,longitude:r},s?{altitude:s}:{})};t.default=s})),pi=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Lt()),n=a(Dt()),i=a(Bt()),r=ie();function a(t){return t&&t.__esModule?t:{default:t}}var o=function t(a){return(0,e.default)(a)?!(parseFloat(a)>r.MAXLAT||a<r.MINLAT):!!(0,n.default)(a)&&t((0,i.default)(a))};t.default=o})),hi=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Lt()),n=a(Dt()),i=a(Bt()),r=ie();function a(t){return t&&t.__esModule?t:{default:t}}var o=function t(a){return(0,e.default)(a)?!(parseFloat(a)>r.MAXLON||a<r.MINLON):!!(0,n.default)(a)&&t((0,i.default)(a))};t.default=o})),yi=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(An()),n=r(pi()),i=r(hi());function r(t){return t&&t.__esModule?t:{default:t}}var a=function(t){var r=(0,e.default)(t),a=r.latitude,o=r.longitude;if(Array.isArray(t)&&t.length>=2)return(0,i.default)(t[0])&&(0,n.default)(t[1]);if(void 0===a||void 0===o)return!1;var s=t[o],l=t[a];return!(void 0===l||void 0===s||!1===(0,n.default)(l)||!1===(0,i.default)(s))};t.default=a})),Sn=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Lt()),n=o(Dt()),i=o(Bt()),r=o(yi()),a=o(An());function o(t){return t&&t.__esModule?t:{default:t}}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var c=function t(o){if((0,e.default)(o))return Number(o);if((0,n.default)(o))return(0,i.default)(o);if((0,r.default)(o)){var s=(0,a.default)(o);return Array.isArray(o)?o.map((function(e,n){return[0,1].includes(n)?t(e):e})):l(l(l({},o),s.latitude&&u({},s.latitude,t(o[s.latitude]))),s.longitude&&u({},s.longitude,t(o[s.longitude])))}return Array.isArray(o)?o.map((function(e){return(0,r.default)(e)?t(e):e})):o};t.default=c})),Me=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ie(),n=r(At()),i=r(Sn());function r(t){return t&&t.__esModule?t:{default:t}}var a=function(t,r){var a=(0,n.default)(t,e.latitudeKeys);if(null!=a){var o=t[a];return!0===r?o:(0,i.default)(o)}};t.default=a})),be=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ie(),n=r(At()),i=r(Sn());function r(t){return t&&t.__esModule?t:{default:t}}var a=function(t,r){var a=(0,n.default)(t,e.longitudeKeys);if(null!=a){var o=t[a];return!0===r?o:(0,i.default)(o)}};t.default=a})),Ae=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return t*Math.PI/180};t.default=e})),Ze=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return 180*t/Math.PI};t.default=e})),La=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Me()),n=o(be()),i=o(Ae()),r=o(Ze()),a=ie();function o(t){return t&&t.__esModule?t:{default:t}}var s=function(t,o,s){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,u=(0,e.default)(t),h=(0,n.default)(t),c=o/l,d=(0,i.default)(s),f=(0,i.default)(u),p=(0,i.default)(h),g=Math.asin(Math.sin(f)*Math.cos(c)+Math.cos(f)*Math.sin(c)*Math.cos(d)),v=p+Math.atan2(Math.sin(d)*Math.sin(c)*Math.cos(f),Math.cos(c)-Math.sin(f)*Math.sin(g)),y=(0,r.default)(v);return(y<a.MINLON||y>a.MAXLON)&&(v=(v+3*Math.PI)%(2*Math.PI)-Math.PI,y=(0,r.default)(v)),{latitude:(0,r.default)(g),longitude:y}};t.default=s})),Da=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ie(),n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",i=e.areaConversion[n];if(i)return t*i;throw new Error("Invalid unit used for area conversion.")};t.default=n})),Ba=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ie(),n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",i=e.distanceConversion[n];if(i)return t*i;throw new Error("Invalid unit used for distance conversion.")};t.default=n})),Ea=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ie(),n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(n){case"kmh":return t*e.timeConversion.h*e.distanceConversion.km;case"mph":return t*e.timeConversion.h*e.distanceConversion.mi;default:return t}};t.default=n})),Ca=V((t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{!i&&null!=s.return&&s.return()}finally{if(r)throw a}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);if("Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(t,e)}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(t){var e=Math.pow(10,12);return Math.round(t*e)/e},r=function(t){var n=e(t.toString().split("."),2),r=n[0],a=n[1],o=Math.abs(Number(r)),s=i(60*Number("0."+(a||0))),l=Math.floor(s),u=i(60*(s%l||0));return o+"° "+Number(l.toFixed(6)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+"' "+Number(u.toFixed(4)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+'"'};t.default=r})),xi=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return t>1?1:t<-1?-1:t};t.default=e})),Ue=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Me()),n=o(be()),i=o(Ae()),r=o(xi()),a=ie();function o(t){return t&&t.__esModule?t:{default:t}}var s=function(t,o){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;s=void 0===s||isNaN(s)?1:s;var l=(0,e.default)(t),u=(0,n.default)(t),h=(0,e.default)(o),c=(0,n.default)(o),d=Math.acos((0,r.default)(Math.sin((0,i.default)(h))*Math.sin((0,i.default)(l))+Math.cos((0,i.default)(h))*Math.cos((0,i.default)(l))*Math.cos((0,i.default)(u)-(0,i.default)(c))))*a.earthRadius;return Math.round(d/s)*s};t.default=s})),wi=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Ue())&&e.__esModule?e:{default:e};var i=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default;return i="function"==typeof i?i:n.default,e.slice().sort((function(e,n){return i(t,e)-i(t,n)}))};t.default=i})),ka=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=wi())&&e.__esModule?e:{default:e};var i=function(t,e){return(0,n.default)(t,e)[0]};t.default=i})),ja=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ae()),n=a(Me()),i=a(be()),r=ie();function a(t){return t&&t.__esModule?t:{default:t}}var o=function(t){var a=0;if(t.length>2){for(var o,s,l,u=0;u<t.length;u++){u===t.length-2?(o=t.length-2,s=t.length-1,l=0):u===t.length-1?(o=t.length-1,s=0,l=1):(o=u,s=u+1,l=u+2);var h=(0,i.default)(t[o]),c=(0,n.default)(t[s]),d=(0,i.default)(t[l]);a+=((0,e.default)(d)-(0,e.default)(h))*Math.sin((0,e.default)(c))}a=a*r.earthRadius*r.earthRadius/2}return Math.abs(a)};t.default=o})),Ni=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Me()),n=i(be());function i(t){return t&&t.__esModule?t:{default:t}}var r=function(t){if(!1===Array.isArray(t)||0===t.length)throw new Error("No points were given.");return t.reduce((function(t,i){var r=(0,e.default)(i),a=(0,n.default)(i);return{maxLat:Math.max(r,t.maxLat),minLat:Math.min(r,t.minLat),maxLng:Math.max(a,t.maxLng),minLng:Math.min(a,t.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})};t.default=r})),$a=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Me()),n=o(be()),i=o(Ae()),r=o(Ze()),a=ie();function o(t){return t&&t.__esModule?t:{default:t}}var s=function(t,o){var s,l,u=(0,e.default)(t),h=(0,n.default)(t),c=(0,i.default)(u),d=(0,i.default)(h),f=o/a.earthRadius,p=c-f,g=c+f,v=(0,i.default)(a.MAXLAT),y=(0,i.default)(a.MINLAT),m=(0,i.default)(a.MAXLON),b=(0,i.default)(a.MINLON);if(p>y&&g<v){var M=Math.asin(Math.sin(f)/Math.cos(c));(s=d-M)<b&&(s+=2*Math.PI),(l=d+M)>m&&(l-=2*Math.PI)}else p=Math.max(p,y),g=Math.min(g,v),s=b,l=m;return[{latitude:(0,r.default)(p),longitude:(0,r.default)(s)},{latitude:(0,r.default)(g),longitude:(0,r.default)(l)}]};t.default=s})),Wa=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Me()),n=a(be()),i=a(Ae()),r=a(Ze());function a(t){return t&&t.__esModule?t:{default:t}}var o=function(t){if(!1===Array.isArray(t)||0===t.length)return!1;var a=t.length,o=t.reduce((function(t,r){var a=(0,i.default)((0,e.default)(r)),o=(0,i.default)((0,n.default)(r));return{X:t.X+Math.cos(a)*Math.cos(o),Y:t.Y+Math.cos(a)*Math.sin(o),Z:t.Z+Math.sin(a)}}),{X:0,Y:0,Z:0}),s=o.X/a,l=o.Y/a,u=o.Z/a;return{longitude:(0,r.default)(Math.atan2(l,s)),latitude:(0,r.default)(Math.atan2(u,Math.sqrt(s*s+l*l)))}};t.default=o})),Ka=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Ni())&&e.__esModule?e:{default:e};var i=function(t){var e=(0,n.default)(t),i=e.minLat+(e.maxLat-e.minLat)/2,r=e.minLng+(e.maxLng-e.minLng)/2;return{latitude:parseFloat(i.toFixed(6)),longitude:parseFloat(r.toFixed(6))}};t.default=i})),Oi=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Me()),n=a(be()),i=a(Ae()),r=a(Ze());function a(t){return t&&t.__esModule?t:{default:t}}var o=function(t,a){var o=(0,i.default)((0,n.default)(a))-(0,i.default)((0,n.default)(t)),s=Math.log(Math.tan((0,i.default)((0,e.default)(a))/2+Math.PI/4)/Math.tan((0,i.default)((0,e.default)(t))/2+Math.PI/4));return Math.abs(o)>Math.PI&&(o=o>0?-1*(2*Math.PI-o):2*Math.PI+o),((0,r.default)(Math.atan2(o,s))+360)%360};t.default=o})),Qa=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Oi())&&e.__esModule?e:{default:e};var i=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,r="function"==typeof i?i(t,e):(0,n.default)(t,e);if(isNaN(r))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(r/22.5)){case 1:return"NNE";case 2:return"NE";case 3:return"ENE";case 4:return"E";case 5:return"ESE";case 6:return"SE";case 7:return"SSE";case 8:return"S";case 9:return"SSW";case 10:return"SW";case 11:return"WSW";case 12:return"W";case 13:return"WNW";case 14:return"NW";case 15:return"NNW";default:return"N"}};t.default=i})),Pi=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Ue()),n=i(xi());function i(t){return t&&t.__esModule?t:{default:t}}var r=function(t,i,r){var a=(0,e.default)(i,t),o=(0,e.default)(t,r),s=(0,e.default)(i,r),l=Math.acos((0,n.default)((a*a+s*s-o*o)/(2*a*s))),u=Math.acos((0,n.default)((o*o+s*s-a*a)/(2*o*s)));return l>Math.PI/2?a:u>Math.PI/2?o:Math.sin(l)*a};t.default=r})),io=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Me()),n=a(be()),i=a(Ae()),r=a(Ze());function a(t){return t&&t.__esModule?t:{default:t}}var o=function(t,a){var o=(0,e.default)(a),s=(0,n.default)(a),l=(0,e.default)(t),u=(0,n.default)(t);return((0,r.default)(Math.atan2(Math.sin((0,i.default)(s)-(0,i.default)(u))*Math.cos((0,i.default)(o)),Math.cos((0,i.default)(l))*Math.sin((0,i.default)(o))-Math.sin((0,i.default)(l))*Math.cos((0,i.default)(o))*Math.cos((0,i.default)(s)-(0,i.default)(u))))+360)%360};t.default=o})),ao=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Ue())&&e.__esModule?e:{default:e};function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.default;return t.reduce((function(t,n){return"object"===i(t)&&null!==t.last&&(t.distance+=e(n,t.last)),t.last=n,t}),{last:null,distance:0}).distance};t.default=r})),lo=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Me()),n=a(be()),i=a(Ae()),r=ie();function a(t){return t&&t.__esModule?t:{default:t}}var o=function(t,a){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;o=void 0===o||isNaN(o)?1:o;var s,l,u,h,c,d,f,p=(0,e.default)(t),g=(0,n.default)(t),v=(0,e.default)(a),y=(0,n.default)(a),m=6356752.314245,b=1/298.257223563,M=(0,i.default)(y-g),w=Math.atan((1-b)*Math.tan((0,i.default)(parseFloat(p)))),_=Math.atan((1-b)*Math.tan((0,i.default)(parseFloat(v)))),x=Math.sin(w),E=Math.cos(w),O=Math.sin(_),N=Math.cos(_),I=M,T=100;do{var j=Math.sin(I),P=Math.cos(I);if(0===(d=Math.sqrt(N*j*(N*j)+(E*O-x*N*P)*(E*O-x*N*P))))return 0;s=x*O+E*N*P,l=Math.atan2(d,s),c=s-2*x*O/(h=1-(u=E*N*j/d)*u),isNaN(c)&&(c=0);var R=b/16*h*(4+b*(4-3*h));f=I,I=M+(1-R)*b*u*(l+R*d*(c+R*s*(2*c*c-1)))}while(Math.abs(I-f)>1e-12&&--T>0);if(0===T)return NaN;var A=h*(r.earthRadius*r.earthRadius-m*m)/(m*m),S=1+A/16384*(4096+A*(A*(320-175*A)-768)),B=A/1024*(256+A*(A*(74-47*A)-128)),k=B*d*(c+B/4*(s*(2*c*c-1)-B/6*c*(4*d*d-3)*(4*c*c-3))),L=m*S*(l-k);return Math.round(L/o)*o};t.default=o})),co=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return/^NNE|NE|NNW|N$/.test(t)?"N":/^ENE|E|ESE|SE$/.test(t)?"E":/^SSE|S|SSW|SW$/.test(t)?"S":/^WSW|W|WNW|NW$/.test(t)?"W":void 0};t.default=e})),po=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Ue())&&e.__esModule?e:{default:e};var i=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,r=i(t,e),a=Number(e.time)-Number(t.time),o=r/a*1e3;return o};t.default=i})),fo=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Ue())&&e.__esModule?e:{default:e};var i=function(t,e,i){return(0,n.default)(e,t)+(0,n.default)(t,i)===(0,n.default)(e,i)};t.default=i})),go=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Me()),n=i(be());function i(t){return t&&t.__esModule?t:{default:t}}var r=function(t,i){for(var r=!1,a=i.length,o=-1,s=a-1;++o<a;s=o)((0,n.default)(i[o])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(i[s])||(0,n.default)(i[s])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(i[o]))&&(0,e.default)(t)<((0,e.default)(i[s])-(0,e.default)(i[o]))*((0,n.default)(t)-(0,n.default)(i[o]))/((0,n.default)(i[s])-(0,n.default)(i[o]))+(0,e.default)(i[o])&&(r=!r);return r};t.default=r})),yo=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Pi())&&e.__esModule?e:{default:e};var i=function(t,e,i,r){return(0,n.default)(t,e,i)<r};t.default=i})),vo=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Ue())&&e.__esModule?e:{default:e};var i=function(t,e,i){return(0,n.default)(t,e)<i};t.default=i})),Mo=V((t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{!i&&null!=s.return&&s.return()}finally{if(r)throw a}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);if("Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(t,e)}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}h(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(t){if(!t.startsWith("POLYGON"))throw new Error("Invalid wkt.");return t.slice(t.indexOf("(")+2,t.indexOf(")")).split(", ").map((function(t){var n=e(t.split(" "),2),i=n[0],r=n[1];return{longitude:parseFloat(i),latitude:parseFloat(r)}}))};t.default=i})),xo=V((t=>{h(),Object.defineProperty(t,"__esModule",{value:!0});var e={computeDestinationPoint:!0,convertArea:!0,convertDistance:!0,convertSpeed:!0,decimalToSexagesimal:!0,findNearest:!0,getAreaOfPolygon:!0,getBounds:!0,getBoundsOfDistance:!0,getCenter:!0,getCenterOfBounds:!0,getCompassDirection:!0,getCoordinateKey:!0,getCoordinateKeys:!0,getDistance:!0,getDistanceFromLine:!0,getGreatCircleBearing:!0,getLatitude:!0,getLongitude:!0,getPathLength:!0,getPreciseDistance:!0,getRhumbLineBearing:!0,getRoughCompassDirection:!0,getSpeed:!0,isDecimal:!0,isPointInLine:!0,isPointInPolygon:!0,isPointNearLine:!0,isPointWithinRadius:!0,isSexagesimal:!0,isValidCoordinate:!0,isValidLatitude:!0,isValidLongitude:!0,orderByDistance:!0,sexagesimalToDecimal:!0,toDecimal:!0,toRad:!0,toDeg:!0,wktToPolygon:!0};Object.defineProperty(t,"computeDestinationPoint",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"convertArea",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"convertDistance",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"convertSpeed",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"decimalToSexagesimal",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"findNearest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"getAreaOfPolygon",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"getBounds",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"getBoundsOfDistance",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"getCenter",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"getCenterOfBounds",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"getCompassDirection",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"getCoordinateKey",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"getCoordinateKeys",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"getDistance",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"getDistanceFromLine",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"getGreatCircleBearing",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"getLatitude",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(t,"getLongitude",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(t,"getPathLength",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"getPreciseDistance",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"getRhumbLineBearing",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"getRoughCompassDirection",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(t,"getSpeed",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(t,"isDecimal",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(t,"isPointInLine",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"isPointInPolygon",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(t,"isPointNearLine",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(t,"isPointWithinRadius",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(t,"isSexagesimal",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(t,"isValidCoordinate",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(t,"isValidLatitude",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(t,"isValidLongitude",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"orderByDistance",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(t,"sexagesimalToDecimal",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(t,"toDecimal",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(t,"toRad",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(t,"toDeg",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(t,"wktToPolygon",{enumerable:!0,get:function(){return G.default}});var n=V(La()),i=V(Da()),r=V(Ba()),a=V(Ea()),o=V(Ca()),s=V(ka()),l=V(ja()),u=V(Ni()),c=V($a()),d=V(Wa()),f=V(Ka()),p=V(Qa()),g=V(At()),v=V(An()),y=V(Ue()),m=V(Pi()),b=V(io()),M=V(Me()),w=V(be()),_=V(ao()),x=V(lo()),E=V(Oi()),O=V(co()),N=V(po()),I=V(Lt()),T=V(fo()),j=V(go()),P=V(yo()),R=V(vo()),A=V(Dt()),S=V(yi()),B=V(pi()),k=V(hi()),L=V(wi()),D=V(Bt()),C=V(Sn()),W=V(Ae()),z=V(Ze()),G=V(Mo()),U=ie();function V(t){return t&&t.__esModule?t:{default:t}}Object.keys(U).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return U[n]}})}))})),rs=V(((t,e)=>{var n,i;h(),n=t,i=function(t){"use strict";var e="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==e&&e,n="URLSearchParams"in e,i="Symbol"in e&&"iterator"in Symbol,r="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(t){return!1}}(),a="FormData"in e,o="ArrayBuffer"in e;if(o)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function c(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function f(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function g(t){var e=new FileReader,n=p(e);return e.readAsArrayBuffer(t),n}function v(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(t){this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:r&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:a&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&r&&function(t){return t&&DataView.prototype.isPrototypeOf(t)}(t)?(this._bodyArrayBuffer=v(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(t)||l(t))?this._bodyArrayBuffer=v(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(g)}),this.text=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,n=p(e);return e.readAsText(t),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),i=0;i<e.length;i++)n[i]=String.fromCharCode(e[i]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(M)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(t,e){t=u(t),e=h(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},d.prototype.delete=function(t){delete this.map[u(t)]},d.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},d.prototype.set=function(t,e){this.map[u(t)]=h(e)},d.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},d.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),c(t)},d.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),c(t)},d.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),c(t)},i&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(t,e){if(!(this instanceof b))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(e=e||{}).body;if(t instanceof b){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,!n&&null!=t._bodyInit&&(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new d(e.headers)),this.method=function(t){var e=t.toUpperCase();return m.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var i=/([?&])_=[^&]*/;i.test(this.url)?this.url=this.url.replace(i,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function M(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),i=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(r))}})),e}function w(t){var e=new d;return t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var n=t.split(":"),i=n.shift().trim();if(i){var r=n.join(":").trim();e.append(i,r)}})),e}function _(t,e){if(!(this instanceof _))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},y.call(b.prototype),y.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},_.error=function(){var t=new _(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];_.redirect=function(t,e){if(-1===x.indexOf(e))throw new RangeError("Invalid status code");return new _(null,{status:e,headers:{location:t}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(n,i){return new Promise((function(a,s){var l=new b(n,i);if(l.signal&&l.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function c(){u.abort()}u.onload=function(){var t={status:u.status,statusText:u.statusText,headers:w(u.getAllResponseHeaders()||"")};t.url="responseURL"in u?u.responseURL:t.headers.get("X-Request-URL");var e="response"in u?u.response:u.responseText;setTimeout((function(){a(new _(e,t))}),0)},u.onerror=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},u.ontimeout=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},u.onabort=function(){setTimeout((function(){s(new t.DOMException("Aborted","AbortError"))}),0)},u.open(l.method,function(t){try{return""===t&&e.location.href?e.location.href:t}catch(e){return t}}(l.url),!0),"include"===l.credentials?u.withCredentials=!0:"omit"===l.credentials&&(u.withCredentials=!1),"responseType"in u&&(r?u.responseType="blob":o&&l.headers.get("Content-Type")&&-1!==l.headers.get("Content-Type").indexOf("application/octet-stream")&&(u.responseType="arraybuffer")),!i||"object"!=typeof i.headers||i.headers instanceof d?l.headers.forEach((function(t,e){u.setRequestHeader(e,t)})):Object.getOwnPropertyNames(i.headers).forEach((function(t){u.setRequestHeader(t,h(i.headers[t]))})),l.signal&&(l.signal.addEventListener("abort",c),u.onreadystatechange=function(){4===u.readyState&&l.signal.removeEventListener("abort",c)}),u.send(void 0===l._bodyInit?null:l._bodyInit)}))}E.polyfill=!0,e.fetch||(e.fetch=E,e.Headers=d,e.Request=b,e.Response=_),t.Headers=d,t.Request=b,t.Response=_,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?i(t):"function"==typeof define&&define.amd?define(["exports"],i):i(n.WHATWGFetch={})})),as=V(((t,e)=>{h(),rs(),e.exports=self.fetch.bind(self)})),Us={};function ea(t,e){return!e&&"function"==typeof t&&(e=t,t={}),this.ondata=e,t}function Ps(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),wt(t,e,[xt],(function(t){return We(Mn(t.data[0],t.data[1]))}),0,n)}function Mn(t,e){return nt(t,e||{},0,0)}function na(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),wt(t,e,[bt],(function(t){return We(It(t.data[0],Wi(t.data[1])))}),1,n)}function It(t,e){return vn(t,e)}function Zd(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),wt(t,e,[xt,xs,function(){return[ia]}],(function(t){return We(ia(t.data[0],t.data[1]))}),2,n)}function ia(t,e){e||(e={});var n=Mt(),i=t.length;n.p(t);var r=nt(t,e,Yi(e),8),a=r.length;return Xi(r,e),W(r,a-8,n.d()),W(r,a-4,i),r}function Ls(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),wt(t,e,[bt,ws,function(){return[ii]}],(function(t){return We(ii(t.data[0]))}),3,n)}function ii(t,e){return vn(t.subarray(Zi(t),-8),e||new z(Ns(t)))}function Qd(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),wt(t,e,[xt,Ts,function(){return[oa]}],(function(t){return We(oa(t.data[0],t.data[1]))}),4,n)}function oa(t,e){e||(e={});var n=Ji();n.p(t);var i=nt(t,e,2,4);return Qi(i,e),W(i,i.length-4,n.d()),i}function Bs(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),wt(t,e,[bt,Is,function(){return[oi]}],(function(t){return We(oi(t.data[0],Wi(t.data[1])))}),5,n)}function oi(t,e){return vn((Os(t),t.subarray(2,-4)),e)}function tp(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),31==t[0]&&139==t[1]&&8==t[2]?Ls(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?na(t,e,n):Bs(t,e,n)}function np(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?ii(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?It(t,e):oi(t,e)}function Ke(t,e){if(e){for(var n=new z(t.length),i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}if(Ss)return Ss.encode(t);var r=t.length,a=new z(t.length+(t.length>>1)),o=0,s=function(t){a[o++]=t};for(i=0;i<r;++i){if(o+5>a.length){var l=new z(o+8+(r-i<<1));l.set(a),a=l}var u=t.charCodeAt(i);u<128||e?s(u):u<2048?(s(192|u>>6),s(128|63&u)):u>55295&&u<57344?(s(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++i))>>18),s(128|u>>12&63),s(128|u>>6&63),s(128|63&u)):(s(224|u>>12),s(128|u>>6&63),s(128|63&u))}return Ie(a,0,o)}function la(t,e){if(e){for(var n="",i=0;i<t.length;i+=16384)n+=String.fromCharCode.apply(null,t.subarray(i,i+16384));return n}if(ua)return ua.decode(t);var r=Cs(t),a=r[0];return r[1].length&&C(8),a}function up(t,e,n){n||(n=e,e={}),"function"!=typeof n&&C(7);var i={};sa(t,"",i,e);var r=Object.keys(i),a=r.length,o=0,s=0,l=a,u=new Array(a),h=[],c=function(){for(var t=0;t<h.length;++t)h[t]()},d=function(t,e){si((function(){n(t,e)}))};si((function(){d=n}));var f=function(){var t=new z(s+22),e=o,n=s-o;s=0;for(var i=0;i<l;++i){var r=u[i];try{var a=r.c.length;Nt(t,s,r,r.f,r.u,a);var h=30+r.f.length+Xe(r.extra),c=s+h;t.set(r.c,c),Nt(t,o,r,r.f,r.u,a,s,r.m),o+=16+h+(r.m?r.m.length:0),s=c+a}catch(t){return d(t,null)}}ca(t,o,u.length,n,e),d(null,t)};a||f();for(var p=function(t){var e=r[t],n=i[e],l=n[0],p=n[1],g=Mt(),v=l.length;g.p(l);var y=Ke(e),m=y.length,b=p.comment,M=b&&Ke(b),w=M&&M.length,_=Xe(p.extra),x=0==p.level?0:8,E=function(n,i){if(n)c(),d(n,null);else{var r=i.length;u[t]=mn(p,{size:v,crc:g.d(),c:i,f:y,m:M,u:m!=e.length||M&&b.length!=w,compression:x}),o+=30+m+_+r,s+=76+2*(m+_)+(w||0)+r,--a||f()}};if(m>65535&&E(C(11,0,1),null),x)if(v<16e4)try{E(null,Mn(l,p))}catch(t){E(t,null)}else h.push(Ps(l,p,E));else E(null,l)},g=0;g<l;++g)p(g);return c}function lp(t,e){e||(e={});var n={},i=[];sa(t,"",n,e);var r=0,a=0;for(var o in n){var s=n[o],l=s[0],u=s[1],h=0==u.level?0:8,c=(x=Ke(o)).length,d=u.comment,f=d&&Ke(d),p=f&&f.length,g=Xe(u.extra);c>65535&&C(11);var v=h?Mn(l,u):l,y=v.length,m=Mt();m.p(l),i.push(mn(u,{size:l.length,crc:m.d(),c:v,f:x,m:f,u:c!=o.length||f&&d.length!=p,o:r,compression:h})),r+=30+c+g+y,a+=76+2*(c+g)+(p||0)+y}for(var b=new z(a+22),M=r,w=a-r,_=0;_<i.length;++_){var x=i[_];Nt(b,x.o,x,x.f,x.u,x.c.length);var E=30+x.f.length+Xe(x.extra);b.set(x.c,x.o+E),Nt(b,r,x,x.f,x.u,x.c.length,x.o,x.m),r+=16+E+(x.m?x.m.length:0)}return ca(b,r,i.length,w,M),b}function fp(t,e,n){n||(n=e,e={}),"function"!=typeof n&&C(7);var i=[],r=function(){for(var t=0;t<i.length;++t)i[t]()},a={},o=function(t,e){si((function(){n(t,e)}))};si((function(){o=n}));for(var s=t.length-22;101010256!=Q(t,s);--s)if(!s||t.length-s>65558)return o(C(13,0,1),null),r;var l=de(t,s+8);if(l){var u=l,h=Q(t,s+16),c=4294967295==h;if(c){if(s=Q(t,s-12),101075792!=Q(t,s))return o(C(13,0,1),null),r;u=l=Q(t,s+32),h=Q(t,s+48)}for(var d=e&&e.filter,f=function(e){var n=Vs(t,h,c),s=n[0],u=n[1],f=n[2],p=n[3],g=n[4],v=n[5],y=Gs(t,v);h=g;var m=function(t,e){t?(r(),o(t,null)):(e&&(a[p]=e),--l||o(null,a))};if(!d||d({name:p,size:u,originalSize:f,compression:s}))if(s)if(8==s){var b=t.subarray(y,y+u);if(u<32e4)try{m(null,It(b,new z(f)))}catch(t){m(t,null)}else i.push(na(b,{size:f},m))}else m(C(14,"unknown compression type "+s,1),null);else m(null,Ie(t,y,y+u));else m(null,null)},p=0;p<u;++p)f()}else o(null,{});return r}function hp(t,e){for(var n={},i=t.length-22;101010256!=Q(t,i);--i)(!i||t.length-i>65558)&&C(13);var r=de(t,i+8);if(!r)return{};var a=Q(t,i+16),o=4294967295==a;o&&(i=Q(t,i-12),101075792!=Q(t,i)&&C(13),r=Q(t,i+32),a=Q(t,i+48));for(var s=e&&e.filter,l=0;l<r;++l){var u=Vs(t,a,o),h=u[0],c=u[1],d=u[2],f=u[3],p=u[4],g=u[5],v=Gs(t,g);a=p,(!s||s({name:f,size:c,originalSize:d,compression:h}))&&(h?8==h?n[f]=It(t.subarray(v,v+c),new z(d)):C(14,"unknown compression type "+h):n[f]=Ie(t,v,v+c))}return n}Qs(Us,{AsyncCompress:()=>Xd,AsyncDecompress:()=>ep,AsyncDeflate:()=>_s,AsyncGunzip:()=>As,AsyncGzip:()=>Xd,AsyncInflate:()=>ta,AsyncUnzipInflate:()=>dp,AsyncUnzlib:()=>Ds,AsyncZipDeflate:()=>op,AsyncZlib:()=>Yd,Compress:()=>ra,DecodeUTF8:()=>rp,Decompress:()=>Es,Deflate:()=>Re,EncodeUTF8:()=>ip,FlateErrorCode:()=>Wd,Gunzip:()=>ri,Gzip:()=>ra,Inflate:()=>ge,Unzip:()=>pp,UnzipInflate:()=>cp,UnzipPassThrough:()=>Fs,Unzlib:()=>ai,Zip:()=>sp,ZipDeflate:()=>ap,ZipPassThrough:()=>bn,Zlib:()=>aa,compress:()=>Zd,compressSync:()=>ia,decompress:()=>tp,decompressSync:()=>np,deflate:()=>Ps,deflateSync:()=>Mn,gunzip:()=>Ls,gunzipSync:()=>ii,gzip:()=>Zd,gzipSync:()=>ia,inflate:()=>na,inflateSync:()=>It,strFromU8:()=>la,strToU8:()=>Ke,unzip:()=>fp,unzipSync:()=>hp,unzlib:()=>Bs,unzlibSync:()=>oi,zip:()=>up,zipSync:()=>lp,zlib:()=>Qd,zlibSync:()=>oa});var os,Jd,z,oe,ft,ht,gt,hn,ss,us,ji,Xr,ls,cs,zi,gn,Ve,we,ke,yt,H,ds,ps,fs,hs,Zr,Te,Yr,yn,Ie,Wd,gs,C,vn,Se,vt,Qr,ei,$i,mt,ti,Hi,ys,Fe,vs,ms,Mt,Ji,nt,mn,Ms,ni,Kd,bs,bt,xt,xs,ws,Ts,Is,We,Wi,wt,Ne,Tt,de,Q,Ki,W,Xi,Zi,Ns,Yi,Qi,Os,Re,_s,ge,ta,ra,Xd,ri,As,aa,Yd,ai,Ds,Es,ep,sa,Ss,ua,Rs,Cs,rp,ip,qs,Gs,Vs,ks,Xe,Nt,ca,bn,ap,op,sp,Fs,cp,dp,pp,si,js=ya((()=>{for(h(),os={},Jd=function(t,e,n,i,r){var a=new Worker(os[e]||(os[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(t){var e=t.data,n=e.$e$;if(n){var i=new Error(n[0]);i.code=n[1],i.stack=n[2],r(i,null)}else r(null,e)},a.postMessage(n,i),a},z=Uint8Array,oe=Uint16Array,ft=Uint32Array,ht=new z([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),gt=new z([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),hn=new z([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),us=(ss=function(t,e){for(var n=new oe(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];var r=new ft(n[30]);for(i=1;i<30;++i)for(var a=n[i];a<n[i+1];++a)r[a]=a-n[i]<<5|i;return[n,r]})(ht,2),ji=us[0],Xr=us[1],ji[28]=258,Xr[258]=28,ls=ss(gt,0),cs=ls[0],zi=ls[1],gn=new oe(32768),H=0;H<32768;++H)Ve=(61680&(Ve=(52428&(Ve=(43690&H)>>>1|(21845&H)<<1))>>>2|(13107&Ve)<<2))>>>4|(3855&Ve)<<4,gn[H]=((65280&Ve)>>>8|(255&Ve)<<8)>>>1;for(we=function(t,e,n){for(var i=t.length,r=0,a=new oe(e);r<i;++r)t[r]&&++a[t[r]-1];var o,s=new oe(e);for(r=0;r<e;++r)s[r]=s[r-1]+a[r-1]<<1;if(n){o=new oe(1<<e);var l=15-e;for(r=0;r<i;++r)if(t[r])for(var u=r<<4|t[r],h=e-t[r],c=s[t[r]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)o[gn[c]>>>l]=u}else for(o=new oe(i),r=0;r<i;++r)t[r]&&(o[r]=gn[s[t[r]-1]++]>>>15-t[r]);return o},ke=new z(288),H=0;H<144;++H)ke[H]=8;for(H=144;H<256;++H)ke[H]=9;for(H=256;H<280;++H)ke[H]=7;for(H=280;H<288;++H)ke[H]=8;for(yt=new z(32),H=0;H<32;++H)yt[H]=5;ds=we(ke,9,0),ps=we(ke,9,1),fs=we(yt,5,0),hs=we(yt,5,1),Zr=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},Te=function(t,e,n){var i=e/8|0;return(t[i]|t[i+1]<<8)>>(7&e)&n},Yr=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},yn=function(t){return(t+7)/8|0},Ie=function(t,e,n){(null==e||e<0)&&(e=0),(null==n||n>t.length)&&(n=t.length);var i=new(2==t.BYTES_PER_ELEMENT?oe:4==t.BYTES_PER_ELEMENT?ft:z)(n-e);return i.set(t.subarray(e,n)),i},Wd={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},gs=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],C=function(t,e,n){var i=new Error(e||gs[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,C),!n)throw i;return i},vn=function(t,e,n){var i=t.length;if(!i||n&&n.f&&!n.l)return e||new z(0);var r=!e||n,a=!n||n.i;n||(n={}),e||(e=new z(3*i));var o=function(t){var n=e.length;if(t>n){var i=new z(Math.max(2*n,t));i.set(e),e=i}},s=n.f||0,l=n.p||0,u=n.b||0,h=n.l,c=n.d,d=n.m,f=n.n,p=8*i;do{if(!h){s=Te(t,l,1);var g=Te(t,l+1,3);if(l+=3,!g){var v=t[(I=yn(l)+4)-4]|t[I-3]<<8,y=I+v;if(y>i){a&&C(0);break}r&&o(u+v),e.set(t.subarray(I,y),u),n.b=u+=v,n.p=l=8*y,n.f=s;continue}if(1==g)h=ps,c=hs,d=9,f=5;else if(2==g){var m=Te(t,l,31)+257,b=Te(t,l+10,15)+4,M=m+Te(t,l+5,31)+1;l+=14;for(var w=new z(M),_=new z(19),x=0;x<b;++x)_[hn[x]]=Te(t,l+3*x,7);l+=3*b;var E=Zr(_),O=(1<<E)-1,N=we(_,E,1);for(x=0;x<M;){var I,T=N[Te(t,l,O)];if(l+=15&T,(I=T>>>4)<16)w[x++]=I;else{var j=0,P=0;for(16==I?(P=3+Te(t,l,3),l+=2,j=w[x-1]):17==I?(P=3+Te(t,l,7),l+=3):18==I&&(P=11+Te(t,l,127),l+=7);P--;)w[x++]=j}}var R=w.subarray(0,m),A=w.subarray(m);d=Zr(R),f=Zr(A),h=we(R,d,1),c=we(A,f,1)}else C(1);if(l>p){a&&C(0);break}}r&&o(u+131072);for(var S=(1<<d)-1,B=(1<<f)-1,k=l;;k=l){var L=(j=h[Yr(t,l)&S])>>>4;if((l+=15&j)>p){a&&C(0);break}if(j||C(2),L<256)e[u++]=L;else{if(256==L){k=l,h=null;break}var D=L-254;if(L>264){var W=ht[x=L-257];D=Te(t,l,(1<<W)-1)+ji[x],l+=W}var G=c[Yr(t,l)&B],U=G>>>4;G||C(3),l+=15&G;A=cs[U];if(U>3){W=gt[U];A+=Yr(t,l)&(1<<W)-1,l+=W}if(l>p){a&&C(0);break}r&&o(u+131072);for(var V=u+D;u<V;u+=4)e[u]=e[u-A],e[u+1]=e[u+1-A],e[u+2]=e[u+2-A],e[u+3]=e[u+3-A];u=V}}n.l=h,n.p=k,n.b=u,n.f=s,h&&(s=1,n.m=d,n.d=c,n.n=f)}while(!s);return u==e.length?e:Ie(e,0,u)},Se=function(t,e,n){n<<=7&e;var i=e/8|0;t[i]|=n,t[i+1]|=n>>>8},vt=function(t,e,n){n<<=7&e;var i=e/8|0;t[i]|=n,t[i+1]|=n>>>8,t[i+2]|=n>>>16},Qr=function(t,e){for(var n=[],i=0;i<t.length;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,a=n.slice();if(!r)return[Fe,0];if(1==r){var o=new z(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(t,e){return t.f-e.f})),n.push({s:-1,f:25001});var s=n[0],l=n[1],u=0,h=1,c=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};h!=r-1;)s=n[n[u].f<n[c].f?u++:c++],l=n[u!=h&&n[u].f<n[c].f?u++:c++],n[h++]={s:-1,f:s.f+l.f,l:s,r:l};var d=a[0].s;for(i=1;i<r;++i)a[i].s>d&&(d=a[i].s);var f=new oe(d+1),p=ei(n[h-1],f,0);if(p>e){i=0;var g=0,v=p-e,y=1<<v;for(a.sort((function(t,e){return f[e.s]-f[t.s]||t.f-e.f}));i<r;++i){var m=a[i].s;if(!(f[m]>e))break;g+=y-(1<<p-f[m]),f[m]=e}for(g>>>=v;g>0;){var b=a[i].s;f[b]<e?g-=1<<e-f[b]++-1:++i}for(;i>=0&&g;--i){var M=a[i].s;f[M]==e&&(--f[M],++g)}p=e}return[new z(f),p]},ei=function(t,e,n){return-1==t.s?Math.max(ei(t.l,e,n+1),ei(t.r,e,n+1)):e[t.s]=n},$i=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new oe(++e),i=0,r=t[0],a=1,o=function(t){n[i++]=t},s=1;s<=e;++s)if(t[s]==r&&s!=e)++a;else{if(!r&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(r),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(r);a=1,r=t[s]}return[n.subarray(0,i),e]},mt=function(t,e){for(var n=0,i=0;i<e.length;++i)n+=t[i]*e[i];return n},ti=function(t,e,n){var i=n.length,r=yn(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var a=0;a<i;++a)t[r+a+4]=n[a];return 8*(r+4+i)},Hi=function(t,e,n,i,r,a,o,s,l,u,h){Se(e,h++,n),++r[256];for(var c=Qr(r,15),d=c[0],f=c[1],p=Qr(a,15),g=p[0],v=p[1],y=$i(d),m=y[0],b=y[1],M=$i(g),w=M[0],_=M[1],x=new oe(19),E=0;E<m.length;++E)x[31&m[E]]++;for(E=0;E<w.length;++E)x[31&w[E]]++;for(var O=Qr(x,7),N=O[0],I=O[1],T=19;T>4&&!N[hn[T-1]];--T);var j,P,R,A,S=u+5<<3,B=mt(r,ke)+mt(a,yt)+o,k=mt(r,d)+mt(a,g)+o+14+3*T+mt(x,N)+(2*x[16]+3*x[17]+7*x[18]);if(S<=B&&S<=k)return ti(e,h,t.subarray(l,l+u));if(Se(e,h,1+(k<B)),h+=2,k<B){j=we(d,f,0),P=d,R=we(g,v,0),A=g;var L=we(N,I,0);Se(e,h,b-257),Se(e,h+5,_-1),Se(e,h+10,T-4),h+=14;for(E=0;E<T;++E)Se(e,h+3*E,N[hn[E]]);h+=3*T;for(var D=[m,w],C=0;C<2;++C){var W=D[C];for(E=0;E<W.length;++E){var z=31&W[E];Se(e,h,L[z]),h+=N[z],z>15&&(Se(e,h,W[E]>>>5&127),h+=W[E]>>>12)}}}else j=ds,P=ke,R=fs,A=yt;for(E=0;E<s;++E)if(i[E]>255){z=i[E]>>>18&31;vt(e,h,j[z+257]),h+=P[z+257],z>7&&(Se(e,h,i[E]>>>23&31),h+=ht[z]);var G=31&i[E];vt(e,h,R[G]),h+=A[G],G>3&&(vt(e,h,i[E]>>>5&8191),h+=gt[G])}else vt(e,h,j[i[E]]),h+=P[i[E]];return vt(e,h,j[256]),h+P[256]},ys=new ft([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Fe=new z(0),vs=function(t,e,n,i,r,a){var o=t.length,s=new z(i+o+5*(1+Math.ceil(o/7e3))+r),l=s.subarray(i,s.length-r),u=0;if(!e||o<8)for(var h=0;h<=o;h+=65535){var c=h+65535;c>=o&&(l[u>>3]=a),u=ti(l,u+1,t.subarray(h,c))}else{for(var d=ys[e-1],f=d>>>13,p=8191&d,g=(1<<n)-1,v=new oe(32768),y=new oe(g+1),m=Math.ceil(n/3),b=2*m,M=function(e){return(t[e]^t[e+1]<<m^t[e+2]<<b)&g},w=new ft(25e3),_=new oe(288),x=new oe(32),E=0,O=0,N=(h=0,0),I=0,T=0;h<o;++h){var j=M(h),P=32767&h,R=y[j];if(v[P]=R,y[j]=P,I<=h){var A=o-h;if((E>7e3||N>24576)&&A>423){u=Hi(t,l,0,w,_,x,O,N,T,h-T,u),N=E=O=0,T=h;for(var S=0;S<286;++S)_[S]=0;for(S=0;S<30;++S)x[S]=0}var B=2,k=0,L=p,D=P-R&32767;if(A>2&&j==M(h-D))for(var C=Math.min(f,A)-1,W=Math.min(32767,h),G=Math.min(258,A);D<=W&&--L&&P!=R;){if(t[h+B]==t[h+B-D]){for(var U=0;U<G&&t[h+U]==t[h+U-D];++U);if(U>B){if(B=U,k=D,U>C)break;var V=Math.min(D,U-2),F=0;for(S=0;S<V;++S){var $=h-D+S+32768&32767,H=$-v[$]+32768&32767;H>F&&(F=H,R=$)}}}D+=(P=R)-(R=v[P])+32768&32767}if(k){w[N++]=268435456|Xr[B]<<18|zi[k];var X=31&Xr[B],q=31&zi[k];O+=ht[X]+gt[q],++_[257+X],++x[q],I=h+B,++E}else w[N++]=t[h],++_[t[h]]}}u=Hi(t,l,a,w,_,x,O,N,T,h-T,u),!a&&7&u&&(u=ti(l,u+1,Fe))}return Ie(s,0,i+yn(u)+r)},ms=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,i=9;--i;)n=(1&n&&-306674912)^n>>>1;t[e]=n}return t}(),Mt=function(){var t=-1;return{p:function(e){for(var n=t,i=0;i<e.length;++i)n=ms[255&n^e[i]]^n>>>8;t=n},d:function(){return~t}}},Ji=function(){var t=1,e=0;return{p:function(n){for(var i=t,r=e,a=0|n.length,o=0;o!=a;){for(var s=Math.min(o+2655,a);o<s;++o)r+=i+=n[o];i=(65535&i)+15*(i>>16),r=(65535&r)+15*(r>>16)}t=i,e=r},d:function(){return(255&(t%=65521))<<24|t>>>8<<16|(255&(e%=65521))<<8|e>>>8}}},nt=function(t,e,n,i,r){return vs(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,i,!r)},mn=function(t,e){var n={};for(var i in t)n[i]=t[i];for(var i in e)n[i]=e[i];return n},Ms=function(t,e,n){for(var i=t(),r=t.toString(),a=r.slice(r.indexOf("[")+1,r.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<i.length;++o){var s=i[o],l=a[o];if("function"==typeof s){e+=";"+l+"=";var u=s.toString();if(s.prototype)if(-1!=u.indexOf("[native code]")){var h=u.indexOf(" ",8)+1;e+=u.slice(h,u.indexOf("(",h))}else for(var c in e+=u,s.prototype)e+=";"+l+".prototype."+c+"="+s.prototype[c].toString();else e+=u}else n[l]=s}return[e,n]},ni=[],Kd=function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},bs=function(t,e,n,i){var r;if(!ni[n]){for(var a="",o={},s=t.length-1,l=0;l<s;++l)a=(r=Ms(t[l],a,o))[0],o=r[1];ni[n]=Ms(t[s],a,o)}var u=mn({},ni[n][1]);return Jd(ni[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,Kd(u),i)},bt=function(){return[z,oe,ft,ht,gt,hn,ji,cs,ps,hs,gn,gs,we,Zr,Te,Yr,yn,Ie,C,vn,It,We,Wi]},xt=function(){return[z,oe,ft,ht,gt,hn,Xr,zi,ds,ke,fs,yt,gn,ys,Fe,we,Se,vt,Qr,ei,$i,mt,ti,Hi,yn,Ie,vs,nt,Mn,We]},xs=function(){return[Xi,Yi,W,Mt,ms]},ws=function(){return[Zi,Ns]},Ts=function(){return[Qi,W,Ji]},Is=function(){return[Os]},We=function(t){return postMessage(t,[t.buffer])},Wi=function(t){return t&&t.size&&new z(t.size)},wt=function(t,e,n,i,r,a){var o=bs(n,i,r,(function(t,e){o.terminate(),a(t,e)}));return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}},Ne=function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){return t.push(e.data[0],e.data[1])}},Tt=function(t,e,n,i,r){var a,o=bs(t,i,r,(function(t,n){t?(o.terminate(),e.ondata.call(e,t)):(n[1]&&o.terminate(),e.ondata.call(e,t,n[0],n[1]))}));o.postMessage(n),e.push=function(t,n){e.ondata||C(5),a&&e.ondata(C(4,0,1),null,!!n),o.postMessage([t,a=n],[t.buffer])},e.terminate=function(){o.terminate()}},de=function(t,e){return t[e]|t[e+1]<<8},Q=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},Ki=function(t,e){return Q(t,e)+4294967296*Q(t,e+4)},W=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},Xi=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&W(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var i=0;i<=n.length;++i)t[i+10]=n.charCodeAt(i)}},Zi=function(t){(31!=t[0]||139!=t[1]||8!=t[2])&&C(6,"invalid gzip data");var e=t[3],n=10;4&e&&(n+=t[10]|2+(t[11]<<8));for(var i=(e>>3&1)+(e>>4&1);i>0;i-=!t[n++]);return n+(2&e)},Ns=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},Yi=function(t){return 10+(t.filename&&t.filename.length+1||0)},Qi=function(t,e){var n=e.level,i=0==n?0:n<6?1:9==n?3:2;t[0]=120,t[1]=i<<6|(i?32-2*i:1)},Os=function(t){(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&C(6,"invalid zlib data"),32&t[1]&&C(6,"invalid zlib data: preset dictionaries not supported")},Re=function(){function t(t,e){!e&&"function"==typeof t&&(e=t,t={}),this.ondata=e,this.o=t||{}}return t.prototype.p=function(t,e){this.ondata(nt(t,this.o,0,0,!e),e)},t.prototype.push=function(t,e){this.ondata||C(5),this.d&&C(4),this.d=e,this.p(t,e||!1)},t}(),_s=function(t,e){Tt([xt,function(){return[Ne,Re]}],this,ea.call(this,t,e),(function(t){var e=new Re(t.data);onmessage=Ne(e)}),6)},ge=function(){function t(t){this.s={},this.p=new z(0),this.ondata=t}return t.prototype.e=function(t){this.ondata||C(5),this.d&&C(4);var e=this.p.length,n=new z(e+t.length);n.set(this.p),n.set(t,e),this.p=n},t.prototype.c=function(t){this.d=this.s.i=t||!1;var e=this.s.b,n=vn(this.p,this.o,this.s);this.ondata(Ie(n,e,this.s.b),this.d),this.o=Ie(n,this.s.b-32768),this.s.b=this.o.length,this.p=Ie(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}(),ta=function(t){this.ondata=t,Tt([bt,function(){return[Ne,ge]}],this,0,(function(){var t=new ge;onmessage=Ne(t)}),7)},ra=function(){function t(t,e){this.c=Mt(),this.l=0,this.v=1,Re.call(this,t,e)}return t.prototype.push=function(t,e){Re.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var n=nt(t,this.o,this.v&&Yi(this.o),e&&8,!e);this.v&&(Xi(n,this.o),this.v=0),e&&(W(n,n.length-8,this.c.d()),W(n,n.length-4,this.l)),this.ondata(n,e)},t}(),Xd=function(t,e){Tt([xt,xs,function(){return[Ne,Re,ra]}],this,ea.call(this,t,e),(function(t){var e=new ra(t.data);onmessage=Ne(e)}),8)},ri=function(){function t(t){this.v=1,ge.call(this,t)}return t.prototype.push=function(t,e){if(ge.prototype.e.call(this,t),this.v){var n=this.p.length>3?Zi(this.p):4;if(n>=this.p.length&&!e)return;this.p=this.p.subarray(n),this.v=0}e&&(this.p.length<8&&C(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),ge.prototype.c.call(this,e)},t}(),As=function(t){this.ondata=t,Tt([bt,ws,function(){return[Ne,ge,ri]}],this,0,(function(){var t=new ri;onmessage=Ne(t)}),9)},aa=function(){function t(t,e){this.c=Ji(),this.v=1,Re.call(this,t,e)}return t.prototype.push=function(t,e){Re.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t);var n=nt(t,this.o,this.v&&2,e&&4,!e);this.v&&(Qi(n,this.o),this.v=0),e&&W(n,n.length-4,this.c.d()),this.ondata(n,e)},t}(),Yd=function(t,e){Tt([xt,Ts,function(){return[Ne,Re,aa]}],this,ea.call(this,t,e),(function(t){var e=new aa(t.data);onmessage=Ne(e)}),10)},ai=function(){function t(t){this.v=1,ge.call(this,t)}return t.prototype.push=function(t,e){if(ge.prototype.e.call(this,t),this.v){if(this.p.length<2&&!e)return;this.p=this.p.subarray(2),this.v=0}e&&(this.p.length<4&&C(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),ge.prototype.c.call(this,e)},t}(),Ds=function(t){this.ondata=t,Tt([bt,Is,function(){return[Ne,ge,ai]}],this,0,(function(){var t=new ai;onmessage=Ne(t)}),11)},Es=function(){function t(t){this.G=ri,this.I=ge,this.Z=ai,this.ondata=t}return t.prototype.push=function(t,e){if(this.ondata||C(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new z(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length)}else this.p=t;if(this.p.length>2){var i=this,r=function(){i.ondata.apply(i,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(r):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(r):new this.Z(r),this.s.push(this.p,e),this.p=null}}},t}(),ep=function(){function t(t){this.G=As,this.I=ta,this.Z=Ds,this.ondata=t}return t.prototype.push=function(t,e){Es.prototype.push.call(this,t,e)},t}(),sa=function(t,e,n,i){for(var r in t){var a=t[r],o=e+r,s=i;Array.isArray(a)&&(s=mn(i,a[1]),a=a[0]),a instanceof z?n[o]=[a,s]:(n[o+="/"]=[new z(0),s],sa(a,o,n,i))}},Ss="undefined"!=typeof TextEncoder&&new TextEncoder,ua="undefined"!=typeof TextDecoder&&new TextDecoder,Rs=0;try{ua.decode(Fe,{stream:!0}),Rs=1}catch(t){}Cs=function(t){for(var e="",n=0;;){var i=t[n++],r=(i>127)+(i>223)+(i>239);if(n+r>t.length)return[e,Ie(t,n-1)];r?3==r?(i=((15&i)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,e+=String.fromCharCode(55296|i>>10,56320|1023&i)):e+=1&r?String.fromCharCode((31&i)<<6|63&t[n++]):String.fromCharCode((15&i)<<12|(63&t[n++])<<6|63&t[n++]):e+=String.fromCharCode(i)}},rp=function(){function t(t){this.ondata=t,Rs?this.t=new TextDecoder:this.p=Fe}return t.prototype.push=function(t,e){if(this.ondata||C(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&C(8),this.t=null));this.p||C(4);var n=new z(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var i=Cs(n),r=i[0],a=i[1];e?(a.length&&C(8),this.p=null):this.p=a,this.ondata(r,e)},t}(),ip=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){this.ondata||C(5),this.d&&C(4),this.ondata(Ke(t),this.d=e||!1)},t}(),qs=function(t){return 1==t?3:t<6?2:9==t?1:0},Gs=function(t,e){return e+30+de(t,e+26)+de(t,e+28)},Vs=function(t,e,n){var i=de(t,e+28),r=la(t.subarray(e+46,e+46+i),!(2048&de(t,e+8))),a=e+46+i,o=Q(t,e+20),s=n&&4294967295==o?ks(t,a):[o,Q(t,e+24),Q(t,e+42)],l=s[0],u=s[1],h=s[2];return[de(t,e+10),l,u,r,a+de(t,e+30)+de(t,e+32),h]},ks=function(t,e){for(;1!=de(t,e);e+=4+de(t,e+2));return[Ki(t,e+12),Ki(t,e+4),Ki(t,e+20)]},Xe=function(t){var e=0;if(t)for(var n in t){var i=t[n].length;i>65535&&C(9),e+=i+4}return e},Nt=function(t,e,n,i,r,a,o,s){var l=i.length,u=n.extra,h=s&&s.length,c=Xe(u);W(t,e,null!=o?33639248:67324752),e+=4,null!=o&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(null==a&&8),t[e++]=r&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var d=new Date(null==n.mtime?Date.now():n.mtime),f=d.getFullYear()-1980;if((f<0||f>119)&&C(10),W(t,e,f<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>>1),e+=4,null!=a&&(W(t,e,n.crc),W(t,e+4,a),W(t,e+8,n.size)),W(t,e+12,l),W(t,e+14,c),e+=16,null!=o&&(W(t,e,h),W(t,e+6,n.attrs),W(t,e+10,o),e+=14),t.set(i,e),e+=l,c)for(var p in u){var g=u[p],v=g.length;W(t,e,+p),W(t,e+2,v),t.set(g,e+4),e+=4+v}return h&&(t.set(s,e),e+=h),e},ca=function(t,e,n,i,r){W(t,e,101010256),W(t,e+8,n),W(t,e+10,n),W(t,e+12,i),W(t,e+16,r)},bn=function(){function t(t){this.filename=t,this.c=Mt(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){this.ondata||C(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}(),ap=function(){function t(t,e){var n=this;e||(e={}),bn.call(this,t),this.d=new Re(e,(function(t,e){n.ondata(null,t,e)})),this.compression=8,this.flag=qs(e.level)}return t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},t.prototype.push=function(t,e){bn.prototype.push.call(this,t,e)},t}(),op=function(){function t(t,e){var n=this;e||(e={}),bn.call(this,t),this.d=new _s(e,(function(t,e,i){n.ondata(t,e,i)})),this.compression=8,this.flag=qs(e.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){bn.prototype.push.call(this,t,e)},t}(),sp=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(this.ondata||C(5),2&this.d)this.ondata(C(4+8*(1&this.d),0,1),null,!1);else{var n=Ke(t.filename),i=n.length,r=t.comment,a=r&&Ke(r),o=i!=t.filename.length||a&&r.length!=a.length,s=i+Xe(t.extra)+30;i>65535&&this.ondata(C(11,0,1),null,!1);var l=new z(s);Nt(l,0,t,n,o);var u=[l],h=function(){for(var t=0,n=u;t<n.length;t++){var i=n[t];e.ondata(null,i,!1)}u=[]},c=this.d;this.d=0;var d=this.u.length,f=mn(t,{f:n,u:o,o:a,t:function(){t.terminate&&t.terminate()},r:function(){if(h(),c){var t=e.u[d+1];t?t.r():e.d=1}c=1}}),p=0;t.ondata=function(n,i,r){if(n)e.ondata(n,i,r),e.terminate();else if(p+=i.length,u.push(i),r){var a=new z(16);W(a,0,134695760),W(a,4,t.crc),W(a,8,p),W(a,12,t.size),u.push(a),f.c=p,f.b=s+p+16,f.crc=t.crc,f.size=t.size,c&&f.r(),c=1}else c&&h()},this.u.push(f)}},t.prototype.end=function(){var t=this;2&this.d?this.ondata(C(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){!(1&t.d)||(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3)},t.prototype.e=function(){for(var t=0,e=0,n=0,i=0,r=this.u;i<r.length;i++){n+=46+(l=r[i]).f.length+Xe(l.extra)+(l.o?l.o.length:0)}for(var a=new z(n+22),o=0,s=this.u;o<s.length;o++){var l=s[o];Nt(a,t,l,l.f,l.u,l.c,e,l.o),t+=46+l.f.length+Xe(l.extra)+(l.o?l.o.length:0),e+=l.b}ca(a,t,this.u.length,n,e),this.ondata(null,a,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++){e[t].t()}this.d=2},t}(),Fs=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}(),cp=function(){function t(){var t=this;this.i=new ge((function(e,n){t.ondata(null,e,n)}))}return t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(t){this.ondata(t,null,e)}},t.compression=8,t}(),dp=function(){function t(t,e){var n=this;e<32e4?this.i=new ge((function(t,e){n.ondata(null,t,e)})):(this.i=new ta((function(t,e,i){n.ondata(t,e,i)})),this.terminate=this.i.terminate)}return t.prototype.push=function(t,e){this.i.terminate&&(t=Ie(t,0)),this.i.push(t,e)},t.compression=8,t}(),pp=function(){function t(t){this.onfile=t,this.k=[],this.o={0:Fs},this.p=Fe}return t.prototype.push=function(t,e){var n=this;if(this.onfile||C(5),this.p||C(4),this.c>0){var i=Math.min(this.c,t.length),r=t.subarray(0,i);if(this.c-=i,this.d?this.d.push(r,!this.c):this.k[0].push(r),(t=t.subarray(i)).length)return this.push(t,e)}else{var a=0,o=0,s=void 0,l=void 0;this.p.length?t.length?((l=new z(this.p.length+t.length)).set(this.p),l.set(t,this.p.length)):l=this.p:l=t;for(var u=l.length,h=this.c,c=h&&this.d,d=function(){var t,e=Q(l,o);if(67324752==e){a=1,s=o,f.d=null,f.c=0;var i=de(l,o+6),r=de(l,o+8),c=2048&i,d=8&i,p=de(l,o+26),g=de(l,o+28);if(u>o+30+p+g){var v=[];f.k.unshift(v),a=2;var y=Q(l,o+18),m=Q(l,o+22),b=la(l.subarray(o+30,o+=30+p),!c);4294967295==y?(t=d?[-2]:ks(l,o),y=t[0],m=t[1]):d&&(y=-1),o+=g,f.c=y;var M,w={name:b,compression:r,start:function(){if(w.ondata||C(5),y){var t=n.o[r];t||w.ondata(C(14,"unknown compression type "+r,1),null,!1),(M=y<0?new t(b):new t(b,y,m)).ondata=function(t,e,n){w.ondata(t,e,n)};for(var e=0,i=v;e<i.length;e++){var a=i[e];M.push(a,!1)}n.k[0]==v&&n.c?n.d=M:M.push(Fe,!0)}else w.ondata(null,Fe,!0)},terminate:function(){M&&M.terminate&&M.terminate()}};y>=0&&(w.size=y,w.originalSize=m),f.onfile(w)}return"break"}if(h){if(134695760==e)return s=o+=12+(-2==h&&8),a=3,f.c=0,"break";if(33639248==e)return s=o-=4,a=3,f.c=0,"break"}},f=this;o<u-4;++o){if("break"===d())break}if(this.p=Fe,h<0){var p=a?l.subarray(0,s-12-(-2==h&&8)-(134695760==Q(l,s-16)&&4)):l.subarray(0,o);c?c.push(p,!!a):this.k[+(2==a)].push(p)}if(2&a)return this.push(l.subarray(o),e);this.p=l.subarray(o)}e&&(this.c&&C(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}(),si="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()}}));h();var zs=va(Ma());h(),h(),h();var To=va(xo());h();var wo=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:i=0,distance:r=0,angle:a=0}){let o,s;if(p(this,"origin"),p(this,"destination"),p(this,"vortex"),p(this,"distance"),p(this,"angle"),p(this,"weight"),this.origin=t,this.destination=e,this.vortex=n,this.distance=r,this.angle=a,n?(this.distance=0,this.angle=0,o=void 0!==n.weight&&n.weight>0?n.weight:"elevator"===n.type?2e3:1e3,s=n.multiplier&&n.multiplier>=1?n.multiplier:1,this.weight=i*s+o):(o=e.weight&&e.weight>=0?e.weight:0,s=e.multiplier&&e.multiplier>=1?e.multiplier:1,this.weight=this.distance*s+o),isNaN(this.angle))throw new Error("nan angle")}},Tr=wo;function Bd(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale||1);try{if(!t.georeference)throw new Error(`map ${t.name||t.shortName||t.id} does not have a georeference field`);if(t.georeference.length<3)throw new Error(`map ${t.name||t.shortName||t.id} has less than 3 georeference points, we require at least 3 for proper map scaling`);let e=t.georeference[0],n=t.georeference[2],i=(0,To.getDistance)({latitude:e.target.x,longitude:e.target.y},{latitude:n.target.x,longitude:n.target.y}),r=e.control.x-n.control.x,a=e.control.y-n.control.y;return Math.sqrt(r*r+a*a)/i}catch(t){return console.error(t),1}}function Ed(t,e){let n=t.x-e.x,i=t.y-e.y;return(Math.atan2(i,n)+2.5*Math.PI)%(2*Math.PI)}var te,he,je,Io=class{constructor({nodes:t,vortexes:e,maps:n,showVortexNames:i=!1}){p(this,"edges"),p(this,"nodesById"),p(this,"mapsById"),this.edges={},this.mapsById=n.map((t=>({...t,_scale:Bd(t)}))).reduce(((t,e)=>(t[e.id]=e,t)),{});let r=t.filter((t=>!!this.mapsById[t.map])).map((t=>({...t,paths:t.paths?t.paths.filter((({map:e})=>e===t.map)):[]})));this.nodesById=r.reduce(((t,e)=>(t[e.id]=e,t)),{});for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].paths=this.nodesById[t].paths.filter((({node:t})=>!!this.nodesById[t])));let a=e.map((t=>({...t,name:i?t.name:t.type,nodes:t.nodes?t.nodes.filter((t=>!!this.nodesById[t])):[]})));r.forEach((t=>{this.edges[t.id]=t.paths.map((({node:e})=>{let n=this.nodesById[e];return new Tr({angle:Ed(t,n),destination:n,distance:this.getDistance(t,n),origin:t})}))})),a.forEach((t=>{if(null==t.nodes||0===t.nodes.length)return;let e=0;for(;e<t.nodes.length-1;){let n=this.nodesById[t.nodes[e]];if(e++,null==n)continue;let i=e;for(;i<t.nodes.length;){let e=this.nodesById[t.nodes[i]];if(i++,null==e)continue;let r=this.mapsById[n.map].elevation||0,a=this.mapsById[e.map].elevation||0,o=Math.abs(r-a);this.edges[n.id].push(new Tr({destination:e,elevationDelta:o,origin:n,vortex:t})),this.edges[e.id].push(new Tr({destination:n,elevationDelta:o,origin:e,vortex:t}))}}}))}aStar(t,e,n){let i=t.map((t=>this.nodesById[t])).filter((t=>t)),r=e.map((t=>this.nodesById[t])).filter((t=>t));if(0===i.length||0===r.length)return[];let a=[],o={},s={};for(i.forEach((t=>{let e=this.getShortestEuclideanDistance(t,r);a.push({origin:t,priority:e}),o[t.id]=null,s[t.id]=0})),a.sort(((t,e)=>t.priority-e.priority));a.length>0;){let t=a[0];if(r.includes(t.origin)){let e=[],n=o[t.origin.id];for(;null!=n;){e.push(n);let t=o[n.origin.id];n=null!=t?t:null}return e.reverse()}for(let e of this.edges[t.origin.id]){let i=e.vortex&&!1===e.vortex.accessible;if(n&&(i||!1===e.origin.accessible||!1===e.destination.accessible))continue;let l=s[t.origin.id]+e.weight;if(null==s[e.destination.id]||l<s[e.destination.id]){s[e.destination.id]=l;let t=l+this.getShortestEuclideanDistance(e.destination,r);a.push({origin:e.destination,priority:t}),o[e.destination.id]=e}}a.splice(0,1),a.sort(((t,e)=>t.priority-e.priority))}return[]}getDistance(t,e){let n,i=t.x-e.x,r=t.y-e.y,a=i*i+r*r;return n=null==this.mapsById[t.map]?1:this.mapsById[t.map]._scale,Math.sqrt(a)/n}getShortestEuclideanDistance(t,e){return e.reduce(((e,n)=>{let i=this.getDistance(t,n);return Math.min(e,i)}),Number.MAX_VALUE)}},Bi=Io;function Sd(t){switch(t){case je.DOWN:case je.UP:return`${t} `;default:return""}}h(),h(),function(t){t.DEPARTURE="Departure",t.TAKEVORTEX="TakeVortex",t.EXITVORTEX="ExitVortex",t.TURN="Turn",t.ARRIVAL="Arrival"}(te||(te={})),function(t){t.STRAIGHT="Straight",t.RIGHT="Right",t.SLIGHTRIGHT="SlightRight",t.LEFT="Left",t.SLIGHTLEFT="SlightLeft"}(he||(he={})),function(t){t.UP="up",t.DOWN="down",t.NONE="none"}(je||(je={}));var Ir,No=class{constructor({origin:t,action:e,distance:n,atLocation:i,instruction:r}){p(this,"node"),p(this,"instruction"),p(this,"action"),p(this,"atLocation"),p(this,"type"),p(this,"distance",0),this.node=t,this.action=e,this.distance=n||0,this.atLocation=i,this.instruction="",r?this.instruction=r:(null!=e&&e.type===te.DEPARTURE?this.instruction=null!=i?`Depart from ${i.name}`:"Depart from current location":null!=e&&e.type===te.ARRIVAL?this.instruction=null!=i?`Arrive at ${i.name}`:"Arrive at destination":null!=e&&e.type===te.TAKEVORTEX?this.instruction=`Take ${i&&i.name} ${Sd(e.direction)}to ${e.toMap.name}`:null!=e&&e.type===te.EXITVORTEX?this.instruction=`Exit ${i&&i.name} at ${e.toMap.name}`:null!=e&&e.bearing===he.RIGHT?this.instruction="Turn right":null!=e&&e.bearing===he.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=e&&e.bearing===he.STRAIGHT?this.instruction="Head straight":null!=e&&e.bearing===he.SLIGHTLEFT?this.instruction="Turn slightly left":null!=e&&e.bearing===he.LEFT&&(this.instruction="Turn left"),null!=e&&e.type===te.TURN&&i&&(this.instruction+=` at ${i.name}`))}},ze=No;(Ir||(Ir={})).NO_VALID_PATH="No Valid Path Available";var Nr=.1*Math.PI;function Or(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var Oo=class{constructor({locations:t,nodes:e,vortexes:n,maps:i,showVortexNames:r}){p(this,"graph"),p(this,"locationsByNodeId"),this.graph=new Bi({maps:i,nodes:e,showVortexNames:r,vortexes:n}),this.locationsByNodeId=t.reduce(((t,e)=>(e.nodes&&e.nodes.forEach((n=>{t[n.node]=e})),e.polygons&&e.polygons.forEach((n=>{n.entrances&&n.entrances.forEach((n=>{t[n]=e}))})),t)),{})}getClosestLocationInRay(t,e=.5*Math.PI,n=10){let i=0,r=0,a=t;for(;Math.abs(i)<e&&r<n;){let t=this.graph.edges[a.destination.id],o=null,s=0;for(let e of t)if(e.distance>0)if(null!=o){let t=-Or(a.angle,e.angle);Math.abs(t)<Math.abs(s)&&(o=e,s=t)}else o=e,s=-Or(a.angle,e.angle);if(null==o)return null;{if(Math.abs(s)>=e||(i+=s,r+=o.distance,Math.abs(i)>=e||r>n))return null;let t=this.locationsByNodeId[o.destination.id];if(null!=t)return t;a=o}}return null}getDirections({originIds:t,destinationNodeIds:e,accessible:n,departFrom:i,arriveAt:r}){let a=this.graph.aStar(t,e,n);if(0===a.length)return{distance:0,instructions:[new ze({distance:0,instruction:Ir.NO_VALID_PATH})],path:[]};let o=0,s=new Array(a.length+1);for(let t=0;t<a.length;t++)s[t]=a[t].origin;s[a.length]=a[a.length-1].destination;let l=[],u=null,h=null,c=0,d=0;for(let t=0;t<a.length;t++){let e=a[t],n=e.origin,s=e.destination;if(o+=e.distance,c+=(null==h?void 0:h.distance)||0,0===t&&l.push(new ze({action:{type:te.DEPARTURE},atLocation:i,distance:0,origin:n})),null!=e.vortex){let t=this.graph.mapsById[n.map],i=this.graph.mapsById[s.map],r=je.NONE;if(null!=t.elevation&&null!=i.elevation){let e=t.elevation-i.elevation;e>0?r=je.DOWN:e<0&&(r=je.UP)}l.push(new ze({action:{direction:r,fromMap:t,toMap:i,type:te.TAKEVORTEX},atLocation:e.vortex,distance:c,origin:n})),d+=c,c=0}else if(null!=u&&null!=h)if(null!=h.vortex){let t=this.graph.mapsById[u.map],e=this.graph.mapsById[h.destination.map];l.push(new ze({action:{fromMap:t,toMap:e,type:te.EXITVORTEX},atLocation:h.vortex,distance:c,origin:n})),d+=c,c=0}else{let t=this.graph.edges[n.id].filter((t=>t.destination!==u&&t.destination!==e.destination));if(t.length>0){let i=-Or(h.angle,e.angle),r=t.reduce(((t,n)=>{let i=-Or(e.angle,n.angle);return Math.min(t,Math.abs(i))}),Math.PI);if(Math.abs(i)>=Nr||Math.abs(r)<=Nr){let t;t=i<=-Math.PI/4?he.RIGHT:i<=-Nr?he.SLIGHTRIGHT:i<=Nr?he.STRAIGHT:i<=Math.PI/4?he.SLIGHTLEFT:he.LEFT;let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=e){let i=new ze({action:{bearing:t,referencePosition:"At",type:te.TURN},atLocation:e,distance:c,origin:n});i.type=t,l.push(i)}else l.push(new ze({action:{bearing:t,referencePosition:"At",type:te.TURN},distance:c,origin:n}));d+=c,c=0}}}t===a.length-1&&(l.push(new ze({action:{type:te.ARRIVAL},atLocation:r,distance:o-d<0?0:o-d,origin:e.destination})),d+=c,c=0),u=n,h=e}let f=[],p=null;for(let t=l.length-1;t>=0;t--){let e=l[t],{action:n}=e;n&&n.type===te.TAKEVORTEX?(p=e.node,f.unshift(e)):n&&n.type===te.TURN&&null!=p?this.graph.getDistance(e.node,p)>5&&f.unshift(e):f.unshift(e)}return{distance:o,instructions:f,path:s}}},Ei=Oo;function _o(t){let e=+this._x.call(null,t),n=+this._y.call(null,t);return Po(this.cover(e,n),e,n,t)}function Po(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,a,o,s,l,u,h,c,d,f=t._root,p={data:i},g=t._x0,v=t._y0,y=t._x1,m=t._y1;if(!f)return t._root=p,t;for(;f.length;)if((u=e>=(a=(g+y)/2))?g=a:y=a,(h=n>=(o=(v+m)/2))?v=o:m=o,r=f,!(f=f[c=h<<1|u]))return r[c]=p,t;if(s=+t._x.call(null,f.data),l=+t._y.call(null,f.data),e===s&&n===l)return p.next=f,r?r[c]=p:t._root=p,t;do{r=r?r[c]=new Array(4):t._root=new Array(4),(u=e>=(a=(g+y)/2))?g=a:y=a,(h=n>=(o=(v+m)/2))?v=o:m=o}while((c=h<<1|u)==(d=(l>=o)<<1|s>=a));return r[d]=f,r[c]=p,t}function Ao(t){var e,n,i,r,a=t.length,o=new Array(a),s=new Array(a),l=1/0,u=1/0,h=-1/0,c=-1/0;for(n=0;n<a;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(r=+this._y.call(null,e))||(o[n]=i,s[n]=r,i<l&&(l=i),i>h&&(h=i),r<u&&(u=r),r>c&&(c=r));if(l>h||u>c)return this;for(this.cover(l,u).cover(h,c),n=0;n<a;++n)Po(this,o[n],s[n],t[n]);return this}function Lo(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,a=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,a=(i=Math.floor(e))+1;else{for(var o,s,l=r-n||1,u=this._root;n>t||t>=r||i>e||e>=a;)switch(s=(e<i)<<1|t<n,o=new Array(4),o[s]=u,u=o,l*=2,s){case 0:r=n+l,a=i+l;break;case 1:n=r-l,a=i+l;break;case 2:r=n+l,i=a-l;break;case 3:n=r-l,i=a-l}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=i,this._x1=r,this._y1=a,this}function Do(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}function Bo(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function re(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function Eo(t,e,n){var i,r,a,o,s,l,u,h=this._x0,c=this._y0,d=this._x1,f=this._y1,p=[],g=this._root;for(g&&p.push(new re(g,h,c,d,f)),null==n?n=1/0:(h=t-n,c=e-n,d=t+n,f=e+n,n*=n);l=p.pop();)if(!(!(g=l.node)||(r=l.x0)>d||(a=l.y0)>f||(o=l.x1)<h||(s=l.y1)<c))if(g.length){var v=(r+o)/2,y=(a+s)/2;p.push(new re(g[3],v,y,o,s),new re(g[2],r,y,v,s),new re(g[1],v,a,o,y),new re(g[0],r,a,v,y)),(u=(e>=y)<<1|t>=v)&&(l=p[p.length-1],p[p.length-1]=p[p.length-1-u],p[p.length-1-u]=l)}else{var m=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),M=m*m+b*b;if(M<n){var w=Math.sqrt(n=M);h=t-w,c=e-w,d=t+w,f=e+w,i=g.data}}return i}function So(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,n,i,r,a,o,s,l,u,h,c,d,f=this._root,p=this._x0,g=this._y0,v=this._x1,y=this._y1;if(!f)return this;if(f.length)for(;;){if((u=a>=(s=(p+v)/2))?p=s:v=s,(h=o>=(l=(g+y)/2))?g=l:y=l,e=f,!(f=f[c=h<<1|u]))return this;if(!f.length)break;(e[c+1&3]||e[c+2&3]||e[c+3&3])&&(n=e,d=c)}for(;f.data!==t;)if(i=f,!(f=f.next))return this;return(r=f.next)&&delete f.next,i?(r?i.next=r:delete i.next,this):e?(r?e[c]=r:delete e[c],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[d]=f:this._root=f),this):(this._root=r,this)}function Ro(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function Co(){return this._root}function qo(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}function Go(t){var e,n,i,r,a,o,s=[],l=this._root;for(l&&s.push(new re(l,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(l=e.node,i=e.x0,r=e.y0,a=e.x1,o=e.y1)&&l.length){var u=(i+a)/2,h=(r+o)/2;(n=l[3])&&s.push(new re(n,u,h,a,o)),(n=l[2])&&s.push(new re(n,i,h,u,o)),(n=l[1])&&s.push(new re(n,u,r,a,h)),(n=l[0])&&s.push(new re(n,i,r,u,h))}return this}function Vo(t){var e,n=[],i=[];for(this._root&&n.push(new re(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var r=e.node;if(r.length){var a,o=e.x0,s=e.y0,l=e.x1,u=e.y1,h=(o+l)/2,c=(s+u)/2;(a=r[0])&&n.push(new re(a,o,s,h,c)),(a=r[1])&&n.push(new re(a,h,s,l,c)),(a=r[2])&&n.push(new re(a,o,c,h,u)),(a=r[3])&&n.push(new re(a,h,c,l,u))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this}function ko(t){return t[0]}function Fo(t){return arguments.length?(this._x=t,this):this._x}function Uo(t){return t[1]}function jo(t){return arguments.length?(this._y=t,this):this._y}function Rt(t,e,n){var i=new Si(null==e?ko:e,null==n?Uo:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function Si(t,e,n,i,r,a){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=a,this._root=void 0}function zo(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h();var ue=Rt.prototype=Si.prototype;ue.copy=function(){var t,e,n=new Si(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=zo(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var r=0;r<4;++r)(e=i.source[r])&&(e.length?t.push({source:e,target:i.target[r]=new Array(4)}):i.target[r]=zo(e));return n},ue.add=_o,ue.addAll=Ao,ue.cover=Lo,ue.data=Do,ue.extent=Bo,ue.find=Eo,ue.remove=So,ue.removeAll=Ro,ue.root=Co,ue.size=qo,ue.visit=Go,ue.visitAfter=Vo,ue.x=Fo,ue.y=jo;var Le,ne,Ye=class{constructor(t){E(this,Le,void 0),p(this,"categories"),p(this,"locations"),p(this,"vortexes"),p(this,"maps"),p(this,"nodes"),p(this,"polygons"),p(this,"events"),p(this,"mapGroups"),p(this,"locationStates"),p(this,"locationRankings"),p(this,"rankings"),E(this,ne,{}),G(this,Le,t)}get polygonsByMapId(){if(v(this,ne).polygonsByMapId)return v(this,ne).polygonsByMapId;let t,e={};for(let n=0,i=v(this,Le).polygons.length;n<i;++n)t=v(this,Le).polygons[n],e[t.map]||(e[t.map]=[]),e[t.map].push(t);return v(this,ne).polygonsByMapId=e,v(this,ne).polygonsByMapId}get nodesByMapId(){if(v(this,ne).nodesByMapId)return v(this,ne).nodesByMapId;let t,e={};for(let n=0,i=v(this,Le).nodes.length;n<i;++n)t=v(this,Le).nodes[n],e[t.map]||(e[t.map]=[]),e[t.map].push(t);return v(this,ne).nodesByMapId=e,v(this,ne).nodesByMapId}findNearestNodeOnMap(t,e){if(v(this,ne).nodeTreesByMap||(v(this,ne).nodeTreesByMap=new Map),!v(this,ne).nodeTreesByMap.has(t)){let e=this.nodesByMapId[t],n=Rt();n.x((t=>t.x)),n.y((t=>t.y)),n.addAll(e),v(this,ne).nodeTreesByMap.set(t,n)}return v(this,ne).nodeTreesByMap.get(t).find(e.x,e.y)}get locationsByMapId(){if(v(this,ne).locationsByMapId)return v(this,ne).locationsByMapId;let t,e={};for(let n=0,i=v(this,Le).locations.length;n<i;++n){t=v(this,Le).locations[n];for(let n=0,i=t.polygons.length;n<i;++n)e[t.polygons[n].map]||(e[t.polygons[n].map]=[]),e[t.polygons[n].map].push(t)}return v(this,ne).locationsByMapId=e,v(this,ne).locationsByMapId}static create(t){return Ye.instances.has(t)||Ye.instances.set(t,new Ye(t)),Ye.instances.get(t)}static clear(){Ye.instances.clear()}},Ri=Ye;Le=new WeakMap,ne=new WeakMap,p(Ri,"instances",new Map);var ye=Ri;h(),h(),h(),h();var $o=" ",le=class{static get separator(){return $o}static set separator(t){$o=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);let e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let n=null;switch(e.length){case 3:n=e[0]/1+e[1]/60+e[2]/3600;break;case 2:n=e[0]/1+e[1]/60;break;case 1:n=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(n=-n),Number(n)}static toDms(t,e="d",n){if(isNaN(t)||"string"==typeof t&&""==t.trim()||"boolean"==typeof t||t==1/0||null==t)return null;if(void 0===n)switch(e){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:e="d",n=4}t=Math.abs(t);let i=null,r=null,a=null,o=null;switch(e){default:case"d":case"deg":r=t.toFixed(n),r<100&&(r="0"+r),r<10&&(r="0"+r),i=r+"°";break;case"dm":case"deg+min":r=Math.floor(t),a=(60*t%60).toFixed(n),60==a&&(a=(0).toFixed(n),r++),r=("000"+r).slice(-3),a<10&&(a="0"+a),i=r+"°"+le.separator+a+"′";break;case"dms":case"deg+min+sec":r=Math.floor(t),a=Math.floor(3600*t/60)%60,o=(3600*t%60).toFixed(n),60==o&&(o=(0).toFixed(n),a++),60==a&&(a=0,r++),r=("000"+r).slice(-3),a=("00"+a).slice(-2),o<10&&(o="0"+o),i=r+"°"+le.separator+a+"′"+le.separator+o+"″"}return i}static toLat(t,e,n){let i=le.toDms(le.wrap90(t),e,n);return null===i?"–":i.slice(1)+le.separator+(t<0?"S":"N")}static toLon(t,e,n){let i=le.toDms(le.wrap180(t),e,n);return null===i?"–":i+le.separator+(t<0?"W":"E")}static toBrng(t,e,n){let i=le.toDms(le.wrap360(t),e,n);return null===i?"–":i.replace("360","0")}static fromLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=le.wrap360(t);let n=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*n/360)%n*16/n]}static wrap360(t){return 0<=t&&t<360?t:(t%360+360)%360}static wrap180(t){return-180<t&&t<=180?t:(t+540)%360-180}static wrap90(t){return-90<=t&&t<=90?t:Math.abs((t%360+270)%360-180)-90}};Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var j=le,X=Math.PI,R=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=j.wrap90(Number(t)),this._lon=j.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?j.wrap90(j.parse(t)):j.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?j.wrap90(j.parse(t)):j.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?j.wrap180(j.parse(t)):j.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?j.wrap180(j.parse(t)):j.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?j.wrap180(j.parse(t)):j.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,n;if(2==t.length&&([e,n]=t,e=j.wrap90(j.parse(e)),n=j.wrap180(j.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,n]=t[0].split(","),e=j.wrap90(j.parse(e)),n=j.wrap180(j.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){let i=t[0];if("Point"==i.type&&Array.isArray(i.coordinates)?[n,e]=i.coordinates:(null!=i.latitude&&(e=i.latitude),null!=i.lat&&(e=i.lat),null!=i.longitude&&(n=i.longitude),null!=i.lng&&(n=i.lng),null!=i.lon&&(n=i.lon),e=j.wrap90(j.parse(e)),n=j.wrap180(j.parse(n))),isNaN(e)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(n))throw new TypeError(`invalid point ‘${t.toString()}’`);return new R(e,n)}distanceTo(t,e=6371e3){if(t instanceof R||(t=R.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);let n=e,i=this.lat.toRadians(),r=this.lon.toRadians(),a=t.lat.toRadians(),o=a-i,s=t.lon.toRadians()-r,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(i)*Math.cos(a)*Math.sin(s/2)*Math.sin(s/2);return n*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof R||(t=R.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),i=(t.lon-this.lon).toRadians(),r=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(i),a=Math.sin(i)*Math.cos(n),o=Math.atan2(a,r).toDegrees();return j.wrap360(o)}finalBearingTo(t){t instanceof R||(t=R.parse(t));let e=t.initialBearingTo(this)+180;return j.wrap360(e)}midpointTo(t){t instanceof R||(t=R.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),i=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),a=Math.cos(e),o=0,s=Math.sin(e),l={x:a+Math.cos(i)*Math.cos(r),y:o+Math.cos(i)*Math.sin(r),z:s+Math.sin(i)},u=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),h=n+Math.atan2(l.y,l.x),c=u.toDegrees(),d=h.toDegrees();return new R(c,d)}intermediatePointTo(t,e){if(t instanceof R||(t=R.parse(t)),this.equals(t))return new R(this.lat,this.lon);let n=this.lat.toRadians(),i=this.lon.toRadians(),r=t.lat.toRadians(),a=t.lon.toRadians(),o=r-n,s=a-i,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(n)*Math.cos(r)*Math.sin(s/2)*Math.sin(s/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),h=Math.sin((1-e)*u)/Math.sin(u),c=Math.sin(e*u)/Math.sin(u),d=h*Math.cos(n)*Math.cos(i)+c*Math.cos(r)*Math.cos(a),f=h*Math.cos(n)*Math.sin(i)+c*Math.cos(r)*Math.sin(a),p=h*Math.sin(n)+c*Math.sin(r),g=Math.atan2(p,Math.sqrt(d*d+f*f)),v=Math.atan2(f,d),y=g.toDegrees(),m=v.toDegrees();return new R(y,m)}destinationPoint(t,e,n=6371e3){let i=t/n,r=Number(e).toRadians(),a=this.lat.toRadians(),o=this.lon.toRadians(),s=Math.sin(a)*Math.cos(i)+Math.cos(a)*Math.sin(i)*Math.cos(r),l=Math.asin(s),u=Math.sin(r)*Math.sin(i)*Math.cos(a),h=Math.cos(i)-Math.sin(a)*s,c=o+Math.atan2(u,h),d=l.toDegrees(),f=c.toDegrees();return new R(d,f)}static intersection(t,e,n,i){if(t instanceof R||(t=R.parse(t)),n instanceof R||(n=R.parse(n)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(i))throw new TypeError(`invalid brng2 ‘${i}’`);let r=t.lat.toRadians(),a=t.lon.toRadians(),o=n.lat.toRadians(),s=n.lon.toRadians(),l=Number(e).toRadians(),u=Number(i).toRadians(),h=o-r,c=s-a,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(r)*Math.cos(o)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new R(t.lat,t.lon);let f=(Math.sin(o)-Math.sin(r)*Math.cos(d))/(Math.sin(d)*Math.cos(r)),p=(Math.sin(r)-Math.sin(o)*Math.cos(d))/(Math.sin(d)*Math.cos(o)),g=Math.acos(Math.min(Math.max(f,-1),1)),v=Math.acos(Math.min(Math.max(p,-1),1)),y=l-(Math.sin(s-a)>0?g:2*X-g),m=(Math.sin(s-a)>0?2*X-v:v)-u;if(0==Math.sin(y)&&0==Math.sin(m)||Math.sin(y)*Math.sin(m)<0)return null;let b=-Math.cos(y)*Math.cos(m)+Math.sin(y)*Math.sin(m)*Math.cos(d),M=Math.atan2(Math.sin(d)*Math.sin(y)*Math.sin(m),Math.cos(m)+Math.cos(y)*b),w=Math.asin(Math.min(Math.max(Math.sin(r)*Math.cos(M)+Math.cos(r)*Math.sin(M)*Math.cos(l),-1),1)),_=a+Math.atan2(Math.sin(l)*Math.sin(M)*Math.cos(r),Math.cos(M)-Math.sin(r)*Math.sin(w)),x=w.toDegrees(),E=_.toDegrees();return new R(x,E)}crossTrackDistanceTo(t,e,n=6371e3){t instanceof R||(t=R.parse(t)),e instanceof R||(e=R.parse(e));let i=n;if(this.equals(t))return 0;let r=t.distanceTo(this,i)/i,a=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(r)*Math.sin(a-o))*i}alongTrackDistanceTo(t,e,n=6371e3){t instanceof R||(t=R.parse(t)),e instanceof R||(e=R.parse(e));let i=n;if(this.equals(t))return 0;let r=t.distanceTo(this,i)/i,a=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians(),s=Math.asin(Math.sin(r)*Math.sin(a-o));return Math.acos(Math.cos(r)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(o-a))*i}maxLatitude(t){let e=Number(t).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(n))).toDegrees()}static crossingParallels(t,e,n){if(t.equals(e))return null;let i=Number(n).toRadians(),r=t.lat.toRadians(),a=t.lon.toRadians(),o=e.lat.toRadians(),s=e.lon.toRadians()-a,l=Math.sin(r)*Math.cos(o)*Math.cos(i)*Math.sin(s),u=Math.sin(r)*Math.cos(o)*Math.cos(i)*Math.cos(s)-Math.cos(r)*Math.sin(o)*Math.cos(i),h=Math.cos(r)*Math.cos(o)*Math.sin(i)*Math.sin(s);if(h*h>l*l+u*u)return null;let c=Math.atan2(-u,l),d=Math.acos(h/Math.sqrt(l*l+u*u)),f=a+c+d,p=(a+c-d).toDegrees(),g=f.toDegrees();return{lon1:j.wrap180(p),lon2:j.wrap180(g)}}rhumbDistanceTo(t,e=6371e3){t instanceof R||(t=R.parse(t));let n=e,i=this.lat.toRadians(),r=t.lat.toRadians(),a=r-i,o=Math.abs(t.lon-this.lon).toRadians();Math.abs(o)>X&&(o=o>0?-(2*X-o):2*X+o);let s=Math.log(Math.tan(r/2+X/4)/Math.tan(i/2+X/4)),l=Math.abs(s)>1e-11?a/s:Math.cos(i);return Math.sqrt(a*a+l*l*o*o)*n}rhumbBearingTo(t){if(t instanceof R||(t=R.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),i=(t.lon-this.lon).toRadians();Math.abs(i)>X&&(i=i>0?-(2*X-i):2*X+i);let r=Math.log(Math.tan(n/2+X/4)/Math.tan(e/2+X/4)),a=Math.atan2(i,r).toDegrees();return j.wrap360(a)}rhumbDestinationPoint(t,e,n=6371e3){let i=this.lat.toRadians(),r=this.lon.toRadians(),a=Number(e).toRadians(),o=t/n,s=o*Math.cos(a),l=i+s;Math.abs(l)>X/2&&(l=l>0?X-l:-X-l);let u=Math.log(Math.tan(l/2+X/4)/Math.tan(i/2+X/4)),h=Math.abs(u)>1e-11?s/u:Math.cos(i),c=r+o*Math.sin(a)/h,d=l.toDegrees(),f=c.toDegrees();return new R(d,f)}rhumbMidpointTo(t){t instanceof R||(t=R.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),i=t.lat.toRadians(),r=t.lon.toRadians();Math.abs(r-n)>X&&(n+=2*X);let a=(e+i)/2,o=Math.tan(X/4+e/2),s=Math.tan(X/4+i/2),l=Math.tan(X/4+a/2),u=((r-n)*Math.log(l)+n*Math.log(s)-r*Math.log(o))/Math.log(s/o);isFinite(u)||(u=(n+r)/2);let h=a.toDegrees(),c=u.toDegrees();return new R(h,c)}static areaOf(t,e=6371e3){let n=e,i=t[0].equals(t[t.length-1]);i||t.push(t[0]);let r=t.length-1,a=0;for(let e=0;e<r;e++){let n=t[e].lat.toRadians(),i=t[e+1].lat.toRadians(),r=(t[e+1].lon-t[e].lon).toRadians();a+=2*Math.atan2(Math.tan(r/2)*(Math.tan(n/2)+Math.tan(i/2)),1+Math.tan(n/2)*Math.tan(i/2))}(function(t){let e=0,n=t[0].initialBearingTo(t[1]);for(let i=0;i<t.length-1;i++){let r=t[i].initialBearingTo(t[i+1]),a=t[i].finalBearingTo(t[i+1]);e+=(r-n+540)%360-180,e+=(a-r+540)%360-180,n=a}return e+=(t[0].initialBearingTo(t[1])-n+540)%360-180,Math.abs(e)<90})(t)&&(a=Math.abs(a)-2*X);let o=Math.abs(a*n*n);return i||t.pop(),o}equals(t){return t instanceof R||(t=R.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);if("n"==t)return null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`;return`${j.toLat(this.lat,t,e)}, ${j.toLon(this.lon,t,e)}`}};h(),h(),h();var _r=class{constructor(t){p(this,"destinations",[]),this.destinations=t}};h();var qt,qe,Ct=class{constructor(t,e){E(this,qt,void 0),E(this,qe,void 0),p(this,"distance",0),p(this,"path",[]),p(this,"instructions",[]),G(this,qe,t),G(this,qt,e),this.distance=e.distance,this.instructions=e.instructions.map((t=>{var e,n,i,r,a,o,s,l,u,h,c,d;let f={...t,action:{...t.action},atLocation:(null==(e=t.atLocation)?void 0:e.id)?null==(i=null==(n=v(this,qe))?void 0:n._vortexesById)?void 0:i[t.atLocation.id]:void 0,node:(null==(r=t.node)?void 0:r.id)?null==(o=null==(a=v(this,qe))?void 0:a._nodesById)?void 0:o[t.node.id]:void 0};return((null==(s=f.action)?void 0:s.type)===te.TAKEVORTEX||(null==(l=f.action)?void 0:l.type)===te.EXITVORTEX)&&(f.action.fromMap=null==(h=v(this,qe)._mapsById)?void 0:h[null==(u=f.action)?void 0:u.fromMap.id],f.action.toMap=null==(d=v(this,qe)._mapsById)?void 0:d[null==(c=f.action)?void 0:c.toMap.id]),f})),this.path=e.path.map((t=>{var e,n;return null==(n=null==(e=v(this,qe))?void 0:e._nodesById)?void 0:n[t.id]}))}toJSON(){return v(this,qt)}};qt=new WeakMap,qe=new WeakMap;var He,$e=class{constructor(t){E(this,He,void 0),G(this,He,t)}directionsTo(t,e){if(t instanceof _r){let n=[],i=this;for(let r=0;r<t.destinations.length;r++){let a=t.destinations[r],o=Gt(i),s=Gt(a),l=v(this,He).navigator.getDirections({originIds:o,destinationNodeIds:s,accessible:(null==e?void 0:e.accessible)||!1}),u=new Ct(v(this,He),l);n.push(u),i=a}return n}{let n=Gt(this),i=Gt(t),r=v(this,He).navigator.getDirections({originIds:n,destinationNodeIds:i,accessible:(null==e?void 0:e.accessible)||!1});return new Ct(v(this,He),r)}}distanceTo(t,e){let n=this.directionsTo(t,e);return(null==n?void 0:n.distance)||0}directionsToCallback(t,e){return this.directionsTo(t,e)}};He=new WeakMap;var Rd=0,Cd="9999-12-31T00:00:00.000Z";function qd(t,e,n=new Date){if(!t.states)return;let i=n||new Date,r=t.states.find((t=>{let e=new Date(t.start||Rd),n=new Date(t.end||Cd);return e<i&&n>i}));return r?e.find((t=>t.value===r.type)):void 0}var De,Qe,ve,Vt,kt,Ft,Ut=class extends $e{constructor(t,e){super(t),E(this,De,void 0),E(this,Qe,void 0),E(this,ve,{}),p(this,"states"),p(this,"id",""),p(this,"name",""),p(this,"type",""),p(this,"description"),p(this,"sortOrder"),p(this,"logo"),p(this,"phone"),p(this,"social"),p(this,"color"),p(this,"shortName"),p(this,"detailsUrl"),p(this,"tags"),p(this,"externalId"),p(this,"showLabelWhenImagePresent"),p(this,"picture"),p(this,"operationHours"),p(this,"siblingGroups"),p(this,"gallery"),p(this,"categories",[]),E(this,Vt,void 0),E(this,kt,[]),E(this,Ft,void 0),G(this,De,t),G(this,Qe,e),Object.assign(this,e)}get polygons(){let t=v(this,ve).polygons;if(void 0!==t)return t;let e=[],n=v(this,Vt),i=v(this,De)._polygonsById;if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t){let r=i[n[t].id];null!=r&&r.geometry.visible&&e.push(r)}return v(this,ve).polygons=e,e}set polygons(t){G(this,Vt,t)}get rank(){let t=v(this,ve).rank;if(void 0!==t)return t;let e=v(this,De).locationRankings;if(!e||!e.locations)return null;let n=e.locations.find((t=>t.ids.find((t=>t===this.id))));return n?(v(this,ve).rank=n.score,n.score):null}get nodes(){let t=v(this,ve).nodes;if(void 0!==t)return t;let e=[],n=v(this,kt),i=v(this,De)._nodesById;if(n)for(let t=0,r=n.length;t<r;++t){let r=i[n[t].node];null!=r&&e.push(r)}return v(this,ve).nodes=e,e}set nodes(t){G(this,kt,t)}get parent(){let t=v(this,ve).parent;if(void 0!==t)return t;let e,n=v(this,De)._locationsById,i=v(this,Ft);return void 0!==i&&(e=n[i]),v(this,ve).parent=e,e}set parent(t){G(this,Ft,t)}get state(){return qd(this,v(this,De).locationStates)}clone(){return new Ut(v(this,De),v(this,Qe))}get nodeOperationHours(){let t=v(this,ve).nodeOperationHours;if(void 0!==t)return t;if(null==this.nodes)return{};let e=v(this,Qe).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return v(this,ve).nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new Ut(e,t)))}static async fetch(t){let e=t.options.things.locations.slice();t.options.things.categories&&Y(e,"categories"),t.options.things.nodes&&Y(e,"nodes"),t.options.things.polygons&&Y(e,"polygons"),t.options.things.locationStates&&Y(e,"states");let n={fields:e,venue:t.options.venue};try{let e=await Z(t.options,"location",n);return t.options.includeHidden||(e=e.filter((t=>!t.hidden))),e.map((e=>new Ut(t,e)))}catch(t){return console.error("Fetch Locations:",t),[]}}toJSON(){return v(this,Qe)}},ot=Ut;De=new WeakMap,Qe=new WeakMap,ve=new WeakMap,Vt=new WeakMap,kt=new WeakMap,Ft=new WeakMap,h();var et,jt,Be,zt,Pr=class extends $e{constructor(t,e){super(t),E(this,et,void 0),E(this,jt,void 0),E(this,Be,{}),p(this,"geometry"),p(this,"image"),p(this,"holes"),p(this,"textures"),p(this,"material"),p(this,"label"),p(this,"id",""),p(this,"map",""),p(this,"layer"),p(this,"layerId"),p(this,"name"),p(this,"externalId"),p(this,"vertexes"),p(this,"canvasBounds"),E(this,zt,void 0),G(this,et,t),G(this,jt,e),Object.assign(this,e)}get locations(){let t=v(this,Be).locations;if(void 0!==t)return t;let e=[],n=ye.instances.get(v(this,et)).locationsByMapId[this.map],{id:i}=this;for(let t=0,r=n.length;t<r;++t){let r=n[t],a=r.polygons;if(Array.isArray(a))for(let t=0,n=a.length;t<n;++t)if(a[t].id===i){e.push(r);break}}return v(this,Be).locations=e,e}get entrances(){let t=v(this,Be).entrances;if(void 0!==t)return t;let e=[],n=v(this,zt),i=v(this,et)._nodesById;if(Array.isArray(n)){for(let t=0,r=n.length;t<r;++t){let r=i[n[t].id];null!=r&&e.push(r)}return v(this,Be).entrances=e,e}return[]}set entrances(t){G(this,zt,t)}get rank(){let t=v(this,Be).rank;if(void 0!==t)return t;let{rankings:e}=v(this,et);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(v(this,Be).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(v(this,Be).rank=null,null)}static hydrate(t,e){return t.map((t=>new Pr(e,t)))}static async fetch(t){let e=t.options.things.polygons.slice();t.options.things.maps&&Y(e,"map"),t.options.things.nodes&&Y(e,"entrances");let n={fields:e,perspective:t.options.do2D&&t.options.perspective||void 0,venue:t.options.venue};try{return(await Z(t.options,"polygon",n)).filter((t=>t.geometry.visible)).map((e=>new Pr(t,e)))}catch(t){return console.error("Fetch Polygons:",t),[]}}toJSON(){return v(this,jt)}},st=Pr;function Ho(t){return/^[\da-f]{24}$/i.test(t)}function Jo(t,e=!1){let n="";if(null!=t){let i="?",r=e?Object.keys(t).filter((t=>!["slug","venue"].includes(t))):Object.keys(t);for(let e=0,a=r.length;e<a;++e){let a=r[e],o=t[a];null!=o&&(n+=`${i+encodeURIComponent(a)}=${encodeURIComponent(o)}`,i="&")}}return n}function Gd(t,e,n,i=!1){var r,a;return i?`${t.supplementaryUrl}${e}?venue=${n.venue||n.slug}`:(null==(r=t.baseUrl)?void 0:r.includes("gateway"))?`${t.baseUrl}${e}/${n.venue||n.slug}${Jo(n,null==(a=t.baseUrl)?void 0:a.includes("gateway"))}`:t.baseUrl+e+Jo(n)}async function Z(t,e,n,i=!1){return $t(t,e,n,i,!0)}async function $t(t,e,n,i=!1,r=!1){let a=Gd(t,e,n,i),o=await Ar(t,a,i);if(!r&&Array.isArray(o)){if(1===o.length)return o[0];throw new Error("Invalid response object")}return o}async function Ar(t,e,n=!1){let i={language:t.language,clientId:t.clientId,clientSecret:t.clientSecret};n&&delete i.language,i.language&&(e+=`&lang=${encodeURIComponent(i.language)}`);let{headers:r}=t;r["Content-Type"]="text/json",t.authorization&&(r.Authorization=t.authorization),i.language&&(r["Accept-Language"]=i.language);let a=await fetch(e,{method:"GET",headers:r});if(!a.ok)throw new Error(`${a.status} ${a.statusText}`);return a.json()}function Y(t,e){t.indexOf(e)<0&&t.push(e)}function Wo([t,e],[n,i]){let r=new R(t,e),a=new R(n,i);return r.distanceTo(a)}function Ko(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale);let e;try{let n=t.georeference[0],i=t.georeference[2],r=new R(n.target.x,n.target.y),a=new R(i.target.x,i.target.y),o=r.distanceTo(a),s=n.control.x-i.control.x,l=n.control.y-i.control.y;e=Math.sqrt(s*s+l*l)/o}catch(n){e=1,console.warn(n),console.warn(`Couldn't georeference ${t.name||t.shortName||t.id}. Probably not enough geocoordinates.`)}return e}function Gt(t){var e;return t instanceof st?t.entrances.map((t=>t.id)):t instanceof ot?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}async function Xo(t){let e={},{maps:n,images:i,scenes:r,polygons:a}=t;if(null!=i)try{let t=Object.keys(i).map((t=>fetch(`data:image/png;base64,${i[t]}`).then((t=>t.blob())).then((n=>{e[t]=n})).catch((t=>{console.error(t)}))));await Promise.all(t)}catch(t){console.error(t)}return n.forEach((t=>{var n;!(null==(n=t.scene)?void 0:n.polygons)&&!r[t.id]||(null!=r&&r[t.id]&&(t.scene||(t.scene={}),Object.defineProperty(t.scene,"polygons",{get:()=>r[t.id]})),null!=i&&(t.scene.images=t.scene.images.map((({filename:t})=>({filename:t,url:e[t]}))),t.scene.polygons.forEach((t=>{var n,i;if((null==(n=null==t?void 0:t.image)?void 0:n.url)&&(null==(i=null==t?void 0:t.image)?void 0:i.url)){let n=t.image.url.split("/"),i=e[n[n.length-1]];i&&(t.image.url=i)}}))))})),null!=i&&a.forEach((t=>{var n;if(null==(n=null==t?void 0:t.image)?void 0:n.url){let n=t.image.url.split("/"),i=e[n[n.length-1]];i&&(t.image.url=i)}})),null!=t.images&&delete t.images,null!=t.scenes&&delete t.scenes,t}et=new WeakMap,jt=new WeakMap,Be=new WeakMap,zt=new WeakMap;var Ht,Jt,Wt,Dr=class{constructor(t,e){E(this,Ht,void 0),E(this,Jt,{}),E(this,Wt,void 0),p(this,"name"),p(this,"externalId"),p(this,"parents"),p(this,"id"),p(this,"icon"),this.id=e.id,G(this,Wt,e),G(this,Ht,t),Object.assign(this,e)}get locations(){let t=v(this,Jt).locations;if(void 0!==t)return t;let e=[],{locations:n}=v(this,Ht),{id:i}=this;for(let t=0,r=n.length;t<r;++t){let r=n[t],a=r.categories;if(Array.isArray(a))for(let t=0,n=a.length;t<n;++t)if(a[t]===i){e.push(r);break}}return v(this,Jt).locations=e,e}static hydrate(t,e){return t.map((t=>new Dr(e,t)))}static async fetch(t){let e={fields:t.options.things.categories,venue:t.options.venue};try{return(await Z(t.options,"category",e)).map((e=>new Dr(t,e)))}catch(t){return console.error("Fetch Categories:",t),[]}}toJSON(){return v(this,Wt)}},Lr=Dr;Ht=new WeakMap,Jt=new WeakMap,Wt=new WeakMap,h();var Kt,ut,Xt,Er=class{constructor(t,e){E(this,Kt,void 0),E(this,ut,void 0),E(this,Xt,{}),p(this,"id",""),p(this,"type",""),p(this,"name",""),p(this,"description"),p(this,"image"),p(this,"startDate"),p(this,"endDate"),p(this,"showDate"),G(this,ut,e),G(this,Kt,t),Object.assign(this,e)}location(){let t=v(this,Xt).location;if(void 0!==t)return t;let e,n=v(this,Kt)._locationsById,i=v(this,ut).location;if(null!=i){let t=n[i];null!=t&&(e=t)}return v(this,Xt).location=e,e}static hydrate(t,e){return t.map((t=>new Er(e,t)))}static async fetch(t){let e=t.options.things.events.slice();t.options.things.locations&&Y(e,"location");let n={fields:e,venue:t.options.venue,activeAtOrAfter:Date.now()};try{return(await Z(t.options,"event",n)).map((e=>new Er(t,e)))}catch(t){return console.error("Fetch Events:",t),[]}}toJSON(){return v(this,ut)}},Br=Er;Kt=new WeakMap,ut=new WeakMap,Xt=new WeakMap,h();var Zt,Sr=class{constructor(t){E(this,Zt,void 0),p(this,"locations",[]),G(this,Zt,t),Object.assign(this,t)}static hydrate(t){return new Sr(t)}static async fetch(t){try{let e=await $t(t.options,"smart-labels/location-label-ranking",{venue:t.options.venue},!0);return new Sr(e)}catch(t){return console.error("Fetch Location Rankings:",t),{}}}toJSON(){return v(this,Zt)}},Ci=Sr;Zt=new WeakMap,h();var Yt,Rr=class{constructor(t){E(this,Yt,void 0),p(this,"id",""),p(this,"name",""),p(this,"value",""),G(this,Yt,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Rr(t)))}static async fetch(t){let e={fields:t.options.things.locationStates.slice(),venue:t.options.venue};try{return(await Z(t.options,"location-state",e)).map((t=>new Rr(t)))}catch(t){return console.error("Fetch Location States:",t),[]}}toJSON(){return v(this,Yt)}},qi=Rr;Yt=new WeakMap,h(),h();var en,tn,Qt=class{constructor(t,e,n,i,r,a){p(this,"map"),p(this,"x",0),p(this,"y",0),p(this,"lat",0),p(this,"lon",0),E(this,en,{}),E(this,tn,void 0),this.lat=t,this.lon=e,this.map="string"==typeof r?r:r.id,this.x=n,this.y=i,G(this,tn,a)}absoluteDistanceTo(t){return Wo([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=v(this,en).nearestNode;if(void 0!==t)return t;let e=ye.instances.get(v(this,tn)).findNearestNodeOnMap(this.map,this);return v(this,en).nearestNode=e,e}};en=new WeakMap,tn=new WeakMap;var Ee,nn,rn,qr=class{constructor(t,e){E(this,Ee,void 0),E(this,nn,{}),E(this,rn,void 0),p(this,"id",""),p(this,"group",""),p(this,"name",""),p(this,"shortName",""),p(this,"elevation",0),p(this,"scale",0),p(this,"layers"),p(this,"x_scale"),p(this,"perspectiveId"),p(this,"scene"),p(this,"width",0),p(this,"height",0),p(this,"georeference",[]),p(this,"_scale",0),G(this,Ee,t),G(this,rn,e),Object.assign(this,e),this._scale=Ko(this),this.scale=this.x_scale||1/this._scale}get polygons(){var t;return(null==(t=ye.instances.get(v(this,Ee)))?void 0:t.polygonsByMapId[this.id])||[]}get locations(){var t;return(null==(t=ye.instances.get(v(this,Ee)))?void 0:t.locationsByMapId[this.id])||[]}get nodes(){var t;return(null==(t=ye.instances.get(v(this,Ee)))?void 0:t.nodesByMapId[this.id])||[]}get mapGroup(){let t=v(this,nn).mapGroup;if(void 0!==t)return t;let e=this.group,n=e&&v(this,Ee)._mapGroupsById[e]||null;return v(this,nn).mapGroup=n,n}createCoordinateByXY(t,e){let n,i=this.georeference[0],r=new R(i.target.x,i.target.y),a=t-i.control.x,o=i.control.y-e,s=Math.atan2(a,o);n=0===a&&0===o?0:0===a?o:a/Math.sin(s);let l=s-this.getNorth(),u=n/this._scale,h=r.destinationPoint(u,180*l/Math.PI);return new Qt(h.lat,h.lon,t,e,this.id,v(this,Ee))}createCoordinate(t,e){let n=this.georeference[0],i=new R(n.target.x,n.target.y),r=new R(t,e),a=i.distanceTo(r),o=(i.finalBearingTo(r)+360)%360*Math.PI/180||0,s=a*(1/this.scale),l=o+this.getNorth(),u=Math.sin(l)*s,h=Math.cos(l)*s;return new Qt(t,e,n.control.x+u,n.control.y-h,this.id,v(this,Ee))}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],i=new R(e.target.x,e.target.y),r=new R(n.target.x,n.target.y);t=-((i.finalBearingTo(r)+0)*Math.PI/180-Math.atan2(n.control.y-e.control.y,n.control.x-e.control.x)-Math.PI/2)}catch(e){t=0,console.warn(e),console.warn(`Couldn't georeference ${this.name||this.shortName||this.id}. Probably not enough geocoordinates.`)}return t}static hydrate(t,e){return t.map((t=>new qr(e,t)))}static async fetch(t){let e=t.options.things.maps.slice();t.options.perspective&&Y(e,"perspectives"),t.options.things.mapGroups&&Y(e,"group"),Y(e,"elevation"),Y(e,"x_scale"),Y(e,"scale"),Y(e,"georeference");let n={fields:e,perspective:t.options.perspective,venue:t.options.venue};try{let r=await Z(t.options,"map",n),a=t=>{let e=i.layers.find((e=>e.id===t));e?e.visible=!0:i.layers.push({id:t,visible:!0})};for(let n=0,o=r.length;n<o;++n){var i=r[n];if(i){let n=i.perspective;null!=n&&(i.perspectiveId=n.id,t.options.do2D?(e.indexOf("width")>-1&&(i.width=n.size&&n.size.width||n.width),e.indexOf("height")>-1&&(i.height=n.size&&n.size.height||n.height),e.indexOf("tiles")>-1&&(i.tiles=n.tiles),e.indexOf("original")>-1&&(i.original=n.original)):(e.indexOf("scene")>-1&&(i.scene=n.scene),n.layers?(i.layers.forEach((t=>{t.visible=!1})),n.layers.forEach(a)):i.layers.forEach((t=>{t.visible=!0})))),delete i.perspective}r[n]=new qr(t,i)}return r}catch(t){return console.error("Fetch Maps:",t),[]}}toJSON(){return v(this,rn)}},Cr=qr;Ee=new WeakMap,nn=new WeakMap,rn=new WeakMap,h();var an,lt,on,Vr=class{constructor(t,e){E(this,an,void 0),E(this,lt,void 0),E(this,on,{}),p(this,"id",""),p(this,"name",""),G(this,lt,e),G(this,an,t),Object.assign(this,e)}get maps(){let t=v(this,on).maps;if(void 0!==t)return t;let e=[],{maps:n}=v(this,an),{id:i}=v(this,lt);for(let t=0,r=n.length;t<r;++t){let r=n[t];r.group===i&&e.push(r)}return v(this,on).maps=e,e}static hydrate(t,e){return t.map((t=>new Vr(e,t)))}static async fetch(t){let e={fields:t.options.things.mapGroups.slice(),venue:t.options.venue};try{return(await Z(t.options,"map-group",e)).map((e=>new Vr(t,e)))}catch(t){return console.error("Fetch Map Groups:",t),[]}}toJSON(){return v(this,lt)}},Gr=Vr;an=new WeakMap,lt=new WeakMap,on=new WeakMap,h();var Ge,sn,ce,un,Fr=class extends $e{constructor(t,e){super(t),E(this,Ge,void 0),E(this,sn,void 0),E(this,ce,{}),p(this,"id",""),p(this,"map",""),p(this,"x",0),p(this,"y",0),p(this,"operationHours"),p(this,"externalId"),E(this,un,void 0),G(this,Ge,t),G(this,sn,e),Object.assign(this,e)}get lat(){var t;let e=v(this,ce).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=v(this,Ge)._mapsById)?void 0:t[this.map];if(null==n)throw new Error("Map not found");return v(this,ce).cachedLatLon=n.createCoordinateByXY(this.x,this.y),v(this,ce).cachedLatLon.lat}get lon(){var t;let e=v(this,ce).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=v(this,Ge)._mapsById)?void 0:t[this.map];if(null==n)throw new Error("Map not found");return v(this,ce).cachedLatLon=n.createCoordinateByXY(this.x,this.y),v(this,ce).cachedLatLon.lon}get paths(){let t=v(this,ce).paths;if(void 0!==t)return t;let e=[],n=v(this,Ge)._nodesById,i=v(this,un);if(Array.isArray(i))for(let t=0,r=i.length;t<r;++t){let r=n[i[t].node];null!=r&&e.push(r)}return v(this,ce).paths=e,e}set paths(t){G(this,un,t)}get locations(){var t;let e=v(this,ce).locations;if(void 0!==e)return e;let n=[],i=null==(t=ye.instances.get(v(this,Ge)))?void 0:t.locationsByMapId[this.map],r=this.id;for(let t=0,e=i.length;t<e;++t){let e=i[t],a=e.nodes;if(Array.isArray(a))for(let t=0,i=a.length;t<i;++t)if(a[t].id===r){n.push(e);break}}return v(this,ce).locations=n,n}get polygon(){let t=v(this,ce).polygon;if(void 0!==t)return t;let e,n=ye.instances.get(v(this,Ge)).polygonsByMapId[this.map],i=this.id;for(let t=0,r=n.length;t<r;++t){let r=n[t];r.entrances.map((t=>t.id)).includes(i)&&(e=r)}return v(this,ce).polygon=e,e}static hydrate(t,e){return t.map((t=>new Fr(e,t)))}static async fetch(t){let e=t.options.things.nodes.slice();t.options.things.maps&&Y(e,"map"),["weight","multiplier","accessible"].forEach((function(t){Y(e,t)}));let n={fields:e,perspective:t.options.do2D&&t.options.perspective||void 0,venue:t.options.venue};try{return(await Z(t.options,"node",n)).map((e=>new Fr(t,e)))}catch(t){return console.error("Fetch Nodes:",t),[]}}toJSON(){return v(this,sn)}},kr=Fr;Ge=new WeakMap,sn=new WeakMap,ce=new WeakMap,un=new WeakMap,h();var ln,jr=class{constructor(t){E(this,ln,void 0),p(this,"polygons",[]),G(this,ln,t),Object.assign(this,t)}static hydrate(t){return new jr(t)}static async fetch(t){try{let e=await $t(t.options,"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new jr(e)}catch(t){return console.error("Fetch Rankings:",t),null}}toJSON(){return v(this,ln)}},Ur=jr;ln=new WeakMap,h();var cn,zr=class{constructor(t){p(this,"id",""),E(this,cn,void 0),G(this,cn,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new zr(t)))}static async fetch(t){let e={fields:t.options.things.themes.slice(),venue:t.options.venue};try{return(await Z(t.options,"apollo-theme",e)).map((t=>new zr(t)))}catch(t){return console.error("Fetch Theme:",t),[]}}toJSON(){return v(this,cn)}},Gi=zr;cn=new WeakMap,h();var dn,pn,ct,Hr=class{constructor(t,e){E(this,dn,void 0),E(this,pn,void 0),E(this,ct,{}),p(this,"defaultMap",""),p(this,"address",""),p(this,"city",""),p(this,"countrycode",""),p(this,"externalId",""),p(this,"id",""),p(this,"latitude"),p(this,"logo"),p(this,"longitude"),p(this,"metadata"),p(this,"name",""),p(this,"operationHours"),p(this,"postal",""),p(this,"slug",""),p(this,"state",""),p(this,"telephone",""),p(this,"tzid",""),p(this,"tzidOverride",""),p(this,"utcOffset",""),p(this,"website",""),G(this,pn,t),G(this,dn,e),Object.assign(this,e)}static hydrate(t,e){return new Hr(e,t)}static async fetch(t){let e={fields:t.options.things.venue,slug:t.options.venue,limit:1};try{let n=await Z(t.options,"venue",e);return new Hr(t,n[0])}catch(t){return console.error("Fetch Venue:",t),{}}}get isMultiBuilding(){if(null==v(this,ct).isMultiBuilding){let t=v(this,pn).maps,e=t.reduce(((t,e)=>t.add(e.elevation)),new Set),n=t.length!==e.size;v(this,ct).isMultiBuilding=n}return v(this,ct).isMultiBuilding}toJSON(){return v(this,dn)}},$r=Hr;dn=new WeakMap,pn=new WeakMap,ct=new WeakMap,h();var fn,Wr=class{constructor(t){p(this,"id",""),E(this,fn,void 0),p(this,"name"),p(this,"type"),p(this,"weight"),p(this,"multiplier"),G(this,fn,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Wr(t)))}static async fetch(t){let e=t.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){Y(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await Z(t.options,"vortex",n)).map((t=>new Wr(t)))}catch(t){return console.error("Fetch Vortexes:",t),[]}}toJSON(){return v(this,fn)}},Jr=Wr;function Vd(t,e){let n=[];return t.features.forEach((t=>{var i,r;let a=[];null==(i=t.properties.spaces)||i.forEach((t=>{if("id"in t){let n;n=e.get(t.id),n&&a.push(...n)}else null==a||a.push({id:t.node,level:""})}));let o=a.map((t=>({node:"n_"+t.id,map:t.level}))),s=null==(r=t.properties.spaces)?void 0:r.filter((t=>"id"in t)),l=(t.properties.hours||[]).map((t=>({...t,"@type":"OpeningHoursSpecification",dayOfWeek:[t.dayOfWeek.replace("http://schema.org/","")]}))),u={...t.properties,polygons:s||[],nodes:o||[],description:t.properties.description||"",logo:t.properties.logo||{},picture:t.properties.picture||{},phone:t.properties.phone||{},social:t.properties.social||{},externalId:t.properties.externalId||"",states:t.properties.states||[],siblingGroups:t.properties.siblingGroups||[],operationHours:l};delete u.spaces,n.push(u)})),n}function kd(t){let e=new Set;return t.features.forEach((t=>{var n;null==(n=t.properties.states)||n.forEach((t=>{e.add(t.type)}))})),Array.from(e).map((t=>({id:t,name:t,value:t})))}function Fd(t){let e=[];return t.features.forEach((t=>{let n={...t.properties,icon:t.properties.picture};delete n.picture,e.push(n)})),e}function Zo(t){let e=1/0,n=1/0,i=-1/0,r=-1/0;return t.features.forEach((t=>{let a;a="MultiPolygon"===t.geometry.type?t.geometry.coordinates[0].flat():t.geometry.coordinates[0],a.forEach((t=>{e=Math.min(e,t[1]),i=Math.max(i,t[1]),n=Math.min(n,t[0]),r=Math.max(r,t[0])}))})),{id:t.features[0].properties.id,minLat:e,minLong:n,maxLat:i,maxLong:r}}function Ud(t,e,n){let i=n.createGeoreferences(),r=[];return t.features.forEach((t=>{let n=new Set;e.forEach((t=>{t.layer&&n.add(t.layer)}));let a=[...n].map((t=>({id:t,visible:!0}))),o={...t.properties,georeference:i,shortName:t.properties.abbreviation||"",scene:{polygons:e},group:t.properties.building,layers:a,width:2e3,height:2e3};r.push(o)})),r}fn=new WeakMap,h();var Vi=class{constructor(t){p(this,"mapExtent"),p(this,"stretchRatio"),p(this,"midLat"),p(this,"midLong"),p(this,"mapUnitRatio"),this.mapExtent=t;let{minLat:e,minLong:n,maxLat:i,maxLong:r}=t,a=(e+i)/2,o=(n+r)/2,s=new R(a,r),l=new R(a,n),u=new R(e,o),h=new R(i,o),c=u.distanceTo(h)/s.distanceTo(l),d=(i-e)/(r-n);this.stretchRatio=c/d,this.midLat=a,this.midLong=o,this.mapUnitRatio=1e6}convert(t){let e=t[1],n=t[0];return{x:(e-this.midLat)*this.mapUnitRatio*this.stretchRatio,y:(n-this.midLong)*this.mapUnitRatio}}createGeoreferences(){let{minLat:t,minLong:e,maxLat:n,maxLong:i}=this.mapExtent;return[[t,e],[t,i],[n,i],[n,e]].map((t=>({target:{x:t[0],y:t[1]},control:this.convert([t[1],t[0]])})))}};function jd(t,e){let n=[];return t.features.forEach((t=>{let i=e.convert(t.geometry.coordinates),r=(t.properties.neighbors||[]).map((e=>({node:e,map:t.properties.level}))),a=t.properties.level,o={...t.properties,x:i.x,y:i.y,paths:r,map:a,externalId:t.properties.externalId||""};n.push(o)})),n}var Yo=(t,e,n)=>{let i=[],r=new Map;return e.forEach((t=>{r.set(t.layer,t)})),t.features.forEach((t=>{if(!t.geometry.coordinates[0].forEach)return;let e,a=[];"entrances"in t.properties&&(a=t.properties.entrances.map((t=>({id:"n_"+t.id,node:"n_"+t.id,map:t.level})))),t.properties.layer&&(e=r.get(t.properties.layer));let o=t.geometry.coordinates[0].map((t=>n.convert(t))),s={...t.properties,entrances:a,map:t.properties.level,externalId:t.properties.externalId||"",geometry:{visible:!0,position:{x:0,y:0,z:1*((null==e?void 0:e.altitude)||0)},scale:{x:1,y:1,z:1*((null==e?void 0:e.height)||1)}},material:{color:(null==e?void 0:e.color)||"#000000"},vertexes:o};i.push(s)})),i};function zd(t,e,n,i){let r=n.features.map((t=>t.properties)),a=Yo(t,r,i),o=Yo(e,r,i);return a.concat(o)}function $d(t){let e=new Map;return t.forEach((t=>{t.features.forEach((t=>{let{destinations:n}=t.properties;if(0===n.length)return;let i=n[0].split("-")[0],r=e.get(i),a=n.map((t=>t.split("-")[1])).map((t=>"n_"+t));if(r)r.nodes.push(...a);else{let{name:n,type:r,weight:o,multiplier:s,accessible:l}=t.properties,u={id:i,nodes:a,name:n,type:r,weight:o,multiplier:s,accessible:l};e.set(i,u)}}))})),Array.from(e.values())}function Hd(t){let e=[];return t.features.forEach((t=>{let n={...t.properties};e.push(n)})),e}function Qo(t){let e=Object.keys(t),n=new Map,i=new Map,r=new Map,a=new Map,o=new Map,s=new Map;e.filter((t=>t.indexOf("/")>-1)).forEach((e=>{let o=e.split(/[\/\.]/),l=o[0],u=o[1];switch(l){case"connection":n.set(u,t[e]);break;case"level":i.set(u,t[e]);break;case"node":r.set(u,t[e]);break;case"obstruction":a.set(u,t[e]);break;case"space":s.set(u,t[e])}}));let l=t["building.geojson"]||t["building.json"],u=t["category.geojson"]||t["category.json"],h=t["location.geojson"]||t["location.json"],c=t["manifest.geojson"]||t["manifest.json"];return{connection:n,level:i,node:r,obstruction:a,polygonStyle:o,space:s,building:l,category:u,layerStyle:{type:"FeatureCollection",features:[]},location:h,manifest:c}}function es(t){let e=Array.from(t.connection.values()),n=Array.from(t.level.values()),i=t.building,r=t.category,a=t.layerStyle,o=t.location,s={},l=[];n.forEach((e=>{let n=e.features[0].properties.id,i=Zo(e),r=new Vi(i),o=t.obstruction.get(n),u=t.space.get(n);s[n]=zd(u,o,a,r);let h=t.node.get(n);l.push(...jd(h,r))}));let u=Object.values(s).flat(),h=$d(e),c=n.map((t=>{let e=t.features[0].properties.id,n=Zo(t),i=new Vi(n);return Ud(t,s[e],i)})).flat(),d=new Map;Array.from(t.space.values()).forEach((t=>{t.features.forEach((t=>{d.set(t.properties.id,t.properties.entrances)}))}));let f=Hd(i),p=Vd(o,d),g=Fd(r),v=kd(o),y=t.manifest.features[0].properties.name,m=t.manifest.features[0].geometry.coordinates[0],b=t.manifest.features[0].geometry.coordinates[1];return{locations:p,categories:g,nodes:l,maps:c,polygons:u,vortexes:h,mapGroups:f,locationStates:v,themes:[],venue:{name:y,latitude:b,longitude:m}}}var Fi,ki={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,do2D:!1,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""};!function(t){t.CATEGORY="categories",t.EVENT="events",t.LOCATION="locations",t.MAPGROUP="mapGroups",t.MAP="maps",t.NODE="nodes",t.POLYGON="polygons",t.VORTEX="vortexes"}(Fi||(Fi={}));var Je,pt,dt={categories:Lr,locations:ot,vortexes:Jr,maps:Cr,nodes:kr,polygons:st,venue:$r,events:Br,mapGroups:Gr,themes:Gi,locationStates:qi,locationRankings:Ci,rankings:Ur},tt=class{constructor(t){p(this,"perspective"),p(this,"things"),p(this,"options"),E(this,Je,void 0),E(this,pt,""),p(this,"updatedAt"),p(this,"categories",[]),p(this,"locations",[]),p(this,"vortexes",[]),p(this,"maps",[]),p(this,"nodes",[]),p(this,"polygons",[]),p(this,"venue",{}),p(this,"events",[]),p(this,"mapGroups",[]),p(this,"themes",[]),p(this,"locationStates",[]),p(this,"locationRankings",[]),p(this,"rankings"),p(this,"_categoriesById"),p(this,"_locationsById"),p(this,"_vortexesById"),p(this,"_mapsById"),p(this,"_nodesById"),p(this,"_polygonsById"),p(this,"_eventsById"),p(this,"_mapGroupsById"),p(this,"_locationStatesById"),p(this,"_locationRankingsById"),p(this,"_rankingsById"),p(this,"_categoriesByExternalId"),p(this,"_locationsByExternalId"),p(this,"_vortexesByExternalId"),p(this,"_mapsByExternalId"),p(this,"_nodesByExternalId"),p(this,"_polygonsByExternalId"),p(this,"_eventsByExternalId"),p(this,"_mapGroupsByExternalId"),p(this,"_locationStatesByExternalId"),p(this,"_locationRankingsByExternalId"),p(this,"_rankingsByExternalId"),p(this,"images"),p(this,"scenes"),p(this,"navigator"),this.options=t,G(this,Je,ye.create(this))}generateGetters(t){try{for(let e=0,n=t.length;e<n;++e){let n=t[e];Array.isArray(this[n])&&(Object.defineProperty(this,`_${n}ByExternalId`,{get(){let t=v(this,Je)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),v(this,Je)[n]=e,e}}),Object.defineProperty(this,`_${n}ById`,{get(){let t=v(this,Je)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),v(this,Je)[n]=e,e}}))}return this}catch(t){throw new Error("Unable to generate getters, "+t)}}getCollectionItemById(t,e){let n=`_${t}ByExternalId`,i=this[`_${t}ById`];return null!=i&&null!=i[e]||(i=this[n],null!=i&&null!=i[e])?i[e]:null}async hydrateFromMVF(t){let e=es(t);return this.hydrate(e)}async hydrate(t,e){let n;if("string"==typeof t)try{G(this,pt,t),n=JSON.parse(t)}catch(t){return void console.error("Unable to parse JSON",t)}else n=t,G(this,pt,JSON.stringify(n));let i=Object.keys(n);for(let t=0,e=i.length;t<e;++t){let e=i[t],r=n[e];null!=dt[e]&&"function"==typeof dt[e].hydrate&&(this[e]=dt[e].hydrate(r,this))}e&&await Xo(n);let{images:r,scenes:a}=n;this.images=r,this.scenes=a,this.generateGetters(i),this.initNavigator()}async fetch(){"vortexes"in this.options.things||(this.options.things.vortexes=["name","type","accessible","weight","multiplier","nodes"]),"locationStates"in this.options.things||(this.options.things.locationStates=["name","id","value"]),Ho(this.options.clientId)||(this.options.things.rankings&&delete this.options.things.rankings,this.options.things.locationRankings&&delete this.options.things.locationRankings);let{things:t}=this.options,e=[],n=Object.keys(t);for(let t=0,i=n.length;t<i;++t){let i=n[t];dt[i]&&e.push(dt[i].fetch(this).then((t=>(this[i]=t,Promise.resolve()))))}return this.generateGetters(n),Promise.all(e).then((()=>{this.initNavigator()}))}initNavigator(){this.navigator=new Ei({locations:this.locations.map((t=>t.toJSON())),nodes:this.nodes.map((t=>t.toJSON())),vortexes:this.vortexes.map((t=>t.toJSON())),maps:this.maps.map((t=>t.toJSON()))})}toJSON(){var t;let e={};for(let t in dt)Array.isArray(this[t])&&(e[t]=this[t].map((t=>t.toJSON())));return{...e,venue:this.venue.toJSON(),rankings:null==(t=this.rankings)?void 0:t.toJSON()}}toString(){return v(this,pt)||JSON.stringify(this.toJSON())}};Je=new WeakMap,pt=new WeakMap,h();var Ui,ts={venue:["slug","name","defaultMap","metadata","countrycode","tzid","logo","externalId"],nodes:["externalId","x","y","paths","accessible","operationHours"],vortexes:["externalId","nodes","types","accessible"],polygons:["vertexes","geometry","canvasBounds","layer","externalId","entrances"],locations:["externalId","name","type","picture","description","icon","logo","sortOrder","phone","operationHours","social","color","toMap","tags","shortName","detailsUrl","locationState","metadata","siblingGroups","gallery"],categories:["name","color","sortOrder","parents"],maps:["name","elevation","height","width","layers","shortName","scene","group","x_scale"],mapGroups:["name"],themes:["name","themeData"],rankings:["polygons"],locationRankings:[]};h(),function(t){t.MULTI_GEOMETRY="MULTI_GEOMETRY",t.SINGLE_GEOMETRY="SINGLE_GEOMETRY"}(Ui||(Ui={})),as(),globalThis.btoa||(globalThis.btoa=zs.encode);var gp=["ar"];function xn(t){let e={...ki,things:ts,...t};return e.noAuth||(e.accessToken?e.authorization=`Bearer ${e.accessToken}`:e.clientId&&e.clientSecret&&(e.authorization=`Basic ${globalThis.btoa(`${e.clientId}:${e.clientSecret}`)}`)),e}async function Pg(t){let{venue:e,clientId:n,clientSecret:i}=t,r=new tt({venue:e}),a=Qo(await vp({clientId:n,clientSecret:i,venue:e},!1));return r.hydrateFromMVF(a),r}async function Ag(t){let e=xn({baseUrl:"https://api-gateway.mappedin.com/",...t}),n=new tt({...e,baseUrl:e.baseUrl+"public/1/"});return await n.fetch(),n}var da={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function Lg(t){let e=xn({baseUrl:"https://api-gateway.mappedin.com/",...da,...t}),{url:n,updated_at:i}=await yp(t),r=await fetch(n,{mode:"cors"}),{data:a,format:o="jsonstring"}=await r.json();if("jsonstring"!==o)throw new Error(`Unrecognized format ${o}`);let s=new tt(e);return await s.hydrate(a,e.shouldPopulateBundledImagesAsBlobs),s.updatedAt=i,s}async function yp(t){let e=xn({baseUrl:"https://api-gateway.mappedin.com/",...da,...t}),{version:n,venue:i}=t,r=`${t.bundleBaseUri||e.baseUrl+`exports/legacy${null!=e.language&&gp.includes(e.language)?"-"+e.language:""}/1/bundle`}?venue=${i}&version=1.0.0`;return e.language=void 0,await Ar(e,r)}async function Dg(t,{url:e,updated_at:n}){let i=xn({baseUrl:"https://api-gateway.mappedin.com/",...da,...t}),r=await fetch(e,{mode:"cors"}),{data:a,format:o="jsonstring"}=await r.json();if("jsonstring"!==o)throw new Error(`Unrecognized format${o}`);let s=new tt(i);return await s.hydrate(a,i.shouldPopulateBundledImagesAsBlobs),s.updatedAt=n,s}async function $s(t){let e=xn({baseUrl:"https://api-gateway.mappedin.com/",...ki,...t}),{version:n,venue:i}=t,r=`${t.bundleBaseUri||e.baseUrl+"exports/mvf/1/bundle"}?venue=${i}&version=1.0.0`;return e.language=void 0,await Ar(e,r)}async function vp(t,e=!1){return new Promise((async(n,i)=>{try{let r;if("TextDecoder"in globalThis){let t=new TextDecoder;r=t.decode.bind(t)}else{let t=new((await import("util")).TextDecoder);r=t.decode.bind(t)}let a=await Promise.resolve().then((()=>(js(),Us)));if(e){let e=new Blob(['var enc = new TextDecoder();\n\t\t\t\tvar currentTaskName;\n\t\t\t\tself.onmessage = async function({ data }) {\n\t\t\t\t\tif (data[0] === "task") {\n\t\t\t\t\t\tcurrentTaskName = data[1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tpostMessage([\n\t\t\t\t\t\t\t "finished",\n\t\t\t\t\t\t [currentTaskName, JSON.parse(enc.decode(data))]\n\t\t\t\t\t\t]);\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t postMessage(["error", e.toString()]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t currentTaskName = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t'],{type:"text/javascript"}),{url:o}=await $s(t),s=new Uint8Array(await fetch(o).then((t=>t.arrayBuffer()))),l=a.unzipSync(s),u=Object.keys(l),h=Math.min(u.length,Math.min(4,navigator.hardwareConcurrency)||4),c=[],d=u.map((t=>[t,l[t].buffer])),f=1e6,p=[],g=[];for(let t=0;t<d.length;t++){let[,e]=d[t];e.byteLength>=f?p.push(d[t]):e.byteLength<f&&g.push(d[t])}let v={};if(0===g.length)d.forEach((([t])=>{v[t]=JSON.parse(r(l[t]))})),n(v);else{let t=function({data:t}){let e=this;if("finished"===t[0]){let n=g[o];if(null!=n){let[t,i]=n;e.postMessage(["task",t]),e.postMessage(i,[i]),o++}let[i,r]=t[1];v[i]=r,s++}else if("error"===t[0]){let[,e]=t;c.forEach((t=>t.terminate())),i(e)}s===u.length&&(n(v),c.forEach((t=>t.terminate())))},a=URL.createObjectURL(e);for(let t=0;t<Math.min(h,g.length);t++)c.push(new Worker(a));let o=0,s=0;c.forEach((e=>{if(e.onmessage=t,null!=g[o]){let[t,n]=g[o];e.postMessage(["task",t]),e.postMessage(n,[n]),o++}})),p.forEach((([t])=>{v[t]=JSON.parse(r(l[t])),s++}))}}else{let{url:e}=await $s(t),i=new Uint8Array(await fetch(e).then((t=>t.arrayBuffer()))),o=a.unzipSync(i),s=Object.keys(o),l={};for(let t=0;t<s.length;t++){let e=s[t];"/"!==e.slice(-1)&&(l[e]=JSON.parse(r(o[e])))}n(l)}}catch(t){i(t)}}))}export{Ui as MAP_RENDER_MODE,tt as Mappedin,Lr as MappedinCategory,Fi as MappedinCollectionType,Qt as MappedinCoordinate,_r as MappedinDestinationSet,Ct as MappedinDirections,Br as MappedinEvent,ot as MappedinLocation,Cr as MappedinMap,Gr as MappedinMapGroup,$e as MappedinNavigatable,kr as MappedinNode,st as MappedinPolygon,Ur as MappedinRankings,$r as MappedinVenue,Jr as MappedinVortex,Dg as downloadBundle,vp as downloadVenueBundleMVF,Ag as getVenue,Lg as getVenueBundle,yp as getVenueBundleURL,Pg as getVenueMVF,$s as getVenueMVFURL};
1
+ var $u=Object.create,Ut=Object.defineProperty,Hu=Object.getOwnPropertyDescriptor,Ju=Object.getOwnPropertyNames,Wu=Object.getPrototypeOf,Xu=Object.prototype.hasOwnProperty,Ku=(t,e,n)=>e in t?Ut(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Va=t=>Ut(t,"__esModule",{value:!0}),ka=(t,e)=>()=>(t&&(e=t(t=0)),e),G=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Zu=(t,e)=>{for(var n in Va(t),e)Ut(t,n,{get:e[n],enumerable:!0})},Yu=(t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let r of Ju(e))!Xu.call(t,r)&&"default"!==r&&Ut(t,r,{get:()=>e[r],enumerable:!(n=Hu(e,r))||n.enumerable});return t},Ai=t=>Yu(Va(Ut(null!=t?$u(Wu(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),d=(t,e,n)=>(Ku(t,"symbol"!=typeof e?e+"":e,n),n),Ua=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},y=(t,e,n)=>(Ua(t,e,"read from private field"),n?n.call(t):e.get(t)),A=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},S=(t,e,n,r)=>(Ua(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),p=ka((()=>{})),ja=G(((t,e)=>{p(),function(n){var r="object"==typeof t&&t,i="object"==typeof e&&e&&e.exports==r&&e,a="object"==typeof global&&global;(a.global===a||a.window===a)&&(n=a);var o=function(t){this.message=t};(o.prototype=new Error).name="InvalidCharacterError";var s=function(t){throw new o(t)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,h={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,r,i,a=t.length%3,o="",u=-1,h=t.length-a;++u<h;)e=t.charCodeAt(u)<<16,n=t.charCodeAt(++u)<<8,r=t.charCodeAt(++u),o+=l.charAt((i=e+n+r)>>18&63)+l.charAt(i>>12&63)+l.charAt(i>>6&63)+l.charAt(63&i);return 2==a?(e=t.charCodeAt(u)<<8,n=t.charCodeAt(++u),o+=l.charAt((i=e+n)>>10)+l.charAt(i>>4&63)+l.charAt(i<<2&63)+"="):1==a&&(i=t.charCodeAt(u),o+=l.charAt(i>>2)+l.charAt(i<<4&63)+"=="),o},decode:function(t){var e=(t=String(t).replace(u,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var n,r,i=0,a="",o=-1;++o<e;)r=l.indexOf(t.charAt(o)),n=i%4?64*n+r:r,i++%4&&(a+=String.fromCharCode(255&n>>(-2*i&6)));return a},version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return h}));else if(r&&!r.nodeType)if(i)i.exports=h;else for(var c in h)h.hasOwnProperty(c)&&(r[c]=h[c]);else n.base64=h}(t)})),ae=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.areaConversion=t.timeConversion=t.distanceConversion=t.altitudeKeys=t.latitudeKeys=t.longitudeKeys=t.MAXLON=t.MINLON=t.MAXLAT=t.MINLAT=t.earthRadius=t.sexagesimalPattern=void 0;t.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/;t.earthRadius=6378137;t.MINLAT=-90;t.MAXLAT=90;t.MINLON=-180;t.MAXLON=180;t.longitudeKeys=["lng","lon","longitude",0];t.latitudeKeys=["lat","latitude",1];t.altitudeKeys=["alt","altitude","elevation","elev",2];t.distanceConversion={m:1,km:.001,cm:100,mm:1e3,mi:1/1609.344,sm:1/1852.216,ft:100/30.48,in:100/2.54,yd:1/.9144};t.timeConversion={m:60,h:3600,d:86400};var e={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};t.areaConversion=e,e.sqm=e.m2,e.sqkm=e.km2,e.sqft=e.ft2,e.sqyd=e.yd2,e.sqin=e.in2})),zt=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t,e){return e.reduce((function(e,n){if(null==t)throw new Error("'".concat(t,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(t,n)&&void 0!==n&&void 0===e?(e=n,n):e}),void 0)};t.default=e})),$t=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){var e=t.toString().trim();return!isNaN(parseFloat(e))&&parseFloat(e)===Number(e)};t.default=e})),Ht=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ae(),n=function(t){return e.sexagesimalPattern.test(t.toString().trim())};t.default=n})),Jt=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ae(),n=function(t){var n=new RegExp(e.sexagesimalPattern).exec(t);if(null==n)throw new Error("Given value is not in sexagesimal format");var r=Number(n[2])/60||0,i=Number(n[4])/3600||0,a=parseFloat(n[1])+r+i;return["S","W"].includes(n[7])?-a:a};t.default=n})),Jn=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=ae(),r=(e=zt())&&e.__esModule?e:{default:e};function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:n.longitudeKeys,latitude:n.latitudeKeys,altitude:n.altitudeKeys},i=(0,r.default)(t,e.longitude),o=(0,r.default)(t,e.latitude),s=(0,r.default)(t,e.altitude);return a({latitude:o,longitude:i},s?{altitude:s}:{})};t.default=s})),Bi=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a($t()),n=a(Ht()),r=a(Jt()),i=ae();function a(t){return t&&t.__esModule?t:{default:t}}var o=function t(a){return(0,e.default)(a)?!(parseFloat(a)>i.MAXLAT||a<i.MINLAT):!!(0,n.default)(a)&&t((0,r.default)(a))};t.default=o})),Ri=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a($t()),n=a(Ht()),r=a(Jt()),i=ae();function a(t){return t&&t.__esModule?t:{default:t}}var o=function t(a){return(0,e.default)(a)?!(parseFloat(a)>i.MAXLON||a<i.MINLON):!!(0,n.default)(a)&&t((0,r.default)(a))};t.default=o})),qi=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Jn()),n=i(Bi()),r=i(Ri());function i(t){return t&&t.__esModule?t:{default:t}}var a=function(t){var i=(0,e.default)(t),a=i.latitude,o=i.longitude;if(Array.isArray(t)&&t.length>=2)return(0,r.default)(t[0])&&(0,n.default)(t[1]);if(void 0===a||void 0===o)return!1;var s=t[o],l=t[a];return!(void 0===l||void 0===s||!1===(0,n.default)(l)||!1===(0,r.default)(s))};t.default=a})),Yn=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o($t()),n=o(Ht()),r=o(Jt()),i=o(qi()),a=o(Jn());function o(t){return t&&t.__esModule?t:{default:t}}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var h=function t(o){if((0,e.default)(o))return Number(o);if((0,n.default)(o))return(0,r.default)(o);if((0,i.default)(o)){var s=(0,a.default)(o);return Array.isArray(o)?o.map((function(e,n){return[0,1].includes(n)?t(e):e})):l(l(l({},o),s.latitude&&u({},s.latitude,t(o[s.latitude]))),s.longitude&&u({},s.longitude,t(o[s.longitude])))}return Array.isArray(o)?o.map((function(e){return(0,i.default)(e)?t(e):e})):o};t.default=h})),we=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ae(),n=i(zt()),r=i(Yn());function i(t){return t&&t.__esModule?t:{default:t}}var a=function(t,i){var a=(0,n.default)(t,e.latitudeKeys);if(null!=a){var o=t[a];return!0===i?o:(0,r.default)(o)}};t.default=a})),Ie=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ae(),n=i(zt()),r=i(Yn());function i(t){return t&&t.__esModule?t:{default:t}}var a=function(t,i){var a=(0,n.default)(t,e.longitudeKeys);if(null!=a){var o=t[a];return!0===i?o:(0,r.default)(o)}};t.default=a})),Se=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return t*Math.PI/180};t.default=e})),tt=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return 180*t/Math.PI};t.default=e})),eo=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(we()),n=o(Ie()),r=o(Se()),i=o(tt()),a=ae();function o(t){return t&&t.__esModule?t:{default:t}}var s=function(t,o,s){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,u=(0,e.default)(t),h=(0,n.default)(t),c=o/l,d=(0,r.default)(s),f=(0,r.default)(u),p=(0,r.default)(h),y=Math.asin(Math.sin(f)*Math.cos(c)+Math.cos(f)*Math.sin(c)*Math.cos(d)),g=p+Math.atan2(Math.sin(d)*Math.sin(c)*Math.cos(f),Math.cos(c)-Math.sin(f)*Math.sin(y)),v=(0,i.default)(g);return(v<a.MINLON||v>a.MAXLON)&&(g=(g+3*Math.PI)%(2*Math.PI)-Math.PI,v=(0,i.default)(g)),{latitude:(0,i.default)(y),longitude:v}};t.default=s})),to=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ae(),n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=e.areaConversion[n];if(r)return t*r;throw new Error("Invalid unit used for area conversion.")};t.default=n})),no=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ae(),n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=e.distanceConversion[n];if(r)return t*r;throw new Error("Invalid unit used for distance conversion.")};t.default=n})),ro=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ae(),n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(n){case"kmh":return t*e.timeConversion.h*e.distanceConversion.km;case"mph":return t*e.timeConversion.h*e.distanceConversion.mi;default:return t}};t.default=n})),oo=G((t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{!r&&null!=s.return&&s.return()}finally{if(i)throw a}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(t){var e=Math.pow(10,12);return Math.round(t*e)/e},i=function(t){var n=e(t.toString().split("."),2),i=n[0],a=n[1],o=Math.abs(Number(i)),s=r(60*Number("0."+(a||0))),l=Math.floor(s),u=r(60*(s%l||0));return o+"° "+Number(l.toFixed(6)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+"' "+Number(u.toFixed(4)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+'"'};t.default=i})),Ui=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return t>1?1:t<-1?-1:t};t.default=e})),He=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(we()),n=o(Ie()),r=o(Se()),i=o(Ui()),a=ae();function o(t){return t&&t.__esModule?t:{default:t}}var s=function(t,o){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;s=void 0===s||isNaN(s)?1:s;var l=(0,e.default)(t),u=(0,n.default)(t),h=(0,e.default)(o),c=(0,n.default)(o),d=Math.acos((0,i.default)(Math.sin((0,r.default)(h))*Math.sin((0,r.default)(l))+Math.cos((0,r.default)(h))*Math.cos((0,r.default)(l))*Math.cos((0,r.default)(u)-(0,r.default)(c))))*a.earthRadius;return Math.round(d/s)*s};t.default=s})),ji=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=He())&&e.__esModule?e:{default:e};var r=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default;return r="function"==typeof r?r:n.default,e.slice().sort((function(e,n){return r(t,e)-r(t,n)}))};t.default=r})),lo=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ji())&&e.__esModule?e:{default:e};var r=function(t,e){return(0,n.default)(t,e)[0]};t.default=r})),ho=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Se()),n=a(we()),r=a(Ie()),i=ae();function a(t){return t&&t.__esModule?t:{default:t}}var o=function(t){var a=0;if(t.length>2){for(var o,s,l,u=0;u<t.length;u++){u===t.length-2?(o=t.length-2,s=t.length-1,l=0):u===t.length-1?(o=t.length-1,s=0,l=1):(o=u,s=u+1,l=u+2);var h=(0,r.default)(t[o]),c=(0,n.default)(t[s]),d=(0,r.default)(t[l]);a+=((0,e.default)(d)-(0,e.default)(h))*Math.sin((0,e.default)(c))}a=a*i.earthRadius*i.earthRadius/2}return Math.abs(a)};t.default=o})),Hi=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(we()),n=r(Ie());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t){if(!1===Array.isArray(t)||0===t.length)throw new Error("No points were given.");return t.reduce((function(t,r){var i=(0,e.default)(r),a=(0,n.default)(r);return{maxLat:Math.max(i,t.maxLat),minLat:Math.min(i,t.minLat),maxLng:Math.max(a,t.maxLng),minLng:Math.min(a,t.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})};t.default=i})),yo=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(we()),n=o(Ie()),r=o(Se()),i=o(tt()),a=ae();function o(t){return t&&t.__esModule?t:{default:t}}var s=function(t,o){var s,l,u=(0,e.default)(t),h=(0,n.default)(t),c=(0,r.default)(u),d=(0,r.default)(h),f=o/a.earthRadius,p=c-f,y=c+f,g=(0,r.default)(a.MAXLAT),v=(0,r.default)(a.MINLAT),m=(0,r.default)(a.MAXLON),b=(0,r.default)(a.MINLON);if(p>v&&y<g){var M=Math.asin(Math.sin(f)/Math.cos(c));(s=d-M)<b&&(s+=2*Math.PI),(l=d+M)>m&&(l-=2*Math.PI)}else p=Math.max(p,v),y=Math.min(y,g),s=b,l=m;return[{latitude:(0,i.default)(p),longitude:(0,i.default)(s)},{latitude:(0,i.default)(y),longitude:(0,i.default)(l)}]};t.default=s})),Mo=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(we()),n=a(Ie()),r=a(Se()),i=a(tt());function a(t){return t&&t.__esModule?t:{default:t}}var o=function(t){if(!1===Array.isArray(t)||0===t.length)return!1;var a=t.length,o=t.reduce((function(t,i){var a=(0,r.default)((0,e.default)(i)),o=(0,r.default)((0,n.default)(i));return{X:t.X+Math.cos(a)*Math.cos(o),Y:t.Y+Math.cos(a)*Math.sin(o),Z:t.Z+Math.sin(a)}}),{X:0,Y:0,Z:0}),s=o.X/a,l=o.Y/a,u=o.Z/a;return{longitude:(0,i.default)(Math.atan2(l,s)),latitude:(0,i.default)(Math.atan2(u,Math.sqrt(s*s+l*l)))}};t.default=o})),xo=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Hi())&&e.__esModule?e:{default:e};var r=function(t){var e=(0,n.default)(t),r=e.minLat+(e.maxLat-e.minLat)/2,i=e.minLng+(e.maxLng-e.minLng)/2;return{latitude:parseFloat(r.toFixed(6)),longitude:parseFloat(i.toFixed(6))}};t.default=r})),Ji=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(we()),n=a(Ie()),r=a(Se()),i=a(tt());function a(t){return t&&t.__esModule?t:{default:t}}var o=function(t,a){var o=(0,r.default)((0,n.default)(a))-(0,r.default)((0,n.default)(t)),s=Math.log(Math.tan((0,r.default)((0,e.default)(a))/2+Math.PI/4)/Math.tan((0,r.default)((0,e.default)(t))/2+Math.PI/4));return Math.abs(o)>Math.PI&&(o=o>0?-1*(2*Math.PI-o):2*Math.PI+o),((0,i.default)(Math.atan2(o,s))+360)%360};t.default=o})),To=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Ji())&&e.__esModule?e:{default:e};var r=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,i="function"==typeof r?r(t,e):(0,n.default)(t,e);if(isNaN(i))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(i/22.5)){case 1:return"NNE";case 2:return"NE";case 3:return"ENE";case 4:return"E";case 5:return"ESE";case 6:return"SE";case 7:return"SSE";case 8:return"S";case 9:return"SSW";case 10:return"SW";case 11:return"WSW";case 12:return"W";case 13:return"WNW";case 14:return"NW";case 15:return"NNW";default:return"N"}};t.default=r})),Xi=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(He()),n=r(Ui());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t,r,i){var a=(0,e.default)(r,t),o=(0,e.default)(t,i),s=(0,e.default)(r,i),l=Math.acos((0,n.default)((a*a+s*s-o*o)/(2*a*s))),u=Math.acos((0,n.default)((o*o+s*s-a*a)/(2*o*s)));return l>Math.PI/2?a:u>Math.PI/2?o:Math.sin(l)*a};t.default=i})),Ao=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(we()),n=a(Ie()),r=a(Se()),i=a(tt());function a(t){return t&&t.__esModule?t:{default:t}}var o=function(t,a){var o=(0,e.default)(a),s=(0,n.default)(a),l=(0,e.default)(t),u=(0,n.default)(t);return((0,i.default)(Math.atan2(Math.sin((0,r.default)(s)-(0,r.default)(u))*Math.cos((0,r.default)(o)),Math.cos((0,r.default)(l))*Math.sin((0,r.default)(o))-Math.sin((0,r.default)(l))*Math.cos((0,r.default)(o))*Math.cos((0,r.default)(s)-(0,r.default)(u))))+360)%360};t.default=o})),Do=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=He())&&e.__esModule?e:{default:e};function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.default;return t.reduce((function(t,n){return"object"===r(t)&&null!==t.last&&(t.distance+=e(n,t.last)),t.last=n,t}),{last:null,distance:0}).distance};t.default=i})),Eo=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(we()),n=a(Ie()),r=a(Se()),i=ae();function a(t){return t&&t.__esModule?t:{default:t}}var o=function(t,a){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;o=void 0===o||isNaN(o)?1:o;var s,l,u,h,c,d,f,p=(0,e.default)(t),y=(0,n.default)(t),g=(0,e.default)(a),v=(0,n.default)(a),m=6356752.314245,b=1/298.257223563,M=(0,r.default)(v-y),w=Math.atan((1-b)*Math.tan((0,r.default)(parseFloat(p)))),_=Math.atan((1-b)*Math.tan((0,r.default)(parseFloat(g)))),x=Math.sin(w),O=Math.cos(w),N=Math.sin(_),I=Math.cos(_),S=M,E=100;do{var A=Math.sin(S),j=Math.cos(S);if(0===(d=Math.sqrt(I*A*(I*A)+(O*N-x*I*j)*(O*N-x*I*j))))return 0;s=x*N+O*I*j,l=Math.atan2(d,s),c=s-2*x*N/(h=1-(u=O*I*A/d)*u),isNaN(c)&&(c=0);var T=b/16*h*(4+b*(4-3*h));f=S,S=M+(1-T)*b*u*(l+T*d*(c+T*s*(2*c*c-1)))}while(Math.abs(S-f)>1e-12&&--E>0);if(0===E)return NaN;var P=h*(i.earthRadius*i.earthRadius-m*m)/(m*m),k=1+P/16384*(4096+P*(P*(320-175*P)-768)),B=P/1024*(256+P*(P*(74-47*P)-128)),R=B*d*(c+B/4*(s*(2*c*c-1)-B/6*c*(4*d*d-3)*(4*c*c-3))),F=m*k*(l-R);return Math.round(F/o)*o};t.default=o})),Ro=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return/^NNE|NE|NNW|N$/.test(t)?"N":/^ENE|E|ESE|SE$/.test(t)?"E":/^SSE|S|SSW|SW$/.test(t)?"S":/^WSW|W|WNW|NW$/.test(t)?"W":void 0};t.default=e})),Co=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=He())&&e.__esModule?e:{default:e};var r=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,i=r(t,e),a=Number(e.time)-Number(t.time),o=i/a*1e3;return o};t.default=r})),qo=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=He())&&e.__esModule?e:{default:e};var r=function(t,e,r){return(0,n.default)(e,t)+(0,n.default)(t,r)===(0,n.default)(e,r)};t.default=r})),Go=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(we()),n=r(Ie());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t,r){for(var i=!1,a=r.length,o=-1,s=a-1;++o<a;s=o)((0,n.default)(r[o])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(r[s])||(0,n.default)(r[s])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(r[o]))&&(0,e.default)(t)<((0,e.default)(r[s])-(0,e.default)(r[o]))*((0,n.default)(t)-(0,n.default)(r[o]))/((0,n.default)(r[s])-(0,n.default)(r[o]))+(0,e.default)(r[o])&&(i=!i);return i};t.default=i})),Vo=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Xi())&&e.__esModule?e:{default:e};var r=function(t,e,r,i){return(0,n.default)(t,e,r)<i};t.default=r})),ko=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=He())&&e.__esModule?e:{default:e};var r=function(t,e,r){return(0,n.default)(t,e)<r};t.default=r})),jo=G((t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{!r&&null!=s.return&&s.return()}finally{if(i)throw a}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}p(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(t){if(!t.startsWith("POLYGON"))throw new Error("Invalid wkt.");return t.slice(t.indexOf("(")+2,t.indexOf(")")).split(", ").map((function(t){var n=e(t.split(" "),2),r=n[0],i=n[1];return{longitude:parseFloat(r),latitude:parseFloat(i)}}))};t.default=r})),$o=G((t=>{p(),Object.defineProperty(t,"__esModule",{value:!0});var e={computeDestinationPoint:!0,convertArea:!0,convertDistance:!0,convertSpeed:!0,decimalToSexagesimal:!0,findNearest:!0,getAreaOfPolygon:!0,getBounds:!0,getBoundsOfDistance:!0,getCenter:!0,getCenterOfBounds:!0,getCompassDirection:!0,getCoordinateKey:!0,getCoordinateKeys:!0,getDistance:!0,getDistanceFromLine:!0,getGreatCircleBearing:!0,getLatitude:!0,getLongitude:!0,getPathLength:!0,getPreciseDistance:!0,getRhumbLineBearing:!0,getRoughCompassDirection:!0,getSpeed:!0,isDecimal:!0,isPointInLine:!0,isPointInPolygon:!0,isPointNearLine:!0,isPointWithinRadius:!0,isSexagesimal:!0,isValidCoordinate:!0,isValidLatitude:!0,isValidLongitude:!0,orderByDistance:!0,sexagesimalToDecimal:!0,toDecimal:!0,toRad:!0,toDeg:!0,wktToPolygon:!0};Object.defineProperty(t,"computeDestinationPoint",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"convertArea",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"convertDistance",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"convertSpeed",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"decimalToSexagesimal",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"findNearest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"getAreaOfPolygon",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"getBounds",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"getBoundsOfDistance",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"getCenter",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"getCenterOfBounds",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"getCompassDirection",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"getCoordinateKey",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"getCoordinateKeys",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"getDistance",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"getDistanceFromLine",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"getGreatCircleBearing",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"getLatitude",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(t,"getLongitude",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(t,"getPathLength",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"getPreciseDistance",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"getRhumbLineBearing",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(t,"getRoughCompassDirection",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(t,"getSpeed",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(t,"isDecimal",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(t,"isPointInLine",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"isPointInPolygon",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(t,"isPointNearLine",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(t,"isPointWithinRadius",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"isSexagesimal",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(t,"isValidCoordinate",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"isValidLatitude",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(t,"isValidLongitude",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(t,"orderByDistance",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(t,"sexagesimalToDecimal",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(t,"toDecimal",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(t,"toRad",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(t,"toDeg",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(t,"wktToPolygon",{enumerable:!0,get:function(){return U.default}});var n=q(eo()),r=q(to()),i=q(no()),a=q(ro()),o=q(oo()),s=q(lo()),l=q(ho()),u=q(Hi()),h=q(yo()),c=q(Mo()),d=q(xo()),f=q(To()),y=q(zt()),g=q(Jn()),v=q(He()),m=q(Xi()),b=q(Ao()),M=q(we()),w=q(Ie()),_=q(Do()),x=q(Eo()),O=q(Ji()),N=q(Ro()),I=q(Co()),S=q($t()),E=q(qo()),A=q(Go()),j=q(Vo()),T=q(ko()),P=q(Ht()),k=q(qi()),B=q(Bi()),R=q(Ri()),F=q(ji()),L=q(Jt()),D=q(Yn()),W=q(Se()),C=q(tt()),U=q(jo()),G=ae();function q(t){return t&&t.__esModule?t:{default:t}}Object.keys(G).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return G[n]}})}))})),Ss=G(((t,e)=>{p(),e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))})),qs=G(((t,e)=>{p();var n="%[a-f0-9]{2}",r=new RegExp(n,"gi"),i=new RegExp("("+n+")+","gi");function a(t,e){try{return decodeURIComponent(t.join(""))}catch(t){}if(1===t.length)return t;e=e||1;var n=t.slice(0,e),r=t.slice(e);return Array.prototype.concat.call([],a(n),a(r))}function o(t){try{return decodeURIComponent(t)}catch(i){for(var e=t.match(r),n=1;n<e.length;n++)e=(t=a(e,n).join("")).match(r);return t}}e.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return function(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},n=i.exec(t);n;){try{e[n[0]]=decodeURIComponent(n[0])}catch(t){var r=o(n[0]);r!==n[0]&&(e[n[0]]=r)}n=i.exec(t)}e["%C2"]="�";for(var a=Object.keys(e),s=0;s<a.length;s++){var l=a[s];t=t.replace(new RegExp(l,"g"),e[l])}return t}(t)}}})),Gs=G(((t,e)=>{p(),e.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];let n=t.indexOf(e);return-1===n?[t]:[t.slice(0,n),t.slice(n+e.length)]}})),ks=G(((t,e)=>{p(),e.exports=function(t,e){for(var n={},r=Object.keys(t),i=Array.isArray(e),a=0;a<r.length;a++){var o=r[a],s=t[o];(i?-1!==e.indexOf(o):e(o,s,t))&&(n[o]=s)}return n}})),Xs=G((t=>{p();var e=Ss(),n=qs(),r=Gs(),i=ks(),a=Symbol("encodeFragmentIdentifier");function o(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function s(t,n){return n.encode?n.strict?e(t):encodeURIComponent(t):t}function l(t,e){return e.decode?n(t):t}function u(t){return Array.isArray(t)?t.sort():"object"==typeof t?u(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function h(t){let e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function c(t){let e=(t=h(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function d(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):e.parseBooleans&&null!==t&&("true"===t.toLowerCase()||"false"===t.toLowerCase())&&(t="true"===t.toLowerCase()),t}function f(t,e){o((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);let n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==r[t]?r[t]=[].concat(r[t],n):r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{let i="string"==typeof n&&n.includes(t.arrayFormatSeparator),a="string"==typeof n&&!i&&l(n,t).includes(t.arrayFormatSeparator);n=a?l(n,t):n;let o=i||a?n.split(t.arrayFormatSeparator).map((e=>l(e,t))):null===n?n:l(n,t);r[e]=o};case"bracket-separator":return(e,n,r)=>{let i=/(\[\])$/.test(e);if(e=e.replace(/\[\]$/,""),!i)return void(r[e]=n&&l(n,t));let a=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>l(e,t)));void 0!==r[e]?r[e]=[].concat(r[e],a):r[e]=a};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[].concat(n[t],e):n[t]=e}}}(e),i=Object.create(null);if("string"!=typeof t||!(t=t.trim().replace(/^[?#&]/,"")))return i;for(let a of t.split("&")){if(""===a)continue;let[t,o]=r(e.decode?a.replace(/\+/g," "):a,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?o:l(o,e),n(l(t,e),o,i)}for(let t of Object.keys(i)){let n=i[t];if("object"==typeof n&&null!==n)for(let t of Object.keys(n))n[t]=d(n[t],e);else i[t]=d(n,e)}return!1===e.sort?i:(!0===e.sort?Object.keys(i).sort():Object.keys(i).sort(e.sort)).reduce(((t,e)=>{let n=i[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=u(n):t[e]=n,t}),Object.create(null))}t.extract=c,t.parse=f,t.stringify=(t,e)=>{if(!t)return"";o((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);let n=n=>e.skipNull&&(t=>null==t)(t[n])||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{let i=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[s(e,t),"[",i,"]"].join("")]:[...n,[s(e,t),"[",s(i,t),"]=",s(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[s(e,t),"[]"].join("")]:[...n,[s(e,t),"[]=",s(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{let e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[s(n,t),e,s(i,t)].join("")]:[[r,s(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,s(e,t)]:[...n,[s(e,t),"=",s(r,t)].join("")]}}(e),i={};for(let e of Object.keys(t))n(e)||(i[e]=t[e]);let a=Object.keys(i);return!1!==e.sort&&a.sort(e.sort),a.map((n=>{let i=t[n];return void 0===i?"":null===i?s(n,e):Array.isArray(i)?0===i.length&&"bracket-separator"===e.arrayFormat?s(n,e)+"[]":i.reduce(r(n),[]).join("&"):s(n,e)+"="+s(i,e)})).filter((t=>t.length>0)).join("&")},t.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);let[n,i]=r(t,"#");return Object.assign({url:n.split("?")[0]||"",query:f(c(t),e)},e&&e.parseFragmentIdentifier&&i?{fragmentIdentifier:l(i,e)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[a]:!0},n);let r=h(e.url).split("?")[0]||"",i=t.extract(e.url),o=t.parse(i,{sort:!1}),l=Object.assign(o,e.query),u=t.stringify(l,n);u&&(u=`?${u}`);let c=function(t){let e="",n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(e.url);return e.fragmentIdentifier&&(c=`#${n[a]?s(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${r}${u}${c}`},t.pick=(e,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[a]:!1},r);let{url:o,query:s,fragmentIdentifier:l}=t.parseUrl(e,r);return t.stringifyUrl({url:o,query:i(s,n),fragmentIdentifier:l},r)},t.exclude=(e,n,r)=>{let i=Array.isArray(n)?t=>!n.includes(t):(t,e)=>!n(t,e);return t.pick(e,i,r)}})),tu=G(((t,e)=>{var n,r;p(),n=t,r=function(t){"use strict";var e="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==e&&e,n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(t){return!1}}(),a="FormData"in e,o="ArrayBuffer"in e;if(o)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function c(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function f(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function y(t){var e=new FileReader,n=p(e);return e.readAsArrayBuffer(t),n}function g(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:a&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&i&&function(t){return t&&DataView.prototype.isPrototypeOf(t)}(t)?(this._bodyArrayBuffer=g(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(t)||l(t))?this._bodyArrayBuffer=g(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(y)}),this.text=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,n=p(e);return e.readAsText(t),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(M)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(t,e){t=u(t),e=h(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},d.prototype.delete=function(t){delete this.map[u(t)]},d.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},d.prototype.set=function(t,e){this.map[u(t)]=h(e)},d.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},d.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),c(t)},d.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),c(t)},d.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),c(t)},r&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(t,e){if(!(this instanceof b))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(e=e||{}).body;if(t instanceof b){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,!n&&null!=t._bodyInit&&(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new d(e.headers)),this.method=function(t){var e=t.toUpperCase();return m.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var r=/([?&])_=[^&]*/;r.test(this.url)?this.url=this.url.replace(r,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function M(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}})),e}function w(t){var e=new d;return t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();e.append(r,i)}})),e}function _(t,e){if(!(this instanceof _))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},_.error=function(){var t=new _(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];_.redirect=function(t,e){if(-1===x.indexOf(e))throw new RangeError("Invalid status code");return new _(null,{status:e,headers:{location:t}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function O(n,r){return new Promise((function(a,s){var l=new b(n,r);if(l.signal&&l.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function c(){u.abort()}u.onload=function(){var t={status:u.status,statusText:u.statusText,headers:w(u.getAllResponseHeaders()||"")};t.url="responseURL"in u?u.responseURL:t.headers.get("X-Request-URL");var e="response"in u?u.response:u.responseText;setTimeout((function(){a(new _(e,t))}),0)},u.onerror=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},u.ontimeout=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},u.onabort=function(){setTimeout((function(){s(new t.DOMException("Aborted","AbortError"))}),0)},u.open(l.method,function(t){try{return""===t&&e.location.href?e.location.href:t}catch(e){return t}}(l.url),!0),"include"===l.credentials?u.withCredentials=!0:"omit"===l.credentials&&(u.withCredentials=!1),"responseType"in u&&(i?u.responseType="blob":o&&l.headers.get("Content-Type")&&-1!==l.headers.get("Content-Type").indexOf("application/octet-stream")&&(u.responseType="arraybuffer")),!r||"object"!=typeof r.headers||r.headers instanceof d?l.headers.forEach((function(t,e){u.setRequestHeader(e,t)})):Object.getOwnPropertyNames(r.headers).forEach((function(t){u.setRequestHeader(t,h(r.headers[t]))})),l.signal&&(l.signal.addEventListener("abort",c),u.onreadystatechange=function(){4===u.readyState&&l.signal.removeEventListener("abort",c)}),u.send(void 0===l._bodyInit?null:l._bodyInit)}))}O.polyfill=!0,e.fetch||(e.fetch=O,e.Headers=d,e.Request=b,e.Response=_),t.Headers=d,t.Request=b,t.Response=_,t.fetch=O,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?r(t):"function"==typeof define&&define.amd?define(["exports"],r):r(n.WHATWGFetch={})})),ru=G(((t,e)=>{p(),tu(),e.exports=self.fetch.bind(self)})),Vu={};function Na(t,e){return!e&&"function"==typeof t&&(e=t,t={}),this.ondata=e,t}function Ou(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&F(7),qt(t,e,[Ct],(function(t){return Ye(qn(t.data[0],t.data[1]))}),0,n)}function qn(t,e){return ct(t,e||{},0,0)}function _a(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&F(7),qt(t,e,[Rt],(function(t){return Ye(Gt(t.data[0],Ma(t.data[1])))}),1,n)}function Gt(t,e){return Rn(t,e)}function lp(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&F(7),qt(t,e,[Ct,Mu,function(){return[Aa]}],(function(t){return Ye(Aa(t.data[0],t.data[1]))}),2,n)}function Aa(t,e){e||(e={});var n=Et(),r=t.length;n.p(t);var i=ct(t,e,Ia(e),8),a=i.length;return ba(i,e),W(i,a-8,n.d()),W(i,a-4,r),i}function Pu(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&F(7),qt(t,e,[Rt,xu,function(){return[Ti]}],(function(t){return Ye(Ti(t.data[0]))}),3,n)}function Ti(t,e){return Rn(t.subarray(wa(t),-8),e||new z(Iu(t)))}function dp(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&F(7),qt(t,e,[Ct,bu,function(){return[La]}],(function(t){return Ye(La(t.data[0],t.data[1]))}),4,n)}function La(t,e){e||(e={});var n=va();n.p(t);var r=ct(t,e,2,4);return Ta(r,e),W(r,r.length-4,n.d()),r}function Du(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&F(7),qt(t,e,[Rt,wu,function(){return[Oi]}],(function(t){return Ye(Oi(t.data[0],Ma(t.data[1])))}),5,n)}function Oi(t,e){return Rn((Tu(t),t.subarray(2,-4)),e)}function hp(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&F(7),31==t[0]&&139==t[1]&&8==t[2]?Pu(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?_a(t,e,n):Du(t,e,n)}function gp(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?Ti(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Gt(t,e):Oi(t,e)}function Qe(t,e){if(e){for(var n=new z(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(Su)return Su.encode(t);var i=t.length,a=new z(t.length+(t.length>>1)),o=0,s=function(t){a[o++]=t};for(r=0;r<i;++r){if(o+5>a.length){var l=new z(o+8+(i-r<<1));l.set(a),a=l}var u=t.charCodeAt(r);u<128||e?s(u):u<2048?(s(192|u>>6),s(128|63&u)):u>55295&&u<57344?(s(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++r))>>18),s(128|u>>12&63),s(128|u>>6&63),s(128|63&u)):(s(224|u>>12),s(128|u>>6&63),s(128|63&u))}return _e(a,0,o)}function Ea(t,e){if(e){for(var n="",r=0;r<t.length;r+=16384)n+=String.fromCharCode.apply(null,t.subarray(r,r+16384));return n}if(Ba)return Ba.decode(t);var i=Eu(t),a=i[0];return i[1].length&&F(8),a}function bp(t,e,n){n||(n=e,e={}),"function"!=typeof n&&F(7);var r={};Sa(t,"",r,e);var i=Object.keys(r),a=i.length,o=0,s=0,l=a,u=new Array(a),h=[],c=function(){for(var t=0;t<h.length;++t)h[t]()},d=function(t,e){_i((function(){n(t,e)}))};_i((function(){d=n}));var f=function(){var t=new z(s+22),e=o,n=s-o;s=0;for(var r=0;r<l;++r){var i=u[r];try{var a=i.c.length;Vt(t,s,i,i.f,i.u,a);var h=30+i.f.length+et(i.extra),c=s+h;t.set(i.c,c),Vt(t,o,i,i.f,i.u,a,s,i.m),o+=16+h+(i.m?i.m.length:0),s=c+a}catch(t){return d(t,null)}}Ra(t,o,u.length,n,e),d(null,t)};a||f();for(var p=function(t){var e=i[t],n=r[e],l=n[0],p=n[1],y=Et(),g=l.length;y.p(l);var v=Qe(e),m=v.length,b=p.comment,M=b&&Qe(b),w=M&&M.length,_=et(p.extra),x=0==p.level?0:8,O=function(n,r){if(n)c(),d(n,null);else{var i=r.length;u[t]=Cn(p,{size:g,crc:y.d(),c:r,f:v,m:M,u:m!=e.length||M&&b.length!=w,compression:x}),o+=30+m+_+i,s+=76+2*(m+_)+(w||0)+i,--a||f()}};if(m>65535&&O(F(11,0,1),null),x)if(g<16e4)try{O(null,qn(l,p))}catch(t){O(t,null)}else h.push(Ou(l,p,O));else O(null,l)},y=0;y<l;++y)p(y);return c}function wp(t,e){e||(e={});var n={},r=[];Sa(t,"",n,e);var i=0,a=0;for(var o in n){var s=n[o],l=s[0],u=s[1],h=0==u.level?0:8,c=(x=Qe(o)).length,d=u.comment,f=d&&Qe(d),p=f&&f.length,y=et(u.extra);c>65535&&F(11);var g=h?qn(l,u):l,v=g.length,m=Et();m.p(l),r.push(Cn(u,{size:l.length,crc:m.d(),c:g,f:x,m:f,u:c!=o.length||f&&d.length!=p,o:i,compression:h})),i+=30+c+y+v,a+=76+2*(c+y)+(p||0)+v}for(var b=new z(a+22),M=i,w=a-i,_=0;_<r.length;++_){var x=r[_];Vt(b,x.o,x,x.f,x.u,x.c.length);var O=30+x.f.length+et(x.extra);b.set(x.c,x.o+O),Vt(b,i,x,x.f,x.u,x.c.length,x.o,x.m),i+=16+O+(x.m?x.m.length:0)}return Ra(b,i,r.length,w,M),b}function Op(t,e,n){n||(n=e,e={}),"function"!=typeof n&&F(7);var r=[],i=function(){for(var t=0;t<r.length;++t)r[t]()},a={},o=function(t,e){_i((function(){n(t,e)}))};_i((function(){o=n}));for(var s=t.length-22;101010256!=Q(t,s);--s)if(!s||t.length-s>65558)return o(F(13,0,1),null),i;var l=pe(t,s+8);if(l){var u=l,h=Q(t,s+16),c=4294967295==h;if(c){if(s=Q(t,s-12),101075792!=Q(t,s))return o(F(13,0,1),null),i;u=l=Q(t,s+32),h=Q(t,s+48)}for(var d=e&&e.filter,f=function(e){var n=qu(t,h,c),s=n[0],u=n[1],f=n[2],p=n[3],y=n[4],g=n[5],v=Cu(t,g);h=y;var m=function(t,e){t?(i(),o(t,null)):(e&&(a[p]=e),--l||o(null,a))};if(!d||d({name:p,size:u,originalSize:f,compression:s}))if(s)if(8==s){var b=t.subarray(v,v+u);if(u<32e4)try{m(null,Gt(b,new z(f)))}catch(t){m(t,null)}else r.push(_a(b,{size:f},m))}else m(F(14,"unknown compression type "+s,1),null);else m(null,_e(t,v,v+u));else m(null,null)},p=0;p<u;++p)f()}else o(null,{});return i}function _p(t,e){for(var n={},r=t.length-22;101010256!=Q(t,r);--r)(!r||t.length-r>65558)&&F(13);var i=pe(t,r+8);if(!i)return{};var a=Q(t,r+16),o=4294967295==a;o&&(r=Q(t,r-12),101075792!=Q(t,r)&&F(13),i=Q(t,r+32),a=Q(t,r+48));for(var s=e&&e.filter,l=0;l<i;++l){var u=qu(t,a,o),h=u[0],c=u[1],d=u[2],f=u[3],p=u[4],y=u[5],g=Cu(t,y);a=p,(!s||s({name:f,size:c,originalSize:d,compression:h}))&&(h?8==h?n[f]=Gt(t.subarray(g,g+c),new z(d)):F(14,"unknown compression type "+h):n[f]=_e(t,g,g+c))}return n}Zu(Vu,{AsyncCompress:()=>cp,AsyncDecompress:()=>pp,AsyncDeflate:()=>Nu,AsyncGunzip:()=>_u,AsyncGzip:()=>cp,AsyncInflate:()=>Oa,AsyncUnzipInflate:()=>Tp,AsyncUnzlib:()=>Au,AsyncZipDeflate:()=>Mp,AsyncZlib:()=>fp,Compress:()=>Pa,DecodeUTF8:()=>yp,Decompress:()=>Lu,Deflate:()=>Fe,EncodeUTF8:()=>mp,FlateErrorCode:()=>sp,Gunzip:()=>Ii,Gzip:()=>Pa,Inflate:()=>ve,Unzip:()=>Np,UnzipInflate:()=>Ip,UnzipPassThrough:()=>Gu,Unzlib:()=>Ni,Zip:()=>xp,ZipDeflate:()=>vp,ZipPassThrough:()=>Fn,Zlib:()=>Da,compress:()=>lp,compressSync:()=>Aa,decompress:()=>hp,decompressSync:()=>gp,deflate:()=>Ou,deflateSync:()=>qn,gunzip:()=>Pu,gunzipSync:()=>Ti,gzip:()=>lp,gzipSync:()=>Aa,inflate:()=>_a,inflateSync:()=>Gt,strFromU8:()=>Ea,strToU8:()=>Qe,unzip:()=>Op,unzipSync:()=>_p,unzlib:()=>Du,unzlibSync:()=>Oi,zip:()=>bp,zipSync:()=>wp,zlib:()=>dp,zlibSync:()=>La});var iu,op,z,ue,Pt,At,Dt,Sn,au,ou,ha,yi,su,uu,ga,Bn,je,Ne,ze,Lt,J,cu,lu,fu,du,mi,Oe,vi,En,_e,sp,pu,F,Rn,qe,St,Mi,xi,ya,Bt,bi,ma,hu,$e,gu,yu,Et,va,ct,Cn,mu,wi,up,vu,Rt,Ct,Mu,xu,bu,wu,Ye,Ma,qt,Pe,Ft,pe,Q,xa,W,ba,wa,Iu,Ia,Ta,Tu,Fe,Nu,ve,Oa,Pa,cp,Ii,_u,Da,fp,Ni,Au,Lu,pp,Sa,Su,Ba,Bu,Eu,yp,mp,Ru,Cu,qu,Fu,et,Vt,Ra,Fn,vp,Mp,xp,Gu,Ip,Tp,Np,_i,ku=ka((()=>{for(p(),iu={},op=function(t,e,n,r,i){var a=new Worker(iu[e]||(iu[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(t){var e=t.data,n=e.$e$;if(n){var r=new Error(n[0]);r.code=n[1],r.stack=n[2],i(r,null)}else i(null,e)},a.postMessage(n,r),a},z=Uint8Array,ue=Uint16Array,Pt=Uint32Array,At=new z([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Dt=new z([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Sn=new z([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ou=(au=function(t,e){for(var n=new ue(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new Pt(n[30]);for(r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return[n,i]})(At,2),ha=ou[0],yi=ou[1],ha[28]=258,yi[258]=28,su=au(Dt,0),uu=su[0],ga=su[1],Bn=new ue(32768),J=0;J<32768;++J)je=(61680&(je=(52428&(je=(43690&J)>>>1|(21845&J)<<1))>>>2|(13107&je)<<2))>>>4|(3855&je)<<4,Bn[J]=((65280&je)>>>8|(255&je)<<8)>>>1;for(Ne=function(t,e,n){for(var r=t.length,i=0,a=new ue(e);i<r;++i)t[i]&&++a[t[i]-1];var o,s=new ue(e);for(i=0;i<e;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new ue(1<<e);var l=15-e;for(i=0;i<r;++i)if(t[i])for(var u=i<<4|t[i],h=e-t[i],c=s[t[i]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)o[Bn[c]>>>l]=u}else for(o=new ue(r),i=0;i<r;++i)t[i]&&(o[i]=Bn[s[t[i]-1]++]>>>15-t[i]);return o},ze=new z(288),J=0;J<144;++J)ze[J]=8;for(J=144;J<256;++J)ze[J]=9;for(J=256;J<280;++J)ze[J]=7;for(J=280;J<288;++J)ze[J]=8;for(Lt=new z(32),J=0;J<32;++J)Lt[J]=5;cu=Ne(ze,9,0),lu=Ne(ze,9,1),fu=Ne(Lt,5,0),du=Ne(Lt,5,1),mi=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},Oe=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n},vi=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},En=function(t){return(t+7)/8|0},_e=function(t,e,n){(null==e||e<0)&&(e=0),(null==n||n>t.length)&&(n=t.length);var r=new(2==t.BYTES_PER_ELEMENT?ue:4==t.BYTES_PER_ELEMENT?Pt:z)(n-e);return r.set(t.subarray(e,n)),r},sp={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},pu=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],F=function(t,e,n){var r=new Error(e||pu[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,F),!n)throw r;return r},Rn=function(t,e,n){var r=t.length;if(!r||n&&n.f&&!n.l)return e||new z(0);var i=!e||n,a=!n||n.i;n||(n={}),e||(e=new z(3*r));var o=function(t){var n=e.length;if(t>n){var r=new z(Math.max(2*n,t));r.set(e),e=r}},s=n.f||0,l=n.p||0,u=n.b||0,h=n.l,c=n.d,d=n.m,f=n.n,p=8*r;do{if(!h){s=Oe(t,l,1);var y=Oe(t,l+1,3);if(l+=3,!y){var g=t[(S=En(l)+4)-4]|t[S-3]<<8,v=S+g;if(v>r){a&&F(0);break}i&&o(u+g),e.set(t.subarray(S,v),u),n.b=u+=g,n.p=l=8*v,n.f=s;continue}if(1==y)h=lu,c=du,d=9,f=5;else if(2==y){var m=Oe(t,l,31)+257,b=Oe(t,l+10,15)+4,M=m+Oe(t,l+5,31)+1;l+=14;for(var w=new z(M),_=new z(19),x=0;x<b;++x)_[Sn[x]]=Oe(t,l+3*x,7);l+=3*b;var O=mi(_),N=(1<<O)-1,I=Ne(_,O,1);for(x=0;x<M;){var S,E=I[Oe(t,l,N)];if(l+=15&E,(S=E>>>4)<16)w[x++]=S;else{var A=0,j=0;for(16==S?(j=3+Oe(t,l,3),l+=2,A=w[x-1]):17==S?(j=3+Oe(t,l,7),l+=3):18==S&&(j=11+Oe(t,l,127),l+=7);j--;)w[x++]=A}}var T=w.subarray(0,m),P=w.subarray(m);d=mi(T),f=mi(P),h=Ne(T,d,1),c=Ne(P,f,1)}else F(1);if(l>p){a&&F(0);break}}i&&o(u+131072);for(var k=(1<<d)-1,B=(1<<f)-1,R=l;;R=l){var L=(A=h[vi(t,l)&k])>>>4;if((l+=15&A)>p){a&&F(0);break}if(A||F(2),L<256)e[u++]=L;else{if(256==L){R=l,h=null;break}var D=L-254;if(L>264){var W=At[x=L-257];D=Oe(t,l,(1<<W)-1)+ha[x],l+=W}var C=c[vi(t,l)&B],U=C>>>4;C||F(3),l+=15&C;P=uu[U];if(U>3){W=Dt[U];P+=vi(t,l)&(1<<W)-1,l+=W}if(l>p){a&&F(0);break}i&&o(u+131072);for(var G=u+D;u<G;u+=4)e[u]=e[u-P],e[u+1]=e[u+1-P],e[u+2]=e[u+2-P],e[u+3]=e[u+3-P];u=G}}n.l=h,n.p=R,n.b=u,n.f=s,h&&(s=1,n.m=d,n.d=c,n.n=f)}while(!s);return u==e.length?e:_e(e,0,u)},qe=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>>8},St=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16},Mi=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,a=n.slice();if(!i)return[$e,0];if(1==i){var o=new z(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(t,e){return t.f-e.f})),n.push({s:-1,f:25001});var s=n[0],l=n[1],u=0,h=1,c=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};h!=i-1;)s=n[n[u].f<n[c].f?u++:c++],l=n[u!=h&&n[u].f<n[c].f?u++:c++],n[h++]={s:-1,f:s.f+l.f,l:s,r:l};var d=a[0].s;for(r=1;r<i;++r)a[r].s>d&&(d=a[r].s);var f=new ue(d+1),p=xi(n[h-1],f,0);if(p>e){r=0;var y=0,g=p-e,v=1<<g;for(a.sort((function(t,e){return f[e.s]-f[t.s]||t.f-e.f}));r<i;++r){var m=a[r].s;if(!(f[m]>e))break;y+=v-(1<<p-f[m]),f[m]=e}for(y>>>=g;y>0;){var b=a[r].s;f[b]<e?y-=1<<e-f[b]++-1:++r}for(;r>=0&&y;--r){var M=a[r].s;f[M]==e&&(--f[M],++y)}p=e}return[new z(f),p]},xi=function(t,e,n){return-1==t.s?Math.max(xi(t.l,e,n+1),xi(t.r,e,n+1)):e[t.s]=n},ya=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new ue(++e),r=0,i=t[0],a=1,o=function(t){n[r++]=t},s=1;s<=e;++s)if(t[s]==i&&s!=e)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=t[s]}return[n.subarray(0,r),e]},Bt=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},bi=function(t,e,n){var r=n.length,i=En(e+2);t[i]=255&r,t[i+1]=r>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<r;++a)t[i+a+4]=n[a];return 8*(i+4+r)},ma=function(t,e,n,r,i,a,o,s,l,u,h){qe(e,h++,n),++i[256];for(var c=Mi(i,15),d=c[0],f=c[1],p=Mi(a,15),y=p[0],g=p[1],v=ya(d),m=v[0],b=v[1],M=ya(y),w=M[0],_=M[1],x=new ue(19),O=0;O<m.length;++O)x[31&m[O]]++;for(O=0;O<w.length;++O)x[31&w[O]]++;for(var N=Mi(x,7),I=N[0],S=N[1],E=19;E>4&&!I[Sn[E-1]];--E);var A,j,T,P,k=u+5<<3,B=Bt(i,ze)+Bt(a,Lt)+o,R=Bt(i,d)+Bt(a,y)+o+14+3*E+Bt(x,I)+(2*x[16]+3*x[17]+7*x[18]);if(k<=B&&k<=R)return bi(e,h,t.subarray(l,l+u));if(qe(e,h,1+(R<B)),h+=2,R<B){A=Ne(d,f,0),j=d,T=Ne(y,g,0),P=y;var F=Ne(I,S,0);qe(e,h,b-257),qe(e,h+5,_-1),qe(e,h+10,E-4),h+=14;for(O=0;O<E;++O)qe(e,h+3*O,I[Sn[O]]);h+=3*E;for(var L=[m,w],D=0;D<2;++D){var W=L[D];for(O=0;O<W.length;++O){var C=31&W[O];qe(e,h,F[C]),h+=I[C],C>15&&(qe(e,h,W[O]>>>5&127),h+=W[O]>>>12)}}}else A=cu,j=ze,T=fu,P=Lt;for(O=0;O<s;++O)if(r[O]>255){C=r[O]>>>18&31;St(e,h,A[C+257]),h+=j[C+257],C>7&&(qe(e,h,r[O]>>>23&31),h+=At[C]);var U=31&r[O];St(e,h,T[U]),h+=P[U],U>3&&(St(e,h,r[O]>>>5&8191),h+=Dt[U])}else St(e,h,A[r[O]]),h+=j[r[O]];return St(e,h,A[256]),h+j[256]},hu=new Pt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),$e=new z(0),gu=function(t,e,n,r,i,a){var o=t.length,s=new z(r+o+5*(1+Math.ceil(o/7e3))+i),l=s.subarray(r,s.length-i),u=0;if(!e||o<8)for(var h=0;h<=o;h+=65535){var c=h+65535;c>=o&&(l[u>>3]=a),u=bi(l,u+1,t.subarray(h,c))}else{for(var d=hu[e-1],f=d>>>13,p=8191&d,y=(1<<n)-1,g=new ue(32768),v=new ue(y+1),m=Math.ceil(n/3),b=2*m,M=function(e){return(t[e]^t[e+1]<<m^t[e+2]<<b)&y},w=new Pt(25e3),_=new ue(288),x=new ue(32),O=0,N=0,I=(h=0,0),S=0,E=0;h<o;++h){var A=M(h),j=32767&h,T=v[A];if(g[j]=T,v[A]=j,S<=h){var P=o-h;if((O>7e3||I>24576)&&P>423){u=ma(t,l,0,w,_,x,N,I,E,h-E,u),I=O=N=0,E=h;for(var k=0;k<286;++k)_[k]=0;for(k=0;k<30;++k)x[k]=0}var B=2,R=0,F=p,L=j-T&32767;if(P>2&&A==M(h-L))for(var D=Math.min(f,P)-1,W=Math.min(32767,h),C=Math.min(258,P);L<=W&&--F&&j!=T;){if(t[h+B]==t[h+B-L]){for(var U=0;U<C&&t[h+U]==t[h+U-L];++U);if(U>B){if(B=U,R=L,U>D)break;var G=Math.min(L,U-2),q=0;for(k=0;k<G;++k){var $=h-L+k+32768&32767,J=$-g[$]+32768&32767;J>q&&(q=J,T=$)}}}L+=(j=T)-(T=g[j])+32768&32767}if(R){w[I++]=268435456|yi[B]<<18|ga[R];var V=31&yi[B],H=31&ga[R];N+=At[V]+Dt[H],++_[257+V],++x[H],S=h+B,++O}else w[I++]=t[h],++_[t[h]]}}u=ma(t,l,a,w,_,x,N,I,E,h-E,u),!a&&7&u&&(u=bi(l,u+1,$e))}return _e(s,0,r+En(u)+i)},yu=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&-306674912)^n>>>1;t[e]=n}return t}(),Et=function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=yu[255&n^e[r]]^n>>>8;t=n},d:function(){return~t}}},va=function(){var t=1,e=0;return{p:function(n){for(var r=t,i=e,a=0|n.length,o=0;o!=a;){for(var s=Math.min(o+2655,a);o<s;++o)i+=r+=n[o];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}t=r,e=i},d:function(){return(255&(t%=65521))<<24|t>>>8<<16|(255&(e%=65521))<<8|e>>>8}}},ct=function(t,e,n,r,i){return gu(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,r,!i)},Cn=function(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n},mu=function(t,e,n){for(var r=t(),i=t.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<r.length;++o){var s=r[o],l=a[o];if("function"==typeof s){e+=";"+l+"=";var u=s.toString();if(s.prototype)if(-1!=u.indexOf("[native code]")){var h=u.indexOf(" ",8)+1;e+=u.slice(h,u.indexOf("(",h))}else for(var c in e+=u,s.prototype)e+=";"+l+".prototype."+c+"="+s.prototype[c].toString();else e+=u}else n[l]=s}return[e,n]},wi=[],up=function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},vu=function(t,e,n,r){var i;if(!wi[n]){for(var a="",o={},s=t.length-1,l=0;l<s;++l)a=(i=mu(t[l],a,o))[0],o=i[1];wi[n]=mu(t[s],a,o)}var u=Cn({},wi[n][1]);return op(wi[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,up(u),r)},Rt=function(){return[z,ue,Pt,At,Dt,Sn,ha,uu,lu,du,Bn,pu,Ne,mi,Oe,vi,En,_e,F,Rn,Gt,Ye,Ma]},Ct=function(){return[z,ue,Pt,At,Dt,Sn,yi,ga,cu,ze,fu,Lt,Bn,hu,$e,Ne,qe,St,Mi,xi,ya,Bt,bi,ma,En,_e,gu,ct,qn,Ye]},Mu=function(){return[ba,Ia,W,Et,yu]},xu=function(){return[wa,Iu]},bu=function(){return[Ta,W,va]},wu=function(){return[Tu]},Ye=function(t){return postMessage(t,[t.buffer])},Ma=function(t){return t&&t.size&&new z(t.size)},qt=function(t,e,n,r,i,a){var o=vu(n,r,i,(function(t,e){o.terminate(),a(t,e)}));return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}},Pe=function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){return t.push(e.data[0],e.data[1])}},Ft=function(t,e,n,r,i){var a,o=vu(t,r,i,(function(t,n){t?(o.terminate(),e.ondata.call(e,t)):(n[1]&&o.terminate(),e.ondata.call(e,t,n[0],n[1]))}));o.postMessage(n),e.push=function(t,n){e.ondata||F(5),a&&e.ondata(F(4,0,1),null,!!n),o.postMessage([t,a=n],[t.buffer])},e.terminate=function(){o.terminate()}},pe=function(t,e){return t[e]|t[e+1]<<8},Q=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},xa=function(t,e){return Q(t,e)+4294967296*Q(t,e+4)},W=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},ba=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&W(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var r=0;r<=n.length;++r)t[r+10]=n.charCodeAt(r)}},wa=function(t){(31!=t[0]||139!=t[1]||8!=t[2])&&F(6,"invalid gzip data");var e=t[3],n=10;4&e&&(n+=t[10]|2+(t[11]<<8));for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(2&e)},Iu=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},Ia=function(t){return 10+(t.filename&&t.filename.length+1||0)},Ta=function(t,e){var n=e.level,r=0==n?0:n<6?1:9==n?3:2;t[0]=120,t[1]=r<<6|(r?32-2*r:1)},Tu=function(t){(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&F(6,"invalid zlib data"),32&t[1]&&F(6,"invalid zlib data: preset dictionaries not supported")},Fe=function(){function t(t,e){!e&&"function"==typeof t&&(e=t,t={}),this.ondata=e,this.o=t||{}}return t.prototype.p=function(t,e){this.ondata(ct(t,this.o,0,0,!e),e)},t.prototype.push=function(t,e){this.ondata||F(5),this.d&&F(4),this.d=e,this.p(t,e||!1)},t}(),Nu=function(t,e){Ft([Ct,function(){return[Pe,Fe]}],this,Na.call(this,t,e),(function(t){var e=new Fe(t.data);onmessage=Pe(e)}),6)},ve=function(){function t(t){this.s={},this.p=new z(0),this.ondata=t}return t.prototype.e=function(t){this.ondata||F(5),this.d&&F(4);var e=this.p.length,n=new z(e+t.length);n.set(this.p),n.set(t,e),this.p=n},t.prototype.c=function(t){this.d=this.s.i=t||!1;var e=this.s.b,n=Rn(this.p,this.o,this.s);this.ondata(_e(n,e,this.s.b),this.d),this.o=_e(n,this.s.b-32768),this.s.b=this.o.length,this.p=_e(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}(),Oa=function(t){this.ondata=t,Ft([Rt,function(){return[Pe,ve]}],this,0,(function(){var t=new ve;onmessage=Pe(t)}),7)},Pa=function(){function t(t,e){this.c=Et(),this.l=0,this.v=1,Fe.call(this,t,e)}return t.prototype.push=function(t,e){Fe.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var n=ct(t,this.o,this.v&&Ia(this.o),e&&8,!e);this.v&&(ba(n,this.o),this.v=0),e&&(W(n,n.length-8,this.c.d()),W(n,n.length-4,this.l)),this.ondata(n,e)},t}(),cp=function(t,e){Ft([Ct,Mu,function(){return[Pe,Fe,Pa]}],this,Na.call(this,t,e),(function(t){var e=new Pa(t.data);onmessage=Pe(e)}),8)},Ii=function(){function t(t){this.v=1,ve.call(this,t)}return t.prototype.push=function(t,e){if(ve.prototype.e.call(this,t),this.v){var n=this.p.length>3?wa(this.p):4;if(n>=this.p.length&&!e)return;this.p=this.p.subarray(n),this.v=0}e&&(this.p.length<8&&F(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),ve.prototype.c.call(this,e)},t}(),_u=function(t){this.ondata=t,Ft([Rt,xu,function(){return[Pe,ve,Ii]}],this,0,(function(){var t=new Ii;onmessage=Pe(t)}),9)},Da=function(){function t(t,e){this.c=va(),this.v=1,Fe.call(this,t,e)}return t.prototype.push=function(t,e){Fe.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t);var n=ct(t,this.o,this.v&&2,e&&4,!e);this.v&&(Ta(n,this.o),this.v=0),e&&W(n,n.length-4,this.c.d()),this.ondata(n,e)},t}(),fp=function(t,e){Ft([Ct,bu,function(){return[Pe,Fe,Da]}],this,Na.call(this,t,e),(function(t){var e=new Da(t.data);onmessage=Pe(e)}),10)},Ni=function(){function t(t){this.v=1,ve.call(this,t)}return t.prototype.push=function(t,e){if(ve.prototype.e.call(this,t),this.v){if(this.p.length<2&&!e)return;this.p=this.p.subarray(2),this.v=0}e&&(this.p.length<4&&F(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),ve.prototype.c.call(this,e)},t}(),Au=function(t){this.ondata=t,Ft([Rt,wu,function(){return[Pe,ve,Ni]}],this,0,(function(){var t=new Ni;onmessage=Pe(t)}),11)},Lu=function(){function t(t){this.G=Ii,this.I=ve,this.Z=Ni,this.ondata=t}return t.prototype.push=function(t,e){if(this.ondata||F(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new z(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length)}else this.p=t;if(this.p.length>2){var r=this,i=function(){r.ondata.apply(r,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(i):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(i):new this.Z(i),this.s.push(this.p,e),this.p=null}}},t}(),pp=function(){function t(t){this.G=_u,this.I=Oa,this.Z=Au,this.ondata=t}return t.prototype.push=function(t,e){Lu.prototype.push.call(this,t,e)},t}(),Sa=function(t,e,n,r){for(var i in t){var a=t[i],o=e+i,s=r;Array.isArray(a)&&(s=Cn(r,a[1]),a=a[0]),a instanceof z?n[o]=[a,s]:(n[o+="/"]=[new z(0),s],Sa(a,o,n,r))}},Su="undefined"!=typeof TextEncoder&&new TextEncoder,Ba="undefined"!=typeof TextDecoder&&new TextDecoder,Bu=0;try{Ba.decode($e,{stream:!0}),Bu=1}catch(t){}Eu=function(t){for(var e="",n=0;;){var r=t[n++],i=(r>127)+(r>223)+(r>239);if(n+i>t.length)return[e,_e(t,n-1)];i?3==i?(r=((15&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r)):e+=1&i?String.fromCharCode((31&r)<<6|63&t[n++]):String.fromCharCode((15&r)<<12|(63&t[n++])<<6|63&t[n++]):e+=String.fromCharCode(r)}},yp=function(){function t(t){this.ondata=t,Bu?this.t=new TextDecoder:this.p=$e}return t.prototype.push=function(t,e){if(this.ondata||F(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&F(8),this.t=null));this.p||F(4);var n=new z(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var r=Eu(n),i=r[0],a=r[1];e?(a.length&&F(8),this.p=null):this.p=a,this.ondata(i,e)},t}(),mp=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){this.ondata||F(5),this.d&&F(4),this.ondata(Qe(t),this.d=e||!1)},t}(),Ru=function(t){return 1==t?3:t<6?2:9==t?1:0},Cu=function(t,e){return e+30+pe(t,e+26)+pe(t,e+28)},qu=function(t,e,n){var r=pe(t,e+28),i=Ea(t.subarray(e+46,e+46+r),!(2048&pe(t,e+8))),a=e+46+r,o=Q(t,e+20),s=n&&4294967295==o?Fu(t,a):[o,Q(t,e+24),Q(t,e+42)],l=s[0],u=s[1],h=s[2];return[pe(t,e+10),l,u,i,a+pe(t,e+30)+pe(t,e+32),h]},Fu=function(t,e){for(;1!=pe(t,e);e+=4+pe(t,e+2));return[xa(t,e+12),xa(t,e+4),xa(t,e+20)]},et=function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&F(9),e+=r+4}return e},Vt=function(t,e,n,r,i,a,o,s){var l=r.length,u=n.extra,h=s&&s.length,c=et(u);W(t,e,null!=o?33639248:67324752),e+=4,null!=o&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(null==a&&8),t[e++]=i&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var d=new Date(null==n.mtime?Date.now():n.mtime),f=d.getFullYear()-1980;if((f<0||f>119)&&F(10),W(t,e,f<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>>1),e+=4,null!=a&&(W(t,e,n.crc),W(t,e+4,a),W(t,e+8,n.size)),W(t,e+12,l),W(t,e+14,c),e+=16,null!=o&&(W(t,e,h),W(t,e+6,n.attrs),W(t,e+10,o),e+=14),t.set(r,e),e+=l,c)for(var p in u){var y=u[p],g=y.length;W(t,e,+p),W(t,e+2,g),t.set(y,e+4),e+=4+g}return h&&(t.set(s,e),e+=h),e},Ra=function(t,e,n,r,i){W(t,e,101010256),W(t,e+8,n),W(t,e+10,n),W(t,e+12,r),W(t,e+16,i)},Fn=function(){function t(t){this.filename=t,this.c=Et(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){this.ondata||F(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}(),vp=function(){function t(t,e){var n=this;e||(e={}),Fn.call(this,t),this.d=new Fe(e,(function(t,e){n.ondata(null,t,e)})),this.compression=8,this.flag=Ru(e.level)}return t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},t.prototype.push=function(t,e){Fn.prototype.push.call(this,t,e)},t}(),Mp=function(){function t(t,e){var n=this;e||(e={}),Fn.call(this,t),this.d=new Nu(e,(function(t,e,r){n.ondata(t,e,r)})),this.compression=8,this.flag=Ru(e.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){Fn.prototype.push.call(this,t,e)},t}(),xp=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(this.ondata||F(5),2&this.d)this.ondata(F(4+8*(1&this.d),0,1),null,!1);else{var n=Qe(t.filename),r=n.length,i=t.comment,a=i&&Qe(i),o=r!=t.filename.length||a&&i.length!=a.length,s=r+et(t.extra)+30;r>65535&&this.ondata(F(11,0,1),null,!1);var l=new z(s);Vt(l,0,t,n,o);var u=[l],h=function(){for(var t=0,n=u;t<n.length;t++){var r=n[t];e.ondata(null,r,!1)}u=[]},c=this.d;this.d=0;var d=this.u.length,f=Cn(t,{f:n,u:o,o:a,t:function(){t.terminate&&t.terminate()},r:function(){if(h(),c){var t=e.u[d+1];t?t.r():e.d=1}c=1}}),p=0;t.ondata=function(n,r,i){if(n)e.ondata(n,r,i),e.terminate();else if(p+=r.length,u.push(r),i){var a=new z(16);W(a,0,134695760),W(a,4,t.crc),W(a,8,p),W(a,12,t.size),u.push(a),f.c=p,f.b=s+p+16,f.crc=t.crc,f.size=t.size,c&&f.r(),c=1}else c&&h()},this.u.push(f)}},t.prototype.end=function(){var t=this;2&this.d?this.ondata(F(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){!(1&t.d)||(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3)},t.prototype.e=function(){for(var t=0,e=0,n=0,r=0,i=this.u;r<i.length;r++){n+=46+(l=i[r]).f.length+et(l.extra)+(l.o?l.o.length:0)}for(var a=new z(n+22),o=0,s=this.u;o<s.length;o++){var l=s[o];Vt(a,t,l,l.f,l.u,l.c,e,l.o),t+=46+l.f.length+et(l.extra)+(l.o?l.o.length:0),e+=l.b}Ra(a,t,this.u.length,n,e),this.ondata(null,a,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++){e[t].t()}this.d=2},t}(),Gu=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}(),Ip=function(){function t(){var t=this;this.i=new ve((function(e,n){t.ondata(null,e,n)}))}return t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(t){this.ondata(t,null,e)}},t.compression=8,t}(),Tp=function(){function t(t,e){var n=this;e<32e4?this.i=new ve((function(t,e){n.ondata(null,t,e)})):(this.i=new Oa((function(t,e,r){n.ondata(t,e,r)})),this.terminate=this.i.terminate)}return t.prototype.push=function(t,e){this.i.terminate&&(t=_e(t,0)),this.i.push(t,e)},t.compression=8,t}(),Np=function(){function t(t){this.onfile=t,this.k=[],this.o={0:Gu},this.p=$e}return t.prototype.push=function(t,e){var n=this;if(this.onfile||F(5),this.p||F(4),this.c>0){var r=Math.min(this.c,t.length),i=t.subarray(0,r);if(this.c-=r,this.d?this.d.push(i,!this.c):this.k[0].push(i),(t=t.subarray(r)).length)return this.push(t,e)}else{var a=0,o=0,s=void 0,l=void 0;this.p.length?t.length?((l=new z(this.p.length+t.length)).set(this.p),l.set(t,this.p.length)):l=this.p:l=t;for(var u=l.length,h=this.c,c=h&&this.d,d=function(){var t,e=Q(l,o);if(67324752==e){a=1,s=o,f.d=null,f.c=0;var r=pe(l,o+6),i=pe(l,o+8),c=2048&r,d=8&r,p=pe(l,o+26),y=pe(l,o+28);if(u>o+30+p+y){var g=[];f.k.unshift(g),a=2;var v=Q(l,o+18),m=Q(l,o+22),b=Ea(l.subarray(o+30,o+=30+p),!c);4294967295==v?(t=d?[-2]:Fu(l,o),v=t[0],m=t[1]):d&&(v=-1),o+=y,f.c=v;var M,w={name:b,compression:i,start:function(){if(w.ondata||F(5),v){var t=n.o[i];t||w.ondata(F(14,"unknown compression type "+i,1),null,!1),(M=v<0?new t(b):new t(b,v,m)).ondata=function(t,e,n){w.ondata(t,e,n)};for(var e=0,r=g;e<r.length;e++){var a=r[e];M.push(a,!1)}n.k[0]==g&&n.c?n.d=M:M.push($e,!0)}else w.ondata(null,$e,!0)},terminate:function(){M&&M.terminate&&M.terminate()}};v>=0&&(w.size=v,w.originalSize=m),f.onfile(w)}return"break"}if(h){if(134695760==e)return s=o+=12+(-2==h&&8),a=3,f.c=0,"break";if(33639248==e)return s=o-=4,a=3,f.c=0,"break"}},f=this;o<u-4;++o){if("break"===d())break}if(this.p=$e,h<0){var p=a?l.subarray(0,s-12-(-2==h&&8)-(134695760==Q(l,s-16)&&4)):l.subarray(0,o);c?c.push(p,!!a):this.k[+(2==a)].push(p)}if(2&a)return this.push(l.subarray(o),e);this.p=l.subarray(o)}e&&(this.c&&F(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}(),_i="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()}}));p();var Uu=Ai(ja());p(),p(),p();var Jo=Ai($o());p();var Ho=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:r=0,distance:i=0,angle:a=0}){let o,s;if(d(this,"origin"),d(this,"destination"),d(this,"vortex"),d(this,"distance"),d(this,"angle"),d(this,"weight"),this.origin=t,this.destination=e,this.vortex=n,this.distance=i,this.angle=a,n?(this.distance=0,this.angle=0,o=void 0!==n.weight&&n.weight>0?n.weight:"elevator"===n.type?2e3:1e3,s=n.multiplier&&n.multiplier>=1?n.multiplier:1,this.weight=r*s+o):(o=e.weight&&e.weight>=0?e.weight:0,s=e.multiplier&&e.multiplier>=1?e.multiplier:1,this.weight=this.distance*s+o),isNaN(this.angle))throw new Error("nan angle")}},kr=Ho;function Ld(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale||1);try{if(!t.georeference)throw new Error(`map ${t.name||t.shortName||t.id} does not have a georeference field`);if(t.georeference.length<3)throw new Error(`map ${t.name||t.shortName||t.id} has less than 3 georeference points, we require at least 3 for proper map scaling`);let e=t.georeference[0],n=t.georeference[2],r=(0,Jo.getDistance)({latitude:e.target.x,longitude:e.target.y},{latitude:n.target.x,longitude:n.target.y}),i=e.control.x-n.control.x,a=e.control.y-n.control.y;return Math.sqrt(i*i+a*a)/r}catch(t){return console.error(t),1}}function Sd(t,e){let n=t.x-e.x,r=t.y-e.y;return(Math.atan2(r,n)+2.5*Math.PI)%(2*Math.PI)}var te,ye,Je,Wo=class{constructor({nodes:t,vortexes:e,maps:n,showVortexNames:r=!1}){d(this,"edges"),d(this,"nodesById"),d(this,"mapsById"),this.edges={},this.mapsById=n.map((t=>({...t,_scale:Ld(t)}))).reduce(((t,e)=>(t[e.id]=e,t)),{});let i=t.filter((t=>!!this.mapsById[t.map])).map((t=>({...t,paths:t.paths?t.paths.filter((({map:e})=>e===t.map)):[]})));this.nodesById=i.reduce(((t,e)=>(t[e.id]=e,t)),{});for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].paths=this.nodesById[t].paths.filter((({node:t})=>!!this.nodesById[t])));let a=e.map((t=>({...t,name:r?t.name:t.type,nodes:t.nodes?t.nodes.filter((t=>!!this.nodesById[t])):[]})));i.forEach((t=>{this.edges[t.id]=t.paths.map((({node:e})=>{let n=this.nodesById[e];return new kr({angle:Sd(t,n),destination:n,distance:this.getDistance(t,n),origin:t})}))})),a.forEach((t=>{if(null==t.nodes||0===t.nodes.length)return;let e=0;for(;e<t.nodes.length-1;){let n=this.nodesById[t.nodes[e]];if(e++,null==n)continue;let r=e;for(;r<t.nodes.length;){let e=this.nodesById[t.nodes[r]];if(r++,null==e)continue;let i=this.mapsById[n.map].elevation||0,a=this.mapsById[e.map].elevation||0,o=Math.abs(i-a);this.edges[n.id].push(new kr({destination:e,elevationDelta:o,origin:n,vortex:t})),this.edges[e.id].push(new kr({destination:n,elevationDelta:o,origin:e,vortex:t}))}}}))}aStar(t,e,n){let r=t.map((t=>this.nodesById[t])).filter((t=>t)),i=e.map((t=>this.nodesById[t])).filter((t=>t));if(0===r.length||0===i.length)return[];let a=[],o={},s={};for(r.forEach((t=>{let e=this.getShortestEuclideanDistance(t,i);a.push({origin:t,priority:e}),o[t.id]=null,s[t.id]=0})),a.sort(((t,e)=>t.priority-e.priority));a.length>0;){let t=a[0];if(i.includes(t.origin)){let e=[],n=o[t.origin.id];for(;null!=n;){e.push(n);let t=o[n.origin.id];n=null!=t?t:null}return e.reverse()}for(let e of this.edges[t.origin.id]){let r=e.vortex&&!1===e.vortex.accessible;if(n&&(r||!1===e.origin.accessible||!1===e.destination.accessible))continue;let l=s[t.origin.id]+e.weight;if(null==s[e.destination.id]||l<s[e.destination.id]){s[e.destination.id]=l;let t=l+this.getShortestEuclideanDistance(e.destination,i);a.push({origin:e.destination,priority:t}),o[e.destination.id]=e}}a.splice(0,1),a.sort(((t,e)=>t.priority-e.priority))}return[]}getDistance(t,e){let n,r=t.x-e.x,i=t.y-e.y,a=r*r+i*i;return n=null==this.mapsById[t.map]?1:this.mapsById[t.map]._scale,Math.sqrt(a)/n}getShortestEuclideanDistance(t,e){return e.reduce(((e,n)=>{let r=this.getDistance(t,n);return Math.min(e,r)}),Number.MAX_VALUE)}},Qi=Wo;function Bd(t){switch(t){case Je.DOWN:case Je.UP:return`${t} `;default:return""}}p(),p(),function(t){t.DEPARTURE="Departure",t.TAKEVORTEX="TakeVortex",t.EXITVORTEX="ExitVortex",t.TURN="Turn",t.ARRIVAL="Arrival"}(te||(te={})),function(t){t.STRAIGHT="Straight",t.RIGHT="Right",t.SLIGHTRIGHT="SlightRight",t.LEFT="Left",t.SLIGHTLEFT="SlightLeft"}(ye||(ye={})),function(t){t.UP="up",t.DOWN="down",t.NONE="none"}(Je||(Je={}));var Ur,Xo=class{constructor({origin:t,action:e,distance:n,atLocation:r,instruction:i}){d(this,"node"),d(this,"instruction"),d(this,"action"),d(this,"atLocation"),d(this,"type"),d(this,"distance",0),this.node=t,this.action=e,this.distance=n||0,this.atLocation=r,this.instruction="",i?this.instruction=i:(null!=e&&e.type===te.DEPARTURE?this.instruction=null!=r?`Depart from ${r.name}`:"Depart from current location":null!=e&&e.type===te.ARRIVAL?this.instruction=null!=r?`Arrive at ${r.name}`:"Arrive at destination":null!=e&&e.type===te.TAKEVORTEX?this.instruction=`Take ${r&&r.name} ${Bd(e.direction)}to ${e.toMap.name}`:null!=e&&e.type===te.EXITVORTEX?this.instruction=`Exit ${r&&r.name} at ${e.toMap.name}`:null!=e&&e.bearing===ye.RIGHT?this.instruction="Turn right":null!=e&&e.bearing===ye.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=e&&e.bearing===ye.STRAIGHT?this.instruction="Head straight":null!=e&&e.bearing===ye.SLIGHTLEFT?this.instruction="Turn slightly left":null!=e&&e.bearing===ye.LEFT&&(this.instruction="Turn left"),null!=e&&e.type===te.TURN&&r&&(this.instruction+=` at ${r.name}`))}},We=Xo;(Ur||(Ur={})).NO_VALID_PATH="No Valid Path Available";var jr=.1*Math.PI;function zr(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var Ko=class{constructor({locations:t,nodes:e,vortexes:n,maps:r,showVortexNames:i}){d(this,"graph"),d(this,"locationsByNodeId"),this.graph=new Qi({maps:r,nodes:e,showVortexNames:i,vortexes:n}),this.locationsByNodeId=t.reduce(((t,e)=>(e.nodes&&e.nodes.forEach((n=>{t[n.node]=e})),e.polygons&&e.polygons.forEach((n=>{n.entrances&&n.entrances.forEach((n=>{t[n]=e}))})),t)),{})}getClosestLocationInRay(t,e=.5*Math.PI,n=10){let r=0,i=0,a=t;for(;Math.abs(r)<e&&i<n;){let t=this.graph.edges[a.destination.id],o=null,s=0;for(let e of t)if(e.distance>0)if(null!=o){let t=-zr(a.angle,e.angle);Math.abs(t)<Math.abs(s)&&(o=e,s=t)}else o=e,s=-zr(a.angle,e.angle);if(null==o)return null;{if(Math.abs(s)>=e||(r+=s,i+=o.distance,Math.abs(r)>=e||i>n))return null;let t=this.locationsByNodeId[o.destination.id];if(null!=t)return t;a=o}}return null}getDirections({originIds:t,destinationNodeIds:e,accessible:n,departFrom:r,arriveAt:i}){let a=this.graph.aStar(t,e,n);if(0===a.length)return{distance:0,instructions:[new We({distance:0,instruction:Ur.NO_VALID_PATH})],path:[]};let o=0,s=new Array(a.length+1);for(let t=0;t<a.length;t++)s[t]=a[t].origin;s[a.length]=a[a.length-1].destination;let l=[],u=null,h=null,c=0,d=0;for(let t=0;t<a.length;t++){let e=a[t],n=e.origin,s=e.destination;if(o+=e.distance,c+=(null==h?void 0:h.distance)||0,0===t&&l.push(new We({action:{type:te.DEPARTURE},atLocation:r,distance:0,origin:n})),null!=e.vortex){let t=this.graph.mapsById[n.map],r=this.graph.mapsById[s.map],i=Je.NONE;if(null!=t.elevation&&null!=r.elevation){let e=t.elevation-r.elevation;e>0?i=Je.DOWN:e<0&&(i=Je.UP)}l.push(new We({action:{direction:i,fromMap:t,toMap:r,type:te.TAKEVORTEX},atLocation:e.vortex,distance:c,origin:n})),d+=c,c=0}else if(null!=u&&null!=h)if(null!=h.vortex){let t=this.graph.mapsById[u.map],e=this.graph.mapsById[h.destination.map];l.push(new We({action:{fromMap:t,toMap:e,type:te.EXITVORTEX},atLocation:h.vortex,distance:c,origin:n})),d+=c,c=0}else{let t=this.graph.edges[n.id].filter((t=>t.destination!==u&&t.destination!==e.destination));if(t.length>0){let r=-zr(h.angle,e.angle),i=t.reduce(((t,n)=>{let r=-zr(e.angle,n.angle);return Math.min(t,Math.abs(r))}),Math.PI);if(Math.abs(r)>=jr||Math.abs(i)<=jr){let t;t=r<=-Math.PI/4?ye.RIGHT:r<=-jr?ye.SLIGHTRIGHT:r<=jr?ye.STRAIGHT:r<=Math.PI/4?ye.SLIGHTLEFT:ye.LEFT;let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=e){let r=new We({action:{bearing:t,referencePosition:"At",type:te.TURN},atLocation:e,distance:c,origin:n});r.type=t,l.push(r)}else l.push(new We({action:{bearing:t,referencePosition:"At",type:te.TURN},distance:c,origin:n}));d+=c,c=0}}}t===a.length-1&&(l.push(new We({action:{type:te.ARRIVAL},atLocation:i,distance:o-d<0?0:o-d,origin:e.destination})),d+=c,c=0),u=n,h=e}let f=[],p=null;for(let t=l.length-1;t>=0;t--){let e=l[t],{action:n}=e;n&&n.type===te.TAKEVORTEX?(p=e.node,f.unshift(e)):n&&n.type===te.TURN&&null!=p?this.graph.getDistance(e.node,p)>5&&f.unshift(e):f.unshift(e)}return{distance:o,instructions:f,path:s}}},ea=Ko;function Zo(t){let e=+this._x.call(null,t),n=+this._y.call(null,t);return Yo(this.cover(e,n),e,n,t)}function Yo(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,a,o,s,l,u,h,c,d,f=t._root,p={data:r},y=t._x0,g=t._y0,v=t._x1,m=t._y1;if(!f)return t._root=p,t;for(;f.length;)if((u=e>=(a=(y+v)/2))?y=a:v=a,(h=n>=(o=(g+m)/2))?g=o:m=o,i=f,!(f=f[c=h<<1|u]))return i[c]=p,t;if(s=+t._x.call(null,f.data),l=+t._y.call(null,f.data),e===s&&n===l)return p.next=f,i?i[c]=p:t._root=p,t;do{i=i?i[c]=new Array(4):t._root=new Array(4),(u=e>=(a=(y+v)/2))?y=a:v=a,(h=n>=(o=(g+m)/2))?g=o:m=o}while((c=h<<1|u)==(d=(l>=o)<<1|s>=a));return i[d]=f,i[c]=p,t}function Qo(t){var e,n,r,i,a=t.length,o=new Array(a),s=new Array(a),l=1/0,u=1/0,h=-1/0,c=-1/0;for(n=0;n<a;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(o[n]=r,s[n]=i,r<l&&(l=r),r>h&&(h=r),i<u&&(u=i),i>c&&(c=i));if(l>h||u>c)return this;for(this.cover(l,u).cover(h,c),n=0;n<a;++n)Yo(this,o[n],s[n],t[n]);return this}function es(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,a=(r=Math.floor(e))+1;else{for(var o,s,l=i-n||1,u=this._root;n>t||t>=i||r>e||e>=a;)switch(s=(e<r)<<1|t<n,o=new Array(4),o[s]=u,u=o,l*=2,s){case 0:i=n+l,a=r+l;break;case 1:n=i-l,a=r+l;break;case 2:i=n+l,r=a-l;break;case 3:n=i-l,r=a-l}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this}function ts(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}function ns(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function re(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function rs(t,e,n){var r,i,a,o,s,l,u,h=this._x0,c=this._y0,d=this._x1,f=this._y1,p=[],y=this._root;for(y&&p.push(new re(y,h,c,d,f)),null==n?n=1/0:(h=t-n,c=e-n,d=t+n,f=e+n,n*=n);l=p.pop();)if(!(!(y=l.node)||(i=l.x0)>d||(a=l.y0)>f||(o=l.x1)<h||(s=l.y1)<c))if(y.length){var g=(i+o)/2,v=(a+s)/2;p.push(new re(y[3],g,v,o,s),new re(y[2],i,v,g,s),new re(y[1],g,a,o,v),new re(y[0],i,a,g,v)),(u=(e>=v)<<1|t>=g)&&(l=p[p.length-1],p[p.length-1]=p[p.length-1-u],p[p.length-1-u]=l)}else{var m=t-+this._x.call(null,y.data),b=e-+this._y.call(null,y.data),M=m*m+b*b;if(M<n){var w=Math.sqrt(n=M);h=t-w,c=e-w,d=t+w,f=e+w,r=y.data}}return r}function is(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,n,r,i,a,o,s,l,u,h,c,d,f=this._root,p=this._x0,y=this._y0,g=this._x1,v=this._y1;if(!f)return this;if(f.length)for(;;){if((u=a>=(s=(p+g)/2))?p=s:g=s,(h=o>=(l=(y+v)/2))?y=l:v=l,e=f,!(f=f[c=h<<1|u]))return this;if(!f.length)break;(e[c+1&3]||e[c+2&3]||e[c+3&3])&&(n=e,d=c)}for(;f.data!==t;)if(r=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,r?(i?r.next=i:delete r.next,this):e?(i?e[c]=i:delete e[c],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[d]=f:this._root=f),this):(this._root=i,this)}function as(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function os(){return this._root}function ss(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}function us(t){var e,n,r,i,a,o,s=[],l=this._root;for(l&&s.push(new re(l,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(l=e.node,r=e.x0,i=e.y0,a=e.x1,o=e.y1)&&l.length){var u=(r+a)/2,h=(i+o)/2;(n=l[3])&&s.push(new re(n,u,h,a,o)),(n=l[2])&&s.push(new re(n,r,h,u,o)),(n=l[1])&&s.push(new re(n,u,i,a,h)),(n=l[0])&&s.push(new re(n,r,i,u,h))}return this}function cs(t){var e,n=[],r=[];for(this._root&&n.push(new re(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var a,o=e.x0,s=e.y0,l=e.x1,u=e.y1,h=(o+l)/2,c=(s+u)/2;(a=i[0])&&n.push(new re(a,o,s,h,c)),(a=i[1])&&n.push(new re(a,h,s,l,c)),(a=i[2])&&n.push(new re(a,o,c,h,u)),(a=i[3])&&n.push(new re(a,h,c,l,u))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this}function ls(t){return t[0]}function fs(t){return arguments.length?(this._x=t,this):this._x}function ds(t){return t[1]}function ps(t){return arguments.length?(this._y=t,this):this._y}function Kt(t,e,n){var r=new ta(null==e?ls:e,null==n?ds:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function ta(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function hs(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}p(),p(),p(),p(),p(),p(),p(),p(),p(),p(),p(),p(),p(),p(),p(),p();var le=Kt.prototype=ta.prototype;le.copy=function(){var t,e,n=new ta(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=hs(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=hs(e));return n},le.add=Zo,le.addAll=Qo,le.cover=es,le.data=ts,le.extent=ns,le.find=rs,le.remove=is,le.removeAll=as,le.root=os,le.size=ss,le.visit=us,le.visitAfter=cs,le.x=fs,le.y=ps;var Be,ne,nt=class{constructor(t){A(this,Be,void 0),d(this,"categories"),d(this,"locations"),d(this,"vortexes"),d(this,"maps"),d(this,"nodes"),d(this,"polygons"),d(this,"events"),d(this,"mapGroups"),d(this,"locationStates"),d(this,"locationRankings"),d(this,"rankings"),A(this,ne,{}),S(this,Be,t)}get polygonsByMapId(){if(y(this,ne).polygonsByMapId)return y(this,ne).polygonsByMapId;let t,e={};for(let n=0,r=y(this,Be).polygons.length;n<r;++n)t=y(this,Be).polygons[n],e[t.map]||(e[t.map]=[]),e[t.map].push(t);return y(this,ne).polygonsByMapId=e,y(this,ne).polygonsByMapId}get nodesByMapId(){if(y(this,ne).nodesByMapId)return y(this,ne).nodesByMapId;let t,e={};for(let n=0,r=y(this,Be).nodes.length;n<r;++n)t=y(this,Be).nodes[n],e[t.map]||(e[t.map]=[]),e[t.map].push(t);return y(this,ne).nodesByMapId=e,y(this,ne).nodesByMapId}findNearestNodeOnMap(t,e){if(y(this,ne).nodeTreesByMap||(y(this,ne).nodeTreesByMap=new Map),!y(this,ne).nodeTreesByMap.has(t)){let e=this.nodesByMapId[t],n=Kt();n.x((t=>t.x)),n.y((t=>t.y)),n.addAll(e),y(this,ne).nodeTreesByMap.set(t,n)}return y(this,ne).nodeTreesByMap.get(t).find(e.x,e.y)}get locationsByMapId(){if(y(this,ne).locationsByMapId)return y(this,ne).locationsByMapId;let t,e={};for(let n=0,r=y(this,Be).locations.length;n<r;++n){t=y(this,Be).locations[n];for(let n=0,r=t.polygons.length;n<r;++n)e[t.polygons[n].map]||(e[t.polygons[n].map]=[]),e[t.polygons[n].map].push(t)}return y(this,ne).locationsByMapId=e,y(this,ne).locationsByMapId}static create(t){return nt.instances.has(t)||nt.instances.set(t,new nt(t)),nt.instances.get(t)}static clear(){nt.instances.clear()}},na=nt;Be=new WeakMap,ne=new WeakMap,d(na,"instances",new Map);var Me=na;p(),p(),p(),p();var gs=" ",fe=class{static get separator(){return gs}static set separator(t){gs=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);let e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let n=null;switch(e.length){case 3:n=e[0]/1+e[1]/60+e[2]/3600;break;case 2:n=e[0]/1+e[1]/60;break;case 1:n=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(n=-n),Number(n)}static toDms(t,e="d",n){if(isNaN(t)||"string"==typeof t&&""==t.trim()||"boolean"==typeof t||t==1/0||null==t)return null;if(void 0===n)switch(e){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:e="d",n=4}t=Math.abs(t);let r=null,i=null,a=null,o=null;switch(e){default:case"d":case"deg":i=t.toFixed(n),i<100&&(i="0"+i),i<10&&(i="0"+i),r=i+"°";break;case"dm":case"deg+min":i=Math.floor(t),a=(60*t%60).toFixed(n),60==a&&(a=(0).toFixed(n),i++),i=("000"+i).slice(-3),a<10&&(a="0"+a),r=i+"°"+fe.separator+a+"′";break;case"dms":case"deg+min+sec":i=Math.floor(t),a=Math.floor(3600*t/60)%60,o=(3600*t%60).toFixed(n),60==o&&(o=(0).toFixed(n),a++),60==a&&(a=0,i++),i=("000"+i).slice(-3),a=("00"+a).slice(-2),o<10&&(o="0"+o),r=i+"°"+fe.separator+a+"′"+fe.separator+o+"″"}return r}static toLat(t,e,n){let r=fe.toDms(fe.wrap90(t),e,n);return null===r?"–":r.slice(1)+fe.separator+(t<0?"S":"N")}static toLon(t,e,n){let r=fe.toDms(fe.wrap180(t),e,n);return null===r?"–":r+fe.separator+(t<0?"W":"E")}static toBrng(t,e,n){let r=fe.toDms(fe.wrap360(t),e,n);return null===r?"–":r.replace("360","0")}static fromLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=fe.wrap360(t);let n=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*n/360)%n*16/n]}static wrap360(t){return 0<=t&&t<360?t:(t%360+360)%360}static wrap180(t){return-180<t&&t<=180?t:(t+540)%360-180}static wrap90(t){return-90<=t&&t<=90?t:Math.abs((t%360+270)%360-180)-90}};Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var j=fe,K=Math.PI,q=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=j.wrap90(Number(t)),this._lon=j.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?j.wrap90(j.parse(t)):j.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?j.wrap90(j.parse(t)):j.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?j.wrap180(j.parse(t)):j.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?j.wrap180(j.parse(t)):j.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?j.wrap180(j.parse(t)):j.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,n;if(2==t.length&&([e,n]=t,e=j.wrap90(j.parse(e)),n=j.wrap180(j.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,n]=t[0].split(","),e=j.wrap90(j.parse(e)),n=j.wrap180(j.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){let r=t[0];if("Point"==r.type&&Array.isArray(r.coordinates)?[n,e]=r.coordinates:(null!=r.latitude&&(e=r.latitude),null!=r.lat&&(e=r.lat),null!=r.longitude&&(n=r.longitude),null!=r.lng&&(n=r.lng),null!=r.lon&&(n=r.lon),e=j.wrap90(j.parse(e)),n=j.wrap180(j.parse(n))),isNaN(e)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(n))throw new TypeError(`invalid point ‘${t.toString()}’`);return new q(e,n)}distanceTo(t,e=6371e3){if(t instanceof q||(t=q.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);let n=e,r=this.lat.toRadians(),i=this.lon.toRadians(),a=t.lat.toRadians(),o=a-r,s=t.lon.toRadians()-i,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(r)*Math.cos(a)*Math.sin(s/2)*Math.sin(s/2);return n*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof q||(t=q.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),i=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(r),a=Math.sin(r)*Math.cos(n),o=Math.atan2(a,i).toDegrees();return j.wrap360(o)}finalBearingTo(t){t instanceof q||(t=q.parse(t));let e=t.initialBearingTo(this)+180;return j.wrap360(e)}midpointTo(t){t instanceof q||(t=q.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),i=(t.lon-this.lon).toRadians(),a=Math.cos(e),o=0,s=Math.sin(e),l={x:a+Math.cos(r)*Math.cos(i),y:o+Math.cos(r)*Math.sin(i),z:s+Math.sin(r)},u=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),h=n+Math.atan2(l.y,l.x),c=u.toDegrees(),d=h.toDegrees();return new q(c,d)}intermediatePointTo(t,e){if(t instanceof q||(t=q.parse(t)),this.equals(t))return new q(this.lat,this.lon);let n=this.lat.toRadians(),r=this.lon.toRadians(),i=t.lat.toRadians(),a=t.lon.toRadians(),o=i-n,s=a-r,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(n)*Math.cos(i)*Math.sin(s/2)*Math.sin(s/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),h=Math.sin((1-e)*u)/Math.sin(u),c=Math.sin(e*u)/Math.sin(u),d=h*Math.cos(n)*Math.cos(r)+c*Math.cos(i)*Math.cos(a),f=h*Math.cos(n)*Math.sin(r)+c*Math.cos(i)*Math.sin(a),p=h*Math.sin(n)+c*Math.sin(i),y=Math.atan2(p,Math.sqrt(d*d+f*f)),g=Math.atan2(f,d),v=y.toDegrees(),m=g.toDegrees();return new q(v,m)}destinationPoint(t,e,n=6371e3){let r=t/n,i=Number(e).toRadians(),a=this.lat.toRadians(),o=this.lon.toRadians(),s=Math.sin(a)*Math.cos(r)+Math.cos(a)*Math.sin(r)*Math.cos(i),l=Math.asin(s),u=Math.sin(i)*Math.sin(r)*Math.cos(a),h=Math.cos(r)-Math.sin(a)*s,c=o+Math.atan2(u,h),d=l.toDegrees(),f=c.toDegrees();return new q(d,f)}static intersection(t,e,n,r){if(t instanceof q||(t=q.parse(t)),n instanceof q||(n=q.parse(n)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(r))throw new TypeError(`invalid brng2 ‘${r}’`);let i=t.lat.toRadians(),a=t.lon.toRadians(),o=n.lat.toRadians(),s=n.lon.toRadians(),l=Number(e).toRadians(),u=Number(r).toRadians(),h=o-i,c=s-a,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(i)*Math.cos(o)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new q(t.lat,t.lon);let f=(Math.sin(o)-Math.sin(i)*Math.cos(d))/(Math.sin(d)*Math.cos(i)),p=(Math.sin(i)-Math.sin(o)*Math.cos(d))/(Math.sin(d)*Math.cos(o)),y=Math.acos(Math.min(Math.max(f,-1),1)),g=Math.acos(Math.min(Math.max(p,-1),1)),v=l-(Math.sin(s-a)>0?y:2*K-y),m=(Math.sin(s-a)>0?2*K-g:g)-u;if(0==Math.sin(v)&&0==Math.sin(m)||Math.sin(v)*Math.sin(m)<0)return null;let b=-Math.cos(v)*Math.cos(m)+Math.sin(v)*Math.sin(m)*Math.cos(d),M=Math.atan2(Math.sin(d)*Math.sin(v)*Math.sin(m),Math.cos(m)+Math.cos(v)*b),w=Math.asin(Math.min(Math.max(Math.sin(i)*Math.cos(M)+Math.cos(i)*Math.sin(M)*Math.cos(l),-1),1)),_=a+Math.atan2(Math.sin(l)*Math.sin(M)*Math.cos(i),Math.cos(M)-Math.sin(i)*Math.sin(w)),x=w.toDegrees(),O=_.toDegrees();return new q(x,O)}crossTrackDistanceTo(t,e,n=6371e3){t instanceof q||(t=q.parse(t)),e instanceof q||(e=q.parse(e));let r=n;if(this.equals(t))return 0;let i=t.distanceTo(this,r)/r,a=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(i)*Math.sin(a-o))*r}alongTrackDistanceTo(t,e,n=6371e3){t instanceof q||(t=q.parse(t)),e instanceof q||(e=q.parse(e));let r=n;if(this.equals(t))return 0;let i=t.distanceTo(this,r)/r,a=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians(),s=Math.asin(Math.sin(i)*Math.sin(a-o));return Math.acos(Math.cos(i)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(o-a))*r}maxLatitude(t){let e=Number(t).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(n))).toDegrees()}static crossingParallels(t,e,n){if(t.equals(e))return null;let r=Number(n).toRadians(),i=t.lat.toRadians(),a=t.lon.toRadians(),o=e.lat.toRadians(),s=e.lon.toRadians()-a,l=Math.sin(i)*Math.cos(o)*Math.cos(r)*Math.sin(s),u=Math.sin(i)*Math.cos(o)*Math.cos(r)*Math.cos(s)-Math.cos(i)*Math.sin(o)*Math.cos(r),h=Math.cos(i)*Math.cos(o)*Math.sin(r)*Math.sin(s);if(h*h>l*l+u*u)return null;let c=Math.atan2(-u,l),d=Math.acos(h/Math.sqrt(l*l+u*u)),f=a+c+d,p=(a+c-d).toDegrees(),y=f.toDegrees();return{lon1:j.wrap180(p),lon2:j.wrap180(y)}}rhumbDistanceTo(t,e=6371e3){t instanceof q||(t=q.parse(t));let n=e,r=this.lat.toRadians(),i=t.lat.toRadians(),a=i-r,o=Math.abs(t.lon-this.lon).toRadians();Math.abs(o)>K&&(o=o>0?-(2*K-o):2*K+o);let s=Math.log(Math.tan(i/2+K/4)/Math.tan(r/2+K/4)),l=Math.abs(s)>1e-11?a/s:Math.cos(r);return Math.sqrt(a*a+l*l*o*o)*n}rhumbBearingTo(t){if(t instanceof q||(t=q.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians();Math.abs(r)>K&&(r=r>0?-(2*K-r):2*K+r);let i=Math.log(Math.tan(n/2+K/4)/Math.tan(e/2+K/4)),a=Math.atan2(r,i).toDegrees();return j.wrap360(a)}rhumbDestinationPoint(t,e,n=6371e3){let r=this.lat.toRadians(),i=this.lon.toRadians(),a=Number(e).toRadians(),o=t/n,s=o*Math.cos(a),l=r+s;Math.abs(l)>K/2&&(l=l>0?K-l:-K-l);let u=Math.log(Math.tan(l/2+K/4)/Math.tan(r/2+K/4)),h=Math.abs(u)>1e-11?s/u:Math.cos(r),c=i+o*Math.sin(a)/h,d=l.toDegrees(),f=c.toDegrees();return new q(d,f)}rhumbMidpointTo(t){t instanceof q||(t=q.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),i=t.lon.toRadians();Math.abs(i-n)>K&&(n+=2*K);let a=(e+r)/2,o=Math.tan(K/4+e/2),s=Math.tan(K/4+r/2),l=Math.tan(K/4+a/2),u=((i-n)*Math.log(l)+n*Math.log(s)-i*Math.log(o))/Math.log(s/o);isFinite(u)||(u=(n+i)/2);let h=a.toDegrees(),c=u.toDegrees();return new q(h,c)}static areaOf(t,e=6371e3){let n=e,r=t[0].equals(t[t.length-1]);r||t.push(t[0]);let i=t.length-1,a=0;for(let e=0;e<i;e++){let n=t[e].lat.toRadians(),r=t[e+1].lat.toRadians(),i=(t[e+1].lon-t[e].lon).toRadians();a+=2*Math.atan2(Math.tan(i/2)*(Math.tan(n/2)+Math.tan(r/2)),1+Math.tan(n/2)*Math.tan(r/2))}(function(t){let e=0,n=t[0].initialBearingTo(t[1]);for(let r=0;r<t.length-1;r++){let i=t[r].initialBearingTo(t[r+1]),a=t[r].finalBearingTo(t[r+1]);e+=(i-n+540)%360-180,e+=(a-i+540)%360-180,n=a}return e+=(t[0].initialBearingTo(t[1])-n+540)%360-180,Math.abs(e)<90})(t)&&(a=Math.abs(a)-2*K);let o=Math.abs(a*n*n);return r||t.pop(),o}equals(t){return t instanceof q||(t=q.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);if("n"==t)return null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`;return`${j.toLat(this.lat,t,e)}, ${j.toLon(this.lon,t,e)}`}};p(),p(),p();var $r=class{constructor(t){d(this,"destinations",[]),this.destinations=t}};p();var Yt,Ve,Zt=class{constructor(t,e){A(this,Yt,void 0),A(this,Ve,void 0),d(this,"distance",0),d(this,"path",[]),d(this,"instructions",[]),S(this,Ve,t),S(this,Yt,e),this.distance=e.distance,this.instructions=e.instructions.map((t=>{var e,n,r,i,a,o,s,l,u,h,c,d;let f={...t,action:{...t.action},atLocation:(null==(e=t.atLocation)?void 0:e.id)?null==(r=null==(n=y(this,Ve))?void 0:n._vortexesById)?void 0:r[t.atLocation.id]:void 0,node:(null==(i=t.node)?void 0:i.id)?null==(o=null==(a=y(this,Ve))?void 0:a._nodesById)?void 0:o[t.node.id]:void 0};return((null==(s=f.action)?void 0:s.type)===te.TAKEVORTEX||(null==(l=f.action)?void 0:l.type)===te.EXITVORTEX)&&(f.action.fromMap=null==(h=y(this,Ve)._mapsById)?void 0:h[null==(u=f.action)?void 0:u.fromMap.id],f.action.toMap=null==(d=y(this,Ve)._mapsById)?void 0:d[null==(c=f.action)?void 0:c.toMap.id]),f})),this.path=e.path.map((t=>{var e,n;return null==(n=null==(e=y(this,Ve))?void 0:e._nodesById)?void 0:n[t.id]}))}toJSON(){return y(this,Yt)}};Yt=new WeakMap,Ve=new WeakMap;var Ke,Xe=class{constructor(t){A(this,Ke,void 0),S(this,Ke,t)}directionsTo(t,e){if(t instanceof $r){let n=[],r=this;for(let i=0;i<t.destinations.length;i++){let a=t.destinations[i],o=Qt(r),s=Qt(a),l=y(this,Ke).navigator.getDirections({originIds:o,destinationNodeIds:s,accessible:(null==e?void 0:e.accessible)||!1}),u=new Zt(y(this,Ke),l);n.push(u),r=a}return n}{let n=Qt(this),r=Qt(t),i=y(this,Ke).navigator.getDirections({originIds:n,destinationNodeIds:r,accessible:(null==e?void 0:e.accessible)||!1});return new Zt(y(this,Ke),i)}}distanceTo(t,e){let n=this.directionsTo(t,e);return(null==n?void 0:n.distance)||0}directionsToCallback(t,e){return this.directionsTo(t,e)}};Ke=new WeakMap;var Ed=0,Rd="9999-12-31T00:00:00.000Z";function Cd(t,e,n=new Date){if(!t.states)return;let r=n||new Date,i=t.states.find((t=>{let e=new Date(t.start||Ed),n=new Date(t.end||Rd);return e<r&&n>r}));return i?e.find((t=>t.value===i.type)):void 0}var Ee,rt,xe,en,tn,nn,rn=class extends Xe{constructor(t,e){super(t),A(this,Ee,void 0),A(this,rt,void 0),A(this,xe,{}),d(this,"states"),d(this,"id",""),d(this,"name",""),d(this,"type",""),d(this,"description"),d(this,"sortOrder"),d(this,"logo"),d(this,"phone"),d(this,"social"),d(this,"color"),d(this,"shortName"),d(this,"detailsUrl"),d(this,"tags"),d(this,"externalId"),d(this,"showLabelWhenImagePresent"),d(this,"picture"),d(this,"operationHours"),d(this,"siblingGroups"),d(this,"gallery"),d(this,"categories",[]),A(this,en,void 0),A(this,tn,[]),A(this,nn,void 0),S(this,Ee,t),S(this,rt,e),Object.assign(this,e)}get polygons(){let t=y(this,xe).polygons;if(void 0!==t)return t;let e=[],n=y(this,en),r=y(this,Ee)._polygonsById;if(Array.isArray(n))for(let t=0,i=n.length;t<i;++t){let i=r[n[t].id];null!=i&&i.geometry.visible&&e.push(i)}return y(this,xe).polygons=e,e}set polygons(t){S(this,en,t)}get rank(){let t=y(this,xe).rank;if(void 0!==t)return t;let e=y(this,Ee).locationRankings;if(!e||!e.locations)return null;let n=e.locations.find((t=>t.ids.find((t=>t===this.id))));return n?(y(this,xe).rank=n.score,n.score):null}get nodes(){let t=y(this,xe).nodes;if(void 0!==t)return t;let e=[],n=y(this,tn),r=y(this,Ee)._nodesById;if(n)for(let t=0,i=n.length;t<i;++t){let i=r[n[t].node];null!=i&&e.push(i)}return y(this,xe).nodes=e,e}set nodes(t){S(this,tn,t)}get parent(){let t=y(this,xe).parent;if(void 0!==t)return t;let e,n=y(this,Ee)._locationsById,r=y(this,nn);return void 0!==r&&(e=n[r]),y(this,xe).parent=e,e}set parent(t){S(this,nn,t)}get state(){return Cd(this,y(this,Ee).locationStates)}clone(){return new rn(y(this,Ee),y(this,rt))}get nodeOperationHours(){let t=y(this,xe).nodeOperationHours;if(void 0!==t)return t;if(null==this.nodes)return{};let e=y(this,rt).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return y(this,xe).nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new rn(e,t)))}static async fetch(t){let e=t.options.things.locations.slice();t.options.things.categories&&Y(e,"categories"),t.options.things.nodes&&Y(e,"nodes"),t.options.things.polygons&&Y(e,"polygons"),t.options.things.locationStates&&Y(e,"states");let n={fields:e,venue:t.options.venue};try{let e=await Z(t.options,"location",n);return t.options.includeHidden||(e=e.filter((t=>!t.hidden))),e.map((e=>new rn(t,e)))}catch(t){return console.error("Fetch Locations:",t),[]}}toJSON(){return y(this,rt)}},pt=rn;Ee=new WeakMap,rt=new WeakMap,xe=new WeakMap,en=new WeakMap,tn=new WeakMap,nn=new WeakMap,p();var it,an,Re,on,Hr=class extends Xe{constructor(t,e){super(t),A(this,it,void 0),A(this,an,void 0),A(this,Re,{}),d(this,"geometry"),d(this,"image"),d(this,"holes"),d(this,"textures"),d(this,"material"),d(this,"label"),d(this,"id",""),d(this,"map",""),d(this,"layer"),d(this,"layerId"),d(this,"name"),d(this,"externalId"),d(this,"vertexes"),d(this,"canvasBounds"),A(this,on,void 0),S(this,it,t),S(this,an,e),Object.assign(this,e)}get locations(){let t=y(this,Re).locations;if(void 0!==t)return t;let e=[],n=Me.instances.get(y(this,it)).locationsByMapId[this.map],{id:r}=this;for(let t=0,i=n.length;t<i;++t){let i=n[t],a=i.polygons;if(Array.isArray(a))for(let t=0,n=a.length;t<n;++t)if(a[t].id===r){e.push(i);break}}return y(this,Re).locations=e,e}get entrances(){let t=y(this,Re).entrances;if(void 0!==t)return t;let e=[],n=y(this,on),r=y(this,it)._nodesById;if(Array.isArray(n)){for(let t=0,i=n.length;t<i;++t){let i=r[n[t].id];null!=i&&e.push(i)}return y(this,Re).entrances=e,e}return[]}set entrances(t){S(this,on,t)}get rank(){let t=y(this,Re).rank;if(void 0!==t)return t;let{rankings:e}=y(this,it);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(y(this,Re).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(y(this,Re).rank=null,null)}static hydrate(t,e){return t.map((t=>new Hr(e,t)))}static async fetch(t){let e=t.options.things.polygons.slice();t.options.things.maps&&Y(e,"map"),t.options.things.nodes&&Y(e,"entrances");let n={fields:e,perspective:t.options.do2D&&t.options.perspective||void 0,venue:t.options.venue};try{return(await Z(t.options,"polygon",n)).filter((t=>t.geometry.visible)).map((e=>new Hr(t,e)))}catch(t){return console.error("Fetch Polygons:",t),[]}}toJSON(){return y(this,an)}},ht=Hr;function ys(t){return/^[\da-f]{24}$/i.test(t)}function ms(t,e=!1){let n="";if(null!=t){let r="?",i=e?Object.keys(t).filter((t=>!["slug","venue"].includes(t))):Object.keys(t);for(let e=0,a=i.length;e<a;++e){let a=i[e],o=t[a];null!=o&&(n+=`${r+encodeURIComponent(a)}=${encodeURIComponent(o)}`,r="&")}}return n}function qd(t,e,n,r=!1){var i,a;return r?`${t.supplementaryUrl}${e}?venue=${n.venue||n.slug}`:(null==(i=t.baseUrl)?void 0:i.includes("gateway"))?`${t.baseUrl}${e}/${n.venue||n.slug}${ms(n,null==(a=t.baseUrl)?void 0:a.includes("gateway"))}`:t.baseUrl+e+ms(n)}async function Z(t,e,n,r=!1){return sn(t,e,n,r,!0)}async function sn(t,e,n,r=!1,i=!1){let a=qd(t,e,n,r),o=await Jr(t,a,r);if(!i&&Array.isArray(o)){if(1===o.length)return o[0];throw new Error("Invalid response object")}return o}async function Jr(t,e,n=!1){let r={language:t.language,clientId:t.clientId,clientSecret:t.clientSecret};n&&delete r.language,r.language&&(e+=`&lang=${encodeURIComponent(r.language)}`);let{headers:i}=t;i["Content-Type"]="text/json",t.authorization&&(i.Authorization=t.authorization),r.language&&(i["Accept-Language"]=r.language);let a=await fetch(e,{method:"GET",headers:i});if(!a.ok)throw new Error(`${a.status} ${a.statusText}`);return a.json()}function Y(t,e){t.indexOf(e)<0&&t.push(e)}function vs([t,e],[n,r]){let i=new q(t,e),a=new q(n,r);return i.distanceTo(a)}function Ms(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale);let e;try{let n=t.georeference[0],r=t.georeference[2],i=new q(n.target.x,n.target.y),a=new q(r.target.x,r.target.y),o=i.distanceTo(a),s=n.control.x-r.control.x,l=n.control.y-r.control.y;e=Math.sqrt(s*s+l*l)/o}catch(n){e=1,console.warn(n),console.warn(`Couldn't georeference ${t.name||t.shortName||t.id}. Probably not enough geocoordinates.`)}return e}function Qt(t){var e;return t instanceof ht?t.entrances.map((t=>t.id)):t instanceof pt?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}async function xs(t){let e={},{maps:n,images:r,scenes:i,polygons:a}=t;if(null!=r)try{let t=Object.keys(r).map((t=>fetch(`data:image/png;base64,${r[t]}`).then((t=>t.blob())).then((n=>{e[t]=n})).catch((t=>{console.error(t)}))));await Promise.all(t)}catch(t){console.error(t)}return n.forEach((t=>{var n;!(null==(n=t.scene)?void 0:n.polygons)&&!i[t.id]||(null!=i&&i[t.id]&&(t.scene||(t.scene={}),Object.defineProperty(t.scene,"polygons",{get:()=>i[t.id]})),null!=r&&(t.scene.images=t.scene.images.map((({filename:t})=>({filename:t,url:e[t]}))),t.scene.polygons.forEach((t=>{var n,r;if((null==(n=null==t?void 0:t.image)?void 0:n.url)&&(null==(r=null==t?void 0:t.image)?void 0:r.url)){let n=t.image.url.split("/"),r=e[n[n.length-1]];r&&(t.image.url=r)}}))))})),null!=r&&a.forEach((t=>{var n;if(null==(n=null==t?void 0:t.image)?void 0:n.url){let n=t.image.url.split("/"),r=e[n[n.length-1]];r&&(t.image.url=r)}})),null!=t.images&&delete t.images,null!=t.scenes&&delete t.scenes,t}it=new WeakMap,an=new WeakMap,Re=new WeakMap,on=new WeakMap;var un,cn,ln,Xr=class{constructor(t,e){A(this,un,void 0),A(this,cn,{}),A(this,ln,void 0),d(this,"name"),d(this,"externalId"),d(this,"parents"),d(this,"id"),d(this,"icon"),this.id=e.id,S(this,ln,e),S(this,un,t),Object.assign(this,e)}get locations(){let t=y(this,cn).locations;if(void 0!==t)return t;let e=[],{locations:n}=y(this,un),{id:r}=this;for(let t=0,i=n.length;t<i;++t){let i=n[t],a=i.categories;if(Array.isArray(a))for(let t=0,n=a.length;t<n;++t)if(a[t]===r){e.push(i);break}}return y(this,cn).locations=e,e}static hydrate(t,e){return t.map((t=>new Xr(e,t)))}static async fetch(t){let e={fields:t.options.things.categories,venue:t.options.venue};try{return(await Z(t.options,"category",e)).map((e=>new Xr(t,e)))}catch(t){return console.error("Fetch Categories:",t),[]}}toJSON(){return y(this,ln)}},Wr=Xr;un=new WeakMap,cn=new WeakMap,ln=new WeakMap,p();var fn,gt,dn,Zr=class{constructor(t,e){A(this,fn,void 0),A(this,gt,void 0),A(this,dn,{}),d(this,"id",""),d(this,"type",""),d(this,"name",""),d(this,"description"),d(this,"image"),d(this,"startDate"),d(this,"endDate"),d(this,"showDate"),S(this,gt,e),S(this,fn,t),Object.assign(this,e)}location(){let t=y(this,dn).location;if(void 0!==t)return t;let e,n=y(this,fn)._locationsById,r=y(this,gt).location;if(null!=r){let t=n[r];null!=t&&(e=t)}return y(this,dn).location=e,e}static hydrate(t,e){return t.map((t=>new Zr(e,t)))}static async fetch(t){let e=t.options.things.events.slice();t.options.things.locations&&Y(e,"location");let n={fields:e,venue:t.options.venue,activeAtOrAfter:Date.now()};try{return(await Z(t.options,"event",n)).map((e=>new Zr(t,e)))}catch(t){return console.error("Fetch Events:",t),[]}}toJSON(){return y(this,gt)}},Kr=Zr;fn=new WeakMap,gt=new WeakMap,dn=new WeakMap,p();var pn,Yr=class{constructor(t){A(this,pn,void 0),d(this,"locations",[]),S(this,pn,t),Object.assign(this,t)}static hydrate(t){return new Yr(t)}static async fetch(t){try{let e=await sn(t.options,"smart-labels/location-label-ranking",{venue:t.options.venue},!0);return new Yr(e)}catch(t){return console.error("Fetch Location Rankings:",t),{}}}toJSON(){return y(this,pn)}},ra=Yr;pn=new WeakMap,p();var hn,Qr=class{constructor(t){A(this,hn,void 0),d(this,"id",""),d(this,"name",""),d(this,"value",""),S(this,hn,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Qr(t)))}static async fetch(t){let e={fields:t.options.things.locationStates.slice(),venue:t.options.venue};try{return(await Z(t.options,"location-state",e)).map((t=>new Qr(t)))}catch(t){return console.error("Fetch Location States:",t),[]}}toJSON(){return y(this,hn)}},ia=Qr;hn=new WeakMap,p(),p();var yn,mn,gn=class{constructor(t,e,n,r,i,a){d(this,"map"),d(this,"x",0),d(this,"y",0),d(this,"lat",0),d(this,"lon",0),A(this,yn,{}),A(this,mn,void 0),this.lat=t,this.lon=e,this.map="string"==typeof i?i:i.id,this.x=n,this.y=r,S(this,mn,a)}absoluteDistanceTo(t){return vs([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=y(this,yn).nearestNode;if(void 0!==t)return t;let e=Me.instances.get(y(this,mn)).findNearestNodeOnMap(this.map,this);return y(this,yn).nearestNode=e,e}};yn=new WeakMap,mn=new WeakMap;var Ce,vn,Mn,ti=class{constructor(t,e){A(this,Ce,void 0),A(this,vn,{}),A(this,Mn,void 0),d(this,"id",""),d(this,"group",""),d(this,"name",""),d(this,"shortName",""),d(this,"elevation",0),d(this,"scale",0),d(this,"layers"),d(this,"x_scale"),d(this,"perspectiveId"),d(this,"scene"),d(this,"width",0),d(this,"height",0),d(this,"georeference",[]),d(this,"_scale",0),S(this,Ce,t),S(this,Mn,e),Object.assign(this,e),this._scale=Ms(this),this.scale=this.x_scale||1/this._scale}get polygons(){var t;return(null==(t=Me.instances.get(y(this,Ce)))?void 0:t.polygonsByMapId[this.id])||[]}get locations(){var t;return(null==(t=Me.instances.get(y(this,Ce)))?void 0:t.locationsByMapId[this.id])||[]}get nodes(){var t;return(null==(t=Me.instances.get(y(this,Ce)))?void 0:t.nodesByMapId[this.id])||[]}get mapGroup(){let t=y(this,vn).mapGroup;if(void 0!==t)return t;let e=this.group,n=e&&y(this,Ce)._mapGroupsById[e]||null;return y(this,vn).mapGroup=n,n}createCoordinateByXY(t,e){let n,r=this.georeference[0],i=new q(r.target.x,r.target.y),a=t-r.control.x,o=r.control.y-e,s=Math.atan2(a,o);n=0===a&&0===o?0:0===a?o:a/Math.sin(s);let l=s-this.getNorth(),u=n/this._scale,h=i.destinationPoint(u,180*l/Math.PI);return new gn(h.lat,h.lon,t,e,this.id,y(this,Ce))}createCoordinate(t,e){let n=this.georeference[0],r=new q(n.target.x,n.target.y),i=new q(t,e),a=r.distanceTo(i),o=(r.finalBearingTo(i)+360)%360*Math.PI/180||0,s=a*(1/this.scale),l=o+this.getNorth(),u=Math.sin(l)*s,h=Math.cos(l)*s;return new gn(t,e,n.control.x+u,n.control.y-h,this.id,y(this,Ce))}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],r=new q(e.target.x,e.target.y),i=new q(n.target.x,n.target.y);t=-((r.finalBearingTo(i)+0)*Math.PI/180-Math.atan2(n.control.y-e.control.y,n.control.x-e.control.x)-Math.PI/2)}catch(e){t=0,console.warn(e),console.warn(`Couldn't georeference ${this.name||this.shortName||this.id}. Probably not enough geocoordinates.`)}return t}static hydrate(t,e){return t.map((t=>new ti(e,t)))}static async fetch(t){let e=t.options.things.maps.slice();t.options.perspective&&Y(e,"perspectives"),t.options.things.mapGroups&&Y(e,"group"),Y(e,"elevation"),Y(e,"x_scale"),Y(e,"scale"),Y(e,"georeference");let n={fields:e,perspective:t.options.perspective,venue:t.options.venue};try{let i=await Z(t.options,"map",n),a=t=>{let e=r.layers.find((e=>e.id===t));e?e.visible=!0:r.layers.push({id:t,visible:!0})};for(let n=0,o=i.length;n<o;++n){var r=i[n];if(r){let n=r.perspective;null!=n&&(r.perspectiveId=n.id,t.options.do2D?(e.indexOf("width")>-1&&(r.width=n.size&&n.size.width||n.width),e.indexOf("height")>-1&&(r.height=n.size&&n.size.height||n.height),e.indexOf("tiles")>-1&&(r.tiles=n.tiles),e.indexOf("original")>-1&&(r.original=n.original)):(e.indexOf("scene")>-1&&(r.scene=n.scene),n.layers?(r.layers.forEach((t=>{t.visible=!1})),n.layers.forEach(a)):r.layers.forEach((t=>{t.visible=!0})))),delete r.perspective}i[n]=new ti(t,r)}return i}catch(t){return console.error("Fetch Maps:",t),[]}}toJSON(){return y(this,Mn)}},ei=ti;Ce=new WeakMap,vn=new WeakMap,Mn=new WeakMap,p();var xn,yt,bn,ri=class{constructor(t,e){A(this,xn,void 0),A(this,yt,void 0),A(this,bn,{}),d(this,"id",""),d(this,"name",""),S(this,yt,e),S(this,xn,t),Object.assign(this,e)}get maps(){let t=y(this,bn).maps;if(void 0!==t)return t;let e=[],{maps:n}=y(this,xn),{id:r}=y(this,yt);for(let t=0,i=n.length;t<i;++t){let i=n[t];i.group===r&&e.push(i)}return y(this,bn).maps=e,e}static hydrate(t,e){return t.map((t=>new ri(e,t)))}static async fetch(t){let e={fields:t.options.things.mapGroups.slice(),venue:t.options.venue};try{return(await Z(t.options,"map-group",e)).map((e=>new ri(t,e)))}catch(t){return console.error("Fetch Map Groups:",t),[]}}toJSON(){return y(this,yt)}},ni=ri;xn=new WeakMap,yt=new WeakMap,bn=new WeakMap,p();var ke,wn,de,In,ai=class extends Xe{constructor(t,e){super(t),A(this,ke,void 0),A(this,wn,void 0),A(this,de,{}),d(this,"id",""),d(this,"map",""),d(this,"x",0),d(this,"y",0),d(this,"operationHours"),d(this,"externalId"),A(this,In,void 0),S(this,ke,t),S(this,wn,e),Object.assign(this,e)}get lat(){var t;let e=y(this,de).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=y(this,ke)._mapsById)?void 0:t[this.map];if(null==n)throw new Error("Map not found");return y(this,de).cachedLatLon=n.createCoordinateByXY(this.x,this.y),y(this,de).cachedLatLon.lat}get lon(){var t;let e=y(this,de).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=y(this,ke)._mapsById)?void 0:t[this.map];if(null==n)throw new Error("Map not found");return y(this,de).cachedLatLon=n.createCoordinateByXY(this.x,this.y),y(this,de).cachedLatLon.lon}get paths(){let t=y(this,de).paths;if(void 0!==t)return t;let e=[],n=y(this,ke)._nodesById,r=y(this,In);if(Array.isArray(r))for(let t=0,i=r.length;t<i;++t){let i=n[r[t].node];null!=i&&e.push(i)}return y(this,de).paths=e,e}set paths(t){S(this,In,t)}get locations(){var t;let e=y(this,de).locations;if(void 0!==e)return e;let n=[],r=null==(t=Me.instances.get(y(this,ke)))?void 0:t.locationsByMapId[this.map],i=this.id;for(let t=0,e=r.length;t<e;++t){let e=r[t],a=e.nodes;if(Array.isArray(a))for(let t=0,r=a.length;t<r;++t)if(a[t].id===i){n.push(e);break}}return y(this,de).locations=n,n}get polygon(){let t=y(this,de).polygon;if(void 0!==t)return t;let e,n=Me.instances.get(y(this,ke)).polygonsByMapId[this.map],r=this.id;for(let t=0,i=n.length;t<i;++t){let i=n[t];i.entrances.map((t=>t.id)).includes(r)&&(e=i)}return y(this,de).polygon=e,e}static hydrate(t,e){return t.map((t=>new ai(e,t)))}static async fetch(t){let e=t.options.things.nodes.slice();t.options.things.maps&&Y(e,"map"),["weight","multiplier","accessible"].forEach((function(t){Y(e,t)}));let n={fields:e,perspective:t.options.do2D&&t.options.perspective||void 0,venue:t.options.venue};try{return(await Z(t.options,"node",n)).map((e=>new ai(t,e)))}catch(t){return console.error("Fetch Nodes:",t),[]}}toJSON(){return y(this,wn)}},ii=ai;ke=new WeakMap,wn=new WeakMap,de=new WeakMap,In=new WeakMap,p();var Tn,si=class{constructor(t){A(this,Tn,void 0),d(this,"polygons",[]),S(this,Tn,t),Object.assign(this,t)}static hydrate(t){return new si(t)}static async fetch(t){try{let e=await sn(t.options,"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new si(e)}catch(t){return console.error("Fetch Rankings:",t),null}}toJSON(){return y(this,Tn)}},oi=si;Tn=new WeakMap,p();var Nn,ui=class{constructor(t){d(this,"id",""),A(this,Nn,void 0),S(this,Nn,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new ui(t)))}static async fetch(t){let e={fields:t.options.things.themes.slice(),venue:t.options.venue};try{return(await Z(t.options,"apollo-theme",e)).map((t=>new ui(t)))}catch(t){return console.error("Fetch Theme:",t),[]}}toJSON(){return y(this,Nn)}},aa=ui;Nn=new WeakMap,p();var On,_n,mt,li=class{constructor(t,e){A(this,On,void 0),A(this,_n,void 0),A(this,mt,{}),d(this,"defaultMap",""),d(this,"address",""),d(this,"city",""),d(this,"countrycode",""),d(this,"externalId",""),d(this,"id",""),d(this,"latitude"),d(this,"logo"),d(this,"longitude"),d(this,"metadata"),d(this,"name",""),d(this,"operationHours"),d(this,"postal",""),d(this,"slug",""),d(this,"state",""),d(this,"telephone",""),d(this,"tzid",""),d(this,"tzidOverride",""),d(this,"utcOffset",""),d(this,"website",""),S(this,_n,t),S(this,On,e),Object.assign(this,e)}static hydrate(t,e){return new li(e,t)}static async fetch(t){let e={fields:t.options.things.venue,slug:t.options.venue,limit:1};try{let n=await Z(t.options,"venue",e);return new li(t,n[0])}catch(t){return console.error("Fetch Venue:",t),{}}}get isMultiBuilding(){if(null==y(this,mt).isMultiBuilding){let t=y(this,_n).maps,e=t.reduce(((t,e)=>t.add(e.elevation)),new Set),n=t.length!==e.size;y(this,mt).isMultiBuilding=n}return y(this,mt).isMultiBuilding}toJSON(){return y(this,On)}},ci=li;On=new WeakMap,_n=new WeakMap,mt=new WeakMap,p();var Pn,di=class{constructor(t){d(this,"id",""),A(this,Pn,void 0),d(this,"name"),d(this,"type"),d(this,"weight"),d(this,"multiplier"),S(this,Pn,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new di(t)))}static async fetch(t){let e=t.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){Y(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await Z(t.options,"vortex",n)).map((t=>new di(t)))}catch(t){return console.error("Fetch Vortexes:",t),[]}}toJSON(){return y(this,Pn)}},fi=di;function Fd(t,e){let n=[];return t.features.forEach((t=>{var r,i;let a=[];null==(r=t.properties.spaces)||r.forEach((t=>{if("id"in t){let n;n=e.get(t.id),n&&a.push(...n)}else null==a||a.push({id:t.node,level:""})}));let o=a.map((t=>({node:"n_"+t.id,map:t.level}))),s=null==(i=t.properties.spaces)?void 0:i.filter((t=>"id"in t)),l=(t.properties.hours||[]).map((t=>({...t,"@type":"OpeningHoursSpecification",dayOfWeek:[t.dayOfWeek.replace("http://schema.org/","")]}))),u={...t.properties,polygons:s||[],nodes:o||[],description:t.properties.description||"",logo:t.properties.logo||{},picture:t.properties.picture||{},phone:t.properties.phone||{},social:t.properties.social||{},externalId:t.properties.externalId||"",states:t.properties.states||[],siblingGroups:t.properties.siblingGroups||[],operationHours:l};delete u.spaces,n.push(u)})),n}function Gd(t){let e=new Set;return t.features.forEach((t=>{var n;null==(n=t.properties.states)||n.forEach((t=>{e.add(t.type)}))})),Array.from(e).map((t=>({id:t,name:t,value:t})))}function Vd(t){let e=[];return t.features.forEach((t=>{let n={...t.properties,icon:t.properties.picture};delete n.picture,e.push(n)})),e}function kd(t){let e=1/0,n=1/0,r=-1/0,i=-1/0;return t.features.forEach((t=>{let a;a="MultiPolygon"===t.geometry.type?t.geometry.coordinates[0].flat():t.geometry.coordinates[0],a.forEach((t=>{e=Math.min(e,t[1]),r=Math.max(r,t[1]),n=Math.min(n,t[0]),i=Math.max(i,t[0])}))})),{id:t.features[0].properties.id,minLat:e,minLong:n,maxLat:r,maxLong:i}}function Ud(t,e,n){let r=n.createGeoreferences(),i=[];return t.features.forEach((t=>{let a=new Set;e.forEach((t=>{t.layer&&a.add(t.layer)}));let o=[...a].map((t=>({id:t,visible:!0}))),s=1/n.mapScale,l={...t.properties,georeference:r,shortName:t.properties.abbreviation||"",scene:{polygons:e},scale:s,x_scale:s,group:t.properties.building,layers:o,width:n.widthInMapUnits,height:n.heightInMapUnits};i.push(l)})),i}Pn=new WeakMap,p();var bs=class{constructor(t){d(this,"mapExtent"),d(this,"stretchRatio"),d(this,"midLat"),d(this,"midLong"),d(this,"mapUnitRatio",1e6),d(this,"latDistance"),d(this,"longDistance"),d(this,"mapScale"),d(this,"widthInMapUnits"),d(this,"heightInMapUnits"),this.mapExtent=t;let{minLat:e,minLong:n,maxLat:r,maxLong:i}=t,a=(e+r)/2,o=(n+i)/2,s=new q(a,i),l=new q(a,n),u=new q(e,o),h=new q(r,o);this.latDistance=u.distanceTo(h),this.longDistance=s.distanceTo(l);let c=this.latDistance/this.longDistance,f=(r-e)/(i-n);this.stretchRatio=c/f,this.midLat=a,this.midLong=o,this.widthInMapUnits=(i-n)*this.mapUnitRatio,this.heightInMapUnits=(r-e)*this.mapUnitRatio*this.stretchRatio,this.mapScale=this.widthInMapUnits/this.longDistance}convert(t){let e=t[1];return{x:(t[0]-this.midLong)*this.mapUnitRatio,y:(this.midLat-e)*this.mapUnitRatio*this.stretchRatio}}createGeoreferences(){let{minLat:t,minLong:e,maxLat:n,maxLong:r}=this.mapExtent;return[[t,e],[t,r],[n,r],[n,e]].map((t=>({target:{x:t[0],y:t[1]},control:this.convert([t[1],t[0]])})))}};function jd(t,e){let n=[];return t.features.forEach((t=>{let r=e.convert(t.geometry.coordinates),i=(t.properties.neighbors||[]).map((e=>({node:e,map:t.properties.level}))),a=t.properties.level,o={...t.properties,x:r.x,y:r.y,paths:i,map:a,externalId:t.properties.externalId||""};n.push(o)})),n}var ws=(t,e,n,r,i)=>{let a=[];return t.features.forEach((t=>{if(!t.geometry.coordinates[0].forEach)return;let o=[];"entrances"in t.properties&&(o=t.properties.entrances.map((t=>({id:"n_"+t.id,node:"n_"+t.id,map:t.level}))));let s,l=n[t.properties.id],u=e.find((t=>t.id===l)),h=t.geometry.coordinates[0].map((t=>i.convert(t))),c=r.find((e=>e.polygonId===t.properties.id)),d=Math.max(i.widthInMapUnits,i.heightInMapUnits)/1e3;if(c){let t=i.convert([c.position[0],c.position[1]]),e=c.size.x,n=c.size.y,r=i.mapScale,a=n*r,o=e*r/d/c.viewBox.width,l=a/d/c.viewBox.height;s={url:null==u?void 0:u.image,visible:!!(null==u?void 0:u.image),viewBox:c.viewBox,scale:{x:o,y:l},position:{x:t.x,y:t.y},rotation:c.rotation,useLocalScaling:!1,_isAbsolutelyPositioned:!0}}let f={...t.properties,entrances:o,map:t.properties.level,externalId:t.properties.externalId||"",geometry:{visible:!0,position:{x:0,y:0,z:((null==u?void 0:u.altitude)||0)*i.mapScale/d},scale:{x:1,y:1,z:((null==u?void 0:u.height)||1)*i.mapScale/d}},material:{color:(null==u?void 0:u.color)||"#000000"},image:s,vertexes:h};a.push(f)})),a};function zd(t,e,n,r,i,a){let o=ws(t,n,r,i,a),s=ws(e,n,r,i,a);return o.concat(s)}function $d(t){let e=new Map;return t.forEach((t=>{t.features.forEach((t=>{let{destinations:n}=t.properties;if(0===n.length)return;let r=n[0].split("-")[0],i=e.get(r),a=n.map((t=>t.split("-")[1])).map((t=>"n_"+t));if(i)i.nodes.push(...a);else{let{name:n,type:i,weight:o,multiplier:s,accessible:l}=t.properties,u={id:r,nodes:a,name:n,type:i,weight:o,multiplier:s,accessible:l};e.set(r,u)}}))})),Array.from(e.values())}function Hd(t){let e=[];return t.features.forEach((t=>{let n={...t.properties};e.push(n)})),e}function Is(t){let e=Object.keys(t),n=new Map,r=new Map,i=new Map,a=new Map,o=new Map,s=new Map,l=new Map,u=new Map;e.filter((t=>t.indexOf("/")>-1)).forEach((e=>{let h=e.split(/[\/\.]/),c=h[0],d=h[1];switch(c){case"connection":n.set(d,t[e]);break;case"level":r.set(d,t[e]);break;case"node":i.set(d,t[e]);break;case"obstruction":a.set(d,t[e]);break;case"space":o.set(d,t[e]);break;case"style":s.set(d,t[e]);break;case"image":l.set(d,t[e]);break;case"image-instance":u.set(d,t[e]);break;case"polygon-style":s.set(d,t[e])}}));let h=t["building.geojson"]||t["building.json"],c=t["category.geojson"]||t["category.json"],d=t["location.geojson"]||t["location.json"],f=t["manifest.geojson"]||t["manifest.json"],p=t["style.json"]||[];return{connection:n,level:r,node:i,obstruction:a,space:o,building:h,category:c,location:d,manifest:f,style:p,polygonStyle:s,imageInstance:u,imageBinaries:l}}function Ts(t){let e=Array.from(t.connection.values()),n=Array.from(t.level.values()),r=t.building,i=t.category,a=t.style,o=t.location,s=t.imageInstance,l=t.polygonStyle,u={},h=[],c=new Map;n.forEach((e=>{let n=e.features[0].properties.id,r=kd(e),i=new bs(r);c.set(n,i);let o=t.obstruction.get(n),d=t.space.get(n),f=s.get(n),p=l.get(n);u[n]=zd(d,o,a,p,f,i);let y=t.node.get(n);h.push(...jd(y,i))}));let d=Object.values(u).flat(),f=$d(e),p=n.map((t=>{let e=t.features[0].properties.id,n=c.get(e);return Ud(t,u[e],n)})).flat(),y=new Map;Array.from(t.space.values()).forEach((t=>{t.features.forEach((t=>{y.set(t.properties.id,t.properties.entrances)}))}));let g=Hd(r),v=Fd(o,y),m=Vd(i),b=Gd(o),M=t.manifest.features[0].properties.name,w=t.manifest.features[0].geometry.coordinates[0],_=t.manifest.features[0].geometry.coordinates[1],x=t.imageBinaries;return{locations:v,categories:m,nodes:h,maps:p,polygons:d,vortexes:f,mapGroups:g,locationStates:b,themes:[],venue:{name:M,latitude:_,longitude:w},imageBinaries:x}}p(),p(),p(),p();var pi,Jd=new Uint8Array(16);function oa(){if(!pi&&!(pi="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pi(Jd)}p(),p(),p();var Ns=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Wd(t){return"string"==typeof t&&Ns.test(t)}var hi,Os=Wd,oe=[];for(hi=0;hi<256;++hi)oe.push((hi+256).toString(16).substr(1));function Xd(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(oe[t[e+0]]+oe[t[e+1]]+oe[t[e+2]]+oe[t[e+3]]+"-"+oe[t[e+4]]+oe[t[e+5]]+"-"+oe[t[e+6]]+oe[t[e+7]]+"-"+oe[t[e+8]]+oe[t[e+9]]+"-"+oe[t[e+10]]+oe[t[e+11]]+oe[t[e+12]]+oe[t[e+13]]+oe[t[e+14]]+oe[t[e+15]]).toLowerCase();if(!Os(n))throw TypeError("Stringified UUID is invalid");return n}var _s=Xd;function Kd(t,e,n){var r=(t=t||{}).random||(t.rng||oa)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var i=0;i<16;++i)e[n+i]=r[i];return e}return _s(r)}p();var at,ot,vt=Kd;function Ps(t){return/^[\da-f]{24}$/i.test(t)}function As(){if(!at)try{let t="mi-uuid";(at=localStorage.getItem(t))||(at=vt(),localStorage.setItem(t,at))}catch(t){at="NLS-"+vt()}return at}function Ds(){if(!ot)try{let t="mi-session";(ot=sessionStorage.getItem(t))||(ot=vt(),sessionStorage.setItem(t,ot))}catch(t){ot="NSS-"+vt()}return ot}var An,Mt,xt,Dn,bt,wt,It,st,Ln,Tt,Nt,Ks=Ai(Xs()),Zs=["websdk","web","webv2"],la=class{constructor(t){var e;A(this,An,void 0),A(this,Mt,void 0),A(this,xt,void 0),A(this,Dn,void 0),A(this,bt,void 0),A(this,wt,void 0),A(this,It,void 0),A(this,st,void 0),A(this,Ln,void 0),A(this,Tt,void 0),A(this,Nt,void 0),S(this,st,t.clientId),S(this,Ln,t.clientSecret),S(this,Tt,t.accessToken),S(this,It,t.noAuth||!1);let n="https://api-gateway.mappedin.com/track-analytics/a/";!y(this,It)&&y(this,st)&&!Ps(y(this,st))&&(n="https://web-proxy.mappedin.com/a/"),S(this,xt,n),S(this,xt,y(this,xt)+(t.venue+"/")),S(this,Mt,!1),S(this,An,"boolean"==typeof t.testMode?t.testMode:"true"===(null==(e=t.testMode)?void 0:e.toLowerCase())),S(this,Dn,Zs.find((e=>e===t.context))||Zs[0]),S(this,bt,As()),S(this,wt,Ds()),S(this,Nt,new Set)}track(t,e){if(y(this,An))return;let n={...e,g:y(this,Mt)},r=y(this,xt)+t+"?"+Ks.default.stringify(n),i={"mi-context":y(this,Dn),"mi-session":y(this,wt),"mi-device":y(this,bt)};y(this,Tt)?i.Authorization=`Bearer ${y(this,Tt)}`:y(this,It)||(i.Authorization=`Basic ${btoa(`${y(this,st)}:${y(this,Ln)}`)}`),fetch(r,{method:"GET",mode:"cors",headers:i})}locationSelected(t){let e=t.id||t;this.track("select-location",{id:e})}categorySelected(t){let e=t.id||t;this.track("select-category",{id:e})}mapViewLoaded(t,e,n,r){this.track("load-mapview",{type:t,force:e,benchmark:n||-1,reason:r||"success"})}getDirections(t,e){let n={start:t,end:e,type:"location_to_location"};this.track("query-directions",n)}getSessionID(){return y(this,wt)}getDeviceID(){return y(this,bt)}setGeolocationMode(t){S(this,Mt,t)}trackBlueDotEvent(t){t&&Object.values(la.BLUEDOT_EVENT).includes(t)&&!y(this,Nt).has(t)?(this.track(t),y(this,Nt).add(t)):console.warn(`Ignored unsupported blue dot event: "${t}".`)}trackSearch(t){null!=t&&this.track("query-search",t)}trackSearchSuggest(t){null!=t&&this.track("query-suggest",t)}},ca=la;An=new WeakMap,Mt=new WeakMap,xt=new WeakMap,Dn=new WeakMap,bt=new WeakMap,wt=new WeakMap,It=new WeakMap,st=new WeakMap,Ln=new WeakMap,Tt=new WeakMap,Nt=new WeakMap,d(ca,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var da,Ys=ca,fa={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,do2D:!1,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""};!function(t){t.CATEGORY="categories",t.EVENT="events",t.LOCATION="locations",t.MAPGROUP="mapGroups",t.MAP="maps",t.NODE="nodes",t.POLYGON="polygons",t.VORTEX="vortexes"}(da||(da={}));var Ze,_t,Ot={categories:Wr,locations:pt,vortexes:fi,maps:ei,nodes:ii,polygons:ht,venue:ci,events:Kr,mapGroups:ni,themes:aa,locationStates:ia,locationRankings:ra,rankings:oi},ut=class{constructor(t){d(this,"perspective"),d(this,"things"),d(this,"options"),A(this,Ze,void 0),A(this,_t,""),d(this,"updatedAt"),d(this,"categories",[]),d(this,"locations",[]),d(this,"vortexes",[]),d(this,"maps",[]),d(this,"nodes",[]),d(this,"polygons",[]),d(this,"venue",{}),d(this,"events",[]),d(this,"mapGroups",[]),d(this,"themes",[]),d(this,"locationStates",[]),d(this,"locationRankings",[]),d(this,"rankings"),d(this,"_categoriesById"),d(this,"_locationsById"),d(this,"_vortexesById"),d(this,"_mapsById"),d(this,"_nodesById"),d(this,"_polygonsById"),d(this,"_eventsById"),d(this,"_mapGroupsById"),d(this,"_locationStatesById"),d(this,"_locationRankingsById"),d(this,"_rankingsById"),d(this,"_categoriesByExternalId"),d(this,"_locationsByExternalId"),d(this,"_vortexesByExternalId"),d(this,"_mapsByExternalId"),d(this,"_nodesByExternalId"),d(this,"_polygonsByExternalId"),d(this,"_eventsByExternalId"),d(this,"_mapGroupsByExternalId"),d(this,"_locationStatesByExternalId"),d(this,"_locationRankingsByExternalId"),d(this,"_rankingsByExternalId"),d(this,"images"),d(this,"imageBinaries"),d(this,"scenes"),d(this,"analytics"),d(this,"navigator"),this.options=t,S(this,Ze,Me.create(this)),this.analytics=new Ys(t)}generateGetters(t){try{for(let e=0,n=t.length;e<n;++e){let n=t[e];Array.isArray(this[n])&&(Object.defineProperty(this,`_${n}ByExternalId`,{get(){let t=y(this,Ze)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),y(this,Ze)[n]=e,e}}),Object.defineProperty(this,`_${n}ById`,{get(){let t=y(this,Ze)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),y(this,Ze)[n]=e,e}}))}return this}catch(t){throw new Error("Unable to generate getters, "+t)}}getCollectionItemById(t,e){let n=`_${t}ByExternalId`,r=this[`_${t}ById`];return null!=r&&null!=r[e]||(r=this[n],null!=r&&null!=r[e])?r[e]:null}async hydrateFromMVF(t){let e=Ts(t);return this.hydrate(e)}async hydrate(t,e){let n;if("string"==typeof t)try{S(this,_t,t),n=JSON.parse(t)}catch(t){return void console.error("Unable to parse JSON",t)}else n=t,S(this,_t,JSON.stringify(n));let r=Object.keys(n);for(let t=0,e=r.length;t<e;++t){let e=r[t],i=n[e];null!=Ot[e]&&"function"==typeof Ot[e].hydrate&&(this[e]=Ot[e].hydrate(i,this))}e&&await xs(n);let{images:i,scenes:a,imageBinaries:o}=n;this.images=i,this.scenes=a,this.imageBinaries=o,this.generateGetters(r),this.initNavigator()}async fetch(){"vortexes"in this.options.things||(this.options.things.vortexes=["name","type","accessible","weight","multiplier","nodes"]),"locationStates"in this.options.things||(this.options.things.locationStates=["name","id","value"]),ys(this.options.clientId)||(this.options.things.rankings&&delete this.options.things.rankings,this.options.things.locationRankings&&delete this.options.things.locationRankings);let{things:t}=this.options,e=[],n=Object.keys(t);for(let t=0,r=n.length;t<r;++t){let r=n[t];Ot[r]&&e.push(Ot[r].fetch(this).then((t=>(this[r]=t,Promise.resolve()))))}return this.generateGetters(n),Promise.all(e).then((()=>{this.initNavigator()}))}initNavigator(){this.navigator=new ea({locations:this.locations.map((t=>t.toJSON())),nodes:this.nodes.map((t=>t.toJSON())),vortexes:this.vortexes.map((t=>t.toJSON())),maps:this.maps.map((t=>t.toJSON()))})}toJSON(){var t;let e={};for(let t in Ot)Array.isArray(this[t])&&(e[t]=this[t].map((t=>t.toJSON())));return{...e,venue:this.venue.toJSON(),rankings:null==(t=this.rankings)?void 0:t.toJSON()}}toString(){return y(this,_t)||JSON.stringify(this.toJSON())}};Ze=new WeakMap,_t=new WeakMap,p();var pa,Qs={venue:["slug","name","defaultMap","metadata","countrycode","tzid","logo","externalId"],nodes:["externalId","x","y","paths","accessible","operationHours"],vortexes:["externalId","nodes","types","accessible"],polygons:["vertexes","geometry","canvasBounds","layer","externalId","entrances"],locations:["externalId","name","type","picture","description","icon","logo","sortOrder","phone","operationHours","social","color","toMap","tags","shortName","detailsUrl","locationState","metadata","siblingGroups","gallery"],categories:["name","color","sortOrder","parents"],maps:["name","elevation","height","width","layers","shortName","scene","group","x_scale"],mapGroups:["name"],themes:["name","themeData"],rankings:["polygons"],locationRankings:[]};p(),function(t){t.MULTI_GEOMETRY="MULTI_GEOMETRY",t.SINGLE_GEOMETRY="SINGLE_GEOMETRY"}(pa||(pa={})),ru(),globalThis.btoa||(globalThis.btoa=Uu.encode);var Pp=["ar"];function Gn(t){let e={...fa,things:Qs,...t};return e.noAuth||(e.accessToken?e.authorization=`Bearer ${e.accessToken}`:e.clientId&&e.clientSecret&&(e.authorization=`Basic ${globalThis.btoa(`${e.clientId}:${e.clientSecret}`)}`)),e}async function um(t){let{venue:e,clientId:n,clientSecret:r,bundleBaseUri:i}=t,a=new ut({venue:e}),o=Is(await Dp({clientId:n,clientSecret:r,venue:e,bundleBaseUri:i},!1));return a.hydrateFromMVF(o),a}async function cm(t){let e=Gn({baseUrl:"https://api-gateway.mappedin.com/",...t}),n=new ut({...e,baseUrl:e.baseUrl+"public/1/"});return await n.fetch(),n}var Ca={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function lm(t){let e=Gn({baseUrl:"https://api-gateway.mappedin.com/",...Ca,...t}),{url:n,updated_at:r}=await Ap(t),i=await fetch(n,{mode:"cors"}),{data:a,format:o="jsonstring"}=await i.json();if("jsonstring"!==o)throw new Error(`Unrecognized format ${o}`);let s=new ut(e);return await s.hydrate(a,e.shouldPopulateBundledImagesAsBlobs),s.updatedAt=r,s}async function Ap(t){let e=Gn({baseUrl:"https://api-gateway.mappedin.com/",...Ca,...t}),{version:n,venue:r}=t,i=`${t.bundleBaseUri||e.baseUrl+`exports/legacy${null!=e.language&&Pp.includes(e.language)?"-"+e.language:""}/1/bundle`}?venue=${r}&version=1.0.0`;return e.language=void 0,await Jr(e,i)}async function fm(t,{url:e,updated_at:n}){let r=Gn({baseUrl:"https://api-gateway.mappedin.com/",...Ca,...t}),i=await fetch(e,{mode:"cors"}),{data:a,format:o="jsonstring"}=await i.json();if("jsonstring"!==o)throw new Error(`Unrecognized format${o}`);let s=new ut(r);return await s.hydrate(a,r.shouldPopulateBundledImagesAsBlobs),s.updatedAt=n,s}async function ju(t){let e=Gn({baseUrl:"https://api-gateway.mappedin.com/",...fa,...t}),{version:n,venue:r}=t,i=`${t.bundleBaseUri||e.baseUrl+"exports/mvf/1/bundle"}?venue=${r}&version=1.0.0`;return e.language=void 0,await Jr(e,i)}async function Dp(t,e=!1){return new Promise((async(n,r)=>{try{let i;if("TextDecoder"in globalThis){let t=new TextDecoder;i=t.decode.bind(t)}else{let t=new((await import("util")).TextDecoder);i=t.decode.bind(t)}let a=await Promise.resolve().then((()=>(ku(),Vu)));if(e){let e=new Blob(['var enc = new TextDecoder();\n\t\t\t\tvar currentTaskName;\n\t\t\t\tself.onmessage = async function({ data }) {\n\t\t\t\t\tif (data[0] === "task") {\n\t\t\t\t\t\tcurrentTaskName = data[1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tpostMessage([\n\t\t\t\t\t\t\t "finished",\n\t\t\t\t\t\t [currentTaskName, JSON.parse(enc.decode(data))]\n\t\t\t\t\t\t]);\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t postMessage(["error", e.toString()]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t currentTaskName = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t'],{type:"text/javascript"}),{url:o}=await ju(t),s=new Uint8Array(await fetch(o).then((t=>t.arrayBuffer()))),l=a.unzipSync(s),u=Object.keys(l),h=Math.min(u.length,Math.min(4,navigator.hardwareConcurrency)||4),c=[],d=u.map((t=>[t,l[t].buffer])),f=1e6,p=[],y=[];for(let t=0;t<d.length;t++){let[,e]=d[t];e.byteLength>=f?p.push(d[t]):e.byteLength<f&&y.push(d[t])}let g={};if(0===y.length)d.forEach((([t])=>{g[t]=JSON.parse(i(l[t]))})),n(g);else{let t=function({data:t}){let e=this;if("finished"===t[0]){let n=y[o];if(null!=n){let[t,r]=n;e.postMessage(["task",t]),e.postMessage(r,[r]),o++}let[r,i]=t[1];g[r]=i,s++}else if("error"===t[0]){let[,e]=t;c.forEach((t=>t.terminate())),r(e)}s===u.length&&(n(g),c.forEach((t=>t.terminate())))},a=URL.createObjectURL(e);for(let t=0;t<Math.min(h,y.length);t++)c.push(new Worker(a));let o=0,s=0;c.forEach((e=>{if(e.onmessage=t,null!=y[o]){let[t,n]=y[o];e.postMessage(["task",t]),e.postMessage(n,[n]),o++}})),p.forEach((([t])=>{g[t]=JSON.parse(i(l[t])),s++}))}}else{let{url:e}=await ju(t),r=new Uint8Array(await fetch(e).then((t=>t.arrayBuffer()))),o=a.unzipSync(r),s=Object.keys(o),l={};for(let t=0;t<s.length;t++){let e=s[t];if(0===e.indexOf("image/")&&-1===e.indexOf("__MACOSX"))l[e]=o[e].buffer;else if("/"!==e.slice(-1))try{l[e]=JSON.parse(i(o[e]))}catch(t){console.warn("bad file",e)}}n(l)}}catch(t){r(t)}}))}export{pa as MAP_RENDER_MODE,ut as Mappedin,Wr as MappedinCategory,da as MappedinCollectionType,gn as MappedinCoordinate,$r as MappedinDestinationSet,Zt as MappedinDirections,Kr as MappedinEvent,pt as MappedinLocation,ei as MappedinMap,ni as MappedinMapGroup,Xe as MappedinNavigatable,ii as MappedinNode,ht as MappedinPolygon,oi as MappedinRankings,ci as MappedinVenue,fi as MappedinVortex,fm as downloadBundle,Dp as downloadVenueBundleMVF,cm as getVenue,lm as getVenueBundle,Ap as getVenueBundleURL,um as getVenueMVF,ju as getVenueMVFURL};