@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
package/lib/node/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var eo,C,$r=Object.create,ta=Object.defineProperty,Wr=Object.getOwnPropertyDescriptor,Hr=Object.getOwnPropertyNames,Jr=Object.getPrototypeOf,Xr=Object.prototype.hasOwnProperty,Yr=(t,e,n)=>e in t?ta(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,vi=t=>ta(t,"__esModule",{value:!0}),Kr=(t,e)=>()=>(t&&(e=t(t=0)),e),ht=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Zr=(t,e)=>{for(var n in vi(t),e)ta(t,n,{get:e[n],enumerable:!0})},Qr=(t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of Hr(e))!Xr.call(t,i)&&"default"!==i&&ta(t,i,{get:()=>e[i],enumerable:!(n=Wr(e,i))||n.enumerable});return t},tn=t=>Qr(vi(ta(null!=t?$r(Jr(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),c=(t,e,n)=>(Yr(t,"symbol"!=typeof e?e+"":e,n),n),Rn=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},l=(t,e,n)=>(Rn(t,e,"read from private field"),n?n.call(t):e.get(t)),O=(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)},N=(t,e,n,i)=>(Rn(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n),nt=(t,e,n)=>(Rn(t,e,"access private method"),n),T=Kr((()=>{C={env:eo={NODE_ENV:"production",npm_package_version:"5.0.2"}}})),wi=ht(((t,e)=>{T(),function(n){var i="object"==typeof t&&t,r="object"==typeof e&&e&&e.exports==i&&e,a="object"==typeof global&&global;(a.global===a||a.window===a)&&(n=a);var s=function(t){this.message=t};(s.prototype=new Error).name="InvalidCharacterError";var o=function(t){throw new s(t)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=/[\t\n\f\r ]/g,c={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,i,r,a=t.length%3,s="",h=-1,c=t.length-a;++h<c;)e=t.charCodeAt(h)<<16,n=t.charCodeAt(++h)<<8,i=t.charCodeAt(++h),s+=l.charAt((r=e+n+i)>>18&63)+l.charAt(r>>12&63)+l.charAt(r>>6&63)+l.charAt(63&r);return 2==a?(e=t.charCodeAt(h)<<8,n=t.charCodeAt(++h),s+=l.charAt((r=e+n)>>10)+l.charAt(r>>4&63)+l.charAt(r<<2&63)+"="):1==a&&(r=t.charCodeAt(h),s+=l.charAt(r>>2)+l.charAt(r<<4&63)+"=="),s},decode:function(t){var e=(t=String(t).replace(h,"")).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,i,r=0,a="",s=-1;++s<e;)i=l.indexOf(t.charAt(s)),n=r%4?64*n+i:i,r++%4&&(a+=String.fromCharCode(255&n>>(-2*r&6)));return a},version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return c}));else if(i&&!i.nodeType)if(r)r.exports=c;else for(var u in c)c.hasOwnProperty(u)&&(i[u]=c[u]);else n.base64=c}(t)})),ji=ht(((t,e)=>{var n,i;T(),n="undefined"!=typeof self?self:t,i=function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e||4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"computeDestinationPoint",(function(){return R})),n.d(e,"convertArea",(function(){return B})),n.d(e,"convertDistance",(function(){return L})),n.d(e,"convertSpeed",(function(){return C})),n.d(e,"decimalToSexagesimal",(function(){return W})),n.d(e,"findNearest",(function(){return U})),n.d(e,"getAreaOfPolygon",(function(){return q})),n.d(e,"getBounds",(function(){return H})),n.d(e,"getBoundsOfDistance",(function(){return J})),n.d(e,"getCenter",(function(){return X})),n.d(e,"getCenterOfBounds",(function(){return Y})),n.d(e,"getCompassDirection",(function(){return K})),n.d(e,"getCoordinateKey",(function(){return g})),n.d(e,"getCoordinateKeys",(function(){return b})),n.d(e,"getDistance",(function(){return z})),n.d(e,"getDistanceFromLine",(function(){return Z})),n.d(e,"getGreatCircleBearing",(function(){return Q})),n.d(e,"getLatitude",(function(){return F})),n.d(e,"getLongitude",(function(){return A})),n.d(e,"getPathLength",(function(){return et})),n.d(e,"getPreciseDistance",(function(){return nt})),n.d(e,"getRhumbLineBearing",(function(){return V})),n.d(e,"getRoughCompassDirection",(function(){return it})),n.d(e,"getSpeed",(function(){return rt})),n.d(e,"isDecimal",(function(){return y})),n.d(e,"isPointInLine",(function(){return at})),n.d(e,"isPointInPolygon",(function(){return st})),n.d(e,"isPointNearLine",(function(){return ot})),n.d(e,"isPointWithinRadius",(function(){return lt})),n.d(e,"isSexagesimal",(function(){return m})),n.d(e,"isValidCoordinate",(function(){return O})),n.d(e,"isValidLatitude",(function(){return x})),n.d(e,"isValidLongitude",(function(){return N})),n.d(e,"orderByDistance",(function(){return $})),n.d(e,"sexagesimalToDecimal",(function(){return v})),n.d(e,"toDecimal",(function(){return k})),n.d(e,"toRad",(function(){return S})),n.d(e,"toDeg",(function(){return D})),n.d(e,"wktToPolygon",(function(){return ct})),n.d(e,"sexagesimalPattern",(function(){return i})),n.d(e,"earthRadius",(function(){return r})),n.d(e,"MINLAT",(function(){return a})),n.d(e,"MAXLAT",(function(){return s})),n.d(e,"MINLON",(function(){return o})),n.d(e,"MAXLON",(function(){return l})),n.d(e,"longitudeKeys",(function(){return h})),n.d(e,"latitudeKeys",(function(){return c})),n.d(e,"altitudeKeys",(function(){return u})),n.d(e,"distanceConversion",(function(){return d})),n.d(e,"timeConversion",(function(){return p})),n.d(e,"areaConversion",(function(){return f}));var i=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/,r=6378137,a=-90,s=90,o=-180,l=180,h=["lng","lon","longitude",0],c=["lat","latitude",1],u=["alt","altitude","elevation","elev",2],d={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},p={m:60,h:3600,d:86400},f={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};f.sqm=f.m2,f.sqkm=f.km2,f.sqft=f.ft2,f.sqyd=f.yd2,f.sqin=f.in2;var g=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)},y=function(t){var e=t.toString().trim();return!isNaN(parseFloat(e))&&parseFloat(e)===Number(e)},m=function(t){return i.test(t.toString().trim())},v=function(t){var e=new RegExp(i).exec(t);if(null==e)throw new Error("Given value is not in sexagesimal format");var n=Number(e[2])/60||0,r=Number(e[4])/3600||0,a=parseFloat(e[1])+n+r;return["S","W"].includes(e[7])?-a:a};function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function _(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){M(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function M(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var b=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:h,latitude:c,altitude:u},n=g(t,e.longitude),i=g(t,e.latitude),r=g(t,e.altitude);return _({latitude:i,longitude:n},r?{altitude:r}:{})},x=function t(e){return y(e)?!(parseFloat(e)>s||e<a):!!m(e)&&t(v(e))},N=function t(e){return y(e)?!(parseFloat(e)>l||e<o):!!m(e)&&t(v(e))},O=function(t){var e=b(t),n=e.latitude,i=e.longitude;if(Array.isArray(t)&&t.length>=2)return N(t[0])&&x(t[1]);if(void 0===n||void 0===i)return!1;var r=t[i],a=t[n];return void 0!==a&&void 0!==r&&!1!==x(a)&&!1!==N(r)};function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){I(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function I(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var k=function t(e){if(y(e))return Number(e);if(m(e))return v(e);if(O(e)){var n=b(e);return Array.isArray(e)?e.map((function(e,n){return[0,1].includes(n)?t(e):e})):E(E(E({},e),n.latitude&&I({},n.latitude,t(e[n.latitude]))),n.longitude&&I({},n.longitude,t(e[n.longitude])))}return Array.isArray(e)?e.map((function(e){return O(e)?t(e):e})):e},F=function(t,e){var n=g(t,c);if(null!=n){var i=t[n];return!0===e?i:k(i)}},A=function(t,e){var n=g(t,h);if(null!=n){var i=t[n];return!0===e?i:k(i)}},S=function(t){return t*Math.PI/180},D=function(t){return 180*t/Math.PI},R=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,r=F(t),a=A(t),s=e/i,h=S(n),c=S(r),u=S(a),d=Math.asin(Math.sin(c)*Math.cos(s)+Math.cos(c)*Math.sin(s)*Math.cos(h)),p=u+Math.atan2(Math.sin(h)*Math.sin(s)*Math.cos(c),Math.cos(s)-Math.sin(c)*Math.sin(d)),f=D(p);return(f<o||f>l)&&(p=(p+3*Math.PI)%(2*Math.PI)-Math.PI,f=D(p)),{latitude:D(d),longitude:f}},B=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",n=f[e];if(n)return t*n;throw new Error("Invalid unit used for area conversion.")},L=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",n=d[e];if(n)return t*n;throw new Error("Invalid unit used for distance conversion.")},C=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(e){case"kmh":return t*p.h*d.km;case"mph":return t*p.h*d.mi;default:return t}};function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var j=function(t){var e=Math.pow(10,12);return Math.round(t*e)/e},W=function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],i=!0,r=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(i=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw a}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return P(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P(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.")}()}(t.toString().split("."),2),n=e[0],i=e[1],r=Math.abs(Number(n)),a=j(60*Number("0."+(i||0))),s=Math.floor(a),o=j(60*(a%s||0));return r+"° "+Number(s.toFixed(6)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+"' "+Number(o.toFixed(4)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+'"'},G=function(t){return t>1?1:t<-1?-1:t},z=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;n=void 0===n||isNaN(n)?1:n;var i=F(t),a=A(t),s=F(e),o=A(e),l=Math.acos(G(Math.sin(S(s))*Math.sin(S(i))+Math.cos(S(s))*Math.cos(S(i))*Math.cos(S(a)-S(o))))*r;return Math.round(l/n)*n},$=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:z;return n="function"==typeof n?n:z,e.slice().sort((function(e,i){return n(t,e)-n(t,i)}))},U=function(t,e){return $(t,e)[0]},q=function(t){var e=0;if(t.length>2){for(var n,i,a,s=0;s<t.length;s++){s===t.length-2?(n=t.length-2,i=t.length-1,a=0):s===t.length-1?(n=t.length-1,i=0,a=1):(n=s,i=s+1,a=s+2);var o=A(t[n]),l=F(t[i]),h=A(t[a]);e+=(S(h)-S(o))*Math.sin(S(l))}e=e*r*r/2}return Math.abs(e)},H=function(t){if(!1===Array.isArray(t)||0===t.length)throw new Error("No points were given.");return t.reduce((function(t,e){var n=F(e),i=A(e);return{maxLat:Math.max(n,t.maxLat),minLat:Math.min(n,t.minLat),maxLng:Math.max(i,t.maxLng),minLng:Math.min(i,t.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})},J=function(t,e){var n,i,h=F(t),c=A(t),u=S(h),d=S(c),p=e/r,f=u-p,g=u+p,y=S(s),m=S(a),v=S(l),w=S(o);if(f>m&&g<y){var _=Math.asin(Math.sin(p)/Math.cos(u));(n=d-_)<w&&(n+=2*Math.PI),(i=d+_)>v&&(i-=2*Math.PI)}else f=Math.max(f,m),g=Math.min(g,y),n=w,i=v;return[{latitude:D(f),longitude:D(n)},{latitude:D(g),longitude:D(i)}]},X=function(t){if(!1===Array.isArray(t)||0===t.length)return!1;var e=t.length,n=t.reduce((function(t,e){var n=S(F(e)),i=S(A(e));return{X:t.X+Math.cos(n)*Math.cos(i),Y:t.Y+Math.cos(n)*Math.sin(i),Z:t.Z+Math.sin(n)}}),{X:0,Y:0,Z:0}),i=n.X/e,r=n.Y/e,a=n.Z/e;return{longitude:D(Math.atan2(r,i)),latitude:D(Math.atan2(a,Math.sqrt(i*i+r*r)))}},Y=function(t){var e=H(t),n=e.minLat+(e.maxLat-e.minLat)/2,i=e.minLng+(e.maxLng-e.minLng)/2;return{latitude:parseFloat(n.toFixed(6)),longitude:parseFloat(i.toFixed(6))}},V=function(t,e){var n=S(A(e))-S(A(t)),i=Math.log(Math.tan(S(F(e))/2+Math.PI/4)/Math.tan(S(F(t))/2+Math.PI/4));return Math.abs(n)>Math.PI&&(n=n>0?-1*(2*Math.PI-n):2*Math.PI+n),(D(Math.atan2(n,i))+360)%360},K=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:V,i="function"==typeof n?n(t,e):V(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"}},Z=function(t,e,n){var i=z(e,t),r=z(t,n),a=z(e,n),s=Math.acos(G((i*i+a*a-r*r)/(2*i*a))),o=Math.acos(G((r*r+a*a-i*i)/(2*r*a)));return s>Math.PI/2?i:o>Math.PI/2?r:Math.sin(s)*i},Q=function(t,e){var n=F(e),i=A(e),r=F(t),a=A(t);return(D(Math.atan2(Math.sin(S(i)-S(a))*Math.cos(S(n)),Math.cos(S(r))*Math.sin(S(n))-Math.sin(S(r))*Math.cos(S(n))*Math.cos(S(i)-S(a))))+360)%360};function tt(t){return(tt="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 et=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z;return t.reduce((function(t,n){return"object"===tt(t)&&null!==t.last&&(t.distance+=e(n,t.last)),t.last=n,t}),{last:null,distance:0}).distance},nt=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;n=void 0===n||isNaN(n)?1:n;var i,a,s,o,l,h,c,u=F(t),d=A(t),p=F(e),f=A(e),g=6356752.314245,y=1/298.257223563,m=S(f-d),v=Math.atan((1-y)*Math.tan(S(parseFloat(u)))),w=Math.atan((1-y)*Math.tan(S(parseFloat(p)))),_=Math.sin(v),M=Math.cos(v),b=Math.sin(w),x=Math.cos(w),N=m,O=100;do{var T=Math.sin(N),E=Math.cos(N);if(0===(h=Math.sqrt(x*T*(x*T)+(M*b-_*x*E)*(M*b-_*x*E))))return 0;i=_*b+M*x*E,a=Math.atan2(h,i),l=i-2*_*b/(o=1-(s=M*x*T/h)*s),isNaN(l)&&(l=0);var I=y/16*o*(4+y*(4-3*o));c=N,N=m+(1-I)*y*s*(a+I*h*(l+I*i*(2*l*l-1)))}while(Math.abs(N-c)>1e-12&&--O>0);if(0===O)return NaN;var k=o*(r*r-g*g)/(g*g),D=1+k/16384*(4096+k*(k*(320-175*k)-768)),R=k/1024*(256+k*(k*(74-47*k)-128)),B=R*h*(l+R/4*(i*(2*l*l-1)-R/6*l*(4*h*h-3)*(4*l*l-3))),L=g*D*(a-B);return Math.round(L/n)*n},it=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},rt=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:z,i=n(t,e),r=Number(e.time)-Number(t.time),a=i/r*1e3;return a},at=function(t,e,n){return z(e,t)+z(t,n)===z(e,n)},st=function(t,e){for(var n=!1,i=e.length,r=-1,a=i-1;++r<i;a=r)(A(e[r])<=A(t)&&A(t)<A(e[a])||A(e[a])<=A(t)&&A(t)<A(e[r]))&&F(t)<(F(e[a])-F(e[r]))*(A(t)-A(e[r]))/(A(e[a])-A(e[r]))+F(e[r])&&(n=!n);return n},ot=function(t,e,n,i){return Z(t,e,n)<i},lt=function(t,e,n){return z(t,e)<n};function ht(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var ct=function(t){if(!t.startsWith("POLYGON"))throw new Error("Invalid wkt.");return t.slice(t.indexOf("(")+2,t.indexOf(")")).split(", ").map((function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],i=!0,r=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(i=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw a}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ht(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ht(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.")}()}(t.split(" "),2),n=e[0],i=e[1];return{longitude:parseFloat(n),latitude:parseFloat(i)}}))}}])},"object"==typeof t&&"object"==typeof e?e.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof t?t.geolib=i():n.geolib=i()})),cr=ht(((t,e)=>{T(),e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))})),gr=ht(((t,e)=>{T();var n="%[a-f0-9]{2}",i=new RegExp(n,"gi"),r=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),i=t.slice(e);return Array.prototype.concat.call([],a(n),a(i))}function s(t){try{return decodeURIComponent(t)}catch(r){for(var e=t.match(i),n=1;n<e.length;n++)e=(t=a(e,n).join("")).match(i);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=r.exec(t);n;){try{e[n[0]]=decodeURIComponent(n[0])}catch(t){var i=s(n[0]);i!==n[0]&&(e[n[0]]=i)}n=r.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)}}})),yr=ht(((t,e)=>{T(),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)]}})),br=ht(((t,e)=>{T(),e.exports=function(t,e){for(var n={},i=Object.keys(t),r=Array.isArray(e),a=0;a<i.length;a++){var s=i[a],o=t[s];(r?-1!==e.indexOf(s):e(s,o,t))&&(n[s]=o)}return n}})),zr=ht((t=>{T();var e=cr(),n=gr(),i=yr(),r=br(),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 h(t){return Array.isArray(t)?t.sort():"object"==typeof t?h(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function c(t){let e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function u(t){let e=(t=c(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,i)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===i[t]&&(i[t]={}),i[t][e[1]]=n):i[t]=n};case"bracket":return(t,n,i)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==i[t]?i[t]=[].concat(i[t],n):i[t]=[n]:i[t]=n};case"comma":case"separator":return(e,n,i)=>{let r="string"==typeof n&&n.includes(t.arrayFormatSeparator),a="string"==typeof n&&!r&&l(n,t).includes(t.arrayFormatSeparator);n=a?l(n,t):n;let s=r||a?n.split(t.arrayFormatSeparator).map((e=>l(e,t))):null===n?n:l(n,t);i[e]=s};case"bracket-separator":return(e,n,i)=>{let r=/(\[\])$/.test(e);if(e=e.replace(/\[\]$/,""),!r)return void(i[e]=n&&l(n,t));let a=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>l(e,t)));void 0!==i[e]?i[e]=[].concat(i[e],a):i[e]=a};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[].concat(n[t],e):n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t||!(t=t.trim().replace(/^[?#&]/,"")))return r;for(let a of t.split("&")){if(""===a)continue;let[t,s]=i(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,r)}for(let t of Object.keys(r)){let n=r[t];if("object"==typeof n&&null!==n)for(let t of Object.keys(n))n[t]=d(n[t],e);else r[t]=d(n,e)}return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{let n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=h(n):t[e]=n,t}),Object.create(null))}t.extract=u,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],i=function(t){switch(t.arrayFormat){case"index":return e=>(n,i)=>{let r=n.length;return void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?n:null===i?[...n,[o(e,t),"[",r,"]"].join("")]:[...n,[o(e,t),"[",o(r,t),"]=",o(i,t)].join("")]};case"bracket":return e=>(n,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?n:null===i?[...n,[o(e,t),"[]"].join("")]:[...n,[o(e,t),"[]=",o(i,t)].join("")];case"comma":case"separator":case"bracket-separator":{let e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(i,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?i:(r=null===r?"":r,0===i.length?[[o(n,t),e,o(r,t)].join("")]:[[i,o(r,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?n:null===i?[...n,o(e,t)]:[...n,[o(e,t),"=",o(i,t)].join("")]}}(e),r={};for(let e of Object.keys(t))n(e)||(r[e]=t[e]);let a=Object.keys(r);return!1!==e.sort&&a.sort(e.sort),a.map((n=>{let r=t[n];return void 0===r?"":null===r?o(n,e):Array.isArray(r)?0===r.length&&"bracket-separator"===e.arrayFormat?o(n,e)+"[]":r.reduce(i(n),[]).join("&"):o(n,e)+"="+o(r,e)})).filter((t=>t.length>0)).join("&")},t.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);let[n,r]=i(t,"#");return Object.assign({url:n.split("?")[0]||"",query:p(u(t),e)},e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:l(r,e)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[a]:!0},n);let i=c(e.url).split("?")[0]||"",r=t.extract(e.url),s=t.parse(r,{sort:!1}),l=Object.assign(s,e.query),h=t.stringify(l,n);h&&(h=`?${h}`);let u=function(t){let e="",n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(e.url);return e.fragmentIdentifier&&(u=`#${n[a]?o(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${i}${h}${u}`},t.pick=(e,n,i)=>{i=Object.assign({parseFragmentIdentifier:!0,[a]:!1},i);let{url:s,query:o,fragmentIdentifier:l}=t.parseUrl(e,i);return t.stringifyUrl({url:s,query:r(o,n),fragmentIdentifier:l},i)},t.exclude=(e,n,i)=>{let r=Array.isArray(n)?t=>!n.includes(t):(t,e)=>!n(t,e);return t.pick(e,r,i)}})),Er=ht(((t,e)=>{var n,i;T(),n=t,i=function(){"use strict";var t=function(){return t=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},t.apply(this,arguments)};function e(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,a=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=a.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return s}var i,r="KEYS",a="VALUES",s="",o=function(){function t(t,e){var n=t._tree,i=Array.from(n.keys());this.set=t,this._type=e,this._path=i.length>0?[{node:n,keys:i}]:[]}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=l(this._path),e=t.node,n=t.keys;if(l(n)===s)return{done:!1,value:this.result()};var i=e.get(l(n));return this._path.push({node:i,keys:Array.from(i.keys())}),this.dive()},t.prototype.backtrack=function(){if(0!==this._path.length){var t=l(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 l(e)})).filter((function(t){return t!==s})).join("")},t.prototype.value=function(){return l(this._path).node.get(s)},t.prototype.result=function(){switch(this._type){case a:return this.value();case r:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),l=function(t){return t[t.length-1]},h=function(t,n,i,r,a,o,l,c){var u,d,p=o*l;try{t:for(var f=e(t.keys()),g=f.next();!g.done;g=f.next()){var y=g.value;if(y===s){var m=a[p-1];m<=i&&r.set(c,[t.get(y),m])}else{for(var v=o,w=0;w<y.length;++w,++v){for(var _=y[w],M=l*v,b=M-l,x=a[M],N=Math.max(0,v-i-1),O=Math.min(l-1,v+i),T=N;T<O;++T){var E=_!==n[T],I=a[b+T]+ +E,k=a[b+T+1]+1,F=a[M+T]+1,A=a[M+T+1]=Math.min(I,k,F);A<x&&(x=A)}if(x>i)continue t}h(t.get(y),n,i,r,a,v,l,c+y)}}}catch(t){u={error:t}}finally{try{g&&!g.done&&(d=f.return)&&d.call(f)}finally{if(u)throw u.error}}},c=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(i){var r,a;if(!i.startsWith(this._prefix))throw new Error("Mismatched prefix");var o=n(u(this._tree,i.slice(this._prefix.length)),2),l=o[0],h=o[1];if(void 0===l){var c=n(m(h),2),d=c[0],p=c[1];try{for(var f=e(d.keys()),g=f.next();!g.done;g=f.next()){var y=g.value;if(y!==s&&y.startsWith(p)){var v=new Map;return v.set(y.slice(p.length),d.get(y)),new t(v,i)}}}catch(t){r={error:t}}finally{try{g&&!g.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}}return new t(l,i)},t.prototype.clear=function(){this._size=void 0,this._tree.clear()},t.prototype.delete=function(t){return this._size=void 0,f(this._tree,t)},t.prototype.entries=function(){return new o(this,"ENTRIES")},t.prototype.forEach=function(t){var i,r;try{for(var a=e(this),s=a.next();!s.done;s=a.next()){var o=n(s.value,2);t(o[0],o[1],this)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}},t.prototype.fuzzyGet=function(t,e){return function(t,e,n){var i=new Map;if(void 0===e)return i;for(var r=e.length+1,a=r+n,s=new Uint8Array(a*r).fill(n+1),o=0;o<r;++o)s[o]=o;for(var l=1;l<a;++l)s[l*r]=l;return h(t,e,n,i,s,1,r,""),i}(this._tree,t,e)},t.prototype.get=function(t){var e=d(this._tree,t);return void 0!==e?e.get(s):void 0},t.prototype.has=function(t){var e=d(this._tree,t);return void 0!==e&&e.has(s)},t.prototype.keys=function(){return new o(this,r)},t.prototype.set=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");return this._size=void 0,p(this._tree,t).set(s,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=p(this._tree,t);return n.set(s,e(n.get(s))),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=p(this._tree,t),i=n.get(s);return void 0===i&&n.set(s,i=e()),i},t.prototype.values=function(){return new o(this,a)},t.prototype[Symbol.iterator]=function(){return this.entries()},t.from=function(i){var r,a,s=new t;try{for(var o=e(i),l=o.next();!l.done;l=o.next()){var h=n(l.value,2),c=h[0],u=h[1];s.set(c,u)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}return s},t.fromObject=function(e){return t.from(Object.entries(e))},t}(),u=function(t,n,i){var r,a;if(void 0===i&&(i=[]),0===n.length||null==t)return[t,i];try{for(var o=e(t.keys()),l=o.next();!l.done;l=o.next()){var h=l.value;if(h!==s&&n.startsWith(h))return i.push([t,h]),u(t.get(h),n.slice(h.length),i)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}return i.push([t,n]),u(void 0,"",i)},d=function(t,n){var i,r;if(0===n.length||null==t)return t;try{for(var a=e(t.keys()),o=a.next();!o.done;o=a.next()){var l=o.value;if(l!==s&&n.startsWith(l))return d(t.get(l),n.slice(l.length))}}catch(t){i={error:t}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}},p=function(t,n){var i,r,a=n.length;t:for(var o=0;t&&o<a;){try{for(var l=(i=void 0,e(t.keys())),h=l.next();!h.done;h=l.next()){var c=h.value;if(c!==s&&n[o]===c[0]){for(var u=Math.min(a-o,c.length),d=1;d<u&&n[o+d]===c[d];)++d;var p=t.get(c);if(d===c.length)t=p;else{var f=new Map;f.set(c.slice(d),p),t.set(n.slice(o,o+d),f),t.delete(c),t=f}o+=d;continue t}}}catch(t){i={error:t}}finally{try{h&&!h.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}var g=new Map;return t.set(n.slice(o),g),g}return t},f=function(t,e){var i=n(u(t,e),2),r=i[0],a=i[1];if(void 0!==r)if(r.delete(s),0===r.size)g(a);else if(1===r.size){var o=n(r.entries().next().value,2),l=o[0],h=o[1];y(a,l,h)}},g=function(t){if(0!==t.length){var e=n(m(t),2),i=e[0],r=e[1];if(i.delete(r),0===i.size)g(t.slice(0,-1));else if(1===i.size){var a=n(i.entries().next().value,2),o=a[0],l=a[1];o!==s&&y(t.slice(0,-1),o,l)}}},y=function(t,e,i){if(0!==t.length){var r=n(m(t),2),a=r[0],s=r[1];a.set(s+e,i),a.delete(s)}},m=function(t){return t[t.length-1]},v="or",w=function(){function i(e){if(null==(null==e?void 0:e.fields))throw new Error('MiniSearch: option "fields" must be provided');this._options=t(t(t({},N),e),{searchOptions:t(t({},O),e.searchOptions||{})}),this._index=new c,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 i.prototype.add=function(t){var n,i,r,a,s=this._options,o=s.extractField,l=s.tokenize,h=s.processTerm,c=s.fields,u=s.idField,d=o(t,u);if(null==d)throw new Error('MiniSearch: document does not have ID field "'.concat(u,'"'));var p=this.addDocumentId(d);this.saveStoredFields(p,t);try{for(var f=e(c),g=f.next();!g.done;g=f.next()){var y=g.value,m=o(t,y);if(null!=m){var v=l(m.toString(),y),w=this._fieldIds[y],_=new Set(v).size;this.addFieldLength(p,w,this._documentCount-1,_);try{for(var M=(r=void 0,e(v)),b=M.next();!b.done;b=M.next()){var x=h(b.value,y);x&&this.addTerm(w,p,x)}}catch(t){r={error:t}}finally{try{b&&!b.done&&(a=M.return)&&a.call(M)}finally{if(r)throw r.error}}}}}catch(t){n={error:t}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}},i.prototype.addAll=function(t){var n,i;try{for(var r=e(t),a=r.next();!a.done;a=r.next()){var s=a.value;this.add(s)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}},i.prototype.addAllAsync=function(t,e){var n=this;void 0===e&&(e={});var i=e.chunkSize,r=void 0===i?10:i,a={chunk:[],promise:Promise.resolve()},s=t.reduce((function(t,e,i){var a=t.chunk,s=t.promise;return a.push(e),(i+1)%r==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)}))},i.prototype.remove=function(t){var i,r,a,s,o,l,h=this._options,c=h.tokenize,u=h.processTerm,d=h.extractField,p=h.fields,f=h.idField,g=d(t,f);if(null==g)throw new Error('MiniSearch: document does not have ID field "'.concat(f,'"'));try{for(var y=e(this._documentIds),m=y.next();!m.done;m=y.next()){var v=n(m.value,2),w=v[0];if(g===v[1]){try{for(var _=(a=void 0,e(p)),M=_.next();!M.done;M=_.next()){var b=M.value,x=d(t,b);if(null!=x){var N=c(x.toString(),b),O=this._fieldIds[b],T=new Set(N).size;this.removeFieldLength(w,O,this._documentCount,T);try{for(var E=(o=void 0,e(N)),I=E.next();!I.done;I=E.next()){var k=u(I.value,b);k&&this.removeTerm(O,w,k)}}catch(t){o={error:t}}finally{try{I&&!I.done&&(l=E.return)&&l.call(E)}finally{if(o)throw o.error}}}}}catch(t){a={error:t}}finally{try{M&&!M.done&&(s=_.return)&&s.call(_)}finally{if(a)throw a.error}}return this._storedFields.delete(w),this._documentIds.delete(w),this._fieldLength.delete(w),void(this._documentCount-=1)}}}catch(t){i={error:t}}finally{try{m&&!m.done&&(r=y.return)&&r.call(y)}finally{if(i)throw i.error}}throw new Error("MiniSearch: cannot remove document with ID ".concat(g,": it is not in the index"))},i.prototype.removeAll=function(t){var n,i;if(t)try{for(var r=e(t),a=r.next();!a.done;a=r.next()){var s=a.value;this.remove(s)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new c,this._documentCount=0,this._documentIds=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},i.prototype.search=function(t,i){var r,a;void 0===i&&(i={});var s=this.executeQuery(t,i),o=[];try{for(var l=e(s),h=l.next();!h.done;h=l.next()){var c=n(h.value,2),u=c[0],d=c[1],p=d.score,f=d.terms,g=d.match,y=f.length,m={id:this._documentIds.get(u),score:p*y,terms:Object.keys(g),match:g};Object.assign(m,this._storedFields.get(u)),(null==i.filter||i.filter(m))&&o.push(m)}}catch(t){r={error:t}}finally{try{h&&!h.done&&(a=l.return)&&a.call(l)}finally{if(r)throw r.error}}return o.sort(k),o},i.prototype.autoSuggest=function(i,r){var a,s,o,l;void 0===r&&(r={}),r=t(t({},T),r);var h=new Map;try{for(var c=e(this.search(i,r)),u=c.next();!u.done;u=c.next()){var d=u.value,p=d.score,f=(M=d.terms).join(" ");null!=(w=h.get(f))?(w.score+=p,w.count+=1):h.set(f,{score:p,terms:M,count:1})}}catch(t){a={error:t}}finally{try{u&&!u.done&&(s=c.return)&&s.call(c)}finally{if(a)throw a.error}}var g=[];try{for(var y=e(h),m=y.next();!m.done;m=y.next()){var v=n(m.value,2),w=v[0],_=v[1],M=(p=_.score,_.terms),b=_.count;g.push({suggestion:w,terms:M,score:p/b})}}catch(t){o={error:t}}finally{try{m&&!m.done&&(l=y.return)&&l.call(y)}finally{if(o)throw o.error}}return g.sort(k),g},Object.defineProperty(i.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),i.loadJSON=function(t,e){if(null==e)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return i.loadJS(JSON.parse(t),e)},i.getDefault=function(t){if(N.hasOwnProperty(t))return _(N,t);throw new Error('MiniSearch: unknown option "'.concat(t,'"'))},i.loadJS=function(t,r){var a,s,o,l,h=t.index,u=t.documentCount,d=t.nextId,p=t.documentIds,f=t.fieldIds,g=t.fieldLength,y=t.averageFieldLength,m=t.storedFields,v=t.serializationVersion;if(1!==v&&2!==v)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var w=new i(r);w._documentCount=u,w._nextId=d,w._documentIds=A(p),w._fieldIds=f,w._fieldLength=A(g),w._avgFieldLength=y,w._storedFields=A(m),w._index=new c;try{for(var _=e(h),M=_.next();!M.done;M=_.next()){var b=n(M.value,2),x=b[0],N=b[1],O=new Map;try{for(var T=(o=void 0,e(Object.keys(N))),E=T.next();!E.done;E=T.next()){var I=E.value,k=N[I];1===v&&(k=k.ds),O.set(parseInt(I,10),A(k))}}catch(t){o={error:t}}finally{try{E&&!E.done&&(l=T.return)&&l.call(T)}finally{if(o)throw o.error}}w._index.set(x,O)}}catch(t){a={error:t}}finally{try{M&&!M.done&&(s=_.return)&&s.call(_)}finally{if(a)throw a.error}}return w},i.prototype.executeQuery=function(e,n){var i=this;if(void 0===n&&(n={}),"string"!=typeof e){var r=t(t(t({},n),e),{queries:void 0}),a=e.queries.map((function(t){return i.executeQuery(t,r)}));return this.combineResults(a,e.combineWith)}var s=this._options,o=s.tokenize,l=s.processTerm,h=s.searchOptions,c=t(t({tokenize:o,processTerm:l},h),n),u=c.tokenize,d=c.processTerm,p=u(e).map((function(t){return d(t)})).filter((function(t){return!!t})).map(x(c)).map((function(t){return i.executeQuerySpec(t,c)}));return this.combineResults(p,c.combineWith)},i.prototype.executeQuerySpec=function(i,r){var a,s,o,l,h,c,u=t(t({},this._options.searchOptions),r),d=(u.fields||this._options.fields).reduce((function(e,n){var i;return t(t({},e),((i={})[n]=_(e,n)||1,i))}),u.boost||{}),p=u.boostDocument,f=u.weights,g=u.maxFuzzy,y=t(t({},O.weights),f),m=y.fuzzy,v=y.prefix,w=this._index.get(i.term),M=this.termResults(i.term,i.term,1,w,d,p);if(i.prefix&&(h=this._index.atPrefix(i.term)),i.fuzzy){var b=!0===i.fuzzy?.2:i.fuzzy,x=b<1?Math.min(g,Math.round(i.term.length*b)):b;x&&(c=this._index.fuzzyGet(i.term,x))}if(h)try{for(var N=e(h),T=N.next();!T.done;T=N.next()){var E=n(T.value,2),I=E[0],k=E[1];if(D=I.length-i.term.length){null==c||c.delete(I);var F=v*I.length/(I.length+.3*D);this.termResults(i.term,I,F,k,d,p,M)}}}catch(t){a={error:t}}finally{try{T&&!T.done&&(s=N.return)&&s.call(N)}finally{if(a)throw a.error}}if(c)try{for(var A=e(c.keys()),S=A.next();!S.done;S=A.next()){I=S.value;var D,R=n(c.get(I),2),B=R[0];(D=R[1])&&(F=m*I.length/(I.length+D),this.termResults(i.term,I,F,B,d,p,M))}}catch(t){o={error:t}}finally{try{S&&!S.done&&(l=A.return)&&l.call(A)}finally{if(o)throw o.error}}return M},i.prototype.combineResults=function(t,e){if(void 0===e&&(e=v),0===t.length)return new Map;var n=e.toLowerCase();return t.reduce(M[n])||new Map},i.prototype.toJSON=function(){var t,i,r,a,s=[];try{for(var o=e(this._index),l=o.next();!l.done;l=o.next()){var h=n(l.value,2),c=h[0],u=h[1],d={};try{for(var p=(r=void 0,e(u)),f=p.next();!f.done;f=p.next()){var g=n(f.value,2),y=g[0],m=g[1];d[y]=Object.fromEntries(m)}}catch(t){r={error:t}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(r)throw r.error}}s.push([c,d])}}catch(e){t={error:e}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}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:s,serializationVersion:2}},i.prototype.termResults=function(t,n,i,r,a,s,o){var l,h,c,u,d;if(void 0===o&&(o=new Map),null==r)return o;try{for(var p=e(Object.keys(a)),f=p.next();!f.done;f=p.next()){var g=f.value,y=a[g],m=this._fieldIds[g],v=r.get(m);if(null!=v){var w=v.size,M=this._avgFieldLength[m];try{for(var x=(c=void 0,e(v.keys())),N=x.next();!N.done;N=x.next()){var O=N.value,T=s?s(this._documentIds.get(O),n):1;if(T){var I=v.get(O),k=this._fieldLength.get(O)[m],F=i*y*T*b(I,w,this._documentCount,k,M),A=o.get(O);if(A){A.score+=F,E(A.terms,t);var S=_(A.match,n);S?S.push(g):A.match[n]=[g]}else o.set(O,{score:F,terms:[t],match:(d={},d[n]=[g],d)})}}}catch(t){c={error:t}}finally{try{N&&!N.done&&(u=x.return)&&u.call(x)}finally{if(c)throw c.error}}}}}catch(t){l={error:t}}finally{try{f&&!f.done&&(h=p.return)&&h.call(p)}finally{if(l)throw l.error}}return o},i.prototype.addTerm=function(t,e,n){var i=this._index.fetch(n,F),r=i.get(t);if(null==r)(r=new Map).set(e,1),i.set(t,r);else{var a=r.get(e);r.set(e,(a||0)+1)}},i.prototype.removeTerm=function(t,e,n){if(this._index.has(n)){var i=this._index.fetch(n,F),r=i.get(t);null==r||null==r.get(e)?this.warnDocumentChanged(e,t,n):r.get(e)<=1?r.size<=1?i.delete(t):r.delete(e):r.set(e,r.get(e)-1),0===this._index.get(n).size&&this._index.delete(n)}else this.warnDocumentChanged(e,t,n)},i.prototype.warnDocumentChanged=function(t,n,i){var r,a;if(null!=console&&null!=console.warn)try{for(var s=e(Object.keys(this._fieldIds)),o=s.next();!o.done;o=s.next()){var l=o.value;if(this._fieldIds[l]===n)return void console.warn("MiniSearch: document with ID ".concat(this._documentIds.get(t),' has changed before removal: term "').concat(i,'" was not present in field "').concat(l,'". Removing a document after it has changed can corrupt the index!'))}}catch(t){r={error:t}}finally{try{o&&!o.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}},i.prototype.addDocumentId=function(t){var e=this._nextId;return this._documentIds.set(e,t),this._documentCount+=1,this._nextId+=1,e},i.prototype.addFields=function(t){for(var e=0;e<t.length;e++)this._fieldIds[t[e]]=e},i.prototype.addFieldLength=function(t,e,n,i){var r=this._fieldLength.get(t);null==r&&this._fieldLength.set(t,r=[]),r[e]=i;var a=(this._avgFieldLength[e]||0)*n+i;this._avgFieldLength[e]=a/(n+1)},i.prototype.removeFieldLength=function(t,e,n,i){var r=this._avgFieldLength[e]*n-i;this._avgFieldLength[e]=r/(n-1)},i.prototype.saveStoredFields=function(t,n){var i,r,a=this._options,s=a.storeFields,o=a.extractField;if(null!=s&&0!==s.length){var l=this._storedFields.get(t);null==l&&this._storedFields.set(t,l={});try{for(var h=e(s),c=h.next();!c.done;c=h.next()){var u=c.value,d=o(n,u);void 0!==d&&(l[u]=d)}}catch(t){i={error:t}}finally{try{c&&!c.done&&(r=h.return)&&r.call(h)}finally{if(i)throw i.error}}}},i}(),_=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0},M=((i={}).or=function(t,n){var i,r;try{for(var a=e(n.keys()),s=a.next();!s.done;s=a.next()){var o=s.value,l=t.get(o);if(null==l)t.set(o,n.get(o));else{var h=n.get(o),c=h.score,u=h.terms,d=h.match;l.score=l.score+c,l.match=Object.assign(l.match,d),I(l.terms,u)}}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return t},i.and=function(t,n){var i,r,a=new Map;try{for(var s=e(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value,h=t.get(l);if(null!=h){var c=n.get(l),u=c.score,d=c.terms,p=c.match;I(h.terms,d),a.set(l,{score:h.score+u,terms:h.terms,match:Object.assign(h.match,p)})}}}catch(t){i={error:t}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return a},i.and_not=function(t,n){var i,r;try{for(var a=e(n.keys()),s=a.next();!s.done;s=a.next()){var o=s.value;t.delete(o)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return t},i),b=function(t,e,n,i,r){return Math.log(1+(n-e+.5)/(e+.5))*(.5+2.2*t/(t+1.2*(1-.7+.7*i/r)))},x=function(t){return function(e,n,i){return{term:e,fuzzy:"function"==typeof t.fuzzy?t.fuzzy(e,n,i):t.fuzzy||!1,prefix:"function"==typeof t.prefix?t.prefix(e,n,i):!0===t.prefix}}},N={idField:"id",extractField:function(t,e){return t[e]},tokenize:function(t,e){return t.split(S)},processTerm:function(t,e){return t.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},O={combineWith:v,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},T={prefix:function(t,e,n){return e===n.length-1}},E=function(t,e){t.includes(e)||t.push(e)},I=function(t,n){var i,r;try{for(var a=e(n),s=a.next();!s.done;s=a.next()){var o=s.value;t.includes(o)||t.push(o)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}},k=function(t,e){var n=t.score;return e.score-n},F=function(){return new Map},A=function(t){var n,i,r=new Map;try{for(var a=e(Object.keys(t)),s=a.next();!s.done;s=a.next()){var o=s.value;r.set(parseInt(o,10),t[o])}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return r},S=/[\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;return w},"object"==typeof t&&void 0!==e?e.exports=i():"function"==typeof define&&define.amd?define(i):(n="undefined"!=typeof globalThis?globalThis:n||self).MiniSearch=i()}));Zr(exports,{Mappedin:()=>Nt,MappedinDestinationSet:()=>Ft,OfflineSearch:()=>Nn,getVenue:()=>mi,getVenueBundle:()=>gi,initialize:()=>ts}),T(),T();var Pr=tn(wi());T(),T(),T();var Ti=tn(ji());T();var xi=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:i=0,distance:r=0,angle:a=0}){let s,o;if(c(this,"origin"),c(this,"destination"),c(this,"vortex"),c(this,"distance"),c(this,"angle"),c(this,"weight"),this.origin=t,this.destination=e,this.vortex=n,this.distance=r,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=i*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")}},nn=xi;T();var qn="mi-debug",to={loggingEnabled(){var t;return"development"===C.env.NODE_ENV||"dev"===C.env.NODE_ENV||"test"===C.env.NODE_ENV||"true"===(null==(t=globalThis.sessionStorage)?void 0:t.getItem(qn))},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)}},D=to;function ao(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale||1);try{if(!t.georeference)throw new Error(`map ${t.name||t.shortName||t.id} does not have a georeference field`);if(t.georeference.length<3)throw new Error(`map ${t.name||t.shortName||t.id} has less than 3 georeference points, we require at least 3 for proper map scaling`);let e=t.georeference[0],n=t.georeference[2],i=(0,Ti.getDistance)({latitude:e.target.x,longitude:e.target.y},{latitude:n.target.x,longitude:n.target.y}),r=e.control.x-n.control.x,a=e.control.y-n.control.y;return Math.sqrt(r*r+a*a)/i}catch(t){return D.error(t),1}}function no(t,e){let n=t.x-e.x,i=t.y-e.y;return(Math.atan2(i,n)+2.5*Math.PI)%(2*Math.PI)}var we,Le,mt,Ii=class{constructor({nodes:t,vortexes:e,maps:n,showVortexNames:i=!1}){c(this,"edges"),c(this,"nodesById"),c(this,"mapsById"),this.edges={},this.mapsById=n.map((t=>({...t,_scale:ao(t)}))).reduce(((t,e)=>(t[e.id]=e,t)),{});let r=t.filter((t=>!!this.mapsById[t.map])).map((t=>({...t,paths:t.paths?t.paths.filter((({map:e})=>e===t.map)):[]})));this.nodesById=r.reduce(((t,e)=>(t[e.id]=e,t)),{});for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].paths=this.nodesById[t].paths.filter((({node:t})=>!!this.nodesById[t])));let a=e.map((t=>({...t,name:i?t.name:t.type,nodes:t.nodes?t.nodes.filter((t=>!!this.nodesById[t])):[]})));r.forEach((t=>{this.edges[t.id]=t.paths.map((({node:e})=>{let n=this.nodesById[e];return new nn({angle:no(t,n),destination:n,distance:this.getDistance(t,n),origin:t})}))})),a.forEach((t=>{if(null==t.nodes||0===t.nodes.length)return;let e=0;for(;e<t.nodes.length-1;){let n=this.nodesById[t.nodes[e]];if(e++,null==n)continue;let i=e;for(;i<t.nodes.length;){let e=this.nodesById[t.nodes[i]];if(i++,null==e)continue;let r=this.mapsById[n.map].elevation||0,a=this.mapsById[e.map].elevation||0,s=Math.abs(r-a);this.edges[n.id].push(new nn({destination:e,elevationDelta:s,origin:n,vortex:t})),this.edges[e.id].push(new nn({destination:n,elevationDelta:s,origin:e,vortex:t}))}}}))}aStar(t,e,n){let i=t.map((t=>this.nodesById[t])).filter((t=>t)),r=e.map((t=>this.nodesById[t])).filter((t=>t));if(0===i.length||0===r.length)return[];let a=[],s={},o={};for(i.forEach((t=>{let e=this.getShortestEuclideanDistance(t,r);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(r.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 i=e.vortex&&!1===e.vortex.accessible;if(n&&(i||!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,r);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,i=t.x-e.x,r=t.y-e.y,a=i*i+r*r;return n=null==this.mapsById[t.map]?1:this.mapsById[t.map]._scale,Math.sqrt(a)/n}getShortestEuclideanDistance(t,e){return e.reduce(((e,n)=>{let i=this.getDistance(t,n);return Math.min(e,i)}),Number.MAX_VALUE)}},Vn=Ii;function io(t){switch(t){case mt.DOWN:case mt.UP:return`${t} `;default:return""}}T(),T(),function(t){t.DEPARTURE="Departure",t.TAKEVORTEX="TakeVortex",t.EXITVORTEX="ExitVortex",t.TURN="Turn",t.ARRIVAL="Arrival"}(we||(we={})),function(t){t.STRAIGHT="Straight",t.RIGHT="Right",t.SLIGHTRIGHT="SlightRight",t.LEFT="Left",t.SLIGHTLEFT="SlightLeft"}(Le||(Le={})),function(t){t.UP="up",t.DOWN="down",t.NONE="none"}(mt||(mt={}));var rn,zi=class{constructor({origin:t,action:e,distance:n,atLocation:i,instruction:r}){c(this,"node"),c(this,"instruction"),c(this,"action"),c(this,"atLocation"),c(this,"type"),c(this,"distance",0),this.node=t,this.action=e,this.distance=n||0,this.atLocation=i,this.instruction="",r?this.instruction=r:(null!=e&&e.type===we.DEPARTURE?this.instruction=null!=i?`Depart from ${i.name}`:"Depart from current location":null!=e&&e.type===we.ARRIVAL?this.instruction=null!=i?`Arrive at ${i.name}`:"Arrive at destination":null!=e&&e.type===we.TAKEVORTEX?this.instruction=`Take ${i&&i.name} ${io(e.direction)}to ${e.toMap.name}`:null!=e&&e.type===we.EXITVORTEX?this.instruction=`Exit ${i&&i.name} at ${e.toMap.name}`:null!=e&&e.bearing===Le.RIGHT?this.instruction="Turn right":null!=e&&e.bearing===Le.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=e&&e.bearing===Le.STRAIGHT?this.instruction="Head straight":null!=e&&e.bearing===Le.SLIGHTLEFT?this.instruction="Turn slightly left":null!=e&&e.bearing===Le.LEFT&&(this.instruction="Turn left"),null!=e&&e.type===we.TURN&&i&&(this.instruction+=` at ${i.name}`))}},gt=zi;(rn||(rn={})).NO_VALID_PATH="No Valid Path Available";var on=.1*Math.PI;function sn(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var Oi=class{constructor({locations:t,nodes:e,vortexes:n,maps:i,showVortexNames:r}){c(this,"graph"),c(this,"locationsByNodeId"),this.graph=new Vn({maps:i,nodes:e,showVortexNames:r,vortexes:n}),this.locationsByNodeId=t.reduce(((t,e)=>(e.nodes&&e.nodes.forEach((n=>{t[n.node]=e})),e.polygons&&e.polygons.forEach((n=>{n.entrances&&n.entrances.forEach((n=>{t[n]=e}))})),t)),{})}getClosestLocationInRay(t,e=.5*Math.PI,n=10){let i=0,r=0,a=t;for(;Math.abs(i)<e&&r<n;){let t=this.graph.edges[a.destination.id],s=null,o=0;for(let e of t)if(e.distance>0)if(null!=s){let t=-sn(a.angle,e.angle);Math.abs(t)<Math.abs(o)&&(s=e,o=t)}else s=e,o=-sn(a.angle,e.angle);if(null==s)return null;{if(Math.abs(o)>=e||(i+=o,r+=s.distance,Math.abs(i)>=e||r>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:i,arriveAt:r}){let a=this.graph.aStar(t,e,n);if(0===a.length)return{distance:0,instructions:[new gt({distance:0,instruction:rn.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=[],h=null,c=null,u=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,u+=(null==c?void 0:c.distance)||0,0===t&&l.push(new gt({action:{type:we.DEPARTURE},atLocation:i,distance:0,origin:n})),null!=e.vortex){let t=this.graph.mapsById[n.map],i=this.graph.mapsById[o.map],r=mt.NONE;if(null!=t.elevation&&null!=i.elevation){let e=t.elevation-i.elevation;e>0?r=mt.DOWN:e<0&&(r=mt.UP)}l.push(new gt({action:{direction:r,fromMap:t,toMap:i,type:we.TAKEVORTEX},atLocation:e.vortex,distance:u,origin:n})),d+=u,u=0}else if(null!=h&&null!=c)if(null!=c.vortex){let t=this.graph.mapsById[h.map],e=this.graph.mapsById[c.destination.map];l.push(new gt({action:{fromMap:t,toMap:e,type:we.EXITVORTEX},atLocation:c.vortex,distance:u,origin:n})),d+=u,u=0}else{let t=this.graph.edges[n.id].filter((t=>t.destination!==h&&t.destination!==e.destination));if(t.length>0){let i=-sn(c.angle,e.angle),r=t.reduce(((t,n)=>{let i=-sn(e.angle,n.angle);return Math.min(t,Math.abs(i))}),Math.PI);if(Math.abs(i)>=on||Math.abs(r)<=on){let t;t=i<=-Math.PI/4?Le.RIGHT:i<=-on?Le.SLIGHTRIGHT:i<=on?Le.STRAIGHT:i<=Math.PI/4?Le.SLIGHTLEFT:Le.LEFT;let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(c,.5*Math.PI,10)),null!=e){let i=new gt({action:{bearing:t,referencePosition:"At",type:we.TURN},atLocation:e,distance:u,origin:n});i.type=t,l.push(i)}else l.push(new gt({action:{bearing:t,referencePosition:"At",type:we.TURN},distance:u,origin:n}));d+=u,u=0}}}t===a.length-1&&(l.push(new gt({action:{type:we.ARRIVAL},atLocation:r,distance:s-d<0?0:s-d,origin:e.destination})),d+=u,u=0),h=n,c=e}let p=[],f=null;for(let t=l.length-1;t>=0;t--){let e=l[t],{action:n}=e;n&&n.type===we.TAKEVORTEX?(f=e.node,p.unshift(e)):n&&n.type===we.TURN&&null!=f?this.graph.getDistance(e.node,f)>5&&p.unshift(e):p.unshift(e)}return{distance:s,instructions:p,path:o}}},Un=Oi;function Ni(t){let e=+this._x.call(null,t),n=+this._y.call(null,t);return _i(this.cover(e,n),e,n,t)}function _i(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,a,s,o,l,h,c,u,d,p=t._root,f={data:i},g=t._x0,y=t._y0,m=t._x1,v=t._y1;if(!p)return t._root=f,t;for(;p.length;)if((h=e>=(a=(g+m)/2))?g=a:m=a,(c=n>=(s=(y+v)/2))?y=s:v=s,r=p,!(p=p[u=c<<1|h]))return r[u]=f,t;if(o=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===o&&n===l)return f.next=p,r?r[u]=f:t._root=f,t;do{r=r?r[u]=new Array(4):t._root=new Array(4),(h=e>=(a=(g+m)/2))?g=a:m=a,(c=n>=(s=(y+v)/2))?y=s:v=s}while((u=c<<1|h)==(d=(l>=s)<<1|o>=a));return r[d]=p,r[u]=f,t}function Ai(t){var e,n,i,r,a=t.length,s=new Array(a),o=new Array(a),l=1/0,h=1/0,c=-1/0,u=-1/0;for(n=0;n<a;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(r=+this._y.call(null,e))||(s[n]=i,o[n]=r,i<l&&(l=i),i>c&&(c=i),r<h&&(h=r),r>u&&(u=r));if(l>c||h>u)return this;for(this.cover(l,h).cover(c,u),n=0;n<a;++n)_i(this,s[n],o[n],t[n]);return this}function Si(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,a=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,a=(i=Math.floor(e))+1;else{for(var s,o,l=r-n||1,h=this._root;n>t||t>=r||i>e||e>=a;)switch(o=(e<i)<<1|t<n,s=new Array(4),s[o]=h,h=s,l*=2,o){case 0:r=n+l,a=i+l;break;case 1:n=r-l,a=i+l;break;case 2:r=n+l,i=a-l;break;case 3:n=r-l,i=a-l}this._root&&this._root.length&&(this._root=h)}return this._x0=n,this._y0=i,this._x1=r,this._y1=a,this}function Ei(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}function Fi(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 Te(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function Li(t,e,n){var i,r,a,s,o,l,h,c=this._x0,u=this._y0,d=this._x1,p=this._y1,f=[],g=this._root;for(g&&f.push(new Te(g,c,u,d,p)),null==n?n=1/0:(c=t-n,u=e-n,d=t+n,p=e+n,n*=n);l=f.pop();)if(!(!(g=l.node)||(r=l.x0)>d||(a=l.y0)>p||(s=l.x1)<c||(o=l.y1)<u))if(g.length){var y=(r+s)/2,m=(a+o)/2;f.push(new Te(g[3],y,m,s,o),new Te(g[2],r,m,y,o),new Te(g[1],y,a,s,m),new Te(g[0],r,a,y,m)),(h=(e>=m)<<1|t>=y)&&(l=f[f.length-1],f[f.length-1]=f[f.length-1-h],f[f.length-1-h]=l)}else{var v=t-+this._x.call(null,g.data),w=e-+this._y.call(null,g.data),_=v*v+w*w;if(_<n){var M=Math.sqrt(n=_);c=t-M,u=e-M,d=t+M,p=e+M,i=g.data}}return i}function Ci(t){if(isNaN(a=+this._x.call(null,t))||isNaN(s=+this._y.call(null,t)))return this;var e,n,i,r,a,s,o,l,h,c,u,d,p=this._root,f=this._x0,g=this._y0,y=this._x1,m=this._y1;if(!p)return this;if(p.length)for(;;){if((h=a>=(o=(f+y)/2))?f=o:y=o,(c=s>=(l=(g+m)/2))?g=l:m=l,e=p,!(p=p[u=c<<1|h]))return this;if(!p.length)break;(e[u+1&3]||e[u+2&3]||e[u+3&3])&&(n=e,d=u)}for(;p.data!==t;)if(i=p,!(p=p.next))return this;return(r=p.next)&&delete p.next,i?(r?i.next=r:delete i.next,this):e?(r?e[u]=r:delete e[u],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(n?n[d]=p:this._root=p),this):(this._root=r,this)}function Pi(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function Di(){return this._root}function Bi(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}function Ri(t){var e,n,i,r,a,s,o=[],l=this._root;for(l&&o.push(new Te(l,this._x0,this._y0,this._x1,this._y1));e=o.pop();)if(!t(l=e.node,i=e.x0,r=e.y0,a=e.x1,s=e.y1)&&l.length){var h=(i+a)/2,c=(r+s)/2;(n=l[3])&&o.push(new Te(n,h,c,a,s)),(n=l[2])&&o.push(new Te(n,i,c,h,s)),(n=l[1])&&o.push(new Te(n,h,r,a,c)),(n=l[0])&&o.push(new Te(n,i,r,h,c))}return this}function Gi(t){var e,n=[],i=[];for(this._root&&n.push(new Te(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var r=e.node;if(r.length){var a,s=e.x0,o=e.y0,l=e.x1,h=e.y1,c=(s+l)/2,u=(o+h)/2;(a=r[0])&&n.push(new Te(a,s,o,c,u)),(a=r[1])&&n.push(new Te(a,c,o,l,u)),(a=r[2])&&n.push(new Te(a,s,u,c,h)),(a=r[3])&&n.push(new Te(a,c,u,l,h))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this}function qi(t){return t[0]}function Vi(t){return arguments.length?(this._x=t,this):this._x}function Ui(t){return t[1]}function $i(t){return arguments.length?(this._y=t,this):this._y}function ia(t,e,n){var i=new $n(null==e?qi:e,null==n?Ui:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function $n(t,e,n,i,r,a){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=a,this._root=void 0}function Wi(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}T(),T(),T(),T(),T(),T(),T(),T(),T(),T(),T(),T(),T(),T(),T(),T();var Ee=ia.prototype=$n.prototype;Ee.copy=function(){var t,e,n=new $n(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=Wi(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var r=0;r<4;++r)(e=i.source[r])&&(e.length?t.push({source:e,target:i.target[r]=new Array(4)}):i.target[r]=Wi(e));return n},Ee.add=Ni,Ee.addAll=Ai,Ee.cover=Si,Ee.data=Ei,Ee.extent=Fi,Ee.find=Li,Ee.remove=Ci,Ee.removeAll=Pi,Ee.root=Di,Ee.size=Bi,Ee.visit=Ri,Ee.visitAfter=Gi,Ee.x=Vi,Ee.y=$i;var We,je,It=class{constructor(t){O(this,We,void 0),c(this,"categories"),c(this,"locations"),c(this,"vortexes"),c(this,"maps"),c(this,"nodes"),c(this,"polygons"),c(this,"events"),c(this,"mapGroups"),c(this,"locationStates"),c(this,"rankings"),O(this,je,{}),N(this,We,t)}get polygonsByMapId(){if(l(this,je).polygonsByMapId)return l(this,je).polygonsByMapId;let t,e={};for(let n=0,i=l(this,We).polygons.length;n<i;++n)t=l(this,We).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 l(this,je).polygonsByMapId=n,l(this,je).polygonsByMapId}get nodesByMapId(){if(l(this,je).nodesByMapId)return l(this,je).nodesByMapId;let t,e={};for(let n=0,i=l(this,We).nodes.length;n<i;++n)t=l(this,We).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 l(this,je).nodesByMapId=n,l(this,je).nodesByMapId}findNearestNodeOnMap(t,e){var n;if(l(this,je).nodeTreesByMap||(l(this,je).nodeTreesByMap=new Map),!l(this,je).nodeTreesByMap.has(t)){let e=null!=(n=this.nodesByMapId.get(t))?n:[],i=ia();i.x((t=>t.x)),i.y((t=>t.y)),i.addAll(e),l(this,je).nodeTreesByMap.set(t,i)}return l(this,je).nodeTreesByMap.get(t).find(e.x,e.y)}get locationsByMapId(){if(l(this,je).locationsByMapId)return l(this,je).locationsByMapId;let t,e={};for(let n=0,i=l(this,We).locations.length;n<i;++n){t=l(this,We).locations[n];for(let n=0,i=t.polygons.length;n<i;++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 l(this,je).locationsByMapId=n,l(this,je).locationsByMapId}static create(t){return It.instances.has(t)||It.instances.set(t,new It(t)),It.instances.get(t)}static clear(){It.instances.clear()}},Wn=It;We=new WeakMap,je=new WeakMap,c(Wn,"instances",new Map);var Be=Wn;T(),T(),T(),T();var Hi=" ",Fe=class{static get separator(){return Hi}static set separator(t){Hi=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);let e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let n=null;switch(e.length){case 3:n=e[0]/1+e[1]/60+e[2]/3600;break;case 2:n=e[0]/1+e[1]/60;break;case 1:n=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(n=-n),Number(n)}static toDms(t,e="d",n){if(isNaN(t)||"string"==typeof t&&""==t.trim()||"boolean"==typeof t||t==1/0||null==t)return null;if(void 0===n)switch(e){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:e="d",n=4}t=Math.abs(t);let i=null,r=null,a=null,s=null;switch(e){default:case"d":case"deg":r=t.toFixed(n),r<100&&(r="0"+r),r<10&&(r="0"+r),i=r+"°";break;case"dm":case"deg+min":r=Math.floor(t),a=(60*t%60).toFixed(n),60==a&&(a=(0).toFixed(n),r++),r=("000"+r).slice(-3),a<10&&(a="0"+a),i=r+"°"+Fe.separator+a+"′";break;case"dms":case"deg+min+sec":r=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,r++),r=("000"+r).slice(-3),a=("00"+a).slice(-2),s<10&&(s="0"+s),i=r+"°"+Fe.separator+a+"′"+Fe.separator+s+"″"}return i}static toLat(t,e,n){let i=Fe.toDms(Fe.wrap90(t),e,n);return null===i?"–":i.slice(1)+Fe.separator+(t<0?"S":"N")}static toLon(t,e,n){let i=Fe.toDms(Fe.wrap180(t),e,n);return null===i?"–":i+Fe.separator+(t<0?"W":"E")}static toBrng(t,e,n){let i=Fe.toDms(Fe.wrap360(t),e,n);return null===i?"–":i.replace("360","0")}static fromLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=Fe.wrap360(t);let n=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*n/360)%n*16/n]}static wrap360(t){return 0<=t&&t<360?t:(t%360+360)%360}static wrap180(t){return-180<t&&t<=180?t:(t+540)%360-180}static wrap90(t){return-90<=t&&t<=90?t:Math.abs((t%360+270)%360-180)-90}};Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var ee=Fe,ge=Math.PI,G=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=ee.wrap90(Number(t)),this._lon=ee.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?ee.wrap90(ee.parse(t)):ee.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?ee.wrap90(ee.parse(t)):ee.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)?ee.wrap180(ee.parse(t)):ee.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?ee.wrap180(ee.parse(t)):ee.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?ee.wrap180(ee.parse(t)):ee.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=ee.wrap90(ee.parse(e)),n=ee.wrap180(ee.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=ee.wrap90(ee.parse(e)),n=ee.wrap180(ee.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){let i=t[0];if("Point"==i.type&&Array.isArray(i.coordinates)?[n,e]=i.coordinates:(null!=i.latitude&&(e=i.latitude),null!=i.lat&&(e=i.lat),null!=i.longitude&&(n=i.longitude),null!=i.lng&&(n=i.lng),null!=i.lon&&(n=i.lon),e=ee.wrap90(ee.parse(e)),n=ee.wrap180(ee.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 G(e,n)}distanceTo(t,e=6371e3){if(t instanceof G||(t=G.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);let n=e,i=this.lat.toRadians(),r=this.lon.toRadians(),a=t.lat.toRadians(),s=a-i,o=t.lon.toRadians()-r,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(i)*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 G||(t=G.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),i=(t.lon-this.lon).toRadians(),r=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(i),a=Math.sin(i)*Math.cos(n),s=Math.atan2(a,r).toDegrees();return ee.wrap360(s)}finalBearingTo(t){t instanceof G||(t=G.parse(t));let e=t.initialBearingTo(this)+180;return ee.wrap360(e)}midpointTo(t){t instanceof G||(t=G.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),i=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),a=Math.cos(e),s=0,o=Math.sin(e),l={x:a+Math.cos(i)*Math.cos(r),y:s+Math.cos(i)*Math.sin(r),z:o+Math.sin(i)},h=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),c=n+Math.atan2(l.y,l.x),u=h.toDegrees(),d=c.toDegrees();return new G(u,d)}intermediatePointTo(t,e){if(t instanceof G||(t=G.parse(t)),this.equals(t))return new G(this.lat,this.lon);let n=this.lat.toRadians(),i=this.lon.toRadians(),r=t.lat.toRadians(),a=t.lon.toRadians(),s=r-n,o=a-i,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(n)*Math.cos(r)*Math.sin(o/2)*Math.sin(o/2),h=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),c=Math.sin((1-e)*h)/Math.sin(h),u=Math.sin(e*h)/Math.sin(h),d=c*Math.cos(n)*Math.cos(i)+u*Math.cos(r)*Math.cos(a),p=c*Math.cos(n)*Math.sin(i)+u*Math.cos(r)*Math.sin(a),f=c*Math.sin(n)+u*Math.sin(r),g=Math.atan2(f,Math.sqrt(d*d+p*p)),y=Math.atan2(p,d),m=g.toDegrees(),v=y.toDegrees();return new G(m,v)}destinationPoint(t,e,n=6371e3){let i=t/n,r=Number(e).toRadians(),a=this.lat.toRadians(),s=this.lon.toRadians(),o=Math.sin(a)*Math.cos(i)+Math.cos(a)*Math.sin(i)*Math.cos(r),l=Math.asin(o),h=Math.sin(r)*Math.sin(i)*Math.cos(a),c=Math.cos(i)-Math.sin(a)*o,u=s+Math.atan2(h,c),d=l.toDegrees(),p=u.toDegrees();return new G(d,p)}static intersection(t,e,n,i){if(t instanceof G||(t=G.parse(t)),n instanceof G||(n=G.parse(n)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(i))throw new TypeError(`invalid brng2 ‘${i}’`);let r=t.lat.toRadians(),a=t.lon.toRadians(),s=n.lat.toRadians(),o=n.lon.toRadians(),l=Number(e).toRadians(),h=Number(i).toRadians(),c=s-r,u=o-a,d=2*Math.asin(Math.sqrt(Math.sin(c/2)*Math.sin(c/2)+Math.cos(r)*Math.cos(s)*Math.sin(u/2)*Math.sin(u/2)));if(Math.abs(d)<Number.EPSILON)return new G(t.lat,t.lon);let p=(Math.sin(s)-Math.sin(r)*Math.cos(d))/(Math.sin(d)*Math.cos(r)),f=(Math.sin(r)-Math.sin(s)*Math.cos(d))/(Math.sin(d)*Math.cos(s)),g=Math.acos(Math.min(Math.max(p,-1),1)),y=Math.acos(Math.min(Math.max(f,-1),1)),m=l-(Math.sin(o-a)>0?g:2*ge-g),v=(Math.sin(o-a)>0?2*ge-y:y)-h;if(0==Math.sin(m)&&0==Math.sin(v)||Math.sin(m)*Math.sin(v)<0)return null;let w=-Math.cos(m)*Math.cos(v)+Math.sin(m)*Math.sin(v)*Math.cos(d),_=Math.atan2(Math.sin(d)*Math.sin(m)*Math.sin(v),Math.cos(v)+Math.cos(m)*w),M=Math.asin(Math.min(Math.max(Math.sin(r)*Math.cos(_)+Math.cos(r)*Math.sin(_)*Math.cos(l),-1),1)),b=a+Math.atan2(Math.sin(l)*Math.sin(_)*Math.cos(r),Math.cos(_)-Math.sin(r)*Math.sin(M)),x=M.toDegrees(),N=b.toDegrees();return new G(x,N)}crossTrackDistanceTo(t,e,n=6371e3){t instanceof G||(t=G.parse(t)),e instanceof G||(e=G.parse(e));let i=n;if(this.equals(t))return 0;let r=t.distanceTo(this,i)/i,a=t.initialBearingTo(this).toRadians(),s=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(r)*Math.sin(a-s))*i}alongTrackDistanceTo(t,e,n=6371e3){t instanceof G||(t=G.parse(t)),e instanceof G||(e=G.parse(e));let i=n;if(this.equals(t))return 0;let r=t.distanceTo(this,i)/i,a=t.initialBearingTo(this).toRadians(),s=t.initialBearingTo(e).toRadians(),o=Math.asin(Math.sin(r)*Math.sin(a-s));return Math.acos(Math.cos(r)/Math.abs(Math.cos(o)))*Math.sign(Math.cos(s-a))*i}maxLatitude(t){let e=Number(t).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(n))).toDegrees()}static crossingParallels(t,e,n){if(t.equals(e))return null;let i=Number(n).toRadians(),r=t.lat.toRadians(),a=t.lon.toRadians(),s=e.lat.toRadians(),o=e.lon.toRadians()-a,l=Math.sin(r)*Math.cos(s)*Math.cos(i)*Math.sin(o),h=Math.sin(r)*Math.cos(s)*Math.cos(i)*Math.cos(o)-Math.cos(r)*Math.sin(s)*Math.cos(i),c=Math.cos(r)*Math.cos(s)*Math.sin(i)*Math.sin(o);if(c*c>l*l+h*h)return null;let u=Math.atan2(-h,l),d=Math.acos(c/Math.sqrt(l*l+h*h)),p=a+u+d,f=(a+u-d).toDegrees(),g=p.toDegrees();return{lon1:ee.wrap180(f),lon2:ee.wrap180(g)}}rhumbDistanceTo(t,e=6371e3){t instanceof G||(t=G.parse(t));let n=e,i=this.lat.toRadians(),r=t.lat.toRadians(),a=r-i,s=Math.abs(t.lon-this.lon).toRadians();Math.abs(s)>ge&&(s=s>0?-(2*ge-s):2*ge+s);let o=Math.log(Math.tan(r/2+ge/4)/Math.tan(i/2+ge/4)),l=Math.abs(o)>1e-11?a/o:Math.cos(i);return Math.sqrt(a*a+l*l*s*s)*n}rhumbBearingTo(t){if(t instanceof G||(t=G.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),i=(t.lon-this.lon).toRadians();Math.abs(i)>ge&&(i=i>0?-(2*ge-i):2*ge+i);let r=Math.log(Math.tan(n/2+ge/4)/Math.tan(e/2+ge/4)),a=Math.atan2(i,r).toDegrees();return ee.wrap360(a)}rhumbDestinationPoint(t,e,n=6371e3){let i=this.lat.toRadians(),r=this.lon.toRadians(),a=Number(e).toRadians(),s=t/n,o=s*Math.cos(a),l=i+o;Math.abs(l)>ge/2&&(l=l>0?ge-l:-ge-l);let h=Math.log(Math.tan(l/2+ge/4)/Math.tan(i/2+ge/4)),c=Math.abs(h)>1e-11?o/h:Math.cos(i),u=r+s*Math.sin(a)/c,d=l.toDegrees(),p=u.toDegrees();return new G(d,p)}rhumbMidpointTo(t){t instanceof G||(t=G.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),i=t.lat.toRadians(),r=t.lon.toRadians();Math.abs(r-n)>ge&&(n+=2*ge);let a=(e+i)/2,s=Math.tan(ge/4+e/2),o=Math.tan(ge/4+i/2),l=Math.tan(ge/4+a/2),h=((r-n)*Math.log(l)+n*Math.log(o)-r*Math.log(s))/Math.log(o/s);isFinite(h)||(h=(n+r)/2);let c=a.toDegrees(),u=h.toDegrees();return new G(c,u)}static areaOf(t,e=6371e3){let n=e,i=t[0].equals(t[t.length-1]);i||t.push(t[0]);let r=t.length-1,a=0;for(let e=0;e<r;e++){let n=t[e].lat.toRadians(),i=t[e+1].lat.toRadians(),r=(t[e+1].lon-t[e].lon).toRadians();a+=2*Math.atan2(Math.tan(r/2)*(Math.tan(n/2)+Math.tan(i/2)),1+Math.tan(n/2)*Math.tan(i/2))}(function(t){let e=0,n=t[0].initialBearingTo(t[1]);for(let i=0;i<t.length-1;i++){let r=t[i].initialBearingTo(t[i+1]),a=t[i].finalBearingTo(t[i+1]);e+=(r-n+540)%360-180,e+=(a-r+540)%360-180,n=a}return e+=(t[0].initialBearingTo(t[1])-n+540)%360-180,Math.abs(e)<90})(t)&&(a=Math.abs(a)-2*ge);let s=Math.abs(a*n*n);return i||t.pop(),s}equals(t){return t instanceof G||(t=G.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`${ee.toLat(this.lat,t,e)}, ${ee.toLon(this.lon,t,e)}`}};T(),T(),T();var Ft=class{constructor(t){c(this,"destinations",[]),this.destinations=t}};T();var oa,it,ra=class{constructor(t,e){O(this,oa,void 0),O(this,it,void 0),c(this,"distance",0),c(this,"path",[]),c(this,"instructions",[]),N(this,it,t),N(this,oa,e),this.distance=e.distance,this.instructions=e.instructions.map((t=>{var e,n,i,r,a,s,o,h,c,u,d,p;let f={...t,action:{...t.action},atLocation:(null==(e=t.atLocation)?void 0:e.id)?null==(i=null==(n=l(this,it))?void 0:n._vortexesById)?void 0:i[t.atLocation.id]:void 0,node:(null==(r=t.node)?void 0:r.id)?null==(s=null==(a=l(this,it))?void 0:a._nodesById)?void 0:s[t.node.id]:void 0};return((null==(o=f.action)?void 0:o.type)===we.TAKEVORTEX||(null==(h=f.action)?void 0:h.type)===we.EXITVORTEX)&&(f.action.fromMap=null==(u=l(this,it)._mapsById)?void 0:u[null==(c=f.action)?void 0:c.fromMap.id],f.action.toMap=null==(p=l(this,it)._mapsById)?void 0:p[null==(d=f.action)?void 0:d.toMap.id]),f})),this.path=e.path.map((t=>{var e,n;return null==(n=null==(e=l(this,it))?void 0:e._nodesById)?void 0:n[t.id]}))}toJSON(){return l(this,oa)}};oa=new WeakMap,it=new WeakMap;var yt,ft=class{constructor(t){O(this,yt,void 0),N(this,yt,t)}directionsTo(t,e){if(t instanceof Ft){let n=[],i=this;for(let r=0;r<t.destinations.length;r++){let a=t.destinations[r],s=sa(i),o=sa(a),h=l(this,yt).navigator.getDirections({originIds:s,destinationNodeIds:o,accessible:(null==e?void 0:e.accessible)||!1}),c=new ra(l(this,yt),h);n.push(c),i=a}return n}{let n=sa(this),i=sa(t),r=l(this,yt).navigator.getDirections({originIds:n,destinationNodeIds:i,accessible:(null==e?void 0:e.accessible)||!1});return new ra(l(this,yt),r)}}distanceTo(t,e){let n=this.directionsTo(t,e);return(null==n?void 0:n.distance)||0}};yt=new WeakMap;var ro=0,oo="9999-12-31T00:00:00.000Z";function so(t,e,n=new Date){if(!t.states)return;let i=n||new Date,r=t.states.find((t=>{let e=new Date(t.start||ro),n=new Date(t.end||oo);return e<i&&n>i}));return r?e.find((t=>t.value===r.type)):void 0}var He,bt,Re,la,ua,ca,da=class extends ft{constructor(t,e){super(t),O(this,He,void 0),O(this,bt,void 0),O(this,Re,{}),c(this,"states"),c(this,"id",""),c(this,"name",""),c(this,"type",""),c(this,"description"),c(this,"sortOrder"),c(this,"logo"),c(this,"phone"),c(this,"social"),c(this,"color"),c(this,"shortName"),c(this,"detailsUrl"),c(this,"tags"),c(this,"externalId"),c(this,"showLabelWhenImagePresent"),c(this,"picture"),c(this,"operationHours"),c(this,"siblingGroups"),c(this,"gallery"),O(this,la,void 0),O(this,ua,[]),O(this,ca,void 0),N(this,He,t),N(this,bt,e);let n=Object.assign({},e);delete n.categories,Object.assign(this,n)}get polygons(){let t=l(this,Re).polygons;if(void 0!==t)return t;let e=[],n=l(this,la),i=l(this,He)._polygonsById;if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t){let r=i[n[t].id];null!=r&&r.geometry.visible&&e.push(r)}return l(this,Re).polygons=e,e}set polygons(t){N(this,la,t)}get nodes(){let t=l(this,Re).nodes;if(void 0!==t)return t;let e=[],n=l(this,ua),i=l(this,He)._nodesById;if(n)for(let t=0,r=n.length;t<r;++t){let r=i[n[t].node];null!=r&&e.push(r)}return l(this,Re).nodes=e,e}set nodes(t){N(this,ua,t)}get parent(){let t=l(this,Re).parent;if(void 0!==t)return t;let e,n=l(this,He)._locationsById,i=l(this,ca);return void 0!==i&&(e=n[i]),l(this,Re).parent=e,e}set parent(t){N(this,ca,t)}get categories(){let t=l(this,Re).categories;if(void 0!==t)return t;let e=[];return l(this,bt).categories.forEach((t=>{let n=l(this,He).getCollectionItemById(rt.CATEGORY,t);n&&e.push(n)})),l(this,Re).categories=e,e}get state(){return so(this,l(this,He).locationStates)}clone(){return new da(l(this,He),l(this,bt))}get nodeOperationHours(){let t=l(this,Re).nodeOperationHours;if(void 0!==t)return t;if(null==this.nodes)return{};let e=l(this,bt).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return l(this,Re).nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new da(e,t)))}static async fetch(t){let e=t.options.things.locations.slice();t.options.things.categories&&be(e,"categories"),t.options.things.nodes&&be(e,"nodes"),t.options.things.polygons&&be(e,"polygons"),t.options.things.locationStates&&be(e,"states");let n={fields:e,venue:t.options.venue};try{let e=await ke(t.options,"location",n);return t.options.includeHidden||(e=e.filter((t=>!t.hidden))),e.map((e=>new da(t,e)))}catch(t){return D.error("Fetch Locations:",t),[]}}toJSON(){let t=l(this,bt);return delete t.color,t}},kt=da;He=new WeakMap,bt=new WeakMap,Re=new WeakMap,la=new WeakMap,ua=new WeakMap,ca=new WeakMap,T();var vt,Ct,Ge,pa,ln=class extends ft{constructor(t,e){super(t),O(this,vt,void 0),O(this,Ct,void 0),O(this,Ge,{}),c(this,"geometry"),c(this,"perspectives"),c(this,"image"),c(this,"holes"),c(this,"textures"),c(this,"material"),c(this,"label"),c(this,"id",""),c(this,"layer"),c(this,"layerId"),c(this,"name"),c(this,"externalId"),c(this,"vertexes"),c(this,"canvasBounds"),O(this,pa,void 0),N(this,vt,t),N(this,Ct,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=l(this,Ge).map;if(void 0!==t)return t;let e=l(this,vt).getCollectionItemById(rt.MAP,l(this,Ct).map);return l(this,Ge).map=e,e}get locations(){var t,e;let n=l(this,Ge).locations;if(void 0!==n)return n;let i=[],r=null!=(e=null==(t=Be.instances.get(l(this,vt)))?void 0:t.locationsByMapId.get(this.map.id))?e:[],{id:a}=this;for(let t=0,e=r.length;t<e;++t){let e=r[t],n=e.polygons;if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t)if(n[t].id===a){i.push(e);break}}return l(this,Ge).locations=i,i}get entrances(){let t=l(this,Ge).entrances;if(void 0!==t)return t;let e=[],n=l(this,pa),i=l(this,vt)._nodesById;if(Array.isArray(n)){for(let t=0,r=n.length;t<r;++t){let r=i[n[t].id];null!=r&&e.push(r)}return l(this,Ge).entrances=e,e}return[]}set entrances(t){N(this,pa,t)}get rank(){let t=l(this,Ge).rank;if(void 0!==t)return t;let{rankings:e}=l(this,vt);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(l(this,Ge).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(l(this,Ge).rank=null,null)}static hydrate(t,e){return t.map((t=>new ln(e,t)))}static async fetch(t){let e=t.options.things.polygons.slice();t.options.things.maps&&be(e,"map"),t.options.things.nodes&&be(e,"entrances");let n={fields:e,venue:t.options.venue};try{return(await ke(t.options,"polygon",n)).filter((t=>t.geometry.visible)).map((e=>new ln(t,e)))}catch(t){return D.error("Fetch Polygons:",t),[]}}toJSON(){return l(this,Ct)}},Lt=ln;function Ji(t){return/^[\da-f]{24}$/i.test(t)}function Xi(t,e=!1){let n="";if(null!=t){let i="?",r=e?Object.keys(t).filter((t=>!["slug","venue"].includes(t))):Object.keys(t);for(let e=0,a=r.length;e<a;++e){let a=r[e],s=t[a];null!=s&&(n+=`${i+encodeURIComponent(a)}=${encodeURIComponent(s)}`,i="&")}}return n}function lo(t,e,n,i=!1){var r,a;return i?`${t.supplementaryUrl}${e}?venue=${n.venue||n.slug}`:(null==(r=t.baseUrl)?void 0:r.includes("gateway"))?`${t.baseUrl}${e}/${n.venue||n.slug}${Xi(n,null==(a=t.baseUrl)?void 0:a.includes("gateway"))}`:t.baseUrl+e+Xi(n)}async function ke(t,e,n,i=!1){return Hn(t,e,n,i,!0)}async function Hn(t,e,n,i=!1,r=!1){let a=lo(t,e,n,i),s=await Jn(t,a,i);if(!r&&Array.isArray(s)){if(1===s.length)return s[0];throw new Error("Invalid response object")}return s}async function Jn(t,e,n=!1){let i={language:t.language,clientId:t.clientId,clientSecret:t.clientSecret};n&&delete i.language,i.language&&(e+=`&lang=${encodeURIComponent(i.language)}`);let{headers:r}=t;r["Content-Type"]="text/json",t.authorization&&(r.Authorization=t.authorization),i.language&&(r["Accept-Language"]=i.language);let a={method:"GET",headers:r},s=await ha()(e,a);if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return s.json()}function be(t,e){t.indexOf(e)<0&&t.push(e)}function Yi([t,e],[n,i]){let r=new G(t,e),a=new G(n,i);return r.distanceTo(a)}function Ki(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale);let e;try{let n=t.georeference[0],i=t.georeference[2],r=new G(n.target.x,n.target.y),a=new G(i.target.x,i.target.y),s=r.distanceTo(a),o=n.control.x-i.control.x,l=n.control.y-i.control.y;e=Math.sqrt(o*o+l*l)/s}catch(n){e=1,D.warn(n),D.warn(`Couldn't georeference ${t.name||t.shortName||t.id}. Probably not enough geocoordinates.`)}return e}function sa(t){var e;return t instanceof Lt?t.entrances.map((t=>t.id)):t instanceof kt?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}async function Zi(t){let e={},{maps:n,images:i,scenes:r,polygons:a}=t;if(null!=i)try{let t=Object.keys(i).map((t=>fetch(`data:image/png;base64,${i[t]}`).then((t=>t.blob())).then((n=>{e[t]=n})).catch((t=>{D.error(t)}))));await Promise.all(t)}catch(t){D.error(t)}return n.forEach((t=>{var n;!(null==(n=t.scene)?void 0:n.polygons)&&!r[t.id]||(null!=r&&r[t.id]&&(t.scene||(t.scene={}),Object.defineProperty(t.scene,"polygons",{get:()=>r[t.id]})),null!=i&&(t.scene.images=t.scene.images.map((({filename:t})=>({filename:t,url:e[t]}))),t.scene.polygons.forEach((t=>{var n,i;if((null==(n=null==t?void 0:t.image)?void 0:n.url)&&(null==(i=null==t?void 0:t.image)?void 0:i.url)){let n=t.image.url.split("/"),i=e[n[n.length-1]];i&&(t.image.url=i)}}))))})),null!=i&&a.forEach((t=>{var n;if(null==(n=null==t?void 0:t.image)?void 0:n.url){let n=t.image.url.split("/"),i=e[n[n.length-1]];i&&(t.image.url=i)}})),null!=t.images&&delete t.images,null!=t.scenes&&delete t.scenes,t}function Xn(t,e,n){let i;return function(){let r=this,a=arguments,s=function(){i=null,n||t.apply(r,a)},o=n&&!i;clearTimeout(i),i=setTimeout(s,e),o&&t.apply(r,a)}}vt=new WeakMap,Ct=new WeakMap,Ge=new WeakMap,pa=new WeakMap;var ma,ga,fa,un=class{constructor(t,e){O(this,ma,void 0),O(this,ga,{}),O(this,fa,void 0),c(this,"name"),c(this,"externalId"),c(this,"parents"),c(this,"id"),c(this,"icon"),this.id=e.id,N(this,fa,e),N(this,ma,t),Object.assign(this,e)}get locations(){var t;let e=l(this,ga).locations;if(void 0!==e)return e;let n=[],{locations:i}=l(this,ma),{id:r}=this;for(let e=0,a=i.length;e<a;++e){let a=i[e],s=a.categories;if(Array.isArray(s))for(let e=0,i=s.length;e<i;++e)if((null==(t=s[e])?void 0:t.id)===r){n.push(a);break}}return l(this,ga).locations=n,n}static hydrate(t,e){return t.map((t=>new un(e,t)))}static async fetch(t){let e={fields:t.options.things.categories,venue:t.options.venue};try{return(await ke(t.options,"category",e)).map((e=>new un(t,e)))}catch(t){return D.error("Fetch Categories:",t),[]}}toJSON(){return l(this,fa)}},Pt=un;ma=new WeakMap,ga=new WeakMap,fa=new WeakMap,T();var ya,Dt,ka,dn=class{constructor(t,e){O(this,ya,void 0),O(this,Dt,void 0),O(this,ka,{}),c(this,"id",""),c(this,"type",""),c(this,"name",""),c(this,"description"),c(this,"image"),c(this,"startDate"),c(this,"endDate"),c(this,"showDate"),N(this,Dt,e),N(this,ya,t),Object.assign(this,e)}location(){let t=l(this,ka).location;if(void 0!==t)return t;let e,n=l(this,ya)._locationsById,i=l(this,Dt).location;if(null!=i){let t=n[i];null!=t&&(e=t)}return l(this,ka).location=e,e}static hydrate(t,e){return t.map((t=>new dn(e,t)))}static async fetch(t){let e=t.options.things.events.slice();t.options.things.locations&&be(e,"location");let n={fields:e,venue:t.options.venue,activeAtOrAfter:Date.now()};try{return(await ke(t.options,"event",n)).map((e=>new dn(t,e)))}catch(t){return D.error("Fetch Events:",t),[]}}toJSON(){return l(this,Dt)}},cn=dn;ya=new WeakMap,Dt=new WeakMap,ka=new WeakMap,T();var ba,pn=class{constructor(t){O(this,ba,void 0),c(this,"id",""),c(this,"name",""),c(this,"value",""),N(this,ba,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new pn(t)))}static async fetch(t){let e={fields:t.options.things.locationStates.slice(),venue:t.options.venue};try{return(await ke(t.options,"location-state",e)).map((t=>new pn(t)))}catch(t){return D.error("Fetch Location States:",t),[]}}toJSON(){return l(this,ba)}},Yn=pn;ba=new WeakMap,T(),T();var Ma,Qi,wa,er,ja,xa,hn,uo,mn,co,Je,Xe,Ye,Ke,va=class{constructor(t){O(this,Ma),O(this,wa),O(this,hn),O(this,mn),c(this,"map"),O(this,ja,{}),O(this,xa,void 0),O(this,Je,void 0),O(this,Xe,void 0),O(this,Ye,void 0),O(this,Ke,void 0);let{map:e,mappedin:n}=t;null!=t.lat&&null!=t.lon&&(N(this,Je,t.lat),N(this,Xe,t.lon)),null!=t.x&&null!=t.y&&(N(this,Ye,t.x),N(this,Ke,t.y)),this.map=e,N(this,xa,n)}get x(){return nt(this,wa,er).call(this,"x")}get y(){return nt(this,wa,er).call(this,"y")}get lat(){return nt(this,Ma,Qi).call(this,"lat")}get lon(){return nt(this,Ma,Qi).call(this,"lon")}absoluteDistanceTo(t){return Yi([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=l(this,ja).nearestNode;if(void 0!==t)return t;let e=Be.instances.get(l(this,xa)).findNearestNodeOnMap(this.map.id,this);return l(this,ja).nearestNode=e,e}toJSON(){return{x:this.x,y:this.y,map:this.map,lat:this.lat,lon:this.lon}}};Ma=new WeakSet,Qi=function(t){if(l(this,Je)&&l(this,Xe))return l(this,"lat"===t?Je:Xe);if(null!=l(this,Ye)&&null!=l(this,Ke)){let[e,n]=nt(this,mn,co).call(this,l(this,Ye),l(this,Ke));return N(this,Je,e),N(this,Xe,n),l(this,"lat"===t?Je:Xe)}throw Error("MappedinCoordinate is missing x and y")},wa=new WeakSet,er=function(t){if(l(this,Ye)&&l(this,Ke))return l(this,"x"===t?Ye:Ke);if(null!=l(this,Je)&&null!=l(this,Xe)){let[e,n]=nt(this,hn,uo).call(this,l(this,Je),l(this,Xe));return N(this,Ye,e),N(this,Ke,n),l(this,"x"===t?Ye:Ke)}throw Error("MappedinCoordinate is missing lat and lon")},ja=new WeakMap,xa=new WeakMap,hn=new WeakSet,uo=function(t,e){let n=this.map.georeference[0],i=new G(n.target.x,n.target.y),r=new G(t,e),a=i.distanceTo(r),s=(i.finalBearingTo(r)+360)%360*Math.PI/180||0,o=a*(1/this.map.scale),l=s+this.map.getNorth(),h=Math.sin(l)*o,c=Math.cos(l)*o;return[n.control.x+h,n.control.y-c]},mn=new WeakSet,co=function(t,e){let n,i=this.map.georeference[0],r=new G(i.target.x,i.target.y),a=t-i.control.x,s=i.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(),h=n/this.map._scale,c=r.destinationPoint(h,180*l/Math.PI);return[c.lat,c.lon]},Je=new WeakMap,Xe=new WeakMap,Ye=new WeakMap,Ke=new WeakMap;var Ze,Ta,Ia,fn=class{constructor(t,e){O(this,Ze,void 0),O(this,Ta,{}),O(this,Ia,void 0),c(this,"id",""),c(this,"group",""),c(this,"name",""),c(this,"shortName",""),c(this,"elevation",0),c(this,"scale",0),c(this,"layers"),c(this,"x_scale"),c(this,"perspectiveId"),c(this,"scene"),c(this,"width",0),c(this,"height",0),c(this,"georeference",[]),c(this,"_scale",0),N(this,Ze,t),N(this,Ia,e),Object.assign(this,e),this._scale=Ki(this),this.scale=this.x_scale||1/this._scale}get polygons(){var t,e,n;return null!=(n=null==(e=null==(t=Be.instances.get(l(this,Ze)))?void 0:t.polygonsByMapId)?void 0:e.get(this.id))?n:[]}get locations(){var t,e,n;return null!=(n=null==(e=null==(t=Be.instances.get(l(this,Ze)))?void 0:t.locationsByMapId)?void 0:e.get(this.id))?n:[]}get nodes(){var t,e,n;return null!=(n=null==(e=null==(t=Be.instances.get(l(this,Ze)))?void 0:t.nodesByMapId)?void 0:e.get(this.id))?n:[]}get mapGroup(){let t=l(this,Ta).mapGroup;if(void 0!==t)return t;let e=this.group,n=e&&l(this,Ze)._mapGroupsById[e]||null;return l(this,Ta).mapGroup=n,n}createCoordinateByXY(t,e){return new va({x:t,y:e,map:this,mappedin:l(this,Ze)})}createCoordinate(t,e){return new va({lat:t,lon:e,map:this,mappedin:l(this,Ze)})}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],i=new G(e.target.x,e.target.y),r=new G(n.target.x,n.target.y);t=-((i.finalBearingTo(r)+0)*Math.PI/180-Math.atan2(n.control.y-e.control.y,n.control.x-e.control.x)-Math.PI/2)}catch(e){t=0,D.warn(e),D.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 fn(e,t)))}static async fetch(t){let e=t.options.things.maps.slice();t.options.perspective&&be(e,"perspectives"),t.options.things.mapGroups&&be(e,"group"),be(e,"elevation"),be(e,"x_scale"),be(e,"scale"),be(e,"georeference");let n={fields:e,perspective:t.options.perspective,venue:t.options.venue};try{let r=await ke(t.options,"map",n),a=t=>{let e=i.layers.find((e=>e.id===t));e?e.visible=!0:i.layers.push({id:t,visible:!0})};for(let n=0,s=r.length;n<s;++n){var i=r[n];if(i){let t=i.perspective;null!=t&&(i.perspectiveId=t.id,e.indexOf("scene")>-1&&(i.scene=t.scene),t.layers?(i.layers.forEach((t=>{t.visible=!1})),t.layers.forEach(a)):i.layers.forEach((t=>{t.visible=!0}))),delete i.perspective}r[n]=new fn(t,i)}return r}catch(t){return D.error("Fetch Maps:",t),[]}}toJSON(){return l(this,Ia)}},gn=fn;Ze=new WeakMap,Ta=new WeakMap,Ia=new WeakMap,T();var za,Bt,Oa,kn=class{constructor(t,e){O(this,za,void 0),O(this,Bt,void 0),O(this,Oa,{}),c(this,"id",""),c(this,"name",""),N(this,Bt,e),N(this,za,t),Object.assign(this,e)}get maps(){let t=l(this,Oa).maps;if(void 0!==t)return t;let e=[],{maps:n}=l(this,za),{id:i}=l(this,Bt);for(let t=0,r=n.length;t<r;++t){let r=n[t];r.group===i&&e.push(r)}return l(this,Oa).maps=e,e}static hydrate(t,e){return t.map((t=>new kn(e,t)))}static async fetch(t){let e={fields:t.options.things.mapGroups.slice(),venue:t.options.venue};try{return(await ke(t.options,"map-group",e)).map((e=>new kn(t,e)))}catch(t){return D.error("Fetch Map Groups:",t),[]}}toJSON(){return l(this,Bt)}},yn=kn;za=new WeakMap,Bt=new WeakMap,Oa=new WeakMap,T();var Qe,Rt,Ne,Na,vn=class extends ft{constructor(t,e){super(t),O(this,Qe,void 0),O(this,Rt,void 0),O(this,Ne,{}),c(this,"id",""),c(this,"x",0),c(this,"y",0),c(this,"operationHours"),c(this,"externalId"),O(this,Na,void 0),N(this,Qe,t),N(this,Rt,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=l(this,Ne).map;if(void 0!==t)return t;let e=l(this,Qe).getCollectionItemById(rt.MAP,l(this,Rt).map);return l(this,Ne).map=e,e}get lat(){var t;let e=l(this,Ne).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=l(this,Qe)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return l(this,Ne).cachedLatLon=n.createCoordinateByXY(this.x,this.y),l(this,Ne).cachedLatLon.lat}get lon(){var t;let e=l(this,Ne).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=l(this,Qe)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return l(this,Ne).cachedLatLon=n.createCoordinateByXY(this.x,this.y),l(this,Ne).cachedLatLon.lon}get paths(){let t=l(this,Ne).paths;if(void 0!==t)return t;let e=[],n=l(this,Qe)._nodesById,i=l(this,Na);if(Array.isArray(i))for(let t=0,r=i.length;t<r;++t){let r=n[i[t].node];null!=r&&e.push(r)}return l(this,Ne).paths=e,e}set paths(t){N(this,Na,t)}get locations(){var t,e,n;let i=l(this,Ne).locations;if(void 0!==i)return i;let r=[],a=null!=(n=null==(e=null==(t=Be.instances.get(l(this,Qe)))?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,i=n.length;t<i;++t)if(n[t].id===s){r.push(e);break}}return l(this,Ne).locations=r,r}get polygon(){var t,e,n;let i=l(this,Ne).polygon;if(void 0!==i)return i;let r,a=null!=(n=null==(e=null==(t=Be.instances.get(l(this,Qe)))?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)&&(r=e)}return l(this,Ne).polygon=r,r}static hydrate(t,e){return t.map((t=>new vn(e,t)))}static async fetch(t){let e=t.options.things.nodes.slice();t.options.things.maps&&be(e,"map"),["weight","multiplier","accessible"].forEach((function(t){be(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await ke(t.options,"node",n)).map((e=>new vn(t,e)))}catch(t){return D.error("Fetch Nodes:",t),[]}}toJSON(){return l(this,Rt)}},bn=vn;Qe=new WeakMap,Rt=new WeakMap,Ne=new WeakMap,Na=new WeakMap,T();var _a,wn=class{constructor(t){O(this,_a,void 0),c(this,"polygons",[]),N(this,_a,t),Object.assign(this,t)}static hydrate(t){return new wn(t)}static async fetch(t){try{let e=await Hn(t.options,"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new wn(e)}catch(t){return D.error("Fetch Rankings:",t),null}}toJSON(){return l(this,_a)}},Mn=wn;_a=new WeakMap,T();var Aa,jn=class{constructor(t){c(this,"id",""),O(this,Aa,void 0),N(this,Aa,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new jn(t)))}static async fetch(t){let e={fields:t.options.things.themes.slice(),venue:t.options.venue};try{return(await ke(t.options,"apollo-theme",e)).map((t=>new jn(t)))}catch(t){return D.error("Fetch Theme:",t),[]}}toJSON(){return l(this,Aa)}},Kn=jn;Aa=new WeakMap,T();var Sa,Ea,Gt,Tn=class{constructor(t,e){O(this,Sa,void 0),O(this,Ea,void 0),O(this,Gt,{}),c(this,"defaultMap",""),c(this,"address",""),c(this,"city",""),c(this,"countrycode",""),c(this,"externalId",""),c(this,"id",""),c(this,"latitude"),c(this,"logo"),c(this,"longitude"),c(this,"metadata"),c(this,"name",""),c(this,"operationHours"),c(this,"postal",""),c(this,"slug",""),c(this,"state",""),c(this,"telephone",""),c(this,"tzid",""),c(this,"tzidOverride",""),c(this,"utcOffset",""),c(this,"website",""),N(this,Ea,t),N(this,Sa,e),Object.assign(this,e)}static hydrate(t,e){return new Tn(e,t)}static async fetch(t){let e={fields:t.options.things.venue,slug:t.options.venue,limit:1};try{let n=await ke(t.options,"venue",e);return new Tn(t,n[0])}catch(t){return D.error("Fetch Venue:",t),{}}}get isMultiBuilding(){if(null==l(this,Gt).isMultiBuilding){let t=l(this,Ea).maps,e=t.reduce(((t,e)=>t.add(e.elevation)),new Set),n=t.length!==e.size;l(this,Gt).isMultiBuilding=n}return l(this,Gt).isMultiBuilding}toJSON(){return l(this,Sa)}},xn=Tn;Sa=new WeakMap,Ea=new WeakMap,Gt=new WeakMap,T();var Fa,zn=class{constructor(t){c(this,"id",""),O(this,Fa,void 0),c(this,"name"),c(this,"type"),c(this,"weight"),c(this,"multiplier"),N(this,Fa,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new zn(t)))}static async fetch(t){let e=t.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){be(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await ke(t.options,"vortex",n)).map((t=>new zn(t)))}catch(t){return D.error("Fetch Vortexes:",t),[]}}toJSON(){return l(this,Fa)}},In=zn;function po(t,e){let n=[];return t.features.forEach((t=>{var i,r;let a=[];null==(i=t.properties.spaces)||i.forEach((t=>{if("id"in t){let n;n=e.get(t.id),n&&a.push(...n)}else null==a||a.push({id:t.node,level:""})}));let s=a.map((t=>({node:"n_"+t.id,map:t.level}))),o=null==(r=t.properties.spaces)?void 0:r.filter((t=>"id"in t)),l=(t.properties.hours||[]).map((t=>({...t,"@type":"OpeningHoursSpecification",dayOfWeek:[t.dayOfWeek.replace("http://schema.org/","")]}))),h={...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 h.spaces,n.push(h)})),n}function ho(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 mo(t){let e=[];return t.features.forEach((t=>{let n={...t.properties,icon:t.properties.picture};delete n.picture,e.push(n)})),e}function go(t){let e=1/0,n=1/0,i=-1/0,r=-1/0;return t.features.forEach((t=>{let a;a="MultiPolygon"===t.geometry.type?t.geometry.coordinates[0].flat():t.geometry.coordinates[0],a.forEach((t=>{e=Math.min(e,t[1]),i=Math.max(i,t[1]),n=Math.min(n,t[0]),r=Math.max(r,t[0])}))})),{id:t.features[0].properties.id,minLat:e,minLong:n,maxLat:i,maxLong:r}}function fo(t,e,n){let i=n.createGeoreferences(),r=[];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:i,shortName:t.properties.abbreviation||"",scene:{polygons:e},scale:o,x_scale:o,group:t.properties.building,layers:s,width:n.widthInMapUnits,height:n.heightInMapUnits};r.push(l)})),r}Fa=new WeakMap,T();var tr=class{constructor(t){c(this,"mapExtent"),c(this,"stretchRatio"),c(this,"midLat"),c(this,"midLong"),c(this,"mapUnitRatio",1e6),c(this,"latDistance"),c(this,"longDistance"),c(this,"mapScale"),c(this,"widthInMapUnits"),c(this,"heightInMapUnits"),this.mapExtent=t;let{minLat:e,minLong:n,maxLat:i,maxLong:r}=t,a=(e+i)/2,s=(n+r)/2,o=new G(a,r),l=new G(a,n),h=new G(e,s),u=new G(i,s);this.latDistance=h.distanceTo(u),this.longDistance=o.distanceTo(l);let d=this.latDistance/this.longDistance,p=(i-e)/(r-n);this.stretchRatio=d/p,this.midLat=a,this.midLong=s,this.widthInMapUnits=(r-n)*this.mapUnitRatio,this.heightInMapUnits=(i-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:i}=this.mapExtent;return[[t,e],[t,i],[n,i],[n,e]].map((t=>({target:{x:t[0],y:t[1]},control:this.convert([t[1],t[0]])})))}};function yo(t,e){let n=[];return t.features.forEach((t=>{let i=e.convert(t.geometry.coordinates),r=(t.properties.neighbors||[]).map((e=>({node:e,map:t.properties.level}))),a=t.properties.level,s={...t.properties,x:i.x,y:i.y,paths:r,map:a,externalId:t.properties.externalId||""};n.push(s)})),n}var ar=(t,e,n,i,r)=>{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],h=e.find((t=>t.id===l)),c=t.geometry.coordinates[0].map((t=>r.convert(t))),u=i.find((e=>e.polygonId===t.properties.id)),d=Math.max(r.widthInMapUnits,r.heightInMapUnits)/1e3;if(u){let t=r.convert([u.position[0],u.position[1]]),e=u.size.x,n=u.size.y,i=r.mapScale,a=n*i,s=e*i/d/u.viewBox.width,l=a/d/u.viewBox.height;o={url:null==h?void 0:h.image,visible:!!(null==h?void 0:h.image),viewBox:u.viewBox,scale:{x:s,y:l},position:{x:t.x,y:t.y},rotation:u.rotation,useLocalScaling:!1,_isAbsolutelyPositioned:!0}}let p={...t.properties,entrances:s,map:t.properties.level,externalId:t.properties.externalId||"",geometry:{visible:!0,position:{x:0,y:0,z:((null==h?void 0:h.altitude)||0)*r.mapScale/d},scale:{x:1,y:1,z:((null==h?void 0:h.height)||1)*r.mapScale/d}},material:{color:(null==h?void 0:h.color)||"#000000"},image:o,vertexes:c};a.push(p)})),a};function ko(t,e,n,i,r,a){let s=ar(t,n,i,r,a),o=ar(e,n,i,r,a);return s.concat(o)}function bo(t){let e=new Map;return t.forEach((t=>{t.features.forEach((t=>{let{destinations:n}=t.properties;if(0===n.length)return;let i=n[0].split("-")[0],r=e.get(i),a=n.map((t=>t.split("-")[1])).map((t=>"n_"+t));if(r)r.nodes.push(...a);else{let{name:n,type:r,weight:s,multiplier:o,accessible:l}=t.properties,h={id:i,nodes:a,name:n,type:r,weight:s,multiplier:o,accessible:l};e.set(i,h)}}))})),Array.from(e.values())}function vo(t){let e=[];return t.features.forEach((t=>{let n={...t.properties};e.push(n)})),e}function nr(t){let e=Array.from(t.connection.values()),n=Array.from(t.level.values()),i=t.building,r=t.category,a=t.style,s=t.location,o=t.imageInstance,l=t.polygonStyle,h={},c=[],u=new Map;n.forEach((e=>{let n=e.features[0].properties.id,i=go(e),r=new tr(i);u.set(n,r);let s=t.obstruction.get(n),d=t.space.get(n),p=o.get(n),f=l.get(n);h[n]=ko(d,s,a,f,p,r);let g=t.node.get(n);c.push(...yo(g,r))}));let d=Object.values(h).flat(),p=bo(e),f=n.map((t=>{let e=t.features[0].properties.id,n=u.get(e);return fo(t,h[e],n)})).flat(),g=new Map;Array.from(t.space.values()).forEach((t=>{t.features.forEach((t=>{g.set(t.properties.id,t.properties.entrances)}))}));let y=vo(i),m=po(s,g),v=mo(r),w=ho(s),_=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:m,categories:v,nodes:c,maps:f,polygons:d,vortexes:p,mapGroups:y,locationStates:w,themes:[],venue:{name:_,latitude:b,longitude:M},imageBinaries:x}}T(),T(),T(),T();var zt,Ue,$e,Zn=[0,4,6,8,10],ot=()=>{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],Zn.map(((t,e)=>n.slice(t,e===Zn.length-1?void 0:Zn[e+1]).join(""))).join("-")},ir="mi-session-data",rr="mi-local-data",Qn=class{constructor(){O(this,Ue,void 0),O(this,$e,void 0);try{let t=sessionStorage.getItem(ir);N(this,Ue,t?JSON.parse(t):{id:ot()})}catch{N(this,Ue,{id:ot()})}try{let t=localStorage.getItem(rr);N(this,$e,t?JSON.parse(t):{deviceId:ot()})}catch{N(this,$e,{deviceId:ot()})}l(this,Ue).id||(l(this,Ue).id=ot()),l(this,$e).deviceId||(l(this,$e).deviceId=ot())}static getInstance(){return l(this,zt)||N(this,zt,new Qn),l(this,zt)}static ___clearInstance(){N(this,zt,void 0)}saveSessionData(t,e){l(this,Ue)[t]=e;try{return sessionStorage.setItem(ir,JSON.stringify(l(this,Ue))),!0}catch{return!1}}loadSessionData(t){let e=l(this,Ue)[t];if(null!=e)return e}saveLocalData(t,e){l(this,$e)[t]=e;try{return localStorage.setItem(rr,JSON.stringify(l(this,$e))),!0}catch{return!1}}loadLocalData(t){let e=l(this,$e)[t];if(null!=e)return e}},La=Qn;function or(t){return/^[\da-f]{24}$/i.test(t)}function sr(){return La.getInstance().loadLocalData("deviceId")}function lr(){return La.getInstance().loadSessionData("id")}zt=new WeakMap,Ue=new WeakMap,$e=new WeakMap,O(La,zt,void 0);var Nr,_r,Ca,qt,Vt,Pa,Ut,$t,Wt,Ot,Da,Ht,Jt,Ba,Or=tn(zr()),_o=null==(_r=null==(Nr=C)?void 0:Nr.env)?void 0:_r.npm_package_version,ai=["websdk","web","webv2"],ni="websdk",ri=class{constructor(t){var e;O(this,Ca,void 0),O(this,qt,void 0),O(this,Vt,void 0),O(this,Pa,void 0),O(this,Ut,void 0),O(this,$t,void 0),O(this,Wt,void 0),O(this,Ot,void 0),O(this,Da,void 0),O(this,Ht,void 0),O(this,Jt,void 0),O(this,Ba,void 0),N(this,Ot,t.clientId),N(this,Da,t.clientSecret),N(this,Ht,t.accessToken),N(this,Wt,t.noAuth||!1);let n="https://api-gateway.mappedin.com/track-analytics/a/";!l(this,Wt)&&l(this,Ot)&&!or(l(this,Ot))&&(n="https://web-proxy.mappedin.com/a/"),N(this,Vt,n),N(this,Vt,l(this,Vt)+(t.venue+"/")),N(this,qt,!1),N(this,Ca,"boolean"==typeof t.testMode?t.testMode:"true"===(null==(e=t.testMode)?void 0:e.toLowerCase())),N(this,Pa,ai.find((e=>e===t.context))||ai[0]),N(this,Ut,sr()),N(this,$t,lr()),N(this,Jt,new Set),N(this,Ba,t.platformString||""),this.locationSelected=this.locationSelected.bind(this),this.categorySelected=this.categorySelected.bind(this),this.getDirections=this.getDirections.bind(this)}track(t,e){if(l(this,Ca))return;let n={...e,g:l(this,qt)},i=l(this,Vt)+t+"?"+Or.default.stringify(n),r={"mi-context":ni||l(this,Pa),"mi-session":l(this,$t),"mi-device":l(this,Ut),"mappedin-sdk-version":_o,"mappedin-platform-version":l(this,Ba)};l(this,Ht)?r.Authorization=`Bearer ${l(this,Ht)}`:l(this,Wt)||(r.Authorization=`Basic ${btoa(`${l(this,Ot)}:${l(this,Da)}`)}`),ha()(i,{method:"GET",mode:"cors",headers:r})}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,i){this.track("load-mapview",{type:t,force:e,benchmark:n||-1,reason:i||"success"})}getDirections(t,e){let n={start:t.id,end:e.id,type:"location_to_location"};this.track("query-directions",n)}getSessionID(){return l(this,$t)}getDeviceID(){return l(this,Ut)}setGeolocationMode(t){N(this,qt,t)}trackBlueDotEvent(t){t&&Object.values(ri.BLUEDOT_EVENT).includes(t)&&!l(this,Jt).has(t)?(this.track(t),l(this,Jt).add(t)):D.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=ai.find((e=>e===t));e&&(ni=e)}static clearContext(){ni=void 0}},ii=ri;Ca=new WeakMap,qt=new WeakMap,Vt=new WeakMap,Pa=new WeakMap,Ut=new WeakMap,$t=new WeakMap,Wt=new WeakMap,Ot=new WeakMap,Da=new WeakMap,Ht=new WeakMap,Jt=new WeakMap,Ba=new WeakMap,c(ii,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var rt,On=ii,Ar={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"}(rt||(rt={}));var Mt,Yt,Xt={categories:Pt,locations:kt,vortexes:In,maps:gn,nodes:bn,polygons:Lt,venue:xn,events:cn,mapGroups:yn,themes:Kn,locationStates:Yn,rankings:Mn},Nt=class{constructor(t){c(this,"perspective"),c(this,"things"),c(this,"options"),O(this,Mt,void 0),O(this,Yt,""),c(this,"updatedAt"),c(this,"categories",[]),c(this,"locations",[]),c(this,"vortexes",[]),c(this,"maps",[]),c(this,"nodes",[]),c(this,"polygons",[]),c(this,"venue",{}),c(this,"events",[]),c(this,"mapGroups",[]),c(this,"themes",[]),c(this,"locationStates",[]),c(this,"rankings"),c(this,"_categoriesById"),c(this,"_locationsById"),c(this,"_vortexesById"),c(this,"_mapsById"),c(this,"_nodesById"),c(this,"_polygonsById"),c(this,"_eventsById"),c(this,"_mapGroupsById"),c(this,"_locationStatesById"),c(this,"_locationRankingsById"),c(this,"_rankingsById"),c(this,"_categoriesByExternalId"),c(this,"_locationsByExternalId"),c(this,"_vortexesByExternalId"),c(this,"_mapsByExternalId"),c(this,"_nodesByExternalId"),c(this,"_polygonsByExternalId"),c(this,"_eventsByExternalId"),c(this,"_mapGroupsByExternalId"),c(this,"_locationStatesByExternalId"),c(this,"_locationRankingsByExternalId"),c(this,"_rankingsByExternalId"),c(this,"images"),c(this,"imageBinaries"),c(this,"scenes"),c(this,"analytics"),c(this,"navigator"),this.options=t,N(this,Mt,Be.create(this));let e=new On({...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(qn,"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=l(this,Mt)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),l(this,Mt)[n]=e,e}}),Object.defineProperty(this,`_${n}ById`,{get(){let t=l(this,Mt)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),l(this,Mt)[n]=e,e}}))}return this}catch(t){throw new Error("Unable to generate getters, "+t)}}getCollectionItemById(t,e){let n=`_${t}ByExternalId`,i=this[`_${t}ById`];return null!=i&&null!=i[e]||(i=this[n],null!=i&&null!=i[e])?i[e]:null}async hydrateFromMVF(t){let e=nr(t);return this.hydrate(e)}async hydrate(t,e){let n;if("string"==typeof t)try{N(this,Yt,t),n=JSON.parse(t)}catch(t){return void D.error("Unable to parse JSON",t)}else n=t,N(this,Yt,JSON.stringify(n));let i=Object.keys(n);for(let t=0,e=i.length;t<e;++t){let e=i[t],r=n[e];null!=Xt[e]&&"function"==typeof Xt[e].hydrate&&(this[e]=Xt[e].hydrate(r,this))}e&&await Zi(n);let{images:r,scenes:a,imageBinaries:s}=n;this.images=r,this.scenes=a,this.imageBinaries=s,this.generateGetters(i),this.initNavigator()}async fetch(){"vortexes"in this.options.things||(this.options.things.vortexes=["name","type","accessible","weight","multiplier","nodes"]),"locationStates"in this.options.things||(this.options.things.locationStates=["name","id","value"]),Ji(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,i=n.length;t<i;++t){let i=n[t];Xt[i]&&e.push(Xt[i].fetch(this).then((t=>(this[i]=t,Promise.resolve()))))}return this.generateGetters(n),Promise.all(e).then((()=>{this.initNavigator()}))}initNavigator(){this.navigator=new Un({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 Xt)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 l(this,Yt)||JSON.stringify(this.toJSON())}};Mt=new WeakMap,Yt=new WeakMap,T();var Sr={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"]};T();var _t=tn(Er());T();var Ao=["0","1","2","3","4","5","6","7","8","9"],So=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],Eo=["0","1","2","3","4","5","6","7","8","9"],Fo=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],ec=[...Ao,...So,...Eo,...Fo],Fr=["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"];T();var At,qe,jt,et,_e,Ga,qa,Zt,Va,Qt,ut,_n,An,xt,Ua,Sn,En,Fn,Xo,$a,Wa,pi,Lo=32,Pe=!1,Co=120,li=0,ui=class{constructor(t){c(this,"_callback"),c(this,"_frameCount"),c(this,"_ordering"),c(this,"_supersededBy"),c(this,"name"),c(this,"_remainingFrameCount"),c(this,"_lastFrameTime"),c(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,Pe&&D.log("update instantiated",this.name)}getLastFrameTime(){return this._lastFrameTime}},wt=class{constructor(t){if(c(this,"_postponed"),c(this,"userdata"),c(this,"_priority"),c(this,"_group"),c(this,"name"),c(this,"_lastFrameTime"),c(this,"_callback"),c(this,"_complete"),c(this,"_scheduled"),c(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,Pe&&D.log("task instantiated",this.name)}isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}},ci=class{constructor(t){c(this,"_postponed"),c(this,"_onComplete"),c(this,"_priority"),c(this,"userdata"),c(this,"name"),c(this,"_tasks"),c(this,"_scheduledTasks"),c(this,"_scheduled"),c(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,Pe&&D.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}},Lr=class{constructor(t){c(this,"_maxMillisecondsPerFrame"),c(this,"_time"),this._maxMillisecondsPerFrame=null!=(null==t?void 0:t.maxMillisecondsPerFrame)?t.maxMillisecondsPerFrame:Lo,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}},di=class{constructor(t){var e;c(this,"_raf"),c(this,"_timer"),c(this,"_performance"),c(this,"_scheduledUpdatesByOrdering"),c(this,"_scheduledTasksByPriority"),c(this,"_postponedTasks"),c(this,"_requestAnimationFrameHandle"),c(this,"_updatesToRunThisFrame"),c(this,"_lastFrameTime",0),c(this,"_updatesRunLastFrame"),this._timer=null!=(null==t?void 0:t.timer)?t.timer:new Lr,this._performance=null!=(null==t?void 0:t.performance)&&t.performance,this._scheduledUpdatesByOrdering=new Ra,this._scheduledTasksByPriority=new Ra,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),Pe&&D.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 Ra,this._scheduledTasksByPriority=new Ra,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),Pe&&D.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;Pe&&(0===li&&(n=!0),++li,li%=Co);let i=this._scheduledUpdatesByOrdering.keys();for(let t=i.length-1;t>=0;--t){let e=i[t];for(let t of this._scheduledUpdatesByOrdering.get(e).values())this._updatesToRunThisFrame.push(t),n&&D.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&&D.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 i;this._performance&&(i=performance.now()),e._callback(t),this._performance&&(e._lastFrameTime=performance.now()-i),n&&D.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(),i=null;D.assert(void 0!==n),Object.getPrototypeOf(n)===ci.prototype&&(i=n,n=i._popTask()),D.assert(void 0!==n),D.assert(Object.getPrototypeOf(n)===wt.prototype),this._performance&&(e=performance.now()),n._callback(t),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-e),Pe&&D.log("task completed",n.name),null!=i&&(i.isComplete()?(i.clear(),i._onComplete(),Pe&&D.log("group completed",i.name)):this._scheduledTasksByPriority.insert(i._priority,i))}scheduleUpdate(t){t._remainingFrameCount=t._frameCount,this._scheduledUpdatesByOrdering.insert(t._ordering,t),this.requestAnimationFrame()}scheduleTask(t){if(Object.getPrototypeOf(t)===ci)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,Pe&&D.log("task scheduled",t.name),this.requestAnimationFrame()}cancelUpdate(t){this._scheduledUpdatesByOrdering.delete(t._ordering,t),Pe&&D.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)===wt.prototype?t._cancelled=!0:"clear"in t&&t.clear(),Pe&&D.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)===wt.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)===wt.prototype||!t.isComplete())&&this._postponedTasks.add(t),t._postponed=!0,Pe&&D.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)===wt.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)===wt.prototype||!t.isComplete())&&this._scheduledTasksByPriority.insert(t._priority,t),t._postponed=!1,this.requestAnimationFrame(),Pe&&D.log("task resumed",t.name)}}setTaskPriority(t,e){if(Object.getPrototypeOf(t)===wt.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,Pe&&D.log("task priority changed",t.name,e)}},Ra=class{constructor(){c(this,"_map"),c(this,"_size"),c(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(D.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 i=t.next();if(i.done)return i;e=this._map.get(i.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 D.assert(t===this._size),t}},lt=t=>t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase(),Kt="",Po=.09,Do=1,Bo=.025,Ro=.5,Go=5e-4,qo=5e-4,Vo=.01,Uo=.05,Cr=1,$o=.01,Wo=.2,Ho={MappedinCategory:"categories",MappedinLocation:"locations"},Jo={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:Fr,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===C.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:Po,PRIMARY_INDEX_WEIGHT:Do,SECONDARY_INDEX_WEIGHT:Bo,CATEGORY_NAME_WEIGHT:Ro,LOCATION_NAME_WEIGHT:Cr,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:Go,CATEGORY_LOCATION_TAGS_WEIGHT:qo,CATEGORY_LOCATION_NAME_WEIGHT:Vo,PRIMARY_INDEX_TAGS_NAME_WEIGHT:Uo,LOCATION_DEFAULT_RANK:Cr,RATIO_OF_FUZZY_TO_EXACT:$o,RATIO_OF_PREFIX_TO_EXACT:Wo}},Nn=class{constructor(t,e){var n,i,r;O(this,Fn),O(this,At,void 0),O(this,qe,void 0),O(this,jt,void 0),O(this,et,void 0),O(this,_e,void 0),O(this,Ga,new di({performance:!0})),O(this,qa,void 0),O(this,Zt,void 0),O(this,Va,new Map),O(this,Qt,0),O(this,ut,(t=>{N(this,Qt,1+ +l(this,Qt)),l(this,Ga).scheduleUpdate(new ui({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{t(),N(this,Qt,+l(this,Qt)-1),0===l(this,Qt)&&l(this,Ua).call(this)}}))})),O(this,_n,(t=>{var e,n,i;let{SECONDARY_INDEX_WEIGHT:r,LOCATION_DEFAULT_RANK:a,PRIMARY_INDEX_TAGS_NAME_WEIGHT:s}=l(this,_e).constants,o=a;(null==(e=l(this,_e))?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),l(this,ut).call(this,(()=>{l(this,qe).add({name:lt(t.name),tags:"",id:"MappedinLocation_"+t.id,weight:a,rank:o})})),(null==(n=l(this,_e))?void 0:n.searchTags)&&Array.isArray(t.tags)&&t.tags.forEach((e=>{l(this,qe).add({name:"",tag:lt(e),id:"MappedinLocation_"+t.id,weight:s,rank:o})})),(null==(i=l(this,_e))?void 0:i.searchDescriptions)&&l(this,ut).call(this,(()=>l(this,jt).add({description:lt(t.description||""),id:"MappedinLocation_"+t.id,weight:r,rank:o})))})),O(this,An,(t=>{var e,n;let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:i,CATEGORY_LOCATION_TAGS_WEIGHT:r,CATEGORY_LOCATION_NAME_WEIGHT:a,CATEGORY_NAME_WEIGHT:s}=l(this,_e).constants;l(this,ut).call(this,(()=>l(this,qe).add({name:lt(t.name||""),description:"",id:"MappedinCategory_"+t.id,weight:s})));let o=t.locations.reduce(((t,e)=>t+` ${Kt} `+e.name),"")+` ${Kt}`;if((null==(e=l(this,_e))?void 0:e.searchDescriptionsInCategories)&&t.locations.forEach((e=>{null!=e.description&&l(this,ut).call(this,(()=>l(this,et).add({id:"MappedinCategory_"+t.id,"category.locations.description":lt(e.description),ref:e.name,weight:i})))})),null==(n=l(this,_e))?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+` ${Kt} `+e),""))+` ${Kt}`}),"");l(this,ut).call(this,(()=>l(this,et).add({"category.locations.tags":lt(e),id:"MappedinCategory_"+t.id,weight:r})))}l(this,ut).call(this,(()=>l(this,et).add({"category.locations.name":lt(o),id:"MappedinCategory_"+t.id,weight:a})))})),O(this,xt,void 0),O(this,Ua,void 0),O(this,Sn,(t=>{var e;let n=t.score,{object:i,id:r,weight:a,rank:s}=t,[o,h]=r.split("_"),c=i||l(this,At).getCollectionItemById(Ho[o],h);return s&&(null==(e=l(this,_e))?void 0:e.useLocationRank)&&(n+=s),a&&(n*=a),{score:n,type:o,object:c}})),O(this,En,((t,e)=>{for(let n in t.match)t.match[n].forEach((i=>{let r=t.ref||t[i]||e.object[i];if("category.locations.tags"===i||"category.locations.name"===i){let e=new RegExp(`[^${Kt}]* `+n+` [^${Kt}]*`,"ig").exec(t[i]);null!=e&&(r=e[0].slice(1,-1))}e.matches.push({term:n,weight:t.weight,matchesOn:i,value:r})}))})),O(this,$a,void 0),O(this,Wa,void 0),N(this,Zt,new On({...t.options,testMode:!1===(null==e?void 0:e.emitAnalyticsEvents)})),N(this,_e,{...Jo,...e}),N(this,At,t),N(this,qa,new Set(null==(n=l(this,_e))?void 0:n.stopWords));let{PRIMARY_INDEX_FUZZYNESS:a,PRIMARY_INDEX_WEIGHT:s,CATEGORY_NAME_WEIGHT:o,RATIO_OF_FUZZY_TO_EXACT:h,RATIO_OF_PREFIX_TO_EXACT:c,PRIMARY_INDEX_TAGS_NAME_WEIGHT:u}=l(this,_e).constants,d=["object","query","weight","tag","rank"],p={fields:["query","name","tag"],storeFields:d,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:a},boost:{name:s,query:s,tag:u},weights:{fuzzy:h,prefix:c},boostDocument:t=>t.includes("MappedinLocation")?s:t.includes("MappedinCategory")?o:s},f={fields:["description"],storeFields:d,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(t,e)=>{var n;return(null==(n=l(this,qa))?void 0:n.has(t.toLowerCase()))?null:t.toLowerCase()}},g={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...d,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(N(this,xt,new Promise((t=>{N(this,Ua,t)}))),null==(i=l(this,_e))?void 0:i.jsonIndex){let{primary:t,secondary:e,extra:n}=JSON.parse(null==(r=l(this,_e))?void 0:r.jsonIndex);N(this,qe,_t.default.loadJS(t,p)),N(this,jt,_t.default.loadJS(e,f)),N(this,et,_t.default.loadJS(n,g))}else N(this,qe,new _t.default(p)),N(this,jt,new _t.default(f)),N(this,et,new _t.default(g)),l(this,At).locations.forEach(l(this,_n)),l(this,At).categories.forEach(l(this,An));l(this,Ga).update(performance.now()),N(this,$a,Xn(((t,e)=>{l(this,Zt).trackSearchSuggest({query:t,hits:e})}),300)),N(this,Wa,Xn(((t,e)=>{l(this,Zt).trackSearch({query:t,hits:e})}),300))}async suggest(t){await l(this,xt);let{PRIMARY_INDEX_FUZZYNESS:e,PRIMARY_INDEX_WEIGHT:n,PRIMARY_INDEX_TAGS_NAME_WEIGHT:i,RATIO_OF_FUZZY_TO_EXACT:r,RATIO_OF_PREFIX_TO_EXACT:a}=l(this,_e).constants,s=l(this,qe).autoSuggest(t,{fields:["name","tag","query"],combineWith:"AND",prefix:!0,fuzzy:e,boost:{name:n,query:n,tag:i},weights:{fuzzy:r,prefix:a}});return l(this,$a).call(this,t,s.length),{total:s.length,hits:s.map((t=>({text:t.suggestion})))}}async search(t){await l(this,xt);let e=nt(this,Fn,Xo).call(this,t);return l(this,Wa).call(this,t,e.length),e}async toJSON(){return await l(this,xt),JSON.stringify({primary:l(this,qe),secondary:l(this,jt),extra:l(this,et)})}async addQuery(t){let e,n,{query:i,object:r,weight:a=1}=t;await l(this,xt),e=r instanceof kt?"MappedinLocation":r instanceof Pt?"MappedinCategory":"Custom","MappedinLocation"===e||"MappedinCategory"===e?n=e+"_"+r.id:"string"==typeof r.id?n="Custom_"+r.id:(n=l(this,Va).get(r),n||(n="Custom_"+ot(),l(this,Va).set(r,n))),l(this,qe).add({id:n,weight:a,object:r,query:lt(i)})}};At=new WeakMap,qe=new WeakMap,jt=new WeakMap,et=new WeakMap,_e=new WeakMap,Ga=new WeakMap,qa=new WeakMap,Zt=new WeakMap,Va=new WeakMap,Qt=new WeakMap,ut=new WeakMap,_n=new WeakMap,An=new WeakMap,xt=new WeakMap,Ua=new WeakMap,Sn=new WeakMap,En=new WeakMap,Fn=new WeakSet,Xo=function(t){let e=[],n=lt(t);e=[...l(this,qe).search(n),...l(this,jt).search(n),...l(this,et).search(n)].sort(((t,e)=>e.score-t.score));let i={};for(let t of e){let e=l(this,Sn).call(this,t);i[t.id]?i[t.id].score+=e.score:i[t.id]={...e,matches:[]},l(this,En).call(this,t,i[t.id])}return Object.keys(i).map((t=>({...i[t],matches:i[t].matches.sort(((t,e)=>e.weight-t.weight))}))).sort(((t,e)=>e.score-t.score))},$a=new WeakMap,Wa=new WeakMap,T(),function(t){t.MULTI_GEOMETRY="MULTI_GEOMETRY",t.SINGLE_GEOMETRY="SINGLE_GEOMETRY"}(pi||(pi={}));var Dr=globalThis.fetch;function ha(){if(null==Dr)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return Dr}var Rr,Gr,Yo=null==(Gr=null==(Rr=C)?void 0:Rr.env)?void 0:Gr.npm_package_version;globalThis.btoa||(globalThis.btoa=Pr.encode);var Ko=["ar"];function hi(t){let e={...Ar,things:Sr,...t};return e.headers={...e.headers,"mappedin-sdk-version":Yo},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 mi(t){let e=hi({baseUrl:"https://api-gateway.mappedin.com/",...{emitAnalyticsEvents:!0,...t}}),n="public/1/"+(e.useDraftData?"draft/":""),i=new Nt({...e,baseUrl:e.baseUrl+n});return await i.fetch(),i}var Br={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function gi(t){let e=hi({baseUrl:"https://api-gateway.mappedin.com/",...Br,...t}),{url:n,updated_at:i}=await Zo(t),r=await ha()(n,{mode:"cors"}),{data:a,format:s="jsonstring"}=await r.json();if("jsonstring"!==s)throw new Error(`Unrecognized format ${s}`);let o=new Nt(e);return await o.hydrate(a,e.shouldPopulateBundledImagesAsBlobs),o.updatedAt=i,o}async function Zo(t){let e=hi({baseUrl:"https://api-gateway.mappedin.com/",...Br,...t}),{version:n,venue:i}=t,r=`${t.bundleBaseUri||e.baseUrl+`exports/legacy${null!=e.language&&Ko.includes(e.language)?"-"+e.language:""}/1/bundle`}?venue=${i}&version=1.0.0`;return e.language=void 0,await Jn(e,r)}var Qo=!1;function es(t){t.things=t.things||{},t.things.venue=t.things.venue||[],t.things.venue.push("slug","defaultMap"),t.things.nodes=t.things.nodes||[],t.things.nodes.push("x","y","paths","map"),t.things.polygons=t.things.polygons||[],t.things.locations=t.things.locations||[],t.things.locations.push("sortOrder","parent","showLabelWhenImagePresent","hidden"),t.things.maps=t.things.maps||[],t.things.maps.push("height","width","georeference"),t.perspective=t.perspective3D||t.perspective||void 0,t.things.maps.push("scene","layers"),t.things.polygons.push("canvasBounds","map","image","perspectives","material","holes","label","geometry"),Qo&&t.things.polygons.push("layer","geometry","vertexes")}var ts=function(t){return null==t.mapView&&(t.mapView={}),new Promise((function(e,n){function i(i,r){if(i)n(i);else{let i={};try{t.firstMapSelector&&(t.mapView=t.mapView||{},t.mapView.firstMap=t.firstMapSelector(r))}catch(t){D.error("Failure in firstMapSelector! Loading default map instead."),D.error(t),n(t)}i.venue=r,e(i)}}es(t.venue),t.venue.useVenueBundle?gi(t.venue).then((t=>i(null,t))).catch((t=>i(t,null))):mi(t.venue).then((t=>i(null,t))).catch((t=>i(t,null)))}))};
|
|
1
|
+
"use strict";var _,oi=Object.create,St=Object.defineProperty,li=Object.getOwnPropertyDescriptor,ui=Object.getOwnPropertyNames,ci=Object.getPrototypeOf,di=Object.prototype.hasOwnProperty,pi=(t,e,n)=>e in t?St(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,hi=(t,e)=>()=>(t&&(e=t(t=0)),e),Qe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),mi=(t,e)=>{for(var n in e)St(t,n,{get:e[n],enumerable:!0})},Wa=(t,e,n,r)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of ui(e))!di.call(t,i)&&i!==n&&St(t,i,{get:()=>e[i],enumerable:!(r=li(e,i))||r.enumerable});return t},Zt=(t,e,n)=>(n=null!=t?oi(ci(t)):{},Wa(!e&&t&&t.__esModule?n:St(n,"default",{value:t,enumerable:!0}),t)),gi=t=>Wa(St({},"__esModule",{value:!0}),t),Ee=(t,e,n)=>(pi(t,"symbol"!=typeof e?e+"":e,n),n),Ha=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},C=(t,e,n)=>(Ha(t,e,"read from private field"),n?n.call(t):e.get(t)),ve=(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)},ue=(t,e,n,r)=>(Ha(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),w=hi((()=>{_={env:{NODE_ENV:"production",npm_package_version:"6.0.0-alpha.0"}}})),Ya=Qe(((t,e)=>{w(),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)})),Ja=Qe(((t,e)=>{var n,r;w(),n=typeof self<"u"?self:t,r=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e||4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){n.r(e),n.d(e,"computeDestinationPoint",(function(){return B})),n.d(e,"convertArea",(function(){return D})),n.d(e,"convertDistance",(function(){return j})),n.d(e,"convertSpeed",(function(){return R})),n.d(e,"decimalToSexagesimal",(function(){return z})),n.d(e,"findNearest",(function(){return U})),n.d(e,"getAreaOfPolygon",(function(){return q})),n.d(e,"getBounds",(function(){return K})),n.d(e,"getBoundsOfDistance",(function(){return J})),n.d(e,"getCenter",(function(){return Y})),n.d(e,"getCenterOfBounds",(function(){return H})),n.d(e,"getCompassDirection",(function(){return X})),n.d(e,"getCoordinateKey",(function(){return g})),n.d(e,"getCoordinateKeys",(function(){return b})),n.d(e,"getDistance",(function(){return $})),n.d(e,"getDistanceFromLine",(function(){return Z})),n.d(e,"getGreatCircleBearing",(function(){return Q})),n.d(e,"getLatitude",(function(){return F})),n.d(e,"getLongitude",(function(){return T})),n.d(e,"getPathLength",(function(){return et})),n.d(e,"getPreciseDistance",(function(){return nt})),n.d(e,"getRhumbLineBearing",(function(){return V})),n.d(e,"getRoughCompassDirection",(function(){return rt})),n.d(e,"getSpeed",(function(){return it})),n.d(e,"isDecimal",(function(){return y})),n.d(e,"isPointInLine",(function(){return at})),n.d(e,"isPointInPolygon",(function(){return st})),n.d(e,"isPointNearLine",(function(){return ot})),n.d(e,"isPointWithinRadius",(function(){return lt})),n.d(e,"isSexagesimal",(function(){return m})),n.d(e,"isValidCoordinate",(function(){return E})),n.d(e,"isValidLatitude",(function(){return x})),n.d(e,"isValidLongitude",(function(){return I})),n.d(e,"orderByDistance",(function(){return G})),n.d(e,"sexagesimalToDecimal",(function(){return v})),n.d(e,"toDecimal",(function(){return O})),n.d(e,"toRad",(function(){return k})),n.d(e,"toDeg",(function(){return C})),n.d(e,"wktToPolygon",(function(){return ht})),n.d(e,"sexagesimalPattern",(function(){return r})),n.d(e,"earthRadius",(function(){return i})),n.d(e,"MINLAT",(function(){return a})),n.d(e,"MAXLAT",(function(){return s})),n.d(e,"MINLON",(function(){return o})),n.d(e,"MAXLON",(function(){return l})),n.d(e,"longitudeKeys",(function(){return u})),n.d(e,"latitudeKeys",(function(){return h})),n.d(e,"altitudeKeys",(function(){return c})),n.d(e,"distanceConversion",(function(){return d})),n.d(e,"timeConversion",(function(){return p})),n.d(e,"areaConversion",(function(){return f}));var r=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/,i=6378137,a=-90,s=90,o=-180,l=180,u=["lng","lon","longitude",0],h=["lat","latitude",1],c=["alt","altitude","elevation","elev",2],d={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},p={m:60,h:3600,d:86400},f={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};f.sqm=f.m2,f.sqkm=f.km2,f.sqft=f.ft2,f.sqyd=f.yd2,f.sqin=f.in2;var g=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)},y=function(t){var e=t.toString().trim();return!isNaN(parseFloat(e))&&parseFloat(e)===Number(e)},m=function(t){return r.test(t.toString().trim())},v=function(t){var e=new RegExp(r).exec(t);if(null==e)throw new Error("Given value is not in sexagesimal format");var n=Number(e[2])/60||0,i=Number(e[4])/3600||0,a=parseFloat(e[1])+n+i;return["S","W"].includes(e[7])?-a:a};function _(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 w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_(Object(n),!0).forEach((function(e){M(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function M(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var b=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:u,latitude:h,altitude:c},n=g(t,e.longitude),r=g(t,e.latitude),i=g(t,e.altitude);return w({latitude:r,longitude:n},i?{altitude:i}:{})},x=function t(e){return y(e)?!(parseFloat(e)>s||e<a):!!m(e)&&t(v(e))},I=function t(e){return y(e)?!(parseFloat(e)>l||e<o):!!m(e)&&t(v(e))},E=function(t){var e=b(t),n=e.latitude,r=e.longitude;if(Array.isArray(t)&&t.length>=2)return I(t[0])&&x(t[1]);if(void 0===n||void 0===r)return!1;var i=t[r],a=t[n];return void 0!==a&&void 0!==i&&!1!==x(a)&&!1!==I(i)};function S(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function N(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?S(Object(n),!0).forEach((function(e){A(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function A(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(e){if(y(e))return Number(e);if(m(e))return v(e);if(E(e)){var n=b(e);return Array.isArray(e)?e.map((function(e,n){return[0,1].includes(n)?t(e):e})):N(N(N({},e),n.latitude&&A({},n.latitude,t(e[n.latitude]))),n.longitude&&A({},n.longitude,t(e[n.longitude])))}return Array.isArray(e)?e.map((function(e){return E(e)?t(e):e})):e},F=function(t,e){var n=g(t,h);if(null!=n){var r=t[n];return!0===e?r:O(r)}},T=function(t,e){var n=g(t,u);if(null!=n){var r=t[n];return!0===e?r:O(r)}},k=function(t){return t*Math.PI/180},C=function(t){return 180*t/Math.PI},B=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,i=F(t),a=T(t),s=e/r,u=k(n),h=k(i),c=k(a),d=Math.asin(Math.sin(h)*Math.cos(s)+Math.cos(h)*Math.sin(s)*Math.cos(u)),p=c+Math.atan2(Math.sin(u)*Math.sin(s)*Math.cos(h),Math.cos(s)-Math.sin(h)*Math.sin(d)),f=C(p);return(f<o||f>l)&&(p=(p+3*Math.PI)%(2*Math.PI)-Math.PI,f=C(p)),{latitude:C(d),longitude:f}},D=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",n=f[e];if(n)return t*n;throw new Error("Invalid unit used for area conversion.")},j=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",n=d[e];if(n)return t*n;throw new Error("Invalid unit used for distance conversion.")},R=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(e){case"kmh":return t*p.h*d.km;case"mph":return t*p.h*d.mi;default:return t}};function L(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}var P=function(t){var e=Math.pow(10,12);return Math.round(t*e)/e},z=function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(typeof Symbol>"u")&&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 L(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return L(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.")}()}(t.toString().split("."),2),n=e[0],r=e[1],i=Math.abs(Number(n)),a=P(60*Number("0."+(r||0))),s=Math.floor(a),o=P(60*(a%s||0));return i+"° "+Number(s.toFixed(6)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+"' "+Number(o.toFixed(4)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+'"'},W=function(t){return t>1?1:t<-1?-1:t},$=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;n=void 0===n||isNaN(n)?1:n;var r=F(t),a=T(t),s=F(e),o=T(e),l=Math.acos(W(Math.sin(k(s))*Math.sin(k(r))+Math.cos(k(s))*Math.cos(k(r))*Math.cos(k(a)-k(o))))*i;return Math.round(l/n)*n},G=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$;return n="function"==typeof n?n:$,e.slice().sort((function(e,r){return n(t,e)-n(t,r)}))},U=function(t,e){return G(t,e)[0]},q=function(t){var e=0;if(t.length>2){for(var n,r,a,s=0;s<t.length;s++){s===t.length-2?(n=t.length-2,r=t.length-1,a=0):s===t.length-1?(n=t.length-1,r=0,a=1):(n=s,r=s+1,a=s+2);var o=T(t[n]),l=F(t[r]),u=T(t[a]);e+=(k(u)-k(o))*Math.sin(k(l))}e=e*i*i/2}return Math.abs(e)},K=function(t){if(!1===Array.isArray(t)||0===t.length)throw new Error("No points were given.");return t.reduce((function(t,e){var n=F(e),r=T(e);return{maxLat:Math.max(n,t.maxLat),minLat:Math.min(n,t.minLat),maxLng:Math.max(r,t.maxLng),minLng:Math.min(r,t.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})},J=function(t,e){var n,r,u=F(t),h=T(t),c=k(u),d=k(h),p=e/i,f=c-p,g=c+p,y=k(s),m=k(a),v=k(l),_=k(o);if(f>m&&g<y){var w=Math.asin(Math.sin(p)/Math.cos(c));(n=d-w)<_&&(n+=2*Math.PI),(r=d+w)>v&&(r-=2*Math.PI)}else f=Math.max(f,m),g=Math.min(g,y),n=_,r=v;return[{latitude:C(f),longitude:C(n)},{latitude:C(g),longitude:C(r)}]},Y=function(t){if(!1===Array.isArray(t)||0===t.length)return!1;var e=t.length,n=t.reduce((function(t,e){var n=k(F(e)),r=k(T(e));return{X:t.X+Math.cos(n)*Math.cos(r),Y:t.Y+Math.cos(n)*Math.sin(r),Z:t.Z+Math.sin(n)}}),{X:0,Y:0,Z:0}),r=n.X/e,i=n.Y/e,a=n.Z/e;return{longitude:C(Math.atan2(i,r)),latitude:C(Math.atan2(a,Math.sqrt(r*r+i*i)))}},H=function(t){var e=K(t),n=e.minLat+(e.maxLat-e.minLat)/2,r=e.minLng+(e.maxLng-e.minLng)/2;return{latitude:parseFloat(n.toFixed(6)),longitude:parseFloat(r.toFixed(6))}},V=function(t,e){var n=k(T(e))-k(T(t)),r=Math.log(Math.tan(k(F(e))/2+Math.PI/4)/Math.tan(k(F(t))/2+Math.PI/4));return Math.abs(n)>Math.PI&&(n=n>0?-1*(2*Math.PI-n):2*Math.PI+n),(C(Math.atan2(n,r))+360)%360},X=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:V,r="function"==typeof n?n(t,e):V(t,e);if(isNaN(r))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(r/22.5)){case 1:return"NNE";case 2:return"NE";case 3:return"ENE";case 4:return"E";case 5:return"ESE";case 6:return"SE";case 7:return"SSE";case 8:return"S";case 9:return"SSW";case 10:return"SW";case 11:return"WSW";case 12:return"W";case 13:return"WNW";case 14:return"NW";case 15:return"NNW";default:return"N"}},Z=function(t,e,n){var r=$(e,t),i=$(t,n),a=$(e,n),s=Math.acos(W((r*r+a*a-i*i)/(2*r*a))),o=Math.acos(W((i*i+a*a-r*r)/(2*i*a)));return s>Math.PI/2?r:o>Math.PI/2?i:Math.sin(s)*r},Q=function(t,e){var n=F(e),r=T(e),i=F(t),a=T(t);return(C(Math.atan2(Math.sin(k(r)-k(a))*Math.cos(k(n)),Math.cos(k(i))*Math.sin(k(n))-Math.sin(k(i))*Math.cos(k(n))*Math.cos(k(r)-k(a))))+360)%360};function tt(t){return(tt="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 et=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$;return t.reduce((function(t,n){return"object"===tt(t)&&null!==t.last&&(t.distance+=e(n,t.last)),t.last=n,t}),{last:null,distance:0}).distance},nt=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;n=void 0===n||isNaN(n)?1:n;var r,a,s,o,l,u,h,c=F(t),d=T(t),p=F(e),f=T(e),g=6356752.314245,y=1/298.257223563,m=k(f-d),v=Math.atan((1-y)*Math.tan(k(parseFloat(c)))),_=Math.atan((1-y)*Math.tan(k(parseFloat(p)))),w=Math.sin(v),M=Math.cos(v),b=Math.sin(_),x=Math.cos(_),I=m,E=100;do{var S=Math.sin(I),N=Math.cos(I);if(0===(u=Math.sqrt(x*S*(x*S)+(M*b-w*x*N)*(M*b-w*x*N))))return 0;r=w*b+M*x*N,a=Math.atan2(u,r),l=r-2*w*b/(o=1-(s=M*x*S/u)*s),isNaN(l)&&(l=0);var A=y/16*o*(4+y*(4-3*o));h=I,I=m+(1-A)*y*s*(a+A*u*(l+A*r*(2*l*l-1)))}while(Math.abs(I-h)>1e-12&&--E>0);if(0===E)return NaN;var O=o*(i*i-g*g)/(g*g),C=1+O/16384*(4096+O*(O*(320-175*O)-768)),B=O/1024*(256+O*(O*(74-47*O)-128)),D=B*u*(l+B/4*(r*(2*l*l-1)-B/6*l*(4*u*u-3)*(4*l*l-3))),j=g*C*(a-D);return Math.round(j/n)*n},rt=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},it=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$,r=n(t,e),i=Number(e.time)-Number(t.time),a=r/i*1e3;return a},at=function(t,e,n){return $(e,t)+$(t,n)===$(e,n)},st=function(t,e){for(var n=!1,r=e.length,i=-1,a=r-1;++i<r;a=i)(T(e[i])<=T(t)&&T(t)<T(e[a])||T(e[a])<=T(t)&&T(t)<T(e[i]))&&F(t)<(F(e[a])-F(e[i]))*(T(t)-T(e[i]))/(T(e[a])-T(e[i]))+F(e[i])&&(n=!n);return n},ot=function(t,e,n,r){return Z(t,e,n)<r},lt=function(t,e,n){return $(t,e)<n};function ut(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}var ht=function(t){if(!t.startsWith("POLYGON"))throw new Error("Invalid wkt.");return t.slice(t.indexOf("(")+2,t.indexOf(")")).split(", ").map((function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(typeof Symbol>"u")&&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 ut(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ut(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.")}()}(t.split(" "),2),n=e[0],r=e[1];return{longitude:parseFloat(n),latitude:parseFloat(r)}}))}}])},"object"==typeof t&&"object"==typeof e?e.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof t?t.geolib=r():n.geolib=r()})),En=Qe(((t,e)=>{w(),e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))})),Cn=Qe(((t,e)=>{w();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{}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{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{return function(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},n=i.exec(t);n;){try{e[n[0]]=decodeURIComponent(n[0])}catch{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)}}})),Rn=Qe(((t,e)=>{w(),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)]}})),Dn=Qe(((t,e)=>{w(),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}})),Yn=Qe((t=>{w();var e=En(),n=Cn(),r=Rn(),i=Dn(),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)}})),Zn=Qe(((t,e)=>{var n,r;w(),n=t,r=function(){var t=function(){return t=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},t.apply(this,arguments)};function e(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 n(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 r,i="KEYS",a="VALUES",s="",o=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=l(this._path),e=t.node,n=t.keys;if(l(n)===s)return{done:!1,value:this.result()};var r=e.get(l(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=l(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 l(e)})).filter((function(t){return t!==s})).join("")},t.prototype.value=function(){return l(this._path).node.get(s)},t.prototype.result=function(){switch(this._type){case a:return this.value();case i:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),l=function(t){return t[t.length-1]},u=function(t,n,r,i,a,o,l,h){var c,d,p=o*l;try{t:for(var f=e(t.keys()),g=f.next();!g.done;g=f.next()){var y=g.value;if(y===s){var m=a[p-1];m<=r&&i.set(h,[t.get(y),m])}else{for(var v=o,_=0;_<y.length;++_,++v){for(var w=y[_],M=l*v,b=M-l,x=a[M],I=Math.max(0,v-r-1),E=Math.min(l-1,v+r),S=I;S<E;++S){var N=w!==n[S],A=a[b+S]+ +N,O=a[b+S+1]+1,F=a[M+S]+1,T=a[M+S+1]=Math.min(A,O,F);T<x&&(x=T)}if(x>r)continue t}u(t.get(y),n,r,i,a,v,l,h+y)}}}catch(t){c={error:t}}finally{try{g&&!g.done&&(d=f.return)&&d.call(f)}finally{if(c)throw c.error}}},h=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(r){var i,a;if(!r.startsWith(this._prefix))throw new Error("Mismatched prefix");var o=n(c(this._tree,r.slice(this._prefix.length)),2),l=o[0],u=o[1];if(void 0===l){var h=n(m(u),2),d=h[0],p=h[1];try{for(var f=e(d.keys()),g=f.next();!g.done;g=f.next()){var y=g.value;if(y!==s&&y.startsWith(p)){var v=new Map;return v.set(y.slice(p.length),d.get(y)),new t(v,r)}}}catch(t){i={error:t}}finally{try{g&&!g.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}}return new t(l,r)},t.prototype.clear=function(){this._size=void 0,this._tree.clear()},t.prototype.delete=function(t){return this._size=void 0,f(this._tree,t)},t.prototype.entries=function(){return new o(this,"ENTRIES")},t.prototype.forEach=function(t){var r,i;try{for(var a=e(this),s=a.next();!s.done;s=a.next()){var o=n(s.value,2);t(o[0],o[1],this)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}},t.prototype.fuzzyGet=function(t,e){return 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 u(t,e,n,r,s,1,i,""),r}(this._tree,t,e)},t.prototype.get=function(t){var e=d(this._tree,t);return void 0!==e?e.get(s):void 0},t.prototype.has=function(t){var e=d(this._tree,t);return void 0!==e&&e.has(s)},t.prototype.keys=function(){return new o(this,i)},t.prototype.set=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");return this._size=void 0,p(this._tree,t).set(s,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=p(this._tree,t);return n.set(s,e(n.get(s))),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=p(this._tree,t),r=n.get(s);return void 0===r&&n.set(s,r=e()),r},t.prototype.values=function(){return new o(this,a)},t.prototype[Symbol.iterator]=function(){return this.entries()},t.from=function(r){var i,a,s=new t;try{for(var o=e(r),l=o.next();!l.done;l=o.next()){var u=n(l.value,2),h=u[0],c=u[1];s.set(h,c)}}catch(t){i={error:t}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(i)throw i.error}}return s},t.fromObject=function(e){return t.from(Object.entries(e))},t}(),c=function(t,n,r){var i,a;if(void 0===r&&(r=[]),0===n.length||null==t)return[t,r];try{for(var o=e(t.keys()),l=o.next();!l.done;l=o.next()){var u=l.value;if(u!==s&&n.startsWith(u))return r.push([t,u]),c(t.get(u),n.slice(u.length),r)}}catch(t){i={error:t}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(i)throw i.error}}return r.push([t,n]),c(void 0,"",r)},d=function(t,n){var r,i;if(0===n.length||null==t)return t;try{for(var a=e(t.keys()),o=a.next();!o.done;o=a.next()){var l=o.value;if(l!==s&&n.startsWith(l))return d(t.get(l),n.slice(l.length))}}catch(t){r={error:t}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}},p=function(t,n){var r,i,a=n.length;t:for(var o=0;t&&o<a;){try{for(var l=(r=void 0,e(t.keys())),u=l.next();!u.done;u=l.next()){var h=u.value;if(h!==s&&n[o]===h[0]){for(var c=Math.min(a-o,h.length),d=1;d<c&&n[o+d]===h[d];)++d;var p=t.get(h);if(d===h.length)t=p;else{var f=new Map;f.set(h.slice(d),p),t.set(n.slice(o,o+d),f),t.delete(h),t=f}o+=d;continue t}}}catch(t){r={error:t}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}var g=new Map;return t.set(n.slice(o),g),g}return t},f=function(t,e){var r=n(c(t,e),2),i=r[0],a=r[1];if(void 0!==i)if(i.delete(s),0===i.size)g(a);else if(1===i.size){var o=n(i.entries().next().value,2),l=o[0],u=o[1];y(a,l,u)}},g=function(t){if(0!==t.length){var e=n(m(t),2),r=e[0],i=e[1];if(r.delete(i),0===r.size)g(t.slice(0,-1));else if(1===r.size){var a=n(r.entries().next().value,2),o=a[0],l=a[1];o!==s&&y(t.slice(0,-1),o,l)}}},y=function(t,e,r){if(0!==t.length){var i=n(m(t),2),a=i[0],s=i[1];a.set(s+e,r),a.delete(s)}},m=function(t){return t[t.length-1]},v="or",_=function(){function r(e){if(null==e?.fields)throw new Error('MiniSearch: option "fields" must be provided');this._options=t(t(t({},I),e),{searchOptions:t(t({},E),e.searchOptions||{})}),this._index=new h,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 r.prototype.add=function(t){var n,r,i,a,s=this._options,o=s.extractField,l=s.tokenize,u=s.processTerm,h=s.fields,c=s.idField,d=o(t,c);if(null==d)throw new Error('MiniSearch: document does not have ID field "'.concat(c,'"'));var p=this.addDocumentId(d);this.saveStoredFields(p,t);try{for(var f=e(h),g=f.next();!g.done;g=f.next()){var y=g.value,m=o(t,y);if(null!=m){var v=l(m.toString(),y),_=this._fieldIds[y],w=new Set(v).size;this.addFieldLength(p,_,this._documentCount-1,w);try{for(var M=(i=void 0,e(v)),b=M.next();!b.done;b=M.next()){var x=u(b.value,y);x&&this.addTerm(_,p,x)}}catch(t){i={error:t}}finally{try{b&&!b.done&&(a=M.return)&&a.call(M)}finally{if(i)throw i.error}}}}}catch(t){n={error:t}}finally{try{g&&!g.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}},r.prototype.addAll=function(t){var n,r;try{for(var i=e(t),a=i.next();!a.done;a=i.next()){var s=a.value;this.add(s)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},r.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)}))},r.prototype.remove=function(t){var r,i,a,s,o,l,u=this._options,h=u.tokenize,c=u.processTerm,d=u.extractField,p=u.fields,f=u.idField,g=d(t,f);if(null==g)throw new Error('MiniSearch: document does not have ID field "'.concat(f,'"'));try{for(var y=e(this._documentIds),m=y.next();!m.done;m=y.next()){var v=n(m.value,2),_=v[0];if(g===v[1]){try{for(var w=(a=void 0,e(p)),M=w.next();!M.done;M=w.next()){var b=M.value,x=d(t,b);if(null!=x){var I=h(x.toString(),b),E=this._fieldIds[b],S=new Set(I).size;this.removeFieldLength(_,E,this._documentCount,S);try{for(var N=(o=void 0,e(I)),A=N.next();!A.done;A=N.next()){var O=c(A.value,b);O&&this.removeTerm(E,_,O)}}catch(t){o={error:t}}finally{try{A&&!A.done&&(l=N.return)&&l.call(N)}finally{if(o)throw o.error}}}}}catch(t){a={error:t}}finally{try{M&&!M.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}return this._storedFields.delete(_),this._documentIds.delete(_),this._fieldLength.delete(_),void(this._documentCount-=1)}}}catch(t){r={error:t}}finally{try{m&&!m.done&&(i=y.return)&&i.call(y)}finally{if(r)throw r.error}}throw new Error("MiniSearch: cannot remove document with ID ".concat(g,": it is not in the index"))},r.prototype.removeAll=function(t){var n,r;if(t)try{for(var i=e(t),a=i.next();!a.done;a=i.next()){var s=a.value;this.remove(s)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new h,this._documentCount=0,this._documentIds=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},r.prototype.search=function(t,r){var i,a;void 0===r&&(r={});var s=this.executeQuery(t,r),o=[];try{for(var l=e(s),u=l.next();!u.done;u=l.next()){var h=n(u.value,2),c=h[0],d=h[1],p=d.score,f=d.terms,g=d.match,y=f.length,m={id:this._documentIds.get(c),score:p*y,terms:Object.keys(g),match:g};Object.assign(m,this._storedFields.get(c)),(null==r.filter||r.filter(m))&&o.push(m)}}catch(t){i={error:t}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return o.sort(O),o},r.prototype.autoSuggest=function(r,i){var a,s,o,l;void 0===i&&(i={}),i=t(t({},S),i);var u=new Map;try{for(var h=e(this.search(r,i)),c=h.next();!c.done;c=h.next()){var d=c.value,p=d.score,f=(M=d.terms).join(" ");null!=(_=u.get(f))?(_.score+=p,_.count+=1):u.set(f,{score:p,terms:M,count:1})}}catch(t){a={error:t}}finally{try{c&&!c.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}var g=[];try{for(var y=e(u),m=y.next();!m.done;m=y.next()){var v=n(m.value,2),_=v[0],w=v[1],M=(p=w.score,w.terms),b=w.count;g.push({suggestion:_,terms:M,score:p/b})}}catch(t){o={error:t}}finally{try{m&&!m.done&&(l=y.return)&&l.call(y)}finally{if(o)throw o.error}}return g.sort(O),g},Object.defineProperty(r.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),r.loadJSON=function(t,e){if(null==e)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return r.loadJS(JSON.parse(t),e)},r.getDefault=function(t){if(I.hasOwnProperty(t))return w(I,t);throw new Error('MiniSearch: unknown option "'.concat(t,'"'))},r.loadJS=function(t,i){var a,s,o,l,u=t.index,c=t.documentCount,d=t.nextId,p=t.documentIds,f=t.fieldIds,g=t.fieldLength,y=t.averageFieldLength,m=t.storedFields,v=t.serializationVersion;if(1!==v&&2!==v)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var _=new r(i);_._documentCount=c,_._nextId=d,_._documentIds=T(p),_._fieldIds=f,_._fieldLength=T(g),_._avgFieldLength=y,_._storedFields=T(m),_._index=new h;try{for(var w=e(u),M=w.next();!M.done;M=w.next()){var b=n(M.value,2),x=b[0],I=b[1],E=new Map;try{for(var S=(o=void 0,e(Object.keys(I))),N=S.next();!N.done;N=S.next()){var A=N.value,O=I[A];1===v&&(O=O.ds),E.set(parseInt(A,10),T(O))}}catch(t){o={error:t}}finally{try{N&&!N.done&&(l=S.return)&&l.call(S)}finally{if(o)throw o.error}}_._index.set(x,E)}}catch(t){a={error:t}}finally{try{M&&!M.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}return _},r.prototype.executeQuery=function(e,n){var r=this;if(void 0===n&&(n={}),"string"!=typeof e){var i=t(t(t({},n),e),{queries:void 0}),a=e.queries.map((function(t){return r.executeQuery(t,i)}));return this.combineResults(a,e.combineWith)}var s=this._options,o=s.tokenize,l=s.processTerm,u=s.searchOptions,h=t(t({tokenize:o,processTerm:l},u),n),c=h.tokenize,d=h.processTerm,p=c(e).map((function(t){return d(t)})).filter((function(t){return!!t})).map(x(h)).map((function(t){return r.executeQuerySpec(t,h)}));return this.combineResults(p,h.combineWith)},r.prototype.executeQuerySpec=function(r,i){var a,s,o,l,u,h,c=t(t({},this._options.searchOptions),i),d=(c.fields||this._options.fields).reduce((function(e,n){var r;return t(t({},e),((r={})[n]=w(e,n)||1,r))}),c.boost||{}),p=c.boostDocument,f=c.weights,g=c.maxFuzzy,y=t(t({},E.weights),f),m=y.fuzzy,v=y.prefix,_=this._index.get(r.term),M=this.termResults(r.term,r.term,1,_,d,p);if(r.prefix&&(u=this._index.atPrefix(r.term)),r.fuzzy){var b=!0===r.fuzzy?.2:r.fuzzy,x=b<1?Math.min(g,Math.round(r.term.length*b)):b;x&&(h=this._index.fuzzyGet(r.term,x))}if(u)try{for(var I=e(u),S=I.next();!S.done;S=I.next()){var N=n(S.value,2),A=N[0],O=N[1];if(C=A.length-r.term.length){h?.delete(A);var F=v*A.length/(A.length+.3*C);this.termResults(r.term,A,F,O,d,p,M)}}}catch(t){a={error:t}}finally{try{S&&!S.done&&(s=I.return)&&s.call(I)}finally{if(a)throw a.error}}if(h)try{for(var T=e(h.keys()),k=T.next();!k.done;k=T.next()){A=k.value;var C,B=n(h.get(A),2),D=B[0];(C=B[1])&&(F=m*A.length/(A.length+C),this.termResults(r.term,A,F,D,d,p,M))}}catch(t){o={error:t}}finally{try{k&&!k.done&&(l=T.return)&&l.call(T)}finally{if(o)throw o.error}}return M},r.prototype.combineResults=function(t,e){if(void 0===e&&(e=v),0===t.length)return new Map;var n=e.toLowerCase();return t.reduce(M[n])||new Map},r.prototype.toJSON=function(){var t,r,i,a,s=[];try{for(var o=e(this._index),l=o.next();!l.done;l=o.next()){var u=n(l.value,2),h=u[0],c=u[1],d={};try{for(var p=(i=void 0,e(c)),f=p.next();!f.done;f=p.next()){var g=n(f.value,2),y=g[0],m=g[1];d[y]=Object.fromEntries(m)}}catch(t){i={error:t}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}s.push([h,d])}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}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:s,serializationVersion:2}},r.prototype.termResults=function(t,n,r,i,a,s,o){var l,u,h,c,d;if(void 0===o&&(o=new Map),null==i)return o;try{for(var p=e(Object.keys(a)),f=p.next();!f.done;f=p.next()){var g=f.value,y=a[g],m=this._fieldIds[g],v=i.get(m);if(null!=v){var _=v.size,M=this._avgFieldLength[m];try{for(var x=(h=void 0,e(v.keys())),I=x.next();!I.done;I=x.next()){var E=I.value,S=s?s(this._documentIds.get(E),n):1;if(S){var A=v.get(E),O=this._fieldLength.get(E)[m],F=r*y*S*b(A,_,this._documentCount,O,M),T=o.get(E);if(T){T.score+=F,N(T.terms,t);var k=w(T.match,n);k?k.push(g):T.match[n]=[g]}else o.set(E,{score:F,terms:[t],match:(d={},d[n]=[g],d)})}}}catch(t){h={error:t}}finally{try{I&&!I.done&&(c=x.return)&&c.call(x)}finally{if(h)throw h.error}}}}}catch(t){l={error:t}}finally{try{f&&!f.done&&(u=p.return)&&u.call(p)}finally{if(l)throw l.error}}return o},r.prototype.addTerm=function(t,e,n){var r=this._index.fetch(n,F),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)}},r.prototype.removeTerm=function(t,e,n){if(this._index.has(n)){var r=this._index.fetch(n,F),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)},r.prototype.warnDocumentChanged=function(t,n,r){var i,a;if(null!=console&&null!=console.warn)try{for(var s=e(Object.keys(this._fieldIds)),o=s.next();!o.done;o=s.next()){var l=o.value;if(this._fieldIds[l]===n)return void console.warn("MiniSearch: document with ID ".concat(this._documentIds.get(t),' has changed before removal: term "').concat(r,'" was not present in field "').concat(l,'". Removing a document after it has changed can corrupt the index!'))}}catch(t){i={error:t}}finally{try{o&&!o.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}},r.prototype.addDocumentId=function(t){var e=this._nextId;return this._documentIds.set(e,t),this._documentCount+=1,this._nextId+=1,e},r.prototype.addFields=function(t){for(var e=0;e<t.length;e++)this._fieldIds[t[e]]=e},r.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)},r.prototype.removeFieldLength=function(t,e,n,r){var i=this._avgFieldLength[e]*n-r;this._avgFieldLength[e]=i/(n-1)},r.prototype.saveStoredFields=function(t,n){var r,i,a=this._options,s=a.storeFields,o=a.extractField;if(null!=s&&0!==s.length){var l=this._storedFields.get(t);null==l&&this._storedFields.set(t,l={});try{for(var u=e(s),h=u.next();!h.done;h=u.next()){var c=h.value,d=o(n,c);void 0!==d&&(l[c]=d)}}catch(t){r={error:t}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}},r}(),w=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0},M=((r={}).or=function(t,n){var r,i;try{for(var a=e(n.keys()),s=a.next();!s.done;s=a.next()){var o=s.value,l=t.get(o);if(null==l)t.set(o,n.get(o));else{var u=n.get(o),h=u.score,c=u.terms,d=u.match;l.score=l.score+h,l.match=Object.assign(l.match,d),A(l.terms,c)}}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return t},r.and=function(t,n){var r,i,a=new Map;try{for(var s=e(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value,u=t.get(l);if(null!=u){var h=n.get(l),c=h.score,d=h.terms,p=h.match;A(u.terms,d),a.set(l,{score:u.score+c,terms:u.terms,match:Object.assign(u.match,p)})}}}catch(t){r={error:t}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a},r.and_not=function(t,n){var r,i;try{for(var a=e(n.keys()),s=a.next();!s.done;s=a.next()){var o=s.value;t.delete(o)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return t},r),b=function(t,e,n,r,i){return Math.log(1+(n-e+.5)/(e+.5))*(.5+2.2*t/(t+1.2*(1-.7+.7*r/i)))},x=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}}},I={idField:"id",extractField:function(t,e){return t[e]},tokenize:function(t,e){return t.split(k)},processTerm:function(t,e){return t.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},E={combineWith:v,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},S={prefix:function(t,e,n){return e===n.length-1}},N=function(t,e){t.includes(e)||t.push(e)},A=function(t,n){var r,i;try{for(var a=e(n),s=a.next();!s.done;s=a.next()){var o=s.value;t.includes(o)||t.push(o)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}},O=function(t,e){var n=t.score;return e.score-n},F=function(){return new Map},T=function(t){var n,r,i=new Map;try{for(var a=e(Object.keys(t)),s=a.next();!s.done;s=a.next()){var o=s.value;i.set(parseInt(o,10),t[o])}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},k=/[\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;return _},"object"==typeof t&&typeof e<"u"?e.exports=r():"function"==typeof define&&define.amd?define(r):(n=typeof globalThis<"u"?globalThis:n||self).MiniSearch=r()})),gr={};mi(gr,{Mappedin:()=>lt,MappedinDestinationSet:()=>dt,OfflineSearch:()=>Vt,getVenue:()=>Da,getVenueBundle:()=>Ga,initialize:()=>mr}),module.exports=gi(gr),w(),w();var ai=Zt(Ya());w(),w(),w();var Xa=Zt(Ja());w();var ga=class{origin;destination;vortex;distance;angle;weight;constructor({origin:t,destination:e,vortex:n,elevationDelta:r=0,distance:i=0,angle:a=0}){let s,o;if(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")}},ea=ga;w();var fa="mi-debug",yi={loggingEnabled:()=>"development"===_.env.NODE_ENV||"dev"===_.env.NODE_ENV||"test"===_.env.NODE_ENV||"true"===globalThis.sessionStorage?.getItem(fa),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)}},A=yi;function ki(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,Xa.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 A.error(t),1}}function bi(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 ya=class{edges;nodesById;mapsById;constructor({nodes:t,vortexes:e,maps:n,showVortexNames:r=!1}){this.edges={},this.mapsById=n.map((t=>({...t,_scale:ki(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 ea({angle:bi(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 ea({destination:e,elevationDelta:s,origin:n,vortex:t})),this.edges[e.id].push(new ea({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)}},ka=ya;function vi(t){switch(t){case"down":case"up":return`${t} `;default:return""}}w(),w();var ba=class{node;instruction;action;atLocation;type;distance=0;constructor({origin:t,action:e,distance:n,atLocation:r,instruction:i}){this.node=t,this.action=e,this.distance=n||0,this.atLocation=r,this.instruction="",i?this.instruction=i:(null!=e&&"Departure"===e.type?this.instruction=null!=r?`Depart from ${r.name}`:"Depart from current location":null!=e&&"Arrival"===e.type?this.instruction=null!=r?`Arrive at ${r.name}`:"Arrive at destination":null!=e&&"TakeVortex"===e.type?this.instruction=`Take ${r&&r.name} ${vi(e.direction)}to ${e.toMap.name}`:null!=e&&"ExitVortex"===e.type?this.instruction=`Exit ${r&&r.name} at ${e.toMap.name}`:null!=e&&"Right"===e.bearing?this.instruction="Turn right":null!=e&&"SlightRight"===e.bearing?this.instruction="Turn slightly right":null!=e&&"Straight"===e.bearing?this.instruction="Head straight":null!=e&&"SlightLeft"===e.bearing?this.instruction="Turn slightly left":null!=e&&"Left"===e.bearing&&(this.instruction="Turn left"),null!=e&&"Turn"===e.type&&r&&(this.instruction+=` at ${r.name}`))}},et=ba,ta=.1*Math.PI;function aa(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var va=class{graph;locationsByNodeId;constructor({locations:t,nodes:e,vortexes:n,maps:r,showVortexNames:i}){this.graph=new ka({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=-aa(a.angle,e.angle);Math.abs(t)<Math.abs(o)&&(s=e,o=t)}else s=e,o=-aa(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 et({distance:0,instruction:"No Valid Path Available"})],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+=h?.distance||0,0===t&&l.push(new et({action:{type:"Departure"},atLocation:r,distance:0,origin:n})),null!=e.vortex){let t=this.graph.mapsById[n.map],r=this.graph.mapsById[o.map],i="none";if(null!=t.elevation&&null!=r.elevation){let e=t.elevation-r.elevation;e>0?i="down":e<0&&(i="up")}l.push(new et({action:{direction:i,fromMap:t,toMap:r,type:"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 et({action:{fromMap:t,toMap:e,type:"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=-aa(h.angle,e.angle),i=t.reduce(((t,n)=>{let r=-aa(e.angle,n.angle);return Math.min(t,Math.abs(r))}),Math.PI);if(Math.abs(r)>=ta||Math.abs(i)<=ta){let t;t=r<=-Math.PI/4?"Right":r<=-ta?"SlightRight":r<=ta?"Straight":r<=Math.PI/4?"SlightLeft":"Left";let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=e){let r=new et({action:{bearing:t,referencePosition:"At",type:"Turn"},atLocation:e,distance:c,origin:n});r.type=t,l.push(r)}else l.push(new et({action:{bearing:t,referencePosition:"At",type:"Turn"},distance:c,origin:n}));d+=c,c=0}}}t===a.length-1&&(l.push(new et({action:{type:"Arrival"},atLocation:i,distance:s-d<0?0:s-d,origin:e.destination})),d+=c,c=0),u=n,h=e}let p=[],f=null;for(let t=l.length-1;t>=0;t--){let e=l[t],{action:n}=e;n&&"TakeVortex"===n.type?(f=e.node,p.unshift(e)):n&&"Turn"===n.type&&null!=f?this.graph.getDistance(e.node,f)>5&&p.unshift(e):p.unshift(e)}return{distance:s,instructions:p,path:o}}},Ma=va;function Za(t){let e=+this._x.call(null,t),n=+this._y.call(null,t);return Qa(this.cover(e,n),e,n,t)}function Qa(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,a,s,o,l,u,h,c,d,p=t._root,f={data:r},g=t._x0,y=t._y0,m=t._x1,v=t._y1;if(!p)return t._root=f,t;for(;p.length;)if((u=e>=(a=(g+m)/2))?g=a:m=a,(h=n>=(s=(y+v)/2))?y=s:v=s,i=p,!(p=p[c=h<<1|u]))return i[c]=f,t;if(o=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===o&&n===l)return f.next=p,i?i[c]=f:t._root=f,t;do{i=i?i[c]=new Array(4):t._root=new Array(4),(u=e>=(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]=p,i[c]=f,t}function en(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)Qa(this,s[n],o[n],t[n]);return this}function tn(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 an(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}function nn(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 je(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function rn(t,e,n){var r,i,a,s,o,l,u,h=this._x0,c=this._y0,d=this._x1,p=this._y1,f=[],g=this._root;for(g&&f.push(new je(g,h,c,d,p)),null==n?n=1/0:(h=t-n,c=e-n,d=t+n,p=e+n,n*=n);l=f.pop();)if(!(!(g=l.node)||(i=l.x0)>d||(a=l.y0)>p||(s=l.x1)<h||(o=l.y1)<c))if(g.length){var y=(i+s)/2,m=(a+o)/2;f.push(new je(g[3],y,m,s,o),new je(g[2],i,m,y,o),new je(g[1],y,a,s,m),new je(g[0],i,a,y,m)),(u=(e>=m)<<1|t>=y)&&(l=f[f.length-1],f[f.length-1]=f[f.length-1-u],f[f.length-1-u]=l)}else{var v=t-+this._x.call(null,g.data),_=e-+this._y.call(null,g.data),w=v*v+_*_;if(w<n){var M=Math.sqrt(n=w);h=t-M,c=e-M,d=t+M,p=e+M,r=g.data}}return r}function sn(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,p=this._root,f=this._x0,g=this._y0,y=this._x1,m=this._y1;if(!p)return this;if(p.length)for(;;){if((u=a>=(o=(f+y)/2))?f=o:y=o,(h=s>=(l=(g+m)/2))?g=l:m=l,e=p,!(p=p[c=h<<1|u]))return this;if(!p.length)break;(e[c+1&3]||e[c+2&3]||e[c+3&3])&&(n=e,d=c)}for(;p.data!==t;)if(r=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,r?(i?r.next=i:delete r.next,this):e?(i?e[c]=i:delete e[c],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(n?n[d]=p:this._root=p),this):(this._root=i,this)}function on(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function ln(){return this._root}function un(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}function cn(t){var e,n,r,i,a,s,o=[],l=this._root;for(l&&o.push(new je(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 je(n,u,h,a,s)),(n=l[2])&&o.push(new je(n,r,h,u,s)),(n=l[1])&&o.push(new je(n,u,i,a,h)),(n=l[0])&&o.push(new je(n,r,i,u,h))}return this}function dn(t){var e,n=[],r=[];for(this._root&&n.push(new je(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 je(a,s,o,h,c)),(a=i[1])&&n.push(new je(a,h,o,l,c)),(a=i[2])&&n.push(new je(a,s,c,h,u)),(a=i[3])&&n.push(new je(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 pn(t){return t[0]}function hn(t){return arguments.length?(this._x=t,this):this._x}function mn(t){return t[1]}function gn(t){return arguments.length?(this._y=t,this):this._y}function Ct(t,e,n){var r=new wa(e??pn,n??mn,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function wa(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 fn(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}w(),w(),w(),w(),w(),w(),w(),w(),w(),w(),w(),w(),w(),w(),w(),w();var _e=Ct.prototype=wa.prototype;_e.copy=function(){var t,e,n=new wa(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=fn(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]=fn(e));return n},_e.add=Za,_e.addAll=en,_e.cover=tn,_e.data=an,_e.extent=nn,_e.find=rn,_e.remove=sn,_e.removeAll=on,_e.root=ln,_e.size=un,_e.visit=cn,_e.visitAfter=dn,_e.x=hn,_e.y=gn;var De,Me,ct=class{constructor(t){ve(this,De,void 0),Ee(this,"categories"),Ee(this,"locations"),Ee(this,"vortexes"),Ee(this,"maps"),Ee(this,"nodes"),Ee(this,"polygons"),Ee(this,"events"),Ee(this,"mapGroups"),Ee(this,"locationStates"),Ee(this,"rankings"),ve(this,Me,{}),ue(this,De,t)}get polygonsByMapId(){if(C(this,Me).polygonsByMapId)return C(this,Me).polygonsByMapId;let t,e={};for(let n=0,r=C(this,De).polygons.length;n<r;++n)t=C(this,De).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 C(this,Me).polygonsByMapId=n,C(this,Me).polygonsByMapId}get nodesByMapId(){if(C(this,Me).nodesByMapId)return C(this,Me).nodesByMapId;let t,e={};for(let n=0,r=C(this,De).nodes.length;n<r;++n)t=C(this,De).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 C(this,Me).nodesByMapId=n,C(this,Me).nodesByMapId}findNearestNodeOnMap(t,e){if(C(this,Me).nodeTreesByMap||(C(this,Me).nodeTreesByMap=new Map),!C(this,Me).nodeTreesByMap.has(t)){let e=this.nodesByMapId.get(t)??[],n=Ct();n.x((t=>t.x)),n.y((t=>t.y)),n.addAll(e),C(this,Me).nodeTreesByMap.set(t,n)}return C(this,Me).nodeTreesByMap.get(t).find(e.x,e.y)}get locationsByMapId(){if(C(this,Me).locationsByMapId)return C(this,Me).locationsByMapId;let t,e={};for(let n=0,r=C(this,De).locations.length;n<r;++n){t=C(this,De).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 C(this,Me).locationsByMapId=n,C(this,Me).locationsByMapId}static create(t){return ct.instances.has(t)||ct.instances.set(t,new ct(t)),ct.instances.get(t)}static clear(){ct.instances.clear()}},na=ct;De=new WeakMap,Me=new WeakMap,Ee(na,"instances",new Map);var Pe=na;w(),w(),w(),w();var yn=" ",Ne=class{static get separator(){return yn}static set separator(t){yn=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+"°"+Ne.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+"°"+Ne.separator+a+"′"+Ne.separator+s+"″"}return r}static toLat(t,e,n){let r=Ne.toDms(Ne.wrap90(t),e,n);return null===r?"–":r.slice(1)+Ne.separator+(t<0?"S":"N")}static toLon(t,e,n){let r=Ne.toDms(Ne.wrap180(t),e,n);return null===r?"–":r+Ne.separator+(t<0?"W":"E")}static toBrng(t,e,n){let r=Ne.toDms(Ne.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=Ne.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 K=Ne,he=Math.PI,S=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=K.wrap90(Number(t)),this._lon=K.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?K.wrap90(K.parse(t)):K.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?K.wrap90(K.parse(t)):K.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)?K.wrap180(K.parse(t)):K.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?K.wrap180(K.parse(t)):K.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?K.wrap180(K.parse(t)):K.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=K.wrap90(K.parse(e)),n=K.wrap180(K.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=K.wrap90(K.parse(e)),n=K.wrap180(K.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=K.wrap90(K.parse(e)),n=K.wrap180(K.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 S(e,n)}distanceTo(t,e=6371e3){if(t instanceof S||(t=S.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 S||(t=S.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 K.wrap360(s)}finalBearingTo(t){t instanceof S||(t=S.parse(t));let e=t.initialBearingTo(this)+180;return K.wrap360(e)}midpointTo(t){t instanceof S||(t=S.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 S(c,d)}intermediatePointTo(t,e){if(t instanceof S||(t=S.parse(t)),this.equals(t))return new S(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),p=h*Math.cos(n)*Math.sin(r)+c*Math.cos(i)*Math.sin(a),f=h*Math.sin(n)+c*Math.sin(i),g=Math.atan2(f,Math.sqrt(d*d+p*p)),y=Math.atan2(p,d),m=g.toDegrees(),v=y.toDegrees();return new S(m,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(),p=c.toDegrees();return new S(d,p)}static intersection(t,e,n,r){if(t instanceof S||(t=S.parse(t)),n instanceof S||(n=S.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 S(t.lat,t.lon);let p=(Math.sin(s)-Math.sin(i)*Math.cos(d))/(Math.sin(d)*Math.cos(i)),f=(Math.sin(i)-Math.sin(s)*Math.cos(d))/(Math.sin(d)*Math.cos(s)),g=Math.acos(Math.min(Math.max(p,-1),1)),y=Math.acos(Math.min(Math.max(f,-1),1)),m=l-(Math.sin(o-a)>0?g:2*he-g),v=(Math.sin(o-a)>0?2*he-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(),I=b.toDegrees();return new S(x,I)}crossTrackDistanceTo(t,e,n=6371e3){t instanceof S||(t=S.parse(t)),e instanceof S||(e=S.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 S||(t=S.parse(t)),e instanceof S||(e=S.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)),p=a+c+d,f=(a+c-d).toDegrees(),g=p.toDegrees();return{lon1:K.wrap180(f),lon2:K.wrap180(g)}}rhumbDistanceTo(t,e=6371e3){t instanceof S||(t=S.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)>he&&(s=s>0?-(2*he-s):2*he+s);let o=Math.log(Math.tan(i/2+he/4)/Math.tan(r/2+he/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 S||(t=S.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)>he&&(r=r>0?-(2*he-r):2*he+r);let i=Math.log(Math.tan(n/2+he/4)/Math.tan(e/2+he/4)),a=Math.atan2(r,i).toDegrees();return K.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)>he/2&&(l=l>0?he-l:-he-l);let u=Math.log(Math.tan(l/2+he/4)/Math.tan(r/2+he/4)),h=Math.abs(u)>1e-11?o/u:Math.cos(r),c=i+s*Math.sin(a)/h,d=l.toDegrees(),p=c.toDegrees();return new S(d,p)}rhumbMidpointTo(t){t instanceof S||(t=S.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),i=t.lon.toRadians();Math.abs(i-n)>he&&(n+=2*he);let a=(e+r)/2,s=Math.tan(he/4+e/2),o=Math.tan(he/4+r/2),l=Math.tan(he/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 S(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}let r=t[0].initialBearingTo(t[1]);return e+=(r-n+540)%360-180,Math.abs(e)<90})(t)&&(a=Math.abs(a)-2*he);let s=Math.abs(a*n*n);return r||t.pop(),s}equals(t){return t instanceof S||(t=S.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`${K.toLat(this.lat,t,e)}, ${K.toLon(this.lon,t,e)}`}};w(),w(),w();var dt=class{destinations=[];constructor(t){this.destinations=t}};w();var bt=class{#t;#e;distance=0;path=[];instructions=[];constructor(t,e){this.#e=t,this.#t=e,this.distance=e.distance,this.instructions=e.instructions.map((t=>{let e={...t,action:{...t.action},atLocation:t.atLocation?.id?this.#e?._vortexesById?.[t.atLocation.id]:void 0,node:t.node?.id?this.#e?._nodesById?.[t.node.id]:void 0};return("TakeVortex"===e.action?.type||"ExitVortex"===e.action?.type)&&(e.action.fromMap=this.#e._mapsById?.[e.action?.fromMap.id],e.action.toMap=this.#e._mapsById?.[e.action?.toMap.id]),e})),this.path=e.path.map((t=>this.#e?._nodesById?.[t.id]))}toJSON(){return this.#t}},$e=class{#t;constructor(t){this.#t=t}directionsTo(t,e){if(t instanceof dt){let n=[],r=this;for(let i=0;i<t.destinations.length;i++){let a=t.destinations[i],s=Lt(r),o=Lt(a),l=this.#t.navigator.getDirections({originIds:s,destinationNodeIds:o,accessible:e?.accessible||!1}),u=new bt(this.#t,l);n.push(u),r=a}return n}{let n=Lt(this),r=Lt(t),i=this.#t.navigator.getDirections({originIds:n,destinationNodeIds:r,accessible:e?.accessible||!1});return new bt(this.#t,i)}}distanceTo(t,e){return this.directionsTo(t,e)?.distance||0}},wi=0,ji="9999-12-31T00:00:00.000Z";function xi(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||wi),n=new Date(t.end||ji);return e<r&&n>r}));return i?e.find((t=>t.value===i.type)):void 0}var Ce=class extends $e{#t;#e;#n={};states;id="";name="";type="";description;sortOrder;logo;phone;social;color;shortName;detailsUrl;tags;externalId;showLabelWhenImagePresent;picture;operationHours;siblingGroups;gallery;constructor(t,e){super(t),this.#t=t,this.#e=e;let n=Object.assign({},e);delete n.categories,Object.assign(this,n)}#r;get polygons(){let t=this.#n.polygons;if(typeof t<"u")return t;let e=[],n=this.#r,r=this.#t._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 this.#n.polygons=e,e}set polygons(t){this.#r=t}#i=[];get nodes(){let t=this.#n.nodes;if(typeof t<"u")return t;let e=[],n=this.#i,r=this.#t._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 this.#n.nodes=e,e}set nodes(t){this.#i=t}#a;get parent(){let t=this.#n.parent;if(typeof t<"u")return t;let e,n=this.#t._locationsById,r=this.#a;return void 0!==r&&(e=n[r]),this.#n.parent=e,e}set parent(t){this.#a=t}get categories(){let t=this.#n.categories;if(typeof t<"u")return t;let e=[];return this.#e.categories.forEach((t=>{let n=this.#t.getCollectionItemById("categories",t);n&&e.push(n)})),this.#n.categories=e,e}get state(){return xi(this,this.#t.locationStates)}clone(){return new Ce(this.#t,this.#e)}get nodeOperationHours(){let t=this.#n.nodeOperationHours;if(typeof t<"u")return t;if(null==this.nodes)return{};let e=this.#e.nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return this.#n.nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new Ce(e,t)))}static async fetch(t){let e=t.options.things.locations.slice();t.options.things.categories&&fe(e,"categories"),t.options.things.nodes&&fe(e,"nodes"),t.options.things.polygons&&fe(e,"polygons"),t.options.things.locationStates&&fe(e,"states");let n={fields:e,venue:t.options.venue};try{let e=await ye(t.options,"location",n);return t.options.includeHidden||(e=e.filter((t=>!t.hidden))),e.map((e=>new Ce(t,e)))}catch(t){return A.error("Fetch Locations:",t),[]}}toJSON(){let t=this.#e;return delete t.color,t}};w();var Ge=class extends $e{#t;#e;#n={};geometry;perspectives;image;holes;textures;material;label;id="";layer;layerId;name;externalId;vertexes;canvasBounds;constructor(t,e){super(t),this.#t=t,this.#e=e;let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=this.#n.map;if(typeof t<"u")return t;let e=this.#t.getCollectionItemById("maps",this.#e.map);return this.#n.map=e,e}get locations(){let t=this.#n.locations;if(typeof t<"u")return t;let e=[],n=Pe.instances.get(this.#t)?.locationsByMapId.get(this.map.id)??[],{id:r}=this;for(let t=0,i=n.length;t<i;++t){let i=n[t],a=i.polygons;if(Array.isArray(a))for(let t=0,n=a.length;t<n;++t)if(a[t].id===r){e.push(i);break}}return this.#n.locations=e,e}#r;get entrances(){let t=this.#n.entrances;if(typeof t<"u")return t;let e=[],n=this.#r,r=this.#t._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 this.#n.entrances=e,e}return[]}set entrances(t){this.#r=t}get rank(){let t=this.#n.rank;if(typeof t<"u")return t;let{rankings:e}=this.#t;if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.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(t,e){return t.map((t=>new Ge(e,t)))}static async fetch(t){let e=t.options.things.polygons.slice();t.options.things.maps&&fe(e,"map"),t.options.things.nodes&&fe(e,"entrances");let n={fields:e,venue:t.options.venue};try{return(await ye(t.options,"polygon",n)).filter((t=>t.geometry.visible)).map((e=>new Ge(t,e)))}catch(t){return A.error("Fetch Polygons:",t),[]}}toJSON(){return this.#e}};function bn(t){return/^[\da-f]{24}$/i.test(t)}function kn(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 Ti(t,e,n,r=!1){return r?`${t.supplementaryUrl}${e}?venue=${n.venue||n.slug}`:t.baseUrl?.includes("gateway")?`${t.baseUrl}${e}/${n.venue||n.slug}${kn(n,t.baseUrl?.includes("gateway"))}`:t.baseUrl+e+kn(n)}async function ye(t,e,n,r=!1){return xa(t,e,n,r,!0)}async function xa(t,e,n,r=!1,i=!1){let a=Ti(t,e,n,r),s=await Ta(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 Ta(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 Rt()(e,a);if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return s.json()}function fe(t,e){t.indexOf(e)<0&&t.push(e)}function vn([t,e],[n,r]){let i=new S(t,e),a=new S(n,r);return i.distanceTo(a)}function Mn(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 S(n.target.x,n.target.y),a=new S(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,A.warn(n),A.warn(`Couldn't georeference ${t.name||t.shortName||t.id}. Probably not enough geocoordinates.`)}return e}function Lt(t){return t instanceof Ge?t.entrances.map((t=>t.id)):t instanceof Ce?t.nodes?.map((t=>t.id))||[]:[t.id]}async function wn(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=>{A.error(t)}))));await Promise.all(t)}catch(t){A.error(t)}return n.forEach((t=>{(t.scene?.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=>{if(t?.image?.url&&t?.image?.url){let n=t.image.url.split("/"),r=e[n[n.length-1]];r&&(t.image.url=r)}}))))})),null!=r&&a.forEach((t=>{if(t?.image?.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 Ia(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)}}var qe=class{#t;#e={};#n;name;externalId;parents;id;icon;constructor(t,e){this.id=e.id,this.#n=e,this.#t=t,Object.assign(this,e)}get locations(){let t=this.#e.locations;if(typeof t<"u")return t;let e=[],{locations:n}=this.#t,{id:r}=this;for(let t=0,i=n.length;t<i;++t){let i=n[t],a=i.categories;if(Array.isArray(a))for(let t=0,n=a.length;t<n;++t)if(a[t]?.id===r){e.push(i);break}}return this.#e.locations=e,e}static hydrate(t,e){return t.map((t=>new qe(e,t)))}static async fetch(t){let e={fields:t.options.things.categories,venue:t.options.venue};try{return(await ye(t.options,"category",e)).map((e=>new qe(t,e)))}catch(t){return A.error("Fetch Categories:",t),[]}}toJSON(){return this.#n}};w();var tt=class{#t;#e;#n={};id="";type="";name="";description;image;startDate;endDate;showDate;constructor(t,e){this.#e=e,this.#t=t,Object.assign(this,e)}location(){let t=this.#n.location;if(typeof t<"u")return t;let e,n=this.#t._locationsById,r=this.#e.location;if(null!=r){let t=n[r];null!=t&&(e=t)}return this.#n.location=e,e}static hydrate(t,e){return t.map((t=>new tt(e,t)))}static async fetch(t){let e=t.options.things.events.slice();t.options.things.locations&&fe(e,"location");let n={fields:e,venue:t.options.venue,activeAtOrAfter:Date.now()};try{return(await ye(t.options,"event",n)).map((e=>new tt(t,e)))}catch(t){return A.error("Fetch Events:",t),[]}}toJSON(){return this.#e}};w();var pt=class{#t;constructor(t){this.#t=t,Object.assign(this,t)}static hydrate(t){return t.map((t=>new pt(t)))}id="";name="";value="";static async fetch(t){let e={fields:t.options.things.locationStates.slice(),venue:t.options.venue};try{return(await ye(t.options,"location-state",e)).map((t=>new pt(t)))}catch(t){return A.error("Fetch Location States:",t),[]}}toJSON(){return this.#t}};w(),w();var vt=class{map;get x(){return this.#e("x")}get y(){return this.#e("y")}get lat(){return this.#t("lat")}get lon(){return this.#t("lon")}#t(t){if(this.#s&&this.#o)return"lat"===t?this.#s:this.#o;if(null!=this.#l&&null!=this.#u){let[e,n]=this.#a(this.#l,this.#u);return this.#s=e,this.#o=n,"lat"===t?this.#s:this.#o}throw Error("MappedinCoordinate is missing x and y")}#e(t){if(this.#l&&this.#u)return"x"===t?this.#l:this.#u;if(null!=this.#s&&null!=this.#o){let[e,n]=this.#i(this.#s,this.#o);return this.#l=e,this.#u=n,"x"===t?this.#l:this.#u}throw Error("MappedinCoordinate is missing lat and lon")}#n={};#r;#i(t,e){let n=this.map.georeference[0],r=new S(n.target.x,n.target.y),i=new S(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]}#a(t,e){let n,r=this.map.georeference[0],i=new S(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]}constructor(t){let{map:e,mappedin:n}=t;null!=t.lat&&null!=t.lon&&(this.#s=t.lat,this.#o=t.lon),null!=t.x&&null!=t.y&&(this.#l=t.x,this.#u=t.y),this.map=e,this.#r=n}#s;#o;#l;#u;absoluteDistanceTo(t){return vn([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=this.#n.nearestNode;if(typeof t<"u")return t;let e=Pe.instances.get(this.#r).findNearestNodeOnMap(this.map.id,this);return this.#n.nearestNode=e,e}toJSON(){return{x:this.x,y:this.y,map:this.map,lat:this.lat,lon:this.lon}}},at=class{#t;#e={};#n;id="";group="";name="";shortName="";elevation=0;scale=0;layers;x_scale;perspectiveId;scene;width=0;height=0;georeference=[];constructor(t,e){this.#t=t,this.#n=e,Object.assign(this,e),this._scale=Mn(this),this.scale=this.x_scale||1/this._scale}_scale=0;get polygons(){return Pe.instances.get(this.#t)?.polygonsByMapId?.get(this.id)??[]}get locations(){return Pe.instances.get(this.#t)?.locationsByMapId?.get(this.id)??[]}get nodes(){return Pe.instances.get(this.#t)?.nodesByMapId?.get(this.id)??[]}get mapGroup(){let t=this.#e.mapGroup;if(typeof t<"u")return t;let e=this.group,n=e&&this.#t._mapGroupsById[e]||null;return this.#e.mapGroup=n,n}createCoordinateByXY(t,e){return new vt({x:t,y:e,map:this,mappedin:this.#t})}createCoordinate(t,e){return new vt({lat:t,lon:e,map:this,mappedin:this.#t})}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],r=new S(e.target.x,e.target.y),i=new S(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,A.warn(e),A.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 at(e,t)))}static async fetch(t){let e=t.options.things.maps.slice();t.options.perspective&&fe(e,"perspectives"),t.options.things.mapGroups&&fe(e,"group"),fe(e,"elevation"),fe(e,"x_scale"),fe(e,"scale"),fe(e,"georeference");let n={fields:e,perspective:t.options.perspective,venue:t.options.venue};try{let i=await ye(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 at(t,r)}return i}catch(t){return A.error("Fetch Maps:",t),[]}}toJSON(){return this.#n}};w();var nt=class{#t;#e;#n={};id="";name="";constructor(t,e){this.#e=e,this.#t=t,Object.assign(this,e)}get maps(){let t=this.#n.maps;if(typeof t<"u")return t;let e=[],{maps:n}=this.#t,{id:r}=this.#e;for(let t=0,i=n.length;t<i;++t){let i=n[t];i.group===r&&e.push(i)}return this.#n.maps=e,e}static hydrate(t,e){return t.map((t=>new nt(e,t)))}static async fetch(t){let e={fields:t.options.things.mapGroups.slice(),venue:t.options.venue};try{return(await ye(t.options,"map-group",e)).map((e=>new nt(t,e)))}catch(t){return A.error("Fetch Map Groups:",t),[]}}toJSON(){return this.#e}};w();var it=class extends $e{#t;#e;#n={};id="";x=0;y=0;operationHours;externalId;constructor(t,e){super(t),this.#t=t,this.#e=e;let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=this.#n.map;if(typeof t<"u")return t;let e=this.#t.getCollectionItemById("maps",this.#e.map);return this.#n.map=e,e}get lat(){let t=this.#n.cachedLatLon;if(null!=t)return t.lat;let e=this.#t._mapsById?.[this.map.id];if(null==e)throw new Error("Map not found");return this.#n.cachedLatLon=e.createCoordinateByXY(this.x,this.y),this.#n.cachedLatLon.lat}get lon(){let t=this.#n.cachedLatLon;if(null!=t)return t.lon;let e=this.#t._mapsById?.[this.map.id];if(null==e)throw new Error("Map not found");return this.#n.cachedLatLon=e.createCoordinateByXY(this.x,this.y),this.#n.cachedLatLon.lon}#r;get paths(){let t=this.#n.paths;if(typeof t<"u")return t;let e=[],n=this.#t._nodesById,r=this.#r;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 this.#n.paths=e,e}set paths(t){this.#r=t}get locations(){let t=this.#n.locations;if(typeof t<"u")return t;let e=[],n=Pe.instances.get(this.#t)?.locationsByMapId?.get(this.map.id)??[],r=this.id;for(let t=0,i=n.length;t<i;++t){let i=n[t],a=i.nodes;if(Array.isArray(a))for(let t=0,n=a.length;t<n;++t)if(a[t].id===r){e.push(i);break}}return this.#n.locations=e,e}get polygon(){let t=this.#n.polygon;if(typeof t<"u")return t;let e,n=Pe.instances.get(this.#t)?.polygonsByMapId?.get(this.map.id)??[],r=this.id;for(let t=0,i=n.length;t<i;++t){let i=n[t];i.entrances.map((t=>t.id)).includes(r)&&(e=i)}return this.#n.polygon=e,e}static hydrate(t,e){return t.map((t=>new it(e,t)))}static async fetch(t){let e=t.options.things.nodes.slice();t.options.things.maps&&fe(e,"map"),["weight","multiplier","accessible"].forEach((function(t){fe(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await ye(t.options,"node",n)).map((e=>new it(t,e)))}catch(t){return A.error("Fetch Nodes:",t),[]}}toJSON(){return this.#e}};w();var rt=class{#t;constructor(t){this.#t=t,Object.assign(this,t)}polygons=[];static hydrate(t){return new rt(t)}static async fetch(t){try{let e=await xa(t.options,"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new rt(e)}catch(t){return A.error("Fetch Rankings:",t),null}}toJSON(){return this.#t}};w();var ht=class{id="";#t;constructor(t){this.#t=t,Object.assign(this,t)}static hydrate(t){return t.map((t=>new ht(t)))}static async fetch(t){let e={fields:t.options.things.themes.slice(),venue:t.options.venue};try{return(await ye(t.options,"apollo-theme",e)).map((t=>new ht(t)))}catch(t){return A.error("Fetch Theme:",t),[]}}toJSON(){return this.#t}};w();var st=class{#t;#e;#n={};defaultMap="";address="";city="";countrycode="";externalId="";id="";latitude;logo;longitude;metadata;name="";operationHours;postal="";slug="";state="";telephone="";tzid="";tzidOverride="";utcOffset="";website="";constructor(t,e){this.#e=t,this.#t=e,Object.assign(this,e)}static hydrate(t,e){return new st(e,t)}static async fetch(t){let e={fields:t.options.things.venue,slug:t.options.venue,limit:1};try{let n=await ye(t.options,"venue",e);return new st(t,n[0])}catch(t){return A.error("Fetch Venue:",t),{}}}get isMultiBuilding(){if(null==this.#n.isMultiBuilding){let t=this.#e.maps,e=t.reduce(((t,e)=>t.add(e.elevation)),new Set),n=t.length!==e.size;this.#n.isMultiBuilding=n}return this.#n.isMultiBuilding}toJSON(){return this.#t}};w();var ot=class{id="";#t;name;type;weight;multiplier;constructor(t){this.#t=t,Object.assign(this,t)}static hydrate(t){return t.map((t=>new ot(t)))}static async fetch(t){let e=t.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){fe(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await ye(t.options,"vortex",n)).map((t=>new ot(t)))}catch(t){return A.error("Fetch Vortexes:",t),[]}}toJSON(){return this.#t}};function Ii(t,e){let n=[];return t.features.forEach((t=>{let r=[];t.properties.spaces?.forEach((t=>{if("id"in t){let n;n=e.get(t.id),n&&r.push(...n)}else r?.push({id:t.node,level:""})}));let i=r.map((t=>({node:"n_"+t.id,map:t.level}))),a=t.properties.spaces?.filter((t=>"id"in t)),s=(t.properties.hours||[]).map((t=>({...t,"@type":"OpeningHoursSpecification",dayOfWeek:[t.dayOfWeek.replace("http://schema.org/","")]}))),o={...t.properties,polygons:a||[],nodes:i||[],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:s};delete o.spaces,n.push(o)})),n}function Oi(t){let e=new Set;return t.features.forEach((t=>{t.properties.states?.forEach((t=>{e.add(t.type)}))})),Array.from(e).map((t=>({id:t,name:t,value:t})))}function zi(t){let e=[];return t.features.forEach((t=>{let n={...t.properties,icon:t.properties.picture};delete n.picture,e.push(n)})),e}function Ni(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 _i(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}w();var Oa=class{mapExtent;stretchRatio;midLat;midLong;mapUnitRatio=1e6;latDistance;longDistance;mapScale;widthInMapUnits;heightInMapUnits;constructor(t){this.mapExtent=t;let{minLat:e,minLong:n,maxLat:r,maxLong:i}=t,a=(e+r)/2,s=(n+i)/2,o=new S(a,i),l=new S(a,n),u=new S(e,s),h=new S(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 Ei(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 jn=(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:u?.image,visible:!!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 p={...t.properties,entrances:s,map:t.properties.level,externalId:t.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(p)})),a};function Ai(t,e,n,r,i,a){let s=jn(t,n,r,i,a),o=jn(e,n,r,i,a);return s.concat(o)}function Si(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 Fi(t){let e=[];return t.features.forEach((t=>{let n={...t.properties};e.push(n)})),e}function xn(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=Ni(e),i=new Oa(r);c.set(n,i);let s=t.obstruction.get(n),d=t.space.get(n),p=o.get(n),f=l.get(n);u[n]=Ai(d,s,a,f,p,i);let g=t.node.get(n);h.push(...Ei(g,i))}));let d=Object.values(u).flat(),p=Si(e),f=n.map((t=>{let e=t.features[0].properties.id,n=c.get(e);return _i(t,u[e],n)})).flat(),g=new Map;Array.from(t.space.values()).forEach((t=>{t.features.forEach((t=>{g.set(t.properties.id,t.properties.entrances)}))}));let y=Fi(r),m=Ii(s,g),v=zi(i),_=Oi(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:m,categories:v,nodes:h,maps:f,polygons:d,vortexes:p,mapGroups:y,locationStates:_,themes:[],venue:{name:w,latitude:b,longitude:M},imageBinaries:x}}w(),w(),w(),w();var mt,Re,Be,za=[0,4,6,8,10],We=()=>{let t=new Array(16).fill(0),e=4294967296*Math.random();for(let n=0;n<t.length;n++)n>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],za.map(((t,e)=>n.slice(t,e===za.length-1?void 0:za[e+1]).join(""))).join("-")},Tn="mi-session-data",In="mi-local-data",Na=class{constructor(){ve(this,Re,void 0),ve(this,Be,void 0);try{let t=sessionStorage.getItem(Tn);ue(this,Re,t?JSON.parse(t):{id:We()})}catch{ue(this,Re,{id:We()})}try{let t=localStorage.getItem(In);ue(this,Be,t?JSON.parse(t):{deviceId:We()})}catch{ue(this,Be,{deviceId:We()})}C(this,Re).id||(C(this,Re).id=We()),C(this,Be).deviceId||(C(this,Be).deviceId=We())}static getInstance(){return C(this,mt)||ue(this,mt,new Na),C(this,mt)}static ___clearInstance(){ue(this,mt,void 0)}saveSessionData(t,e){C(this,Re)[t]=e;try{return sessionStorage.setItem(Tn,JSON.stringify(C(this,Re))),!0}catch{return!1}}loadSessionData(t){let e=C(this,Re)[t];if(null!=e)return e}saveLocalData(t,e){C(this,Be)[t]=e;try{return localStorage.setItem(In,JSON.stringify(C(this,Be))),!0}catch{return!1}}loadLocalData(t){let e=C(this,Be)[t];if(null!=e)return e}},Mt=Na;function On(t){return/^[\da-f]{24}$/i.test(t)}function zn(){return Mt.getInstance().loadLocalData("deviceId")}function Nn(){return Mt.getInstance().loadSessionData("id")}mt=new WeakMap,Re=new WeakMap,Be=new WeakMap,ve(Mt,mt,void 0);var Bt,wt,jt,Dt,xt,Tt,It,gt,Gt,Ot,zt,qt,Jn=Zt(Yn()),Ui=_?.env?.npm_package_version,Aa=["websdk","web","webv2"],Sa="websdk",Fa=class{constructor(t){ve(this,Bt,void 0),ve(this,wt,void 0),ve(this,jt,void 0),ve(this,Dt,void 0),ve(this,xt,void 0),ve(this,Tt,void 0),ve(this,It,void 0),ve(this,gt,void 0),ve(this,Gt,void 0),ve(this,Ot,void 0),ve(this,zt,void 0),ve(this,qt,void 0),ue(this,gt,t.clientId),ue(this,Gt,t.clientSecret),ue(this,Ot,t.accessToken),ue(this,It,t.noAuth||!1);let e="https://api-gateway.mappedin.com/track-analytics/a/";!C(this,It)&&C(this,gt)&&!On(C(this,gt))&&(e="https://web-proxy.mappedin.com/a/"),ue(this,jt,e),ue(this,jt,C(this,jt)+(t.venue+"/")),ue(this,wt,!1),ue(this,Bt,"boolean"==typeof t.testMode?t.testMode:"true"===t.testMode?.toLowerCase()),ue(this,Dt,Aa.find((e=>e===t.context))||Aa[0]),ue(this,xt,zn()),ue(this,Tt,Nn()),ue(this,zt,new Set),ue(this,qt,t.platformString||""),this.locationSelected=this.locationSelected.bind(this),this.categorySelected=this.categorySelected.bind(this),this.getDirections=this.getDirections.bind(this)}track(t,e){if(C(this,Bt))return;let n={...e,g:C(this,wt)},r=C(this,jt)+t+"?"+Jn.default.stringify(n),i={"mi-context":Sa||C(this,Dt),"mi-session":C(this,Tt),"mi-device":C(this,xt),"mappedin-sdk-version":Ui,"mappedin-platform-version":C(this,qt)};C(this,Ot)?i.Authorization=`Bearer ${C(this,Ot)}`:C(this,It)||(i.Authorization=`Basic ${btoa(`${C(this,gt)}:${C(this,Gt)}`)}`),Rt()(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 C(this,Tt)}getDeviceID(){return C(this,xt)}setGeolocationMode(t){ue(this,wt,t)}trackBlueDotEvent(t){t&&Object.values(Fa.BLUEDOT_EVENT).includes(t)&&!C(this,zt).has(t)?(this.track(t),C(this,zt).add(t)):A.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=Aa.find((e=>e===t));e&&(Sa=e)}static clearContext(){Sa=void 0}},ia=Fa;Bt=new WeakMap,wt=new WeakMap,jt=new WeakMap,Dt=new WeakMap,xt=new WeakMap,Tt=new WeakMap,It=new WeakMap,gt=new WeakMap,Gt=new WeakMap,Ot=new WeakMap,zt=new WeakMap,qt=new WeakMap,Ee(ia,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var ra=ia,Xn={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""},Nt={categories:qe,locations:Ce,vortexes:ot,maps:at,nodes:it,polygons:Ge,venue:st,events:tt,mapGroups:nt,themes:ht,locationStates:pt,rankings:rt},lt=class{perspective;things;options;#t;#e="";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(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=this.#t[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),this.#t[n]=e,e}}),Object.defineProperty(this,`_${n}ById`,{get(){let t=this.#t[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),this.#t[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=xn(t);return this.hydrate(e)}async hydrate(t,e){let n;if("string"==typeof t)try{this.#e=t,n=JSON.parse(t)}catch(t){return void A.error("Unable to parse JSON",t)}else n=t,this.#e=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!=Nt[e]&&"function"==typeof Nt[e].hydrate&&(this[e]=Nt[e].hydrate(i,this))}e&&await wn(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"]),bn(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];Nt[r]&&e.push(Nt[r].fetch(this).then((t=>(this[r]=t,Promise.resolve()))))}return this.generateGetters(n),Promise.all(e).then((()=>{this.initNavigator()}))}constructor(t){this.options=t,this.#t=Pe.create(this);let e=new ra({...t,testMode:!t?.emitAnalyticsEvents});this.analytics={locationSelected:e.locationSelected,categorySelected:e.categorySelected,getDirections:e.getDirections},globalThis.MappedinDebug||(globalThis.MappedinDebug={enable(){globalThis.sessionStorage.setItem(fa,"true")}})}analytics;navigator;initNavigator(){this.navigator=new Ma({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(){let t={};for(let e in Nt)Array.isArray(this[e])&&(t[e]=this[e].map((t=>t.toJSON())));let e={...t,venue:this.venue.toJSON()};return null!=this.rankings&&(e.rankings=this.rankings?.toJSON()),delete e.locationRankings,e}toString(){return this.#e||JSON.stringify(this.toJSON())}};w();var Kn={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"]};w();var ft=Zt(Zn());w();var $i=["0","1","2","3","4","5","6","7","8","9"],Wi=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],Hi=["0","1","2","3","4","5","6","7","8","9"],Yi=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],wu=[...$i,...Wi,...Hi,...Yi],Qn=["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"];w();var Ji=32,Se=!1,Xi=120,La=0,sa=class{constructor(t){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,Se&&A.log("update instantiated",this.name)}_callback;_frameCount;_ordering;_supersededBy;name;_remainingFrameCount;_lastFrameTime;userdata;getLastFrameTime(){return this._lastFrameTime}},Ye=class{constructor(t){if(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,Se&&A.log("task instantiated",this.name)}_postponed;userdata;_priority;_group;name;_lastFrameTime;_callback;_complete;_scheduled;_cancelled;isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}},oa=class{constructor(t){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,Se&&A.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 t of this._scheduledTasks)return this._scheduledTasks.delete(t),t}},Ra=class{_maxMillisecondsPerFrame;_time;constructor(t){this._maxMillisecondsPerFrame=null!=t?.maxMillisecondsPerFrame?t.maxMillisecondsPerFrame:Ji,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}},la=class{constructor(t){this._timer=null!=t?.timer?t.timer:new Ra,this._performance=null!=t?.performance&&t.performance,this._scheduledUpdatesByOrdering=new _t,this._scheduledTasksByPriority=new _t,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),Se&&A.log("task scheduler instantiated"),globalThis.MappedinDebug?.TEST_IOS&&(this._raf=t=>setTimeout(t,16))}_raf;_timer;_performance;_scheduledUpdatesByOrdering;_scheduledTasksByPriority;_postponedTasks;_requestAnimationFrameHandle;_updatesToRunThisFrame;_lastFrameTime=0;_updatesRunLastFrame;clear(){for(let t of this._scheduledTasksByPriority.values())t._cancelled=!0;for(let t of this._postponedTasks.values())t._cancelled=!0;this._scheduledUpdatesByOrdering=new _t,this._scheduledTasksByPriority=new _t,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),Se&&A.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;Se&&(0===La&&(n=!0),++La,La%=Xi);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&&A.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&&A.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&&A.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;A.assert(void 0!==n),Object.getPrototypeOf(n)===oa.prototype&&(r=n,n=r._popTask()),A.assert(void 0!==n),A.assert(Object.getPrototypeOf(n)===Ye.prototype),this._performance&&(e=performance.now()),n._callback(t),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-e),Se&&A.log("task completed",n.name),null!=r&&(r.isComplete()?(r.clear(),r._onComplete(),Se&&A.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)===oa)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,Se&&A.log("task scheduled",t.name),this.requestAnimationFrame()}cancelUpdate(t){this._scheduledUpdatesByOrdering.delete(t._ordering,t),Se&&A.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)===Ye.prototype?t._cancelled=!0:"clear"in t&&t.clear(),Se&&A.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)===Ye.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)===Ye.prototype||!t.isComplete())&&this._postponedTasks.add(t),t._postponed=!0,Se&&A.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)===Ye.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)===Ye.prototype||!t.isComplete())&&this._scheduledTasksByPriority.insert(t._priority,t),t._postponed=!1,this.requestAnimationFrame(),Se&&A.log("task resumed",t.name)}}setTaskPriority(t,e){if(Object.getPrototypeOf(t)===Ye.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,Se&&A.log("task priority changed",t.name,e)}},_t=class{constructor(){this._map=new Map,this._size=0,this._sortedKeys=[]}_map;_size;_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(A.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 A.assert(t===this._size),t}},Je=t=>t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase(),Et="",Ki=.09,Zi=1,Qi=.025,er=.5,tr=5e-4,ar=5e-4,nr=.01,ir=.05,ei=1,rr=.01,sr=.2,or={MappedinCategory:"categories",MappedinLocation:"locations"},lr={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:Qn,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===_.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:Ki,PRIMARY_INDEX_WEIGHT:Zi,SECONDARY_INDEX_WEIGHT:Qi,CATEGORY_NAME_WEIGHT:er,LOCATION_NAME_WEIGHT:ei,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:tr,CATEGORY_LOCATION_TAGS_WEIGHT:ar,CATEGORY_LOCATION_NAME_WEIGHT:nr,PRIMARY_INDEX_TAGS_NAME_WEIGHT:ir,LOCATION_DEFAULT_RANK:ei,RATIO_OF_FUZZY_TO_EXACT:rr,RATIO_OF_PREFIX_TO_EXACT:sr}},Vt=class{#t;#e;#n;#r;#i;#a=new la({performance:!0});#s;#o;#l=new Map;constructor(t,e){this.#o=new ra({...t.options,testMode:!1===e?.emitAnalyticsEvents}),this.#i={...lr,...e},this.#t=t,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:t=>t.includes("MappedinLocation")?r:t.includes("MappedinCategory")?i:r},h={fields:["description"],storeFields:l,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(t,e)=>this.#s?.has(t.toLowerCase())?null:t.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((t=>{this.#c=t})),this.#i?.jsonIndex){let{primary:t,secondary:e,extra:n}=JSON.parse(this.#i?.jsonIndex);this.#e=ft.default.loadJS(t,u),this.#n=ft.default.loadJS(e,h),this.#r=ft.default.loadJS(n,c)}else this.#e=new ft.default(u),this.#n=new ft.default(h),this.#r=new ft.default(c),this.#t.locations.forEach(this.#d),this.#t.categories.forEach(this.#p);this.#a.update(performance.now()),this.#f=Ia(((t,e)=>{this.#o.trackSearchSuggest({query:t,hits:e})}),300),this.#g=Ia(((t,e)=>{this.#o.trackSearch({query:t,hits:e})}),300)}#u=0;#y=t=>{this.#u++,this.#a.scheduleUpdate(new sa({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{t(),this.#u--,0===this.#u&&this.#c()}}))};#d=t=>{let{SECONDARY_INDEX_WEIGHT:e,LOCATION_DEFAULT_RANK:n,PRIMARY_INDEX_TAGS_NAME_WEIGHT:r}=this.#i.constants,i=n;this.#i?.useLocationRank&&(i=Array.isArray(t.polygons)?Math.max(...t.polygons.map((t=>t.rank?.score?t.rank?.score:n)),n):n),this.#y((()=>{this.#e.add({name:Je(t.name),tags:"",id:"MappedinLocation_"+t.id,weight:n,rank:i})})),this.#i?.searchTags&&Array.isArray(t.tags)&&t.tags.forEach((e=>{this.#e.add({name:"",tag:Je(e),id:"MappedinLocation_"+t.id,weight:r,rank:i})})),this.#i?.searchDescriptions&&this.#y((()=>this.#n.add({description:Je(t.description||""),id:"MappedinLocation_"+t.id,weight:e,rank:i})))};#p=t=>{let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:e,CATEGORY_LOCATION_TAGS_WEIGHT:n,CATEGORY_LOCATION_NAME_WEIGHT:r,CATEGORY_NAME_WEIGHT:i}=this.#i.constants;this.#y((()=>this.#e.add({name:Je(t.name||""),description:"",id:"MappedinCategory_"+t.id,weight:i})));let a=t.locations.reduce(((t,e)=>t+` ${Et} `+e.name),"")+` ${Et}`;if(this.#i?.searchDescriptionsInCategories&&t.locations.forEach((n=>{null!=n.description&&this.#y((()=>this.#r.add({id:"MappedinCategory_"+t.id,"category.locations.description":Je(n.description),ref:n.name,weight:e})))})),this.#i?.searchTagsInCategories){let e=t.locations.reduce(((t,e)=>t+e.tags?.reduce(((t,e)=>t+` ${Et} `+e),"")+` ${Et}`),"");this.#y((()=>this.#r.add({"category.locations.tags":Je(e),id:"MappedinCategory_"+t.id,weight:n})))}this.#y((()=>this.#r.add({"category.locations.name":Je(a),id:"MappedinCategory_"+t.id,weight:r})))};#h;#c;#m=t=>{let e=t.score,{object:n,id:r,weight:i,rank:a}=t,[s,o]=r.split("_"),l=n||this.#t.getCollectionItemById(or[s],o);return a&&this.#i?.useLocationRank&&(e+=a),i&&(e*=i),{score:e,type:s,object:l}};#v=(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(`[^${Et}]* `+n+` [^${Et}]*`,"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){let e=[],n=Je(t);e=[...this.#e.search(n),...this.#n.search(n),...this.#r.search(n)].sort(((t,e)=>e.score-t.score));let r={};for(let t of e){let e=this.#m(t);r[t.id]?r[t.id].score+=e.score:r[t.id]={...e,matches:[]},this.#v(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))}async suggest(t){await this.#h;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}=this.#i.constants,s=this.#e.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 this.#f(t,s.length),{total:s.length,hits:s.map((t=>({text:t.suggestion})))}}async search(t){await this.#h;let e=this.#_(t);return this.#g(t,e.length),e}async toJSON(){return await this.#h,JSON.stringify({primary:this.#e,secondary:this.#n,extra:this.#r})}#f;#g;async addQuery(t){let e,n,{query:r,object:i,weight:a=1}=t;await this.#h,e=i instanceof Ce?"MappedinLocation":i instanceof qe?"MappedinCategory":"Custom","MappedinLocation"===e||"MappedinCategory"===e?n=e+"_"+i.id:"string"==typeof i.id?n="Custom_"+i.id:(n=this.#l.get(i),n||(n="Custom_"+We(),this.#l.set(i,n))),this.#e.add({id:n,weight:a,object:i,query:Je(r)})}};w();var ti=globalThis.fetch;function Rt(){if(null==ti)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return ti}var ur=_?.env?.npm_package_version;globalThis.btoa||(globalThis.btoa=ai.encode);var cr=["ar"];function Ba(t){let e={...Xn,things:Kn,...t};return e.headers={...e.headers,"mappedin-sdk-version":ur},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 Da(t){let e=Ba({baseUrl:"https://api-gateway.mappedin.com/",...{emitAnalyticsEvents:!0,...t}}),n="public/1/"+(e.useDraftData?"draft/":""),r=new lt({...e,baseUrl:e.baseUrl+n});return await r.fetch(),r}var ni={shouldPopulateBundledImagesAsBlobs:!(typeof globalThis.navigator<"u"&&"ReactNative"==globalThis.navigator.product)};async function Ga(t){let e=Ba({baseUrl:"https://api-gateway.mappedin.com/",...ni,...t}),{url:n,updated_at:r}=await dr(t),i=await Rt()(n,{mode:"cors"}),{data:a,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error(`Unrecognized format ${s}`);let o=new lt(e);return await o.hydrate(a,e.shouldPopulateBundledImagesAsBlobs),o.updatedAt=r,o}async function dr(t){let e=Ba({baseUrl:"https://api-gateway.mappedin.com/",...ni,...t}),{version:n,venue:r}=t,i=`${t.bundleBaseUri||e.baseUrl+`exports/legacy${null!=e.language&&cr.includes(e.language)?"-"+e.language:""}/1/bundle`}?venue=${r}&version=1.0.0`;return e.language=void 0,await Ta(e,i)}var pr=!1;function hr(t){t.things=t.things||{},t.things.venue=t.things.venue||[],t.things.venue.push("slug","defaultMap"),t.things.nodes=t.things.nodes||[],t.things.nodes.push("x","y","paths","map"),t.things.polygons=t.things.polygons||[],t.things.locations=t.things.locations||[],t.things.locations.push("sortOrder","parent","showLabelWhenImagePresent","hidden"),t.things.maps=t.things.maps||[],t.things.maps.push("height","width","georeference"),t.perspective=t.perspective3D||t.perspective||void 0,t.things.maps.push("scene","layers"),t.things.polygons.push("canvasBounds","map","image","perspectives","material","holes","label","geometry"),pr&&t.things.polygons.push("layer","geometry","vertexes")}var mr=function(t){return null==t.mapView&&(t.mapView={}),new Promise((function(e,n){function r(r,i){if(r)n(r);else{let r={};try{t.firstMapSelector&&(t.mapView=t.mapView||{},t.mapView.firstMap=t.firstMapSelector(i))}catch(t){A.error("Failure in firstMapSelector! Loading default map instead."),A.error(t),n(t)}r.venue=i,e(r)}}hr(t.venue),t.venue.useVenueBundle?Ga(t.venue).then((t=>r(null,t))).catch((t=>r(t,null))):Da(t.venue).then((t=>r(null,t))).catch((t=>r(t,null)))}))};
|