@mappedin/mappedin-js 5.0.2 → 6.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/get-venue/index.js +1 -1
- package/lib/esm/navigator/index.js +1 -1
- package/lib/esm/renderer/{Arrival-PKSG6T4Z.js → Arrival-4MKJIUN5.js} +1 -1
- package/lib/esm/renderer/{Chalet-VFHRODCH.js → Chalet-GV7JZBKK.js} +1 -1
- package/lib/esm/renderer/{HelveticaNeue-WCQR4QTH.js → HelveticaNeue-R5HCTMBV.js} +1 -1
- package/lib/esm/renderer/{Helvetiker-MTC66PG3.js → Helvetiker-QBSINMO4.js} +1 -1
- package/lib/esm/renderer/{Lato-34YCHTLI.js → Lato-QM7AE3DK.js} +1 -1
- package/lib/esm/renderer/{MyriadPro-CDL2F5Z4.js → MyriadPro-NF2ACQHP.js} +1 -1
- package/lib/esm/renderer/{ProximaNova-LCC2XBMA.js → ProximaNova-D2MX6TJ7.js} +1 -1
- package/lib/esm/renderer/{SimonCircular-PFENG7AR.js → SimonCircular-ALISSBZP.js} +1 -1
- package/lib/esm/renderer/browser-KGLQR3GL.js +1 -0
- package/lib/esm/renderer/chunk-HOXAWNB6.js +1 -0
- package/lib/esm/renderer/chunk-VMKNI4UR.js +1 -0
- package/lib/esm/renderer/index.css +1 -1
- package/lib/esm/renderer/index.js +1 -1
- package/lib/mappedin.css +1 -1
- package/lib/mappedin.js +1 -1
- package/lib/node/index.js +1 -1
- package/package.json +2 -2
- package/lib/esm/renderer/browser-KHJ5ARUQ.js +0 -1
- package/lib/esm/renderer/chunk-76H4FNT6.js +0 -1
- package/lib/esm/renderer/chunk-BZTBAOL6.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var bd,j,pd=Object.create,va=Object.defineProperty,hd=Object.getOwnPropertyDescriptor,md=Object.getOwnPropertyNames,fd=Object.getPrototypeOf,gd=Object.prototype.hasOwnProperty,yd=(t,e,n)=>e in t?va(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Jo=t=>va(t,"__esModule",{value:!0}),Ko=(t,e)=>()=>(t&&(e=t(t=0)),e),R=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),vd=(t,e)=>{for(var n in Jo(t),e)va(t,n,{get:e[n],enumerable:!0})},kd=(t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let r of md(e))!gd.call(t,r)&&"default"!==r&&va(t,r,{get:()=>e[r],enumerable:!(n=hd(e,r))||n.enumerable});return t},vr=t=>kd(Jo(va(null!=t?pd(fd(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),m=(t,e,n)=>(yd(t,"symbol"!=typeof e?e+"":e,n),n),kr=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},p=(t,e,n)=>(kr(t,e,"read from private field"),n?n.call(t):e.get(t)),T=(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)},I=(t,e,n,r)=>(kr(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),et=(t,e,n)=>(kr(t,e,"access private method"),n),f=Ko((()=>{j={env:bd={NODE_ENV:"production",npm_package_version:"5.0.2"}}})),Yo=R(((t,e)=>{f(),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 s=function(t){this.message=t};(s.prototype=new Error).name="InvalidCharacterError";var o=function(t){throw new s(t)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,h={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&o("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,r,i,a=t.length%3,s="",u=-1,h=t.length-a;++u<h;)e=t.charCodeAt(u)<<16,n=t.charCodeAt(++u)<<8,r=t.charCodeAt(++u),s+=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),s+=l.charAt((i=e+n)>>10)+l.charAt(i>>4&63)+l.charAt(i<<2&63)+"="):1==a&&(i=t.charCodeAt(u),s+=l.charAt(i>>2)+l.charAt(i<<4&63)+"=="),s},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))&&o("Invalid character: the string to be decoded is not correctly encoded.");for(var n,r,i=0,a="",s=-1;++s<e;)r=l.indexOf(t.charAt(s)),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)})),ue=R((t=>{f(),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})),ba=R((t=>{f(),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})),Ma=R((t=>{f(),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})),wa=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ue(),n=function(t){return e.sexagesimalPattern.test(t.toString().trim())};t.default=n})),xa=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ue(),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})),Nn=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=ue(),r=(e=ba())&&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){s(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 s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var o=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),s=(0,r.default)(t,e.latitude),o=(0,r.default)(t,e.altitude);return a({latitude:s,longitude:i},o?{altitude:o}:{})};t.default=o})),xr=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ma()),n=a(wa()),r=a(xa()),i=ue();function a(t){return t&&t.__esModule?t:{default:t}}var s=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=s})),_r=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ma()),n=a(wa()),r=a(xa()),i=ue();function a(t){return t&&t.__esModule?t:{default:t}}var s=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=s})),Ir=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Nn()),n=i(xr()),r=i(_r());function i(t){return t&&t.__esModule?t:{default:t}}var a=function(t){var i=(0,e.default)(t),a=i.latitude,s=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===s)return!1;var o=t[s],l=t[a];return!(void 0===l||void 0===o||!1===(0,n.default)(l)||!1===(0,r.default)(o))};t.default=a})),Fn=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(Ma()),n=s(wa()),r=s(xa()),i=s(Ir()),a=s(Nn());function s(t){return t&&t.__esModule?t:{default:t}}function o(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?o(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(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(s){if((0,e.default)(s))return Number(s);if((0,n.default)(s))return(0,r.default)(s);if((0,i.default)(s)){var o=(0,a.default)(s);return Array.isArray(s)?s.map((function(e,n){return[0,1].includes(n)?t(e):e})):l(l(l({},s),o.latitude&&u({},o.latitude,t(s[o.latitude]))),o.longitude&&u({},o.longitude,t(s[o.longitude])))}return Array.isArray(s)?s.map((function(e){return(0,i.default)(e)?t(e):e})):s};t.default=h})),Oe=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ue(),n=i(ba()),r=i(Fn());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 s=t[a];return!0===i?s:(0,r.default)(s)}};t.default=a})),ze=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ue(),n=i(ba()),r=i(Fn());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 s=t[a];return!0===i?s:(0,r.default)(s)}};t.default=a})),Ge=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return t*Math.PI/180};t.default=e})),It=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return 180*t/Math.PI};t.default=e})),us=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(Oe()),n=s(ze()),r=s(Ge()),i=s(It()),a=ue();function s(t){return t&&t.__esModule?t:{default:t}}var o=function(t,s,o){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,u=(0,e.default)(t),h=(0,n.default)(t),c=s/l,d=(0,r.default)(o),f=(0,r.default)(u),p=(0,r.default)(h),m=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(m)),y=(0,i.default)(g);return(y<a.MINLON||y>a.MAXLON)&&(g=(g+3*Math.PI)%(2*Math.PI)-Math.PI,y=(0,i.default)(g)),{latitude:(0,i.default)(m),longitude:y}};t.default=o})),ls=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ue(),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})),ds=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ue(),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})),cs=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ue(),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})),ms=R((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 s,o=t[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{!r&&null!=o.return&&o.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}f(),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],s=Math.abs(Number(i)),o=r(60*Number("0."+(a||0))),l=Math.floor(o),u=r(60*(o%l||0));return s+"° "+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})),Sr=R((t=>{f(),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})),ct=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(Oe()),n=s(ze()),r=s(Ge()),i=s(Sr()),a=ue();function s(t){return t&&t.__esModule?t:{default:t}}var o=function(t,s){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;o=void 0===o||isNaN(o)?1:o;var l=(0,e.default)(t),u=(0,n.default)(t),h=(0,e.default)(s),c=(0,n.default)(s),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/o)*o};t.default=o})),Er=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ct())&&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})),vs=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Er())&&e.__esModule?e:{default:e};var r=function(t,e){return(0,n.default)(t,e)[0]};t.default=r})),Ms=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ge()),n=a(Oe()),r=a(ze()),i=ue();function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t){var a=0;if(t.length>2){for(var s,o,l,u=0;u<t.length;u++){u===t.length-2?(s=t.length-2,o=t.length-1,l=0):u===t.length-1?(s=t.length-1,o=0,l=1):(s=u,o=u+1,l=u+2);var h=(0,r.default)(t[s]),c=(0,n.default)(t[o]),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=s})),Fr=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(Oe()),n=r(ze());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})),xs=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(Oe()),n=s(ze()),r=s(Ge()),i=s(It()),a=ue();function s(t){return t&&t.__esModule?t:{default:t}}var o=function(t,s){var o,l,u=(0,e.default)(t),h=(0,n.default)(t),c=(0,r.default)(u),d=(0,r.default)(h),f=s/a.earthRadius,p=c-f,m=c+f,g=(0,r.default)(a.MAXLAT),y=(0,r.default)(a.MINLAT),v=(0,r.default)(a.MAXLON),_=(0,r.default)(a.MINLON);if(p>y&&m<g){var w=Math.asin(Math.sin(f)/Math.cos(c));(o=d-w)<_&&(o+=2*Math.PI),(l=d+w)>v&&(l-=2*Math.PI)}else p=Math.max(p,y),m=Math.min(m,g),o=_,l=v;return[{latitude:(0,i.default)(p),longitude:(0,i.default)(o)},{latitude:(0,i.default)(m),longitude:(0,i.default)(l)}]};t.default=o})),Ts=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Oe()),n=a(ze()),r=a(Ge()),i=a(It());function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t){if(!1===Array.isArray(t)||0===t.length)return!1;var a=t.length,s=t.reduce((function(t,i){var a=(0,r.default)((0,e.default)(i)),s=(0,r.default)((0,n.default)(i));return{X:t.X+Math.cos(a)*Math.cos(s),Y:t.Y+Math.cos(a)*Math.sin(s),Z:t.Z+Math.sin(a)}}),{X:0,Y:0,Z:0}),o=s.X/a,l=s.Y/a,u=s.Z/a;return{longitude:(0,i.default)(Math.atan2(l,o)),latitude:(0,i.default)(Math.atan2(u,Math.sqrt(o*o+l*l)))}};t.default=s})),Is=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Fr())&&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})),Pr=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Oe()),n=a(ze()),r=a(Ge()),i=a(It());function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t,a){var s=(0,r.default)((0,n.default)(a))-(0,r.default)((0,n.default)(t)),o=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(s)>Math.PI&&(s=s>0?-1*(2*Math.PI-s):2*Math.PI+s),((0,i.default)(Math.atan2(s,o))+360)%360};t.default=s})),Ns=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Pr())&&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})),Rr=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(ct()),n=r(Sr());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t,r,i){var a=(0,e.default)(r,t),s=(0,e.default)(t,i),o=(0,e.default)(r,i),l=Math.acos((0,n.default)((a*a+o*o-s*s)/(2*a*o))),u=Math.acos((0,n.default)((s*s+o*o-a*a)/(2*s*o)));return l>Math.PI/2?a:u>Math.PI/2?s:Math.sin(l)*a};t.default=i})),Fs=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Oe()),n=a(ze()),r=a(Ge()),i=a(It());function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t,a){var s=(0,e.default)(a),o=(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)(o)-(0,r.default)(u))*Math.cos((0,r.default)(s)),Math.cos((0,r.default)(l))*Math.sin((0,r.default)(s))-Math.sin((0,r.default)(l))*Math.cos((0,r.default)(s))*Math.cos((0,r.default)(o)-(0,r.default)(u))))+360)%360};t.default=s})),Ps=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ct())&&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})),qs=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Oe()),n=a(ze()),r=a(Ge()),i=ue();function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t,a){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;s=void 0===s||isNaN(s)?1:s;var o,l,u,h,c,d,f,p=(0,e.default)(t),m=(0,n.default)(t),g=(0,e.default)(a),y=(0,n.default)(a),v=6356752.314245,_=1/298.257223563,w=(0,r.default)(y-m),M=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(p)))),b=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(g)))),x=Math.sin(M),I=Math.cos(M),T=Math.sin(b),E=Math.cos(b),O=w,k=100;do{var N=Math.sin(O),A=Math.cos(O);if(0===(d=Math.sqrt(E*N*(E*N)+(I*T-x*E*A)*(I*T-x*E*A))))return 0;o=x*T+I*E*A,l=Math.atan2(d,o),c=o-2*x*T/(h=1-(u=I*E*N/d)*u),isNaN(c)&&(c=0);var S=_/16*h*(4+_*(4-3*h));f=O,O=w+(1-S)*_*u*(l+S*d*(c+S*o*(2*c*c-1)))}while(Math.abs(O-f)>1e-12&&--k>0);if(0===k)return NaN;var F=h*(i.earthRadius*i.earthRadius-v*v)/(v*v),L=1+F/16384*(4096+F*(F*(320-175*F)-768)),D=F/1024*(256+F*(F*(74-47*F)-128)),R=D*d*(c+D/4*(o*(2*c*c-1)-D/6*c*(4*d*d-3)*(4*c*c-3))),j=v*L*(l-R);return Math.round(j/s)*s};t.default=s})),Gs=R((t=>{f(),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})),Vs=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ct())&&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),s=i/a*1e3;return s};t.default=r})),Us=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ct())&&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})),Ws=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(Oe()),n=r(ze());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t,r){for(var i=!1,a=r.length,s=-1,o=a-1;++s<a;o=s)((0,n.default)(r[s])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(r[o])||(0,n.default)(r[o])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(r[s]))&&(0,e.default)(t)<((0,e.default)(r[o])-(0,e.default)(r[s]))*((0,n.default)(t)-(0,n.default)(r[s]))/((0,n.default)(r[o])-(0,n.default)(r[s]))+(0,e.default)(r[s])&&(i=!i);return i};t.default=i})),Hs=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Rr())&&e.__esModule?e:{default:e};var r=function(t,e,r,i){return(0,n.default)(t,e,r)<i};t.default=r})),Js=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ct())&&e.__esModule?e:{default:e};var r=function(t,e,r){return(0,n.default)(t,e)<r};t.default=r})),Xs=R((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 s,o=t[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{!r&&null!=o.return&&o.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}f(),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})),Zs=R((t=>{f(),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 s.default}}),Object.defineProperty(t,"findNearest",{enumerable:!0,get:function(){return o.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 p.default}}),Object.defineProperty(t,"getCoordinateKey",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"getCoordinateKeys",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"getDistance",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"getDistanceFromLine",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"getGreatCircleBearing",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"getLatitude",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(t,"getLongitude",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(t,"getPathLength",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"getPreciseDistance",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"getRhumbLineBearing",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(t,"getRoughCompassDirection",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"getSpeed",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"isDecimal",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(t,"isPointInLine",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"isPointInPolygon",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(t,"isPointNearLine",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(t,"isPointWithinRadius",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(t,"isSexagesimal",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(t,"isValidCoordinate",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(t,"isValidLatitude",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(t,"isValidLongitude",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(t,"orderByDistance",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(t,"sexagesimalToDecimal",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(t,"toDecimal",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(t,"toRad",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(t,"toDeg",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(t,"wktToPolygon",{enumerable:!0,get:function(){return z.default}});var n=U(us()),r=U(ls()),i=U(ds()),a=U(cs()),s=U(ms()),o=U(vs()),l=U(Ms()),u=U(Fr()),h=U(xs()),c=U(Ts()),d=U(Is()),p=U(Ns()),m=U(ba()),g=U(Nn()),y=U(ct()),v=U(Rr()),_=U(Fs()),w=U(Oe()),M=U(ze()),b=U(Ps()),x=U(qs()),I=U(Pr()),T=U(Gs()),E=U(Vs()),O=U(Ma()),k=U(Us()),N=U(Ws()),A=U(Hs()),S=U(Js()),F=U(wa()),L=U(Ir()),D=U(xr()),R=U(_r()),j=U(Er()),P=U(xa()),B=U(Fn()),C=U(Ge()),W=U(It()),z=U(Xs()),$=ue();function U(t){return t&&t.__esModule?t:{default:t}}Object.keys($).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return $[n]}})}))})),Bu=R(((t,e)=>{f(),e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))})),$u=R(((t,e)=>{f();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 s(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=s(n[0]);r!==n[0]&&(e[n[0]]=r)}n=i.exec(t)}e["%C2"]="�";for(var a=Object.keys(e),o=0;o<a.length;o++){var l=a[o];t=t.replace(new RegExp(l,"g"),e[l])}return t}(t)}}})),Hu=R(((t,e)=>{f(),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)]}})),Ku=R(((t,e)=>{f(),e.exports=function(t,e){for(var n={},r=Object.keys(t),i=Array.isArray(e),a=0;a<r.length;a++){var s=r[a],o=t[s];(i?-1!==e.indexOf(s):e(s,o,t))&&(n[s]=o)}return n}})),nl=R((t=>{f();var e=Bu(),n=$u(),r=Hu(),i=Ku(),a=Symbol("encodeFragmentIdentifier");function s(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function o(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 p(t,e){s((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 s=i||a?n.split(t.arrayFormatSeparator).map((e=>l(e,t))):null===n?n:l(n,t);r[e]=s};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,s]=r(e.decode?a.replace(/\+/g," "):a,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?s:l(s,e),n(l(t,e),s,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=p,t.stringify=(t,e)=>{if(!t)return"";s((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,[o(e,t),"[",i,"]"].join("")]:[...n,[o(e,t),"[",o(i,t),"]=",o(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[o(e,t),"[]"].join("")]:[...n,[o(e,t),"[]=",o(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?[[o(n,t),e,o(i,t)].join("")]:[[r,o(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,o(e,t)]:[...n,[o(e,t),"=",o(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?o(n,e):Array.isArray(i)?0===i.length&&"bracket-separator"===e.arrayFormat?o(n,e)+"[]":i.reduce(r(n),[]).join("&"):o(n,e)+"="+o(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:p(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),s=t.parse(i,{sort:!1}),l=Object.assign(s,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]?o(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${r}${u}${c}`},t.pick=(e,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[a]:!1},r);let{url:s,query:o,fragmentIdentifier:l}=t.parseUrl(e,r);return t.stringifyUrl({url:s,query:i(o,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)}})),rd={};function So(t,e){return!e&&"function"==typeof t&&(e=t,t={}),this.ondata=e,t}function $l(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&D(7),ha(t,e,[pa],(function(t){return jt(Mn(t.data[0],t.data[1]))}),0,n)}function Mn(t,e){return Lt(t,e||{},0,0)}function Lo(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&D(7),ha(t,e,[ca],(function(t){return jt(fa(t.data[0],To(t.data[1])))}),1,n)}function fa(t,e){return kn(t,e)}function lf(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&D(7),ha(t,e,[pa,Cl,function(){return[Fo]}],(function(t){return jt(Fo(t.data[0],t.data[1]))}),2,n)}function Fo(t,e){e||(e={});var n=da(),r=t.length;n.p(t);var i=Lt(t,e,Ao(e),8),a=i.length;return Oo(i,e),X(i,a-8,n.d()),X(i,a-4,r),i}function Hl(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&D(7),ha(t,e,[ca,Rl,function(){return[hr]}],(function(t){return jt(hr(t.data[0]))}),3,n)}function hr(t,e){return kn(t.subarray(zo(t),-8),e||new W(Gl(t)))}function cf(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&D(7),ha(t,e,[pa,Bl,function(){return[Co]}],(function(t){return jt(Co(t.data[0],t.data[1]))}),4,n)}function Co(t,e){e||(e={});var n=_o();n.p(t);var r=Lt(t,e,2,4);return No(r,e),X(r,r.length-4,n.d()),r}function Kl(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&D(7),ha(t,e,[ca,ql,function(){return[fr]}],(function(t){return jt(fr(t.data[0],To(t.data[1])))}),5,n)}function fr(t,e){return kn((Vl(t),t.subarray(2,-4)),e)}function hf(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&D(7),31==t[0]&&139==t[1]&&8==t[2]?Hl(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Lo(t,e,n):Kl(t,e,n)}function mf(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?hr(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?fa(t,e):fr(t,e)}function _t(t,e){if(e){for(var n=new W(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(Yl)return Yl.encode(t);var i=t.length,a=new W(t.length+(t.length>>1)),s=0,o=function(t){a[s++]=t};for(r=0;r<i;++r){if(s+5>a.length){var l=new W(s+8+(i-r<<1));l.set(a),a=l}var u=t.charCodeAt(r);u<128||e?o(u):u<2048?(o(192|u>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++r))>>18),o(128|u>>12&63),o(128|u>>6&63),o(128|63&u)):(o(224|u>>12),o(128|u>>6&63),o(128|63&u))}return De(a,0,s)}function qo(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(Bo)return Bo.decode(t);var i=Ql(t),a=i[0];return i[1].length&&D(8),a}function bf(t,e,n){n||(n=e,e={}),"function"!=typeof n&&D(7);var r={};Ro(t,"",r,e);var i=Object.keys(r),a=i.length,s=0,o=0,l=a,u=new Array(a),h=[],c=function(){for(var t=0;t<h.length;++t)h[t]()},d=function(t,e){gr((function(){n(t,e)}))};gr((function(){d=n}));var f=function(){var t=new W(o+22),e=s,n=o-s;o=0;for(var r=0;r<l;++r){var i=u[r];try{var a=i.c.length;ga(t,o,i,i.f,i.u,a);var h=30+i.f.length+Tt(i.extra),c=o+h;t.set(i.c,c),ga(t,s,i,i.f,i.u,a,o,i.m),s+=16+h+(i.m?i.m.length:0),o=c+a}catch(t){return d(t,null)}}Go(t,s,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],m=da(),g=l.length;m.p(l);var y=_t(e),v=y.length,_=p.comment,w=_&&_t(_),M=w&&w.length,b=Tt(p.extra),x=0==p.level?0:8,I=function(n,r){if(n)c(),d(n,null);else{var i=r.length;u[t]=bn(p,{size:g,crc:m.d(),c:r,f:y,m:w,u:v!=e.length||w&&_.length!=M,compression:x}),s+=30+v+b+i,o+=76+2*(v+b)+(M||0)+i,--a||f()}};if(v>65535&&I(D(11,0,1),null),x)if(g<16e4)try{I(null,Mn(l,p))}catch(t){I(t,null)}else h.push($l(l,p,I));else I(null,l)},m=0;m<l;++m)p(m);return c}function Mf(t,e){e||(e={});var n={},r=[];Ro(t,"",n,e);var i=0,a=0;for(var s in n){var o=n[s],l=o[0],u=o[1],h=0==u.level?0:8,c=(x=_t(s)).length,d=u.comment,f=d&&_t(d),p=f&&f.length,m=Tt(u.extra);c>65535&&D(11);var g=h?Mn(l,u):l,y=g.length,v=da();v.p(l),r.push(bn(u,{size:l.length,crc:v.d(),c:g,f:x,m:f,u:c!=s.length||f&&d.length!=p,o:i,compression:h})),i+=30+c+m+y,a+=76+2*(c+m)+(p||0)+y}for(var _=new W(a+22),w=i,M=a-i,b=0;b<r.length;++b){var x=r[b];ga(_,x.o,x,x.f,x.u,x.c.length);var I=30+x.f.length+Tt(x.extra);_.set(x.c,x.o+I),ga(_,i,x,x.f,x.u,x.c.length,x.o,x.m),i+=16+I+(x.m?x.m.length:0)}return Go(_,i,r.length,M,w),_}function _f(t,e,n){n||(n=e,e={}),"function"!=typeof n&&D(7);var r=[],i=function(){for(var t=0;t<r.length;++t)r[t]()},a={},s=function(t,e){gr((function(){n(t,e)}))};gr((function(){s=n}));for(var o=t.length-22;101010256!=te(t,o);--o)if(!o||t.length-o>65558)return s(D(13,0,1),null),i;var l=ve(t,o+8);if(l){var u=l,h=te(t,o+16),c=4294967295==h;if(c){if(o=te(t,o-12),101075792!=te(t,o))return s(D(13,0,1),null),i;u=l=te(t,o+32),h=te(t,o+48)}for(var d=e&&e.filter,f=function(e){var n=ad(t,h,c),o=n[0],u=n[1],f=n[2],p=n[3],m=n[4],g=n[5],y=td(t,g);h=m;var v=function(t,e){t?(i(),s(t,null)):(e&&(a[p]=e),--l||s(null,a))};if(!d||d({name:p,size:u,originalSize:f,compression:o}))if(o)if(8==o){var _=t.subarray(y,y+u);if(u<32e4)try{v(null,fa(_,new W(f)))}catch(t){v(t,null)}else r.push(Lo(_,{size:f},v))}else v(D(14,"unknown compression type "+o,1),null);else v(null,De(t,y,y+u));else v(null,null)},p=0;p<u;++p)f()}else s(null,{});return i}function Tf(t,e){for(var n={},r=t.length-22;101010256!=te(t,r);--r)(!r||t.length-r>65558)&&D(13);var i=ve(t,r+8);if(!i)return{};var a=te(t,r+16),s=4294967295==a;s&&(r=te(t,r-12),101075792!=te(t,r)&&D(13),i=te(t,r+32),a=te(t,r+48));for(var o=e&&e.filter,l=0;l<i;++l){var u=ad(t,a,s),h=u[0],c=u[1],d=u[2],f=u[3],p=u[4],m=u[5],g=td(t,m);a=p,(!o||o({name:f,size:c,originalSize:d,compression:h}))&&(h?8==h?n[f]=fa(t.subarray(g,g+c),new W(d)):D(14,"unknown compression type "+h):n[f]=De(t,g,g+c))}return n}vd(rd,{AsyncCompress:()=>uf,AsyncDecompress:()=>pf,AsyncDeflate:()=>Ul,AsyncGunzip:()=>Wl,AsyncGzip:()=>uf,AsyncInflate:()=>Eo,AsyncUnzipInflate:()=>xf,AsyncUnzlib:()=>Jl,AsyncZipDeflate:()=>vf,AsyncZlib:()=>df,Compress:()=>Do,DecodeUTF8:()=>ff,Decompress:()=>Xl,Deflate:()=>Qe,EncodeUTF8:()=>gf,FlateErrorCode:()=>of,Gunzip:()=>pr,Gzip:()=>Do,Inflate:()=>je,Unzip:()=>jf,UnzipInflate:()=>wf,UnzipPassThrough:()=>id,Unzlib:()=>mr,Zip:()=>kf,ZipDeflate:()=>yf,ZipPassThrough:()=>wn,Zlib:()=>Po,compress:()=>lf,compressSync:()=>Fo,decompress:()=>hf,decompressSync:()=>mf,deflate:()=>$l,deflateSync:()=>Mn,gunzip:()=>Hl,gunzipSync:()=>hr,gzip:()=>lf,gzipSync:()=>Fo,inflate:()=>Lo,inflateSync:()=>fa,strFromU8:()=>qo,strToU8:()=>_t,unzip:()=>_f,unzipSync:()=>Tf,unzlib:()=>Kl,unzlibSync:()=>fr,zip:()=>bf,zipSync:()=>Mf,zlib:()=>cf,zlibSync:()=>Co});var xl,rf,W,me,ia,ra,oa,gn,jl,_l,Mo,rr,Tl,Il,wo,yn,ut,Ee,lt,sa,K,Ol,zl,Al,Nl,or,Le,sr,vn,De,of,Sl,D,kn,Ze,ua,ur,lr,xo,la,dr,jo,El,dt,Ll,Dl,da,_o,Lt,bn,Fl,cr,sf,Pl,ca,pa,Cl,Rl,Bl,ql,jt,To,ha,Fe,ma,ve,te,Io,X,Oo,zo,Gl,Ao,No,Vl,Qe,Ul,je,Eo,Do,uf,pr,Wl,Po,df,mr,Jl,Xl,pf,Ro,Yl,Bo,Zl,Ql,ff,gf,ed,td,ad,nd,Tt,ga,Go,wn,yf,vf,kf,id,wf,xf,jf,gr,od=Ko((()=>{for(f(),xl={},rf=function(t,e,n,r,i){var a=new Worker(xl[e]||(xl[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},W=Uint8Array,me=Uint16Array,ia=Uint32Array,ra=new W([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]),oa=new W([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]),gn=new W([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_l=(jl=function(t,e){for(var n=new me(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new ia(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]})(ra,2),Mo=_l[0],rr=_l[1],Mo[28]=258,rr[258]=28,Tl=jl(oa,0),Il=Tl[0],wo=Tl[1],yn=new me(32768),K=0;K<32768;++K)ut=(61680&(ut=(52428&(ut=(43690&K)>>>1|(21845&K)<<1))>>>2|(13107&ut)<<2))>>>4|(3855&ut)<<4,yn[K]=((65280&ut)>>>8|(255&ut)<<8)>>>1;for(Ee=function(t,e,n){for(var r=t.length,i=0,a=new me(e);i<r;++i)t[i]&&++a[t[i]-1];var s,o=new me(e);for(i=0;i<e;++i)o[i]=o[i-1]+a[i-1]<<1;if(n){s=new me(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=o[t[i]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)s[yn[c]>>>l]=u}else for(s=new me(r),i=0;i<r;++i)t[i]&&(s[i]=yn[o[t[i]-1]++]>>>15-t[i]);return s},lt=new W(288),K=0;K<144;++K)lt[K]=8;for(K=144;K<256;++K)lt[K]=9;for(K=256;K<280;++K)lt[K]=7;for(K=280;K<288;++K)lt[K]=8;for(sa=new W(32),K=0;K<32;++K)sa[K]=5;Ol=Ee(lt,9,0),zl=Ee(lt,9,1),Al=Ee(sa,5,0),Nl=Ee(sa,5,1),or=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},Le=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n},sr=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},vn=function(t){return(t+7)/8|0},De=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?me:4==t.BYTES_PER_ELEMENT?ia:W)(n-e);return r.set(t.subarray(e,n)),r},of={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},Sl=["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"],D=function(t,e,n){var r=new Error(e||Sl[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,D),!n)throw r;return r},kn=function(t,e,n){var r=t.length;if(!r||n&&n.f&&!n.l)return e||new W(0);var i=!e||n,a=!n||n.i;n||(n={}),e||(e=new W(3*r));var s=function(t){var n=e.length;if(t>n){var r=new W(Math.max(2*n,t));r.set(e),e=r}},o=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){o=Le(t,l,1);var m=Le(t,l+1,3);if(l+=3,!m){var g=t[(O=vn(l)+4)-4]|t[O-3]<<8,y=O+g;if(y>r){a&&D(0);break}i&&s(u+g),e.set(t.subarray(O,y),u),n.b=u+=g,n.p=l=8*y,n.f=o;continue}if(1==m)h=zl,c=Nl,d=9,f=5;else if(2==m){var v=Le(t,l,31)+257,_=Le(t,l+10,15)+4,w=v+Le(t,l+5,31)+1;l+=14;for(var M=new W(w),b=new W(19),x=0;x<_;++x)b[gn[x]]=Le(t,l+3*x,7);l+=3*_;var I=or(b),T=(1<<I)-1,E=Ee(b,I,1);for(x=0;x<w;){var O,k=E[Le(t,l,T)];if(l+=15&k,(O=k>>>4)<16)M[x++]=O;else{var N=0,A=0;for(16==O?(A=3+Le(t,l,3),l+=2,N=M[x-1]):17==O?(A=3+Le(t,l,7),l+=3):18==O&&(A=11+Le(t,l,127),l+=7);A--;)M[x++]=N}}var S=M.subarray(0,v),F=M.subarray(v);d=or(S),f=or(F),h=Ee(S,d,1),c=Ee(F,f,1)}else D(1);if(l>p){a&&D(0);break}}i&&s(u+131072);for(var L=(1<<d)-1,R=(1<<f)-1,j=l;;j=l){var P=(N=h[sr(t,l)&L])>>>4;if((l+=15&N)>p){a&&D(0);break}if(N||D(2),P<256)e[u++]=P;else{if(256==P){j=l,h=null;break}var B=P-254;if(P>264){var C=ra[x=P-257];B=Le(t,l,(1<<C)-1)+Mo[x],l+=C}var z=c[sr(t,l)&R],$=z>>>4;z||D(3),l+=15&z;F=Il[$];if($>3){C=oa[$];F+=sr(t,l)&(1<<C)-1,l+=C}if(l>p){a&&D(0);break}i&&s(u+131072);for(var U=u+B;u<U;u+=4)e[u]=e[u-F],e[u+1]=e[u+1-F],e[u+2]=e[u+2-F],e[u+3]=e[u+3-F];u=U}}n.l=h,n.p=j,n.b=u,n.f=o,h&&(o=1,n.m=d,n.d=c,n.n=f)}while(!o);return u==e.length?e:De(e,0,u)},Ze=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>>8},ua=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},ur=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[dt,0];if(1==i){var s=new W(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(t,e){return t.f-e.f})),n.push({s:-1,f:25001});var o=n[0],l=n[1],u=0,h=1,c=2;for(n[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=i-1;)o=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:o.f+l.f,l:o,r:l};var d=a[0].s;for(r=1;r<i;++r)a[r].s>d&&(d=a[r].s);var f=new me(d+1),p=lr(n[h-1],f,0);if(p>e){r=0;var m=0,g=p-e,y=1<<g;for(a.sort((function(t,e){return f[e.s]-f[t.s]||t.f-e.f}));r<i;++r){var v=a[r].s;if(!(f[v]>e))break;m+=y-(1<<p-f[v]),f[v]=e}for(m>>>=g;m>0;){var _=a[r].s;f[_]<e?m-=1<<e-f[_]++-1:++r}for(;r>=0&&m;--r){var w=a[r].s;f[w]==e&&(--f[w],++m)}p=e}return[new W(f),p]},lr=function(t,e,n){return-1==t.s?Math.max(lr(t.l,e,n+1),lr(t.r,e,n+1)):e[t.s]=n},xo=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new me(++e),r=0,i=t[0],a=1,s=function(t){n[r++]=t},o=1;o<=e;++o)if(t[o]==i&&o!=e)++a;else{if(!i&&a>2){for(;a>138;a-=138)s(32754);a>2&&(s(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(s(i),--a;a>6;a-=6)s(8304);a>2&&(s(a-3<<5|8208),a=0)}for(;a--;)s(i);a=1,i=t[o]}return[n.subarray(0,r),e]},la=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},dr=function(t,e,n){var r=n.length,i=vn(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)},jo=function(t,e,n,r,i,a,s,o,l,u,h){Ze(e,h++,n),++i[256];for(var c=ur(i,15),d=c[0],f=c[1],p=ur(a,15),m=p[0],g=p[1],y=xo(d),v=y[0],_=y[1],w=xo(m),M=w[0],b=w[1],x=new me(19),I=0;I<v.length;++I)x[31&v[I]]++;for(I=0;I<M.length;++I)x[31&M[I]]++;for(var T=ur(x,7),E=T[0],O=T[1],k=19;k>4&&!E[gn[k-1]];--k);var N,A,S,F,L=u+5<<3,D=la(i,lt)+la(a,sa)+s,R=la(i,d)+la(a,m)+s+14+3*k+la(x,E)+(2*x[16]+3*x[17]+7*x[18]);if(L<=D&&L<=R)return dr(e,h,t.subarray(l,l+u));if(Ze(e,h,1+(R<D)),h+=2,R<D){N=Ee(d,f,0),A=d,S=Ee(m,g,0),F=m;var j=Ee(E,O,0);Ze(e,h,_-257),Ze(e,h+5,b-1),Ze(e,h+10,k-4),h+=14;for(I=0;I<k;++I)Ze(e,h+3*I,E[gn[I]]);h+=3*k;for(var P=[v,M],B=0;B<2;++B){var C=P[B];for(I=0;I<C.length;++I){var W=31&C[I];Ze(e,h,j[W]),h+=E[W],W>15&&(Ze(e,h,C[I]>>>5&127),h+=C[I]>>>12)}}}else N=Ol,A=lt,S=Al,F=sa;for(I=0;I<o;++I)if(r[I]>255){W=r[I]>>>18&31;ua(e,h,N[W+257]),h+=A[W+257],W>7&&(Ze(e,h,r[I]>>>23&31),h+=ra[W]);var z=31&r[I];ua(e,h,S[z]),h+=F[z],z>3&&(ua(e,h,r[I]>>>5&8191),h+=oa[z])}else ua(e,h,N[r[I]]),h+=A[r[I]];return ua(e,h,N[256]),h+A[256]},El=new ia([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),dt=new W(0),Ll=function(t,e,n,r,i,a){var s=t.length,o=new W(r+s+5*(1+Math.ceil(s/7e3))+i),l=o.subarray(r,o.length-i),u=0;if(!e||s<8)for(var h=0;h<=s;h+=65535){var c=h+65535;c>=s&&(l[u>>3]=a),u=dr(l,u+1,t.subarray(h,c))}else{for(var d=El[e-1],f=d>>>13,p=8191&d,m=(1<<n)-1,g=new me(32768),y=new me(m+1),v=Math.ceil(n/3),_=2*v,w=function(e){return(t[e]^t[e+1]<<v^t[e+2]<<_)&m},M=new ia(25e3),b=new me(288),x=new me(32),I=0,T=0,E=(h=0,0),O=0,k=0;h<s;++h){var N=w(h),A=32767&h,S=y[N];if(g[A]=S,y[N]=A,O<=h){var F=s-h;if((I>7e3||E>24576)&&F>423){u=jo(t,l,0,M,b,x,T,E,k,h-k,u),E=I=T=0,k=h;for(var L=0;L<286;++L)b[L]=0;for(L=0;L<30;++L)x[L]=0}var D=2,R=0,j=p,P=A-S&32767;if(F>2&&N==w(h-P))for(var B=Math.min(f,F)-1,C=Math.min(32767,h),z=Math.min(258,F);P<=C&&--j&&A!=S;){if(t[h+D]==t[h+D-P]){for(var $=0;$<z&&t[h+$]==t[h+$-P];++$);if($>D){if(D=$,R=P,$>B)break;var U=Math.min(P,$-2),G=0;for(L=0;L<U;++L){var J=h-P+L+32768&32767,X=J-g[J]+32768&32767;X>G&&(G=X,S=J)}}}P+=(A=S)-(S=g[A])+32768&32767}if(R){M[E++]=268435456|rr[D]<<18|wo[R];var K=31&rr[D],V=31&wo[R];T+=ra[K]+oa[V],++b[257+K],++x[V],O=h+D,++I}else M[E++]=t[h],++b[t[h]]}}u=jo(t,l,a,M,b,x,T,E,k,h-k,u),!a&&7&u&&(u=dr(l,u+1,dt))}return De(o,0,r+vn(u)+i)},Dl=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}(),da=function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=Dl[255&n^e[r]]^n>>>8;t=n},d:function(){return~t}}},_o=function(){var t=1,e=0;return{p:function(n){for(var r=t,i=e,a=0|n.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=r+=n[s];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}}},Lt=function(t,e,n,r,i){return Ll(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)},bn=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},Fl=function(t,e,n){for(var r=t(),i=t.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<r.length;++s){var o=r[s],l=a[s];if("function"==typeof o){e+=";"+l+"=";var u=o.toString();if(o.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,o.prototype)e+=";"+l+".prototype."+c+"="+o.prototype[c].toString();else e+=u}else n[l]=o}return[e,n]},cr=[],sf=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},Pl=function(t,e,n,r){var i;if(!cr[n]){for(var a="",s={},o=t.length-1,l=0;l<o;++l)a=(i=Fl(t[l],a,s))[0],s=i[1];cr[n]=Fl(t[o],a,s)}var u=bn({},cr[n][1]);return rf(cr[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,sf(u),r)},ca=function(){return[W,me,ia,ra,oa,gn,Mo,Il,zl,Nl,yn,Sl,Ee,or,Le,sr,vn,De,D,kn,fa,jt,To]},pa=function(){return[W,me,ia,ra,oa,gn,rr,wo,Ol,lt,Al,sa,yn,El,dt,Ee,Ze,ua,ur,lr,xo,la,dr,jo,vn,De,Ll,Lt,Mn,jt]},Cl=function(){return[Oo,Ao,X,da,Dl]},Rl=function(){return[zo,Gl]},Bl=function(){return[No,X,_o]},ql=function(){return[Vl]},jt=function(t){return postMessage(t,[t.buffer])},To=function(t){return t&&t.size&&new W(t.size)},ha=function(t,e,n,r,i,a){var s=Pl(n,r,i,(function(t,e){s.terminate(),a(t,e)}));return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}},Fe=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])}},ma=function(t,e,n,r,i){var a,s=Pl(t,r,i,(function(t,n){t?(s.terminate(),e.ondata.call(e,t)):(n[1]&&s.terminate(),e.ondata.call(e,t,n[0],n[1]))}));s.postMessage(n),e.push=function(t,n){e.ondata||D(5),a&&e.ondata(D(4,0,1),null,!!n),s.postMessage([t,a=n],[t.buffer])},e.terminate=function(){s.terminate()}},ve=function(t,e){return t[e]|t[e+1]<<8},te=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},Io=function(t,e){return te(t,e)+4294967296*te(t,e+4)},X=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},Oo=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&&X(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)}},zo=function(t){(31!=t[0]||139!=t[1]||8!=t[2])&&D(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)},Gl=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},Ao=function(t){return 10+(t.filename&&t.filename.length+1||0)},No=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)},Vl=function(t){(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&D(6,"invalid zlib data"),32&t[1]&&D(6,"invalid zlib data: preset dictionaries not supported")},Qe=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(Lt(t,this.o,0,0,!e),e)},t.prototype.push=function(t,e){this.ondata||D(5),this.d&&D(4),this.d=e,this.p(t,e||!1)},t}(),Ul=function(t,e){ma([pa,function(){return[Fe,Qe]}],this,So.call(this,t,e),(function(t){var e=new Qe(t.data);onmessage=Fe(e)}),6)},je=function(){function t(t){this.s={},this.p=new W(0),this.ondata=t}return t.prototype.e=function(t){this.ondata||D(5),this.d&&D(4);var e=this.p.length,n=new W(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=kn(this.p,this.o,this.s);this.ondata(De(n,e,this.s.b),this.d),this.o=De(n,this.s.b-32768),this.s.b=this.o.length,this.p=De(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}(),Eo=function(t){this.ondata=t,ma([ca,function(){return[Fe,je]}],this,0,(function(){var t=new je;onmessage=Fe(t)}),7)},Do=function(){function t(t,e){this.c=da(),this.l=0,this.v=1,Qe.call(this,t,e)}return t.prototype.push=function(t,e){Qe.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var n=Lt(t,this.o,this.v&&Ao(this.o),e&&8,!e);this.v&&(Oo(n,this.o),this.v=0),e&&(X(n,n.length-8,this.c.d()),X(n,n.length-4,this.l)),this.ondata(n,e)},t}(),uf=function(t,e){ma([pa,Cl,function(){return[Fe,Qe,Do]}],this,So.call(this,t,e),(function(t){var e=new Do(t.data);onmessage=Fe(e)}),8)},pr=function(){function t(t){this.v=1,je.call(this,t)}return t.prototype.push=function(t,e){if(je.prototype.e.call(this,t),this.v){var n=this.p.length>3?zo(this.p):4;if(n>=this.p.length&&!e)return;this.p=this.p.subarray(n),this.v=0}e&&(this.p.length<8&&D(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),je.prototype.c.call(this,e)},t}(),Wl=function(t){this.ondata=t,ma([ca,Rl,function(){return[Fe,je,pr]}],this,0,(function(){var t=new pr;onmessage=Fe(t)}),9)},Po=function(){function t(t,e){this.c=_o(),this.v=1,Qe.call(this,t,e)}return t.prototype.push=function(t,e){Qe.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t);var n=Lt(t,this.o,this.v&&2,e&&4,!e);this.v&&(No(n,this.o),this.v=0),e&&X(n,n.length-4,this.c.d()),this.ondata(n,e)},t}(),df=function(t,e){ma([pa,Bl,function(){return[Fe,Qe,Po]}],this,So.call(this,t,e),(function(t){var e=new Po(t.data);onmessage=Fe(e)}),10)},mr=function(){function t(t){this.v=1,je.call(this,t)}return t.prototype.push=function(t,e){if(je.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&&D(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),je.prototype.c.call(this,e)},t}(),Jl=function(t){this.ondata=t,ma([ca,ql,function(){return[Fe,je,mr]}],this,0,(function(){var t=new mr;onmessage=Fe(t)}),11)},Xl=function(){function t(t){this.G=pr,this.I=je,this.Z=mr,this.ondata=t}return t.prototype.push=function(t,e){if(this.ondata||D(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new W(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}(),pf=function(){function t(t){this.G=Wl,this.I=Eo,this.Z=Jl,this.ondata=t}return t.prototype.push=function(t,e){Xl.prototype.push.call(this,t,e)},t}(),Ro=function(t,e,n,r){for(var i in t){var a=t[i],s=e+i,o=r;Array.isArray(a)&&(o=bn(r,a[1]),a=a[0]),a instanceof W?n[s]=[a,o]:(n[s+="/"]=[new W(0),o],Ro(a,s,n,r))}},Yl="undefined"!=typeof TextEncoder&&new TextEncoder,Bo="undefined"!=typeof TextDecoder&&new TextDecoder,Zl=0;try{Bo.decode(dt,{stream:!0}),Zl=1}catch(t){}Ql=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,De(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)}},ff=function(){function t(t){this.ondata=t,Zl?this.t=new TextDecoder:this.p=dt}return t.prototype.push=function(t,e){if(this.ondata||D(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&D(8),this.t=null));this.p||D(4);var n=new W(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var r=Ql(n),i=r[0],a=r[1];e?(a.length&&D(8),this.p=null):this.p=a,this.ondata(i,e)},t}(),gf=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){this.ondata||D(5),this.d&&D(4),this.ondata(_t(t),this.d=e||!1)},t}(),ed=function(t){return 1==t?3:t<6?2:9==t?1:0},td=function(t,e){return e+30+ve(t,e+26)+ve(t,e+28)},ad=function(t,e,n){var r=ve(t,e+28),i=qo(t.subarray(e+46,e+46+r),!(2048&ve(t,e+8))),a=e+46+r,s=te(t,e+20),o=n&&4294967295==s?nd(t,a):[s,te(t,e+24),te(t,e+42)],l=o[0],u=o[1],h=o[2];return[ve(t,e+10),l,u,i,a+ve(t,e+30)+ve(t,e+32),h]},nd=function(t,e){for(;1!=ve(t,e);e+=4+ve(t,e+2));return[Io(t,e+12),Io(t,e+4),Io(t,e+20)]},Tt=function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&D(9),e+=r+4}return e},ga=function(t,e,n,r,i,a,s,o){var l=r.length,u=n.extra,h=o&&o.length,c=Tt(u);X(t,e,null!=s?33639248:67324752),e+=4,null!=s&&(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)&&D(10),X(t,e,f<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>>1),e+=4,null!=a&&(X(t,e,n.crc),X(t,e+4,a),X(t,e+8,n.size)),X(t,e+12,l),X(t,e+14,c),e+=16,null!=s&&(X(t,e,h),X(t,e+6,n.attrs),X(t,e+10,s),e+=14),t.set(r,e),e+=l,c)for(var p in u){var m=u[p],g=m.length;X(t,e,+p),X(t,e+2,g),t.set(m,e+4),e+=4+g}return h&&(t.set(o,e),e+=h),e},Go=function(t,e,n,r,i){X(t,e,101010256),X(t,e+8,n),X(t,e+10,n),X(t,e+12,r),X(t,e+16,i)},wn=function(){function t(t){this.filename=t,this.c=da(),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||D(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}(),yf=function(){function t(t,e){var n=this;e||(e={}),wn.call(this,t),this.d=new Qe(e,(function(t,e){n.ondata(null,t,e)})),this.compression=8,this.flag=ed(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){wn.prototype.push.call(this,t,e)},t}(),vf=function(){function t(t,e){var n=this;e||(e={}),wn.call(this,t),this.d=new Ul(e,(function(t,e,r){n.ondata(t,e,r)})),this.compression=8,this.flag=ed(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){wn.prototype.push.call(this,t,e)},t}(),kf=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(this.ondata||D(5),2&this.d)this.ondata(D(4+8*(1&this.d),0,1),null,!1);else{var n=_t(t.filename),r=n.length,i=t.comment,a=i&&_t(i),s=r!=t.filename.length||a&&i.length!=a.length,o=r+Tt(t.extra)+30;r>65535&&this.ondata(D(11,0,1),null,!1);var l=new W(o);ga(l,0,t,n,s);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=bn(t,{f:n,u:s,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 W(16);X(a,0,134695760),X(a,4,t.crc),X(a,8,p),X(a,12,t.size),u.push(a),f.c=p,f.b=o+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(D(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+Tt(l.extra)+(l.o?l.o.length:0)}for(var a=new W(n+22),s=0,o=this.u;s<o.length;s++){var l=o[s];ga(a,t,l,l.f,l.u,l.c,e,l.o),t+=46+l.f.length+Tt(l.extra)+(l.o?l.o.length:0),e+=l.b}Go(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}(),id=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}(),wf=function(){function t(){var t=this;this.i=new je((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}(),xf=function(){function t(t,e){var n=this;e<32e4?this.i=new je((function(t,e){n.ondata(null,t,e)})):(this.i=new Eo((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=De(t,0)),this.i.push(t,e)},t.compression=8,t}(),jf=function(){function t(t){this.onfile=t,this.k=[],this.o={0:id},this.p=dt}return t.prototype.push=function(t,e){var n=this;if(this.onfile||D(5),this.p||D(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,s=0,o=void 0,l=void 0;this.p.length?t.length?((l=new W(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=te(l,s);if(67324752==e){a=1,o=s,f.d=null,f.c=0;var r=ve(l,s+6),i=ve(l,s+8),c=2048&r,d=8&r,p=ve(l,s+26),m=ve(l,s+28);if(u>s+30+p+m){var g=[];f.k.unshift(g),a=2;var y=te(l,s+18),v=te(l,s+22),_=qo(l.subarray(s+30,s+=30+p),!c);4294967295==y?(t=d?[-2]:nd(l,s),y=t[0],v=t[1]):d&&(y=-1),s+=m,f.c=y;var w,M={name:_,compression:i,start:function(){if(M.ondata||D(5),y){var t=n.o[i];t||M.ondata(D(14,"unknown compression type "+i,1),null,!1),(w=y<0?new t(_):new t(_,y,v)).ondata=function(t,e,n){M.ondata(t,e,n)};for(var e=0,r=g;e<r.length;e++){var a=r[e];w.push(a,!1)}n.k[0]==g&&n.c?n.d=w:w.push(dt,!0)}else M.ondata(null,dt,!0)},terminate:function(){w&&w.terminate&&w.terminate()}};y>=0&&(M.size=y,M.originalSize=v),f.onfile(M)}return"break"}if(h){if(134695760==e)return o=s+=12+(-2==h&&8),a=3,f.c=0,"break";if(33639248==e)return o=s-=4,a=3,f.c=0,"break"}},f=this;s<u-4;++s){if("break"===d())break}if(this.p=dt,h<0){var p=a?l.subarray(0,o-12-(-2==h&&8)-(134695760==te(l,o-16)&&4)):l.subarray(0,s);c?c.push(p,!!a):this.k[+(2==a)].push(p)}if(2&a)return this.push(l.subarray(s),e);this.p=l.subarray(s)}e&&(this.c&&D(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}(),gr="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()}}));f();var sd=vr(Yo());f(),f(),f();var eu=vr(Zs());f();var Qs=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:r=0,distance:i=0,angle:a=0}){let s,o;if(m(this,"origin"),m(this,"destination"),m(this,"vortex"),m(this,"distance"),m(this,"angle"),m(this,"weight"),this.origin=t,this.destination=e,this.vortex=n,this.distance=i,this.angle=a,n?(this.distance=0,this.angle=0,s=void 0!==n.weight&&n.weight>0?n.weight:"elevator"===n.type?2e3:1e3,o=n.multiplier&&n.multiplier>=1?n.multiplier:1,this.weight=r*o+s):(s=e.weight&&e.weight>=0?e.weight:0,o=e.multiplier&&e.multiplier>=1?e.multiplier:1,this.weight=this.distance*o+s),isNaN(this.angle))throw new Error("nan angle")}},_i=Qs;f();var Vr="mi-debug",Zh={loggingEnabled(){var t;return"development"===j.env.NODE_ENV||"dev"===j.env.NODE_ENV||"test"===j.env.NODE_ENV||"true"===(null==(t=globalThis.sessionStorage)?void 0:t.getItem(Vr))},log(...t){this.loggingEnabled()&&console.log("[MappedInJS]",...t)},warn(...t){this.loggingEnabled()&&console.warn("[MappedInJS]",...t)},error(...t){this.loggingEnabled()&&console.error("[MappedInJS]",...t)},assert(...t){this.loggingEnabled()&&console.assert(...t)},time(t){this.loggingEnabled()&&console.time(t)},timeEnd(t){this.loggingEnabled()&&console.timeEnd(t)}},E=Zh;function Qh(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,eu.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 E.error(t),1}}function em(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 ae,Me,pt,tu=class{constructor({nodes:t,vortexes:e,maps:n,showVortexNames:r=!1}){m(this,"edges"),m(this,"nodesById"),m(this,"mapsById"),this.edges={},this.mapsById=n.map((t=>({...t,_scale:Qh(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 _i({angle:em(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,s=Math.abs(i-a);this.edges[n.id].push(new _i({destination:e,elevationDelta:s,origin:n,vortex:t})),this.edges[e.id].push(new _i({destination:n,elevationDelta:s,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=[],s={},o={};for(r.forEach((t=>{let e=this.getShortestEuclideanDistance(t,i);a.push({origin:t,priority:e}),s[t.id]=null,o[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=s[t.origin.id];for(;null!=n;){e.push(n);let t=s[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=o[t.origin.id]+e.weight;if(null==o[e.destination.id]||l<o[e.destination.id]){o[e.destination.id]=l;let t=l+this.getShortestEuclideanDistance(e.destination,i);a.push({origin:e.destination,priority:t}),s[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)}},Ur=tu;function tm(t){switch(t){case pt.DOWN:case pt.UP:return`${t} `;default:return""}}f(),f(),function(t){t.DEPARTURE="Departure",t.TAKEVORTEX="TakeVortex",t.EXITVORTEX="ExitVortex",t.TURN="Turn",t.ARRIVAL="Arrival"}(ae||(ae={})),function(t){t.STRAIGHT="Straight",t.RIGHT="Right",t.SLIGHTRIGHT="SlightRight",t.LEFT="Left",t.SLIGHTLEFT="SlightLeft"}(Me||(Me={})),function(t){t.UP="up",t.DOWN="down",t.NONE="none"}(pt||(pt={}));var Ti,au=class{constructor({origin:t,action:e,distance:n,atLocation:r,instruction:i}){m(this,"node"),m(this,"instruction"),m(this,"action"),m(this,"atLocation"),m(this,"type"),m(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===ae.DEPARTURE?this.instruction=null!=r?`Depart from ${r.name}`:"Depart from current location":null!=e&&e.type===ae.ARRIVAL?this.instruction=null!=r?`Arrive at ${r.name}`:"Arrive at destination":null!=e&&e.type===ae.TAKEVORTEX?this.instruction=`Take ${r&&r.name} ${tm(e.direction)}to ${e.toMap.name}`:null!=e&&e.type===ae.EXITVORTEX?this.instruction=`Exit ${r&&r.name} at ${e.toMap.name}`:null!=e&&e.bearing===Me.RIGHT?this.instruction="Turn right":null!=e&&e.bearing===Me.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=e&&e.bearing===Me.STRAIGHT?this.instruction="Head straight":null!=e&&e.bearing===Me.SLIGHTLEFT?this.instruction="Turn slightly left":null!=e&&e.bearing===Me.LEFT&&(this.instruction="Turn left"),null!=e&&e.type===ae.TURN&&r&&(this.instruction+=` at ${r.name}`))}},ht=au;(Ti||(Ti={})).NO_VALID_PATH="No Valid Path Available";var Ii=.1*Math.PI;function Oi(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var nu=class{constructor({locations:t,nodes:e,vortexes:n,maps:r,showVortexNames:i}){m(this,"graph"),m(this,"locationsByNodeId"),this.graph=new Ur({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],s=null,o=0;for(let e of t)if(e.distance>0)if(null!=s){let t=-Oi(a.angle,e.angle);Math.abs(t)<Math.abs(o)&&(s=e,o=t)}else s=e,o=-Oi(a.angle,e.angle);if(null==s)return null;{if(Math.abs(o)>=e||(r+=o,i+=s.distance,Math.abs(r)>=e||i>n))return null;let t=this.locationsByNodeId[s.destination.id];if(null!=t)return t;a=s}}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 ht({distance:0,instruction:Ti.NO_VALID_PATH})],path:[]};let s=0,o=new Array(a.length+1);for(let t=0;t<a.length;t++)o[t]=a[t].origin;o[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,o=e.destination;if(s+=e.distance,c+=(null==h?void 0:h.distance)||0,0===t&&l.push(new ht({action:{type:ae.DEPARTURE},atLocation:r,distance:0,origin:n})),null!=e.vortex){let t=this.graph.mapsById[n.map],r=this.graph.mapsById[o.map],i=pt.NONE;if(null!=t.elevation&&null!=r.elevation){let e=t.elevation-r.elevation;e>0?i=pt.DOWN:e<0&&(i=pt.UP)}l.push(new ht({action:{direction:i,fromMap:t,toMap:r,type:ae.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 ht({action:{fromMap:t,toMap:e,type:ae.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=-Oi(h.angle,e.angle),i=t.reduce(((t,n)=>{let r=-Oi(e.angle,n.angle);return Math.min(t,Math.abs(r))}),Math.PI);if(Math.abs(r)>=Ii||Math.abs(i)<=Ii){let t;t=r<=-Math.PI/4?Me.RIGHT:r<=-Ii?Me.SLIGHTRIGHT:r<=Ii?Me.STRAIGHT:r<=Math.PI/4?Me.SLIGHTLEFT:Me.LEFT;let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=e){let r=new ht({action:{bearing:t,referencePosition:"At",type:ae.TURN},atLocation:e,distance:c,origin:n});r.type=t,l.push(r)}else l.push(new ht({action:{bearing:t,referencePosition:"At",type:ae.TURN},distance:c,origin:n}));d+=c,c=0}}}t===a.length-1&&(l.push(new ht({action:{type:ae.ARRIVAL},atLocation:i,distance:s-d<0?0:s-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===ae.TAKEVORTEX?(p=e.node,f.unshift(e)):n&&n.type===ae.TURN&&null!=p?this.graph.getDistance(e.node,p)>5&&f.unshift(e):f.unshift(e)}return{distance:s,instructions:f,path:o}}},$r=nu;function iu(t){let e=+this._x.call(null,t),n=+this._y.call(null,t);return ru(this.cover(e,n),e,n,t)}function ru(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,a,s,o,l,u,h,c,d,f=t._root,p={data:r},m=t._x0,g=t._y0,y=t._x1,v=t._y1;if(!f)return t._root=p,t;for(;f.length;)if((u=e>=(a=(m+y)/2))?m=a:y=a,(h=n>=(s=(g+v)/2))?g=s:v=s,i=f,!(f=f[c=h<<1|u]))return i[c]=p,t;if(o=+t._x.call(null,f.data),l=+t._y.call(null,f.data),e===o&&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=(m+y)/2))?m=a:y=a,(h=n>=(s=(g+v)/2))?g=s:v=s}while((c=h<<1|u)==(d=(l>=s)<<1|o>=a));return i[d]=f,i[c]=p,t}function ou(t){var e,n,r,i,a=t.length,s=new Array(a),o=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))||(s[n]=r,o[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)ru(this,s[n],o[n],t[n]);return this}function su(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 s,o,l=i-n||1,u=this._root;n>t||t>=i||r>e||e>=a;)switch(o=(e<r)<<1|t<n,s=new Array(4),s[o]=u,u=s,l*=2,o){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 uu(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}function lu(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 oe(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function du(t,e,n){var r,i,a,s,o,l,u,h=this._x0,c=this._y0,d=this._x1,f=this._y1,p=[],m=this._root;for(m&&p.push(new oe(m,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(!(!(m=l.node)||(i=l.x0)>d||(a=l.y0)>f||(s=l.x1)<h||(o=l.y1)<c))if(m.length){var g=(i+s)/2,y=(a+o)/2;p.push(new oe(m[3],g,y,s,o),new oe(m[2],i,y,g,o),new oe(m[1],g,a,s,y),new oe(m[0],i,a,g,y)),(u=(e>=y)<<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 v=t-+this._x.call(null,m.data),_=e-+this._y.call(null,m.data),w=v*v+_*_;if(w<n){var M=Math.sqrt(n=w);h=t-M,c=e-M,d=t+M,f=e+M,r=m.data}}return r}function cu(t){if(isNaN(a=+this._x.call(null,t))||isNaN(s=+this._y.call(null,t)))return this;var e,n,r,i,a,s,o,l,u,h,c,d,f=this._root,p=this._x0,m=this._y0,g=this._x1,y=this._y1;if(!f)return this;if(f.length)for(;;){if((u=a>=(o=(p+g)/2))?p=o:g=o,(h=s>=(l=(m+y)/2))?m=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(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 pu(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function hu(){return this._root}function mu(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}function fu(t){var e,n,r,i,a,s,o=[],l=this._root;for(l&&o.push(new oe(l,this._x0,this._y0,this._x1,this._y1));e=o.pop();)if(!t(l=e.node,r=e.x0,i=e.y0,a=e.x1,s=e.y1)&&l.length){var u=(r+a)/2,h=(i+s)/2;(n=l[3])&&o.push(new oe(n,u,h,a,s)),(n=l[2])&&o.push(new oe(n,r,h,u,s)),(n=l[1])&&o.push(new oe(n,u,i,a,h)),(n=l[0])&&o.push(new oe(n,r,i,u,h))}return this}function gu(t){var e,n=[],r=[];for(this._root&&n.push(new oe(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var a,s=e.x0,o=e.y0,l=e.x1,u=e.y1,h=(s+l)/2,c=(o+u)/2;(a=i[0])&&n.push(new oe(a,s,o,h,c)),(a=i[1])&&n.push(new oe(a,h,o,l,c)),(a=i[2])&&n.push(new oe(a,s,c,h,u)),(a=i[3])&&n.push(new oe(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 yu(t){return t[0]}function vu(t){return arguments.length?(this._x=t,this):this._x}function ku(t){return t[1]}function bu(t){return arguments.length?(this._y=t,this):this._y}function Ta(t,e,n){var r=new Wr(null==e?yu:e,null==n?ku:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Wr(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 Mu(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}f(),f(),f(),f(),f(),f(),f(),f(),f(),f(),f(),f(),f(),f(),f(),f();var ge=Ta.prototype=Wr.prototype;ge.copy=function(){var t,e,n=new Wr(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=Mu(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]=Mu(e));return n},ge.add=iu,ge.addAll=ou,ge.cover=su,ge.data=uu,ge.extent=lu,ge.find=du,ge.remove=cu,ge.removeAll=pu,ge.root=hu,ge.size=mu,ge.visit=fu,ge.visitAfter=gu,ge.x=vu,ge.y=bu;var Ve,ne,Ot=class{constructor(t){T(this,Ve,void 0),m(this,"categories"),m(this,"locations"),m(this,"vortexes"),m(this,"maps"),m(this,"nodes"),m(this,"polygons"),m(this,"events"),m(this,"mapGroups"),m(this,"locationStates"),m(this,"rankings"),T(this,ne,{}),I(this,Ve,t)}get polygonsByMapId(){if(p(this,ne).polygonsByMapId)return p(this,ne).polygonsByMapId;let t,e={};for(let n=0,r=p(this,Ve).polygons.length;n<r;++n)t=p(this,Ve).polygons[n],e[t.map.id]||(e[t.map.id]=[]),e[t.map.id].push(t);let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return p(this,ne).polygonsByMapId=n,p(this,ne).polygonsByMapId}get nodesByMapId(){if(p(this,ne).nodesByMapId)return p(this,ne).nodesByMapId;let t,e={};for(let n=0,r=p(this,Ve).nodes.length;n<r;++n)t=p(this,Ve).nodes[n],e[t.map.id]||(e[t.map.id]=[]),e[t.map.id].push(t);let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return p(this,ne).nodesByMapId=n,p(this,ne).nodesByMapId}findNearestNodeOnMap(t,e){var n;if(p(this,ne).nodeTreesByMap||(p(this,ne).nodeTreesByMap=new Map),!p(this,ne).nodeTreesByMap.has(t)){let e=null!=(n=this.nodesByMapId.get(t))?n:[],r=Ta();r.x((t=>t.x)),r.y((t=>t.y)),r.addAll(e),p(this,ne).nodeTreesByMap.set(t,r)}return p(this,ne).nodeTreesByMap.get(t).find(e.x,e.y)}get locationsByMapId(){if(p(this,ne).locationsByMapId)return p(this,ne).locationsByMapId;let t,e={};for(let n=0,r=p(this,Ve).locations.length;n<r;++n){t=p(this,Ve).locations[n];for(let n=0,r=t.polygons.length;n<r;++n)e[t.polygons[n].map.id]||(e[t.polygons[n].map.id]=[]),e[t.polygons[n].map.id].push(t)}let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return p(this,ne).locationsByMapId=n,p(this,ne).locationsByMapId}static create(t){return Ot.instances.has(t)||Ot.instances.set(t,new Ot(t)),Ot.instances.get(t)}static clear(){Ot.instances.clear()}},Hr=Ot;Ve=new WeakMap,ne=new WeakMap,m(Hr,"instances",new Map);var _e=Hr;f(),f(),f(),f();var wu=" ",ye=class{static get separator(){return wu}static set separator(t){wu=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,s=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+"°"+ye.separator+a+"′";break;case"dms":case"deg+min+sec":i=Math.floor(t),a=Math.floor(3600*t/60)%60,s=(3600*t%60).toFixed(n),60==s&&(s=(0).toFixed(n),a++),60==a&&(a=0,i++),i=("000"+i).slice(-3),a=("00"+a).slice(-2),s<10&&(s="0"+s),r=i+"°"+ye.separator+a+"′"+ye.separator+s+"″"}return r}static toLat(t,e,n){let r=ye.toDms(ye.wrap90(t),e,n);return null===r?"–":r.slice(1)+ye.separator+(t<0?"S":"N")}static toLon(t,e,n){let r=ye.toDms(ye.wrap180(t),e,n);return null===r?"–":r+ye.separator+(t<0?"W":"E")}static toBrng(t,e,n){let r=ye.toDms(ye.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=ye.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 $=ye,Z=Math.PI,L=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=$.wrap90(Number(t)),this._lon=$.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?$.wrap90($.parse(t)):$.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?$.wrap90($.parse(t)):$.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)?$.wrap180($.parse(t)):$.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?$.wrap180($.parse(t)):$.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?$.wrap180($.parse(t)):$.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=$.wrap90($.parse(e)),n=$.wrap180($.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=$.wrap90($.parse(e)),n=$.wrap180($.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=$.wrap90($.parse(e)),n=$.wrap180($.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 L(e,n)}distanceTo(t,e=6371e3){if(t instanceof L||(t=L.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(),s=a-r,o=t.lon.toRadians()-i,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(r)*Math.cos(a)*Math.sin(o/2)*Math.sin(o/2);return n*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof L||(t=L.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),s=Math.atan2(a,i).toDegrees();return $.wrap360(s)}finalBearingTo(t){t instanceof L||(t=L.parse(t));let e=t.initialBearingTo(this)+180;return $.wrap360(e)}midpointTo(t){t instanceof L||(t=L.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),s=0,o=Math.sin(e),l={x:a+Math.cos(r)*Math.cos(i),y:s+Math.cos(r)*Math.sin(i),z:o+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 L(c,d)}intermediatePointTo(t,e){if(t instanceof L||(t=L.parse(t)),this.equals(t))return new L(this.lat,this.lon);let n=this.lat.toRadians(),r=this.lon.toRadians(),i=t.lat.toRadians(),a=t.lon.toRadians(),s=i-n,o=a-r,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(n)*Math.cos(i)*Math.sin(o/2)*Math.sin(o/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),m=Math.atan2(p,Math.sqrt(d*d+f*f)),g=Math.atan2(f,d),y=m.toDegrees(),v=g.toDegrees();return new L(y,v)}destinationPoint(t,e,n=6371e3){let r=t/n,i=Number(e).toRadians(),a=this.lat.toRadians(),s=this.lon.toRadians(),o=Math.sin(a)*Math.cos(r)+Math.cos(a)*Math.sin(r)*Math.cos(i),l=Math.asin(o),u=Math.sin(i)*Math.sin(r)*Math.cos(a),h=Math.cos(r)-Math.sin(a)*o,c=s+Math.atan2(u,h),d=l.toDegrees(),f=c.toDegrees();return new L(d,f)}static intersection(t,e,n,r){if(t instanceof L||(t=L.parse(t)),n instanceof L||(n=L.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(),s=n.lat.toRadians(),o=n.lon.toRadians(),l=Number(e).toRadians(),u=Number(r).toRadians(),h=s-i,c=o-a,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(i)*Math.cos(s)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new L(t.lat,t.lon);let f=(Math.sin(s)-Math.sin(i)*Math.cos(d))/(Math.sin(d)*Math.cos(i)),p=(Math.sin(i)-Math.sin(s)*Math.cos(d))/(Math.sin(d)*Math.cos(s)),m=Math.acos(Math.min(Math.max(f,-1),1)),g=Math.acos(Math.min(Math.max(p,-1),1)),y=l-(Math.sin(o-a)>0?m:2*Z-m),v=(Math.sin(o-a)>0?2*Z-g:g)-u;if(0==Math.sin(y)&&0==Math.sin(v)||Math.sin(y)*Math.sin(v)<0)return null;let _=-Math.cos(y)*Math.cos(v)+Math.sin(y)*Math.sin(v)*Math.cos(d),w=Math.atan2(Math.sin(d)*Math.sin(y)*Math.sin(v),Math.cos(v)+Math.cos(y)*_),M=Math.asin(Math.min(Math.max(Math.sin(i)*Math.cos(w)+Math.cos(i)*Math.sin(w)*Math.cos(l),-1),1)),b=a+Math.atan2(Math.sin(l)*Math.sin(w)*Math.cos(i),Math.cos(w)-Math.sin(i)*Math.sin(M)),x=M.toDegrees(),I=b.toDegrees();return new L(x,I)}crossTrackDistanceTo(t,e,n=6371e3){t instanceof L||(t=L.parse(t)),e instanceof L||(e=L.parse(e));let r=n;if(this.equals(t))return 0;let i=t.distanceTo(this,r)/r,a=t.initialBearingTo(this).toRadians(),s=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(i)*Math.sin(a-s))*r}alongTrackDistanceTo(t,e,n=6371e3){t instanceof L||(t=L.parse(t)),e instanceof L||(e=L.parse(e));let r=n;if(this.equals(t))return 0;let i=t.distanceTo(this,r)/r,a=t.initialBearingTo(this).toRadians(),s=t.initialBearingTo(e).toRadians(),o=Math.asin(Math.sin(i)*Math.sin(a-s));return Math.acos(Math.cos(i)/Math.abs(Math.cos(o)))*Math.sign(Math.cos(s-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(),s=e.lat.toRadians(),o=e.lon.toRadians()-a,l=Math.sin(i)*Math.cos(s)*Math.cos(r)*Math.sin(o),u=Math.sin(i)*Math.cos(s)*Math.cos(r)*Math.cos(o)-Math.cos(i)*Math.sin(s)*Math.cos(r),h=Math.cos(i)*Math.cos(s)*Math.sin(r)*Math.sin(o);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(),m=f.toDegrees();return{lon1:$.wrap180(p),lon2:$.wrap180(m)}}rhumbDistanceTo(t,e=6371e3){t instanceof L||(t=L.parse(t));let n=e,r=this.lat.toRadians(),i=t.lat.toRadians(),a=i-r,s=Math.abs(t.lon-this.lon).toRadians();Math.abs(s)>Z&&(s=s>0?-(2*Z-s):2*Z+s);let o=Math.log(Math.tan(i/2+Z/4)/Math.tan(r/2+Z/4)),l=Math.abs(o)>1e-11?a/o:Math.cos(r);return Math.sqrt(a*a+l*l*s*s)*n}rhumbBearingTo(t){if(t instanceof L||(t=L.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)>Z&&(r=r>0?-(2*Z-r):2*Z+r);let i=Math.log(Math.tan(n/2+Z/4)/Math.tan(e/2+Z/4)),a=Math.atan2(r,i).toDegrees();return $.wrap360(a)}rhumbDestinationPoint(t,e,n=6371e3){let r=this.lat.toRadians(),i=this.lon.toRadians(),a=Number(e).toRadians(),s=t/n,o=s*Math.cos(a),l=r+o;Math.abs(l)>Z/2&&(l=l>0?Z-l:-Z-l);let u=Math.log(Math.tan(l/2+Z/4)/Math.tan(r/2+Z/4)),h=Math.abs(u)>1e-11?o/u:Math.cos(r),c=i+s*Math.sin(a)/h,d=l.toDegrees(),f=c.toDegrees();return new L(d,f)}rhumbMidpointTo(t){t instanceof L||(t=L.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),i=t.lon.toRadians();Math.abs(i-n)>Z&&(n+=2*Z);let a=(e+r)/2,s=Math.tan(Z/4+e/2),o=Math.tan(Z/4+r/2),l=Math.tan(Z/4+a/2),u=((i-n)*Math.log(l)+n*Math.log(o)-i*Math.log(s))/Math.log(o/s);isFinite(u)||(u=(n+i)/2);let h=a.toDegrees(),c=u.toDegrees();return new L(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*Z);let s=Math.abs(a*n*n);return r||t.pop(),s}equals(t){return t instanceof L||(t=L.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`${$.toLat(this.lat,t,e)}, ${$.toLon(this.lon,t,e)}`}};f(),f(),f();var zi=class{constructor(t){m(this,"destinations",[]),this.destinations=t}};f();var Oa,at,Ia=class{constructor(t,e){T(this,Oa,void 0),T(this,at,void 0),m(this,"distance",0),m(this,"path",[]),m(this,"instructions",[]),I(this,at,t),I(this,Oa,e),this.distance=e.distance,this.instructions=e.instructions.map((t=>{var e,n,r,i,a,s,o,l,u,h,c,d;let f={...t,action:{...t.action},atLocation:(null==(e=t.atLocation)?void 0:e.id)?null==(r=null==(n=p(this,at))?void 0:n._vortexesById)?void 0:r[t.atLocation.id]:void 0,node:(null==(i=t.node)?void 0:i.id)?null==(s=null==(a=p(this,at))?void 0:a._nodesById)?void 0:s[t.node.id]:void 0};return((null==(o=f.action)?void 0:o.type)===ae.TAKEVORTEX||(null==(l=f.action)?void 0:l.type)===ae.EXITVORTEX)&&(f.action.fromMap=null==(h=p(this,at)._mapsById)?void 0:h[null==(u=f.action)?void 0:u.fromMap.id],f.action.toMap=null==(d=p(this,at)._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=p(this,at))?void 0:e._nodesById)?void 0:n[t.id]}))}toJSON(){return p(this,Oa)}};Oa=new WeakMap,at=new WeakMap;var ft,mt=class{constructor(t){T(this,ft,void 0),I(this,ft,t)}directionsTo(t,e){if(t instanceof zi){let n=[],r=this;for(let i=0;i<t.destinations.length;i++){let a=t.destinations[i],s=za(r),o=za(a),l=p(this,ft).navigator.getDirections({originIds:s,destinationNodeIds:o,accessible:(null==e?void 0:e.accessible)||!1}),u=new Ia(p(this,ft),l);n.push(u),r=a}return n}{let n=za(this),r=za(t),i=p(this,ft).navigator.getDirections({originIds:n,destinationNodeIds:r,accessible:(null==e?void 0:e.accessible)||!1});return new Ia(p(this,ft),i)}}distanceTo(t,e){let n=this.directionsTo(t,e);return(null==n?void 0:n.distance)||0}};ft=new WeakMap;var am=0,nm="9999-12-31T00:00:00.000Z";function im(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||am),n=new Date(t.end||nm);return e<r&&n>r}));return i?e.find((t=>t.value===i.type)):void 0}var Ue,yt,Te,Aa,Na,Sa,Ea=class extends mt{constructor(t,e){super(t),T(this,Ue,void 0),T(this,yt,void 0),T(this,Te,{}),m(this,"states"),m(this,"id",""),m(this,"name",""),m(this,"type",""),m(this,"description"),m(this,"sortOrder"),m(this,"logo"),m(this,"phone"),m(this,"social"),m(this,"color"),m(this,"shortName"),m(this,"detailsUrl"),m(this,"tags"),m(this,"externalId"),m(this,"showLabelWhenImagePresent"),m(this,"picture"),m(this,"operationHours"),m(this,"siblingGroups"),m(this,"gallery"),T(this,Aa,void 0),T(this,Na,[]),T(this,Sa,void 0),I(this,Ue,t),I(this,yt,e);let n=Object.assign({},e);delete n.categories,Object.assign(this,n)}get polygons(){let t=p(this,Te).polygons;if(void 0!==t)return t;let e=[],n=p(this,Aa),r=p(this,Ue)._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 p(this,Te).polygons=e,e}set polygons(t){I(this,Aa,t)}get nodes(){let t=p(this,Te).nodes;if(void 0!==t)return t;let e=[],n=p(this,Na),r=p(this,Ue)._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 p(this,Te).nodes=e,e}set nodes(t){I(this,Na,t)}get parent(){let t=p(this,Te).parent;if(void 0!==t)return t;let e,n=p(this,Ue)._locationsById,r=p(this,Sa);return void 0!==r&&(e=n[r]),p(this,Te).parent=e,e}set parent(t){I(this,Sa,t)}get categories(){let t=p(this,Te).categories;if(void 0!==t)return t;let e=[];return p(this,yt).categories.forEach((t=>{let n=p(this,Ue).getCollectionItemById(nt.CATEGORY,t);n&&e.push(n)})),p(this,Te).categories=e,e}get state(){return im(this,p(this,Ue).locationStates)}clone(){return new Ea(p(this,Ue),p(this,yt))}get nodeOperationHours(){let t=p(this,Te).nodeOperationHours;if(void 0!==t)return t;if(null==this.nodes)return{};let e=p(this,yt).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return p(this,Te).nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new Ea(e,t)))}static async fetch(t){let e=t.options.things.locations.slice();t.options.things.categories&&ee(e,"categories"),t.options.things.nodes&&ee(e,"nodes"),t.options.things.polygons&&ee(e,"polygons"),t.options.things.locationStates&&ee(e,"states");let n={fields:e,venue:t.options.venue};try{let e=await Q(t.options,"location",n);return t.options.includeHidden||(e=e.filter((t=>!t.hidden))),e.map((e=>new Ea(t,e)))}catch(t){return E.error("Fetch Locations:",t),[]}}toJSON(){let t=p(this,yt);return delete t.color,t}},gt=Ea;Ue=new WeakMap,yt=new WeakMap,Te=new WeakMap,Aa=new WeakMap,Na=new WeakMap,Sa=new WeakMap,f();var vt,Rt,Ne,La,Ai=class extends mt{constructor(t,e){super(t),T(this,vt,void 0),T(this,Rt,void 0),T(this,Ne,{}),m(this,"geometry"),m(this,"perspectives"),m(this,"image"),m(this,"holes"),m(this,"textures"),m(this,"material"),m(this,"label"),m(this,"id",""),m(this,"layer"),m(this,"layerId"),m(this,"name"),m(this,"externalId"),m(this,"vertexes"),m(this,"canvasBounds"),T(this,La,void 0),I(this,vt,t),I(this,Rt,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=p(this,Ne).map;if(void 0!==t)return t;let e=p(this,vt).getCollectionItemById(nt.MAP,p(this,Rt).map);return p(this,Ne).map=e,e}get locations(){var t,e;let n=p(this,Ne).locations;if(void 0!==n)return n;let r=[],i=null!=(e=null==(t=_e.instances.get(p(this,vt)))?void 0:t.locationsByMapId.get(this.map.id))?e:[],{id:a}=this;for(let t=0,e=i.length;t<e;++t){let e=i[t],n=e.polygons;if(Array.isArray(n))for(let t=0,i=n.length;t<i;++t)if(n[t].id===a){r.push(e);break}}return p(this,Ne).locations=r,r}get entrances(){let t=p(this,Ne).entrances;if(void 0!==t)return t;let e=[],n=p(this,La),r=p(this,vt)._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 p(this,Ne).entrances=e,e}return[]}set entrances(t){I(this,La,t)}get rank(){let t=p(this,Ne).rank;if(void 0!==t)return t;let{rankings:e}=p(this,vt);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(p(this,Ne).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(p(this,Ne).rank=null,null)}static hydrate(t,e){return t.map((t=>new Ai(e,t)))}static async fetch(t){let e=t.options.things.polygons.slice();t.options.things.maps&&ee(e,"map"),t.options.things.nodes&&ee(e,"entrances");let n={fields:e,venue:t.options.venue};try{return(await Q(t.options,"polygon",n)).filter((t=>t.geometry.visible)).map((e=>new Ai(t,e)))}catch(t){return E.error("Fetch Polygons:",t),[]}}toJSON(){return p(this,Rt)}},Ct=Ai;function xu(t){return/^[\da-f]{24}$/i.test(t)}function ju(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],s=t[a];null!=s&&(n+=`${r+encodeURIComponent(a)}=${encodeURIComponent(s)}`,r="&")}}return n}function rm(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}${ju(n,null==(a=t.baseUrl)?void 0:a.includes("gateway"))}`:t.baseUrl+e+ju(n)}async function Q(t,e,n,r=!1){return Jr(t,e,n,r,!0)}async function Jr(t,e,n,r=!1,i=!1){let a=rm(t,e,n,r),s=await Ni(t,a,r);if(!i&&Array.isArray(s)){if(1===s.length)return s[0];throw new Error("Invalid response object")}return s}async function Ni(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={method:"GET",headers:i},s=await kt()(e,a);if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return s.json()}function ee(t,e){t.indexOf(e)<0&&t.push(e)}function _u([t,e],[n,r]){let i=new L(t,e),a=new L(n,r);return i.distanceTo(a)}function Tu(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 L(n.target.x,n.target.y),a=new L(r.target.x,r.target.y),s=i.distanceTo(a),o=n.control.x-r.control.x,l=n.control.y-r.control.y;e=Math.sqrt(o*o+l*l)/s}catch(n){e=1,E.warn(n),E.warn(`Couldn't georeference ${t.name||t.shortName||t.id}. Probably not enough geocoordinates.`)}return e}function za(t){var e;return t instanceof Ct?t.entrances.map((t=>t.id)):t instanceof gt?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}async function Iu(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=>{E.error(t)}))));await Promise.all(t)}catch(t){E.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}function Kr(t,e,n){let r;return function(){let i=this,a=arguments,s=function(){r=null,n||t.apply(i,a)},o=n&&!r;clearTimeout(r),r=setTimeout(s,e),o&&t.apply(i,a)}}vt=new WeakMap,Rt=new WeakMap,Ne=new WeakMap,La=new WeakMap;var Da,Fa,Pa,Si=class{constructor(t,e){T(this,Da,void 0),T(this,Fa,{}),T(this,Pa,void 0),m(this,"name"),m(this,"externalId"),m(this,"parents"),m(this,"id"),m(this,"icon"),this.id=e.id,I(this,Pa,e),I(this,Da,t),Object.assign(this,e)}get locations(){var t;let e=p(this,Fa).locations;if(void 0!==e)return e;let n=[],{locations:r}=p(this,Da),{id:i}=this;for(let e=0,a=r.length;e<a;++e){let a=r[e],s=a.categories;if(Array.isArray(s))for(let e=0,r=s.length;e<r;++e)if((null==(t=s[e])?void 0:t.id)===i){n.push(a);break}}return p(this,Fa).locations=n,n}static hydrate(t,e){return t.map((t=>new Si(e,t)))}static async fetch(t){let e={fields:t.options.things.categories,venue:t.options.venue};try{return(await Q(t.options,"category",e)).map((e=>new Si(t,e)))}catch(t){return E.error("Fetch Categories:",t),[]}}toJSON(){return p(this,Pa)}},Bt=Si;Da=new WeakMap,Fa=new WeakMap,Pa=new WeakMap,f();var Ca,qt,Ra,Li=class{constructor(t,e){T(this,Ca,void 0),T(this,qt,void 0),T(this,Ra,{}),m(this,"id",""),m(this,"type",""),m(this,"name",""),m(this,"description"),m(this,"image"),m(this,"startDate"),m(this,"endDate"),m(this,"showDate"),I(this,qt,e),I(this,Ca,t),Object.assign(this,e)}location(){let t=p(this,Ra).location;if(void 0!==t)return t;let e,n=p(this,Ca)._locationsById,r=p(this,qt).location;if(null!=r){let t=n[r];null!=t&&(e=t)}return p(this,Ra).location=e,e}static hydrate(t,e){return t.map((t=>new Li(e,t)))}static async fetch(t){let e=t.options.things.events.slice();t.options.things.locations&&ee(e,"location");let n={fields:e,venue:t.options.venue,activeAtOrAfter:Date.now()};try{return(await Q(t.options,"event",n)).map((e=>new Li(t,e)))}catch(t){return E.error("Fetch Events:",t),[]}}toJSON(){return p(this,qt)}},Ei=Li;Ca=new WeakMap,qt=new WeakMap,Ra=new WeakMap,f();var Ba,Di=class{constructor(t){T(this,Ba,void 0),m(this,"id",""),m(this,"name",""),m(this,"value",""),I(this,Ba,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Di(t)))}static async fetch(t){let e={fields:t.options.things.locationStates.slice(),venue:t.options.venue};try{return(await Q(t.options,"location-state",e)).map((t=>new Di(t)))}catch(t){return E.error("Fetch Location States:",t),[]}}toJSON(){return p(this,Ba)}},Xr=Di;Ba=new WeakMap,f(),f();var Ga,Ou,Va,zu,Ua,$a,Fi,om,Pi,sm,$e,We,He,Je,qa=class{constructor(t){T(this,Ga),T(this,Va),T(this,Fi),T(this,Pi),m(this,"map"),T(this,Ua,{}),T(this,$a,void 0),T(this,$e,void 0),T(this,We,void 0),T(this,He,void 0),T(this,Je,void 0);let{map:e,mappedin:n}=t;null!=t.lat&&null!=t.lon&&(I(this,$e,t.lat),I(this,We,t.lon)),null!=t.x&&null!=t.y&&(I(this,He,t.x),I(this,Je,t.y)),this.map=e,I(this,$a,n)}get x(){return et(this,Va,zu).call(this,"x")}get y(){return et(this,Va,zu).call(this,"y")}get lat(){return et(this,Ga,Ou).call(this,"lat")}get lon(){return et(this,Ga,Ou).call(this,"lon")}absoluteDistanceTo(t){return _u([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=p(this,Ua).nearestNode;if(void 0!==t)return t;let e=_e.instances.get(p(this,$a)).findNearestNodeOnMap(this.map.id,this);return p(this,Ua).nearestNode=e,e}toJSON(){return{x:this.x,y:this.y,map:this.map,lat:this.lat,lon:this.lon}}};Ga=new WeakSet,Ou=function(t){if(p(this,$e)&&p(this,We))return p(this,"lat"===t?$e:We);if(null!=p(this,He)&&null!=p(this,Je)){let[e,n]=et(this,Pi,sm).call(this,p(this,He),p(this,Je));return I(this,$e,e),I(this,We,n),p(this,"lat"===t?$e:We)}throw Error("MappedinCoordinate is missing x and y")},Va=new WeakSet,zu=function(t){if(p(this,He)&&p(this,Je))return p(this,"x"===t?He:Je);if(null!=p(this,$e)&&null!=p(this,We)){let[e,n]=et(this,Fi,om).call(this,p(this,$e),p(this,We));return I(this,He,e),I(this,Je,n),p(this,"x"===t?He:Je)}throw Error("MappedinCoordinate is missing lat and lon")},Ua=new WeakMap,$a=new WeakMap,Fi=new WeakSet,om=function(t,e){let n=this.map.georeference[0],r=new L(n.target.x,n.target.y),i=new L(t,e),a=r.distanceTo(i),s=(r.finalBearingTo(i)+360)%360*Math.PI/180||0,o=a*(1/this.map.scale),l=s+this.map.getNorth(),u=Math.sin(l)*o,h=Math.cos(l)*o;return[n.control.x+u,n.control.y-h]},Pi=new WeakSet,sm=function(t,e){let n,r=this.map.georeference[0],i=new L(r.target.x,r.target.y),a=t-r.control.x,s=r.control.y-e,o=Math.atan2(a,s);n=0===a&&0===s?0:0===a?s:a/Math.sin(o);let l=o-this.map.getNorth(),u=n/this.map._scale,h=i.destinationPoint(u,180*l/Math.PI);return[h.lat,h.lon]},$e=new WeakMap,We=new WeakMap,He=new WeakMap,Je=new WeakMap;var Ke,Wa,Ha,Ri=class{constructor(t,e){T(this,Ke,void 0),T(this,Wa,{}),T(this,Ha,void 0),m(this,"id",""),m(this,"group",""),m(this,"name",""),m(this,"shortName",""),m(this,"elevation",0),m(this,"scale",0),m(this,"layers"),m(this,"x_scale"),m(this,"perspectiveId"),m(this,"scene"),m(this,"width",0),m(this,"height",0),m(this,"georeference",[]),m(this,"_scale",0),I(this,Ke,t),I(this,Ha,e),Object.assign(this,e),this._scale=Tu(this),this.scale=this.x_scale||1/this._scale}get polygons(){var t,e,n;return null!=(n=null==(e=null==(t=_e.instances.get(p(this,Ke)))?void 0:t.polygonsByMapId)?void 0:e.get(this.id))?n:[]}get locations(){var t,e,n;return null!=(n=null==(e=null==(t=_e.instances.get(p(this,Ke)))?void 0:t.locationsByMapId)?void 0:e.get(this.id))?n:[]}get nodes(){var t,e,n;return null!=(n=null==(e=null==(t=_e.instances.get(p(this,Ke)))?void 0:t.nodesByMapId)?void 0:e.get(this.id))?n:[]}get mapGroup(){let t=p(this,Wa).mapGroup;if(void 0!==t)return t;let e=this.group,n=e&&p(this,Ke)._mapGroupsById[e]||null;return p(this,Wa).mapGroup=n,n}createCoordinateByXY(t,e){return new qa({x:t,y:e,map:this,mappedin:p(this,Ke)})}createCoordinate(t,e){return new qa({lat:t,lon:e,map:this,mappedin:p(this,Ke)})}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],r=new L(e.target.x,e.target.y),i=new L(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,E.warn(e),E.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 Ri(e,t)))}static async fetch(t){let e=t.options.things.maps.slice();t.options.perspective&&ee(e,"perspectives"),t.options.things.mapGroups&&ee(e,"group"),ee(e,"elevation"),ee(e,"x_scale"),ee(e,"scale"),ee(e,"georeference");let n={fields:e,perspective:t.options.perspective,venue:t.options.venue};try{let i=await Q(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,s=i.length;n<s;++n){var r=i[n];if(r){let t=r.perspective;null!=t&&(r.perspectiveId=t.id,e.indexOf("scene")>-1&&(r.scene=t.scene),t.layers?(r.layers.forEach((t=>{t.visible=!1})),t.layers.forEach(a)):r.layers.forEach((t=>{t.visible=!0}))),delete r.perspective}i[n]=new Ri(t,r)}return i}catch(t){return E.error("Fetch Maps:",t),[]}}toJSON(){return p(this,Ha)}},Ci=Ri;Ke=new WeakMap,Wa=new WeakMap,Ha=new WeakMap,f();var Ja,Gt,Ka,qi=class{constructor(t,e){T(this,Ja,void 0),T(this,Gt,void 0),T(this,Ka,{}),m(this,"id",""),m(this,"name",""),I(this,Gt,e),I(this,Ja,t),Object.assign(this,e)}get maps(){let t=p(this,Ka).maps;if(void 0!==t)return t;let e=[],{maps:n}=p(this,Ja),{id:r}=p(this,Gt);for(let t=0,i=n.length;t<i;++t){let i=n[t];i.group===r&&e.push(i)}return p(this,Ka).maps=e,e}static hydrate(t,e){return t.map((t=>new qi(e,t)))}static async fetch(t){let e={fields:t.options.things.mapGroups.slice(),venue:t.options.venue};try{return(await Q(t.options,"map-group",e)).map((e=>new qi(t,e)))}catch(t){return E.error("Fetch Map Groups:",t),[]}}toJSON(){return p(this,Gt)}},Bi=qi;Ja=new WeakMap,Gt=new WeakMap,Ka=new WeakMap,f();var Xe,Vt,le,Xa,Vi=class extends mt{constructor(t,e){super(t),T(this,Xe,void 0),T(this,Vt,void 0),T(this,le,{}),m(this,"id",""),m(this,"x",0),m(this,"y",0),m(this,"operationHours"),m(this,"externalId"),T(this,Xa,void 0),I(this,Xe,t),I(this,Vt,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=p(this,le).map;if(void 0!==t)return t;let e=p(this,Xe).getCollectionItemById(nt.MAP,p(this,Vt).map);return p(this,le).map=e,e}get lat(){var t;let e=p(this,le).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=p(this,Xe)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return p(this,le).cachedLatLon=n.createCoordinateByXY(this.x,this.y),p(this,le).cachedLatLon.lat}get lon(){var t;let e=p(this,le).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=p(this,Xe)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return p(this,le).cachedLatLon=n.createCoordinateByXY(this.x,this.y),p(this,le).cachedLatLon.lon}get paths(){let t=p(this,le).paths;if(void 0!==t)return t;let e=[],n=p(this,Xe)._nodesById,r=p(this,Xa);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 p(this,le).paths=e,e}set paths(t){I(this,Xa,t)}get locations(){var t,e,n;let r=p(this,le).locations;if(void 0!==r)return r;let i=[],a=null!=(n=null==(e=null==(t=_e.instances.get(p(this,Xe)))?void 0:t.locationsByMapId)?void 0:e.get(this.map.id))?n:[],s=this.id;for(let t=0,e=a.length;t<e;++t){let e=a[t],n=e.nodes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t)if(n[t].id===s){i.push(e);break}}return p(this,le).locations=i,i}get polygon(){var t,e,n;let r=p(this,le).polygon;if(void 0!==r)return r;let i,a=null!=(n=null==(e=null==(t=_e.instances.get(p(this,Xe)))?void 0:t.polygonsByMapId)?void 0:e.get(this.map.id))?n:[],s=this.id;for(let t=0,e=a.length;t<e;++t){let e=a[t];e.entrances.map((t=>t.id)).includes(s)&&(i=e)}return p(this,le).polygon=i,i}static hydrate(t,e){return t.map((t=>new Vi(e,t)))}static async fetch(t){let e=t.options.things.nodes.slice();t.options.things.maps&&ee(e,"map"),["weight","multiplier","accessible"].forEach((function(t){ee(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await Q(t.options,"node",n)).map((e=>new Vi(t,e)))}catch(t){return E.error("Fetch Nodes:",t),[]}}toJSON(){return p(this,Vt)}},Gi=Vi;Xe=new WeakMap,Vt=new WeakMap,le=new WeakMap,Xa=new WeakMap,f();var Ya,$i=class{constructor(t){T(this,Ya,void 0),m(this,"polygons",[]),I(this,Ya,t),Object.assign(this,t)}static hydrate(t){return new $i(t)}static async fetch(t){try{let e=await Jr(t.options,"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new $i(e)}catch(t){return E.error("Fetch Rankings:",t),null}}toJSON(){return p(this,Ya)}},Ui=$i;Ya=new WeakMap,f();var Za,Wi=class{constructor(t){m(this,"id",""),T(this,Za,void 0),I(this,Za,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Wi(t)))}static async fetch(t){let e={fields:t.options.things.themes.slice(),venue:t.options.venue};try{return(await Q(t.options,"apollo-theme",e)).map((t=>new Wi(t)))}catch(t){return E.error("Fetch Theme:",t),[]}}toJSON(){return p(this,Za)}},Yr=Wi;Za=new WeakMap,f();var Qa,en,Ut,Ji=class{constructor(t,e){T(this,Qa,void 0),T(this,en,void 0),T(this,Ut,{}),m(this,"defaultMap",""),m(this,"address",""),m(this,"city",""),m(this,"countrycode",""),m(this,"externalId",""),m(this,"id",""),m(this,"latitude"),m(this,"logo"),m(this,"longitude"),m(this,"metadata"),m(this,"name",""),m(this,"operationHours"),m(this,"postal",""),m(this,"slug",""),m(this,"state",""),m(this,"telephone",""),m(this,"tzid",""),m(this,"tzidOverride",""),m(this,"utcOffset",""),m(this,"website",""),I(this,en,t),I(this,Qa,e),Object.assign(this,e)}static hydrate(t,e){return new Ji(e,t)}static async fetch(t){let e={fields:t.options.things.venue,slug:t.options.venue,limit:1};try{let n=await Q(t.options,"venue",e);return new Ji(t,n[0])}catch(t){return E.error("Fetch Venue:",t),{}}}get isMultiBuilding(){if(null==p(this,Ut).isMultiBuilding){let t=p(this,en).maps,e=t.reduce(((t,e)=>t.add(e.elevation)),new Set),n=t.length!==e.size;p(this,Ut).isMultiBuilding=n}return p(this,Ut).isMultiBuilding}toJSON(){return p(this,Qa)}},Hi=Ji;Qa=new WeakMap,en=new WeakMap,Ut=new WeakMap,f();var tn,Xi=class{constructor(t){m(this,"id",""),T(this,tn,void 0),m(this,"name"),m(this,"type"),m(this,"weight"),m(this,"multiplier"),I(this,tn,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Xi(t)))}static async fetch(t){let e=t.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){ee(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await Q(t.options,"vortex",n)).map((t=>new Xi(t)))}catch(t){return E.error("Fetch Vortexes:",t),[]}}toJSON(){return p(this,tn)}},Ki=Xi;function um(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 s=a.map((t=>({node:"n_"+t.id,map:t.level}))),o=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:o||[],nodes:s||[],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 lm(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 dm(t){let e=[];return t.features.forEach((t=>{let n={...t.properties,icon:t.properties.picture};delete n.picture,e.push(n)})),e}function cm(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 pm(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 s=[...a].map((t=>({id:t,visible:!0}))),o=1/n.mapScale,l={...t.properties,georeference:r,shortName:t.properties.abbreviation||"",scene:{polygons:e},scale:o,x_scale:o,group:t.properties.building,layers:s,width:n.widthInMapUnits,height:n.heightInMapUnits};i.push(l)})),i}tn=new WeakMap,f();var Au=class{constructor(t){m(this,"mapExtent"),m(this,"stretchRatio"),m(this,"midLat"),m(this,"midLong"),m(this,"mapUnitRatio",1e6),m(this,"latDistance"),m(this,"longDistance"),m(this,"mapScale"),m(this,"widthInMapUnits"),m(this,"heightInMapUnits"),this.mapExtent=t;let{minLat:e,minLong:n,maxLat:r,maxLong:i}=t,a=(e+r)/2,s=(n+i)/2,o=new L(a,i),l=new L(a,n),u=new L(e,s),h=new L(r,s);this.latDistance=u.distanceTo(h),this.longDistance=o.distanceTo(l);let c=this.latDistance/this.longDistance,d=(r-e)/(i-n);this.stretchRatio=c/d,this.midLat=a,this.midLong=s,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 hm(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,s={...t.properties,x:r.x,y:r.y,paths:i,map:a,externalId:t.properties.externalId||""};n.push(s)})),n}var Nu=(t,e,n,r,i)=>{let a=[];return t.features.forEach((t=>{if(!t.geometry.coordinates[0].forEach)return;let s=[];"entrances"in t.properties&&(s=t.properties.entrances.map((t=>({id:"n_"+t.id,node:"n_"+t.id,map:t.level}))));let o,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,s=e*r/d/c.viewBox.width,l=a/d/c.viewBox.height;o={url:null==u?void 0:u.image,visible:!!(null==u?void 0:u.image),viewBox:c.viewBox,scale:{x:s,y:l},position:{x:t.x,y:t.y},rotation:c.rotation,useLocalScaling:!1,_isAbsolutelyPositioned:!0}}let f={...t.properties,entrances:s,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:o,vertexes:h};a.push(f)})),a};function mm(t,e,n,r,i,a){let s=Nu(t,n,r,i,a),o=Nu(e,n,r,i,a);return s.concat(o)}function fm(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:s,multiplier:o,accessible:l}=t.properties,u={id:r,nodes:a,name:n,type:i,weight:s,multiplier:o,accessible:l};e.set(r,u)}}))})),Array.from(e.values())}function gm(t){let e=[];return t.features.forEach((t=>{let n={...t.properties};e.push(n)})),e}function Su(t){let e=Object.keys(t),n=new Map,r=new Map,i=new Map,a=new Map,s=new Map,o=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":s.set(d,t[e]);break;case"style":case"polygon-style":o.set(d,t[e]);break;case"image":l.set(d,t[e]);break;case"image-instance":u.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:s,building:h,category:c,location:d,manifest:f,style:p,polygonStyle:o,imageInstance:u,imageBinaries:l}}function Eu(t){let e=Array.from(t.connection.values()),n=Array.from(t.level.values()),r=t.building,i=t.category,a=t.style,s=t.location,o=t.imageInstance,l=t.polygonStyle,u={},h=[],c=new Map;n.forEach((e=>{let n=e.features[0].properties.id,r=cm(e),i=new Au(r);c.set(n,i);let s=t.obstruction.get(n),d=t.space.get(n),f=o.get(n),p=l.get(n);u[n]=mm(d,s,a,p,f,i);let m=t.node.get(n);h.push(...hm(m,i))}));let d=Object.values(u).flat(),f=fm(e),p=n.map((t=>{let e=t.features[0].properties.id,n=c.get(e);return pm(t,u[e],n)})).flat(),m=new Map;Array.from(t.space.values()).forEach((t=>{t.features.forEach((t=>{m.set(t.properties.id,t.properties.entrances)}))}));let g=gm(r),y=um(s,m),v=dm(i),_=lm(s),w=t.manifest.features[0].properties.name,M=t.manifest.features[0].geometry.coordinates[0],b=t.manifest.features[0].geometry.coordinates[1],x=t.imageBinaries;return{locations:y,categories:v,nodes:h,maps:p,polygons:d,vortexes:f,mapGroups:g,locationStates:_,themes:[],venue:{name:w,latitude:b,longitude:M},imageBinaries:x}}f(),f(),f(),f();var zt,Re,Be,Zr=[0,4,6,8,10],it=()=>{let t=new Array(16).fill(0),e=4294967296*Math.random();for(let n=0;n<t.length;n++)n>0&&0==(3&n)&&(e=4294967296*Math.random()),t[n]=e>>>((3&n)<<3)&255;let n=t.map((t=>t.toString(16).padStart(2,"0")));return n[6]="4"+n[6][1],n[8]=["8","9","a","b"].includes(n[7][0])?n[7]:"a"+n[7][1],Zr.map(((t,e)=>n.slice(t,e===Zr.length-1?void 0:Zr[e+1]).join(""))).join("-")},Lu="mi-session-data",Du="mi-local-data",Qr=class{constructor(){T(this,Re,void 0),T(this,Be,void 0);try{let t=sessionStorage.getItem(Lu);I(this,Re,t?JSON.parse(t):{id:it()})}catch{I(this,Re,{id:it()})}try{let t=localStorage.getItem(Du);I(this,Be,t?JSON.parse(t):{deviceId:it()})}catch{I(this,Be,{deviceId:it()})}p(this,Re).id||(p(this,Re).id=it()),p(this,Be).deviceId||(p(this,Be).deviceId=it())}static getInstance(){return p(this,zt)||I(this,zt,new Qr),p(this,zt)}static ___clearInstance(){I(this,zt,void 0)}saveSessionData(t,e){p(this,Re)[t]=e;try{return sessionStorage.setItem(Lu,JSON.stringify(p(this,Re))),!0}catch{return!1}}loadSessionData(t){let e=p(this,Re)[t];if(null!=e)return e}saveLocalData(t,e){p(this,Be)[t]=e;try{return localStorage.setItem(Du,JSON.stringify(p(this,Be))),!0}catch{return!1}}loadLocalData(t){let e=p(this,Be)[t];if(null!=e)return e}},an=Qr;function Fu(t){return/^[\da-f]{24}$/i.test(t)}function Pu(){return an.getInstance().loadLocalData("deviceId")}function Cu(){return an.getInstance().loadSessionData("id")}zt=new WeakMap,Re=new WeakMap,Be=new WeakMap,T(an,zt,void 0);var rl,ol,nn,$t,Wt,rn,Ht,Jt,Kt,At,on,Xt,Yt,sn,il=vr(nl()),Tm=null==(ol=null==(rl=j)?void 0:rl.env)?void 0:ol.npm_package_version,ao=["websdk","web","webv2"],no="websdk",ro=class{constructor(t){var e;T(this,nn,void 0),T(this,$t,void 0),T(this,Wt,void 0),T(this,rn,void 0),T(this,Ht,void 0),T(this,Jt,void 0),T(this,Kt,void 0),T(this,At,void 0),T(this,on,void 0),T(this,Xt,void 0),T(this,Yt,void 0),T(this,sn,void 0),I(this,At,t.clientId),I(this,on,t.clientSecret),I(this,Xt,t.accessToken),I(this,Kt,t.noAuth||!1);let n="https://api-gateway.mappedin.com/track-analytics/a/";!p(this,Kt)&&p(this,At)&&!Fu(p(this,At))&&(n="https://web-proxy.mappedin.com/a/"),I(this,Wt,n),I(this,Wt,p(this,Wt)+(t.venue+"/")),I(this,$t,!1),I(this,nn,"boolean"==typeof t.testMode?t.testMode:"true"===(null==(e=t.testMode)?void 0:e.toLowerCase())),I(this,rn,ao.find((e=>e===t.context))||ao[0]),I(this,Ht,Pu()),I(this,Jt,Cu()),I(this,Yt,new Set),I(this,sn,t.platformString||""),this.locationSelected=this.locationSelected.bind(this),this.categorySelected=this.categorySelected.bind(this),this.getDirections=this.getDirections.bind(this)}track(t,e){if(p(this,nn))return;let n={...e,g:p(this,$t)},r=p(this,Wt)+t+"?"+il.default.stringify(n),i={"mi-context":no||p(this,rn),"mi-session":p(this,Jt),"mi-device":p(this,Ht),"mappedin-sdk-version":Tm,"mappedin-platform-version":p(this,sn)};p(this,Xt)?i.Authorization=`Bearer ${p(this,Xt)}`:p(this,Kt)||(i.Authorization=`Basic ${btoa(`${p(this,At)}:${p(this,on)}`)}`),kt()(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.id,end:e.id,type:"location_to_location"};this.track("query-directions",n)}getSessionID(){return p(this,Jt)}getDeviceID(){return p(this,Ht)}setGeolocationMode(t){I(this,$t,t)}trackBlueDotEvent(t){t&&Object.values(ro.BLUEDOT_EVENT).includes(t)&&!p(this,Yt).has(t)?(this.track(t),p(this,Yt).add(t)):E.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)}static setContext(t){let e=ao.find((e=>e===t));e&&(no=e)}static clearContext(){no=void 0}},io=ro;nn=new WeakMap,$t=new WeakMap,Wt=new WeakMap,rn=new WeakMap,Ht=new WeakMap,Jt=new WeakMap,Kt=new WeakMap,At=new WeakMap,on=new WeakMap,Xt=new WeakMap,Yt=new WeakMap,sn=new WeakMap,m(io,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var nt,Yi=io,oo={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,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"}(nt||(nt={}));var bt,Qt,Zt={categories:Bt,locations:gt,vortexes:Ki,maps:Ci,nodes:Gi,polygons:Ct,venue:Hi,events:Ei,mapGroups:Bi,themes:Yr,locationStates:Xr,rankings:Ui},Nt=class{constructor(t){m(this,"perspective"),m(this,"things"),m(this,"options"),T(this,bt,void 0),T(this,Qt,""),m(this,"updatedAt"),m(this,"categories",[]),m(this,"locations",[]),m(this,"vortexes",[]),m(this,"maps",[]),m(this,"nodes",[]),m(this,"polygons",[]),m(this,"venue",{}),m(this,"events",[]),m(this,"mapGroups",[]),m(this,"themes",[]),m(this,"locationStates",[]),m(this,"rankings"),m(this,"_categoriesById"),m(this,"_locationsById"),m(this,"_vortexesById"),m(this,"_mapsById"),m(this,"_nodesById"),m(this,"_polygonsById"),m(this,"_eventsById"),m(this,"_mapGroupsById"),m(this,"_locationStatesById"),m(this,"_locationRankingsById"),m(this,"_rankingsById"),m(this,"_categoriesByExternalId"),m(this,"_locationsByExternalId"),m(this,"_vortexesByExternalId"),m(this,"_mapsByExternalId"),m(this,"_nodesByExternalId"),m(this,"_polygonsByExternalId"),m(this,"_eventsByExternalId"),m(this,"_mapGroupsByExternalId"),m(this,"_locationStatesByExternalId"),m(this,"_locationRankingsByExternalId"),m(this,"_rankingsByExternalId"),m(this,"images"),m(this,"imageBinaries"),m(this,"scenes"),m(this,"analytics"),m(this,"navigator"),this.options=t,I(this,bt,_e.create(this));let e=new Yi({...t,testMode:!(null==t?void 0:t.emitAnalyticsEvents)});this.analytics={locationSelected:e.locationSelected,categorySelected:e.categorySelected,getDirections:e.getDirections},globalThis.MappedinDebug||(globalThis.MappedinDebug={enable(){globalThis.sessionStorage.setItem(Vr,"true")}})}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=p(this,bt)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),p(this,bt)[n]=e,e}}),Object.defineProperty(this,`_${n}ById`,{get(){let t=p(this,bt)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),p(this,bt)[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=Eu(t);return this.hydrate(e)}async hydrate(t,e){let n;if("string"==typeof t)try{I(this,Qt,t),n=JSON.parse(t)}catch(t){return void E.error("Unable to parse JSON",t)}else n=t,I(this,Qt,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!=Zt[e]&&"function"==typeof Zt[e].hydrate&&(this[e]=Zt[e].hydrate(i,this))}e&&await Iu(n);let{images:i,scenes:a,imageBinaries:s}=n;this.images=i,this.scenes=a,this.imageBinaries=s,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"]),xu(this.options.clientId)||this.options.things.rankings&&delete this.options.things.rankings;let{things:t}=this.options,e=[],n=Object.keys(t);for(let t=0,r=n.length;t<r;++t){let r=n[t];Zt[r]&&e.push(Zt[r].fetch(this).then((t=>(this[r]=t,Promise.resolve()))))}return this.generateGetters(n),Promise.all(e).then((()=>{this.initNavigator()}))}initNavigator(){this.navigator=new $r({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 Zt)Array.isArray(this[t])&&(e[t]=this[t].map((t=>t.toJSON())));let n={...e,venue:this.venue.toJSON()};return null!=this.rankings&&(n.rankings=null==(t=this.rankings)?void 0:t.toJSON()),delete n.locationRankings,n}toString(){return p(this,Qt)||JSON.stringify(this.toJSON())}};bt=new WeakMap,Qt=new WeakMap,f();var sl={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"]};f(),f();var ie=function(){return ie=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ie.apply(this,arguments)};function J(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function de(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return s}var un,Im="ENTRIES",ul="KEYS",ll="VALUES",ce="",so=function(){function t(t,e){var n=t._tree,r=Array.from(n.keys());this.set=t,this._type=e,this._path=r.length>0?[{node:n,keys:r}]:[]}return t.prototype.next=function(){var t=this.dive();return this.backtrack(),t},t.prototype.dive=function(){if(0===this._path.length)return{done:!0,value:void 0};var t=ea(this._path),e=t.node,n=t.keys;if(ea(n)===ce)return{done:!1,value:this.result()};var r=e.get(ea(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},t.prototype.backtrack=function(){if(0!==this._path.length){var t=ea(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}},t.prototype.key=function(){return this.set._prefix+this._path.map((function(t){var e=t.keys;return ea(e)})).filter((function(t){return t!==ce})).join("")},t.prototype.value=function(){return ea(this._path).node.get(ce)},t.prototype.result=function(){switch(this._type){case ll:return this.value();case ul:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),ea=function(t){return t[t.length-1]},Om=function(t,e,n){var r=new Map;if(void 0===e)return r;for(var i=e.length+1,a=i+n,s=new Uint8Array(a*i).fill(n+1),o=0;o<i;++o)s[o]=o;for(var l=1;l<a;++l)s[l*i]=l;return dl(t,e,n,r,s,1,i,""),r},dl=function(t,e,n,r,i,a,s,o){var l,u,h=a*s;try{t:for(var c=J(t.keys()),d=c.next();!d.done;d=c.next()){var f=d.value;if(f===ce){var p=i[h-1];p<=n&&r.set(o,[t.get(f),p])}else{for(var m=a,g=0;g<f.length;++g,++m){for(var y=f[g],v=s*m,_=v-s,w=i[v],M=Math.max(0,m-n-1),b=Math.min(s-1,m+n),x=M;x<b;++x){var I=y!==e[x],T=i[_+x]+ +I,E=i[_+x+1]+1,O=i[v+x]+1,k=i[v+x+1]=Math.min(T,E,O);k<w&&(w=k)}if(w>n)continue t}dl(t.get(f),e,n,r,i,m,s,o+f)}}}catch(t){l={error:t}}finally{try{d&&!d.done&&(u=c.return)&&u.call(c)}finally{if(l)throw l.error}}},uo=function(){function t(t,e){void 0===t&&(t=new Map),void 0===e&&(e=""),this._size=void 0,this._tree=t,this._prefix=e}return t.prototype.atPrefix=function(e){var n,r;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var i=de(Zi(this._tree,e.slice(this._prefix.length)),2),a=i[0],s=i[1];if(void 0===a){var o=de(po(s),2),l=o[0],u=o[1];try{for(var h=J(l.keys()),c=h.next();!c.done;c=h.next()){var d=c.value;if(d!==ce&&d.startsWith(u)){var f=new Map;return f.set(d.slice(u.length),l.get(d)),new t(f,e)}}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}return new t(a,e)},t.prototype.clear=function(){this._size=void 0,this._tree.clear()},t.prototype.delete=function(t){return this._size=void 0,zm(this._tree,t)},t.prototype.entries=function(){return new so(this,Im)},t.prototype.forEach=function(t){var e,n;try{for(var r=J(this),i=r.next();!i.done;i=r.next()){var a=de(i.value,2);t(a[0],a[1],this)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.fuzzyGet=function(t,e){return Om(this._tree,t,e)},t.prototype.get=function(t){var e=lo(this._tree,t);return void 0!==e?e.get(ce):void 0},t.prototype.has=function(t){var e=lo(this._tree,t);return void 0!==e&&e.has(ce)},t.prototype.keys=function(){return new so(this,ul)},t.prototype.set=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");return this._size=void 0,co(this._tree,t).set(ce,e),this},Object.defineProperty(t.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var t=this.entries();!t.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),t.prototype.update=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var n=co(this._tree,t);return n.set(ce,e(n.get(ce))),this},t.prototype.fetch=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var n=co(this._tree,t),r=n.get(ce);return void 0===r&&n.set(ce,r=e()),r},t.prototype.values=function(){return new so(this,ll)},t.prototype[Symbol.iterator]=function(){return this.entries()},t.from=function(e){var n,r,i=new t;try{for(var a=J(e),s=a.next();!s.done;s=a.next()){var o=de(s.value,2),l=o[0],u=o[1];i.set(l,u)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},t.fromObject=function(e){return t.from(Object.entries(e))},t}(),Zi=function(t,e,n){var r,i;if(void 0===n&&(n=[]),0===e.length||null==t)return[t,n];try{for(var a=J(t.keys()),s=a.next();!s.done;s=a.next()){var o=s.value;if(o!==ce&&e.startsWith(o))return n.push([t,o]),Zi(t.get(o),e.slice(o.length),n)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return n.push([t,e]),Zi(void 0,"",n)},lo=function(t,e){var n,r;if(0===e.length||null==t)return t;try{for(var i=J(t.keys()),a=i.next();!a.done;a=i.next()){var s=a.value;if(s!==ce&&e.startsWith(s))return lo(t.get(s),e.slice(s.length))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},co=function(t,e){var n,r,i=e.length;t:for(var a=0;t&&a<i;){try{for(var s=(n=void 0,J(t.keys())),o=s.next();!o.done;o=s.next()){var l=o.value;if(l!==ce&&e[a]===l[0]){for(var u=Math.min(i-a,l.length),h=1;h<u&&e[a+h]===l[h];)++h;var c=t.get(l);if(h===l.length)t=c;else{var d=new Map;d.set(l.slice(h),c),t.set(e.slice(a,a+h),d),t.delete(l),t=d}a+=h;continue t}}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}var f=new Map;return t.set(e.slice(a),f),f}return t},zm=function(t,e){var n=de(Zi(t,e),2),r=n[0],i=n[1];if(void 0!==r)if(r.delete(ce),0===r.size)cl(i);else if(1===r.size){var a=de(r.entries().next().value,2),s=a[0],o=a[1];pl(i,s,o)}},cl=function(t){if(0!==t.length){var e=de(po(t),2),n=e[0],r=e[1];if(n.delete(r),0===n.size)cl(t.slice(0,-1));else if(1===n.size){var i=de(n.entries().next().value,2),a=i[0],s=i[1];a!==ce&&pl(t.slice(0,-1),a,s)}}},pl=function(t,e,n){if(0!==t.length){var r=de(po(t),2),i=r[0],a=r[1];i.set(a+e,n),i.delete(a)}},po=function(t){return t[t.length-1]},ho="or",Am="and",Nm="and_not",St=function(){function t(t){if(null==(null==t?void 0:t.fields))throw new Error('MiniSearch: option "fields" must be provided');this._options=ie(ie(ie({},fo),t),{searchOptions:ie(ie({},fl),t.searchOptions||{})}),this._index=new uo,this._documentCount=0,this._documentIds=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this.addFields(this._options.fields)}return t.prototype.add=function(t){var e,n,r,i,a=this._options,s=a.extractField,o=a.tokenize,l=a.processTerm,u=a.fields,h=a.idField,c=s(t,h);if(null==c)throw new Error('MiniSearch: document does not have ID field "'.concat(h,'"'));var d=this.addDocumentId(c);this.saveStoredFields(d,t);try{for(var f=J(u),p=f.next();!p.done;p=f.next()){var m=p.value,g=s(t,m);if(null!=g){var y=o(g.toString(),m),v=this._fieldIds[m],_=new Set(y).size;this.addFieldLength(d,v,this._documentCount-1,_);try{for(var w=(r=void 0,J(y)),M=w.next();!M.done;M=w.next()){var b=l(M.value,m);b&&this.addTerm(v,d,b)}}catch(t){r={error:t}}finally{try{M&&!M.done&&(i=w.return)&&i.call(w)}finally{if(r)throw r.error}}}}}catch(t){e={error:t}}finally{try{p&&!p.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}},t.prototype.addAll=function(t){var e,n;try{for(var r=J(t),i=r.next();!i.done;i=r.next()){var a=i.value;this.add(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.addAllAsync=function(t,e){var n=this;void 0===e&&(e={});var r=e.chunkSize,i=void 0===r?10:r,a={chunk:[],promise:Promise.resolve()},s=t.reduce((function(t,e,r){var a=t.chunk,s=t.promise;return a.push(e),(r+1)%i==0?{chunk:[],promise:s.then((function(){return new Promise((function(t){return setTimeout(t,0)}))})).then((function(){return n.addAll(a)}))}:{chunk:a,promise:s}}),a),o=s.chunk;return s.promise.then((function(){return n.addAll(o)}))},t.prototype.remove=function(t){var e,n,r,i,a,s,o=this._options,l=o.tokenize,u=o.processTerm,h=o.extractField,c=o.fields,d=o.idField,f=h(t,d);if(null==f)throw new Error('MiniSearch: document does not have ID field "'.concat(d,'"'));try{for(var p=J(this._documentIds),m=p.next();!m.done;m=p.next()){var g=de(m.value,2),y=g[0];if(f===g[1]){try{for(var v=(r=void 0,J(c)),_=v.next();!_.done;_=v.next()){var w=_.value,M=h(t,w);if(null!=M){var b=l(M.toString(),w),x=this._fieldIds[w],I=new Set(b).size;this.removeFieldLength(y,x,this._documentCount,I);try{for(var T=(a=void 0,J(b)),E=T.next();!E.done;E=T.next()){var O=u(E.value,w);O&&this.removeTerm(x,y,O)}}catch(t){a={error:t}}finally{try{E&&!E.done&&(s=T.return)&&s.call(T)}finally{if(a)throw a.error}}}}}catch(t){r={error:t}}finally{try{_&&!_.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}return this._storedFields.delete(y),this._documentIds.delete(y),this._fieldLength.delete(y),void(this._documentCount-=1)}}}catch(t){e={error:t}}finally{try{m&&!m.done&&(n=p.return)&&n.call(p)}finally{if(e)throw e.error}}throw new Error("MiniSearch: cannot remove document with ID ".concat(f,": it is not in the index"))},t.prototype.removeAll=function(t){var e,n;if(t)try{for(var r=J(t),i=r.next();!i.done;i=r.next()){var a=i.value;this.remove(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new uo,this._documentCount=0,this._documentIds=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},t.prototype.search=function(t,e){var n,r;void 0===e&&(e={});var i=this.executeQuery(t,e),a=[];try{for(var s=J(i),o=s.next();!o.done;o=s.next()){var l=de(o.value,2),u=l[0],h=l[1],c=h.score,d=h.terms,f=h.match,p=d.length,m={id:this._documentIds.get(u),score:c*p,terms:Object.keys(f),match:f};Object.assign(m,this._storedFields.get(u)),(null==e.filter||e.filter(m))&&a.push(m)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return a.sort(yl),a},t.prototype.autoSuggest=function(t,e){var n,r,i,a;void 0===e&&(e={}),e=ie(ie({},Fm),e);var s=new Map;try{for(var o=J(this.search(t,e)),l=o.next();!l.done;l=o.next()){var u=l.value,h=u.score,c=(v=u.terms).join(" ");null!=(g=s.get(c))?(g.score+=h,g.count+=1):s.set(c,{score:h,terms:v,count:1})}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}var d=[];try{for(var f=J(s),p=f.next();!p.done;p=f.next()){var m=de(p.value,2),g=m[0],y=m[1],v=(h=y.score,y.terms),_=y.count;d.push({suggestion:g,terms:v,score:h/_})}}catch(t){i={error:t}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}return d.sort(yl),d},Object.defineProperty(t.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),t.loadJSON=function(e,n){if(null==n)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return t.loadJS(JSON.parse(e),n)},t.getDefault=function(t){if(fo.hasOwnProperty(t))return mo(fo,t);throw new Error('MiniSearch: unknown option "'.concat(t,'"'))},t.loadJS=function(e,n){var r,i,a,s,o=e.index,l=e.documentCount,u=e.nextId,h=e.documentIds,c=e.fieldIds,d=e.fieldLength,f=e.averageFieldLength,p=e.storedFields,m=e.serializationVersion;if(1!==m&&2!==m)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var g=new t(n);g._documentCount=l,g._nextId=u,g._documentIds=Qi(h),g._fieldIds=c,g._fieldLength=Qi(d),g._avgFieldLength=f,g._storedFields=Qi(p),g._index=new uo;try{for(var y=J(o),v=y.next();!v.done;v=y.next()){var _=de(v.value,2),w=_[0],M=_[1],b=new Map;try{for(var x=(a=void 0,J(Object.keys(M))),I=x.next();!I.done;I=x.next()){var T=I.value,E=M[T];1===m&&(E=E.ds),b.set(parseInt(T,10),Qi(E))}}catch(t){a={error:t}}finally{try{I&&!I.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}g._index.set(w,b)}}catch(t){r={error:t}}finally{try{v&&!v.done&&(i=y.return)&&i.call(y)}finally{if(r)throw r.error}}return g},t.prototype.executeQuery=function(t,e){var n=this;if(void 0===e&&(e={}),"string"!=typeof t){var r=ie(ie(ie({},e),t),{queries:void 0}),i=t.queries.map((function(t){return n.executeQuery(t,r)}));return this.combineResults(i,t.combineWith)}var a=this._options,s=a.tokenize,o=a.processTerm,l=a.searchOptions,u=ie(ie({tokenize:s,processTerm:o},l),e),h=u.tokenize,c=u.processTerm,d=h(t).map((function(t){return c(t)})).filter((function(t){return!!t})).map(Dm(u)).map((function(t){return n.executeQuerySpec(t,u)}));return this.combineResults(d,u.combineWith)},t.prototype.executeQuerySpec=function(t,e){var n,r,i,a,s,o,l=ie(ie({},this._options.searchOptions),e),u=(l.fields||this._options.fields).reduce((function(t,e){var n;return ie(ie({},t),((n={})[e]=mo(t,e)||1,n))}),l.boost||{}),h=l.boostDocument,c=l.weights,d=l.maxFuzzy,f=ie(ie({},fl.weights),c),p=f.fuzzy,m=f.prefix,g=this._index.get(t.term),y=this.termResults(t.term,t.term,1,g,u,h);if(t.prefix&&(s=this._index.atPrefix(t.term)),t.fuzzy){var v=!0===t.fuzzy?.2:t.fuzzy,_=v<1?Math.min(d,Math.round(t.term.length*v)):v;_&&(o=this._index.fuzzyGet(t.term,_))}if(s)try{for(var w=J(s),M=w.next();!M.done;M=w.next()){var b=de(M.value,2),x=b[0],I=b[1];if(k=x.length-t.term.length){null==o||o.delete(x);var T=m*x.length/(x.length+.3*k);this.termResults(t.term,x,T,I,u,h,y)}}}catch(t){n={error:t}}finally{try{M&&!M.done&&(r=w.return)&&r.call(w)}finally{if(n)throw n.error}}if(o)try{for(var E=J(o.keys()),O=E.next();!O.done;O=E.next()){x=O.value;var k,N=de(o.get(x),2),A=N[0];if(k=N[1]){T=p*x.length/(x.length+k);this.termResults(t.term,x,T,A,u,h,y)}}}catch(t){i={error:t}}finally{try{O&&!O.done&&(a=E.return)&&a.call(E)}finally{if(i)throw i.error}}return y},t.prototype.combineResults=function(t,e){if(void 0===e&&(e=ho),0===t.length)return new Map;var n=e.toLowerCase();return t.reduce(Sm[n])||new Map},t.prototype.toJSON=function(){var t,e,n,r,i=[];try{for(var a=J(this._index),s=a.next();!s.done;s=a.next()){var o=de(s.value,2),l=o[0],u=o[1],h={};try{for(var c=(n=void 0,J(u)),d=c.next();!d.done;d=c.next()){var f=de(d.value,2),p=f[0],m=f[1];h[p]=Object.fromEntries(m)}}catch(t){n={error:t}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}i.push([l,h])}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),index:i,serializationVersion:2}},t.prototype.termResults=function(t,e,n,r,i,a,s){var o,l,u,h,c;if(void 0===s&&(s=new Map),null==r)return s;try{for(var d=J(Object.keys(i)),f=d.next();!f.done;f=d.next()){var p=f.value,m=i[p],g=this._fieldIds[p],y=r.get(g);if(null!=y){var v=y.size,_=this._avgFieldLength[g];try{for(var w=(u=void 0,J(y.keys())),M=w.next();!M.done;M=w.next()){var b=M.value,x=a?a(this._documentIds.get(b),e):1;if(x){var I=y.get(b),T=this._fieldLength.get(b)[g],E=n*m*x*Lm(I,v,this._documentCount,T,_),O=s.get(b);if(O){O.score+=E,Pm(O.terms,t);var k=mo(O.match,e);k?k.push(p):O.match[e]=[p]}else s.set(b,{score:E,terms:[t],match:(c={},c[e]=[p],c)})}}}catch(t){u={error:t}}finally{try{M&&!M.done&&(h=w.return)&&h.call(w)}finally{if(u)throw u.error}}}}}catch(t){o={error:t}}finally{try{f&&!f.done&&(l=d.return)&&l.call(d)}finally{if(o)throw o.error}}return s},t.prototype.addTerm=function(t,e,n){var r=this._index.fetch(n,vl),i=r.get(t);if(null==i)(i=new Map).set(e,1),r.set(t,i);else{var a=i.get(e);i.set(e,(a||0)+1)}},t.prototype.removeTerm=function(t,e,n){if(this._index.has(n)){var r=this._index.fetch(n,vl),i=r.get(t);null==i||null==i.get(e)?this.warnDocumentChanged(e,t,n):i.get(e)<=1?i.size<=1?r.delete(t):i.delete(e):i.set(e,i.get(e)-1),0===this._index.get(n).size&&this._index.delete(n)}else this.warnDocumentChanged(e,t,n)},t.prototype.warnDocumentChanged=function(t,e,n){var r,i;if(null!=console&&null!=console.warn)try{for(var a=J(Object.keys(this._fieldIds)),s=a.next();!s.done;s=a.next()){var o=s.value;if(this._fieldIds[o]===e)return void console.warn("MiniSearch: document with ID ".concat(this._documentIds.get(t),' has changed before removal: term "').concat(n,'" was not present in field "').concat(o,'". Removing a document after it has changed can corrupt the index!'))}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}},t.prototype.addDocumentId=function(t){var e=this._nextId;return this._documentIds.set(e,t),this._documentCount+=1,this._nextId+=1,e},t.prototype.addFields=function(t){for(var e=0;e<t.length;e++)this._fieldIds[t[e]]=e},t.prototype.addFieldLength=function(t,e,n,r){var i=this._fieldLength.get(t);null==i&&this._fieldLength.set(t,i=[]),i[e]=r;var a=(this._avgFieldLength[e]||0)*n+r;this._avgFieldLength[e]=a/(n+1)},t.prototype.removeFieldLength=function(t,e,n,r){var i=this._avgFieldLength[e]*n-r;this._avgFieldLength[e]=i/(n-1)},t.prototype.saveStoredFields=function(t,e){var n,r,i=this._options,a=i.storeFields,s=i.extractField;if(null!=a&&0!==a.length){var o=this._storedFields.get(t);null==o&&this._storedFields.set(t,o={});try{for(var l=J(a),u=l.next();!u.done;u=l.next()){var h=u.value,c=s(e,h);void 0!==c&&(o[h]=c)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}},t}(),mo=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0},Sm=((un={})[ho]=function(t,e){var n,r;try{for(var i=J(e.keys()),a=i.next();!a.done;a=i.next()){var s=a.value,o=t.get(s);if(null==o)t.set(s,e.get(s));else{var l=e.get(s),u=l.score,h=l.terms,c=l.match;o.score=o.score+u,o.match=Object.assign(o.match,c),gl(o.terms,h)}}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t},un[Am]=function(t,e){var n,r,i=new Map;try{for(var a=J(e.keys()),s=a.next();!s.done;s=a.next()){var o=s.value,l=t.get(o);if(null!=l){var u=e.get(o),h=u.score,c=u.terms,d=u.match;gl(l.terms,c),i.set(o,{score:l.score+h,terms:l.terms,match:Object.assign(l.match,d)})}}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},un[Nm]=function(t,e){var n,r;try{for(var i=J(e.keys()),a=i.next();!a.done;a=i.next()){var s=a.value;t.delete(s)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t},un),hl=1.2,ml=.7,Em=.5,Lm=function(t,e,n,r,i){return Math.log(1+(n-e+.5)/(e+.5))*(Em+t*(hl+1)/(t+hl*(1-ml+ml*r/i)))},Dm=function(t){return function(e,n,r){return{term:e,fuzzy:"function"==typeof t.fuzzy?t.fuzzy(e,n,r):t.fuzzy||!1,prefix:"function"==typeof t.prefix?t.prefix(e,n,r):!0===t.prefix}}},fo={idField:"id",extractField:function(t,e){return t[e]},tokenize:function(t,e){return t.split(Cm)},processTerm:function(t,e){return t.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},fl={combineWith:ho,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},Fm={prefix:function(t,e,n){return e===n.length-1}},Pm=function(t,e){t.includes(e)||t.push(e)},gl=function(t,e){var n,r;try{for(var i=J(e),a=i.next();!a.done;a=i.next()){var s=a.value;t.includes(s)||t.push(s)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},yl=function(t,e){var n=t.score;return e.score-n},vl=function(){return new Map},Qi=function(t){var e,n,r=new Map;try{for(var i=J(Object.keys(t)),a=i.next();!a.done;a=i.next()){var s=a.value;r.set(parseInt(s,10),t[s])}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},Cm=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;f();var Rm=["0","1","2","3","4","5","6","7","8","9"],Bm=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],qm=["0","1","2","3","4","5","6","7","8","9"],Gm=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],kk=[...Rm,...Bm,...qm,...Gm],kl=["about","after","all","also","am","an","and","another","any","are","as","at","be","because","been","before","being","between","both","but","by","came","can","come","could","did","do","each","for","from","get","got","has","had","he","have","her","here","him","himself","his","how","if","in","into","is","it","like","make","many","me","might","more","most","much","must","my","never","now","of","on","only","or","other","our","out","over","said","same","should","since","some","still","such","take","than","that","the","their","them","then","there","these","they","this","those","through","to","too","under","up","very","was","way","we","well","were","what","where","which","while","who","with","would","you","your","a","i"];f();var Et,Se,wt,Ye,pe,dn,cn,aa,pn,na,st,er,tr,xt,hn,ar,nr,ir,nf,mn,fn,bo,Vm=32,xe=!1,Um=120,go=0,yo=class{constructor(t){m(this,"_callback"),m(this,"_frameCount"),m(this,"_ordering"),m(this,"_supersededBy"),m(this,"name"),m(this,"_remainingFrameCount"),m(this,"_lastFrameTime"),m(this,"userdata"),this._callback=t.callback,this._frameCount=null!=t.frameCount?t.frameCount:1,this._ordering=null!=t.ordering?t.ordering:0,this._supersededBy=null!=t.supersededBy?new Set(t.supersededBy):new Set,this.name=t.name,this.userdata=t.userdata,this._remainingFrameCount=this._frameCount,this._lastFrameTime=0,xe&&E.log("update instantiated",this.name)}getLastFrameTime(){return this._lastFrameTime}},Mt=class{constructor(t){if(m(this,"_postponed"),m(this,"userdata"),m(this,"_priority"),m(this,"_group"),m(this,"name"),m(this,"_lastFrameTime"),m(this,"_callback"),m(this,"_complete"),m(this,"_scheduled"),m(this,"_cancelled"),null!=t.group&&null!=t.priority)throw new Error("cannot specify task priority individually within group");if(null!=t.group&&null!=t.postponeOnAdd)throw new Error("cannot specify task postpone individually within group");this._callback=t.callback,this._group=null!=t.group?t.group:null,this._priority=null!=t.priority?t.priority:0,this._postponed=null!=t.postponeOnAdd&&t.postponeOnAdd,this.name=t.name,this.userdata=t.userdata,this._complete=!1,this._scheduled=!1,this._cancelled=!1,this._lastFrameTime=0,xe&&E.log("task instantiated",this.name)}isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}},vo=class{constructor(t){m(this,"_postponed"),m(this,"_onComplete"),m(this,"_priority"),m(this,"userdata"),m(this,"name"),m(this,"_tasks"),m(this,"_scheduledTasks"),m(this,"_scheduled"),m(this,"_cancelled"),this._onComplete=null!=t.onComplete?t.onComplete:()=>{},this._priority=null!=t.priority?t.priority:0,this._postponed=null!=t.postponeOnAdd&&t.postponeOnAdd,this.name=t.name,this.userdata=t.userdata,this._tasks=new Set,this._scheduledTasks=new Set,this._scheduled=!1,this._cancelled=!1,xe&&E.log("task group instantiated",this.name)}isComplete(){return 0===this._scheduledTasks.size}getTasks(){return Array.from(this._tasks.values())}clear(){this._tasks.clear(),this._scheduledTasks.clear()}_popTask(){for(let t of this._scheduledTasks)return this._scheduledTasks.delete(t),t}},bl=class{constructor(t){m(this,"_maxMillisecondsPerFrame"),m(this,"_time"),this._maxMillisecondsPerFrame=null!=(null==t?void 0:t.maxMillisecondsPerFrame)?t.maxMillisecondsPerFrame:Vm,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}},ko=class{constructor(t){var e;m(this,"_raf"),m(this,"_timer"),m(this,"_performance"),m(this,"_scheduledUpdatesByOrdering"),m(this,"_scheduledTasksByPriority"),m(this,"_postponedTasks"),m(this,"_requestAnimationFrameHandle"),m(this,"_updatesToRunThisFrame"),m(this,"_lastFrameTime",0),m(this,"_updatesRunLastFrame"),this._timer=null!=(null==t?void 0:t.timer)?t.timer:new bl,this._performance=null!=(null==t?void 0:t.performance)&&t.performance,this._scheduledUpdatesByOrdering=new ln,this._scheduledTasksByPriority=new ln,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),xe&&E.log("task scheduler instantiated"),(null==(e=globalThis.MappedinDebug)?void 0:e.TEST_IOS)&&(this._raf=t=>setTimeout(t,16))}clear(){for(let t of this._scheduledTasksByPriority.values())t._cancelled=!0;for(let t of this._postponedTasks.values())t._cancelled=!0;this._scheduledUpdatesByOrdering=new ln,this._scheduledTasksByPriority=new ln,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),xe&&E.log("task scheduler cleared")}destroy(){this.clear()}requestAnimationFrame(){null==this._requestAnimationFrameHandle&&(this._requestAnimationFrameHandle="function"==typeof this._raf?this._raf(this.update):requestAnimationFrame(this.update))}update(t){let e;this._timer.beginFrame(),this._performance&&(e=performance.now());let n=!1;xe&&(0===go&&(n=!0),++go,go%=Um);let r=this._scheduledUpdatesByOrdering.keys();for(let t=r.length-1;t>=0;--t){let e=r[t];for(let t of this._scheduledUpdatesByOrdering.get(e).values())this._updatesToRunThisFrame.push(t),n&&E.log("update scheduled to run this frame",t.name)}for(let t of this._updatesToRunThisFrame){--t._remainingFrameCount,t._remainingFrameCount<=0&&this._scheduledUpdatesByOrdering.delete(t._ordering,t),t._superseded=!1;for(let e of this._updatesToRunThisFrame)t._supersededBy.has(e)&&(t._superseded=!0,n&&E.log("update superseded",t.name,e.name))}for(let t=0;t<this._updatesToRunThisFrame.length;++t)this._updatesToRunThisFrame[t]._superseded&&(this._updatesToRunThisFrame.splice(t,1),--t);for(let e of this._updatesToRunThisFrame){let r;this._performance&&(r=performance.now()),e._callback(t),this._performance&&(e._lastFrameTime=performance.now()-r),n&&E.log("update completed",e.name)}this._updatesRunLastFrame.clear();for(let t of this._updatesToRunThisFrame)this._updatesRunLastFrame.add(t);if(this._updatesToRunThisFrame.splice(0,this._updatesToRunThisFrame.length),this._scheduledTasksByPriority.size>0)do{this._executeOneTask(t)}while(this._timer.hasTimeRemaining()&&this._scheduledTasksByPriority.size>0);this._performance&&(this._lastFrameTime=performance.now()-e),this._requestAnimationFrameHandle=null,(this._scheduledUpdatesByOrdering.size>0||this._scheduledTasksByPriority.size>0)&&this.requestAnimationFrame()}flushTasks(){for(;this._scheduledTasksByPriority.size>0;)this._executeOneTask(performance.now())}getLastFrameTime(){return this._lastFrameTime}getUpdatesRunLastFrame(){return this._updatesRunLastFrame}_executeOneTask(t){let e,n=this._scheduledTasksByPriority.popFromMaxKey(),r=null;E.assert(void 0!==n),Object.getPrototypeOf(n)===vo.prototype&&(r=n,n=r._popTask()),E.assert(void 0!==n),E.assert(Object.getPrototypeOf(n)===Mt.prototype),this._performance&&(e=performance.now()),n._callback(t),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-e),xe&&E.log("task completed",n.name),null!=r&&(r.isComplete()?(r.clear(),r._onComplete(),xe&&E.log("group completed",r.name)):this._scheduledTasksByPriority.insert(r._priority,r))}scheduleUpdate(t){t._remainingFrameCount=t._frameCount,this._scheduledUpdatesByOrdering.insert(t._ordering,t),this.requestAnimationFrame()}scheduleTask(t){if(Object.getPrototypeOf(t)===vo)throw new Error("frame task groups are automatically scheduled when a task is added to them and cannot be manually scheduled: "+t.name);if(t._scheduled)throw new Error("cannot schedule already scheduled task: "+t.name);if(t._cancelled)throw new Error("cannot schedule cancelled task: "+t.name);let e=t;"_group"in t&&null!=t._group&&(t._group._tasks.add(t),t._group._scheduledTasks.add(t),e=t._group),e._postponed?this._postponedTasks.add(e):this._scheduledTasksByPriority.insert(e._priority,e),t._scheduled=!0,e._scheduled=!0,xe&&E.log("task scheduled",t.name),this.requestAnimationFrame()}cancelUpdate(t){this._scheduledUpdatesByOrdering.delete(t._ordering,t),xe&&E.log("update cancelled",t.name)}cancelTask(t){if(!t._scheduled)throw new Error("cannot cancel task that has not been scheduled: "+t.name);if(t._cancelled)throw new Error("cannot cancel task that has already been cancelled: "+t.name);if("_group"in t&&null!=t._group){let e=t._group.isComplete();t._group._tasks.delete(t),t._group._scheduledTasks.delete(t),t._group.isComplete()&&(this._scheduledTasksByPriority.delete(t._group._priority,t._group),e||t._group._onComplete())}else this._scheduledTasksByPriority.delete(t._priority,t),this._postponedTasks.delete(t);Object.getPrototypeOf(t)===Mt.prototype?t._cancelled=!0:"clear"in t&&t.clear(),xe&&E.log("task cancelled",t.name)}postponeTask(t){if("_group"in t&&null!=t._group)throw new Error("cannot postpone individual tasks in group: "+t.name);if(t._cancelled)throw new Error("cannot postpone cancelled task: "+t.name);if(!t._postponed){if(Object.getPrototypeOf(t)===Mt.prototype){if("_complete"in t)return;if(!t._scheduled)throw new Error("cannot postpone task that has not been scheduled: "+t.name)}this._scheduledTasksByPriority.delete(t._priority,t),(Object.getPrototypeOf(t)===Mt.prototype||!t.isComplete())&&this._postponedTasks.add(t),t._postponed=!0,xe&&E.log("task postponed",t.name)}}resumeTask(t){if("_group"in t&&null!=t._group)throw new Error("cannot resume individual tasks in groups");if(t._cancelled)throw new Error("cannot resume cancelled task");if(t._postponed){if(Object.getPrototypeOf(t)===Mt.prototype){if("_complete"in t&&t._complete)return;if(!t._scheduled)throw new Error("cannot resume unscheduled task")}this._postponedTasks.delete(t),(Object.getPrototypeOf(t)===Mt.prototype||!t.isComplete())&&this._scheduledTasksByPriority.insert(t._priority,t),t._postponed=!1,this.requestAnimationFrame(),xe&&E.log("task resumed",t.name)}}setTaskPriority(t,e){if(Object.getPrototypeOf(t)===Mt.prototype&&!t._scheduled)throw new Error("task must be scheduled to be reprioritized");this._scheduledTasksByPriority.has(t._priority,t)&&(this._scheduledTasksByPriority.delete(t._priority,t),this._scheduledTasksByPriority.insert(e,t)),t._priority=e,xe&&E.log("task priority changed",t.name,e)}},ln=class{constructor(){m(this,"_map"),m(this,"_size"),m(this,"_sortedKeys"),this._map=new Map,this._size=0,this._sortedKeys=[]}has(t,e){return null!=this._map.get(t)&&this._map.get(t).has(e)}get(t){return this._map.get(t)}insert(t,e){if(E.assert("number"==typeof t&&Number.isFinite(t)),null==this._map.get(t)){this._map.set(t,new Set);for(let e=0;e<=this._sortedKeys.length;++e)if(e===this._sortedKeys.length||t<this._sortedKeys[e]){this._sortedKeys.splice(e,0,t);break}}this._map.get(t).has(e)||(this._map.get(t).add(e),++this._size)}delete(t,e){null!=this._map.get(t)&&this._map.get(t).has(e)&&(this._map.get(t).delete(e),--this._size,0===this._map.get(t).size&&(this._map.delete(t),this._sortedKeys.splice(this._sortedKeys.indexOf(t),1)))}pop(t){if(null!=this._map.get(t)){let e;for(e of this._map.get(t).values()){this._map.get(t).delete(e),--this._size;break}return 0===this._map.get(t).size&&(this._map.delete(t),this._sortedKeys.splice(this._sortedKeys.indexOf(t),1)),e}}popFromMaxKey(){if(this._sortedKeys.length>0)return this.pop(this._sortedKeys[this._sortedKeys.length-1])}values(){let t=this._map.keys(),e=null,n={[Symbol.iterator]:()=>n,next:()=>{if(null==e){let n=t.next();if(n.done)return n;e=this._map.get(n.value).values()}let n=e.next();for(;n.done;){let r=t.next();if(r.done)return r;e=this._map.get(r.value).values(),n=e.next()}return n}};return n}keys(){return this._sortedKeys}get size(){let t=0;for(let e of this._map.values())t+=e.size;return E.assert(t===this._size),t}},ot=t=>t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase(),ta="",$m=.09,Wm=1,Hm=.025,Jm=.5,Km=5e-4,Xm=5e-4,Ym=.01,Zm=.05,Ml=1,Qm=.01,ef=.2,tf={MappedinCategory:"categories",MappedinLocation:"locations"},af={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:kl,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===j.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:$m,PRIMARY_INDEX_WEIGHT:Wm,SECONDARY_INDEX_WEIGHT:Hm,CATEGORY_NAME_WEIGHT:Jm,LOCATION_NAME_WEIGHT:Ml,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:Km,CATEGORY_LOCATION_TAGS_WEIGHT:Xm,CATEGORY_LOCATION_NAME_WEIGHT:Ym,PRIMARY_INDEX_TAGS_NAME_WEIGHT:Zm,LOCATION_DEFAULT_RANK:Ml,RATIO_OF_FUZZY_TO_EXACT:Qm,RATIO_OF_PREFIX_TO_EXACT:ef}},wl=class{constructor(t,e){var n,r,i;T(this,ir),T(this,Et,void 0),T(this,Se,void 0),T(this,wt,void 0),T(this,Ye,void 0),T(this,pe,void 0),T(this,dn,new ko({performance:!0})),T(this,cn,void 0),T(this,aa,void 0),T(this,pn,new Map),T(this,na,0),T(this,st,(t=>{I(this,na,1+ +p(this,na)),p(this,dn).scheduleUpdate(new yo({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{t(),I(this,na,+p(this,na)-1),0===p(this,na)&&p(this,hn).call(this)}}))})),T(this,er,(t=>{var e,n,r;let{SECONDARY_INDEX_WEIGHT:i,LOCATION_DEFAULT_RANK:a,PRIMARY_INDEX_TAGS_NAME_WEIGHT:s}=p(this,pe).constants,o=a;(null==(e=p(this,pe))?void 0:e.useLocationRank)&&(o=Array.isArray(t.polygons)?Math.max(...t.polygons.map((t=>{var e,n;return(null==(e=t.rank)?void 0:e.score)?null==(n=t.rank)?void 0:n.score:a})),a):a),p(this,st).call(this,(()=>{p(this,Se).add({name:ot(t.name),tags:"",id:"MappedinLocation_"+t.id,weight:a,rank:o})})),(null==(n=p(this,pe))?void 0:n.searchTags)&&Array.isArray(t.tags)&&t.tags.forEach((e=>{p(this,Se).add({name:"",tag:ot(e),id:"MappedinLocation_"+t.id,weight:s,rank:o})})),(null==(r=p(this,pe))?void 0:r.searchDescriptions)&&p(this,st).call(this,(()=>p(this,wt).add({description:ot(t.description||""),id:"MappedinLocation_"+t.id,weight:i,rank:o})))})),T(this,tr,(t=>{var e,n;let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:r,CATEGORY_LOCATION_TAGS_WEIGHT:i,CATEGORY_LOCATION_NAME_WEIGHT:a,CATEGORY_NAME_WEIGHT:s}=p(this,pe).constants;p(this,st).call(this,(()=>p(this,Se).add({name:ot(t.name||""),description:"",id:"MappedinCategory_"+t.id,weight:s})));let o=t.locations.reduce(((t,e)=>t+` ${ta} `+e.name),"")+` ${ta}`;if((null==(e=p(this,pe))?void 0:e.searchDescriptionsInCategories)&&t.locations.forEach((e=>{null!=e.description&&p(this,st).call(this,(()=>p(this,Ye).add({id:"MappedinCategory_"+t.id,"category.locations.description":ot(e.description),ref:e.name,weight:r})))})),null==(n=p(this,pe))?void 0:n.searchTagsInCategories){let e=t.locations.reduce(((t,e)=>{var n;return t+(null==(n=e.tags)?void 0:n.reduce(((t,e)=>t+` ${ta} `+e),""))+` ${ta}`}),"");p(this,st).call(this,(()=>p(this,Ye).add({"category.locations.tags":ot(e),id:"MappedinCategory_"+t.id,weight:i})))}p(this,st).call(this,(()=>p(this,Ye).add({"category.locations.name":ot(o),id:"MappedinCategory_"+t.id,weight:a})))})),T(this,xt,void 0),T(this,hn,void 0),T(this,ar,(t=>{var e;let n=t.score,{object:r,id:i,weight:a,rank:s}=t,[o,l]=i.split("_"),u=r||p(this,Et).getCollectionItemById(tf[o],l);return s&&(null==(e=p(this,pe))?void 0:e.useLocationRank)&&(n+=s),a&&(n*=a),{score:n,type:o,object:u}})),T(this,nr,((t,e)=>{for(let n in t.match)t.match[n].forEach((r=>{let i=t.ref||t[r]||e.object[r];if("category.locations.tags"===r||"category.locations.name"===r){let e=new RegExp(`[^${ta}]* `+n+` [^${ta}]*`,"ig").exec(t[r]);null!=e&&(i=e[0].slice(1,-1))}e.matches.push({term:n,weight:t.weight,matchesOn:r,value:i})}))})),T(this,mn,void 0),T(this,fn,void 0),I(this,aa,new Yi({...t.options,testMode:!1===(null==e?void 0:e.emitAnalyticsEvents)})),I(this,pe,{...af,...e}),I(this,Et,t),I(this,cn,new Set(null==(n=p(this,pe))?void 0:n.stopWords));let{PRIMARY_INDEX_FUZZYNESS:a,PRIMARY_INDEX_WEIGHT:s,CATEGORY_NAME_WEIGHT:o,RATIO_OF_FUZZY_TO_EXACT:l,RATIO_OF_PREFIX_TO_EXACT:u,PRIMARY_INDEX_TAGS_NAME_WEIGHT:h}=p(this,pe).constants,c=["object","query","weight","tag","rank"],d={fields:["query","name","tag"],storeFields:c,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:a},boost:{name:s,query:s,tag:h},weights:{fuzzy:l,prefix:u},boostDocument:t=>t.includes("MappedinLocation")?s:t.includes("MappedinCategory")?o:s},f={fields:["description"],storeFields:c,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(t,e)=>{var n;return(null==(n=p(this,cn))?void 0:n.has(t.toLowerCase()))?null:t.toLowerCase()}},m={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...c,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(I(this,xt,new Promise((t=>{I(this,hn,t)}))),null==(r=p(this,pe))?void 0:r.jsonIndex){let{primary:t,secondary:e,extra:n}=JSON.parse(null==(i=p(this,pe))?void 0:i.jsonIndex);I(this,Se,St.loadJS(t,d)),I(this,wt,St.loadJS(e,f)),I(this,Ye,St.loadJS(n,m))}else I(this,Se,new St(d)),I(this,wt,new St(f)),I(this,Ye,new St(m)),p(this,Et).locations.forEach(p(this,er)),p(this,Et).categories.forEach(p(this,tr));p(this,dn).update(performance.now()),I(this,mn,Kr(((t,e)=>{p(this,aa).trackSearchSuggest({query:t,hits:e})}),300)),I(this,fn,Kr(((t,e)=>{p(this,aa).trackSearch({query:t,hits:e})}),300))}async suggest(t){await p(this,xt);let{PRIMARY_INDEX_FUZZYNESS:e,PRIMARY_INDEX_WEIGHT:n,PRIMARY_INDEX_TAGS_NAME_WEIGHT:r,RATIO_OF_FUZZY_TO_EXACT:i,RATIO_OF_PREFIX_TO_EXACT:a}=p(this,pe).constants,s=p(this,Se).autoSuggest(t,{fields:["name","tag","query"],combineWith:"AND",prefix:!0,fuzzy:e,boost:{name:n,query:n,tag:r},weights:{fuzzy:i,prefix:a}});return p(this,mn).call(this,t,s.length),{total:s.length,hits:s.map((t=>({text:t.suggestion})))}}async search(t){await p(this,xt);let e=et(this,ir,nf).call(this,t);return p(this,fn).call(this,t,e.length),e}async toJSON(){return await p(this,xt),JSON.stringify({primary:p(this,Se),secondary:p(this,wt),extra:p(this,Ye)})}async addQuery(t){let e,n,{query:r,object:i,weight:a=1}=t;await p(this,xt),e=i instanceof gt?"MappedinLocation":i instanceof Bt?"MappedinCategory":"Custom","MappedinLocation"===e||"MappedinCategory"===e?n=e+"_"+i.id:"string"==typeof i.id?n="Custom_"+i.id:(n=p(this,pn).get(i),n||(n="Custom_"+it(),p(this,pn).set(i,n))),p(this,Se).add({id:n,weight:a,object:i,query:ot(r)})}};Et=new WeakMap,Se=new WeakMap,wt=new WeakMap,Ye=new WeakMap,pe=new WeakMap,dn=new WeakMap,cn=new WeakMap,aa=new WeakMap,pn=new WeakMap,na=new WeakMap,st=new WeakMap,er=new WeakMap,tr=new WeakMap,xt=new WeakMap,hn=new WeakMap,ar=new WeakMap,nr=new WeakMap,ir=new WeakSet,nf=function(t){let e=[],n=ot(t);e=[...p(this,Se).search(n),...p(this,wt).search(n),...p(this,Ye).search(n)].sort(((t,e)=>e.score-t.score));let r={};for(let t of e){let e=p(this,ar).call(this,t);r[t.id]?r[t.id].score+=e.score:r[t.id]={...e,matches:[]},p(this,nr).call(this,t,r[t.id])}return Object.keys(r).map((t=>({...r[t],matches:r[t].matches.sort(((t,e)=>e.weight-t.weight))}))).sort(((t,e)=>e.score-t.score))},mn=new WeakMap,fn=new WeakMap,f(),function(t){t.MULTI_GEOMETRY="MULTI_GEOMETRY",t.SINGLE_GEOMETRY="SINGLE_GEOMETRY"}(bo||(bo={}));var Vo=globalThis.fetch;function kt(){if(null==Vo)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return Vo}function Rk(t){Vo=t}var ld,dd,If=null==(dd=null==(ld=j)?void 0:ld.env)?void 0:dd.npm_package_version;globalThis.btoa||(globalThis.btoa=sd.encode);var Of=["ar"];function xn(t){let e={...oo,things:sl,...t};return e.headers={...e.headers,"mappedin-sdk-version":If},t.platformString&&(e.headers={...e.headers,"mappedin-platform-version":t.platformString}),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 qk(t){let{venue:e,clientId:n,clientSecret:r,bundleBaseUri:i}=t,a=new Nt({venue:e}),s=Su(await Nf({clientId:n,clientSecret:r,venue:e,bundleBaseUri:i},!1));return a.hydrateFromMVF(s),a}async function zf(t){let e=xn({baseUrl:"https://api-gateway.mappedin.com/",...{emitAnalyticsEvents:!0,...t}}),n="public/1/"+(e.useDraftData?"draft/":""),r=new Nt({...e,baseUrl:e.baseUrl+n});return await r.fetch(),r}function Gk(t){zf=t}var Uo={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function Vk(t){let e=xn({baseUrl:"https://api-gateway.mappedin.com/",...Uo,...t}),{url:n,updated_at:r}=await Af(t),i=await kt()(n,{mode:"cors"}),{data:a,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error(`Unrecognized format ${s}`);let o=new Nt(e);return await o.hydrate(a,e.shouldPopulateBundledImagesAsBlobs),o.updatedAt=r,o}async function Af(t){let e=xn({baseUrl:"https://api-gateway.mappedin.com/",...Uo,...t}),{version:n,venue:r}=t,i=`${t.bundleBaseUri||e.baseUrl+`exports/legacy${null!=e.language&&Of.includes(e.language)?"-"+e.language:""}/1/bundle`}?venue=${r}&version=1.0.0`;return e.language=void 0,await Ni(e,i)}async function Uk(t,{url:e,updated_at:n}){let r=xn({baseUrl:"https://api-gateway.mappedin.com/",...Uo,...t}),i=await kt()(e,{mode:"cors"}),{data:a,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error(`Unrecognized format${s}`);let o=new Nt(r);return await o.hydrate(a,r.shouldPopulateBundledImagesAsBlobs),o.updatedAt=n,o}async function ud(t){let e=xn({baseUrl:"https://api-gateway.mappedin.com/",...oo,...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 Ni(e,i)}async function Nf(t,e=!1){return new Promise((async(n,r)=>{try{let i=new TextDecoder,a=i.decode.bind(i),s=await Promise.resolve().then((()=>(od(),rd)));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:i}=await ud(t),o=new Uint8Array(await kt()(i).then((t=>t.arrayBuffer()))),l=s.unzipSync(o),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=[],m=[];for(let t=0;t<d.length;t++){let[,e]=d[t];e.byteLength>=f?p.push(d[t]):e.byteLength<f&&m.push(d[t])}let g={};if(0===m.length)d.forEach((([t])=>{g[t]=JSON.parse(a(l[t]))})),n(g);else{let t=function({data:t}){let e=this;if("finished"===t[0]){let n=m[s];if(null!=n){let[t,r]=n;e.postMessage(["task",t]),e.postMessage(r,[r]),s++}let[r,i]=t[1];g[r]=i,o++}else if("error"===t[0]){let[,e]=t;c.forEach((t=>t.terminate())),r(e)}o===u.length&&(n(g),c.forEach((t=>t.terminate())))},i=URL.createObjectURL(e);for(let t=0;t<Math.min(h,m.length);t++)c.push(new Worker(i));let s=0,o=0;c.forEach((e=>{if(e.onmessage=t,null!=m[s]){let[t,n]=m[s];e.postMessage(["task",t]),e.postMessage(n,[n]),s++}})),p.forEach((([t])=>{g[t]=JSON.parse(a(l[t])),o++}))}}else{let{url:e}=await ud(t),r=new Uint8Array(await kt()(e).then((t=>t.arrayBuffer()))),i=s.unzipSync(r),o=Object.keys(i),l={};for(let t=0;t<o.length;t++){let e=o[t];if(0===e.indexOf("image/")&&-1===e.indexOf("__MACOSX"))l[e]=i[e].buffer;else if("/"!==e.slice(-1))try{l[e]=JSON.parse(a(i[e]))}catch(t){E.warn("bad file",e)}}n(l)}}catch(t){r(t)}}))}export{bo as MAP_RENDER_MODE,Nt as Mappedin,Bt as MappedinCategory,nt as MappedinCollectionType,qa as MappedinCoordinate,zi as MappedinDestinationSet,Ia as MappedinDirections,Ei as MappedinEvent,gt as MappedinLocation,Ci as MappedinMap,Bi as MappedinMapGroup,mt as MappedinNavigatable,Gi as MappedinNode,Ct as MappedinPolygon,Ui as MappedinRankings,Hi as MappedinVenue,Ki as MappedinVortex,wl as OfflineSearch,Gk as __setGetVenueMock,Uk as downloadBundle,Nf as downloadVenueBundleMVF,zf as getVenue,Vk as getVenueBundle,Af as getVenueBundleURL,qk as getVenueMVF,ud as getVenueMVFURL,kt as isomorphicFetch,Rk as setFetchFn};
|
|
1
|
+
var M,Ou=Object.create,Ma=Object.defineProperty,zu=Object.getOwnPropertyDescriptor,Au=Object.getOwnPropertyNames,Nu=Object.getPrototypeOf,Eu=Object.prototype.hasOwnProperty,Su=(e,t,n)=>t in e?Ma(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mi=(e,t)=>()=>(e&&(t=e(e=0)),t),D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Pu=(e,t)=>{for(var n in t)Ma(e,n,{get:t[n],enumerable:!0})},Fu=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of Au(t))!Eu.call(e,i)&&i!==n&&Ma(e,i,{get:()=>t[i],enumerable:!(r=zu(t,i))||r.enumerable});return e},Yn=(e,t,n)=>(n=null!=e?Ou(Nu(e)):{},Fu(!t&&e&&e.__esModule?n:Ma(n,"default",{value:e,enumerable:!0}),e)),ye=(e,t,n)=>(Su(e,"symbol"!=typeof t?t+"":t,n),n),wi=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},N=(e,t,n)=>(wi(e,t,"read from private field"),n?n.call(e):t.get(e)),ee=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Y=(e,t,n,r)=>(wi(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),h=Mi((()=>{M={env:{NODE_ENV:"production",npm_package_version:"6.0.0-alpha.0"}}})),xi=D(((e,t)=>{h(),function(n){var r="object"==typeof e&&e,i="object"==typeof t&&t&&t.exports==r&&t,a="object"==typeof global&&global;(a.global===a||a.window===a)&&(n=a);var s=function(e){this.message=e};(s.prototype=new Error).name="InvalidCharacterError";var o=function(e){throw new s(e)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,h={encode:function(e){e=String(e),/[^\0-\xFF]/.test(e)&&o("The string to be encoded contains characters outside of the Latin1 range.");for(var t,n,r,i,a=e.length%3,s="",u=-1,h=e.length-a;++u<h;)t=e.charCodeAt(u)<<16,n=e.charCodeAt(++u)<<8,r=e.charCodeAt(++u),s+=l.charAt((i=t+n+r)>>18&63)+l.charAt(i>>12&63)+l.charAt(i>>6&63)+l.charAt(63&i);return 2==a?(t=e.charCodeAt(u)<<8,n=e.charCodeAt(++u),s+=l.charAt((i=t+n)>>10)+l.charAt(i>>4&63)+l.charAt(i<<2&63)+"="):1==a&&(i=e.charCodeAt(u),s+=l.charAt(i>>2)+l.charAt(i<<4&63)+"=="),s},decode:function(e){var t=(e=String(e).replace(u,"")).length;t%4==0&&(t=(e=e.replace(/==?$/,"")).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&o("Invalid character: the string to be decoded is not correctly encoded.");for(var n,r,i=0,a="",s=-1;++s<t;)r=l.indexOf(e.charAt(s)),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}(e)})),oe=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.areaConversion=e.timeConversion=e.distanceConversion=e.altitudeKeys=e.latitudeKeys=e.longitudeKeys=e.MAXLON=e.MINLON=e.MAXLAT=e.MINLAT=e.earthRadius=e.sexagesimalPattern=void 0;e.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/;e.earthRadius=6378137;e.MINLAT=-90;e.MAXLAT=90;e.MINLON=-180;e.MAXLON=180;e.longitudeKeys=["lng","lon","longitude",0];e.latitudeKeys=["lat","latitude",1];e.altitudeKeys=["alt","altitude","elevation","elev",2];e.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};e.timeConversion={m:60,h:3600,d:86400};var t={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};e.areaConversion=t,t.sqm=t.m2,t.sqkm=t.km2,t.sqft=t.ft2,t.sqyd=t.yd2,t.sqin=t.in2})),Kt=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e,t){return t.reduce((function(t,n){if(typeof e>"u"||null===e)throw new Error("'".concat(e,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(e,n)&&typeof n<"u"&&typeof t>"u"?(t=n,n):t}),void 0)};e.default=t})),Zt=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){var t=e.toString().trim();return!isNaN(parseFloat(t))&&parseFloat(t)===Number(t)};e.default=t})),Qt=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=function(e){return t.sexagesimalPattern.test(e.toString().trim())};e.default=n})),ea=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=function(e){var n=new RegExp(t.sexagesimalPattern).exec(e);if(typeof n>"u"||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};e.default=n})),Oa=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=oe(),r=(t=Kt())&&t.__esModule?t:{default:t};function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:n.longitudeKeys,latitude:n.latitudeKeys,altitude:n.altitudeKeys},i=(0,r.default)(e,t.longitude),s=(0,r.default)(e,t.latitude),o=(0,r.default)(e,t.altitude);return a({latitude:s,longitude:i},o?{altitude:o}:{})};e.default=o})),Zn=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(Zt()),n=a(Qt()),r=a(ea()),i=oe();function a(e){return e&&e.__esModule?e:{default:e}}var s=function e(a){return(0,t.default)(a)?!(parseFloat(a)>i.MAXLAT||a<i.MINLAT):!!(0,n.default)(a)&&e((0,r.default)(a))};e.default=s})),er=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(Zt()),n=a(Qt()),r=a(ea()),i=oe();function a(e){return e&&e.__esModule?e:{default:e}}var s=function e(a){return(0,t.default)(a)?!(parseFloat(a)>i.MAXLON||a<i.MINLON):!!(0,n.default)(a)&&e((0,r.default)(a))};e.default=s})),ar=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=i(Oa()),n=i(Zn()),r=i(er());function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e){var i=(0,t.default)(e),a=i.latitude,s=i.longitude;if(Array.isArray(e)&&e.length>=2)return(0,r.default)(e[0])&&(0,n.default)(e[1]);if(typeof a>"u"||typeof s>"u")return!1;var o=e[s],l=e[a];return!(typeof l>"u"||typeof o>"u"||!1===(0,n.default)(l)||!1===(0,r.default)(o))};e.default=a})),Sa=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=s(Zt()),n=s(Qt()),r=s(ea()),i=s(ar()),a=s(Oa());function s(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=function e(s){if((0,t.default)(s))return Number(s);if((0,n.default)(s))return(0,r.default)(s);if((0,i.default)(s)){var o=(0,a.default)(s);return Array.isArray(s)?s.map((function(t,n){return[0,1].includes(n)?e(t):t})):l(l(l({},s),o.latitude&&u({},o.latitude,e(s[o.latitude]))),o.longitude&&u({},o.longitude,e(s[o.longitude])))}return Array.isArray(s)?s.map((function(t){return(0,i.default)(t)?e(t):t})):s};e.default=c})),_e=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=i(Kt()),r=i(Sa());function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e,i){var a=(0,n.default)(e,t.latitudeKeys);if(!(typeof a>"u"||null===a)){var s=e[a];return!0===i?s:(0,r.default)(s)}};e.default=a})),je=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=i(Kt()),r=i(Sa());function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e,i){var a=(0,n.default)(e,t.longitudeKeys);if(!(typeof a>"u"||null===a)){var s=e[a];return!0===i?s:(0,r.default)(s)}};e.default=a})),De=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){return e*Math.PI/180};e.default=t})),dt=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){return 180*e/Math.PI};e.default=t})),Pi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=s(_e()),n=s(je()),r=s(De()),i=s(dt()),a=oe();function s(e){return e&&e.__esModule?e:{default:e}}var o=function(e,s,o){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,u=(0,t.default)(e),h=(0,n.default)(e),c=s/l,d=(0,r.default)(o),f=(0,r.default)(u),p=(0,r.default)(h),g=Math.asin(Math.sin(f)*Math.cos(c)+Math.cos(f)*Math.sin(c)*Math.cos(d)),y=p+Math.atan2(Math.sin(d)*Math.sin(c)*Math.cos(f),Math.cos(c)-Math.sin(f)*Math.sin(g)),m=(0,i.default)(y);return(m<a.MINLON||m>a.MAXLON)&&(y=(y+3*Math.PI)%(2*Math.PI)-Math.PI,m=(0,i.default)(y)),{latitude:(0,i.default)(g),longitude:m}};e.default=o})),Fi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=t.areaConversion[n];if(r)return e*r;throw new Error("Invalid unit used for area conversion.")};e.default=n})),Di=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=t.distanceConversion[n];if(r)return e*r;throw new Error("Invalid unit used for distance conversion.")};e.default=n})),Li=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(n){case"kmh":return e*t.timeConversion.h*t.distanceConversion.km;case"mph":return e*t.timeConversion.h*t.distanceConversion.mi;default:return e}};e.default=n})),Bi=D((e=>{"use strict";function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&null!=o.return&&o.return()}finally{if(i)throw a}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}}(e,t)||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(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(e){var t=Math.pow(10,12);return Math.round(e*t)/t},i=function(e){var n=t(e.toString().split("."),2),i=n[0],a=n[1],s=Math.abs(Number(i)),o=r(60*Number("0."+(a||0))),l=Math.floor(o),u=r(60*(o%l||0));return s+"° "+Number(l.toFixed(6)).toString().split(".").map((function(e,t){return 0===t?e.padStart(2,"0"):e})).join(".")+"' "+Number(u.toFixed(4)).toString().split(".").map((function(e,t){return 0===t?e.padStart(2,"0"):e})).join(".")+'"'};e.default=i})),sr=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){return e>1?1:e<-1?-1:e};e.default=t})),Ke=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=s(_e()),n=s(je()),r=s(De()),i=s(sr()),a=oe();function s(e){return e&&e.__esModule?e:{default:e}}var o=function(e,s){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;o=typeof o<"u"&&!isNaN(o)?o:1;var l=(0,t.default)(e),u=(0,n.default)(e),h=(0,t.default)(s),c=(0,n.default)(s),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/o)*o};e.default=o})),ur=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=Ke())&&t.__esModule?t:{default:t};var r=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default;return r="function"==typeof r?r:n.default,t.slice().sort((function(t,n){return r(e,t)-r(e,n)}))};e.default=r})),Vi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=ur())&&t.__esModule?t:{default:t};var r=function(e,t){return(0,n.default)(e,t)[0]};e.default=r})),Hi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(De()),n=a(_e()),r=a(je()),i=oe();function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){var a=0;if(e.length>2){for(var s,o,l,u=0;u<e.length;u++){u===e.length-2?(s=e.length-2,o=e.length-1,l=0):u===e.length-1?(s=e.length-1,o=0,l=1):(s=u,o=u+1,l=u+2);var h=(0,r.default)(e[s]),c=(0,n.default)(e[o]),d=(0,r.default)(e[l]);a+=((0,t.default)(d)-(0,t.default)(h))*Math.sin((0,t.default)(c))}a=a*i.earthRadius*i.earthRadius/2}return Math.abs(a)};e.default=s})),dr=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(_e()),n=r(je());function r(e){return e&&e.__esModule?e:{default:e}}var i=function(e){if(!1===Array.isArray(e)||0===e.length)throw new Error("No points were given.");return e.reduce((function(e,r){var i=(0,t.default)(r),a=(0,n.default)(r);return{maxLat:Math.max(i,e.maxLat),minLat:Math.min(i,e.minLat),maxLng:Math.max(a,e.maxLng),minLng:Math.min(a,e.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})};e.default=i})),Xi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=s(_e()),n=s(je()),r=s(De()),i=s(dt()),a=oe();function s(e){return e&&e.__esModule?e:{default:e}}var o=function(e,s){var o,l,u=(0,t.default)(e),h=(0,n.default)(e),c=(0,r.default)(u),d=(0,r.default)(h),f=s/a.earthRadius,p=c-f,g=c+f,y=(0,r.default)(a.MAXLAT),m=(0,r.default)(a.MINLAT),v=(0,r.default)(a.MAXLON),_=(0,r.default)(a.MINLON);if(p>m&&g<y){var w=Math.asin(Math.sin(f)/Math.cos(c));(o=d-w)<_&&(o+=2*Math.PI),(l=d+w)>v&&(l-=2*Math.PI)}else p=Math.max(p,m),g=Math.min(g,y),o=_,l=v;return[{latitude:(0,i.default)(p),longitude:(0,i.default)(o)},{latitude:(0,i.default)(g),longitude:(0,i.default)(l)}]};e.default=o})),Zi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(_e()),n=a(je()),r=a(De()),i=a(dt());function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){if(!1===Array.isArray(e)||0===e.length)return!1;var a=e.length,s=e.reduce((function(e,i){var a=(0,r.default)((0,t.default)(i)),s=(0,r.default)((0,n.default)(i));return{X:e.X+Math.cos(a)*Math.cos(s),Y:e.Y+Math.cos(a)*Math.sin(s),Z:e.Z+Math.sin(a)}}),{X:0,Y:0,Z:0}),o=s.X/a,l=s.Y/a,u=s.Z/a;return{longitude:(0,i.default)(Math.atan2(l,o)),latitude:(0,i.default)(Math.atan2(u,Math.sqrt(o*o+l*l)))}};e.default=s})),Qi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=dr())&&t.__esModule?t:{default:t};var r=function(e){var t=(0,n.default)(e),r=t.minLat+(t.maxLat-t.minLat)/2,i=t.minLng+(t.maxLng-t.minLng)/2;return{latitude:parseFloat(r.toFixed(6)),longitude:parseFloat(i.toFixed(6))}};e.default=r})),pr=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(_e()),n=a(je()),r=a(De()),i=a(dt());function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e,a){var s=(0,r.default)((0,n.default)(a))-(0,r.default)((0,n.default)(e)),o=Math.log(Math.tan((0,r.default)((0,t.default)(a))/2+Math.PI/4)/Math.tan((0,r.default)((0,t.default)(e))/2+Math.PI/4));return Math.abs(s)>Math.PI&&(s=s>0?-1*(2*Math.PI-s):2*Math.PI+s),((0,i.default)(Math.atan2(s,o))+360)%360};e.default=s})),no=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=pr())&&t.__esModule?t:{default:t};var r=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,i="function"==typeof r?r(e,t):(0,n.default)(e,t);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"}};e.default=r})),mr=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(Ke()),n=r(sr());function r(e){return e&&e.__esModule?e:{default:e}}var i=function(e,r,i){var a=(0,t.default)(r,e),s=(0,t.default)(e,i),o=(0,t.default)(r,i),l=Math.acos((0,n.default)((a*a+o*o-s*s)/(2*a*o))),u=Math.acos((0,n.default)((s*s+o*o-a*a)/(2*s*o)));return l>Math.PI/2?a:u>Math.PI/2?s:Math.sin(l)*a};e.default=i})),uo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(_e()),n=a(je()),r=a(De()),i=a(dt());function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e,a){var s=(0,t.default)(a),o=(0,n.default)(a),l=(0,t.default)(e),u=(0,n.default)(e);return((0,i.default)(Math.atan2(Math.sin((0,r.default)(o)-(0,r.default)(u))*Math.cos((0,r.default)(s)),Math.cos((0,r.default)(l))*Math.sin((0,r.default)(s))-Math.sin((0,r.default)(l))*Math.cos((0,r.default)(s))*Math.cos((0,r.default)(o)-(0,r.default)(u))))+360)%360};e.default=s})),lo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=Ke())&&t.__esModule?t:{default:t};function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.default;return e.reduce((function(e,n){return"object"===r(e)&&null!==e.last&&(e.distance+=t(n,e.last)),e.last=n,e}),{last:null,distance:0}).distance};e.default=i})),mo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(_e()),n=a(je()),r=a(De()),i=oe();function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e,a){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;s=typeof s<"u"&&!isNaN(s)?s:1;var o,l,u,h,c,d,f,p=(0,t.default)(e),g=(0,n.default)(e),y=(0,t.default)(a),m=(0,n.default)(a),v=6356752.314245,_=1/298.257223563,w=(0,r.default)(m-g),M=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(p)))),b=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(y)))),x=Math.sin(M),O=Math.cos(M),E=Math.sin(b),N=Math.cos(b),A=w,I=100;do{var k=Math.sin(A),T=Math.cos(A);if(0===(d=Math.sqrt(N*k*(N*k)+(O*E-x*N*T)*(O*E-x*N*T))))return 0;o=x*E+O*N*T,l=Math.atan2(d,o),c=o-2*x*E/(h=1-(u=O*N*k/d)*u),isNaN(c)&&(c=0);var S=_/16*h*(4+_*(4-3*h));f=A,A=w+(1-S)*_*u*(l+S*d*(c+S*o*(2*c*c-1)))}while(Math.abs(A-f)>1e-12&&--I>0);if(0===I)return NaN;var F=h*(i.earthRadius*i.earthRadius-v*v)/(v*v),D=1+F/16384*(4096+F*(F*(320-175*F)-768)),P=F/1024*(256+F*(F*(74-47*F)-128)),j=P*d*(c+P/4*(o*(2*c*c-1)-P/6*c*(4*d*d-3)*(4*c*c-3))),B=v*D*(l-j);return Math.round(B/s)*s};e.default=s})),fo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){return/^NNE|NE|NNW|N$/.test(e)?"N":/^ENE|E|ESE|SE$/.test(e)?"E":/^SSE|S|SSW|SW$/.test(e)?"S":/^WSW|W|WNW|NW$/.test(e)?"W":void 0};e.default=t})),go=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=Ke())&&t.__esModule?t:{default:t};var r=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,i=r(e,t),a=Number(t.time)-Number(e.time),s=i/a*1e3;return s};e.default=r})),yo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=Ke())&&t.__esModule?t:{default:t};var r=function(e,t,r){return(0,n.default)(t,e)+(0,n.default)(e,r)===(0,n.default)(t,r)};e.default=r})),ko=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(_e()),n=r(je());function r(e){return e&&e.__esModule?e:{default:e}}var i=function(e,r){for(var i=!1,a=r.length,s=-1,o=a-1;++s<a;o=s)((0,n.default)(r[s])<=(0,n.default)(e)&&(0,n.default)(e)<(0,n.default)(r[o])||(0,n.default)(r[o])<=(0,n.default)(e)&&(0,n.default)(e)<(0,n.default)(r[s]))&&(0,t.default)(e)<((0,t.default)(r[o])-(0,t.default)(r[s]))*((0,n.default)(e)-(0,n.default)(r[s]))/((0,n.default)(r[o])-(0,n.default)(r[s]))+(0,t.default)(r[s])&&(i=!i);return i};e.default=i})),bo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=mr())&&t.__esModule?t:{default:t};var r=function(e,t,r,i){return(0,n.default)(e,t,r)<i};e.default=r})),Mo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=Ke())&&t.__esModule?t:{default:t};var r=function(e,t,r){return(0,n.default)(e,t)<r};e.default=r})),xo=D((e=>{"use strict";function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&null!=o.return&&o.return()}finally{if(i)throw a}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}}(e,t)||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(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(e){if(!e.startsWith("POLYGON"))throw new Error("Invalid wkt.");return e.slice(e.indexOf("(")+2,e.indexOf(")")).split(", ").map((function(e){var n=t(e.split(" "),2),r=n[0],i=n[1];return{longitude:parseFloat(r),latitude:parseFloat(i)}}))};e.default=r})),jo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0});var t={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(e,"computeDestinationPoint",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"convertArea",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"convertDistance",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"convertSpeed",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"decimalToSexagesimal",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"findNearest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"getAreaOfPolygon",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"getBounds",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"getBoundsOfDistance",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"getCenter",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"getCenterOfBounds",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"getCompassDirection",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"getCoordinateKey",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(e,"getCoordinateKeys",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(e,"getDistance",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(e,"getDistanceFromLine",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(e,"getGreatCircleBearing",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(e,"getLatitude",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(e,"getLongitude",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(e,"getPathLength",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(e,"getPreciseDistance",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(e,"getRhumbLineBearing",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(e,"getRoughCompassDirection",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(e,"getSpeed",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(e,"isDecimal",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(e,"isPointInLine",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(e,"isPointInPolygon",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(e,"isPointNearLine",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(e,"isPointWithinRadius",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(e,"isSexagesimal",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(e,"isValidCoordinate",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(e,"isValidLatitude",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(e,"isValidLongitude",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(e,"orderByDistance",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(e,"sexagesimalToDecimal",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(e,"toDecimal",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(e,"toRad",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(e,"toDeg",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(e,"wktToPolygon",{enumerable:!0,get:function(){return U.default}});var n=G(Pi()),r=G(Fi()),i=G(Di()),a=G(Li()),s=G(Bi()),o=G(Vi()),l=G(Hi()),u=G(dr()),c=G(Xi()),d=G(Zi()),f=G(Qi()),p=G(no()),g=G(Kt()),y=G(Oa()),m=G(Ke()),v=G(mr()),_=G(uo()),w=G(_e()),M=G(je()),b=G(lo()),x=G(mo()),O=G(pr()),E=G(fo()),N=G(go()),A=G(Zt()),I=G(yo()),k=G(ko()),T=G(bo()),S=G(Mo()),F=G(Qt()),D=G(ar()),P=G(Zn()),j=G(er()),B=G(ur()),C=G(ea()),L=G(Sa()),z=G(De()),R=G(dt()),U=G(xo()),$=oe();function G(e){return e&&e.__esModule?e:{default:e}}Object.keys($).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(t,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return $[n]}})}))})),ss=D(((e,t)=>{"use strict";h(),t.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))})),ps=D(((e,t)=>{"use strict";h();var n="%[a-f0-9]{2}",r=new RegExp("("+n+")|([^%]+?)","gi"),i=new RegExp("("+n+")+","gi");function a(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],a(n),a(r))}function s(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(r)||[],n=1;n<t.length;n++)t=(e=a(t,n).join("")).match(r)||[];return e}}t.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=i.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{var r=s(n[0]);r!==n[0]&&(t[n[0]]=r)}n=i.exec(e)}t["%C2"]="�";for(var a=Object.keys(t),o=0;o<a.length;o++){var l=a[o];e=e.replace(new RegExp(l,"g"),t[l])}return e}(e)}}})),ms=D(((e,t)=>{"use strict";h(),t.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];let n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}})),gs=D(((e,t)=>{"use strict";h(),t.exports=function(e,t){for(var n={},r=Object.keys(e),i=Array.isArray(t),a=0;a<r.length;a++){var s=r[a],o=e[s];(i?-1!==t.indexOf(s):t(s,o,e))&&(n[s]=o)}return n}})),_s=D((e=>{"use strict";h();var t=ss(),n=ps(),r=ms(),i=gs(),a=Symbol("encodeFragmentIdentifier");function s(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function o(e,n){return n.encode?n.strict?t(e):encodeURIComponent(e):e}function l(e,t){return t.decode?n(e):e}function u(e){return Array.isArray(e)?e.sort():"object"==typeof e?u(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function c(e){let t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function d(e){let t=(e=c(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function f(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):t.parseBooleans&&null!==e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())&&(e="true"===e.toLowerCase()),e}function p(e,t){s((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{let i="string"==typeof n&&n.includes(e.arrayFormatSeparator),a="string"==typeof n&&!i&&l(n,e).includes(e.arrayFormatSeparator);n=a?l(n,e):n;let s=i||a?n.split(e.arrayFormatSeparator).map((t=>l(t,e))):null===n?n:l(n,e);r[t]=s};case"bracket-separator":return(t,n,r)=>{let i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(r[t]=n&&l(n,e));let a=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>l(t,e)));void 0!==r[t]?r[t]=[].concat(r[t],a):r[t]=a};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),i=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return i;for(let a of e.split("&")){if(""===a)continue;let[e,s]=r(t.decode?a.replace(/\+/g," "):a,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:l(s,t),n(l(e,t),s,i)}for(let e of Object.keys(i)){let n=i[e];if("object"==typeof n&&null!==n)for(let e of Object.keys(n))n[e]=f(n[e],t);else i[e]=f(n,t)}return!1===t.sort?i:(!0===t.sort?Object.keys(i).sort():Object.keys(i).sort(t.sort)).reduce(((e,t)=>{let n=i[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=u(n):e[t]=n,e}),Object.create(null))}e.extract=d,e.parse=p,e.stringify=(e,t)=>{if(!e)return"";s((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let n=n=>t.skipNull&&(e=>null==e)(e[n])||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{let i=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[o(t,e),"[",i,"]"].join("")]:[...n,[o(t,e),"[",o(i,e),"]=",o(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[o(t,e),"[]"].join("")]:[...n,[o(t,e),"[]=",o(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{let t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[o(n,e),t,o(i,e)].join("")]:[[r,o(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,o(t,e)]:[...n,[o(t,e),"=",o(r,e)].join("")]}}(t),i={};for(let t of Object.keys(e))n(t)||(i[t]=e[t]);let a=Object.keys(i);return!1!==t.sort&&a.sort(t.sort),a.map((n=>{let i=e[n];return void 0===i?"":null===i?o(n,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?o(n,t)+"[]":i.reduce(r(n),[]).join("&"):o(n,t)+"="+o(i,t)})).filter((e=>e.length>0)).join("&")},e.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);let[n,i]=r(e,"#");return Object.assign({url:n.split("?")[0]||"",query:p(d(e),t)},t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:l(i,t)}:{})},e.stringifyUrl=(t,n)=>{n=Object.assign({encode:!0,strict:!0,[a]:!0},n);let r=c(t.url).split("?")[0]||"",i=e.extract(t.url),s=e.parse(i,{sort:!1}),l=Object.assign(s,t.query),u=e.stringify(l,n);u&&(u=`?${u}`);let h=function(e){let t="",n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(t.url);return t.fragmentIdentifier&&(h=`#${n[a]?o(t.fragmentIdentifier,n):t.fragmentIdentifier}`),`${r}${u}${h}`},e.pick=(t,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[a]:!1},r);let{url:s,query:o,fragmentIdentifier:l}=e.parseUrl(t,r);return e.stringifyUrl({url:s,query:i(o,n),fragmentIdentifier:l},r)},e.exclude=(t,n,r)=>{let i=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return e.pick(t,i,r)}})),xu={};function ci(e,t){return!t&&"function"==typeof e&&(t=e,e={}),this.ondata=t,e}function cu(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[$t],(function(e){return ct(va(e.data[0],e.data[1]))}),0,n)}function va(e,t){return vt(e,t||{},0,0)}function pi(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[Vt],(function(e){return ct(Yt(e.data[0],ii(e.data[1])))}),1,n)}function Yt(e,t){return ga(e,t)}function wh(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[$t,nu,function(){return[Qr]}],(function(e){return ct(Qr(e.data[0],e.data[1]))}),2,n)}function Qr(e,t){t||(t={});var n=Ut(),r=e.length;n.p(e);var i=vt(e,t,ui(t),8),a=i.length;return oi(i,t),H(i,a-8,n.d()),H(i,a-4,r),i}function pu(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[Vt,ru,function(){return[Un]}],(function(e){return ct(Un(e.data[0]))}),3,n)}function Un(e,t){return ga(e.subarray(si(e),-8),t||new U(su(e)))}function _h(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[$t,iu,function(){return[ti]}],(function(e){return ct(ti(e.data[0],e.data[1]))}),4,n)}function ti(e,t){t||(t={});var n=ri();n.p(e);var r=vt(e,t,2,4);return li(r,t),H(r,r.length-4,n.d()),r}function mu(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[Vt,ou,function(){return[$n]}],(function(e){return ct($n(e.data[0],ii(e.data[1])))}),5,n)}function $n(e,t){return ga((uu(e),e.subarray(2,-4)),t)}function Th(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),31==e[0]&&139==e[1]&&8==e[2]?pu(e,t,n):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?pi(e,t,n):mu(e,t,n)}function Ih(e,t){return 31==e[0]&&139==e[1]&&8==e[2]?Un(e,t):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?Yt(e,t):$n(e,t)}function lt(e,t){if(t){for(var n=new U(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(Us)return Us.encode(e);var i=e.length,a=new U(e.length+(e.length>>1)),s=0,o=function(e){a[s++]=e};for(r=0;r<i;++r){if(s+5>a.length){var l=new U(s+8+(i-r<<1));l.set(a),a=l}var u=e.charCodeAt(r);u<128||t?o(u):u<2048?(o(192|u>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++r))>>18),o(128|u>>12&63),o(128|u>>6&63),o(128|63&u)):(o(224|u>>12),o(128|u>>6&63),o(128|63&u))}return ze(a,0,s)}function mi(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(ai)return ai.decode(e);var i=yu(e),a=i[0];return i[1].length&&E(8),a}function Sh(e,t,n){n||(n=t,t={}),"function"!=typeof n&&E(7);var r={};hi(e,"",r,t);var i=Object.keys(r),a=i.length,s=0,o=0,l=a,u=new Array(a),h=[],c=function(){for(var e=0;e<h.length;++e)h[e]()},d=function(e,t){Wn((function(){n(e,t)}))};Wn((function(){d=n}));var f=function(){var e=new U(o+22),t=s,n=o-s;o=0;for(var r=0;r<l;++r){var i=u[r];try{var a=i.c.length;Rt(e,o,i,i.f,i.u,a);var h=30+i.f.length+ut(i.extra),c=o+h;e.set(i.c,c),Rt(e,s,i,i.f,i.u,a,o,i.m),s+=16+h+(i.m?i.m.length:0),o=c+a}catch(e){return d(e,null)}}fi(e,s,u.length,n,t),d(null,e)};a||f();for(var p=function(e){var t=i[e],n=r[t],l=n[0],p=n[1],g=Ut(),y=l.length;g.p(l);var m=lt(t),v=m.length,_=p.comment,w=_&<(_),M=w&&w.length,b=ut(p.extra),x=0==p.level?0:8,O=function(n,r){if(n)c(),d(n,null);else{var i=r.length;u[e]=ya(p,{size:y,crc:g.d(),c:r,f:m,m:w,u:v!=t.length||w&&_.length!=M,compression:x}),s+=30+v+b+i,o+=76+2*(v+b)+(M||0)+i,--a||f()}};if(v>65535&&O(E(11,0,1),null),x)if(y<16e4)try{O(null,va(l,p))}catch(e){O(e,null)}else h.push(cu(l,p,O));else O(null,l)},g=0;g<l;++g)p(g);return c}function Ph(e,t){t||(t={});var n={},r=[];hi(e,"",n,t);var i=0,a=0;for(var s in n){var o=n[s],l=o[0],u=o[1],h=0==u.level?0:8,c=(x=lt(s)).length,d=u.comment,f=d&<(d),p=f&&f.length,g=ut(u.extra);c>65535&&E(11);var y=h?va(l,u):l,m=y.length,v=Ut();v.p(l),r.push(ya(u,{size:l.length,crc:v.d(),c:y,f:x,m:f,u:c!=s.length||f&&d.length!=p,o:i,compression:h})),i+=30+c+g+m,a+=76+2*(c+g)+(p||0)+m}for(var _=new U(a+22),w=i,M=a-i,b=0;b<r.length;++b){var x=r[b];Rt(_,x.o,x,x.f,x.u,x.c.length);var O=30+x.f.length+ut(x.extra);_.set(x.c,x.o+O),Rt(_,i,x,x.f,x.u,x.c.length,x.o,x.m),i+=16+O+(x.m?x.m.length:0)}return fi(_,i,r.length,M,w),_}function Ch(e,t,n){n||(n=t,t={}),"function"!=typeof n&&E(7);var r=[],i=function(){for(var e=0;e<r.length;++e)r[e]()},a={},s=function(e,t){Wn((function(){n(e,t)}))};Wn((function(){s=n}));for(var o=e.length-22;101010256!=Q(e,o);--o)if(!o||e.length-o>65558)return s(E(13,0,1),null),i;var l=me(e,o+8);if(l){var u=l,h=Q(e,o+16),c=4294967295==h;if(c){if(o=Q(e,o-12),101075792!=Q(e,o))return s(E(13,0,1),null),i;u=l=Q(e,o+32),h=Q(e,o+48)}for(var d=t&&t.filter,f=function(t){var n=bu(e,h,c),o=n[0],u=n[1],f=n[2],p=n[3],g=n[4],y=n[5],m=ku(e,y);h=g;var v=function(e,t){e?(i(),s(e,null)):(t&&(a[p]=t),--l||s(null,a))};if(!d||d({name:p,size:u,originalSize:f,compression:o}))if(o)if(8==o){var _=e.subarray(m,m+u);if(u<32e4)try{v(null,Yt(_,new U(f)))}catch(e){v(e,null)}else r.push(pi(_,{size:f},v))}else v(E(14,"unknown compression type "+o,1),null);else v(null,ze(e,m,m+u));else v(null,null)},p=0;p<u;++p)f()}else s(null,{});return i}function Rh(e,t){for(var n={},r=e.length-22;101010256!=Q(e,r);--r)(!r||e.length-r>65558)&&E(13);var i=me(e,r+8);if(!i)return{};var a=Q(e,r+16),s=4294967295==a;s&&(r=Q(e,r-12),101075792!=Q(e,r)&&E(13),i=Q(e,r+32),a=Q(e,r+48));for(var o=t&&t.filter,l=0;l<i;++l){var u=bu(e,a,s),h=u[0],c=u[1],d=u[2],f=u[3],p=u[4],g=u[5],y=ku(e,g);a=p,(!o||o({name:f,size:c,originalSize:d,compression:h}))&&(h?8==h?n[f]=Yt(e.subarray(y,y+c),new U(d)):E(14,"unknown compression type "+h):n[f]=ze(e,y,y+c))}return n}Pu(xu,{AsyncCompress:()=>Mh,AsyncDecompress:()=>jh,AsyncDeflate:()=>lu,AsyncGunzip:()=>du,AsyncGzip:()=>Mh,AsyncInflate:()=>di,AsyncUnzipInflate:()=>Dh,AsyncUnzlib:()=>hu,AsyncZipDeflate:()=>Nh,AsyncZlib:()=>xh,Compress:()=>Zr,DecodeUTF8:()=>Oh,Decompress:()=>fu,Deflate:()=>qe,EncodeUTF8:()=>zh,FlateErrorCode:()=>kh,Gunzip:()=>Gn,Gzip:()=>Zr,Inflate:()=>be,Unzip:()=>Lh,UnzipInflate:()=>Fh,UnzipPassThrough:()=>wu,Unzlib:()=>Vn,Zip:()=>Eh,ZipDeflate:()=>Ah,ZipPassThrough:()=>ma,Zlib:()=>ei,compress:()=>wh,compressSync:()=>Qr,decompress:()=>Th,decompressSync:()=>Ih,deflate:()=>cu,deflateSync:()=>va,gunzip:()=>pu,gunzipSync:()=>Un,gzip:()=>wh,gzipSync:()=>Qr,inflate:()=>pi,inflateSync:()=>Yt,strFromU8:()=>mi,strToU8:()=>lt,unzip:()=>Ch,unzipSync:()=>Rh,unzlib:()=>mu,unzlibSync:()=>$n,zip:()=>Sh,zipSync:()=>Ph,zlib:()=>_h,zlibSync:()=>ti});var qs,vh,U,de,Bt,qt,Gt,pa,Vs,$s,ni,Rn,Ws,Hs,Xr,ha,Ye,Oe,Je,Ct,W,Ys,Xs,Js,Ks,Dn,Ie,Ln,fa,ze,kh,Zs,E,ga,Be,Dt,Cn,Bn,Jr,Lt,qn,Kr,Qs,Xe,eu,tu,Ut,ri,vt,ya,Gs,Fn,bh,au,Vt,$t,nu,ru,iu,ou,ct,ii,Wt,Ae,Ht,me,Q,Yr,H,oi,si,su,ui,li,uu,qe,lu,be,di,Zr,Mh,Gn,du,ei,xh,Vn,hu,fu,jh,hi,Us,ai,gu,yu,Oh,zh,vu,ku,bu,Mu,ut,Rt,fi,ma,Ah,Nh,Eh,wu,Fh,Dh,Lh,Wn,_u=Mi((()=>{for(h(),qs={},vh=function(e,t,n,r,i){var a=new Worker(qs[t]||(qs[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(e){var t=e.data,n=t.$e$;if(n){var r=new Error(n[0]);r.code=n[1],r.stack=n[2],i(r,null)}else i(null,t)},a.postMessage(n,r),a},U=Uint8Array,de=Uint16Array,Bt=Uint32Array,qt=new U([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 U([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]),pa=new U([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$s=(Vs=function(e,t){for(var n=new de(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new Bt(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]})(qt,2),ni=$s[0],Rn=$s[1],ni[28]=258,Rn[258]=28,Ws=Vs(Gt,0),Hs=Ws[0],Xr=Ws[1],ha=new de(32768),W=0;W<32768;++W)Ye=(61680&(Ye=(52428&(Ye=(43690&W)>>>1|(21845&W)<<1))>>>2|(13107&Ye)<<2))>>>4|(3855&Ye)<<4,ha[W]=((65280&Ye)>>>8|(255&Ye)<<8)>>>1;for(Oe=function(e,t,n){for(var r=e.length,i=0,a=new de(t);i<r;++i)e[i]&&++a[e[i]-1];var s,o=new de(t);for(i=0;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;if(n){s=new de(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],h=t-e[i],c=o[e[i]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)s[ha[c]>>>l]=u}else for(s=new de(r),i=0;i<r;++i)e[i]&&(s[i]=ha[o[e[i]-1]++]>>>15-e[i]);return s},Je=new U(288),W=0;W<144;++W)Je[W]=8;for(W=144;W<256;++W)Je[W]=9;for(W=256;W<280;++W)Je[W]=7;for(W=280;W<288;++W)Je[W]=8;for(Ct=new U(32),W=0;W<32;++W)Ct[W]=5;Ys=Oe(Je,9,0),Xs=Oe(Je,9,1),Js=Oe(Ct,5,0),Ks=Oe(Ct,5,1),Dn=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Ie=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},Ln=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},fa=function(e){return(e+7)/8|0},ze=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(2==e.BYTES_PER_ELEMENT?de:4==e.BYTES_PER_ELEMENT?Bt:U)(n-t);return r.set(e.subarray(t,n)),r},kh={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},Zs=["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"],E=function(e,t,n){var r=new Error(t||Zs[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,E),!n)throw r;return r},ga=function(e,t,n){var r=e.length;if(!r||n&&n.f&&!n.l)return t||new U(0);var i=!t||n,a=!n||n.i;n||(n={}),t||(t=new U(3*r));var s=function(e){var n=t.length;if(e>n){var r=new U(Math.max(2*n,e));r.set(t),t=r}},o=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){o=Ie(e,l,1);var g=Ie(e,l+1,3);if(l+=3,!g){var y=e[(I=fa(l)+4)-4]|e[I-3]<<8,m=I+y;if(m>r){a&&E(0);break}i&&s(u+y),t.set(e.subarray(I,m),u),n.b=u+=y,n.p=l=8*m,n.f=o;continue}if(1==g)h=Xs,c=Ks,d=9,f=5;else if(2==g){var v=Ie(e,l,31)+257,_=Ie(e,l+10,15)+4,w=v+Ie(e,l+5,31)+1;l+=14;for(var M=new U(w),b=new U(19),x=0;x<_;++x)b[pa[x]]=Ie(e,l+3*x,7);l+=3*_;var O=Dn(b),N=(1<<O)-1,A=Oe(b,O,1);for(x=0;x<w;){var I,k=A[Ie(e,l,N)];if(l+=15&k,(I=k>>>4)<16)M[x++]=I;else{var T=0,S=0;for(16==I?(S=3+Ie(e,l,3),l+=2,T=M[x-1]):17==I?(S=3+Ie(e,l,7),l+=3):18==I&&(S=11+Ie(e,l,127),l+=7);S--;)M[x++]=T}}var F=M.subarray(0,v),D=M.subarray(v);d=Dn(F),f=Dn(D),h=Oe(F,d,1),c=Oe(D,f,1)}else E(1);if(l>p){a&&E(0);break}}i&&s(u+131072);for(var P=(1<<d)-1,j=(1<<f)-1,B=l;;B=l){var C=(T=h[Ln(e,l)&P])>>>4;if((l+=15&T)>p){a&&E(0);break}if(T||E(2),C<256)t[u++]=C;else{if(256==C){B=l,h=null;break}var L=C-254;if(C>264){var z=qt[x=C-257];L=Ie(e,l,(1<<z)-1)+ni[x],l+=z}var R=c[Ln(e,l)&j],$=R>>>4;R||E(3),l+=15&R;D=Hs[$];if($>3){z=Gt[$];D+=Ln(e,l)&(1<<z)-1,l+=z}if(l>p){a&&E(0);break}i&&s(u+131072);for(var G=u+L;u<G;u+=4)t[u]=t[u-D],t[u+1]=t[u+1-D],t[u+2]=t[u+2-D],t[u+3]=t[u+3-D];u=G}}n.l=h,n.p=B,n.b=u,n.f=o,h&&(o=1,n.m=d,n.d=c,n.n=f)}while(!o);return u==t.length?t:ze(t,0,u)},Be=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},Dt=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Cn=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[Xe,0];if(1==i){var s=new U(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var o=n[0],l=n[1],u=0,h=1,c=2;for(n[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=i-1;)o=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:o.f+l.f,l:o,r:l};var d=a[0].s;for(r=1;r<i;++r)a[r].s>d&&(d=a[r].s);var f=new de(d+1),p=Bn(n[h-1],f,0);if(p>t){r=0;var g=0,y=p-t,m=1<<y;for(a.sort((function(e,t){return f[t.s]-f[e.s]||e.f-t.f}));r<i;++r){var v=a[r].s;if(!(f[v]>t))break;g+=m-(1<<p-f[v]),f[v]=t}for(g>>>=y;g>0;){var _=a[r].s;f[_]<t?g-=1<<t-f[_]++-1:++r}for(;r>=0&&g;--r){var w=a[r].s;f[w]==t&&(--f[w],++g)}p=t}return[new U(f),p]},Bn=function(e,t,n){return-1==e.s?Math.max(Bn(e.l,t,n+1),Bn(e.r,t,n+1)):t[e.s]=n},Jr=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new de(++t),r=0,i=e[0],a=1,s=function(e){n[r++]=e},o=1;o<=t;++o)if(e[o]==i&&o!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)s(32754);a>2&&(s(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(s(i),--a;a>6;a-=6)s(8304);a>2&&(s(a-3<<5|8208),a=0)}for(;a--;)s(i);a=1,i=e[o]}return[n.subarray(0,r),t]},Lt=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},qn=function(e,t,n){var r=n.length,i=fa(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;a<r;++a)e[i+a+4]=n[a];return 8*(i+4+r)},Kr=function(e,t,n,r,i,a,s,o,l,u,h){Be(t,h++,n),++i[256];for(var c=Cn(i,15),d=c[0],f=c[1],p=Cn(a,15),g=p[0],y=p[1],m=Jr(d),v=m[0],_=m[1],w=Jr(g),M=w[0],b=w[1],x=new de(19),O=0;O<v.length;++O)x[31&v[O]]++;for(O=0;O<M.length;++O)x[31&M[O]]++;for(var E=Cn(x,7),N=E[0],A=E[1],I=19;I>4&&!N[pa[I-1]];--I);var k,T,S,F,D=u+5<<3,P=Lt(i,Je)+Lt(a,Ct)+s,j=Lt(i,d)+Lt(a,g)+s+14+3*I+Lt(x,N)+(2*x[16]+3*x[17]+7*x[18]);if(D<=P&&D<=j)return qn(t,h,e.subarray(l,l+u));if(Be(t,h,1+(j<P)),h+=2,j<P){k=Oe(d,f,0),T=d,S=Oe(g,y,0),F=g;var B=Oe(N,A,0);Be(t,h,_-257),Be(t,h+5,b-1),Be(t,h+10,I-4),h+=14;for(O=0;O<I;++O)Be(t,h+3*O,N[pa[O]]);h+=3*I;for(var C=[v,M],L=0;L<2;++L){var z=C[L];for(O=0;O<z.length;++O){var R=31&z[O];Be(t,h,B[R]),h+=N[R],R>15&&(Be(t,h,z[O]>>>5&127),h+=z[O]>>>12)}}}else k=Ys,T=Je,S=Js,F=Ct;for(O=0;O<o;++O)if(r[O]>255){R=r[O]>>>18&31;Dt(t,h,k[R+257]),h+=T[R+257],R>7&&(Be(t,h,r[O]>>>23&31),h+=qt[R]);var U=31&r[O];Dt(t,h,S[U]),h+=F[U],U>3&&(Dt(t,h,r[O]>>>5&8191),h+=Gt[U])}else Dt(t,h,k[r[O]]),h+=T[r[O]];return Dt(t,h,k[256]),h+T[256]},Qs=new Bt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Xe=new U(0),eu=function(e,t,n,r,i,a){var s=e.length,o=new U(r+s+5*(1+Math.ceil(s/7e3))+i),l=o.subarray(r,o.length-i),u=0;if(!t||s<8)for(var h=0;h<=s;h+=65535){var c=h+65535;c>=s&&(l[u>>3]=a),u=qn(l,u+1,e.subarray(h,c))}else{for(var d=Qs[t-1],f=d>>>13,p=8191&d,g=(1<<n)-1,y=new de(32768),m=new de(g+1),v=Math.ceil(n/3),_=2*v,w=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<_)&g},M=new Bt(25e3),b=new de(288),x=new de(32),O=0,E=0,N=(h=0,0),A=0,I=0;h<s;++h){var k=w(h),T=32767&h,S=m[k];if(y[T]=S,m[k]=T,A<=h){var F=s-h;if((O>7e3||N>24576)&&F>423){u=Kr(e,l,0,M,b,x,E,N,I,h-I,u),N=O=E=0,I=h;for(var D=0;D<286;++D)b[D]=0;for(D=0;D<30;++D)x[D]=0}var P=2,j=0,B=p,C=T-S&32767;if(F>2&&k==w(h-C))for(var L=Math.min(f,F)-1,z=Math.min(32767,h),R=Math.min(258,F);C<=z&&--B&&T!=S;){if(e[h+P]==e[h+P-C]){for(var $=0;$<R&&e[h+$]==e[h+$-C];++$);if($>P){if(P=$,j=C,$>L)break;var G=Math.min(C,$-2),W=0;for(D=0;D<G;++D){var H=h-C+D+32768&32767,q=H-y[H]+32768&32767;q>W&&(W=q,S=H)}}}C+=(T=S)-(S=y[T])+32768&32767}if(j){M[N++]=268435456|Rn[P]<<18|Xr[j];var J=31&Rn[P],Y=31&Xr[j];E+=qt[J]+Gt[Y],++b[257+J],++x[Y],A=h+P,++O}else M[N++]=e[h],++b[e[h]]}}u=Kr(e,l,a,M,b,x,E,N,I,h-I,u),!a&&7&u&&(u=qn(l,u+1,Xe))}return ze(o,0,r+fa(u)+i)},tu=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&-306674912)^n>>>1;e[t]=n}return e}(),Ut=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=tu[255&n^t[r]]^n>>>8;e=n},d:function(){return~e}}},ri=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,a=0|n.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=r+=n[s];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}e=r,t=i},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}},vt=function(e,t,n,r,i){return eu(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},ya=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},Gs=function(e,t,n){for(var r=e(),i=e.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<r.length;++s){var o=r[s],l=a[s];if("function"==typeof o){t+=";"+l+"=";var u=o.toString();if(o.prototype)if(-1!=u.indexOf("[native code]")){var h=u.indexOf(" ",8)+1;t+=u.slice(h,u.indexOf("(",h))}else for(var c in t+=u,o.prototype)t+=";"+l+".prototype."+c+"="+o.prototype[c].toString();else t+=u}else n[l]=o}return[t,n]},Fn=[],bh=function(e){var t=[];for(var n in e)e[n].buffer&&t.push((e[n]=new e[n].constructor(e[n])).buffer);return t},au=function(e,t,n,r){var i;if(!Fn[n]){for(var a="",s={},o=e.length-1,l=0;l<o;++l)a=(i=Gs(e[l],a,s))[0],s=i[1];Fn[n]=Gs(e[o],a,s)}var u=ya({},Fn[n][1]);return vh(Fn[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",n,u,bh(u),r)},Vt=function(){return[U,de,Bt,qt,Gt,pa,ni,Hs,Xs,Ks,ha,Zs,Oe,Dn,Ie,Ln,fa,ze,E,ga,Yt,ct,ii]},$t=function(){return[U,de,Bt,qt,Gt,pa,Rn,Xr,Ys,Je,Js,Ct,ha,Qs,Xe,Oe,Be,Dt,Cn,Bn,Jr,Lt,qn,Kr,fa,ze,eu,vt,va,ct]},nu=function(){return[oi,ui,H,Ut,tu]},ru=function(){return[si,su]},iu=function(){return[li,H,ri]},ou=function(){return[uu]},ct=function(e){return postMessage(e,[e.buffer])},ii=function(e){return e&&e.size&&new U(e.size)},Wt=function(e,t,n,r,i,a){var s=au(n,r,i,(function(e,t){s.terminate(),a(e,t)}));return s.postMessage([e,t],t.consume?[e.buffer]:[]),function(){s.terminate()}},Ae=function(e){return e.ondata=function(e,t){return postMessage([e,t],[e.buffer])},function(t){return e.push(t.data[0],t.data[1])}},Ht=function(e,t,n,r,i){var a,s=au(e,r,i,(function(e,n){e?(s.terminate(),t.ondata.call(t,e)):(n[1]&&s.terminate(),t.ondata.call(t,e,n[0],n[1]))}));s.postMessage(n),t.push=function(e,n){t.ondata||E(5),a&&t.ondata(E(4,0,1),null,!!n),s.postMessage([e,a=n],[e.buffer])},t.terminate=function(){s.terminate()}},me=function(e,t){return e[t]|e[t+1]<<8},Q=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},Yr=function(e,t){return Q(e,t)+4294967296*Q(e,t+4)},H=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},oi=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&H(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},si=function(e){(31!=e[0]||139!=e[1]||8!=e[2])&&E(6,"invalid gzip data");var t=e[3],n=10;4&t&&(n+=e[10]|2+(e[11]<<8));for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(2&t)},su=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},ui=function(e){return 10+(e.filename&&e.filename.length+1||0)},li=function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)},uu=function(e){(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)&&E(6,"invalid zlib data"),32&e[1]&&E(6,"invalid zlib data: preset dictionaries not supported")},qe=function(){function e(e,t){!t&&"function"==typeof e&&(t=e,e={}),this.ondata=t,this.o=e||{}}return e.prototype.p=function(e,t){this.ondata(vt(e,this.o,0,0,!t),t)},e.prototype.push=function(e,t){this.ondata||E(5),this.d&&E(4),this.d=t,this.p(e,t||!1)},e}(),lu=function(e,t){Ht([$t,function(){return[Ae,qe]}],this,ci.call(this,e,t),(function(e){var t=new qe(e.data);onmessage=Ae(t)}),6)},be=function(){function e(e){this.s={},this.p=new U(0),this.ondata=e}return e.prototype.e=function(e){this.ondata||E(5),this.d&&E(4);var t=this.p.length,n=new U(t+e.length);n.set(this.p),n.set(e,t),this.p=n},e.prototype.c=function(e){this.d=this.s.i=e||!1;var t=this.s.b,n=ga(this.p,this.o,this.s);this.ondata(ze(n,t,this.s.b),this.d),this.o=ze(n,this.s.b-32768),this.s.b=this.o.length,this.p=ze(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),di=function(e){this.ondata=e,Ht([Vt,function(){return[Ae,be]}],this,0,(function(){var e=new be;onmessage=Ae(e)}),7)},Zr=function(){function e(e,t){this.c=Ut(),this.l=0,this.v=1,qe.call(this,e,t)}return e.prototype.push=function(e,t){qe.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e),this.l+=e.length;var n=vt(e,this.o,this.v&&ui(this.o),t&&8,!t);this.v&&(oi(n,this.o),this.v=0),t&&(H(n,n.length-8,this.c.d()),H(n,n.length-4,this.l)),this.ondata(n,t)},e}(),Mh=function(e,t){Ht([$t,nu,function(){return[Ae,qe,Zr]}],this,ci.call(this,e,t),(function(e){var t=new Zr(e.data);onmessage=Ae(t)}),8)},Gn=function(){function e(e){this.v=1,be.call(this,e)}return e.prototype.push=function(e,t){if(be.prototype.e.call(this,e),this.v){var n=this.p.length>3?si(this.p):4;if(n>=this.p.length&&!t)return;this.p=this.p.subarray(n),this.v=0}t&&(this.p.length<8&&E(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),be.prototype.c.call(this,t)},e}(),du=function(e){this.ondata=e,Ht([Vt,ru,function(){return[Ae,be,Gn]}],this,0,(function(){var e=new Gn;onmessage=Ae(e)}),9)},ei=function(){function e(e,t){this.c=ri(),this.v=1,qe.call(this,e,t)}return e.prototype.push=function(e,t){qe.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e);var n=vt(e,this.o,this.v&&2,t&&4,!t);this.v&&(li(n,this.o),this.v=0),t&&H(n,n.length-4,this.c.d()),this.ondata(n,t)},e}(),xh=function(e,t){Ht([$t,iu,function(){return[Ae,qe,ei]}],this,ci.call(this,e,t),(function(e){var t=new ei(e.data);onmessage=Ae(t)}),10)},Vn=function(){function e(e){this.v=1,be.call(this,e)}return e.prototype.push=function(e,t){if(be.prototype.e.call(this,e),this.v){if(this.p.length<2&&!t)return;this.p=this.p.subarray(2),this.v=0}t&&(this.p.length<4&&E(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),be.prototype.c.call(this,t)},e}(),hu=function(e){this.ondata=e,Ht([Vt,ou,function(){return[Ae,be,Vn]}],this,0,(function(){var e=new Vn;onmessage=Ae(e)}),11)},fu=function(){function e(e){this.G=Gn,this.I=be,this.Z=Vn,this.ondata=e}return e.prototype.push=function(e,t){if(this.ondata||E(5),this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var n=new U(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length)}else this.p=e;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,t),this.p=null}}},e}(),jh=function(){function e(e){this.G=du,this.I=di,this.Z=hu,this.ondata=e}return e.prototype.push=function(e,t){fu.prototype.push.call(this,e,t)},e}(),hi=function(e,t,n,r){for(var i in e){var a=e[i],s=t+i,o=r;Array.isArray(a)&&(o=ya(r,a[1]),a=a[0]),a instanceof U?n[s]=[a,o]:(n[s+="/"]=[new U(0),o],hi(a,s,n,r))}},Us=typeof TextEncoder<"u"&&new TextEncoder,ai=typeof TextDecoder<"u"&&new TextDecoder,gu=0;try{ai.decode(Xe,{stream:!0}),gu=1}catch{}yu=function(e){for(var t="",n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return[t,ze(e,n-1)];i?3==i?(r=((15&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,t+=String.fromCharCode(55296|r>>10,56320|1023&r)):t+=1&i?String.fromCharCode((31&r)<<6|63&e[n++]):String.fromCharCode((15&r)<<12|(63&e[n++])<<6|63&e[n++]):t+=String.fromCharCode(r)}},Oh=function(){function e(e){this.ondata=e,gu?this.t=new TextDecoder:this.p=Xe}return e.prototype.push=function(e,t){if(this.ondata||E(5),t=!!t,this.t)return this.ondata(this.t.decode(e,{stream:!0}),t),void(t&&(this.t.decode().length&&E(8),this.t=null));this.p||E(4);var n=new U(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length);var r=yu(n),i=r[0],a=r[1];t?(a.length&&E(8),this.p=null):this.p=a,this.ondata(i,t)},e}(),zh=function(){function e(e){this.ondata=e}return e.prototype.push=function(e,t){this.ondata||E(5),this.d&&E(4),this.ondata(lt(e),this.d=t||!1)},e}(),vu=function(e){return 1==e?3:e<6?2:9==e?1:0},ku=function(e,t){return t+30+me(e,t+26)+me(e,t+28)},bu=function(e,t,n){var r=me(e,t+28),i=mi(e.subarray(t+46,t+46+r),!(2048&me(e,t+8))),a=t+46+r,s=Q(e,t+20),o=n&&4294967295==s?Mu(e,a):[s,Q(e,t+24),Q(e,t+42)],l=o[0],u=o[1],h=o[2];return[me(e,t+10),l,u,i,a+me(e,t+30)+me(e,t+32),h]},Mu=function(e,t){for(;1!=me(e,t);t+=4+me(e,t+2));return[Yr(e,t+12),Yr(e,t+4),Yr(e,t+20)]},ut=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&E(9),t+=r+4}return t},Rt=function(e,t,n,r,i,a,s,o){var l=r.length,u=n.extra,h=o&&o.length,c=ut(u);H(e,t,null!=s?33639248:67324752),t+=4,null!=s&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(null==a&&8),e[t++]=i&&8,e[t++]=255&n.compression,e[t++]=n.compression>>8;var d=new Date(null==n.mtime?Date.now():n.mtime),f=d.getFullYear()-1980;if((f<0||f>119)&&E(10),H(e,t,f<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>>1),t+=4,null!=a&&(H(e,t,n.crc),H(e,t+4,a),H(e,t+8,n.size)),H(e,t+12,l),H(e,t+14,c),t+=16,null!=s&&(H(e,t,h),H(e,t+6,n.attrs),H(e,t+10,s),t+=14),e.set(r,t),t+=l,c)for(var p in u){var g=u[p],y=g.length;H(e,t,+p),H(e,t+2,y),e.set(g,t+4),t+=4+y}return h&&(e.set(o,t),t+=h),t},fi=function(e,t,n,r,i){H(e,t,101010256),H(e,t+8,n),H(e,t+10,n),H(e,t+12,r),H(e,t+16,i)},ma=function(){function e(e){this.filename=e,this.c=Ut(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){this.ondata||E(5),this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}(),Ah=function(){function e(e,t){var n=this;t||(t={}),ma.call(this,e),this.d=new qe(t,(function(e,t){n.ondata(null,e,t)})),this.compression=8,this.flag=vu(t.level)}return e.prototype.process=function(e,t){try{this.d.push(e,t)}catch(e){this.ondata(e,null,t)}},e.prototype.push=function(e,t){ma.prototype.push.call(this,e,t)},e}(),Nh=function(){function e(e,t){var n=this;t||(t={}),ma.call(this,e),this.d=new lu(t,(function(e,t,r){n.ondata(e,t,r)})),this.compression=8,this.flag=vu(t.level),this.terminate=this.d.terminate}return e.prototype.process=function(e,t){this.d.push(e,t)},e.prototype.push=function(e,t){ma.prototype.push.call(this,e,t)},e}(),Eh=function(){function e(e){this.ondata=e,this.u=[],this.d=1}return e.prototype.add=function(e){var t=this;if(this.ondata||E(5),2&this.d)this.ondata(E(4+8*(1&this.d),0,1),null,!1);else{var n=lt(e.filename),r=n.length,i=e.comment,a=i&<(i),s=r!=e.filename.length||a&&i.length!=a.length,o=r+ut(e.extra)+30;r>65535&&this.ondata(E(11,0,1),null,!1);var l=new U(o);Rt(l,0,e,n,s);var u=[l],h=function(){for(var e=0,n=u;e<n.length;e++){var r=n[e];t.ondata(null,r,!1)}u=[]},c=this.d;this.d=0;var d=this.u.length,f=ya(e,{f:n,u:s,o:a,t:function(){e.terminate&&e.terminate()},r:function(){if(h(),c){var e=t.u[d+1];e?e.r():t.d=1}c=1}}),p=0;e.ondata=function(n,r,i){if(n)t.ondata(n,r,i),t.terminate();else if(p+=r.length,u.push(r),i){var a=new U(16);H(a,0,134695760),H(a,4,e.crc),H(a,8,p),H(a,12,e.size),u.push(a),f.c=p,f.b=o+p+16,f.crc=e.crc,f.size=e.size,c&&f.r(),c=1}else c&&h()},this.u.push(f)}},e.prototype.end=function(){var e=this;2&this.d?this.ondata(E(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&e.d&&(e.u.splice(-1,1),e.e())},t:function(){}}),this.d=3)},e.prototype.e=function(){for(var e=0,t=0,n=0,r=0,i=this.u;r<i.length;r++){n+=46+(l=i[r]).f.length+ut(l.extra)+(l.o?l.o.length:0)}for(var a=new U(n+22),s=0,o=this.u;s<o.length;s++){var l=o[s];Rt(a,e,l,l.f,l.u,l.c,t,l.o),e+=46+l.f.length+ut(l.extra)+(l.o?l.o.length:0),t+=l.b}fi(a,e,this.u.length,n,t),this.ondata(null,a,!0),this.d=2},e.prototype.terminate=function(){for(var e=0,t=this.u;e<t.length;e++){t[e].t()}this.d=2},e}(),wu=function(){function e(){}return e.prototype.push=function(e,t){this.ondata(null,e,t)},e.compression=0,e}(),Fh=function(){function e(){var e=this;this.i=new be((function(t,n){e.ondata(null,t,n)}))}return e.prototype.push=function(e,t){try{this.i.push(e,t)}catch(e){this.ondata(e,null,t)}},e.compression=8,e}(),Dh=function(){function e(e,t){var n=this;t<32e4?this.i=new be((function(e,t){n.ondata(null,e,t)})):(this.i=new di((function(e,t,r){n.ondata(e,t,r)})),this.terminate=this.i.terminate)}return e.prototype.push=function(e,t){this.i.terminate&&(e=ze(e,0)),this.i.push(e,t)},e.compression=8,e}(),Lh=function(){function e(e){this.onfile=e,this.k=[],this.o={0:wu},this.p=Xe}return e.prototype.push=function(e,t){var n=this;if(this.onfile||E(5),this.p||E(4),this.c>0){var r=Math.min(this.c,e.length),i=e.subarray(0,r);if(this.c-=r,this.d?this.d.push(i,!this.c):this.k[0].push(i),(e=e.subarray(r)).length)return this.push(e,t)}else{var a=0,s=0,o=void 0,l=void 0;this.p.length?e.length?((l=new U(this.p.length+e.length)).set(this.p),l.set(e,this.p.length)):l=this.p:l=e;for(var u=l.length,h=this.c,c=h&&this.d,d=function(){var e,t=Q(l,s);if(67324752==t){a=1,o=s,f.d=null,f.c=0;var r=me(l,s+6),i=me(l,s+8),c=2048&r,d=8&r,p=me(l,s+26),g=me(l,s+28);if(u>s+30+p+g){var y=[];f.k.unshift(y),a=2;var m=Q(l,s+18),v=Q(l,s+22),_=mi(l.subarray(s+30,s+=30+p),!c);4294967295==m?(e=d?[-2]:Mu(l,s),m=e[0],v=e[1]):d&&(m=-1),s+=g,f.c=m;var w,M={name:_,compression:i,start:function(){if(M.ondata||E(5),m){var e=n.o[i];e||M.ondata(E(14,"unknown compression type "+i,1),null,!1),(w=m<0?new e(_):new e(_,m,v)).ondata=function(e,t,n){M.ondata(e,t,n)};for(var t=0,r=y;t<r.length;t++){var a=r[t];w.push(a,!1)}n.k[0]==y&&n.c?n.d=w:w.push(Xe,!0)}else M.ondata(null,Xe,!0)},terminate:function(){w&&w.terminate&&w.terminate()}};m>=0&&(M.size=m,M.originalSize=v),f.onfile(M)}return"break"}if(h){if(134695760==t)return o=s+=12+(-2==h&&8),a=3,f.c=0,"break";if(33639248==t)return o=s-=4,a=3,f.c=0,"break"}},f=this;s<u-4;++s){if("break"===d())break}if(this.p=Xe,h<0){var p=a?l.subarray(0,o-12-(-2==h&&8)-(134695760==Q(l,o-16)&&4)):l.subarray(0,s);c?c.push(p,!!a):this.k[+(2==a)].push(p)}if(2&a)return this.push(l.subarray(s),t);this.p=l.subarray(s)}t&&(this.c&&E(13),this.p=null)},e.prototype.register=function(e){this.o[e.compression]=e},e}(),Wn="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(e){e()}}));h();var Tu=Yn(xi());h(),h(),h();var To=Yn(jo());h();var vr=class{origin;destination;vortex;distance;angle;weight;constructor({origin:e,destination:t,vortex:n,elevationDelta:r=0,distance:i=0,angle:a=0}){let s,o;if(this.origin=e,this.destination=t,this.vortex=n,this.distance=i,this.angle=a,n?(this.distance=0,this.angle=0,s=void 0!==n.weight&&n.weight>0?n.weight:"elevator"===n.type?2e3:1e3,o=n.multiplier&&n.multiplier>=1?n.multiplier:1,this.weight=r*o+s):(s=t.weight&&t.weight>=0?t.weight:0,o=t.multiplier&&t.multiplier>=1?t.multiplier:1,this.weight=this.distance*o+s),isNaN(this.angle))throw new Error("nan angle")}},xn=vr;h();var kr="mi-debug",mp={loggingEnabled:()=>"development"===M.env.NODE_ENV||"dev"===M.env.NODE_ENV||"test"===M.env.NODE_ENV||"true"===globalThis.sessionStorage?.getItem(kr),log(...e){this.loggingEnabled()&&console.log("[MappedInJS]",...e)},warn(...e){this.loggingEnabled()&&console.warn("[MappedInJS]",...e)},error(...e){this.loggingEnabled()&&console.error("[MappedInJS]",...e)},assert(...e){this.loggingEnabled()&&console.assert(...e)},time(e){this.loggingEnabled()&&console.time(e)},timeEnd(e){this.loggingEnabled()&&console.timeEnd(e)}},z=mp;function fp(e){if(e.scale||e.x_scale)return 1/(e.scale||e.x_scale||1);try{if(!e.georeference)throw new Error(`map ${e.name||e.shortName||e.id} does not have a georeference field`);if(e.georeference.length<3)throw new Error(`map ${e.name||e.shortName||e.id} has less than 3 georeference points, we require at least 3 for proper map scaling`);let t=e.georeference[0],n=e.georeference[2],r=(0,To.getDistance)({latitude:t.target.x,longitude:t.target.y},{latitude:n.target.x,longitude:n.target.y}),i=t.control.x-n.control.x,a=t.control.y-n.control.y;return Math.sqrt(i*i+a*a)/r}catch(e){return z.error(e),1}}function gp(e,t){let n=e.x-t.x,r=e.y-t.y;return(Math.atan2(r,n)+2.5*Math.PI)%(2*Math.PI)}var br=class{edges;nodesById;mapsById;constructor({nodes:e,vortexes:t,maps:n,showVortexNames:r=!1}){this.edges={},this.mapsById=n.map((e=>({...e,_scale:fp(e)}))).reduce(((e,t)=>(e[t.id]=t,e)),{});let i=e.filter((e=>!!this.mapsById[e.map])).map((e=>({...e,paths:e.paths?e.paths.filter((({map:t})=>t===e.map)):[]})));this.nodesById=i.reduce(((e,t)=>(e[t.id]=t,e)),{});for(let e in this.nodesById)this.nodesById.hasOwnProperty(e)&&(this.nodesById[e].paths=this.nodesById[e].paths.filter((({node:e})=>!!this.nodesById[e])));let a=t.map((e=>({...e,name:r?e.name:e.type,nodes:e.nodes?e.nodes.filter((e=>!!this.nodesById[e])):[]})));i.forEach((e=>{this.edges[e.id]=e.paths.map((({node:t})=>{let n=this.nodesById[t];return new xn({angle:gp(e,n),destination:n,distance:this.getDistance(e,n),origin:e})}))})),a.forEach((e=>{if(null==e.nodes||0===e.nodes.length)return;let t=0;for(;t<e.nodes.length-1;){let n=this.nodesById[e.nodes[t]];if(t++,null==n)continue;let r=t;for(;r<e.nodes.length;){let t=this.nodesById[e.nodes[r]];if(r++,null==t)continue;let i=this.mapsById[n.map].elevation||0,a=this.mapsById[t.map].elevation||0,s=Math.abs(i-a);this.edges[n.id].push(new xn({destination:t,elevationDelta:s,origin:n,vortex:e})),this.edges[t.id].push(new xn({destination:n,elevationDelta:s,origin:t,vortex:e}))}}}))}aStar(e,t,n){let r=e.map((e=>this.nodesById[e])).filter((e=>e)),i=t.map((e=>this.nodesById[e])).filter((e=>e));if(0===r.length||0===i.length)return[];let a=[],s={},o={};for(r.forEach((e=>{let t=this.getShortestEuclideanDistance(e,i);a.push({origin:e,priority:t}),s[e.id]=null,o[e.id]=0})),a.sort(((e,t)=>e.priority-t.priority));a.length>0;){let e=a[0];if(i.includes(e.origin)){let t=[],n=s[e.origin.id];for(;null!=n;){t.push(n);let e=s[n.origin.id];n=null!=e?e:null}return t.reverse()}for(let t of this.edges[e.origin.id]){let r=t.vortex&&!1===t.vortex.accessible;if(n&&(r||!1===t.origin.accessible||!1===t.destination.accessible))continue;let l=o[e.origin.id]+t.weight;if(null==o[t.destination.id]||l<o[t.destination.id]){o[t.destination.id]=l;let e=l+this.getShortestEuclideanDistance(t.destination,i);a.push({origin:t.destination,priority:e}),s[t.destination.id]=t}}a.splice(0,1),a.sort(((e,t)=>e.priority-t.priority))}return[]}getDistance(e,t){let n,r=e.x-t.x,i=e.y-t.y,a=r*r+i*i;return n=null==this.mapsById[e.map]?1:this.mapsById[e.map]._scale,Math.sqrt(a)/n}getShortestEuclideanDistance(e,t){return t.reduce(((t,n)=>{let r=this.getDistance(e,n);return Math.min(t,r)}),Number.MAX_VALUE)}},Mr=br;function yp(e){switch(e){case"down":case"up":return`${e} `;default:return""}}h(),h();var wr=class{node;instruction;action;atLocation;type;distance=0;constructor({origin:e,action:t,distance:n,atLocation:r,instruction:i}){this.node=e,this.action=t,this.distance=n||0,this.atLocation=r,this.instruction="",i?this.instruction=i:(null!=t&&"Departure"===t.type?this.instruction=null!=r?`Depart from ${r.name}`:"Depart from current location":null!=t&&"Arrival"===t.type?this.instruction=null!=r?`Arrive at ${r.name}`:"Arrive at destination":null!=t&&"TakeVortex"===t.type?this.instruction=`Take ${r&&r.name} ${yp(t.direction)}to ${t.toMap.name}`:null!=t&&"ExitVortex"===t.type?this.instruction=`Exit ${r&&r.name} at ${t.toMap.name}`:null!=t&&"Right"===t.bearing?this.instruction="Turn right":null!=t&&"SlightRight"===t.bearing?this.instruction="Turn slightly right":null!=t&&"Straight"===t.bearing?this.instruction="Head straight":null!=t&&"SlightLeft"===t.bearing?this.instruction="Turn slightly left":null!=t&&"Left"===t.bearing&&(this.instruction="Turn left"),null!=t&&"Turn"===t.type&&r&&(this.instruction+=` at ${r.name}`))}},Ze=wr,_n=.1*Math.PI;function jn(e,t){return((t-e+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var xr=class{graph;locationsByNodeId;constructor({locations:e,nodes:t,vortexes:n,maps:r,showVortexNames:i}){this.graph=new Mr({maps:r,nodes:t,showVortexNames:i,vortexes:n}),this.locationsByNodeId=e.reduce(((e,t)=>(t.nodes&&t.nodes.forEach((n=>{e[n.node]=t})),t.polygons&&t.polygons.forEach((n=>{n.entrances&&n.entrances.forEach((n=>{e[n]=t}))})),e)),{})}getClosestLocationInRay(e,t=.5*Math.PI,n=10){let r=0,i=0,a=e;for(;Math.abs(r)<t&&i<n;){let e=this.graph.edges[a.destination.id],s=null,o=0;for(let t of e)if(t.distance>0)if(null!=s){let e=-jn(a.angle,t.angle);Math.abs(e)<Math.abs(o)&&(s=t,o=e)}else s=t,o=-jn(a.angle,t.angle);if(null==s)return null;{if(Math.abs(o)>=t||(r+=o,i+=s.distance,Math.abs(r)>=t||i>n))return null;let e=this.locationsByNodeId[s.destination.id];if(null!=e)return e;a=s}}return null}getDirections({originIds:e,destinationNodeIds:t,accessible:n,departFrom:r,arriveAt:i}){let a=this.graph.aStar(e,t,n);if(0===a.length)return{distance:0,instructions:[new Ze({distance:0,instruction:"No Valid Path Available"})],path:[]};let s=0,o=new Array(a.length+1);for(let e=0;e<a.length;e++)o[e]=a[e].origin;o[a.length]=a[a.length-1].destination;let l=[],u=null,h=null,c=0,d=0;for(let e=0;e<a.length;e++){let t=a[e],n=t.origin,o=t.destination;if(s+=t.distance,c+=h?.distance||0,0===e&&l.push(new Ze({action:{type:"Departure"},atLocation:r,distance:0,origin:n})),null!=t.vortex){let e=this.graph.mapsById[n.map],r=this.graph.mapsById[o.map],i="none";if(null!=e.elevation&&null!=r.elevation){let t=e.elevation-r.elevation;t>0?i="down":t<0&&(i="up")}l.push(new Ze({action:{direction:i,fromMap:e,toMap:r,type:"TakeVortex"},atLocation:t.vortex,distance:c,origin:n})),d+=c,c=0}else if(null!=u&&null!=h)if(null!=h.vortex){let e=this.graph.mapsById[u.map],t=this.graph.mapsById[h.destination.map];l.push(new Ze({action:{fromMap:e,toMap:t,type:"ExitVortex"},atLocation:h.vortex,distance:c,origin:n})),d+=c,c=0}else{let e=this.graph.edges[n.id].filter((e=>e.destination!==u&&e.destination!==t.destination));if(e.length>0){let r=-jn(h.angle,t.angle),i=e.reduce(((e,n)=>{let r=-jn(t.angle,n.angle);return Math.min(e,Math.abs(r))}),Math.PI);if(Math.abs(r)>=_n||Math.abs(i)<=_n){let e;e=r<=-Math.PI/4?"Right":r<=-_n?"SlightRight":r<=_n?"Straight":r<=Math.PI/4?"SlightLeft":"Left";let t=this.locationsByNodeId[n.id];if(t||(t=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=t){let r=new Ze({action:{bearing:e,referencePosition:"At",type:"Turn"},atLocation:t,distance:c,origin:n});r.type=e,l.push(r)}else l.push(new Ze({action:{bearing:e,referencePosition:"At",type:"Turn"},distance:c,origin:n}));d+=c,c=0}}}e===a.length-1&&(l.push(new Ze({action:{type:"Arrival"},atLocation:i,distance:s-d<0?0:s-d,origin:t.destination})),d+=c,c=0),u=n,h=t}let f=[],p=null;for(let e=l.length-1;e>=0;e--){let t=l[e],{action:n}=t;n&&"TakeVortex"===n.type?(p=t.node,f.unshift(t)):n&&"Turn"===n.type&&null!=p?this.graph.getDistance(t.node,p)>5&&f.unshift(t):f.unshift(t)}return{distance:s,instructions:f,path:o}}},_r=xr;function Oo(e){let t=+this._x.call(null,e),n=+this._y.call(null,e);return zo(this.cover(t,n),t,n,e)}function zo(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a,s,o,l,u,h,c,d,f=e._root,p={data:r},g=e._x0,y=e._y0,m=e._x1,v=e._y1;if(!f)return e._root=p,e;for(;f.length;)if((u=t>=(a=(g+m)/2))?g=a:m=a,(h=n>=(s=(y+v)/2))?y=s:v=s,i=f,!(f=f[c=h<<1|u]))return i[c]=p,e;if(o=+e._x.call(null,f.data),l=+e._y.call(null,f.data),t===o&&n===l)return p.next=f,i?i[c]=p:e._root=p,e;do{i=i?i[c]=new Array(4):e._root=new Array(4),(u=t>=(a=(g+m)/2))?g=a:m=a,(h=n>=(s=(y+v)/2))?y=s:v=s}while((c=h<<1|u)==(d=(l>=s)<<1|o>=a));return i[d]=f,i[c]=p,e}function Ao(e){var t,n,r,i,a=e.length,s=new Array(a),o=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,t=e[n]))||isNaN(i=+this._y.call(null,t))||(s[n]=r,o[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)zo(this,s[n],o[n],e[n]);return this}function No(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,a=(r=Math.floor(t))+1;else{for(var s,o,l=i-n||1,u=this._root;n>e||e>=i||r>t||t>=a;)switch(o=(t<r)<<1|e<n,s=new Array(4),s[o]=u,u=s,l*=2,o){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 Eo(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e}function So(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function re(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function Po(e,t,n){var r,i,a,s,o,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=e-n,c=t-n,d=e+n,f=t+n,n*=n);l=p.pop();)if(!(!(g=l.node)||(i=l.x0)>d||(a=l.y0)>f||(s=l.x1)<h||(o=l.y1)<c))if(g.length){var y=(i+s)/2,m=(a+o)/2;p.push(new re(g[3],y,m,s,o),new re(g[2],i,m,y,o),new re(g[1],y,a,s,m),new re(g[0],i,a,y,m)),(u=(t>=m)<<1|e>=y)&&(l=p[p.length-1],p[p.length-1]=p[p.length-1-u],p[p.length-1-u]=l)}else{var v=e-+this._x.call(null,g.data),_=t-+this._y.call(null,g.data),w=v*v+_*_;if(w<n){var M=Math.sqrt(n=w);h=e-M,c=t-M,d=e+M,f=t+M,r=g.data}}return r}function Fo(e){if(isNaN(a=+this._x.call(null,e))||isNaN(s=+this._y.call(null,e)))return this;var t,n,r,i,a,s,o,l,u,h,c,d,f=this._root,p=this._x0,g=this._y0,y=this._x1,m=this._y1;if(!f)return this;if(f.length)for(;;){if((u=a>=(o=(p+y)/2))?p=o:y=o,(h=s>=(l=(g+m)/2))?g=l:m=l,t=f,!(f=f[c=h<<1|u]))return this;if(!f.length)break;(t[c+1&3]||t[c+2&3]||t[c+3&3])&&(n=t,d=c)}for(;f.data!==e;)if(r=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,r?(i?r.next=i:delete r.next,this):t?(i?t[c]=i:delete t[c],(f=t[0]||t[1]||t[2]||t[3])&&f===(t[3]||t[2]||t[1]||t[0])&&!f.length&&(n?n[d]=f:this._root=f),this):(this._root=i,this)}function Do(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function Lo(){return this._root}function Co(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e}function Ro(e){var t,n,r,i,a,s,o=[],l=this._root;for(l&&o.push(new re(l,this._x0,this._y0,this._x1,this._y1));t=o.pop();)if(!e(l=t.node,r=t.x0,i=t.y0,a=t.x1,s=t.y1)&&l.length){var u=(r+a)/2,h=(i+s)/2;(n=l[3])&&o.push(new re(n,u,h,a,s)),(n=l[2])&&o.push(new re(n,r,h,u,s)),(n=l[1])&&o.push(new re(n,u,i,a,h)),(n=l[0])&&o.push(new re(n,r,i,u,h))}return this}function Bo(e){var t,n=[],r=[];for(this._root&&n.push(new re(this._root,this._x0,this._y0,this._x1,this._y1));t=n.pop();){var i=t.node;if(i.length){var a,s=t.x0,o=t.y0,l=t.x1,u=t.y1,h=(s+l)/2,c=(o+u)/2;(a=i[0])&&n.push(new re(a,s,o,h,c)),(a=i[1])&&n.push(new re(a,h,o,l,c)),(a=i[2])&&n.push(new re(a,s,c,h,u)),(a=i[3])&&n.push(new re(a,h,c,l,u))}r.push(t)}for(;t=r.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this}function qo(e){return e[0]}function Go(e){return arguments.length?(this._x=e,this):this._x}function Uo(e){return e[1]}function Vo(e){return arguments.length?(this._y=e,this):this._y}function na(e,t,n){var r=new jr(t??qo,n??Uo,NaN,NaN,NaN,NaN);return null==e?r:r.addAll(e)}function jr(e,t,n,r,i,a){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function $o(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h();var he=na.prototype=jr.prototype;he.copy=function(){var e,t,n=new jr(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=$o(r),n;for(e=[{source:r,target:n._root=new Array(4)}];r=e.pop();)for(var i=0;i<4;++i)(t=r.source[i])&&(t.length?e.push({source:t,target:r.target[i]=new Array(4)}):r.target[i]=$o(t));return n},he.add=Oo,he.addAll=Ao,he.cover=No,he.data=Eo,he.extent=So,he.find=Po,he.remove=Fo,he.removeAll=Do,he.root=Lo,he.size=Co,he.visit=Ro,he.visitAfter=Bo,he.x=Go,he.y=Vo;var Le,te,pt=class{constructor(e){ee(this,Le,void 0),ye(this,"categories"),ye(this,"locations"),ye(this,"vortexes"),ye(this,"maps"),ye(this,"nodes"),ye(this,"polygons"),ye(this,"events"),ye(this,"mapGroups"),ye(this,"locationStates"),ye(this,"rankings"),ee(this,te,{}),Y(this,Le,e)}get polygonsByMapId(){if(N(this,te).polygonsByMapId)return N(this,te).polygonsByMapId;let e,t={};for(let n=0,r=N(this,Le).polygons.length;n<r;++n)e=N(this,Le).polygons[n],t[e.map.id]||(t[e.map.id]=[]),t[e.map.id].push(e);let n=Object.entries(t).reduce(((e,[t,n])=>(e.set(t,n),e)),new Map);return N(this,te).polygonsByMapId=n,N(this,te).polygonsByMapId}get nodesByMapId(){if(N(this,te).nodesByMapId)return N(this,te).nodesByMapId;let e,t={};for(let n=0,r=N(this,Le).nodes.length;n<r;++n)e=N(this,Le).nodes[n],t[e.map.id]||(t[e.map.id]=[]),t[e.map.id].push(e);let n=Object.entries(t).reduce(((e,[t,n])=>(e.set(t,n),e)),new Map);return N(this,te).nodesByMapId=n,N(this,te).nodesByMapId}findNearestNodeOnMap(e,t){if(N(this,te).nodeTreesByMap||(N(this,te).nodeTreesByMap=new Map),!N(this,te).nodeTreesByMap.has(e)){let t=this.nodesByMapId.get(e)??[],n=na();n.x((e=>e.x)),n.y((e=>e.y)),n.addAll(t),N(this,te).nodeTreesByMap.set(e,n)}return N(this,te).nodeTreesByMap.get(e).find(t.x,t.y)}get locationsByMapId(){if(N(this,te).locationsByMapId)return N(this,te).locationsByMapId;let e,t={};for(let n=0,r=N(this,Le).locations.length;n<r;++n){e=N(this,Le).locations[n];for(let n=0,r=e.polygons.length;n<r;++n)t[e.polygons[n].map.id]||(t[e.polygons[n].map.id]=[]),t[e.polygons[n].map.id].push(e)}let n=Object.entries(t).reduce(((e,[t,n])=>(e.set(t,n),e)),new Map);return N(this,te).locationsByMapId=n,N(this,te).locationsByMapId}static create(e){return pt.instances.has(e)||pt.instances.set(e,new pt(e)),pt.instances.get(e)}static clear(){pt.instances.clear()}},Tn=pt;Le=new WeakMap,te=new WeakMap,ye(Tn,"instances",new Map);var Me=Tn;h(),h(),h(),h();var Wo=" ",ce=class{static get separator(){return Wo}static set separator(e){Wo=e}static parse(e){if(!isNaN(parseFloat(e))&&isFinite(e))return Number(e);let t=String(e).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;let n=null;switch(t.length){case 3:n=t[0]/1+t[1]/60+t[2]/3600;break;case 2:n=t[0]/1+t[1]/60;break;case 1:n=t[0];break;default:return NaN}return/^-|[WS]$/i.test(e.trim())&&(n=-n),Number(n)}static toDms(e,t="d",n){if(isNaN(e)||"string"==typeof e&&""==e.trim()||"boolean"==typeof e||e==1/0||null==e)return null;if(void 0===n)switch(t){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:t="d",n=4}e=Math.abs(e);let r=null,i=null,a=null,s=null;switch(t){default:case"d":case"deg":i=e.toFixed(n),i<100&&(i="0"+i),i<10&&(i="0"+i),r=i+"°";break;case"dm":case"deg+min":i=Math.floor(e),a=(60*e%60).toFixed(n),60==a&&(a=(0).toFixed(n),i++),i=("000"+i).slice(-3),a<10&&(a="0"+a),r=i+"°"+ce.separator+a+"′";break;case"dms":case"deg+min+sec":i=Math.floor(e),a=Math.floor(3600*e/60)%60,s=(3600*e%60).toFixed(n),60==s&&(s=(0).toFixed(n),a++),60==a&&(a=0,i++),i=("000"+i).slice(-3),a=("00"+a).slice(-2),s<10&&(s="0"+s),r=i+"°"+ce.separator+a+"′"+ce.separator+s+"″"}return r}static toLat(e,t,n){let r=ce.toDms(ce.wrap90(e),t,n);return null===r?"–":r.slice(1)+ce.separator+(e<0?"S":"N")}static toLon(e,t,n){let r=ce.toDms(ce.wrap180(e),t,n);return null===r?"–":r+ce.separator+(e<0?"W":"E")}static toBrng(e,t,n){let r=ce.toDms(ce.wrap360(e),t,n);return null===r?"–":r.replace("360","0")}static fromLocale(e){let t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(e){let t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(e,t=3){if(![1,2,3].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);e=ce.wrap360(e);let n=4*2**(t-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*n/360)%n*16/n]}static wrap360(e){return 0<=e&&e<360?e:(e%360+360)%360}static wrap180(e){return-180<e&&e<=180?e:(e+540)%360-180}static wrap90(e){return-90<=e&&e<=90?e:Math.abs((e%360+270)%360-180)-90}};Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var G=ce,J=Math.PI,A=class{constructor(e,t){if(isNaN(e))throw new TypeError(`invalid lat ‘${e}’`);if(isNaN(t))throw new TypeError(`invalid lon ‘${t}’`);this._lat=G.wrap90(Number(e)),this._lon=G.wrap180(Number(t))}get lat(){return this._lat}get latitude(){return this._lat}set lat(e){if(this._lat=isNaN(e)?G.wrap90(G.parse(e)):G.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${e}’`)}set latitude(e){if(this._lat=isNaN(e)?G.wrap90(G.parse(e)):G.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${e}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(e){if(this._lon=isNaN(e)?G.wrap180(G.parse(e)):G.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${e}’`)}set lng(e){if(this._lon=isNaN(e)?G.wrap180(G.parse(e)):G.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${e}’`)}set longitude(e){if(this._lon=isNaN(e)?G.wrap180(G.parse(e)):G.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${e}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");if(null===e[0]||null===e[1])throw new TypeError("invalid (null) point");let t,n;if(2==e.length&&([t,n]=e,t=G.wrap90(G.parse(t)),n=G.wrap180(G.parse(n)),isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e.toString()}’`);if(1==e.length&&"string"==typeof e[0]&&([t,n]=e[0].split(","),t=G.wrap90(G.parse(t)),n=G.wrap180(G.parse(n)),isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e[0]}’`);if(1==e.length&&"object"==typeof e[0]){let r=e[0];if("Point"==r.type&&Array.isArray(r.coordinates)?[n,t]=r.coordinates:(null!=r.latitude&&(t=r.latitude),null!=r.lat&&(t=r.lat),null!=r.longitude&&(n=r.longitude),null!=r.lng&&(n=r.lng),null!=r.lon&&(n=r.lon),t=G.wrap90(G.parse(t)),n=G.wrap180(G.parse(n))),isNaN(t)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(e[0])}’`)}if(isNaN(t)||isNaN(n))throw new TypeError(`invalid point ‘${e.toString()}’`);return new A(t,n)}distanceTo(e,t=6371e3){if(e instanceof A||(e=A.parse(e)),isNaN(t))throw new TypeError(`invalid radius ‘${t}’`);let n=t,r=this.lat.toRadians(),i=this.lon.toRadians(),a=e.lat.toRadians(),s=a-r,o=e.lon.toRadians()-i,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(r)*Math.cos(a)*Math.sin(o/2)*Math.sin(o/2);return n*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(e){if(e instanceof A||(e=A.parse(e)),this.equals(e))return NaN;let t=this.lat.toRadians(),n=e.lat.toRadians(),r=(e.lon-this.lon).toRadians(),i=Math.cos(t)*Math.sin(n)-Math.sin(t)*Math.cos(n)*Math.cos(r),a=Math.sin(r)*Math.cos(n),s=Math.atan2(a,i).toDegrees();return G.wrap360(s)}finalBearingTo(e){e instanceof A||(e=A.parse(e));let t=e.initialBearingTo(this)+180;return G.wrap360(t)}midpointTo(e){e instanceof A||(e=A.parse(e));let t=this.lat.toRadians(),n=this.lon.toRadians(),r=e.lat.toRadians(),i=(e.lon-this.lon).toRadians(),a=Math.cos(t),s=0,o=Math.sin(t),l={x:a+Math.cos(r)*Math.cos(i),y:s+Math.cos(r)*Math.sin(i),z:o+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 A(c,d)}intermediatePointTo(e,t){if(e instanceof A||(e=A.parse(e)),this.equals(e))return new A(this.lat,this.lon);let n=this.lat.toRadians(),r=this.lon.toRadians(),i=e.lat.toRadians(),a=e.lon.toRadians(),s=i-n,o=a-r,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(n)*Math.cos(i)*Math.sin(o/2)*Math.sin(o/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),h=Math.sin((1-t)*u)/Math.sin(u),c=Math.sin(t*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),g=Math.atan2(p,Math.sqrt(d*d+f*f)),y=Math.atan2(f,d),m=g.toDegrees(),v=y.toDegrees();return new A(m,v)}destinationPoint(e,t,n=6371e3){let r=e/n,i=Number(t).toRadians(),a=this.lat.toRadians(),s=this.lon.toRadians(),o=Math.sin(a)*Math.cos(r)+Math.cos(a)*Math.sin(r)*Math.cos(i),l=Math.asin(o),u=Math.sin(i)*Math.sin(r)*Math.cos(a),h=Math.cos(r)-Math.sin(a)*o,c=s+Math.atan2(u,h),d=l.toDegrees(),f=c.toDegrees();return new A(d,f)}static intersection(e,t,n,r){if(e instanceof A||(e=A.parse(e)),n instanceof A||(n=A.parse(n)),isNaN(t))throw new TypeError(`invalid brng1 ‘${t}’`);if(isNaN(r))throw new TypeError(`invalid brng2 ‘${r}’`);let i=e.lat.toRadians(),a=e.lon.toRadians(),s=n.lat.toRadians(),o=n.lon.toRadians(),l=Number(t).toRadians(),u=Number(r).toRadians(),h=s-i,c=o-a,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(i)*Math.cos(s)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new A(e.lat,e.lon);let f=(Math.sin(s)-Math.sin(i)*Math.cos(d))/(Math.sin(d)*Math.cos(i)),p=(Math.sin(i)-Math.sin(s)*Math.cos(d))/(Math.sin(d)*Math.cos(s)),g=Math.acos(Math.min(Math.max(f,-1),1)),y=Math.acos(Math.min(Math.max(p,-1),1)),m=l-(Math.sin(o-a)>0?g:2*J-g),v=(Math.sin(o-a)>0?2*J-y:y)-u;if(0==Math.sin(m)&&0==Math.sin(v)||Math.sin(m)*Math.sin(v)<0)return null;let _=-Math.cos(m)*Math.cos(v)+Math.sin(m)*Math.sin(v)*Math.cos(d),w=Math.atan2(Math.sin(d)*Math.sin(m)*Math.sin(v),Math.cos(v)+Math.cos(m)*_),M=Math.asin(Math.min(Math.max(Math.sin(i)*Math.cos(w)+Math.cos(i)*Math.sin(w)*Math.cos(l),-1),1)),b=a+Math.atan2(Math.sin(l)*Math.sin(w)*Math.cos(i),Math.cos(w)-Math.sin(i)*Math.sin(M)),x=M.toDegrees(),O=b.toDegrees();return new A(x,O)}crossTrackDistanceTo(e,t,n=6371e3){e instanceof A||(e=A.parse(e)),t instanceof A||(t=A.parse(t));let r=n;if(this.equals(e))return 0;let i=e.distanceTo(this,r)/r,a=e.initialBearingTo(this).toRadians(),s=e.initialBearingTo(t).toRadians();return Math.asin(Math.sin(i)*Math.sin(a-s))*r}alongTrackDistanceTo(e,t,n=6371e3){e instanceof A||(e=A.parse(e)),t instanceof A||(t=A.parse(t));let r=n;if(this.equals(e))return 0;let i=e.distanceTo(this,r)/r,a=e.initialBearingTo(this).toRadians(),s=e.initialBearingTo(t).toRadians(),o=Math.asin(Math.sin(i)*Math.sin(a-s));return Math.acos(Math.cos(i)/Math.abs(Math.cos(o)))*Math.sign(Math.cos(s-a))*r}maxLatitude(e){let t=Number(e).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(t)*Math.cos(n))).toDegrees()}static crossingParallels(e,t,n){if(e.equals(t))return null;let r=Number(n).toRadians(),i=e.lat.toRadians(),a=e.lon.toRadians(),s=t.lat.toRadians(),o=t.lon.toRadians()-a,l=Math.sin(i)*Math.cos(s)*Math.cos(r)*Math.sin(o),u=Math.sin(i)*Math.cos(s)*Math.cos(r)*Math.cos(o)-Math.cos(i)*Math.sin(s)*Math.cos(r),h=Math.cos(i)*Math.cos(s)*Math.sin(r)*Math.sin(o);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:G.wrap180(p),lon2:G.wrap180(g)}}rhumbDistanceTo(e,t=6371e3){e instanceof A||(e=A.parse(e));let n=t,r=this.lat.toRadians(),i=e.lat.toRadians(),a=i-r,s=Math.abs(e.lon-this.lon).toRadians();Math.abs(s)>J&&(s=s>0?-(2*J-s):2*J+s);let o=Math.log(Math.tan(i/2+J/4)/Math.tan(r/2+J/4)),l=Math.abs(o)>1e-11?a/o:Math.cos(r);return Math.sqrt(a*a+l*l*s*s)*n}rhumbBearingTo(e){if(e instanceof A||(e=A.parse(e)),this.equals(e))return NaN;let t=this.lat.toRadians(),n=e.lat.toRadians(),r=(e.lon-this.lon).toRadians();Math.abs(r)>J&&(r=r>0?-(2*J-r):2*J+r);let i=Math.log(Math.tan(n/2+J/4)/Math.tan(t/2+J/4)),a=Math.atan2(r,i).toDegrees();return G.wrap360(a)}rhumbDestinationPoint(e,t,n=6371e3){let r=this.lat.toRadians(),i=this.lon.toRadians(),a=Number(t).toRadians(),s=e/n,o=s*Math.cos(a),l=r+o;Math.abs(l)>J/2&&(l=l>0?J-l:-J-l);let u=Math.log(Math.tan(l/2+J/4)/Math.tan(r/2+J/4)),h=Math.abs(u)>1e-11?o/u:Math.cos(r),c=i+s*Math.sin(a)/h,d=l.toDegrees(),f=c.toDegrees();return new A(d,f)}rhumbMidpointTo(e){e instanceof A||(e=A.parse(e));let t=this.lat.toRadians(),n=this.lon.toRadians(),r=e.lat.toRadians(),i=e.lon.toRadians();Math.abs(i-n)>J&&(n+=2*J);let a=(t+r)/2,s=Math.tan(J/4+t/2),o=Math.tan(J/4+r/2),l=Math.tan(J/4+a/2),u=((i-n)*Math.log(l)+n*Math.log(o)-i*Math.log(s))/Math.log(o/s);isFinite(u)||(u=(n+i)/2);let h=a.toDegrees(),c=u.toDegrees();return new A(h,c)}static areaOf(e,t=6371e3){let n=t,r=e[0].equals(e[e.length-1]);r||e.push(e[0]);let i=e.length-1,a=0;for(let t=0;t<i;t++){let n=e[t].lat.toRadians(),r=e[t+1].lat.toRadians(),i=(e[t+1].lon-e[t].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(e){let t=0,n=e[0].initialBearingTo(e[1]);for(let r=0;r<e.length-1;r++){let i=e[r].initialBearingTo(e[r+1]),a=e[r].finalBearingTo(e[r+1]);t+=(i-n+540)%360-180,t+=(a-i+540)%360-180,n=a}let r=e[0].initialBearingTo(e[1]);return t+=(r-n+540)%360-180,Math.abs(t)<90})(e)&&(a=Math.abs(a)-2*J);let s=Math.abs(a*n*n);return r||e.pop(),s}equals(e){return e instanceof A||(e=A.parse(e)),!(Math.abs(this.lat-e.lat)>Number.EPSILON||Math.abs(this.lon-e.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(e="d",t){if(!["d","dm","dms","n"].includes(e))throw new RangeError(`invalid format ‘${e}’`);if("n"==e)return null==t&&(t=4),`${this.lat.toFixed(t)},${this.lon.toFixed(t)}`;return`${G.toLat(this.lat,e,t)}, ${G.toLon(this.lon,e,t)}`}};h(),h(),h();var ra=class{destinations=[];constructor(e){this.destinations=e}};h();var wt=class{#e;#t;distance=0;path=[];instructions=[];constructor(e,t){this.#t=e,this.#e=t,this.distance=t.distance,this.instructions=t.instructions.map((e=>{let t={...e,action:{...e.action},atLocation:e.atLocation?.id?this.#t?._vortexesById?.[e.atLocation.id]:void 0,node:e.node?.id?this.#t?._nodesById?.[e.node.id]:void 0};return("TakeVortex"===t.action?.type||"ExitVortex"===t.action?.type)&&(t.action.fromMap=this.#t._mapsById?.[t.action?.fromMap.id],t.action.toMap=this.#t._mapsById?.[t.action?.toMap.id]),t})),this.path=t.path.map((e=>this.#t?._nodesById?.[e.id]))}toJSON(){return this.#e}},Ue=class{#e;constructor(e){this.#e=e}directionsTo(e,t){if(e instanceof ra){let n=[],r=this;for(let i=0;i<e.destinations.length;i++){let a=e.destinations[i],s=ia(r),o=ia(a),l=this.#e.navigator.getDirections({originIds:s,destinationNodeIds:o,accessible:t?.accessible||!1}),u=new wt(this.#e,l);n.push(u),r=a}return n}{let n=ia(this),r=ia(e),i=this.#e.navigator.getDirections({originIds:n,destinationNodeIds:r,accessible:t?.accessible||!1});return new wt(this.#e,i)}}distanceTo(e,t){return this.directionsTo(e,t)?.distance||0}},kp=0,bp="9999-12-31T00:00:00.000Z";function Mp(e,t,n=new Date){if(!e.states)return;let r=n||new Date,i=e.states.find((e=>{let t=new Date(e.start||kp),n=new Date(e.end||bp);return t<r&&n>r}));return i?t.find((e=>e.value===i.type)):void 0}var we=class extends Ue{#e;#t;#n={};states;id="";name="";type="";description;sortOrder;logo;phone;social;color;shortName;detailsUrl;tags;externalId;showLabelWhenImagePresent;picture;operationHours;siblingGroups;gallery;constructor(e,t){super(e),this.#e=e,this.#t=t;let n=Object.assign({},t);delete n.categories,Object.assign(this,n)}#r;get polygons(){let e=this.#n.polygons;if(typeof e<"u")return e;let t=[],n=this.#r,r=this.#e._polygonsById;if(Array.isArray(n))for(let e=0,i=n.length;e<i;++e){let i=r[n[e].id];null!=i&&i.geometry.visible&&t.push(i)}return this.#n.polygons=t,t}set polygons(e){this.#r=e}#i=[];get nodes(){let e=this.#n.nodes;if(typeof e<"u")return e;let t=[],n=this.#i,r=this.#e._nodesById;if(n)for(let e=0,i=n.length;e<i;++e){let i=r[n[e].node];null!=i&&t.push(i)}return this.#n.nodes=t,t}set nodes(e){this.#i=e}#a;get parent(){let e=this.#n.parent;if(typeof e<"u")return e;let t,n=this.#e._locationsById,r=this.#a;return void 0!==r&&(t=n[r]),this.#n.parent=t,t}set parent(e){this.#a=e}get categories(){let e=this.#n.categories;if(typeof e<"u")return e;let t=[];return this.#t.categories.forEach((e=>{let n=this.#e.getCollectionItemById("categories",e);n&&t.push(n)})),this.#n.categories=t,t}get state(){return Mp(this,this.#e.locationStates)}clone(){return new we(this.#e,this.#t)}get nodeOperationHours(){let e=this.#n.nodeOperationHours;if(typeof e<"u")return e;if(null==this.nodes)return{};let t=this.#t.nodes.reduce(((e,t)=>(null!=t.operationHours&&(e[t.node]=t.operationHours),e)),{});return this.#n.nodeOperationHours=t,t}static hydrate(e,t){return e.map((e=>new we(t,e)))}static async fetch(e){let t=e.options.things.locations.slice();e.options.things.categories&&K(t,"categories"),e.options.things.nodes&&K(t,"nodes"),e.options.things.polygons&&K(t,"polygons"),e.options.things.locationStates&&K(t,"states");let n={fields:t,venue:e.options.venue};try{let t=await Z(e.options,"location",n);return e.options.includeHidden||(t=t.filter((e=>!e.hidden))),t.map((t=>new we(e,t)))}catch(e){return z.error("Fetch Locations:",e),[]}}toJSON(){let e=this.#t;return delete e.color,e}};h();var Ce=class extends Ue{#e;#t;#n={};geometry;perspectives;image;holes;textures;material;label;id="";layer;layerId;name;externalId;vertexes;canvasBounds;constructor(e,t){super(e),this.#e=e,this.#t=t;let n=Object.assign({},t);delete n.map,Object.assign(this,n)}get map(){let e=this.#n.map;if(typeof e<"u")return e;let t=this.#e.getCollectionItemById("maps",this.#t.map);return this.#n.map=t,t}get locations(){let e=this.#n.locations;if(typeof e<"u")return e;let t=[],n=Me.instances.get(this.#e)?.locationsByMapId.get(this.map.id)??[],{id:r}=this;for(let e=0,i=n.length;e<i;++e){let i=n[e],a=i.polygons;if(Array.isArray(a))for(let e=0,n=a.length;e<n;++e)if(a[e].id===r){t.push(i);break}}return this.#n.locations=t,t}#r;get entrances(){let e=this.#n.entrances;if(typeof e<"u")return e;let t=[],n=this.#r,r=this.#e._nodesById;if(Array.isArray(n)){for(let e=0,i=n.length;e<i;++e){let i=r[n[e].id];null!=i&&t.push(i)}return this.#n.entrances=t,t}return[]}set entrances(e){this.#r=e}get rank(){let e=this.#n.rank;if(typeof e<"u")return e;let{rankings:t}=this.#e;if(!t||!t.polygons)return null;let n=t.polygons.find((e=>e.polygonId===this.id));return n?(this.#n.rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(this.#n.rank=null,null)}static hydrate(e,t){return e.map((e=>new Ce(t,e)))}static async fetch(e){let t=e.options.things.polygons.slice();e.options.things.maps&&K(t,"map"),e.options.things.nodes&&K(t,"entrances");let n={fields:t,venue:e.options.venue};try{return(await Z(e.options,"polygon",n)).filter((e=>e.geometry.visible)).map((t=>new Ce(e,t)))}catch(e){return z.error("Fetch Polygons:",e),[]}}toJSON(){return this.#t}};function Yo(e){return/^[\da-f]{24}$/i.test(e)}function Ho(e,t=!1){let n="";if(null!=e){let r="?",i=t?Object.keys(e).filter((e=>!["slug","venue"].includes(e))):Object.keys(e);for(let t=0,a=i.length;t<a;++t){let a=i[t],s=e[a];null!=s&&(n+=`${r+encodeURIComponent(a)}=${encodeURIComponent(s)}`,r="&")}}return n}function wp(e,t,n,r=!1){return r?`${e.supplementaryUrl}${t}?venue=${n.venue||n.slug}`:e.baseUrl?.includes("gateway")?`${e.baseUrl}${t}/${n.venue||n.slug}${Ho(n,e.baseUrl?.includes("gateway"))}`:e.baseUrl+t+Ho(n)}async function Z(e,t,n,r=!1){return Tr(e,t,n,r,!0)}async function Tr(e,t,n,r=!1,i=!1){let a=wp(e,t,n,r),s=await In(e,a,r);if(!i&&Array.isArray(s)){if(1===s.length)return s[0];throw new Error("Invalid response object")}return s}async function In(e,t,n=!1){let r={language:e.language,clientId:e.clientId,clientSecret:e.clientSecret};n&&delete r.language,r.language&&(t+=`&lang=${encodeURIComponent(r.language)}`);let{headers:i}=e;i["Content-Type"]="text/json",e.authorization&&(i.Authorization=e.authorization),r.language&&(i["Accept-Language"]=r.language);let a={method:"GET",headers:i},s=await Qe()(t,a);if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return s.json()}function K(e,t){e.indexOf(t)<0&&e.push(t)}function Xo([e,t],[n,r]){let i=new A(e,t),a=new A(n,r);return i.distanceTo(a)}function Jo(e){if(e.scale||e.x_scale)return 1/(e.scale||e.x_scale);let t;try{let n=e.georeference[0],r=e.georeference[2],i=new A(n.target.x,n.target.y),a=new A(r.target.x,r.target.y),s=i.distanceTo(a),o=n.control.x-r.control.x,l=n.control.y-r.control.y;t=Math.sqrt(o*o+l*l)/s}catch(n){t=1,z.warn(n),z.warn(`Couldn't georeference ${e.name||e.shortName||e.id}. Probably not enough geocoordinates.`)}return t}function ia(e){return e instanceof Ce?e.entrances.map((e=>e.id)):e instanceof we?e.nodes?.map((e=>e.id))||[]:[e.id]}async function Ko(e){let t={},{maps:n,images:r,scenes:i,polygons:a}=e;if(null!=r)try{let e=Object.keys(r).map((e=>fetch(`data:image/png;base64,${r[e]}`).then((e=>e.blob())).then((n=>{t[e]=n})).catch((e=>{z.error(e)}))));await Promise.all(e)}catch(e){z.error(e)}return n.forEach((e=>{(e.scene?.polygons||i[e.id])&&(null!=i&&i[e.id]&&(e.scene||(e.scene={}),Object.defineProperty(e.scene,"polygons",{get:()=>i[e.id]})),null!=r&&(e.scene.images=e.scene.images.map((({filename:e})=>({filename:e,url:t[e]}))),e.scene.polygons.forEach((e=>{if(e?.image?.url&&e?.image?.url){let n=e.image.url.split("/"),r=t[n[n.length-1]];r&&(e.image.url=r)}}))))})),null!=r&&a.forEach((e=>{if(e?.image?.url){let n=e.image.url.split("/"),r=t[n[n.length-1]];r&&(e.image.url=r)}})),null!=e.images&&delete e.images,null!=e.scenes&&delete e.scenes,e}function Ir(e,t,n){let r;return function(){let i=this,a=arguments,s=function(){r=null,n||e.apply(i,a)},o=n&&!r;clearTimeout(r),r=setTimeout(s,t),o&&e.apply(i,a)}}var Re=class{#e;#t={};#n;name;externalId;parents;id;icon;constructor(e,t){this.id=t.id,this.#n=t,this.#e=e,Object.assign(this,t)}get locations(){let e=this.#t.locations;if(typeof e<"u")return e;let t=[],{locations:n}=this.#e,{id:r}=this;for(let e=0,i=n.length;e<i;++e){let i=n[e],a=i.categories;if(Array.isArray(a))for(let e=0,n=a.length;e<n;++e)if(a[e]?.id===r){t.push(i);break}}return this.#t.locations=t,t}static hydrate(e,t){return e.map((e=>new Re(t,e)))}static async fetch(e){let t={fields:e.options.things.categories,venue:e.options.venue};try{return(await Z(e.options,"category",t)).map((t=>new Re(e,t)))}catch(e){return z.error("Fetch Categories:",e),[]}}toJSON(){return this.#n}};h();var et=class{#e;#t;#n={};id="";type="";name="";description;image;startDate;endDate;showDate;constructor(e,t){this.#t=t,this.#e=e,Object.assign(this,t)}location(){let e=this.#n.location;if(typeof e<"u")return e;let t,n=this.#e._locationsById,r=this.#t.location;if(null!=r){let e=n[r];null!=e&&(t=e)}return this.#n.location=t,t}static hydrate(e,t){return e.map((e=>new et(t,e)))}static async fetch(e){let t=e.options.things.events.slice();e.options.things.locations&&K(t,"location");let n={fields:t,venue:e.options.venue,activeAtOrAfter:Date.now()};try{return(await Z(e.options,"event",n)).map((t=>new et(e,t)))}catch(e){return z.error("Fetch Events:",e),[]}}toJSON(){return this.#t}};h();var ht=class{#e;constructor(e){this.#e=e,Object.assign(this,e)}static hydrate(e){return e.map((e=>new ht(e)))}id="";name="";value="";static async fetch(e){let t={fields:e.options.things.locationStates.slice(),venue:e.options.venue};try{return(await Z(e.options,"location-state",t)).map((e=>new ht(e)))}catch(e){return z.error("Fetch Location States:",e),[]}}toJSON(){return this.#e}};h(),h();var xt=class{map;get x(){return this.#t("x")}get y(){return this.#t("y")}get lat(){return this.#e("lat")}get lon(){return this.#e("lon")}#e(e){if(this.#s&&this.#o)return"lat"===e?this.#s:this.#o;if(null!=this.#l&&null!=this.#u){let[t,n]=this.#a(this.#l,this.#u);return this.#s=t,this.#o=n,"lat"===e?this.#s:this.#o}throw Error("MappedinCoordinate is missing x and y")}#t(e){if(this.#l&&this.#u)return"x"===e?this.#l:this.#u;if(null!=this.#s&&null!=this.#o){let[t,n]=this.#i(this.#s,this.#o);return this.#l=t,this.#u=n,"x"===e?this.#l:this.#u}throw Error("MappedinCoordinate is missing lat and lon")}#n={};#r;#i(e,t){let n=this.map.georeference[0],r=new A(n.target.x,n.target.y),i=new A(e,t),a=r.distanceTo(i),s=(r.finalBearingTo(i)+360)%360*Math.PI/180||0,o=a*(1/this.map.scale),l=s+this.map.getNorth(),u=Math.sin(l)*o,h=Math.cos(l)*o;return[n.control.x+u,n.control.y-h]}#a(e,t){let n,r=this.map.georeference[0],i=new A(r.target.x,r.target.y),a=e-r.control.x,s=r.control.y-t,o=Math.atan2(a,s);n=0===a&&0===s?0:0===a?s:a/Math.sin(o);let l=o-this.map.getNorth(),u=n/this.map._scale,h=i.destinationPoint(u,180*l/Math.PI);return[h.lat,h.lon]}constructor(e){let{map:t,mappedin:n}=e;null!=e.lat&&null!=e.lon&&(this.#s=e.lat,this.#o=e.lon),null!=e.x&&null!=e.y&&(this.#l=e.x,this.#u=e.y),this.map=t,this.#r=n}#s;#o;#l;#u;absoluteDistanceTo(e){return Xo([e.lat,e.lon],[this.lat,this.lon])}get nearestNode(){let e=this.#n.nearestNode;if(typeof e<"u")return e;let t=Me.instances.get(this.#r).findNearestNodeOnMap(this.map.id,this);return this.#n.nearestNode=t,t}toJSON(){return{x:this.x,y:this.y,map:this.map,lat:this.lat,lon:this.lon}}},tt=class{#e;#t={};#n;id="";group="";name="";shortName="";elevation=0;scale=0;layers;x_scale;perspectiveId;scene;width=0;height=0;georeference=[];constructor(e,t){this.#e=e,this.#n=t,Object.assign(this,t),this._scale=Jo(this),this.scale=this.x_scale||1/this._scale}_scale=0;get polygons(){return Me.instances.get(this.#e)?.polygonsByMapId?.get(this.id)??[]}get locations(){return Me.instances.get(this.#e)?.locationsByMapId?.get(this.id)??[]}get nodes(){return Me.instances.get(this.#e)?.nodesByMapId?.get(this.id)??[]}get mapGroup(){let e=this.#t.mapGroup;if(typeof e<"u")return e;let t=this.group,n=t&&this.#e._mapGroupsById[t]||null;return this.#t.mapGroup=n,n}createCoordinateByXY(e,t){return new xt({x:e,y:t,map:this,mappedin:this.#e})}createCoordinate(e,t){return new xt({lat:e,lon:t,map:this,mappedin:this.#e})}getNorth(){let e;try{let t=this.georeference[0],n=this.georeference[2],r=new A(t.target.x,t.target.y),i=new A(n.target.x,n.target.y);e=-((r.finalBearingTo(i)+0)*Math.PI/180-Math.atan2(n.control.y-t.control.y,n.control.x-t.control.x)-Math.PI/2)}catch(t){e=0,z.warn(t),z.warn(`Couldn't georeference ${this.name||this.shortName||this.id}. Probably not enough geocoordinates.`)}return e}static hydrate(e,t){return e.map((e=>new tt(t,e)))}static async fetch(e){let t=e.options.things.maps.slice();e.options.perspective&&K(t,"perspectives"),e.options.things.mapGroups&&K(t,"group"),K(t,"elevation"),K(t,"x_scale"),K(t,"scale"),K(t,"georeference");let n={fields:t,perspective:e.options.perspective,venue:e.options.venue};try{let i=await Z(e.options,"map",n),a=e=>{let t=r.layers.find((t=>t.id===e));t?t.visible=!0:r.layers.push({id:e,visible:!0})};for(let n=0,s=i.length;n<s;++n){var r=i[n];if(r){let e=r.perspective;null!=e&&(r.perspectiveId=e.id,t.indexOf("scene")>-1&&(r.scene=e.scene),e.layers?(r.layers.forEach((e=>{e.visible=!1})),e.layers.forEach(a)):r.layers.forEach((e=>{e.visible=!0}))),delete r.perspective}i[n]=new tt(e,r)}return i}catch(e){return z.error("Fetch Maps:",e),[]}}toJSON(){return this.#n}};h();var at=class{#e;#t;#n={};id="";name="";constructor(e,t){this.#t=t,this.#e=e,Object.assign(this,t)}get maps(){let e=this.#n.maps;if(typeof e<"u")return e;let t=[],{maps:n}=this.#e,{id:r}=this.#t;for(let e=0,i=n.length;e<i;++e){let i=n[e];i.group===r&&t.push(i)}return this.#n.maps=t,t}static hydrate(e,t){return e.map((e=>new at(t,e)))}static async fetch(e){let t={fields:e.options.things.mapGroups.slice(),venue:e.options.venue};try{return(await Z(e.options,"map-group",t)).map((t=>new at(e,t)))}catch(e){return z.error("Fetch Map Groups:",e),[]}}toJSON(){return this.#t}};h();var nt=class extends Ue{#e;#t;#n={};id="";x=0;y=0;operationHours;externalId;constructor(e,t){super(e),this.#e=e,this.#t=t;let n=Object.assign({},t);delete n.map,Object.assign(this,n)}get map(){let e=this.#n.map;if(typeof e<"u")return e;let t=this.#e.getCollectionItemById("maps",this.#t.map);return this.#n.map=t,t}get lat(){let e=this.#n.cachedLatLon;if(null!=e)return e.lat;let t=this.#e._mapsById?.[this.map.id];if(null==t)throw new Error("Map not found");return this.#n.cachedLatLon=t.createCoordinateByXY(this.x,this.y),this.#n.cachedLatLon.lat}get lon(){let e=this.#n.cachedLatLon;if(null!=e)return e.lon;let t=this.#e._mapsById?.[this.map.id];if(null==t)throw new Error("Map not found");return this.#n.cachedLatLon=t.createCoordinateByXY(this.x,this.y),this.#n.cachedLatLon.lon}#r;get paths(){let e=this.#n.paths;if(typeof e<"u")return e;let t=[],n=this.#e._nodesById,r=this.#r;if(Array.isArray(r))for(let e=0,i=r.length;e<i;++e){let i=n[r[e].node];null!=i&&t.push(i)}return this.#n.paths=t,t}set paths(e){this.#r=e}get locations(){let e=this.#n.locations;if(typeof e<"u")return e;let t=[],n=Me.instances.get(this.#e)?.locationsByMapId?.get(this.map.id)??[],r=this.id;for(let e=0,i=n.length;e<i;++e){let i=n[e],a=i.nodes;if(Array.isArray(a))for(let e=0,n=a.length;e<n;++e)if(a[e].id===r){t.push(i);break}}return this.#n.locations=t,t}get polygon(){let e=this.#n.polygon;if(typeof e<"u")return e;let t,n=Me.instances.get(this.#e)?.polygonsByMapId?.get(this.map.id)??[],r=this.id;for(let e=0,i=n.length;e<i;++e){let i=n[e];i.entrances.map((e=>e.id)).includes(r)&&(t=i)}return this.#n.polygon=t,t}static hydrate(e,t){return e.map((e=>new nt(t,e)))}static async fetch(e){let t=e.options.things.nodes.slice();e.options.things.maps&&K(t,"map"),["weight","multiplier","accessible"].forEach((function(e){K(t,e)}));let n={fields:t,venue:e.options.venue};try{return(await Z(e.options,"node",n)).map((t=>new nt(e,t)))}catch(e){return z.error("Fetch Nodes:",e),[]}}toJSON(){return this.#t}};h();var rt=class{#e;constructor(e){this.#e=e,Object.assign(this,e)}polygons=[];static hydrate(e){return new rt(e)}static async fetch(e){try{let t=await Tr(e.options,"smart-labels/polygon-label-ranking",{venue:e.options.venue},!0);return new rt(t)}catch(e){return z.error("Fetch Rankings:",e),null}}toJSON(){return this.#e}};h();var mt=class{id="";#e;constructor(e){this.#e=e,Object.assign(this,e)}static hydrate(e){return e.map((e=>new mt(e)))}static async fetch(e){let t={fields:e.options.things.themes.slice(),venue:e.options.venue};try{return(await Z(e.options,"apollo-theme",t)).map((e=>new mt(e)))}catch(e){return z.error("Fetch Theme:",e),[]}}toJSON(){return this.#e}};h();var it=class{#e;#t;#n={};defaultMap="";address="";city="";countrycode="";externalId="";id="";latitude;logo;longitude;metadata;name="";operationHours;postal="";slug="";state="";telephone="";tzid="";tzidOverride="";utcOffset="";website="";constructor(e,t){this.#t=e,this.#e=t,Object.assign(this,t)}static hydrate(e,t){return new it(t,e)}static async fetch(e){let t={fields:e.options.things.venue,slug:e.options.venue,limit:1};try{let n=await Z(e.options,"venue",t);return new it(e,n[0])}catch(e){return z.error("Fetch Venue:",e),{}}}get isMultiBuilding(){if(null==this.#n.isMultiBuilding){let e=this.#t.maps,t=e.reduce(((e,t)=>e.add(t.elevation)),new Set),n=e.length!==t.size;this.#n.isMultiBuilding=n}return this.#n.isMultiBuilding}toJSON(){return this.#e}};h();var ot=class{id="";#e;name;type;weight;multiplier;constructor(e){this.#e=e,Object.assign(this,e)}static hydrate(e){return e.map((e=>new ot(e)))}static async fetch(e){let t=e.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(e){K(t,e)}));let n={fields:t,venue:e.options.venue};try{return(await Z(e.options,"vortex",n)).map((e=>new ot(e)))}catch(e){return z.error("Fetch Vortexes:",e),[]}}toJSON(){return this.#e}};function xp(e,t){let n=[];return e.features.forEach((e=>{let r=[];e.properties.spaces?.forEach((e=>{if("id"in e){let n;n=t.get(e.id),n&&r.push(...n)}else r?.push({id:e.node,level:""})}));let i=r.map((e=>({node:"n_"+e.id,map:e.level}))),a=e.properties.spaces?.filter((e=>"id"in e)),s=(e.properties.hours||[]).map((e=>({...e,"@type":"OpeningHoursSpecification",dayOfWeek:[e.dayOfWeek.replace("http://schema.org/","")]}))),o={...e.properties,polygons:a||[],nodes:i||[],description:e.properties.description||"",logo:e.properties.logo||{},picture:e.properties.picture||{},phone:e.properties.phone||{},social:e.properties.social||{},externalId:e.properties.externalId||"",states:e.properties.states||[],siblingGroups:e.properties.siblingGroups||[],operationHours:s};delete o.spaces,n.push(o)})),n}function _p(e){let t=new Set;return e.features.forEach((e=>{e.properties.states?.forEach((e=>{t.add(e.type)}))})),Array.from(t).map((e=>({id:e,name:e,value:e})))}function jp(e){let t=[];return e.features.forEach((e=>{let n={...e.properties,icon:e.properties.picture};delete n.picture,t.push(n)})),t}function Tp(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;return e.features.forEach((e=>{let a;a="MultiPolygon"===e.geometry.type?e.geometry.coordinates[0].flat():e.geometry.coordinates[0],a.forEach((e=>{t=Math.min(t,e[1]),r=Math.max(r,e[1]),n=Math.min(n,e[0]),i=Math.max(i,e[0])}))})),{id:e.features[0].properties.id,minLat:t,minLong:n,maxLat:r,maxLong:i}}function Ip(e,t,n){let r=n.createGeoreferences(),i=[];return e.features.forEach((e=>{let a=new Set;t.forEach((e=>{e.layer&&a.add(e.layer)}));let s=[...a].map((e=>({id:e,visible:!0}))),o=1/n.mapScale,l={...e.properties,georeference:r,shortName:e.properties.abbreviation||"",scene:{polygons:t},scale:o,x_scale:o,group:e.properties.building,layers:s,width:n.widthInMapUnits,height:n.heightInMapUnits};i.push(l)})),i}h();var Or=class{mapExtent;stretchRatio;midLat;midLong;mapUnitRatio=1e6;latDistance;longDistance;mapScale;widthInMapUnits;heightInMapUnits;constructor(e){this.mapExtent=e;let{minLat:t,minLong:n,maxLat:r,maxLong:i}=e,a=(t+r)/2,s=(n+i)/2,o=new A(a,i),l=new A(a,n),u=new A(t,s),h=new A(r,s);this.latDistance=u.distanceTo(h),this.longDistance=o.distanceTo(l);let c=this.latDistance/this.longDistance,d=(r-t)/(i-n);this.stretchRatio=c/d,this.midLat=a,this.midLong=s,this.widthInMapUnits=(i-n)*this.mapUnitRatio,this.heightInMapUnits=(r-t)*this.mapUnitRatio*this.stretchRatio,this.mapScale=this.widthInMapUnits/this.longDistance}convert(e){let t=e[1];return{x:(e[0]-this.midLong)*this.mapUnitRatio,y:(this.midLat-t)*this.mapUnitRatio*this.stretchRatio}}createGeoreferences(){let{minLat:e,minLong:t,maxLat:n,maxLong:r}=this.mapExtent;return[[e,t],[e,r],[n,r],[n,t]].map((e=>({target:{x:e[0],y:e[1]},control:this.convert([e[1],e[0]])})))}};function Op(e,t){let n=[];return e.features.forEach((e=>{let r=t.convert(e.geometry.coordinates),i=(e.properties.neighbors||[]).map((t=>({node:t,map:e.properties.level}))),a=e.properties.level,s={...e.properties,x:r.x,y:r.y,paths:i,map:a,externalId:e.properties.externalId||""};n.push(s)})),n}var Zo=(e,t,n,r,i)=>{let a=[];return e.features.forEach((e=>{if(!e.geometry.coordinates[0].forEach)return;let s=[];"entrances"in e.properties&&(s=e.properties.entrances.map((e=>({id:"n_"+e.id,node:"n_"+e.id,map:e.level}))));let o,l=n[e.properties.id],u=t.find((e=>e.id===l)),h=e.geometry.coordinates[0].map((e=>i.convert(e))),c=r.find((t=>t.polygonId===e.properties.id)),d=Math.max(i.widthInMapUnits,i.heightInMapUnits)/1e3;if(c){let e=i.convert([c.position[0],c.position[1]]),t=c.size.x,n=c.size.y,r=i.mapScale,a=n*r,s=t*r/d/c.viewBox.width,l=a/d/c.viewBox.height;o={url:u?.image,visible:!!u?.image,viewBox:c.viewBox,scale:{x:s,y:l},position:{x:e.x,y:e.y},rotation:c.rotation,useLocalScaling:!1,_isAbsolutelyPositioned:!0}}let f={...e.properties,entrances:s,map:e.properties.level,externalId:e.properties.externalId||"",geometry:{visible:!0,position:{x:0,y:0,z:(u?.altitude||0)*i.mapScale/d},scale:{x:1,y:1,z:(u?.height||1)*i.mapScale/d}},material:{color:u?.color||"#000000"},image:o,vertexes:h};a.push(f)})),a};function zp(e,t,n,r,i,a){let s=Zo(e,n,r,i,a),o=Zo(t,n,r,i,a);return s.concat(o)}function Ap(e){let t=new Map;return e.forEach((e=>{e.features.forEach((e=>{let{destinations:n}=e.properties;if(0===n.length)return;let r=n[0].split("-")[0],i=t.get(r),a=n.map((e=>e.split("-")[1])).map((e=>"n_"+e));if(i)i.nodes.push(...a);else{let{name:n,type:i,weight:s,multiplier:o,accessible:l}=e.properties,u={id:r,nodes:a,name:n,type:i,weight:s,multiplier:o,accessible:l};t.set(r,u)}}))})),Array.from(t.values())}function Np(e){let t=[];return e.features.forEach((e=>{let n={...e.properties};t.push(n)})),t}function Qo(e){let t=Object.keys(e),n=new Map,r=new Map,i=new Map,a=new Map,s=new Map,o=new Map,l=new Map,u=new Map;t.filter((e=>e.indexOf("/")>-1)).forEach((t=>{let h=t.split(/[\/\.]/),c=h[0],d=h[1];switch(c){case"connection":n.set(d,e[t]);break;case"level":r.set(d,e[t]);break;case"node":i.set(d,e[t]);break;case"obstruction":a.set(d,e[t]);break;case"space":s.set(d,e[t]);break;case"style":case"polygon-style":o.set(d,e[t]);break;case"image":l.set(d,e[t]);break;case"image-instance":u.set(d,e[t])}}));let h=e["building.geojson"]||e["building.json"],c=e["category.geojson"]||e["category.json"],d=e["location.geojson"]||e["location.json"],f=e["manifest.geojson"]||e["manifest.json"],p=e["style.json"]||[];return{connection:n,level:r,node:i,obstruction:a,space:s,building:h,category:c,location:d,manifest:f,style:p,polygonStyle:o,imageInstance:u,imageBinaries:l}}function es(e){let t=Array.from(e.connection.values()),n=Array.from(e.level.values()),r=e.building,i=e.category,a=e.style,s=e.location,o=e.imageInstance,l=e.polygonStyle,u={},h=[],c=new Map;n.forEach((t=>{let n=t.features[0].properties.id,r=Tp(t),i=new Or(r);c.set(n,i);let s=e.obstruction.get(n),d=e.space.get(n),f=o.get(n),p=l.get(n);u[n]=zp(d,s,a,p,f,i);let g=e.node.get(n);h.push(...Op(g,i))}));let d=Object.values(u).flat(),f=Ap(t),p=n.map((e=>{let t=e.features[0].properties.id,n=c.get(t);return Ip(e,u[t],n)})).flat(),g=new Map;Array.from(e.space.values()).forEach((e=>{e.features.forEach((e=>{g.set(e.properties.id,e.properties.entrances)}))}));let y=Np(r),m=xp(s,g),v=jp(i),_=_p(s),w=e.manifest.features[0].properties.name,M=e.manifest.features[0].geometry.coordinates[0],b=e.manifest.features[0].geometry.coordinates[1],x=e.imageBinaries;return{locations:m,categories:v,nodes:h,maps:p,polygons:d,vortexes:f,mapGroups:y,locationStates:_,themes:[],venue:{name:w,latitude:b,longitude:M},imageBinaries:x}}h(),h(),h(),h();var ft,Se,Pe,zr=[0,4,6,8,10],Ve=()=>{let e=new Array(16).fill(0),t=4294967296*Math.random();for(let n=0;n<e.length;n++)n>0&&!(3&n)&&(t=4294967296*Math.random()),e[n]=t>>>((3&n)<<3)&255;let n=e.map((e=>e.toString(16).padStart(2,"0")));return n[6]="4"+n[6][1],n[8]=["8","9","a","b"].includes(n[7][0])?n[7]:"a"+n[7][1],zr.map(((e,t)=>n.slice(e,t===zr.length-1?void 0:zr[t+1]).join(""))).join("-")},ts="mi-session-data",as="mi-local-data",Ar=class{constructor(){ee(this,Se,void 0),ee(this,Pe,void 0);try{let e=sessionStorage.getItem(ts);Y(this,Se,e?JSON.parse(e):{id:Ve()})}catch{Y(this,Se,{id:Ve()})}try{let e=localStorage.getItem(as);Y(this,Pe,e?JSON.parse(e):{deviceId:Ve()})}catch{Y(this,Pe,{deviceId:Ve()})}N(this,Se).id||(N(this,Se).id=Ve()),N(this,Pe).deviceId||(N(this,Pe).deviceId=Ve())}static getInstance(){return N(this,ft)||Y(this,ft,new Ar),N(this,ft)}static ___clearInstance(){Y(this,ft,void 0)}saveSessionData(e,t){N(this,Se)[e]=t;try{return sessionStorage.setItem(ts,JSON.stringify(N(this,Se))),!0}catch{return!1}}loadSessionData(e){let t=N(this,Se)[e];if(null!=t)return t}saveLocalData(e,t){N(this,Pe)[e]=t;try{return localStorage.setItem(as,JSON.stringify(N(this,Pe))),!0}catch{return!1}}loadLocalData(e){let t=N(this,Pe)[e];if(null!=t)return t}},_t=Ar;function ns(e){return/^[\da-f]{24}$/i.test(e)}function rs(){return _t.getInstance().loadLocalData("deviceId")}function is(){return _t.getInstance().loadSessionData("id")}ft=new WeakMap,Se=new WeakMap,Pe=new WeakMap,ee(_t,ft,void 0);var sa,jt,Tt,ua,It,Ot,zt,gt,la,At,Nt,ca,js=Yn(_s()),qp=M?.env?.npm_package_version,Sr=["websdk","web","webv2"],Pr="websdk",Fr=class{constructor(e){ee(this,sa,void 0),ee(this,jt,void 0),ee(this,Tt,void 0),ee(this,ua,void 0),ee(this,It,void 0),ee(this,Ot,void 0),ee(this,zt,void 0),ee(this,gt,void 0),ee(this,la,void 0),ee(this,At,void 0),ee(this,Nt,void 0),ee(this,ca,void 0),Y(this,gt,e.clientId),Y(this,la,e.clientSecret),Y(this,At,e.accessToken),Y(this,zt,e.noAuth||!1);let t="https://api-gateway.mappedin.com/track-analytics/a/";!N(this,zt)&&N(this,gt)&&!ns(N(this,gt))&&(t="https://web-proxy.mappedin.com/a/"),Y(this,Tt,t),Y(this,Tt,N(this,Tt)+(e.venue+"/")),Y(this,jt,!1),Y(this,sa,"boolean"==typeof e.testMode?e.testMode:"true"===e.testMode?.toLowerCase()),Y(this,ua,Sr.find((t=>t===e.context))||Sr[0]),Y(this,It,rs()),Y(this,Ot,is()),Y(this,Nt,new Set),Y(this,ca,e.platformString||""),this.locationSelected=this.locationSelected.bind(this),this.categorySelected=this.categorySelected.bind(this),this.getDirections=this.getDirections.bind(this)}track(e,t){if(N(this,sa))return;let n={...t,g:N(this,jt)},r=N(this,Tt)+e+"?"+js.default.stringify(n),i={"mi-context":Pr||N(this,ua),"mi-session":N(this,Ot),"mi-device":N(this,It),"mappedin-sdk-version":qp,"mappedin-platform-version":N(this,ca)};N(this,At)?i.Authorization=`Bearer ${N(this,At)}`:N(this,zt)||(i.Authorization=`Basic ${btoa(`${N(this,gt)}:${N(this,la)}`)}`),Qe()(r,{method:"GET",mode:"cors",headers:i})}locationSelected(e){let t=e.id||e;this.track("select-location",{id:t})}categorySelected(e){let t=e.id||e;this.track("select-category",{id:t})}mapViewLoaded(e,t,n,r){this.track("load-mapview",{type:e,force:t,benchmark:n||-1,reason:r||"success"})}getDirections(e,t){let n={start:e.id,end:t.id,type:"location_to_location"};this.track("query-directions",n)}getSessionID(){return N(this,Ot)}getDeviceID(){return N(this,It)}setGeolocationMode(e){Y(this,jt,e)}trackBlueDotEvent(e){e&&Object.values(Fr.BLUEDOT_EVENT).includes(e)&&!N(this,Nt).has(e)?(this.track(e),N(this,Nt).add(e)):z.warn(`Ignored unsupported blue dot event: "${e}".`)}trackSearch(e){null!=e&&this.track("query-search",e)}trackSearchSuggest(e){null!=e&&this.track("query-suggest",e)}static setContext(e){let t=Sr.find((t=>t===e));t&&(Pr=t)}static clearContext(){Pr=void 0}},On=Fr;sa=new WeakMap,jt=new WeakMap,Tt=new WeakMap,ua=new WeakMap,It=new WeakMap,Ot=new WeakMap,zt=new WeakMap,gt=new WeakMap,la=new WeakMap,At=new WeakMap,Nt=new WeakMap,ca=new WeakMap,ye(On,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var zn=On,Dr={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""},oa=(e=>(e.CATEGORY="categories",e.EVENT="events",e.LOCATION="locations",e.MAPGROUP="mapGroups",e.MAP="maps",e.NODE="nodes",e.POLYGON="polygons",e.VORTEX="vortexes",e))(oa||{}),Et={categories:Re,locations:we,vortexes:ot,maps:tt,nodes:nt,polygons:Ce,venue:it,events:et,mapGroups:at,themes:mt,locationStates:ht,rankings:rt},st=class{perspective;things;options;#e;#t="";updatedAt;categories=[];locations=[];vortexes=[];maps=[];nodes=[];polygons=[];venue={};events=[];mapGroups=[];themes=[];locationStates=[];rankings;_categoriesById;_locationsById;_vortexesById;_mapsById;_nodesById;_polygonsById;_eventsById;_mapGroupsById;_locationStatesById;_locationRankingsById;_rankingsById;_categoriesByExternalId;_locationsByExternalId;_vortexesByExternalId;_mapsByExternalId;_nodesByExternalId;_polygonsByExternalId;_eventsByExternalId;_mapGroupsByExternalId;_locationStatesByExternalId;_locationRankingsByExternalId;_rankingsByExternalId;generateGetters(e){try{for(let t=0,n=e.length;t<n;++t){let n=e[t];Array.isArray(this[n])&&(Object.defineProperty(this,`_${n}ByExternalId`,{get(){let e=this.#e[n];if(null!=e)return e;let t={};return this[n].forEach((e=>t[e.externalId]=e)),this.#e[n]=t,t}}),Object.defineProperty(this,`_${n}ById`,{get(){let e=this.#e[n];if(null!=e)return e;let t={};return this[n].forEach((e=>t[e.id]=e)),this.#e[n]=t,t}}))}return this}catch(e){throw new Error("Unable to generate getters, "+e)}}getCollectionItemById(e,t){let n=`_${e}ByExternalId`,r=this[`_${e}ById`];return null!=r&&null!=r[t]||(r=this[n],null!=r&&null!=r[t])?r[t]:null}async hydrateFromMVF(e){let t=es(e);return this.hydrate(t)}async hydrate(e,t){let n;if("string"==typeof e)try{this.#t=e,n=JSON.parse(e)}catch(e){return void z.error("Unable to parse JSON",e)}else n=e,this.#t=JSON.stringify(n);let r=Object.keys(n);for(let e=0,t=r.length;e<t;++e){let t=r[e],i=n[t];null!=Et[t]&&"function"==typeof Et[t].hydrate&&(this[t]=Et[t].hydrate(i,this))}t&&await Ko(n);let{images:i,scenes:a,imageBinaries:s}=n;this.images=i,this.scenes=a,this.imageBinaries=s,this.generateGetters(r),this.initNavigator()}images;imageBinaries;scenes;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"]),Yo(this.options.clientId)||this.options.things.rankings&&delete this.options.things.rankings;let{things:e}=this.options,t=[],n=Object.keys(e);for(let e=0,r=n.length;e<r;++e){let r=n[e];Et[r]&&t.push(Et[r].fetch(this).then((e=>(this[r]=e,Promise.resolve()))))}return this.generateGetters(n),Promise.all(t).then((()=>{this.initNavigator()}))}constructor(e){this.options=e,this.#e=Me.create(this);let t=new zn({...e,testMode:!e?.emitAnalyticsEvents});this.analytics={locationSelected:t.locationSelected,categorySelected:t.categorySelected,getDirections:t.getDirections},globalThis.MappedinDebug||(globalThis.MappedinDebug={enable(){globalThis.sessionStorage.setItem(kr,"true")}})}analytics;navigator;initNavigator(){this.navigator=new _r({locations:this.locations.map((e=>e.toJSON())),nodes:this.nodes.map((e=>e.toJSON())),vortexes:this.vortexes.map((e=>e.toJSON())),maps:this.maps.map((e=>e.toJSON()))})}toJSON(){let e={};for(let t in Et)Array.isArray(this[t])&&(e[t]=this[t].map((e=>e.toJSON())));let t={...e,venue:this.venue.toJSON()};return null!=this.rankings&&(t.rankings=this.rankings?.toJSON()),delete t.locationRankings,t}toString(){return this.#t||JSON.stringify(this.toJSON())}};h();var 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"]};h(),h();var ae=function(){return ae=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ae.apply(this,arguments)};function $(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function se(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return s}var da,Gp="ENTRIES",Ss="KEYS",Ps="VALUES",ue="",Lr=function(){function e(e,t){var n=e._tree,r=Array.from(n.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:n,keys:r}]:[]}return e.prototype.next=function(){var e=this.dive();return this.backtrack(),e},e.prototype.dive=function(){if(0===this._path.length)return{done:!0,value:void 0};var e=St(this._path),t=e.node,n=e.keys;if(St(n)===ue)return{done:!1,value:this.result()};var r=t.get(St(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},e.prototype.backtrack=function(){if(0!==this._path.length){var e=St(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},e.prototype.key=function(){return this.set._prefix+this._path.map((function(e){var t=e.keys;return St(t)})).filter((function(e){return e!==ue})).join("")},e.prototype.value=function(){return St(this._path).node.get(ue)},e.prototype.result=function(){switch(this._type){case Ps:return this.value();case Ss:return this.key();default:return[this.key(),this.value()]}},e.prototype[Symbol.iterator]=function(){return this},e}(),St=function(e){return e[e.length-1]},Up=function(e,t,n){var r=new Map;if(void 0===t)return r;for(var i=t.length+1,a=i+n,s=new Uint8Array(a*i).fill(n+1),o=0;o<i;++o)s[o]=o;for(var l=1;l<a;++l)s[l*i]=l;return Fs(e,t,n,r,s,1,i,""),r},Fs=function(e,t,n,r,i,a,s,o){var l,u,h=a*s;try{e:for(var c=$(e.keys()),d=c.next();!d.done;d=c.next()){var f=d.value;if(f===ue){var p=i[h-1];p<=n&&r.set(o,[e.get(f),p])}else{for(var g=a,y=0;y<f.length;++y,++g){for(var m=f[y],v=s*g,_=v-s,w=i[v],M=Math.max(0,g-n-1),b=Math.min(s-1,g+n),x=M;x<b;++x){var O=m!==t[x],E=i[_+x]+ +O,N=i[_+x+1]+1,A=i[v+x]+1,I=i[v+x+1]=Math.min(E,N,A);I<w&&(w=I)}if(w>n)continue e}Fs(e.get(f),t,n,r,i,g,s,o+f)}}}catch(e){l={error:e}}finally{try{d&&!d.done&&(u=c.return)&&u.call(c)}finally{if(l)throw l.error}}},Cr=function(){function e(e,t){void 0===e&&(e=new Map),void 0===t&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return e.prototype.atPrefix=function(t){var n,r;if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");var i=se(Nn(this._tree,t.slice(this._prefix.length)),2),a=i[0],s=i[1];if(void 0===a){var o=se(Ur(s),2),l=o[0],u=o[1];try{for(var h=$(l.keys()),c=h.next();!c.done;c=h.next()){var d=c.value;if(d!==ue&&d.startsWith(u)){var f=new Map;return f.set(d.slice(u.length),l.get(d)),new e(f,t)}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}return new e(a,t)},e.prototype.clear=function(){this._size=void 0,this._tree.clear()},e.prototype.delete=function(e){return this._size=void 0,Vp(this._tree,e)},e.prototype.entries=function(){return new Lr(this,Gp)},e.prototype.forEach=function(e){var t,n;try{for(var r=$(this),i=r.next();!i.done;i=r.next()){var a=se(i.value,2);e(a[0],a[1],this)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.fuzzyGet=function(e,t){return Up(this._tree,e,t)},e.prototype.get=function(e){var t=Gr(this._tree,e);return void 0!==t?t.get(ue):void 0},e.prototype.has=function(e){var t=Gr(this._tree,e);return void 0!==t&&t.has(ue)},e.prototype.keys=function(){return new Lr(this,Ss)},e.prototype.set=function(e,t){if("string"!=typeof e)throw new Error("key must be a string");return this._size=void 0,Rr(this._tree,e).set(ue,t),this},Object.defineProperty(e.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),e.prototype.update=function(e,t){if("string"!=typeof e)throw new Error("key must be a string");this._size=void 0;var n=Rr(this._tree,e);return n.set(ue,t(n.get(ue))),this},e.prototype.fetch=function(e,t){if("string"!=typeof e)throw new Error("key must be a string");this._size=void 0;var n=Rr(this._tree,e),r=n.get(ue);return void 0===r&&n.set(ue,r=t()),r},e.prototype.values=function(){return new Lr(this,Ps)},e.prototype[Symbol.iterator]=function(){return this.entries()},e.from=function(t){var n,r,i=new e;try{for(var a=$(t),s=a.next();!s.done;s=a.next()){var o=se(s.value,2),l=o[0],u=o[1];i.set(l,u)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},e.fromObject=function(t){return e.from(Object.entries(t))},e}(),Nn=function(e,t,n){var r,i;if(void 0===n&&(n=[]),0===t.length||null==e)return[e,n];try{for(var a=$(e.keys()),s=a.next();!s.done;s=a.next()){var o=s.value;if(o!==ue&&t.startsWith(o))return n.push([e,o]),Nn(e.get(o),t.slice(o.length),n)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return n.push([e,t]),Nn(void 0,"",n)},Gr=function(e,t){var n,r;if(0===t.length||null==e)return e;try{for(var i=$(e.keys()),a=i.next();!a.done;a=i.next()){var s=a.value;if(s!==ue&&t.startsWith(s))return Gr(e.get(s),t.slice(s.length))}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},Rr=function(e,t){var n,r,i=t.length;e:for(var a=0;e&&a<i;){try{for(var s=(n=void 0,$(e.keys())),o=s.next();!o.done;o=s.next()){var l=o.value;if(l!==ue&&t[a]===l[0]){for(var u=Math.min(i-a,l.length),h=1;h<u&&t[a+h]===l[h];)++h;var c=e.get(l);if(h===l.length)e=c;else{var d=new Map;d.set(l.slice(h),c),e.set(t.slice(a,a+h),d),e.delete(l),e=d}a+=h;continue e}}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}var f=new Map;return e.set(t.slice(a),f),f}return e},Vp=function(e,t){var n=se(Nn(e,t),2),r=n[0],i=n[1];if(void 0!==r)if(r.delete(ue),0===r.size)Ds(i);else if(1===r.size){var a=se(r.entries().next().value,2),s=a[0],o=a[1];Ls(i,s,o)}},Ds=function(e){if(0!==e.length){var t=se(Ur(e),2),n=t[0],r=t[1];if(n.delete(r),0===n.size)Ds(e.slice(0,-1));else if(1===n.size){var i=se(n.entries().next().value,2),a=i[0],s=i[1];a!==ue&&Ls(e.slice(0,-1),a,s)}}},Ls=function(e,t,n){if(0!==e.length){var r=se(Ur(e),2),i=r[0],a=r[1];i.set(a+t,n),i.delete(a)}},Ur=function(e){return e[e.length-1]},Vr="or",$p="and",Wp="and_not",yt=function(){function e(e){if(null==e?.fields)throw new Error('MiniSearch: option "fields" must be provided');this._options=ae(ae(ae({},qr),e),{searchOptions:ae(ae({},zs),e.searchOptions||{})}),this._index=new Cr,this._documentCount=0,this._documentIds=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this.addFields(this._options.fields)}return e.prototype.add=function(e){var t,n,r,i,a=this._options,s=a.extractField,o=a.tokenize,l=a.processTerm,u=a.fields,h=a.idField,c=s(e,h);if(null==c)throw new Error('MiniSearch: document does not have ID field "'.concat(h,'"'));var d=this.addDocumentId(c);this.saveStoredFields(d,e);try{for(var f=$(u),p=f.next();!p.done;p=f.next()){var g=p.value,y=s(e,g);if(null!=y){var m=o(y.toString(),g),v=this._fieldIds[g],_=new Set(m).size;this.addFieldLength(d,v,this._documentCount-1,_);try{for(var w=(r=void 0,$(m)),M=w.next();!M.done;M=w.next()){var b=l(M.value,g);b&&this.addTerm(v,d,b)}}catch(e){r={error:e}}finally{try{M&&!M.done&&(i=w.return)&&i.call(w)}finally{if(r)throw r.error}}}}}catch(e){t={error:e}}finally{try{p&&!p.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}},e.prototype.addAll=function(e){var t,n;try{for(var r=$(e),i=r.next();!i.done;i=r.next()){var a=i.value;this.add(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.addAllAsync=function(e,t){var n=this;void 0===t&&(t={});var r=t.chunkSize,i=void 0===r?10:r,a={chunk:[],promise:Promise.resolve()},s=e.reduce((function(e,t,r){var a=e.chunk,s=e.promise;return a.push(t),(r+1)%i==0?{chunk:[],promise:s.then((function(){return new Promise((function(e){return setTimeout(e,0)}))})).then((function(){return n.addAll(a)}))}:{chunk:a,promise:s}}),a),o=s.chunk;return s.promise.then((function(){return n.addAll(o)}))},e.prototype.remove=function(e){var t,n,r,i,a,s,o=this._options,l=o.tokenize,u=o.processTerm,h=o.extractField,c=o.fields,d=o.idField,f=h(e,d);if(null==f)throw new Error('MiniSearch: document does not have ID field "'.concat(d,'"'));try{for(var p=$(this._documentIds),g=p.next();!g.done;g=p.next()){var y=se(g.value,2),m=y[0];if(f===y[1]){try{for(var v=(r=void 0,$(c)),_=v.next();!_.done;_=v.next()){var w=_.value,M=h(e,w);if(null!=M){var b=l(M.toString(),w),x=this._fieldIds[w],O=new Set(b).size;this.removeFieldLength(m,x,this._documentCount,O);try{for(var E=(a=void 0,$(b)),N=E.next();!N.done;N=E.next()){var A=u(N.value,w);A&&this.removeTerm(x,m,A)}}catch(e){a={error:e}}finally{try{N&&!N.done&&(s=E.return)&&s.call(E)}finally{if(a)throw a.error}}}}}catch(e){r={error:e}}finally{try{_&&!_.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}return this._storedFields.delete(m),this._documentIds.delete(m),this._fieldLength.delete(m),void(this._documentCount-=1)}}}catch(e){t={error:e}}finally{try{g&&!g.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}throw new Error("MiniSearch: cannot remove document with ID ".concat(f,": it is not in the index"))},e.prototype.removeAll=function(e){var t,n;if(e)try{for(var r=$(e),i=r.next();!i.done;i=r.next()){var a=i.value;this.remove(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Cr,this._documentCount=0,this._documentIds=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},e.prototype.search=function(e,t){var n,r;void 0===t&&(t={});var i=this.executeQuery(e,t),a=[];try{for(var s=$(i),o=s.next();!o.done;o=s.next()){var l=se(o.value,2),u=l[0],h=l[1],c=h.score,d=h.terms,f=h.match,p=d.length,g={id:this._documentIds.get(u),score:c*p,terms:Object.keys(f),match:f};Object.assign(g,this._storedFields.get(u)),(null==t.filter||t.filter(g))&&a.push(g)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return a.sort(Ns),a},e.prototype.autoSuggest=function(e,t){var n,r,i,a;void 0===t&&(t={}),t=ae(ae({},Kp),t);var s=new Map;try{for(var o=$(this.search(e,t)),l=o.next();!l.done;l=o.next()){var u=l.value,h=u.score,c=(v=u.terms).join(" ");null!=(y=s.get(c))?(y.score+=h,y.count+=1):s.set(c,{score:h,terms:v,count:1})}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}var d=[];try{for(var f=$(s),p=f.next();!p.done;p=f.next()){var g=se(p.value,2),y=g[0],m=g[1],v=(h=m.score,m.terms),_=m.count;d.push({suggestion:y,terms:v,score:h/_})}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}return d.sort(Ns),d},Object.defineProperty(e.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),e.loadJSON=function(t,n){if(null==n)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return e.loadJS(JSON.parse(t),n)},e.getDefault=function(e){if(qr.hasOwnProperty(e))return Br(qr,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},e.loadJS=function(t,n){var r,i,a,s,o=t.index,l=t.documentCount,u=t.nextId,h=t.documentIds,c=t.fieldIds,d=t.fieldLength,f=t.averageFieldLength,p=t.storedFields,g=t.serializationVersion;if(1!==g&&2!==g)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var y=new e(n);y._documentCount=l,y._nextId=u,y._documentIds=An(h),y._fieldIds=c,y._fieldLength=An(d),y._avgFieldLength=f,y._storedFields=An(p),y._index=new Cr;try{for(var m=$(o),v=m.next();!v.done;v=m.next()){var _=se(v.value,2),w=_[0],M=_[1],b=new Map;try{for(var x=(a=void 0,$(Object.keys(M))),O=x.next();!O.done;O=x.next()){var E=O.value,N=M[E];1===g&&(N=N.ds),b.set(parseInt(E,10),An(N))}}catch(e){a={error:e}}finally{try{O&&!O.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}y._index.set(w,b)}}catch(e){r={error:e}}finally{try{v&&!v.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}return y},e.prototype.executeQuery=function(e,t){var n=this;if(void 0===t&&(t={}),"string"!=typeof e){var r=ae(ae(ae({},t),e),{queries:void 0}),i=e.queries.map((function(e){return n.executeQuery(e,r)}));return this.combineResults(i,e.combineWith)}var a=this._options,s=a.tokenize,o=a.processTerm,l=a.searchOptions,u=ae(ae({tokenize:s,processTerm:o},l),t),h=u.tokenize,c=u.processTerm,d=h(e).map((function(e){return c(e)})).filter((function(e){return!!e})).map(Jp(u)).map((function(e){return n.executeQuerySpec(e,u)}));return this.combineResults(d,u.combineWith)},e.prototype.executeQuerySpec=function(e,t){var n,r,i,a,s,o,l=ae(ae({},this._options.searchOptions),t),u=(l.fields||this._options.fields).reduce((function(e,t){var n;return ae(ae({},e),((n={})[t]=Br(e,t)||1,n))}),l.boost||{}),h=l.boostDocument,c=l.weights,d=l.maxFuzzy,f=ae(ae({},zs.weights),c),p=f.fuzzy,g=f.prefix,y=this._index.get(e.term),m=this.termResults(e.term,e.term,1,y,u,h);if(e.prefix&&(s=this._index.atPrefix(e.term)),e.fuzzy){var v=!0===e.fuzzy?.2:e.fuzzy,_=v<1?Math.min(d,Math.round(e.term.length*v)):v;_&&(o=this._index.fuzzyGet(e.term,_))}if(s)try{for(var w=$(s),M=w.next();!M.done;M=w.next()){var b=se(M.value,2),x=b[0],O=b[1];if(I=x.length-e.term.length){o?.delete(x);var E=g*x.length/(x.length+.3*I);this.termResults(e.term,x,E,O,u,h,m)}}}catch(e){n={error:e}}finally{try{M&&!M.done&&(r=w.return)&&r.call(w)}finally{if(n)throw n.error}}if(o)try{for(var N=$(o.keys()),A=N.next();!A.done;A=N.next()){x=A.value;var I,k=se(o.get(x),2),T=k[0];if(I=k[1]){E=p*x.length/(x.length+I);this.termResults(e.term,x,E,T,u,h,m)}}}catch(e){i={error:e}}finally{try{A&&!A.done&&(a=N.return)&&a.call(N)}finally{if(i)throw i.error}}return m},e.prototype.combineResults=function(e,t){if(void 0===t&&(t=Vr),0===e.length)return new Map;var n=t.toLowerCase();return e.reduce(Hp[n])||new Map},e.prototype.toJSON=function(){var e,t,n,r,i=[];try{for(var a=$(this._index),s=a.next();!s.done;s=a.next()){var o=se(s.value,2),l=o[0],u=o[1],h={};try{for(var c=(n=void 0,$(u)),d=c.next();!d.done;d=c.next()){var f=se(d.value,2),p=f[0],g=f[1];h[p]=Object.fromEntries(g)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}i.push([l,h])}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),index:i,serializationVersion:2}},e.prototype.termResults=function(e,t,n,r,i,a,s){var o,l,u,h,c;if(void 0===s&&(s=new Map),null==r)return s;try{for(var d=$(Object.keys(i)),f=d.next();!f.done;f=d.next()){var p=f.value,g=i[p],y=this._fieldIds[p],m=r.get(y);if(null!=m){var v=m.size,_=this._avgFieldLength[y];try{for(var w=(u=void 0,$(m.keys())),M=w.next();!M.done;M=w.next()){var b=M.value,x=a?a(this._documentIds.get(b),t):1;if(x){var O=m.get(b),E=this._fieldLength.get(b)[y],N=n*g*x*Xp(O,v,this._documentCount,E,_),A=s.get(b);if(A){A.score+=N,Zp(A.terms,e);var I=Br(A.match,t);I?I.push(p):A.match[t]=[p]}else s.set(b,{score:N,terms:[e],match:(c={},c[t]=[p],c)})}}}catch(e){u={error:e}}finally{try{M&&!M.done&&(h=w.return)&&h.call(w)}finally{if(u)throw u.error}}}}}catch(e){o={error:e}}finally{try{f&&!f.done&&(l=d.return)&&l.call(d)}finally{if(o)throw o.error}}return s},e.prototype.addTerm=function(e,t,n){var r=this._index.fetch(n,Es),i=r.get(e);if(null==i)(i=new Map).set(t,1),r.set(e,i);else{var a=i.get(t);i.set(t,(a||0)+1)}},e.prototype.removeTerm=function(e,t,n){if(this._index.has(n)){var r=this._index.fetch(n,Es),i=r.get(e);null==i||null==i.get(t)?this.warnDocumentChanged(t,e,n):i.get(t)<=1?i.size<=1?r.delete(e):i.delete(t):i.set(t,i.get(t)-1),0===this._index.get(n).size&&this._index.delete(n)}else this.warnDocumentChanged(t,e,n)},e.prototype.warnDocumentChanged=function(e,t,n){var r,i;if(null!=console&&null!=console.warn)try{for(var a=$(Object.keys(this._fieldIds)),s=a.next();!s.done;s=a.next()){var o=s.value;if(this._fieldIds[o]===t)return void console.warn("MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(n,'" was not present in field "').concat(o,'". Removing a document after it has changed can corrupt the index!'))}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}},e.prototype.addDocumentId=function(e){var t=this._nextId;return this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},e.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},e.prototype.addFieldLength=function(e,t,n,r){var i=this._fieldLength.get(e);null==i&&this._fieldLength.set(e,i=[]),i[t]=r;var a=(this._avgFieldLength[t]||0)*n+r;this._avgFieldLength[t]=a/(n+1)},e.prototype.removeFieldLength=function(e,t,n,r){var i=this._avgFieldLength[t]*n-r;this._avgFieldLength[t]=i/(n-1)},e.prototype.saveStoredFields=function(e,t){var n,r,i=this._options,a=i.storeFields,s=i.extractField;if(null!=a&&0!==a.length){var o=this._storedFields.get(e);null==o&&this._storedFields.set(e,o={});try{for(var l=$(a),u=l.next();!u.done;u=l.next()){var h=u.value,c=s(t,h);void 0!==c&&(o[h]=c)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}},e}(),Br=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},Hp=((da={})[Vr]=function(e,t){var n,r;try{for(var i=$(t.keys()),a=i.next();!a.done;a=i.next()){var s=a.value,o=e.get(s);if(null==o)e.set(s,t.get(s));else{var l=t.get(s),u=l.score,h=l.terms,c=l.match;o.score=o.score+u,o.match=Object.assign(o.match,c),As(o.terms,h)}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},da[$p]=function(e,t){var n,r,i=new Map;try{for(var a=$(t.keys()),s=a.next();!s.done;s=a.next()){var o=s.value,l=e.get(o);if(null!=l){var u=t.get(o),h=u.score,c=u.terms,d=u.match;As(l.terms,c),i.set(o,{score:l.score+h,terms:l.terms,match:Object.assign(l.match,d)})}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},da[Wp]=function(e,t){var n,r;try{for(var i=$(t.keys()),a=i.next();!a.done;a=i.next()){var s=a.value;e.delete(s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},da),Is=1.2,Os=.7,Yp=.5,Xp=function(e,t,n,r,i){return Math.log(1+(n-t+.5)/(t+.5))*(Yp+e*(Is+1)/(e+Is*(1-Os+Os*r/i)))},Jp=function(e){return function(t,n,r){return{term:t,fuzzy:"function"==typeof e.fuzzy?e.fuzzy(t,n,r):e.fuzzy||!1,prefix:"function"==typeof e.prefix?e.prefix(t,n,r):!0===e.prefix}}},qr={idField:"id",extractField:function(e,t){return e[t]},tokenize:function(e,t){return e.split(Qp)},processTerm:function(e,t){return e.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},zs={combineWith:Vr,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},Kp={prefix:function(e,t,n){return t===n.length-1}},Zp=function(e,t){e.includes(t)||e.push(t)},As=function(e,t){var n,r;try{for(var i=$(t),a=i.next();!a.done;a=i.next()){var s=a.value;e.includes(s)||e.push(s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},Ns=function(e,t){var n=e.score;return t.score-n},Es=function(){return new Map},An=function(e){var t,n,r=new Map;try{for(var i=$(Object.keys(e)),a=i.next();!a.done;a=i.next()){var s=a.value;r.set(parseInt(s,10),e[s])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},Qp=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;h();var eh=["0","1","2","3","4","5","6","7","8","9"],th=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],ah=["0","1","2","3","4","5","6","7","8","9"],nh=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],Ik=[...eh,...th,...ah,...nh],Cs=["about","after","all","also","am","an","and","another","any","are","as","at","be","because","been","before","being","between","both","but","by","came","can","come","could","did","do","each","for","from","get","got","has","had","he","have","her","here","him","himself","his","how","if","in","into","is","it","like","make","many","me","might","more","most","much","must","my","never","now","of","on","only","or","other","our","out","over","said","same","should","since","some","still","such","take","than","that","the","their","them","then","there","these","they","this","those","through","to","too","under","up","very","was","way","we","well","were","what","where","which","while","who","with","would","you","your","a","i"];h();var rh=32,ke=!1,ih=120,$r=0,En=class{constructor(e){this._callback=e.callback,this._frameCount=null!=e.frameCount?e.frameCount:1,this._ordering=null!=e.ordering?e.ordering:0,this._supersededBy=null!=e.supersededBy?new Set(e.supersededBy):new Set,this.name=e.name,this.userdata=e.userdata,this._remainingFrameCount=this._frameCount,this._lastFrameTime=0,ke&&z.log("update instantiated",this.name)}_callback;_frameCount;_ordering;_supersededBy;name;_remainingFrameCount;_lastFrameTime;userdata;getLastFrameTime(){return this._lastFrameTime}},We=class{constructor(e){if(null!=e.group&&null!=e.priority)throw new Error("cannot specify task priority individually within group");if(null!=e.group&&null!=e.postponeOnAdd)throw new Error("cannot specify task postpone individually within group");this._callback=e.callback,this._group=null!=e.group?e.group:null,this._priority=null!=e.priority?e.priority:0,this._postponed=null!=e.postponeOnAdd&&e.postponeOnAdd,this.name=e.name,this.userdata=e.userdata,this._complete=!1,this._scheduled=!1,this._cancelled=!1,this._lastFrameTime=0,ke&&z.log("task instantiated",this.name)}_postponed;userdata;_priority;_group;name;_lastFrameTime;_callback;_complete;_scheduled;_cancelled;isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}},Sn=class{constructor(e){this._onComplete=null!=e.onComplete?e.onComplete:()=>{},this._priority=null!=e.priority?e.priority:0,this._postponed=null!=e.postponeOnAdd&&e.postponeOnAdd,this.name=e.name,this.userdata=e.userdata,this._tasks=new Set,this._scheduledTasks=new Set,this._scheduled=!1,this._cancelled=!1,ke&&z.log("task group instantiated",this.name)}_postponed;_onComplete;_priority;userdata;name;_tasks;_scheduledTasks;_scheduled;_cancelled;isComplete(){return 0===this._scheduledTasks.size}getTasks(){return Array.from(this._tasks.values())}clear(){this._tasks.clear(),this._scheduledTasks.clear()}_popTask(){for(let e of this._scheduledTasks)return this._scheduledTasks.delete(e),e}},Wr=class{_maxMillisecondsPerFrame;_time;constructor(e){this._maxMillisecondsPerFrame=null!=e?.maxMillisecondsPerFrame?e.maxMillisecondsPerFrame:rh,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}},Pn=class{constructor(e){this._timer=null!=e?.timer?e.timer:new Wr,this._performance=null!=e?.performance&&e.performance,this._scheduledUpdatesByOrdering=new Pt,this._scheduledTasksByPriority=new Pt,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),ke&&z.log("task scheduler instantiated"),globalThis.MappedinDebug?.TEST_IOS&&(this._raf=e=>setTimeout(e,16))}_raf;_timer;_performance;_scheduledUpdatesByOrdering;_scheduledTasksByPriority;_postponedTasks;_requestAnimationFrameHandle;_updatesToRunThisFrame;_lastFrameTime=0;_updatesRunLastFrame;clear(){for(let e of this._scheduledTasksByPriority.values())e._cancelled=!0;for(let e of this._postponedTasks.values())e._cancelled=!0;this._scheduledUpdatesByOrdering=new Pt,this._scheduledTasksByPriority=new Pt,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),ke&&z.log("task scheduler cleared")}destroy(){this.clear()}requestAnimationFrame(){null==this._requestAnimationFrameHandle&&(this._requestAnimationFrameHandle="function"==typeof this._raf?this._raf(this.update):requestAnimationFrame(this.update))}update(e){let t;this._timer.beginFrame(),this._performance&&(t=performance.now());let n=!1;ke&&(0===$r&&(n=!0),++$r,$r%=ih);let r=this._scheduledUpdatesByOrdering.keys();for(let e=r.length-1;e>=0;--e){let t=r[e];for(let e of this._scheduledUpdatesByOrdering.get(t).values())this._updatesToRunThisFrame.push(e),n&&z.log("update scheduled to run this frame",e.name)}for(let e of this._updatesToRunThisFrame){--e._remainingFrameCount,e._remainingFrameCount<=0&&this._scheduledUpdatesByOrdering.delete(e._ordering,e),e._superseded=!1;for(let t of this._updatesToRunThisFrame)e._supersededBy.has(t)&&(e._superseded=!0,n&&z.log("update superseded",e.name,t.name))}for(let e=0;e<this._updatesToRunThisFrame.length;++e)this._updatesToRunThisFrame[e]._superseded&&(this._updatesToRunThisFrame.splice(e,1),--e);for(let t of this._updatesToRunThisFrame){let r;this._performance&&(r=performance.now()),t._callback(e),this._performance&&(t._lastFrameTime=performance.now()-r),n&&z.log("update completed",t.name)}this._updatesRunLastFrame.clear();for(let e of this._updatesToRunThisFrame)this._updatesRunLastFrame.add(e);if(this._updatesToRunThisFrame.splice(0,this._updatesToRunThisFrame.length),this._scheduledTasksByPriority.size>0)do{this._executeOneTask(e)}while(this._timer.hasTimeRemaining()&&this._scheduledTasksByPriority.size>0);this._performance&&(this._lastFrameTime=performance.now()-t),this._requestAnimationFrameHandle=null,(this._scheduledUpdatesByOrdering.size>0||this._scheduledTasksByPriority.size>0)&&this.requestAnimationFrame()}flushTasks(){for(;this._scheduledTasksByPriority.size>0;)this._executeOneTask(performance.now())}getLastFrameTime(){return this._lastFrameTime}getUpdatesRunLastFrame(){return this._updatesRunLastFrame}_executeOneTask(e){let t,n=this._scheduledTasksByPriority.popFromMaxKey(),r=null;z.assert(void 0!==n),Object.getPrototypeOf(n)===Sn.prototype&&(r=n,n=r._popTask()),z.assert(void 0!==n),z.assert(Object.getPrototypeOf(n)===We.prototype),this._performance&&(t=performance.now()),n._callback(e),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-t),ke&&z.log("task completed",n.name),null!=r&&(r.isComplete()?(r.clear(),r._onComplete(),ke&&z.log("group completed",r.name)):this._scheduledTasksByPriority.insert(r._priority,r))}scheduleUpdate(e){e._remainingFrameCount=e._frameCount,this._scheduledUpdatesByOrdering.insert(e._ordering,e),this.requestAnimationFrame()}scheduleTask(e){if(Object.getPrototypeOf(e)===Sn)throw new Error("frame task groups are automatically scheduled when a task is added to them and cannot be manually scheduled: "+e.name);if(e._scheduled)throw new Error("cannot schedule already scheduled task: "+e.name);if(e._cancelled)throw new Error("cannot schedule cancelled task: "+e.name);let t=e;"_group"in e&&null!=e._group&&(e._group._tasks.add(e),e._group._scheduledTasks.add(e),t=e._group),t._postponed?this._postponedTasks.add(t):this._scheduledTasksByPriority.insert(t._priority,t),e._scheduled=!0,t._scheduled=!0,ke&&z.log("task scheduled",e.name),this.requestAnimationFrame()}cancelUpdate(e){this._scheduledUpdatesByOrdering.delete(e._ordering,e),ke&&z.log("update cancelled",e.name)}cancelTask(e){if(!e._scheduled)throw new Error("cannot cancel task that has not been scheduled: "+e.name);if(e._cancelled)throw new Error("cannot cancel task that has already been cancelled: "+e.name);if("_group"in e&&null!=e._group){let t=e._group.isComplete();e._group._tasks.delete(e),e._group._scheduledTasks.delete(e),e._group.isComplete()&&(this._scheduledTasksByPriority.delete(e._group._priority,e._group),t||e._group._onComplete())}else this._scheduledTasksByPriority.delete(e._priority,e),this._postponedTasks.delete(e);Object.getPrototypeOf(e)===We.prototype?e._cancelled=!0:"clear"in e&&e.clear(),ke&&z.log("task cancelled",e.name)}postponeTask(e){if("_group"in e&&null!=e._group)throw new Error("cannot postpone individual tasks in group: "+e.name);if(e._cancelled)throw new Error("cannot postpone cancelled task: "+e.name);if(!e._postponed){if(Object.getPrototypeOf(e)===We.prototype){if("_complete"in e)return;if(!e._scheduled)throw new Error("cannot postpone task that has not been scheduled: "+e.name)}this._scheduledTasksByPriority.delete(e._priority,e),(Object.getPrototypeOf(e)===We.prototype||!e.isComplete())&&this._postponedTasks.add(e),e._postponed=!0,ke&&z.log("task postponed",e.name)}}resumeTask(e){if("_group"in e&&null!=e._group)throw new Error("cannot resume individual tasks in groups");if(e._cancelled)throw new Error("cannot resume cancelled task");if(e._postponed){if(Object.getPrototypeOf(e)===We.prototype){if("_complete"in e&&e._complete)return;if(!e._scheduled)throw new Error("cannot resume unscheduled task")}this._postponedTasks.delete(e),(Object.getPrototypeOf(e)===We.prototype||!e.isComplete())&&this._scheduledTasksByPriority.insert(e._priority,e),e._postponed=!1,this.requestAnimationFrame(),ke&&z.log("task resumed",e.name)}}setTaskPriority(e,t){if(Object.getPrototypeOf(e)===We.prototype&&!e._scheduled)throw new Error("task must be scheduled to be reprioritized");this._scheduledTasksByPriority.has(e._priority,e)&&(this._scheduledTasksByPriority.delete(e._priority,e),this._scheduledTasksByPriority.insert(t,e)),e._priority=t,ke&&z.log("task priority changed",e.name,t)}},Pt=class{constructor(){this._map=new Map,this._size=0,this._sortedKeys=[]}_map;_size;_sortedKeys;has(e,t){return null!=this._map.get(e)&&this._map.get(e).has(t)}get(e){return this._map.get(e)}insert(e,t){if(z.assert("number"==typeof e&&Number.isFinite(e)),null==this._map.get(e)){this._map.set(e,new Set);for(let t=0;t<=this._sortedKeys.length;++t)if(t===this._sortedKeys.length||e<this._sortedKeys[t]){this._sortedKeys.splice(t,0,e);break}}this._map.get(e).has(t)||(this._map.get(e).add(t),++this._size)}delete(e,t){null!=this._map.get(e)&&this._map.get(e).has(t)&&(this._map.get(e).delete(t),--this._size,0===this._map.get(e).size&&(this._map.delete(e),this._sortedKeys.splice(this._sortedKeys.indexOf(e),1)))}pop(e){if(null!=this._map.get(e)){let t;for(t of this._map.get(e).values()){this._map.get(e).delete(t),--this._size;break}return 0===this._map.get(e).size&&(this._map.delete(e),this._sortedKeys.splice(this._sortedKeys.indexOf(e),1)),t}}popFromMaxKey(){if(this._sortedKeys.length>0)return this.pop(this._sortedKeys[this._sortedKeys.length-1])}values(){let e=this._map.keys(),t=null,n={[Symbol.iterator]:()=>n,next:()=>{if(null==t){let n=e.next();if(n.done)return n;t=this._map.get(n.value).values()}let n=t.next();for(;n.done;){let r=e.next();if(r.done)return r;t=this._map.get(r.value).values(),n=t.next()}return n}};return n}keys(){return this._sortedKeys}get size(){let e=0;for(let t of this._map.values())e+=t.size;return z.assert(e===this._size),e}},He=e=>e.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase(),Ft="",oh=.09,sh=1,uh=.025,lh=.5,ch=5e-4,dh=5e-4,ph=.01,hh=.05,Rs=1,mh=.01,fh=.2,gh={MappedinCategory:"categories",MappedinLocation:"locations"},yh={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:Cs,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===M.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:oh,PRIMARY_INDEX_WEIGHT:sh,SECONDARY_INDEX_WEIGHT:uh,CATEGORY_NAME_WEIGHT:lh,LOCATION_NAME_WEIGHT:Rs,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:ch,CATEGORY_LOCATION_TAGS_WEIGHT:dh,CATEGORY_LOCATION_NAME_WEIGHT:ph,PRIMARY_INDEX_TAGS_NAME_WEIGHT:hh,LOCATION_DEFAULT_RANK:Rs,RATIO_OF_FUZZY_TO_EXACT:mh,RATIO_OF_PREFIX_TO_EXACT:fh}},Hr=class{#e;#t;#n;#r;#i;#a=new Pn({performance:!0});#s;#o;#l=new Map;constructor(e,t){this.#o=new zn({...e.options,testMode:!1===t?.emitAnalyticsEvents}),this.#i={...yh,...t},this.#e=e,this.#s=new Set(this.#i?.stopWords);let{PRIMARY_INDEX_FUZZYNESS:n,PRIMARY_INDEX_WEIGHT:r,CATEGORY_NAME_WEIGHT:i,RATIO_OF_FUZZY_TO_EXACT:a,RATIO_OF_PREFIX_TO_EXACT:s,PRIMARY_INDEX_TAGS_NAME_WEIGHT:o}=this.#i.constants,l=["object","query","weight","tag","rank"],u={fields:["query","name","tag"],storeFields:l,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:n},boost:{name:r,query:r,tag:o},weights:{fuzzy:a,prefix:s},boostDocument:e=>e.includes("MappedinLocation")?r:e.includes("MappedinCategory")?i:r},h={fields:["description"],storeFields:l,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(e,t)=>this.#s?.has(e.toLowerCase())?null:e.toLowerCase()},c={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...l,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(this.#h=new Promise((e=>{this.#c=e})),this.#i?.jsonIndex){let{primary:e,secondary:t,extra:n}=JSON.parse(this.#i?.jsonIndex);this.#t=yt.loadJS(e,u),this.#n=yt.loadJS(t,h),this.#r=yt.loadJS(n,c)}else this.#t=new yt(u),this.#n=new yt(h),this.#r=new yt(c),this.#e.locations.forEach(this.#d),this.#e.categories.forEach(this.#f);this.#a.update(performance.now()),this.#p=Ir(((e,t)=>{this.#o.trackSearchSuggest({query:e,hits:t})}),300),this.#g=Ir(((e,t)=>{this.#o.trackSearch({query:e,hits:t})}),300)}#u=0;#y=e=>{this.#u++,this.#a.scheduleUpdate(new En({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{e(),this.#u--,0===this.#u&&this.#c()}}))};#d=e=>{let{SECONDARY_INDEX_WEIGHT:t,LOCATION_DEFAULT_RANK:n,PRIMARY_INDEX_TAGS_NAME_WEIGHT:r}=this.#i.constants,i=n;this.#i?.useLocationRank&&(i=Array.isArray(e.polygons)?Math.max(...e.polygons.map((e=>e.rank?.score?e.rank?.score:n)),n):n),this.#y((()=>{this.#t.add({name:He(e.name),tags:"",id:"MappedinLocation_"+e.id,weight:n,rank:i})})),this.#i?.searchTags&&Array.isArray(e.tags)&&e.tags.forEach((t=>{this.#t.add({name:"",tag:He(t),id:"MappedinLocation_"+e.id,weight:r,rank:i})})),this.#i?.searchDescriptions&&this.#y((()=>this.#n.add({description:He(e.description||""),id:"MappedinLocation_"+e.id,weight:t,rank:i})))};#f=e=>{let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:t,CATEGORY_LOCATION_TAGS_WEIGHT:n,CATEGORY_LOCATION_NAME_WEIGHT:r,CATEGORY_NAME_WEIGHT:i}=this.#i.constants;this.#y((()=>this.#t.add({name:He(e.name||""),description:"",id:"MappedinCategory_"+e.id,weight:i})));let a=e.locations.reduce(((e,t)=>e+` ${Ft} `+t.name),"")+` ${Ft}`;if(this.#i?.searchDescriptionsInCategories&&e.locations.forEach((n=>{null!=n.description&&this.#y((()=>this.#r.add({id:"MappedinCategory_"+e.id,"category.locations.description":He(n.description),ref:n.name,weight:t})))})),this.#i?.searchTagsInCategories){let t=e.locations.reduce(((e,t)=>e+t.tags?.reduce(((e,t)=>e+` ${Ft} `+t),"")+` ${Ft}`),"");this.#y((()=>this.#r.add({"category.locations.tags":He(t),id:"MappedinCategory_"+e.id,weight:n})))}this.#y((()=>this.#r.add({"category.locations.name":He(a),id:"MappedinCategory_"+e.id,weight:r})))};#h;#c;#m=e=>{let t=e.score,{object:n,id:r,weight:i,rank:a}=e,[s,o]=r.split("_"),l=n||this.#e.getCollectionItemById(gh[s],o);return a&&this.#i?.useLocationRank&&(t+=a),i&&(t*=i),{score:t,type:s,object:l}};#v=(e,t)=>{for(let n in e.match)e.match[n].forEach((r=>{let i=e.ref||e[r]||t.object[r];if("category.locations.tags"===r||"category.locations.name"===r){let t=new RegExp(`[^${Ft}]* `+n+` [^${Ft}]*`,"ig").exec(e[r]);null!=t&&(i=t[0].slice(1,-1))}t.matches.push({term:n,weight:e.weight,matchesOn:r,value:i})}))};#_(e){let t=[],n=He(e);t=[...this.#t.search(n),...this.#n.search(n),...this.#r.search(n)].sort(((e,t)=>t.score-e.score));let r={};for(let e of t){let t=this.#m(e);r[e.id]?r[e.id].score+=t.score:r[e.id]={...t,matches:[]},this.#v(e,r[e.id])}return Object.keys(r).map((e=>({...r[e],matches:r[e].matches.sort(((e,t)=>t.weight-e.weight))}))).sort(((e,t)=>t.score-e.score))}async suggest(e){await this.#h;let{PRIMARY_INDEX_FUZZYNESS:t,PRIMARY_INDEX_WEIGHT:n,PRIMARY_INDEX_TAGS_NAME_WEIGHT:r,RATIO_OF_FUZZY_TO_EXACT:i,RATIO_OF_PREFIX_TO_EXACT:a}=this.#i.constants,s=this.#t.autoSuggest(e,{fields:["name","tag","query"],combineWith:"AND",prefix:!0,fuzzy:t,boost:{name:n,query:n,tag:r},weights:{fuzzy:i,prefix:a}});return this.#p(e,s.length),{total:s.length,hits:s.map((e=>({text:e.suggestion})))}}async search(e){await this.#h;let t=this.#_(e);return this.#g(e,t.length),t}async toJSON(){return await this.#h,JSON.stringify({primary:this.#t,secondary:this.#n,extra:this.#r})}#p;#g;async addQuery(e){let t,n,{query:r,object:i,weight:a=1}=e;await this.#h,t=i instanceof we?"MappedinLocation":i instanceof Re?"MappedinCategory":"Custom","MappedinLocation"===t||"MappedinCategory"===t?n=t+"_"+i.id:"string"==typeof i.id?n="Custom_"+i.id:(n=this.#l.get(i),n||(n="Custom_"+Ve(),this.#l.set(i,n))),this.#t.add({id:n,weight:a,object:i,query:He(r)})}};h();var Bs=(e=>(e.MULTI_GEOMETRY="MULTI_GEOMETRY",e.SINGLE_GEOMETRY="SINGLE_GEOMETRY",e))(Bs||{}),gi=globalThis.fetch;function Qe(){if(null==gi)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return gi}function Zk(e){gi=e}var Bh=M?.env?.npm_package_version;globalThis.btoa||(globalThis.btoa=Tu.encode);var qh=["ar"];function ka(e){let t={...Dr,things:Ts,...e};return t.headers={...t.headers,"mappedin-sdk-version":Bh},e.platformString&&(t.headers={...t.headers,"mappedin-platform-version":e.platformString}),t.noAuth||(t.accessToken?t.authorization=`Bearer ${t.accessToken}`:t.clientId&&t.clientSecret&&(t.authorization=`Basic ${globalThis.btoa(`${t.clientId}:${t.clientSecret}`)}`)),t}async function eb(e){let{venue:t,clientId:n,clientSecret:r,bundleBaseUri:i}=e,a=new st({venue:t}),s=Qo(await Vh({clientId:n,clientSecret:r,venue:t,bundleBaseUri:i},!1));return a.hydrateFromMVF(s),a}async function Gh(e){let t=ka({baseUrl:"https://api-gateway.mappedin.com/",...{emitAnalyticsEvents:!0,...e}}),n="public/1/"+(t.useDraftData?"draft/":""),r=new st({...t,baseUrl:t.baseUrl+n});return await r.fetch(),r}function tb(e){Gh=e}var yi={shouldPopulateBundledImagesAsBlobs:!(typeof globalThis.navigator<"u"&&"ReactNative"==globalThis.navigator.product)};async function ab(e){let t=ka({baseUrl:"https://api-gateway.mappedin.com/",...yi,...e}),{url:n,updated_at:r}=await Uh(e),i=await Qe()(n,{mode:"cors"}),{data:a,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error(`Unrecognized format ${s}`);let o=new st(t);return await o.hydrate(a,t.shouldPopulateBundledImagesAsBlobs),o.updatedAt=r,o}async function Uh(e){let t=ka({baseUrl:"https://api-gateway.mappedin.com/",...yi,...e}),{version:n,venue:r}=e,i=`${e.bundleBaseUri||t.baseUrl+`exports/legacy${null!=t.language&&qh.includes(t.language)?"-"+t.language:""}/1/bundle`}?venue=${r}&version=1.0.0`;return t.language=void 0,await In(t,i)}async function nb(e,{url:t,updated_at:n}){let r=ka({baseUrl:"https://api-gateway.mappedin.com/",...yi,...e}),i=await Qe()(t,{mode:"cors"}),{data:a,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error(`Unrecognized format${s}`);let o=new st(r);return await o.hydrate(a,r.shouldPopulateBundledImagesAsBlobs),o.updatedAt=n,o}async function ju(e){let t=ka({baseUrl:"https://api-gateway.mappedin.com/",...Dr,...e}),{version:n,venue:r}=e,i=`${e.bundleBaseUri||t.baseUrl+"exports/mvf/1/bundle"}?venue=${r}&version=1.0.0`;return t.language=void 0,await In(t,i)}async function Vh(e,t=!1){return new Promise((async(n,r)=>{try{let i=new TextDecoder,a=i.decode.bind(i),s=await Promise.resolve().then((()=>(_u(),xu)));if(t){let t=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:i}=await ju(e),o=new Uint8Array(await Qe()(i).then((e=>e.arrayBuffer()))),l=s.unzipSync(o),u=Object.keys(l),h=Math.min(u.length,Math.min(4,navigator.hardwareConcurrency)||4),c=[],d=u.map((e=>[e,l[e].buffer])),f=1e6,p=[],g=[];for(let e=0;e<d.length;e++){let[,t]=d[e];t.byteLength>=f?p.push(d[e]):t.byteLength<f&&g.push(d[e])}let y={};if(0===g.length)d.forEach((([e])=>{y[e]=JSON.parse(a(l[e]))})),n(y);else{let e=function({data:e}){let t=this;if("finished"===e[0]){let n=g[s];if(null!=n){let[e,r]=n;t.postMessage(["task",e]),t.postMessage(r,[r]),s++}let[r,i]=e[1];y[r]=i,o++}else if("error"===e[0]){let[,t]=e;c.forEach((e=>e.terminate())),r(t)}o===u.length&&(n(y),c.forEach((e=>e.terminate())))};let i=URL.createObjectURL(t);for(let e=0;e<Math.min(h,g.length);e++)c.push(new Worker(i));let s=0,o=0;c.forEach((t=>{if(t.onmessage=e,null!=g[s]){let[e,n]=g[s];t.postMessage(["task",e]),t.postMessage(n,[n]),s++}})),p.forEach((([e])=>{y[e]=JSON.parse(a(l[e])),o++}))}}else{let{url:t}=await ju(e),r=new Uint8Array(await Qe()(t).then((e=>e.arrayBuffer()))),i=s.unzipSync(r),o=Object.keys(i),l={};for(let e=0;e<o.length;e++){let t=o[e];if(0===t.indexOf("image/")&&-1===t.indexOf("__MACOSX"))l[t]=i[t].buffer;else if("/"!==t.slice(-1))try{l[t]=JSON.parse(a(i[t]))}catch{z.warn("bad file",t)}}n(l)}}catch(e){r(e)}}))}export{Bs as MAP_RENDER_MODE,st as Mappedin,Re as MappedinCategory,oa as MappedinCollectionType,xt as MappedinCoordinate,ra as MappedinDestinationSet,wt as MappedinDirections,et as MappedinEvent,we as MappedinLocation,tt as MappedinMap,at as MappedinMapGroup,Ue as MappedinNavigatable,nt as MappedinNode,Ce as MappedinPolygon,rt as MappedinRankings,it as MappedinVenue,ot as MappedinVortex,Hr as OfflineSearch,tb as __setGetVenueMock,nb as downloadBundle,Vh as downloadVenueBundleMVF,Gh as getVenue,ab as getVenueBundle,Uh as getVenueBundleURL,eb as getVenueMVF,ju as getVenueMVFURL,Qe as isomorphicFetch,Zk as setFetchFn};
|