@twinmatrix/spatialverse-sdk-rn 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import e from"react-native-geolocation-service";import{PermissionsAndroid as t,Platform as n,Animated as r,Easing as i,StyleSheet as o,View as a}from"react-native";import s from"react-native-compass-heading";import l,{useState as u,useRef as c,useEffect as h,useImperativeHandle as d,useMemo as p,forwardRef as f,isValidElement as g,useCallback as m}from"react";import{ShapeSource as v,CircleLayer as y,SymbolLayer as w,Animated as b,LineLayer as _,FillLayer as x,MarkerView as S,MapView as A,Camera as P,Images as M,VectorSource as C}from"@maplibre/maplibre-react-native";export{Animated,CircleLayer,FillLayer,ShapeSource as GeoJSONSource,ImageSource,Images,LineLayer,MarkerView as Marker,MarkerView,RasterSource,ShapeSource,SymbolLayer,VectorSource}from"@maplibre/maplibre-react-native";import k from"axios";import{MMKV as E}from"react-native-mmkv";import T from"react-native-aes-crypto";import L from"react-native-fs";import{unzip as R,unzipWithPassword as D}from"react-native-zip-archive";import F from"@react-native-community/netinfo";var O=function(e,t){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},O(e,t)};function N(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}O(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var j=function(){return j=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},j.apply(this,arguments)};function I(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function z(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function B(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function H(e,t,n){return t=Z(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,$()?Reflect.construct(t,n||[],Z(e).constructor):t.apply(e,n))}function G(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function W(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ee(r.key),r)}}function V(e,t,n){return t&&W(e.prototype,t),n&&W(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function q(e,t,n){return(t=ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Z(e)}function Y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&X(e,t)}function $(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return($=function(){return!!e})()}function J(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J(Object(n),!0).forEach(function(t){q(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function X(e,t){return X=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},X(e,t)}function Q(e){return function(e){if(Array.isArray(e))return U(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return U(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?U(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ee(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function te(e){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(e)}"function"==typeof SuppressedError&&SuppressedError;var ne=function(){function r(){this.gpsEnabled=!1,this.gpsWatchId=null,this.currentGPSPosition=null,this.gpsCallbacks={}}return r.prototype.requestGPSPermission=function(){return I(this,void 0,void 0,function(){var r,i,o,a,s;return z(this,function(l){switch(l.label){case 0:return l.trys.push([0,9,,10]),"android"!==n.OS?[3,4]:(r=t.PERMISSIONS.ACCESS_FINE_LOCATION,i=t.PERMISSIONS.ACCESS_COARSE_LOCATION,[4,t.check(r)]);case 1:return o=l.sent(),[4,t.check(i)];case 2:return a=l.sent(),o||a?[2,{granted:!0,denied:!1,prompt:!1,state:"granted"}]:[4,t.request(r)];case 3:return(s=l.sent())===t.RESULTS.GRANTED?[2,{granted:!0,denied:!1,prompt:!1,state:"granted"}]:s===t.RESULTS.DENIED?[2,{granted:!1,denied:!1,prompt:!0,state:"prompt"}]:[2,{granted:!1,denied:!0,prompt:!1,state:"denied"}];case 4:if(!e.requestAuthorization)return[3,8];l.label=5;case 5:return l.trys.push([5,7,,8]),[4,e.requestAuthorization("whenInUse")];case 6:switch(s=l.sent()){case"granted":return[2,{granted:!0,denied:!1,prompt:!1,state:"granted"}];case"denied":return[2,{granted:!1,denied:!0,prompt:!1,state:"denied"}];case"disabled":case"restricted":return[2,{granted:!1,denied:!0,prompt:!1,state:"blocked"}];default:return[2,{granted:!1,denied:!1,prompt:!0,state:"prompt"}]}return[3,8];case 7:return l.sent(),[2,{granted:!1,denied:!0,prompt:!1,state:"denied"}];case 8:return[2,{granted:!1,denied:!1,prompt:!0,state:"prompt"}];case 9:return l.sent(),[2,{granted:!1,denied:!1,prompt:!0,state:"prompt"}];case 10:return[2]}})})},r.prototype.isGPSPermissionGranted=function(){return I(this,void 0,void 0,function(){return z(this,function(e){switch(e.label){case 0:return[4,this.requestGPSPermission()];case 1:return[2,e.sent().granted]}})})},r.prototype.enableGPS=function(e){return void 0===e&&(e={}),I(this,void 0,void 0,function(){var t;return z(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e.callbacks&&e.callbacks!==this.gpsCallbacks&&(this.gpsCallbacks=e.callbacks),[4,this.isGPSPermissionGranted()];case 1:if(!n.sent())throw{type:"permission_denied",message:"GPS permission is required to enable location services."};return this.startGPS(e),[2,{success:!0}];case 2:return t=n.sent(),this.handleGPSError(t),[2,{success:!1,warning:{type:"unavailable",message:"Failed to enable GPS due to an unexpected error."}}];case 3:return[2]}})})},r.prototype.disableGPS=function(){var e;this.stopGPS(),this.currentGPSPosition=null,(null===(e=this.gpsCallbacks)||void 0===e?void 0:e.onToggle)&&this.gpsCallbacks.onToggle(!1)},r.prototype.destroyGPS=function(){this.disableGPS(),this.gpsCallbacks={}},r.prototype.startGPS=function(t){var n=this;void 0===t&&(t={});var r=t.enableHighAccuracy,i=void 0===r||r,o=t.timeout,a=void 0===o?1e4:o,s=t.maximumAge,l=void 0===s?0:s;if(!e||!e.watchPosition){var u=new Error("Geolocation is not supported by this runtime.");throw u.code=0,u}this.gpsEnabled=!0;var c={enableHighAccuracy:i,timeout:a,maximumAge:l,distanceFilter:0,interval:100,fastestInterval:10};this.gpsWatchId=e.watchPosition(function(e){var t=n.mapNativePosition(e);n.currentGPSPosition=t,n.gpsCallbacks.onLocationUpdate&&n.gpsCallbacks.onLocationUpdate(t)},function(e){n.handleGPSError(e)},c)},r.prototype.stopGPS=function(){if(this.gpsEnabled=!1,null!==this.gpsWatchId){try{e.clearWatch(this.gpsWatchId)}catch(e){}this.gpsWatchId=null}},r.prototype.getGPSPosition=function(t){var n=this;void 0===t&&(t={});var r=t.enableHighAccuracy,i=void 0===r||r,o=t.timeout,a=void 0===o?1e4:o,s=t.maximumAge,l=void 0===s?15e3:s;return new Promise(function(t,r){e&&e.getCurrentPosition?e.getCurrentPosition(function(e){var r=n.mapNativePosition(e);n.currentGPSPosition=r,t(r)},function(e){return r(e)},{enableHighAccuracy:i,timeout:a,maximumAge:l}):r(new Error("Geolocation is not supported by this runtime."))})},r.prototype.isGPSEnabled=function(){return this.gpsEnabled},r.prototype.getCurrentGPSPosition=function(){return this.currentGPSPosition},r.prototype.handleGPSError=function(e){var t="Unknown GPS error occurred.",n=e&&"object"===te(e)&&"code"in e?Number(e.code):NaN;if(Number.isFinite(n))switch(n){case 1:t="GPS permission denied by user.";break;case 2:t="GPS position unavailable.";break;case 3:t="GPS request timed out."}this.gpsCallbacks.onError&&this.gpsCallbacks.onError(e,t)},r.prototype.mapNativePosition=function(e){var t,n,r,i;return{coordinates:[e.coords.longitude,e.coords.latitude],accuracy:e.coords.accuracy,timestamp:e.timestamp||Date.now(),heading:null!==(t=e.coords.heading)&&void 0!==t?t:void 0,speed:null!==(n=e.coords.speed)&&void 0!==n?n:void 0,altitude:null!==(r=e.coords.altitude)&&void 0!==r?r:void 0,altitudeAccuracy:null!==(i=e.coords.altitudeAccuracy)&&void 0!==i?i:void 0}},r}(),re=function(){function e(){this.compassEnabled=!1,this.currentCompassData=null,this.onUpdateCallbacks=new Set,this.onToggleCallbacks=new Set,this.onErrorCallbacks=new Set,this.degreeUpdateRate=3}return e.prototype.requestCompassPermission=function(){return I(this,void 0,void 0,function(){var e;return z(this,function(t){switch(t.label){case 0:console.log("🧭 Requesting compass permission..."),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.isCompassAvailable()];case 2:return t.sent()?(console.log("🧭 Compass permission granted (automatic)"),[2,{granted:!0,denied:!1,prompt:!1,state:"granted"}]):(console.warn("🧭 Compass not available on this device"),[2,{granted:!1,denied:!0,prompt:!1,state:"unavailable"}]);case 3:return e=t.sent(),console.error("🧭 Error checking compass availability:",e),[2,{granted:!1,denied:!0,prompt:!1,state:"denied"}];case 4:return[2]}})})},e.prototype.isCompassAvailable=function(){return I(this,void 0,void 0,function(){return z(this,function(e){try{return[2,new Promise(function(e){var t=!1,n=setTimeout(function(){t||(t=!0,e(!1))},500);try{s.start(1,function(r){r.heading,r.accuracy;t||(t=!0,clearTimeout(n),s.stop(),e(!0))})}catch(r){clearTimeout(n),t||(t=!0,e(!1))}})]}catch(e){return[2,!1]}return[2]})})},e.prototype.enableCompass=function(e){return I(this,void 0,void 0,function(){var t,n;return z(this,function(r){switch(r.label){case 0:if(this.compassEnabled)return console.log("🧭 Compass already enabled"),[2,!0];r.label=1;case 1:return r.trys.push([1,3,,4]),e&&this.addCallback(e),[4,this.requestCompassPermission()];case 2:return t=r.sent(),console.log("🧭 Compass permission status:",t),t.denied||!t.granted?(console.warn("🧭 Compass permission denied or not granted"),this.handleCompassError({type:"permission_denied",message:"Compass permission denied. Please enable device sensor access in device settings."}),[2,!1]):(console.log("🧭 Compass permission granted, starting compass..."),this.compassEnabled=!0,this.startCompass(),this.onToggleCallbacks.forEach(function(e){try{e(!0)}catch(e){}}),[2,!0]);case 3:return n=r.sent(),console.error("Error enabling compass:",n),this.compassEnabled=!1,this.handleCompassError({type:"unavailable",message:"Failed to enable compass"}),[2,!1];case 4:return[2]}})})},e.prototype.disableCompass=function(){this.compassEnabled&&(this.compassEnabled=!1,this.stopCompass(),this.currentCompassData=null,this.onToggleCallbacks.forEach(function(e){try{e(!1)}catch(e){}}))},e.prototype.startCompass=function(){var e=this;console.log("🧭 Starting compass listeners...");try{s.start(this.degreeUpdateRate,function(t){var n=t.heading,r=t.accuracy;e.handleCompassUpdate(n,r)})}catch(e){console.error("🧭 Error starting compass:",e),this.handleCompassError({type:"unavailable",message:"Failed to start compass tracking"})}},e.prototype.stopCompass=function(){try{s.stop()}catch(e){console.error("🧭 Error stopping compass:",e)}},e.prototype.handleCompassUpdate=function(e,t){if(this.compassEnabled)try{var n=null!==e&&!isNaN(e),r={heading:e,accuracy:null!=t?t:null,timestamp:Date.now(),isCalibrated:n};this.currentCompassData=r,this.onUpdateCallbacks.forEach(function(e){try{e(r)}catch(e){}})}catch(e){console.error("Error processing compass update:",e),this.handleCompassError({type:"inaccurate",message:"Error processing compass data"})}},e.prototype.triggerCompassUpdate=function(e,t){void 0===t&&(t=null);var n=null!==e&&!isNaN(e),r={heading:e,accuracy:null!=t?t:null,timestamp:Date.now(),isCalibrated:n};this.currentCompassData=r,this.onUpdateCallbacks.forEach(function(e){try{e(r)}catch(e){}})},e.prototype.handleCompassError=function(e){this.onErrorCallbacks.forEach(function(t){try{t(e)}catch(e){}}),this.onToggleCallbacks.forEach(function(e){try{e(!1)}catch(e){}})},e.prototype.getCurrentCompassData=function(){return this.currentCompassData},e.prototype.isCompassEnabled=function(){return this.compassEnabled},e.prototype.getCompassHeading=function(){var e;return(null===(e=this.currentCompassData)||void 0===e?void 0:e.heading)||null},e.prototype.isCompassCalibrated=function(){var e;return(null===(e=this.currentCompassData)||void 0===e?void 0:e.isCalibrated)||!1},e.prototype.addCallback=function(e){e.onCompassUpdate&&this.onUpdateCallbacks.add(e.onCompassUpdate),e.onCompassToggle&&this.onToggleCallbacks.add(e.onCompassToggle),e.onCompassError&&this.onErrorCallbacks.add(e.onCompassError)},e.prototype.removeCallback=function(e){e.onCompassUpdate&&this.onUpdateCallbacks.delete(e.onCompassUpdate),e.onCompassToggle&&this.onToggleCallbacks.delete(e.onCompassToggle),e.onCompassError&&this.onErrorCallbacks.delete(e.onCompassError)},e.prototype.isCompassPermissionDenied=function(){return!1},e.prototype.destroy=function(){this.disableCompass(),this.onUpdateCallbacks.clear(),this.onToggleCallbacks.clear(),this.onErrorCallbacks.clear(),this.currentCompassData=null},e}();function ie(e){var t=!1;return{getZoom:function(){return e.getZoom()},moveTo:function(n){var r,i=e.getCamera();if(i){var o=56===n.pitch,a=!o||!t;t=o;var s=a&&n.paddingFraction?function(e,t){var n,r,i,o;return{top:Math.round(t.height*(null!==(n=e.top)&&void 0!==n?n:0)),bottom:Math.round(t.height*(null!==(r=e.bottom)&&void 0!==r?r:0)),left:Math.round(t.width*(null!==(i=e.left)&&void 0!==i?i:0)),right:Math.round(t.width*(null!==(o=e.right)&&void 0!==o?o:0))}}(n.paddingFraction,e.getViewport()):void 0;i.setStop(j(j(j({center:n.center,bearing:n.bearing,pitch:n.pitch},a&&null!=n.zoom?{zoom:n.zoom}:{}),s?{padding:s}:{}),{duration:n.durationMs,easing:null!==(r=n.easing)&&void 0!==r?r:"linear"}))}},fitBounds:function(t,n){var r,i;null===(i=null===(r=e.getCamera())||void 0===r?void 0:r.fitBounds)||void 0===i||i.call(r,t,n)}}}function oe(e){var t,n=e.position,r=e.showAccuracy,i=void 0===r||r,o=e.pulse,a=void 0===o||o,s=e.color,f=void 0===s?"#1E90FF":s,g=e.pulseColor,m=void 0===g?"#b7d8f7":g,b=e.showArrow,_=void 0===b||b,x=e.ref,S=u(!0),A=S[0],P=S[1],M=u(!0),C=M[0],k=M[1],E=u(n),T=E[0],L=E[1],R=u(0),D=R[0],F=R[1],O=c(null),N=c({});h(function(){L(n)},[n]),h(function(){if(a){var e=Date.now(),t=function(){var n=(Date.now()-e)%2e3,r=.5*Math.sin(n/2e3*Math.PI*2)+.5;F(r),O.current=requestAnimationFrame(t)};return O.current=requestAnimationFrame(t),function(){O.current&&cancelAnimationFrame(O.current),O.current=null}}},[a]),d(x,function(){return Object.assign(N.current,{update:function(e,t,n){var r=null!=n&&Number.isFinite(n);L({coordinates:e,accuracy:t,timestamp:Date.now(),heading:r?n:void 0}),k(!r)},updateHeading:function(e){var t=null!=e&&Number.isFinite(e);L(function(n){return n?j(j({},n),{heading:t?e:void 0}):n}),k(!t)},show:function(){P(!0)},hide:function(){P(!1)},remove:function(){P(!1),L(null)}}),N.current});var I=p(function(){var e;return T&&A?{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:T.coordinates},properties:{radius:8,accuracy:T.accuracy,heading:null!==(e=T.heading)&&void 0!==e?e:0}}]}:{type:"FeatureCollection",features:[]}},[T,A]);if(!T||!A)return null;var z=a?8+9.6*D:8,B=a?Math.max(Math.min(.9*(1-.7*D),.9),.2):.95;return l.createElement(l.Fragment,null,l.createElement(v,{id:"gps-source",data:I},l.createElement(y,{id:"gps-accuracy",style:{circleColor:f,circleOpacity:.2,circleRadius:["*",["get","accuracy"],.6],circleStrokeColor:f,circleStrokeWidth:1,visibility:i?"visible":"none"}}),l.createElement(y,{id:"gps-pulse",style:{circleColor:m,circleOpacity:B,circleRadius:z,circleStrokeColor:m,circleStrokeWidth:2,visibility:C&&a?"visible":"none"}}),l.createElement(y,{id:"gps-dot",style:{circleColor:f,circleOpacity:.95,circleRadius:6,circleStrokeColor:"#ffffff",circleStrokeWidth:2,visibility:C?"visible":"none"}}),l.createElement(w,{id:"gps-arrow",style:{iconImage:"arrow-marker",iconSize:.05,iconAllowOverlap:!0,iconRotate:null!==(t=T.heading)&&void 0!==t?t:0,iconRotationAlignment:"map",iconIgnorePlacement:!0,visibility:!C&&null!=T.heading&&Number.isFinite(T.heading)&&_?"visible":"none"}})))}function ae(){var e;try{return null!==(e=require("expo-sensors").DeviceMotion)&&void 0!==e?e:null}catch(e){return null}}function se(e){var t,n,r;return e?{x:null!==(t=e.x)&&void 0!==t?t:0,y:null!==(n=e.y)&&void 0!==n?n:0,z:null!==(r=e.z)&&void 0!==r?r:0}:null}function le(){var e=null;return{isSupported:function(){return null!=ae()},requestPermission:function(){return I(this,void 0,void 0,function(){var e,t;return z(this,function(n){switch(n.label){case 0:if(!(e=ae()))return[2,!1];n.label=1;case 1:return n.trys.push([1,6,,7]),"function"!=typeof e.isAvailableAsync?[3,3]:[4,e.isAvailableAsync()];case 2:if(!n.sent())return[2,!0];n.label=3;case 3:return"function"!=typeof e.requestPermissionsAsync?[3,5]:[4,e.requestPermissionsAsync()];case 4:return[2,"granted"===(null==(t=n.sent())?void 0:t.status)];case 5:return[2,!0];case 6:return n.sent(),[2,!1];case 7:return[2]}})})},start:function(t){var n,r=ae();if(r){null==e||e(),null===(n=r.setUpdateInterval)||void 0===n||n.call(r,16);var i=r.addListener(function(e){t(function(e,t){var n,r,i;void 0===t&&(t=Date.now());var o=e.rotationRate;return{timestampMs:t,accelerationIncludingGravity:se(e.accelerationIncludingGravity),acceleration:se(e.acceleration),rotationRate:o?{alpha:null!==(n=o.alpha)&&void 0!==n?n:0,beta:null!==(r=o.beta)&&void 0!==r?r:0,gamma:null!==(i=o.gamma)&&void 0!==i?i:0}:null,interval:"number"==typeof e.interval&&e.interval>0?e.interval:16}}(e))});e=function(){return i.remove()}}},stop:function(){null==e||e(),e=null}}}function ue(){return globalThis.DeviceMotionEvent}var ce,he,de=(ce=le(),he=null,{isSupported:function(){return ce.isSupported()||!!ue()},requestPermission:function(){return I(this,void 0,void 0,function(){var e;return z(this,function(t){switch(t.label){case 0:if(ce.isSupported())return[2,ce.requestPermission()];if(!(null==(e=ue())?void 0:e.requestPermission))return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e.requestPermission()];case 2:return[2,"granted"===t.sent()];case 3:return t.sent(),[2,!1];case 4:return[2,!!e]}})})},start:function(e){ce.isSupported()?ce.start(e):(null==he||he(),he=function(e){if("undefined"==typeof window||!ue())return null;var t=function(t){var n,r,i,o,a,s,l,u,c,h;e({timestampMs:Date.now(),accelerationIncludingGravity:t.accelerationIncludingGravity?{x:null!==(n=t.accelerationIncludingGravity.x)&&void 0!==n?n:0,y:null!==(r=t.accelerationIncludingGravity.y)&&void 0!==r?r:0,z:null!==(i=t.accelerationIncludingGravity.z)&&void 0!==i?i:0}:null,acceleration:t.acceleration?{x:null!==(o=t.acceleration.x)&&void 0!==o?o:0,y:null!==(a=t.acceleration.y)&&void 0!==a?a:0,z:null!==(s=t.acceleration.z)&&void 0!==s?s:0}:null,rotationRate:t.rotationRate?{alpha:null!==(l=t.rotationRate.alpha)&&void 0!==l?l:0,beta:null!==(u=t.rotationRate.beta)&&void 0!==u?u:0,gamma:null!==(c=t.rotationRate.gamma)&&void 0!==c?c:0}:null,interval:null!==(h=t.interval)&&void 0!==h?h:16})};return window.addEventListener("devicemotion",t),function(){return window.removeEventListener("devicemotion",t)}}(e))},stop:function(){ce.stop(),null==he||he(),he=null}}),pe=function(){function e(e){void 0===e&&(e=de),this.handler=null,this.listening=!1,this.source=e}return e.prototype.requestPermission=function(){return I(this,void 0,void 0,function(){return z(this,function(e){return[2,this.source.requestPermission()]})})},e.prototype.isSupported=function(){return this.source.isSupported()},e.prototype.start=function(e){var t=this;this.handler=e,this.listening=!0,this.source.start(function(e){var n;t.listening&&(null===(n=t.handler)||void 0===n||n.call(t,e))})},e.prototype.stop=function(){this.listening=!1,this.handler=null,this.source.stop()},e}(),fe=6371008.8,ge={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:fe,metres:fe,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:3440.069546436285,radians:1,yards:6967335.223679999};function me(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function ve(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!_e(e[0])||!_e(e[1]))throw new Error("coordinates must contain numbers");return me({type:"Point",coordinates:e},t,n)}function ye(e,t,n){if(void 0===n&&(n={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return me({type:"LineString",coordinates:e},t,n)}function we(e,t,n){return void 0===n&&(n={}),me({type:"MultiPoint",coordinates:e},t,n)}function be(e){return e%360*Math.PI/180}function _e(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}var xe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Se(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ae=function(){this.__data__=[],this.size=0};var Pe=function(e,t){return e===t||e!=e&&t!=t},Me=Pe;var Ce=function(e,t){for(var n=e.length;n--;)if(Me(e[n][0],t))return n;return-1},ke=Ce,Ee=Array.prototype.splice;var Te=Ce;var Le=Ce;var Re=Ce;var De=Ae,Fe=function(e){var t=this.__data__,n=ke(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ee.call(t,n,1),--this.size,!0)},Oe=function(e){var t=this.__data__,n=Te(t,e);return n<0?void 0:t[n][1]},Ne=function(e){return Le(this.__data__,e)>-1},je=function(e,t){var n=this.__data__,r=Re(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Ie(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ie.prototype.clear=De,Ie.prototype.delete=Fe,Ie.prototype.get=Oe,Ie.prototype.has=Ne,Ie.prototype.set=je;var ze=Ie,Be=ze;var Ue=function(){this.__data__=new Be,this.size=0};var He=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var Ge=function(e){return this.__data__.get(e)};var We=function(e){return this.__data__.has(e)},Ve="object"==typeof xe&&xe&&xe.Object===Object&&xe,qe=Ve,Ze="object"==typeof self&&self&&self.Object===Object&&self,Ye=qe||Ze||Function("return this")(),$e=Ye.Symbol,Je=$e,Ke=Object.prototype,Xe=Ke.hasOwnProperty,Qe=Ke.toString,et=Je?Je.toStringTag:void 0;var tt=function(e){var t=Xe.call(e,et),n=e[et];try{e[et]=void 0;var r=!0}catch(e){}var i=Qe.call(e);return r&&(t?e[et]=n:delete e[et]),i},nt=Object.prototype.toString;var rt=tt,it=function(e){return nt.call(e)},ot=$e?$e.toStringTag:void 0;var at=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ot&&ot in Object(e)?rt(e):it(e)};var st=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},lt=at,ut=st;var ct,ht=function(e){if(!ut(e))return!1;var t=lt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},dt=Ye["__core-js_shared__"],pt=(ct=/[^.]+$/.exec(dt&&dt.keys&&dt.keys.IE_PROTO||""))?"Symbol(src)_1."+ct:"";var ft=function(e){return!!pt&&pt in e},gt=Function.prototype.toString;var mt=function(e){if(null!=e){try{return gt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},vt=ht,yt=ft,wt=st,bt=mt,_t=/^\[object .+?Constructor\]$/,xt=Function.prototype,St=Object.prototype,At=xt.toString,Pt=St.hasOwnProperty,Mt=RegExp("^"+At.call(Pt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ct=function(e){return!(!wt(e)||yt(e))&&(vt(e)?Mt:_t).test(bt(e))},kt=function(e,t){return null==e?void 0:e[t]};var Et=function(e,t){var n=kt(e,t);return Ct(n)?n:void 0},Tt=Et(Ye,"Map"),Lt=Et(Object,"create"),Rt=Lt;var Dt=function(){this.__data__=Rt?Rt(null):{},this.size=0};var Ft=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ot=Lt,Nt=Object.prototype.hasOwnProperty;var jt=function(e){var t=this.__data__;if(Ot){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Nt.call(t,e)?t[e]:void 0},It=Lt,zt=Object.prototype.hasOwnProperty;var Bt=Lt;var Ut=Dt,Ht=Ft,Gt=jt,Wt=function(e){var t=this.__data__;return It?void 0!==t[e]:zt.call(t,e)},Vt=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Bt&&void 0===t?"__lodash_hash_undefined__":t,this};function qt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}qt.prototype.clear=Ut,qt.prototype.delete=Ht,qt.prototype.get=Gt,qt.prototype.has=Wt,qt.prototype.set=Vt;var Zt=qt,Yt=ze,$t=Tt;var Jt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Kt=function(e,t){var n=e.__data__;return Jt(t)?n["string"==typeof t?"string":"hash"]:n.map},Xt=Kt;var Qt=Kt;var en=Kt;var tn=Kt;var nn=function(){this.size=0,this.__data__={hash:new Zt,map:new($t||Yt),string:new Zt}},rn=function(e){var t=Xt(this,e).delete(e);return this.size-=t?1:0,t},on=function(e){return Qt(this,e).get(e)},an=function(e){return en(this,e).has(e)},sn=function(e,t){var n=tn(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ln.prototype.clear=nn,ln.prototype.delete=rn,ln.prototype.get=on,ln.prototype.has=an,ln.prototype.set=sn;var un=ze,cn=Tt,hn=ln;var dn=ze,pn=Ue,fn=He,gn=Ge,mn=We,vn=function(e,t){var n=this.__data__;if(n instanceof un){var r=n.__data__;if(!cn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new hn(r)}return n.set(e,t),this.size=n.size,this};function yn(e){var t=this.__data__=new dn(e);this.size=t.size}yn.prototype.clear=pn,yn.prototype.delete=fn,yn.prototype.get=gn,yn.prototype.has=mn,yn.prototype.set=vn;var wn=yn;var bn=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},_n=Et,xn=function(){try{var e=_n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Sn=function(e,t,n){"__proto__"==t&&xn?xn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},An=Sn,Pn=Pe,Mn=Object.prototype.hasOwnProperty;var Cn=function(e,t,n){var r=e[t];Mn.call(e,t)&&Pn(r,n)&&(void 0!==n||t in e)||An(e,t,n)},kn=Cn,En=Sn;var Tn=function(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),i?En(n,s,l):kn(n,s,l)}return n};var Ln=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var Rn=function(e){return null!=e&&"object"==typeof e},Dn=at,Fn=Rn;var On=function(e){return Fn(e)&&"[object Arguments]"==Dn(e)},Nn=Rn,jn=Object.prototype,In=jn.hasOwnProperty,zn=jn.propertyIsEnumerable,Bn=On(function(){return arguments}())?On:function(e){return Nn(e)&&In.call(e,"callee")&&!zn.call(e,"callee")},Un=Array.isArray,Hn={};var Gn=function(){return!1};!function(e,t){var n=Ye,r=Gn,i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;e.exports=s}({get exports(){return Hn},set exports(e){Hn=e}},Hn);var Wn=/^(?:0|[1-9]\d*)$/;var Vn=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Wn.test(e))&&e>-1&&e%1==0&&e<t};var qn=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Zn=at,Yn=qn,$n=Rn,Jn={};Jn["[object Float32Array]"]=Jn["[object Float64Array]"]=Jn["[object Int8Array]"]=Jn["[object Int16Array]"]=Jn["[object Int32Array]"]=Jn["[object Uint8Array]"]=Jn["[object Uint8ClampedArray]"]=Jn["[object Uint16Array]"]=Jn["[object Uint32Array]"]=!0,Jn["[object Arguments]"]=Jn["[object Array]"]=Jn["[object ArrayBuffer]"]=Jn["[object Boolean]"]=Jn["[object DataView]"]=Jn["[object Date]"]=Jn["[object Error]"]=Jn["[object Function]"]=Jn["[object Map]"]=Jn["[object Number]"]=Jn["[object Object]"]=Jn["[object RegExp]"]=Jn["[object Set]"]=Jn["[object String]"]=Jn["[object WeakMap]"]=!1;var Kn=function(e){return $n(e)&&Yn(e.length)&&!!Jn[Zn(e)]};var Xn=function(e){return function(t){return e(t)}},Qn={};!function(e,t){var n=Ve,r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,o=i&&i.exports===r&&n.process,a=function(){try{var e=i&&i.require&&i.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}({get exports(){return Qn},set exports(e){Qn=e}},Qn);var er=Kn,tr=Xn,nr=Qn&&Qn.isTypedArray,rr=nr?tr(nr):er,ir=Ln,or=Bn,ar=Un,sr=Hn,lr=Vn,ur=rr,cr=Object.prototype.hasOwnProperty;var hr=function(e,t){var n=ar(e),r=!n&&or(e),i=!n&&!r&&sr(e),o=!n&&!r&&!i&&ur(e),a=n||r||i||o,s=a?ir(e.length,String):[],l=s.length;for(var u in e)!t&&!cr.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||lr(u,l))||s.push(u);return s},dr=Object.prototype;var pr=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||dr)};var fr=function(e,t){return function(n){return e(t(n))}},gr=fr(Object.keys,Object),mr=pr,vr=gr,yr=Object.prototype.hasOwnProperty;var wr=ht,br=qn;var _r=function(e){return null!=e&&br(e.length)&&!wr(e)},xr=hr,Sr=function(e){if(!mr(e))return vr(e);var t=[];for(var n in Object(e))yr.call(e,n)&&"constructor"!=n&&t.push(n);return t},Ar=_r;var Pr=function(e){return Ar(e)?xr(e):Sr(e)},Mr=Tn,Cr=Pr;var kr=function(e,t){return e&&Mr(t,Cr(t),e)};var Er=st,Tr=pr,Lr=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},Rr=Object.prototype.hasOwnProperty;var Dr=hr,Fr=function(e){if(!Er(e))return Lr(e);var t=Tr(e),n=[];for(var r in e)("constructor"!=r||!t&&Rr.call(e,r))&&n.push(r);return n},Or=_r;var Nr=function(e){return Or(e)?Dr(e,!0):Fr(e)},jr=Tn,Ir=Nr;var zr=function(e,t){return e&&jr(t,Ir(t),e)},Br={};!function(e,t){var n=Ye,r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,o=i&&i.exports===r?n.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}({get exports(){return Br},set exports(e){Br=e}},Br);var Ur=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var Hr=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o};var Gr=function(){return[]},Wr=Hr,Vr=Gr,qr=Object.prototype.propertyIsEnumerable,Zr=Object.getOwnPropertySymbols,Yr=Zr?function(e){return null==e?[]:(e=Object(e),Wr(Zr(e),function(t){return qr.call(e,t)}))}:Vr,$r=Tn,Jr=Yr;var Kr=function(e,t){return $r(e,Jr(e),t)};var Xr=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},Qr=fr(Object.getPrototypeOf,Object),ei=Xr,ti=Qr,ni=Yr,ri=Gr,ii=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)ei(t,ni(e)),e=ti(e);return t}:ri,oi=Tn,ai=ii;var si=function(e,t){return oi(e,ai(e),t)},li=Xr,ui=Un;var ci=function(e,t,n){var r=t(e);return ui(e)?r:li(r,n(e))},hi=ci,di=Yr,pi=Pr;var fi=function(e){return hi(e,pi,di)},gi=ci,mi=ii,vi=Nr;var yi=function(e){return gi(e,vi,mi)},wi=Et(Ye,"DataView"),bi=Tt,_i=Et(Ye,"Promise"),xi=Et(Ye,"Set"),Si=Et(Ye,"WeakMap"),Ai=at,Pi=mt,Mi="[object Map]",Ci="[object Promise]",ki="[object Set]",Ei="[object WeakMap]",Ti="[object DataView]",Li=Pi(wi),Ri=Pi(bi),Di=Pi(_i),Fi=Pi(xi),Oi=Pi(Si),Ni=Ai;(wi&&Ni(new wi(new ArrayBuffer(1)))!=Ti||bi&&Ni(new bi)!=Mi||_i&&Ni(_i.resolve())!=Ci||xi&&Ni(new xi)!=ki||Si&&Ni(new Si)!=Ei)&&(Ni=function(e){var t=Ai(e),n="[object Object]"==t?e.constructor:void 0,r=n?Pi(n):"";if(r)switch(r){case Li:return Ti;case Ri:return Mi;case Di:return Ci;case Fi:return ki;case Oi:return Ei}return t});var ji=Ni,Ii=Object.prototype.hasOwnProperty;var zi=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ii.call(e,"index")&&(n.index=e.index,n.input=e.input),n},Bi=Ye.Uint8Array;var Ui=function(e){var t=new e.constructor(e.byteLength);return new Bi(t).set(new Bi(e)),t},Hi=Ui;var Gi=function(e,t){var n=t?Hi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},Wi=/\w*$/;var Vi=function(e){var t=new e.constructor(e.source,Wi.exec(e));return t.lastIndex=e.lastIndex,t},qi=$e?$e.prototype:void 0,Zi=qi?qi.valueOf:void 0;var Yi=Ui;var $i=function(e,t){var n=t?Yi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},Ji=Ui,Ki=Gi,Xi=Vi,Qi=function(e){return Zi?Object(Zi.call(e)):{}},eo=$i;var to=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return Ji(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return Ki(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return eo(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return Xi(e);case"[object Symbol]":return Qi(e)}},no=st,ro=Object.create,io=function(){function e(){}return function(t){if(!no(t))return{};if(ro)return ro(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),oo=Qr,ao=pr;var so=function(e){return"function"!=typeof e.constructor||ao(e)?{}:io(oo(e))},lo=ji,uo=Rn;var co=function(e){return uo(e)&&"[object Map]"==lo(e)},ho=Xn,po=Qn&&Qn.isMap,fo=po?ho(po):co,go=ji,mo=Rn;var vo=function(e){return mo(e)&&"[object Set]"==go(e)},yo=Xn,wo=Qn&&Qn.isSet,bo=wo?yo(wo):vo,_o=wn,xo=bn,So=Cn,Ao=kr,Po=zr,Mo=Br,Co=Ur,ko=Kr,Eo=si,To=fi,Lo=yi,Ro=ji,Do=zi,Fo=to,Oo=so,No=Un,jo=Hn,Io=fo,zo=st,Bo=bo,Uo=Pr,Ho=Nr,Go="[object Arguments]",Wo="[object Function]",Vo="[object Object]",qo={};qo[Go]=qo["[object Array]"]=qo["[object ArrayBuffer]"]=qo["[object DataView]"]=qo["[object Boolean]"]=qo["[object Date]"]=qo["[object Float32Array]"]=qo["[object Float64Array]"]=qo["[object Int8Array]"]=qo["[object Int16Array]"]=qo["[object Int32Array]"]=qo["[object Map]"]=qo["[object Number]"]=qo[Vo]=qo["[object RegExp]"]=qo["[object Set]"]=qo["[object String]"]=qo["[object Symbol]"]=qo["[object Uint8Array]"]=qo["[object Uint8ClampedArray]"]=qo["[object Uint16Array]"]=qo["[object Uint32Array]"]=!0,qo["[object Error]"]=qo[Wo]=qo["[object WeakMap]"]=!1;var Zo=function e(t,n,r,i,o,a){var s,l=1&n,u=2&n,c=4&n;if(r&&(s=o?r(t,i,o,a):r(t)),void 0!==s)return s;if(!zo(t))return t;var h=No(t);if(h){if(s=Do(t),!l)return Co(t,s)}else{var d=Ro(t),p=d==Wo||"[object GeneratorFunction]"==d;if(jo(t))return Mo(t,l);if(d==Vo||d==Go||p&&!o){if(s=u||p?{}:Oo(t),!l)return u?Eo(t,Po(s,t)):ko(t,Ao(s,t))}else{if(!qo[d])return o?t:{};s=Fo(t,d,l)}}a||(a=new _o);var f=a.get(t);if(f)return f;a.set(t,s),Bo(t)?t.forEach(function(i){s.add(e(i,n,r,i,t,a))}):Io(t)&&t.forEach(function(i,o){s.set(o,e(i,n,r,o,t,a))});var g=h?void 0:(c?u?Lo:To:u?Ho:Uo)(t);return xo(g||t,function(i,o){g&&(i=t[o=i]),So(s,o,e(i,n,r,o,t,a))}),s},Yo=Zo;var $o=function(e){return Yo(e,5)},Jo=Object.getPrototypeOf(r.ValueXY);__DEV__&&"AnimatedWithChildren"!==Jo.name&&console.error("AnimatedCoordinatesArray could not obtain AnimatedWithChildren base class");var Ko={useNativeDriver:!1},Xo=function(){function e(){var t,n;return G(this,e),(n=H(this,e)).state=(t=n).onInitialState.apply(t,arguments),n}return Y(e,Jo),V(e,[{key:"onInitialState",value:function(e){return{coords:e.map(function(e){return[e[0],e[1]]})}}},{key:"onGetValue",value:function(e){return e.coords}},{key:"onCalculate",value:function(e,t){var n=e.coords,r=e.targetCoords,i=t,o=1-i,a=Math.min(n.length,r.length),s=n.slice(0,a).map(function(e,t){return[e[0]*o+r[t][0]*i,e[1]*o+r[t][1]*i]});if(r.length>n.length){var l=n.length>0?n[n.length-1]:r[0],u=r.slice(a,r.length).map(function(e){return[l[0]*o+e[0]*i,l[1]*o+e[1]*i]});return{coords:[].concat(Q(s),Q(u)),targetCoords:r}}if(n.length>r.length){var c=r.length>0?r[r.length-1]:n[0],h=n.slice(a,n.length).map(function(e){return[e[0]*o+c[0]*i,e[1]*o+c[1]*i]});return{coords:[].concat(Q(s),Q(h)),targetCoords:r}}return{coords:s,targetCoords:r}}},{key:"onStart",value:function(e,t){var n=t.map(function(e){return[e[0],e[1]]});return K(K({},e),{},{targetCoords:n})}},{key:"animate",value:function(e,t,n){var r=this,i=n.toValue,o=t.start,a=t;return a.start=function(){var n;n=t,r.progressValue=e,r.progressValue.__addChild(r),r.animation=n,r.state=r.onStart(r.state,i),o.apply(void 0,arguments)},a}},{key:"timing",value:function(e){var t=new r.Value(1);return this.animate(t,r.loop(r.timing(t,K(K(K({},Ko),e),{},{toValue:0}))),e)}},{key:"spring",value:function(e){var t=new r.Value(0);return this.animate(t,r.spring(t,K(K(K({},Ko),e),{},{toValue:1})),e)}},{key:"decay",value:function(e){var t=new r.Value(0);return this.animate(t,r.decay(this.progressValue,K(K(K({},Ko),e),{},{toValue:1})),e)}},{key:"__getValue",value:function(){return this.progressValue?this.onGetValue(this.onCalculate(this.state,this.progressValue.__getValue())):this.onGetValue(this.state)}},{key:"destroy",value:function(){if(this.animation){var e=this.progressValue.__getValue();this.animation.stop(),this.state=this.onCalculate(this.state,e),this.progressValue.__removeChild(this),this.progressValue=null,this.animation=null}}}])}();function Qo(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function ea(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function ta(e,t,n){void 0===n&&(n={});var r=Qo(e),i=Qo(t),o=be(i[1]-r[1]),a=be(i[0]-r[0]),s=be(r[1]),l=be(i[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return function(e,t){void 0===t&&(t="kilometers");var n=ge[t];if(!n)throw new Error(t+" units is invalid");return e*n}(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),n.units)}function na(e){return e%360*Math.PI/180}function ra(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function ia(e,t,n){if(void 0===n&&(n={}),!0===n.final)return function(e,t){var n=ia(t,e);return n=(n+180)%360}(e,t);var r=ra(e),i=ra(t),o=na(r[0]),a=na(i[0]),s=na(r[1]),l=na(i[1]),u=Math.sin(a-o)*Math.cos(l),c=Math.cos(s)*Math.sin(l)-Math.sin(s)*Math.cos(l)*Math.cos(a-o);return Math.atan2(u,c)%(2*Math.PI)*180/Math.PI}var oa=6371008.8,aa={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:oa,metres:oa,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:3440.069546436285,radians:1,yards:6967335.223679999};function sa(e){return 180*(e%(2*Math.PI))/Math.PI}function la(e){return e%360*Math.PI/180}function ua(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function ca(e,t,n,r){void 0===r&&(r={});var i=function(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}(e),o=la(i[0]),a=la(i[1]),s=la(n),l=function(e,t){void 0===t&&(t="kilometers");var n=aa[t];if(!n)throw new Error(t+" units is invalid");return e/n}(t,r.units),u=Math.asin(Math.sin(a)*Math.cos(l)+Math.cos(a)*Math.sin(l)*Math.cos(s));return function(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ua(e[0])||!ua(e[1]))throw new Error("coordinates must contain numbers");return function(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}({type:"Point",coordinates:e},t,n)}([sa(o+Math.atan2(Math.sin(s)*Math.sin(l)*Math.cos(a),Math.cos(l)-Math.sin(a)*Math.sin(u))),sa(u)],r.properties)}function ha(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function da(e,t){void 0===t&&(t={});var n={type:"FeatureCollection"};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}function pa(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function fa(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function ga(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function ma(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function va(e,t){!function(e,t){var n,r,i,o,a,s,l,u,c,h,d=0,p="FeatureCollection"===e.type,f="Feature"===e.type,g=p?e.features.length:1;for(n=0;n<g;n++){for(s=p?e.features[n].geometry:f?e.geometry:e,u=p?e.features[n].properties:f?e.properties:{},c=p?e.features[n].bbox:f?e.bbox:void 0,h=p?e.features[n].id:f?e.id:void 0,a=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=l?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(o,d,u,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===t(o.geometries[r],d,u,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,d,u,c,h))return!1;d++}}(e,function(e,n,r,i,o){var a,s=null===e?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return!1!==t(ga(e,r,{bbox:i,id:o}),n,0)&&void 0}switch(s){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l<e.coordinates.length;l++){var u=e.coordinates[l];if(!1===t(ga({type:a,coordinates:u},r),n,l))return!1}})}function ya(e){if(!e)throw new Error("geojson is required");var t=[];return va(e,function(e){!function(e,t){var n=[],r=e.geometry;if(null!==r){switch(r.type){case"Polygon":n=ma(r);break;case"LineString":n=[ma(r)]}n.forEach(function(n){var r=function(e,t){var n=[];return e.reduce(function(e,r){var i,o,a,s,l,u,c=function(e,t,n){if(void 0===n&&(n={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return ga({type:"LineString",coordinates:e},t,n)}([e,r],t);return c.bbox=(o=r,a=(i=e)[0],s=i[1],l=o[0],u=o[1],[a<l?a:l,s<u?s:u,a>l?a:l,s>u?s:u]),n.push(c),r}),n}(n,e.properties);r.forEach(function(e){e.id=t.length,t.push(e)})})}}(e,t)}),function(e,t){void 0===t&&(t={});var n={type:"FeatureCollection"};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}(t)}function wa(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var n=0;n<e.features.length&&!1!==t(e.features[n],n);n++);}var ba={},_a={get exports(){return ba},set exports(e){ba=e}};function xa(e,t,n,r,i){Sa(e,t,n||0,r||e.length-1,i||Pa)}function Sa(e,t,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,a=t-n+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);Sa(e,t,Math.max(n,Math.floor(t-a*l/o+u)),Math.min(r,Math.floor(t+(o-a)*l/o+u)),i)}var c=e[t],h=n,d=r;for(Aa(e,n,t),i(e[r],c)>0&&Aa(e,n,r);h<d;){for(Aa(e,h,d),h++,d--;i(e[h],c)<0;)h++;for(;i(e[d],c)>0;)d--}0===i(e[n],c)?Aa(e,n,d):Aa(e,++d,r),d<=t&&(n=d+1),t<=d&&(r=d-1)}}function Aa(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Pa(e,t){return e<t?-1:e>t?1:0}function Ma(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function Ca(e,t){ka(e,0,e.children.length,t,e)}function ka(e,t,n,r,i){i||(i=Ia(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=t;o<n;o++){const t=e.children[o];Ea(i,e.leaf?r(t):t)}return i}function Ea(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Ta(e,t){return e.minX-t.minX}function La(e,t){return e.minY-t.minY}function Ra(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Da(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Fa(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function Oa(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function Na(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function ja(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function Ia(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function za(e,t,n,r,i){const o=[t,n];for(;o.length;){if((n=o.pop())-(t=o.pop())<=r)continue;const a=t+Math.ceil((n-t)/r/2)*r;xa(e,a,t,n,i),o.push(t,a,a,n)}}var Ba={};!function(e){function t(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function n(e,n,r){if(void 0===r&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!d(e[0])||!d(e[1]))throw new Error("coordinates must contain numbers");return t({type:"Point",coordinates:e},n,r)}function r(e,n,r){void 0===r&&(r={});for(var i=0,o=e;i<o.length;i++){var a=o[i];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw new Error("First and last Position are not equivalent.")}return t({type:"Polygon",coordinates:e},n,r)}function i(e,n,r){if(void 0===r&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return t({type:"LineString",coordinates:e},n,r)}function o(e,t){void 0===t&&(t={});var n={type:"FeatureCollection"};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}function a(e,n,r){return void 0===r&&(r={}),t({type:"MultiLineString",coordinates:e},n,r)}function s(e,n,r){return void 0===r&&(r={}),t({type:"MultiPoint",coordinates:e},n,r)}function l(e,n,r){return void 0===r&&(r={}),t({type:"MultiPolygon",coordinates:e},n,r)}function u(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t*r}function c(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t/r}function h(e){return 180*(e%(2*Math.PI))/Math.PI}function d(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.earthRadius=6371008.8,e.factors={centimeters:100*e.earthRadius,centimetres:100*e.earthRadius,degrees:e.earthRadius/111325,feet:3.28084*e.earthRadius,inches:39.37*e.earthRadius,kilometers:e.earthRadius/1e3,kilometres:e.earthRadius/1e3,meters:e.earthRadius,metres:e.earthRadius,miles:e.earthRadius/1609.344,millimeters:1e3*e.earthRadius,millimetres:1e3*e.earthRadius,nauticalmiles:e.earthRadius/1852,radians:1,yards:1.0936*e.earthRadius},e.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/e.earthRadius,yards:1.0936133},e.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},e.feature=t,e.geometry=function(e,t,o){switch(e){case"Point":return n(t).geometry;case"LineString":return i(t).geometry;case"Polygon":return r(t).geometry;case"MultiPoint":return s(t).geometry;case"MultiLineString":return a(t).geometry;case"MultiPolygon":return l(t).geometry;default:throw new Error(e+" is invalid")}},e.point=n,e.points=function(e,t,r){return void 0===r&&(r={}),o(e.map(function(e){return n(e,t)}),r)},e.polygon=r,e.polygons=function(e,t,n){return void 0===n&&(n={}),o(e.map(function(e){return r(e,t)}),n)},e.lineString=i,e.lineStrings=function(e,t,n){return void 0===n&&(n={}),o(e.map(function(e){return i(e,t)}),n)},e.featureCollection=o,e.multiLineString=a,e.multiPoint=s,e.multiPolygon=l,e.geometryCollection=function(e,n,r){return void 0===r&&(r={}),t({type:"GeometryCollection",geometries:e},n,r)},e.round=function(e,t){if(void 0===t&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,t||0);return Math.round(e*n)/n},e.radiansToLength=u,e.lengthToRadians=c,e.lengthToDegrees=function(e,t){return h(c(e,t))},e.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},e.radiansToDegrees=h,e.degreesToRadians=function(e){return e%360*Math.PI/180},e.convertLength=function(e,t,n){if(void 0===t&&(t="kilometers"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("length must be a positive number");return u(c(e,t),n)},e.convertArea=function(t,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=e.areaFactors[n];if(!i)throw new Error("invalid original units");var o=e.areaFactors[r];if(!o)throw new Error("invalid final units");return t/i*o},e.isNumber=d,e.isObject=function(e){return!!e&&e.constructor===Object},e.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(e){if(!d(e))throw new Error("bbox must only contain numbers")})},e.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}}(Ba);var Ua={};Object.defineProperty(Ua,"__esModule",{value:!0});var Ha=Ba;function Ga(e,t,n){if(null!==e)for(var r,i,o,a,s,l,u,c,h=0,d=0,p=e.type,f="FeatureCollection"===p,g="Feature"===p,m=f?e.features.length:1,v=0;v<m;v++){s=(c=!!(u=f?e.features[v].geometry:g?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var y=0;y<s;y++){var w=0,b=0;if(null!==(a=c?u.geometries[y]:u)){l=a.coordinates;var _=a.type;switch(h=!n||"Polygon"!==_&&"MultiPolygon"!==_?0:1,_){case null:break;case"Point":if(!1===t(l,d,v,w,b))return!1;d++,w++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],d,v,w,b))return!1;d++,"MultiPoint"===_&&w++}"LineString"===_&&w++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-h;i++){if(!1===t(l[r][i],d,v,w,b))return!1;d++}"MultiLineString"===_&&w++,"Polygon"===_&&b++}"Polygon"===_&&w++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(b=0,i=0;i<l[r].length;i++){for(o=0;o<l[r][i].length-h;o++){if(!1===t(l[r][i][o],d,v,w,b))return!1;d++}b++}w++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===Ga(a.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Wa(e,t){var n;switch(e.type){case"FeatureCollection":for(n=0;n<e.features.length&&!1!==t(e.features[n].properties,n);n++);break;case"Feature":t(e.properties,0)}}function Va(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var n=0;n<e.features.length&&!1!==t(e.features[n],n);n++);}function qa(e,t){var n,r,i,o,a,s,l,u,c,h,d=0,p="FeatureCollection"===e.type,f="Feature"===e.type,g=p?e.features.length:1;for(n=0;n<g;n++){for(s=p?e.features[n].geometry:f?e.geometry:e,u=p?e.features[n].properties:f?e.properties:{},c=p?e.features[n].bbox:f?e.bbox:void 0,h=p?e.features[n].id:f?e.id:void 0,a=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=l?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(o,d,u,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===t(o.geometries[r],d,u,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,d,u,c,h))return!1;d++}}function Za(e,t){qa(e,function(e,n,r,i,o){var a,s=null===e?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return!1!==t(Ha.feature(e,r,{bbox:i,id:o}),n,0)&&void 0}switch(s){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l<e.coordinates.length;l++){var u={type:a,coordinates:e.coordinates[l]};if(!1===t(Ha.feature(u,r),n,l))return!1}})}function Ya(e,t){Za(e,function(e,n,r){var i=0;if(e.geometry){var o=e.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var a,s=0,l=0,u=0;return!1!==Ga(e,function(o,c,h,d,p){if(void 0===a||n>s||d>l||p>u)return a=o,s=n,l=d,u=p,void(i=0);var f=Ha.lineString([a,o],e.properties);if(!1===t(f,n,r,p,i))return!1;i++,a=o})&&void 0}}})}function $a(e,t){if(!e)throw new Error("geojson is required");Za(e,function(e,n,r){if(null!==e.geometry){var i=e.geometry.type,o=e.geometry.coordinates;switch(i){case"LineString":if(!1===t(e,n,r,0,0))return!1;break;case"Polygon":for(var a=0;a<o.length;a++)if(!1===t(Ha.lineString(o[a],e.properties),n,r,a))return!1}}})}Ua.coordAll=function(e){var t=[];return Ga(e,function(e){t.push(e)}),t},Ua.coordEach=Ga,Ua.coordReduce=function(e,t,n,r){var i=n;return Ga(e,function(e,r,o,a,s){i=0===r&&void 0===n?e:t(i,e,r,o,a,s)},r),i},Ua.featureEach=Va,Ua.featureReduce=function(e,t,n){var r=n;return Va(e,function(e,i){r=0===i&&void 0===n?e:t(r,e,i)}),r},Ua.findPoint=function(e,t){if(t=t||{},!Ha.isObject(t))throw new Error("options is invalid");var n,r=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,a=t.coordIndex||0,s=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,n=e.features[r].geometry;break;case"Feature":s=s||e.properties,n=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=e;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":return Ha.point(l,s,t);case"MultiPoint":return i<0&&(i=l.length+i),Ha.point(l[i],s,t);case"LineString":return a<0&&(a=l.length+a),Ha.point(l[a],s,t);case"Polygon":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a),Ha.point(l[o][a],s,t);case"MultiLineString":return i<0&&(i=l.length+i),a<0&&(a=l[i].length+a),Ha.point(l[i][a],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),a<0&&(a=l[i][o].length-a),Ha.point(l[i][o][a],s,t)}throw new Error("geojson is invalid")},Ua.findSegment=function(e,t){if(t=t||{},!Ha.isObject(t))throw new Error("options is invalid");var n,r=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,a=t.segmentIndex||0,s=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,n=e.features[r].geometry;break;case"Feature":s=s||e.properties,n=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=e;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=l.length+a-1),Ha.lineString([l[a],l[a+1]],s,t);case"Polygon":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a-1),Ha.lineString([l[o][a],l[o][a+1]],s,t);case"MultiLineString":return i<0&&(i=l.length+i),a<0&&(a=l[i].length+a-1),Ha.lineString([l[i][a],l[i][a+1]],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),a<0&&(a=l[i][o].length-a-1),Ha.lineString([l[i][o][a],l[i][o][a+1]],s,t)}throw new Error("geojson is invalid")},Ua.flattenEach=Za,Ua.flattenReduce=function(e,t,n){var r=n;return Za(e,function(e,i,o){r=0===i&&0===o&&void 0===n?e:t(r,e,i,o)}),r},Ua.geomEach=qa,Ua.geomReduce=function(e,t,n){var r=n;return qa(e,function(e,i,o,a,s){r=0===i&&void 0===n?e:t(r,e,i,o,a,s)}),r},Ua.lineEach=$a,Ua.lineReduce=function(e,t,n){var r=n;return $a(e,function(e,i,o,a){r=0===i&&void 0===n?e:t(r,e,i,o,a)}),r},Ua.propEach=Wa,Ua.propReduce=function(e,t,n){var r=n;return Wa(e,function(e,i){r=0===i&&void 0===n?e:t(r,e,i)}),r},Ua.segmentEach=Ya,Ua.segmentReduce=function(e,t,n){var r=n,i=!1;return Ya(e,function(e,o,a,s,l){r=!1===i&&void 0===n?e:t(r,e,o,a,s,l),i=!0}),r};var Ja={},Ka={},Xa={};!function(e){function t(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function n(e,n,r){if(void 0===r&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!d(e[0])||!d(e[1]))throw new Error("coordinates must contain numbers");return t({type:"Point",coordinates:e},n,r)}function r(e,n,r){void 0===r&&(r={});for(var i=0,o=e;i<o.length;i++){var a=o[i];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw new Error("First and last Position are not equivalent.")}return t({type:"Polygon",coordinates:e},n,r)}function i(e,n,r){if(void 0===r&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return t({type:"LineString",coordinates:e},n,r)}function o(e,t){void 0===t&&(t={});var n={type:"FeatureCollection"};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}function a(e,n,r){return void 0===r&&(r={}),t({type:"MultiLineString",coordinates:e},n,r)}function s(e,n,r){return void 0===r&&(r={}),t({type:"MultiPoint",coordinates:e},n,r)}function l(e,n,r){return void 0===r&&(r={}),t({type:"MultiPolygon",coordinates:e},n,r)}function u(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t*r}function c(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t/r}function h(e){return 180*(e%(2*Math.PI))/Math.PI}function d(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.earthRadius=6371008.8,e.factors={centimeters:100*e.earthRadius,centimetres:100*e.earthRadius,degrees:e.earthRadius/111325,feet:3.28084*e.earthRadius,inches:39.37*e.earthRadius,kilometers:e.earthRadius/1e3,kilometres:e.earthRadius/1e3,meters:e.earthRadius,metres:e.earthRadius,miles:e.earthRadius/1609.344,millimeters:1e3*e.earthRadius,millimetres:1e3*e.earthRadius,nauticalmiles:e.earthRadius/1852,radians:1,yards:1.0936*e.earthRadius},e.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/e.earthRadius,yards:1.0936133},e.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},e.feature=t,e.geometry=function(e,t,o){switch(e){case"Point":return n(t).geometry;case"LineString":return i(t).geometry;case"Polygon":return r(t).geometry;case"MultiPoint":return s(t).geometry;case"MultiLineString":return a(t).geometry;case"MultiPolygon":return l(t).geometry;default:throw new Error(e+" is invalid")}},e.point=n,e.points=function(e,t,r){return void 0===r&&(r={}),o(e.map(function(e){return n(e,t)}),r)},e.polygon=r,e.polygons=function(e,t,n){return void 0===n&&(n={}),o(e.map(function(e){return r(e,t)}),n)},e.lineString=i,e.lineStrings=function(e,t,n){return void 0===n&&(n={}),o(e.map(function(e){return i(e,t)}),n)},e.featureCollection=o,e.multiLineString=a,e.multiPoint=s,e.multiPolygon=l,e.geometryCollection=function(e,n,r){return void 0===r&&(r={}),t({type:"GeometryCollection",geometries:e},n,r)},e.round=function(e,t){if(void 0===t&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,t||0);return Math.round(e*n)/n},e.radiansToLength=u,e.lengthToRadians=c,e.lengthToDegrees=function(e,t){return h(c(e,t))},e.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},e.radiansToDegrees=h,e.degreesToRadians=function(e){return e%360*Math.PI/180},e.convertLength=function(e,t,n){if(void 0===t&&(t="kilometers"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("length must be a positive number");return u(c(e,t),n)},e.convertArea=function(t,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=e.areaFactors[n];if(!i)throw new Error("invalid original units");var o=e.areaFactors[r];if(!o)throw new Error("invalid final units");return t/i*o},e.isNumber=d,e.isObject=function(e){return!!e&&e.constructor===Object},e.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(e){if(!d(e))throw new Error("bbox must only contain numbers")})},e.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}}(Xa),Object.defineProperty(Ka,"__esModule",{value:!0});var Qa=Xa;function es(e,t,n){if(null!==e)for(var r,i,o,a,s,l,u,c,h=0,d=0,p=e.type,f="FeatureCollection"===p,g="Feature"===p,m=f?e.features.length:1,v=0;v<m;v++){s=(c=!!(u=f?e.features[v].geometry:g?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var y=0;y<s;y++){var w=0,b=0;if(null!==(a=c?u.geometries[y]:u)){l=a.coordinates;var _=a.type;switch(h=!n||"Polygon"!==_&&"MultiPolygon"!==_?0:1,_){case null:break;case"Point":if(!1===t(l,d,v,w,b))return!1;d++,w++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],d,v,w,b))return!1;d++,"MultiPoint"===_&&w++}"LineString"===_&&w++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-h;i++){if(!1===t(l[r][i],d,v,w,b))return!1;d++}"MultiLineString"===_&&w++,"Polygon"===_&&b++}"Polygon"===_&&w++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(b=0,i=0;i<l[r].length;i++){for(o=0;o<l[r][i].length-h;o++){if(!1===t(l[r][i][o],d,v,w,b))return!1;d++}b++}w++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===es(a.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function ts(e,t){var n;switch(e.type){case"FeatureCollection":for(n=0;n<e.features.length&&!1!==t(e.features[n].properties,n);n++);break;case"Feature":t(e.properties,0)}}function ns(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var n=0;n<e.features.length&&!1!==t(e.features[n],n);n++);}function rs(e,t){var n,r,i,o,a,s,l,u,c,h,d=0,p="FeatureCollection"===e.type,f="Feature"===e.type,g=p?e.features.length:1;for(n=0;n<g;n++){for(s=p?e.features[n].geometry:f?e.geometry:e,u=p?e.features[n].properties:f?e.properties:{},c=p?e.features[n].bbox:f?e.bbox:void 0,h=p?e.features[n].id:f?e.id:void 0,a=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=l?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(o,d,u,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===t(o.geometries[r],d,u,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,d,u,c,h))return!1;d++}}function is(e,t){rs(e,function(e,n,r,i,o){var a,s=null===e?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return!1!==t(Qa.feature(e,r,{bbox:i,id:o}),n,0)&&void 0}switch(s){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l<e.coordinates.length;l++){var u={type:a,coordinates:e.coordinates[l]};if(!1===t(Qa.feature(u,r),n,l))return!1}})}function os(e,t){is(e,function(e,n,r){var i=0;if(e.geometry){var o=e.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var a,s=0,l=0,u=0;return!1!==es(e,function(o,c,h,d,p){if(void 0===a||n>s||d>l||p>u)return a=o,s=n,l=d,u=p,void(i=0);var f=Qa.lineString([a,o],e.properties);if(!1===t(f,n,r,p,i))return!1;i++,a=o})&&void 0}}})}function as(e,t){if(!e)throw new Error("geojson is required");is(e,function(e,n,r){if(null!==e.geometry){var i=e.geometry.type,o=e.geometry.coordinates;switch(i){case"LineString":if(!1===t(e,n,r,0,0))return!1;break;case"Polygon":for(var a=0;a<o.length;a++)if(!1===t(Qa.lineString(o[a],e.properties),n,r,a))return!1}}})}Ka.coordAll=function(e){var t=[];return es(e,function(e){t.push(e)}),t},Ka.coordEach=es,Ka.coordReduce=function(e,t,n,r){var i=n;return es(e,function(e,r,o,a,s){i=0===r&&void 0===n?e:t(i,e,r,o,a,s)},r),i},Ka.featureEach=ns,Ka.featureReduce=function(e,t,n){var r=n;return ns(e,function(e,i){r=0===i&&void 0===n?e:t(r,e,i)}),r},Ka.findPoint=function(e,t){if(t=t||{},!Qa.isObject(t))throw new Error("options is invalid");var n,r=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,a=t.coordIndex||0,s=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,n=e.features[r].geometry;break;case"Feature":s=s||e.properties,n=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=e;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":return Qa.point(l,s,t);case"MultiPoint":return i<0&&(i=l.length+i),Qa.point(l[i],s,t);case"LineString":return a<0&&(a=l.length+a),Qa.point(l[a],s,t);case"Polygon":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a),Qa.point(l[o][a],s,t);case"MultiLineString":return i<0&&(i=l.length+i),a<0&&(a=l[i].length+a),Qa.point(l[i][a],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),a<0&&(a=l[i][o].length-a),Qa.point(l[i][o][a],s,t)}throw new Error("geojson is invalid")},Ka.findSegment=function(e,t){if(t=t||{},!Qa.isObject(t))throw new Error("options is invalid");var n,r=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,a=t.segmentIndex||0,s=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,n=e.features[r].geometry;break;case"Feature":s=s||e.properties,n=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=e;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=l.length+a-1),Qa.lineString([l[a],l[a+1]],s,t);case"Polygon":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a-1),Qa.lineString([l[o][a],l[o][a+1]],s,t);case"MultiLineString":return i<0&&(i=l.length+i),a<0&&(a=l[i].length+a-1),Qa.lineString([l[i][a],l[i][a+1]],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),a<0&&(a=l[i][o].length-a-1),Qa.lineString([l[i][o][a],l[i][o][a+1]],s,t)}throw new Error("geojson is invalid")},Ka.flattenEach=is,Ka.flattenReduce=function(e,t,n){var r=n;return is(e,function(e,i,o){r=0===i&&0===o&&void 0===n?e:t(r,e,i,o)}),r},Ka.geomEach=rs,Ka.geomReduce=function(e,t,n){var r=n;return rs(e,function(e,i,o,a,s){r=0===i&&void 0===n?e:t(r,e,i,o,a,s)}),r},Ka.lineEach=as,Ka.lineReduce=function(e,t,n){var r=n;return as(e,function(e,i,o,a){r=0===i&&void 0===n?e:t(r,e,i,o,a)}),r},Ka.propEach=ts,Ka.propReduce=function(e,t,n){var r=n;return ts(e,function(e,i){r=0===i&&void 0===n?e:t(r,e,i)}),r},Ka.segmentEach=os,Ka.segmentReduce=function(e,t,n){var r=n,i=!1;return os(e,function(e,o,a,s,l){r=!1===i&&void 0===n?e:t(r,e,o,a,s,l),i=!0}),r},Object.defineProperty(Ja,"__esModule",{value:!0});var ss=Ka;function ls(e){var t=[1/0,1/0,-1/0,-1/0];return ss.coordEach(e,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}ls.default=ls,Ja.default=ls;var us=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const n=[];if(!ja(e,t))return n;const r=this.toBBox,i=[];for(;t;){for(let o=0;o<t.children.length;o++){const a=t.children[o],s=t.leaf?r(a):a;ja(e,s)&&(t.leaf?n.push(a):Na(e,s)?this._all(a,n):i.push(a))}t=i.pop()}return n}collides(e){let t=this.data;if(!ja(e,t))return!1;const n=[];for(;t;){for(let r=0;r<t.children.length;r++){const i=t.children[r],o=t.leaf?this.toBBox(i):i;if(ja(e,o)){if(t.leaf||Na(e,o))return!0;n.push(i)}}t=n.pop()}return!1}load(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(let t=0;t<e.length;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}else this.data=t;return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=Ia([]),this}remove(e,t){if(!e)return this;let n=this.data;const r=this.toBBox(e),i=[],o=[];let a,s,l;for(;n||i.length;){if(n||(n=i.pop(),s=i[i.length-1],a=o.pop(),l=!0),n.leaf){const r=Ma(e,n.children,t);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}l||n.leaf||!Na(n,r)?s?(a++,n=s.children[a],l=!1):n=null:(i.push(n),o.push(a),a=0,s=n,n=n.children[0])}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){const n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,r){const i=n-t+1;let o,a=this._maxEntries;if(i<=a)return o=Ia(e.slice(t,n+1)),Ca(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,r-1))),o=Ia([]),o.leaf=!1,o.height=r;const s=Math.ceil(i/a),l=s*Math.ceil(Math.sqrt(a));za(e,t,n,l,this.compareMinX);for(let i=t;i<=n;i+=l){const t=Math.min(i+l-1,n);za(e,i,t,s,this.compareMinY);for(let n=i;n<=t;n+=s){const i=Math.min(n+s-1,t);o.children.push(this._build(e,n,i,r-1))}}return Ca(o,this.toBBox),o}_chooseSubtree(e,t,n,r){for(;r.push(t),!t.leaf&&r.length-1!==n;){let n,r=1/0,i=1/0;for(let o=0;o<t.children.length;o++){const a=t.children[o],s=Ra(a),l=Fa(e,a)-s;l<i?(i=l,r=s<r?s:r,n=a):l===i&&s<r&&(r=s,n=a)}t=n||t.children[0]}return t}_insert(e,t,n){const r=n?e:this.toBBox(e),i=[],o=this._chooseSubtree(r,this.data,t,i);for(o.children.push(e),Ea(o,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){const n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),a=Ia(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,Ca(n,this.toBBox),Ca(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(n,a)}_splitRoot(e,t){this.data=Ia([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Ca(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,o=1/0;for(let a=t;a<=n-t;a++){const t=ka(e,0,a,this.toBBox),s=ka(e,a,n,this.toBBox),l=Oa(t,s),u=Ra(t)+Ra(s);l<i?(i=l,r=a,o=u<o?u:o):l===i&&u<o&&(o=u,r=a)}return r||n-t}_chooseSplitAxis(e,t,n){const r=e.leaf?this.compareMinX:Ta,i=e.leaf?this.compareMinY:La;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);const i=this.toBBox,o=ka(e,0,t,i),a=ka(e,n-t,n,i);let s=Da(o)+Da(a);for(let r=t;r<n-t;r++){const t=e.children[r];Ea(o,e.leaf?i(t):t),s+=Da(o)}for(let r=n-t-1;r>=t;r--){const t=e.children[r];Ea(a,e.leaf?i(t):t),s+=Da(a)}return s}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)Ea(t[r],e)}_condense(e){for(let t,n=e.length-1;n>=0;n--)0===e[n].children.length?n>0?(t=e[n-1].children,t.splice(t.indexOf(e[n]),1)):this.clear():Ca(e[n],this.toBBox)}},cs=Ba,hs=Ua,ds=Ja.default,ps=hs.featureEach;hs.coordEach;var fs=cs.featureCollection;function gs(e){var t=new us(e);return t.insert=function(e){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:ds(e),us.prototype.insert.call(this,e)},t.load=function(e){var t=[];return Array.isArray(e)?e.forEach(function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox?e.bbox:ds(e),t.push(e)}):ps(e,function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox?e.bbox:ds(e),t.push(e)}),us.prototype.load.call(this,t)},t.remove=function(e,t){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:ds(e),us.prototype.remove.call(this,e,t)},t.clear=function(){return us.prototype.clear.call(this)},t.search=function(e){var t=us.prototype.search.call(this,this.toBBox(e));return fs(t)},t.collides=function(e){return us.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=us.prototype.all.call(this);return fs(e)},t.toJSON=function(){return us.prototype.toJSON.call(this)},t.fromJSON=function(e){return us.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var t;if(e.bbox)t=e.bbox;else if(Array.isArray(e)&&4===e.length)t=e;else if(Array.isArray(e)&&6===e.length)t=[e[0],e[1],e[3],e[4]];else if("Feature"===e.type)t=ds(e);else{if("FeatureCollection"!==e.type)throw new Error("invalid geojson");t=ds(e)}return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},t}function ms(e,t){var n={},r=[];if("LineString"===e.type&&(e=ha(e)),"LineString"===t.type&&(t=ha(t)),"Feature"===e.type&&"Feature"===t.type&&null!==e.geometry&&null!==t.geometry&&"LineString"===e.geometry.type&&"LineString"===t.geometry.type&&2===e.geometry.coordinates.length&&2===t.geometry.coordinates.length){var i=vs(e,t);return i&&r.push(i),da(r)}var o=ba();return o.load(ya(t)),wa(ya(e),function(e){wa(o.search(e),function(t){var i=vs(e,t);if(i){var o=fa(i).join(",");n[o]||(n[o]=!0,r.push(i))}})}),da(r)}function vs(e,t){var n=fa(e),r=fa(t);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==r.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=n[0][0],o=n[0][1],a=n[1][0],s=n[1][1],l=r[0][0],u=r[0][1],c=r[1][0],h=r[1][1],d=(h-u)*(a-i)-(c-l)*(s-o),p=(c-l)*(o-u)-(h-u)*(i-l),f=(a-i)*(o-u)-(s-o)*(i-l);if(0===d)return null;var g=p/d,m=f/d;return g>=0&&g<=1&&m>=0&&m<=1?function(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!pa(e[0])||!pa(e[1]))throw new Error("coordinates must contain numbers");return ha({type:"Point",coordinates:e},t,n)}([i+g*(a-i),o+g*(s-o)]):null}function ys(e,t,n){if(null!==e)for(var r,i,o,a,s,l,u,c,h=0,d=0,p=e.type,f="FeatureCollection"===p,g="Feature"===p,m=f?e.features.length:1,v=0;v<m;v++){s=(c=!!(u=f?e.features[v].geometry:g?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var y=0;y<s;y++){var w=0,b=0;if(null!==(a=c?u.geometries[y]:u)){l=a.coordinates;var _=a.type;switch(h=!n||"Polygon"!==_&&"MultiPolygon"!==_?0:1,_){case null:break;case"Point":if(!1===t(l,d,v,w,b))return!1;d++,w++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],d,v,w,b))return!1;d++,"MultiPoint"===_&&w++}"LineString"===_&&w++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-h;i++){if(!1===t(l[r][i],d,v,w,b))return!1;d++}"MultiLineString"===_&&w++,"Polygon"===_&&b++}"Polygon"===_&&w++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(b=0,i=0;i<l[r].length;i++){for(o=0;o<l[r][i].length-h;o++){if(!1===t(l[r][i][o],d,v,w,b))return!1;d++}b++}w++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===ys(a.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function ws(e,t){!function(e,t){var n,r,i,o,a,s,l,u,c,h,d=0,p="FeatureCollection"===e.type,f="Feature"===e.type,g=p?e.features.length:1;for(n=0;n<g;n++){for(s=p?e.features[n].geometry:f?e.geometry:e,u=p?e.features[n].properties:f?e.properties:{},c=p?e.features[n].bbox:f?e.bbox:void 0,h=p?e.features[n].id:f?e.id:void 0,a=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=l?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(o,d,u,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===t(o.geometries[r],d,u,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,d,u,c,h))return!1;d++}}(e,function(e,n,r,i,o){var a,s=null===e?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return!1!==t(me(e,r,{bbox:i,id:o}),n,0)&&void 0}switch(s){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l<e.coordinates.length;l++){var u=e.coordinates[l];if(!1===t(me({type:a,coordinates:u},r),n,l))return!1}})}function bs(e,t,n){var r=n,i=!1;return function(e,t){ws(e,function(e,n,r){var i=0;if(e.geometry){var o=e.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var a,s=0,l=0,u=0;return!1!==ys(e,function(o,c,h,d,p){if(void 0===a||n>s||d>l||p>u)return a=o,s=n,l=d,u=p,void(i=0);var f=ye([a,o],e.properties);if(!1===t(f,n,r,p,i))return!1;i++,a=o})&&void 0}}})}(e,function(e,o,a,s,l){r=!1===i&&void 0===n?e:t(r,e,o,a,s,l),i=!0}),r}function _s(e,t,n){void 0===n&&(n={});var r=ve([1/0,1/0],{dist:1/0}),i=0;return ws(e,function(e){for(var o=ea(e),a=0;a<o.length-1;a++){var s=ve(o[a]);s.properties.dist=ta(t,s,n);var l=ve(o[a+1]);l.properties.dist=ta(t,l,n);var u=ta(s,l,n),c=Math.max(s.properties.dist,l.properties.dist),h=ia(s,l),d=ca(t,c,h+90,n),p=ca(t,c,h-90,n),f=ms(ye([d.geometry.coordinates,p.geometry.coordinates]),ye([s.geometry.coordinates,l.geometry.coordinates])),g=null;f.features.length>0&&((g=f.features[0]).properties.dist=ta(t,g,n),g.properties.location=i+ta(s,g,n)),s.properties.dist<r.properties.dist&&((r=s).properties.index=a,r.properties.location=i),l.properties.dist<r.properties.dist&&((r=l).properties.index=a+1,r.properties.location=i+u),g&&g.properties.dist<r.properties.dist&&((r=g).properties.index=a),i+=u}}),r}function xs(e,t){return void 0===t&&(t={}),bs(e,function(e,n){var r=n.geometry.coordinates;return e+ta(r[0],r[1],t)},0)}_a.exports=gs,ba.default=gs;var Ss=function(){function e(){return G(this,e),H(this,e,arguments)}return Y(e,Xo),V(e,[{key:"onInitialState",value:function(e){return{fullRoute:e.map(function(e){return[e[0],e[1]]}),end:{from:0}}}},{key:"onGetValue",value:function(e){return e.actRoute||e.fullRoute}},{key:"onCalculate",value:function(e,t){var n,r=e.fullRoute,i=e.end;if(t>.5){var o=2*(t-.5);n=i.from*(1-o)+o*i.to}else{var a=2*t;n=i.from*(1-a)+a*i.to}for(var s=0,l=0,u=r.length-1;l<n&&u>0;)s=l,l+=ta(ve(r[u]),ve(r[u-1])),u-=1;if(t>.5){var c=(n-s)/(l-s),h=1-c,d=[].concat(Q(r.slice(0,u+1)),[[r[u][0]*c+r[u+1][0]*h,r[u][1]*c+r[u+1][1]*h]]);return{fullRoute:r,end:K(K({},i),{},{current:n}),actRoute:d}}if(l<=n){var p=Q(r.slice(r.length-2,r.length));return{fullRoute:r,end:K(K({},i),{},{current:n}),actRoute:p}}var f=(n-s)/(l-s),g=1-f,m=[[r[u][0]*f+r[u+1][0]*g,r[u][1]*f+r[u+1][1]*g]].concat(Q(r.slice(u+1,r.length)));return{fullRoute:r,end:K(K({},i),{},{current:n}),actRoute:m}}},{key:"onStart",value:function(e,t){var n,r=e.fullRoute,i=e.end;if(t.end.point){var o=ye(r),a=_s(o,t.end.point);n=xs(o)-a.properties.location}else console.warn("RouteCoordinatesArray: toValue.end: should have either along or point");return{fullRoute:r,end:K(K({},i),{},{from:null!=i.current?i.current:i.from,to:n})}}},{key:"originalRoute",get:function(){return this.state.fullRoute}}])}(),As=["match",["get","isNonHighlightedOverview"],"1","#A7A6BA","0",["match",["get","zone"],"transit","#4F7EF8","public","#CF9FFF","#CF9FFF"],["match",["get","zone"],"transit","#4F7EF8","public","#CF9FFF","#CF9FFF"]],Ps=["match",["get","isNonHighlightedOverview"],"1",.4,"0",1,1],Ms=[{id:"route-line-outline-inactive",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!1]],paint:{"line-color":"#FFFFFF","line-gap-width":6},layout:{"line-cap":"round","line-join":"round"}},{id:"route-line-inactive",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!1]],style:{lineCap:"round",lineJoin:"round",lineColor:As,lineWidth:5},paint:{"line-color":As,"line-width":5,"line-opacity":Ps},layout:{"line-cap":"round","line-join":"round"},belowLayerID:"route-line-animate"},{id:"route-line-active",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!0]],style:{lineCap:"round",lineJoin:"round",lineColor:As,lineWidth:6},paint:{"line-color":As,"line-width":6,"line-opacity":Ps},layout:{"line-cap":"round","line-join":"round"},belowLayerID:"route-line-animate"},{id:"route-line-outline-active",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!0]],style:{lineCap:"round",lineJoin:"round",lineColor:"#FFFFFF",lineGapWidth:6},paint:{"line-color":"#FFFFFF","line-gap-width":6,"line-opacity":Ps},layout:{"line-cap":"round","line-join":"round"}},{id:"route-line-endpoint-active",type:"circle",filter:["all",["==",["geometry-type"],"Point"],["==",["get","highlight"],!0],["==",["get","isNode"],!0]],style:{circleRadius:2,circleOpacity:0,circleStrokeWidth:2,circleStrokeColor:"#FFFFFF",circleStrokeOpacity:.7},paint:{"circle-radius":2,"circle-opacity":0,"circle-stroke-width":2,"circle-stroke-color":"#FFFFFF","circle-stroke-opacity":.7}},{id:"route-line-endpoint-fill-active",type:"circle",filter:["all",["==",["geometry-type"],"Point"],["==",["get","highlight"],!0],["==",["get","isNode"],!0]],style:{circleRadius:2,circleColor:"#FFFFFF",circleOpacity:.7},paint:{"circle-color":"#FFFFFF","circle-radius":2,"circle-opacity":.7}}],Cs=[{id:"route-line-animate",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!0]],style:{lineCap:"round",lineJoin:"round",lineColor:"#FFFFFF",lineOpacity:.7,lineWidth:4},paint:{"line-color":"#FFFFFF","line-width":4,"line-opacity":.7},layout:{"line-cap":"round","line-join":"round"},isAnimationLayer:!0}];var ks,Es={};function Ts(e){var t=e.children,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["children"]);return j(j({},n),{name:e.name,taxonomyPath:e.taxonomyPath,children:(null!=t?t:[]).map(Ts)})}function Ls(e,t){if(e.taxonomyPath){var n=t.get(e.taxonomyPath);n&&(e.altMin=n.altMin,e.altMax=n.altMax,n.timestamp&&(e.altitudeTimestamp=n.timestamp))}for(var r=0,i=function(e){var t;return null!==(t=e.children)&&void 0!==t?t:[]}(e);r<i.length;r++){Ls(i[r],t)}}function Rs(e,t){if(!t||"object"!==te(t))return e;var n=function(e){for(var t=new Map,n=0,r=Object.keys(e);n<r.length;n++){var i=e[r[n]];if(i&&"object"===te(i))for(var o=0,a=Object.keys(i);o<a.length;o++){var s=i[a[o]];null!=(null==s?void 0:s.floorTaxonomyPath)&&"number"==typeof s.altMin&&"number"==typeof s.altMax&&t.set(s.floorTaxonomyPath,{altMin:s.altMin,altMax:s.altMax,timestamp:s.timestamp})}}return t}(t);if(0===n.size)return e;var r=JSON.parse(JSON.stringify(e));for(var i in r){var o=r[i];(null==o?void 0:o.taxonomyPath)&&Ls(o,n)}return r}function Ds(e,t){if(!e||"object"!==te(e)||0===Object.keys(e).length)return console.error("[focus-core] Focus tree data is missing or empty"),void(Es={});var n=function(e){var t={};return Object.keys(e).forEach(function(n){var r=e[n];(null==r?void 0:r.taxonomyPath)&&(t[n]=Ts(r))}),t}(e);t&&(n=Rs(n,t)),Es=n}function Fs(){return Es}function Os(e){var t;return null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]}function Ns(e){return 0===Os(e).length}function js(e,t,n,r,i){if(void 0===r&&(r=0),void 0===i&&(i=null),n)return t(n,r,i),void Os(n).forEach(function(i){return js(e,t,i,r+1,n)});for(var o in e){var a=e[o];(null==a?void 0:a.taxonomyPath)&&js(e,t,a,0,null)}}function Is(){var e=Fs(),t=[];for(var n in e){var r=e[n];(null==r?void 0:r.taxonomyPath)&&t.push(r)}return t}function zs(e){if(!e)return null;var t=null;return js(Fs(),function(n){n.taxonomyPath===e&&(t=n)}),t}function Bs(e){if(!zs(e))return[];for(var t=[],n=e;;){var r=Us(n);if(!r)break;t.unshift(r),n=r.taxonomyPath}return t}function Us(e){if(!e)return null;var t=null;return js(Fs(),function(n){Os(n).some(function(t){return t.taxonomyPath===e})&&(t=n)}),t}function Hs(e,t){if(t<0)return[];if(null===e||""===e)return 0===t?Is():Is().flatMap(function(e){return Hs(e.taxonomyPath,t)});var n=zs(e);return n?0===t?[n]:1===t?Os(n):Os(n).flatMap(function(e){return Hs(e.taxonomyPath,t-1)}):[]}function Gs(e){var t=zs(e);if(!t)return 0;var n=Os(t);return 0===n.length?0:1+Math.max.apply(Math,n.map(function(e){return Gs(e.taxonomyPath)}))}function Ws(e){var t=Os(e);return 0===t.length?e.taxonomyPath?[e.taxonomyPath]:[]:t.flatMap(function(e){return Ws(e)})}!function(e){e.Name="title",e.LocalRef="localRef",e.WhatTaxonomy="dimension_what"}(ks||(ks={}));var Vs=["Aerodrome","Aerodrome names","Aerobridge","Aerobridge gates","Airplanes","Airplanes outline","Building icon","Building overlay","Building overlay outline","Building underlay","Building underlay icon","Building underlay selected outline","building_outline","Changi Airport Connector","Changi Airport Connector Text","Changi Walkway Text","T2 overlay outline copy","Building overlay base","Skytrain track outdoor"];function qs(e){var t=[e],n=zs(e);if(n){var r=Ws(n);t=r.length>0&&!Ns(n)?r:(Ns(n),[n.taxonomyPath])}return t}function Zs(e,t){var n=e.filter;if("openmaptiles"!==e.source&&n){for(var r=!1,i=0;i<n.length;i+=1){var o=n[i];if(Array.isArray(o[1])&&"dimension_where"===o[1][1]){o[0]="in",o[2]=["literal",t],r=!0;break}}r||n.push(["in",["get","dimension_where"],["literal",t]])}}function Ys(e,t,n,r){function i(e,t){var n=t.filter(function(t){return!e.includes(t)});return e.push.apply(e,n),e}return function e(o){if(Array.isArray(o)&&"match"===o[0]){var a=B([],o,!0);return Array.isArray(a[1])&&a[1][1]===t?function(e,t){for(var o=3;o<t.length;o+=2){if(e[o]===r){var a=i(e[o-1],n);return void(e[o-1]=a)}o+2===t.length&&e.splice(o+1,0,n,r)}}(a,o):a[a.length-1]=e(a[a.length-1]),a}return["match",["get",t],n,r,o]}(e)}function $s(e,t,n){return function e(r){if(Array.isArray(r)&&"match"===r[0]){var i=B([],r,!0);return Array.isArray(i[1])&&i[1][1]===t?n.length>0?function(e,t){for(var r=function(t){Array.isArray(e[t])&&n.forEach(function(n){var r=e[t].indexOf(n);r>-1&&(e[t].length>1?e[t].splice(r,1):e[t]=[""])})},i=2;i<t.length;i+=2)r(i)}(i,r):i=i[i.length-1]:i[i.length-1]=e(i[i.length-1]),i}}(e)}var Js={lineColor:"line-color",lineWidth:"line-width",lineOpacity:"line-opacity",lineGapWidth:"line-gap-width"},Ks=new Set(Ms.filter(function(e){return"line"===e.type}).map(function(e){return e.id})),Xs=new Set(Ms.filter(function(e){return"line"===e.type&&e.id.toLowerCase().includes("outline")}).map(function(e){return e.id})),Qs=function(e,t){var n,r,i=j({},null!==(n=e.style)&&void 0!==n?n:{}),o=j({},null!==(r=e.paint)&&void 0!==r?r:{});return Object.entries(t).forEach(function(e){var t=e[0],n=e[1];i[t]=n;var r=Js[t];r&&(o[r]=n)}),j(j({},e),{style:i,paint:o})},el={line:_,circle:y,symbol:w,fill:x},tl={line:b.LineLayer,circle:b.CircleLayer,symbol:b.SymbolLayer,fill:b.FillLayer},nl=function(e){var t=e.isAnimationLayer?tl[e.type]:el[e.type];return t?l.createElement(t,{key:e.id,id:e.id,style:e.style,filter:e.filter}):(console.warn("Unsupported MapLibre layer type: ".concat(e.type)),null)};function rl(e){var t=e.metaAtlasCoreRef,n=e.triggerRender,r=c({}),o=u(Ms),a=o[0],s=o[1],p=c({type:"FeatureCollection",features:[]}),f=c(null),g=c(Cs),m=c(new Ss([])),y=function(e){m.current.destroy(),m.current=new Ss(e)};h(function(){!function(){if(m.current.__getValue().length>2){var e=ve(m.current.originalRoute[0]);m.current.timing({toValue:{end:{point:e}},duration:2e3,easing:i.linear}).start()}}()},[m.current]),d(e.ref,function(){return Object.assign(r.current,{setDisplayRoute:function(e){f.current=e},getDisplayRoute:function(){return f.current},setPatchFeatures:function(e){p.current=e,n()},setAnimatedCoordinates:function(e){y(e),n()},clear:function(){p.current={type:"FeatureCollection",features:[]},f.current=null,y([]),n()},filterRoutingLayersWhereDimension:function(e){var t=function(e,t){if(t){for(var n=[t],r=0;r<e.length;r+=1)Zs(e[r],n);return e}}($o(a),e);s(t),n()},styleRouteLineLayer:function(e){var t=e.color,r=e.width,i=e.opacity,o=Math.max(r,0),l=Math.min(Math.max(i,0),1),u=a.map(function(e){return Ks.has(e.id)?Xs.has(e.id)?Qs(e,{lineColor:"#FFFFFF",lineGapWidth:o>0?o+1:0,lineOpacity:l}):Qs(e,{lineColor:t,lineWidth:o,lineOpacity:l}):e});s(u),n()}}),r.current},[a,n,t]);var w=a.map(nl).filter(Boolean);return l.createElement(l.Fragment,null,l.createElement(v,{id:"mapPinsSource",data:p.current},w),m.current.__getValue().length>2?l.createElement(b.ShapeSource,{id:"route",data:new b.Shape({type:"LineString",coordinates:m.current})},l.createElement(b.LineLayer,{id:"lineroute",style:g.current[0].style})):null)}var il={id:"43f36e14-e3f5-43c1-84c0-50a9c80dc5c7",name:"MapLibre",layers:[{id:"background",type:"background",paint:{"background-color":"rgb(242,243,240)"}},{id:"building",type:"fill",source:"openmaptiles","source-layer":"building",minzoom:12,paint:{"fill-antialias":!0,"fill-color":"#e0e0e0"}},{id:"aeroway-area",type:"fill",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["==","$type","Polygon"]],layout:{visibility:"visible"},paint:{"fill-color":"rgba(222, 222, 228, 1)"}},{id:"park",type:"fill",source:"openmaptiles","source-layer":"park",filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-color":"rgb(230, 233, 229)"}},{id:"landcover_park",type:"fill",source:"openmaptiles","source-layer":"landcover",filter:["all",["==","subclass","park"]],layout:{visibility:"visible"},paint:{"fill-color":"#c8facc","fill-antialias":!0}},{id:"landcover_grass",type:"fill",source:"openmaptiles","source-layer":"landcover",filter:["all",["==","$type","Polygon"],["==","class","grass"]],layout:{visibility:"visible"},paint:{"fill-color":"#d6dcd6","fill-opacity":1}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["==","$type","Polygon"],["!=","brunnel","tunnel"]],layout:{visibility:"visible"},paint:{"fill-antialias":!0,"fill-color":"rgba(208, 214, 218, 1)","fill-outline-color":{base:1,stops:[[0,"hsla(180, 6%, 63%, 0.82)"],[22,"hsla(180, 6%, 63%, 0.18)"]]}}},{id:"landcover_ice_shelf",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["==","$type","Polygon"],["==","subclass","ice_shelf"]],layout:{visibility:"visible"},paint:{"fill-color":"hsl(0, 0%, 98%)","fill-opacity":.7}},{id:"landcover_glacier",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["==","$type","Polygon"],["==","subclass","glacier"]],layout:{visibility:"visible"},paint:{"fill-color":"hsl(0, 0%, 98%)","fill-opacity":{base:1,stops:[[0,1],[8,.5]]}}},{id:"landuse_residential",type:"fill",source:"openmaptiles","source-layer":"landuse",maxzoom:16,filter:["all",["==","$type","Polygon"],["==","class","residential"]],layout:{visibility:"visible"},paint:{"fill-color":"rgb(234, 234, 230)","fill-opacity":{base:.6,stops:[[8,.8],[9,.6]]}}},{id:"landcover_wood",type:"fill",source:"openmaptiles","source-layer":"landcover",minzoom:10,filter:["all",["==","$type","Polygon"],["==","class","wood"]],layout:{visibility:"visible"},paint:{"fill-color":"rgb(220,224,220)","fill-opacity":{base:1,stops:[[8,0],[12,1]]}}},{id:"water_name",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"symbol-placement":"line","symbol-spacing":500,"text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-rotation-alignment":"map","text-size":12},paint:{"text-color":"rgb(157,169,177)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"tunnel_motorway_casing",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"butt","line-join":"miter",visibility:"visible"},paint:{"line-color":"rgb(213, 213, 213)","line-opacity":1,"line-width":{base:1.4,stops:[[5.8,0],[6,3],[20,40]]}}},{id:"tunnel_motorway_inner",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgb(234,234,234)","line-width":{base:1.4,stops:[[4,2],[6,1.3],[20,30]]}}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(251, 251, 251, 1)","line-opacity":1,"line-width":{base:1.55,stops:[[13,5],[20,20]]}}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"hsl(0, 0%, 88%)","line-opacity":1,"line-width":{base:1.5,stops:[[11,6],[17,55]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-opacity":1,"line-width":{base:1.5,stops:[[11,4],[17,50]]}}},{id:"road_area_pier",type:"fill",metadata:{},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","Polygon"],["==","class","pier"]],layout:{visibility:"visible"},paint:{"fill-antialias":!0,"fill-color":"rgb(242,243,240)"}},{id:"road_pier",type:"line",metadata:{},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["in","class","pier"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#F5f5f5","line-width":{base:1.2,stops:[[15,1],[17,4]]}}},{id:"highway_minor",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:8,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fdfdfd","line-opacity":.9,"line-width":{base:1.55,stops:[[13,1.8],[20,20]]}}},{id:"highway_major_casing",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==","$type","LineString"],["in","class","primary","secondary","tertiary","trunk"]],layout:{"line-cap":"butt","line-join":"miter",visibility:"visible"},paint:{"line-color":"rgb(213, 213, 213)","line-dasharray":[12,0],"line-width":{base:1.3,stops:[[10,3],[20,23]]}}},{id:"highway_major_inner",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==","$type","LineString"],["in","class","primary","secondary","tertiary","trunk"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fff","line-width":{base:1.3,stops:[[10,2],[20,20]]}}},{id:"highway_major_subtle",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",maxzoom:11,filter:["all",["==","$type","LineString"],["in","class","primary","secondary","tertiary","trunk"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 85%, 0.69)","line-width":2}},{id:"highway_motorway_casing",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"butt","line-join":"miter",visibility:"visible"},paint:{"line-color":"rgb(213, 213, 213)","line-dasharray":[2,0],"line-opacity":1,"line-width":{base:1.4,stops:[[5.8,0],[6,3],[20,40]]}}},{id:"highway_motorway_inner",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":{base:1,stops:[[5.8,"hsla(0, 0%, 85%, 0.53)"],[6,"#fff"]]},"line-width":{base:1.4,stops:[[4,2],[6,1.3],[20,30]]}}},{id:"highway_motorway_subtle",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",maxzoom:6,filter:["all",["==","$type","LineString"],["==","class","motorway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 85%, 0.53)","line-width":{base:1.4,stops:[[4,2],[6,1.3]]}}},{id:"railway_transit",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#dddddd","line-width":3}},{id:"railway_transit_dashline",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#fafafa","line-dasharray":[3,3],"line-width":2}},{id:"railway_service",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#dddddd","line-width":3}},{id:"railway_service_dashline",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==","$type","LineString"],["==","class","rail"],["has","service"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#fafafa","line-dasharray":[3,3],"line-width":2}},{id:"railway",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==","$type","LineString"],["all",["!has","service"],["==","class","rail"]]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#dddddd","line-width":{base:1.3,stops:[[16,3],[20,7]]}}},{id:"railway_dashline",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==","$type","LineString"],["all",["!has","service"],["==","class","rail"]]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#fafafa","line-dasharray":[3,3],"line-width":{base:1.3,stops:[[16,2],[20,6]]}}},{id:"highway_motorway_bridge_casing",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","motorway"]]],layout:{"line-cap":"butt","line-join":"miter",visibility:"visible"},paint:{"line-color":"rgb(213, 213, 213)","line-dasharray":[2,0],"line-opacity":1,"line-width":{base:1.4,stops:[[5.8,0],[6,5],[20,45]]}}},{id:"highway_motorway_bridge_inner",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":{base:1,stops:[[5.8,"hsla(0, 0%, 85%, 0.53)"],[6,"#fff"]]},"line-width":{base:1.4,stops:[[4,2],[6,1.3],[20,30]]}}},{id:"highway_name_other",type:"symbol",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation_name",filter:["all",["!=","class","motorway"],["==","$type","LineString"]],layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":"{name:latin} {name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-max-angle":30,"text-pitch-alignment":"viewport","text-rotation-alignment":"map","text-size":10,"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":"#bbb","text-halo-blur":1,"text-halo-color":"#fff","text-halo-width":2,"text-translate":[0,0]}},{id:"highway_name_motorway",type:"symbol",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation_name",filter:["all",["==","$type","LineString"],["==","class","motorway"]],layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":"{ref}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-pitch-alignment":"viewport","text-rotation-alignment":"viewport","text-size":10,visibility:"visible"},paint:{"text-color":"rgb(117, 129, 145)","text-halo-blur":1,"text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":1,"text-translate":[0,2]}},{id:"boundary_state",type:"line",metadata:{"mapbox:group":"a14c9607bc7954ba1df7205bf660433f"},source:"openmaptiles","source-layer":"boundary",filter:["==","admin_level",4],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-blur":.4,"line-color":"rgb(230, 204, 207)","line-dasharray":[2,2],"line-opacity":1,"line-width":{base:1.3,stops:[[3,1],[22,15]]}}},{id:"boundary_country_z0-4",type:"line",metadata:{"mapbox:group":"a14c9607bc7954ba1df7205bf660433f"},source:"openmaptiles","source-layer":"boundary",maxzoom:5,filter:["all",["==","admin_level",2],["!has","claimed_by"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-blur":{base:1,stops:[[0,.4],[22,4]]},"line-color":"rgb(230, 204, 207)","line-opacity":1,"line-width":{base:1.1,stops:[[3,1],[22,20]]}}},{id:"boundary_country_z5-",type:"line",metadata:{"mapbox:group":"a14c9607bc7954ba1df7205bf660433f"},source:"openmaptiles","source-layer":"boundary",minzoom:5,filter:["==","admin_level",2],layout:{"line-cap":"round","line-join":"round"},paint:{"line-blur":{base:1,stops:[[0,.4],[22,4]]},"line-color":"rgb(230, 204, 207)","line-opacity":1,"line-width":{base:1.1,stops:[[3,1],[22,20]]}}},{id:"place_other",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:14,filter:["all",["in","class","continent","hamlet","neighbourhood","isolated_dwelling"],["==","$type","Point"]],layout:{"text-anchor":"center","text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-justify":"center","text-offset":[.5,0],"text-size":10,"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":"rgb(117, 129, 145)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"place_suburb",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:15,filter:["all",["==","$type","Point"],["==","class","suburb"]],layout:{"text-anchor":"center","text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-justify":"center","text-offset":[.5,0],"text-size":10,"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":"rgb(117, 129, 145)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"place_village",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:14,filter:["all",["==","$type","Point"],["==","class","village"]],layout:{"icon-size":.4,"text-anchor":"left","text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-justify":"left","text-offset":[.5,.2],"text-size":10,"text-transform":"uppercase",visibility:"visible"},paint:{"icon-opacity":.7,"text-color":"rgb(117, 129, 145)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"place_town",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:15,filter:["all",["==","$type","Point"],["==","class","town"]],layout:{"text-anchor":{base:1,stops:[[0,"left"],[8,"center"]]},"text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-justify":"left","text-size":10,"text-transform":"uppercase",visibility:"visible"},paint:{"icon-opacity":.7,"text-color":"rgb(117, 129, 145)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"place_city",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:14,filter:["all",["==","$type","Point"],["all",["!=","capital",2],["==","class","city"],[">","rank",3]]],layout:{"text-anchor":{base:1,stops:[[0,"left"],[8,"center"]]},"text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-justify":"left","text-size":10,"text-transform":"uppercase",visibility:"visible"},paint:{"icon-opacity":.7,"text-color":"rgb(117, 129, 145)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"place_capital",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:12,filter:["all",["==","$type","Point"],["all",["==","capital",2],["==","class","city"]]],layout:{"text-anchor":{base:1,stops:[[0,"left"],[8,"center"]]},"text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-justify":"left","text-size":14,"text-transform":"uppercase",visibility:"visible"},paint:{"icon-opacity":.7,"text-color":"rgb(117, 129, 145)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"place_city_large",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:12,filter:["all",["==","$type","Point"],["all",["!=","capital",2],["<=","rank",3],["==","class","city"]]],layout:{"text-anchor":{base:1,stops:[[0,"left"],[8,"center"]]},"text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-justify":"left","text-size":14,"text-transform":"uppercase",visibility:"visible"},paint:{"icon-opacity":.7,"text-color":"rgb(117, 129, 145)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"place_state",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:12,filter:["all",["==","$type","Point"],["==","class","state"]],layout:{"text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-size":10,"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":"rgb(113, 129, 144)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"place_country_other",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:8,filter:["all",["==","$type","Point"],["==","class","country"],["!has","iso_a2"]],layout:{"text-field":"{name:latin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-size":{base:1,stops:[[0,9],[6,11]]},"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":{base:1,stops:[[3,"rgb(157,169,177)"],[4,"rgb(153, 153, 153)"]]},"text-halo-color":"rgba(236,236,234,0.7)","text-halo-width":1.4}},{id:"place_country_minor",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:8,filter:["all",["==","$type","Point"],["==","class","country"],[">=","rank",2],["has","iso_a2"]],layout:{"text-field":"{name:latin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-size":{base:1,stops:[[0,10],[6,12]]},"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":{base:1,stops:[[3,"rgb(157,169,177)"],[4,"rgb(153, 153, 153)"]]},"text-halo-color":"rgba(236,236,234,0.7)","text-halo-width":1.4}},{id:"place_country_major",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:6,filter:["all",["==","$type","Point"],["<=","rank",1],["==","class","country"],["has","iso_a2"]],layout:{"text-anchor":"center","text-field":"{name:latin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-size":{base:1.4,stops:[[0,10],[3,12],[4,14]]},"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":{base:1,stops:[[3,"rgb(157,169,177)"],[4,"rgb(153, 153, 153)"]]},"text-halo-color":"rgba(236,236,234,0.7)","text-halo-width":1.4}}],sprite:"https://atoms-map-sprites.qa.cag.spatialverse.online/sprites/sprites",glyphs:"https://atoms-map-sprites.qa.cag.spatialverse.online/fonts/{fontstack}/{range}.pbf",sources:{openmaptiles:{type:"vector",url:"https://api.maptiler.com/tiles/v3/tiles.json?key=12H5hrITUbJ1sDrVPqkq"}},version:8},ol=[{id:"Building overlay base",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel.l1","#97b5bc"],["where.changi.terminals.t1.l1","#92a7b8"],["where.changi.terminals.t2.l1","#d59d99"],["where.changi.terminals.t3.l1","#8ab8b5"],["where.changi.terminals.t4.l1","#a891aa"]],default:"#1a72B6"},"fill-opacity":1,"fill-antialias":!1},"source-layer":"geojson"},{id:"Aerobridge",type:"fill",metadata:{"source-type":"steerpath_base_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.infra.aerobridge","what.infra.tunnel"]]]],paint:{"fill-color":"hsl(0, 0%, 68%)","fill-opacity":{base:1,stops:[[15,0],[15.5,.99]]},"fill-antialias":!1},"source-layer":"geojson"},{id:"Airplanes",type:"fill",metadata:{"source-type":"steerpath_base_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.plane"]],paint:{"fill-color":{base:1,stops:[[15,"hsl(0, 0%, 53%)"],[15.5,"hsl(0, 0%, 100%)"]]},"fill-outline-color":"hsl(0, 0%, 50%)","fill-opacity":{base:1,stops:[[15,0],[15.5,.99]]},"fill-antialias":!1},"source-layer":"geojson"},{id:"building_outline",type:"fill",metadata:{"source-type":"steerpath_base_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","subType"],"building_outline"]],paint:{"fill-color":"hsl(0, 0%, 82%)","fill-opacity":.2,"fill-outline-color":"hsl(0, 0%, 82%)"},"source-layer":"geojson"},{id:"Skytrain track outdoor",type:"fill",metadata:{"source-type":"steerpath_base_tiles"},source:"custom",filter:["all",["==",["get","dimension_where"],"where.changi.terminals.t2.l2"],["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.transport.skytrain"]],paint:{"fill-color":"hsl(0, 0%, 100%)","fill-opacity":.99,"fill-outline-color":"hsl(0, 0%, 69%)"},"source-layer":"geojson"},{id:"Skytrain line outdoor",type:"line",metadata:{"source-type":"steerpath_base_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.transport.skytrain"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":"hsl(13, 97%, 67%)","line-width":3},"source-layer":"geojson"},{id:"Floor",type:"fill",metadata:{"source-type":"steerpath_base_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.infra.floor","what.floor"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":"hsl(0, 0%, 100%)","fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Skytrain track",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.transport.skytrain"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none"},paint:{"fill-color":"hsl(0, 0%, 100%)","fill-opacity":.99,"fill-outline-color":"hsl(0, 0%, 69%)"},"source-layer":"geojson"},{id:"Changi Airport Connector",type:"fill",minzoom:16,maxzoom:24,metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.transport.walkway"]],layout:{visibility:"visible"},paint:{"fill-color":"#faefd6","fill-opacity":.99,"fill-outline-color":"#cd9d2d"},"source-layer":"geojson"},{id:"Changi Airport Connector Text",type:"symbol",minzoom:16,maxzoom:24,metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.transport.walkway"]],layout:{"symbol-placement":"line","symbol-spacing":300,"text-field":"{title}","text-font":["Lato Regular"],"text-max-angle":30,"text-pitch-alignment":"viewport","text-rotation-alignment":"map","text-size":12,"text-transform":"none"},paint:{"text-halo-color":"#cd9d2d","text-color":"#ffffff","text-halo-width":2},"source-layer":"geojson"},{id:"Changi Sheltered Walkway",type:"fill",minzoom:16,maxzoom:24,metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.transport.walkway_sheltered"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible"},paint:{"fill-color":"#d6e2fa","fill-opacity":.99,"fill-outline-color":"#375692"},"source-layer":"geojson"},{id:"Carpark fill",metadata:{"source-type":"steerpath_floor_tiles"},minzoom:16,maxzoom:24,type:"fill",source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.infra.carpark","what.infra.parking_bike","what.infra.parking_bike_locked"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{stops:[[18,"#dddddd"],[19.25,"#c0c0c0"]]},"fill-opacity":{stops:[[16,0],[16.5,.99]]}},"source-layer":"geojson"},{id:"Public",type:"fill",minzoom:15,maxzoom:17,metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.wing"],["==",["get","title"],"Public"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none"},paint:{"fill-color":"hsl(43, 100%, 98%)","fill-opacity":.3,"fill-antialias":!1},"source-layer":"geojson"},{id:"Transit",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.wing"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none"},paint:{"fill-color":"hsl(0, 0%, 100%)","fill-antialias":!1,"fill-opacity":.99},"source-layer":"geojson"},{id:"Hole fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.hole"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":"hsl(0, 0%, 90%)","fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Immigration",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.service.immigration"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"#89CBDF"],[17.5,"hsl(194, 79%, 91%)"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Other service areas",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:16,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.service.baggage_claim","what.service.atm","what.service.baby_care","what.service.baggage_storage","what.service.clinic","what.service.tax_refund","what.service.free_singapore_tour","what.service.information","what.service.internet","what.service.laptop_access","what.service.meditation_room","what.service.money_exchange","what.service.phone","what.service.post","what.service.prayer_room","what.service.smoking_area","what.service.cloakroom","what.service.toilet","what.service.wifi","what.other","what.service.prayer_room","what.service.adult_diaper_change","what.service.changi_rewards","what.service.toilet_accessible","what.service.shower"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":"hsl(263, 75%, 96%)","fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Retail",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.shop.retail","what.shop.retail_anchor"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"#CAACED"],[17.5,"#E0CCF8"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Lounge",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.service.airline_lounge","what.service.pay_per_use_lounge","what.service.lodging","what.service.airport_transfer","what.service.vip_counter","what.service.connect_changi","what.service.lounge_changi"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"hsl(224, 46%, 72%)"],[17.5,"hsl(215, 66%, 94%)"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Gate",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.airplane_gate","what.gate_airplane"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"#89CBDF"],[17.5,"hsl(194, 79%, 91%)"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Gate screening",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.security"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible"},paint:{"fill-color":{base:1,stops:[[17,"#89CBDF"],[17.5,"hsl(194, 54%, 85%)"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Travelator",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.travelator"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":"hsl(0, 0%, 96%)","fill-opacity":{base:1,stops:[[17,0],[17.5,.99]]}},"source-layer":"geojson"},{id:"Checkin",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.service.checkin","what.service.checkin_early"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"#89CBDF"],[17.5,"hsl(194, 79%, 91%)"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Entertainment",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.shop.fun","what.service.movie_theatre","what.service.tv_lounge","what.service.attraction_tour"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"hsl(1, 100%, 82%)"],[17.5,"hsl(0, 100%, 95%)"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Entertainment outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.shop.fun","what.service.movie_theatre","what.service.tv_lounge","what.service.attraction_tour"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,stops:[[17,"hsl(330, 100%, 82%)"],[17.5,"hsl(330, 100%, 68%)"]]},"line-width":1},"source-layer":"geojson"},{id:"Water fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.infra.water"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"hsl(195, 87%, 63%)"],[17.5,"hsl(197, 71%, 91%)"]]},"fill-opacity":.99,"fill-antialias":!0},"source-layer":"geojson"},{id:"Water outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.infra.water"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,stops:[[17,"hsl(190, 91%, 53%)"],[17.5,"hsl(190, 100%, 41%)"]]},"line-width":1},"source-layer":"geojson"},{id:"Garden fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.garden"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"hsl(183, 64%, 56%)"],[17.5,"hsl(181, 49%, 89%)"]]},"fill-opacity":.99,"fill-antialias":!0},"source-layer":"geojson"},{id:"Garden outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.garden"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,stops:[[17,"hsl(159, 55%, 61%)"],[17.5,"hsl(164, 100%, 35%)"]]},"line-width":1},"source-layer":"geojson"},{id:"Pickup zone outline",type:"line",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.transport.pickup","what.transport.pickup_car"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":"hsl(0, 0%, 78%)","line-width":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Pick-up Zone",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.transport.pickup","what.transport.pickup_car"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"#bcbaba"],[17.5,"#ececec"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Restarea",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.service.rest_area"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"hsl(1, 100%, 82%)"],[17.5,"hsl(0, 100%, 95%)"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Food",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.shop.food","what.shop.food","what.shop.food_anchor","what.shop.food_anchor"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"#FFD3B3"],[17.5,"#FFE3CE"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Road marking fill",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill",source:"custom",minzoom:19,maxzoom:24,filter:["all",["in",["get","$type"],["literal",["Polygon"]]],["==",["get","dimension_what"],"what.road.marking_fill"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-opacity":{base:1,stops:[[19,0],[19.25,1]]},"fill-color":"#ffffff"},"source-layer":"geojson"},{id:"road marking line",metadata:{"source-type":"steerpath_floor_tiles"},type:"line",source:"custom",minzoom:19,maxzoom:24,filter:["all",["==",["get","dimension_what"],"what.road.marking_line"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-opacity":{base:1,stops:[[19,0],[19.25,1]]},"line-color":"#ffffff","line-width":1.5},"source-layer":"geojson"},{id:"Kerb",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:18,maxzoom:24,filter:["all",["==",["get","dimension_what"],"what.road.kerb"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-opacity":{base:1,stops:[[18,0],[18.25,1]]},"line-color":"hsl(0, 0%, 63%)","line-width":1.5},"source-layer":"geojson"},{id:"Hole outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.hole"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-opacity":{base:1,stops:[[17,0],[17.5,1]]},"line-color":"hsl(0, 0%, 68%)","line-width":1},"source-layer":"geojson"},{id:"Travelator outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:16,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.travelator"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{},paint:{"line-color":"hsl(0, 0%, 81%)","line-width":3,"line-opacity":1},"source-layer":"geojson"},{id:"Airplanes outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.airplane"]],layout:{},paint:{"line-color":"hsl(0, 0%, 76%)","line-opacity":{base:1,stops:[[15,0],[15.5,1]]}},"source-layer":"geojson"},{id:"Immigration outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.service.immigration"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none"},paint:{"line-color":"hsl(0, 0%, 85%)","line-width":2},"source-layer":"geojson"},{id:"Checkin outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.service.checkin","what.service.checkin_early"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-width":1,"line-color":"#89CBDF"},"source-layer":"geojson"},{id:"Other service outline",type:"line",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:16,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.service.baggage_claim","what.service.atm","what.service.baby_care","what.service.baggage_storage","what.service.clinic","what.service.free_singapore_tour","what.service.information","what.service.internet","what.service.laptop_access","what.service.meditation_room","what.service.money_exchange","what.service.phone","what.service.post","what.service.prayer_room","what.service.smoking_area","what.service.tax_refund","what.service.cloakroom","what.service.toilet","what.service.wifi","what.other","what.service.prayer_room","what.service.adult_diaper_change","what.service.changi_rewards","what.service.toilet_accessible","what.service.shower"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":"hsl(0, 0%, 78%)","line-width":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Retail outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.shop.retail","what.shop.retail_anchor"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,stops:[[17,"#CAACED"],[17.5,"#986FCA"]]},"line-width":1},"source-layer":"geojson"},{id:"Lounge outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.service.airline_lounge","what.service.pay_per_use_lounge","what.service.lodging","what.service.airport_transfer","what.service.vip_counter","what.service.connect_changi","what.service.lounge_changi"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,stops:[[17,"hsl(224, 46%, 72%)"],[17.5,"hsl(224, 43%, 58%)"]]},"line-width":1},"source-layer":"geojson"},{id:"Food outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.shop.food","what.shop.food","what.shop.food_anchor","what.shop.food_anchor"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,stops:[[17,"#FFD3B3"],[17.5,"#FFB681"]]},"line-width":1},"source-layer":"geojson"},{id:"Gate and outline",type:"line",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["in",["get","$type"],["literal",["LineString","Polygon"]]],["in",["get","dimension_what"],["literal",["what.airplane_gate","what.gate_airplane","what.security"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,stops:[[17,"#89CBDF"],[17.5,"hsl(194, 56%, 49%)"]]},"line-width":1},"source-layer":"geojson"},{id:"Restarea outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.service.rest_area"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,stops:[[17,"hsl(330, 100%, 82%)"],[17.5,"hsl(330, 100%, 68%)"]]},"line-width":1},"source-layer":"geojson"},{id:"highlight_custom_fill",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill",minzoom:18,source:"custom",filter:["all",["all",["==",["geometry-type"],"Polygon"]],["any"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none"},paint:{"fill-color":"#f6f6f6","fill-opacity":{stops:[[16,0],[16.5,.5]]}},"source-layer":"geojson"},{id:"highlight_custom_outline",metadata:{"source-type":"steerpath_floor_tiles"},type:"line",minzoom:18,source:"custom",filter:["all",["all",["==",["geometry-type"],"Polygon"]],["any"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none","line-join":"round","line-cap":"round"},paint:{"line-color":"#5d5d5d","line-blur":10,"line-width":20,"line-opacity":{stops:[[16,0],[16.5,1]]}},"source-layer":"geojson"},{id:"Public outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","title"],"Public"],["==",["get","dimension_what"],"what.infra.wing"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none"},paint:{"line-width":2,"line-color":"hsl(0, 0%, 46%)"},"source-layer":"geojson"},{id:"Transit border",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.infra.wing"],["==",["get","title"],"Transit"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":"hsl(270, 41%, 46%)","line-width":2},"source-layer":"geojson"},{id:"Floor outline aka wall fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.infra.wall","what.wall"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":"hsl(0, 0%, 56%)"},"source-layer":"geojson"},{id:"Floor outline aka wall",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["in",["get","dimension_what"],["literal",["what.infra.wall","what.wall"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-width":{base:1,stops:[[15.5,1],[22,3]]},"line-color":"hsl(0, 0%, 56%)"},"source-layer":"geojson"},{id:"T2 overlay outline copy",metadata:{"source-type":"steerpath_floor_tiles"},type:"line",source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","subType"],"building_outline"]],layout:{visibility:"none"},paint:{"line-color":"#ee3424","line-opacity":1,"line-width":3},"source-layer":"geojson"},{id:"High poi extrude",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill-extrusion",minzoom:16,maxzoom:20,source:"custom",layout:{visibility:"none"},filter:["all",["==",["geometry-type"],"Polygon"],["all",["in",["get","dimension_what"],["literal",["what.shop.retail","what.shop.retail_anchor","what.shop.food","what.shop.food","what.shop.food_anchor","what.shop.food_anchor","what.service.checkin","what.airplane_gate","what.security"]]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-extrusion-base":0,"fill-extrusion-color":{base:1,type:"categorical",property:"dimension_what",stops:[["category_retail","#E0CCF8"],["category_retail_anchor","#E0CCF8"],["category_restaurant","#FFE3CE"],["category_restaurant_anchor","#FFE3CE"],["category_food","#FFE3CE"],["category_food_anchor","#FFE3CE"],["service_checkin","hsl(194, 79%, 91%)"],["category_airplane_gate","hsl(194, 79%, 91%)"],["category_security","hsl(194, 54%, 85%)"]],default:"#ebe8e5"},"fill-extrusion-height":{stops:[[17,0],[17.5,3],[19,3],[19.5,0]]},"fill-extrusion-opacity":{stops:[[17,0],[17.5,.75],[19,.75],[19.5,0]]}},"source-layer":"geojson"},{id:"Medium poi extrude",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill-extrusion",minzoom:16,maxzoom:20,source:"custom",layout:{visibility:"none"},filter:["all",["==",["geometry-type"],"Polygon"],["all",["in",["get","dimension_what"],["literal",["what.service.baggage_claim","what.other"]]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-extrusion-base":0,"fill-extrusion-color":{base:1,type:"categorical",property:"dimension_what",stops:[["service_baggage_claim","hsl(263, 75%, 96%)"],["category_other","hsl(263, 75%, 96%)"]],default:"#ebe8e5"},"fill-extrusion-height":{stops:[[17,0],[17.5,1.5],[19,1.5],[19.5,0]]},"fill-extrusion-opacity":{stops:[[17,0],[17.5,.75],[19,.75],[19.5,0]]}},"source-layer":"geojson"},{id:"Low poi extrude",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill-extrusion",minzoom:16,maxzoom:20,source:"custom",layout:{visibility:"none"},filter:["all",["in",["get","dimension_what"],["literal",["what.infra.garden"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-extrusion-base":0,"fill-extrusion-color":{base:1,type:"categorical",property:"dimension_what",stops:[["other","#ebe8e5"],["infrastructure_garden","hsl(181, 49%, 89%)"]],default:"#ebe8e5"},"fill-extrusion-height":{stops:[[17,0],[17.5,.5],[19,.5],[19.5,0]]},"fill-extrusion-opacity":{stops:[[17,0],[17.5,.75],[19,.75],[19.5,0]]}},"source-layer":"geojson"},{id:"temporarily_disabled_highlight_custom_extrusion",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill-extrusion",source:"custom",minzoom:18,layout:{visibility:"none"},filter:["all",["all",["==",["get","buildingRef"],"67"]],["any"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-extrusion-base":0,"fill-extrusion-color":{type:"identity",property:"fillExtrusionColor",default:"#fff"},"fill-extrusion-height":{stops:[[16,0],[16.5,.1]]},"fill-extrusion-opacity":{stops:[[16,0],[16.5,.5]]}},"source-layer":"geojson"},{id:"Aerobridge gates",metadata:{"source-type":"steerpath_floor_tiles"},type:"symbol",source:"custom",filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.infra.aerobridge"]],layout:{visibility:"none","text-field":"{cad_text}","text-font":["Lato Regular"],"text-padding":0,"text-size":15,"text-ignore-placement":!0},paint:{"text-opacity":{base:1,stops:[[15,0],[15.5,1],[17,1],[17.5,0]]},"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(194, 64%, 49%)","text-halo-width":2},"source-layer":"geojson"},{id:"Gate names",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.airplane_gate","what.gate_airplane"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","text-field":"{title}","text-font":["Lato Regular"],"text-padding":0,"text-ignore-placement":!0,"text-size":18,"text-allow-overlap":!0},paint:{"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(194, 79%, 91%)","text-color":"hsl(194, 64%, 49%)","text-halo-width":2},"source-layer":"geojson"},{id:"Lounge title",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.service.airline_lounge","what.service.lodging","what.service.vip_counter","what.service.checkin_early","what.service.connect_changi","what.service.lounge_changi"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]],["has","title"],["!=",["get","title"],""]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,15]]},"text-padding":2,"text-font":["Lato Regular"],"text-field":"{title}","text-letter-spacing":0,"text-max-width":5,"icon-image":"{dimension_what}","icon-offset":[0,-32],"text-anchor":"top","icon-size":{base:1,stops:[[17,.3],[22,1]]},"icon-padding":1},paint:{"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-blur":0,"text-halo-color":"hsl(224, 43%, 58%)","text-halo-width":1.5,"text-color":"#ffffff","text-translate":[0,0],"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]}}},{id:"Pay Per Use Lounge title",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.service.pay_per_use_lounge"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]],["has","title"],["!=",["get","title"],""]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,15]]},"text-padding":2,"text-font":["Lato Regular"],"text-field":"{title}","text-letter-spacing":0,"text-max-width":5,"icon-image":"what.service.airline_lounge","icon-offset":[0,-32],"text-anchor":"top","icon-size":{base:1,stops:[[17,.3],[22,1]]},"icon-padding":1},paint:{"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-blur":0,"text-halo-color":"hsl(224, 43%, 58%)","text-halo-width":1.5,"text-color":"#ffffff","text-translate":[0,0],"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]}}},{id:"Tenant title",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.shop.retail","what.shop.food"]]],["!=",["get","title"],""],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,15]]},"icon-offset":[0,-20],"icon-image":"{dimension_what}","text-font":["Lato Regular"],"text-padding":1,"icon-size":{base:1,stops:[[17,.3],[21,1]]},"text-anchor":"top","text-field":"{title}","text-letter-spacing":0,"text-max-width":5},paint:{"text-color":"#ffffff","text-halo-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.shop.retail","hsl(267, 31%, 52%)"],["what.shop.food","hsl(25, 76%, 58%)"]],default:"hsl(267, 31%, 52%)"},"text-halo-blur":0,"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-width":2,"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Anchor tenant title",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.shop.retail_anchor","what.shop.food_anchor"]]],["!=",["get","title"],""],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,15]]},"icon-offset":[0,-20],"icon-image":{base:1,type:"categorical",property:"dimension_what",stops:[["what.shop.retail_anchor","what.shop.retail"],["what.shop.food_anchor","what.shop.food"]],default:"what.shop.retail"},"text-font":["Lato Regular"],"text-padding":1,"icon-size":{base:1,stops:[[17,.3],[21,1]]},"text-anchor":"top","text-field":"{title}","text-letter-spacing":0,"text-max-width":5},paint:{"text-color":"#ffffff","text-halo-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.shop.retail_anchor","hsl(267, 31%, 52%)"],["what.shop.food_anchor","hsl(25, 76%, 58%)"]],default:"hsl(267, 31%, 52%)"},"text-halo-blur":0,"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-width":2,"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Entrance texts",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.infra.entrance"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","text-field":"{title}","text-font":["Lato Regular"],"text-padding":0,"text-size":{base:1,stops:[[17,8],[18,15]]},"text-ignore-placement":!0,"text-max-width":5},paint:{"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 39%)","text-halo-width":2},"source-layer":"geojson"},{id:"Exit texts",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.infra.exit"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","text-field":"{title}","text-font":["Lato Regular"],"text-padding":0,"text-size":{base:1,stops:[[17,8],[18,15]]},"text-ignore-placement":!0},paint:{"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 39%)","text-halo-width":2},"source-layer":"geojson"},{id:"Changi Walkway Text",type:"symbol",minzoom:16,maxzoom:24,metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.transport.walkway"]],layout:{"text-field":"{title}","text-font":["Lato Regular"],"text-pitch-alignment":"viewport","text-size":12},paint:{"text-halo-color":"#cd9d2d","text-color":"#ffffff","text-halo-width":2,"text-opacity":0},"source-layer":"geojson"},{id:"Changi Sheltered Walkway Text",type:"symbol",minzoom:16,maxzoom:24,metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.transport.walkway_sheltered"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-field":"{title}","text-font":["Lato Regular"],"text-pitch-alignment":"viewport","text-size":12},paint:{"text-halo-color":"#375692","text-color":"#ffffff","text-halo-width":2},"source-layer":"geojson"},{id:"Checkin row text",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.service.checkin"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","text-field":"{title}","text-font":["Lato Regular"],"text-padding":0,"text-size":{base:1,stops:[[17,8],[18,15]]}},paint:{"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 39%)","text-halo-width":2},"source-layer":"geojson"},{id:"Belt text",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.service.baggage_claim"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","text-field":"{title}","text-font":["Lato Regular"],"text-padding":0,"text-size":{base:1,stops:[[17,8],[18,15]]}},paint:{"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 39%)","text-halo-width":2},"source-layer":"geojson"},{id:"Infrastructure icons",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.infra.ramp","what.infra.escalator"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","icon-image":"{dimension_what}","text-font":["Lato Regular"],"icon-size":{base:1,stops:[[17,.3],[22,.7]]},"icon-padding":1},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Attraction text and icon",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["has","title"],["!=",["get","title"],""],["in",["get","dimension_what"],["literal",["what.shop.fun","what.service.attraction_tour"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[22,15]]},"icon-offset":[0,-30],"icon-image":"{dimension_what}","text-transform":"uppercase","text-font":["Lato Regular"],visibility:"visible","icon-size":{base:1,stops:[[17,.3],[22,.7]]},"text-anchor":"top","text-field":"{title}","text-letter-spacing":0,"icon-padding":1,"text-max-width":5},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(330, 100%, 68%)","text-halo-width":2,"text-halo-blur":0,"text-color":"hsl(0, 0%, 100%)"},"source-layer":"geojson"},{id:"Rest area text and icon",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.service.rest_area"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[22,15]]},"icon-offset":[0,-30],"icon-image":"{dimension_what}","text-transform":"uppercase","text-font":["Lato Regular"],visibility:"visible","icon-size":{base:1,stops:[[17,.3],[24,1]]},"text-anchor":"top","text-field":"{title}","text-letter-spacing":0,"icon-padding":1,"text-max-width":5},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(330, 100%, 68%)","text-halo-width":2,"text-halo-blur":0,"text-color":"hsl(0, 0%, 100%)"},"source-layer":"geojson"},{id:"Airport transfer icon and text",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.service.airport_transfer"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,15]]},"icon-offset":[0,-40],"icon-image":"{dimension_what}","text-font":["Lato Regular"],visibility:"visible","icon-size":{base:1,stops:[[17,.3],[22,.7]]},"text-anchor":"top","text-field":"{title}","text-letter-spacing":0,"icon-padding":1,"text-max-width":5},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"#ec7033","text-halo-width":2,"text-halo-blur":0,"text-color":"hsl(0, 0%, 100%)"},"source-layer":"geojson"},{id:"Other Attraction icons",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["has","title"],["!=",["get","title"],""],["in",["get","dimension_what"],["literal",["what.service.movie_theatre"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[22,15]]},"icon-offset":[0,-30],"icon-image":"{dimension_what}","text-transform":"uppercase","text-font":["Lato Regular"],visibility:"visible","icon-size":{base:1,stops:[[17,.3],[22,.7]]},"text-anchor":"top","text-field":"{title}","text-letter-spacing":0,"icon-padding":1,"text-max-width":5},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(330, 100%, 68%)","text-halo-width":2,"text-halo-blur":0,"text-color":"hsl(0, 0%, 100%)"},"source-layer":"geojson"},{id:"Other Service icons",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.infra.lift","what.service.phone","what.service.baggage_storage","what.service.atm","what.service.money_exchange","what.service.internet","what.service.tv_lounge","what.service.toilet","what.service.baby_care","what.service.clinic","what.service.post","what.service.wifi","what.service.prayer_room","what.service.tax_refund","what.service.device_charging","what.service.meditation_room","what.service.smoking_area","what.service.information","what.service.cloakroom","what.service.prayer_room","what.service.adult_diaper_change","what.service.changi_rewards","what.service.toilet_accessible","what.service.shower"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","icon-image":"{dimension_what}","text-font":["Lato Regular"],"icon-size":{base:1,stops:[[17,.3],[24,1]]},"icon-padding":1},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"iShop Changi",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","title"],"iShop Changi"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","icon-padding":1,"icon-size":{base:1,stops:[[17,.3],[22,1]]},"text-field":"{title}","text-font":["Lato Regular"],"text-max-width":4,"text-size":{base:1,stops:[[16,6],[20,18]]},"text-letter-spacing":-.05,"text-line-height":1},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-color":"hsl(0, 0%, 47%)","text-opacity":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Pickup Zone Text",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.transport.pickup","what.transport.pickup_car"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","text-field":"{title}","text-font":["Lato Regular"],"text-padding":0,"text-size":{base:1,stops:[[17,8],[18,15]]}},paint:{"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 39%)","text-halo-width":2},"source-layer":"geojson"},{id:"Gate screening icon",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.security"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","icon-image":"{dimension_what}","text-font":["Lato Regular"],"icon-size":{base:1,stops:[[17,.1],[19,1]]},"icon-padding":1},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Immigration icon",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.service.immigration"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","icon-image":"{dimension_what}","text-font":["Lato Regular"],"icon-size":{base:1,stops:[[17,.3],[22,1]]},"icon-allow-overlap":!0,"text-size":{base:1,stops:[[17,1],[20,18]]},"text-letter-spacing":-.05},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-opacity":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Parking icon",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.infra.carpark","what.infra.parking_bike","what.infra.parking_bike_locked"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,15]]},"icon-offset":[0,-40],"icon-image":"{dimension_what}","text-font":["Lato Regular"],visibility:"visible","text-offset":[0,0],"icon-size":{base:1,stops:[[17,.3],[22,1]]},"text-anchor":"top","text-field":"{title}","icon-padding":1},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-color":"hsl(0, 0%, 100%)","text-halo-color":"#ec7033","text-halo-width":2,"text-opacity":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Transport Taxi, Bus, Consierge and Train",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.transport.taxi_queue","what.transport.taxi","what.transport.type_bus","what.transport.bus","what.transport.train","what.service.ground_transport_concierge"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,15]]},"icon-offset":[0,0],"icon-image":"{dimension_what}","text-font":["Lato Regular"],"icon-allow-overlap":!0,visibility:"visible","text-offset":[0,1],"icon-size":{base:1,stops:[[17,.3],[22,.7]]},"text-anchor":"top","text-field":"{title}","text-letter-spacing":0,"icon-padding":1,"text-max-width":5},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-color":"hsl(0, 0%, 100%)","text-halo-color":"#ec7033","text-halo-width":2,"text-halo-blur":0,"text-translate":[0,0]},"source-layer":"geojson"},{id:"Construction area",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill",source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.construction"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"hsl(0, 0%, 100%)"],[17.5,"hsl(0, 0%, 70%)"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Construction outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.construction"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":"hsl(0, 0%, 70%)","line-opacity":1,"line-width":1},"source-layer":"geojson"},{id:"Construction text",metadata:{"source-type":"steerpath_floor_tiles"},type:"symbol",source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.infra.construction"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","text-letter-spacing":-.05,"icon-size":{base:1,stops:[[17,.3],[22,1]]},"icon-allow-overlap":!0,"text-size":{base:1,stops:[[17,1],[20,20]]},"text-max-width":5,"text-field":"{title}","text-font":["Lato Regular"]},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-color":"hsl(0, 0%, 39%)","text-halo-color":"hsl(0, 0%, 70%)","text-halo-width":4},"source-layer":"geojson"},{id:"highlight_custom_symbol",metadata:{"source-type":"steerpath_floor_tiles"},type:"symbol",source:"custom",minzoom:18,filter:["all",["all",["==",["geometry-type"],"Point"]],["any"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none","icon-image":"{dimension_what}","icon-size":1,"icon-optional":!0,"text-field":"{title}","text-max-width":4,"text-padding":2,"text-line-height":.8,"text-optional":!0,"text-font":["Lato Regular"],"icon-offset":[0,-16],"text-offset":[0,.2],"text-anchor":"top","text-size":{stops:[[16,10],[18,16]]}},paint:{"icon-opacity":{stops:[[16,0],[16.5,1]]},"text-color":"#fff","text-halo-width":2,"text-halo-color":"#373737","text-halo-blur":1,"text-opacity":{stops:[[18,0],[18.5,1]]}},"source-layer":"geojson"},{id:"Transit overlay",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill",source:"custom",minzoom:15,maxzoom:17,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.wing"],["==",["get","title"],"Transit"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":"hsl(250, 75%, 33%)","fill-antialias":!1,"fill-opacity":{base:1,stops:[[16,.4],[16.5,0]]}},"source-layer":"geojson"},{id:"Public overlay",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill",source:"custom",minzoom:15,maxzoom:17,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.wing"],["==",["get","title"],"Public"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":"hsl(31, 100%, 43%)","fill-opacity":{base:1,stops:[[16,.4],[16.5,0]]},"fill-antialias":!1},"source-layer":"geojson"},{id:"Public overlay text",metadata:{"source-type":"steerpath_floor_tiles"},type:"symbol",source:"custom",minzoom:15,maxzoom:17,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.infra.wing"],["==",["get","title"],"Public"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","icon-offset":[0,-104],"icon-size":1,"text-field":"Public","text-size":25,"text-font":["Lato Regular"],"text-allow-overlap":!0},paint:{"icon-opacity":{base:1,stops:[[13,1],[13.5,0]]},"text-color":"hsl(0, 0%, 100%)","text-halo-color":"hsl(22, 38%, 45%)","text-halo-width":2,"text-halo-blur":2,"text-opacity":{base:1,stops:[[15,0],[15.5,1],[16.25,1],[16.5,0]]}},"source-layer":"geojson"},{id:"Transit overlay text",metadata:{"source-type":"steerpath_floor_tiles"},type:"symbol",source:"custom",minzoom:15,maxzoom:17,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.infra.wing"],["==",["get","title"],"Transit"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","icon-offset":[0,-104],"icon-size":1,"text-field":"Transit","text-font":["Lato Regular"],"text-size":25,"text-allow-overlap":!0},paint:{"icon-opacity":{base:1,stops:[[13,1],[13.5,0]]},"text-color":"hsl(0, 0%, 100%)","text-halo-color":"hsl(254, 56%, 46%)","text-halo-width":2,"text-halo-blur":2,"text-opacity":{base:1,stops:[[15,0],[15.5,1],[16.25,1],[16.5,0]]}},"source-layer":"geojson"},{id:"Skytrain line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.transport.skytrain"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none"},paint:{"line-color":"hsl(13, 97%, 67%)","line-width":3},"source-layer":"geojson"},{id:"Skytrain icon",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.transport.skytrain"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,15]]},"icon-offset":[0,0],"icon-image":"{dimension_what}","text-font":["Lato Regular"],visibility:"visible","text-offset":[0,1],"icon-size":.4,"text-anchor":"top","text-field":"{title}","text-letter-spacing":0,"icon-padding":2,"text-max-width":10},paint:{"icon-opacity":{base:1,stops:[[15,0],[15.5,1]]},"text-color":"hsl(0, 0%, 100%)","text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"#ec7033","text-halo-width":2,"text-halo-blur":0,"text-translate":[0,0]},"source-layer":"geojson"},{id:"Building overlay",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",maxzoom:16,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel.l1","#008FBA"],["where.changi.terminals.t1.l1","#1a72B6"],["where.changi.terminals.t2.l1","#ee3424"],["where.changi.terminals.t3.l1","#008880"],["where.changi.terminals.t4.l1","#6f2770"]],default:"#1a72B6"},"fill-opacity":{base:1,stops:[[15,.99],[15.5,0]]},"fill-antialias":!1},"source-layer":"geojson"},{id:"Building overlay outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",maxzoom:15.5,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel.l1","#008FBA"],["where.changi.terminals.t1.l1","#1a72B6"],["where.changi.terminals.t2.l1","#ee3424"],["where.changi.terminals.t3.l1","#008880"],["where.changi.terminals.t4.l1","#6f2770"]],default:"#1a72B6"},"line-opacity":1,"line-width":2},"source-layer":"geojson"},{id:"Building icon",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:1,maxzoom:17,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","icon-size":{base:1,stops:[[13,.21],[14,.3],[15,.6],[16,1]]},"text-font":["Lato Regular"],"text-size":50,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"icon-image":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel.l1","building_Jewel"],["where.changi.terminals.t1.l1","building_T1"],["where.changi.terminals.t2.l1","building_T2"],["where.changi.terminals.t3.l1","building_T3"],["where.changi.terminals.t4.l1","building_T4"]],default:"building_T1"},"icon-offset":[0,0]},paint:{"text-color":"hsl(0, 0%, 100%)","text-halo-color":"rgba(0,136,128,1)","text-halo-width":2,"text-opacity":{base:1,stops:[[15.5,1],[15.6,0]]},"icon-opacity":{base:1,stops:[[15,1],[15.5,0]]}},"source-layer":"geojson"}],al=[{id:"Smoke Zone Polygon",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom","source-layer":"geojson",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.fire_safety.smoke_zone"]]]],paint:{"fill-color":"#7595ff","fill-opacity":.1}},{id:"Fire Zone Polygon",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom","source-layer":"geojson",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.fire_safety.fire_zone"]]]],paint:{"fill-color":"#ff75df","fill-opacity":.1}},{id:"Smoke Zone Outline",type:"line",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom","source-layer":"geojson",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.fire_safety.smoke_zone"]]]],paint:{"line-color":"#1376bd","line-width":2,"line-dasharray":[4,2]}},{id:"Fire Zone Outline",type:"line",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom","source-layer":"geojson",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.fire_safety.fire_zone"]]]],paint:{"line-color":"#ff75df","line-width":2,"line-dasharray":[4,2]}},{id:"Fire Safety Icons",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom","source-layer":"geojson",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.fire_safety.smoke_detector.general","what.fire_safety.smoke_detector.esc","what.fire_safety.beam_detector","what.fire_safety.flame_detector","what.fire_safety.manual_call_point","what.fire_safety.flow_switch"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,14]]},"icon-image":"{dimension_what}","text-font":["Lato Regular"],"text-padding":1,"icon-size":{base:1,stops:[[17,.3],[21,1]]},"text-field":"{title}","text-letter-spacing":0,"text-max-width":5,"text-anchor":"top","text-offset":[0,.6],"icon-allow-overlap":["step",["zoom"],!1,20,!0],"text-allow-overlap":["step",["zoom"],!1,20,!0]},paint:{"text-color":"#ffffff","text-halo-color":"#ff75df","text-halo-blur":0,"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-width":2,"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]}}},{id:"Smoke Zone Title",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom","source-layer":"geojson",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.fire_safety.smoke_zone"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,14],[20,24]]},"text-font":["Lato Regular"],"text-padding":1,"text-field":"{title}","text-letter-spacing":0,"text-max-width":5,"text-allow-overlap":!0},paint:{"text-color":"#ffffff","text-halo-color":"#1376bd","text-halo-blur":0,"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-width":2}},{id:"FA Zone Title",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom","source-layer":"geojson",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.fire_safety.fire_zone"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,14],[20,24]]},"text-font":["Lato Regular"],"text-padding":1,"text-field":"{title}","text-letter-spacing":0,"text-max-width":5,"text-allow-overlap":!0},paint:{"text-color":"#ffffff","text-halo-color":"#ff75df","text-halo-blur":0,"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-width":2}}],sl=[{id:"airside turf fill",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["in",["get","dimension_what"],["literal",["what.airside.turf"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.airside.turf","#c5e0ca"]],default:"#c5e0ca"},"fill-opacity":1}},{id:"airside building fill",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["in",["get","dimension_what"],["literal",["what.airside.building"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.airside.building","#969ba3"]],default:"#969ba3"},"fill-opacity":1}},{id:"airside line base",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["in",["get","dimension_what"],["literal",["what.airside.taxiway","what.airside.lead_in_line","what.airside.push_back_line"]]],["==",["get","dimension_where"],"where.changi.airside"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#AAAAAA","line-opacity":1,"line-width":{base:1.4,stops:[[5.8,0],[6,3],[20,40]]}}},{id:"airside roadway edge",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["in",["geometry-type"],["literal",["LineString","Polygon"]]],["in",["get","dimension_what"],["literal",["what.airside.roadway_edge"]]],["==",["get","dimension_where"],"where.changi.airside"],["!=",["get","title"],"landside roadway"],["!=",["get","title"],"external layout"]],paint:{"line-color":"#8c98ab","line-opacity":1,"line-width":1},layout:{visibility:"visible"}},{id:"airside markings fill",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.airside.markings.epa","what.airside.markings.era","what.airside.markings.esa","what.airside.markings.plb"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.airside.markings.epa","blue"],["what.airside.markings.era","red"],["what.airside.markings.esa","green"],["what.airside.markings.plb","magenta"]],default:"black"},"fill-opacity":.1}},{id:"airside construction fill",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:14,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.airside.construction"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.airside.construction","#c9c9c9"]],default:"black"},"fill-opacity":.4}},{id:"airside kcz abl line",type:"line",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["in",["get","dimension_what"],["literal",["what.airside.markings.kcz","what.airside.markings.abl"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.airside.markings.kcz","white"],["what.airside.markings.abl","#f29b9b"]],default:"black"},"line-width":1}},{id:"airside markings line",type:"line",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["in",["get","dimension_what"],["literal",["what.airside.markings.epa","what.airside.markings.era","what.airside.markings.esa","what.airside.markings.plb"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.airside.markings.kcz","white"],["what.airside.markings.abl","#f29b9b"],["what.airside.markings.epa","#7dbaf0"],["what.airside.markings.era","#ff6b6b"],["what.airside.markings.esa","#8ed191"],["what.airside.markings.plb","#c893e6"]],default:"black"},"line-width":1}},{id:"airside construction line",type:"line",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:14,maxzoom:24,filter:["all",["in",["get","dimension_what"],["literal",["what.airside.construction"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.airside.construction","black"]],default:"black"},"line-width":1}},{id:"taxiway line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.taxiway"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":"#fcd5a2","line-opacity":1,"line-width":1.5}},{id:"taxiway name",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.taxiway"],["==",["get","dimension_where"],"where.changi.airside"],["!=",["get","title"],"unknown"]],layout:{"symbol-placement":"line","symbol-spacing":150,"text-field":"{title}","text-font":["Lato Regular"],"text-max-angle":30,"text-pitch-alignment":"viewport","text-rotation-alignment":"map","text-size":9,"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":"#ffffff","text-halo-blur":1,"text-halo-color":"#807f7e","text-halo-width":2,"text-translate":[0,0]}},{id:"pushback line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.push_back_line"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":"white","line-opacity":1,"line-width":1.5,"line-dasharray":[2,2]}},{id:"pushback fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.airside.push_back_line"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":"white","fill-opacity":1}},{id:"leadin line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.lead_in_line"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":"#f0d748","line-opacity":1,"line-width":1.5}},{id:"leadin fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.airside.lead_in_line"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":"#f0d748","fill-opacity":1}},{id:"acft type marking line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.markings.acft_type"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":"#e0d569","line-opacity":1,"line-width":1}},{id:"acft type marking names",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:13,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.airside.markings.acft_type"]]],["==",["get","dimension_where"],"where.changi.airside"]],layout:{visibility:"visible","text-field":"{text}","text-max-width":25,"text-font":["Lato Regular"],"text-padding":0,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-size":["interpolate",["exponential",2],["zoom"],13,["*",["get","height"],.1],15,["*",["get","height"],.5],17,["*",["get","height"],2],19,["*",["get","height"],5],22,["*",["get","height"],45]],"text-anchor":{type:"identity",property:"attachPt"},"text-justify":["match",["get","testJustify"],"left","left","right","right","center","center","auto"],"text-rotation-alignment":"map","text-rotate":["get","rotation"]},paint:{"text-color":"black"}},{id:"Compass Swing line dashed",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["in",["geometry-type"],["literal",["LineString","Polygon"]]],["in",["get","dimension_what"],["literal",["what.airside.markings.compass_swing"]]],["==",["get","dimension_where"],"where.changi.airside"],["==",["get","dxfDashed"],!0]],paint:{"line-color":"white","line-opacity":1,"line-width":2,"line-dasharray":[2,2]}},{id:"Compass Swing line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["in",["geometry-type"],["literal",["LineString","Polygon"]]],["in",["get","dimension_what"],["literal",["what.airside.markings.compass_swing"]]],["==",["get","dimension_where"],"where.changi.airside"],["!=",["get","dxfDashed"],!0]],paint:{"line-color":"white","line-opacity":1,"line-width":2}},{id:"EOT EOP line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["in",["geometry-type"],["literal",["LineString","Polygon"]]],["in",["get","dimension_what"],["literal",["what.airside.markings.eot","what.airside.markings.eop"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":"white","line-opacity":1,"line-width":2}},{id:"EOT TOP Compass Swing names",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:13,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.airside.markings.eot","what.airside.markings.eop","what.airside.markings.compass_swing"]]],["==",["get","dimension_where"],"where.changi.airside"]],layout:{visibility:"visible","text-field":"{text}","text-max-width":25,"text-font":["Lato Regular"],"text-padding":0,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-size":["interpolate",["exponential",2],["zoom"],13,["*",["get","height"],.1],15,["*",["get","height"],.5],17,["*",["get","height"],2],19,["*",["get","height"],5],22,["*",["get","height"],45]],"text-anchor":{type:"identity",property:"attachPt"},"text-justify":["match",["get","testJustify"],"left","left","right","right","center","center","auto"],"text-rotation-alignment":"map","text-rotate":["get","rotation"]},paint:{"text-halo-color":"hsl(194, 0%, 60%)","text-color":"white","text-halo-width":1}},{id:"stand marking fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:16.5,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.airside.markings.stand"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{type:"identity",property:"dxfColour"},"fill-opacity":.7},layout:{"fill-sort-key":["coalesce",["-",1,["get","dxfArea"]],1]}},{id:"stand marking names",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:13,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.airside.markings.stand"]]],["==",["get","dimension_where"],"where.changi.airside"]],layout:{visibility:"visible","text-field":"{text}","text-max-width":25,"text-font":["Lato Regular"],"text-padding":0,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-size":["interpolate",["exponential",2],["zoom"],13,["*",["get","height"],.1],15,["*",["get","height"],.5],17,["*",["get","height"],2],19,["*",["get","height"],5],22,["*",["get","height"],45]],"text-anchor":{type:"identity",property:"attachPt"},"text-justify":["match",["get","testJustify"],"left","left","right","right","center","center","auto"],"text-rotation-alignment":"map","text-rotate":["-",["get","rotation"],-45]},paint:{"text-color":{type:"identity",property:"dxfColour"}}},{id:"mws marking fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:16.5,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.airside.markings.mws"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{type:"identity",property:"dxfColour"},"fill-opacity":.7},layout:{"fill-sort-key":["coalesce",["-",1,["get","dxfArea"]],1]}},{id:"taxiway holding psn line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.taxiway.holding_psn"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{type:"identity",property:"dxfColour"},"line-opacity":1,"line-width":2.5,"line-dasharray":[4,2]}},{id:"runway holding psn line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.runway.holding_psn"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":"#e0d569","line-opacity":1,"line-width":2.5}},{id:"runway fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.airside.runway"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{type:"identity",property:"dxfColour"},"fill-opacity":.8},layout:{"fill-sort-key":["case",["==",["get","dxfColour"],"#ffffff"],2,["==",["get","dxfColour"],"#999999"],1,0]}},{id:"runway displ threshold fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.airside.runway.displ_threshold"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{type:"identity",property:"dxfColour"},"fill-opacity":.8},layout:{"fill-sort-key":["case",["==",["get","dxfColour"],"#ffffff"],2,["==",["get","dxfColour"],"#999999"],1,0]}},{id:"runway stopway fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.airside.runway.stopway"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{type:"identity",property:"dxfColour"},"fill-opacity":.8}},{id:"runway stopway line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.runway.stopway"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{type:"identity",property:"dxfColour"},"line-opacity":.8}},{id:"runway clearway outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["get","dimension_what"],"what.airside.runway.clearway"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{type:"identity",property:"dxfColour"},"line-width":1.5,"line-opacity":.8}},{id:"runway strip outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["get","dimension_what"],"what.airside.runway.strip"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{type:"identity",property:"dxfColour"},"line-width":1.5,"line-dasharray":[8,4],"line-opacity":.8}},{id:"runway resa outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.airside.runway.resa"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{type:"identity",property:"dxfColour"},"line-width":1.5,"line-dasharray":[3,3],"line-opacity":1}},{id:"runway resa line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.runway.resa"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{type:"identity",property:"dxfColour"},"line-width":1.5,"line-opacity":1}},{id:"airside building name",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.airside.building"],["==",["get","dimension_where"],"where.changi.airside"]],layout:{"text-field":"{title}","text-font":["Lato Regular"],"text-size":10,visibility:"visible"},paint:{"text-color":"#807f7e","text-halo-blur":1,"text-halo-color":"#ffffff","text-halo-width":1,"text-translate":[0,0]}},{id:"fence jet blast fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.airside.fence.jet_blast"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":"#42566e","fill-opacity":.8}},{id:"fence jet blast name",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.airside.fence.jet_blast"],["==",["get","dimension_where"],"where.changi.airside"]],layout:{"text-field":"Jet Blast Fence","text-font":["Lato Regular"],"text-size":10,visibility:"visible"},paint:{"text-color":"#807f7e","text-halo-blur":1,"text-halo-color":"#ffffff","text-halo-width":1,"text-translate":[0,0]}},{id:"fence perimeter line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.fence.perimeter"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":"#f04f43","line-opacity":1,"line-width":1.5,"line-dasharray":[3,3]}},{id:"apron stand name",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.airside.apron.stand"],["==",["get","dimension_where"],"where.changi.airside"],["!=",["get","title"],"Unknown"]],layout:{"text-field":"{title}","text-font":["Lato Regular"],"text-size":12,"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":"#807f7e","text-halo-blur":1,"text-halo-color":"#ffffff","text-halo-width":1,"text-translate":[0,0]}},{id:"runway name",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.airside.runway"],["==",["get","dimension_where"],"where.changi.airside"],["!=",["get","title"],"Unknown"]],layout:{"text-field":"{title}","text-font":["Lato Regular"],"text-size":16,"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":"#807f7e","text-halo-blur":1,"text-halo-color":"#ffffff","text-halo-width":1,"text-translate":[0,0]}},{id:"Airside Construction Name",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:13,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.airside.construction"]]],["==",["get","dimension_where"],"where.changi.airside"]],layout:{visibility:"visible","text-field":"{text}","text-max-width":25,"text-font":["Lato Regular"],"text-padding":0,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-size":["interpolate",["exponential",2],["zoom"],13,["*",["get","height"],.1],15,["*",["get","height"],.5],17,["*",["get","height"],2],19,["*",["get","height"],5],22,["*",["get","height"],45]],"text-anchor":{type:"identity",property:"attachPt"},"text-justify":["match",["get","testJustify"],"left","left","right","right","center","center","auto"],"text-rotation-alignment":"map","text-rotate":["%",["-",360,["+",["get","rotation"],0]],360]},paint:{"text-halo-color":"hsl(194, 0%, 60%)","text-color":{type:"identity",property:"dxfColour"},"text-halo-width":1}},{id:"Aerobridge",type:"fill",metadata:{"source-type":"steerpath_base_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.infra.aerobridge","what.infra.tunnel"]]]],paint:{"fill-color":"hsl(0, 0%, 68%)","fill-opacity":{base:1,stops:[[15,0],[15.5,.99]]},"fill-antialias":!1}},{id:"Building overlay base",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel","where.changi.terminals.t1","where.changi.terminals.t2","where.changi.terminals.t3","where.changi.terminals.t4"]]]],paint:{"fill-color":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel","#97b5bc"],["where.changi.terminals.t1","#92a7b8"],["where.changi.terminals.t2","#d59d99"],["where.changi.terminals.t3","#8ab8b5"],["where.changi.terminals.t4","#a891aa"]],default:"#1a72B6"},"fill-opacity":.9,"fill-antialias":!1}},{id:"Building underlay icon",type:"symbol",metadata:{"source-type":"steerpath_base_tiles"},source:"custom",minzoom:1,maxzoom:17,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel","where.changi.terminals.t1","where.changi.terminals.t2","where.changi.terminals.t3","where.changi.terminals.t4"]]]],layout:{visibility:"visible","icon-size":{base:1,stops:[[13,.21],[14,.3],[15,.6],[16,1]]},"text-font":["Lato Regular"],"text-size":50,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"icon-image":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel","building_Jewel"],["where.changi.terminals.t1","building_T1"],["where.changi.terminals.t2","building_T2"],["where.changi.terminals.t3","building_T3"],["where.changi.terminals.t4","building_T4"]],default:"building_T1"},"icon-offset":[0,0]},paint:{"text-color":"hsl(0, 0%, 100%)","text-halo-color":"rgba(0,136,128,1)","text-halo-width":2,"text-opacity":1,"icon-opacity":1}},{id:"Building overlay",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",maxzoom:16,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel","where.changi.terminals.t1","where.changi.terminals.t2","where.changi.terminals.t3","where.changi.terminals.t4"]]]],paint:{"fill-color":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel","#008FBA"],["where.changi.terminals.t1","#1a72B6"],["where.changi.terminals.t2","#ee3424"],["where.changi.terminals.t3","#008880"],["where.changi.terminals.t4","#6f2770"]],default:"#1a72B6"},"fill-opacity":{base:1,stops:[[15,.99],[15.5,0]]},"fill-antialias":!1}},{id:"Building overlay outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",maxzoom:15.5,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel","where.changi.terminals.t1","where.changi.terminals.t2","where.changi.terminals.t3","where.changi.terminals.t4"]]]],paint:{"line-color":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel","#008FBA"],["where.changi.terminals.t1","#1a72B6"],["where.changi.terminals.t2","#ee3424"],["where.changi.terminals.t3","#008880"],["where.changi.terminals.t4","#6f2770"]],default:"#1a72B6"},"line-opacity":1,"line-width":2}},{id:"Building icon",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:1,maxzoom:17,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel","where.changi.terminals.t1","where.changi.terminals.t2","where.changi.terminals.t3","where.changi.terminals.t4"]]]],layout:{visibility:"visible","icon-size":{base:1,stops:[[13,.21],[14,.3],[15,.6],[16,1]]},"text-font":["Lato Regular"],"text-size":50,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"icon-image":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel","building_Jewel"],["where.changi.terminals.t1","building_T1"],["where.changi.terminals.t2","building_T2"],["where.changi.terminals.t3","building_T3"],["where.changi.terminals.t4","building_T4"]],default:"building_T1"},"icon-offset":[0,0]},paint:{"text-color":"hsl(0, 0%, 100%)","text-halo-color":"rgba(0,136,128,1)","text-halo-width":2,"text-opacity":{base:1,stops:[[15.5,1],[15.6,0]]},"icon-opacity":{base:1,stops:[[15,1],[15.5,0]]}}}];function ll(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");var r,i=function(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}(e),o="Feature"===(r=t).type?r.geometry:r,a=o.type,s=t.bbox,l=o.coordinates;if(s&&!1===function(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}(i,s))return!1;"Polygon"===a&&(l=[l]);for(var u=!1,c=0;c<l.length&&!u;c++)if(ul(i,l[c][0],n.ignoreBoundary)){for(var h=!1,d=1;d<l[c].length&&!h;)ul(i,l[c][d],!n.ignoreBoundary)&&(h=!0),d++;h||(u=!0)}return u}function ul(e,t,n){var r=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var i=0,o=t.length-1;i<t.length;o=i++){var a=t[i][0],s=t[i][1],l=t[o][0],u=t[o][1];if(e[1]*(a-l)+s*(l-e[0])+u*(e[0]-a)===0&&(a-e[0])*(l-e[0])<=0&&(s-e[1])*(u-e[1])<=0)return!n;s>e[1]!=u>e[1]&&e[0]<(l-a)*(e[1]-s)/(u-s)+a&&(r=!r)}return r}function cl(){var e=this;return{enableGPS:function(){return I(e,void 0,void 0,function(){return z(this,function(e){return[2,{success:!0}]})})},disableGPS:function(){},destroyGPS:function(){},requestGPSPermission:function(){return I(e,void 0,void 0,function(){return z(this,function(e){return[2,{granted:!1,denied:!1,prompt:!0,state:"prompt"}]})})},isGPSPermissionGranted:function(){return I(e,void 0,void 0,function(){return z(this,function(e){return[2,!1]})})},getGPSPosition:function(){return I(e,void 0,void 0,function(){return z(this,function(e){return[2,{coordinates:[0,0],accuracy:0,timestamp:0}]})})},isGPSEnabled:function(){return!1}}}function hl(){var e=this;return{enableCompass:function(){return I(e,void 0,void 0,function(){return z(this,function(e){return[2,!1]})})},disableCompass:function(){},addCallback:function(){},removeCallback:function(){},isCompassEnabled:function(){return!1},isCompassPermissionDenied:function(){return!1},getCompassHeading:function(){return null}}}function dl(){var e=this;return{start:function(){},stop:function(){},requestPermission:function(){return I(e,void 0,void 0,function(){return z(this,function(e){return[2,!1]})})}}}const pl=e=>{let t;const n=new Set,r=(e,r)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,o={setState:r,getState:i,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},a=t=e(r,i,o);return o},fl=e=>e?pl(e):pl;var gl={ready:!0,missing:[]};function ml(e){return{ready:0===e.length,missing:B([],e,!0)}}var vl=function(e){function t(t,n){var r=this,i=B([],t,!0);return(r=e.call(this,null!=n?n:"Not ready: missing ".concat(i.join(", ")))||this).name="NotReadyError",r.missing=i,r}return N(t,e),t}(Error),yl={ready:!1,missing:[]},wl={ready:!1,missing:[],modules:{mapDataService:yl,focusManager:yl,cameraDirector:yl,userLocation:yl,routingManager:yl,navigationEngine:yl}},bl=["mapDataService","focusManager","cameraDirector","userLocation","routingManager","navigationEngine"];function _l(){var e=new xl;return e.notifyMapLoaded(),e}var xl=function(){function e(){this.camera={moveTo:function(){},getZoom:function(){return 0},fitBounds:function(){}},this.cameraAttached=!1,this.followBreaker={breakFollow:function(){}},this.mapLoaded=!1,this.pending=null}return e.prototype.attachCamera=function(e){this.camera=e,this.cameraAttached=!0,this.flushIfReady()},e.prototype.detachCamera=function(){this.camera={moveTo:function(){},getZoom:function(){return 0},fitBounds:function(){}},this.cameraAttached=!1,this.mapLoaded=!1},e.prototype.attachFollowBreaker=function(e){this.followBreaker=e},e.prototype.detachFollowBreaker=function(){this.followBreaker={breakFollow:function(){}}},e.prototype.notifyMapLoaded=function(){this.mapLoaded=!0,this.flushIfReady()},e.prototype.submit=function(e,t){this.canWrite()?this.write(e,t):this.pending={stop:e,reason:t}},e.prototype.getZoom=function(){return this.camera.getZoom()},e.prototype.getReadiness=function(){return this.cameraAttached?gl:ml(["camera"])},e.prototype.canWrite=function(){return this.mapLoaded&&this.cameraAttached},e.prototype.flushIfReady=function(){if(this.canWrite()&&this.pending){var e=this.pending;this.pending=null,this.write(e.stop,e.reason)}},e.prototype.write=function(e,t){"focus"===t&&this.followBreaker.breakFollow(),this.camera.moveTo(e)},e}();function Sl(e){if(!e||!Array.isArray(e))return null;try{var t=e,n=t[0];if(!n)return null;var r=void 0;if(Array.isArray(n)){var i=n[0];if(2===t.length&&Array.isArray(i)&&"number"==typeof i[0]){var o=n,a=t[1];r=[[[o[0],o[1]],[a[0],o[1]],[a[0],a[1]],[o[0],a[1]],[o[0],o[1]]]]}else if("number"==typeof i&&n.length>=2){var s=t;if(!function(e){if(!e||e.length<3)return!1;for(var t=0,n=e;t<n.length;t++){var r=n[t];if(!Array.isArray(r)||"number"!=typeof r[0]||"number"!=typeof r[1])return!1}return!0}(s))return null;r=[s]}else{if(!Array.isArray(i)||"number"!=typeof i[0])return null;r=t}}else{if(!("number"==typeof n&&t.length>=4))return null;r=[[[t[0],t[1]],[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],[t[0],t[1]]]]}return function(e,t,n){void 0===n&&(n={});for(var r=0,i=e;r<i.length;r++){var o=i[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw new Error("First and last Position are not equivalent.")}return me({type:"Polygon",coordinates:e},t,n)}(r)}catch(e){return null}}var Al,Pl=function(){function e(){this.defaultFocusedTaxonomy="",this.currentFocus="",this.stylePort={readLayers:function(){return[]},commitLayers:function(){}},this.styleAttached=!1,this.cameraDirector=_l(),this.focusChangeListeners=new Set}return e.prototype.attachStyle=function(e){this.stylePort=e,this.styleAttached=!0},e.prototype.detachStyle=function(){this.stylePort={readLayers:function(){return[]},commitLayers:function(){}},this.styleAttached=!1},e.prototype.attachCameraDirector=function(e){this.cameraDirector=e},e.prototype.detachCameraDirector=function(){this.cameraDirector=_l()},e.prototype.subscribeToFocusChange=function(e){var t=this;return this.focusChangeListeners.add(e),function(){t.focusChangeListeners.delete(e)}},e.prototype.getReadiness=function(){return this.styleAttached?gl:ml(["style"])},e.prototype.commit=function(e,t){if(void 0===t&&(t={}),e){var n=!0===t.moveCamera;this.currentFocus=e;var r=this.stylePort.readLayers();if(Array.isArray(r)&&r.length>0){var i=function(e,t){if(t){var n=qs(t);if(e.length>0)for(var r=0;r<e.length;r+=1){var i=e[r].id;Vs.includes(i)||Zs(e[r],n)}return e}}(r,e);i&&this.stylePort.commitLayers(i)}if(n){var o=this.getFlyToLocation(e,!0);(null==o?void 0:o.center)&&this.cameraDirector.submit({center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch,durationMs:1200,easing:"ease"},"focus")}this.focusChangeListeners.forEach(function(t){try{t(e)}catch(e){}})}},e.prototype.getDefaultFocusedTaxonomy=function(){return this.defaultFocusedTaxonomy},e.prototype.setDefaultFocusedTaxonomy=function(e){this.defaultFocusedTaxonomy=e},e.prototype.getCurrentFocus=function(){return this.currentFocus},e.prototype.setCurrentFocus=function(e){this.currentFocus=e},e.prototype.getCurrentFocusBuilding=function(){var e=zs(this.currentFocus);return e?Ns(e)?Us(this.currentFocus):e:null},e.prototype.getCurrentFocusFloor=function(){var e=zs(this.currentFocus);return e&&Ns(e)?e:null},e.prototype.getUserViewportBuilding=function(e){var t,n=ve(e),r=null;return t=function(e){if(!r&&!Ns(e)&&e.bounds){var t=Sl(e.bounds);t&&ll(n,t)&&(r=e)}},js(Fs(),t),r},e.prototype.checkUserViewport=function(e,t,n){var r=ve(e);if(null==t)return!1;if(!Object.prototype.hasOwnProperty.call(t,"bounds"))return!1;var i=Sl(t.bounds),o=!!i&&ll(r,i);if(null==n)return o;if(!Object.prototype.hasOwnProperty.call(n,"bounds"))return o;var a=Sl(n.bounds),s=!!a&&ll(r,a);return o||s},e.prototype.changeToUserViewpoint=function(e,t){if(void 0===t&&(t={}),!this.checkUserViewport(e,this.getCurrentFocusBuilding(),this.getCurrentFocusFloor())){var n=this.getUserViewportBuilding(e);if(n){var r=null!=t?t:{};n.taxonomyPath&&n.taxonomyPath in r?this.commit(r[n.taxonomyPath],{moveCamera:!1}):n.name&&n.name in r?this.commit(r[n.name],{moveCamera:!1}):n.defaultFloorPath&&this.commit(n.defaultFloorPath,{moveCamera:!1})}}},e.prototype.getFlyToLocation=function(e,t){void 0===t&&(t=!0);var n="[getFlyToLocation]",r="Please review the where taxonomy camera configuration in Spatialverse Configurator → Map Config → Taxonomies page.",i=function(e){if(!(null==e?void 0:e.cameraConfigs))return null;var n=t?e.cameraConfigs.mobile||e.cameraConfigs.web:e.cameraConfigs.web||e.cameraConfigs.mobile;return!(null==n?void 0:n.center)||!Array.isArray(n.center)||n.center.length<2?null:n},o=zs(e);if(!o)return console.error(n,'Where taxonomy "'.concat(e,'" was not found in the focus tree. ').concat(r),{whereTaxonomyPath:e}),null;var a,s,l=i(o);if(l)return l;a=e,s=o,console.warn(n,'Camera config for where taxonomy "'.concat(a,'" was not found. ').concat(r),{whereTaxonomyPath:a,node:s?{name:s.name,taxonomyPath:s.taxonomyPath,cameraConfigs:s.cameraConfigs}:void 0,isMobile:t});for(var u=Bs(e),c=u.length-1;c>=0;c-=1){var h=i(u[c]);if(h)return h}if(!Ns(o))for(var d=0,p=Os(o);d<p.length;d++){var f=i(p[d]);if(f)return f}return console.error(n,'Camera config not found for where taxonomy "'.concat(e,'" and no ancestor or child fallback was available. ').concat(r),{whereTaxonomyPath:e,matchedNode:{name:o.name,taxonomyPath:o.taxonomyPath},ancestorsChecked:u.map(function(e){return e.taxonomyPath})}),null},e.prototype.getFloorAltitudeRangesForBuilding=function(e){var t=zs(e);if(!t)return[];for(var n=[],r=0,i=Os(t);r<i.length;r++){var o=i[r];if(Ns(o)&&o.taxonomyPath){var a=o.altMin,s=o.altMax;"number"!=typeof a||"number"!=typeof s||Number.isNaN(a)||Number.isNaN(s)||n.push({whereDimension:o.taxonomyPath,minAltitude:a,maxAltitude:s})}}return n.sort(function(e,t){return e.minAltitude-t.minAltitude})},e.prototype.isLngLatInsideBuildingFocusBounds=function(e,t){var n=function(e){var t=zs(e);if(!t)return null;var n=Sl(t.bounds);if(n)return n;var r=Us(e);return Sl(null==r?void 0:r.bounds)}(t);if(!n)return!1;try{return ll(ve(e),n)}catch(e){return!1}},e}();function Ml(){return Al||(Al=new Pl),Al}var Cl=function(){function e(e){var t,n;void 0===e&&(e={}),this.floorRanges=[],this.getFloorRangesFromFocusTree=null,this.currentAltitude=null,this.currentFloor=null,this.onFloorChangeCallbacks=new Set,this.floorRanges=null!==(t=e.floorRanges)&&void 0!==t?t:[],this.getFloorRangesFromFocusTree=null!==(n=e.getFloorRangesFromFocusTree)&&void 0!==n?n:null}return e.prototype.setFloorRanges=function(e){this.floorRanges=B([],e,!0).sort(function(e,t){return e.minAltitude-t.minAltitude})},e.prototype.setGetFloorRangesFromFocusTree=function(e){this.getFloorRangesFromFocusTree=e},e.prototype.updateAltitude=function(e){var t,n=e.altitude;if(!(null==n||isNaN(n)||n<0)){this.currentAltitude=n;var r=null!==(t=this.getFloorRanges())&&void 0!==t?t:this.floorRanges,i=this.altitudeToFloor(n,r);if(i&&i!==this.currentFloor){var o=this.currentFloor;this.currentFloor=i,this.onFloorChangeCallbacks.forEach(function(e){try{e(o,i)}catch(e){}})}else i&&(this.currentFloor=i)}},e.prototype.getCurrentFloor=function(){return this.currentFloor},e.prototype.getCurrentAltitude=function(){return this.currentAltitude},e.prototype.onFloorChange=function(e){var t=this;return this.onFloorChangeCallbacks.add(e),function(){return t.onFloorChangeCallbacks.delete(e)}},e.prototype.altitudeToFloor=function(e,t){for(var n=0,r=t;n<r.length;n++){var i=r[n];if(e>=i.minAltitude&&e<=i.maxAltitude)return i.whereDimension}return null},e.prototype.getFloorRanges=function(){if(this.getFloorRangesFromFocusTree)try{return this.getFloorRangesFromFocusTree()}catch(e){return null}return null},e.prototype.reset=function(){this.currentAltitude=null,this.currentFloor=null},e.prototype.destroy=function(){this.reset(),this.onFloorChangeCallbacks.clear(),this.getFloorRangesFromFocusTree=null,this.floorRanges=[]},e}(),kl=function(){function e(e,t,n){var r,i,o;void 0===n&&(n={}),this.proposalListeners=new Set,this.acceptedListeners=new Set,this.autoRejectedListeners=new Set,this.lastProposalTime=0,this.whereProposalSentAtMs=new Map,this.isActive=!1,this.gpsCallbackRef=null,this.pendingProposalId=null,this.pendingWhereTaxonomyPath=null,this.isAwaitingDecision=!1,this.lastAcceptedTaxonomyPath=null,this.gpsController=e,this.altitudeManager=t,this.proposalCooldownMs=null!==(r=n.proposalCooldownMs)&&void 0!==r?r:2e3,this.autoAcceptCooldownMs=null!==(i=n.autoAcceptCooldownMs)&&void 0!==i?i:2e4,this.portalAutoAcceptCooldownMs=null!==(o=n.portalAutoAcceptCooldownMs)&&void 0!==o?o:2e4,this.portalLiftAutoAcceptCooldownMs=n.portalLiftAutoAcceptCooldownMs}return e.prototype.start=function(){var e=this;this.isActive||(this.gpsCallbackRef=function(t){return e.evaluate(t)},this.gpsController.addCallback({onLocationUpdate:this.gpsCallbackRef}),this.isActive=!0)},e.prototype.stop=function(){this.isActive&&(this.gpsCallbackRef=null,this.clearPending(),this.lastProposalTime=0,this.lastAcceptedTaxonomyPath=null,this.whereProposalSentAtMs.clear(),this.isActive=!1)},e.prototype.resetLastAcceptedPath=function(){this.lastAcceptedTaxonomyPath=null},e.prototype.resetPortalProposalSuppression=function(){for(var e=0,t=B([],this.whereProposalSentAtMs.keys(),!0);e<t.length;e++){var n=t[e];n.startsWith("portal:")&&this.whereProposalSentAtMs.delete(n)}},e.prototype.addWhereTaxonomyUpdateProposedListener=function(e){this.proposalListeners.add(e)},e.prototype.removeWhereTaxonomyUpdateProposedListener=function(e){this.proposalListeners.delete(e)},e.prototype.addWhereTaxonomyUpdateAcceptedListener=function(e){this.acceptedListeners.add(e)},e.prototype.removeWhereTaxonomyUpdateAcceptedListener=function(e){this.acceptedListeners.delete(e)},e.prototype.addWhereTaxonomyUpdateAutoRejectedListener=function(e){this.autoRejectedListeners.add(e)},e.prototype.removeWhereTaxonomyUpdateAutoRejectedListener=function(e){this.autoRejectedListeners.delete(e)},e.prototype.removeAllListeners=function(){this.proposalListeners.clear(),this.acceptedListeners.clear(),this.autoRejectedListeners.clear()},e.prototype.acceptProposal=function(e){this.isAwaitingDecision&&this.pendingProposalId&&e===this.pendingProposalId&&this.pendingWhereTaxonomyPath&&(this.lastAcceptedTaxonomyPath=this.pendingWhereTaxonomyPath,this.lastProposalTime=Date.now(),this.publishAccepted(this.pendingWhereTaxonomyPath),this.clearPending())},e.prototype.setLastAcceptedTaxonomyPath=function(e){this.lastAcceptedTaxonomyPath=e},e.prototype.getLastAcceptedTaxonomyPath=function(){return this.lastAcceptedTaxonomyPath},e.prototype.rejectProposal=function(e){this.isAwaitingDecision&&this.pendingProposalId&&e===this.pendingProposalId&&(this.lastProposalTime=Date.now(),this.clearPending())},e.prototype.manualOverride=function(e,t){this.isAwaitingDecision&&this.pendingProposalId&&e===this.pendingProposalId&&(this.lastAcceptedTaxonomyPath=t,this.lastProposalTime=Date.now(),this.publishAccepted(t),this.clearPending())},e.prototype.notifyManualFloorChange=function(e,t){void 0===t&&(t=!1),this.lastAcceptedTaxonomyPath!==e&&(this.lastAcceptedTaxonomyPath=e,this.publishAccepted(e,t))},e.prototype.proposeFromNavigation=function(t){var n,r;if(this.isAwaitingDecision)return!1;var i=Date.now();if(i-this.lastProposalTime<this.proposalCooldownMs)return!1;var o="portal:".concat(t.portalDedupeKey),a=this.whereProposalSentAtMs.get(o);if("number"==typeof a&&i-a<e.WHERE_PROPOSAL_SUPPRESSION_MS)return!1;var s=Ml().getCurrentFocus();if("string"==typeof s&&s===t.whereTaxonomyPath)return!1;if(this.lastAcceptedTaxonomyPath===t.whereTaxonomyPath)return!1;var l={segmentIndex:t.portal.segmentIndex,instructionLine:t.portal.instructionLine,portalName:null!==(n=t.portal.portalName)&&void 0!==n?n:void 0,description:null!==(r=t.portal.description)&&void 0!==r?r:void 0};return this.emitProposalPayload({kind:"portal",whereTaxonomyPath:t.whereTaxonomyPath,portalDedupeKey:t.portalDedupeKey,portal:l},i),!0},e.prototype.evaluate=function(e){},e.prototype.publishAccepted=function(e,t){void 0===t&&(t=!1),this.acceptedListeners.forEach(function(n){try{n(e,t)}catch(e){console.error("AutoFocusManager accepted listener error",e)}})},e.prototype.clearPending=function(){this.isAwaitingDecision=!1,this.pendingProposalId=null,this.pendingWhereTaxonomyPath=null},e.prototype.emitProposal=function(e,t,n){void 0===n&&(n=Date.now()),this.emitProposalPayload({kind:"altitude",whereTaxonomyPath:e},n)},e.prototype.resolvePortalAutoAcceptCooldownMs=function(e){var t,n,r,i,o="".concat(null!==(t=e.instructionLine)&&void 0!==t?t:""," ").concat(null!==(n=e.description)&&void 0!==n?n:""," ").concat(null!==(r=e.portalName)&&void 0!==r?r:"").toLowerCase();return/\blift\b|elevator/.test(o)?null!==(i=this.portalLiftAutoAcceptCooldownMs)&&void 0!==i?i:2*this.portalAutoAcceptCooldownMs:this.portalAutoAcceptCooldownMs},e.prototype.emitProposalPayload=function(e,t){var n="altitude"===e.kind?e.whereTaxonomyPath:"portal:".concat(e.portalDedupeKey);this.whereProposalSentAtMs.set(n,t);var r=this.generateId();this.pendingProposalId=r,this.pendingWhereTaxonomyPath=e.whereTaxonomyPath,this.isAwaitingDecision=!0;var i="altitude"===e.kind?{kind:"altitude",whereTaxonomyPath:e.whereTaxonomyPath,id:r,autoAcceptCooldownMs:this.autoAcceptCooldownMs}:{kind:"portal",whereTaxonomyPath:e.whereTaxonomyPath,id:r,autoAcceptCooldownMs:this.resolvePortalAutoAcceptCooldownMs(e.portal),portal:e.portal};this.proposalListeners.forEach(function(e){try{e(i)}catch(e){console.error("AutoFocusManager proposal listener error.",e)}})},e.prototype.generateId=function(){return"proposal_".concat(Date.now(),"_").concat(Math.random().toString(36).slice(2,10))},e.WHERE_PROPOSAL_SUPPRESSION_MS=6e4,e}(),El={pendingWhere:"",proposalId:null,proposalKind:null,portalMeta:null,isAwaitingDecision:!1,showTaxonomyUpdatePopup:!1,autoAcceptCooldownMs:0};function Tl(e,t,n){if(null!==e)for(var r,i,o,a,s,l,u,c,h=0,d=0,p=e.type,f="FeatureCollection"===p,g="Feature"===p,m=f?e.features.length:1,v=0;v<m;v++){s=(c=!!(u=f?e.features[v].geometry:g?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var y=0;y<s;y++){var w=0,b=0;if(null!==(a=c?u.geometries[y]:u)){l=a.coordinates;var _=a.type;switch(h=!n||"Polygon"!==_&&"MultiPolygon"!==_?0:1,_){case null:break;case"Point":if(!1===t(l,d,v,w,b))return!1;d++,w++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],d,v,w,b))return!1;d++,"MultiPoint"===_&&w++}"LineString"===_&&w++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-h;i++){if(!1===t(l[r][i],d,v,w,b))return!1;d++}"MultiLineString"===_&&w++,"Polygon"===_&&b++}"Polygon"===_&&w++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(b=0,i=0;i<l[r].length;i++){for(o=0;o<l[r][i].length-h;o++){if(!1===t(l[r][i][o],d,v,w,b))return!1;d++}b++}w++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===Tl(a.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ll(e){var t=[1/0,1/0,-1/0,-1/0];return Tl(e,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}function Rl(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function Dl(e,t){void 0===t&&(t={});var n=Ll(e);return function(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Rl(e[0])||!Rl(e[1]))throw new Error("coordinates must contain numbers");return function(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}({type:"Point",coordinates:e},t,n)}([(n[0]+n[2])/2,(n[1]+n[3])/2],t.properties,t)}Ll.default=Ll;var Fl=6371008.8,Ol={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:Fl,metres:Fl,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:3440.069546436285,radians:1,yards:6967335.223679999};function Nl(e,t,n){if(void 0===n&&(n={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return function(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}({type:"LineString",coordinates:e},t,n)}function jl(e){return e%360*Math.PI/180}function Il(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function zl(e,t,n){void 0===n&&(n={});var r=Il(e),i=Il(t),o=jl(i[1]-r[1]),a=jl(i[0]-r[0]),s=jl(r[1]),l=jl(i[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return function(e,t){void 0===t&&(t="kilometers");var n=Ol[t];if(!n)throw new Error(t+" units is invalid");return e*n}(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),n.units)}function Bl(e,t,n,r){if(!(i=r=r||{})||i.constructor!==Object)throw new Error("options is invalid");var i,o,a=[];if("Feature"===e.type)o=e.geometry.coordinates;else{if("LineString"!==e.type)throw new Error("input must be a LineString Feature or Geometry");o=e.coordinates}for(var s,l,u,c=o.length,h=0,d=0;d<o.length&&!(t>=h&&d===o.length-1);d++){if(h>t&&0===a.length){if(!(s=t-h))return a.push(o[d]),Nl(a);l=ia(o[d],o[d-1])-180,u=ca(o[d],s,l,r),a.push(u.geometry.coordinates)}if(h>=n)return(s=n-h)?(l=ia(o[d],o[d-1])-180,u=ca(o[d],s,l,r),a.push(u.geometry.coordinates),Nl(a)):(a.push(o[d]),Nl(a));if(h>=t&&a.push(o[d]),d===o.length-1)return Nl(a);h+=zl(o[d],o[d+1],r)}if(h<t&&o.length===c)throw new Error("Start position is beyond line");var p=o[o.length-1];return Nl([p,p])}for(var Ul=function(){function e(){this.localStoarge=new E}return e.prototype.contains=function(e){return this.localStoarge.contains(e)},e.prototype.getString=function(e){return this.localStoarge.getString(e)},e.prototype.set=function(e,t){this.localStoarge.set(e,t)},e.prototype.clearAll=function(){this.localStoarge.clearAll()},e}(),Hl={},Gl={byteLength:function(e){var t=$l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},toByteArray:function(e){var t,n,r=$l(e),i=r[0],o=r[1],a=new ql(function(e,t,n){return 3*(t+n)/4-n}(0,i,o)),s=0,l=o>0?i-4:i;for(n=0;n<l;n+=4)t=Vl[e.charCodeAt(n)]<<18|Vl[e.charCodeAt(n+1)]<<12|Vl[e.charCodeAt(n+2)]<<6|Vl[e.charCodeAt(n+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=Vl[e.charCodeAt(n)]<<2|Vl[e.charCodeAt(n+1)]>>4,a[s++]=255&t);1===o&&(t=Vl[e.charCodeAt(n)]<<10|Vl[e.charCodeAt(n+1)]<<4|Vl[e.charCodeAt(n+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},fromByteArray:function(e){for(var t,n=e.length,r=n%3,i=[],o=16383,a=0,s=n-r;a<s;a+=o)i.push(Kl(e,a,a+o>s?s:a+o));1===r?(t=e[n-1],i.push(Wl[t>>2]+Wl[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(Wl[t>>10]+Wl[t>>4&63]+Wl[t<<2&63]+"="));return i.join("")}},Wl=[],Vl=[],ql="undefined"!=typeof Uint8Array?Uint8Array:Array,Zl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yl=0;Yl<64;++Yl)Wl[Yl]=Zl[Yl],Vl[Zl.charCodeAt(Yl)]=Yl;function $l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function Jl(e){return Wl[e>>18&63]+Wl[e>>12&63]+Wl[e>>6&63]+Wl[63&e]}function Kl(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(Jl(r));return i.join("")}Vl["-".charCodeAt(0)]=62,Vl["_".charCodeAt(0)]=63;var Xl={
1
+ import e from"react-native-geolocation-service";import{PermissionsAndroid as t,Platform as n,Animated as r,Easing as i,StyleSheet as o,View as a}from"react-native";import s from"react-native-compass-heading";import l,{useState as u,useRef as c,useEffect as h,useImperativeHandle as d,useMemo as p,forwardRef as f,isValidElement as g,useCallback as m}from"react";import{ShapeSource as v,CircleLayer as y,SymbolLayer as w,Animated as b,LineLayer as _,FillLayer as x,MarkerView as S,MapView as A,Camera as P,Images as M,VectorSource as C}from"@maplibre/maplibre-react-native";export{Animated,CircleLayer,FillLayer,ShapeSource as GeoJSONSource,ImageSource,Images,LineLayer,MarkerView as Marker,MarkerView,RasterSource,ShapeSource,SymbolLayer,VectorSource}from"@maplibre/maplibre-react-native";import T from"axios";import{MMKV as k}from"react-native-mmkv";import E from"react-native-aes-crypto";import R from"react-native-fs";import{unzip as L,unzipWithPassword as D}from"react-native-zip-archive";import F from"@react-native-community/netinfo";var N=function(e,t){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},N(e,t)};function O(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}N(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var j=function(){return j=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},j.apply(this,arguments)};function I(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function z(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function B(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function H(e,t,n){return t=Z(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,$()?Reflect.construct(t,n||[],Z(e).constructor):t.apply(e,n))}function G(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function W(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ee(r.key),r)}}function V(e,t,n){return t&&W(e.prototype,t),n&&W(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function q(e,t,n){return(t=ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Z(e)}function Y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&J(e,t)}function $(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return($=function(){return!!e})()}function K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?K(Object(n),!0).forEach(function(t){q(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function J(e,t){return J=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},J(e,t)}function Q(e){return function(e){if(Array.isArray(e))return U(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return U(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?U(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ee(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function te(e){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(e)}var ne=function(){function r(){this.gpsEnabled=!1,this.gpsWatchId=null,this.currentGPSPosition=null,this.gpsCallbacks={}}return r.prototype.requestGPSPermission=function(){return I(this,void 0,void 0,function(){var r,i,o,a,s;return z(this,function(l){switch(l.label){case 0:return l.trys.push([0,9,,10]),"android"!==n.OS?[3,4]:(r=t.PERMISSIONS.ACCESS_FINE_LOCATION,i=t.PERMISSIONS.ACCESS_COARSE_LOCATION,[4,t.check(r)]);case 1:return o=l.sent(),[4,t.check(i)];case 2:return a=l.sent(),o||a?[2,{granted:!0,denied:!1,prompt:!1,state:"granted"}]:[4,t.request(r)];case 3:return(s=l.sent())===t.RESULTS.GRANTED?[2,{granted:!0,denied:!1,prompt:!1,state:"granted"}]:s===t.RESULTS.DENIED?[2,{granted:!1,denied:!1,prompt:!0,state:"prompt"}]:[2,{granted:!1,denied:!0,prompt:!1,state:"denied"}];case 4:if(!e.requestAuthorization)return[3,8];l.label=5;case 5:return l.trys.push([5,7,,8]),[4,e.requestAuthorization("whenInUse")];case 6:switch(s=l.sent()){case"granted":return[2,{granted:!0,denied:!1,prompt:!1,state:"granted"}];case"denied":return[2,{granted:!1,denied:!0,prompt:!1,state:"denied"}];case"disabled":case"restricted":return[2,{granted:!1,denied:!0,prompt:!1,state:"blocked"}];default:return[2,{granted:!1,denied:!1,prompt:!0,state:"prompt"}]}return[3,8];case 7:return l.sent(),[2,{granted:!1,denied:!0,prompt:!1,state:"denied"}];case 8:return[2,{granted:!1,denied:!1,prompt:!0,state:"prompt"}];case 9:return l.sent(),[2,{granted:!1,denied:!1,prompt:!0,state:"prompt"}];case 10:return[2]}})})},r.prototype.isGPSPermissionGranted=function(){return I(this,void 0,void 0,function(){return z(this,function(e){switch(e.label){case 0:return[4,this.requestGPSPermission()];case 1:return[2,e.sent().granted]}})})},r.prototype.enableGPS=function(e){return void 0===e&&(e={}),I(this,void 0,void 0,function(){var t;return z(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e.callbacks&&e.callbacks!==this.gpsCallbacks&&(this.gpsCallbacks=e.callbacks),[4,this.isGPSPermissionGranted()];case 1:if(!n.sent())throw{type:"permission_denied",message:"GPS permission is required to enable location services."};return this.startGPS(e),[2,{success:!0}];case 2:return t=n.sent(),this.handleGPSError(t),[2,{success:!1,warning:{type:"unavailable",message:"Failed to enable GPS due to an unexpected error."}}];case 3:return[2]}})})},r.prototype.disableGPS=function(){var e;this.stopGPS(),this.currentGPSPosition=null,(null===(e=this.gpsCallbacks)||void 0===e?void 0:e.onToggle)&&this.gpsCallbacks.onToggle(!1)},r.prototype.destroyGPS=function(){this.disableGPS(),this.gpsCallbacks={}},r.prototype.startGPS=function(t){var n=this;void 0===t&&(t={});var r=t.enableHighAccuracy,i=void 0===r||r,o=t.timeout,a=void 0===o?1e4:o,s=t.maximumAge,l=void 0===s?0:s;if(!e||!e.watchPosition){var u=new Error("Geolocation is not supported by this runtime.");throw u.code=0,u}this.gpsEnabled=!0;var c={enableHighAccuracy:i,timeout:a,maximumAge:l,distanceFilter:0,interval:100,fastestInterval:10};this.gpsWatchId=e.watchPosition(function(e){var t=n.mapNativePosition(e);n.currentGPSPosition=t,n.gpsCallbacks.onLocationUpdate&&n.gpsCallbacks.onLocationUpdate(t)},function(e){n.handleGPSError(e)},c)},r.prototype.stopGPS=function(){if(this.gpsEnabled=!1,null!==this.gpsWatchId){try{e.clearWatch(this.gpsWatchId)}catch(e){}this.gpsWatchId=null}},r.prototype.getGPSPosition=function(t){var n=this;void 0===t&&(t={});var r=t.enableHighAccuracy,i=void 0===r||r,o=t.timeout,a=void 0===o?1e4:o,s=t.maximumAge,l=void 0===s?15e3:s;return new Promise(function(t,r){e&&e.getCurrentPosition?e.getCurrentPosition(function(e){var r=n.mapNativePosition(e);n.currentGPSPosition=r,t(r)},function(e){return r(e)},{enableHighAccuracy:i,timeout:a,maximumAge:l}):r(new Error("Geolocation is not supported by this runtime."))})},r.prototype.isGPSEnabled=function(){return this.gpsEnabled},r.prototype.getCurrentGPSPosition=function(){return this.currentGPSPosition},r.prototype.handleGPSError=function(e){var t="Unknown GPS error occurred.",n=e&&"object"===te(e)&&"code"in e?Number(e.code):NaN;if(Number.isFinite(n))switch(n){case 1:t="GPS permission denied by user.";break;case 2:t="GPS position unavailable.";break;case 3:t="GPS request timed out."}this.gpsCallbacks.onError&&this.gpsCallbacks.onError(e,t)},r.prototype.mapNativePosition=function(e){var t,n,r,i;return{coordinates:[e.coords.longitude,e.coords.latitude],accuracy:e.coords.accuracy,timestamp:e.timestamp||Date.now(),heading:null!==(t=e.coords.heading)&&void 0!==t?t:void 0,speed:null!==(n=e.coords.speed)&&void 0!==n?n:void 0,altitude:null!==(r=e.coords.altitude)&&void 0!==r?r:void 0,altitudeAccuracy:null!==(i=e.coords.altitudeAccuracy)&&void 0!==i?i:void 0}},r}(),re=function(){function e(){this.compassEnabled=!1,this.currentCompassData=null,this.onUpdateCallbacks=new Set,this.onToggleCallbacks=new Set,this.onErrorCallbacks=new Set,this.degreeUpdateRate=3}return e.prototype.requestCompassPermission=function(){return I(this,void 0,void 0,function(){var e;return z(this,function(t){switch(t.label){case 0:console.log("🧭 Requesting compass permission..."),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.isCompassAvailable()];case 2:return t.sent()?(console.log("🧭 Compass permission granted (automatic)"),[2,{granted:!0,denied:!1,prompt:!1,state:"granted"}]):(console.warn("🧭 Compass not available on this device"),[2,{granted:!1,denied:!0,prompt:!1,state:"unavailable"}]);case 3:return e=t.sent(),console.error("🧭 Error checking compass availability:",e),[2,{granted:!1,denied:!0,prompt:!1,state:"denied"}];case 4:return[2]}})})},e.prototype.isCompassAvailable=function(){return I(this,void 0,void 0,function(){return z(this,function(e){try{return[2,new Promise(function(e){var t=!1,n=setTimeout(function(){t||(t=!0,e(!1))},500);try{s.start(1,function(r){r.heading,r.accuracy;t||(t=!0,clearTimeout(n),s.stop(),e(!0))})}catch(r){clearTimeout(n),t||(t=!0,e(!1))}})]}catch(e){return[2,!1]}return[2]})})},e.prototype.enableCompass=function(e){return I(this,void 0,void 0,function(){var t,n;return z(this,function(r){switch(r.label){case 0:if(this.compassEnabled)return console.log("🧭 Compass already enabled"),[2,!0];r.label=1;case 1:return r.trys.push([1,3,,4]),e&&this.addCallback(e),[4,this.requestCompassPermission()];case 2:return t=r.sent(),console.log("🧭 Compass permission status:",t),t.denied||!t.granted?(console.warn("🧭 Compass permission denied or not granted"),this.handleCompassError({type:"permission_denied",message:"Compass permission denied. Please enable device sensor access in device settings."}),[2,!1]):(console.log("🧭 Compass permission granted, starting compass..."),this.compassEnabled=!0,this.startCompass(),this.onToggleCallbacks.forEach(function(e){try{e(!0)}catch(e){}}),[2,!0]);case 3:return n=r.sent(),console.error("Error enabling compass:",n),this.compassEnabled=!1,this.handleCompassError({type:"unavailable",message:"Failed to enable compass"}),[2,!1];case 4:return[2]}})})},e.prototype.disableCompass=function(){this.compassEnabled&&(this.compassEnabled=!1,this.stopCompass(),this.currentCompassData=null,this.onToggleCallbacks.forEach(function(e){try{e(!1)}catch(e){}}))},e.prototype.startCompass=function(){var e=this;console.log("🧭 Starting compass listeners...");try{s.start(this.degreeUpdateRate,function(t){var n=t.heading,r=t.accuracy;e.handleCompassUpdate(n,r)})}catch(e){console.error("🧭 Error starting compass:",e),this.handleCompassError({type:"unavailable",message:"Failed to start compass tracking"})}},e.prototype.stopCompass=function(){try{s.stop()}catch(e){console.error("🧭 Error stopping compass:",e)}},e.prototype.handleCompassUpdate=function(e,t){if(this.compassEnabled)try{var n=null!==e&&!isNaN(e),r={heading:e,accuracy:null!=t?t:null,timestamp:Date.now(),isCalibrated:n};this.currentCompassData=r,this.onUpdateCallbacks.forEach(function(e){try{e(r)}catch(e){}})}catch(e){console.error("Error processing compass update:",e),this.handleCompassError({type:"inaccurate",message:"Error processing compass data"})}},e.prototype.triggerCompassUpdate=function(e,t){void 0===t&&(t=null);var n=null!==e&&!isNaN(e),r={heading:e,accuracy:null!=t?t:null,timestamp:Date.now(),isCalibrated:n};this.currentCompassData=r,this.onUpdateCallbacks.forEach(function(e){try{e(r)}catch(e){}})},e.prototype.handleCompassError=function(e){this.onErrorCallbacks.forEach(function(t){try{t(e)}catch(e){}}),this.onToggleCallbacks.forEach(function(e){try{e(!1)}catch(e){}})},e.prototype.getCurrentCompassData=function(){return this.currentCompassData},e.prototype.isCompassEnabled=function(){return this.compassEnabled},e.prototype.getCompassHeading=function(){var e;return(null===(e=this.currentCompassData)||void 0===e?void 0:e.heading)||null},e.prototype.isCompassCalibrated=function(){var e;return(null===(e=this.currentCompassData)||void 0===e?void 0:e.isCalibrated)||!1},e.prototype.addCallback=function(e){e.onCompassUpdate&&this.onUpdateCallbacks.add(e.onCompassUpdate),e.onCompassToggle&&this.onToggleCallbacks.add(e.onCompassToggle),e.onCompassError&&this.onErrorCallbacks.add(e.onCompassError)},e.prototype.removeCallback=function(e){e.onCompassUpdate&&this.onUpdateCallbacks.delete(e.onCompassUpdate),e.onCompassToggle&&this.onToggleCallbacks.delete(e.onCompassToggle),e.onCompassError&&this.onErrorCallbacks.delete(e.onCompassError)},e.prototype.isCompassPermissionDenied=function(){return!1},e.prototype.destroy=function(){this.disableCompass(),this.onUpdateCallbacks.clear(),this.onToggleCallbacks.clear(),this.onErrorCallbacks.clear(),this.currentCompassData=null},e}();function ie(e){var t=!1;return{getZoom:function(){return e.getZoom()},moveTo:function(n){var r,i=e.getCamera();if(i){var o=56===n.pitch,a=!o||!t;t=o;var s=a&&n.paddingFraction?function(e,t){var n,r,i,o;return{top:Math.round(t.height*(null!==(n=e.top)&&void 0!==n?n:0)),bottom:Math.round(t.height*(null!==(r=e.bottom)&&void 0!==r?r:0)),left:Math.round(t.width*(null!==(i=e.left)&&void 0!==i?i:0)),right:Math.round(t.width*(null!==(o=e.right)&&void 0!==o?o:0))}}(n.paddingFraction,e.getViewport()):void 0;i.setStop(j(j(j({center:n.center,bearing:n.bearing,pitch:n.pitch},a&&null!=n.zoom?{zoom:n.zoom}:{}),s?{padding:s}:{}),{duration:n.durationMs,easing:null!==(r=n.easing)&&void 0!==r?r:"linear"}))}},fitBounds:function(t,n){var r,i;null===(i=null===(r=e.getCamera())||void 0===r?void 0:r.fitBounds)||void 0===i||i.call(r,t,n)}}}function oe(e){var t,n=e.position,r=e.showAccuracy,i=void 0===r||r,o=e.pulse,a=void 0===o||o,s=e.color,f=void 0===s?"#1E90FF":s,g=e.pulseColor,m=void 0===g?"#b7d8f7":g,b=e.showArrow,_=void 0===b||b,x=e.ref,S=u(!0),A=S[0],P=S[1],M=u(!0),C=M[0],T=M[1],k=u(n),E=k[0],R=k[1],L=u(0),D=L[0],F=L[1],N=c(null),O=c({});h(function(){R(n)},[n]),h(function(){if(a){var e=Date.now(),t=function(){var n=(Date.now()-e)%2e3,r=.5*Math.sin(n/2e3*Math.PI*2)+.5;F(r),N.current=requestAnimationFrame(t)};return N.current=requestAnimationFrame(t),function(){N.current&&cancelAnimationFrame(N.current),N.current=null}}},[a]),d(x,function(){return Object.assign(O.current,{update:function(e,t,n){var r=null!=n&&Number.isFinite(n);R({coordinates:e,accuracy:t,timestamp:Date.now(),heading:r?n:void 0}),T(!r)},updateHeading:function(e){var t=null!=e&&Number.isFinite(e);R(function(n){return n?j(j({},n),{heading:t?e:void 0}):n}),T(!t)},show:function(){P(!0)},hide:function(){P(!1)},remove:function(){P(!1),R(null)}}),O.current});var I=p(function(){var e;return E&&A?{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:E.coordinates},properties:{radius:8,accuracy:E.accuracy,heading:null!==(e=E.heading)&&void 0!==e?e:0}}]}:{type:"FeatureCollection",features:[]}},[E,A]);if(!E||!A)return null;var z=a?8+9.6*D:8,B=a?Math.max(Math.min(.9*(1-.7*D),.9),.2):.95;return l.createElement(l.Fragment,null,l.createElement(v,{id:"gps-source",data:I},l.createElement(y,{id:"gps-accuracy",style:{circleColor:f,circleOpacity:.2,circleRadius:["*",["get","accuracy"],.6],circleStrokeColor:f,circleStrokeWidth:1,visibility:i?"visible":"none"}}),l.createElement(y,{id:"gps-pulse",style:{circleColor:m,circleOpacity:B,circleRadius:z,circleStrokeColor:m,circleStrokeWidth:2,visibility:C&&a?"visible":"none"}}),l.createElement(y,{id:"gps-dot",style:{circleColor:f,circleOpacity:.95,circleRadius:6,circleStrokeColor:"#ffffff",circleStrokeWidth:2,visibility:C?"visible":"none"}}),l.createElement(w,{id:"gps-arrow",style:{iconImage:"arrow-marker",iconSize:.05,iconAllowOverlap:!0,iconRotate:null!==(t=E.heading)&&void 0!==t?t:0,iconRotationAlignment:"map",iconIgnorePlacement:!0,visibility:!C&&null!=E.heading&&Number.isFinite(E.heading)&&_?"visible":"none"}})))}function ae(){var e;try{return null!==(e=require("expo-sensors").DeviceMotion)&&void 0!==e?e:null}catch(e){return null}}function se(e){var t,n,r;return e?{x:null!==(t=e.x)&&void 0!==t?t:0,y:null!==(n=e.y)&&void 0!==n?n:0,z:null!==(r=e.z)&&void 0!==r?r:0}:null}function le(){var e=null;return{isSupported:function(){return null!=ae()},requestPermission:function(){return I(this,void 0,void 0,function(){var e,t;return z(this,function(n){switch(n.label){case 0:if(!(e=ae()))return[2,!1];n.label=1;case 1:return n.trys.push([1,6,,7]),"function"!=typeof e.isAvailableAsync?[3,3]:[4,e.isAvailableAsync()];case 2:if(!n.sent())return[2,!0];n.label=3;case 3:return"function"!=typeof e.requestPermissionsAsync?[3,5]:[4,e.requestPermissionsAsync()];case 4:return[2,"granted"===(null==(t=n.sent())?void 0:t.status)];case 5:return[2,!0];case 6:return n.sent(),[2,!1];case 7:return[2]}})})},start:function(t){var n,r=ae();if(r){null==e||e(),null===(n=r.setUpdateInterval)||void 0===n||n.call(r,16);var i=r.addListener(function(e){t(function(e,t){var n,r,i;void 0===t&&(t=Date.now());var o=e.rotationRate;return{timestampMs:t,accelerationIncludingGravity:se(e.accelerationIncludingGravity),acceleration:se(e.acceleration),rotationRate:o?{alpha:null!==(n=o.alpha)&&void 0!==n?n:0,beta:null!==(r=o.beta)&&void 0!==r?r:0,gamma:null!==(i=o.gamma)&&void 0!==i?i:0}:null,interval:"number"==typeof e.interval&&e.interval>0?e.interval:16}}(e))});e=function(){return i.remove()}}},stop:function(){null==e||e(),e=null}}}function ue(){return globalThis.DeviceMotionEvent}var ce,he,de=(ce=le(),he=null,{isSupported:function(){return ce.isSupported()||!!ue()},requestPermission:function(){return I(this,void 0,void 0,function(){var e;return z(this,function(t){switch(t.label){case 0:if(ce.isSupported())return[2,ce.requestPermission()];if(!(null==(e=ue())?void 0:e.requestPermission))return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e.requestPermission()];case 2:return[2,"granted"===t.sent()];case 3:return t.sent(),[2,!1];case 4:return[2,!!e]}})})},start:function(e){ce.isSupported()?ce.start(e):(null==he||he(),he=function(e){if("undefined"==typeof window||!ue())return null;var t=function(t){var n,r,i,o,a,s,l,u,c,h;e({timestampMs:Date.now(),accelerationIncludingGravity:t.accelerationIncludingGravity?{x:null!==(n=t.accelerationIncludingGravity.x)&&void 0!==n?n:0,y:null!==(r=t.accelerationIncludingGravity.y)&&void 0!==r?r:0,z:null!==(i=t.accelerationIncludingGravity.z)&&void 0!==i?i:0}:null,acceleration:t.acceleration?{x:null!==(o=t.acceleration.x)&&void 0!==o?o:0,y:null!==(a=t.acceleration.y)&&void 0!==a?a:0,z:null!==(s=t.acceleration.z)&&void 0!==s?s:0}:null,rotationRate:t.rotationRate?{alpha:null!==(l=t.rotationRate.alpha)&&void 0!==l?l:0,beta:null!==(u=t.rotationRate.beta)&&void 0!==u?u:0,gamma:null!==(c=t.rotationRate.gamma)&&void 0!==c?c:0}:null,interval:null!==(h=t.interval)&&void 0!==h?h:16})};return window.addEventListener("devicemotion",t),function(){return window.removeEventListener("devicemotion",t)}}(e))},stop:function(){ce.stop(),null==he||he(),he=null}}),pe=function(){function e(e){void 0===e&&(e=de),this.handler=null,this.listening=!1,this.source=e}return e.prototype.requestPermission=function(){return I(this,void 0,void 0,function(){return z(this,function(e){return[2,this.source.requestPermission()]})})},e.prototype.isSupported=function(){return this.source.isSupported()},e.prototype.start=function(e){var t=this;this.handler=e,this.listening=!0,this.source.start(function(e){var n;t.listening&&(null===(n=t.handler)||void 0===n||n.call(t,e))})},e.prototype.stop=function(){this.listening=!1,this.handler=null,this.source.stop()},e}(),fe=6371008.8,ge={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:fe,metres:fe,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:3440.069546436285,radians:1,yards:6967335.223679999};function me(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function ve(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Pe(e[0])||!Pe(e[1]))throw new Error("coordinates must contain numbers");return me({type:"Point",coordinates:e},t,n)}function ye(e,t,n){if(void 0===n&&(n={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return me({type:"LineString",coordinates:e},t,n)}function we(e,t){void 0===t&&(t={});var n={type:"FeatureCollection"};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}function be(e,t,n){return void 0===n&&(n={}),me({type:"MultiPoint",coordinates:e},t,n)}function _e(e,t){void 0===t&&(t="kilometers");var n=ge[t];if(!n)throw new Error(t+" units is invalid");return e*n}function xe(e,t){void 0===t&&(t="kilometers");var n=ge[t];if(!n)throw new Error(t+" units is invalid");return e/n}function Se(e){return 180*(e%(2*Math.PI))/Math.PI}function Ae(e){return e%360*Math.PI/180}function Pe(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function Me(e){return!!e&&e.constructor===Object}var Ce="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Te(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ke=function(){this.__data__=[],this.size=0};var Ee=function(e,t){return e===t||e!=e&&t!=t},Re=Ee;var Le=function(e,t){for(var n=e.length;n--;)if(Re(e[n][0],t))return n;return-1},De=Le,Fe=Array.prototype.splice;var Ne=Le;var Oe=Le;var je=Le;var Ie=ke,ze=function(e){var t=this.__data__,n=De(t,e);return!(n<0)&&(n==t.length-1?t.pop():Fe.call(t,n,1),--this.size,!0)},Be=function(e){var t=this.__data__,n=Ne(t,e);return n<0?void 0:t[n][1]},Ue=function(e){return Oe(this.__data__,e)>-1},He=function(e,t){var n=this.__data__,r=je(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Ge(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ge.prototype.clear=Ie,Ge.prototype.delete=ze,Ge.prototype.get=Be,Ge.prototype.has=Ue,Ge.prototype.set=He;var We=Ge,Ve=We;var qe=function(){this.__data__=new Ve,this.size=0};var Ze=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var Ye=function(e){return this.__data__.get(e)};var $e=function(e){return this.__data__.has(e)},Ke="object"==typeof Ce&&Ce&&Ce.Object===Object&&Ce,Xe=Ke,Je="object"==typeof self&&self&&self.Object===Object&&self,Qe=Xe||Je||Function("return this")(),et=Qe.Symbol,tt=et,nt=Object.prototype,rt=nt.hasOwnProperty,it=nt.toString,ot=tt?tt.toStringTag:void 0;var at=function(e){var t=rt.call(e,ot),n=e[ot];try{e[ot]=void 0;var r=!0}catch(e){}var i=it.call(e);return r&&(t?e[ot]=n:delete e[ot]),i},st=Object.prototype.toString;var lt=at,ut=function(e){return st.call(e)},ct=et?et.toStringTag:void 0;var ht=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ct&&ct in Object(e)?lt(e):ut(e)};var dt=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},pt=ht,ft=dt;var gt,mt=function(e){if(!ft(e))return!1;var t=pt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},vt=Qe["__core-js_shared__"],yt=(gt=/[^.]+$/.exec(vt&&vt.keys&&vt.keys.IE_PROTO||""))?"Symbol(src)_1."+gt:"";var wt=function(e){return!!yt&&yt in e},bt=Function.prototype.toString;var _t=function(e){if(null!=e){try{return bt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},xt=mt,St=wt,At=dt,Pt=_t,Mt=/^\[object .+?Constructor\]$/,Ct=Function.prototype,Tt=Object.prototype,kt=Ct.toString,Et=Tt.hasOwnProperty,Rt=RegExp("^"+kt.call(Et).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Lt=function(e){return!(!At(e)||St(e))&&(xt(e)?Rt:Mt).test(Pt(e))},Dt=function(e,t){return null==e?void 0:e[t]};var Ft=function(e,t){var n=Dt(e,t);return Lt(n)?n:void 0},Nt=Ft(Qe,"Map"),Ot=Ft(Object,"create"),jt=Ot;var It=function(){this.__data__=jt?jt(null):{},this.size=0};var zt=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Bt=Ot,Ut=Object.prototype.hasOwnProperty;var Ht=function(e){var t=this.__data__;if(Bt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Ut.call(t,e)?t[e]:void 0},Gt=Ot,Wt=Object.prototype.hasOwnProperty;var Vt=Ot;var qt=It,Zt=zt,Yt=Ht,$t=function(e){var t=this.__data__;return Gt?void 0!==t[e]:Wt.call(t,e)},Kt=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Vt&&void 0===t?"__lodash_hash_undefined__":t,this};function Xt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Xt.prototype.clear=qt,Xt.prototype.delete=Zt,Xt.prototype.get=Yt,Xt.prototype.has=$t,Xt.prototype.set=Kt;var Jt=Xt,Qt=We,en=Nt;var tn=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var nn=function(e,t){var n=e.__data__;return tn(t)?n["string"==typeof t?"string":"hash"]:n.map},rn=nn;var on=nn;var an=nn;var sn=nn;var ln=function(){this.size=0,this.__data__={hash:new Jt,map:new(en||Qt),string:new Jt}},un=function(e){var t=rn(this,e).delete(e);return this.size-=t?1:0,t},cn=function(e){return on(this,e).get(e)},hn=function(e){return an(this,e).has(e)},dn=function(e,t){var n=sn(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}pn.prototype.clear=ln,pn.prototype.delete=un,pn.prototype.get=cn,pn.prototype.has=hn,pn.prototype.set=dn;var fn=We,gn=Nt,mn=pn;var vn=We,yn=qe,wn=Ze,bn=Ye,_n=$e,xn=function(e,t){var n=this.__data__;if(n instanceof fn){var r=n.__data__;if(!gn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new mn(r)}return n.set(e,t),this.size=n.size,this};function Sn(e){var t=this.__data__=new vn(e);this.size=t.size}Sn.prototype.clear=yn,Sn.prototype.delete=wn,Sn.prototype.get=bn,Sn.prototype.has=_n,Sn.prototype.set=xn;var An=Sn;var Pn=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},Mn=Ft,Cn=function(){try{var e=Mn(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Tn=function(e,t,n){"__proto__"==t&&Cn?Cn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},kn=Tn,En=Ee,Rn=Object.prototype.hasOwnProperty;var Ln=function(e,t,n){var r=e[t];Rn.call(e,t)&&En(r,n)&&(void 0!==n||t in e)||kn(e,t,n)},Dn=Ln,Fn=Tn;var Nn=function(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),i?Fn(n,s,l):Dn(n,s,l)}return n};var On=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var jn=function(e){return null!=e&&"object"==typeof e},In=ht,zn=jn;var Bn=function(e){return zn(e)&&"[object Arguments]"==In(e)},Un=jn,Hn=Object.prototype,Gn=Hn.hasOwnProperty,Wn=Hn.propertyIsEnumerable,Vn=Bn(function(){return arguments}())?Bn:function(e){return Un(e)&&Gn.call(e,"callee")&&!Wn.call(e,"callee")},qn=Array.isArray,Zn={};var Yn=function(){return!1};!function(e,t){var n=Qe,r=Yn,i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;e.exports=s}({get exports(){return Zn},set exports(e){Zn=e}},Zn);var $n=/^(?:0|[1-9]\d*)$/;var Kn=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&$n.test(e))&&e>-1&&e%1==0&&e<t};var Xn=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Jn=ht,Qn=Xn,er=jn,tr={};tr["[object Float32Array]"]=tr["[object Float64Array]"]=tr["[object Int8Array]"]=tr["[object Int16Array]"]=tr["[object Int32Array]"]=tr["[object Uint8Array]"]=tr["[object Uint8ClampedArray]"]=tr["[object Uint16Array]"]=tr["[object Uint32Array]"]=!0,tr["[object Arguments]"]=tr["[object Array]"]=tr["[object ArrayBuffer]"]=tr["[object Boolean]"]=tr["[object DataView]"]=tr["[object Date]"]=tr["[object Error]"]=tr["[object Function]"]=tr["[object Map]"]=tr["[object Number]"]=tr["[object Object]"]=tr["[object RegExp]"]=tr["[object Set]"]=tr["[object String]"]=tr["[object WeakMap]"]=!1;var nr=function(e){return er(e)&&Qn(e.length)&&!!tr[Jn(e)]};var rr=function(e){return function(t){return e(t)}},ir={};!function(e,t){var n=Ke,r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,o=i&&i.exports===r&&n.process,a=function(){try{var e=i&&i.require&&i.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}({get exports(){return ir},set exports(e){ir=e}},ir);var or=nr,ar=rr,sr=ir&&ir.isTypedArray,lr=sr?ar(sr):or,ur=On,cr=Vn,hr=qn,dr=Zn,pr=Kn,fr=lr,gr=Object.prototype.hasOwnProperty;var mr=function(e,t){var n=hr(e),r=!n&&cr(e),i=!n&&!r&&dr(e),o=!n&&!r&&!i&&fr(e),a=n||r||i||o,s=a?ur(e.length,String):[],l=s.length;for(var u in e)!t&&!gr.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||pr(u,l))||s.push(u);return s},vr=Object.prototype;var yr=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||vr)};var wr=function(e,t){return function(n){return e(t(n))}},br=wr(Object.keys,Object),_r=yr,xr=br,Sr=Object.prototype.hasOwnProperty;var Ar=mt,Pr=Xn;var Mr=function(e){return null!=e&&Pr(e.length)&&!Ar(e)},Cr=mr,Tr=function(e){if(!_r(e))return xr(e);var t=[];for(var n in Object(e))Sr.call(e,n)&&"constructor"!=n&&t.push(n);return t},kr=Mr;var Er=function(e){return kr(e)?Cr(e):Tr(e)},Rr=Nn,Lr=Er;var Dr=function(e,t){return e&&Rr(t,Lr(t),e)};var Fr=dt,Nr=yr,Or=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},jr=Object.prototype.hasOwnProperty;var Ir=mr,zr=function(e){if(!Fr(e))return Or(e);var t=Nr(e),n=[];for(var r in e)("constructor"!=r||!t&&jr.call(e,r))&&n.push(r);return n},Br=Mr;var Ur=function(e){return Br(e)?Ir(e,!0):zr(e)},Hr=Nn,Gr=Ur;var Wr=function(e,t){return e&&Hr(t,Gr(t),e)},Vr={};!function(e,t){var n=Qe,r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,o=i&&i.exports===r?n.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}({get exports(){return Vr},set exports(e){Vr=e}},Vr);var qr=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var Zr=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o};var Yr=function(){return[]},$r=Zr,Kr=Yr,Xr=Object.prototype.propertyIsEnumerable,Jr=Object.getOwnPropertySymbols,Qr=Jr?function(e){return null==e?[]:(e=Object(e),$r(Jr(e),function(t){return Xr.call(e,t)}))}:Kr,ei=Nn,ti=Qr;var ni=function(e,t){return ei(e,ti(e),t)};var ri=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},ii=wr(Object.getPrototypeOf,Object),oi=ri,ai=ii,si=Qr,li=Yr,ui=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)oi(t,si(e)),e=ai(e);return t}:li,ci=Nn,hi=ui;var di=function(e,t){return ci(e,hi(e),t)},pi=ri,fi=qn;var gi=function(e,t,n){var r=t(e);return fi(e)?r:pi(r,n(e))},mi=gi,vi=Qr,yi=Er;var wi=function(e){return mi(e,yi,vi)},bi=gi,_i=ui,xi=Ur;var Si=function(e){return bi(e,xi,_i)},Ai=Ft(Qe,"DataView"),Pi=Nt,Mi=Ft(Qe,"Promise"),Ci=Ft(Qe,"Set"),Ti=Ft(Qe,"WeakMap"),ki=ht,Ei=_t,Ri="[object Map]",Li="[object Promise]",Di="[object Set]",Fi="[object WeakMap]",Ni="[object DataView]",Oi=Ei(Ai),ji=Ei(Pi),Ii=Ei(Mi),zi=Ei(Ci),Bi=Ei(Ti),Ui=ki;(Ai&&Ui(new Ai(new ArrayBuffer(1)))!=Ni||Pi&&Ui(new Pi)!=Ri||Mi&&Ui(Mi.resolve())!=Li||Ci&&Ui(new Ci)!=Di||Ti&&Ui(new Ti)!=Fi)&&(Ui=function(e){var t=ki(e),n="[object Object]"==t?e.constructor:void 0,r=n?Ei(n):"";if(r)switch(r){case Oi:return Ni;case ji:return Ri;case Ii:return Li;case zi:return Di;case Bi:return Fi}return t});var Hi=Ui,Gi=Object.prototype.hasOwnProperty;var Wi=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Gi.call(e,"index")&&(n.index=e.index,n.input=e.input),n},Vi=Qe.Uint8Array;var qi=function(e){var t=new e.constructor(e.byteLength);return new Vi(t).set(new Vi(e)),t},Zi=qi;var Yi=function(e,t){var n=t?Zi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},$i=/\w*$/;var Ki=function(e){var t=new e.constructor(e.source,$i.exec(e));return t.lastIndex=e.lastIndex,t},Xi=et?et.prototype:void 0,Ji=Xi?Xi.valueOf:void 0;var Qi=qi;var eo=function(e,t){var n=t?Qi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},to=qi,no=Yi,ro=Ki,io=function(e){return Ji?Object(Ji.call(e)):{}},oo=eo;var ao=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return to(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return no(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return oo(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return ro(e);case"[object Symbol]":return io(e)}},so=dt,lo=Object.create,uo=function(){function e(){}return function(t){if(!so(t))return{};if(lo)return lo(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),co=ii,ho=yr;var po=function(e){return"function"!=typeof e.constructor||ho(e)?{}:uo(co(e))},fo=Hi,go=jn;var mo=function(e){return go(e)&&"[object Map]"==fo(e)},vo=rr,yo=ir&&ir.isMap,wo=yo?vo(yo):mo,bo=Hi,_o=jn;var xo=function(e){return _o(e)&&"[object Set]"==bo(e)},So=rr,Ao=ir&&ir.isSet,Po=Ao?So(Ao):xo,Mo=An,Co=Pn,To=Ln,ko=Dr,Eo=Wr,Ro=Vr,Lo=qr,Do=ni,Fo=di,No=wi,Oo=Si,jo=Hi,Io=Wi,zo=ao,Bo=po,Uo=qn,Ho=Zn,Go=wo,Wo=dt,Vo=Po,qo=Er,Zo=Ur,Yo="[object Arguments]",$o="[object Function]",Ko="[object Object]",Xo={};Xo[Yo]=Xo["[object Array]"]=Xo["[object ArrayBuffer]"]=Xo["[object DataView]"]=Xo["[object Boolean]"]=Xo["[object Date]"]=Xo["[object Float32Array]"]=Xo["[object Float64Array]"]=Xo["[object Int8Array]"]=Xo["[object Int16Array]"]=Xo["[object Int32Array]"]=Xo["[object Map]"]=Xo["[object Number]"]=Xo[Ko]=Xo["[object RegExp]"]=Xo["[object Set]"]=Xo["[object String]"]=Xo["[object Symbol]"]=Xo["[object Uint8Array]"]=Xo["[object Uint8ClampedArray]"]=Xo["[object Uint16Array]"]=Xo["[object Uint32Array]"]=!0,Xo["[object Error]"]=Xo[$o]=Xo["[object WeakMap]"]=!1;var Jo=function e(t,n,r,i,o,a){var s,l=1&n,u=2&n,c=4&n;if(r&&(s=o?r(t,i,o,a):r(t)),void 0!==s)return s;if(!Wo(t))return t;var h=Uo(t);if(h){if(s=Io(t),!l)return Lo(t,s)}else{var d=jo(t),p=d==$o||"[object GeneratorFunction]"==d;if(Ho(t))return Ro(t,l);if(d==Ko||d==Yo||p&&!o){if(s=u||p?{}:Bo(t),!l)return u?Fo(t,Eo(s,t)):Do(t,ko(s,t))}else{if(!Xo[d])return o?t:{};s=zo(t,d,l)}}a||(a=new Mo);var f=a.get(t);if(f)return f;a.set(t,s),Vo(t)?t.forEach(function(i){s.add(e(i,n,r,i,t,a))}):Go(t)&&t.forEach(function(i,o){s.set(o,e(i,n,r,o,t,a))});var g=h?void 0:(c?u?Oo:No:u?Zo:qo)(t);return Co(g||t,function(i,o){g&&(i=t[o=i]),To(s,o,e(i,n,r,o,t,a))}),s},Qo=Jo;var ea=function(e){return Qo(e,5)},ta=Object.getPrototypeOf(r.ValueXY);__DEV__&&"AnimatedWithChildren"!==ta.name&&console.error("AnimatedCoordinatesArray could not obtain AnimatedWithChildren base class");var na={useNativeDriver:!1},ra=function(){function e(){var t,n;return G(this,e),(n=H(this,e)).state=(t=n).onInitialState.apply(t,arguments),n}return Y(e,ta),V(e,[{key:"onInitialState",value:function(e){return{coords:e.map(function(e){return[e[0],e[1]]})}}},{key:"onGetValue",value:function(e){return e.coords}},{key:"onCalculate",value:function(e,t){var n=e.coords,r=e.targetCoords,i=t,o=1-i,a=Math.min(n.length,r.length),s=n.slice(0,a).map(function(e,t){return[e[0]*o+r[t][0]*i,e[1]*o+r[t][1]*i]});if(r.length>n.length){var l=n.length>0?n[n.length-1]:r[0],u=r.slice(a,r.length).map(function(e){return[l[0]*o+e[0]*i,l[1]*o+e[1]*i]});return{coords:[].concat(Q(s),Q(u)),targetCoords:r}}if(n.length>r.length){var c=r.length>0?r[r.length-1]:n[0],h=n.slice(a,n.length).map(function(e){return[e[0]*o+c[0]*i,e[1]*o+c[1]*i]});return{coords:[].concat(Q(s),Q(h)),targetCoords:r}}return{coords:s,targetCoords:r}}},{key:"onStart",value:function(e,t){var n=t.map(function(e){return[e[0],e[1]]});return X(X({},e),{},{targetCoords:n})}},{key:"animate",value:function(e,t,n){var r=this,i=n.toValue,o=t.start,a=t;return a.start=function(){var n;n=t,r.progressValue=e,r.progressValue.__addChild(r),r.animation=n,r.state=r.onStart(r.state,i),o.apply(void 0,arguments)},a}},{key:"timing",value:function(e){var t=new r.Value(1);return this.animate(t,r.loop(r.timing(t,X(X(X({},na),e),{},{toValue:0}))),e)}},{key:"spring",value:function(e){var t=new r.Value(0);return this.animate(t,r.spring(t,X(X(X({},na),e),{},{toValue:1})),e)}},{key:"decay",value:function(e){var t=new r.Value(0);return this.animate(t,r.decay(this.progressValue,X(X(X({},na),e),{},{toValue:1})),e)}},{key:"__getValue",value:function(){return this.progressValue?this.onGetValue(this.onCalculate(this.state,this.progressValue.__getValue())):this.onGetValue(this.state)}},{key:"destroy",value:function(){if(this.animation){var e=this.progressValue.__getValue();this.animation.stop(),this.state=this.onCalculate(this.state,e),this.progressValue.__removeChild(this),this.progressValue=null,this.animation=null}}}])}();function ia(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function oa(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function aa(e){return"Feature"===e.type?e.geometry:e}function sa(e,t,n){void 0===n&&(n={});var r=ia(e),i=ia(t),o=Ae(i[1]-r[1]),a=Ae(i[0]-r[0]),s=Ae(r[1]),l=Ae(i[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return _e(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),n.units)}function la(e,t,n){if(void 0===n&&(n={}),!0===n.final)return function(e,t){var n=la(t,e);return n=(n+180)%360}(e,t);var r=ia(e),i=ia(t),o=Ae(r[0]),a=Ae(i[0]),s=Ae(r[1]),l=Ae(i[1]),u=Math.sin(a-o)*Math.cos(l),c=Math.cos(s)*Math.sin(l)-Math.sin(s)*Math.cos(l)*Math.cos(a-o);return Se(Math.atan2(u,c))}function ua(e,t,n,r){void 0===r&&(r={});var i=ia(e),o=Ae(i[0]),a=Ae(i[1]),s=Ae(n),l=xe(t,r.units),u=Math.asin(Math.sin(a)*Math.cos(l)+Math.cos(a)*Math.sin(l)*Math.cos(s));return ve([Se(o+Math.atan2(Math.sin(s)*Math.sin(l)*Math.cos(a),Math.cos(l)-Math.sin(a)*Math.sin(u))),Se(u)],r.properties)}function ca(e,t,n){if(null!==e)for(var r,i,o,a,s,l,u,c,h=0,d=0,p=e.type,f="FeatureCollection"===p,g="Feature"===p,m=f?e.features.length:1,v=0;v<m;v++){s=(c=!!(u=f?e.features[v].geometry:g?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var y=0;y<s;y++){var w=0,b=0;if(null!==(a=c?u.geometries[y]:u)){l=a.coordinates;var _=a.type;switch(h=!n||"Polygon"!==_&&"MultiPolygon"!==_?0:1,_){case null:break;case"Point":if(!1===t(l,d,v,w,b))return!1;d++,w++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],d,v,w,b))return!1;d++,"MultiPoint"===_&&w++}"LineString"===_&&w++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-h;i++){if(!1===t(l[r][i],d,v,w,b))return!1;d++}"MultiLineString"===_&&w++,"Polygon"===_&&b++}"Polygon"===_&&w++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(b=0,i=0;i<l[r].length;i++){for(o=0;o<l[r][i].length-h;o++){if(!1===t(l[r][i][o],d,v,w,b))return!1;d++}b++}w++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===ca(a.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function ha(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var n=0;n<e.features.length&&!1!==t(e.features[n],n);n++);}function da(e,t){!function(e,t){var n,r,i,o,a,s,l,u,c,h,d=0,p="FeatureCollection"===e.type,f="Feature"===e.type,g=p?e.features.length:1;for(n=0;n<g;n++){for(s=p?e.features[n].geometry:f?e.geometry:e,u=p?e.features[n].properties:f?e.properties:{},c=p?e.features[n].bbox:f?e.bbox:void 0,h=p?e.features[n].id:f?e.id:void 0,a=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=l?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(o,d,u,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===t(o.geometries[r],d,u,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,d,u,c,h))return!1;d++}}(e,function(e,n,r,i,o){var a,s=null===e?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return!1!==t(me(e,r,{bbox:i,id:o}),n,0)&&void 0}switch(s){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l<e.coordinates.length;l++){var u=e.coordinates[l];if(!1===t(me({type:a,coordinates:u},r),n,l))return!1}})}function pa(e,t,n){var r=n,i=!1;return function(e,t){da(e,function(e,n,r){var i=0;if(e.geometry){var o=e.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var a,s=0,l=0,u=0;return!1!==ca(e,function(o,c,h,d,p){if(void 0===a||n>s||d>l||p>u)return a=o,s=n,l=d,u=p,void(i=0);var f=ye([a,o],e.properties);if(!1===t(f,n,r,p,i))return!1;i++,a=o})&&void 0}}})}(e,function(e,o,a,s,l){r=!1===i&&void 0===n?e:t(r,e,o,a,s,l),i=!0}),r}function fa(e){if(!e)throw new Error("geojson is required");var t=[];return da(e,function(e){!function(e,t){var n=[],r=e.geometry;if(null!==r){switch(r.type){case"Polygon":n=oa(r);break;case"LineString":n=[oa(r)]}n.forEach(function(n){var r=function(e,t){var n=[];return e.reduce(function(e,r){var i,o,a,s,l,u,c=ye([e,r],t);return c.bbox=(o=r,a=(i=e)[0],s=i[1],l=o[0],u=o[1],[a<l?a:l,s<u?s:u,a>l?a:l,s>u?s:u]),n.push(c),r}),n}(n,e.properties);r.forEach(function(e){e.id=t.length,t.push(e)})})}}(e,t)}),we(t)}var ga={},ma={get exports(){return ga},set exports(e){ga=e}};function va(e,t,n,r,i){ya(e,t,n||0,r||e.length-1,i||ba)}function ya(e,t,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,a=t-n+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);ya(e,t,Math.max(n,Math.floor(t-a*l/o+u)),Math.min(r,Math.floor(t+(o-a)*l/o+u)),i)}var c=e[t],h=n,d=r;for(wa(e,n,t),i(e[r],c)>0&&wa(e,n,r);h<d;){for(wa(e,h,d),h++,d--;i(e[h],c)<0;)h++;for(;i(e[d],c)>0;)d--}0===i(e[n],c)?wa(e,n,d):wa(e,++d,r),d<=t&&(n=d+1),t<=d&&(r=d-1)}}function wa(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function ba(e,t){return e<t?-1:e>t?1:0}function _a(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function xa(e,t){Sa(e,0,e.children.length,t,e)}function Sa(e,t,n,r,i){i||(i=Da(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=t;o<n;o++){const t=e.children[o];Aa(i,e.leaf?r(t):t)}return i}function Aa(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Pa(e,t){return e.minX-t.minX}function Ma(e,t){return e.minY-t.minY}function Ca(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Ta(e){return e.maxX-e.minX+(e.maxY-e.minY)}function ka(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function Ea(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function Ra(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function La(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function Da(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Fa(e,t,n,r,i){const o=[t,n];for(;o.length;){if((n=o.pop())-(t=o.pop())<=r)continue;const a=t+Math.ceil((n-t)/r/2)*r;va(e,a,t,n,i),o.push(t,a,a,n)}}var Na={};!function(e){function t(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function n(e,n,r){if(void 0===r&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!d(e[0])||!d(e[1]))throw new Error("coordinates must contain numbers");return t({type:"Point",coordinates:e},n,r)}function r(e,n,r){void 0===r&&(r={});for(var i=0,o=e;i<o.length;i++){var a=o[i];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw new Error("First and last Position are not equivalent.")}return t({type:"Polygon",coordinates:e},n,r)}function i(e,n,r){if(void 0===r&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return t({type:"LineString",coordinates:e},n,r)}function o(e,t){void 0===t&&(t={});var n={type:"FeatureCollection"};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}function a(e,n,r){return void 0===r&&(r={}),t({type:"MultiLineString",coordinates:e},n,r)}function s(e,n,r){return void 0===r&&(r={}),t({type:"MultiPoint",coordinates:e},n,r)}function l(e,n,r){return void 0===r&&(r={}),t({type:"MultiPolygon",coordinates:e},n,r)}function u(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t*r}function c(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t/r}function h(e){return 180*(e%(2*Math.PI))/Math.PI}function d(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.earthRadius=6371008.8,e.factors={centimeters:100*e.earthRadius,centimetres:100*e.earthRadius,degrees:e.earthRadius/111325,feet:3.28084*e.earthRadius,inches:39.37*e.earthRadius,kilometers:e.earthRadius/1e3,kilometres:e.earthRadius/1e3,meters:e.earthRadius,metres:e.earthRadius,miles:e.earthRadius/1609.344,millimeters:1e3*e.earthRadius,millimetres:1e3*e.earthRadius,nauticalmiles:e.earthRadius/1852,radians:1,yards:1.0936*e.earthRadius},e.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/e.earthRadius,yards:1.0936133},e.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},e.feature=t,e.geometry=function(e,t,o){switch(e){case"Point":return n(t).geometry;case"LineString":return i(t).geometry;case"Polygon":return r(t).geometry;case"MultiPoint":return s(t).geometry;case"MultiLineString":return a(t).geometry;case"MultiPolygon":return l(t).geometry;default:throw new Error(e+" is invalid")}},e.point=n,e.points=function(e,t,r){return void 0===r&&(r={}),o(e.map(function(e){return n(e,t)}),r)},e.polygon=r,e.polygons=function(e,t,n){return void 0===n&&(n={}),o(e.map(function(e){return r(e,t)}),n)},e.lineString=i,e.lineStrings=function(e,t,n){return void 0===n&&(n={}),o(e.map(function(e){return i(e,t)}),n)},e.featureCollection=o,e.multiLineString=a,e.multiPoint=s,e.multiPolygon=l,e.geometryCollection=function(e,n,r){return void 0===r&&(r={}),t({type:"GeometryCollection",geometries:e},n,r)},e.round=function(e,t){if(void 0===t&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,t||0);return Math.round(e*n)/n},e.radiansToLength=u,e.lengthToRadians=c,e.lengthToDegrees=function(e,t){return h(c(e,t))},e.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},e.radiansToDegrees=h,e.degreesToRadians=function(e){return e%360*Math.PI/180},e.convertLength=function(e,t,n){if(void 0===t&&(t="kilometers"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("length must be a positive number");return u(c(e,t),n)},e.convertArea=function(t,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=e.areaFactors[n];if(!i)throw new Error("invalid original units");var o=e.areaFactors[r];if(!o)throw new Error("invalid final units");return t/i*o},e.isNumber=d,e.isObject=function(e){return!!e&&e.constructor===Object},e.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(e){if(!d(e))throw new Error("bbox must only contain numbers")})},e.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}}(Na);var Oa={};Object.defineProperty(Oa,"__esModule",{value:!0});var ja=Na;function Ia(e,t,n){if(null!==e)for(var r,i,o,a,s,l,u,c,h=0,d=0,p=e.type,f="FeatureCollection"===p,g="Feature"===p,m=f?e.features.length:1,v=0;v<m;v++){s=(c=!!(u=f?e.features[v].geometry:g?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var y=0;y<s;y++){var w=0,b=0;if(null!==(a=c?u.geometries[y]:u)){l=a.coordinates;var _=a.type;switch(h=!n||"Polygon"!==_&&"MultiPolygon"!==_?0:1,_){case null:break;case"Point":if(!1===t(l,d,v,w,b))return!1;d++,w++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],d,v,w,b))return!1;d++,"MultiPoint"===_&&w++}"LineString"===_&&w++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-h;i++){if(!1===t(l[r][i],d,v,w,b))return!1;d++}"MultiLineString"===_&&w++,"Polygon"===_&&b++}"Polygon"===_&&w++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(b=0,i=0;i<l[r].length;i++){for(o=0;o<l[r][i].length-h;o++){if(!1===t(l[r][i][o],d,v,w,b))return!1;d++}b++}w++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===Ia(a.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function za(e,t){var n;switch(e.type){case"FeatureCollection":for(n=0;n<e.features.length&&!1!==t(e.features[n].properties,n);n++);break;case"Feature":t(e.properties,0)}}function Ba(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var n=0;n<e.features.length&&!1!==t(e.features[n],n);n++);}function Ua(e,t){var n,r,i,o,a,s,l,u,c,h,d=0,p="FeatureCollection"===e.type,f="Feature"===e.type,g=p?e.features.length:1;for(n=0;n<g;n++){for(s=p?e.features[n].geometry:f?e.geometry:e,u=p?e.features[n].properties:f?e.properties:{},c=p?e.features[n].bbox:f?e.bbox:void 0,h=p?e.features[n].id:f?e.id:void 0,a=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=l?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(o,d,u,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===t(o.geometries[r],d,u,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,d,u,c,h))return!1;d++}}function Ha(e,t){Ua(e,function(e,n,r,i,o){var a,s=null===e?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return!1!==t(ja.feature(e,r,{bbox:i,id:o}),n,0)&&void 0}switch(s){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l<e.coordinates.length;l++){var u={type:a,coordinates:e.coordinates[l]};if(!1===t(ja.feature(u,r),n,l))return!1}})}function Ga(e,t){Ha(e,function(e,n,r){var i=0;if(e.geometry){var o=e.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var a,s=0,l=0,u=0;return!1!==Ia(e,function(o,c,h,d,p){if(void 0===a||n>s||d>l||p>u)return a=o,s=n,l=d,u=p,void(i=0);var f=ja.lineString([a,o],e.properties);if(!1===t(f,n,r,p,i))return!1;i++,a=o})&&void 0}}})}function Wa(e,t){if(!e)throw new Error("geojson is required");Ha(e,function(e,n,r){if(null!==e.geometry){var i=e.geometry.type,o=e.geometry.coordinates;switch(i){case"LineString":if(!1===t(e,n,r,0,0))return!1;break;case"Polygon":for(var a=0;a<o.length;a++)if(!1===t(ja.lineString(o[a],e.properties),n,r,a))return!1}}})}Oa.coordAll=function(e){var t=[];return Ia(e,function(e){t.push(e)}),t},Oa.coordEach=Ia,Oa.coordReduce=function(e,t,n,r){var i=n;return Ia(e,function(e,r,o,a,s){i=0===r&&void 0===n?e:t(i,e,r,o,a,s)},r),i},Oa.featureEach=Ba,Oa.featureReduce=function(e,t,n){var r=n;return Ba(e,function(e,i){r=0===i&&void 0===n?e:t(r,e,i)}),r},Oa.findPoint=function(e,t){if(t=t||{},!ja.isObject(t))throw new Error("options is invalid");var n,r=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,a=t.coordIndex||0,s=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,n=e.features[r].geometry;break;case"Feature":s=s||e.properties,n=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=e;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":return ja.point(l,s,t);case"MultiPoint":return i<0&&(i=l.length+i),ja.point(l[i],s,t);case"LineString":return a<0&&(a=l.length+a),ja.point(l[a],s,t);case"Polygon":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a),ja.point(l[o][a],s,t);case"MultiLineString":return i<0&&(i=l.length+i),a<0&&(a=l[i].length+a),ja.point(l[i][a],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),a<0&&(a=l[i][o].length-a),ja.point(l[i][o][a],s,t)}throw new Error("geojson is invalid")},Oa.findSegment=function(e,t){if(t=t||{},!ja.isObject(t))throw new Error("options is invalid");var n,r=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,a=t.segmentIndex||0,s=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,n=e.features[r].geometry;break;case"Feature":s=s||e.properties,n=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=e;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=l.length+a-1),ja.lineString([l[a],l[a+1]],s,t);case"Polygon":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a-1),ja.lineString([l[o][a],l[o][a+1]],s,t);case"MultiLineString":return i<0&&(i=l.length+i),a<0&&(a=l[i].length+a-1),ja.lineString([l[i][a],l[i][a+1]],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),a<0&&(a=l[i][o].length-a-1),ja.lineString([l[i][o][a],l[i][o][a+1]],s,t)}throw new Error("geojson is invalid")},Oa.flattenEach=Ha,Oa.flattenReduce=function(e,t,n){var r=n;return Ha(e,function(e,i,o){r=0===i&&0===o&&void 0===n?e:t(r,e,i,o)}),r},Oa.geomEach=Ua,Oa.geomReduce=function(e,t,n){var r=n;return Ua(e,function(e,i,o,a,s){r=0===i&&void 0===n?e:t(r,e,i,o,a,s)}),r},Oa.lineEach=Wa,Oa.lineReduce=function(e,t,n){var r=n;return Wa(e,function(e,i,o,a){r=0===i&&void 0===n?e:t(r,e,i,o,a)}),r},Oa.propEach=za,Oa.propReduce=function(e,t,n){var r=n;return za(e,function(e,i){r=0===i&&void 0===n?e:t(r,e,i)}),r},Oa.segmentEach=Ga,Oa.segmentReduce=function(e,t,n){var r=n,i=!1;return Ga(e,function(e,o,a,s,l){r=!1===i&&void 0===n?e:t(r,e,o,a,s,l),i=!0}),r};var Va={};Object.defineProperty(Va,"__esModule",{value:!0});var qa=Oa;function Za(e){var t=[1/0,1/0,-1/0,-1/0];return qa.coordEach(e,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Za.default=Za,Va.default=Za;var Ya=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const n=[];if(!La(e,t))return n;const r=this.toBBox,i=[];for(;t;){for(let o=0;o<t.children.length;o++){const a=t.children[o],s=t.leaf?r(a):a;La(e,s)&&(t.leaf?n.push(a):Ra(e,s)?this._all(a,n):i.push(a))}t=i.pop()}return n}collides(e){let t=this.data;if(!La(e,t))return!1;const n=[];for(;t;){for(let r=0;r<t.children.length;r++){const i=t.children[r],o=t.leaf?this.toBBox(i):i;if(La(e,o)){if(t.leaf||Ra(e,o))return!0;n.push(i)}}t=n.pop()}return!1}load(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(let t=0;t<e.length;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}else this.data=t;return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=Da([]),this}remove(e,t){if(!e)return this;let n=this.data;const r=this.toBBox(e),i=[],o=[];let a,s,l;for(;n||i.length;){if(n||(n=i.pop(),s=i[i.length-1],a=o.pop(),l=!0),n.leaf){const r=_a(e,n.children,t);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}l||n.leaf||!Ra(n,r)?s?(a++,n=s.children[a],l=!1):n=null:(i.push(n),o.push(a),a=0,s=n,n=n.children[0])}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){const n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,r){const i=n-t+1;let o,a=this._maxEntries;if(i<=a)return o=Da(e.slice(t,n+1)),xa(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,r-1))),o=Da([]),o.leaf=!1,o.height=r;const s=Math.ceil(i/a),l=s*Math.ceil(Math.sqrt(a));Fa(e,t,n,l,this.compareMinX);for(let i=t;i<=n;i+=l){const t=Math.min(i+l-1,n);Fa(e,i,t,s,this.compareMinY);for(let n=i;n<=t;n+=s){const i=Math.min(n+s-1,t);o.children.push(this._build(e,n,i,r-1))}}return xa(o,this.toBBox),o}_chooseSubtree(e,t,n,r){for(;r.push(t),!t.leaf&&r.length-1!==n;){let n,r=1/0,i=1/0;for(let o=0;o<t.children.length;o++){const a=t.children[o],s=Ca(a),l=ka(e,a)-s;l<i?(i=l,r=s<r?s:r,n=a):l===i&&s<r&&(r=s,n=a)}t=n||t.children[0]}return t}_insert(e,t,n){const r=n?e:this.toBBox(e),i=[],o=this._chooseSubtree(r,this.data,t,i);for(o.children.push(e),Aa(o,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){const n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),a=Da(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,xa(n,this.toBBox),xa(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(n,a)}_splitRoot(e,t){this.data=Da([e,t]),this.data.height=e.height+1,this.data.leaf=!1,xa(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,o=1/0;for(let a=t;a<=n-t;a++){const t=Sa(e,0,a,this.toBBox),s=Sa(e,a,n,this.toBBox),l=Ea(t,s),u=Ca(t)+Ca(s);l<i?(i=l,r=a,o=u<o?u:o):l===i&&u<o&&(o=u,r=a)}return r||n-t}_chooseSplitAxis(e,t,n){const r=e.leaf?this.compareMinX:Pa,i=e.leaf?this.compareMinY:Ma;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);const i=this.toBBox,o=Sa(e,0,t,i),a=Sa(e,n-t,n,i);let s=Ta(o)+Ta(a);for(let r=t;r<n-t;r++){const t=e.children[r];Aa(o,e.leaf?i(t):t),s+=Ta(o)}for(let r=n-t-1;r>=t;r--){const t=e.children[r];Aa(a,e.leaf?i(t):t),s+=Ta(a)}return s}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)Aa(t[r],e)}_condense(e){for(let t,n=e.length-1;n>=0;n--)0===e[n].children.length?n>0?(t=e[n-1].children,t.splice(t.indexOf(e[n]),1)):this.clear():xa(e[n],this.toBBox)}},$a=Na,Ka=Oa,Xa=Va.default,Ja=Ka.featureEach;Ka.coordEach;var Qa=$a.featureCollection;function es(e){var t=new Ya(e);return t.insert=function(e){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Xa(e),Ya.prototype.insert.call(this,e)},t.load=function(e){var t=[];return Array.isArray(e)?e.forEach(function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox?e.bbox:Xa(e),t.push(e)}):Ja(e,function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox?e.bbox:Xa(e),t.push(e)}),Ya.prototype.load.call(this,t)},t.remove=function(e,t){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Xa(e),Ya.prototype.remove.call(this,e,t)},t.clear=function(){return Ya.prototype.clear.call(this)},t.search=function(e){var t=Ya.prototype.search.call(this,this.toBBox(e));return Qa(t)},t.collides=function(e){return Ya.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=Ya.prototype.all.call(this);return Qa(e)},t.toJSON=function(){return Ya.prototype.toJSON.call(this)},t.fromJSON=function(e){return Ya.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var t;if(e.bbox)t=e.bbox;else if(Array.isArray(e)&&4===e.length)t=e;else if(Array.isArray(e)&&6===e.length)t=[e[0],e[1],e[3],e[4]];else if("Feature"===e.type)t=Xa(e);else{if("FeatureCollection"!==e.type)throw new Error("invalid geojson");t=Xa(e)}return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},t}function ts(e,t){var n={},r=[];if("LineString"===e.type&&(e=me(e)),"LineString"===t.type&&(t=me(t)),"Feature"===e.type&&"Feature"===t.type&&null!==e.geometry&&null!==t.geometry&&"LineString"===e.geometry.type&&"LineString"===t.geometry.type&&2===e.geometry.coordinates.length&&2===t.geometry.coordinates.length){var i=ns(e,t);return i&&r.push(i),we(r)}var o=ga();return o.load(fa(t)),ha(fa(e),function(e){ha(o.search(e),function(t){var i=ns(e,t);if(i){var o=oa(i).join(",");n[o]||(n[o]=!0,r.push(i))}})}),we(r)}function ns(e,t){var n=oa(e),r=oa(t);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==r.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=n[0][0],o=n[0][1],a=n[1][0],s=n[1][1],l=r[0][0],u=r[0][1],c=r[1][0],h=r[1][1],d=(h-u)*(a-i)-(c-l)*(s-o),p=(c-l)*(o-u)-(h-u)*(i-l),f=(a-i)*(o-u)-(s-o)*(i-l);if(0===d)return null;var g=p/d,m=f/d;return g>=0&&g<=1&&m>=0&&m<=1?ve([i+g*(a-i),o+g*(s-o)]):null}function rs(e,t,n){void 0===n&&(n={});var r=ve([1/0,1/0],{dist:1/0}),i=0;return da(e,function(e){for(var o=oa(e),a=0;a<o.length-1;a++){var s=ve(o[a]);s.properties.dist=sa(t,s,n);var l=ve(o[a+1]);l.properties.dist=sa(t,l,n);var u=sa(s,l,n),c=Math.max(s.properties.dist,l.properties.dist),h=la(s,l),d=ua(t,c,h+90,n),p=ua(t,c,h-90,n),f=ts(ye([d.geometry.coordinates,p.geometry.coordinates]),ye([s.geometry.coordinates,l.geometry.coordinates])),g=null;f.features.length>0&&((g=f.features[0]).properties.dist=sa(t,g,n),g.properties.location=i+sa(s,g,n)),s.properties.dist<r.properties.dist&&((r=s).properties.index=a,r.properties.location=i),l.properties.dist<r.properties.dist&&((r=l).properties.index=a+1,r.properties.location=i+u),g&&g.properties.dist<r.properties.dist&&((r=g).properties.index=a),i+=u}}),r}function is(e,t){return void 0===t&&(t={}),pa(e,function(e,n){var r=n.geometry.coordinates;return e+sa(r[0],r[1],t)},0)}ma.exports=es,ga.default=es;var os=function(){function e(){return G(this,e),H(this,e,arguments)}return Y(e,ra),V(e,[{key:"onInitialState",value:function(e){return{fullRoute:e.map(function(e){return[e[0],e[1]]}),end:{from:0}}}},{key:"onGetValue",value:function(e){return e.actRoute||e.fullRoute}},{key:"onCalculate",value:function(e,t){var n,r=e.fullRoute,i=e.end;if(t>.5){var o=2*(t-.5);n=i.from*(1-o)+o*i.to}else{var a=2*t;n=i.from*(1-a)+a*i.to}for(var s=0,l=0,u=r.length-1;l<n&&u>0;)s=l,l+=sa(ve(r[u]),ve(r[u-1])),u-=1;if(t>.5){var c=(n-s)/(l-s),h=1-c,d=[].concat(Q(r.slice(0,u+1)),[[r[u][0]*c+r[u+1][0]*h,r[u][1]*c+r[u+1][1]*h]]);return{fullRoute:r,end:X(X({},i),{},{current:n}),actRoute:d}}if(l<=n){var p=Q(r.slice(r.length-2,r.length));return{fullRoute:r,end:X(X({},i),{},{current:n}),actRoute:p}}var f=(n-s)/(l-s),g=1-f,m=[[r[u][0]*f+r[u+1][0]*g,r[u][1]*f+r[u+1][1]*g]].concat(Q(r.slice(u+1,r.length)));return{fullRoute:r,end:X(X({},i),{},{current:n}),actRoute:m}}},{key:"onStart",value:function(e,t){var n,r=e.fullRoute,i=e.end;if(t.end.point){var o=ye(r),a=rs(o,t.end.point);n=is(o)-a.properties.location}else console.warn("RouteCoordinatesArray: toValue.end: should have either along or point");return{fullRoute:r,end:X(X({},i),{},{from:null!=i.current?i.current:i.from,to:n})}}},{key:"originalRoute",get:function(){return this.state.fullRoute}}])}(),as=["match",["get","isNonHighlightedOverview"],"1","#A7A6BA","0",["match",["get","zone"],"transit","#4F7EF8","public","#CF9FFF","#CF9FFF"],["match",["get","zone"],"transit","#4F7EF8","public","#CF9FFF","#CF9FFF"]],ss=["match",["get","isNonHighlightedOverview"],"1",.4,"0",1,1],ls=[{id:"route-line-outline-inactive",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!1]],paint:{"line-color":"#FFFFFF","line-gap-width":6},layout:{"line-cap":"round","line-join":"round"}},{id:"route-line-inactive",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!1]],style:{lineCap:"round",lineJoin:"round",lineColor:as,lineWidth:5},paint:{"line-color":as,"line-width":5,"line-opacity":ss},layout:{"line-cap":"round","line-join":"round"},belowLayerID:"route-line-animate"},{id:"route-line-active",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!0]],style:{lineCap:"round",lineJoin:"round",lineColor:as,lineWidth:6},paint:{"line-color":as,"line-width":6,"line-opacity":ss},layout:{"line-cap":"round","line-join":"round"},belowLayerID:"route-line-animate"},{id:"route-line-outline-active",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!0]],style:{lineCap:"round",lineJoin:"round",lineColor:"#FFFFFF",lineGapWidth:6},paint:{"line-color":"#FFFFFF","line-gap-width":6,"line-opacity":ss},layout:{"line-cap":"round","line-join":"round"}},{id:"route-line-endpoint-active",type:"circle",filter:["all",["==",["geometry-type"],"Point"],["==",["get","highlight"],!0],["==",["get","isNode"],!0]],style:{circleRadius:2,circleOpacity:0,circleStrokeWidth:2,circleStrokeColor:"#FFFFFF",circleStrokeOpacity:.7},paint:{"circle-radius":2,"circle-opacity":0,"circle-stroke-width":2,"circle-stroke-color":"#FFFFFF","circle-stroke-opacity":.7}},{id:"route-line-endpoint-fill-active",type:"circle",filter:["all",["==",["geometry-type"],"Point"],["==",["get","highlight"],!0],["==",["get","isNode"],!0]],style:{circleRadius:2,circleColor:"#FFFFFF",circleOpacity:.7},paint:{"circle-color":"#FFFFFF","circle-radius":2,"circle-opacity":.7}}],us=[{id:"route-line-animate",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!0]],style:{lineCap:"round",lineJoin:"round",lineColor:"#FFFFFF",lineOpacity:.7,lineWidth:4},paint:{"line-color":"#FFFFFF","line-width":4,"line-opacity":.7},layout:{"line-cap":"round","line-join":"round"},isAnimationLayer:!0}];var cs,hs={};function ds(e){var t=e.children,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["children"]);return j(j({},n),{name:e.name,taxonomyPath:e.taxonomyPath,children:(null!=t?t:[]).map(ds)})}function ps(e,t){if(e.taxonomyPath){var n=t.get(e.taxonomyPath);n&&(e.altMin=n.altMin,e.altMax=n.altMax,n.timestamp&&(e.altitudeTimestamp=n.timestamp))}for(var r=0,i=function(e){var t;return null!==(t=e.children)&&void 0!==t?t:[]}(e);r<i.length;r++){ps(i[r],t)}}function fs(e,t){if(!t||"object"!==te(t))return e;var n=function(e){for(var t=new Map,n=0,r=Object.keys(e);n<r.length;n++){var i=e[r[n]];if(i&&"object"===te(i))for(var o=0,a=Object.keys(i);o<a.length;o++){var s=i[a[o]];null!=(null==s?void 0:s.floorTaxonomyPath)&&"number"==typeof s.altMin&&"number"==typeof s.altMax&&t.set(s.floorTaxonomyPath,{altMin:s.altMin,altMax:s.altMax,timestamp:s.timestamp})}}return t}(t);if(0===n.size)return e;var r=JSON.parse(JSON.stringify(e));for(var i in r){var o=r[i];(null==o?void 0:o.taxonomyPath)&&ps(o,n)}return r}function gs(e,t){if(!e||"object"!==te(e)||0===Object.keys(e).length)return console.error("[focus-core] Focus tree data is missing or empty"),void(hs={});var n=function(e){var t={};return Object.keys(e).forEach(function(n){var r=e[n];(null==r?void 0:r.taxonomyPath)&&(t[n]=ds(r))}),t}(e);t&&(n=fs(n,t)),hs=n}function ms(){return hs}function vs(e){var t;return null!==(t=null==e?void 0:e.children)&&void 0!==t?t:[]}function ys(e){return 0===vs(e).length}function ws(e,t,n,r,i){if(void 0===r&&(r=0),void 0===i&&(i=null),n)return t(n,r,i),void vs(n).forEach(function(i){return ws(e,t,i,r+1,n)});for(var o in e){var a=e[o];(null==a?void 0:a.taxonomyPath)&&ws(e,t,a,0,null)}}function bs(){var e=ms(),t=[];for(var n in e){var r=e[n];(null==r?void 0:r.taxonomyPath)&&t.push(r)}return t}function _s(e){if(!e)return null;var t=null;return ws(ms(),function(n){n.taxonomyPath===e&&(t=n)}),t}function xs(e){if(!_s(e))return[];for(var t=[],n=e;;){var r=Ss(n);if(!r)break;t.unshift(r),n=r.taxonomyPath}return t}function Ss(e){if(!e)return null;var t=null;return ws(ms(),function(n){vs(n).some(function(t){return t.taxonomyPath===e})&&(t=n)}),t}function As(e,t){if(t<0)return[];if(null===e||""===e)return 0===t?bs():bs().flatMap(function(e){return As(e.taxonomyPath,t)});var n=_s(e);return n?0===t?[n]:1===t?vs(n):vs(n).flatMap(function(e){return As(e.taxonomyPath,t-1)}):[]}function Ps(e){var t=_s(e);if(!t)return 0;var n=vs(t);return 0===n.length?0:1+Math.max.apply(Math,n.map(function(e){return Ps(e.taxonomyPath)}))}function Ms(e){var t=vs(e);return 0===t.length?e.taxonomyPath?[e.taxonomyPath]:[]:t.flatMap(function(e){return Ms(e)})}!function(e){e.Name="title",e.LocalRef="localRef",e.WhatTaxonomy="dimension_what"}(cs||(cs={}));var Cs=["Aerodrome","Aerodrome names","Aerobridge","Aerobridge gates","Airplanes","Airplanes outline","Building icon","Building overlay","Building overlay outline","Building underlay","Building underlay icon","Building underlay selected outline","building_outline","Changi Airport Connector","Changi Airport Connector Text","Changi Walkway Text","T2 overlay outline copy","Building overlay base","Skytrain track outdoor"];function Ts(e){var t=[e],n=_s(e);if(n){var r=Ms(n);t=r.length>0&&!ys(n)?r:(ys(n),[n.taxonomyPath])}return t}function ks(e,t){var n=e.filter;if("openmaptiles"!==e.source&&n){for(var r=!1,i=0;i<n.length;i+=1){var o=n[i];if(Array.isArray(o[1])&&"dimension_where"===o[1][1]){o[0]="in",o[2]=["literal",t],r=!0;break}}r||n.push(["in",["get","dimension_where"],["literal",t]])}}function Es(e,t,n,r){function i(e,t){var n=t.filter(function(t){return!e.includes(t)});return e.push.apply(e,n),e}return function e(o){if(Array.isArray(o)&&"match"===o[0]){var a=B([],o,!0);return Array.isArray(a[1])&&a[1][1]===t?function(e,t){for(var o=3;o<t.length;o+=2){if(e[o]===r){var a=i(e[o-1],n);return void(e[o-1]=a)}o+2===t.length&&e.splice(o+1,0,n,r)}}(a,o):a[a.length-1]=e(a[a.length-1]),a}return["match",["get",t],n,r,o]}(e)}function Rs(e,t,n){return function e(r){if(Array.isArray(r)&&"match"===r[0]){var i=B([],r,!0);return Array.isArray(i[1])&&i[1][1]===t?n.length>0?function(e,t){for(var r=function(t){Array.isArray(e[t])&&n.forEach(function(n){var r=e[t].indexOf(n);r>-1&&(e[t].length>1?e[t].splice(r,1):e[t]=[""])})},i=2;i<t.length;i+=2)r(i)}(i,r):i=i[i.length-1]:i[i.length-1]=e(i[i.length-1]),i}}(e)}var Ls={lineColor:"line-color",lineWidth:"line-width",lineOpacity:"line-opacity",lineGapWidth:"line-gap-width"},Ds=new Set(ls.filter(function(e){return"line"===e.type}).map(function(e){return e.id})),Fs=new Set(ls.filter(function(e){return"line"===e.type&&e.id.toLowerCase().includes("outline")}).map(function(e){return e.id})),Ns=function(e,t){var n,r,i=j({},null!==(n=e.style)&&void 0!==n?n:{}),o=j({},null!==(r=e.paint)&&void 0!==r?r:{});return Object.entries(t).forEach(function(e){var t=e[0],n=e[1];i[t]=n;var r=Ls[t];r&&(o[r]=n)}),j(j({},e),{style:i,paint:o})},Os={line:_,circle:y,symbol:w,fill:x},js={line:b.LineLayer,circle:b.CircleLayer,symbol:b.SymbolLayer,fill:b.FillLayer},Is=function(e){var t=e.isAnimationLayer?js[e.type]:Os[e.type];return t?l.createElement(t,{key:e.id,id:e.id,style:e.style,filter:e.filter}):(console.warn("Unsupported MapLibre layer type: ".concat(e.type)),null)};function zs(e){var t=e.metaAtlasCoreRef,n=e.triggerRender,r=c({}),o=u(ls),a=o[0],s=o[1],p=c({type:"FeatureCollection",features:[]}),f=c(null),g=c(us),m=c(new os([])),y=function(e){m.current.destroy(),m.current=new os(e)};h(function(){!function(){if(m.current.__getValue().length>2){var e=ve(m.current.originalRoute[0]);m.current.timing({toValue:{end:{point:e}},duration:2e3,easing:i.linear}).start()}}()},[m.current]),d(e.ref,function(){return Object.assign(r.current,{setDisplayRoute:function(e){f.current=e},getDisplayRoute:function(){return f.current},setPatchFeatures:function(e){p.current=e,n()},setAnimatedCoordinates:function(e){y(e),n()},clear:function(){p.current={type:"FeatureCollection",features:[]},f.current=null,y([]),n()},filterRoutingLayersWhereDimension:function(e){var t=function(e,t){if(t){for(var n=[t],r=0;r<e.length;r+=1)ks(e[r],n);return e}}(ea(a),e);s(t),n()},styleRouteLineLayer:function(e){var t=e.color,r=e.width,i=e.opacity,o=Math.max(r,0),l=Math.min(Math.max(i,0),1),u=a.map(function(e){return Ds.has(e.id)?Fs.has(e.id)?Ns(e,{lineColor:"#FFFFFF",lineGapWidth:o>0?o+1:0,lineOpacity:l}):Ns(e,{lineColor:t,lineWidth:o,lineOpacity:l}):e});s(u),n()}}),r.current},[a,n,t]);var w=a.map(Is).filter(Boolean);return l.createElement(l.Fragment,null,l.createElement(v,{id:"mapPinsSource",data:p.current},w),m.current.__getValue().length>2?l.createElement(b.ShapeSource,{id:"route",data:new b.Shape({type:"LineString",coordinates:m.current})},l.createElement(b.LineLayer,{id:"lineroute",style:g.current[0].style})):null)}var Bs={id:"43f36e14-e3f5-43c1-84c0-50a9c80dc5c7",name:"MapLibre",layers:[{id:"background",type:"background",paint:{"background-color":"rgb(242,243,240)"}},{id:"building",type:"fill",source:"openmaptiles","source-layer":"building",minzoom:12,paint:{"fill-antialias":!0,"fill-color":"#e0e0e0"}},{id:"aeroway-area",type:"fill",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["==","$type","Polygon"]],layout:{visibility:"visible"},paint:{"fill-color":"rgba(222, 222, 228, 1)"}},{id:"park",type:"fill",source:"openmaptiles","source-layer":"park",filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-color":"rgb(230, 233, 229)"}},{id:"landcover_park",type:"fill",source:"openmaptiles","source-layer":"landcover",filter:["all",["==","subclass","park"]],layout:{visibility:"visible"},paint:{"fill-color":"#c8facc","fill-antialias":!0}},{id:"landcover_grass",type:"fill",source:"openmaptiles","source-layer":"landcover",filter:["all",["==","$type","Polygon"],["==","class","grass"]],layout:{visibility:"visible"},paint:{"fill-color":"#d6dcd6","fill-opacity":1}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["==","$type","Polygon"],["!=","brunnel","tunnel"]],layout:{visibility:"visible"},paint:{"fill-antialias":!0,"fill-color":"rgba(208, 214, 218, 1)","fill-outline-color":{base:1,stops:[[0,"hsla(180, 6%, 63%, 0.82)"],[22,"hsla(180, 6%, 63%, 0.18)"]]}}},{id:"landcover_ice_shelf",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["==","$type","Polygon"],["==","subclass","ice_shelf"]],layout:{visibility:"visible"},paint:{"fill-color":"hsl(0, 0%, 98%)","fill-opacity":.7}},{id:"landcover_glacier",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["==","$type","Polygon"],["==","subclass","glacier"]],layout:{visibility:"visible"},paint:{"fill-color":"hsl(0, 0%, 98%)","fill-opacity":{base:1,stops:[[0,1],[8,.5]]}}},{id:"landuse_residential",type:"fill",source:"openmaptiles","source-layer":"landuse",maxzoom:16,filter:["all",["==","$type","Polygon"],["==","class","residential"]],layout:{visibility:"visible"},paint:{"fill-color":"rgb(234, 234, 230)","fill-opacity":{base:.6,stops:[[8,.8],[9,.6]]}}},{id:"landcover_wood",type:"fill",source:"openmaptiles","source-layer":"landcover",minzoom:10,filter:["all",["==","$type","Polygon"],["==","class","wood"]],layout:{visibility:"visible"},paint:{"fill-color":"rgb(220,224,220)","fill-opacity":{base:1,stops:[[8,0],[12,1]]}}},{id:"water_name",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"symbol-placement":"line","symbol-spacing":500,"text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-rotation-alignment":"map","text-size":12},paint:{"text-color":"rgb(157,169,177)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"tunnel_motorway_casing",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"butt","line-join":"miter",visibility:"visible"},paint:{"line-color":"rgb(213, 213, 213)","line-opacity":1,"line-width":{base:1.4,stops:[[5.8,0],[6,3],[20,40]]}}},{id:"tunnel_motorway_inner",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgb(234,234,234)","line-width":{base:1.4,stops:[[4,2],[6,1.3],[20,30]]}}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(251, 251, 251, 1)","line-opacity":1,"line-width":{base:1.55,stops:[[13,5],[20,20]]}}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"hsl(0, 0%, 88%)","line-opacity":1,"line-width":{base:1.5,stops:[[11,6],[17,55]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-opacity":1,"line-width":{base:1.5,stops:[[11,4],[17,50]]}}},{id:"road_area_pier",type:"fill",metadata:{},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","Polygon"],["==","class","pier"]],layout:{visibility:"visible"},paint:{"fill-antialias":!0,"fill-color":"rgb(242,243,240)"}},{id:"road_pier",type:"line",metadata:{},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["in","class","pier"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#F5f5f5","line-width":{base:1.2,stops:[[15,1],[17,4]]}}},{id:"highway_minor",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:8,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fdfdfd","line-opacity":.9,"line-width":{base:1.55,stops:[[13,1.8],[20,20]]}}},{id:"highway_major_casing",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==","$type","LineString"],["in","class","primary","secondary","tertiary","trunk"]],layout:{"line-cap":"butt","line-join":"miter",visibility:"visible"},paint:{"line-color":"rgb(213, 213, 213)","line-dasharray":[12,0],"line-width":{base:1.3,stops:[[10,3],[20,23]]}}},{id:"highway_major_inner",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==","$type","LineString"],["in","class","primary","secondary","tertiary","trunk"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fff","line-width":{base:1.3,stops:[[10,2],[20,20]]}}},{id:"highway_major_subtle",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",maxzoom:11,filter:["all",["==","$type","LineString"],["in","class","primary","secondary","tertiary","trunk"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 85%, 0.69)","line-width":2}},{id:"highway_motorway_casing",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"butt","line-join":"miter",visibility:"visible"},paint:{"line-color":"rgb(213, 213, 213)","line-dasharray":[2,0],"line-opacity":1,"line-width":{base:1.4,stops:[[5.8,0],[6,3],[20,40]]}}},{id:"highway_motorway_inner",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":{base:1,stops:[[5.8,"hsla(0, 0%, 85%, 0.53)"],[6,"#fff"]]},"line-width":{base:1.4,stops:[[4,2],[6,1.3],[20,30]]}}},{id:"highway_motorway_subtle",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",maxzoom:6,filter:["all",["==","$type","LineString"],["==","class","motorway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 85%, 0.53)","line-width":{base:1.4,stops:[[4,2],[6,1.3]]}}},{id:"railway_transit",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#dddddd","line-width":3}},{id:"railway_transit_dashline",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#fafafa","line-dasharray":[3,3],"line-width":2}},{id:"railway_service",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#dddddd","line-width":3}},{id:"railway_service_dashline",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==","$type","LineString"],["==","class","rail"],["has","service"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#fafafa","line-dasharray":[3,3],"line-width":2}},{id:"railway",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==","$type","LineString"],["all",["!has","service"],["==","class","rail"]]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#dddddd","line-width":{base:1.3,stops:[[16,3],[20,7]]}}},{id:"railway_dashline",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==","$type","LineString"],["all",["!has","service"],["==","class","rail"]]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#fafafa","line-dasharray":[3,3],"line-width":{base:1.3,stops:[[16,2],[20,6]]}}},{id:"highway_motorway_bridge_casing",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","motorway"]]],layout:{"line-cap":"butt","line-join":"miter",visibility:"visible"},paint:{"line-color":"rgb(213, 213, 213)","line-dasharray":[2,0],"line-opacity":1,"line-width":{base:1.4,stops:[[5.8,0],[6,5],[20,45]]}}},{id:"highway_motorway_bridge_inner",type:"line",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":{base:1,stops:[[5.8,"hsla(0, 0%, 85%, 0.53)"],[6,"#fff"]]},"line-width":{base:1.4,stops:[[4,2],[6,1.3],[20,30]]}}},{id:"highway_name_other",type:"symbol",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation_name",filter:["all",["!=","class","motorway"],["==","$type","LineString"]],layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":"{name:latin} {name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-max-angle":30,"text-pitch-alignment":"viewport","text-rotation-alignment":"map","text-size":10,"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":"#bbb","text-halo-blur":1,"text-halo-color":"#fff","text-halo-width":2,"text-translate":[0,0]}},{id:"highway_name_motorway",type:"symbol",metadata:{"mapbox:group":"b6371a3f2f5a9932464fa3867530a2e5"},source:"openmaptiles","source-layer":"transportation_name",filter:["all",["==","$type","LineString"],["==","class","motorway"]],layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":"{ref}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-pitch-alignment":"viewport","text-rotation-alignment":"viewport","text-size":10,visibility:"visible"},paint:{"text-color":"rgb(117, 129, 145)","text-halo-blur":1,"text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":1,"text-translate":[0,2]}},{id:"boundary_state",type:"line",metadata:{"mapbox:group":"a14c9607bc7954ba1df7205bf660433f"},source:"openmaptiles","source-layer":"boundary",filter:["==","admin_level",4],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-blur":.4,"line-color":"rgb(230, 204, 207)","line-dasharray":[2,2],"line-opacity":1,"line-width":{base:1.3,stops:[[3,1],[22,15]]}}},{id:"boundary_country_z0-4",type:"line",metadata:{"mapbox:group":"a14c9607bc7954ba1df7205bf660433f"},source:"openmaptiles","source-layer":"boundary",maxzoom:5,filter:["all",["==","admin_level",2],["!has","claimed_by"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-blur":{base:1,stops:[[0,.4],[22,4]]},"line-color":"rgb(230, 204, 207)","line-opacity":1,"line-width":{base:1.1,stops:[[3,1],[22,20]]}}},{id:"boundary_country_z5-",type:"line",metadata:{"mapbox:group":"a14c9607bc7954ba1df7205bf660433f"},source:"openmaptiles","source-layer":"boundary",minzoom:5,filter:["==","admin_level",2],layout:{"line-cap":"round","line-join":"round"},paint:{"line-blur":{base:1,stops:[[0,.4],[22,4]]},"line-color":"rgb(230, 204, 207)","line-opacity":1,"line-width":{base:1.1,stops:[[3,1],[22,20]]}}},{id:"place_other",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:14,filter:["all",["in","class","continent","hamlet","neighbourhood","isolated_dwelling"],["==","$type","Point"]],layout:{"text-anchor":"center","text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-justify":"center","text-offset":[.5,0],"text-size":10,"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":"rgb(117, 129, 145)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"place_suburb",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:15,filter:["all",["==","$type","Point"],["==","class","suburb"]],layout:{"text-anchor":"center","text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-justify":"center","text-offset":[.5,0],"text-size":10,"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":"rgb(117, 129, 145)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"place_village",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:14,filter:["all",["==","$type","Point"],["==","class","village"]],layout:{"icon-size":.4,"text-anchor":"left","text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-justify":"left","text-offset":[.5,.2],"text-size":10,"text-transform":"uppercase",visibility:"visible"},paint:{"icon-opacity":.7,"text-color":"rgb(117, 129, 145)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"place_town",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:15,filter:["all",["==","$type","Point"],["==","class","town"]],layout:{"text-anchor":{base:1,stops:[[0,"left"],[8,"center"]]},"text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-justify":"left","text-size":10,"text-transform":"uppercase",visibility:"visible"},paint:{"icon-opacity":.7,"text-color":"rgb(117, 129, 145)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"place_city",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:14,filter:["all",["==","$type","Point"],["all",["!=","capital",2],["==","class","city"],[">","rank",3]]],layout:{"text-anchor":{base:1,stops:[[0,"left"],[8,"center"]]},"text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-justify":"left","text-size":10,"text-transform":"uppercase",visibility:"visible"},paint:{"icon-opacity":.7,"text-color":"rgb(117, 129, 145)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"place_capital",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:12,filter:["all",["==","$type","Point"],["all",["==","capital",2],["==","class","city"]]],layout:{"text-anchor":{base:1,stops:[[0,"left"],[8,"center"]]},"text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-justify":"left","text-size":14,"text-transform":"uppercase",visibility:"visible"},paint:{"icon-opacity":.7,"text-color":"rgb(117, 129, 145)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"place_city_large",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:12,filter:["all",["==","$type","Point"],["all",["!=","capital",2],["<=","rank",3],["==","class","city"]]],layout:{"text-anchor":{base:1,stops:[[0,"left"],[8,"center"]]},"text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-justify":"left","text-size":14,"text-transform":"uppercase",visibility:"visible"},paint:{"icon-opacity":.7,"text-color":"rgb(117, 129, 145)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"place_state",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:12,filter:["all",["==","$type","Point"],["==","class","state"]],layout:{"text-field":"{name:latin}\n{name:nonlatin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-size":10,"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":"rgb(113, 129, 144)","text-halo-blur":1,"text-halo-color":"rgb(242,243,240)","text-halo-width":1}},{id:"place_country_other",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:8,filter:["all",["==","$type","Point"],["==","class","country"],["!has","iso_a2"]],layout:{"text-field":"{name:latin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-size":{base:1,stops:[[0,9],[6,11]]},"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":{base:1,stops:[[3,"rgb(157,169,177)"],[4,"rgb(153, 153, 153)"]]},"text-halo-color":"rgba(236,236,234,0.7)","text-halo-width":1.4}},{id:"place_country_minor",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:8,filter:["all",["==","$type","Point"],["==","class","country"],[">=","rank",2],["has","iso_a2"]],layout:{"text-field":"{name:latin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-size":{base:1,stops:[[0,10],[6,12]]},"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":{base:1,stops:[[3,"rgb(157,169,177)"],[4,"rgb(153, 153, 153)"]]},"text-halo-color":"rgba(236,236,234,0.7)","text-halo-width":1.4}},{id:"place_country_major",type:"symbol",metadata:{"mapbox:group":"101da9f13b64a08fa4b6ac1168e89e5f"},source:"openmaptiles","source-layer":"place",maxzoom:6,filter:["all",["==","$type","Point"],["<=","rank",1],["==","class","country"],["has","iso_a2"]],layout:{"text-anchor":"center","text-field":"{name:latin}","text-font":["Source Sans Pro Black","Arial Unicode MS Regular"],"text-size":{base:1.4,stops:[[0,10],[3,12],[4,14]]},"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":{base:1,stops:[[3,"rgb(157,169,177)"],[4,"rgb(153, 153, 153)"]]},"text-halo-color":"rgba(236,236,234,0.7)","text-halo-width":1.4}}],sprite:"https://atoms-map-sprites.qa.cag.spatialverse.online/sprites/sprites",glyphs:"https://atoms-map-sprites.qa.cag.spatialverse.online/fonts/{fontstack}/{range}.pbf",sources:{openmaptiles:{type:"vector",url:"https://api.maptiler.com/tiles/v3/tiles.json?key=12H5hrITUbJ1sDrVPqkq"}},version:8},Us=[{id:"Building overlay base",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel.l1","#97b5bc"],["where.changi.terminals.t1.l1","#92a7b8"],["where.changi.terminals.t2.l1","#d59d99"],["where.changi.terminals.t3.l1","#8ab8b5"],["where.changi.terminals.t4.l1","#a891aa"]],default:"#1a72B6"},"fill-opacity":1,"fill-antialias":!1},"source-layer":"geojson"},{id:"Aerobridge",type:"fill",metadata:{"source-type":"steerpath_base_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.infra.aerobridge","what.infra.tunnel"]]]],paint:{"fill-color":"hsl(0, 0%, 68%)","fill-opacity":{base:1,stops:[[15,0],[15.5,.99]]},"fill-antialias":!1},"source-layer":"geojson"},{id:"Airplanes",type:"fill",metadata:{"source-type":"steerpath_base_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.plane"]],paint:{"fill-color":{base:1,stops:[[15,"hsl(0, 0%, 53%)"],[15.5,"hsl(0, 0%, 100%)"]]},"fill-outline-color":"hsl(0, 0%, 50%)","fill-opacity":{base:1,stops:[[15,0],[15.5,.99]]},"fill-antialias":!1},"source-layer":"geojson"},{id:"building_outline",type:"fill",metadata:{"source-type":"steerpath_base_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","subType"],"building_outline"]],paint:{"fill-color":"hsl(0, 0%, 82%)","fill-opacity":.2,"fill-outline-color":"hsl(0, 0%, 82%)"},"source-layer":"geojson"},{id:"Skytrain track outdoor",type:"fill",metadata:{"source-type":"steerpath_base_tiles"},source:"custom",filter:["all",["==",["get","dimension_where"],"where.changi.terminals.t2.l2"],["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.transport.skytrain"]],paint:{"fill-color":"hsl(0, 0%, 100%)","fill-opacity":.99,"fill-outline-color":"hsl(0, 0%, 69%)"},"source-layer":"geojson"},{id:"Skytrain line outdoor",type:"line",metadata:{"source-type":"steerpath_base_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.transport.skytrain"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":"hsl(13, 97%, 67%)","line-width":3},"source-layer":"geojson"},{id:"Floor",type:"fill",metadata:{"source-type":"steerpath_base_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.infra.floor","what.floor"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":"hsl(0, 0%, 100%)","fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Skytrain track",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.transport.skytrain"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none"},paint:{"fill-color":"hsl(0, 0%, 100%)","fill-opacity":.99,"fill-outline-color":"hsl(0, 0%, 69%)"},"source-layer":"geojson"},{id:"Changi Airport Connector",type:"fill",minzoom:16,maxzoom:24,metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.transport.walkway"]],layout:{visibility:"visible"},paint:{"fill-color":"#faefd6","fill-opacity":.99,"fill-outline-color":"#cd9d2d"},"source-layer":"geojson"},{id:"Changi Airport Connector Text",type:"symbol",minzoom:16,maxzoom:24,metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.transport.walkway"]],layout:{"symbol-placement":"line","symbol-spacing":300,"text-field":"{title}","text-font":["Lato Regular"],"text-max-angle":30,"text-pitch-alignment":"viewport","text-rotation-alignment":"map","text-size":12,"text-transform":"none"},paint:{"text-halo-color":"#cd9d2d","text-color":"#ffffff","text-halo-width":2},"source-layer":"geojson"},{id:"Changi Sheltered Walkway",type:"fill",minzoom:16,maxzoom:24,metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.transport.walkway_sheltered"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible"},paint:{"fill-color":"#d6e2fa","fill-opacity":.99,"fill-outline-color":"#375692"},"source-layer":"geojson"},{id:"Carpark fill",metadata:{"source-type":"steerpath_floor_tiles"},minzoom:16,maxzoom:24,type:"fill",source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.infra.carpark","what.infra.parking_bike","what.infra.parking_bike_locked"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{stops:[[18,"#dddddd"],[19.25,"#c0c0c0"]]},"fill-opacity":{stops:[[16,0],[16.5,.99]]}},"source-layer":"geojson"},{id:"Public",type:"fill",minzoom:15,maxzoom:17,metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.wing"],["==",["get","title"],"Public"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none"},paint:{"fill-color":"hsl(43, 100%, 98%)","fill-opacity":.3,"fill-antialias":!1},"source-layer":"geojson"},{id:"Transit",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.wing"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none"},paint:{"fill-color":"hsl(0, 0%, 100%)","fill-antialias":!1,"fill-opacity":.99},"source-layer":"geojson"},{id:"Hole fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.hole"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":"hsl(0, 0%, 90%)","fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Immigration",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.service.immigration"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"#89CBDF"],[17.5,"hsl(194, 79%, 91%)"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Other service areas",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:16,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.service.baggage_claim","what.service.atm","what.service.baby_care","what.service.baggage_storage","what.service.clinic","what.service.tax_refund","what.service.free_singapore_tour","what.service.information","what.service.internet","what.service.laptop_access","what.service.meditation_room","what.service.money_exchange","what.service.phone","what.service.post","what.service.prayer_room","what.service.smoking_area","what.service.cloakroom","what.service.toilet","what.service.wifi","what.other","what.service.prayer_room","what.service.adult_diaper_change","what.service.changi_rewards","what.service.toilet_accessible","what.service.shower"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":"hsl(263, 75%, 96%)","fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Retail",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.shop.retail","what.shop.retail_anchor"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"#CAACED"],[17.5,"#E0CCF8"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Lounge",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.service.airline_lounge","what.service.pay_per_use_lounge","what.service.lodging","what.service.airport_transfer","what.service.vip_counter","what.service.connect_changi","what.service.lounge_changi"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"hsl(224, 46%, 72%)"],[17.5,"hsl(215, 66%, 94%)"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Gate",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.airplane_gate","what.gate_airplane"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"#89CBDF"],[17.5,"hsl(194, 79%, 91%)"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Gate screening",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.security"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible"},paint:{"fill-color":{base:1,stops:[[17,"#89CBDF"],[17.5,"hsl(194, 54%, 85%)"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Travelator",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.travelator"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":"hsl(0, 0%, 96%)","fill-opacity":{base:1,stops:[[17,0],[17.5,.99]]}},"source-layer":"geojson"},{id:"Checkin",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.service.checkin","what.service.checkin_early"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"#89CBDF"],[17.5,"hsl(194, 79%, 91%)"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Entertainment",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.shop.fun","what.service.movie_theatre","what.service.tv_lounge","what.service.attraction_tour"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"hsl(1, 100%, 82%)"],[17.5,"hsl(0, 100%, 95%)"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Entertainment outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.shop.fun","what.service.movie_theatre","what.service.tv_lounge","what.service.attraction_tour"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,stops:[[17,"hsl(330, 100%, 82%)"],[17.5,"hsl(330, 100%, 68%)"]]},"line-width":1},"source-layer":"geojson"},{id:"Water fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.infra.water"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"hsl(195, 87%, 63%)"],[17.5,"hsl(197, 71%, 91%)"]]},"fill-opacity":.99,"fill-antialias":!0},"source-layer":"geojson"},{id:"Water outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.infra.water"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,stops:[[17,"hsl(190, 91%, 53%)"],[17.5,"hsl(190, 100%, 41%)"]]},"line-width":1},"source-layer":"geojson"},{id:"Garden fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.garden"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"hsl(183, 64%, 56%)"],[17.5,"hsl(181, 49%, 89%)"]]},"fill-opacity":.99,"fill-antialias":!0},"source-layer":"geojson"},{id:"Garden outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.garden"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,stops:[[17,"hsl(159, 55%, 61%)"],[17.5,"hsl(164, 100%, 35%)"]]},"line-width":1},"source-layer":"geojson"},{id:"Pickup zone outline",type:"line",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.transport.pickup","what.transport.pickup_car"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":"hsl(0, 0%, 78%)","line-width":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Pick-up Zone",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.transport.pickup","what.transport.pickup_car"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"#bcbaba"],[17.5,"#ececec"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Restarea",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.service.rest_area"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"hsl(1, 100%, 82%)"],[17.5,"hsl(0, 100%, 95%)"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Food",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.shop.food","what.shop.food","what.shop.food_anchor","what.shop.food_anchor"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"#FFD3B3"],[17.5,"#FFE3CE"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Road marking fill",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill",source:"custom",minzoom:19,maxzoom:24,filter:["all",["in",["get","$type"],["literal",["Polygon"]]],["==",["get","dimension_what"],"what.road.marking_fill"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-opacity":{base:1,stops:[[19,0],[19.25,1]]},"fill-color":"#ffffff"},"source-layer":"geojson"},{id:"road marking line",metadata:{"source-type":"steerpath_floor_tiles"},type:"line",source:"custom",minzoom:19,maxzoom:24,filter:["all",["==",["get","dimension_what"],"what.road.marking_line"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-opacity":{base:1,stops:[[19,0],[19.25,1]]},"line-color":"#ffffff","line-width":1.5},"source-layer":"geojson"},{id:"Kerb",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:18,maxzoom:24,filter:["all",["==",["get","dimension_what"],"what.road.kerb"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-opacity":{base:1,stops:[[18,0],[18.25,1]]},"line-color":"hsl(0, 0%, 63%)","line-width":1.5},"source-layer":"geojson"},{id:"Hole outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.hole"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-opacity":{base:1,stops:[[17,0],[17.5,1]]},"line-color":"hsl(0, 0%, 68%)","line-width":1},"source-layer":"geojson"},{id:"Travelator outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:16,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.travelator"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{},paint:{"line-color":"hsl(0, 0%, 81%)","line-width":3,"line-opacity":1},"source-layer":"geojson"},{id:"Airplanes outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.airplane"]],layout:{},paint:{"line-color":"hsl(0, 0%, 76%)","line-opacity":{base:1,stops:[[15,0],[15.5,1]]}},"source-layer":"geojson"},{id:"Immigration outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.service.immigration"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none"},paint:{"line-color":"hsl(0, 0%, 85%)","line-width":2},"source-layer":"geojson"},{id:"Checkin outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.service.checkin","what.service.checkin_early"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-width":1,"line-color":"#89CBDF"},"source-layer":"geojson"},{id:"Other service outline",type:"line",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:16,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.service.baggage_claim","what.service.atm","what.service.baby_care","what.service.baggage_storage","what.service.clinic","what.service.free_singapore_tour","what.service.information","what.service.internet","what.service.laptop_access","what.service.meditation_room","what.service.money_exchange","what.service.phone","what.service.post","what.service.prayer_room","what.service.smoking_area","what.service.tax_refund","what.service.cloakroom","what.service.toilet","what.service.wifi","what.other","what.service.prayer_room","what.service.adult_diaper_change","what.service.changi_rewards","what.service.toilet_accessible","what.service.shower"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":"hsl(0, 0%, 78%)","line-width":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Retail outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.shop.retail","what.shop.retail_anchor"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,stops:[[17,"#CAACED"],[17.5,"#986FCA"]]},"line-width":1},"source-layer":"geojson"},{id:"Lounge outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.service.airline_lounge","what.service.pay_per_use_lounge","what.service.lodging","what.service.airport_transfer","what.service.vip_counter","what.service.connect_changi","what.service.lounge_changi"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,stops:[[17,"hsl(224, 46%, 72%)"],[17.5,"hsl(224, 43%, 58%)"]]},"line-width":1},"source-layer":"geojson"},{id:"Food outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.shop.food","what.shop.food","what.shop.food_anchor","what.shop.food_anchor"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,stops:[[17,"#FFD3B3"],[17.5,"#FFB681"]]},"line-width":1},"source-layer":"geojson"},{id:"Gate and outline",type:"line",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["in",["get","$type"],["literal",["LineString","Polygon"]]],["in",["get","dimension_what"],["literal",["what.airplane_gate","what.gate_airplane","what.security"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,stops:[[17,"#89CBDF"],[17.5,"hsl(194, 56%, 49%)"]]},"line-width":1},"source-layer":"geojson"},{id:"Restarea outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.service.rest_area"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,stops:[[17,"hsl(330, 100%, 82%)"],[17.5,"hsl(330, 100%, 68%)"]]},"line-width":1},"source-layer":"geojson"},{id:"highlight_custom_fill",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill",minzoom:18,source:"custom",filter:["all",["all",["==",["geometry-type"],"Polygon"]],["any"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none"},paint:{"fill-color":"#f6f6f6","fill-opacity":{stops:[[16,0],[16.5,.5]]}},"source-layer":"geojson"},{id:"highlight_custom_outline",metadata:{"source-type":"steerpath_floor_tiles"},type:"line",minzoom:18,source:"custom",filter:["all",["all",["==",["geometry-type"],"Polygon"]],["any"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none","line-join":"round","line-cap":"round"},paint:{"line-color":"#5d5d5d","line-blur":10,"line-width":20,"line-opacity":{stops:[[16,0],[16.5,1]]}},"source-layer":"geojson"},{id:"Public outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","title"],"Public"],["==",["get","dimension_what"],"what.infra.wing"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none"},paint:{"line-width":2,"line-color":"hsl(0, 0%, 46%)"},"source-layer":"geojson"},{id:"Transit border",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.infra.wing"],["==",["get","title"],"Transit"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":"hsl(270, 41%, 46%)","line-width":2},"source-layer":"geojson"},{id:"Floor outline aka wall fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.infra.wall","what.wall"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":"hsl(0, 0%, 56%)"},"source-layer":"geojson"},{id:"Floor outline aka wall",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["in",["get","dimension_what"],["literal",["what.infra.wall","what.wall"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-width":{base:1,stops:[[15.5,1],[22,3]]},"line-color":"hsl(0, 0%, 56%)"},"source-layer":"geojson"},{id:"T2 overlay outline copy",metadata:{"source-type":"steerpath_floor_tiles"},type:"line",source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","subType"],"building_outline"]],layout:{visibility:"none"},paint:{"line-color":"#ee3424","line-opacity":1,"line-width":3},"source-layer":"geojson"},{id:"High poi extrude",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill-extrusion",minzoom:16,maxzoom:20,source:"custom",layout:{visibility:"none"},filter:["all",["==",["geometry-type"],"Polygon"],["all",["in",["get","dimension_what"],["literal",["what.shop.retail","what.shop.retail_anchor","what.shop.food","what.shop.food","what.shop.food_anchor","what.shop.food_anchor","what.service.checkin","what.airplane_gate","what.security"]]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-extrusion-base":0,"fill-extrusion-color":{base:1,type:"categorical",property:"dimension_what",stops:[["category_retail","#E0CCF8"],["category_retail_anchor","#E0CCF8"],["category_restaurant","#FFE3CE"],["category_restaurant_anchor","#FFE3CE"],["category_food","#FFE3CE"],["category_food_anchor","#FFE3CE"],["service_checkin","hsl(194, 79%, 91%)"],["category_airplane_gate","hsl(194, 79%, 91%)"],["category_security","hsl(194, 54%, 85%)"]],default:"#ebe8e5"},"fill-extrusion-height":{stops:[[17,0],[17.5,3],[19,3],[19.5,0]]},"fill-extrusion-opacity":{stops:[[17,0],[17.5,.75],[19,.75],[19.5,0]]}},"source-layer":"geojson"},{id:"Medium poi extrude",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill-extrusion",minzoom:16,maxzoom:20,source:"custom",layout:{visibility:"none"},filter:["all",["==",["geometry-type"],"Polygon"],["all",["in",["get","dimension_what"],["literal",["what.service.baggage_claim","what.other"]]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-extrusion-base":0,"fill-extrusion-color":{base:1,type:"categorical",property:"dimension_what",stops:[["service_baggage_claim","hsl(263, 75%, 96%)"],["category_other","hsl(263, 75%, 96%)"]],default:"#ebe8e5"},"fill-extrusion-height":{stops:[[17,0],[17.5,1.5],[19,1.5],[19.5,0]]},"fill-extrusion-opacity":{stops:[[17,0],[17.5,.75],[19,.75],[19.5,0]]}},"source-layer":"geojson"},{id:"Low poi extrude",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill-extrusion",minzoom:16,maxzoom:20,source:"custom",layout:{visibility:"none"},filter:["all",["in",["get","dimension_what"],["literal",["what.infra.garden"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-extrusion-base":0,"fill-extrusion-color":{base:1,type:"categorical",property:"dimension_what",stops:[["other","#ebe8e5"],["infrastructure_garden","hsl(181, 49%, 89%)"]],default:"#ebe8e5"},"fill-extrusion-height":{stops:[[17,0],[17.5,.5],[19,.5],[19.5,0]]},"fill-extrusion-opacity":{stops:[[17,0],[17.5,.75],[19,.75],[19.5,0]]}},"source-layer":"geojson"},{id:"temporarily_disabled_highlight_custom_extrusion",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill-extrusion",source:"custom",minzoom:18,layout:{visibility:"none"},filter:["all",["all",["==",["get","buildingRef"],"67"]],["any"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-extrusion-base":0,"fill-extrusion-color":{type:"identity",property:"fillExtrusionColor",default:"#fff"},"fill-extrusion-height":{stops:[[16,0],[16.5,.1]]},"fill-extrusion-opacity":{stops:[[16,0],[16.5,.5]]}},"source-layer":"geojson"},{id:"Aerobridge gates",metadata:{"source-type":"steerpath_floor_tiles"},type:"symbol",source:"custom",filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.infra.aerobridge"]],layout:{visibility:"none","text-field":"{cad_text}","text-font":["Lato Regular"],"text-padding":0,"text-size":15,"text-ignore-placement":!0},paint:{"text-opacity":{base:1,stops:[[15,0],[15.5,1],[17,1],[17.5,0]]},"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(194, 64%, 49%)","text-halo-width":2},"source-layer":"geojson"},{id:"Gate names",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.airplane_gate","what.gate_airplane"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","text-field":"{title}","text-font":["Lato Regular"],"text-padding":0,"text-ignore-placement":!0,"text-size":18,"text-allow-overlap":!0},paint:{"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(194, 79%, 91%)","text-color":"hsl(194, 64%, 49%)","text-halo-width":2},"source-layer":"geojson"},{id:"Lounge title",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.service.airline_lounge","what.service.lodging","what.service.vip_counter","what.service.checkin_early","what.service.connect_changi","what.service.lounge_changi"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]],["has","title"],["!=",["get","title"],""]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,15]]},"text-padding":2,"text-font":["Lato Regular"],"text-field":"{title}","text-letter-spacing":0,"text-max-width":5,"icon-image":"{dimension_what}","icon-offset":[0,-32],"text-anchor":"top","icon-size":{base:1,stops:[[17,.3],[22,1]]},"icon-padding":1},paint:{"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-blur":0,"text-halo-color":"hsl(224, 43%, 58%)","text-halo-width":1.5,"text-color":"#ffffff","text-translate":[0,0],"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]}}},{id:"Pay Per Use Lounge title",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.service.pay_per_use_lounge"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]],["has","title"],["!=",["get","title"],""]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,15]]},"text-padding":2,"text-font":["Lato Regular"],"text-field":"{title}","text-letter-spacing":0,"text-max-width":5,"icon-image":"what.service.airline_lounge","icon-offset":[0,-32],"text-anchor":"top","icon-size":{base:1,stops:[[17,.3],[22,1]]},"icon-padding":1},paint:{"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-blur":0,"text-halo-color":"hsl(224, 43%, 58%)","text-halo-width":1.5,"text-color":"#ffffff","text-translate":[0,0],"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]}}},{id:"Tenant title",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.shop.retail","what.shop.food"]]],["!=",["get","title"],""],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,15]]},"icon-offset":[0,-20],"icon-image":"{dimension_what}","text-font":["Lato Regular"],"text-padding":1,"icon-size":{base:1,stops:[[17,.3],[21,1]]},"text-anchor":"top","text-field":"{title}","text-letter-spacing":0,"text-max-width":5},paint:{"text-color":"#ffffff","text-halo-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.shop.retail","hsl(267, 31%, 52%)"],["what.shop.food","hsl(25, 76%, 58%)"]],default:"hsl(267, 31%, 52%)"},"text-halo-blur":0,"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-width":2,"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Anchor tenant title",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.shop.retail_anchor","what.shop.food_anchor"]]],["!=",["get","title"],""],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,15]]},"icon-offset":[0,-20],"icon-image":{base:1,type:"categorical",property:"dimension_what",stops:[["what.shop.retail_anchor","what.shop.retail"],["what.shop.food_anchor","what.shop.food"]],default:"what.shop.retail"},"text-font":["Lato Regular"],"text-padding":1,"icon-size":{base:1,stops:[[17,.3],[21,1]]},"text-anchor":"top","text-field":"{title}","text-letter-spacing":0,"text-max-width":5},paint:{"text-color":"#ffffff","text-halo-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.shop.retail_anchor","hsl(267, 31%, 52%)"],["what.shop.food_anchor","hsl(25, 76%, 58%)"]],default:"hsl(267, 31%, 52%)"},"text-halo-blur":0,"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-width":2,"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Entrance texts",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.infra.entrance"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","text-field":"{title}","text-font":["Lato Regular"],"text-padding":0,"text-size":{base:1,stops:[[17,8],[18,15]]},"text-ignore-placement":!0,"text-max-width":5},paint:{"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 39%)","text-halo-width":2},"source-layer":"geojson"},{id:"Exit texts",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.infra.exit"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","text-field":"{title}","text-font":["Lato Regular"],"text-padding":0,"text-size":{base:1,stops:[[17,8],[18,15]]},"text-ignore-placement":!0},paint:{"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 39%)","text-halo-width":2},"source-layer":"geojson"},{id:"Changi Walkway Text",type:"symbol",minzoom:16,maxzoom:24,metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.transport.walkway"]],layout:{"text-field":"{title}","text-font":["Lato Regular"],"text-pitch-alignment":"viewport","text-size":12},paint:{"text-halo-color":"#cd9d2d","text-color":"#ffffff","text-halo-width":2,"text-opacity":0},"source-layer":"geojson"},{id:"Changi Sheltered Walkway Text",type:"symbol",minzoom:16,maxzoom:24,metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.transport.walkway_sheltered"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-field":"{title}","text-font":["Lato Regular"],"text-pitch-alignment":"viewport","text-size":12},paint:{"text-halo-color":"#375692","text-color":"#ffffff","text-halo-width":2},"source-layer":"geojson"},{id:"Checkin row text",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.service.checkin"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","text-field":"{title}","text-font":["Lato Regular"],"text-padding":0,"text-size":{base:1,stops:[[17,8],[18,15]]}},paint:{"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 39%)","text-halo-width":2},"source-layer":"geojson"},{id:"Belt text",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.service.baggage_claim"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","text-field":"{title}","text-font":["Lato Regular"],"text-padding":0,"text-size":{base:1,stops:[[17,8],[18,15]]}},paint:{"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 39%)","text-halo-width":2},"source-layer":"geojson"},{id:"Infrastructure icons",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.infra.ramp","what.infra.escalator"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","icon-image":"{dimension_what}","text-font":["Lato Regular"],"icon-size":{base:1,stops:[[17,.3],[22,.7]]},"icon-padding":1},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Attraction text and icon",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["has","title"],["!=",["get","title"],""],["in",["get","dimension_what"],["literal",["what.shop.fun","what.service.attraction_tour"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[22,15]]},"icon-offset":[0,-30],"icon-image":"{dimension_what}","text-transform":"uppercase","text-font":["Lato Regular"],visibility:"visible","icon-size":{base:1,stops:[[17,.3],[22,.7]]},"text-anchor":"top","text-field":"{title}","text-letter-spacing":0,"icon-padding":1,"text-max-width":5},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(330, 100%, 68%)","text-halo-width":2,"text-halo-blur":0,"text-color":"hsl(0, 0%, 100%)"},"source-layer":"geojson"},{id:"Rest area text and icon",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.service.rest_area"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[22,15]]},"icon-offset":[0,-30],"icon-image":"{dimension_what}","text-transform":"uppercase","text-font":["Lato Regular"],visibility:"visible","icon-size":{base:1,stops:[[17,.3],[24,1]]},"text-anchor":"top","text-field":"{title}","text-letter-spacing":0,"icon-padding":1,"text-max-width":5},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(330, 100%, 68%)","text-halo-width":2,"text-halo-blur":0,"text-color":"hsl(0, 0%, 100%)"},"source-layer":"geojson"},{id:"Airport transfer icon and text",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.service.airport_transfer"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,15]]},"icon-offset":[0,-40],"icon-image":"{dimension_what}","text-font":["Lato Regular"],visibility:"visible","icon-size":{base:1,stops:[[17,.3],[22,.7]]},"text-anchor":"top","text-field":"{title}","text-letter-spacing":0,"icon-padding":1,"text-max-width":5},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"#ec7033","text-halo-width":2,"text-halo-blur":0,"text-color":"hsl(0, 0%, 100%)"},"source-layer":"geojson"},{id:"Other Attraction icons",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["has","title"],["!=",["get","title"],""],["in",["get","dimension_what"],["literal",["what.service.movie_theatre"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[22,15]]},"icon-offset":[0,-30],"icon-image":"{dimension_what}","text-transform":"uppercase","text-font":["Lato Regular"],visibility:"visible","icon-size":{base:1,stops:[[17,.3],[22,.7]]},"text-anchor":"top","text-field":"{title}","text-letter-spacing":0,"icon-padding":1,"text-max-width":5},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(330, 100%, 68%)","text-halo-width":2,"text-halo-blur":0,"text-color":"hsl(0, 0%, 100%)"},"source-layer":"geojson"},{id:"Other Service icons",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.infra.lift","what.service.phone","what.service.baggage_storage","what.service.atm","what.service.money_exchange","what.service.internet","what.service.tv_lounge","what.service.toilet","what.service.baby_care","what.service.clinic","what.service.post","what.service.wifi","what.service.prayer_room","what.service.tax_refund","what.service.device_charging","what.service.meditation_room","what.service.smoking_area","what.service.information","what.service.cloakroom","what.service.prayer_room","what.service.adult_diaper_change","what.service.changi_rewards","what.service.toilet_accessible","what.service.shower"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","icon-image":"{dimension_what}","text-font":["Lato Regular"],"icon-size":{base:1,stops:[[17,.3],[24,1]]},"icon-padding":1},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"iShop Changi",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","title"],"iShop Changi"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","icon-padding":1,"icon-size":{base:1,stops:[[17,.3],[22,1]]},"text-field":"{title}","text-font":["Lato Regular"],"text-max-width":4,"text-size":{base:1,stops:[[16,6],[20,18]]},"text-letter-spacing":-.05,"text-line-height":1},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-color":"hsl(0, 0%, 47%)","text-opacity":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Pickup Zone Text",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.transport.pickup","what.transport.pickup_car"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","text-field":"{title}","text-font":["Lato Regular"],"text-padding":0,"text-size":{base:1,stops:[[17,8],[18,15]]}},paint:{"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 39%)","text-halo-width":2},"source-layer":"geojson"},{id:"Gate screening icon",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.security"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","icon-image":"{dimension_what}","text-font":["Lato Regular"],"icon-size":{base:1,stops:[[17,.1],[19,1]]},"icon-padding":1},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Immigration icon",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.service.immigration"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","icon-image":"{dimension_what}","text-font":["Lato Regular"],"icon-size":{base:1,stops:[[17,.3],[22,1]]},"icon-allow-overlap":!0,"text-size":{base:1,stops:[[17,1],[20,18]]},"text-letter-spacing":-.05},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-opacity":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Parking icon",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.infra.carpark","what.infra.parking_bike","what.infra.parking_bike_locked"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,15]]},"icon-offset":[0,-40],"icon-image":"{dimension_what}","text-font":["Lato Regular"],visibility:"visible","text-offset":[0,0],"icon-size":{base:1,stops:[[17,.3],[22,1]]},"text-anchor":"top","text-field":"{title}","icon-padding":1},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-color":"hsl(0, 0%, 100%)","text-halo-color":"#ec7033","text-halo-width":2,"text-opacity":{base:1,stops:[[17,0],[17.5,1]]}},"source-layer":"geojson"},{id:"Transport Taxi, Bus, Consierge and Train",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.transport.taxi_queue","what.transport.taxi","what.transport.type_bus","what.transport.bus","what.transport.train","what.service.ground_transport_concierge"]]],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,15]]},"icon-offset":[0,0],"icon-image":"{dimension_what}","text-font":["Lato Regular"],"icon-allow-overlap":!0,visibility:"visible","text-offset":[0,1],"icon-size":{base:1,stops:[[17,.3],[22,.7]]},"text-anchor":"top","text-field":"{title}","text-letter-spacing":0,"icon-padding":1,"text-max-width":5},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-color":"hsl(0, 0%, 100%)","text-halo-color":"#ec7033","text-halo-width":2,"text-halo-blur":0,"text-translate":[0,0]},"source-layer":"geojson"},{id:"Construction area",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill",source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.construction"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,stops:[[17,"hsl(0, 0%, 100%)"],[17.5,"hsl(0, 0%, 70%)"]]},"fill-opacity":.99,"fill-antialias":!1},"source-layer":"geojson"},{id:"Construction outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.construction"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":"hsl(0, 0%, 70%)","line-opacity":1,"line-width":1},"source-layer":"geojson"},{id:"Construction text",metadata:{"source-type":"steerpath_floor_tiles"},type:"symbol",source:"custom",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.infra.construction"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","text-letter-spacing":-.05,"icon-size":{base:1,stops:[[17,.3],[22,1]]},"icon-allow-overlap":!0,"text-size":{base:1,stops:[[17,1],[20,20]]},"text-max-width":5,"text-field":"{title}","text-font":["Lato Regular"]},paint:{"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-color":"hsl(0, 0%, 39%)","text-halo-color":"hsl(0, 0%, 70%)","text-halo-width":4},"source-layer":"geojson"},{id:"highlight_custom_symbol",metadata:{"source-type":"steerpath_floor_tiles"},type:"symbol",source:"custom",minzoom:18,filter:["all",["all",["==",["geometry-type"],"Point"]],["any"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none","icon-image":"{dimension_what}","icon-size":1,"icon-optional":!0,"text-field":"{title}","text-max-width":4,"text-padding":2,"text-line-height":.8,"text-optional":!0,"text-font":["Lato Regular"],"icon-offset":[0,-16],"text-offset":[0,.2],"text-anchor":"top","text-size":{stops:[[16,10],[18,16]]}},paint:{"icon-opacity":{stops:[[16,0],[16.5,1]]},"text-color":"#fff","text-halo-width":2,"text-halo-color":"#373737","text-halo-blur":1,"text-opacity":{stops:[[18,0],[18.5,1]]}},"source-layer":"geojson"},{id:"Transit overlay",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill",source:"custom",minzoom:15,maxzoom:17,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.wing"],["==",["get","title"],"Transit"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":"hsl(250, 75%, 33%)","fill-antialias":!1,"fill-opacity":{base:1,stops:[[16,.4],[16.5,0]]}},"source-layer":"geojson"},{id:"Public overlay",metadata:{"source-type":"steerpath_floor_tiles"},type:"fill",source:"custom",minzoom:15,maxzoom:17,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.infra.wing"],["==",["get","title"],"Public"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":"hsl(31, 100%, 43%)","fill-opacity":{base:1,stops:[[16,.4],[16.5,0]]},"fill-antialias":!1},"source-layer":"geojson"},{id:"Public overlay text",metadata:{"source-type":"steerpath_floor_tiles"},type:"symbol",source:"custom",minzoom:15,maxzoom:17,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.infra.wing"],["==",["get","title"],"Public"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","icon-offset":[0,-104],"icon-size":1,"text-field":"Public","text-size":25,"text-font":["Lato Regular"],"text-allow-overlap":!0},paint:{"icon-opacity":{base:1,stops:[[13,1],[13.5,0]]},"text-color":"hsl(0, 0%, 100%)","text-halo-color":"hsl(22, 38%, 45%)","text-halo-width":2,"text-halo-blur":2,"text-opacity":{base:1,stops:[[15,0],[15.5,1],[16.25,1],[16.5,0]]}},"source-layer":"geojson"},{id:"Transit overlay text",metadata:{"source-type":"steerpath_floor_tiles"},type:"symbol",source:"custom",minzoom:15,maxzoom:17,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.infra.wing"],["==",["get","title"],"Transit"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","icon-offset":[0,-104],"icon-size":1,"text-field":"Transit","text-font":["Lato Regular"],"text-size":25,"text-allow-overlap":!0},paint:{"icon-opacity":{base:1,stops:[[13,1],[13.5,0]]},"text-color":"hsl(0, 0%, 100%)","text-halo-color":"hsl(254, 56%, 46%)","text-halo-width":2,"text-halo-blur":2,"text-opacity":{base:1,stops:[[15,0],[15.5,1],[16.25,1],[16.5,0]]}},"source-layer":"geojson"},{id:"Skytrain line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.transport.skytrain"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"none"},paint:{"line-color":"hsl(13, 97%, 67%)","line-width":3},"source-layer":"geojson"},{id:"Skytrain icon",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.transport.skytrain"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,15]]},"icon-offset":[0,0],"icon-image":"{dimension_what}","text-font":["Lato Regular"],visibility:"visible","text-offset":[0,1],"icon-size":.4,"text-anchor":"top","text-field":"{title}","text-letter-spacing":0,"icon-padding":2,"text-max-width":10},paint:{"icon-opacity":{base:1,stops:[[15,0],[15.5,1]]},"text-color":"hsl(0, 0%, 100%)","text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-color":"#ec7033","text-halo-width":2,"text-halo-blur":0,"text-translate":[0,0]},"source-layer":"geojson"},{id:"Building overlay",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",maxzoom:16,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"fill-color":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel.l1","#008FBA"],["where.changi.terminals.t1.l1","#1a72B6"],["where.changi.terminals.t2.l1","#ee3424"],["where.changi.terminals.t3.l1","#008880"],["where.changi.terminals.t4.l1","#6f2770"]],default:"#1a72B6"},"fill-opacity":{base:1,stops:[[15,.99],[15.5,0]]},"fill-antialias":!1},"source-layer":"geojson"},{id:"Building overlay outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",maxzoom:15.5,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],paint:{"line-color":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel.l1","#008FBA"],["where.changi.terminals.t1.l1","#1a72B6"],["where.changi.terminals.t2.l1","#ee3424"],["where.changi.terminals.t3.l1","#008880"],["where.changi.terminals.t4.l1","#6f2770"]],default:"#1a72B6"},"line-opacity":1,"line-width":2},"source-layer":"geojson"},{id:"Building icon",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:1,maxzoom:17,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel.l1","where.changi.terminals.t1.l1","where.changi.terminals.t2.l1","where.changi.terminals.t3.l1","where.changi.terminals.t4.l1"]]]],layout:{visibility:"visible","icon-size":{base:1,stops:[[13,.21],[14,.3],[15,.6],[16,1]]},"text-font":["Lato Regular"],"text-size":50,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"icon-image":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel.l1","building_Jewel"],["where.changi.terminals.t1.l1","building_T1"],["where.changi.terminals.t2.l1","building_T2"],["where.changi.terminals.t3.l1","building_T3"],["where.changi.terminals.t4.l1","building_T4"]],default:"building_T1"},"icon-offset":[0,0]},paint:{"text-color":"hsl(0, 0%, 100%)","text-halo-color":"rgba(0,136,128,1)","text-halo-width":2,"text-opacity":{base:1,stops:[[15.5,1],[15.6,0]]},"icon-opacity":{base:1,stops:[[15,1],[15.5,0]]}},"source-layer":"geojson"}],Hs=[{id:"Smoke Zone Polygon",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom","source-layer":"geojson",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.fire_safety.smoke_zone"]]]],paint:{"fill-color":"#7595ff","fill-opacity":.1}},{id:"Fire Zone Polygon",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom","source-layer":"geojson",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.fire_safety.fire_zone"]]]],paint:{"fill-color":"#ff75df","fill-opacity":.1}},{id:"Smoke Zone Outline",type:"line",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom","source-layer":"geojson",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.fire_safety.smoke_zone"]]]],paint:{"line-color":"#1376bd","line-width":2,"line-dasharray":[4,2]}},{id:"Fire Zone Outline",type:"line",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom","source-layer":"geojson",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.fire_safety.fire_zone"]]]],paint:{"line-color":"#ff75df","line-width":2,"line-dasharray":[4,2]}},{id:"Fire Safety Icons",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom","source-layer":"geojson",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.fire_safety.smoke_detector.general","what.fire_safety.smoke_detector.esc","what.fire_safety.beam_detector","what.fire_safety.flame_detector","what.fire_safety.manual_call_point","what.fire_safety.flow_switch"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,8],[20,14]]},"icon-image":"{dimension_what}","text-font":["Lato Regular"],"text-padding":1,"icon-size":{base:1,stops:[[17,.3],[21,1]]},"text-field":"{title}","text-letter-spacing":0,"text-max-width":5,"text-anchor":"top","text-offset":[0,.6],"icon-allow-overlap":["step",["zoom"],!1,20,!0],"text-allow-overlap":["step",["zoom"],!1,20,!0]},paint:{"text-color":"#ffffff","text-halo-color":"#ff75df","text-halo-blur":0,"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-width":2,"icon-opacity":{base:1,stops:[[17,0],[17.5,1]]}}},{id:"Smoke Zone Title",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom","source-layer":"geojson",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.fire_safety.smoke_zone"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,14],[20,24]]},"text-font":["Lato Regular"],"text-padding":1,"text-field":"{title}","text-letter-spacing":0,"text-max-width":5,"text-allow-overlap":!0},paint:{"text-color":"#ffffff","text-halo-color":"#1376bd","text-halo-blur":0,"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-width":2}},{id:"FA Zone Title",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom","source-layer":"geojson",minzoom:17,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.fire_safety.fire_zone"]]]],layout:{"text-line-height":1,"text-size":{base:1,stops:[[16,14],[20,24]]},"text-font":["Lato Regular"],"text-padding":1,"text-field":"{title}","text-letter-spacing":0,"text-max-width":5,"text-allow-overlap":!0},paint:{"text-color":"#ffffff","text-halo-color":"#ff75df","text-halo-blur":0,"text-opacity":{base:1,stops:[[17,0],[17.5,1]]},"text-halo-width":2}}],Gs=[{id:"airside turf fill",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["in",["get","dimension_what"],["literal",["what.airside.turf"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.airside.turf","#c5e0ca"]],default:"#c5e0ca"},"fill-opacity":1}},{id:"airside building fill",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["in",["get","dimension_what"],["literal",["what.airside.building"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.airside.building","#969ba3"]],default:"#969ba3"},"fill-opacity":1}},{id:"airside line base",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["in",["get","dimension_what"],["literal",["what.airside.taxiway","what.airside.lead_in_line","what.airside.push_back_line"]]],["==",["get","dimension_where"],"where.changi.airside"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#AAAAAA","line-opacity":1,"line-width":{base:1.4,stops:[[5.8,0],[6,3],[20,40]]}}},{id:"airside roadway edge",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["in",["geometry-type"],["literal",["LineString","Polygon"]]],["in",["get","dimension_what"],["literal",["what.airside.roadway_edge"]]],["==",["get","dimension_where"],"where.changi.airside"],["!=",["get","title"],"landside roadway"],["!=",["get","title"],"external layout"]],paint:{"line-color":"#8c98ab","line-opacity":1,"line-width":1},layout:{visibility:"visible"}},{id:"airside markings fill",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.airside.markings.epa","what.airside.markings.era","what.airside.markings.esa","what.airside.markings.plb"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.airside.markings.epa","blue"],["what.airside.markings.era","red"],["what.airside.markings.esa","green"],["what.airside.markings.plb","magenta"]],default:"black"},"fill-opacity":.1}},{id:"airside construction fill",type:"fill",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:14,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.airside.construction"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.airside.construction","#c9c9c9"]],default:"black"},"fill-opacity":.4}},{id:"airside kcz abl line",type:"line",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["in",["get","dimension_what"],["literal",["what.airside.markings.kcz","what.airside.markings.abl"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.airside.markings.kcz","white"],["what.airside.markings.abl","#f29b9b"]],default:"black"},"line-width":1}},{id:"airside markings line",type:"line",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["in",["get","dimension_what"],["literal",["what.airside.markings.epa","what.airside.markings.era","what.airside.markings.esa","what.airside.markings.plb"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.airside.markings.kcz","white"],["what.airside.markings.abl","#f29b9b"],["what.airside.markings.epa","#7dbaf0"],["what.airside.markings.era","#ff6b6b"],["what.airside.markings.esa","#8ed191"],["what.airside.markings.plb","#c893e6"]],default:"black"},"line-width":1}},{id:"airside construction line",type:"line",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:14,maxzoom:24,filter:["all",["in",["get","dimension_what"],["literal",["what.airside.construction"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{base:1,type:"categorical",property:"dimension_what",stops:[["what.airside.construction","black"]],default:"black"},"line-width":1}},{id:"taxiway line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.taxiway"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":"#fcd5a2","line-opacity":1,"line-width":1.5}},{id:"taxiway name",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.taxiway"],["==",["get","dimension_where"],"where.changi.airside"],["!=",["get","title"],"unknown"]],layout:{"symbol-placement":"line","symbol-spacing":150,"text-field":"{title}","text-font":["Lato Regular"],"text-max-angle":30,"text-pitch-alignment":"viewport","text-rotation-alignment":"map","text-size":9,"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":"#ffffff","text-halo-blur":1,"text-halo-color":"#807f7e","text-halo-width":2,"text-translate":[0,0]}},{id:"pushback line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.push_back_line"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":"white","line-opacity":1,"line-width":1.5,"line-dasharray":[2,2]}},{id:"pushback fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.airside.push_back_line"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":"white","fill-opacity":1}},{id:"leadin line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.lead_in_line"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":"#f0d748","line-opacity":1,"line-width":1.5}},{id:"leadin fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.airside.lead_in_line"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":"#f0d748","fill-opacity":1}},{id:"acft type marking line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.markings.acft_type"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":"#e0d569","line-opacity":1,"line-width":1}},{id:"acft type marking names",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:13,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.airside.markings.acft_type"]]],["==",["get","dimension_where"],"where.changi.airside"]],layout:{visibility:"visible","text-field":"{text}","text-max-width":25,"text-font":["Lato Regular"],"text-padding":0,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-size":["interpolate",["exponential",2],["zoom"],13,["*",["get","height"],.1],15,["*",["get","height"],.5],17,["*",["get","height"],2],19,["*",["get","height"],5],22,["*",["get","height"],45]],"text-anchor":{type:"identity",property:"attachPt"},"text-justify":["match",["get","testJustify"],"left","left","right","right","center","center","auto"],"text-rotation-alignment":"map","text-rotate":["get","rotation"]},paint:{"text-color":"black"}},{id:"Compass Swing line dashed",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["in",["geometry-type"],["literal",["LineString","Polygon"]]],["in",["get","dimension_what"],["literal",["what.airside.markings.compass_swing"]]],["==",["get","dimension_where"],"where.changi.airside"],["==",["get","dxfDashed"],!0]],paint:{"line-color":"white","line-opacity":1,"line-width":2,"line-dasharray":[2,2]}},{id:"Compass Swing line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["in",["geometry-type"],["literal",["LineString","Polygon"]]],["in",["get","dimension_what"],["literal",["what.airside.markings.compass_swing"]]],["==",["get","dimension_where"],"where.changi.airside"],["!=",["get","dxfDashed"],!0]],paint:{"line-color":"white","line-opacity":1,"line-width":2}},{id:"EOT EOP line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["in",["geometry-type"],["literal",["LineString","Polygon"]]],["in",["get","dimension_what"],["literal",["what.airside.markings.eot","what.airside.markings.eop"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":"white","line-opacity":1,"line-width":2}},{id:"EOT TOP Compass Swing names",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:13,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.airside.markings.eot","what.airside.markings.eop","what.airside.markings.compass_swing"]]],["==",["get","dimension_where"],"where.changi.airside"]],layout:{visibility:"visible","text-field":"{text}","text-max-width":25,"text-font":["Lato Regular"],"text-padding":0,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-size":["interpolate",["exponential",2],["zoom"],13,["*",["get","height"],.1],15,["*",["get","height"],.5],17,["*",["get","height"],2],19,["*",["get","height"],5],22,["*",["get","height"],45]],"text-anchor":{type:"identity",property:"attachPt"},"text-justify":["match",["get","testJustify"],"left","left","right","right","center","center","auto"],"text-rotation-alignment":"map","text-rotate":["get","rotation"]},paint:{"text-halo-color":"hsl(194, 0%, 60%)","text-color":"white","text-halo-width":1}},{id:"stand marking fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:16.5,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.airside.markings.stand"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{type:"identity",property:"dxfColour"},"fill-opacity":.7},layout:{"fill-sort-key":["coalesce",["-",1,["get","dxfArea"]],1]}},{id:"stand marking names",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:13,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.airside.markings.stand"]]],["==",["get","dimension_where"],"where.changi.airside"]],layout:{visibility:"visible","text-field":"{text}","text-max-width":25,"text-font":["Lato Regular"],"text-padding":0,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-size":["interpolate",["exponential",2],["zoom"],13,["*",["get","height"],.1],15,["*",["get","height"],.5],17,["*",["get","height"],2],19,["*",["get","height"],5],22,["*",["get","height"],45]],"text-anchor":{type:"identity",property:"attachPt"},"text-justify":["match",["get","testJustify"],"left","left","right","right","center","center","auto"],"text-rotation-alignment":"map","text-rotate":["-",["get","rotation"],-45]},paint:{"text-color":{type:"identity",property:"dxfColour"}}},{id:"mws marking fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:16.5,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.airside.markings.mws"]]],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{type:"identity",property:"dxfColour"},"fill-opacity":.7},layout:{"fill-sort-key":["coalesce",["-",1,["get","dxfArea"]],1]}},{id:"taxiway holding psn line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.taxiway.holding_psn"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{type:"identity",property:"dxfColour"},"line-opacity":1,"line-width":2.5,"line-dasharray":[4,2]}},{id:"runway holding psn line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.runway.holding_psn"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":"#e0d569","line-opacity":1,"line-width":2.5}},{id:"runway fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.airside.runway"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{type:"identity",property:"dxfColour"},"fill-opacity":.8},layout:{"fill-sort-key":["case",["==",["get","dxfColour"],"#ffffff"],2,["==",["get","dxfColour"],"#999999"],1,0]}},{id:"runway displ threshold fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.airside.runway.displ_threshold"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{type:"identity",property:"dxfColour"},"fill-opacity":.8},layout:{"fill-sort-key":["case",["==",["get","dxfColour"],"#ffffff"],2,["==",["get","dxfColour"],"#999999"],1,0]}},{id:"runway stopway fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.airside.runway.stopway"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":{type:"identity",property:"dxfColour"},"fill-opacity":.8}},{id:"runway stopway line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.runway.stopway"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{type:"identity",property:"dxfColour"},"line-opacity":.8}},{id:"runway clearway outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["get","dimension_what"],"what.airside.runway.clearway"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{type:"identity",property:"dxfColour"},"line-width":1.5,"line-opacity":.8}},{id:"runway strip outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["get","dimension_what"],"what.airside.runway.strip"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{type:"identity",property:"dxfColour"},"line-width":1.5,"line-dasharray":[8,4],"line-opacity":.8}},{id:"runway resa outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.airside.runway.resa"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{type:"identity",property:"dxfColour"},"line-width":1.5,"line-dasharray":[3,3],"line-opacity":1}},{id:"runway resa line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.runway.resa"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":{type:"identity",property:"dxfColour"},"line-width":1.5,"line-opacity":1}},{id:"airside building name",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.airside.building"],["==",["get","dimension_where"],"where.changi.airside"]],layout:{"text-field":"{title}","text-font":["Lato Regular"],"text-size":10,visibility:"visible"},paint:{"text-color":"#807f7e","text-halo-blur":1,"text-halo-color":"#ffffff","text-halo-width":1,"text-translate":[0,0]}},{id:"fence jet blast fill",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.airside.fence.jet_blast"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"fill-color":"#42566e","fill-opacity":.8}},{id:"fence jet blast name",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.airside.fence.jet_blast"],["==",["get","dimension_where"],"where.changi.airside"]],layout:{"text-field":"Jet Blast Fence","text-font":["Lato Regular"],"text-size":10,visibility:"visible"},paint:{"text-color":"#807f7e","text-halo-blur":1,"text-halo-color":"#ffffff","text-halo-width":1,"text-translate":[0,0]}},{id:"fence perimeter line",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","dimension_what"],"what.airside.fence.perimeter"],["==",["get","dimension_where"],"where.changi.airside"]],paint:{"line-color":"#f04f43","line-opacity":1,"line-width":1.5,"line-dasharray":[3,3]}},{id:"apron stand name",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.airside.apron.stand"],["==",["get","dimension_where"],"where.changi.airside"],["!=",["get","title"],"Unknown"]],layout:{"text-field":"{title}","text-font":["Lato Regular"],"text-size":12,"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":"#807f7e","text-halo-blur":1,"text-halo-color":"#ffffff","text-halo-width":1,"text-translate":[0,0]}},{id:"runway name",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.airside.runway"],["==",["get","dimension_where"],"where.changi.airside"],["!=",["get","title"],"Unknown"]],layout:{"text-field":"{title}","text-font":["Lato Regular"],"text-size":16,"text-transform":"uppercase",visibility:"visible"},paint:{"text-color":"#807f7e","text-halo-blur":1,"text-halo-color":"#ffffff","text-halo-width":1,"text-translate":[0,0]}},{id:"Airside Construction Name",type:"symbol",metadata:{fallback:"true","source-type":"steerpath_floor_tiles"},source:"custom",minzoom:13,maxzoom:24,filter:["all",["==",["geometry-type"],"Point"],["in",["get","dimension_what"],["literal",["what.airside.construction"]]],["==",["get","dimension_where"],"where.changi.airside"]],layout:{visibility:"visible","text-field":"{text}","text-max-width":25,"text-font":["Lato Regular"],"text-padding":0,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-size":["interpolate",["exponential",2],["zoom"],13,["*",["get","height"],.1],15,["*",["get","height"],.5],17,["*",["get","height"],2],19,["*",["get","height"],5],22,["*",["get","height"],45]],"text-anchor":{type:"identity",property:"attachPt"},"text-justify":["match",["get","testJustify"],"left","left","right","right","center","center","auto"],"text-rotation-alignment":"map","text-rotate":["%",["-",360,["+",["get","rotation"],0]],360]},paint:{"text-halo-color":"hsl(194, 0%, 60%)","text-color":{type:"identity",property:"dxfColour"},"text-halo-width":1}},{id:"Aerobridge",type:"fill",metadata:{"source-type":"steerpath_base_tiles"},source:"custom",minzoom:15,maxzoom:24,filter:["all",["==",["geometry-type"],"Polygon"],["in",["get","dimension_what"],["literal",["what.infra.aerobridge","what.infra.tunnel"]]]],paint:{"fill-color":"hsl(0, 0%, 68%)","fill-opacity":{base:1,stops:[[15,0],[15.5,.99]]},"fill-antialias":!1}},{id:"Building overlay base",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel","where.changi.terminals.t1","where.changi.terminals.t2","where.changi.terminals.t3","where.changi.terminals.t4"]]]],paint:{"fill-color":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel","#97b5bc"],["where.changi.terminals.t1","#92a7b8"],["where.changi.terminals.t2","#d59d99"],["where.changi.terminals.t3","#8ab8b5"],["where.changi.terminals.t4","#a891aa"]],default:"#1a72B6"},"fill-opacity":.9,"fill-antialias":!1}},{id:"Building underlay icon",type:"symbol",metadata:{"source-type":"steerpath_base_tiles"},source:"custom",minzoom:1,maxzoom:17,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel","where.changi.terminals.t1","where.changi.terminals.t2","where.changi.terminals.t3","where.changi.terminals.t4"]]]],layout:{visibility:"visible","icon-size":{base:1,stops:[[13,.21],[14,.3],[15,.6],[16,1]]},"text-font":["Lato Regular"],"text-size":50,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"icon-image":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel","building_Jewel"],["where.changi.terminals.t1","building_T1"],["where.changi.terminals.t2","building_T2"],["where.changi.terminals.t3","building_T3"],["where.changi.terminals.t4","building_T4"]],default:"building_T1"},"icon-offset":[0,0]},paint:{"text-color":"hsl(0, 0%, 100%)","text-halo-color":"rgba(0,136,128,1)","text-halo-width":2,"text-opacity":1,"icon-opacity":1}},{id:"Building overlay",type:"fill",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",maxzoom:16,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel","where.changi.terminals.t1","where.changi.terminals.t2","where.changi.terminals.t3","where.changi.terminals.t4"]]]],paint:{"fill-color":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel","#008FBA"],["where.changi.terminals.t1","#1a72B6"],["where.changi.terminals.t2","#ee3424"],["where.changi.terminals.t3","#008880"],["where.changi.terminals.t4","#6f2770"]],default:"#1a72B6"},"fill-opacity":{base:1,stops:[[15,.99],[15.5,0]]},"fill-antialias":!1}},{id:"Building overlay outline",type:"line",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",maxzoom:15.5,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel","where.changi.terminals.t1","where.changi.terminals.t2","where.changi.terminals.t3","where.changi.terminals.t4"]]]],paint:{"line-color":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel","#008FBA"],["where.changi.terminals.t1","#1a72B6"],["where.changi.terminals.t2","#ee3424"],["where.changi.terminals.t3","#008880"],["where.changi.terminals.t4","#6f2770"]],default:"#1a72B6"},"line-opacity":1,"line-width":2}},{id:"Building icon",type:"symbol",metadata:{"source-type":"steerpath_floor_tiles"},source:"custom",minzoom:1,maxzoom:17,filter:["all",["==",["geometry-type"],"Point"],["==",["get","dimension_what"],"what.building"],["in",["get","dimension_where"],["literal",["where.changi.terminals.jewel","where.changi.terminals.t1","where.changi.terminals.t2","where.changi.terminals.t3","where.changi.terminals.t4"]]]],layout:{visibility:"visible","icon-size":{base:1,stops:[[13,.21],[14,.3],[15,.6],[16,1]]},"text-font":["Lato Regular"],"text-size":50,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"icon-image":{base:1,type:"categorical",property:"dimension_where",stops:[["where.changi.terminals.jewel","building_Jewel"],["where.changi.terminals.t1","building_T1"],["where.changi.terminals.t2","building_T2"],["where.changi.terminals.t3","building_T3"],["where.changi.terminals.t4","building_T4"]],default:"building_T1"},"icon-offset":[0,0]},paint:{"text-color":"hsl(0, 0%, 100%)","text-halo-color":"rgba(0,136,128,1)","text-halo-width":2,"text-opacity":{base:1,stops:[[15.5,1],[15.6,0]]},"icon-opacity":{base:1,stops:[[15,1],[15.5,0]]}}}];function Ws(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");var r=ia(e),i=aa(t),o=i.type,a=t.bbox,s=i.coordinates;if(a&&!1===function(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}(r,a))return!1;"Polygon"===o&&(s=[s]);for(var l=!1,u=0;u<s.length&&!l;u++)if(Vs(r,s[u][0],n.ignoreBoundary)){for(var c=!1,h=1;h<s[u].length&&!c;)Vs(r,s[u][h],!n.ignoreBoundary)&&(c=!0),h++;c||(l=!0)}return l}function Vs(e,t,n){var r=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var i=0,o=t.length-1;i<t.length;o=i++){var a=t[i][0],s=t[i][1],l=t[o][0],u=t[o][1];if(e[1]*(a-l)+s*(l-e[0])+u*(e[0]-a)===0&&(a-e[0])*(l-e[0])<=0&&(s-e[1])*(u-e[1])<=0)return!n;s>e[1]!=u>e[1]&&e[0]<(l-a)*(e[1]-s)/(u-s)+a&&(r=!r)}return r}function qs(){var e=this;return{enableGPS:function(){return I(e,void 0,void 0,function(){return z(this,function(e){return[2,{success:!0}]})})},disableGPS:function(){},destroyGPS:function(){},requestGPSPermission:function(){return I(e,void 0,void 0,function(){return z(this,function(e){return[2,{granted:!1,denied:!1,prompt:!0,state:"prompt"}]})})},isGPSPermissionGranted:function(){return I(e,void 0,void 0,function(){return z(this,function(e){return[2,!1]})})},getGPSPosition:function(){return I(e,void 0,void 0,function(){return z(this,function(e){return[2,{coordinates:[0,0],accuracy:0,timestamp:0}]})})},isGPSEnabled:function(){return!1}}}function Zs(){var e=this;return{enableCompass:function(){return I(e,void 0,void 0,function(){return z(this,function(e){return[2,!1]})})},disableCompass:function(){},addCallback:function(){},removeCallback:function(){},isCompassEnabled:function(){return!1},isCompassPermissionDenied:function(){return!1},getCompassHeading:function(){return null}}}function Ys(){var e=this;return{start:function(){},stop:function(){},requestPermission:function(){return I(e,void 0,void 0,function(){return z(this,function(e){return[2,!1]})})}}}const $s=e=>{let t;const n=new Set,r=(e,r)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,o={setState:r,getState:i,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},a=t=e(r,i,o);return o},Ks=e=>e?$s(e):$s;var Xs={ready:!0,missing:[]};function Js(e){return{ready:0===e.length,missing:B([],e,!0)}}var Qs=function(e){function t(t,n){var r=this,i=B([],t,!0);return(r=e.call(this,null!=n?n:"Not ready: missing ".concat(i.join(", ")))||this).name="NotReadyError",r.missing=i,r}return O(t,e),t}(Error),el={ready:!1,missing:[]},tl={ready:!1,missing:[],modules:{mapDataService:el,focusManager:el,cameraDirector:el,userLocation:el,routingManager:el,navigationEngine:el}},nl=["mapDataService","focusManager","cameraDirector","userLocation","routingManager","navigationEngine"];function rl(){var e=new il;return e.notifyMapLoaded(),e}var il=function(){function e(){this.camera={moveTo:function(){},getZoom:function(){return 0},fitBounds:function(){}},this.cameraAttached=!1,this.followBreaker={breakFollow:function(){}},this.mapLoaded=!1,this.pending=null}return e.prototype.attachCamera=function(e){this.camera=e,this.cameraAttached=!0,this.flushIfReady()},e.prototype.detachCamera=function(){this.camera={moveTo:function(){},getZoom:function(){return 0},fitBounds:function(){}},this.cameraAttached=!1,this.mapLoaded=!1},e.prototype.attachFollowBreaker=function(e){this.followBreaker=e},e.prototype.detachFollowBreaker=function(){this.followBreaker={breakFollow:function(){}}},e.prototype.notifyMapLoaded=function(){this.mapLoaded=!0,this.flushIfReady()},e.prototype.submit=function(e,t){this.canWrite()?this.write(e,t):this.pending={stop:e,reason:t}},e.prototype.getZoom=function(){return this.camera.getZoom()},e.prototype.getReadiness=function(){return this.cameraAttached?Xs:Js(["camera"])},e.prototype.canWrite=function(){return this.mapLoaded&&this.cameraAttached},e.prototype.flushIfReady=function(){if(this.canWrite()&&this.pending){var e=this.pending;this.pending=null,this.write(e.stop,e.reason)}},e.prototype.write=function(e,t){"focus"===t&&this.followBreaker.breakFollow(),this.camera.moveTo(e)},e}();function ol(e){if(!e||!Array.isArray(e))return null;try{var t=e,n=t[0];if(!n)return null;var r=void 0;if(Array.isArray(n)){var i=n[0];if(2===t.length&&Array.isArray(i)&&"number"==typeof i[0]){var o=n,a=t[1];r=[[[o[0],o[1]],[a[0],o[1]],[a[0],a[1]],[o[0],a[1]],[o[0],o[1]]]]}else if("number"==typeof i&&n.length>=2){var s=t;if(!function(e){if(!e||e.length<3)return!1;for(var t=0,n=e;t<n.length;t++){var r=n[t];if(!Array.isArray(r)||"number"!=typeof r[0]||"number"!=typeof r[1])return!1}return!0}(s))return null;r=[s]}else{if(!Array.isArray(i)||"number"!=typeof i[0])return null;r=t}}else{if(!("number"==typeof n&&t.length>=4))return null;r=[[[t[0],t[1]],[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],[t[0],t[1]]]]}return function(e,t,n){void 0===n&&(n={});for(var r=0,i=e;r<i.length;r++){var o=i[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw new Error("First and last Position are not equivalent.")}return me({type:"Polygon",coordinates:e},t,n)}(r)}catch(e){return null}}var al,sl=function(){function e(){this.defaultFocusedTaxonomy="",this.currentFocus="",this.stylePort={readLayers:function(){return[]},commitLayers:function(){}},this.styleAttached=!1,this.cameraDirector=rl(),this.focusChangeListeners=new Set}return e.prototype.attachStyle=function(e){this.stylePort=e,this.styleAttached=!0},e.prototype.detachStyle=function(){this.stylePort={readLayers:function(){return[]},commitLayers:function(){}},this.styleAttached=!1},e.prototype.attachCameraDirector=function(e){this.cameraDirector=e},e.prototype.detachCameraDirector=function(){this.cameraDirector=rl()},e.prototype.subscribeToFocusChange=function(e){var t=this;return this.focusChangeListeners.add(e),function(){t.focusChangeListeners.delete(e)}},e.prototype.getReadiness=function(){return this.styleAttached?Xs:Js(["style"])},e.prototype.commit=function(e,t){if(void 0===t&&(t={}),e){var n=!0===t.moveCamera;this.currentFocus=e;var r=this.stylePort.readLayers();if(Array.isArray(r)&&r.length>0){var i=function(e,t){if(t){var n=Ts(t);if(e.length>0)for(var r=0;r<e.length;r+=1){var i=e[r].id;Cs.includes(i)||ks(e[r],n)}return e}}(r,e);i&&this.stylePort.commitLayers(i)}if(n){var o=this.getFlyToLocation(e,!0);(null==o?void 0:o.center)&&this.cameraDirector.submit({center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch,durationMs:1200,easing:"ease"},"focus")}this.focusChangeListeners.forEach(function(t){try{t(e)}catch(e){}})}},e.prototype.getDefaultFocusedTaxonomy=function(){return this.defaultFocusedTaxonomy},e.prototype.setDefaultFocusedTaxonomy=function(e){this.defaultFocusedTaxonomy=e},e.prototype.getCurrentFocus=function(){return this.currentFocus},e.prototype.setCurrentFocus=function(e){this.currentFocus=e},e.prototype.getCurrentFocusBuilding=function(){var e=_s(this.currentFocus);return e?ys(e)?Ss(this.currentFocus):e:null},e.prototype.getCurrentFocusFloor=function(){var e=_s(this.currentFocus);return e&&ys(e)?e:null},e.prototype.getUserViewportBuilding=function(e){var t,n=ve(e),r=null;return t=function(e){if(!r&&!ys(e)&&e.bounds){var t=ol(e.bounds);t&&Ws(n,t)&&(r=e)}},ws(ms(),t),r},e.prototype.checkUserViewport=function(e,t,n){var r=ve(e);if(null==t)return!1;if(!Object.prototype.hasOwnProperty.call(t,"bounds"))return!1;var i=ol(t.bounds),o=!!i&&Ws(r,i);if(null==n)return o;if(!Object.prototype.hasOwnProperty.call(n,"bounds"))return o;var a=ol(n.bounds),s=!!a&&Ws(r,a);return o||s},e.prototype.changeToUserViewpoint=function(e,t){if(void 0===t&&(t={}),!this.checkUserViewport(e,this.getCurrentFocusBuilding(),this.getCurrentFocusFloor())){var n=this.getUserViewportBuilding(e);if(n){var r=null!=t?t:{};n.taxonomyPath&&n.taxonomyPath in r?this.commit(r[n.taxonomyPath],{moveCamera:!1}):n.name&&n.name in r?this.commit(r[n.name],{moveCamera:!1}):n.defaultFloorPath&&this.commit(n.defaultFloorPath,{moveCamera:!1})}}},e.prototype.getFlyToLocation=function(e,t){void 0===t&&(t=!0);var n="[getFlyToLocation]",r="Please review the where taxonomy camera configuration in Spatialverse Configurator → Map Config → Taxonomies page.",i=function(e){if(!(null==e?void 0:e.cameraConfigs))return null;var n=t?e.cameraConfigs.mobile||e.cameraConfigs.web:e.cameraConfigs.web||e.cameraConfigs.mobile;return!(null==n?void 0:n.center)||!Array.isArray(n.center)||n.center.length<2?null:n},o=_s(e);if(!o)return console.error(n,'Where taxonomy "'.concat(e,'" was not found in the focus tree. ').concat(r),{whereTaxonomyPath:e}),null;var a,s,l=i(o);if(l)return l;a=e,s=o,console.warn(n,'Camera config for where taxonomy "'.concat(a,'" was not found. ').concat(r),{whereTaxonomyPath:a,node:s?{name:s.name,taxonomyPath:s.taxonomyPath,cameraConfigs:s.cameraConfigs}:void 0,isMobile:t});for(var u=xs(e),c=u.length-1;c>=0;c-=1){var h=i(u[c]);if(h)return h}if(!ys(o))for(var d=0,p=vs(o);d<p.length;d++){var f=i(p[d]);if(f)return f}return console.error(n,'Camera config not found for where taxonomy "'.concat(e,'" and no ancestor or child fallback was available. ').concat(r),{whereTaxonomyPath:e,matchedNode:{name:o.name,taxonomyPath:o.taxonomyPath},ancestorsChecked:u.map(function(e){return e.taxonomyPath})}),null},e.prototype.getFloorAltitudeRangesForBuilding=function(e){var t=_s(e);if(!t)return[];for(var n=[],r=0,i=vs(t);r<i.length;r++){var o=i[r];if(ys(o)&&o.taxonomyPath){var a=o.altMin,s=o.altMax;"number"!=typeof a||"number"!=typeof s||Number.isNaN(a)||Number.isNaN(s)||n.push({whereDimension:o.taxonomyPath,minAltitude:a,maxAltitude:s})}}return n.sort(function(e,t){return e.minAltitude-t.minAltitude})},e.prototype.isLngLatInsideBuildingFocusBounds=function(e,t){var n=function(e){var t=_s(e);if(!t)return null;var n=ol(t.bounds);if(n)return n;var r=Ss(e);return ol(null==r?void 0:r.bounds)}(t);if(!n)return!1;try{return Ws(ve(e),n)}catch(e){return!1}},e}();function ll(){return al||(al=new sl),al}var ul=function(){function e(e){var t,n;void 0===e&&(e={}),this.floorRanges=[],this.getFloorRangesFromFocusTree=null,this.currentAltitude=null,this.currentFloor=null,this.onFloorChangeCallbacks=new Set,this.floorRanges=null!==(t=e.floorRanges)&&void 0!==t?t:[],this.getFloorRangesFromFocusTree=null!==(n=e.getFloorRangesFromFocusTree)&&void 0!==n?n:null}return e.prototype.setFloorRanges=function(e){this.floorRanges=B([],e,!0).sort(function(e,t){return e.minAltitude-t.minAltitude})},e.prototype.setGetFloorRangesFromFocusTree=function(e){this.getFloorRangesFromFocusTree=e},e.prototype.updateAltitude=function(e){var t,n=e.altitude;if(!(null==n||isNaN(n)||n<0)){this.currentAltitude=n;var r=null!==(t=this.getFloorRanges())&&void 0!==t?t:this.floorRanges,i=this.altitudeToFloor(n,r);if(i&&i!==this.currentFloor){var o=this.currentFloor;this.currentFloor=i,this.onFloorChangeCallbacks.forEach(function(e){try{e(o,i)}catch(e){}})}else i&&(this.currentFloor=i)}},e.prototype.getCurrentFloor=function(){return this.currentFloor},e.prototype.getCurrentAltitude=function(){return this.currentAltitude},e.prototype.onFloorChange=function(e){var t=this;return this.onFloorChangeCallbacks.add(e),function(){return t.onFloorChangeCallbacks.delete(e)}},e.prototype.altitudeToFloor=function(e,t){for(var n=0,r=t;n<r.length;n++){var i=r[n];if(e>=i.minAltitude&&e<=i.maxAltitude)return i.whereDimension}return null},e.prototype.getFloorRanges=function(){if(this.getFloorRangesFromFocusTree)try{return this.getFloorRangesFromFocusTree()}catch(e){return null}return null},e.prototype.reset=function(){this.currentAltitude=null,this.currentFloor=null},e.prototype.destroy=function(){this.reset(),this.onFloorChangeCallbacks.clear(),this.getFloorRangesFromFocusTree=null,this.floorRanges=[]},e}(),cl=function(){function e(e,t,n){var r,i,o;void 0===n&&(n={}),this.proposalListeners=new Set,this.acceptedListeners=new Set,this.autoRejectedListeners=new Set,this.lastProposalTime=0,this.whereProposalSentAtMs=new Map,this.isActive=!1,this.gpsCallbackRef=null,this.pendingProposalId=null,this.pendingWhereTaxonomyPath=null,this.isAwaitingDecision=!1,this.lastAcceptedTaxonomyPath=null,this.gpsController=e,this.altitudeManager=t,this.proposalCooldownMs=null!==(r=n.proposalCooldownMs)&&void 0!==r?r:2e3,this.autoAcceptCooldownMs=null!==(i=n.autoAcceptCooldownMs)&&void 0!==i?i:2e4,this.portalAutoAcceptCooldownMs=null!==(o=n.portalAutoAcceptCooldownMs)&&void 0!==o?o:2e4,this.portalLiftAutoAcceptCooldownMs=n.portalLiftAutoAcceptCooldownMs}return e.prototype.start=function(){var e=this;this.isActive||(this.gpsCallbackRef=function(t){return e.evaluate(t)},this.gpsController.addCallback({onLocationUpdate:this.gpsCallbackRef}),this.isActive=!0)},e.prototype.stop=function(){this.isActive&&(this.gpsCallbackRef=null,this.clearPending(),this.lastProposalTime=0,this.lastAcceptedTaxonomyPath=null,this.whereProposalSentAtMs.clear(),this.isActive=!1)},e.prototype.resetLastAcceptedPath=function(){this.lastAcceptedTaxonomyPath=null},e.prototype.resetPortalProposalSuppression=function(){for(var e=0,t=B([],this.whereProposalSentAtMs.keys(),!0);e<t.length;e++){var n=t[e];n.startsWith("portal:")&&this.whereProposalSentAtMs.delete(n)}},e.prototype.addWhereTaxonomyUpdateProposedListener=function(e){this.proposalListeners.add(e)},e.prototype.removeWhereTaxonomyUpdateProposedListener=function(e){this.proposalListeners.delete(e)},e.prototype.addWhereTaxonomyUpdateAcceptedListener=function(e){this.acceptedListeners.add(e)},e.prototype.removeWhereTaxonomyUpdateAcceptedListener=function(e){this.acceptedListeners.delete(e)},e.prototype.addWhereTaxonomyUpdateAutoRejectedListener=function(e){this.autoRejectedListeners.add(e)},e.prototype.removeWhereTaxonomyUpdateAutoRejectedListener=function(e){this.autoRejectedListeners.delete(e)},e.prototype.removeAllListeners=function(){this.proposalListeners.clear(),this.acceptedListeners.clear(),this.autoRejectedListeners.clear()},e.prototype.acceptProposal=function(e){this.isAwaitingDecision&&this.pendingProposalId&&e===this.pendingProposalId&&this.pendingWhereTaxonomyPath&&(this.lastAcceptedTaxonomyPath=this.pendingWhereTaxonomyPath,this.lastProposalTime=Date.now(),this.publishAccepted(this.pendingWhereTaxonomyPath),this.clearPending())},e.prototype.setLastAcceptedTaxonomyPath=function(e){this.lastAcceptedTaxonomyPath=e},e.prototype.getLastAcceptedTaxonomyPath=function(){return this.lastAcceptedTaxonomyPath},e.prototype.rejectProposal=function(e){this.isAwaitingDecision&&this.pendingProposalId&&e===this.pendingProposalId&&(this.lastProposalTime=Date.now(),this.clearPending())},e.prototype.manualOverride=function(e,t){this.isAwaitingDecision&&this.pendingProposalId&&e===this.pendingProposalId&&(this.lastAcceptedTaxonomyPath=t,this.lastProposalTime=Date.now(),this.publishAccepted(t),this.clearPending())},e.prototype.notifyManualFloorChange=function(e,t){void 0===t&&(t=!1),this.lastAcceptedTaxonomyPath!==e&&(this.lastAcceptedTaxonomyPath=e,this.publishAccepted(e,t))},e.prototype.proposeFromNavigation=function(t){var n,r;if(this.isAwaitingDecision)return!1;var i=Date.now();if(i-this.lastProposalTime<this.proposalCooldownMs)return!1;var o="portal:".concat(t.portalDedupeKey),a=this.whereProposalSentAtMs.get(o);if("number"==typeof a&&i-a<e.WHERE_PROPOSAL_SUPPRESSION_MS)return!1;var s=ll().getCurrentFocus();if("string"==typeof s&&s===t.whereTaxonomyPath)return!1;if(this.lastAcceptedTaxonomyPath===t.whereTaxonomyPath)return!1;var l={segmentIndex:t.portal.segmentIndex,instructionLine:t.portal.instructionLine,portalName:null!==(n=t.portal.portalName)&&void 0!==n?n:void 0,description:null!==(r=t.portal.description)&&void 0!==r?r:void 0};return this.emitProposalPayload({kind:"portal",whereTaxonomyPath:t.whereTaxonomyPath,portalDedupeKey:t.portalDedupeKey,portal:l},i),!0},e.prototype.evaluate=function(e){},e.prototype.publishAccepted=function(e,t){void 0===t&&(t=!1),this.acceptedListeners.forEach(function(n){try{n(e,t)}catch(e){console.error("AutoFocusManager accepted listener error",e)}})},e.prototype.clearPending=function(){this.isAwaitingDecision=!1,this.pendingProposalId=null,this.pendingWhereTaxonomyPath=null},e.prototype.emitProposal=function(e,t,n){void 0===n&&(n=Date.now()),this.emitProposalPayload({kind:"altitude",whereTaxonomyPath:e},n)},e.prototype.resolvePortalAutoAcceptCooldownMs=function(e){var t,n,r,i,o="".concat(null!==(t=e.instructionLine)&&void 0!==t?t:""," ").concat(null!==(n=e.description)&&void 0!==n?n:""," ").concat(null!==(r=e.portalName)&&void 0!==r?r:"").toLowerCase();return/\blift\b|elevator/.test(o)?null!==(i=this.portalLiftAutoAcceptCooldownMs)&&void 0!==i?i:2*this.portalAutoAcceptCooldownMs:this.portalAutoAcceptCooldownMs},e.prototype.emitProposalPayload=function(e,t){var n="altitude"===e.kind?e.whereTaxonomyPath:"portal:".concat(e.portalDedupeKey);this.whereProposalSentAtMs.set(n,t);var r=this.generateId();this.pendingProposalId=r,this.pendingWhereTaxonomyPath=e.whereTaxonomyPath,this.isAwaitingDecision=!0;var i="altitude"===e.kind?{kind:"altitude",whereTaxonomyPath:e.whereTaxonomyPath,id:r,autoAcceptCooldownMs:this.autoAcceptCooldownMs}:{kind:"portal",whereTaxonomyPath:e.whereTaxonomyPath,id:r,autoAcceptCooldownMs:this.resolvePortalAutoAcceptCooldownMs(e.portal),portal:e.portal};this.proposalListeners.forEach(function(e){try{e(i)}catch(e){console.error("AutoFocusManager proposal listener error.",e)}})},e.prototype.generateId=function(){return"proposal_".concat(Date.now(),"_").concat(Math.random().toString(36).slice(2,10))},e.WHERE_PROPOSAL_SUPPRESSION_MS=6e4,e}(),hl={pendingWhere:"",proposalId:null,proposalKind:null,portalMeta:null,isAwaitingDecision:!1,showTaxonomyUpdatePopup:!1,autoAcceptCooldownMs:0};function dl(e){var t=[1/0,1/0,-1/0,-1/0];return ca(e,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}function pl(e,t,n,r){if(!Me(r=r||{}))throw new Error("options is invalid");var i,o=[];if("Feature"===e.type)i=e.geometry.coordinates;else{if("LineString"!==e.type)throw new Error("input must be a LineString Feature or Geometry");i=e.coordinates}for(var a,s,l,u=i.length,c=0,h=0;h<i.length&&!(t>=c&&h===i.length-1);h++){if(c>t&&0===o.length){if(!(a=t-c))return o.push(i[h]),ye(o);s=la(i[h],i[h-1])-180,l=ua(i[h],a,s,r),o.push(l.geometry.coordinates)}if(c>=n)return(a=n-c)?(s=la(i[h],i[h-1])-180,l=ua(i[h],a,s,r),o.push(l.geometry.coordinates),ye(o)):(o.push(i[h]),ye(o));if(c>=t&&o.push(i[h]),h===i.length-1)return ye(o);c+=sa(i[h],i[h+1],r)}if(c<t&&i.length===u)throw new Error("Start position is beyond line");var d=i[i.length-1];return ye([d,d])}dl.default=dl;for(var fl=function(){function e(){this.localStoarge=new k}return e.prototype.contains=function(e){return this.localStoarge.contains(e)},e.prototype.getString=function(e){return this.localStoarge.getString(e)},e.prototype.set=function(e,t){this.localStoarge.set(e,t)},e.prototype.clearAll=function(){this.localStoarge.clearAll()},e}(),gl={},ml={byteLength:function(e){var t=xl(e),n=t[0],r=t[1];return 3*(n+r)/4-r},toByteArray:function(e){var t,n,r=xl(e),i=r[0],o=r[1],a=new wl(function(e,t,n){return 3*(t+n)/4-n}(0,i,o)),s=0,l=o>0?i-4:i;for(n=0;n<l;n+=4)t=yl[e.charCodeAt(n)]<<18|yl[e.charCodeAt(n+1)]<<12|yl[e.charCodeAt(n+2)]<<6|yl[e.charCodeAt(n+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=yl[e.charCodeAt(n)]<<2|yl[e.charCodeAt(n+1)]>>4,a[s++]=255&t);1===o&&(t=yl[e.charCodeAt(n)]<<10|yl[e.charCodeAt(n+1)]<<4|yl[e.charCodeAt(n+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},fromByteArray:function(e){for(var t,n=e.length,r=n%3,i=[],o=16383,a=0,s=n-r;a<s;a+=o)i.push(Al(e,a,a+o>s?s:a+o));1===r?(t=e[n-1],i.push(vl[t>>2]+vl[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(vl[t>>10]+vl[t>>4&63]+vl[t<<2&63]+"="));return i.join("")}},vl=[],yl=[],wl="undefined"!=typeof Uint8Array?Uint8Array:Array,bl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_l=0;_l<64;++_l)vl[_l]=bl[_l],yl[bl.charCodeAt(_l)]=_l;function xl(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function Sl(e){return vl[e>>18&63]+vl[e>>12&63]+vl[e>>6&63]+vl[63&e]}function Al(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(Sl(r));return i.join("")}yl["-".charCodeAt(0)]=62,yl["_".charCodeAt(0)]=63;var Pl={
2
2
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
3
3
  read:function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<<s)-1,u=l>>1,c=-7,h=n?i-1:0,d=n?-1:1,p=e[t+h];for(h+=d,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+h],h+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+h],h+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=u}return(p?-1:1)*a*Math.pow(2,o-r)},write:function(e,t,n,r,i,o){var a,s,l,u=8*o-i-1,c=(1<<u)-1,h=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(t*l-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=f,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[n+p]=255&a,p+=f,a/=256,u-=8);e[n+p-f]|=128*g}};
4
4
  /*!
@@ -7,7 +7,7 @@ read:function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<<s)-1,u=l>>1,c=-7,h=n?i-1:0,d=n?
7
7
  * @author Feross Aboukhadijeh <https://feross.org>
8
8
  * @license MIT
9
9
  */
10
- !function(e){var t=Gl,n=Xl,r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},e.INSPECT_MAX_BYTES=50;var i=2147483647;function o(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|p(e,t),r=o(n),i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(z(e,Uint8Array)){var t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(z(e,ArrayBuffer)||e&&z(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(z(e,SharedArrayBuffer)||e&&z(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return a.from(r,t,n);var i=function(e){if(a.isBuffer(e)){var t=0|d(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||B(e.length)?o(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return l(e),o(e<0?0:0|d(e))}function c(e){for(var t=e.length<0?0:0|d(e.length),n=o(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,a.prototype),r}function d(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function p(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return N(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(i)return r?-1:N(e).length;t=(""+t).toLowerCase(),i=!0}}function f(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return M(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),B(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){var o,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;o<s;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(n+l>s&&(n=s-l),o=n;o>=0;o--){for(var h=!0,d=0;d<l;d++)if(u(e,o+d)!==u(t,d)){h=!1;break}if(h)return o}return-1}function y(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(B(s))return a;e[n+a]=s}return a}function w(e,t,n,r){return I(N(t,e.length-n),e,n,r)}function b(e,t,n,r){return I(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function _(e,t,n,r){return I(j(t),e,n,r)}function x(e,t,n,r){return I(function(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function S(e,n,r){return 0===n&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function A(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,a,s,l,u=e[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=n)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=h}return function(e){var t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=P));return n}(r)}e.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,n){return s(e,t,n)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,n){return function(e,t,n){return l(e),e<=0?o(e):void 0!==t?"string"==typeof n?o(e).fill(t,n):o(e).fill(t):o(e)}(e,t,n)},a.allocUnsafe=function(e){return u(e)},a.allocUnsafeSlow=function(e){return u(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),z(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=a.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(z(o,Uint8Array))i+o.length>r.length?a.from(o).copy(r,i):Uint8Array.prototype.set.call(r,o,i);else{if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i)}i+=o.length}return r},a.byteLength=p,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?A(this,0,e):f.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(e,t,n,r,i){if(z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),l=Math.min(o,s),u=this.slice(r,i),c=e.slice(t,n),h=0;h<l;++h)if(u[h]!==c[h]){o=u[h],s=c[h];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},a.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},a.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},a.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":case"latin1":case"binary":return b(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function M(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function C(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function k(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=U[e[o]];return i}function E(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length-1;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function T(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,n,r,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function R(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,r,i,o){return t=+t,r>>>=0,o||R(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function F(e,t,r,i,o){return t=+t,r>>>=0,o||R(e,0,r,8),n.write(e,t,r,i,52,8),r+8}a.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,a.prototype),r},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),n.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),n.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),n.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),n.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||L(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||L(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);L(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);L(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},a.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var i=e.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=a.isBuffer(e)?e:a.from(e,r),l=s.length;if(0===l)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=s[o%l]}return this};var O=/[^+/0-9A-Za-z-_]/g;function N(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function j(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function I(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function B(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()}(Hl);let Ql=function(e){var t={},n=t.lib={},r=function(){},i=n.Base={extend:function(e){r.prototype=this;var t=new r;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=n.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||s).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes;if(e=e.sigBytes,this.clamp(),r%4)for(var i=0;i<e;i++)t[r+i>>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(r+i)%4*8;else if(65535<n.length)for(i=0;i<e;i+=4)t[r+i>>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r<t;r+=4)n.push(4294967296*e.random()|0);return new o.init(n,t)}}),a=t.enc={},s=a.Hex={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r<e;r++){var i=t[r>>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},l=a.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r<e;r++)n.push(String.fromCharCode(t[r>>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},u=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},c=n.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a);if(t=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,i=e.min(4*t,i),t){for(var l=0;l<t;l+=a)this._doProcessBlock(r,l);l=r.splice(0,t),n.sigBytes-=i}return new o.init(l,i)},clone:function(){var e=i.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});n.Hasher=c.extend({cfg:i.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new h.HMAC.init(e,n).finalize(t)}}});var h=t.algo={};return t}(Math);!function(){var e=Ql,t=e.lib.WordArray;e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp(),e=[];for(var i=0;i<n;i+=3)for(var o=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;4>a&&i+.75*a<n;a++)e.push(r.charAt(o>>>6*(3-a)&63));if(t=r.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var n=e.length,r=this._map;(i=r.charAt(64))&&(-1!=(i=e.indexOf(i))&&(n=i));for(var i=[],o=0,a=0;a<n;a++)if(a%4){var s=r.indexOf(e.charAt(a-1))<<a%4*2,l=r.indexOf(e.charAt(a))>>>6-a%4*2;i[o>>>2]|=(s|l)<<24-o%4*8,o++}return t.create(i,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){function t(e,t,n,r,i,o,a){return((e=e+(t&n|~t&r)+i+a)<<o|e>>>32-o)+t}function n(e,t,n,r,i,o,a){return((e=e+(t&r|n&~r)+i+a)<<o|e>>>32-o)+t}function r(e,t,n,r,i,o,a){return((e=e+(t^n^r)+i+a)<<o|e>>>32-o)+t}function i(e,t,n,r,i,o,a){return((e=e+(n^(t|~r))+i+a)<<o|e>>>32-o)+t}for(var o=Ql,a=(l=o.lib).WordArray,s=l.Hasher,l=o.algo,u=[],c=0;64>c;c++)u[c]=4294967296*e.abs(e.sin(c+1))|0;l=l.MD5=s.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,o){for(var a=0;16>a;a++){var s=e[l=o+a];e[l]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}a=this._hash.words;var l=e[o+0],c=(s=e[o+1],e[o+2]),h=e[o+3],d=e[o+4],p=e[o+5],f=e[o+6],g=e[o+7],m=e[o+8],v=e[o+9],y=e[o+10],w=e[o+11],b=e[o+12],_=e[o+13],x=e[o+14],S=e[o+15],A=t(A=a[0],C=a[1],M=a[2],P=a[3],l,7,u[0]),P=t(P,A,C,M,s,12,u[1]),M=t(M,P,A,C,c,17,u[2]),C=t(C,M,P,A,h,22,u[3]);A=t(A,C,M,P,d,7,u[4]),P=t(P,A,C,M,p,12,u[5]),M=t(M,P,A,C,f,17,u[6]),C=t(C,M,P,A,g,22,u[7]),A=t(A,C,M,P,m,7,u[8]),P=t(P,A,C,M,v,12,u[9]),M=t(M,P,A,C,y,17,u[10]),C=t(C,M,P,A,w,22,u[11]),A=t(A,C,M,P,b,7,u[12]),P=t(P,A,C,M,_,12,u[13]),M=t(M,P,A,C,x,17,u[14]),A=n(A,C=t(C,M,P,A,S,22,u[15]),M,P,s,5,u[16]),P=n(P,A,C,M,f,9,u[17]),M=n(M,P,A,C,w,14,u[18]),C=n(C,M,P,A,l,20,u[19]),A=n(A,C,M,P,p,5,u[20]),P=n(P,A,C,M,y,9,u[21]),M=n(M,P,A,C,S,14,u[22]),C=n(C,M,P,A,d,20,u[23]),A=n(A,C,M,P,v,5,u[24]),P=n(P,A,C,M,x,9,u[25]),M=n(M,P,A,C,h,14,u[26]),C=n(C,M,P,A,m,20,u[27]),A=n(A,C,M,P,_,5,u[28]),P=n(P,A,C,M,c,9,u[29]),M=n(M,P,A,C,g,14,u[30]),A=r(A,C=n(C,M,P,A,b,20,u[31]),M,P,p,4,u[32]),P=r(P,A,C,M,m,11,u[33]),M=r(M,P,A,C,w,16,u[34]),C=r(C,M,P,A,x,23,u[35]),A=r(A,C,M,P,s,4,u[36]),P=r(P,A,C,M,d,11,u[37]),M=r(M,P,A,C,g,16,u[38]),C=r(C,M,P,A,y,23,u[39]),A=r(A,C,M,P,_,4,u[40]),P=r(P,A,C,M,l,11,u[41]),M=r(M,P,A,C,h,16,u[42]),C=r(C,M,P,A,f,23,u[43]),A=r(A,C,M,P,v,4,u[44]),P=r(P,A,C,M,b,11,u[45]),M=r(M,P,A,C,S,16,u[46]),A=i(A,C=r(C,M,P,A,c,23,u[47]),M,P,l,6,u[48]),P=i(P,A,C,M,g,10,u[49]),M=i(M,P,A,C,x,15,u[50]),C=i(C,M,P,A,p,21,u[51]),A=i(A,C,M,P,b,6,u[52]),P=i(P,A,C,M,h,10,u[53]),M=i(M,P,A,C,y,15,u[54]),C=i(C,M,P,A,s,21,u[55]),A=i(A,C,M,P,m,6,u[56]),P=i(P,A,C,M,S,10,u[57]),M=i(M,P,A,C,f,15,u[58]),C=i(C,M,P,A,_,21,u[59]),A=i(A,C,M,P,d,6,u[60]),P=i(P,A,C,M,w,10,u[61]),M=i(M,P,A,C,c,15,u[62]),C=i(C,M,P,A,v,21,u[63]);a[0]=a[0]+A|0,a[1]=a[1]+C|0,a[2]=a[2]+M|0,a[3]=a[3]+P|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var o=e.floor(r/4294967296);for(n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(n.length+1),this._process(),n=(t=this._hash).words,r=0;4>r;r++)i=n[r],n[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return t},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),o.MD5=s._createHelper(l),o.HmacMD5=s._createHmacHelper(l)}(Math),function(){var e,t=Ql,n=(e=t.lib).Base,r=e.WordArray,i=(e=t.algo).EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:e.MD5,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=(s=this.cfg).hasher.create(),i=r.create(),o=i.words,a=s.keySize,s=s.iterations;o.length<a;){l&&n.update(l);var l=n.update(e).finalize(t);n.reset();for(var u=1;u<s;u++)l=n.finalize(l),n.reset();i.concat(l)}return i.sigBytes=4*a,i}});t.EvpKDF=function(e,t,n){return i.create(n).compute(e,t)}}(),Ql.lib.Cipher||function(){var e=(d=Ql).lib,t=e.Base,n=e.WordArray,r=e.BufferedBlockAlgorithm,i=d.enc.Base64,o=d.algo.EvpKDF,a=e.Cipher=r.extend({cfg:t.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){r.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(t,n,r){return("string"==typeof n?p:h).encrypt(e,t,n,r)},decrypt:function(t,n,r){return("string"==typeof n?p:h).decrypt(e,t,n,r)}}}});e.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var s=d.mode={},l=function(e,t,n){var r=this._iv;r?this._iv=void 0:r=this._prevBlock;for(var i=0;i<n;i++)e[t+i]^=r[i]},u=(e.BlockCipherMode=t.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}})).extend();u.Encryptor=u.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize;l.call(this,e,t,r),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+r)}}),u.Decryptor=u.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=e.slice(t,t+r);n.decryptBlock(e,t),l.call(this,e,t,r),this._prevBlock=i}}),s=s.CBC=u,u=(d.pad={}).Pkcs7={pad:function(e,t){for(var r,i=(r=(r=4*t)-e.sigBytes%r)<<24|r<<16|r<<8|r,o=[],a=0;a<r;a+=4)o.push(i);r=n.create(o,r),e.concat(r)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},e.BlockCipher=a.extend({cfg:a.cfg.extend({mode:s,padding:u}),reset:function(){a.reset.call(this);var e=(t=this.cfg).iv,t=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=t.createEncryptor;else n=t.createDecryptor,this._minBufferSize=1;this._mode=n.call(t,this,e&&e.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var c=e.CipherParams=t.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),h=(s=(d.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return((e=e.salt)?n.create([1398893684,1701076831]).concat(e).concat(t):t).toString(i)},parse:function(e){var t=(e=i.parse(e)).words;if(1398893684==t[0]&&1701076831==t[1]){var r=n.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return c.create({ciphertext:e,salt:r})}},e.SerializableCipher=t.extend({cfg:t.extend({format:s}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r);return t=i.finalize(t),i=i.cfg,c.create({ciphertext:t,key:n,iv:i.iv,algorithm:e,mode:i.mode,padding:i.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}})),d=(d.kdf={}).OpenSSL={execute:function(e,t,r,i){return i||(i=n.random(8)),e=o.create({keySize:t+r}).compute(e,i),r=n.create(e.words.slice(t),4*r),e.sigBytes=4*t,c.create({key:e,iv:r,salt:i})}},p=e.PasswordBasedCipher=h.extend({cfg:h.cfg.extend({kdf:d}),encrypt:function(e,t,n,r){return n=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize),r.iv=n.iv,(e=h.encrypt.call(this,e,t,n.key,r)).mixIn(n),e},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),n=r.kdf.execute(n,e.keySize,e.ivSize,t.salt),r.iv=n.iv,h.decrypt.call(this,e,t,n.key,r)}})}(),function(){for(var e=Ql,t=e.lib.BlockCipher,n=e.algo,r=[],i=[],o=[],a=[],s=[],l=[],u=[],c=[],h=[],d=[],p=[],f=0;256>f;f++)p[f]=128>f?f<<1:f<<1^283;var g=0,m=0;for(f=0;256>f;f++){var v=(v=m^m<<1^m<<2^m<<3^m<<4)>>>8^255&v^99;r[g]=v,i[v]=g;var y=p[g],w=p[y],b=p[w],_=257*p[v]^16843008*v;o[g]=_<<24|_>>>8,a[g]=_<<16|_>>>16,s[g]=_<<8|_>>>24,l[g]=_,_=16843009*b^65537*w^257*y^16843008*g,u[v]=_<<24|_>>>8,c[v]=_<<16|_>>>16,h[v]=_<<8|_>>>24,d[v]=_,g?(g=y^p[p[p[b^y]]],m^=p[p[m]]):g=m=1}var x=[0,1,2,4,8,16,32,64,128,27,54];n=n.AES=t.extend({_doReset:function(){for(var e=(n=this._key).words,t=n.sigBytes/4,n=4*((this._nRounds=t+6)+1),i=this._keySchedule=[],o=0;o<n;o++)if(o<t)i[o]=e[o];else{var a=i[o-1];o%t?6<t&&4==o%t&&(a=r[a>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a]):(a=r[(a=a<<8|a>>>24)>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a],a^=x[o/t|0]<<24),i[o]=i[o-t]^a}for(e=this._invKeySchedule=[],t=0;t<n;t++)o=n-t,a=t%4?i[o]:i[o-4],e[t]=4>t||4>=o?a:u[r[a>>>24]]^c[r[a>>>16&255]]^h[r[a>>>8&255]]^d[r[255&a]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,s,l,r)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,c,h,d,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,o,a,s){for(var l=this._nRounds,u=e[t]^n[0],c=e[t+1]^n[1],h=e[t+2]^n[2],d=e[t+3]^n[3],p=4,f=1;f<l;f++){var g=r[u>>>24]^i[c>>>16&255]^o[h>>>8&255]^a[255&d]^n[p++],m=r[c>>>24]^i[h>>>16&255]^o[d>>>8&255]^a[255&u]^n[p++],v=r[h>>>24]^i[d>>>16&255]^o[u>>>8&255]^a[255&c]^n[p++];d=r[d>>>24]^i[u>>>16&255]^o[c>>>8&255]^a[255&h]^n[p++],u=g,c=m,h=v}g=(s[u>>>24]<<24|s[c>>>16&255]<<16|s[h>>>8&255]<<8|s[255&d])^n[p++],m=(s[c>>>24]<<24|s[h>>>16&255]<<16|s[d>>>8&255]<<8|s[255&u])^n[p++],v=(s[h>>>24]<<24|s[d>>>16&255]<<16|s[u>>>8&255]<<8|s[255&c])^n[p++],d=(s[d>>>24]<<24|s[u>>>16&255]<<16|s[c>>>8&255]<<8|s[255&h])^n[p++],e[t]=g,e[t+1]=m,e[t+2]=v,e[t+3]=d},keySize:8});e.AES=t._createHelper(n)}();var eu=Ql,tu=function(e,t,n){return I(void 0,void 0,void 0,function(){var r,i,o,a,s;return z(this,function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),r="string"==typeof(u=e)&&u.length>0&&u.length%2==0&&/^[0-9a-fA-F]+$/.test(u)?Hl.Buffer.from(e,"hex").toString("base64"):e,i=Hl.Buffer.from(t,"base64").toString("hex"),o=Hl.Buffer.from(n,"utf8").toString("hex"),[4,T.decrypt(r,o,i,"aes-256-cbc")];case 1:return a=l.sent(),[2,JSON.parse(a)];case 2:throw s=l.sent(),console.error("Error decrypting file:",s),s;case 3:return[2]}var u})})};var nu=function(e,t){return I(void 0,void 0,void 0,function(){var n,r,i,o;return z(this,function(a){switch(a.label){case 0:n="".concat(L.DocumentDirectoryPath+"/"+e),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,L.readFile(n,"utf8")];case 2:return r=a.sent(),i=eu.AES.decrypt(r,t),[2,JSON.parse(i.toString(eu.enc.Utf8))];case 3:return o=a.sent(),console.error("Failed to read file:",o.message),[2,[]];case 4:return[2]}})})},ru=function(e){return I(void 0,void 0,void 0,function(){var t,n,r,i,o;return z(this,function(a){switch(a.label){case 0:return a.trys.push([0,9,,10]),[4,L.readDir(e)];case 1:t=a.sent(),n=0,r=t,a.label=2;case 2:return n<r.length?(i=r[n]).isFile()?[4,L.unlink(i.path)]:[3,4]:[3,8];case 3:return a.sent(),[3,7];case 4:return i.isDirectory()?[4,ru(i.path)]:[3,7];case 5:return a.sent(),[4,L.unlink(i.path)];case 6:a.sent(),a.label=7;case 7:return n++,[3,2];case 8:return console.log("Contents of ".concat(e," have been cleared.")),[3,10];case 9:return o=a.sent(),console.error("Error clearing contents of ".concat(e,":"),o),[3,10];case 10:return[2]}})})},iu={},ou={get exports(){return iu},set exports(e){iu=e}},au={},su={},lu={get exports(){return su},set exports(e){su=e}},uu={},cu=l;var hu="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},du=cu.useState,pu=cu.useEffect,fu=cu.useLayoutEffect,gu=cu.useDebugValue;function mu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!hu(e,n)}catch(e){return!0}}var vu="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=du({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return fu(function(){i.value=n,i.getSnapshot=t,mu(i)&&o({inst:i})},[e,n,t]),pu(function(){return mu(i)&&o({inst:i}),e(function(){mu(i)&&o({inst:i})})},[e]),gu(n),n};uu.useSyncExternalStore=void 0!==cu.useSyncExternalStore?cu.useSyncExternalStore:vu,lu.exports=uu;
10
+ !function(e){var t=ml,n=Pl,r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},e.INSPECT_MAX_BYTES=50;var i=2147483647;function o(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|p(e,t),r=o(n),i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(z(e,Uint8Array)){var t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(z(e,ArrayBuffer)||e&&z(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(z(e,SharedArrayBuffer)||e&&z(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return a.from(r,t,n);var i=function(e){if(a.isBuffer(e)){var t=0|d(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||B(e.length)?o(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return l(e),o(e<0?0:0|d(e))}function c(e){for(var t=e.length<0?0:0|d(e.length),n=o(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,a.prototype),r}function d(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function p(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return O(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(i)return r?-1:O(e).length;t=(""+t).toLowerCase(),i=!0}}function f(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return M(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),B(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){var o,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;o<s;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(n+l>s&&(n=s-l),o=n;o>=0;o--){for(var h=!0,d=0;d<l;d++)if(u(e,o+d)!==u(t,d)){h=!1;break}if(h)return o}return-1}function y(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(B(s))return a;e[n+a]=s}return a}function w(e,t,n,r){return I(O(t,e.length-n),e,n,r)}function b(e,t,n,r){return I(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function _(e,t,n,r){return I(j(t),e,n,r)}function x(e,t,n,r){return I(function(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function S(e,n,r){return 0===n&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function A(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,a,s,l,u=e[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=n)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=h}return function(e){var t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=P));return n}(r)}e.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,n){return s(e,t,n)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,n){return function(e,t,n){return l(e),e<=0?o(e):void 0!==t?"string"==typeof n?o(e).fill(t,n):o(e).fill(t):o(e)}(e,t,n)},a.allocUnsafe=function(e){return u(e)},a.allocUnsafeSlow=function(e){return u(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),z(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=a.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(z(o,Uint8Array))i+o.length>r.length?a.from(o).copy(r,i):Uint8Array.prototype.set.call(r,o,i);else{if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i)}i+=o.length}return r},a.byteLength=p,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?A(this,0,e):f.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(e,t,n,r,i){if(z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),l=Math.min(o,s),u=this.slice(r,i),c=e.slice(t,n),h=0;h<l;++h)if(u[h]!==c[h]){o=u[h],s=c[h];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},a.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},a.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},a.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":case"latin1":case"binary":return b(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function M(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function C(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function T(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=U[e[o]];return i}function k(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length-1;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function E(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,n,r,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function L(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,r,i,o){return t=+t,r>>>=0,o||L(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function F(e,t,r,i,o){return t=+t,r>>>=0,o||L(e,0,r,8),n.write(e,t,r,i,52,8),r+8}a.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,a.prototype),r},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||E(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return e>>>=0,t||E(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||E(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){e>>>=0,t||E(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||E(e,4,this.length),n.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||E(e,4,this.length),n.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||E(e,8,this.length),n.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||E(e,8,this.length),n.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||R(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||R(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);R(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);R(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},a.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var i=e.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=a.isBuffer(e)?e:a.from(e,r),l=s.length;if(0===l)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=s[o%l]}return this};var N=/[^+/0-9A-Za-z-_]/g;function O(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function j(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(N,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function I(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function B(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()}(gl);let Ml=function(e){var t={},n=t.lib={},r=function(){},i=n.Base={extend:function(e){r.prototype=this;var t=new r;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=n.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||s).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes;if(e=e.sigBytes,this.clamp(),r%4)for(var i=0;i<e;i++)t[r+i>>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(r+i)%4*8;else if(65535<n.length)for(i=0;i<e;i+=4)t[r+i>>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r<t;r+=4)n.push(4294967296*e.random()|0);return new o.init(n,t)}}),a=t.enc={},s=a.Hex={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r<e;r++){var i=t[r>>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},l=a.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r<e;r++)n.push(String.fromCharCode(t[r>>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},u=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},c=n.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a);if(t=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,i=e.min(4*t,i),t){for(var l=0;l<t;l+=a)this._doProcessBlock(r,l);l=r.splice(0,t),n.sigBytes-=i}return new o.init(l,i)},clone:function(){var e=i.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});n.Hasher=c.extend({cfg:i.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new h.HMAC.init(e,n).finalize(t)}}});var h=t.algo={};return t}(Math);var Cl,Tl;Tl=(Cl=Ml).lib.WordArray,Cl.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp(),e=[];for(var i=0;i<n;i+=3)for(var o=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;4>a&&i+.75*a<n;a++)e.push(r.charAt(o>>>6*(3-a)&63));if(t=r.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var t=e.length,n=this._map;(r=n.charAt(64))&&-1!=(r=e.indexOf(r))&&(t=r);for(var r=[],i=0,o=0;o<t;o++)if(o%4){var a=n.indexOf(e.charAt(o-1))<<o%4*2,s=n.indexOf(e.charAt(o))>>>6-o%4*2;r[i>>>2]|=(a|s)<<24-i%4*8,i++}return Tl.create(r,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},function(e){function t(e,t,n,r,i,o,a){return((e=e+(t&n|~t&r)+i+a)<<o|e>>>32-o)+t}function n(e,t,n,r,i,o,a){return((e=e+(t&r|n&~r)+i+a)<<o|e>>>32-o)+t}function r(e,t,n,r,i,o,a){return((e=e+(t^n^r)+i+a)<<o|e>>>32-o)+t}function i(e,t,n,r,i,o,a){return((e=e+(n^(t|~r))+i+a)<<o|e>>>32-o)+t}for(var o=Ml,a=(l=o.lib).WordArray,s=l.Hasher,l=o.algo,u=[],c=0;64>c;c++)u[c]=4294967296*e.abs(e.sin(c+1))|0;l=l.MD5=s.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,o){for(var a=0;16>a;a++){var s=e[l=o+a];e[l]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}a=this._hash.words;var l=e[o+0],c=(s=e[o+1],e[o+2]),h=e[o+3],d=e[o+4],p=e[o+5],f=e[o+6],g=e[o+7],m=e[o+8],v=e[o+9],y=e[o+10],w=e[o+11],b=e[o+12],_=e[o+13],x=e[o+14],S=e[o+15],A=t(A=a[0],C=a[1],M=a[2],P=a[3],l,7,u[0]),P=t(P,A,C,M,s,12,u[1]),M=t(M,P,A,C,c,17,u[2]),C=t(C,M,P,A,h,22,u[3]);A=t(A,C,M,P,d,7,u[4]),P=t(P,A,C,M,p,12,u[5]),M=t(M,P,A,C,f,17,u[6]),C=t(C,M,P,A,g,22,u[7]),A=t(A,C,M,P,m,7,u[8]),P=t(P,A,C,M,v,12,u[9]),M=t(M,P,A,C,y,17,u[10]),C=t(C,M,P,A,w,22,u[11]),A=t(A,C,M,P,b,7,u[12]),P=t(P,A,C,M,_,12,u[13]),M=t(M,P,A,C,x,17,u[14]),A=n(A,C=t(C,M,P,A,S,22,u[15]),M,P,s,5,u[16]),P=n(P,A,C,M,f,9,u[17]),M=n(M,P,A,C,w,14,u[18]),C=n(C,M,P,A,l,20,u[19]),A=n(A,C,M,P,p,5,u[20]),P=n(P,A,C,M,y,9,u[21]),M=n(M,P,A,C,S,14,u[22]),C=n(C,M,P,A,d,20,u[23]),A=n(A,C,M,P,v,5,u[24]),P=n(P,A,C,M,x,9,u[25]),M=n(M,P,A,C,h,14,u[26]),C=n(C,M,P,A,m,20,u[27]),A=n(A,C,M,P,_,5,u[28]),P=n(P,A,C,M,c,9,u[29]),M=n(M,P,A,C,g,14,u[30]),A=r(A,C=n(C,M,P,A,b,20,u[31]),M,P,p,4,u[32]),P=r(P,A,C,M,m,11,u[33]),M=r(M,P,A,C,w,16,u[34]),C=r(C,M,P,A,x,23,u[35]),A=r(A,C,M,P,s,4,u[36]),P=r(P,A,C,M,d,11,u[37]),M=r(M,P,A,C,g,16,u[38]),C=r(C,M,P,A,y,23,u[39]),A=r(A,C,M,P,_,4,u[40]),P=r(P,A,C,M,l,11,u[41]),M=r(M,P,A,C,h,16,u[42]),C=r(C,M,P,A,f,23,u[43]),A=r(A,C,M,P,v,4,u[44]),P=r(P,A,C,M,b,11,u[45]),M=r(M,P,A,C,S,16,u[46]),A=i(A,C=r(C,M,P,A,c,23,u[47]),M,P,l,6,u[48]),P=i(P,A,C,M,g,10,u[49]),M=i(M,P,A,C,x,15,u[50]),C=i(C,M,P,A,p,21,u[51]),A=i(A,C,M,P,b,6,u[52]),P=i(P,A,C,M,h,10,u[53]),M=i(M,P,A,C,y,15,u[54]),C=i(C,M,P,A,s,21,u[55]),A=i(A,C,M,P,m,6,u[56]),P=i(P,A,C,M,S,10,u[57]),M=i(M,P,A,C,f,15,u[58]),C=i(C,M,P,A,_,21,u[59]),A=i(A,C,M,P,d,6,u[60]),P=i(P,A,C,M,w,10,u[61]),M=i(M,P,A,C,c,15,u[62]),C=i(C,M,P,A,v,21,u[63]);a[0]=a[0]+A|0,a[1]=a[1]+C|0,a[2]=a[2]+M|0,a[3]=a[3]+P|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var o=e.floor(r/4294967296);for(n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(n.length+1),this._process(),n=(t=this._hash).words,r=0;4>r;r++)i=n[r],n[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return t},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),o.MD5=s._createHelper(l),o.HmacMD5=s._createHmacHelper(l)}(Math),function(){var e,t=Ml,n=(e=t.lib).Base,r=e.WordArray,i=(e=t.algo).EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:e.MD5,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=(s=this.cfg).hasher.create(),i=r.create(),o=i.words,a=s.keySize,s=s.iterations;o.length<a;){l&&n.update(l);var l=n.update(e).finalize(t);n.reset();for(var u=1;u<s;u++)l=n.finalize(l),n.reset();i.concat(l)}return i.sigBytes=4*a,i}});t.EvpKDF=function(e,t,n){return i.create(n).compute(e,t)}}(),Ml.lib.Cipher||function(){var e=(d=Ml).lib,t=e.Base,n=e.WordArray,r=e.BufferedBlockAlgorithm,i=d.enc.Base64,o=d.algo.EvpKDF,a=e.Cipher=r.extend({cfg:t.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){r.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(t,n,r){return("string"==typeof n?p:h).encrypt(e,t,n,r)},decrypt:function(t,n,r){return("string"==typeof n?p:h).decrypt(e,t,n,r)}}}});e.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var s=d.mode={},l=function(e,t,n){var r=this._iv;r?this._iv=void 0:r=this._prevBlock;for(var i=0;i<n;i++)e[t+i]^=r[i]},u=(e.BlockCipherMode=t.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}})).extend();u.Encryptor=u.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize;l.call(this,e,t,r),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+r)}}),u.Decryptor=u.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=e.slice(t,t+r);n.decryptBlock(e,t),l.call(this,e,t,r),this._prevBlock=i}}),s=s.CBC=u,u=(d.pad={}).Pkcs7={pad:function(e,t){for(var r,i=(r=(r=4*t)-e.sigBytes%r)<<24|r<<16|r<<8|r,o=[],a=0;a<r;a+=4)o.push(i);r=n.create(o,r),e.concat(r)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},e.BlockCipher=a.extend({cfg:a.cfg.extend({mode:s,padding:u}),reset:function(){a.reset.call(this);var e=(t=this.cfg).iv,t=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=t.createEncryptor;else n=t.createDecryptor,this._minBufferSize=1;this._mode=n.call(t,this,e&&e.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var c=e.CipherParams=t.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),h=(s=(d.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return((e=e.salt)?n.create([1398893684,1701076831]).concat(e).concat(t):t).toString(i)},parse:function(e){var t=(e=i.parse(e)).words;if(1398893684==t[0]&&1701076831==t[1]){var r=n.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return c.create({ciphertext:e,salt:r})}},e.SerializableCipher=t.extend({cfg:t.extend({format:s}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r);return t=i.finalize(t),i=i.cfg,c.create({ciphertext:t,key:n,iv:i.iv,algorithm:e,mode:i.mode,padding:i.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}})),d=(d.kdf={}).OpenSSL={execute:function(e,t,r,i){return i||(i=n.random(8)),e=o.create({keySize:t+r}).compute(e,i),r=n.create(e.words.slice(t),4*r),e.sigBytes=4*t,c.create({key:e,iv:r,salt:i})}},p=e.PasswordBasedCipher=h.extend({cfg:h.cfg.extend({kdf:d}),encrypt:function(e,t,n,r){return n=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize),r.iv=n.iv,(e=h.encrypt.call(this,e,t,n.key,r)).mixIn(n),e},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),n=r.kdf.execute(n,e.keySize,e.ivSize,t.salt),r.iv=n.iv,h.decrypt.call(this,e,t,n.key,r)}})}(),function(){for(var e=Ml,t=e.lib.BlockCipher,n=e.algo,r=[],i=[],o=[],a=[],s=[],l=[],u=[],c=[],h=[],d=[],p=[],f=0;256>f;f++)p[f]=128>f?f<<1:f<<1^283;var g=0,m=0;for(f=0;256>f;f++){var v=(v=m^m<<1^m<<2^m<<3^m<<4)>>>8^255&v^99;r[g]=v,i[v]=g;var y=p[g],w=p[y],b=p[w],_=257*p[v]^16843008*v;o[g]=_<<24|_>>>8,a[g]=_<<16|_>>>16,s[g]=_<<8|_>>>24,l[g]=_,_=16843009*b^65537*w^257*y^16843008*g,u[v]=_<<24|_>>>8,c[v]=_<<16|_>>>16,h[v]=_<<8|_>>>24,d[v]=_,g?(g=y^p[p[p[b^y]]],m^=p[p[m]]):g=m=1}var x=[0,1,2,4,8,16,32,64,128,27,54];n=n.AES=t.extend({_doReset:function(){for(var e=(n=this._key).words,t=n.sigBytes/4,n=4*((this._nRounds=t+6)+1),i=this._keySchedule=[],o=0;o<n;o++)if(o<t)i[o]=e[o];else{var a=i[o-1];o%t?6<t&&4==o%t&&(a=r[a>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a]):(a=r[(a=a<<8|a>>>24)>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a],a^=x[o/t|0]<<24),i[o]=i[o-t]^a}for(e=this._invKeySchedule=[],t=0;t<n;t++)o=n-t,a=t%4?i[o]:i[o-4],e[t]=4>t||4>=o?a:u[r[a>>>24]]^c[r[a>>>16&255]]^h[r[a>>>8&255]]^d[r[255&a]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,s,l,r)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,c,h,d,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,o,a,s){for(var l=this._nRounds,u=e[t]^n[0],c=e[t+1]^n[1],h=e[t+2]^n[2],d=e[t+3]^n[3],p=4,f=1;f<l;f++){var g=r[u>>>24]^i[c>>>16&255]^o[h>>>8&255]^a[255&d]^n[p++],m=r[c>>>24]^i[h>>>16&255]^o[d>>>8&255]^a[255&u]^n[p++],v=r[h>>>24]^i[d>>>16&255]^o[u>>>8&255]^a[255&c]^n[p++];d=r[d>>>24]^i[u>>>16&255]^o[c>>>8&255]^a[255&h]^n[p++],u=g,c=m,h=v}g=(s[u>>>24]<<24|s[c>>>16&255]<<16|s[h>>>8&255]<<8|s[255&d])^n[p++],m=(s[c>>>24]<<24|s[h>>>16&255]<<16|s[d>>>8&255]<<8|s[255&u])^n[p++],v=(s[h>>>24]<<24|s[d>>>16&255]<<16|s[u>>>8&255]<<8|s[255&c])^n[p++],d=(s[d>>>24]<<24|s[u>>>16&255]<<16|s[c>>>8&255]<<8|s[255&h])^n[p++],e[t]=g,e[t+1]=m,e[t+2]=v,e[t+3]=d},keySize:8});e.AES=t._createHelper(n)}();var kl=Ml,El=function(e,t,n){return I(void 0,void 0,void 0,function(){var r,i,o,a,s;return z(this,function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),r="string"==typeof(u=e)&&u.length>0&&u.length%2==0&&/^[0-9a-fA-F]+$/.test(u)?gl.Buffer.from(e,"hex").toString("base64"):e,i=gl.Buffer.from(t,"base64").toString("hex"),o=gl.Buffer.from(n,"utf8").toString("hex"),[4,E.decrypt(r,o,i,"aes-256-cbc")];case 1:return a=l.sent(),[2,JSON.parse(a)];case 2:throw s=l.sent(),console.error("Error decrypting file:",s),s;case 3:return[2]}var u})})};var Rl=function(e,t){return I(void 0,void 0,void 0,function(){var n,r,i,o;return z(this,function(a){switch(a.label){case 0:n="".concat(R.DocumentDirectoryPath+"/"+e),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,R.readFile(n,"utf8")];case 2:return r=a.sent(),i=kl.AES.decrypt(r,t),[2,JSON.parse(i.toString(kl.enc.Utf8))];case 3:return o=a.sent(),console.error("Failed to read file:",o.message),[2,[]];case 4:return[2]}})})},Ll=function(e){return I(void 0,void 0,void 0,function(){var t,n,r,i,o;return z(this,function(a){switch(a.label){case 0:return a.trys.push([0,9,,10]),[4,R.readDir(e)];case 1:t=a.sent(),n=0,r=t,a.label=2;case 2:return n<r.length?(i=r[n]).isFile()?[4,R.unlink(i.path)]:[3,4]:[3,8];case 3:return a.sent(),[3,7];case 4:return i.isDirectory()?[4,Ll(i.path)]:[3,7];case 5:return a.sent(),[4,R.unlink(i.path)];case 6:a.sent(),a.label=7;case 7:return n++,[3,2];case 8:return console.log("Contents of ".concat(e," have been cleared.")),[3,10];case 9:return o=a.sent(),console.error("Error clearing contents of ".concat(e,":"),o),[3,10];case 10:return[2]}})})},Dl={},Fl={get exports(){return Dl},set exports(e){Dl=e}},Nl={},Ol={},jl={get exports(){return Ol},set exports(e){Ol=e}},Il={},zl=l;var Bl="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Ul=zl.useState,Hl=zl.useEffect,Gl=zl.useLayoutEffect,Wl=zl.useDebugValue;function Vl(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Bl(e,n)}catch(e){return!0}}var ql="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=Ul({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return Gl(function(){i.value=n,i.getSnapshot=t,Vl(i)&&o({inst:i})},[e,n,t]),Hl(function(){return Vl(i)&&o({inst:i}),e(function(){Vl(i)&&o({inst:i})})},[e]),Wl(n),n};Il.useSyncExternalStore=void 0!==zl.useSyncExternalStore?zl.useSyncExternalStore:ql,jl.exports=Il;
11
11
  /**
12
12
  * @license React
13
13
  * use-sync-external-store-shim/with-selector.production.js
@@ -17,7 +17,7 @@ read:function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<<s)-1,u=l>>1,c=-7,h=n?i-1:0,d=n?
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
19
  */
20
- var yu=l,wu=su;var bu="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},_u=wu.useSyncExternalStore,xu=yu.useRef,Su=yu.useEffect,Au=yu.useMemo,Pu=yu.useDebugValue;au.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=xu(null);if(null===o.current){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=Au(function(){function e(e){if(!l){if(l=!0,o=e,e=r(e),void 0!==i&&a.hasValue){var t=a.value;if(i(t,e))return s=t}return s=e}if(t=s,bu(o,e))return t;var n=r(e);return void 0!==i&&i(t,n)?(o=e,t):(o=e,s=n)}var o,s,l=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,n,r,i]);var s=_u(e,o[0],o[1]);return Su(function(){a.hasValue=!0,a.value=s},[s]),Pu(s),s},ou.exports=au;var Mu=Se(iu);const{useDebugValue:Cu}=l,{useSyncExternalStoreWithSelector:ku}=Mu;const Eu=e=>e;const Tu=e=>{const t="function"==typeof e?fl(e):e,n=(e,n)=>function(e,t=Eu,n){const r=ku(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Cu(r),r}(t,e,n);return Object.assign(n,t),n},Lu=e=>e?Tu(e):Tu;var Ru,Du,Fu,Ou,Nu,ju,Iu,zu,Bu,Uu,Hu,Gu,Wu={};
20
+ var Zl=l,Yl=Ol;var $l="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Kl=Yl.useSyncExternalStore,Xl=Zl.useRef,Jl=Zl.useEffect,Ql=Zl.useMemo,eu=Zl.useDebugValue;Nl.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Xl(null);if(null===o.current){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=Ql(function(){function e(e){if(!l){if(l=!0,o=e,e=r(e),void 0!==i&&a.hasValue){var t=a.value;if(i(t,e))return s=t}return s=e}if(t=s,$l(o,e))return t;var n=r(e);return void 0!==i&&i(t,n)?(o=e,t):(o=e,s=n)}var o,s,l=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,n,r,i]);var s=Kl(e,o[0],o[1]);return Jl(function(){a.hasValue=!0,a.value=s},[s]),eu(s),s},Fl.exports=Nl;var tu=Te(Dl);const{useDebugValue:nu}=l,{useSyncExternalStoreWithSelector:ru}=tu;const iu=e=>e;const ou=e=>{const t="function"==typeof e?Ks(e):e,n=(e,n)=>function(e,t=iu,n){const r=ru(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return nu(r),r}(t,e,n);return Object.assign(n,t),n},au=e=>e?ou(e):ou;var su,lu,uu,cu,hu,du,pu,fu,gu,mu,vu,yu,wu={};
21
21
  /**
22
22
  * @license
23
23
  * Lodash <https://lodash.com/>
@@ -26,5 +26,5 @@ var yu=l,wu=su;var bu="function"==typeof Object.is?Object.is:function(e,t){retur
26
26
  * Based on Underscore.js <http://underscorejs.org/LICENSE>
27
27
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
28
28
  */
29
- Ru={get exports(){return Wu},set exports(e){Wu=e}},Du=Wu,function(){var e,t="Expected a function",n="__lodash_hash_undefined__",r="__lodash_placeholder__",i=16,o=32,a=64,s=128,l=256,u=1/0,c=9007199254740991,h=NaN,d=4294967295,p=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",i],["flip",512],["partial",o],["partialRight",a],["rearg",l]],f="[object Arguments]",g="[object Array]",m="[object Boolean]",v="[object Date]",y="[object Error]",w="[object Function]",b="[object GeneratorFunction]",_="[object Map]",x="[object Number]",S="[object Object]",A="[object Promise]",P="[object RegExp]",M="[object Set]",C="[object String]",k="[object Symbol]",E="[object WeakMap]",T="[object ArrayBuffer]",L="[object DataView]",R="[object Float32Array]",D="[object Float64Array]",F="[object Int8Array]",O="[object Int16Array]",N="[object Int32Array]",j="[object Uint8Array]",I="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",U=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,V=/[&<>"']/g,q=RegExp(W.source),Z=RegExp(V.source),Y=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),ne=/^\s+/,re=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ue=/\\(\\)?/g,ce=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,fe=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ye=/($^)/,we=/['\n\r\u2028\u2029\\]/g,be="\\ud800-\\udfff",_e="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",Ae="a-z\\xdf-\\xf6\\xf8-\\xff",Pe="A-Z\\xc0-\\xd6\\xd8-\\xde",Me="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ke="['’]",Ee="["+be+"]",Te="["+Ce+"]",Le="["+_e+"]",Re="\\d+",De="["+Se+"]",Fe="["+Ae+"]",Oe="[^"+be+Ce+Re+Se+Ae+Pe+"]",Ne="\\ud83c[\\udffb-\\udfff]",je="[^"+be+"]",Ie="(?:\\ud83c[\\udde6-\\uddff]){2}",ze="[\\ud800-\\udbff][\\udc00-\\udfff]",Be="["+Pe+"]",Ue="\\u200d",He="(?:"+Fe+"|"+Oe+")",Ge="(?:"+Be+"|"+Oe+")",We="(?:['’](?:d|ll|m|re|s|t|ve))?",Ve="(?:['’](?:D|LL|M|RE|S|T|VE))?",qe="(?:"+Le+"|"+Ne+")?",Ze="["+Me+"]?",Ye=Ze+qe+"(?:"+Ue+"(?:"+[je,Ie,ze].join("|")+")"+Ze+qe+")*",$e="(?:"+[De,Ie,ze].join("|")+")"+Ye,Je="(?:"+[je+Le+"?",Le,Ie,ze,Ee].join("|")+")",Ke=RegExp(ke,"g"),Xe=RegExp(Le,"g"),Qe=RegExp(Ne+"(?="+Ne+")|"+Je+Ye,"g"),et=RegExp([Be+"?"+Fe+"+"+We+"(?="+[Te,Be,"$"].join("|")+")",Ge+"+"+Ve+"(?="+[Te,Be+He,"$"].join("|")+")",Be+"?"+He+"+"+We,Be+"+"+Ve,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Re,$e].join("|"),"g"),tt=RegExp("["+Ue+be+_e+Me+"]"),nt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],it=-1,ot={};ot[R]=ot[D]=ot[F]=ot[O]=ot[N]=ot[j]=ot[I]=ot[z]=ot[B]=!0,ot[f]=ot[g]=ot[T]=ot[m]=ot[L]=ot[v]=ot[y]=ot[w]=ot[_]=ot[x]=ot[S]=ot[P]=ot[M]=ot[C]=ot[E]=!1;var at={};at[f]=at[g]=at[T]=at[L]=at[m]=at[v]=at[R]=at[D]=at[F]=at[O]=at[N]=at[_]=at[x]=at[S]=at[P]=at[M]=at[C]=at[k]=at[j]=at[I]=at[z]=at[B]=!0,at[y]=at[w]=at[E]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},lt=parseFloat,ut=parseInt,ct="object"==typeof xe&&xe&&xe.Object===Object&&xe,ht="object"==typeof self&&self&&self.Object===Object&&self,dt=ct||ht||Function("return this")(),pt=Du&&!Du.nodeType&&Du,ft=pt&&Ru&&!Ru.nodeType&&Ru,gt=ft&&ft.exports===pt,mt=gt&&ct.process,vt=function(){try{var e=ft&&ft.require&&ft.require("util").types;return e||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),yt=vt&&vt.isArrayBuffer,wt=vt&&vt.isDate,bt=vt&&vt.isMap,_t=vt&&vt.isRegExp,xt=vt&&vt.isSet,St=vt&&vt.isTypedArray;function At(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Pt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function Mt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Ct(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function kt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Et(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Tt(e,t){return!(null==e||!e.length)&&Bt(e,t,0)>-1}function Lt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Rt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Dt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Ft(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function Ot(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Nt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var jt=Wt("length");function It(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function zt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Bt(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):zt(e,Ht,n)}function Ut(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Ht(e){return e!=e}function Gt(e,t){var n=null==e?0:e.length;return n?Zt(e,t)/n:h}function Wt(t){return function(n){return null==n?e:n[t]}}function Vt(t){return function(n){return null==t?e:t[n]}}function qt(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}function Zt(t,n){for(var r,i=-1,o=t.length;++i<o;){var a=n(t[i]);a!==e&&(r=r===e?a:r+a)}return r}function Yt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function $t(e){return e?e.slice(0,pn(e)+1).replace(ne,""):e}function Jt(e){return function(t){return e(t)}}function Kt(e,t){return Rt(t,function(t){return e[t]})}function Xt(e,t){return e.has(t)}function Qt(e,t){for(var n=-1,r=e.length;++n<r&&Bt(t,e[n],0)>-1;);return n}function en(e,t){for(var n=e.length;n--&&Bt(t,e[n],0)>-1;);return n}var tn=Vt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nn=Vt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function rn(e){return"\\"+st[e]}function on(e){return tt.test(e)}function an(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function sn(e,t){return function(n){return e(t(n))}}function ln(e,t){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var s=e[n];s!==t&&s!==r||(e[n]=r,a[o++]=n)}return a}function un(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function cn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function hn(e){return on(e)?function(e){for(var t=Qe.lastIndex=0;Qe.test(e);)++t;return t}(e):jt(e)}function dn(e){return on(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.split("")}(e)}function pn(e){for(var t=e.length;t--&&re.test(e.charAt(t)););return t}var fn=Vt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),gn=function re(be){var _e=(be=null==be?dt:gn.defaults(dt.Object(),be,gn.pick(dt,rt))).Array,xe=be.Date,Se=be.Error,Ae=be.Function,Pe=be.Math,Me=be.Object,Ce=be.RegExp,ke=be.String,Ee=be.TypeError,Te=_e.prototype,Le=Ae.prototype,Re=Me.prototype,De=be["__core-js_shared__"],Fe=Le.toString,Oe=Re.hasOwnProperty,Ne=0,je=function(){var e=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ie=Re.toString,ze=Fe.call(Me),Be=dt._,Ue=Ce("^"+Fe.call(Oe).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),He=gt?be.Buffer:e,Ge=be.Symbol,We=be.Uint8Array,Ve=He?He.allocUnsafe:e,qe=sn(Me.getPrototypeOf,Me),Ze=Me.create,Ye=Re.propertyIsEnumerable,$e=Te.splice,Je=Ge?Ge.isConcatSpreadable:e,Qe=Ge?Ge.iterator:e,tt=Ge?Ge.toStringTag:e,st=function(){try{var e=ho(Me,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=be.clearTimeout!==dt.clearTimeout&&be.clearTimeout,ht=xe&&xe.now!==dt.Date.now&&xe.now,pt=be.setTimeout!==dt.setTimeout&&be.setTimeout,ft=Pe.ceil,mt=Pe.floor,vt=Me.getOwnPropertySymbols,jt=He?He.isBuffer:e,Vt=be.isFinite,mn=Te.join,vn=sn(Me.keys,Me),yn=Pe.max,wn=Pe.min,bn=xe.now,_n=be.parseInt,xn=Pe.random,Sn=Te.reverse,An=ho(be,"DataView"),Pn=ho(be,"Map"),Mn=ho(be,"Promise"),Cn=ho(be,"Set"),kn=ho(be,"WeakMap"),En=ho(Me,"create"),Tn=kn&&new kn,Ln={},Rn=Io(An),Dn=Io(Pn),Fn=Io(Mn),On=Io(Cn),Nn=Io(kn),jn=Ge?Ge.prototype:e,In=jn?jn.valueOf:e,zn=jn?jn.toString:e;function Bn(e){if(ts(e)&&!Wa(e)&&!(e instanceof Wn)){if(e instanceof Gn)return e;if(Oe.call(e,"__wrapped__"))return zo(e)}return new Gn(e)}var Un=function(){function t(){}return function(n){if(!es(n))return{};if(Ze)return Ze(n);t.prototype=n;var r=new t;return t.prototype=e,r}}();function Hn(){}function Gn(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=e}function Wn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Zn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Zn;++t<n;)this.add(e[t])}function $n(e){var t=this.__data__=new qn(e);this.size=t.size}function Jn(e,t){var n=Wa(e),r=!n&&Ga(e),i=!n&&!r&&Ya(e),o=!n&&!r&&!i&&us(e),a=n||r||i||o,s=a?Yt(e.length,ke):[],l=s.length;for(var u in e)!t&&!Oe.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||wo(u,l))||s.push(u);return s}function Kn(t){var n=t.length;return n?t[Yr(0,n-1)]:e}function Xn(e,t){return Oo(Ei(e),sr(t,0,e.length))}function Qn(e){return Oo(Ei(e))}function er(t,n,r){(r!==e&&!Ba(t[n],r)||r===e&&!(n in t))&&or(t,n,r)}function tr(t,n,r){var i=t[n];Oe.call(t,n)&&Ba(i,r)&&(r!==e||n in t)||or(t,n,r)}function nr(e,t){for(var n=e.length;n--;)if(Ba(e[n][0],t))return n;return-1}function rr(e,t,n,r){return dr(e,function(e,i,o){t(r,e,n(e),o)}),r}function ir(e,t){return e&&Ti(t,Ls(t),e)}function or(e,t,n){"__proto__"==t&&st?st(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ar(t,n){for(var r=-1,i=n.length,o=_e(i),a=null==t;++r<i;)o[r]=a?e:Ms(t,n[r]);return o}function sr(t,n,r){return t==t&&(r!==e&&(t=t<=r?t:r),n!==e&&(t=t>=n?t:n)),t}function lr(t,n,r,i,o,a){var s,l=1&n,u=2&n,c=4&n;if(r&&(s=o?r(t,i,o,a):r(t)),s!==e)return s;if(!es(t))return t;var h=Wa(t);if(h){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Oe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!l)return Ei(t,s)}else{var d=go(t),p=d==w||d==b;if(Ya(t))return Si(t,l);if(d==S||d==f||p&&!o){if(s=u||p?{}:vo(t),!l)return u?function(e,t){return Ti(e,fo(e),t)}(t,function(e,t){return e&&Ti(t,Rs(t),e)}(s,t)):function(e,t){return Ti(e,po(e),t)}(t,ir(s,t))}else{if(!at[d])return o?t:{};s=function(e,t,n){var r,i=e.constructor;switch(t){case T:return Ai(e);case m:case v:return new i(+e);case L:return function(e,t){var n=t?Ai(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case R:case D:case F:case O:case N:case j:case I:case z:case B:return Pi(e,n);case _:return new i;case x:case C:return new i(e);case P:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case M:return new i;case k:return r=e,In?Me(In.call(r)):{}}}(t,d,l)}}a||(a=new $n);var g=a.get(t);if(g)return g;a.set(t,s),as(t)?t.forEach(function(e){s.add(lr(e,n,r,e,t,a))}):ns(t)&&t.forEach(function(e,i){s.set(i,lr(e,n,r,i,t,a))});var y=h?e:(c?u?io:ro:u?Rs:Ls)(t);return Mt(y||t,function(e,i){y&&(e=t[i=e]),tr(s,i,lr(e,n,r,i,t,a))}),s}function ur(t,n,r){var i=r.length;if(null==t)return!i;for(t=Me(t);i--;){var o=r[i],a=n[o],s=t[o];if(s===e&&!(o in t)||!a(s))return!1}return!0}function cr(n,r,i){if("function"!=typeof n)throw new Ee(t);return Lo(function(){n.apply(e,i)},r)}function hr(e,t,n,r){var i=-1,o=Tt,a=!0,s=e.length,l=[],u=t.length;if(!s)return l;n&&(t=Rt(t,Jt(n))),r?(o=Lt,a=!1):t.length>=200&&(o=Xt,a=!1,t=new Yn(t));e:for(;++i<s;){var c=e[i],h=null==n?c:n(c);if(c=r||0!==c?c:0,a&&h==h){for(var d=u;d--;)if(t[d]===h)continue e;l.push(c)}else o(t,h,r)||l.push(c)}return l}Bn.templateSettings={escape:Y,evaluate:$,interpolate:J,variable:"",imports:{_:Bn}},Bn.prototype=Hn.prototype,Bn.prototype.constructor=Bn,Gn.prototype=Un(Hn.prototype),Gn.prototype.constructor=Gn,Wn.prototype=Un(Hn.prototype),Wn.prototype.constructor=Wn,Vn.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},Vn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Vn.prototype.get=function(t){var r=this.__data__;if(En){var i=r[t];return i===n?e:i}return Oe.call(r,t)?r[t]:e},Vn.prototype.has=function(t){var n=this.__data__;return En?n[t]!==e:Oe.call(n,t)},Vn.prototype.set=function(t,r){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=En&&r===e?n:r,this},qn.prototype.clear=function(){this.__data__=[],this.size=0},qn.prototype.delete=function(e){var t=this.__data__,n=nr(t,e);return!(n<0||(n==t.length-1?t.pop():$e.call(t,n,1),--this.size,0))},qn.prototype.get=function(t){var n=this.__data__,r=nr(n,t);return r<0?e:n[r][1]},qn.prototype.has=function(e){return nr(this.__data__,e)>-1},qn.prototype.set=function(e,t){var n=this.__data__,r=nr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Zn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(Pn||qn),string:new Vn}},Zn.prototype.delete=function(e){var t=uo(this,e).delete(e);return this.size-=t?1:0,t},Zn.prototype.get=function(e){return uo(this,e).get(e)},Zn.prototype.has=function(e){return uo(this,e).has(e)},Zn.prototype.set=function(e,t){var n=uo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Yn.prototype.add=Yn.prototype.push=function(e){return this.__data__.set(e,n),this},Yn.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.clear=function(){this.__data__=new qn,this.size=0},$n.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},$n.prototype.get=function(e){return this.__data__.get(e)},$n.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.set=function(e,t){var n=this.__data__;if(n instanceof qn){var r=n.__data__;if(!Pn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Zn(r)}return n.set(e,t),this.size=n.size,this};var dr=Di(br),pr=Di(_r,!0);function fr(e,t){var n=!0;return dr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function gr(t,n,r){for(var i=-1,o=t.length;++i<o;){var a=t[i],s=n(a);if(null!=s&&(l===e?s==s&&!ls(s):r(s,l)))var l=s,u=a}return u}function mr(e,t){var n=[];return dr(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function vr(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=yo),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?vr(s,t-1,n,r,i):Dt(i,s):r||(i[i.length]=s)}return i}var yr=Fi(),wr=Fi(!0);function br(e,t){return e&&yr(e,t,Ls)}function _r(e,t){return e&&wr(e,t,Ls)}function xr(e,t){return Et(t,function(t){return Ka(e[t])})}function Sr(t,n){for(var r=0,i=(n=wi(n,t)).length;null!=t&&r<i;)t=t[jo(n[r++])];return r&&r==i?t:e}function Ar(e,t,n){var r=t(e);return Wa(e)?r:Dt(r,n(e))}function Pr(t){return null==t?t===e?"[object Undefined]":"[object Null]":tt&&tt in Me(t)?function(t){var n=Oe.call(t,tt),r=t[tt];try{t[tt]=e;var i=!0}catch(e){}var o=Ie.call(t);return i&&(n?t[tt]=r:delete t[tt]),o}(t):function(e){return Ie.call(e)}(t)}function Mr(e,t){return e>t}function Cr(e,t){return null!=e&&Oe.call(e,t)}function kr(e,t){return null!=e&&t in Me(e)}function Er(t,n,r){for(var i=r?Lt:Tt,o=t[0].length,a=t.length,s=a,l=_e(a),u=1/0,c=[];s--;){var h=t[s];s&&n&&(h=Rt(h,Jt(n))),u=wn(h.length,u),l[s]=!r&&(n||o>=120&&h.length>=120)?new Yn(s&&h):e}h=t[0];var d=-1,p=l[0];e:for(;++d<o&&c.length<u;){var f=h[d],g=n?n(f):f;if(f=r||0!==f?f:0,!(p?Xt(p,g):i(c,g,r))){for(s=a;--s;){var m=l[s];if(!(m?Xt(m,g):i(t[s],g,r)))continue e}p&&p.push(g),c.push(f)}}return c}function Tr(t,n,r){var i=null==(t=ko(t,n=wi(n,t)))?t:t[jo(Jo(n))];return null==i?e:At(i,t,r)}function Lr(e){return ts(e)&&Pr(e)==f}function Rr(t,n,r,i,o){return t===n||(null==t||null==n||!ts(t)&&!ts(n)?t!=t&&n!=n:function(t,n,r,i,o,a){var s=Wa(t),l=Wa(n),u=s?g:go(t),c=l?g:go(n),h=(u=u==f?S:u)==S,d=(c=c==f?S:c)==S,p=u==c;if(p&&Ya(t)){if(!Ya(n))return!1;s=!0,h=!1}if(p&&!h)return a||(a=new $n),s||us(t)?to(t,n,r,i,o,a):function(e,t,n,r,i,o,a){switch(n){case L:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case T:return!(e.byteLength!=t.byteLength||!o(new We(e),new We(t)));case m:case v:case x:return Ba(+e,+t);case y:return e.name==t.name&&e.message==t.message;case P:case C:return e==t+"";case _:var s=an;case M:var l=1&r;if(s||(s=un),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var c=to(s(e),s(t),r,i,o,a);return a.delete(e),c;case k:if(In)return In.call(e)==In.call(t)}return!1}(t,n,u,r,i,o,a);if(!(1&r)){var w=h&&Oe.call(t,"__wrapped__"),b=d&&Oe.call(n,"__wrapped__");if(w||b){var A=w?t.value():t,E=b?n.value():n;return a||(a=new $n),o(A,E,r,i,a)}}return!!p&&(a||(a=new $n),function(t,n,r,i,o,a){var s=1&r,l=ro(t),u=l.length,c=ro(n),h=c.length;if(u!=h&&!s)return!1;for(var d=u;d--;){var p=l[d];if(!(s?p in n:Oe.call(n,p)))return!1}var f=a.get(t),g=a.get(n);if(f&&g)return f==n&&g==t;var m=!0;a.set(t,n),a.set(n,t);for(var v=s;++d<u;){var y=t[p=l[d]],w=n[p];if(i)var b=s?i(w,y,p,n,t,a):i(y,w,p,t,n,a);if(!(b===e?y===w||o(y,w,r,i,a):b)){m=!1;break}v||(v="constructor"==p)}if(m&&!v){var _=t.constructor,x=n.constructor;_==x||!("constructor"in t)||!("constructor"in n)||"function"==typeof _&&_ instanceof _&&"function"==typeof x&&x instanceof x||(m=!1)}return a.delete(t),a.delete(n),m}(t,n,r,i,o,a))}(t,n,r,i,Rr,o))}function Dr(t,n,r,i){var o=r.length,a=o,s=!i;if(null==t)return!a;for(t=Me(t);o--;){var l=r[o];if(s&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++o<a;){var u=(l=r[o])[0],c=t[u],h=l[1];if(s&&l[2]){if(c===e&&!(u in t))return!1}else{var d=new $n;if(i)var p=i(c,h,u,t,n,d);if(!(p===e?Rr(h,c,3,i,d):p))return!1}}return!0}function Fr(e){return!(!es(e)||(t=e,je&&je in t))&&(Ka(e)?Ue:fe).test(Io(e));var t}function Or(e){return"function"==typeof e?e:null==e?rl:"object"==typeof e?Wa(e)?Ur(e[0],e[1]):Br(e):dl(e)}function Nr(e){if(!Ao(e))return vn(e);var t=[];for(var n in Me(e))Oe.call(e,n)&&"constructor"!=n&&t.push(n);return t}function jr(e){if(!es(e))return function(e){var t=[];if(null!=e)for(var n in Me(e))t.push(n);return t}(e);var t=Ao(e),n=[];for(var r in e)("constructor"!=r||!t&&Oe.call(e,r))&&n.push(r);return n}function Ir(e,t){return e<t}function zr(e,t){var n=-1,r=qa(e)?_e(e.length):[];return dr(e,function(e,i,o){r[++n]=t(e,i,o)}),r}function Br(e){var t=co(e);return 1==t.length&&t[0][2]?Mo(t[0][0],t[0][1]):function(n){return n===e||Dr(n,e,t)}}function Ur(t,n){return _o(t)&&Po(n)?Mo(jo(t),n):function(r){var i=Ms(r,t);return i===e&&i===n?Cs(r,t):Rr(n,i,3)}}function Hr(t,n,r,i,o){t!==n&&yr(n,function(a,s){if(o||(o=new $n),es(a))!function(t,n,r,i,o,a,s){var l=Eo(t,r),u=Eo(n,r),c=s.get(u);if(c)er(t,r,c);else{var h=a?a(l,u,r+"",t,n,s):e,d=h===e;if(d){var p=Wa(u),f=!p&&Ya(u),g=!p&&!f&&us(u);h=u,p||f||g?Wa(l)?h=l:Za(l)?h=Ei(l):f?(d=!1,h=Si(u,!0)):g?(d=!1,h=Pi(u,!0)):h=[]:is(u)||Ga(u)?(h=l,Ga(l)?h=vs(l):es(l)&&!Ka(l)||(h=vo(u))):d=!1}d&&(s.set(u,h),o(h,u,i,a,s),s.delete(u)),er(t,r,h)}}(t,n,s,r,Hr,i,o);else{var l=i?i(Eo(t,s),a,s+"",t,n,o):e;l===e&&(l=a),er(t,s,l)}},Rs)}function Gr(t,n){var r=t.length;if(r)return wo(n+=n<0?r:0,r)?t[n]:e}function Wr(e,t,n){t=t.length?Rt(t,function(e){return Wa(e)?function(t){return Sr(t,1===e.length?e[0]:e)}:e}):[rl];var r=-1;t=Rt(t,Jt(lo()));var i=zr(e,function(e,n,i){var o=Rt(t,function(t){return t(e)});return{criteria:o,index:++r,value:e}});return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(i,function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;++r<a;){var l=Mi(i[r],o[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)})}function Vr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=Sr(e,a);n(s,a)&&Qr(o,wi(a,e),s)}return o}function qr(e,t,n,r){var i=r?Ut:Bt,o=-1,a=t.length,s=e;for(e===t&&(t=Ei(t)),n&&(s=Rt(e,Jt(n)));++o<a;)for(var l=0,u=t[o],c=n?n(u):u;(l=i(s,c,l,r))>-1;)s!==e&&$e.call(s,l,1),$e.call(e,l,1);return e}function Zr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;wo(i)?$e.call(e,i,1):hi(e,i)}}return e}function Yr(e,t){return e+mt(xn()*(t-e+1))}function $r(e,t){var n="";if(!e||t<1||t>c)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Jr(e,t){return Ro(Co(e,t,rl),e+"")}function Kr(e){return Kn(Bs(e))}function Xr(e,t){var n=Bs(e);return Oo(n,sr(t,0,n.length))}function Qr(t,n,r,i){if(!es(t))return t;for(var o=-1,a=(n=wi(n,t)).length,s=a-1,l=t;null!=l&&++o<a;){var u=jo(n[o]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=s){var h=l[u];(c=i?i(h,u,l):e)===e&&(c=es(h)?h:wo(n[o+1])?[]:{})}tr(l,u,c),l=l[u]}return t}var ei=Tn?function(e,t){return Tn.set(e,t),e}:rl,ti=st?function(e,t){return st(e,"toString",{configurable:!0,enumerable:!1,value:el(t),writable:!0})}:rl;function ni(e){return Oo(Bs(e))}function ri(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=_e(i);++r<i;)o[r]=e[r+t];return o}function ii(e,t){var n;return dr(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function oi(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!ls(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return ai(e,t,rl,n)}function ai(t,n,r,i){var o=0,a=null==t?0:t.length;if(0===a)return 0;for(var s=(n=r(n))!=n,l=null===n,u=ls(n),c=n===e;o<a;){var h=mt((o+a)/2),d=r(t[h]),p=d!==e,f=null===d,g=d==d,m=ls(d);if(s)var v=i||g;else v=c?g&&(i||p):l?g&&p&&(i||!f):u?g&&p&&!f&&(i||!m):!f&&!m&&(i?d<=n:d<n);v?o=h+1:a=h}return wn(a,4294967294)}function si(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!Ba(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function li(e){return"number"==typeof e?e:ls(e)?h:+e}function ui(e){if("string"==typeof e)return e;if(Wa(e))return Rt(e,ui)+"";if(ls(e))return zn?zn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ci(e,t,n){var r=-1,i=Tt,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=Lt;else if(o>=200){var u=t?null:$i(e);if(u)return un(u);a=!1,i=Xt,l=new Yn}else l=t?[]:s;e:for(;++r<o;){var c=e[r],h=t?t(c):c;if(c=n||0!==c?c:0,a&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),s.push(c)}else i(l,h,n)||(l!==s&&l.push(h),s.push(c))}return s}function hi(e,t){return null==(e=ko(e,t=wi(t,e)))||delete e[jo(Jo(t))]}function di(e,t,n,r){return Qr(e,t,n(Sr(e,t)),r)}function pi(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?ri(e,r?0:o,r?o+1:i):ri(e,r?o+1:0,r?i:o)}function fi(e,t){var n=e;return n instanceof Wn&&(n=n.value()),Ft(t,function(e,t){return t.func.apply(t.thisArg,Dt([e],t.args))},n)}function gi(e,t,n){var r=e.length;if(r<2)return r?ci(e[0]):[];for(var i=-1,o=_e(r);++i<r;)for(var a=e[i],s=-1;++s<r;)s!=i&&(o[i]=hr(o[i]||a,e[s],t,n));return ci(vr(o,1),t,n)}function mi(t,n,r){for(var i=-1,o=t.length,a=n.length,s={};++i<o;){var l=i<a?n[i]:e;r(s,t[i],l)}return s}function vi(e){return Za(e)?e:[]}function yi(e){return"function"==typeof e?e:rl}function wi(e,t){return Wa(e)?e:_o(e,t)?[e]:No(ys(e))}var bi=Jr;function _i(t,n,r){var i=t.length;return r=r===e?i:r,!n&&r>=i?t:ri(t,n,r)}var xi=ct||function(e){return dt.clearTimeout(e)};function Si(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function Ai(e){var t=new e.constructor(e.byteLength);return new We(t).set(new We(e)),t}function Pi(e,t){var n=t?Ai(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Mi(t,n){if(t!==n){var r=t!==e,i=null===t,o=t==t,a=ls(t),s=n!==e,l=null===n,u=n==n,c=ls(n);if(!l&&!c&&!a&&t>n||a&&s&&u&&!l&&!c||i&&s&&u||!r&&u||!o)return 1;if(!i&&!a&&!c&&t<n||c&&r&&o&&!i&&!a||l&&r&&o||!s&&o||!u)return-1}return 0}function Ci(e,t,n,r){for(var i=-1,o=e.length,a=n.length,s=-1,l=t.length,u=yn(o-a,0),c=_e(l+u),h=!r;++s<l;)c[s]=t[s];for(;++i<a;)(h||i<o)&&(c[n[i]]=e[i]);for(;u--;)c[s++]=e[i++];return c}function ki(e,t,n,r){for(var i=-1,o=e.length,a=-1,s=n.length,l=-1,u=t.length,c=yn(o-s,0),h=_e(c+u),d=!r;++i<c;)h[i]=e[i];for(var p=i;++l<u;)h[p+l]=t[l];for(;++a<s;)(d||i<o)&&(h[p+n[a]]=e[i++]);return h}function Ei(e,t){var n=-1,r=e.length;for(t||(t=_e(r));++n<r;)t[n]=e[n];return t}function Ti(t,n,r,i){var o=!r;r||(r={});for(var a=-1,s=n.length;++a<s;){var l=n[a],u=i?i(r[l],t[l],l,r,t):e;u===e&&(u=t[l]),o?or(r,l,u):tr(r,l,u)}return r}function Li(e,t){return function(n,r){var i=Wa(n)?Pt:rr,o=t?t():{};return i(n,e,lo(r,2),o)}}function Ri(t){return Jr(function(n,r){var i=-1,o=r.length,a=o>1?r[o-1]:e,s=o>2?r[2]:e;for(a=t.length>3&&"function"==typeof a?(o--,a):e,s&&bo(r[0],r[1],s)&&(a=o<3?e:a,o=1),n=Me(n);++i<o;){var l=r[i];l&&t(n,l,i,a)}return n})}function Di(e,t){return function(n,r){if(null==n)return n;if(!qa(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Me(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Fi(e){return function(t,n,r){for(var i=-1,o=Me(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}function Oi(t){return function(n){var r=on(n=ys(n))?dn(n):e,i=r?r[0]:n.charAt(0),o=r?_i(r,1).join(""):n.slice(1);return i[t]()+o}}function Ni(e){return function(t){return Ft(Ks(Gs(t).replace(Ke,"")),e,"")}}function ji(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Un(e.prototype),r=e.apply(n,t);return es(r)?r:n}}function Ii(t){return function(n,r,i){var o=Me(n);if(!qa(n)){var a=lo(r,3);n=Ls(n),r=function(e){return a(o[e],e,o)}}var s=t(n,r,i);return s>-1?o[a?n[s]:s]:e}}function zi(n){return no(function(r){var i=r.length,o=i,a=Gn.prototype.thru;for(n&&r.reverse();o--;){var s=r[o];if("function"!=typeof s)throw new Ee(t);if(a&&!l&&"wrapper"==ao(s))var l=new Gn([],!0)}for(o=l?o:i;++o<i;){var u=ao(s=r[o]),c="wrapper"==u?oo(s):e;l=c&&xo(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[ao(c[0])].apply(l,c[3]):1==s.length&&xo(s)?l[u]():l.thru(s)}return function(){var e=arguments,t=e[0];if(l&&1==e.length&&Wa(t))return l.plant(t).value();for(var n=0,o=i?r[n].apply(this,e):t;++n<i;)o=r[n].call(this,o);return o}})}function Bi(t,n,r,i,o,a,l,u,c,h){var d=n&s,p=1&n,f=2&n,g=24&n,m=512&n,v=f?e:ji(t);return function s(){for(var y=arguments.length,w=_e(y),b=y;b--;)w[b]=arguments[b];if(g)var _=so(s),x=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(w,_);if(i&&(w=Ci(w,i,o,g)),a&&(w=ki(w,a,l,g)),y-=x,g&&y<h){var S=ln(w,_);return Zi(t,n,Bi,s.placeholder,r,w,S,u,c,h-y)}var A=p?r:this,P=f?A[t]:t;return y=w.length,u?w=function(t,n){for(var r=t.length,i=wn(n.length,r),o=Ei(t);i--;){var a=n[i];t[i]=wo(a,r)?o[a]:e}return t}(w,u):m&&y>1&&w.reverse(),d&&c<y&&(w.length=c),this&&this!==dt&&this instanceof s&&(P=v||ji(P)),P.apply(A,w)}}function Ui(e,t){return function(n,r){return function(e,t,n,r){return br(e,function(e,i,o){t(r,n(e),i,o)}),r}(n,e,t(r),{})}}function Hi(t,n){return function(r,i){var o;if(r===e&&i===e)return n;if(r!==e&&(o=r),i!==e){if(o===e)return i;"string"==typeof r||"string"==typeof i?(r=ui(r),i=ui(i)):(r=li(r),i=li(i)),o=t(r,i)}return o}}function Gi(e){return no(function(t){return t=Rt(t,Jt(lo())),Jr(function(n){var r=this;return e(t,function(e){return At(e,r,n)})})})}function Wi(t,n){var r=(n=n===e?" ":ui(n)).length;if(r<2)return r?$r(n,t):n;var i=$r(n,ft(t/hn(n)));return on(n)?_i(dn(i),0,t).join(""):i.slice(0,t)}function Vi(t){return function(n,r,i){return i&&"number"!=typeof i&&bo(n,r,i)&&(r=i=e),n=ps(n),r===e?(r=n,n=0):r=ps(r),function(e,t,n,r){for(var i=-1,o=yn(ft((t-e)/(n||1)),0),a=_e(o);o--;)a[r?o:++i]=e,e+=n;return a}(n,r,i=i===e?n<r?1:-1:ps(i),t)}}function qi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ms(t),n=ms(n)),e(t,n)}}function Zi(t,n,r,i,s,l,u,c,h,d){var p=8&n;n|=p?o:a,4&(n&=~(p?a:o))||(n&=-4);var f=[t,n,s,p?l:e,p?u:e,p?e:l,p?e:u,c,h,d],g=r.apply(e,f);return xo(t)&&To(g,f),g.placeholder=i,Do(g,t,n)}function Yi(e){var t=Pe[e];return function(e,n){if(e=ms(e),(n=null==n?0:wn(fs(n),292))&&Vt(e)){var r=(ys(e)+"e").split("e");return+((r=(ys(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var $i=Cn&&1/un(new Cn([,-0]))[1]==u?function(e){return new Cn(e)}:ll;function Ji(e){return function(t){var n=go(t);return n==_?an(t):n==M?cn(t):function(e,t){return Rt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Ki(n,u,c,h,d,p,f,g){var m=2&u;if(!m&&"function"!=typeof n)throw new Ee(t);var v=h?h.length:0;if(v||(u&=-97,h=d=e),f=f===e?f:yn(fs(f),0),g=g===e?g:fs(g),v-=d?d.length:0,u&a){var y=h,w=d;h=d=e}var b=m?e:oo(n),_=[n,u,c,h,d,y,w,p,f,g];if(b&&function(e,t){var n=e[1],i=t[1],o=n|i,a=o<131,u=i==s&&8==n||i==s&&n==l&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n;if(!a&&!u)return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var c=t[3];if(c){var h=e[3];e[3]=h?Ci(h,c,t[4]):c,e[4]=h?ln(e[3],r):t[4]}(c=t[5])&&(h=e[5],e[5]=h?ki(h,c,t[6]):c,e[6]=h?ln(e[5],r):t[6]),(c=t[7])&&(e[7]=c),i&s&&(e[8]=null==e[8]?t[8]:wn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(_,b),n=_[0],u=_[1],c=_[2],h=_[3],d=_[4],!(g=_[9]=_[9]===e?m?0:n.length:yn(_[9]-v,0))&&24&u&&(u&=-25),u&&1!=u)x=8==u||u==i?function(t,n,r){var i=ji(t);return function o(){for(var a=arguments.length,s=_e(a),l=a,u=so(o);l--;)s[l]=arguments[l];var c=a<3&&s[0]!==u&&s[a-1]!==u?[]:ln(s,u);return(a-=c.length)<r?Zi(t,n,Bi,o.placeholder,e,s,c,e,e,r-a):At(this&&this!==dt&&this instanceof o?i:t,this,s)}}(n,u,g):u!=o&&33!=u||d.length?Bi.apply(e,_):function(e,t,n,r){var i=1&t,o=ji(e);return function t(){for(var a=-1,s=arguments.length,l=-1,u=r.length,c=_e(u+s),h=this&&this!==dt&&this instanceof t?o:e;++l<u;)c[l]=r[l];for(;s--;)c[l++]=arguments[++a];return At(h,i?n:this,c)}}(n,u,c,h);else var x=function(e,t,n){var r=1&t,i=ji(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(n,u,c);return Do((b?ei:To)(x,_),n,u)}function Xi(t,n,r,i){return t===e||Ba(t,Re[r])&&!Oe.call(i,r)?n:t}function Qi(t,n,r,i,o,a){return es(t)&&es(n)&&(a.set(n,t),Hr(t,n,e,Qi,a),a.delete(n)),t}function eo(t){return is(t)?e:t}function to(t,n,r,i,o,a){var s=1&r,l=t.length,u=n.length;if(l!=u&&!(s&&u>l))return!1;var c=a.get(t),h=a.get(n);if(c&&h)return c==n&&h==t;var d=-1,p=!0,f=2&r?new Yn:e;for(a.set(t,n),a.set(n,t);++d<l;){var g=t[d],m=n[d];if(i)var v=s?i(m,g,d,n,t,a):i(g,m,d,t,n,a);if(v!==e){if(v)continue;p=!1;break}if(f){if(!Nt(n,function(e,t){if(!Xt(f,t)&&(g===e||o(g,e,r,i,a)))return f.push(t)})){p=!1;break}}else if(g!==m&&!o(g,m,r,i,a)){p=!1;break}}return a.delete(t),a.delete(n),p}function no(t){return Ro(Co(t,e,Vo),t+"")}function ro(e){return Ar(e,Ls,po)}function io(e){return Ar(e,Rs,fo)}var oo=Tn?function(e){return Tn.get(e)}:ll;function ao(e){for(var t=e.name+"",n=Ln[t],r=Oe.call(Ln,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function so(e){return(Oe.call(Bn,"placeholder")?Bn:e).placeholder}function lo(){var e=Bn.iteratee||il;return e=e===il?Or:e,arguments.length?e(arguments[0],arguments[1]):e}function uo(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function co(e){for(var t=Ls(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Po(i)]}return t}function ho(t,n){var r=function(t,n){return null==t?e:t[n]}(t,n);return Fr(r)?r:e}var po=vt?function(e){return null==e?[]:(e=Me(e),Et(vt(e),function(t){return Ye.call(e,t)}))}:gl,fo=vt?function(e){for(var t=[];e;)Dt(t,po(e)),e=qe(e);return t}:gl,go=Pr;function mo(e,t,n){for(var r=-1,i=(t=wi(t,e)).length,o=!1;++r<i;){var a=jo(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Qa(i)&&wo(a,i)&&(Wa(e)||Ga(e))}function vo(e){return"function"!=typeof e.constructor||Ao(e)?{}:Un(qe(e))}function yo(e){return Wa(e)||Ga(e)||!!(Je&&e&&e[Je])}function wo(e,t){var n=typeof e;return!!(t=null==t?c:t)&&("number"==n||"symbol"!=n&&me.test(e))&&e>-1&&e%1==0&&e<t}function bo(e,t,n){if(!es(n))return!1;var r=typeof t;return!!("number"==r?qa(n)&&wo(t,n.length):"string"==r&&t in n)&&Ba(n[t],e)}function _o(e,t){if(Wa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ls(e))||X.test(e)||!K.test(e)||null!=t&&e in Me(t)}function xo(e){var t=ao(e),n=Bn[t];if("function"!=typeof n||!(t in Wn.prototype))return!1;if(e===n)return!0;var r=oo(n);return!!r&&e===r[0]}(An&&go(new An(new ArrayBuffer(1)))!=L||Pn&&go(new Pn)!=_||Mn&&go(Mn.resolve())!=A||Cn&&go(new Cn)!=M||kn&&go(new kn)!=E)&&(go=function(t){var n=Pr(t),r=n==S?t.constructor:e,i=r?Io(r):"";if(i)switch(i){case Rn:return L;case Dn:return _;case Fn:return A;case On:return M;case Nn:return E}return n});var So=De?Ka:ml;function Ao(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Re)}function Po(e){return e==e&&!es(e)}function Mo(t,n){return function(r){return null!=r&&r[t]===n&&(n!==e||t in Me(r))}}function Co(t,n,r){return n=yn(n===e?t.length-1:n,0),function(){for(var e=arguments,i=-1,o=yn(e.length-n,0),a=_e(o);++i<o;)a[i]=e[n+i];i=-1;for(var s=_e(n+1);++i<n;)s[i]=e[i];return s[n]=r(a),At(t,this,s)}}function ko(e,t){return t.length<2?e:Sr(e,ri(t,0,-1))}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var To=Fo(ei),Lo=pt||function(e,t){return dt.setTimeout(e,t)},Ro=Fo(ti);function Do(e,t,n){var r=t+"";return Ro(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ie,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Mt(p,function(n){var r="_."+n[0];t&n[1]&&!Tt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(ae):[]}(r),n)))}function Fo(t){var n=0,r=0;return function(){var i=bn(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(e,arguments)}}function Oo(t,n){var r=-1,i=t.length,o=i-1;for(n=n===e?i:n;++r<n;){var a=Yr(r,o),s=t[a];t[a]=t[r],t[r]=s}return t.length=n,t}var No=function(e){var t=Fa(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Q,function(e,n,r,i){t.push(r?i.replace(ue,"$1"):n||e)}),t});function jo(e){if("string"==typeof e||ls(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Io(e){if(null!=e){try{return Fe.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function zo(e){if(e instanceof Wn)return e.clone();var t=new Gn(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Bo=Jr(function(e,t){return Za(e)?hr(e,vr(t,1,Za,!0)):[]}),Uo=Jr(function(t,n){var r=Jo(n);return Za(r)&&(r=e),Za(t)?hr(t,vr(n,1,Za,!0),lo(r,2)):[]}),Ho=Jr(function(t,n){var r=Jo(n);return Za(r)&&(r=e),Za(t)?hr(t,vr(n,1,Za,!0),e,r):[]});function Go(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:fs(n);return i<0&&(i=yn(r+i,0)),zt(e,lo(t,3),i)}function Wo(t,n,r){var i=null==t?0:t.length;if(!i)return-1;var o=i-1;return r!==e&&(o=fs(r),o=r<0?yn(i+o,0):wn(o,i-1)),zt(t,lo(n,3),o,!0)}function Vo(e){return null!=e&&e.length?vr(e,1):[]}function qo(t){return t&&t.length?t[0]:e}var Zo=Jr(function(e){var t=Rt(e,vi);return t.length&&t[0]===e[0]?Er(t):[]}),Yo=Jr(function(t){var n=Jo(t),r=Rt(t,vi);return n===Jo(r)?n=e:r.pop(),r.length&&r[0]===t[0]?Er(r,lo(n,2)):[]}),$o=Jr(function(t){var n=Jo(t),r=Rt(t,vi);return(n="function"==typeof n?n:e)&&r.pop(),r.length&&r[0]===t[0]?Er(r,e,n):[]});function Jo(t){var n=null==t?0:t.length;return n?t[n-1]:e}var Ko=Jr(Xo);function Xo(e,t){return e&&e.length&&t&&t.length?qr(e,t):e}var Qo=no(function(e,t){var n=null==e?0:e.length,r=ar(e,t);return Zr(e,Rt(t,function(e){return wo(e,n)?+e:e}).sort(Mi)),r});function ea(e){return null==e?e:Sn.call(e)}var ta=Jr(function(e){return ci(vr(e,1,Za,!0))}),na=Jr(function(t){var n=Jo(t);return Za(n)&&(n=e),ci(vr(t,1,Za,!0),lo(n,2))}),ra=Jr(function(t){var n=Jo(t);return n="function"==typeof n?n:e,ci(vr(t,1,Za,!0),e,n)});function ia(e){if(!e||!e.length)return[];var t=0;return e=Et(e,function(e){if(Za(e))return t=yn(e.length,t),!0}),Yt(t,function(t){return Rt(e,Wt(t))})}function oa(t,n){if(!t||!t.length)return[];var r=ia(t);return null==n?r:Rt(r,function(t){return At(n,e,t)})}var aa=Jr(function(e,t){return Za(e)?hr(e,t):[]}),sa=Jr(function(e){return gi(Et(e,Za))}),la=Jr(function(t){var n=Jo(t);return Za(n)&&(n=e),gi(Et(t,Za),lo(n,2))}),ua=Jr(function(t){var n=Jo(t);return n="function"==typeof n?n:e,gi(Et(t,Za),e,n)}),ca=Jr(ia),ha=Jr(function(t){var n=t.length,r=n>1?t[n-1]:e;return r="function"==typeof r?(t.pop(),r):e,oa(t,r)});function da(e){var t=Bn(e);return t.__chain__=!0,t}function pa(e,t){return t(e)}var fa=no(function(t){var n=t.length,r=n?t[0]:0,i=this.__wrapped__,o=function(e){return ar(e,t)};return!(n>1||this.__actions__.length)&&i instanceof Wn&&wo(r)?((i=i.slice(r,+r+(n?1:0))).__actions__.push({func:pa,args:[o],thisArg:e}),new Gn(i,this.__chain__).thru(function(t){return n&&!t.length&&t.push(e),t})):this.thru(o)}),ga=Li(function(e,t,n){Oe.call(e,n)?++e[n]:or(e,n,1)}),ma=Ii(Go),va=Ii(Wo);function ya(e,t){return(Wa(e)?Mt:dr)(e,lo(t,3))}function wa(e,t){return(Wa(e)?Ct:pr)(e,lo(t,3))}var ba=Li(function(e,t,n){Oe.call(e,n)?e[n].push(t):or(e,n,[t])}),_a=Jr(function(e,t,n){var r=-1,i="function"==typeof t,o=qa(e)?_e(e.length):[];return dr(e,function(e){o[++r]=i?At(t,e,n):Tr(e,t,n)}),o}),xa=Li(function(e,t,n){or(e,n,t)});function Sa(e,t){return(Wa(e)?Rt:zr)(e,lo(t,3))}var Aa=Li(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),Pa=Jr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&bo(e,t[0],t[1])?t=[]:n>2&&bo(t[0],t[1],t[2])&&(t=[t[0]]),Wr(e,vr(t,1),[])}),Ma=ht||function(){return dt.Date.now()};function Ca(t,n,r){return n=r?e:n,n=t&&null==n?t.length:n,Ki(t,s,e,e,e,e,n)}function ka(n,r){var i;if("function"!=typeof r)throw new Ee(t);return n=fs(n),function(){return--n>0&&(i=r.apply(this,arguments)),n<=1&&(r=e),i}}var Ea=Jr(function(e,t,n){var r=1;if(n.length){var i=ln(n,so(Ea));r|=o}return Ki(e,r,t,n,i)}),Ta=Jr(function(e,t,n){var r=3;if(n.length){var i=ln(n,so(Ta));r|=o}return Ki(t,r,e,n,i)});function La(n,r,i){var o,a,s,l,u,c,h=0,d=!1,p=!1,f=!0;if("function"!=typeof n)throw new Ee(t);function g(t){var r=o,i=a;return o=a=e,h=t,l=n.apply(i,r)}function m(t){var n=t-c;return c===e||n>=r||n<0||p&&t-h>=s}function v(){var e=Ma();if(m(e))return y(e);u=Lo(v,function(e){var t=r-(e-c);return p?wn(t,s-(e-h)):t}(e))}function y(t){return u=e,f&&o?g(t):(o=a=e,l)}function w(){var t=Ma(),n=m(t);if(o=arguments,a=this,c=t,n){if(u===e)return function(e){return h=e,u=Lo(v,r),d?g(e):l}(c);if(p)return xi(u),u=Lo(v,r),g(c)}return u===e&&(u=Lo(v,r)),l}return r=ms(r)||0,es(i)&&(d=!!i.leading,s=(p="maxWait"in i)?yn(ms(i.maxWait)||0,r):s,f="trailing"in i?!!i.trailing:f),w.cancel=function(){u!==e&&xi(u),h=0,o=c=a=u=e},w.flush=function(){return u===e?l:y(Ma())},w}var Ra=Jr(function(e,t){return cr(e,1,t)}),Da=Jr(function(e,t,n){return cr(e,ms(t)||0,n)});function Fa(e,n){if("function"!=typeof e||null!=n&&"function"!=typeof n)throw new Ee(t);var r=function(){var t=arguments,i=n?n.apply(this,t):t[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,t);return r.cache=o.set(i,a)||o,a};return r.cache=new(Fa.Cache||Zn),r}function Oa(e){if("function"!=typeof e)throw new Ee(t);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Fa.Cache=Zn;var Na=bi(function(e,t){var n=(t=1==t.length&&Wa(t[0])?Rt(t[0],Jt(lo())):Rt(vr(t,1),Jt(lo()))).length;return Jr(function(r){for(var i=-1,o=wn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return At(e,this,r)})}),ja=Jr(function(t,n){var r=ln(n,so(ja));return Ki(t,o,e,n,r)}),Ia=Jr(function(t,n){var r=ln(n,so(Ia));return Ki(t,a,e,n,r)}),za=no(function(t,n){return Ki(t,l,e,e,e,n)});function Ba(e,t){return e===t||e!=e&&t!=t}var Ua=qi(Mr),Ha=qi(function(e,t){return e>=t}),Ga=Lr(function(){return arguments}())?Lr:function(e){return ts(e)&&Oe.call(e,"callee")&&!Ye.call(e,"callee")},Wa=_e.isArray,Va=yt?Jt(yt):function(e){return ts(e)&&Pr(e)==T};function qa(e){return null!=e&&Qa(e.length)&&!Ka(e)}function Za(e){return ts(e)&&qa(e)}var Ya=jt||ml,$a=wt?Jt(wt):function(e){return ts(e)&&Pr(e)==v};function Ja(e){if(!ts(e))return!1;var t=Pr(e);return t==y||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!is(e)}function Ka(e){if(!es(e))return!1;var t=Pr(e);return t==w||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Xa(e){return"number"==typeof e&&e==fs(e)}function Qa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=c}function es(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ts(e){return null!=e&&"object"==typeof e}var ns=bt?Jt(bt):function(e){return ts(e)&&go(e)==_};function rs(e){return"number"==typeof e||ts(e)&&Pr(e)==x}function is(e){if(!ts(e)||Pr(e)!=S)return!1;var t=qe(e);if(null===t)return!0;var n=Oe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Fe.call(n)==ze}var os=_t?Jt(_t):function(e){return ts(e)&&Pr(e)==P},as=xt?Jt(xt):function(e){return ts(e)&&go(e)==M};function ss(e){return"string"==typeof e||!Wa(e)&&ts(e)&&Pr(e)==C}function ls(e){return"symbol"==typeof e||ts(e)&&Pr(e)==k}var us=St?Jt(St):function(e){return ts(e)&&Qa(e.length)&&!!ot[Pr(e)]},cs=qi(Ir),hs=qi(function(e,t){return e<=t});function ds(e){if(!e)return[];if(qa(e))return ss(e)?dn(e):Ei(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=go(e);return(t==_?an:t==M?un:Bs)(e)}function ps(e){return e?(e=ms(e))===u||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fs(e){var t=ps(e),n=t%1;return t==t?n?t-n:t:0}function gs(e){return e?sr(fs(e),0,d):0}function ms(e){if("number"==typeof e)return e;if(ls(e))return h;if(es(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=es(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=$t(e);var n=pe.test(e);return n||ge.test(e)?ut(e.slice(2),n?2:8):de.test(e)?h:+e}function vs(e){return Ti(e,Rs(e))}function ys(e){return null==e?"":ui(e)}var ws=Ri(function(e,t){if(Ao(t)||qa(t))Ti(t,Ls(t),e);else for(var n in t)Oe.call(t,n)&&tr(e,n,t[n])}),bs=Ri(function(e,t){Ti(t,Rs(t),e)}),_s=Ri(function(e,t,n,r){Ti(t,Rs(t),e,r)}),xs=Ri(function(e,t,n,r){Ti(t,Ls(t),e,r)}),Ss=no(ar),As=Jr(function(t,n){t=Me(t);var r=-1,i=n.length,o=i>2?n[2]:e;for(o&&bo(n[0],n[1],o)&&(i=1);++r<i;)for(var a=n[r],s=Rs(a),l=-1,u=s.length;++l<u;){var c=s[l],h=t[c];(h===e||Ba(h,Re[c])&&!Oe.call(t,c))&&(t[c]=a[c])}return t}),Ps=Jr(function(t){return t.push(e,Qi),At(Fs,e,t)});function Ms(t,n,r){var i=null==t?e:Sr(t,n);return i===e?r:i}function Cs(e,t){return null!=e&&mo(e,t,kr)}var ks=Ui(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ie.call(t)),e[t]=n},el(rl)),Es=Ui(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ie.call(t)),Oe.call(e,t)?e[t].push(n):e[t]=[n]},lo),Ts=Jr(Tr);function Ls(e){return qa(e)?Jn(e):Nr(e)}function Rs(e){return qa(e)?Jn(e,!0):jr(e)}var Ds=Ri(function(e,t,n){Hr(e,t,n)}),Fs=Ri(function(e,t,n,r){Hr(e,t,n,r)}),Os=no(function(e,t){var n={};if(null==e)return n;var r=!1;t=Rt(t,function(t){return t=wi(t,e),r||(r=t.length>1),t}),Ti(e,io(e),n),r&&(n=lr(n,7,eo));for(var i=t.length;i--;)hi(n,t[i]);return n}),Ns=no(function(e,t){return null==e?{}:function(e,t){return Vr(e,t,function(t,n){return Cs(e,n)})}(e,t)});function js(e,t){if(null==e)return{};var n=Rt(io(e),function(e){return[e]});return t=lo(t),Vr(e,n,function(e,n){return t(e,n[0])})}var Is=Ji(Ls),zs=Ji(Rs);function Bs(e){return null==e?[]:Kt(e,Ls(e))}var Us=Ni(function(e,t,n){return t=t.toLowerCase(),e+(n?Hs(t):t)});function Hs(e){return Js(ys(e).toLowerCase())}function Gs(e){return(e=ys(e))&&e.replace(ve,tn).replace(Xe,"")}var Ws=Ni(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Vs=Ni(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),qs=Oi("toLowerCase"),Zs=Ni(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ys=Ni(function(e,t,n){return e+(n?" ":"")+Js(t)}),$s=Ni(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Js=Oi("toUpperCase");function Ks(t,n,r){return t=ys(t),(n=r?e:n)===e?function(e){return nt.test(e)}(t)?function(e){return e.match(et)||[]}(t):function(e){return e.match(se)||[]}(t):t.match(n)||[]}var Xs=Jr(function(t,n){try{return At(t,e,n)}catch(e){return Ja(e)?e:new Se(e)}}),Qs=no(function(e,t){return Mt(t,function(t){t=jo(t),or(e,t,Ea(e[t],e))}),e});function el(e){return function(){return e}}var tl=zi(),nl=zi(!0);function rl(e){return e}function il(e){return Or("function"==typeof e?e:lr(e,1))}var ol=Jr(function(e,t){return function(n){return Tr(n,e,t)}}),al=Jr(function(e,t){return function(n){return Tr(e,n,t)}});function sl(e,t,n){var r=Ls(t),i=xr(t,r);null!=n||es(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=xr(t,Ls(t)));var o=!(es(n)&&"chain"in n&&!n.chain),a=Ka(e);return Mt(i,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Ei(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Dt([this.value()],arguments))})}),e}function ll(){}var ul=Gi(Rt),cl=Gi(kt),hl=Gi(Nt);function dl(e){return _o(e)?Wt(jo(e)):function(e){return function(t){return Sr(t,e)}}(e)}var pl=Vi(),fl=Vi(!0);function gl(){return[]}function ml(){return!1}var vl,yl=Hi(function(e,t){return e+t},0),wl=Yi("ceil"),bl=Hi(function(e,t){return e/t},1),_l=Yi("floor"),xl=Hi(function(e,t){return e*t},1),Sl=Yi("round"),Al=Hi(function(e,t){return e-t},0);return Bn.after=function(e,n){if("function"!=typeof n)throw new Ee(t);return e=fs(e),function(){if(--e<1)return n.apply(this,arguments)}},Bn.ary=Ca,Bn.assign=ws,Bn.assignIn=bs,Bn.assignInWith=_s,Bn.assignWith=xs,Bn.at=Ss,Bn.before=ka,Bn.bind=Ea,Bn.bindAll=Qs,Bn.bindKey=Ta,Bn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Wa(e)?e:[e]},Bn.chain=da,Bn.chunk=function(t,n,r){n=(r?bo(t,n,r):n===e)?1:yn(fs(n),0);var i=null==t?0:t.length;if(!i||n<1)return[];for(var o=0,a=0,s=_e(ft(i/n));o<i;)s[a++]=ri(t,o,o+=n);return s},Bn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Bn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=_e(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Dt(Wa(n)?Ei(n):[n],vr(t,1))},Bn.cond=function(e){var n=null==e?0:e.length,r=lo();return e=n?Rt(e,function(e){if("function"!=typeof e[1])throw new Ee(t);return[r(e[0]),e[1]]}):[],Jr(function(t){for(var r=-1;++r<n;){var i=e[r];if(At(i[0],this,t))return At(i[1],this,t)}})},Bn.conforms=function(e){return function(e){var t=Ls(e);return function(n){return ur(n,e,t)}}(lr(e,1))},Bn.constant=el,Bn.countBy=ga,Bn.create=function(e,t){var n=Un(e);return null==t?n:ir(n,t)},Bn.curry=function t(n,r,i){var o=Ki(n,8,e,e,e,e,e,r=i?e:r);return o.placeholder=t.placeholder,o},Bn.curryRight=function t(n,r,o){var a=Ki(n,i,e,e,e,e,e,r=o?e:r);return a.placeholder=t.placeholder,a},Bn.debounce=La,Bn.defaults=As,Bn.defaultsDeep=Ps,Bn.defer=Ra,Bn.delay=Da,Bn.difference=Bo,Bn.differenceBy=Uo,Bn.differenceWith=Ho,Bn.drop=function(t,n,r){var i=null==t?0:t.length;return i?ri(t,(n=r||n===e?1:fs(n))<0?0:n,i):[]},Bn.dropRight=function(t,n,r){var i=null==t?0:t.length;return i?ri(t,0,(n=i-(n=r||n===e?1:fs(n)))<0?0:n):[]},Bn.dropRightWhile=function(e,t){return e&&e.length?pi(e,lo(t,3),!0,!0):[]},Bn.dropWhile=function(e,t){return e&&e.length?pi(e,lo(t,3),!0):[]},Bn.fill=function(t,n,r,i){var o=null==t?0:t.length;return o?(r&&"number"!=typeof r&&bo(t,n,r)&&(r=0,i=o),function(t,n,r,i){var o=t.length;for((r=fs(r))<0&&(r=-r>o?0:o+r),(i=i===e||i>o?o:fs(i))<0&&(i+=o),i=r>i?0:gs(i);r<i;)t[r++]=n;return t}(t,n,r,i)):[]},Bn.filter=function(e,t){return(Wa(e)?Et:mr)(e,lo(t,3))},Bn.flatMap=function(e,t){return vr(Sa(e,t),1)},Bn.flatMapDeep=function(e,t){return vr(Sa(e,t),u)},Bn.flatMapDepth=function(t,n,r){return r=r===e?1:fs(r),vr(Sa(t,n),r)},Bn.flatten=Vo,Bn.flattenDeep=function(e){return null!=e&&e.length?vr(e,u):[]},Bn.flattenDepth=function(t,n){return null!=t&&t.length?vr(t,n=n===e?1:fs(n)):[]},Bn.flip=function(e){return Ki(e,512)},Bn.flow=tl,Bn.flowRight=nl,Bn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Bn.functions=function(e){return null==e?[]:xr(e,Ls(e))},Bn.functionsIn=function(e){return null==e?[]:xr(e,Rs(e))},Bn.groupBy=ba,Bn.initial=function(e){return null!=e&&e.length?ri(e,0,-1):[]},Bn.intersection=Zo,Bn.intersectionBy=Yo,Bn.intersectionWith=$o,Bn.invert=ks,Bn.invertBy=Es,Bn.invokeMap=_a,Bn.iteratee=il,Bn.keyBy=xa,Bn.keys=Ls,Bn.keysIn=Rs,Bn.map=Sa,Bn.mapKeys=function(e,t){var n={};return t=lo(t,3),br(e,function(e,r,i){or(n,t(e,r,i),e)}),n},Bn.mapValues=function(e,t){var n={};return t=lo(t,3),br(e,function(e,r,i){or(n,r,t(e,r,i))}),n},Bn.matches=function(e){return Br(lr(e,1))},Bn.matchesProperty=function(e,t){return Ur(e,lr(t,1))},Bn.memoize=Fa,Bn.merge=Ds,Bn.mergeWith=Fs,Bn.method=ol,Bn.methodOf=al,Bn.mixin=sl,Bn.negate=Oa,Bn.nthArg=function(e){return e=fs(e),Jr(function(t){return Gr(t,e)})},Bn.omit=Os,Bn.omitBy=function(e,t){return js(e,Oa(lo(t)))},Bn.once=function(e){return ka(2,e)},Bn.orderBy=function(t,n,r,i){return null==t?[]:(Wa(n)||(n=null==n?[]:[n]),Wa(r=i?e:r)||(r=null==r?[]:[r]),Wr(t,n,r))},Bn.over=ul,Bn.overArgs=Na,Bn.overEvery=cl,Bn.overSome=hl,Bn.partial=ja,Bn.partialRight=Ia,Bn.partition=Aa,Bn.pick=Ns,Bn.pickBy=js,Bn.property=dl,Bn.propertyOf=function(t){return function(n){return null==t?e:Sr(t,n)}},Bn.pull=Ko,Bn.pullAll=Xo,Bn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?qr(e,t,lo(n,2)):e},Bn.pullAllWith=function(t,n,r){return t&&t.length&&n&&n.length?qr(t,n,e,r):t},Bn.pullAt=Qo,Bn.range=pl,Bn.rangeRight=fl,Bn.rearg=za,Bn.reject=function(e,t){return(Wa(e)?Et:mr)(e,Oa(lo(t,3)))},Bn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=lo(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return Zr(e,i),n},Bn.rest=function(n,r){if("function"!=typeof n)throw new Ee(t);return Jr(n,r=r===e?r:fs(r))},Bn.reverse=ea,Bn.sampleSize=function(t,n,r){return n=(r?bo(t,n,r):n===e)?1:fs(n),(Wa(t)?Xn:Xr)(t,n)},Bn.set=function(e,t,n){return null==e?e:Qr(e,t,n)},Bn.setWith=function(t,n,r,i){return i="function"==typeof i?i:e,null==t?t:Qr(t,n,r,i)},Bn.shuffle=function(e){return(Wa(e)?Qn:ni)(e)},Bn.slice=function(t,n,r){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&bo(t,n,r)?(n=0,r=i):(n=null==n?0:fs(n),r=r===e?i:fs(r)),ri(t,n,r)):[]},Bn.sortBy=Pa,Bn.sortedUniq=function(e){return e&&e.length?si(e):[]},Bn.sortedUniqBy=function(e,t){return e&&e.length?si(e,lo(t,2)):[]},Bn.split=function(t,n,r){return r&&"number"!=typeof r&&bo(t,n,r)&&(n=r=e),(r=r===e?d:r>>>0)?(t=ys(t))&&("string"==typeof n||null!=n&&!os(n))&&!(n=ui(n))&&on(t)?_i(dn(t),0,r):t.split(n,r):[]},Bn.spread=function(e,n){if("function"!=typeof e)throw new Ee(t);return n=null==n?0:yn(fs(n),0),Jr(function(t){var r=t[n],i=_i(t,0,n);return r&&Dt(i,r),At(e,this,i)})},Bn.tail=function(e){var t=null==e?0:e.length;return t?ri(e,1,t):[]},Bn.take=function(t,n,r){return t&&t.length?ri(t,0,(n=r||n===e?1:fs(n))<0?0:n):[]},Bn.takeRight=function(t,n,r){var i=null==t?0:t.length;return i?ri(t,(n=i-(n=r||n===e?1:fs(n)))<0?0:n,i):[]},Bn.takeRightWhile=function(e,t){return e&&e.length?pi(e,lo(t,3),!1,!0):[]},Bn.takeWhile=function(e,t){return e&&e.length?pi(e,lo(t,3)):[]},Bn.tap=function(e,t){return t(e),e},Bn.throttle=function(e,n,r){var i=!0,o=!0;if("function"!=typeof e)throw new Ee(t);return es(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),La(e,n,{leading:i,maxWait:n,trailing:o})},Bn.thru=pa,Bn.toArray=ds,Bn.toPairs=Is,Bn.toPairsIn=zs,Bn.toPath=function(e){return Wa(e)?Rt(e,jo):ls(e)?[e]:Ei(No(ys(e)))},Bn.toPlainObject=vs,Bn.transform=function(e,t,n){var r=Wa(e),i=r||Ya(e)||us(e);if(t=lo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:es(e)&&Ka(o)?Un(qe(e)):{}}return(i?Mt:br)(e,function(e,r,i){return t(n,e,r,i)}),n},Bn.unary=function(e){return Ca(e,1)},Bn.union=ta,Bn.unionBy=na,Bn.unionWith=ra,Bn.uniq=function(e){return e&&e.length?ci(e):[]},Bn.uniqBy=function(e,t){return e&&e.length?ci(e,lo(t,2)):[]},Bn.uniqWith=function(t,n){return n="function"==typeof n?n:e,t&&t.length?ci(t,e,n):[]},Bn.unset=function(e,t){return null==e||hi(e,t)},Bn.unzip=ia,Bn.unzipWith=oa,Bn.update=function(e,t,n){return null==e?e:di(e,t,yi(n))},Bn.updateWith=function(t,n,r,i){return i="function"==typeof i?i:e,null==t?t:di(t,n,yi(r),i)},Bn.values=Bs,Bn.valuesIn=function(e){return null==e?[]:Kt(e,Rs(e))},Bn.without=aa,Bn.words=Ks,Bn.wrap=function(e,t){return ja(yi(t),e)},Bn.xor=sa,Bn.xorBy=la,Bn.xorWith=ua,Bn.zip=ca,Bn.zipObject=function(e,t){return mi(e||[],t||[],tr)},Bn.zipObjectDeep=function(e,t){return mi(e||[],t||[],Qr)},Bn.zipWith=ha,Bn.entries=Is,Bn.entriesIn=zs,Bn.extend=bs,Bn.extendWith=_s,sl(Bn,Bn),Bn.add=yl,Bn.attempt=Xs,Bn.camelCase=Us,Bn.capitalize=Hs,Bn.ceil=wl,Bn.clamp=function(t,n,r){return r===e&&(r=n,n=e),r!==e&&(r=(r=ms(r))==r?r:0),n!==e&&(n=(n=ms(n))==n?n:0),sr(ms(t),n,r)},Bn.clone=function(e){return lr(e,4)},Bn.cloneDeep=function(e){return lr(e,5)},Bn.cloneDeepWith=function(t,n){return lr(t,5,n="function"==typeof n?n:e)},Bn.cloneWith=function(t,n){return lr(t,4,n="function"==typeof n?n:e)},Bn.conformsTo=function(e,t){return null==t||ur(e,t,Ls(t))},Bn.deburr=Gs,Bn.defaultTo=function(e,t){return null==e||e!=e?t:e},Bn.divide=bl,Bn.endsWith=function(t,n,r){t=ys(t),n=ui(n);var i=t.length,o=r=r===e?i:sr(fs(r),0,i);return(r-=n.length)>=0&&t.slice(r,o)==n},Bn.eq=Ba,Bn.escape=function(e){return(e=ys(e))&&Z.test(e)?e.replace(V,nn):e},Bn.escapeRegExp=function(e){return(e=ys(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Bn.every=function(t,n,r){var i=Wa(t)?kt:fr;return r&&bo(t,n,r)&&(n=e),i(t,lo(n,3))},Bn.find=ma,Bn.findIndex=Go,Bn.findKey=function(e,t){return It(e,lo(t,3),br)},Bn.findLast=va,Bn.findLastIndex=Wo,Bn.findLastKey=function(e,t){return It(e,lo(t,3),_r)},Bn.floor=_l,Bn.forEach=ya,Bn.forEachRight=wa,Bn.forIn=function(e,t){return null==e?e:yr(e,lo(t,3),Rs)},Bn.forInRight=function(e,t){return null==e?e:wr(e,lo(t,3),Rs)},Bn.forOwn=function(e,t){return e&&br(e,lo(t,3))},Bn.forOwnRight=function(e,t){return e&&_r(e,lo(t,3))},Bn.get=Ms,Bn.gt=Ua,Bn.gte=Ha,Bn.has=function(e,t){return null!=e&&mo(e,t,Cr)},Bn.hasIn=Cs,Bn.head=qo,Bn.identity=rl,Bn.includes=function(e,t,n,r){e=qa(e)?e:Bs(e),n=n&&!r?fs(n):0;var i=e.length;return n<0&&(n=yn(i+n,0)),ss(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Bt(e,t,n)>-1},Bn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:fs(n);return i<0&&(i=yn(r+i,0)),Bt(e,t,i)},Bn.inRange=function(t,n,r){return n=ps(n),r===e?(r=n,n=0):r=ps(r),function(e,t,n){return e>=wn(t,n)&&e<yn(t,n)}(t=ms(t),n,r)},Bn.invoke=Ts,Bn.isArguments=Ga,Bn.isArray=Wa,Bn.isArrayBuffer=Va,Bn.isArrayLike=qa,Bn.isArrayLikeObject=Za,Bn.isBoolean=function(e){return!0===e||!1===e||ts(e)&&Pr(e)==m},Bn.isBuffer=Ya,Bn.isDate=$a,Bn.isElement=function(e){return ts(e)&&1===e.nodeType&&!is(e)},Bn.isEmpty=function(e){if(null==e)return!0;if(qa(e)&&(Wa(e)||"string"==typeof e||"function"==typeof e.splice||Ya(e)||us(e)||Ga(e)))return!e.length;var t=go(e);if(t==_||t==M)return!e.size;if(Ao(e))return!Nr(e).length;for(var n in e)if(Oe.call(e,n))return!1;return!0},Bn.isEqual=function(e,t){return Rr(e,t)},Bn.isEqualWith=function(t,n,r){var i=(r="function"==typeof r?r:e)?r(t,n):e;return i===e?Rr(t,n,e,r):!!i},Bn.isError=Ja,Bn.isFinite=function(e){return"number"==typeof e&&Vt(e)},Bn.isFunction=Ka,Bn.isInteger=Xa,Bn.isLength=Qa,Bn.isMap=ns,Bn.isMatch=function(e,t){return e===t||Dr(e,t,co(t))},Bn.isMatchWith=function(t,n,r){return r="function"==typeof r?r:e,Dr(t,n,co(n),r)},Bn.isNaN=function(e){return rs(e)&&e!=+e},Bn.isNative=function(e){if(So(e))throw new Se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Fr(e)},Bn.isNil=function(e){return null==e},Bn.isNull=function(e){return null===e},Bn.isNumber=rs,Bn.isObject=es,Bn.isObjectLike=ts,Bn.isPlainObject=is,Bn.isRegExp=os,Bn.isSafeInteger=function(e){return Xa(e)&&e>=-9007199254740991&&e<=c},Bn.isSet=as,Bn.isString=ss,Bn.isSymbol=ls,Bn.isTypedArray=us,Bn.isUndefined=function(t){return t===e},Bn.isWeakMap=function(e){return ts(e)&&go(e)==E},Bn.isWeakSet=function(e){return ts(e)&&"[object WeakSet]"==Pr(e)},Bn.join=function(e,t){return null==e?"":mn.call(e,t)},Bn.kebabCase=Ws,Bn.last=Jo,Bn.lastIndexOf=function(t,n,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==e&&(o=(o=fs(r))<0?yn(i+o,0):wn(o,i-1)),n==n?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(t,n,o):zt(t,Ht,o,!0)},Bn.lowerCase=Vs,Bn.lowerFirst=qs,Bn.lt=cs,Bn.lte=hs,Bn.max=function(t){return t&&t.length?gr(t,rl,Mr):e},Bn.maxBy=function(t,n){return t&&t.length?gr(t,lo(n,2),Mr):e},Bn.mean=function(e){return Gt(e,rl)},Bn.meanBy=function(e,t){return Gt(e,lo(t,2))},Bn.min=function(t){return t&&t.length?gr(t,rl,Ir):e},Bn.minBy=function(t,n){return t&&t.length?gr(t,lo(n,2),Ir):e},Bn.stubArray=gl,Bn.stubFalse=ml,Bn.stubObject=function(){return{}},Bn.stubString=function(){return""},Bn.stubTrue=function(){return!0},Bn.multiply=xl,Bn.nth=function(t,n){return t&&t.length?Gr(t,fs(n)):e},Bn.noConflict=function(){return dt._===this&&(dt._=Be),this},Bn.noop=ll,Bn.now=Ma,Bn.pad=function(e,t,n){e=ys(e);var r=(t=fs(t))?hn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Wi(mt(i),n)+e+Wi(ft(i),n)},Bn.padEnd=function(e,t,n){e=ys(e);var r=(t=fs(t))?hn(e):0;return t&&r<t?e+Wi(t-r,n):e},Bn.padStart=function(e,t,n){e=ys(e);var r=(t=fs(t))?hn(e):0;return t&&r<t?Wi(t-r,n)+e:e},Bn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),_n(ys(e).replace(ne,""),t||0)},Bn.random=function(t,n,r){if(r&&"boolean"!=typeof r&&bo(t,n,r)&&(n=r=e),r===e&&("boolean"==typeof n?(r=n,n=e):"boolean"==typeof t&&(r=t,t=e)),t===e&&n===e?(t=0,n=1):(t=ps(t),n===e?(n=t,t=0):n=ps(n)),t>n){var i=t;t=n,n=i}if(r||t%1||n%1){var o=xn();return wn(t+o*(n-t+lt("1e-"+((o+"").length-1))),n)}return Yr(t,n)},Bn.reduce=function(e,t,n){var r=Wa(e)?Ft:qt,i=arguments.length<3;return r(e,lo(t,4),n,i,dr)},Bn.reduceRight=function(e,t,n){var r=Wa(e)?Ot:qt,i=arguments.length<3;return r(e,lo(t,4),n,i,pr)},Bn.repeat=function(t,n,r){return n=(r?bo(t,n,r):n===e)?1:fs(n),$r(ys(t),n)},Bn.replace=function(){var e=arguments,t=ys(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Bn.result=function(t,n,r){var i=-1,o=(n=wi(n,t)).length;for(o||(o=1,t=e);++i<o;){var a=null==t?e:t[jo(n[i])];a===e&&(i=o,a=r),t=Ka(a)?a.call(t):a}return t},Bn.round=Sl,Bn.runInContext=re,Bn.sample=function(e){return(Wa(e)?Kn:Kr)(e)},Bn.size=function(e){if(null==e)return 0;if(qa(e))return ss(e)?hn(e):e.length;var t=go(e);return t==_||t==M?e.size:Nr(e).length},Bn.snakeCase=Zs,Bn.some=function(t,n,r){var i=Wa(t)?Nt:ii;return r&&bo(t,n,r)&&(n=e),i(t,lo(n,3))},Bn.sortedIndex=function(e,t){return oi(e,t)},Bn.sortedIndexBy=function(e,t,n){return ai(e,t,lo(n,2))},Bn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=oi(e,t);if(r<n&&Ba(e[r],t))return r}return-1},Bn.sortedLastIndex=function(e,t){return oi(e,t,!0)},Bn.sortedLastIndexBy=function(e,t,n){return ai(e,t,lo(n,2),!0)},Bn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=oi(e,t,!0)-1;if(Ba(e[n],t))return n}return-1},Bn.startCase=Ys,Bn.startsWith=function(e,t,n){return e=ys(e),n=null==n?0:sr(fs(n),0,e.length),t=ui(t),e.slice(n,n+t.length)==t},Bn.subtract=Al,Bn.sum=function(e){return e&&e.length?Zt(e,rl):0},Bn.sumBy=function(e,t){return e&&e.length?Zt(e,lo(t,2)):0},Bn.template=function(t,n,r){var i=Bn.templateSettings;r&&bo(t,n,r)&&(n=e),t=ys(t),n=_s({},n,i,Xi);var o,a,s=_s({},n.imports,i.imports,Xi),l=Ls(s),u=Kt(s,l),c=0,h=n.interpolate||ye,d="__p += '",p=Ce((n.escape||ye).source+"|"+h.source+"|"+(h===J?ce:ye).source+"|"+(n.evaluate||ye).source+"|$","g"),f="//# sourceURL="+(Oe.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++it+"]")+"\n";t.replace(p,function(e,n,r,i,s,l){return r||(r=i),d+=t.slice(c,l).replace(we,rn),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=l+e.length,e}),d+="';\n";var g=Oe.call(n,"variable")&&n.variable;if(g){if(le.test(g))throw new Se("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(U,""):d).replace(H,"$1").replace(G,"$1;"),d="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=Xs(function(){return Ae(l,f+"return "+d).apply(e,u)});if(m.source=d,Ja(m))throw m;return m},Bn.times=function(e,t){if((e=fs(e))<1||e>c)return[];var n=d,r=wn(e,d);t=lo(t),e-=d;for(var i=Yt(r,t);++n<e;)t(n);return i},Bn.toFinite=ps,Bn.toInteger=fs,Bn.toLength=gs,Bn.toLower=function(e){return ys(e).toLowerCase()},Bn.toNumber=ms,Bn.toSafeInteger=function(e){return e?sr(fs(e),-9007199254740991,c):0===e?e:0},Bn.toString=ys,Bn.toUpper=function(e){return ys(e).toUpperCase()},Bn.trim=function(t,n,r){if((t=ys(t))&&(r||n===e))return $t(t);if(!t||!(n=ui(n)))return t;var i=dn(t),o=dn(n);return _i(i,Qt(i,o),en(i,o)+1).join("")},Bn.trimEnd=function(t,n,r){if((t=ys(t))&&(r||n===e))return t.slice(0,pn(t)+1);if(!t||!(n=ui(n)))return t;var i=dn(t);return _i(i,0,en(i,dn(n))+1).join("")},Bn.trimStart=function(t,n,r){if((t=ys(t))&&(r||n===e))return t.replace(ne,"");if(!t||!(n=ui(n)))return t;var i=dn(t);return _i(i,Qt(i,dn(n))).join("")},Bn.truncate=function(t,n){var r=30,i="...";if(es(n)){var o="separator"in n?n.separator:o;r="length"in n?fs(n.length):r,i="omission"in n?ui(n.omission):i}var a=(t=ys(t)).length;if(on(t)){var s=dn(t);a=s.length}if(r>=a)return t;var l=r-hn(i);if(l<1)return i;var u=s?_i(s,0,l).join(""):t.slice(0,l);if(o===e)return u+i;if(s&&(l+=u.length-l),os(o)){if(t.slice(l).search(o)){var c,h=u;for(o.global||(o=Ce(o.source,ys(he.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var d=c.index;u=u.slice(0,d===e?l:d)}}else if(t.indexOf(ui(o),l)!=l){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+i},Bn.unescape=function(e){return(e=ys(e))&&q.test(e)?e.replace(W,fn):e},Bn.uniqueId=function(e){var t=++Ne;return ys(e)+t},Bn.upperCase=$s,Bn.upperFirst=Js,Bn.each=ya,Bn.eachRight=wa,Bn.first=qo,sl(Bn,(vl={},br(Bn,function(e,t){Oe.call(Bn.prototype,t)||(vl[t]=e)}),vl),{chain:!1}),Bn.VERSION="4.17.21",Mt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Bn[e].placeholder=Bn}),Mt(["drop","take"],function(t,n){Wn.prototype[t]=function(r){r=r===e?1:yn(fs(r),0);var i=this.__filtered__&&!n?new Wn(this):this.clone();return i.__filtered__?i.__takeCount__=wn(r,i.__takeCount__):i.__views__.push({size:wn(r,d),type:t+(i.__dir__<0?"Right":"")}),i},Wn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Mt(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Wn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:lo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),Mt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Wn.prototype[e]=function(){return this[n](1).value()[0]}}),Mt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Wn.prototype[e]=function(){return this.__filtered__?new Wn(this):this[n](1)}}),Wn.prototype.compact=function(){return this.filter(rl)},Wn.prototype.find=function(e){return this.filter(e).head()},Wn.prototype.findLast=function(e){return this.reverse().find(e)},Wn.prototype.invokeMap=Jr(function(e,t){return"function"==typeof e?new Wn(this):this.map(function(n){return Tr(n,e,t)})}),Wn.prototype.reject=function(e){return this.filter(Oa(lo(e)))},Wn.prototype.slice=function(t,n){t=fs(t);var r=this;return r.__filtered__&&(t>0||n<0)?new Wn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==e&&(r=(n=fs(n))<0?r.dropRight(-n):r.take(n-t)),r)},Wn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Wn.prototype.toArray=function(){return this.take(d)},br(Wn.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),i=/^(?:head|last)$/.test(n),o=Bn[i?"take"+("last"==n?"Right":""):n],a=i||/^find/.test(n);o&&(Bn.prototype[n]=function(){var n=this.__wrapped__,s=i?[1]:arguments,l=n instanceof Wn,u=s[0],c=l||Wa(n),h=function(e){var t=o.apply(Bn,Dt([e],s));return i&&d?t[0]:t};c&&r&&"function"==typeof u&&1!=u.length&&(l=c=!1);var d=this.__chain__,p=!!this.__actions__.length,f=a&&!d,g=l&&!p;if(!a&&c){n=g?n:new Wn(this);var m=t.apply(n,s);return m.__actions__.push({func:pa,args:[h],thisArg:e}),new Gn(m,d)}return f&&g?t.apply(this,s):(m=this.thru(h),f?i?m.value()[0]:m.value():m)})}),Mt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Te[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Bn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Wa(i)?i:[],e)}return this[n](function(n){return t.apply(Wa(n)?n:[],e)})}}),br(Wn.prototype,function(e,t){var n=Bn[t];if(n){var r=n.name+"";Oe.call(Ln,r)||(Ln[r]=[]),Ln[r].push({name:t,func:n})}}),Ln[Bi(e,2).name]=[{name:"wrapper",func:e}],Wn.prototype.clone=function(){var e=new Wn(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Wn.prototype.reverse=function(){if(this.__filtered__){var e=new Wn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Wn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Wa(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=wn(t,e+a);break;case"takeRight":e=yn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,u=r?s:a-1,c=this.__iteratees__,h=c.length,d=0,p=wn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return fi(e,this.__actions__);var f=[];e:for(;l--&&d<p;){for(var g=-1,m=e[u+=t];++g<h;){var v=c[g],y=v.iteratee,w=v.type,b=y(m);if(2==w)m=b;else if(!b){if(1==w)continue e;break e}}f[d++]=m}return f},Bn.prototype.at=fa,Bn.prototype.chain=function(){return da(this)},Bn.prototype.commit=function(){return new Gn(this.value(),this.__chain__)},Bn.prototype.next=function(){this.__values__===e&&(this.__values__=ds(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?e:this.__values__[this.__index__++]}},Bn.prototype.plant=function(t){for(var n,r=this;r instanceof Hn;){var i=zo(r);i.__index__=0,i.__values__=e,n?o.__wrapped__=i:n=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,n},Bn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Wn){var n=t;return this.__actions__.length&&(n=new Wn(this)),(n=n.reverse()).__actions__.push({func:pa,args:[ea],thisArg:e}),new Gn(n,this.__chain__)}return this.thru(ea)},Bn.prototype.toJSON=Bn.prototype.valueOf=Bn.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Bn.prototype.first=Bn.prototype.head,Qe&&(Bn.prototype[Qe]=function(){return this}),Bn}();ft?((ft.exports=gn)._=gn,pt._=gn):dt._=gn}.call(xe),function(e){e[e.TwoWay=2]="TwoWay",e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(Ou||(Ou={})),function(e){e.Transit="transit",e.Public="public"}(Nu||(Nu={})),function(e){e.MapObject="map-object",e.Coordinate="coordinate"}(ju||(ju={})),function(e){e.Edge="what.route_edge",e.Network="what.route_network",e.PortalNetwork="what.link",e.AirsideNetwork="what.route.network"}(Iu||(Iu={})),function(e){e.Vehicle="vehicle",e.Plane="plane",e.Pedestrian="pedestrian"}(zu||(zu={})),function(e){e.escalator="escalator",e.lift="lift",e.liftAnchor="liftAnchor",e.bus="airport_transfer",e.skytrain="skytrain",e.entrance="entrance",e.exit="exit",e.staircase="staircase",e.unknown=""}(Bu||(Bu={})),function(e){e.RouteOverview="Route Overview",e.SectionOverview="Section Overview",e.LeftHairPinTurn="Left hairpin turn",e.RightHairPinTurn="Right hairpin turn",e.LeftTurn="Turn left",e.RightTurn="Turn right",e.ContinueStraight="Continue straight",e.EnterPortal="Enter Portal",e.TravelPortal="Travel Portal",e.ExitPortal="Exit Portal",e.Static="Static",e.ChangeZone="Change Zone",e.PassThroughImmigration="Pass Through Immigration",e.RoadChangeContinueStraight="Road Change Continue Straight",e.TurnLeftAndContinue="Turn Left and Continue",e.TurnSlightLeftAndContinue="Turn Slight Left and Continue",e.TurnRightAndContinue="Turn Right and Continue",e.TurnSlightRightAndContinue="Turn Slight Right and Continue",e.UTurnAndContinue="U-Turn and Continue"}(Uu||(Uu={})),function(e){e.Internal="Internal",e.External="External"}(Hu||(Hu={})),function(e){e.WithinTerminal="WithinTerminal",e.ToTerminal="ToTerminal",e.FromTerminal="FromTerminal",e.Airside="Airside"}(Gu||(Gu={}));var Vu=((Fu={})[Gu.WithinTerminal]=["gps","compass","motion"],Fu[Gu.Airside]=["gps","compass"],Fu[Gu.ToTerminal]=[],Fu[Gu.FromTerminal]=[],Fu);function qu(e,t){var n;return(null==t?void 0:t.requiredSensors)?t.requiredSensors:null!==(n=Vu[e])&&void 0!==n?n:[]}var Zu=6371008.8,Yu={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:Zu,metres:Zu,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:3440.069546436285,radians:1,yards:6967335.223679999};function $u(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ku(e[0])||!Ku(e[1]))throw new Error("coordinates must contain numbers");return function(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}({type:"Point",coordinates:e},t,n)}function Ju(e){return e%360*Math.PI/180}function Ku(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function Xu(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Qu(e,t,n){void 0===n&&(n={});var r=Xu(e),i=Xu(t),o=Ju(i[1]-r[1]),a=Ju(i[0]-r[0]),s=Ju(r[1]),l=Ju(i[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return function(e,t){void 0===t&&(t="kilometers");var n=Yu[t];if(!n)throw new Error(t+" units is invalid");return e*n}(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),n.units)}function ec(e,t,n){void 0===n&&(n={});for(var r,i=("Feature"===(r=e).type?r.geometry:r).coordinates,o=0,a=0;a<i.length&&!(t>=o&&a===i.length-1);a++){if(o>=t){var s=t-o;if(s){var l=ia(i[a],i[a-1])-180;return ca(i[a],s,l,n)}return $u(i[a])}o+=Qu(i[a],i[a+1],n)}return $u(i[i.length-1])}var tc="where.changi.airside",nc="meters",rc="Custom Location",ic="custom_location",oc="user_position";function ac(e,t){var n,r=null!=t?t:{},i=r.vehicleTemplateType,o=r.distanceThreshold,a=void 0===o?30:o,s=bc.getState().data;if(e.type===ju.MapObject){var l=e.mapObjectId;if(!l||!s.hasOwnProperty(Iu.Edge)||!s[Iu.Edge].edges.hasOwnProperty(l))return;return Wu.cloneDeep(s[Iu.Edge].edges[l])}if(e.type!==ju.Coordinate);else{var u=sc(e.whereDimension,!1,Iu.Network,!0);if(u.length<1){var c="RouteNetworkData not found for the whereDimension: ".concat(e.whereDimension);throw console.error(c),new Error(c)}var h=e.coordinates,d=function(e,t,n,r){if(0===e.length||0===n)return;var i=e.map(function(e){return{feature:e,dist:ta(_s(e,t,{units:"meters"}).geometry.coordinates,t,{units:"meters"})}}).filter(function(e){return e.dist<=n}).sort(function(e,t){return e.dist-t.dist}).map(function(e){return e.feature}),o=function(e,t){if(0===e.length)return;var n=e.find(function(e){return!!pc(e,null!=t?t:void 0)});if(!n)return;return n}(i,null!=r?r:void 0);return null!=o?o:void 0}(u,h,a,i);if(d){console.log("DEBUG - Nearest Accessible Network Feature:",d);var p=_s(d,h,{units:"meters"});bc.getState().updateNetworkWithIntersection(d,p.geometry.coordinates);var f=ye([h,p.geometry.coordinates],{center:[h[0],h[1]],dimension_what:"what.route_edge",dimension_where:"where.changi.airside",direction:Ou.TwoWay,mapObjectId:"",modified:1,myMapObjectId:"",title:rc,uniqueId:"",zone:Nu.Public});return{id:oc,where:e.whereDimension,what:null===(n=f.properties)||void 0===n?void 0:n.dimension_what,name:rc,coords:h,lines:[f],localRef:ic,zone:Nu.Public}}var g,m=function(){var e=Object.values(bc.getState().data[Iu.Edge].edges).filter(function(e){return"where.changi.airside"===e.where}),t=e.flatMap(function(e){return e.lines});return t}(),v=function(e,t,n){if(0===e.length||0===n)return;var r=e.map(function(e){return{feature:e,dist:_s(e,t,{units:"meters"}).properties.dist}}).filter(function(e){return e.dist<=n}).sort(function(e,t){return e.dist-t.dist});if(0===r.length)return;return r}(m,h,a),y=null==v?void 0:v.find(function(e){var t=function(e,t){var n,r=ve(e.geometry.coordinates.at(-1)),i=1/0;return t.forEach(function(e){var t=_s(e,r,{units:"meters"}).properties.dist;t<i&&(i=t,n=e)}),i<=1?n:void 0}(e.feature,u);return!(!t||!pc(t,null!=i?i:void 0))&&(g=t,!0)});if(y)return console.log("DEBUG - Nearest Accessible Edge:",y),console.log("DEBUG - Accessible Network Feature:",g),function(e){if(!e)return;var t=ea(e),n=t[0],r=ye(t,{center:[n[0],n[1]],dimension_what:"what.route_edge",dimension_where:"where.changi.airside",direction:Ou.TwoWay,mapObjectId:"",modified:1,myMapObjectId:"",title:rc,uniqueId:"",zone:Nu.Public}),i={id:oc,where:tc,what:Iu.Edge,name:rc,coords:n,lines:[r],localRef:ic,zone:Nu.Public};return i}(y.feature);var w=function(e,t,n){void 0===n&&(n=.001);if(0===t.length)throw new Error("RouteNetworkData is empty");var r=ba();r.load(t);var i,o,a=Ll(ve(e)),s=[a[0]-n,a[1]-n,a[2]+n,a[3]+n],l=r.search(s),u=1/0;l.features.forEach(function(t){var n=_s(t,e,{units:"meters"}),r=ta(n.geometry.coordinates,e,{units:"meters"});r<u&&(u=r,i=n,o=t)}),0===l.features.length&&(console.warn("No candidate features found in spatial index, falling back to brute force"),t.forEach(function(t){var n=_s(t,e,{units:"meters"}),r=ta(n.geometry.coordinates,e,{units:"meters"});r<u&&(u=r,i=n,o=t)}));return{nearestPoint:i,closestLine:o,minDistance:u}}(h,B(B([],u,!0),m,!0)).minDistance;if(void 0!==a){c="Your location is ".concat(w.toFixed(2),"m from the nearest road. Please move within ").concat(a,"m to start navigation.");throw console.error(c),new Error(c)}}}function sc(e,t,n,r){void 0===t&&(t=!0),void 0===r&&(r=!1);var i=bc.getState().data;if(!i.hasOwnProperty(Iu.Network))return[];for(var o=i[Iu.Network],a=[],s=0;s<o.length;s++){var l=o[s];if(l&&l.properties&&l.properties.dimension_where){var u=!1;u=t?l.properties.dimension_where.includes(e):l.properties.dimension_where===e;var c=!0;n&&l.properties.dimension_what?c=r?l.properties.dimension_what.includes(n):l.properties.dimension_what===n:n&&!l.properties.dimension_what&&(c=!1),u&&c&&a.push(l)}}return Wu.cloneDeep(a)}function lc(e,t,n,r){return void 0===t&&(t=!0),void 0===r&&(r=!1),sc(e,t,n,r)}function uc(e,t){return ac(e,t)}function cc(e){var t;return(t=bc.getState().data).hasOwnProperty("portal")?t.portal:{edgeData:{},lines:[]}}function hc(e){return function(e){var t=bc.getState().data;return e&&t.hasOwnProperty("what.service.immigration")&&t["what.service.immigration"].hasOwnProperty(e)?t["what.service.immigration"][e]:[]}(e)}function dc(e,t,n){void 0===n&&(n=!0);var r=function(n,r){var i=_s(r,n);void 0!==i.properties.index&&(t.geometry.coordinates.splice(i.properties.index+1,0,e.geometry.coordinates),t.properties&&(t.properties.modified=1))};if(n){var i=function(e,t){var n=-1;return ys(e,function(e,r){if(-1===n){var i=ve(e);ta(t,i,{units:"meters"})<.001&&(n=r)}}),n}(t,e);-1===i?r(e.geometry.coordinates,t):(t.geometry.coordinates[i]=e.geometry.coordinates,t.properties&&(t.properties.modified=1))}else r(e.geometry.coordinates,t)}function pc(e,t){var n,r;if(void 0===t)return!0;var i=t.customProperties,o=t.allowedRoadwayCategories,a=null!==(n=e.properties)&&void 0!==n?n:{},s=Object.entries(i).every(function(e){var t=e[0],n=e[1];return a[t]&&a[t].includes(n)}),l=o.includes(null!==(r=a.dimension_what)&&void 0!==r?r:"");return s&&l}function fc(e){var t=e.split("."),n=t[t.length-1];return e.replace(".".concat(n),"")}var gc="where";function mc(e,t){var n=[],r={};for(var i in e)if(e[i].where.includes(t)){var o=e[i];r[i]=o,n.push.apply(n,o.lines),o.links.forEach(function(e){n.push.apply(n,e.lines)})}return{edgeData:r,lines:n}}function vc(e,t){var n=[],r={};return t.forEach(function(i){if(i in e&&t.has(e[i].id)){var o=e[i];r[i]=o,n.push.apply(n,o.lines),o.links.forEach(function(e){n.push.apply(n,e.lines)})}}),{edgeData:r,lines:n}}var yc,wc,bc=Lu(function(e,t){return{data:{},setRoute:function(t){return e({data:t})},updateNetworkWithIntersection:function(n,r){var i;if(n&&r){var o=t().data,a=o[Iu.Network]||[];if(0!==a.length){var s=!1,l=a.map(function(e){Wu.isEqual(e,n)&&(dc(ve(r),e,!1),s=!0);return e});s&&e({data:j(j({},o),(i={},i[Iu.Network]=l,i))})}}},upsertEdge:function(n){var r,i,o;if(n&&n.id){var a=t().data,s=j(j({},a),((r={})[Iu.Edge]=j(j({},a[Iu.Edge]),{edges:j(j({},(null===(o=a[Iu.Edge])||void 0===o?void 0:o.edges)||{}),(i={},i[n.id]=n,i))}),r));e({data:s})}},getTemplateTypes:function(){return t().data.templatesData.templateTypes},getTemplateDefaults:function(){return t().data.templatesData.defaults}}}),_c=Lu(function(e){return{data:{},setMapObjectsData:function(t){return e({data:t})}}}),xc=Lu(function(e){return{data:{},setRoute:function(t){return e({data:t})}}}),Sc=Lu(function(e){return{data:{},setRoute:function(t){return e({data:t})}}});function Ac(e){return e===yc.Routing?"generate-route-json-per-role":e===yc.MapObjects?"generate-map-objects-per-role":e===yc.MBTiles?"generate-vector-tiles":e===yc.Fonts?"generate-font-sprites":void 0}function Pc(e,t){return t.valueOf()+e}!function(e){e.Routing="routing",e.MapObjects="mapObjects",e.MBTiles="mbtiles",e.Fonts="fonts"}(yc||(yc={})),function(e){e.Ready="Ready",e.Awaiting="Awaiting",e.DownloadingResources="DownloadingResources",e.Unavailable="Unavailable"}(wc||(wc={}));var Mc=bc.setState,Cc=_c.setState,kc=xc.setState,Ec=Sc.setState;function Tc(e,t,n){var r,i;return I(this,void 0,void 0,function(){var o,a,s,l,u,c,h,d,p,f,g,m,v,y,w,b,_,x,S,A,P,M,C,E=this;return z(this,function(T){switch(T.label){case 0:o=e.publishedDataType,a=Pc("version",o),s=Pc("roleName",o),l=null==e?void 0:e.roleName,u=wc.Awaiting,c=function(e){return e===yc.Routing?Mc:e===yc.MapObjects?Cc:e===yc.MBTiles?kc:e===yc.Fonts?Ec:void 0}(o),h=e.secretKey,d="".concat(L.DocumentDirectoryPath,"/extracted/"),p=function(){return I(E,void 0,void 0,function(){var n;return z(this,function(r){return n=t.contains(a)?t.getString(a):"0.0.0",[2,new Promise(function(r,i){k({url:"".concat(e.URL,"/check-published-versions"),headers:{Authorization:"Bearer ".concat(e.accessToken),"Content-Type":"application/json"},method:"POST",data:JSON.stringify({version:n,dataType:Ac(e.publishedDataType)})}).then(function(e){var n=e.data,i={currentVersion:void 0,remoteVersion:void 0,roleName:void 0,URL:void 0,data:void 0},c=t.getString(a),h=t.getString(s),d=c;if(n.hasOwnProperty("version")&&(d=n.version),i.currentVersion=c,i.remoteVersion=d,c){var p=t.getString(Pc("data",o));if(o===yc.MBTiles||o===yc.Fonts)p&&(i.data=p);else t.getString(Pc("encryptionTag",o))&&p&&(i.data=p)}if(l&&(i.roleName=l,h!==l))return n.hasOwnProperty("downloadUrl")&&(i.URL=n.downloadUrl),u=wc.DownloadingResources,console.log("Role mismatch. Setting status to DownloadingResources: ",i.roleName,h),void r(i);d&&(n.hasOwnProperty("downloadUrl")&&(i.URL=n.downloadUrl),(c&&d>c||!c||!i.data)&&(u=i.URL?wc.DownloadingResources:u)),console.log("final: ",i.URL,i.currentVersion,i.remoteVersion,i.roleName),r(i)}).catch(function(t){console.log("error while fetching published version: ",e.publishedDataType),t.response?(console.log(t.response.data),console.log(t.response.status),console.log(t.response.headers)):t.request?console.log(t.request):console.log("Error",t.message),console.log(t.config),i(t)})})]})})},f=function(e,n,r,i){try{return t.set(Pc("data",o),e),t.set(a,n),t.set(Pc("roleName",o),r),i&&t.set(Pc("encryptionTag",o),i),!0}catch(e){return console.log("error storing routing file from local storage",e),!1}},g=function(){return I(E,void 0,void 0,function(){var n,r,i,a;return z(this,function(s){switch(s.label){case 0:return n=t.getString(Pc("data",o)),o!==yc.MBTiles&&o!==yc.Fonts?[3,2]:[4,Lc(o,n,d,h)];case 1:return(r=s.sent())?(c({data:r}),u=wc.Ready,[2,!0]):[2,!1];case 2:return i=t.getString(Pc("encryptionTag",o)),n&&i?[4,tu(n,i,e.secretKey)]:[3,4];case 3:return a=s.sent(),c({data:a}),u=wc.Ready,[2,!0];case 4:return[2,!1];case 5:return[2]}})})},m=function(){return I(E,void 0,void 0,function(){return z(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,g()];case 1:return e.sent()||(console.log("metaAtlasSDK: failed to load data",o),u=wc.Unavailable),[3,3];case 2:return e.sent(),console.log("metaAtlasSDK: erro while loading data",o),u=wc.Unavailable,t.clearAll(),[3,3];case 3:return[2]}})})},T.label=1;case 1:return T.trys.push([1,26,,28]),[4,p()];case 2:if(v=T.sent(),u!==wc.DownloadingResources||!v.URL)return[3,15];console.log("metaAtlasSDK: downloading file from server",o),T.label=3;case 3:return T.trys.push([3,12,,14]),o!==yc.MBTiles&&o!==yc.Fonts?[3,7]:(y="".concat(L.DocumentDirectoryPath,"/").concat(o,".zip"),[4,L.downloadFile({fromUrl:v.URL,toFile:y,begin:function(e){var t,r=(e.contentLength/1048576).toFixed(2);n&&(null==n?void 0:n.onStart)&&(null===(t=null==n?void 0:n.onStart)||void 0===t||t.call(n,{totalSize:r})),console.log("Download started. Total size: ".concat(r," MB"))},progress:function(e){var t,r=e.bytesWritten/e.contentLength*100,i=(e.bytesWritten/1048576).toFixed(2),o=(e.contentLength/1048576).toFixed(2);n&&(null==n?void 0:n.onProgress)&&(null===(t=null==n?void 0:n.onProgress)||void 0===t||t.call(n,{downloaded:i,totalSize:o,progress:r.toFixed(2)})),console.log("Downloaded: ".concat(i," MB / ").concat(o," MB (").concat(r.toFixed(2),"%)"))}}).promise]);case 4:return w=T.sent(),[4,L.mkdir(d)];case 5:if(T.sent(),200!==w.statusCode)throw n&&(null==n?void 0:n.onError)&&(null===(r=null==n?void 0:n.onError)||void 0===r||r.call(n,w.statusCode.toString())),new Error("Download failed with status ".concat(w.statusCode));return n&&(null==n?void 0:n.onSuccess)&&(null===(i=null==n?void 0:n.onSuccess)||void 0===i||i.call(n,y)),console.log("File downloaded to: ".concat(y)),L.stat(y).then(function(e){var t=(e.size/1048576).toFixed(2);console.log("File size: ".concat(t," MB"))}).catch(function(e){console.error("Error getting file size:",e)}),x=f(y,v.remoteVersion,l),[4,Lc(o,y,d,h)];case 6:if(!(P=T.sent()))throw new Error("No MBTiles file found in the archive");return x&&(console.log("Loaded file"),c({data:P}),u=wc.Ready),[3,11];case 7:return[4,fetch(v.URL)];case 8:if(!(w=T.sent()).ok)throw new Error("HTTP error! Status: ".concat(w.status));return[4,w.json()];case 9:return b=T.sent(),_=b.data,M=b.tag,[4,tu(_,M,e.secretKey)];case 10:C=T.sent(),(x=f(_,v.remoteVersion,l,M))&&(console.log("loaded file"),c({data:C}),u=wc.Ready),T.label=11;case 11:return[3,14];case 12:return S=T.sent(),console.error("Error fetching and decrypting data:",S),[4,m()];case 13:return T.sent(),[3,14];case 14:return[3,25];case 15:return o!==yc.MBTiles&&o!==yc.Fonts?[3,21]:(A=t.getString(Pc("data",o)),[4,L.exists(A)]);case 16:return T.sent()?console.log("File exists at: ".concat(A)):(console.log("File does not exist at: ".concat(A)),f("","","")),[4,Lc(o,A,d,h)];case 17:return P=T.sent(),A?(c({data:P}),u=wc.Ready,[3,20]):[3,18];case 18:return[4,m()];case 19:T.sent(),T.label=20;case 20:return[3,25];case 21:return M=t.getString("encryptionTag"),v.data&&M?(console.log("loaded local file"),[4,tu(v.data,M,e.secretKey)]):[3,23];case 22:return C=T.sent(),c({data:C}),u=wc.Ready,[3,25];case 23:return[4,m()];case 24:T.sent(),T.label=25;case 25:return[3,28];case 26:return T.sent(),[4,m()];case 27:return T.sent(),[3,28];case 28:return[2,u]}})})}function Lc(e,t,n,r){return I(this,void 0,void 0,function(){var i,o,a,s,l,u,c,h,d,p,f,g,m,v,y,w,b,_,x,S,A;return z(this,function(P){switch(P.label){case 0:return P.trys.push([0,30,,31]),i="",[4,L.exists(n)];case 1:return P.sent()?[3,3]:[4,L.mkdir(n)];case 2:return P.sent(),console.log("Directory created at: ".concat(n)),[3,4];case 3:console.log("Directory already exists at: ".concat(n)),P.label=4;case 4:return e!==yc.MBTiles?[3,24]:[4,D(t,n,r)];case 5:return P.sent(),[4,L.readDir(n)];case 6:o=P.sent(),a=o.filter(function(e){return e.name.endsWith(".mbtiles")}),s=0,l=a,P.label=7;case 7:return s<l.length?(u=l[s],[4,L.unlink(u.path)]):[3,10];case 8:P.sent(),P.label=9;case 9:return s++,[3,7];case 10:return[4,L.readDir(n)];case 11:return y=P.sent(),c=y.find(function(e){return e.name.endsWith(".zip")}),c?[4,R("".concat(n).concat(c.name),n)]:[3,15];case 12:return P.sent(),h="".concat(n).concat(c.name),[4,L.exists(h)];case 13:return P.sent()?[4,Dc(h)]:[3,15];case 14:P.sent(),P.label=15;case 15:return[4,L.readDir(n)];case 16:return d=P.sent(),p=d.find(function(e){return e.name.endsWith(".mbtiles")}),p?(f="geojson_".concat(performance.now().toFixed(0),".mbtiles"),g="".concat(n).concat(f),[4,L.moveFile(p.path,g)]):[3,22];case 17:return P.sent(),[4,L.exists(p.path)];case 18:return P.sent()?[4,L.unlink(p.path)]:[3,20];case 19:P.sent(),P.label=20;case 20:return[4,L.readDir(n)];case 21:return m=P.sent(),console.log("All files in unzip destination:",m),i=g,[3,23];case 22:throw new Error("MBTiles file not found.");case 23:return[3,29];case 24:return e!==yc.Fonts?[3,28]:[4,R(t,n)];case 25:return v=P.sent(),[4,L.readDir(v)];case 26:return y=P.sent(),w=y.map(function(e){return e.name}),[4,L.readDir("".concat(v,"sprites"))];case 27:if(b=P.sent(),_=b.map(function(e){return e.name}),console.log("Sprites Files:",_),x=w.includes("fonts"),S=w.includes("sprites"),!x||!S)throw new Error("Missing required directories: fonts or sprites.");return i=v,[3,29];case 28:throw new Error("Unsupported data type.");case 29:return[2,i];case 30:throw A=P.sent(),console.error("Error extracting offline file path:",A),A;case 31:return[2]}})})}var Rc,Dc=function(e){return I(void 0,void 0,void 0,function(){var t;return z(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,L.unlink(e)];case 1:return n.sent(),console.log("File deleted successfully"),[3,3];case 2:return t=n.sent(),console.error("Error deleting file:",t),[3,3];case 3:return[2]}})})};function Fc(e){if(e&&"object"===te(e)&&!Array.isArray(e))return e}function Oc(e,t){var n=Fc(e),r=Fc(t);if(n||r)return j(j({},null!=n?n:{}),null!=r?r:{})}function Nc(e){var t,n,r,i,o,a,s,l,u,c,h,d,p=null!==(n=null!==(t=e.mID)&&void 0!==t?t:e.id)&&void 0!==n?n:e.mapObjectId,f={myMapObjectId:p,title:null!==(r=e.name)&&void 0!==r?r:e.title,localRef:e.localRef,dimension_what:null!==(i=e.what)&&void 0!==i?i:e.whatDimension,dimension_where:null!==(o=e.where)&&void 0!==o?o:e.whereDimension,isSearchable:!0},g=function(e){var t=Fc(e),n=null==t?void 0:t.features;if(Array.isArray(n)&&0!==n.length){for(var r,i=0,o=n;i<o.length;i++){var a=Fc(o[i]),s=Fc(null==a?void 0:a.properties);if(s&&(r||(r=j({},s)),s.booth_info||s.metadata))return j({},s)}return r?j({},r):void 0}}(e.property_geojson),m=Fc(e.properties),v=function(e){var t,n,r,i,o,a,s,l,u=Fc(e.booth_info),c=null!==(n=null!==(t=e.images)&&void 0!==t?t:e.property_images)&&void 0!==n?n:null==u?void 0:u.images,h=null!==(i=null!==(r=e.logos)&&void 0!==r?r:e.property_logos)&&void 0!==i?i:null==u?void 0:u.logos,d=null!==(o=e.overview)&&void 0!==o?o:null==u?void 0:u.overview,p=null!==(a=e.products)&&void 0!==a?a:null==u?void 0:u.products,f=null!==(s=e.videos)&&void 0!==s?s:null==u?void 0:u.videos,g=null!==(l=e.files)&&void 0!==l?l:null==u?void 0:u.files;if(null!=d||null!=p||null!=c||null!=h||null!=f||null!=g||u)return j(j(j(j(j(j(j({},null!=u?u:{}),void 0!==d?{overview:d}:{}),void 0!==p?{products:p}:{}),void 0!==c?{images:c}:{}),void 0!==h?{logos:h}:{}),void 0!==f?{videos:f}:{}),void 0!==g?{files:g}:{})}(e),y=j(j(j({},f),null!=g?g:{}),null!=m?m:{});v&&Object.keys(v).length>0?y.booth_info=v:(null==g?void 0:g.booth_info)?y.booth_info=g.booth_info:(null==m?void 0:m.booth_info)&&(y.booth_info=m.booth_info);var w=Oc(function(e){if(null!=e){if("object"===te(e)&&!Array.isArray(e))return e;if("string"==typeof e&&e.trim())try{return Fc(JSON.parse(e))}catch(e){return}}}(e.metaData),Oc(e.metadata,Oc(null==g?void 0:g.metadata,null==m?void 0:m.metadata)));return w&&Object.keys(w).length>0&&(y.metadata=w),y.myMapObjectId=null!==(a=y.myMapObjectId)&&void 0!==a?a:p,y.title=null!==(l=null!==(s=y.title)&&void 0!==s?s:e.name)&&void 0!==l?l:e.title,y.dimension_what=null!==(c=null!==(u=y.dimension_what)&&void 0!==u?u:e.what)&&void 0!==c?c:e.whatDimension,y.dimension_where=null!==(d=null!==(h=y.dimension_where)&&void 0!==h?h:e.where)&&void 0!==d?d:e.whereDimension,y.isSearchable=!0,y}!function(e){e.Name="Name",e.WhereDimension="WhereDimension",e.Relevance="Relevance",e.RelevanceStrict="RelevanceStrict"}(Rc||(Rc={}));var jc=function(){function e(){this.searchableGeoJsonFeatures=[],this.token="",this.empApi="",this.HOST="",this.atomsAPIAccessToken="",this.apiRequestLimit=5e3,this.secretKeyForDecryption="",this.routingStatus=wc.Awaiting,this.searchStatus=wc.Awaiting,this.offlineMapStatus=wc.Awaiting,this.storage=new Ul,this.onReadinessChange=null,this.lastClicked={mapObjectId:null,coordinates:null,name:null,whatDimension:null,whereDimension:null,geometry:null,properties:null}}return e.prototype.init=function(e,t,n,r,i){this.empApi=e,this.token=t,this.HOST=r,this.secretKeyForDecryption=n,this.tileserverRoleName=i},Object.defineProperty(e.prototype,"defaultFocusedTaxonomy",{get:function(){return Ml().getDefaultFocusedTaxonomy()},set:function(e){Ml().setDefaultFocusedTaxonomy(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentFocus",{get:function(){return Ml().getCurrentFocus()},set:function(e){Ml().setCurrentFocus(e)},enumerable:!1,configurable:!0}),e.prototype.getAtomsAPIAccessToken=function(e){var t=this,n=JSON.stringify({strategy:"atomstoken",atomsSdkToken:this.token,clientEngine:"API",clientOS:"Linux"}),r={method:"post",url:"".concat(this.empApi,"/authentication"),headers:{"Content-Type":"application/json"},data:n};k(r).then(function(n){return I(t,void 0,void 0,function(){var t;return z(this,function(r){return(null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.accessToken)&&(this.atomsAPIAccessToken=n.data.accessToken,e({authenticated:!0})),[2]})})}).catch(function(t){e({authenticated:!1,error:t})})},e.prototype.setupFocusTree=function(){return I(this,void 0,void 0,function(){var e,t,n,r;return z(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e="".concat(this.empApi,"/role-based-camera-properties"),[4,k.get(e,{headers:{Authorization:"Bearer ".concat(this.atomsAPIAccessToken)}})];case 1:return(null==(t=i.sent())?void 0:t.data)&&Object.keys(t.data).length>0?(Ds(t.data),(n=Is()).length>0&&!this.currentFocus&&(this.defaultFocusedTaxonomy=n[0].taxonomyPath,this.currentFocus=n[0].taxonomyPath),console.log("Focus tree loaded from ATOMS API",t.data)):(console.error("[focus-core] Empty focus tree response from ATOMS API"),Ds({})),[3,3];case 2:return r=i.sent(),console.error("[focus-core] Failed to load focus tree from ATOMS API",r),Ds({}),[3,3];case 3:return[2]}})})},e.prototype.hasPublishedDataVersion=function(e){return function(e,t){var n=Pc("version",e);return null!=t.getString(n)}(e,this.storage)},e.prototype.setupOfflineMaps=function(e,t){return I(this,void 0,void 0,function(){var n,r,i,o;return z(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,Tc({URL:this.empApi,accessToken:this.atomsAPIAccessToken,secretKey:this.secretKeyForDecryption,publishedDataType:yc.MBTiles,roleName:this.tileserverRoleName},this.storage,t)];case 1:return n=a.sent(),[4,Tc({URL:this.empApi,accessToken:this.atomsAPIAccessToken,secretKey:this.secretKeyForDecryption,publishedDataType:yc.Fonts,roleName:this.tileserverRoleName},this.storage,t)];case 2:return r=a.sent(),console.log("Offline Map & fonts status:",n,r),i=n===wc.Ready&&r===wc.Ready,this.offlineMapStatus=i?wc.Ready:wc.Unavailable,this.emitReadinessChange(),e&&e(this.offlineMapStatus===wc.Ready),[2,i];case 3:return o=a.sent(),console.error("Error setting up offline maps:",o),this.offlineMapStatus=wc.Unavailable,this.emitReadinessChange(),e&&e(!1),[3,4];case 4:return[2]}})})},e.prototype.getOfflineMapStatus=function(){return this.offlineMapStatus},e.prototype.setupRouting=function(e){return I(this,void 0,void 0,function(){var t;return z(this,function(n){switch(n.label){case 0:return[4,Tc({URL:this.empApi,accessToken:this.atomsAPIAccessToken,secretKey:this.secretKeyForDecryption,publishedDataType:yc.Routing,roleName:this.tileserverRoleName},this.storage)];case 1:return t=n.sent(),this.routingStatus=t,this.emitReadinessChange(),console.log("routing status: ",t),e&&e(t===wc.Ready),[2]}})})},e.prototype.getRoutingStatus=function(){return this.routingStatus},e.prototype.getReadiness=function(){var e=[];return this.routingStatus!==wc.Ready&&e.push(yc.Routing),this.searchStatus!==wc.Ready&&e.push(yc.MapObjects),this.offlineMapStatus!==wc.Ready&&e.push(yc.MBTiles),ml(e)},e.prototype.emitReadinessChange=function(){var e;null===(e=this.onReadinessChange)||void 0===e||e.call(this)},e.prototype.setLastClickedFeature=function(e){return this.lastClicked=e,this.lastClicked},e.prototype.hydrateClickedFeature=function(e){var t,n,r,i,o,a,s,l,u,c,h,d=null!==(r=null!==(t=e.mapObjectId)&&void 0!==t?t:null===(n=e.properties)||void 0===n?void 0:n.myMapObjectId)&&void 0!==r?r:null;if(null==d)return e;var p=this.searchableGeoJsonFeatures.find(function(e){var t,n,r=null!==(n=null===(t=e.properties)||void 0===t?void 0:t.myMapObjectId)&&void 0!==n?n:e.mapObjectId;return null!=r&&String(r)===String(d)});if(!(null==p?void 0:p.properties))return e;var f=function(e,t){var n,r,i,o,a,s,l=Oc(e.metadata,t.metadata);return j(j(j(j({},e),t),{myMapObjectId:null!==(n=t.myMapObjectId)&&void 0!==n?n:e.myMapObjectId,title:null!==(r=t.title)&&void 0!==r?r:e.title,dimension_what:null!==(i=t.dimension_what)&&void 0!==i?i:e.dimension_what,dimension_where:null!==(o=t.dimension_where)&&void 0!==o?o:e.dimension_where,localRef:null!==(a=t.localRef)&&void 0!==a?a:e.localRef,booth_info:null!==(s=e.booth_info)&&void 0!==s?s:t.booth_info}),l?{metadata:l}:{})}(p.properties,null!==(i=e.properties)&&void 0!==i?i:{}),g=null!==(a=null!==(o=e.coordinates)&&void 0!==o?o:p.lngLat)&&void 0!==a?a:null;return{mapObjectId:String(d),coordinates:g,name:null!==(s=e.name)&&void 0!==s?s:"string"==typeof f.title?f.title:null,whatDimension:null!==(l=e.whatDimension)&&void 0!==l?l:"string"==typeof f.dimension_what?f.dimension_what:null,whereDimension:null!==(u=e.whereDimension)&&void 0!==u?u:"string"==typeof f.dimension_where?f.dimension_where:null,geometry:null!==(h=null!==(c=e.geometry)&&void 0!==c?c:p.geometry)&&void 0!==h?h:null,properties:f}},e.prototype.getLastClickedFeature=function(){var e=this.lastClicked;if(!this.lastClicked||this.lastClicked&&(null===this.lastClicked.name||null===this.lastClicked.whereDimension)){e=this.setLastClickedFeature({mapObjectId:null,coordinates:null,name:null,whatDimension:null,whereDimension:null,geometry:null,properties:null})}return e},e.prototype.isClickableFeature=function(e){return!!(e&&e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"isSearchable")&&e.properties.isSearchable&&"Transit"!==e.properties.title&&"Public"!==e.properties.title)},e.prototype.getMidPointOfFeature=function(e){if(!e)return null;if(e.lngLat)return e.lngLat;if(!e.geometry)return null;if("Point"===e.geometry.type)return e.geometry.coordinates;var t=me(e.geometry);if("LineString"===t.geometry.type||"MultiLineString"===t.geometry.type&&1==t.geometry.coordinates.length){var n=xs(t=ye(e.geometry.coordinates));return Bl(t,n/2,n).geometry.coordinates[0]}return Dl(t).geometry.coordinates},e.prototype.getFocusTree=function(){return Fs()},e.prototype.getWhatTaxonomies=function(){if(this.searchStatus===wc.Ready){for(var e=new Set,t=0,n=this.searchableGeoJsonFeatures;t<n.length;t++){var r=n[t];e.add(r.properties.dimension_what)}return Array.from(e)}return console.warn("getWhatTaxonomies called before Search APIs are ready"),[]},e.prototype.getCurrentFocus=function(){return Ml().getCurrentFocus()},e.prototype.getCurrentFocusBuilding=function(){return Ml().getCurrentFocusBuilding()},e.prototype.getCurrentFocusFloor=function(){return Ml().getCurrentFocusFloor()},e.prototype.getUserViewportBuilding=function(e){return Ml().getUserViewportBuilding(e)},e.prototype.checkUserViewport=function(e,t,n){return Ml().checkUserViewport(e,t,n)},e.prototype.getFlyToLocation=function(e,t){return void 0===t&&(t=!0),Ml().getFlyToLocation(e,t)},e.prototype.normalize=function(e){return e.trim().toLowerCase()},e.prototype.relevanceSort=function(e,t,n){function r(e){var r=[-1,0,e.name];if(e.name){var i=e.name.toLowerCase(),o=t.toLowerCase();return i===o?[1e3,-e.name.length,i]:i.startsWith(o)?[500,-e.name.length,i]:i.split(" ").some(function(e){return e.startsWith(o)})?[200,-e.name.length,i]:n?r:i.includes(o)?[0,-e.name.length,i]:r}return r}return void 0===n&&(n=!1),e.sort(function(e,t){var n=r(e),i=r(t);return i[0]-n[0]||i[1]-n[1]||n[2].localeCompare(i[2])}).filter(function(e){return r(e)[0]>=0})},e.prototype.sort=function(e,t,n){void 0===n&&(n="");var r=function(e,t){return e&&t?e.localeCompare(t):0};return t===Rc.Name?e.sort(function(e,t){return r(e.name,t.name)}):t===Rc.WhereDimension?e.sort(function(e,t){var n=r(e.whereDimension,t.whereDimension);return 0===n?r(e.name,t.name):n}):t===Rc.Relevance?this.relevanceSort(e,n):t===Rc.RelevanceStrict?this.relevanceSort(e,n,!0):void 0},e.prototype.setupMapObjectSearch=function(e){return I(this,void 0,void 0,function(){var t,n,r,i,o,a,s;return z(this,function(l){switch(l.label){case 0:return[4,Tc({URL:this.empApi,accessToken:this.atomsAPIAccessToken,secretKey:this.secretKeyForDecryption,publishedDataType:yc.MapObjects,roleName:this.tileserverRoleName},this.storage)];case 1:for(t=l.sent(),this.searchStatus=t,this.emitReadinessChange(),console.log("search status: ",t),this.searchableGeoJsonFeatures=[],n=_c.getState().data,r=0;r<n.length;r++)(i=n[r])&&(o=i,a=i.lngLat,s={mapObjectId:i.mID,lngLat:a,geometry:a?{type:"Point",coordinates:a}:i.geometry,properties:Nc(o)},this.searchableGeoJsonFeatures.push(s));return e&&e(t===wc.Ready),[2]}})})},e.prototype.getSearchStatus=function(){return this.searchStatus},e.prototype.createMetaFeature=function(e,t,n,r,i,o,a){return void 0===e&&(e=null),void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=null),void 0===o&&(o=null),void 0===a&&(a=null),{mapObjectId:e,coordinates:t,name:n,whatDimension:r,whereDimension:i,geometry:o,properties:null!=a?a:{},isSearchable:!0}},e.prototype.getAllMapObjects=function(e){for(var t,n,r,i=new Set,o=[],a=0,s=this.searchableGeoJsonFeatures;a<s.length;a++){var l=s[a],u=null===(t=l.properties)||void 0===t?void 0:t.myMapObjectId;if(null!=u&&!i.has(u)){i.add(u);var c=null!==(n=l.lngLat)&&void 0!==n?n:"Point"===(null===(r=l.geometry)||void 0===r?void 0:r.type)?l.geometry.coordinates:null;o.push(this.createMetaFeature(l.properties.myMapObjectId,c,l.properties.title,l.properties.dimension_what,l.properties.dimension_where,l.geometry,l.properties))}}e(o)},e.prototype.getMapObjectsByName=function(e,t,n,r){var i,o;void 0===t&&(t=!1);for(var a=new Set,s=[],l=this.normalize(e),u=0,c=this.searchableGeoJsonFeatures;u<c.length;u++){var h=c[u],d=h.properties.myMapObjectId,p=this.normalize(h.properties.title);if((!t||p.includes(l))&&((t||p===l)&&!a.has(d))){a.add(d);var f=null!==(i=h.lngLat)&&void 0!==i?i:"Point"===(null===(o=h.geometry)||void 0===o?void 0:o.type)?h.geometry.coordinates:null,g=this.createMetaFeature(h.properties.myMapObjectId,f,h.properties.title,h.properties.dimension_what,h.properties.dimension_where,h.geometry,h.properties);s.push(g)}}r(this.sort(s,n,e))},e.prototype.getMapObjectById=function(e,t){for(var n=[],r=0,i=this.searchableGeoJsonFeatures;r<i.length;r++){var o=i[r],a=o.properties.myMapObjectId;if(String(a)===String(e)){var s=this.createMetaFeature(o.properties.myMapObjectId,o.lngLat,o.properties.title,o.properties.dimension_what,o.properties.dimension_where,o.geometry,o.properties);n.push(s)}}t(n)},e.prototype.getMapObjectByLocalRef=function(e,t){for(var n=[],r=0,i=this.searchableGeoJsonFeatures;r<i.length;r++){var o=i[r],a=o.properties.localRef;if(String(a)===String(e)){var s=this.createMetaFeature(o.properties.myMapObjectId,o.lngLat,o.properties.title,o.properties.dimension_what,o.properties.dimension_where,o.geometry,o.properties);n.push(s)}}t(n)},e.prototype.getMapObjectsByWhatTaxonomy=function(e,t){for(var n=[],r=0,i=this.searchableGeoJsonFeatures;r<i.length;r++){var o=i[r],a=o.properties.dimension_what;if(String(a)===String(e)){var s=this.createMetaFeature(o.properties.myMapObjectId,o.lngLat,o.properties.title,o.properties.dimension_what,o.properties.dimension_where,o.geometry,o.properties);n.push(s)}}t(n)},e.prototype.getMapObjectsByWhereTaxonomy=function(e,t){for(var n=[],r=0,i=this.searchableGeoJsonFeatures;r<i.length;r++){var o=i[r],a=o.properties.dimension_where;if(String(a)===String(e)){var s=this.createMetaFeature(o.properties.myMapObjectId,o.lngLat,o.properties.title,o.properties.dimension_what,o.properties.dimension_where,o.geometry,o.properties);n.push(s)}}t(n)},e.prototype.getMapObjectsByWhatAndWhereTaxonomy=function(e,t,n){for(var r=[],i=0,o=this.searchableGeoJsonFeatures;i<o.length;i++){var a=o[i],s=a.properties.dimension_where,l=a.properties.dimension_what;if(String(s)===String(t)&&String(l)===String(e)){var u=this.createMetaFeature(a.properties.myMapObjectId,a.lngLat,a.properties.title,a.properties.dimension_what,a.properties.dimension_where,a.geometry,a.properties);r.push(u)}}n(r)},e.prototype.getMapObjectsInWhatTaxonomy=function(e,t){for(var n=[],r=0,i=this.searchableGeoJsonFeatures;r<i.length;r++){var o=i[r],a=o.properties.dimension_what;if(e.includes(String(a))){var s=this.createMetaFeature(o.properties.myMapObjectId,o.lngLat,o.properties.title,o.properties.dimension_what,o.properties.dimension_where,o.geometry,o.properties);n.push(s)}}t(n)},e.prototype.getMapObjectsInWhereTaxonomy=function(e,t){for(var n=[],r=0,i=this.searchableGeoJsonFeatures;r<i.length;r++){var o=i[r],a=o.properties.dimension_where;if(e.includes(String(a))){var s=this.createMetaFeature(o.properties.myMapObjectId,o.lngLat,o.properties.title,o.properties.dimension_what,o.properties.dimension_where,o.geometry,o.properties);n.push(s)}}t(n)},e.prototype.getMapObjectsInWhatAndWhereTaxonomy=function(e,t,n){for(var r=[],i=0,o=this.searchableGeoJsonFeatures;i<o.length;i++){var a=o[i],s=a.properties.dimension_where,l=a.properties.dimension_what;if(t.includes(String(s))&&e.includes(String(l))){var u=this.createMetaFeature(a.properties.myMapObjectId,a.lngLat,a.properties.title,a.properties.dimension_what,a.properties.dimension_where,a.geometry,a.properties);r.push(u)}}n(r)},e.prototype.geofence=function(e,t,n){var r=this;void 0===t&&(t=2),k({url:"".concat(this.empApi,"/geofence"),headers:{Authorization:"Bearer ".concat(this.atomsAPIAccessToken),"Content-Type":"application/json"},method:"POST",data:JSON.stringify({point:e,padding:t})}).then(function(e){return I(r,void 0,void 0,function(){var t;return z(this,function(r){return(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchableMOs)&&n(e.data.searchableMOs),[2]})})}).catch(function(e){console.log("error occured while geofencing",e),n([])})},e}(),Ic=function(){function e(e){void 0===e&&(e={});var t,n,r,i,o=this;this.onCompassSensorUpdate=function(e){o.handleCompassUpdate(e)},this.cameraDirector=_l(),this.marker={show:function(){},hide:function(){},remove:function(){},update:function(){},updateHeading:function(){}},this.sensorsAttached=!1,this.markerAttached=!1,this.locationCallbacks=new Set,this.errorCallbacks=new Set,this.toggleCallbacks=new Set,this.compassCallbacks=new Set,this.lastProcessedPosition=null,this.lastExternalGpsPosition=null,this.lastAppliedPose=null,this.lastAppliedCameraStop=null,this.lastHeadingMarkerDeg=null,this.sdkMode="normal",this.follow=!0,this.headingFollow=!1,this.lastHeadingCameraUpdateMs=0,this.lastHeadingFollowCenterUpdateMs=0,this.lastHeadingCameraEaseDeg=null,this.lastCameraBearingUnwrapped=null,this.lastCameraUpdateMs=0,this.gps=null!==(t=e.gps)&&void 0!==t?t:cl(),this.compass=null!==(n=e.compass)&&void 0!==n?n:hl(),this.motion=null!==(r=e.motion)&&void 0!==r?r:dl(),this.getFocusTree=null!==(i=e.getFocusTree)&&void 0!==i?i:function(){return null},this.compass.addCallback({onCompassUpdate:this.onCompassSensorUpdate})}return e.prototype.attachSensors=function(e){this.installSensors(e),this.sensorsAttached=!0},e.prototype.detachSensors=function(){var e;this.gps.disableGPS(),this.compass.disableCompass(),null===(e=this.motion)||void 0===e||e.stop(),this.installSensors({gps:cl(),compass:hl(),motion:dl()}),this.sensorsAttached=!1},e.prototype.attachCameraDirector=function(e){var t=this;this.cameraDirector=e,e.attachFollowBreaker({breakFollow:function(){t.setFollow(!1)}})},e.prototype.detachCameraDirector=function(){this.cameraDirector.detachFollowBreaker(),this.cameraDirector=_l()},e.prototype.attachMarker=function(e){this.marker=e,this.markerAttached=!0},e.prototype.detachMarker=function(){this.marker={show:function(){},hide:function(){},remove:function(){},update:function(){},updateHeading:function(){}},this.markerAttached=!1},e.prototype.getReadiness=function(){var e=[];return this.sensorsAttached||e.push("sensors"),this.markerAttached||e.push("marker"),ml(e)},e.prototype.getSdkMode=function(){return this.sdkMode},e.prototype.getIsNavigating=function(){return"navigation"===this.sdkMode},e.prototype.isCompassPermissionDenied=function(){return this.compass.isCompassPermissionDenied()},e.prototype.enterNavigationMode=function(){this.clearNormalHeadingCameraFollowInternal({easeMapToNorthUp:!1}),this.sdkMode="navigation",this.follow=!0,this.marker.show()},e.prototype.enterNormalMode=function(){this.sdkMode="normal",this.follow=!0,this.marker.show(),this.marker.updateHeading(null),this.lastHeadingMarkerDeg=null},e.prototype.notifyUserGesture=function(){this.gps.isGPSEnabled()&&(this.follow=!1,this.emitToggle())},e.prototype.getCameraFollowState=function(){return"navigation"===this.sdkMode?{mode:"navigation",owner:"navigation",isFollowing:this.isFollowing()}:{mode:"normal",owner:"gps",isFollowing:this.gps.isGPSEnabled()&&this.isFollowing(),followsHeading:this.headingFollow}},e.prototype.applyPose=function(e){"navigation"===this.sdkMode&&this.writeMarker(e)},e.prototype.applyCameraStop=function(e,t){void 0===t&&(t={}),"navigation"===this.sdkMode&&this.commitCameraStop(e,t)},e.prototype.recenter=function(e){var t,n,r;return I(this,void 0,void 0,function(){var i,o,a;return z(this,function(s){switch(s.label){case 0:return this.follow=!0,this.emitToggle(),"navigation"===this.sdkMode?(i=this.lastAppliedCameraStop,o=this.lastAppliedPose,i||o?(a=(null==e?void 0:e.useDefaultZoom)?19:this.cameraDirector.getZoom()||(null==i?void 0:i.zoom)||19,this.commitCameraStop({center:null!==(t=null==i?void 0:i.center)&&void 0!==t?t:o.coordinates,bearing:null==i?void 0:i.bearing,pitch:null!==(n=null==i?void 0:i.pitch)&&void 0!==n?n:60,zoom:a,paddingFraction:null!==(r=null==i?void 0:i.paddingFraction)&&void 0!==r?r:{top:.3},durationMs:300,easing:"linear"},{force:!0}),[2]):[2]):[4,this.focusToGPS({flyToLocation:!0,duration:1e3})];case 1:return s.sent(),[2]}})})},e.prototype.addCallback=function(e){e.onLocationUpdate&&this.locationCallbacks.add(e.onLocationUpdate),e.onError&&this.errorCallbacks.add(e.onError),e.onToggle&&this.toggleCallbacks.add(e.onToggle),e.onCompassUpdate&&this.compassCallbacks.add(e.onCompassUpdate)},e.prototype.removeCallback=function(e){e.onLocationUpdate&&this.locationCallbacks.delete(e.onLocationUpdate),e.onError&&this.errorCallbacks.delete(e.onError),e.onToggle&&this.toggleCallbacks.delete(e.onToggle),e.onCompassUpdate&&this.compassCallbacks.delete(e.onCompassUpdate)},e.prototype.simulatePosition=function(e,t){void 0===t&&(t=5);var n={coordinates:e,accuracy:t,timestamp:Date.now()};this.applyGpsSample(n)},e.prototype.enableGPS=function(e){var t,n,r,i;return void 0===e&&(e={}),I(this,void 0,void 0,function(){var o,a,s,l,u,c=this;return z(this,function(h){switch(h.label){case 0:(null===(t=e.callbacks)||void 0===t?void 0:t.onLocationUpdate)&&this.locationCallbacks.add(e.callbacks.onLocationUpdate),(null===(n=e.callbacks)||void 0===n?void 0:n.onError)&&this.errorCallbacks.add(e.callbacks.onError),(null===(r=e.callbacks)||void 0===r?void 0:r.onToggle)&&this.toggleCallbacks.add(e.callbacks.onToggle),this.marker.show(),this.follow=!1!==e.trackUserLocation,h.label=1;case 1:return h.trys.push([1,9,,10]),[4,this.gps.isGPSPermissionGranted()];case 2:if(!h.sent())return o={type:"permission_denied",message:"GPS permission is required to enable location services."},this.fanoutError(o,o.message),[2,{success:!1,warning:o}];h.label=3;case 3:return h.trys.push([3,5,,6]),[4,this.compass.enableCompass()];case 4:case 5:return h.sent(),[3,6];case 6:return[4,this.gps.getGPSPosition(e)];case 7:return a=h.sent(),s=this.isPositionWithinBounds(a.coordinates),[4,this.gps.enableGPS(j(j({},e),{callbacks:{onLocationUpdate:function(t){var n;c.handleRealGPSUpdate(t,c.shouldFlyTo(e.flyToLocation),null!==(n=e.zoom)&&void 0!==n?n:18)},onError:function(e,t){c.fanoutError(e,t)},onToggle:function(e){c.toggleCallbacks.forEach(function(t){try{t(e)}catch(e){}})}}}))];case 8:return l=h.sent(),this.handleRealGPSUpdate(a,this.shouldFlyTo(e.flyToLocation),null!==(i=e.zoom)&&void 0!==i?i:18),l.success?s?[2,{success:!0}]:[2,{success:!0,warning:{type:"outside_bounds",message:"You are currently outside of operational boundaries. GPS functionality may be limited.",position:a}}]:[2,l];case 9:return u=h.sent(),this.fanoutError(u,"Failed to enable GPS due to an unexpected error."),[2,{success:!1,warning:{type:"unavailable",message:"Failed to enable GPS due to an unexpected error."}}];case 10:return[2]}})})},e.prototype.installSensors=function(e){var t;this.compass.removeCallback({onCompassUpdate:this.onCompassSensorUpdate}),this.gps=e.gps,this.compass=e.compass,this.motion=null!==(t=e.motion)&&void 0!==t?t:null,this.compass.addCallback({onCompassUpdate:this.onCompassSensorUpdate})},e.prototype.ensureRequiredSensors=function(e){var t,n,r;return I(this,void 0,void 0,function(){var i,o,a,s,l,u,c,h,d=this;return z(this,function(p){switch(p.label){case 0:if(!this.sensorsAttached)throw new vl(["sensors"]);if(0===e.length)return[2,!0];i=e.includes("gps"),o=e.includes("compass"),a=e.includes("motion"),s=this.gps.isGPSEnabled(),l=this.compass.isCompassEnabled(),u=!1,c=!1,h=function(){u&&d.disableGPS(),c&&d.compass.disableCompass()},p.label=1;case 1:return p.trys.push([1,10,,11]),!i||s?[3,3]:[4,this.enableGPS({flyToLocation:!0,trackUserLocation:!0})];case 2:if(!p.sent().success)return[2,!1];u=!0,p.label=3;case 3:return!o||l?[3,5]:[4,this.compass.enableCompass()];case 4:if(!p.sent())return h(),[2,!1];c=!0,p.label=5;case 5:return a?[4,null===(n=null===(t=this.motion)||void 0===t?void 0:t.requestPermission)||void 0===n?void 0:n.call(t)]:[3,7];case 6:if(!(null===(r=p.sent())||void 0===r||r))return h(),[2,!1];p.label=7;case 7:return i?[4,this.gps.getGPSPosition({enableHighAccuracy:!0,timeout:1e4,maximumAge:5e3})]:[3,9];case 8:if(!p.sent())return h(),[2,!1];p.label=9;case 9:return[2,!0];case 10:return p.sent(),h(),[2,!1];case 11:return[2]}})})},e.prototype.disableGPS=function(){this.clearNormalHeadingCameraFollowInternal({easeMapToNorthUp:!0}),this.compass.disableCompass(),this.gps.disableGPS(),this.follow=!0,this.lastProcessedPosition=null,this.lastAppliedPose=null,this.lastAppliedCameraStop=null,this.lastHeadingMarkerDeg=null,this.lastHeadingCameraEaseDeg=null,this.lastCameraBearingUnwrapped=null,this.marker.hide(),this.emitToggle()},e.prototype.requestGPSPermission=function(){return I(this,void 0,void 0,function(){return z(this,function(e){return[2,this.gps.requestGPSPermission()]})})},e.prototype.isGPSPermissionGranted=function(){return I(this,void 0,void 0,function(){return z(this,function(e){return[2,this.gps.isGPSPermissionGranted()]})})},e.prototype.focusToGPS=function(e){var t,n,r;return void 0===e&&(e={}),I(this,void 0,void 0,function(){var i,o,a,s,l,u,c,h;return z(this,function(d){if(i=e.zoom,o=e.duration,a=void 0===o?1e3:o,s=e.flyToLocation,l=void 0===s||s,this.follow=!0,this.emitToggle(),!(u=null!==(n=null===(t=this.lastProcessedPosition)||void 0===t?void 0:t.coordinates)&&void 0!==n?n:null===(r=this.lastAppliedPose)||void 0===r?void 0:r.coordinates))throw{type:"unavailable",message:"Unable to determine current location. GPS may not be available."};return l&&(void 0===(c=i)&&(h=this.cameraDirector.getZoom(),c=h>0?h:18),this.commitCameraStop({center:u,zoom:c,durationMs:a,easing:"ease"},{force:!0})),[2,{success:!0}]})})},e.prototype.setNormalHeadingCameraFollow=function(e){if(e){if("navigation"===this.sdkMode)return;if(!this.gps.isGPSEnabled()||!this.follow||this.compass.isCompassPermissionDenied())return;if(!this.compass.isCompassEnabled())return;this.headingFollow=!0;var t=this.compass.getCompassHeading();return null!=t&&Number.isFinite(t)&&(this.lastHeadingCameraEaseDeg=null,this.applyNormalHeading(t)),void this.emitToggle()}this.clearNormalHeadingCameraFollowInternal({easeMapToNorthUp:!0})},e.prototype.isNormalHeadingCameraFollowEnabled=function(){return this.headingFollow},e.prototype.clearNormalHeadingCameraFollowForNavigation=function(){this.clearNormalHeadingCameraFollowInternal({easeMapToNorthUp:!1})},e.prototype.isFollowing=function(){return this.follow},e.prototype.setFollow=function(e){this.follow=e,this.emitToggle()},e.prototype.getGPSPosition=function(e){return I(this,void 0,void 0,function(){var t;return z(this,function(n){switch(n.label){case 0:return[4,this.gps.getGPSPosition(e)];case 1:return t=n.sent(),this.lastProcessedPosition=t,[2,t]}})})},e.prototype.showBlueDot=function(){this.marker.updateHeading(null),this.lastHeadingMarkerDeg=null},e.prototype.hideBlueDot=function(){null!=this.lastHeadingMarkerDeg&&this.marker.updateHeading(this.lastHeadingMarkerDeg)},e.prototype.show=function(){this.marker.show()},e.prototype.hide=function(){this.marker.hide()},e.prototype.getCurrentPosition=function(){return this.lastProcessedPosition},e.prototype.getExternalGpsPosition=function(){var e,t=null===(e=this.lastExternalGpsPosition)||void 0===e?void 0:e.coordinates;return!t||t.length<2?null:{coordinates:[t[0],t[1]]}},e.prototype.isGPSEnabled=function(){return this.gps.isGPSEnabled()},e.prototype.isCompassEnabled=function(){return this.compass.isCompassEnabled()},e.prototype.getZoom=function(){return this.cameraDirector.getZoom()},e.prototype.startMotion=function(e){var t;null===(t=this.motion)||void 0===t||t.start(e)},e.prototype.stopMotion=function(){var e;null===(e=this.motion)||void 0===e||e.stop()},e.prototype.destroy=function(){var e;this.clearNormalHeadingCameraFollowInternal({easeMapToNorthUp:!1}),this.gps.destroyGPS(),this.compass.disableCompass(),null===(e=this.motion)||void 0===e||e.stop(),this.marker.remove(),this.locationCallbacks.clear(),this.errorCallbacks.clear(),this.toggleCallbacks.clear(),this.compassCallbacks.clear(),this.lastProcessedPosition=null,this.lastExternalGpsPosition=null,this.lastAppliedPose=null,this.lastAppliedCameraStop=null,this.detachCameraDirector(),this.detachMarker()},e.prototype.applyGpsSample=function(e){this.marker.show(),this.handleRealGPSUpdate(e,!1)},e.prototype.triggerGPSUpdate=function(e){this.gps.isGPSEnabled()?console.error("Internal GPS is already enabled, skipping triggerGPSUpdate, please disable internal GPS first"):this.compass.isCompassEnabled()?console.error("Compass is already enabled, skipping triggerGPSUpdate, please disable compass first"):(this.lastExternalGpsPosition=function(e){return{coordinates:[e.coordinates[0],e.coordinates[1]],accuracy:e.accuracy,timestamp:e.timestamp||Date.now(),heading:e.heading,speed:e.speed,altitude:e.altitude,altitudeAccuracy:e.altitudeAccuracy}}(e),this.applyGpsSample(e),this.emitExternalHeading(e))},e.prototype.shouldFlyTo=function(e){return void 0===e&&(e=!0),this.follow&&e},e.prototype.handleRealGPSUpdate=function(e,t,n){var r,i,o;if(this.lastProcessedPosition={coordinates:[e.coordinates[0],e.coordinates[1]],accuracy:e.accuracy,timestamp:e.timestamp||Date.now(),heading:null!==(r=e.heading)&&void 0!==r?r:void 0,speed:null!==(i=e.speed)&&void 0!==i?i:void 0,altitude:e.altitude,altitudeAccuracy:e.altitudeAccuracy},this.locationCallbacks.forEach(function(t){try{t(e)}catch(e){}}),"navigation"!==this.sdkMode){var a=null!=this.lastHeadingMarkerDeg?this.lastHeadingMarkerDeg:null!==(o=e.heading)&&void 0!==o?o:null;this.writeMarker({coordinates:this.lastProcessedPosition.coordinates,accuracy:e.accuracy,heading:a}),this.headingFollow?this.syncHeadingFollowCenterFromGps():t&&this.focusToGPS({zoom:n,flyToLocation:t}).catch(function(){})}},e.prototype.handleCompassUpdate=function(e){this.compassCallbacks.forEach(function(t){try{t(e)}catch(e){}}),this.compass.isCompassPermissionDenied()||this.gps.isGPSEnabled()&&"navigation"!==this.sdkMode&&this.applyNormalHeading(e.heading)},e.prototype.applyNormalHeading=function(e){var t,n,r;if(null===e||!Number.isFinite(e))return this.lastHeadingMarkerDeg=null,this.lastHeadingCameraEaseDeg=null,this.lastCameraBearingUnwrapped=null,void this.marker.updateHeading(null);var i=null===(t=this.lastProcessedPosition)||void 0===t?void 0:t.coordinates,o=null!==(r=null===(n=this.lastProcessedPosition)||void 0===n?void 0:n.accuracy)&&void 0!==r?r:5;if(i?this.writeMarker({coordinates:i,accuracy:o,heading:e}):this.writeHeadingOnly(e),this.headingFollow&&this.follow&&"navigation"!==this.sdkMode&&!(null!==this.lastHeadingCameraEaseDeg&&zc(e,this.lastHeadingCameraEaseDeg)<3)&&i&&!(i.length<2)){var a=Date.now();if(!(a-this.lastHeadingCameraUpdateMs<48)){this.lastHeadingCameraUpdateMs=a,this.lastHeadingCameraEaseDeg=e;var s=this.unwrapCameraBearing(e);this.commitCameraStop({center:i,bearing:s,pitch:56,zoom:this.cameraDirector.getZoom()||18,paddingFraction:{top:.22},durationMs:280,easing:"linear"})}}},e.prototype.commitCameraStop=function(e,t){if(void 0===t&&(t={}),this.follow){var n=Date.now();!t.force&&n-this.lastCameraUpdateMs<48||(this.lastCameraUpdateMs=n,this.lastAppliedCameraStop=e,this.cameraDirector.submit(e,"user-location"))}},e.prototype.writeHeadingOnly=function(e){(null===this.lastHeadingMarkerDeg||zc(e,this.lastHeadingMarkerDeg)>=3)&&(this.marker.updateHeading(e),this.lastHeadingMarkerDeg=e)},e.prototype.writeMarker=function(e){var t=null!=e.heading&&Number.isFinite(e.heading)?e.heading:null;if(null==t)return this.marker.update(e.coordinates,e.accuracy,null),void(this.lastAppliedPose={coordinates:e.coordinates,accuracy:e.accuracy,heading:null});var n=null===this.lastHeadingMarkerDeg||zc(t,this.lastHeadingMarkerDeg)>=3,r=n?t:this.lastHeadingMarkerDeg;this.marker.update(e.coordinates,e.accuracy,r),n&&(this.lastHeadingMarkerDeg=t),this.lastAppliedPose={coordinates:e.coordinates,accuracy:e.accuracy,heading:r}},e.prototype.syncHeadingFollowCenterFromGps=function(){var e;if(this.headingFollow&&this.gps.isGPSEnabled()&&this.follow&&"navigation"!==this.sdkMode){var t=null===(e=this.lastProcessedPosition)||void 0===e?void 0:e.coordinates;if(t&&!(t.length<2)){var n=Date.now();n-this.lastHeadingFollowCenterUpdateMs<48||(this.lastHeadingFollowCenterUpdateMs=n,this.commitCameraStop(j(j({center:t},null!=this.lastCameraBearingUnwrapped?{bearing:this.lastCameraBearingUnwrapped}:{}),{pitch:56,durationMs:200,easing:"linear"})))}}},e.prototype.clearNormalHeadingCameraFollowInternal=function(e){var t,n=this.headingFollow;if(this.headingFollow=!1,this.lastHeadingCameraEaseDeg=null,n&&e.easeMapToNorthUp){var r=null===(t=this.lastProcessedPosition)||void 0===t?void 0:t.coordinates;if(r){var i=this.unwrapCameraBearing(0);this.commitCameraStop({center:r,bearing:i,pitch:0,durationMs:400,easing:"ease"},{force:!0})}}this.lastCameraBearingUnwrapped=null,n&&this.emitToggle()},e.prototype.unwrapCameraBearing=function(e){var t=this.lastCameraBearingUnwrapped;if(null==t)return this.lastCameraBearingUnwrapped=e,e;var n=t+function(e,t){var n=(e%360+360)%360,r=(t%360+360)%360-n;r>180&&(r-=360);r<-180&&(r+=360);return r}(t,e);return this.lastCameraBearingUnwrapped=n,n},e.prototype.isPositionWithinBounds=function(e){var t,n=this.getFocusTree();if(!n||"object"!==te(n))return!1;for(var r=e[0],i=e[1],o=0,a=Object.keys(n);o<a.length;o++){var s=n[a[o]],l=null==s?void 0:s.bounds;if(l&&Array.isArray(l))try{if(2===l.length&&Array.isArray(l[0])&&"number"==typeof l[0][0]&&Array.isArray(l[1])&&"number"==typeof l[1][0]&&!Array.isArray(l[0][0])){var u=l[0],c=l[1];if(r>=u[0]&&r<=c[0]&&i>=u[1]&&i<=c[1])return!0;continue}var h=Array.isArray(null===(t=l[0])||void 0===t?void 0:t[0])?l[0]:l;if(!Array.isArray(h)||h.length<3)continue;for(var d=1/0,p=1/0,f=-1/0,g=-1/0,m=0,v=h;m<v.length;m++){var y=v[m];Array.isArray(y)&&"number"==typeof y[0]&&(d=Math.min(d,y[0]),p=Math.min(p,y[1]),f=Math.max(f,y[0]),g=Math.max(g,y[1]))}if(Number.isFinite(d)&&r>=d&&r<=f&&i>=p&&i<=g)return!0}catch(e){continue}}return!1},e.prototype.emitToggle=function(){var e=this.gps.isGPSEnabled()&&this.isFollowing();this.toggleCallbacks.forEach(function(t){try{t(e)}catch(e){}})},e.prototype.fanoutError=function(e,t){this.errorCallbacks.forEach(function(n){try{n(e,t)}catch(e){}})},e.prototype.emitExternalHeading=function(e){if(void 0!==e.heading&&null!==e.heading){var t=e.heading,n={heading:t,accuracy:e.accuracy?Math.round(e.accuracy):null,timestamp:Date.now(),isCalibrated:Number.isFinite(t)};this.compassCallbacks.forEach(function(e){try{e(n)}catch(e){}})}},e}();function zc(e,t){var n=Math.abs(e-t)%360;return n>180?360-n:n}function Bc(e){var t=JSON.parse(e);if(!Array.isArray(t))throw new Error("Dead zones JSON must be a top-level array");for(var n=0,r=t;n<r.length;n++){var i=r[n];if(!i||"object"!==te(i)||"string"!=typeof i.id)throw new Error("Each dead zone must have a string id");var o=i.geometry;if(!o||"Polygon"!==o.type||!Array.isArray(o.coordinates))throw new Error("Dead zone ".concat(i.id,": geometry must be GeoJSON Polygon"))}return t}function Uc(e,t,n){if(!n.length)return null;for(var r=ve(e),i=0,o=n;i<o.length;i++){var a=o[i],s=a.whereDimension;if(null==s||""===s||t&&s===t)try{if(ll(r,a.geometry))return a}catch(e){continue}}return null}var Hc=function(e,t){for(var n=t-e;n>180;)n-=360;for(;n<-180;)n+=360;return n},Gc=function(e){for(var t=e;t<0;)t+=360;for(;t>=360;)t-=360;return t};function Wc(e,t){var n,r;void 0===t&&(t={});var i=null!==(n=t.turnAngleMinDeg)&&void 0!==n?n:22,o=null!==(r=t.minLegM)&&void 0!==r?r:3;if(!e||e.length<2)return[];for(var a=function(e){for(var t=[0],n=1;n<e.length;n+=1){var r=e[n-1],i=e[n];t.push(t[n-1]+ta(r,i,{units:"meters"}))}return t}(e),s=e.length,l=[],u=1;u<s-1;u+=1){var c=ia(e[u-1],e[u]),h=ia(e[u],e[u+1]);Math.abs(Hc(c,h))>=i&&l.push(u)}for(var d=[],p=0,f=0,g=l;f<g.length;f++){var m=g[f],v=m;if(!(v<=p)){var y=e[p],w=e[v],b=a[v]-a[p],_=ia(y,w);d.push({type:"straight",lengthM:b,bearingDeg:Gc(_),startAlongM:a[p],endAlongM:a[v]});c=ia(e[m-1],e[m]),h=ia(e[m],e[m+1]);var x=Hc(c,h);d.push({type:"turn",atAlongM:a[m],entryBearingDeg:Gc(c),exitBearingDeg:Gc(h),turnAngleDeg:x}),p=m}}if(p<s-1){y=e[p],w=e[s-1],b=a[s-1]-a[p],_=ia(y,w);d.push({type:"straight",bearingDeg:Gc(_),lengthM:b,startAlongM:a[p],endAlongM:a[s-1]})}return function(e,t){if(0===e.length||t<=0)return e;for(var n=[],r=0;r<e.length;r+=1){var i=e[r];if("straight"===i.type&&i.lengthM<t&&n.length>0){var o=n[n.length-1];if("straight"===o.type){n[n.length-1]={type:"straight",lengthM:o.lengthM+i.lengthM,bearingDeg:i.bearingDeg,startAlongM:o.startAlongM,endAlongM:i.endAlongM};continue}}n.push(i)}return n}(d,o)}function Vc(e,t,n){if(!e.length||n<=0)return null;for(var r=Math.max(0,Math.min(t,n)),i=null,o=0,a=e;o<a.length;o++){var s=a[o];if("straight"===s.type){if(r>=s.startAlongM&&r<=s.endAlongM+1e-6)return s.bearingDeg;i=s.bearingDeg}}for(var l=e.length-1;l>=0;l-=1)if("straight"===e[l].type)return e[l].bearingDeg;return i}function qc(e,t){for(var n=Math.max(0,t),r=-1,i=0;i<e.length;i+=1){var o=e[i];if("straight"===o.type&&(r+=1,n>=o.startAlongM&&n<=o.endAlongM+1e-6))return r}return Math.max(0,r)}var Zc=new Map;function Yc(e,t,n){var r,i,o="".concat(e,"|").concat(function(e){for(var t=0,n=0;n<e.length;n+=1){var r=e[n];t=(t<<5)-t+(1e6*r[0]+r[1])*(n+1)|0}return String(t)}(t),"|").concat(null!==(r=null==n?void 0:n.turnAngleMinDeg)&&void 0!==r?r:"","|").concat(null!==(i=null==n?void 0:n.minLegM)&&void 0!==i?i:""),a=Zc.get(o);return a||(a=Wc(t,n),Zc.set(o,a)),a}function $c(e){return e.length<2?0:xs(ye(e),{units:"meters"})}function Jc(e,t,n){for(var r=e,i=t-r;i>180;)i-=360;for(;i<-180;)i+=360;for(var o=r+i*n;o<0;)o+=360;for(;o>=360;)o-=360;return o}function Kc(e,t){var n,r,i,o;if(!(null===(n=null==e?void 0:e.segments)||void 0===n?void 0:n.length))return null;for(var a=t.whereDimension,s=t.forwardFloor,l=t.requireWhereDimensionMatch,u=[],c=function(e,t){return Math.abs(e[0]-t[0])<1e-7&&Math.abs(e[1]-t[1])<1e-7},h=Math.max(0,s);h<e.segments.length;h+=1){var d=e.segments[h];if(d.maneuverType!==Uu.RouteOverview&&d.maneuverType!==Uu.SectionOverview&&(!l||!a||d.whereDimension===a)){var p=null!==(i=null===(r=d.features)||void 0===r?void 0:r.find(function(e){var t;return"LineString"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}))&&void 0!==i?i:null===(o=d.features)||void 0===o?void 0:o[1];if(p&&"LineString"===p.geometry.type){var f=p.geometry.coordinates;if(!(f.length<2)){var g=0;u.length>0&&c(u[u.length-1],f[0])&&(g=1);for(var m=g;m<f.length;m+=1)u.push(f[m])}}}}if(u.length<2)return null;var v=ye(u,{});return xs(v,{units:"meters"})<=0?null:{line:v}}var Xc=function(){function e(){this.built=null,this.snapped=!1,this.lastAlongM=0,this.lastDisplay=null,this.lastDisplayHeadingDeg=null,this.lastRawFix=null,this.lightSmoothRaw=null,this.transitionBlend=0,this.lastDebugSnapshot=null}return e.prototype.reset=function(){this.built=null,this.snapped=!1,this.lastAlongM=0,this.lastDisplay=null,this.lastDisplayHeadingDeg=null,this.lastRawFix=null,this.lightSmoothRaw=null,this.transitionBlend=0,this.lastDebugSnapshot=null},e.prototype.getDebugSnapshot=function(){return this.lastDebugSnapshot},e.prototype.setTrackingLine=function(e){this.built=e,e||(this.snapped=!1)},e.prototype.seedFromEnginePose=function(e,t,n){var r;this.lastDisplayHeadingDeg=null;var i=this.confidenceFromAccuracy(t),o=this.scaledThresholds(t),a=o.enter,s=o.exit;if(!this.built||this.built.line.geometry.coordinates.length<2){this.lastDisplay=null,this.lastDisplayHeadingDeg=null;var l=this.smoothUnsnapped(e,t);this.lastDisplay=l,this.snapped=!1,this.lastAlongM=0,this.lastRawFix={coords:e,t:n},this.lightSmoothRaw=B([],e,!0),this.transitionBlend=0;var u=Math.max(t,5);return this.lastDebugSnapshot={hasTrackingLine:!1,trackingLineLengthM:0,snapped:!1,reportedAccuracyM:t,accuracyForScalingM:u,enterThresholdM:a,exitThresholdM:s,rawDistanceToRouteM:1/0,smoothedDistanceForEnterM:1/0,lastAlongRouteM:this.lastAlongM,standstill:!1,confidence:i,routeHeadingDeg:null},{displayCoords:l,snapped:!1,rawDistanceToRouteM:1/0,displayHeadingDeg:null,confidence:i}}var c=this.built.line,h=xs(c,{units:"meters"}),d=_s(c,ve(e),{units:"meters"}),p=null!==(r=d.properties.dist)&&void 0!==r?r:1/0;this.lightSmoothRaw=B([],e,!0);var f=p,g=this.snapped;this.snapped?p>s&&(g=!1,this.transitionBlend=1):f<=a&&(g=!0,this.transitionBlend=1),this.lastRawFix={coords:e,t:n};var m,v=Math.max(0,Math.min(h,d.properties.location));this.lastAlongM=v;var y=null;if(g){var w=ec(c,v,{units:"meters"}).geometry.coordinates,b=ia(w,ec(c,Math.min(v+5,h),{units:"meters"}).geometry.coordinates);for(Number.isFinite(b)||(b=0);b<0;)b+=360;for(;b>=360;)b-=360;null===this.lastDisplayHeadingDeg?this.lastDisplayHeadingDeg=b:this.lastDisplayHeadingDeg=Jc(this.lastDisplayHeadingDeg,b,.22+.12*(1-i)),y=this.lastDisplayHeadingDeg,m=w}else this.lastDisplayHeadingDeg=null,this.lastDisplay=null,m=this.smoothUnsnapped(e,t),y=null;this.snapped=g,this.lastDisplay=m;var _=Math.max(t,5);return this.lastDebugSnapshot={hasTrackingLine:!0,trackingLineLengthM:h,snapped:this.snapped,reportedAccuracyM:t,accuracyForScalingM:_,enterThresholdM:a,exitThresholdM:s,rawDistanceToRouteM:p,smoothedDistanceForEnterM:f,lastAlongRouteM:this.lastAlongM,standstill:!1,confidence:i,routeHeadingDeg:y},{displayCoords:m,snapped:this.snapped,rawDistanceToRouteM:p,displayHeadingDeg:y,confidence:i}},e.prototype.confidenceFromAccuracy=function(e){var t=Math.max(e,5);return Math.max(0,Math.min(1,1-(t-5)/45))},e.prototype.scaledThresholds=function(e){var t=Math.max(e,5);return{enter:14+.45*t,exit:Math.max(20,26+.75*t)}},e.prototype.update=function(e,t,n){var r,i,o=this.confidenceFromAccuracy(t),a=this.scaledThresholds(t),s=a.enter,l=a.exit;if(!this.built||this.built.line.geometry.coordinates.length<2){var u=this.smoothUnsnapped(e,t);this.lastDisplay=u,this.snapped=!1,this.lastRawFix={coords:e,t:n};var c=Math.max(t,5),h=this.scaledThresholds(t),d=h.enter,p=h.exit;return this.lastDebugSnapshot={hasTrackingLine:!1,trackingLineLengthM:0,snapped:!1,reportedAccuracyM:t,accuracyForScalingM:c,enterThresholdM:d,exitThresholdM:p,rawDistanceToRouteM:1/0,smoothedDistanceForEnterM:1/0,lastAlongRouteM:this.lastAlongM,standstill:!1,confidence:o,routeHeadingDeg:null},{displayCoords:u,snapped:!1,rawDistanceToRouteM:1/0,displayHeadingDeg:null,confidence:o}}var f=this.built.line,g=xs(f,{units:"meters"}),m=_s(f,ve(e),{units:"meters"}),v=null!==(r=m.properties.dist)&&void 0!==r?r:1/0;if(this.lightSmoothRaw){c=.25+.35*(1-o);this.lightSmoothRaw=[this.lightSmoothRaw[0]*(1-c)+e[0]*c,this.lightSmoothRaw[1]*(1-c)+e[1]*c]}else this.lightSmoothRaw=B([],e,!0);var y=null!==(i=_s(f,ve(this.lightSmoothRaw),{units:"meters"}).properties.dist)&&void 0!==i?i:v,w=this.snapped;if(this.snapped)v>l&&(w=!1,this.transitionBlend=1);else if(y<=s){w=!0,this.transitionBlend=1;var b=m.properties.location;this.lastAlongM=Math.max(this.lastAlongM,b)}var _,x=!1;if(this.lastRawFix){var S=ta(this.lastRawFix.coords,e,{units:"meters"}),A=Math.max(0,n-this.lastRawFix.t);S<.85&&A<8e3&&(x=!0)}this.lastRawFix={coords:e,t:n};var P=null;if(w){var M=m.properties.location,C=void 0;if(x)C=this.lastAlongM;else{var k=Math.max(this.lastAlongM-3,M);C=Math.min(k,g),this.lastAlongM=C}var E=Math.max(0,Math.min(C,g)),T=ec(f,E,{units:"meters"}).geometry.coordinates,L=ia(T,ec(f,Math.min(E+5,g),{units:"meters"}).geometry.coordinates);for(Number.isFinite(L)||(L=0);L<0;)L+=360;for(;L>=360;)L-=360;null===this.lastDisplayHeadingDeg?this.lastDisplayHeadingDeg=L:this.lastDisplayHeadingDeg=Jc(this.lastDisplayHeadingDeg,L,.22+.12*(1-o)),P=this.lastDisplayHeadingDeg;var R=1+.2*(1-o);if(_=this.lastDisplay?[this.lastDisplay[0]*(1-R)+T[0]*R,this.lastDisplay[1]*(1-R)+T[1]*R]:T,this.transitionBlend>0&&this.lastDisplay&&!this.snapped){var D=.35;_=[_[0]*(1-D)+this.lastDisplay[0]*D,_[1]*(1-D)+this.lastDisplay[1]*D],this.transitionBlend=Math.max(0,this.transitionBlend-.25)}}else if(this.lastDisplayHeadingDeg=null,_=this.smoothUnsnapped(e,t),P=null,this.transitionBlend>0&&this.lastDisplay&&this.snapped){D=.35;_=[_[0]*(1-D)+this.lastDisplay[0]*D,_[1]*(1-D)+this.lastDisplay[1]*D],this.transitionBlend=Math.max(0,this.transitionBlend-.25)}this.snapped=w,this.lastDisplay=_;var F=Math.max(t,5);return this.lastDebugSnapshot={hasTrackingLine:!0,trackingLineLengthM:g,snapped:this.snapped,reportedAccuracyM:t,accuracyForScalingM:F,enterThresholdM:s,exitThresholdM:l,rawDistanceToRouteM:v,smoothedDistanceForEnterM:y,lastAlongRouteM:this.lastAlongM,standstill:x,confidence:o,routeHeadingDeg:P},{displayCoords:_,snapped:this.snapped,rawDistanceToRouteM:v,displayHeadingDeg:P,confidence:o}},e.prototype.smoothUnsnapped=function(e,t){var n=.88+.25*(1-this.confidenceFromAccuracy(t));if(!this.lastDisplay)return e;var r=this.lastDisplay[0]*(1-n)+e[0]*n,i=this.lastDisplay[1]*(1-n)+e[1]*n,o=ta(this.lastDisplay,[r,i],{units:"meters"});if(o>1){var a=1/o;r=this.lastDisplay[0]+(r-this.lastDisplay[0])*a,i=this.lastDisplay[1]+(i-this.lastDisplay[1])*a}return[r,i]},e.prototype.getSnapped=function(){return this.snapped},e}(),Qc=function(){function e(){this.pieces=[],this.totalLenM=0,this.alongM=0,this.movementHeadingDeg=null,this.lastSampleMs=0,this.magSlow=9.81,this.lastPeakMs=0,this.lastBumpForPeak=0,this.stepLengthEma=.72,this.energyEma=0,this.stopSinceMs=null,this.straightIdx=0,this.turnConfirmForwardM=0,this.pendingTurnExitBearing=null}return e.prototype.reset=function(e){this.pieces=e.pieces,this.totalLenM=Math.max(0,e.totalLenM),this.alongM=Math.max(0,Math.min(e.startAlongM,this.totalLenM)),this.movementHeadingDeg=e.initialMovementHeadingDeg,this.lastSampleMs=0,this.magSlow=9.81,this.lastPeakMs=0,this.lastBumpForPeak=0,this.stepLengthEma=.72,this.energyEma=0,this.stopSinceMs=null,this.straightIdx=qc(this.pieces,this.alongM),this.turnConfirmForwardM=0,this.pendingTurnExitBearing=null},e.prototype.getAlongM=function(){return this.alongM},e.prototype.getMovementHeadingDeg=function(){return this.movementHeadingDeg},e.prototype.getStraightPieceIndex=function(){return this.straightIdx},e.prototype.feed=function(e){var t,n=e.timestampMs,r=this.lastSampleMs>0?Math.min(.2,Math.max(0,(n-this.lastSampleMs)/1e3)):0;this.lastSampleMs=n;var i=e.accelerationIncludingGravity,o=0;i&&(o=Math.sqrt(i.x*i.x+i.y*i.y+i.z*i.z)),this.magSlow=.92*this.magSlow+.08*o;var a=o-this.magSlow;this.energyEma=.9*this.energyEma+.1*Math.abs(a);var s=!1;i&&n-this.lastPeakMs>=380&&a>1.15&&a>.4*this.lastBumpForPeak&&(s=!0,this.lastPeakMs=n),this.lastBumpForPeak=a,this.energyEma<.35?this.stopSinceMs=null!==(t=this.stopSinceMs)&&void 0!==t?t:n:this.stopSinceMs=null;var l=!(null!=this.stopSinceMs&&n-this.stopSinceMs>900),u=Vc(this.pieces,this.alongM,this.totalLenM),c=e.rotationRate;if(r>0&&l&&c&&null!=this.movementHeadingDeg){var h=c.gamma;if(Number.isFinite(h)){for(var d=this.movementHeadingDeg+h*r;d<0;)d+=360;for(;d>=360;)d-=360;this.movementHeadingDeg=d}}null!=u&&null==this.movementHeadingDeg&&(this.movementHeadingDeg=u),s&&null!=u&&null!=this.movementHeadingDeg&&(this.movementHeadingDeg=Jc(this.movementHeadingDeg,u,.07));var p=0;if(null!=u&&null!=this.movementHeadingDeg){for(var f=u-this.movementHeadingDeg;f>180;)f-=360;for(;f<-180;)f+=360;p=Math.max(0,Math.cos(f*Math.PI/180))}else p=s?.55:0;if(this.updateTurnAnchorState(u,s?this.stepLengthEma*p:0),s&&l&&this.totalLenM>0){var g=this.stepLengthEma*p,m=Math.min(this.totalLenM,this.alongM+Math.max(0,g));if(p>.2&&m>this.alongM+.05){var v=(m-this.alongM)/Math.max(p,.2);this.stepLengthEma=.92*this.stepLengthEma+.08*v,this.stepLengthEma=Math.max(.45,Math.min(1.05,this.stepLengthEma))}this.alongM=m}return this.straightIdx=qc(this.pieces,this.alongM),{alongM:this.alongM,movementHeadingDeg:this.movementHeadingDeg,moving:l,straightPieceIndex:this.straightIdx,alignmentGain:p,stepDetected:s}},e.prototype.updateTurnAnchorState=function(e,t){var n=this,r=this.pieces.find(function(e){return"turn"===e.type&&n.alongM>=e.atAlongM-.5&&n.alongM<=e.atAlongM+2.5});if(r&&null!=e&&(this.pendingTurnExitBearing=r.exitBearingDeg),null!=this.pendingTurnExitBearing&&null!=this.movementHeadingDeg){for(var i=this.movementHeadingDeg-this.pendingTurnExitBearing;i>180;)i-=360;for(;i<-180;)i+=360;Math.abs(i)<42&&t>0?this.turnConfirmForwardM+=t:t>0&&(this.turnConfirmForwardM=Math.max(0,this.turnConfirmForwardM-.5*t)),this.turnConfirmForwardM>=1.2&&(this.pendingTurnExitBearing=null,this.turnConfirmForwardM=0)}},e}(),eh=function(){function e(e,t,n,r){var i,o=this;this.gpsCallbackRef=null,this.compassCallbackRef=null,this.unsubscribeFocus=null,this.uiHandlers={},this.lastEmittedSegmentIndex=-1,this.lerpedCoords=null,this.routeArc=[],this.currentRouteStep=0,this.targetRouteStep=0,this.routeSteps=500,this.animationSpeed=1,this.SNAP_WINDOW_METERS=5,this.OFF_ROUTE_THRESHOLD_METERS=25,this.REROUTE_COOLDOWN_MS=5e3,this.lastRerouteTime=0,this.lastKnownRemainingDistanceM=null,this.arrivalLockActive=!1,this.arrivalCameraFramingApplied=!1,this.navigationCompleteEmitted=!1,this.lastRawPosition=null,this.MIN_DISTANCE_FOR_VALID_HEADING_METERS=10,this.totalDistanceTraveled=0,this.currentHeading=null,this.currentPosition=null,this.cameraPitch=60,this.cameraZoomLevel=19,this.lastWhereUsedForTracking=null,this.isNavigating=!1,this.routeAlignedHeadingDeg=null,this.frozenUnsnappedHeadingDeg=null,this.navigationSnapped=!1,this.lastSnapStateForUi=!1,this.routeFollowingEstimator=new Xc,this.routeTrackingEpoch=0,this.trackingLineCacheKey="",this.trackingLineCached=null,this.trackingLineLengthMCached=0,this.targetNavCoords=null,this.targetNavHeadingDeg=null,this.targetAlongMOnTrackingLine=null,this.targetAlongMCacheKey="",this.visualNavCoords=null,this.visualNavHeadingDeg=null,this.visualAlongMOnTrackingLine=null,this.visualAlongMCacheKey="",this.lastNavAccuracy=10,this.lastNavVisualFrameTime=0,this.lastAppliedVisualNavCoords=null,this.lastAppliedVisualHeadingDeg=null,this.tickNavVisual=function(){return o.runNavVisualFrame()},this.lastRouteProgressVisualMs=0,this.lastRouteSliceVisualNavCoords=null,this.lastBlueDotProgressVisualMs=0,this.lastAppliedRouteSliceSegmentIndex=-1,this.lastAppliedRouteSliceAlongM=-1,this.navigationLocMode="gps",this.deadZones=[],this.deadZonesUrl=null,this.deadZonesLoadPromise=null,this.activeDeadZoneId=null,this.deadZoneInsideConsecutive=0,this.pdrRawGpsOutsideConsecutive=0,this.lastDeadZoneModeSwitchMs=0,this.startAnchorLockActive=!1,this.startAnchorLockAnchorLngLat=null,this.startAnchorLockWhereTaxonomyPath=null,this.anchorPdrHandoffGoodFrames=0,this.anchorPdrBlendActive=!1,this.anchorPdrBlendW=0,this.anchorPdrBlendGpsTarget=null,this.anchorPdrLastBlendGpsTs=0,this.lastAnchorBlendBForOdom=null,this.qualityPdrBadConsecutive=0,this.qualityBlendRerouteSuppressed=!1,this.portalProgressHoldActive=!1,this.pdrLockedRouteSegmentIndex=-1,this.pdrAlongMeters=0,this.pdrLastAlongForDistanceM=null,this.pdrLockedLine=null,this.pdrEngine=new Qc,this.pdrLastFeed=null,this.pdrNavigationAllowedByUi=!0,this.lastRouteFollowingConfidence=.75,this.routingManager=e,this.userLocation=t,this.autoFocusManager=n,(null==r?void 0:r.deadZonesUrl)&&(this.deadZonesUrl=r.deadZonesUrl),(null===(i=null==r?void 0:r.deadZones)||void 0===i?void 0:i.length)&&(this.deadZones=B([],r.deadZones,!0)),this.unsubscribeFocus=Ml().subscribeToFocusChange(function(){o.onWhereTaxonomyUpdate()}),this.gpsCallbackRef=function(e){o.updateNavigationWithGPS(e)},this.userLocation.addCallback({onLocationUpdate:this.gpsCallbackRef}),this.compassCallbackRef=function(e){o.updateNavigationWithCompass(e)},this.userLocation.addCallback({onCompassUpdate:this.compassCallbackRef})}return e.prototype.getReadiness=function(){return gl},e.prototype.focusedWhere=function(){return Ml().getCurrentFocus()||null},e.prototype.emitUserPose=function(e){this.userLocation.applyPose(e)},e.prototype.emitUserCameraStop=function(e,t){this.userLocation.applyCameraStop(e,t)},e.prototype.setUIHandlers=function(e){this.uiHandlers=e||{}},e.prototype.setNavigationPdrOptions=function(e){void 0!==e.deadZonesUrl&&(this.deadZonesUrl=e.deadZonesUrl||null,this.deadZonesLoadPromise=null),void 0!==e.deadZones&&(this.deadZones=e.deadZones.length?B([],e.deadZones,!0):[])},e.prototype.setPdrNavigationAllowed=function(e){this.pdrNavigationAllowedByUi=e,e||"pdr"!==this.navigationLocMode||this.leavePdrMode()},e.prototype.getPdrNavigationDebug=function(){var e,t,n,r,i,o,a,s;return this.isNavigating?{mode:this.navigationLocMode,deadZoneId:this.activeDeadZoneId,anchorBlendActive:this.anchorPdrBlendActive,anchorBlendW:this.anchorPdrBlendW,lockedSegmentIndex:this.pdrLockedRouteSegmentIndex,pdrAlongMeters:this.pdrAlongMeters,subSegmentStraightIndex:null!==(t=null===(e=this.pdrLastFeed)||void 0===e?void 0:e.straightPieceIndex)&&void 0!==t?t:this.pdrEngine.getStraightPieceIndex(),movementHeadingDeg:this.pdrEngine.getMovementHeadingDeg(),moving:null!==(r=null===(n=this.pdrLastFeed)||void 0===n?void 0:n.moving)&&void 0!==r&&r,alignmentGain:null!==(o=null===(i=this.pdrLastFeed)||void 0===i?void 0:i.alignmentGain)&&void 0!==o?o:0,stepDetected:null!==(s=null===(a=this.pdrLastFeed)||void 0===a?void 0:a.stepDetected)&&void 0!==s&&s}:null},e.prototype.getSegmentLineStringFeature=function(e){var t,n,r,i,o=this.routingManager.getReferenceRouteForTracking(),a=null===(t=null==o?void 0:o.segments)||void 0===t?void 0:t[e];if(!a)return null;var s=null!==(r=null===(n=a.features)||void 0===n?void 0:n.find(function(e){var t;return"LineString"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}))&&void 0!==r?r:null===(i=a.features)||void 0===i?void 0:i[1];return s&&"LineString"===s.geometry.type?s:null},e.prototype.ensureDeadZonesLoaded=function(){return I(this,void 0,void 0,function(){var e=this;return z(this,function(t){switch(t.label){case 0:return this.deadZonesUrl?this.deadZonesLoadPromise?[4,this.deadZonesLoadPromise]:[3,2]:[2];case 1:case 3:return t.sent(),[2];case 2:return this.deadZonesLoadPromise=function(e){return I(this,void 0,void 0,function(){var t,n;return z(this,function(r){switch(r.label){case 0:return[4,fetch(e)];case 1:if(!(t=r.sent()).ok)throw new Error("Failed to load dead zones (".concat(t.status,"): ").concat(e));return n=Bc,[4,t.text()];case 2:return[2,n.apply(void 0,[r.sent()])]}})})}(this.deadZonesUrl).then(function(t){e.deadZones=t}).catch(function(e){console.warn("[NavigationEngine] Failed to load dead zones",e)}),[4,this.deadZonesLoadPromise]}})})},e.prototype.leavePdrMode=function(){var e,t;if("pdr"===this.navigationLocMode){this.userLocation.stopMotion();var n=this.activeDeadZoneId;this.navigationLocMode="gps",this.resetAnchorPdrBlendState(),this.activeDeadZoneId=null,this.pdrLockedLine=null,this.pdrLockedRouteSegmentIndex=-1,this.pdrAlongMeters=0,this.pdrLastAlongForDistanceM=null,this.pdrLastFeed=null,this.pdrRawGpsOutsideConsecutive=0,this.lastDeadZoneModeSwitchMs=Date.now(),this.qualityBlendRerouteSuppressed=!1,null===(t=(e=this.uiHandlers).onNavigationLocModeChange)||void 0===t||t.call(e,"gps",null!=n?n:void 0)}},e.prototype.resetDeadZoneEvaluationState=function(){this.deadZoneInsideConsecutive=0,this.pdrRawGpsOutsideConsecutive=0,this.lastDeadZoneModeSwitchMs=0},e.prototype.resetAnchorPdrBlendState=function(){var e,t,n=this.anchorPdrBlendActive;this.anchorPdrBlendActive=!1,this.anchorPdrBlendW=0,this.anchorPdrBlendGpsTarget=null,this.anchorPdrLastBlendGpsTs=0,this.lastAnchorBlendBForOdom=null,this.anchorPdrHandoffGoodFrames=0,n&&(null===(t=(e=this.uiHandlers).onAnchorGpsBlendChange)||void 0===t||t.call(e,!1,0))},e.prototype.clearStartAnchorLock=function(){this.startAnchorLockActive=!1,this.startAnchorLockAnchorLngLat=null,this.startAnchorLockWhereTaxonomyPath=null,this.resetAnchorPdrBlendState()},e.prototype.configureStartAnchorLock=function(e){var t;this.clearStartAnchorLock();var n=null==e?void 0:e.startAnchorLngLat;n&&Number.isFinite(n[0])&&Number.isFinite(n[1])&&(this.startAnchorLockActive=!0,this.startAnchorLockAnchorLngLat=[n[0],n[1]],this.startAnchorLockWhereTaxonomyPath=null!==(t=null==e?void 0:e.lockWhereTaxonomyPath)&&void 0!==t?t:null)},e.prototype.evaluateStartAnchorLockScope=function(e){this.startAnchorLockActive&&this.startAnchorLockWhereTaxonomyPath&&this.focusedWhere()&&this.focusedWhere()!==this.startAnchorLockWhereTaxonomyPath&&this.clearStartAnchorLock()},e.prototype.tryEnterQualityRecoveryPdr=function(t,n,r){var i,o,a,s;if(!this.pdrNavigationAllowedByUi)return!1;if(this.arrivalLockActive)return!1;if(r-this.lastDeadZoneModeSwitchMs<e.DEAD_ZONE_MODE_SWITCH_COOLDOWN_MS)return!1;var l=null!==(a=null!==(o=null!==(i=this.visualNavCoords)&&void 0!==i?i:this.lerpedCoords)&&void 0!==o?o:this.targetNavCoords)&&void 0!==a?a:null===(s=this.currentPosition)||void 0===s?void 0:s.coordinates;if(!l||l.length<2)return!1;var u=ta(l,t.coordinates,{units:"meters"});return n>=e.QUALITY_PDR_BAD_ACCURACY_M||u>=e.QUALITY_PDR_MAX_RESIDUAL_M?(this.qualityPdrBadConsecutive+=1,!(this.qualityPdrBadConsecutive<e.QUALITY_PDR_CONSECUTIVE_BAD)&&(this.enterPdrFromRouteSeed(null,l)?(this.qualityPdrBadConsecutive=0,this.qualityBlendRerouteSuppressed=!0,!0):(this.qualityPdrBadConsecutive=0,!1))):(this.qualityPdrBadConsecutive=0,!1)},e.prototype.enterPdrFromRouteSeed=function(e,t){var n,r,i,o,a,s,l=this;if("pdr"===this.navigationLocMode)return!0;if(!this.pdrNavigationAllowedByUi)return!1;var u=this.routingManager.getReferenceRouteForTracking();if(!(null===(n=null==u?void 0:u.segments)||void 0===n?void 0:n.length))return!1;var c=null!==(i=null!==(r=null!=t?t:this.visualNavCoords)&&void 0!==r?r:this.lerpedCoords)&&void 0!==i?i:null===(o=this.currentPosition)||void 0===o?void 0:o.coordinates;if(!c)return!1;var h=this.findNearestSegmentIndexForCurrentWhere(u,c);this.maybeAdvanceLastEmittedSegmentIndex(h);var d=this.getSegmentLineStringFeature(h);if(!d)return!1;var p=d.geometry.coordinates;if(p.length<2)return!1;var f=$c(p);if(!(f>0))return!1;var g=_s(d,ve(c),{units:"meters"}),m=Math.max(0,Math.min(f,g.properties.location)),v=Yc(h,p),y=Vc(v,m,f);this.pdrLockedRouteSegmentIndex=h,this.pdrLockedLine=d,this.pdrAlongMeters=m,this.pdrLastAlongForDistanceM=m,this.activeDeadZoneId=e,this.navigationLocMode="pdr",this.lastDeadZoneModeSwitchMs=Date.now(),this.resetAnchorPdrBlendState(),this.pdrEngine.reset({totalLenM:f,startAlongM:m,pieces:v,initialMovementHeadingDeg:y});var w=ec(d,m,{units:"meters"});return this.setTargetNavCoords(w.geometry.coordinates),this.navigationSnapped=!0,this.routeAlignedHeadingDeg=y,this.frozenUnsnappedHeadingDeg=y,this.targetNavHeadingDeg=this.resolveNavigationHeadingTarget(),this.pdrLastFeed={moving:!1,alignmentGain:1,stepDetected:!1,straightPieceIndex:this.pdrEngine.getStraightPieceIndex()},this.userLocation.startMotion(function(e){return l.updateNavigationWithMotion(e)}),null===(s=(a=this.uiHandlers).onNavigationLocModeChange)||void 0===s||s.call(a,"pdr",null!=e?e:void 0),!0},e.prototype.tryEnterPdrMode=function(e,t){return this.enterPdrFromRouteSeed(e.id,t)},e.prototype.rebindPdrLockedLineAtSeed=function(e,t){var n,r,i;if("pdr"!==this.navigationLocMode)return!1;var o=this.routingManager.getReferenceRouteForTracking();if(!(null===(n=null==o?void 0:o.segments)||void 0===n?void 0:n.length))return this.leavePdrMode(),!1;var a=this.findNearestSegmentIndexForCurrentWhere(o,e);this.maybeAdvanceLastEmittedSegmentIndex(a);var s=this.getSegmentLineStringFeature(a);if(!s)return this.leavePdrMode(),!1;var l=s.geometry.coordinates;if(l.length<2)return this.leavePdrMode(),!1;var u=$c(l);if(!(u>0))return this.leavePdrMode(),!1;var c=_s(s,ve(e),{units:"meters"}),h=Math.max(0,Math.min(u,c.properties.location)),d=Yc(a,l),p=Vc(d,h,u);this.pdrLockedRouteSegmentIndex=a,this.pdrLockedLine=s,this.pdrAlongMeters=h,this.pdrLastAlongForDistanceM=h,this.activeDeadZoneId=t,null===t?this.resetAnchorPdrBlendState():this.anchorPdrHandoffGoodFrames=0,this.pdrEngine.reset({totalLenM:u,startAlongM:h,pieces:d,initialMovementHeadingDeg:p});var f=ec(s,h,{units:"meters"});return this.setTargetNavCoords(f.geometry.coordinates),this.navigationSnapped=!0,this.routeAlignedHeadingDeg=p,this.frozenUnsnappedHeadingDeg=p,this.targetNavHeadingDeg=this.resolveNavigationHeadingTarget(),this.pdrRawGpsOutsideConsecutive=0,this.pdrLastFeed={moving:!1,alignmentGain:1,stepDetected:!1,straightPieceIndex:this.pdrEngine.getStraightPieceIndex()},null===(i=(r=this.uiHandlers).onNavigationLocModeChange)||void 0===i||i.call(r,"pdr",null!=t?t:void 0),!0},e.prototype.rebindPdrToDeadZone=function(e,t){return this.rebindPdrLockedLineAtSeed(t,e.id)},e.prototype.getPdrPureCoords=function(){var e,t,n,r;return this.pdrLockedLine&&Number.isFinite(this.pdrAlongMeters)?ec(this.pdrLockedLine,this.pdrAlongMeters,{units:"meters"}).geometry.coordinates:null!==(r=null!==(t=null!==(e=this.visualNavCoords)&&void 0!==e?e:this.lerpedCoords)&&void 0!==t?t:null===(n=this.currentPosition)||void 0===n?void 0:n.coordinates)&&void 0!==r?r:[0,0]},e.prototype.anchorPdrReliabilityFromAccuracy=function(e){var t=Math.max(e,5);return Math.max(0,Math.min(1,1-(t-5)/45))},e.prototype.updateAnchorPdrBlendTowardGps=function(t,n,r){var i,o,a,s,l=t.coordinates,u=this.getBuiltTrackingLine();if(!u)return this.anchorPdrHandoffGoodFrames=0,!1;this.routeFollowingEstimator.setTrackingLine(u);var c=this.routeFollowingEstimator.update(l,n,r);if(this.lastRouteFollowingConfidence=c.confidence,c.snapped&&(this.anchorPdrBlendGpsTarget=[c.displayCoords[0],c.displayCoords[1]]),!this.anchorPdrBlendActive){if(c.snapped&&n<=e.ANCHOR_PDR_HANDOFF_MAX_ACCURACY_M&&c.confidence>=e.ANCHOR_PDR_HANDOFF_MIN_CONFIDENCE){if(this.anchorPdrHandoffGoodFrames+=1,this.anchorPdrHandoffGoodFrames>=e.ANCHOR_PDR_HANDOFF_CONSECUTIVE_GOOD){this.anchorPdrBlendActive=!0,this.anchorPdrBlendW=0,this.anchorPdrHandoffGoodFrames=0,this.anchorPdrLastBlendGpsTs=r;var h=this.getPdrPureCoords();this.lastAnchorBlendBForOdom=[h[0],h[1]],this.setTargetNavCoords(h),this.ensureNavVisualLoop(),null===(o=(i=this.uiHandlers).onAnchorGpsBlendChange)||void 0===o||o.call(i,!0,0)}}else this.anchorPdrHandoffGoodFrames=0;return!1}if(!this.anchorPdrBlendGpsTarget)return this.ensureNavVisualLoop(),!1;var d=(r-this.anchorPdrLastBlendGpsTs)/1e3;if((!Number.isFinite(d)||d<=0)&&(d=.12),d>2&&(d=.25),this.anchorPdrLastBlendGpsTs=r,c.snapped&&n<=e.ANCHOR_PDR_HANDOFF_MAX_ACCURACY_M){var p=this.anchorPdrReliabilityFromAccuracy(n),f=Math.min(.35,e.ANCHOR_PDR_BLEND_SPEED_PER_S*p*d);this.anchorPdrBlendW=Math.min(1,this.anchorPdrBlendW+f)}var g=this.getPdrPureCoords(),m=this.anchorPdrBlendGpsTarget,v=this.anchorPdrBlendW,y=[g[0]+(m[0]-g[0])*v,g[1]+(m[1]-g[1])*v];return this.setTargetNavCoords(y),this.lastAnchorBlendBForOdom&&(this.totalDistanceTraveled+=ta(this.lastAnchorBlendBForOdom,y,{units:"meters"})),this.lastAnchorBlendBForOdom=[y[0],y[1]],this.anchorPdrBlendW>=.995?this.completeAnchorBlendHandoff(c,t,n,r):(null===(s=(a=this.uiHandlers).onAnchorGpsBlendChange)||void 0===s||s.call(a,!0,this.anchorPdrBlendW),this.ensureNavVisualLoop(),!1)},e.prototype.completeAnchorBlendHandoff=function(e,t,n,r){var i,o,a=[e.displayCoords[0],e.displayCoords[1]];return this.leavePdrMode(),this.startAnchorLockActive&&(this.startAnchorLockActive=!1,this.startAnchorLockAnchorLngLat=null,this.startAnchorLockWhereTaxonomyPath=null),this.visualNavCoords=B([],a,!0),this.lerpedCoords=B([],a,!0),this.setTargetNavCoords(a),this.navigationSnapped=e.snapped,this.lastNavAccuracy=n,this.lastRawPosition={coords:t.coordinates,timestamp:r},e.snapped!==this.lastSnapStateForUi&&(this.lastSnapStateForUi=e.snapped,null===(o=(i=this.uiHandlers).onSnapStateChange)||void 0===o||o.call(i,e.snapped)),!0},e.prototype.updateNavigationWithMotion=function(e){if(this.isNavigating&&"pdr"===this.navigationLocMode&&this.pdrLockedLine){var t=this.pdrEngine.feed(e),n=null===this.activeDeadZoneId&&this.anchorPdrBlendActive;if(!n&&null!=this.pdrLastAlongForDistanceM&&Number.isFinite(this.pdrLastAlongForDistanceM)){var r=t.alongM-this.pdrLastAlongForDistanceM;r>0&&(this.totalDistanceTraveled+=r)}this.pdrLastAlongForDistanceM=t.alongM,this.pdrAlongMeters=t.alongM,this.pdrLastFeed={moving:t.moving,alignmentGain:t.alignmentGain,stepDetected:t.stepDetected,straightPieceIndex:t.straightPieceIndex};var i=ec(this.pdrLockedLine,t.alongM,{units:"meters"}).geometry.coordinates;if(n&&this.anchorPdrBlendGpsTarget){var o=this.anchorPdrBlendGpsTarget,a=this.anchorPdrBlendW,s=[i[0]+(o[0]-i[0])*a,i[1]+(o[1]-i[1])*a];this.setTargetNavCoords(s),this.lastAnchorBlendBForOdom&&(this.totalDistanceTraveled+=ta(this.lastAnchorBlendBForOdom,s,{units:"meters"})),this.lastAnchorBlendBForOdom=[s[0],s[1]]}else this.setTargetNavCoords(i);this.navigationSnapped=!0,this.ensureNavVisualLoop()}},e.prototype.resolveArrivalTargetFromRoute=function(e){var t,n,r,i,o;if(!(null===(t=null==e?void 0:e.segments)||void 0===t?void 0:t.length))return null;for(var a=e.segments.length-1;a>=0;a-=1){var s=e.segments[a];if(s.maneuverType!==Uu.RouteOverview&&s.maneuverType!==Uu.SectionOverview){var l=null===(n=s.features)||void 0===n?void 0:n.find(function(e){var t;return"Point"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}),u=null==l?void 0:l.geometry,c="Point"===(null==u?void 0:u.type)?u.coordinates:void 0;if(c&&Number.isFinite(c[0])&&Number.isFinite(c[1]))return[c[0],c[1]];var h=null!==(i=null===(r=s.features)||void 0===r?void 0:r.find(function(e){var t;return"LineString"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}))&&void 0!==i?i:null===(o=s.features)||void 0===o?void 0:o[1],d=null==h?void 0:h.geometry,p="LineString"===(null==d?void 0:d.type)?d.coordinates:void 0;if(p&&p.length>0){var f=p[p.length-1];if(Number.isFinite(f[0])&&Number.isFinite(f[1]))return[f[0],f[1]]}}}return null},e.prototype.applyArrivalCameraFraming=function(t,n){var r=ia(t,n);for(Number.isFinite(r)||(r=0);r<0;)r+=360;for(;r>=360;)r-=360;this.emitUserCameraStop({center:n,bearing:r,pitch:e.ARRIVAL_CAMERA_PITCH,zoom:Math.max(e.ARRIVAL_CAMERA_ZOOM,this.userLocation.getZoom()),durationMs:1500,easing:"linear"})},e.prototype.maybeEnterArrivalLockAndFrame=function(e,t,n){var r,i;if(Number.isFinite(t)&&!(t>20||(this.arrivalLockActive||(this.arrivalLockActive=!0,this.navigationCompleteEmitted||(this.navigationCompleteEmitted=!0,null===(i=(r=this.uiHandlers).onNavigationComplete)||void 0===i||i.call(r))),this.arrivalCameraFramingApplied))){var o=this.resolveArrivalTargetFromRoute(n);o&&this.applyArrivalCameraFraming([e[0],e[1]],o),this.arrivalCameraFramingApplied=!0}},e.prototype.notifyReroute=function(e){this.leavePdrMode(),this.lastEmittedSegmentIndex=-1,this.lastKnownRemainingDistanceM=null,this.arrivalLockActive=!1,this.arrivalCameraFramingApplied=!1,this.navigationCompleteEmitted=!1,this.routeTrackingEpoch++,this.invalidateRouteTrackingCache(),this.lastAppliedRouteSliceSegmentIndex=-1,this.lastAppliedRouteSliceAlongM=-1,this.lastAppliedVisualNavCoords=null,this.lastAppliedVisualHeadingDeg=null,this.lastRouteSliceVisualNavCoords=null,this.lastBlueDotProgressVisualMs=0,this.autoFocusManager.resetPortalProposalSuppression(),this.uiHandlers.onReroute&&this.uiHandlers.onReroute(e)},e.prototype.invalidateRouteTrackingCache=function(){this.trackingLineCacheKey="",this.trackingLineCached=null,this.trackingLineLengthMCached=0,this.targetAlongMOnTrackingLine=null,this.targetAlongMCacheKey="",this.visualAlongMOnTrackingLine=null,this.visualAlongMCacheKey="",this.routeFollowingEstimator.reset()},e.prototype.getBuiltTrackingLine=function(){var e,t,n=this.routingManager.getReferenceRouteForTracking();if(!(null===(e=null==n?void 0:n.segments)||void 0===e?void 0:e.length))return null;var r=Math.max(0,this.lastEmittedSegmentIndex),i="".concat(this.routeTrackingEpoch,"|").concat(null!==(t=this.focusedWhere())&&void 0!==t?t:"","|").concat(r,"|").concat(n.segments.length);if(i===this.trackingLineCacheKey&&this.trackingLineCached)return this.trackingLineCached;var o=Kc(n,{whereDimension:this.focusedWhere(),forwardFloor:r,requireWhereDimensionMatch:!0}),a=o?xs(o.line,{units:"meters"}):0;return(!o||a<=0)&&(a=(o=Kc(n,{whereDimension:this.focusedWhere(),forwardFloor:r,requireWhereDimensionMatch:!1}))?xs(o.line,{units:"meters"}):0),this.trackingLineCacheKey=i,this.trackingLineCached=o,this.trackingLineLengthMCached=a,this.targetAlongMOnTrackingLine=null,this.targetAlongMCacheKey="",this.visualAlongMOnTrackingLine=null,this.visualAlongMCacheKey="",o},e.prototype.findNextNavigableSegmentIndex=function(e,t){if(!(null==e?void 0:e.length))return null;for(var n=t+1;n<e.length;n++){var r=e[n];if(r.maneuverType!==Uu.RouteOverview&&r.maneuverType!==Uu.SectionOverview)return n}return null},e.prototype.isPortalRouteSegment=function(e){if(e.isPortal)return!0;var t=e.maneuverType;return t===Uu.EnterPortal||t===Uu.TravelPortal||t===Uu.ExitPortal},e.prototype.resolvePostPortalDestinationWhere=function(e,t){var n,r,i,o=e.segments,a=o.length;if(t<0||t>=a)return null;for(var s=t;s<a&&this.isPortalRouteSegment(o[s]);)s+=1;if(s<a){var l=null===(n=o[s])||void 0===n?void 0:n.whereDimension;if(l)return l}var u=s-1;if(u>=t){var c=null===(i=null===(r=o[u])||void 0===r?void 0:r.endEdge)||void 0===i?void 0:i.whereDimension;if(c)return c}return null},e.prototype.maybeProposePortalFloorChange=function(t,n,r,i){var o;if(this.autoFocusManager&&this.isNavigating&&null!=i&&!(i>e.PORTAL_PROPOSE_VICINITY_M)){var a=t.segments,s=this.findNextNavigableSegmentIndex(a,n),l=null,u=null;if(this.isPortalRouteSegment(r))l=n,u=r;else{if(null===s||!this.isPortalRouteSegment(a[s]))return;l=s,u=a[s]}var c=this.resolvePostPortalDestinationWhere(t,l);if(c&&c!==this.focusedWhere()){var h="".concat(l,":").concat(c),d=null===(o=u.instructions)||void 0===o?void 0:o[0];this.autoFocusManager.proposeFromNavigation({whereTaxonomyPath:c,portalDedupeKey:h,portal:{segmentIndex:l,instructionLine:d,portalName:u.portalName,description:u.description}}),i<=e.PORTAL_PROGRESS_HOLD_VICINITY_M&&(this.portalProgressHoldActive=!0)}}},e.prototype.findNearestSegmentIndexAlongRoute=function(e,t,n,r){var i=this,o=-1,a=1/0,s=null;return e.segments.forEach(function(e,l){var u,c,h;if(!(l<n)){var d=null!==(c=null===(u=e.features)||void 0===u?void 0:u.find(function(e){var t;return"LineString"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}))&&void 0!==c?c:null===(h=e.features)||void 0===h?void 0:h[1];if(e.maneuverType!==Uu.RouteOverview&&e.maneuverType!==Uu.SectionOverview&&d&&"LineString"===d.geometry.type&&(!r||e.whereDimension===i.focusedWhere())){var p=_s(d,t,{units:"meters"}),f=p.properties.dist;f<a&&(a=f,o=l,s=p.geometry.coordinates)}}}),{nearestIndex:o,minDistance:a,snappedCoords:s}},e.prototype.findNearestSegmentIndexForCurrentWhere=function(e,t){var n=Math.max(0,this.lastEmittedSegmentIndex),r=ve(t),i=this.findNearestSegmentIndexAlongRoute(e,r,n,!0).nearestIndex;return i>=0?i:n},e.prototype.maybeAdvanceLastEmittedSegmentIndex=function(e){var t,n;e<0||null===(n=(t=this.uiHandlers).onSegmentIndexChange)||void 0===n||n.call(t,e)},e.prototype.getCurrentPosition=function(){var e,t,n,r;return null!==(n=null!==(t=null!==(e=this.visualNavCoords)&&void 0!==e?e:this.lerpedCoords)&&void 0!==t?t:this.targetNavCoords)&&void 0!==n?n:null===(r=this.currentPosition)||void 0===r?void 0:r.coordinates},e.prototype.getNavigationPose=function(){var e,t,n=null!==(e=this.lerpedCoords)&&void 0!==e?e:null===(t=this.currentPosition)||void 0===t?void 0:t.coordinates;if(!n)return null;var r=null;return this.userLocation.isCompassPermissionDenied()||"number"!=typeof this.currentHeading||(r=this.currentHeading),{coordinates:n,headingDegrees:r,snapped:this.navigationSnapped,confidence:this.lastRouteFollowingConfidence}},e.prototype.getRouteFollowingDebug=function(){var t,n,r;if(!this.isNavigating)return null;var i=this.routeFollowingEstimator.getDebugSnapshot(),o=null!==(n=null===(t=this.currentPosition)||void 0===t?void 0:t.accuracy)&&void 0!==n?n:null,a={offRouteRerouteThresholdM:this.OFF_ROUTE_THRESHOLD_METERS,suppressRerouteBelowRemainingM:e.SUPPRESS_REROUTE_BELOW_REMAINING_M,lastKnownRemainingDistanceM:this.lastKnownRemainingDistanceM,whereTaxonomyPath:this.focusedWhere(),forwardFloor:Math.max(0,this.lastEmittedSegmentIndex),routeAlignedHeadingDeg:this.routeAlignedHeadingDeg,gpsReportedAccuracyM:"number"==typeof o&&Number.isFinite(o)?o:null};return j(i?j(j({},i),{snapped:this.navigationSnapped,routeHeadingDeg:null!==(r=this.routeAlignedHeadingDeg)&&void 0!==r?r:i.routeHeadingDeg}):{hasTrackingLine:!1,trackingLineLengthM:0,snapped:this.navigationSnapped,reportedAccuracyM:"number"==typeof o&&Number.isFinite(o)?o:NaN,accuracyForScalingM:NaN,enterThresholdM:NaN,exitThresholdM:NaN,rawDistanceToRouteM:NaN,smoothedDistanceForEnterM:NaN,lastAlongRouteM:0,standstill:!1,confidence:NaN,routeHeadingDeg:this.routeAlignedHeadingDeg},a)},e.prototype.regenerateRouteArc=function(){this.focusedWhere()&&this.onWhereTaxonomyUpdate()},e.prototype.resetAltitudeConfig=function(){console.log("Altitude config reset - handled by UserLocationController")},e.prototype.routeHasNavigableSegmentForWhere=function(e,t){var n,r,i,o,a;if(!(null===(n=null==e?void 0:e.segments)||void 0===n?void 0:n.length))return!1;for(var s=0,l=e.segments;s<l.length;s++){var u=l[s];if(u.maneuverType!==Uu.RouteOverview&&u.maneuverType!==Uu.SectionOverview&&u.whereDimension===t){var c=null!==(i=null===(r=u.features)||void 0===r?void 0:r.find(function(e){var t;return"LineString"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}))&&void 0!==i?i:null===(o=u.features)||void 0===o?void 0:o[1];if(c&&"LineString"===(null===(a=c.geometry)||void 0===a?void 0:a.type)){var h=c.geometry.coordinates;if(Array.isArray(h)&&h.length>=2)return!0}}}return!1},e.prototype.onWhereTaxonomyUpdate=function(){var e,t,n,r,i,o,a,s,l,u,c;if(this.isNavigating){var h=this.focusedWhere();if(h){var d=this.lastWhereUsedForTracking!==h;this.lastWhereUsedForTracking=h,this.evaluateStartAnchorLockScope(null!==(n=null!==(t=null===(e=this.currentPosition)||void 0===e?void 0:e.coordinates)&&void 0!==t?t:this.visualNavCoords)&&void 0!==n?n:void 0),this.portalProgressHoldActive&&(this.portalProgressHoldActive=!1),this.invalidateRouteTrackingCache(),this.lastAppliedRouteSliceSegmentIndex=-1,this.lastAppliedRouteSliceAlongM=-1,this.lastAppliedVisualNavCoords=null,this.lastAppliedVisualHeadingDeg=null,this.lastRouteSliceVisualNavCoords=null,this.lastBlueDotProgressVisualMs=0;var p=this.routingManager.getReferenceRouteForTracking();if(p){if(d&&this.isNavigating&&!this.routeHasNavigableSegmentForWhere(p,h)){var f=null!==(i=null!==(r=this.visualNavCoords)&&void 0!==r?r:this.lerpedCoords)&&void 0!==i?i:null===(o=this.currentPosition)||void 0===o?void 0:o.coordinates,g=Date.now();this.lastRerouteTime=g,this.routingManager.requestRerouteFromPosition(f).catch(function(e){console.warn("Re-route failed:",e)})}if(d&&this.isNavigating&&"pdr"===this.navigationLocMode){var m=null!==(s=null!==(a=this.visualNavCoords)&&void 0!==a?a:this.lerpedCoords)&&void 0!==s?s:null===(l=this.currentPosition)||void 0===l?void 0:l.coordinates;if(m)if(null!=this.activeDeadZoneId)if(this.deadZones.length>0){var v=Uc(m,this.focusedWhere(),this.deadZones);v?this.rebindPdrToDeadZone(v,m):this.leavePdrMode()}else this.rebindPdrLockedLineAtSeed(m,this.activeDeadZoneId)||this.leavePdrMode();else this.rebindPdrLockedLineAtSeed(m,null)||this.leavePdrMode();else this.leavePdrMode()}var y=this.getCurrentPosition();y&&(this.updateRouteProgress(y),this.lastEmittedSegmentIndex>=0&&(null===(c=(u=this.uiHandlers).onSegmentIndexChange)||void 0===c||c.call(u,this.lastEmittedSegmentIndex)))}else console.warn("No reference route available for where taxonomy update")}else console.warn("No focused where-taxonomy available for where taxonomy update")}},e.prototype.generatePathForWhereTaxonomy=function(e,t){if(!e.segments||0===e.segments.length)return null;for(var n=[],r=1;r<e.segments.length;r+=1){(s=e.segments[r]).maneuverType!==Uu.SectionOverview&&(s.whereDimension===t&&n.push(s))}if(0===n.length)return console.warn("No segments found for where taxonomy path: ".concat(t)),null;for(var i=[],o=0,a=n;o<a.length;o++)for(var s=a[o],l=0;l<s.coordinates.length;l+=1){var u=s.coordinates[l];i.push(u)}return i.length<2?(console.warn("Insufficient coordinates for path generation"),null):ye(i,{dimension_where:t,isNode:!1,featureBelongsToLineString:!0,isNonHighlightedOverview:"0"})},e.prototype.generateRouteArcFromPath=function(e){if("LineString"===e.geometry.type){var t=e,n=xs(t,{units:"meters"});this.routeArc=[];for(var r=0;r<=this.routeSteps;r++){var i=ec(t,r/this.routeSteps*n,{units:"meters"});this.routeArc.push(i.geometry.coordinates)}this.currentRouteStep=0,this.targetRouteStep=0}else this.routeArc=[]},e.prototype.generateRouteArc=function(e,t,n){if(-1!==t&&e.segments[t]){var r=e.segments[t].features[1];if("LineString"===r.geometry.type){var i=r,o=xs(i,{units:"meters"}),a=_s(i,ve(n),{units:"meters"}).properties.location;this.routeArc=[];for(var s=0;s<=this.routeSteps;s++){var l=ec(i,s/this.routeSteps*o,{units:"meters"});this.routeArc.push(l.geometry.coordinates)}this.currentRouteStep=Math.floor(a/o*this.routeSteps),this.currentRouteStep=Math.max(0,Math.min(this.routeSteps,this.currentRouteStep))}else this.routeArc=[]}else this.routeArc=[]},e.prototype.resetSmoothingState=function(){},e.prototype.startNavigation=function(e){var t,n,r,i,o;return I(this,void 0,void 0,function(){var a,s,l,u;return z(this,function(c){switch(c.label){case 0:return this.isNavigating?[2]:[4,this.ensureDeadZonesLoaded()];case 1:return c.sent(),this.configureStartAnchorLock(e),this.isNavigating=!0,this.portalProgressHoldActive=!1,this.userLocation.show(),a=this.routingManager.getActiveRoute(),(null===(t=null==a?void 0:a.segments)||void 0===t?void 0:t[0])&&(this.lastEmittedSegmentIndex=0,this.routingManager.highlightRouteSegment(0),this.onWhereTaxonomyUpdate()),this.startAnchorLockActive&&this.startAnchorLockAnchorLngLat&&this.enterPdrFromRouteSeed(null,this.startAnchorLockAnchorLngLat),s=this.startAnchorLockActive&&!!this.startAnchorLockAnchorLngLat&&"pdr"===this.navigationLocMode,l=this.userLocation.getCurrentPosition(),s?l&&Number.isFinite(l.accuracy)&&l.accuracy>=0?this.lastNavAccuracy=l.accuracy:l&&(this.lastNavAccuracy=null!==(n=l.accuracy)&&void 0!==n?n:10):(null==l?void 0:l.coordinates)&&(u=[l.coordinates[0],l.coordinates[1]],this.visualNavCoords=B([],u,!0),this.lastNavAccuracy=null!==(r=l.accuracy)&&void 0!==r?r:10,this.targetNavHeadingDeg=null,this.visualNavHeadingDeg=null,this.lerpedCoords=B([],u,!0),this.applyNavigationVisualFrame(u,this.lastNavAccuracy,null),this.setTargetNavCoords(u)),this.uiHandlers.onNavigationStart&&this.uiHandlers.onNavigationStart(),null===(o=(i=this.uiHandlers).onSegmentIndexChange)||void 0===o||o.call(i,0),this.resetSmoothingState(),this.lastKnownRemainingDistanceM=null,this.arrivalLockActive=!1,this.arrivalCameraFramingApplied=!1,this.navigationCompleteEmitted=!1,this.lastRouteProgressVisualMs=0,this.lastRouteSliceVisualNavCoords=null,this.lastBlueDotProgressVisualMs=0,this.resetDeadZoneEvaluationState(),this.qualityPdrBadConsecutive=0,this.qualityBlendRerouteSuppressed=!1,[2]}})})},e.prototype.getIsNavigating=function(){return"navigation"===this.userLocation.getSdkMode()},e.prototype.stopNavigation=function(){this.isNavigating&&(this.userLocation.stopMotion(),this.leavePdrMode(),this.isNavigating=!1,this.lastWhereUsedForTracking=null,this.portalProgressHoldActive=!1,this.stopNavVisualLoop(),this.setTargetNavCoords(null),this.targetNavHeadingDeg=null,this.visualNavCoords=null,this.visualNavHeadingDeg=null,this.frozenUnsnappedHeadingDeg=null,this.lastAppliedVisualNavCoords=null,this.lastAppliedVisualHeadingDeg=null,this.lastRouteSliceVisualNavCoords=null,this.lastBlueDotProgressVisualMs=0,this.lastRouteProgressVisualMs=0,this.lastAppliedRouteSliceSegmentIndex=-1,this.lastAppliedRouteSliceAlongM=-1,this.lerpedCoords=null,this.totalDistanceTraveled=0,this.currentHeading=null,this.currentPosition=null,this.navigationSnapped=!1,this.routeAlignedHeadingDeg=null,this.frozenUnsnappedHeadingDeg=null,this.lastSnapStateForUi=!1,this.invalidateRouteTrackingCache(),this.resetSmoothingState(),this.routeArc=[],this.currentRouteStep=0,this.targetRouteStep=0,this.lastKnownRemainingDistanceM=null,this.arrivalLockActive=!1,this.arrivalCameraFramingApplied=!1,this.navigationCompleteEmitted=!1,this.resetDeadZoneEvaluationState(),this.clearStartAnchorLock(),this.uiHandlers.onNavigationStop&&this.uiHandlers.onNavigationStop())},e.prototype.destroy=function(){var e,t;this.gpsCallbackRef&&this.userLocation.removeCallback({onLocationUpdate:this.gpsCallbackRef,onCompassUpdate:null!==(e=this.compassCallbackRef)&&void 0!==e?e:void 0}),this.gpsCallbackRef=null,this.compassCallbackRef=null,null===(t=this.unsubscribeFocus)||void 0===t||t.call(this),this.unsubscribeFocus=null,this.userLocation.stopMotion(),this.leavePdrMode(),this.isNavigating=!1,this.lastWhereUsedForTracking=null,this.portalProgressHoldActive=!1,this.stopNavVisualLoop(),this.setTargetNavCoords(null),this.targetNavHeadingDeg=null,this.visualNavCoords=null,this.visualNavHeadingDeg=null,this.frozenUnsnappedHeadingDeg=null,this.lastAppliedVisualNavCoords=null,this.lastAppliedVisualHeadingDeg=null,this.lastRouteSliceVisualNavCoords=null,this.lastBlueDotProgressVisualMs=0,this.lerpedCoords=null,this.totalDistanceTraveled=0,this.currentHeading=null,this.currentPosition=null,this.routeArc=[],this.currentRouteStep=0,this.targetRouteStep=0,this.resetDeadZoneEvaluationState(),this.qualityPdrBadConsecutive=0,this.qualityBlendRerouteSuppressed=!1,this.arrivalLockActive=!1,this.arrivalCameraFramingApplied=!1,this.navigationCompleteEmitted=!1,this.navigationSnapped=!1,this.routeAlignedHeadingDeg=null,this.frozenUnsnappedHeadingDeg=null,this.lastSnapStateForUi=!1,this.invalidateRouteTrackingCache(),this.lastRouteProgressVisualMs=0,this.lastAppliedRouteSliceSegmentIndex=-1,this.lastAppliedRouteSliceAlongM=-1,this.clearStartAnchorLock()},e.prototype.updateNavigationWithGPS=function(t){var n,r;if(this.isNavigating){this.currentPosition=t,this.evaluateStartAnchorLockScope(t.coordinates);var i=t.timestamp||Date.now(),o=i-this.lastDeadZoneModeSwitchMs<e.DEAD_ZONE_MODE_SWITCH_COOLDOWN_MS,a=Number.isFinite(t.accuracy)&&t.accuracy>=0?t.accuracy:50;if("pdr"===this.navigationLocMode)if(null!=this.activeDeadZoneId){var s=Uc(t.coordinates,this.focusedWhere(),this.deadZones);if(!!s&&!!this.activeDeadZoneId&&s.id===this.activeDeadZoneId)return this.pdrRawGpsOutsideConsecutive=0,void(this.deadZoneInsideConsecutive=0);if(o)return;if(this.pdrRawGpsOutsideConsecutive+=1,this.pdrRawGpsOutsideConsecutive<e.DEAD_ZONE_EXIT_CONSECUTIVE_COUNT)return;this.pdrRawGpsOutsideConsecutive=0,this.leavePdrMode()}else if(!this.updateAnchorPdrBlendTowardGps(t,a,i))return;if(!(this.startAnchorLockActive&&this.startAnchorLockAnchorLngLat&&"pdr"!==this.navigationLocMode&&this.enterPdrFromRouteSeed(null,this.startAnchorLockAnchorLngLat))){if("gps"===this.navigationLocMode&&this.deadZones.length>0)if(o)this.deadZoneInsideConsecutive=0;else{var l=Uc(t.coordinates,this.focusedWhere(),this.deadZones);if(l){if(this.deadZoneInsideConsecutive+=1,this.deadZoneInsideConsecutive>=e.DEAD_ZONE_ENTER_CONSECUTIVE_COUNT&&(this.deadZoneInsideConsecutive=0,this.tryEnterPdrMode(l,t.coordinates)))return}else this.deadZoneInsideConsecutive=0}if("gps"!==this.navigationLocMode||!this.tryEnterQualityRecoveryPdr(t,a,i)){var u=this.getBuiltTrackingLine();this.routeFollowingEstimator.setTrackingLine(u);var c=this.routeFollowingEstimator.update(t.coordinates,a,i);this.lastRouteFollowingConfidence=c.confidence;var h=[c.displayCoords[0],c.displayCoords[1]],d=!!this.arrivalLockActive||c.snapped;if(d!==this.lastSnapStateForUi&&(this.lastSnapStateForUi=d,null===(r=(n=this.uiHandlers).onSnapStateChange)||void 0===r||r.call(n,d)),this.navigationSnapped=d,this.routeAlignedHeadingDeg=null,this.lastRawPosition){var p=ta(this.lastRawPosition.coords,t.coordinates,{units:"meters"});this.totalDistanceTraveled+=p}this.lastRawPosition={coords:t.coordinates,timestamp:i},this.lastNavAccuracy=a,this.visualNavCoords||(this.visualNavCoords=[h[0],h[1]],this.visualNavHeadingDeg=this.frozenUnsnappedHeadingDeg),this.setTargetNavCoords([h[0],h[1]])}}}},e.prototype.updateNavigationWithCompass=function(e){if(this.isNavigating){if(this.userLocation.isCompassPermissionDenied())return this.currentHeading=null,void this.ensureNavVisualLoop();this.currentHeading=e.heading,this.ensureNavVisualLoop()}},e.prototype.headingFromAlongOnLine=function(t,n,r){if(!(n>0&&Number.isFinite(r)))return null;var i=Math.max(0,Math.min(n,r)),o=e.NAV_HEADING_LOOKAHEAD_M,a=Math.min(n,i+o);if(a<=i&&(a=Math.max(0,i-Math.min(1,o)))===i)return null;var s=ia(ec(t,i,{units:"meters"}).geometry.coordinates,ec(t,a,{units:"meters"}).geometry.coordinates);if(!Number.isFinite(s))return null;for(;s<0;)s+=360;for(;s>=360;)s-=360;return s},e.prototype.computeHeadingFromGPS=function(){return this.userLocation.isCompassPermissionDenied()||"number"!=typeof this.currentHeading||Number.isNaN(this.currentHeading)?null:this.currentHeading},e.prototype.resolveNavigationHeadingTarget=function(){return"navigation"===this.userLocation.getSdkMode()&&null!==this.routeAlignedHeadingDeg&&Number.isFinite(this.routeAlignedHeadingDeg)?this.routeAlignedHeadingDeg:this.computeHeadingFromGPS()},e.prototype.ensureNavVisualLoop=function(){this.isNavigating&&void 0===this.navVisualRafId&&(this.lastNavVisualFrameTime=0,this.navVisualRafId=requestAnimationFrame(this.tickNavVisual))},e.prototype.setTargetNavCoords=function(e){this.targetNavCoords=e,this.targetAlongMOnTrackingLine=null,this.targetAlongMCacheKey="",null!==e&&this.ensureNavVisualLoop()},e.prototype.stopNavVisualLoop=function(){void 0!==this.navVisualRafId&&(cancelAnimationFrame(this.navVisualRafId),this.navVisualRafId=void 0),this.lastNavVisualFrameTime=0},e.approxMetersBetween=function(e,t){var n=Math.PI/180,r=.5*(e[1]+t[1])*n,i=(t[1]-e[1])*n,o=(t[0]-e[0])*n*Math.cos(r);return 6378137*Math.sqrt(i*i+o*o)},e.prototype.lerpVisualCoordsCartesian=function(t,n,r){var i=this.visualNavCoords,o=i[0]+(t[0]-i[0])*n,a=i[1]+(t[1]-i[1])*n,s=e.approxMetersBetween(i,[o,a]),l=e.NAV_VISUAL_MAX_FREE_MS*r;if(s>l&&s>0){var u=l/s;o=i[0]+(o-i[0])*u,a=i[1]+(a-i[1])*u}e.approxMetersBetween([o,a],t)<e.NAV_VISUAL_SNAP_DIST_M&&(o=t[0],a=t[1]),this.visualNavCoords=[o,a]},e.prototype.getOrSnapAlong=function(e,t,n,r,i){return null!==r&&i===n?{alongM:r,cacheKey:n}:{alongM:_s(e,ve(t),{units:"meters"}).properties.location,cacheKey:n}},e.prototype.advanceVisualAlongLine=function(t,n,r,i,o,a,s){var l,u;if(void 0===s&&(s=e.NAV_VISUAL_MAX_ALONG_MS),!(n>0)||!(null===(u=null===(l=null==t?void 0:t.geometry)||void 0===l?void 0:l.coordinates)||void 0===u?void 0:u.length)||t.geometry.coordinates.length<2)return!1;if(this.targetAlongMCacheKey!==i||null===this.targetAlongMOnTrackingLine){var c=_s(t,ve(r),{units:"meters"});this.targetAlongMOnTrackingLine=c.properties.location,this.targetAlongMCacheKey=i}if(this.visualAlongMCacheKey!==i||null===this.visualAlongMOnTrackingLine){var h=_s(t,ve(this.visualNavCoords),{units:"meters"});this.visualAlongMOnTrackingLine=h.properties.location,this.visualAlongMCacheKey=i}var d=Math.max(0,Math.min(n,this.targetAlongMOnTrackingLine)),p=Math.max(0,Math.min(n,this.visualAlongMOnTrackingLine)),f=(d-p)*o,g=s*a;Math.abs(f)>g&&(f=Math.sign(f)*g);var m=Math.max(0,Math.min(n,p+f));Math.abs(m-d)<e.NAV_VISUAL_SNAP_DIST_M&&(m=d),this.visualAlongMOnTrackingLine=m;var v=ec(t,m,{units:"meters"});return this.visualNavCoords=v.geometry.coordinates,!0},e.prototype.routeVisualProgressMinMs=function(t){return this.navigationSnapped?t?e.ROUTE_PROGRESS_VISUAL_MIN_INTERVAL_MS_ANCHOR_BLEND:e.ROUTE_PROGRESS_VISUAL_MIN_INTERVAL_MS:4*e.ROUTE_PROGRESS_VISUAL_MIN_INTERVAL_MS},e.prototype.routeVisualSliceMinDeltaM=function(){return this.navigationSnapped?e.ROUTE_SLICE_RESEND_MIN_DELTA_M:e.ROUTE_SLICE_RESEND_MIN_DELTA_M_UNSMAPPED},e.prototype.runNavVisualFrame=function(){var t,n,r,i;if(this.isNavigating){var o=this.targetNavCoords;if(o){var a=performance.now(),s=this.lastNavVisualFrameTime>0?Math.min(.12,(a-this.lastNavVisualFrameTime)/1e3):0;this.lastNavVisualFrameTime=a;var l="pdr"===this.navigationLocMode&&null===this.activeDeadZoneId&&this.anchorPdrBlendActive,u=!0;if(this.visualNavCoords){var c=this.visualNavCoords[0],h=this.visualNavCoords[1],d=l?e.NAV_VISUAL_POS_LAMBDA_ANCHOR_BLEND:e.NAV_VISUAL_POS_LAMBDA,p=s>0?1-Math.exp(-d*s):1;if("pdr"===this.navigationLocMode&&this.pdrLockedLine){var f=this.pdrLockedLine,g="pdr|".concat(this.pdrLockedRouteSegmentIndex),m=(null===(n=null===(t=null==f?void 0:f.geometry)||void 0===t?void 0:t.coordinates)||void 0===n?void 0:n.length)>=2?xs(f,{units:"meters"}):0,v=l?e.NAV_VISUAL_MAX_ALONG_MS_ANCHOR_BLEND:e.NAV_VISUAL_MAX_ALONG_MS;this.advanceVisualAlongLine(f,m,o,g,p,s,v)||this.lerpVisualCoordsCartesian(o,p,s)}else if(this.navigationSnapped){f=null==(w=this.getBuiltTrackingLine())?void 0:w.line,m=this.trackingLineLengthMCached,g=this.trackingLineCacheKey;this.advanceVisualAlongLine(f,m,o,g,p,s)||this.lerpVisualCoordsCartesian(o,p,s)}else this.lerpVisualCoordsCartesian(o,p,s);if(this.navigationSnapped){var y=null;if("pdr"===this.navigationLocMode&&this.pdrLockedLine){m=(null===(i=null===(r=null==(f=this.pdrLockedLine)?void 0:f.geometry)||void 0===r?void 0:r.coordinates)||void 0===i?void 0:i.length)>=2?xs(f,{units:"meters"}):0;null!==this.visualAlongMOnTrackingLine&&(y=this.headingFromAlongOnLine(f,m,this.visualAlongMOnTrackingLine))}else{var w;(f=null==(w=this.getBuiltTrackingLine())?void 0:w.line)&&null!==this.visualAlongMOnTrackingLine&&(y=this.headingFromAlongOnLine(f,this.trackingLineLengthMCached,this.visualAlongMOnTrackingLine))}null!==y?(this.routeAlignedHeadingDeg=y,this.frozenUnsnappedHeadingDeg=y,this.targetNavHeadingDeg=y):(this.routeAlignedHeadingDeg=null,this.targetNavHeadingDeg=this.frozenUnsnappedHeadingDeg)}else this.routeAlignedHeadingDeg=null,this.targetNavHeadingDeg=this.frozenUnsnappedHeadingDeg;var b=this.visualNavCoords[0]-c,_=this.visualNavCoords[1]-h;u=b*b+_*_>1e-18;var x=this.targetNavHeadingDeg,S=this.visualNavHeadingDeg;if(null!==x&&Number.isFinite(x))if(null!==S&&Number.isFinite(S)){var A=s>0?1-Math.exp(-e.NAV_VISUAL_HEAD_LAMBDA*s):1;this.visualNavHeadingDeg=Jc(S,x,A)}else this.visualNavHeadingDeg=x;else this.visualNavHeadingDeg=null}else this.visualNavCoords=[o[0],o[1]],this.visualNavHeadingDeg=this.targetNavHeadingDeg;this.lerpedCoords=[this.visualNavCoords[0],this.visualNavCoords[1]];var P=this.headingDeltaDegrees(this.visualNavHeadingDeg,this.targetNavHeadingDeg),M=e.approxMetersBetween(this.visualNavCoords,o),C=!u&&M<e.NAV_VISUAL_SNAP_DIST_M&&P<.05;if(this.portalProgressHoldActive)this.isNavigating&&(this.navVisualRafId=requestAnimationFrame(this.tickNavVisual));else{var k=performance.now(),E=this.routeVisualProgressMinMs(l),T=this.routeVisualSliceMinDeltaM(),L=null,R=!1,D=!1;if(this.navigationSnapped){var F=k-this.lastRouteProgressVisualMs>=E,O=(null===this.lastAppliedVisualNavCoords?1/0:e.approxMetersBetween(this.lastAppliedVisualNavCoords,this.visualNavCoords))>=T;F&&O&&(L=this.computeRouteSliceGateSnapshot(this.visualNavCoords,T)),D=R=F&&O&&!!L}else{O=(null===this.lastRouteSliceVisualNavCoords?1/0:e.approxMetersBetween(this.lastRouteSliceVisualNavCoords,this.visualNavCoords))>=T;(F=k-this.lastRouteProgressVisualMs>=E)&&O&&(L=this.computeRouteSliceGateSnapshot(this.visualNavCoords,T)),R=F&&O&&!!L;var N=l?e.ROUTE_PROGRESS_VISUAL_MIN_INTERVAL_MS_ANCHOR_BLEND:e.ROUTE_PROGRESS_VISUAL_MIN_INTERVAL_MS,j=e.NAV_VISUAL_APPLY_MIN_DELTA_M,I=null===this.lastAppliedVisualNavCoords?1/0:e.approxMetersBetween(this.lastAppliedVisualNavCoords,this.visualNavCoords),z=k-this.lastBlueDotProgressVisualMs>=N,B=I>=j;D=R||null===this.lastAppliedVisualNavCoords||z&&B}if(R&&L&&(this.lastRouteProgressVisualMs=k,this.lastRouteSliceVisualNavCoords=[this.visualNavCoords[0],this.visualNavCoords[1]],this.updateRouteProgress(this.visualNavCoords,L)),D){this.lastBlueDotProgressVisualMs=k,this.applyNavigationVisualFrame(this.visualNavCoords,this.lastNavAccuracy,this.visualNavHeadingDeg);var U=this.getCurrentPosition();U&&U.length>=2&&this.updateCamera(U,this.visualNavHeadingDeg),this.lastAppliedVisualNavCoords=[this.visualNavCoords[0],this.visualNavCoords[1]],this.lastAppliedVisualHeadingDeg=this.visualNavHeadingDeg}else this.applyNavigationHeadingVisualOnly();if(C)return this.navVisualRafId=void 0,void(this.lastNavVisualFrameTime=0);this.isNavigating&&(this.navVisualRafId=requestAnimationFrame(this.tickNavVisual))}}else this.navVisualRafId=void 0}else this.navVisualRafId=void 0},e.prototype.headingDeltaDegrees=function(e,t){if(null===e||null===t||!Number.isFinite(e)||!Number.isFinite(t))return 0;var n=Math.abs(e-t)%360;return n>180&&(n=360-n),n},e.prototype.applyNavigationHeadingVisualOnly=function(){var e=this.computeHeadingFromGPS(),t=this.visualNavCoords;t&&this.emitUserPose({coordinates:t,accuracy:this.lastNavAccuracy,heading:e})},e.prototype.applyNavigationVisualFrame=function(e,t,n){var r=this.computeHeadingFromGPS();this.emitUserPose({coordinates:e,accuracy:t,heading:r})},e.prototype.computeRouteSliceGateSnapshot=function(t,n){var r,i,o,a,s,l,u,c;void 0===n&&(n=this.routeVisualSliceMinDeltaM());var h=this.routingManager.getReferenceRouteForTracking();if(!t||!h)return null;var d,p,f,g=ve([t[0],t[1]]),m=Math.max(0,this.lastEmittedSegmentIndex);if("pdr"===this.navigationLocMode&&this.pdrLockedRouteSegmentIndex>=0){d=this.pdrLockedRouteSegmentIndex;var v=h.segments[d],y=null!==(i=null===(r=null==v?void 0:v.features)||void 0===r?void 0:r.find(function(e){var t;return"LineString"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}))&&void 0!==i?i:null===(o=null==v?void 0:v.features)||void 0===o?void 0:o[1];if("LineString"===(null===(a=null==y?void 0:y.geometry)||void 0===a?void 0:a.type)){var w=_s(y,g,{units:"meters"});f=w.geometry.coordinates,p=w.properties.dist}else f=t,p=0}else{var b=this.findNearestSegmentIndexAlongRoute(h,g,m,!0);d=b.nearestIndex,p=b.minDistance,f=b.snappedCoords}if(-1===d)return null;var _=h.segments[d],x=null!==(l=null===(s=_.features)||void 0===s?void 0:s.find(function(e){var t;return"LineString"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}))&&void 0!==l?l:null===(u=_.features)||void 0===u?void 0:u[1];if("LineString"!==(null===(c=null==x?void 0:x.geometry)||void 0===c?void 0:c.type))return null;var S=null!=f?f:t,A=[S[0],S[1]],P=_s(x,ve(A),{units:"meters"}).properties.location,M=xs(x,{units:"meters"}),C=Math.max(0,M-P),k=this.lastRouteSliceVisualNavCoords,E=null===k?1/0:e.approxMetersBetween(k,t);return{referenceRoute:h,nearestIndex:d,minDistance:p,referenceSegment:_,referenceLineFeature:x,ptCoords:A,snappedAlongM:P,originalLen:M,remainingSegmentDistance:C,slicePointChanged:d!==this.lastAppliedRouteSliceSegmentIndex||E>=n}},e.prototype.updateRouteProgress=function(t,n){var r,i,o=null!=n?n:this.computeRouteSliceGateSnapshot(t);if(t&&o){var a=o.referenceRoute,s=o.nearestIndex,l=o.minDistance,u=o.referenceSegment,c=o.referenceLineFeature,h=o.ptCoords,d=o.snappedAlongM,p=o.originalLen,f=o.remainingSegmentDistance,g=o.slicePointChanged;this.maybeProposePortalFloorChange(a,s,u,Number.isFinite(f)?f:null);var m=null;if(g){m=B([h],Bl(c,d,p,{units:"meters"}).geometry.coordinates,!0);var v=null!==(i=null===(r=u.features)||void 0===r?void 0:r.findIndex(function(e){var t;return"LineString"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}))&&void 0!==i?i:1,y=u.features.slice();if(v>=0&&y[v]){var w=y[v];y[v]=j(j({},w),{geometry:j(j({},w.geometry),{coordinates:m})})}var b=j(j({},u),{features:y}),_=a.segments.slice();_[s]=b;var x=j(j({},a),{segments:_});this.routingManager.setActiveRoute(x),this.routingManager.highlightRouteSegment(s,!0,!0,!1,!1),this.lastAppliedRouteSliceSegmentIndex=s,this.lastAppliedRouteSliceAlongM=d}try{for(var S=0,A=0,P=s;P<a.segments.length;P+=1)S+=a.segments[P].distance||0,A+=a.segments[P].time||0;var M=u.distance||0,C=u.time||0;if(p>0&&M>0){var k=Math.max(0,Math.min(1,f/p));S-=M,A-=C,S+=M*k,A+=C*k}this.lastKnownRemainingDistanceM=S,this.maybeEnterArrivalLockAndFrame([t[0],t[1]],S,a),this.uiHandlers.onProgressUpdate&&this.uiHandlers.onProgressUpdate({remainingTime:A,remainingDistance:S,segmentRemainingDistance:f})}catch(e){}if(this.uiHandlers.onBearingUpdate&&m&&m.length>=2){var E=ia(m[0],m[1]);this.uiHandlers.onBearingUpdate(E)}this.maybeAdvanceLastEmittedSegmentIndex(s);var T=-1===s||l>this.OFF_ROUTE_THRESHOLD_METERS,L=null!=this.lastKnownRemainingDistanceM&&this.lastKnownRemainingDistanceM<e.SUPPRESS_REROUTE_BELOW_REMAINING_M;if(T&&!L&&!this.arrivalLockActive&&!this.startAnchorLockActive&&!this.qualityBlendRerouteSuppressed){var R=Date.now();R-this.lastRerouteTime>=this.REROUTE_COOLDOWN_MS&&(this.lastRerouteTime=R,this.routingManager.requestRerouteFromPosition(t).catch(function(e){console.warn("Re-route failed:",e)}))}return{nearestIndex:s,minDistance:l}}},e.prototype.updateCamera=function(e,t,n){void 0===n&&(n=!1),this.arrivalLockActive||!e||e.length<2||"number"!=typeof e[0]||"number"!=typeof e[1]||null!==t&&this.emitUserCameraStop({center:[e[0],e[1]],bearing:t,pitch:this.cameraPitch,zoom:this.cameraZoomLevel,paddingFraction:{top:.3},durationMs:300,easing:"linear"},{force:n})},e.NAV_VISUAL_APPLY_MIN_DELTA_M=.1,e.NAV_VISUAL_APPLY_MIN_DELTA_M_ANCHOR_BLEND=.05,e.NAV_VISUAL_APPLY_MIN_HEADING_DEG=1,e.NAV_VISUAL_POS_LAMBDA=9,e.NAV_VISUAL_POS_LAMBDA_ANCHOR_BLEND=17,e.NAV_VISUAL_HEAD_LAMBDA=12,e.NAV_VISUAL_SNAP_DIST_M=.04,e.NAV_HEADING_LOOKAHEAD_M=5,e.NAV_VISUAL_MAX_ALONG_MS=3,e.NAV_VISUAL_MAX_ALONG_MS_ANCHOR_BLEND=8,e.NAV_VISUAL_MAX_FREE_MS=4,e.ROUTE_PROGRESS_VISUAL_MIN_INTERVAL_MS=50,e.ROUTE_PROGRESS_VISUAL_MIN_INTERVAL_MS_ANCHOR_BLEND=28,e.ROUTE_SLICE_RESEND_MIN_DELTA_M=.5,e.ROUTE_SLICE_RESEND_MIN_DELTA_M_UNSMAPPED=2,e.DEAD_ZONE_MODE_SWITCH_COOLDOWN_MS=3e3,e.DEAD_ZONE_ENTER_CONSECUTIVE_COUNT=2,e.DEAD_ZONE_EXIT_CONSECUTIVE_COUNT=2,e.ANCHOR_PDR_HANDOFF_CONSECUTIVE_GOOD=4,e.ANCHOR_PDR_HANDOFF_MAX_ACCURACY_M=32,e.ANCHOR_PDR_HANDOFF_MIN_CONFIDENCE=.3,e.ANCHOR_PDR_BLEND_SPEED_PER_S=.55,e.QUALITY_PDR_BAD_ACCURACY_M=35,e.QUALITY_PDR_MAX_RESIDUAL_M=30,e.QUALITY_PDR_CONSECUTIVE_BAD=3,e.PORTAL_PROPOSE_VICINITY_M=15,e.PORTAL_PROGRESS_HOLD_VICINITY_M=5,e.SUPPRESS_REROUTE_BELOW_REMAINING_M=20,e.ARRIVAL_CAMERA_ZOOM=20,e.ARRIVAL_CAMERA_PITCH=55,e}();function th(e,t,n){if(null!==e)for(var r,i,o,a,s,l,u,c,h=0,d=0,p=e.type,f="FeatureCollection"===p,g="Feature"===p,m=f?e.features.length:1,v=0;v<m;v++){s=(c=!!(u=f?e.features[v].geometry:g?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var y=0;y<s;y++){var w=0,b=0;if(null!==(a=c?u.geometries[y]:u)){l=a.coordinates;var _=a.type;switch(h=!n||"Polygon"!==_&&"MultiPolygon"!==_?0:1,_){case null:break;case"Point":if(!1===t(l,d,v,w,b))return!1;d++,w++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],d,v,w,b))return!1;d++,"MultiPoint"===_&&w++}"LineString"===_&&w++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-h;i++){if(!1===t(l[r][i],d,v,w,b))return!1;d++}"MultiLineString"===_&&w++,"Polygon"===_&&b++}"Polygon"===_&&w++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(b=0,i=0;i<l[r].length;i++){for(o=0;o<l[r][i].length-h;o++){if(!1===t(l[r][i][o],d,v,w,b))return!1;d++}b++}w++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===th(a.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function nh(e){if(!e)throw new Error("geojson is required");switch(e.type){case"Feature":return rh(e);case"FeatureCollection":return function(e){var t={type:"FeatureCollection"};return Object.keys(e).forEach(function(n){switch(n){case"type":case"features":return;default:t[n]=e[n]}}),t.features=e.features.map(function(e){return rh(e)}),t}(e);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return oh(e);default:throw new Error("unknown GeoJSON type")}}function rh(e){var t={type:"Feature"};return Object.keys(e).forEach(function(n){switch(n){case"type":case"properties":case"geometry":return;default:t[n]=e[n]}}),t.properties=ih(e.properties),t.geometry=oh(e.geometry),t}function ih(e){var t={};return e?(Object.keys(e).forEach(function(n){var r=e[n];"object"==typeof r?null===r?t[n]=null:Array.isArray(r)?t[n]=r.map(function(e){return e}):t[n]=ih(r):t[n]=r}),t):t}function oh(e){var t={type:e.type};return e.bbox&&(t.bbox=e.bbox),"GeometryCollection"===e.type?(t.geometries=e.geometries.map(function(e){return oh(e)}),t):(t.coordinates=ah(e.coordinates),t)}function ah(e){var t=e;return"object"!=typeof t[0]?t.slice():t.map(function(e){return ah(e)})}var sh=6371008.8,lh={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:sh,metres:sh,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:3440.069546436285,radians:1,yards:6967335.223679999};function uh(e){return e%360*Math.PI/180}function ch(e,t,n){if(void 0===t&&(t="kilometers"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("length must be a positive number");return function(e,t){void 0===t&&(t="kilometers");var n=lh[t];if(!n)throw new Error(t+" units is invalid");return e*n}(function(e,t){void 0===t&&(t="kilometers");var n=lh[t];if(!n)throw new Error(t+" units is invalid");return e/n}(e,t),n)}function hh(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function dh(e,t,n,r){void 0===r&&(r={});var i=t<0,o=ch(Math.abs(t),r.units,"meters");i&&(o=-Math.abs(o));var a=function(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}(e),s=function(e,t,n,r){r=void 0===r?sh:Number(r);var i=t/r,o=e[0]*Math.PI/180,a=uh(e[1]),s=uh(n),l=i*Math.cos(s),u=a+l;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var c=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(a/2+Math.PI/4)),h=Math.abs(c)>1e-11?l/c:Math.cos(a),d=i*Math.sin(s)/h;return[(180*(o+d)/Math.PI+540)%360-180,180*u/Math.PI]}(a,o,n);return s[0]+=s[0]-a[0]>180?-360:a[0]-s[0]>180?360:0,function(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!hh(e[0])||!hh(e[1]))throw new Error("coordinates must contain numbers");return function(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}({type:"Point",coordinates:e},t,n)}(s,r.properties)}function ph(e,t,n,r){if(!(i=r=r||{})||i.constructor!==Object)throw new Error("options is invalid");var i,o=r.units,a=r.zTranslation,s=r.mutate;if(!e)throw new Error("geojson is required");if(null==t||isNaN(t))throw new Error("distance is required");if(a&&"number"!=typeof a&&isNaN(a))throw new Error("zTranslation is not a number");if(a=void 0!==a?a:0,0===t&&0===a)return e;if(null==n||isNaN(n))throw new Error("direction is required");return t<0&&(t=-t,n+=180),!1!==s&&void 0!==s||(e=nh(e)),th(e,function(e){var r=function(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(dh(e,t,n,{units:o}));e[0]=r[0],e[1]=r[1],a&&3===e.length&&(e[2]+=a)}),e}function fh(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function gh(e,t){!function(e,t){var n,r,i,o,a,s,l,u,c,h,d=0,p="FeatureCollection"===e.type,f="Feature"===e.type,g=p?e.features.length:1;for(n=0;n<g;n++){for(s=p?e.features[n].geometry:f?e.geometry:e,u=p?e.features[n].properties:f?e.properties:{},c=p?e.features[n].bbox:f?e.bbox:void 0,h=p?e.features[n].id:f?e.id:void 0,a=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=l?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(o,d,u,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===t(o.geometries[r],d,u,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,d,u,c,h))return!1;d++}}(e,function(e,n,r,i,o){var a,s=null===e?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return!1!==t(fh(e,r,{bbox:i,id:o}),n,0)&&void 0}switch(s){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l<e.coordinates.length;l++){var u=e.coordinates[l];if(!1===t(fh({type:a,coordinates:u},r),n,l))return!1}})}function mh(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function vh(e){return"Feature"===e.type?e.geometry:e}function yh(e,t){void 0===t&&(t={});var n=vh(e);switch(t.properties||"Feature"!==e.type||(t.properties=e.properties),n.type){case"Polygon":return function(e,t){void 0===t&&(t={});var n=vh(e),r=n.coordinates,i=t.properties?t.properties:"Feature"===e.type?e.properties:{};return wh(r,i)}(n,t);case"MultiPolygon":return function(e,t){void 0===t&&(t={});var n=vh(e),r=n.coordinates,i=t.properties?t.properties:"Feature"===e.type?e.properties:{},o=[];return r.forEach(function(e){o.push(wh(e,i))}),function(e,t){void 0===t&&(t={});var n={type:"FeatureCollection"};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}(o)}(n,t);default:throw new Error("invalid poly")}}function wh(e,t){return e.length>1?function(e,t,n){return void 0===n&&(n={}),mh({type:"MultiLineString",coordinates:e},t,n)}(e,t):function(e,t,n){if(void 0===n&&(n={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return mh({type:"LineString",coordinates:e},t,n)}(e[0],t)}function bh(e,t){var n=!0;return gh(e,function(e){gh(t,function(t){if(!1===n)return!1;n=function(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return n=e.coordinates,r=t.coordinates,!(n[0]===r[0]&&n[1]===r[1]);case"LineString":return!_h(t,e);case"Polygon":return!ll(e,t)}break;case"LineString":switch(t.type){case"Point":return!_h(e,t);case"LineString":return!function(e,t){if(ms(e,t).features.length>0)return!0;return!1}(e,t);case"Polygon":return!xh(t,e)}break;case"Polygon":switch(t.type){case"Point":return!ll(t,e);case"LineString":return!xh(e,t);case"Polygon":return!function(e,t){for(var n=0,r=e.coordinates[0];n<r.length;n++){if(ll(r[n],t))return!0}for(var i=0,o=t.coordinates[0];i<o.length;i++){if(ll(o[i],e))return!0}var a=ms(yh(e),yh(t));if(a.features.length>0)return!0;return!1}(t,e)}}var n,r;return!1}(e.geometry,t.geometry)})}),n}function _h(e,t){for(var n=0;n<e.coordinates.length-1;n++)if(Sh(e.coordinates[n],e.coordinates[n+1],t.coordinates))return!0;return!1}function xh(e,t){for(var n=0,r=t.coordinates;n<r.length;n++){if(ll(r[n],e))return!0}return ms(t,yh(e)).features.length>0}function Sh(e,t,n){var r=n[0]-e[0],i=n[1]-e[1],o=t[0]-e[0],a=t[1]-e[1];return 0===r*a-i*o&&(Math.abs(o)>=Math.abs(a)?o>0?e[0]<=n[0]&&n[0]<=t[0]:t[0]<=n[0]&&n[0]<=e[0]:a>0?e[1]<=n[1]&&n[1]<=t[1]:t[1]<=n[1]&&n[1]<=e[1])}var Ah=6371008.8,Ph={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:Ah,metres:Ah,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:3440.069546436285,radians:1,yards:6967335.223679999};function Mh(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function Ch(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Th(e[0])||!Th(e[1]))throw new Error("coordinates must contain numbers");return Mh({type:"Point",coordinates:e},t,n)}function kh(e,t,n){if(void 0===n&&(n={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return Mh({type:"LineString",coordinates:e},t,n)}function Eh(e){return e%360*Math.PI/180}function Th(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function Lh(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Rh(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Dh(e,t,n){void 0===n&&(n={});var r=Lh(e),i=Lh(t),o=Eh(i[1]-r[1]),a=Eh(i[0]-r[0]),s=Eh(r[1]),l=Eh(i[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return function(e,t){void 0===t&&(t="kilometers");var n=Ph[t];if(!n)throw new Error(t+" units is invalid");return e*n}(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),n.units)}function Fh(e,t){!function(e,t){var n,r,i,o,a,s,l,u,c,h,d=0,p="FeatureCollection"===e.type,f="Feature"===e.type,g=p?e.features.length:1;for(n=0;n<g;n++){for(s=p?e.features[n].geometry:f?e.geometry:e,u=p?e.features[n].properties:f?e.properties:{},c=p?e.features[n].bbox:f?e.bbox:void 0,h=p?e.features[n].id:f?e.id:void 0,a=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=l?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(o,d,u,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===t(o.geometries[r],d,u,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,d,u,c,h))return!1;d++}}(e,function(e,n,r,i,o){var a,s=null===e?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return!1!==t(Mh(e,r,{bbox:i,id:o}),n,0)&&void 0}switch(s){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l<e.coordinates.length;l++){var u=e.coordinates[l];if(!1===t(Mh({type:a,coordinates:u},r),n,l))return!1}})}function Oh(e,t,n){void 0===n&&(n={});var r=Ch([1/0,1/0],{dist:1/0}),i=0;return Fh(e,function(e){for(var o=Rh(e),a=0;a<o.length-1;a++){var s=Ch(o[a]);s.properties.dist=Dh(t,s,n);var l=Ch(o[a+1]);l.properties.dist=Dh(t,l,n);var u=Dh(s,l,n),c=Math.max(s.properties.dist,l.properties.dist),h=ia(s,l),d=ca(t,c,h+90,n),p=ca(t,c,h-90,n),f=ms(kh([d.geometry.coordinates,p.geometry.coordinates]),kh([s.geometry.coordinates,l.geometry.coordinates])),g=null;f.features.length>0&&((g=f.features[0]).properties.dist=Dh(t,g,n),g.properties.location=i+Dh(s,g,n)),s.properties.dist<r.properties.dist&&((r=s).properties.index=a,r.properties.location=i),l.properties.dist<r.properties.dist&&((r=l).properties.index=a+1,r.properties.location=i+u),g&&g.properties.dist<r.properties.dist&&((r=g).properties.index=a),i+=u}}),r}function Nh(e,t,n){var r,i=Rh(n);if("LineString"!==("FeatureCollection"===(r=n).type?"FeatureCollection":"GeometryCollection"===r.type?"GeometryCollection":"Feature"===r.type&&null!==r.geometry?r.geometry.type:r.type))throw new Error("line must be a LineString");for(var o,a=Oh(n,e),s=Oh(n,t),l=[(o=a.properties.index<=s.properties.index?[a,s]:[s,a])[0].geometry.coordinates],u=o[0].properties.index+1;u<o[1].properties.index+1;u++)l.push(i[u]);return l.push(o[1].geometry.coordinates),kh(l,n.properties)}function jh(e,t){if(!new.target)return new jh(e,t);if(Array.isArray(e)||(t=e,e=[]),t=t||{},this.data=e||[],this.length=this.data.length,this.compare=t.compare||zh,this.setNodeId=t.setNodeId||Ih,this.length>0)for(var n=this.length>>1;n>=0;n--)this._down(n);if(t.setNodeId)for(n=0;n<this.length;++n)this.setNodeId(this.data[n],n)}function Ih(){}function zh(e,t){return e-t}function Bh(e){this.node=e,this.parent=null,this.closed=!1,this.open=0,this.distanceToSource=Number.POSITIVE_INFINITY,this.fScore=Number.POSITIVE_INFINITY,this.heapIndex=-1}jh.prototype={push:function(e){this.data.push(e),this.setNodeId(e,this.length),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var e=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this.setNodeId(this.data[0],0),this._down(0)),this.data.pop(),e}},peek:function(){return this.data[0]},updateItem:function(e){this._down(e),this._up(e)},_up:function(e){for(var t=this.data,n=this.compare,r=this.setNodeId,i=t[e];e>0;){var o=e-1>>1,a=t[o];if(n(i,a)>=0)break;t[e]=a,r(a,e),e=o}t[e]=i,r(i,e)},_down:function(e){for(var t=this.data,n=this.compare,r=this.length>>1,i=t[e],o=this.setNodeId;e<r;){var a=1+(e<<1),s=a+1,l=t[a];if(s<this.length&&n(t[s],l)<0&&(a=s,l=t[s]),n(l,i)>=0)break;t[e]=l,o(l,e),e=a}t[e]=i,o(i,e)}};const Uh=[];"function"==typeof Object.freeze&&Object.freeze(Uh);const Hh={heuristic:function(){return 0},distance:function(){return 1},blocked:function(){return!1},compareFScore:function(e,t){return e.fScore-t.fScore},NO_PATH:Uh,setHeapIndex:function(e,t){e.heapIndex=t},setH1:function(e,t){e.h1=t},setH2:function(e,t){e.h2=t},compareF1Score:function(e,t){return e.f1-t.f1},compareF2Score:function(e,t){return e.f2-t.f2}};var Gh=Hh.NO_PATH;function Wh(e,t){var n=(t=t||{}).oriented,r=t.blocked;r||(r=Hh.blocked);var i=t.heuristic;i||(i=Hh.heuristic);var o=t.distance;o||(o=Hh.distance);var a=function(){var e=0,t=[];return{createNewState:function(n){var r=t[e];return r?(r.node=n,r.parent=null,r.closed=!1,r.open=0,r.distanceToSource=Number.POSITIVE_INFINITY,r.fScore=Number.POSITIVE_INFINITY,r.heapIndex=-1):(r=new Bh(n),t[e]=r),e++,r},reset:function(){e=0}}}();return{find:function(t,s){var l=e.getNode(t);if(!l)throw new Error("fromId is not defined in this graph: "+t);var u=e.getNode(s);if(!u)throw new Error("toId is not defined in this graph: "+s);a.reset();var c,h=new Map,d=new jh({compare:Hh.compareFScore,setNodeId:Hh.setHeapIndex}),p=a.createNewState(l);for(h.set(t,p),p.fScore=i(l,u),p.distanceToSource=0,d.push(p),p.open=1;d.length>0;){if(Vh(c=d.pop(),u))return qh(c);c.closed=!0,e.forEachLinkedNode(c.node.id,f,n)}return Gh;function f(e,t){var n=h.get(e.id);if(n||(n=a.createNewState(e),h.set(e.id,n)),!n.closed&&(0===n.open&&(d.push(n),n.open=1),!r(e,c.node,t))){var s=c.distanceToSource+o(e,c.node,t);s>=n.distanceToSource||(n.parent=c,n.distanceToSource=s,n.fScore=s+i(n.node,u),d.updateItem(n.heapIndex))}}}}}function Vh(e,t){return e.node===t}function qh(e){for(var t=[e.node],n=e.parent;n;)t.push(n.node),n=n.parent;return t}function Zh(e){!function(e){if(!e)throw new Error("Eventify cannot use falsy object as events subject");const t=["on","fire","off"];for(let n=0;n<t.length;++n)if(e.hasOwnProperty(t[n]))throw new Error("Subject cannot be eventified, since it already has property '"+t[n]+"'")}(e);const t=function(e){let t=Object.create(null);return{on:function(n,r,i){if("function"!=typeof r)throw new Error("callback is expected to be a function");let o=t[n];return o||(o=t[n]=[]),o.push({callback:r,ctx:i}),e},off:function(n,r){if(void 0===n)return t=Object.create(null),e;if(t[n]){if("function"!=typeof r)delete t[n];else{const e=t[n];for(let t=0;t<e.length;++t)e[t].callback===r&&e.splice(t,1)}}return e},fire:function(n){const r=t[n];if(!r)return e;let i;arguments.length>1&&(i=Array.prototype.slice.call(arguments,1));for(let e=0;e<r.length;++e){const t=r[e];t.callback.apply(t.ctx,i)}return e}}}(e);return e.on=t.on,e.off=t.off,e.fire=t.fire,e}function Yh(e){if("uniqueLinkId"in(e=e||{})&&(console.warn("ngraph.graph: Starting from version 0.14 `uniqueLinkId` is deprecated.\nUse `multigraph` option instead\n","\n","Note: there is also change in default behavior: From now on each graph\nis considered to be not a multigraph by default (each edge is unique)."),e.multigraph=e.uniqueLinkId),void 0===e.multigraph&&(e.multigraph=!1),"function"!=typeof Map)throw new Error("ngraph.graph requires `Map` to be defined. Please polyfill it before using ngraph");var t,n=new Map,r=new Map,i={},o=0,a=e.multigraph?function(e,t,n){var r=Xh(e,t),o=i.hasOwnProperty(r);if(o||_(e,t)){o||(i[r]=0);var a="@"+ ++i[r];r=Xh(e+a,t+a)}return new Kh(e,t,n,r)}:function(e,t,n){var i=Xh(e,t),o=r.get(i);if(o)return o.data=n,o;return new Kh(e,t,n,i)},s=[],l=x,u=x,c=x,h=x,d={version:20,addNode:g,addLink:function(e,t,n){c();var i=m(e)||g(e),o=m(t)||g(t),s=a(e,t,n),u=r.has(s.id);r.set(s.id,s),Jh(i,s),e!==t&&Jh(o,s);return l(s,u?"update":"add"),h(),s},removeLink:function(e,t){void 0!==t&&(e=_(e,t));return b(e)},removeNode:v,getNode:m,getNodeCount:y,getLinkCount:w,getEdgeCount:w,getLinksCount:w,getNodesCount:y,getLinks:function(e){var t=m(e);return t?t.links:null},forEachNode:P,forEachLinkedNode:function(e,t,r){var i=m(e);if(i&&i.links&&"function"==typeof t)return r?function(e,t,r){var i=e.values(),o=i.next();for(;!o.done;){var a=o.value;if(a.fromId===t&&r(n.get(a.toId),a))return!0;o=i.next()}}(i.links,e,t):function(e,t,r){var i=e.values(),o=i.next();for(;!o.done;){var a=o.value,s=a.fromId===t?a.toId:a.fromId;if(r(n.get(s),a))return!0;o=i.next()}}(i.links,e,t)},forEachLink:function(e){if("function"==typeof e)for(var t=r.values(),n=t.next();!n.done;){if(e(n.value))return!0;n=t.next()}},beginUpdate:c,endUpdate:h,clear:function(){c(),P(function(e){v(e.id)}),h()},hasLink:_,hasNode:m,getLink:_,getLinkById:function(e){return void 0===e?void 0:r.get(e)}};return Zh(d),t=d.on,d.on=function(){return d.beginUpdate=c=S,d.endUpdate=h=A,l=p,u=f,d.on=t,t.apply(d,arguments)},d;function p(e,t){s.push({link:e,changeType:t})}function f(e,t){s.push({node:e,changeType:t})}function g(e,t){if(void 0===e)throw new Error("Invalid node identifier");c();var r=m(e);return r?(r.data=t,u(r,"update")):(r=new $h(e,t),u(r,"add")),n.set(e,r),h(),r}function m(e){return n.get(e)}function v(e){var t=m(e);if(!t)return!1;c();var r=t.links;return r&&(r.forEach(b),t.links=null),n.delete(e),u(t,"remove"),h(),!0}function y(){return n.size}function w(){return r.size}function b(e){if(!e)return!1;if(!r.get(e.id))return!1;c(),r.delete(e.id);var t=m(e.fromId),n=m(e.toId);return t&&t.links.delete(e),n&&n.links.delete(e),l(e,"remove"),h(),!0}function _(e,t){if(void 0!==e&&void 0!==t)return r.get(Xh(e,t))}function x(){}function S(){o+=1}function A(){0===(o-=1)&&s.length>0&&(d.fire("changed",s),s.length=0)}function P(e){if("function"!=typeof e)throw new Error("Function is expected to iterate over graph nodes. You passed "+e);for(var t=n.values(),r=t.next();!r.done;){if(e(r.value))return!0;r=t.next()}}}function $h(e,t){this.id=e,this.links=null,this.data=t}function Jh(e,t){e.links?e.links.add(t):e.links=new Set([t])}function Kh(e,t,n,r){this.fromId=e,this.toId=t,this.data=n,this.id=r}function Xh(e,t){return e.toString()+"👉 "+t.toString()}Wh.l2=function(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)},Wh.l1=function(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.abs(n)+Math.abs(r)};var Qh,ed,td=function(){var e,t,n="custom_",r=Nu.Transit,i=!0,o=!0,a=!1,s=null,l=!1,u={edgeData:{},lines:[]};function c(e,t,n,r,i,o,a,l,u){void 0===a&&(a=!1);var c="".concat(t.toString(),",").concat(r),h=e.getNode(c);if(void 0===h){var d=j(j({mapObjectId:n,coords:t,where:r,what:i,zone:o,zoneUnionVertex:!1,name:u},s?{localRef:l}:{}),s?{memberships:[{mapObjectId:n,localRef:l,name:u,what:i}]}:{});h=e.addNode(c,d)}else if(a){if(h.data.mapObjectId=n,h.data.what=i,h.data.where=r,s&&l&&(h.data.localRef=l),s&&u&&(h.data.name=u),h.data.zone!==o&&(h.data.zoneUnionVertex=!0),h.data.zone=o,s&&l)h.data.memberships.some(function(e){return e.localRef===l})||h.data.memberships.push({mapObjectId:n,localRef:l,name:u,what:i})}else{if(s&&l)h.data.memberships.some(function(e){return e.localRef===l})||h.data.memberships.push({mapObjectId:n,localRef:l,name:u,what:i})}return h}function h(e,t,r,o){var a=o.cost,l=o.description,u=o.isPortal?a/1:a;if(!i||i&&o.wheelChairAccesible){var c={weight:u,cost:a,description:l};o.dimension_what&&(c.dimension_what=o.dimension_what),o.name&&(c.name=o.name),s&&Object.keys(o).forEach(function(e){e.startsWith(n)&&(c[e]=o[e])}),e.addLink(t.id,r.id,c)}}function d(e,t){return ta(ve(e),ve(t),{units:"meters"})}function p(e,t,r){var i;if(s)for(var o=0,a=e;o<a.length;o++){var l=a[o];t.properties&&l in t.properties?r["".concat(n).concat(l)]=null!==(i=t.properties[l])&&void 0!==i?i:[]:t.properties&&!(l in t.properties)&&(r["".concat(n).concat(l)]=s.defaults[l]||[])}}function f(e,t){var n,r,i=t;if(i){for(var o=c(e,i.coords,i.id,i.where,i.what,i.zone||"public",!0,i.localRef,i.name),a=Object.keys((null==s?void 0:s.customProperties)||{}),l=0;l<i.lines.length;l+=1)for(var u=i.lines[l],f=ea(u),g=0;g<f.length-1;g+=1){var m=c(e,f[g],"vertex",i.where,Iu.Edge,u.properties.zone,!1,(null===(n=u.properties)||void 0===n?void 0:n.localRef)||i.localRef,i.name),v=c(e,f[g+1],"vertex",i.where,Iu.Edge,u.properties.zone,!1,(null===(r=u.properties)||void 0===r?void 0:r.localRef)||i.localRef,i.name);if(m.id!==v.id){var y=d(f[g],f[g+1]),w={wheelChairAccesible:u.properties.wheelchair,cost:y,isPortal:!1,description:null};s&&(p(a,u,w),w.dimension_what=i.what,w.name=i.name),u.properties.direction!==Ou.Forward&&u.properties.direction!==Ou.TwoWay||h(e,m,v,w),u.properties.direction!==Ou.Backward&&u.properties.direction!==Ou.TwoWay||h(e,v,m,w)}}return o}}function g(e,t){var n=t;if(void 0!==n)return c(e,n.coords,n.id,n.where,n.what,n.zone||r,!0,n.localRef)}function m(e){var t,n,i,o,a,s;return{type:"Feature",geometry:{type:"LineString",coordinates:[e.data.coords]},properties:{dimension_where:e.data.where,zone:(null===(t=e.data)||void 0===t?void 0:t.zone)?null===(n=e.data)||void 0===n?void 0:n.zone:r,cost:0,localRef:(null===(i=e.data)||void 0===i?void 0:i.localRef)?null===(o=e.data)||void 0===o?void 0:o.localRef:null,name:(null===(a=e.data)||void 0===a?void 0:a.name)?null===(s=e.data)||void 0===s?void 0:s.name:null,what:e.data.what}}}function v(e){var t;return((null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.memberships)||[]).map(function(e){return null==e?void 0:e.localRef}).filter(function(e){return Boolean(e)})}function y(e,t){var n,r,i,o,a=new Set(v(e)),s=new Set(v(t)),l=[];return a.forEach(function(e){s.has(e)&&l.push(e)}),1===l.length?l[0]:l.length>1?(null===(n=e.data)||void 0===n?void 0:n.localRef)&&l.includes(e.data.localRef)?e.data.localRef:(null===(r=t.data)||void 0===r?void 0:r.localRef)&&l.includes(t.data.localRef)?t.data.localRef:l.sort()[0]:(null===(i=t.data)||void 0===i?void 0:i.localRef)||(null===(o=e.data)||void 0===o?void 0:o.localRef)||null}function w(e,t){var n,r,i="";if((null===(n=e.data)||void 0===n?void 0:n.memberships)&&t){var o=e.data.memberships.find(function(e){return e.localRef===t});o&&o.name&&(i=o.name)}return!i&&(null===(r=e.data)||void 0===r?void 0:r.name)&&(i=e.data.name),"string"==typeof i&&"unknow"===i.trim().toLowerCase()?"":i}function b(e,t){var n,r,i="";if((null===(n=e.data)||void 0===n?void 0:n.memberships)&&t){var o=e.data.memberships.find(function(e){return e.localRef===t});o&&o.what&&(i=o.what)}return!i&&(null===(r=e.data)||void 0===r?void 0:r.what)&&(i=e.data.what),"string"==typeof i&&i.includes("taxiway_crossing_300_stands")&&(i=i.replace("taxiway_crossing_300_stands","taxiway_crossing")),i}function _(e,t,n,r){if(n.length<=1)throw new Error("Route not found");var i=e,o=t;if(s){var a=function(e,t){var n,r,i,o,a=[];if(!e||e.length<2)return a;for(var s=[],l=0;l<e.length-1;l+=1){var u=e[l],c=e[l+1],h=t.getLink(u.id,c.id),d=h&&h.data&&"number"==typeof h.data.cost?h.data.cost:0,p=y(u,c);s.push({a:u,b:c,ref:p,cost:d})}if(s.length<=2)return a;var f=s.length,g=m(e[0]);g.properties.localRef=null!==(r=null===(n=s[0])||void 0===n?void 0:n.ref)&&void 0!==r?r:g.properties.localRef,g.properties.name=w(e[0],null===(i=s[0])||void 0===i?void 0:i.ref),g.properties.what=b(e[0],null===(o=s[0])||void 0===o?void 0:o.ref);var v=e[0].data,_=null;for(l=0;l<f;l+=1){var x=s[l];x.ref!==g.properties.localRef&&(g.geometry.coordinates.length>1&&a.push({geojson:g,edges:[v.mapObjectId,x.a.data.mapObjectId],startFloor:v.where,endFloor:x.a.data.where,isPortal:!1,portalPath:void 0,cost:g.properties.cost,description:null}),(g=m(x.a)).properties.localRef=x.ref,g.properties.name=w(x.a,x.ref),g.properties.what=b(x.a,x.ref),v=x.a.data),g.geometry.coordinates.push(x.b.data.coords),g.properties.cost+=x.cost,_=x}return _&&g.geometry.coordinates.length>1&&(g.properties.name=w(_.b,_.ref),g.properties.what=b(_.b,_.ref),a.push({geojson:g,edges:[v.mapObjectId,_.b.data.mapObjectId],startFloor:v.where,endFloor:_.b.data.where,isPortal:!1,portalPath:void 0,cost:g.properties.cost,description:null})),a}(n,r);return{startNode:i,endNode:o,routes:a,distance:0}}for(var c=[],h=-1,d=0;d<n.length;d+=1)if(n[d].data.what===Iu.Network){h=d;break}var p=-1;for(d=0;d<n.length;d+=1)n[d].data.what===Iu.Network&&(p=d);for(var f=l&&null===s&&h>0,g=f?n[h]:n[0],v=f?h+1:1,_=g.data,x=[m(g)],S=v;S<n.length;S+=1){var A=n[S],P=n[S-1],M=x[x.length-1];if(null===s&&("vertex"!==A.data.mapObjectId||A.data.zoneUnionVertex)){var C=void 0;if(hd(P.data.what)&&hd(A.data.what)){P.data.zone!==A.data.zone&&console.warn("A portal is triggering a change in zone");var k=void 0;if(ud(P.data.what)){var E=function(e,t,n,r){void 0===r&&(r=!1);var i=n.data.mapObjectId,o=vc(e,(new Set).add(i));if(o&&o.edgeData[i])for(var a=o.edgeData[i],s=0;s<a.links.length;s+=1){var l=a.links[s];if(l.id===t.data.mapObjectId&&l.pathFeatures&&l.pathFeatures.length>0){var u=l.pathFeatures[0],c=!1===r?n.data.coords:t.data.coords,h=!1===r?t.data.coords:n.data.coords;return ye(ta(c,u.geometry.coordinates[0])<ta(h,u.geometry.coordinates[0])?u.geometry.coordinates:u.geometry.coordinates.slice().reverse())}}return null};(k=E(u.edgeData,A,P,!1))||(k=E(u.edgeData,P,A,!0))}var T=(D=r.getLink(P.id,A.id))&&D.data.cost?D.data.cost:void 0,L=D&&D.data.description?D.data.description:void 0;C={geojson:we([P.data.coords,A.data.coords],{zone:A.data.zone}),edges:[P.data.mapObjectId,A.data.mapObjectId],startFloor:P.data.where,endFloor:A.data.where,isPortal:!0,portalPath:k,cost:T,description:L},c.push(C),_=A.data}else{var R=S+1<n.length?n[S+1]:void 0;A.data.zoneUnionVertex&&P&&R&&(null==P?void 0:P.data.zone)===(null==R?void 0:R.data.zone)?console.log("ignore zoneUnionVertex in segment"):(C={geojson:M,edges:[_.mapObjectId,A.data.mapObjectId],startFloor:_.where,endFloor:_.where,isPortal:!1,portalPath:void 0,cost:M.properties.cost,description:null},c.push(C),_=A.data)}}if(null===s)if(hd(P.data.what)&&hd(A.data.what))M.geometry.coordinates.length<2&&x.pop(),x.push(m(A));else{var D;T=(D=r.getLink(P.id,A.id))&&D.data.cost?D.data.cost:void 0;l&&p>=0&&S>p&&A.data.what!==Iu.Network||(M.geometry.coordinates.push(A.data.coords),M.properties.cost+=T)}if(A.data.zoneUnionVertex&&!s){var F=S>0?n[S-1]:void 0;R=S+1<n.length?n[S+1]:void 0;if(F&&R&&(null==F?void 0:F.data.zone)===(null==R?void 0:R.data.zone))console.log("ignore zoneUnionVertex");else if(R){var O=Wu.cloneDeep(A);O.data.zone=R.data.zone,x.push(m(O))}else x.push(m(A))}}if(l&&null===s){var N=x[x.length-1];if(N.geometry.coordinates.length>1){var j=c[c.length-1];if(!j||j.geojson!==N){var I=n[p>=0?p:n.length-1];c.push({geojson:N,edges:[_.mapObjectId,I.data.mapObjectId],startFloor:_.where,endFloor:I.data.where,isPortal:!1,portalPath:void 0,cost:N.properties.cost,description:null})}}}return{startNode:i,endNode:o,routes:c,distance:0}}function x(t,i,l,u){var m=Yh(),v=f(m,t),y=f(m,i);if(v&&y){a||function(e,t){for(var n in t){for(var r=t[n],i=0;i<r.links.length;i+=1){var o=r.links[i],a=o.cost;a=Wu.toInteger(a);var s=o.direction,l=o.wheelchair,u=o.description,c=g(e,r),d=g(e,o);void 0!==c&&void 0!==d&&c.id!==d.id&&(s!==Ou.Forward&&s!==Ou.TwoWay||h(e,c,d,{wheelChairAccesible:l,cost:a,description:u,isPortal:!0}),s!==Ou.Backward&&s!==Ou.TwoWay||h(e,d,c,{wheelChairAccesible:l,cost:a,description:u,isPortal:!0}),f(e,o))}f(e,r)}}(m,l),function(e,t){for(var n,i,o=Object.keys((null==s?void 0:s.customProperties)||{}),a=0;a<t.length;a+=1){var l=t[a];if("LineString"===l.geometry.type){var u=ea(l);if(l.properties)for(var f=l.properties.dimension_where,g=l.properties.dimension_what,m=l.properties.zone,v=null===(n=l.properties)||void 0===n?void 0:n.localRef,y=null===(i=l.properties)||void 0===i?void 0:i.title,w=0;w<u.length-1;w+=1){var b=c(e,u[w],"vertex",f,g,m||r,!0,v,y),_=c(e,u[w+1],"vertex",f,g,m||r,!0,v,y);if(b.id!==_.id){var x=d(u[w],u[w+1]),S={wheelChairAccesible:l.properties.wheelchair,cost:x,isPortal:!1,description:null};s&&(p(o,l,S),S.dimension_what=l.properties.dimension_what,S.name=y),l.properties.direction!==Ou.Forward&&l.properties.direction!==Ou.TwoWay||h(e,b,_,S),l.properties.direction!==Ou.Backward&&l.properties.direction!==Ou.TwoWay||h(e,_,b,S)}}}}}(m,u);var w=function(t,r,i){var l=null==s?void 0:s.customProperties,u=null,c=null,h=function(e){var t,n;return null===(n=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.dimension_what)||void 0===n?void 0:n.includes("what.route.network.vehicle.road.primary")},d=function(e,t,n){var r,i,o;if((null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.localRef)===(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.localRef))return null;if(!h(t))return null;var a=null;return null===(o=null==e?void 0:e.links)||void 0===o||o.forEach(function(e){var r,i,o,s;switch(n){case"start":null===a&&(null==e?void 0:e.toId)===(null==t?void 0:t.fromId)&&(a=null!==(i=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.localRef)&&void 0!==i?i:null);break;case"end":null===a&&(null==e?void 0:e.fromId)===(null==t?void 0:t.toId)&&(a=null!==(s=null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.localRef)&&void 0!==s?s:null);break;default:a=null}}),a},p=["twy-crs_unknown_1","twy-crs_unknown_2","twy-crs_unknown_3","twy-crs_unknown_4","twy-crs_unknown_5","twy-crs_unknown_6"],f=Wh(i,{oriented:!0,distance:function(e,n,i){var o,s,l=i.data.cost;return a?(null===u&&(u=d(t,i,"start")),null===c&&(c=d(r,i,"end")),u&&(null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.localRef)===u&&h(i)&&(l*=.1),c&&(null===(s=null==i?void 0:i.data)||void 0===s?void 0:s.localRef)===c&&h(i)&&(l*=.1),l):l},blocked:function(i,u,c){if(o&&(null==i?void 0:i.data.zone)!==(null==u?void 0:u.data.zone)){var h=fc(i.data.where),d=fc(e.where),f=fc(u.data.where);if(h!==d&&f!==d)return!0}if(a&&c.data.dimension_what&&c.data.dimension_what.includes(Iu.AirsideNetwork)){if(s){if(!s.allowedRoadwayCategories.includes(c.data.dimension_what))return!0;var g=!0;for(var m in l)c.data["".concat(n).concat(m)].includes(l[m])||(console.log("Blocked on custom property '".concat(m,"' check. ").concat(c.data.name," ").concat(c.data.dimension_what.split(".").slice(5).map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join(" ")," Road allows ").concat(m,":[").concat(c.data["".concat(n).concat(m)],"]. Vehicle has ").concat(m,": ").concat(l[m])),g=!1);if(!1===g)return!0}var v=/3\d{2}/;if((!v.test(t.data.name)||"what.airside.apron.stand"!==t.data.what)&&(!v.test(r.data.name)||"what.airside.apron.stand"!==r.data.what)&&(null==s?void 0:s.allowedRoadwayCategories.includes("what.route.network.vehicle.road.tunnel"))&&"what.route.network.vehicle.road.taxiway_crossing"===c.data.dimension_what&&p.includes(c.data.localRef)&&(null==s?void 0:s.allowedRoadwayCategories.includes("what.route.network.vehicle.road.taxiway_crossing.300s")))return!0}return!1}}),g=f.find(t.id,r.id).reverse();return console.log("Shorest Path:",g),g}(v,y,m);try{return _(t,i,w,m)}catch(e){throw e}}return{}}function S(e,t,n){for(var r=new Set,i=0;n.routes&&i<n.routes.length;i+=1){var o=n.routes[i];o.isPortal&&(r.add(o.edges[0]),r.add(o.edges[1]))}var a=performance.now(),s=lc(gc,!0,Iu.Network,!1),l=vc(u.edgeData,r);console.log("time load: ",(performance.now()-a)/1e3),a=performance.now(),e.lines.concat(t.lines,l.lines);var c=s;return console.log("time network: ",(performance.now()-a)/1e3,s.length),x(e,t,l.edgeData,c)}function A(e,t,n){var r=performance.now();if(n){console.log("getDirectRoute() called for Airside Roadways Routing"),e.lines.concat(t.lines);var i=lc("where.changi.airside",!1,Iu.AirsideNetwork,!0);return console.log("Network Features:",i),console.log("time network: ",(performance.now()-r)/1e3),x(e,t,{},i)}console.log("getDirectRoute() called for In-Airport Routing");var o=lc(fc(e.where),!0,Iu.Network,!1),a=lc(fc(t.where),!0,Iu.Network,!1),s=mc(u.edgeData,fc(e.where)),l=mc(u.edgeData,fc(t.where));console.log("time load: ",(performance.now()-r)/1e3),r=performance.now(),e.lines.concat(t.lines,s.lines,l.lines);var c=o.concat(a);return console.log("time network: ",(performance.now()-r)/1e3,o.length),x(e,t,j(j({},s.edgeData),l.edgeData),c)}return{getRoute:function(n,r,c){var h=function(e){var t;return e.mode===Gu.WithinTerminal&&null!==(t=e.config.wheelChairAccessible)&&void 0!==t&&t}(c),d=function(e){return e.mode===Gu.Airside?e.config.vehicleType:null}(c),p=function(e){if(e.mode===Gu.Airside)return e.config.distanceThreshold}(c);if(i=h,s=d,a=function(e){return e.mode===Gu.Airside}(c),l=function(e){return Boolean(e.config.forRealtime)}(c),n.type===ju.MapObject&&r.type===ju.MapObject&&n.mapObjectId===r.mapObjectId)return console.warn("Start and end locations are the same for mode ".concat(c.mode)),{};if(n.type===ju.Coordinate&&r.type===ju.Coordinate&&n.coordinates[0]===r.coordinates[0]&&n.coordinates[1]===r.coordinates[1]){var f="Start and end locations are the same for mode ".concat(c.mode);throw console.warn(f),new Error(f)}var g=uc(n,{distanceThreshold:p,vehicleTemplateType:s}),m=uc(r,{distanceThreshold:p,vehicleTemplateType:s});console.log("Routing Mode:",c.mode),console.log("Node1:",g),console.log("Node2:",m),console.log("Config:",c.config),e=g,t=m;var v=performance.now();if(function(e){return[Gu.WithinTerminal,Gu.ToTerminal,Gu.FromTerminal].includes(e.mode)}(c)&&(u=cc(),console.log("time portal load with extrapolation: ",(performance.now()-v)/1e3)),v=performance.now(),e&&t){var y=function(){var n=A(e,t,d);if(console.log("Direct route",n),Wu.isEmpty(n)){var r=function(e,t){var n=performance.now(),r=lc(gc,!0,Iu.Network,!1);console.log("time load: ",(performance.now()-n)/1e3),n=performance.now(),e.lines.concat(t.lines,u.lines);var i=r;return console.log("time network: ",(performance.now()-n)/1e3,r.length),x(e,t,u.edgeData,i)}(e,t);return S(e,t,r)}return S(e,t,n)},w=void 0;if(c.mode===Gu.Airside){o=!1;var b=A(e,t,d);return console.log("Airside direct route",b),b}return o=function(e){return e.mode===Gu.WithinTerminal}(c),w=y(),Wu.isEmpty(w)&&(o=!1,w=y()),console.log("time total: ",(performance.now()-v)/1e3),w}return{}}}}(),nd={getRoute:td.getRoute};function rd(e){var t,n,r,i,o,a,s,l,u,c,h,d=uc({type:ju.MapObject,mapObjectId:e.edges[0]}),p=uc({type:ju.MapObject,mapObjectId:e.edges[1]});return j(j(j({maneuverType:Uu.Static,coordinates:[],distance:0,features:[],time:0,startEdge:{mapObjectId:e.edges[0],whereDimension:e.startFloor,whatDimension:d?d.what:"",name:d?d.name:null!==(r=null===(n=null===(t=e.geojson)||void 0===t?void 0:t.properties)||void 0===n?void 0:n.name)&&void 0!==r?r:""},endEdge:{mapObjectId:e.edges[1],whereDimension:e.endFloor,whatDimension:p?p.what:"",name:p?p.name:null===(o=null===(i=e.geojson)||void 0===i?void 0:i.properties)||void 0===o?void 0:o.name},isPortal:e.isPortal,segmentType:Hu.Internal,instructions:[],patchNumber:-1,whereDimension:"",zone:"",cost:e.cost,description:e.description},(null===(s=null===(a=e.geojson)||void 0===a?void 0:a.properties)||void 0===s?void 0:s.localRef)?{localRef:e.geojson.properties.localRef}:{}),(null===(u=null===(l=e.geojson)||void 0===l?void 0:l.properties)||void 0===u?void 0:u.name)?{name:e.geojson.properties.name}:{}),(null===(h=null===(c=e.geojson)||void 0===c?void 0:c.properties)||void 0===h?void 0:h.what)?{whatTaxonomy:e.geojson.properties.what}:{})}function id(e){return e.maneuverType===Uu.RouteOverview||e.maneuverType===Uu.SectionOverview}function od(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];r.properties.highlight=!!t}return e}function ad(e,t,n,r,i){if(void 0===i&&(i=""),0===e.length)return[];var o=[ve(e,{segmentNumber:t,dimension_where:i,patchNumber:r,isNode:!0})];return od(o,n),o}function sd(e,t,n,r,i,o,a,s,l){if(void 0===o&&(o=""),void 0===a&&(a=""),void 0===s&&(s=""),void 0===l&&(l=""),0===e.length)return[];var u=j(j(j({segmentNumber:t,dimension_where:o,patchNumber:r,isNode:!1,zone:i},l?{localRef:l}:{}),a?{whatTaxonomy:a}:{}),s?{name:s}:{}),c=ye(e,j(j({},u),{featureBelongsToLineString:!0})),h=ve(e[0],j(j({},u),{featureBelongsToLineString:!1})),d=ve(e[e.length-1],j(j({},u),{featureBelongsToLineString:!1})),p=[];return p.push(h,c,d),od(p,n),p}function ld(e,t,n){var r,i,o,a,s,l;return I(this,void 0,void 0,function(){var u,c,h,d,p,f,g,m,v,y,w,b,_,x,S,A,P,M,C,k,E,T,L,R,D,F,O,N,I,B,U,H,G,W,V,q,Z,Y,$,J,K,X,Q,ee,te,ne,re,ie,oe,ae,se,le,ue,ce,he,de,pe,fe,ge,me,ve,we,be,_e,xe;return z(this,function(z){for(u=function(e){var t,n,r;return{shouldAddOverviewSegment:null===(t=e.config.shouldAddOverviewSegment)||void 0===t||t,shouldAddStartSegment:null===(n=e.config.shouldAddStartSegment)||void 0===n||n,shouldAddEndSegment:null===(r=e.config.shouldAddEndSegment)||void 0===r||r}}(n),c=u.shouldAddOverviewSegment,h=u.shouldAddStartSegment,d=u.shouldAddEndSegment,p=function(e){var t;return null!==(t=e.indexOffset)&&void 0!==t?t:0}(n),f=n.mode===Gu.Airside,g=nd.getRoute(e,t,n),m=g.routes,console.log("PathSegments:",m),v=[],w=0;m&&w<m.length;w+=1)if(b=m[w],_=b.geojson.properties.zone,b.isPortal)y=j(j({},rd(b)),{maneuverType:Uu.Static,coordinates:[b.geojson.geometry.coordinates[1]],zone:_,isPortal:!1}),K=j(j({},rd(b)),{maneuverType:Uu.EnterPortal,coordinates:[b.geojson.geometry.coordinates[0]]}),v.push(K),X=j(j({},rd(b)),{maneuverType:Uu.ExitPortal,coordinates:[b.geojson.geometry.coordinates[1]]}),v.push(X),(Q=v.length>0?v[v.length-1]:void 0)&&Q.maneuverType===Uu.ExitPortal&&(v.pop(),b.portalPath&&(ee=j(j({},rd(b)),{maneuverType:Uu.TravelPortal,coordinates:b.portalPath.geometry.coordinates,zone:_}),v.push(ee)),v.push(X));else{if(x=b.geojson.geometry.coordinates,S=Uu.Static,0===v.length&&h&&(A=j(j({},rd(b)),{maneuverType:Uu.Static,coordinates:[x[0]]}),v.push(A)),w>0&&v.length>0&&(P=m[w-1],M=P.geojson.properties.zone,_===M||f||(C=P.geojson.geometry.coordinates,R=j(j({},rd(P)),{maneuverType:Uu.ChangeZone,zone:_,coordinates:[C[C.length-1]]}),v.push(R),S=Uu.ChangeZone)),x.length>2)for(se=0;se<x.length-2;se+=1)k=x[se],E=x[se+1],T=x[se+2],y=j(j({},rd(b)),{maneuverType:Uu.Static,coordinates:[T],zone:_||""}),L=Uu.ContinueStraight,R=j(j({},rd(b)),{maneuverType:L,zone:_}),S===Uu.ContinueStraight?(se+3===x.length?v[v.length-1].coordinates.push(E,T):v[v.length-1].coordinates.push(E),v[v.length-1].maneuverType=L):(R.coordinates.push(k,E),v.push(R),se+3===x.length&&(L===Uu.ContinueStraight?v[v.length-1].coordinates.push(T):v.push(j(j({},rd(b)),{maneuverType:Uu.ContinueStraight,coordinates:[E,T],zone:_||""})))),S=L;else R=j(j({},rd(b)),{maneuverType:Uu.ContinueStraight,coordinates:x,zone:_}),v.push(R),y=j(j({},rd(b)),{maneuverType:Uu.Static,coordinates:[x[x.length-1]],zone:_||""});if(D=function(){if(v.length>0){var e=v[v.length-1];e.maneuverType===Uu.ChangeZone&&e.zone===Nu.Transit&&v.pop()}},(Q=v.length>0?v[v.length-1]:void 0)&&Q.maneuverType===Uu.ContinueStraight)for(F=hc(Q.startEdge.whereDimension),O=ye(Q.coordinates),se=0;se<F.length;se+=1)N=F[se],bh(O,N)||((I=ms(O,N)).features.length>1?(v.pop(),B=Nh(ea(O)[0],Qo(I.features[0]),O),xs(B,{units:"meters"})>=10?(U=j(j({},rd(b)),{maneuverType:Uu.ContinueStraight,zone:_,coordinates:ea(B)}),v.push(U)):v.length>0&&((Q=v[v.length-1]).maneuverType===Uu.ChangeZone?(H=ea(B),Q.coordinates=[H[H.length-1]],v.length>1&&((q=v[v.length-2]).coordinates=q.coordinates.concat(ea(B)))):Q.coordinates.concat(ea(B))),G=Nh(Qo(I.features[0]),Qo(I.features[1]),O),W=j(j({},rd(b)),{maneuverType:Uu.PassThroughImmigration,zone:_,coordinates:ea(G)}),0===v.length&&(W.coordinates=B.geometry.coordinates.concat(W.coordinates)),D(),v.push(W),Y=ea(O),$=Nh(Qo(I.features[1]),Y[Y.length-1],O),J=j(j({},rd(b)),{maneuverType:Uu.ContinueStraight,zone:_,coordinates:ea($)}),v.push(J)):I.features.length>0&&(ll(ea(O)[0],N)?(v.pop(),G=Nh(ea(O)[0],Qo(I.features[0]),O),W=j(j({},rd(b)),{maneuverType:Uu.PassThroughImmigration,zone:_,coordinates:ea(G)}),(Q=v.length>0?v[v.length-1]:void 0)&&Q.maneuverType===Uu.ChangeZone&&(V=v.pop(),v.length>1&&(q=v[v.length-1]).maneuverType===Uu.PassThroughImmigration&&(v.pop(),V.coordinates=[q.coordinates[0]],v.push(V),W.coordinates=q.coordinates.concat(W.coordinates))),D(),v.push(W),Y=ea(O),$=Nh(Qo(I.features[0]),Y[Y.length-1],O),J=j(j({},rd(b)),{maneuverType:Uu.ContinueStraight,zone:_,coordinates:ea($)}),v.push(J)):(Z=Nh(ea(O)[0],Qo(I.features[0]),O),Q.coordinates=ea(Z),Y=ea(O),$=Nh(Qo(I.features[0]),Y[Y.length-1],O),J=j(j({},rd(b)),{maneuverType:Uu.PassThroughImmigration,zone:_,coordinates:ea($)}),v.push(J))))}if(y&&d&&v.push(y),f&&v.length>0&&function(e){if(0!==(null==e?void 0:e.length)){e[0].coordinates=[e[1].coordinates[e[1].coordinates.length-1]],e[e.length-1].coordinates=[e[e.length-2].coordinates[0]],e.splice(1,1),e.splice(e.length-2,1);for(var t=1;t<e.length;t+=1){var n=e[t-1],r=e[t];if((n.maneuverType===Uu.ContinueStraight||n.maneuverType===Uu.RoadChangeContinueStraight||n.maneuverType===Uu.TurnLeftAndContinue||n.maneuverType===Uu.TurnSlightLeftAndContinue||n.maneuverType===Uu.TurnRightAndContinue||n.maneuverType===Uu.TurnSlightRightAndContinue||n.maneuverType===Uu.UTurnAndContinue)&&r.maneuverType===Uu.ContinueStraight&&n.localRef!==r.localRef){var i=n.coordinates,o=r.coordinates;if(i.length>=2&&o.length>=2){var a=ia(i[i.length-2],i[i.length-1]),s=ia(o[0],o[1])-a;s>180&&(s-=360),s<-180&&(s+=360),r.maneuverType=s>-30&&s<30?Uu.RoadChangeContinueStraight:s>=30&&s<60?Uu.TurnSlightRightAndContinue:s>=60&&s<120?Uu.TurnRightAndContinue:s<=-30&&s>-60?Uu.TurnSlightLeftAndContinue:s<=-60&&s>-120?Uu.TurnLeftAndContinue:Uu.UTurnAndContinue}else r.maneuverType=Uu.RoadChangeContinueStraight}}}}(v),te={segments:v,walkingDistance:0,transportDistance:0,walkingTime:0,transportTime:0,distanceUnit:nc,speed:1},f&&(te.speed=8.33),te.segments.length>0){for(re=0,(ne=c)&&((ie=Wu.cloneDeep(te.segments[0])).maneuverType=Uu.RouteOverview,te.segments.unshift(ie),re=1),oe=p+re,ae=te.segments.length>re?te.segments[re].startEdge.whereDimension:"",se=re;se<te.segments.length;se+=1){if(le=!1,ue=te.segments[se],ce=p+se,ue.isPortal){if(ue.maneuverType===Uu.EnterPortal){for(de=ad(ue.coordinates[0],ce,le,oe,ue.startEdge.whereDimension),pe=[],fe=0,ge=de;fe<ge.length;fe++)me=ge[fe],pe.push(me);ue.features=pe,ue.patchNumber=oe,ue.whereDimension=ae,(ve=te.segments.length>=se+2?te.segments[se+1]:void 0)&&ve.maneuverType!==Uu.TravelPortal?(we=ue.cost,ue.time=we||0):ue.time=0,ue.distance=0}ue.maneuverType===Uu.TravelPortal&&(ue.features=sd(ue.coordinates,ce,le,oe,ue.zone,ue.startEdge.whereDimension),ue.patchNumber=oe,ue.whereDimension=ae,we=ue.cost,ue.time=we||0,be=void 0,be=ue.coordinates.length>1?xs(ye(ue.coordinates),{units:te.distanceUnit}):0,ue.distance=be,se>0&&(te.segments[se-1].time=0)),ue.maneuverType===Uu.ExitPortal&&(oe+=1,ae=ue.endEdge.whereDimension,te.segments.splice(se,1),se-=1),(_e=te.segments.length>=se+2?te.segments[se+1]:void 0)&&_e.maneuverType===Uu.TravelPortal&&(oe+=1)}else ue.maneuverType===Uu.Static||ue.maneuverType===Uu.ChangeZone?(ue.features=ad(ue.coordinates[0],ce,le,oe,ue.endEdge.whereDimension),ue.patchNumber=oe,ue.whereDimension=ae):(ue.features=sd(ue.coordinates,ce,le,oe,ue.zone,ue.startEdge.whereDimension,null!==(o=null===(i=null===(r=ue.features[0])||void 0===r?void 0:r.properties)||void 0===i?void 0:i.what)&&void 0!==o?o:"",null!==(l=null===(s=null===(a=ue.features[0])||void 0===a?void 0:a.properties)||void 0===s?void 0:s.name)&&void 0!==l?l:"",ue.localRef),ue.patchNumber=oe,ue.whereDimension=ae),he=ue.coordinates,be=void 0,be=he.length>1?xs(ye(he),{units:te.distanceUnit}):0,ue.distance=be,ue.maneuverType!==Uu.PassThroughImmigration?ue.time=ue.distance/te.speed:ue.time=0;f||ue.maneuverType===Uu.TravelPortal?(te.transportDistance+=ue.distance,te.transportTime+=ue.time):(te.walkingDistance+=ue.distance,te.walkingTime+=ue.time)}ne&&(xe=Pd(te,p),te.segments[0]=xe)}return[2,te]})})}function ud(e){return!!Object.values(Qh).includes(e)}function cd(e){return!!Object.values(ed).includes(e)}function hd(e){return!(!ud(e)&&!cd(e))}function dd(e){switch(e){case"what.transport.skytrain":return"Skytrain";case"what.service.airport_transfer":return"Bus";case"what.infra.escalator":return"Escalator";case"what.infra.lift":return"Lift";case"what.infra.entrance":case"what.infra.exit":return"";default:return e}}function pd(e,t){var n,r=function(e){var t=e.split(".").slice(-2).join("").toUpperCase().match(/^(T\d+|JEWEL)([A-Za-z]\d+[A-Za-z]?)$/);if(t){var n=void 0;switch(t[1][0]){case"T":n="Terminal";break;case"J":n="Jewel";break;default:n="Level"}var r="Terminal"===n?"".concat(n," ").concat(t[1][1]):"".concat(n),i=void 0;switch(t[2][0]){case"L":default:i="Level";break;case"B":i="Basement"}return{Terminal:r,Level:"".concat(i," ").concat(t[2].substring(1))}}return null}(t);if(r){if((n=e)===Qh.Skytrain||n===Qh.Bus)return r.Terminal;if(e===Qh.Escalator||e===Qh.Lift)return r.Level;if(cd(e))return r.Terminal}return t.split(".").slice(-2).join(" ").toUpperCase()}!function(e){e.Skytrain="what.transport.skytrain",e.Bus="what.service.airport_transfer",e.Escalator="what.infra.escalator",e.Lift="what.infra.lift"}(Qh||(Qh={})),function(e){e.Entrance="what.infra.entrance",e.Exit="what.infra.exit"}(ed||(ed={}));var fd=function(e){return(e="number"==typeof e?{precision:e}:e||{}).precision=e.precision||5,e.factor=e.factor||Math.pow(10,e.precision),e.dimension=e.dimension||2,e},gd={encode:function(e,t){t=fd(t);var n=[];return e.forEach(function(e){if(2===t.dimension)n.push(e.lat||e[0]),n.push(e.lng||e[1]);else for(var r=0;r<t.dimension;++r)n.push(e[r])}),gd.encodeDeltas(n,t)},decode:function(e,t){t=fd(t);for(var n=gd.decodeDeltas(e,t),r=[],i=0;i<n.length;i+=2){var o=[],a=n[i],s=n[i+1];o.push(s,a),r.push(o)}return r},encodeDeltas:function(e,t){t=fd(t);var n=[];return e.forEach(function(r,i){var o=r-(n[i%t.dimension]||0);n[i%t.dimension]=r,e[i]=o}),gd.encodeFloats(e,t)},decodeDeltas:function(e,t){t=fd(t);var n=[],r=gd.decodeFloats(e,t);return r.forEach(function(e,i){r[i]=Math.round((n[i%t.dimension]=e+(n[i%t.dimension]||0))*t.factor)/t.factor}),r},encodeFloats:function(e,t){return t=fd(t),gd.encodeSignedIntegers(e.map(function(e){return Math.round(e*t.factor)}))},decodeFloats:function(e,t){return t=fd(t),gd.decodeSignedIntegers(e).map(function(e){return e/t.factor})},encodeSignedIntegers:function(e){return gd.encodeUnsignedIntegers(e.map(function(e){return e<0?~(e<<1):e<<1}))},decodeSignedIntegers:function(e){return gd.decodeUnsignedIntegers(e).map(function(e){return 1&e?~(e>>1):e>>1})},encodeUnsignedIntegers:function(e){return e.reduce(function(e,t){return e+gd.encodeUnsignedInteger(t)},"")},decodeUnsignedIntegers:function(e){for(var t=[],n=0,r=0,i=0;i<e.length;i++){var o=e.charCodeAt(i)-63;n|=(31&o)<<r,o<32?(t.push(n),n=0,r=0):r+=5}return t},encodeSignedInteger:function(e){return gd.encodeUnsignedInteger(e<0?~(e<<1):e<<1)},encodeUnsignedInteger:function(e){for(var t="";e>=32;)t+=String.fromCharCode(63+(32|31&e)),e>>=5;return t+=String.fromCharCode(e+63)}};function md(e,t,n,r){return I(this,void 0,void 0,function(){return z(this,function(e){return[2,null]})})}function vd(e){return I(this,void 0,void 0,function(){return z(this,function(e){return[2,null]})})}function yd(e){var t={maneuverType:Uu.Static,coordinates:[],distance:e.distance,features:[],time:e.duration,startEdge:{mapObjectId:"",whereDimension:"where.external",whatDimension:"what.location",name:e.from.name},endEdge:{mapObjectId:"",whereDimension:"where.external",whatDimension:"what.location",name:e.to.name},isPortal:"WALK"!==e.mode,segmentType:Hu.External,instructions:[],patchNumber:-1,whereDimension:"where.external",zone:""};return"WALK"!==e.mode&&(t.portalName=e.routeLongName),t}function wd(e,t,n,r,i){var o;return void 0===t&&(t=!0),void 0===n&&(n=!0),void 0===r&&(r=!0),void 0===i&&(i=0),I(this,void 0,void 0,function(){var a,s,l,u,c,h,d,p,f,g,m,v,y,w,b,_,x,S,A,P,M,C,k,E;return z(this,function(T){try{if(a=null==e?void 0:e.legs,s=null===(o=null==e?void 0:e.legs)||void 0===o?void 0:o.length,l=[],n&&(u=j(j({},yd(a[0])),{maneuverType:Uu.Static,coordinates:[gd.decode(a[0].legGeometry.points,5)[0]],distance:0,isPortal:!1,features:[],time:0}),l.push(u)),a.map(function(e){var t=gd.decode(e.legGeometry.points,5);if("WALK"===e.mode){var n=j(j({},yd(e)),{maneuverType:Uu.ContinueStraight,coordinates:t,distance:e.distance,time:e.duration});l.push(n)}else{var r=[];if("BUS"===e.mode){var i=l[l.length-1];r=i.coordinates.length>2?i.coordinates[i.coordinates.length-1]:[],console.log("LAST_LINE:",i),console.log("LAST_VERTEX:",r)}var o=j(j({},yd(e)),{maneuverType:Uu.EnterPortal,coordinates:r.length>1?[r]:[t[0]],isPortal:!0,distance:0,time:0}),a=j(j({},yd(e)),{maneuverType:Uu.TravelPortal,coordinates:t,isPortal:!0,distance:e.distance,time:e.duration}),s=j(j({},yd(e)),{maneuverType:Uu.ExitPortal,coordinates:[t[t.length-1]],distance:0,time:0,isPortal:!0});l.push(o,a,s)}}),r&&(c=gd.decode(a[s-1].legGeometry.points,5),h=j(j({},yd(a[s-1])),{maneuverType:Uu.Static,coordinates:[c[c.length-1]],distance:0,isPortal:!1,features:[],time:0}),l.push(h)),(d={segments:l,walkingDistance:0,transportDistance:0,walkingTime:0,transportTime:0,distanceUnit:nc,speed:1}).segments.length>0){for(f=0,(p=t)&&((g=Wu.cloneDeep(d.segments[0])).maneuverType=Uu.SectionOverview,d.segments.unshift(g),(g=Wu.cloneDeep(d.segments[0])).maneuverType=Uu.RouteOverview,d.segments.unshift(g),f=2),m=i+f,v=d.segments.length>f?d.segments[f].startEdge.whereDimension:"",y=f;y<d.segments.length;y+=1){if(w=!1,b=d.segments[y],_=i+y,b.isPortal){if(b.maneuverType===Uu.EnterPortal){for(x=Sd(b.coordinates[0],_,w,m,b.startEdge.whereDimension),S=[],A=0,P=x;A<P.length;A++)M=P[A],S.push(M);b.features=S,b.patchNumber=m,b.whereDimension=v}b.maneuverType===Uu.TravelPortal&&(b.features=Ad(b.coordinates,_,w,m,b.zone,b.startEdge.whereDimension),b.patchNumber=m,b.whereDimension=v),b.maneuverType===Uu.ExitPortal&&(d.segments.splice(y,1),y-=1)}else b.maneuverType===Uu.Static?(b.features=Sd(b.coordinates[0],_,w,m,b.endEdge.whereDimension),b.patchNumber=m,b.whereDimension=v):(b.features=Ad(b.coordinates,_,w,m,b.zone,b.startEdge.whereDimension),b.patchNumber=m,b.whereDimension=v),C=b.coordinates,k=void 0,k=C.length>1?xs(ye(C),{units:d.distanceUnit}):0,b.distance=k;b.maneuverType===Uu.ContinueStraight?(d.walkingDistance+=b.distance,d.walkingTime+=b.time):(d.transportDistance+=b.distance,d.transportTime+=b.time)}p&&(E=Pd(d,i),d.segments[0]=E,E=Pd(d,i+1),d.segments[1]=E)}return[2,d]}catch(e){return console.log("Error:",e),[2,void 0]}return[2]})})}function bd(e,t,n,r,i){return I(this,void 0,void 0,function(){var i,o,a,s,l,u,c,h,d;return z(this,function(p){switch(p.label){case 0:if(!e)return console.error("ExternalTransitionPoint not received"),[2,void 0];if(t.type!==ju.MapObject)return console.error("Internal location must be MapObject type for external routing"),[2,void 0];if(i=Number.POSITIVE_INFINITY,console.log("ExternalTransitionPoint",e),0===(a=void e.stopCode).length)return[2,void 0];if(console.log("AirportTransitionPoints:",a),!(a.length>0))return[3,5];s=0,p.label=1;case 1:return s<a.length?(l={type:ju.MapObject,mapObjectId:a[s].id},u=void 0,c=void 0,"Inside"===r?(u=l,c=t):(u=t,c=l),[4,Md(u,c,n)]):[3,4];case 2:h=p.sent(),(d=h.walkingTime+h.transportTime)<i&&(i=d,o=h),p.label=3;case 3:return s+=1,[3,1];case 4:return console.log("InternalShortestRoute:",o),console.log("InternalShortestTime",i/60),[3,6];case 5:return console.error("Internal transition points not found"),[2,void 0];case 6:return[2,o]}})})}function _d(e,t,n,r){return void 0===r&&(r="Inside"),I(this,void 0,void 0,function(){var i,o,a,s,l,u,c,h,d,p,f,g,m,v;return z(this,function(y){switch(y.label){case 0:a=e.plan.itineraries.length,s=e.plan.itineraries,l=Number.POSITIVE_INFINITY,u=0,y.label=1;case 1:return u<a?(function(e,t){"Inside"!==t||"WALK"!==e[e.length-1].mode||"SUBWAY"!==e[e.length-2].mode&&"BUS"!==e[e.length-2].mode?"Outside"!==t||"WALK"!==e[0].mode||"SUBWAY"!==e[1].mode&&"BUS"!==e[1].mode||e.shift():e.pop()}(c=s[u].legs,r),h=s[u].legs.length,d=void 0,p=null,f=void 0,"Inside"===r?(d=c[h-1].mode,p={name:c[h-1].to.name,lat:c[h-1].to.lat,lng:c[h-1].to.lon,stopId:c[h-1].to.stopId,stopCode:c[h-1].to.stopCode}):"Outside"===r&&(d=c[0].mode,p={name:c[0].from.name,lat:c[0].from.lat,lng:c[0].from.lon,stopId:c[0].from.stopId,stopCode:c[0].from.stopCode}),"WALK"!==d?[3,3]:("Inside"===r?(d=c[h-2].mode,p={name:c[h-2].to.name,lat:c[h-2].to.lat,lng:c[h-2].to.lon,stopId:c[h-2].to.stopId,stopCode:c[h-2].to.stopCode}):"Outside"===r&&(d=c[1].mode,p={name:c[1].from.name,lat:c[1].from.lat,lng:c[1].from.lon,stopId:c[1].from.stopId,stopCode:c[1].from.stopCode}),console.log("INFINITY_WALKMODE"),[4,bd(p,t,n,r)])):[3,7];case 2:return f=y.sent(),[3,5];case 3:return[4,bd(p,t,n,r)];case 4:f=y.sent(),y.label=5;case 5:if(!f||0===f.segments.length)return console.error("Internal route to nearest transition point not found"),[2,void 0];g=f.walkingTime+f.transportTime,m=s[u].duration,(v=g+m)<l&&(l=v,i=f,o=s[u]),y.label=6;case 6:return u+=1,[3,1];case 7:return[2,{shortestInternalRoute:i,shortestExternalRoute:o}]}})})}function xd(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];r.properties.highlight=!!t}return e}function Sd(e,t,n,r,i){if(void 0===i&&(i=""),0===e.length)return[];var o=[ve(e,{segmentNumber:t,dimension_where:i,patchNumber:r,isNode:!0})];return xd(o,n),o}function Ad(e,t,n,r,i,o){if(void 0===o&&(o=""),0===e.length)return[];var a={segmentNumber:t,dimension_where:o,patchNumber:r,isNode:!1,zone:i},s=ye(e,j(j({},a),{featureBelongsToLineString:!0})),l=ve(e[0],j(j({},a),{featureBelongsToLineString:!1})),u=ve(e[e.length-1],j(j({},a),{featureBelongsToLineString:!1})),c=[];return c.push(l,s,u),xd(c,n),c}function Pd(e,t){void 0===t&&(t=0);var n=Wu.cloneDeep(e.segments[1]),r=e.segments.length>1?e.segments[1].startEdge.whereDimension:"";n.coordinates=[],n.features=[],n.time=0,n.distance=0,n.isPortal=!1,n.maneuverType=Uu.RouteOverview,n.patchNumber=t,n.instructions=["Overview"];for(var i=1;i<e.segments.length;i+=1)if(e.segments[i].maneuverType!==Uu.SectionOverview){for(var o=0;o<e.segments[i].coordinates.length;o+=1){var a=e.segments[i].coordinates[o];n.coordinates.push(a)}for(o=0;o<e.segments[i].features.length;o+=1){var s=Wu.cloneDeep(e.segments[i].features[o]);s.properties&&!s.properties.isNode&&(s.properties.dimension_where!==r?s.properties.isNonHighlightedOverview="1":s.properties.isNonHighlightedOverview="0",s.properties.dimension_where=r,s.properties.patchNumber=n.patchNumber,s.properties.segmentNumber=n.patchNumber,n.features.push(s))}}return n.endEdge=Wu.cloneDeep(e.segments[e.segments.length-1].endEdge),n.time=e.walkingTime+e.transportTime,n.distance=e.walkingDistance+e.transportDistance,n}function Md(e,t,n){return I(this,void 0,void 0,function(){var r;return z(this,function(i){switch(i.label){case 0:return[4,ld(e,t,n)];case 1:return r=i.sent(),console.log("internal generated: ",r),function(e){for(var t=function(t){return 0===t||1===t&&e.segments[t-1].maneuverType===Uu.RouteOverview},n=function(e){return e.startEdge.whereDimension.toLowerCase().includes("l1")?"Clear Arrival Immigration":"Clear Departure Immigration"},r=function(e){return e?e.split(".").slice(5).join(" ").split(/[\s_]+/).map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join(" "):""},i=0;i<e.segments.length;i+=1){var o=e.segments[i];if(o.instructions=[],o.maneuverType===Uu.RouteOverview){var a="Overview";o.instructions.push(a)}if(i>0&&o.maneuverType===Uu.ChangeZone)a="",e.segments[i-1].zone===Nu.Public&&o.zone===Nu.Transit?a=n(o):e.segments[i-1].zone===Nu.Transit&&o.zone===Nu.Public&&(a="Exit Baggage Claim Hall"),o.instructions.push(a);else if(o.maneuverType===Uu.ContinueStraight||o.maneuverType===Uu.PassThroughImmigration){var s=o.maneuverType===Uu.ContinueStraight?"".concat((null==o?void 0:o.localRef)?"Continue":"Walk"," for ").concat(Math.ceil(o.distance)," ").concat(e.distanceUnit):n(o);o.localRef&&(s=o.maneuverType===Uu.ContinueStraight?"".concat((null==o?void 0:o.localRef)?"Continue":"Walk","\n ").concat((null==o?void 0:o.name)&&"unknown"!==o.name?"on ".concat(o.name):"","\n ").concat("".concat(r(o.whatTaxonomy)," Road"),"\n for ").concat(Math.ceil(o.distance)," ").concat(e.distanceUnit):n(o)),a=void 0,0===i||e.segments[i-1].maneuverType!==Uu.ChangeZone&&(e.segments[i-1].maneuverType,Uu.PassThroughImmigration),a=s,o.instructions.push(a)}else if(o.maneuverType===Uu.Static)t(i)&&o.instructions.push("Start at ".concat(o.startEdge.name," on ").concat(o.startEdge.whereDimension.split(".").slice(-2).join(" ").toUpperCase())),i===e.segments.length-1&&o.instructions.push("Arrive at ".concat(o.endEdge.name," on ").concat(o.endEdge.whereDimension.split(".").slice(-2).join(" ").toUpperCase()));else if(o.maneuverType===Uu.EnterPortal){if(a="Enter ".concat(o.startEdge.name," at ").concat(o.startEdge.whereDimension.split(".").slice(-2).join(" ").toUpperCase()),cd(o.startEdge.whatDimension))a="Continue to ".concat(pd(o.startEdge.whatDimension,o.endEdge.whereDimension)),o.instructions.push(a);else if(ud(o.startEdge.whatDimension)){var l=i+1<=e.segments.length-1?e.segments[i+1]:void 0;if(l&&l.maneuverType===Uu.TravelPortal){o.instructions.push(a),i+=1;var u=dd(l.startEdge.whatDimension);a="Take ".concat(u," to ").concat(pd(o.startEdge.whatDimension,o.endEdge.whereDimension)),l.instructions.push(a),o.description&&l.instructions.push(o.description)}else{var c=dd(o.startEdge.whatDimension);a="Take ".concat(c," to ").concat(pd(o.startEdge.whatDimension,o.endEdge.whereDimension)),o.instructions.push(a)}}}else o.maneuverType===Uu.RoadChangeContinueStraight?(a="Continue on\n ".concat(o&&"unknown"!==o.name?o.name:"","\n ").concat("".concat(r(o.whatTaxonomy)," Road"),"\n for ").concat(Math.ceil(o.distance)," ").concat(e.distanceUnit),o.instructions.push(a)):o.maneuverType===Uu.UTurnAndContinue?(a="Take U-Turn onto\n ".concat(o&&"unknown"!==o.name?o.name:"","\n ").concat("".concat(r(o.whatTaxonomy)," Road"),"\n for ").concat(Math.ceil(o.distance)," ").concat(e.distanceUnit),o.instructions.push(a)):o.maneuverType===Uu.TurnSlightLeftAndContinue?(a="Turn Slight Left onto\n ".concat(o&&"unknown"!==o.name?o.name:"","\n ").concat("".concat(r(o.whatTaxonomy)," Road"),"\n & Continue for ").concat(Math.ceil(o.distance)," ").concat(e.distanceUnit),o.instructions.push(a)):o.maneuverType===Uu.TurnLeftAndContinue?(a="Turn Left onto\n ".concat(o&&"unknown"!==o.name?o.name:"","\n ").concat("".concat(r(o.whatTaxonomy)," Road"),"\n & Continue for ").concat(Math.ceil(o.distance)," ").concat(e.distanceUnit),o.instructions.push(a)):o.maneuverType===Uu.TurnRightAndContinue?(a="Turn Right onto\n ".concat(o&&"unknown"!==o.name?o.name:"","\n ").concat("".concat(r(o.whatTaxonomy)," Road"),"\n & Continue for ").concat(Math.ceil(o.distance)," ").concat(e.distanceUnit),o.instructions.push(a)):o.maneuverType===Uu.TurnSlightRightAndContinue&&(a="Turn Slight Right onto\n ".concat(o&&"unknown"!==o.name?o.name:"","\n ").concat("".concat(r(o.whatTaxonomy)," Road"),"\n & Continue for ").concat(Math.ceil(o.distance)," ").concat(e.distanceUnit),o.instructions.push(a))}}(r),console.log(r.segments),[2,r]}})})}function Cd(e,t,n,r,i){return void 0===t&&(t=!0),void 0===n&&(n=!0),void 0===r&&(r=!0),void 0===i&&(i=0),I(this,void 0,void 0,function(){var o;return z(this,function(a){switch(a.label){case 0:return[4,wd(e,t,n,r,i)];case 1:return o=a.sent(),console.log("GeneratedExternalRoute:",o),function(e){for(var t=0;t<e.segments.length;t+=1){var n=e.segments[t];if(n.instructions=[],n.maneuverType===Uu.RouteOverview){var r="Overview";n.instructions.push(r)}n.maneuverType===Uu.SectionOverview&&(r="",n.instructions.push(r)),t>0&&n.maneuverType===Uu.ContinueStraight?(r="Walk for ".concat(Math.ceil(n.distance)," ").concat(e.distanceUnit),n.instructions.push(r)):t>0&&n.maneuverType===Uu.TravelPortal?(r="Take ".concat(null==n?void 0:n.portalName," to ").concat(n.endEdge.name),n.instructions.push(r)):t>0&&n.maneuverType===Uu.EnterPortal?(r="Enter ".concat(null==n?void 0:n.portalName," at ").concat(n.startEdge.name),n.instructions.push(r)):t>0&&n.maneuverType===Uu.Static?t===e.segments.length-1?(r="Arrive at ".concat(n.endEdge.name),n.instructions.push(r)):1===t&&e.segments[t-1].maneuverType===Uu.RouteOverview&&(r="Start at ".concat(n.startEdge.name),n.instructions.push(r)):0===t&&e.segments[t].maneuverType===Uu.Static&&(r="Start at ".concat(n.startEdge.name),n.instructions.push(r))}}(o),[2,o]}})})}var kd=new Map;function Ed(e){return I(this,void 0,void 0,function(){var e;return z(this,function(t){switch(t.label){case 0:return[4,vd()];case 1:return(e=t.sent())?[2,e.GeocodeInfo]:[2,void 0]}})})}function Td(e){return I(this,void 0,void 0,function(){var t,n,r,i;return z(this,function(o){switch(o.label){case 0:return e.type===ju.MapObject?(t=uc(e))?[2,t.name||"Unknown Location"]:[2,"Unknown Location"]:e.type!==ju.Coordinate?[3,3]:(n="".concat(e.coordinates[0],",").concat(e.coordinates[1]),"where.external"!==e.whereDimension?[3,2]:kd.has(n)?[2,kd.get(n)]:[4,Ed()]);case 1:return r=o.sent(),i=n,r&&r.length>0&&(i="NIL"!==r[0].BUILDINGNAME&&"null"!==r[0].BUILDINGNAME?r[0].BUILDINGNAME:"NIL"!==r[0].ROAD&&"null"!==r[0].ROAD?r[0].ROAD:"".concat(e.coordinates[0].toFixed(5),",").concat(e.coordinates[1].toFixed(5))),kd.set(n,i),[2,i];case 2:return[2,"".concat(e.coordinates[0].toFixed(6),",").concat(e.coordinates[1].toFixed(6))];case 3:return[2,"Unknown Location"]}})})}function Ld(){return{segments:[],walkingDistance:0,transportDistance:0,walkingTime:0,transportTime:0,distanceUnit:nc,speed:1}}function Rd(e,t,n,r,i){var o;return I(this,void 0,void 0,function(){var a,s,l,u,c,h,d,p,f,g,m,v,y;return z(this,function(w){switch(w.label){case 0:console.log("Case: Within Terminal (Pedestrian)"),a=null!==(o=t.wheelChairAccessible)&&void 0!==o&&o,s=Ld(),l=Ld(),s.segments.push({}),u=1,c=0,h=0,w.label=1;case 1:return h<e.length-1?(d={mode:Gu.WithinTerminal,config:{wheelChairAccessible:a,shouldAddOverviewSegment:n,shouldAddStartSegment:r,shouldAddEndSegment:i,forRealtime:t.forRealtime},indexOffset:u},[4,Md(e[h],e[h+1],d)]):[3,4];case 2:if(!((p=w.sent()).segments.length>0))return console.error("Within-terminal route not found"),[2,void 0];for((f=p.segments[0]).maneuverType=Uu.SectionOverview,f.instructions=["".concat(f.startEdge.name," to ").concat(f.endEdge.name)],g=0;g<p.segments.length;g+=1)m=p.segments[g],s.segments.push(m),l.segments.push(m);s.walkingDistance+=p.walkingDistance,s.transportDistance+=p.transportDistance,s.walkingTime+=p.walkingTime,s.transportTime+=p.transportTime,l.walkingDistance+=p.walkingDistance,l.transportDistance+=p.transportDistance,l.walkingTime+=p.walkingTime,l.transportTime+=p.transportTime,u+=p.segments.length,w.label=3;case 3:return h+=1,[3,1];case 4:return v=Pd(l,c),s.segments[c]=v,l.segments.unshift(v),s.segments.length>1?(y=Pd(s),s.segments[0]=y):s.segments.length=0,console.log("Within-terminal route:",s),[2,s]}})})}function Dd(e,t,n,r,i){var o,a,s;return I(this,void 0,void 0,function(){var r,i,l,u,c,h,d,p,f,g,m,v,y,w,b,_,x,S,A,P,M,C,k,E,T,L,R,D,F,O;return z(this,function(N){switch(N.label){case 0:console.log("Case: To Terminal (External → Internal)"),r=t.departureDate,i=t.departureTime,l=t.wheelChairAccessible,u=void 0!==l&&l,c=Ld(),h=Ld(),d=Ld(),c.segments.push({}),p=1,f=0,e.length>2&&(f=c.segments.length,p+=1,c.segments.push({})),g=0,N.label=1;case 1:return g<e.length-1?(m=e[g],e[g+1],m.type!==ju.Coordinate?(console.error("ToTerminal mode: first location must be coordinate type"),[2,void 0]):(v=performance.now(),[4,md()])):[3,8];case 2:return(y=N.sent())?(w={mode:Gu.ToTerminal,config:{departureDate:r,departureTime:i,shouldAddOverviewSegment:!0,shouldAddStartSegment:!0,shouldAddEndSegment:!0,forRealtime:t.forRealtime},indexOffset:p},[4,_d(y,e[g+1],w,"Inside")]):(console.error("External route not found"),[2,void 0]);case 3:return(b=N.sent())?(console.log("ShortestCompleteRoute:",b),_=performance.now(),console.log("EXECUTION_TIME:",_-v),[4,Cd(b.shortestExternalRoute,n,!0,!0,p)]):[2,void 0];case 4:return(x=N.sent()).segments.length?[4,Td(e[g])]:(console.error("Something went wrong in computing external route"),[2,void 0]);case 5:return S=N.sent(),x.segments[2].instructions=["Start at ".concat(S)],p+=x.segments.length,p+=1,(A=null===(o=b.shortestInternalRoute)||void 0===o?void 0:o.segments)?(P={mode:Gu.WithinTerminal,config:{wheelChairAccessible:u,shouldAddOverviewSegment:!0,shouldAddStartSegment:!0,shouldAddEndSegment:!0,forRealtime:t.forRealtime},indexOffset:p},M={type:ju.MapObject,mapObjectId:A[0].startEdge.mapObjectId},C={type:ju.MapObject,mapObjectId:A[A.length-1].endEdge.mapObjectId},[4,Md(M,C,P)]):(console.error("Internal route segments empty"),[2,void 0]);case 6:if(!((k=N.sent()).segments.length>0))return console.error("Internal route not found"),[2,void 0];for((L=k.segments[0]).maneuverType=Uu.SectionOverview,L.instructions=["".concat(L.startEdge.name," to ").concat(L.endEdge.name)],E=k.segments[1].startEdge.whereDimension.split("."),x.segments[x.segments.length-1].instructions=["Arrive at ".concat(k.segments[1].startEdge.name," at ").concat(E[3].toUpperCase()," ").concat(E[4].toUpperCase())],x.segments[x.segments.length-1].whereDimension=k.segments[1].startEdge.whereDimension,x.segments[x.segments.length-1].endEdge.whereDimension=k.segments[1].startEdge.whereDimension,x.segments[x.segments.length-1].features[0].geometry.coordinates=k.segments[1].coordinates,x.segments[x.segments.length-1].coordinates=k.segments[1].coordinates,x.segments[x.segments.length-1].patchNumber+=1,x.segments[x.segments.length-1].features[0].properties.patchNumber+=1,x.segments.length>0&&((T=x.segments[0]).maneuverType=Uu.RouteOverview,T.instructions=["Overview"],(L=x.segments[1]).maneuverType=Uu.SectionOverview,L.instructions=["".concat(S," to ").concat(null===(a=b.shortestInternalRoute)||void 0===a?void 0:a.segments[0].startEdge.name)],L.startEdge.name=S,L.endEdge.name=null===(s=b.shortestInternalRoute)||void 0===s?void 0:s.segments[0].startEdge.name),R=0;R<x.segments.length;R+=1)D=x.segments[R],c.segments.push(D),h.segments.push(D);if(c.walkingDistance+=x.walkingDistance,c.transportDistance+=x.transportDistance,c.walkingTime+=x.walkingTime,c.transportTime+=x.transportTime,h.walkingDistance+=x.walkingDistance,h.transportDistance+=x.transportDistance,h.walkingTime+=x.walkingTime,h.transportTime+=x.transportTime,f=c.segments.length,c.segments.push({}),k){for(R=0;R<k.segments.length;R+=1)D=null==k?void 0:k.segments[R],c.segments.push(D),d.segments.push(D);c.walkingDistance+=k.walkingDistance,c.transportDistance+=k.transportDistance,c.walkingTime+=k.walkingTime,c.transportTime+=k.transportTime,d.walkingDistance+=k.walkingDistance,d.transportDistance+=k.transportDistance,d.walkingTime+=k.walkingTime,d.transportTime+=k.transportTime,p+=k.segments.length}N.label=7;case 7:return g+=1,[3,1];case 8:return console.log("MergedExternalRoute:",h),console.log("MergedInternalRoute:",d),F=Pd(d,f),c.segments[f]=F,d.segments.unshift(F),c.segments.length>1?(O=Pd(c),c.segments[0]=O):c.segments.length=0,console.log("To-terminal route:",c),[2,{fullRoute:c,internalRoute:d,externalRoute:h}]}})})}function Fd(e,t,n,r,i){var o,a;return I(this,void 0,void 0,function(){var n,r,i,s,l,u,c,h,d,p,f,g,m,v,y,w,b,_,x,S,A,P;return z(this,function(M){switch(M.label){case 0:console.log("Case: From Terminal (Internal → External)"),n=t.departureDate,r=t.departureTime,t.wheelChairAccessible,i=Ld(),s=Ld(),l=Ld(),i.segments.push({}),u=1,c=0,h=0,M.label=1;case 1:return h<e.length-1?(e[h],e[h+1].type!==ju.Coordinate?(console.error("FromTerminal mode: last location must be coordinate type"),[2,void 0]):[4,md()]):[3,8];case 2:return(d=M.sent())?(2===e.length&&(u+=1),p={mode:Gu.FromTerminal,config:{departureDate:n,departureTime:r,shouldAddOverviewSegment:!0,shouldAddStartSegment:!0,shouldAddEndSegment:!0,forRealtime:t.forRealtime},indexOffset:u},[4,_d(d,e[h],p,"Outside")]):(console.error("External route not found"),[2,void 0]);case 3:return(f=M.sent())&&(g=f.shortestInternalRoute)?(u+=g.segments.length,[4,Cd(f.shortestExternalRoute,!0,!0,!0,u)]):[2,void 0];case 4:return(m=M.sent()).segments.length?(m.segments[2].instructions=["Start at ".concat(null==g?void 0:g.segments[(null==g?void 0:g.segments.length)-1].endEdge.name)],m.segments[2].coordinates=g.segments[g.segments.length-1].coordinates,m.segments[2].features[0].geometry.coordinates=g.segments[g.segments.length-1].coordinates,[4,Td(e[h+1])]):(console.error("Something went wrong in computing external route"),[2,void 0]);case 5:return v=M.sent(),m.segments[m.segments.length-1].instructions=["Arrive at ".concat(v)],m.segments[m.segments.length-1].endEdge.name=v,[4,Td(e[h])];case 6:if(y=M.sent(),!(g&&g.segments.length>0))return console.log("Route not found"),[2,void 0];for((w=g.segments[0]).maneuverType=Uu.SectionOverview,w.instructions=["".concat(y," to ").concat(g.segments[g.segments.length-1].endEdge.name)],m.segments.length>0&&((b=m.segments[0]).maneuverType=Uu.RouteOverview,b.instructions=["Overview"],(_=m.segments[1]).maneuverType=Uu.SectionOverview,_.instructions=["".concat(null===(o=f.shortestInternalRoute)||void 0===o?void 0:o.segments[f.shortestInternalRoute.segments.length-1].endEdge.name," to ").concat(v)],_.startEdge.name=null===(a=f.shortestInternalRoute)||void 0===a?void 0:a.segments[f.shortestInternalRoute.segments.length-1].endEdge.name,_.endEdge.name=v),2===e.length&&(c=i.segments.length,i.segments.push({})),x=0;x<g.segments.length;x+=1)S=g.segments[x],i.segments.push(S),l.segments.push(S);for(i.walkingDistance+=g.walkingDistance,i.transportDistance+=g.transportDistance,i.walkingTime+=g.walkingTime,i.transportTime+=g.transportTime,x=0;x<m.segments.length;x+=1)S=m.segments[x],i.segments.push(S),s.segments.push(S);i.walkingDistance+=m.walkingDistance,i.transportDistance+=m.transportDistance,i.walkingTime+=m.walkingTime,i.transportTime+=m.transportTime,s.walkingDistance+=m.walkingDistance,s.transportDistance+=m.transportDistance,s.walkingTime+=m.walkingTime,s.transportTime+=m.transportTime,u+=m.segments.length,M.label=7;case 7:return h+=1,[3,1];case 8:return console.log("MergedExternalRoute:",s),console.log("MergedInternalRoute:",l),A=Pd(l,c),i.segments[c]=A,l.segments.unshift(A),i.segments.length>1?(P=Pd(i),i.segments[0]=P):i.segments.length=0,console.log("From-terminal route:",i),[2,{fullRoute:i,internalRoute:l,externalRoute:s}]}})})}function Od(e,t,n,r,i){return I(this,void 0,void 0,function(){var o,a,s,l,u,c,h,d,p,f,g,m,v,y,w;return z(this,function(b){switch(b.label){case 0:console.log("Case: Airside Vehicle Routing"),o=t.vehicleType,a=t.distanceThreshold,s=void 0===a?30:a,l=Ld(),u=Ld(),l.segments.push({}),c=1,h=0,d=0,b.label=1;case 1:return d<e.length-1?(p={mode:Gu.Airside,config:{vehicleType:o,distanceThreshold:s,shouldAddOverviewSegment:n,shouldAddStartSegment:r,shouldAddEndSegment:i,forRealtime:t.forRealtime},indexOffset:c},[4,Md(e[d],e[d+1],p)]):[3,4];case 2:if(!((f=b.sent()).segments.length>0))return console.error("Airside route not found"),[2,void 0];for((g=f.segments[0]).maneuverType=Uu.SectionOverview,g.instructions=["".concat(g.startEdge.name," to ").concat(g.endEdge.name)],m=0;m<f.segments.length;m+=1)v=f.segments[m],l.segments.push(v),u.segments.push(v);l.walkingDistance+=f.walkingDistance,l.transportDistance+=f.transportDistance,l.walkingTime+=f.walkingTime,l.transportTime+=f.transportTime,u.walkingDistance+=f.walkingDistance,u.transportDistance+=f.transportDistance,u.walkingTime+=f.walkingTime,u.transportTime+=f.transportTime,c+=f.segments.length,b.label=3;case 3:return d+=1,[3,1];case 4:return y=Pd(u,h),l.segments[h]=y,u.segments.unshift(y),l.segments.length>1?(w=Pd(l),l.segments[0]=w):l.segments.length=0,console.log("Airside route:",l),[2,l]}})})}var Nd=function(e){function t(t,n,r,i){void 0===i&&(i=[]);var o=e.call(this,null!=r?r:"".concat(t,": ").concat(n))||this;return o.name="NavigationStartError",o.code=t,o.mode=n,o.missing=i,o}return N(t,e),t}(Error);function jd(e,t){if("string"!=typeof e||""===e.trim())throw new Error("".concat(t," is required to start navigation"));return e}function Id(e){if(null==e)throw new Error("Routing mode is not set. Call setRoutingMode before startNavigation.");if(e===Gu.ToTerminal||e===Gu.FromTerminal)throw new Nd("UNSUPPORTED_ROUTE_MODE",e);if(e===Gu.Airside&&!function(e){if(!e||"object"!==te(e))return!1;var t=e[Iu.Network];if(!Array.isArray(t)||0===t.length)return!1;return t.some(function(e){var t,n=null===(t=null==e?void 0:e.properties)||void 0===t?void 0:t.dimension_what;return"string"==typeof n&&n.includes(Iu.AirsideNetwork)})}(bc.getState().data))throw new Nd("MISSING_ROUTING_DATA",e);return e}function zd(e){return j(j({wheelChairAccessible:!1,shouldAddOverviewSegment:!0,shouldAddStartSegment:!0,shouldAddEndSegment:!0},e),{forRealtime:!0})}function Bd(e){return e.startAnchorLngLat?e.startAnchorLngLat:e.useStartPositionAsAnchor?e.startLngLat:void 0}function Ud(e){var t=this,n=null,r=!1,i=null,o=-1,a=[],s=null,l=!1,u=function(){var e=[];return l||e.push("routingDisplay"),e},c=function(e){var t=u();if(t.length>0)throw new Nd("NOT_READY",e,void 0,t)},h=function(e,t){if(t instanceof vl)throw new Nd("NOT_READY",e,t.message,t.missing);throw t},d=function(){if(!s)throw new Error("NavigationEngine is not attached. Attach the engine after constructing Routing Manager.");return s},p=function(t){e.display.setDisplayRoute(t)},f=function(){return e.display.getDisplayRoute()},g=function(e){i=e},m=function(e){p(e),g(e)},v=function(n){return I(t,void 0,void 0,function(){var t,r,i,o,a,s;return z(this,function(l){switch(l.label){case 0:return t=!1!==n.useInternalGPS,r=qu(n.mode,n.config),(i=t?r:r.filter(function(e){return"motion"===e})).length>0?[4,e.ensureRequiredSensors(i)]:[3,2];case 1:l.sent(),l.label=2;case 2:return t?[4,e.getInternalGpsPosition()]:[3,4];case 3:return a=l.sent(),[3,5];case 4:a=e.getExternalGpsPosition(),l.label=5;case 5:if(!(null==(o=a)?void 0:o.coordinates)){if(!t&&n.mode===Gu.Airside)throw new Error("No external GPS position available. Call triggerGPSUpdate() first or provide an initial position.");throw new Error("Unable to determine start location")}return t||null===(s=e.onExternalGpsUsed)||void 0===s||s.call(e),[2,o]}})})},y=function(e,r){return I(t,void 0,void 0,function(){var t,i,a,s,l,u,c,h,d;return z(this,function(p){return null===n?(console.error("Route mode not set. Please call setRoutingMode() before computing routes."),[2,void 0]):(t=function(e,t){var n=[];switch(e){case Gu.Airside:t.vehicleType||n.push("vehicleType is required for Airside routing mode");break;case Gu.ToTerminal:case Gu.FromTerminal:var r=t;r.departureDate||n.push("departureDate is required for ToTerminal/FromTerminal routing modes"),r.departureTime||n.push("departureTime is required for ToTerminal/FromTerminal routing modes");break;case Gu.WithinTerminal:break;default:n.push("Unknown routing mode: ".concat(e))}return{isValid:0===n.length,errors:n}}(n,r),t.isValid?e.length<2?(console.warn("Invalid array passed to computeRoutes"),[2,void 0]):function(e,t){if(e.length<2)return!1;switch(t){case Gu.WithinTerminal:return e.every(function(e){return e.type===ju.MapObject||e.type===ju.Coordinate&&"string"==typeof e.whereDimension&&""!==e.whereDimension.trim()&&"where.external"!==e.whereDimension});case Gu.ToTerminal:return e[0].type===ju.Coordinate&&"where.external"===e[0].whereDimension&&e.slice(1).every(function(e){return e.type===ju.MapObject});case Gu.FromTerminal:var n=e.length-1;return e[n].type===ju.Coordinate&&"where.external"===e[n].whereDimension&&e.slice(0,-1).every(function(e){return e.type===ju.MapObject});case Gu.Airside:return e.every(function(e){return e.type===ju.MapObject||e.type===ju.Coordinate&&e.whereDimension.includes("airside")});default:return!1}}(e,n)?(i=j({},r),n===Gu.Airside&&(a=i).vehicleType&&(a.vehicleType=j(j({},a.vehicleType),{defaults:bc.getState().getTemplateDefaults()})),s=i.shouldAddOverviewSegment,l=void 0===s||s,u=i.shouldAddStartSegment,c=void 0===u||u,h=i.shouldAddEndSegment,d=void 0===h||h,o=-1,[2,function(e){switch(e){case Gu.WithinTerminal:return Rd;case Gu.ToTerminal:return Dd;case Gu.FromTerminal:return Fd;case Gu.Airside:return Od;default:throw new Error("Unknown route mode: ".concat(e))}}(n)(e,i,l,c,d)]):(console.error("Invalid location types for route mode: ".concat(n)),console.error("Locations:",e),[2,void 0]):(console.error("Config validation failed:",t.errors),[2,void 0]))})})},w=function(e,n,r,i){return I(t,void 0,void 0,function(){var t,o;return z(this,function(a){return 2!==e.length||""===n||r.length<1?(console.warn("Invalid input parameters passed to computeRoutesFromLocation"),[2,void 0]):(t={type:ju.Coordinate,coordinates:e,whereDimension:n},o=r.map(function(e){return{type:ju.MapObject,mapObjectId:e}}),[2,y(B([t],o,!0),null!=i?i:{})])})})},b=function(e,n,r,i){return I(t,void 0,void 0,function(){var t;return z(this,function(o){return 2!==e.length||""===n||r.type!==ju.Coordinate?(console.warn("Invalid input parameters passed to computeRouteFromLocationToCoordinates"),[2,void 0]):(t={type:ju.Coordinate,coordinates:e,whereDimension:n},[2,y([t,r],null!=i?i:{})])})})},_=function(t,n){var r={padding:{top:50,right:50,bottom:50,left:50},duration:1e3};if(n.coordinates.length>1){var i=function(e,t){void 0===t&&(t=0);for(var n=[],r=0;r<e.segments.length;r+=1){var i=e.segments[r];i.patchNumber===t&&(n=n.concat(i.features))}return n}(t,n.patchNumber);if(!i.length)return;e.fitBounds(function(e){var t=Ll({type:"FeatureCollection",features:e});return[t[0],t[1],t[2],t[3]]}(i),r)}else{var o={type:"FeatureCollection",features:[ve(n.coordinates[0])]},a=ph(o,.025,3).features[0].geometry.coordinates,s=ph(o,-.025,-3).features[0].geometry.coordinates;e.fitBounds([s[0],s[1],a[0],a[1]],r)}},x=function(n,r,i,s,l){return void 0===r&&(r=!0),void 0===i&&(i=!1),void 0===s&&(s=!0),void 0===l&&(l=!0),I(t,void 0,void 0,function(){var t,u,c,h,d;return z(this,function(p){return!(t=f())||t.segments.length<=n?(console.warn("Invalid segment number passed to highlightRouteSegment"),[2]):(u=t.segments[n]).coordinates.length?(c=u.maneuverType===Uu.ExitPortal||u.maneuverType===Uu.Static?u.endEdge.whereDimension:u.startEdge.whereDimension,h=u.features[0].properties.patchNumber,(i||o!==h)&&(o=h,a=function(e,t,n,r){var i;void 0===r&&(r=-1);for(var o=[],a=0;a<e.segments.length;a+=1){var s=e.segments[a];if(!(r>=0&&a<r))if(n.includeOverviewFeatures){if(id(s)){for(var l=[],u=[],c=0;c<s.features.length;c+=1){var h=s.features[c];void 0!==(null===(i=h.properties)||void 0===i?void 0:i.patchNumber)&&h.properties.patchNumber===n.patchNumberForOverviewFeatures&&void 0!==h.properties.isNonHighlightedOverview&&("1"===h.properties.isNonHighlightedOverview?l.push(h):u.push(h))}var d=l.concat(u);o=o.concat(d)}}else s.patchNumber===t&&(id(s)||(o=o.concat(s.features)))}return o}(t,h,{includeOverviewFeatures:id(u),patchNumberForOverviewFeatures:h},n)),c&&c!==Ml().getCurrentFocus()&&r&&Ml().commit(c,{moveCamera:!1}),d=function(e,t,n){void 0===n&&(n=!1);for(var r=0;r<e.length;r+=1){var i=e[r];i.properties.segmentNumber===t?n?!0===i.properties.startPoint&&xd([i],!0):xd([i],!0):xd([i],!1)}return e}(a,n),a=d,e.display.setPatchFeatures({type:"FeatureCollection",features:d}),l&&!id(u)?function(t,n,r){var i,o=t.segments[n];if(null===(i=null==o?void 0:o.features)||void 0===i?void 0:i.length){var a=function(e,t){void 0===t&&(t="");for(var n=[],r=0;r<e.features.length;r+=1){var i=e.features[r];i.properties.featureBelongsToLineString&&(""!==t?i.properties.dimension_where&&i.properties.dimension_where===t&&n.push(i):n.push(i))}return n}(o,r);if(0!==a.length){var s=a[0].geometry.coordinates;s.length<=2&&s.push(s[s.length-1]),e.display.setAnimatedCoordinates(s)}else e.display.setAnimatedCoordinates([])}else e.display.setAnimatedCoordinates([])}(t,n,c):e.display.setAnimatedCoordinates([]),s&&_(t,u),[2]):(console.log("at vertical portal segment, ignoring!"),[2])})})},S=function(){i=null,o=-1,a=[],e.display.clear()},A=function(){r&&(null==s||s.stopNavigation(),e.enterNormalMode(),r=!1),S()},P=function(n){return I(t,void 0,void 0,function(){var t,i;return z(this,function(o){switch(o.label){case 0:(t=d()).setUIHandlers(n.handlers),m(n.route),e.enterNavigationMode(),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,t.startNavigation({startAnchorLngLat:Bd(n),lockWhereTaxonomyPath:n.lockWhereTaxonomyPath})];case 2:return o.sent(),[3,4];case 3:throw i=o.sent(),t.stopNavigation(),e.enterNormalMode(),r=!1,i;case 4:return r=!0,[2,n.route]}})})},M={attachEngine:function(e){s=e},attachDisplay:function(){l=!0},detachDisplay:function(){l=!1},getReadiness:function(){return ml(u())},requestRerouteFromPosition:function(e){return I(t,void 0,void 0,function(){var t,n,o,a;return z(this,function(l){switch(l.label){case 0:return r&&e?(t=function(e){for(var t,n,r,i=null!==(t=null==e?void 0:e.segments)&&void 0!==t?t:[],o=i.length-1;o>=0;o-=1){var a=null===(r=null===(n=i[o])||void 0===n?void 0:n.endEdge)||void 0===r?void 0:r.mapObjectId;if(a)return a}}(i),t?(n=Ml().getCurrentFocus(),[4,w(e,n,[t],zd())]):[2]):[2];case 1:return o=l.sent(),(null===(a=null==o?void 0:o.segments)||void 0===a?void 0:a.length)?(m(o),[4,x(0,!0,!0,!1,!1)]):[2];case 2:return l.sent(),null==s||s.onWhereTaxonomyUpdate(),null==s||s.notifyReroute(o),[2]}})})},getActiveRoute:f,setActiveRoute:function(e){p(e)},getReferenceRouteForTracking:function(){return i},setReferenceRouteForTracking:g,highlightRouteSegment:x,setRoutingMode:function(t){var r;n=t,null===(r=e.onRoutingModeChange)||void 0===r||r.call(e,t)},getRoutingParameters:function(){return n===Gu.Airside?{vehicleType:bc.getState().getTemplateTypes()}:n===Gu.WithinTerminal?{wheelChairAccessible:[!1,!0]}:void 0},computeRoute:function(e,t,n){return I(this,void 0,void 0,function(){return z(this,function(r){return[2,y([{type:ju.MapObject,mapObjectId:e},{type:ju.MapObject,mapObjectId:t}],n)]})})},computeRoutes:function(e,t){return I(this,void 0,void 0,function(){return z(this,function(n){return[2,y(e.map(function(e){return{type:ju.MapObject,mapObjectId:e}}),t)]})})},computeRoutesFromLocation:w,computeRouteFromCoordinates:function(e,t,r){return I(this,void 0,void 0,function(){var i;return z(this,function(o){return n!==Gu.Airside?(console.error("computeRouteFromCoordinates only works when routing mode is set to Airside"),[2,void 0]):e&&t&&2===e.length&&2===t.length?(i={vehicleType:null==r?void 0:r.vehicleType,shouldAddOverviewSegment:!0,shouldAddStartSegment:!0,shouldAddEndSegment:!0},[2,y([{type:ju.Coordinate,coordinates:e,whereDimension:"where.changi.airside"},{type:ju.Coordinate,coordinates:t,whereDimension:"where.changi.airside"}],i)]):(console.error("Invalid coordinates provided to computeRouteFromCoordinates"),[2,void 0])})})},startNavigation:function(e,r,i,o){return I(this,void 0,void 0,function(){var a,s,l,u,f,g,m;return z(this,function(y){switch(y.label){case 0:a=jd(null==o?void 0:o.userWhereDimension,"userWhereDimension"),s=Id(n),c(s),y.label=1;case 1:return y.trys.push([1,3,,4]),[4,v({mode:s,useInternalGPS:null==o?void 0:o.useInternalGPS,config:r})];case 2:return l=y.sent(),[3,4];case 3:return u=y.sent(),[2,h(s,u)];case 4:return f=l.coordinates,s!==Gu.Airside?[3,6]:[4,w(f,a,[e],r)];case 5:return g=y.sent(),[2,(b={route:g,handlers:i},I(t,void 0,void 0,function(){return z(this,function(e){if(!b.route)throw A(),new Error("Failed to compute route from GPS location to destination");return p(b.route),b.handlers&&d().setUIHandlers(b.handlers),[2,b.route]})}))];case 6:return[4,w(f,a,[e],zd(r))];case 7:if(!(m=y.sent()))throw new Error("Failed to compute route from GPS location to destination");return[2,P({route:m,handlers:i,startLngLat:f,startAnchorLngLat:null==o?void 0:o.startAnchorLngLat,useStartPositionAsAnchor:null==o?void 0:o.useStartPositionAsAnchor,lockWhereTaxonomyPath:a})]}var b})})},startNavigationFromCoordinates:function(e,t,r,i){return I(this,void 0,void 0,function(){var o,a,s,l,u,d;return z(this,function(p){switch(p.label){case 0:o=jd(null==i?void 0:i.startWhereDimension,"startWhereDimension"),a=function(e){if(null==e)throw new Error("Routing mode is not set. Call setRoutingMode before startNavigation.");if(e===Gu.ToTerminal||e===Gu.FromTerminal)throw new Nd("UNSUPPORTED_ROUTE_MODE",e);if(e===Gu.Airside)throw new Nd("MISSING_ROUTING_DATA",e);return e}(n),c(a),p.label=1;case 1:return p.trys.push([1,3,,4]),[4,v({mode:a,useInternalGPS:null==i?void 0:i.useInternalGPS,config:t})];case 2:return s=p.sent(),[3,4];case 3:return l=p.sent(),[2,h(a,l)];case 4:return u=s.coordinates,[4,b(u,o,e,zd(t))];case 5:if(!(d=p.sent()))throw new Error("Failed to compute route from GPS location to destination");return[2,P({route:d,handlers:r,startLngLat:u,startAnchorLngLat:null==i?void 0:i.startAnchorLngLat,useStartPositionAsAnchor:null==i?void 0:i.useStartPositionAsAnchor,lockWhereTaxonomyPath:o})]}})})},stopNavigation:A,clearRoute:function(){S()}};return M}var Hd=new Set;var Gd=function(){function e(){var e,t,n=this;this.bootstrapped=!1,this.platform=null,this.routingDisplay={setDisplayRoute:function(){},getDisplayRoute:function(){return null},setPatchFeatures:function(){},setAnimatedCoordinates:function(){},clear:function(){}},this.taxonomyUpdateDetach=null,this.focusManager=new Pl,this.cameraDirector=new xl,this.focusManager.attachCameraDirector(this.cameraDirector),e=this.focusManager,Al=e,this.mapDataService=new jc,this.userLocation=new Ic({getFocusTree:function(){return n.mapDataService.getFocusTree()}}),this.userLocation.attachCameraDirector(this.cameraDirector),this.autoFocusManager=new kl(this.userLocation,new Cl),this.autoFocusManager.addWhereTaxonomyUpdateAcceptedListener(function(e,t){n.focusManager.commit(e,{moveCamera:t})}),this.taxonomyUpdateStore=(t=function(){return n.autoFocusManager},fl(function(e,n){return j(j({},El),{openProposal:function(t){n().isAwaitingDecision||e({pendingWhere:t.whereTaxonomyPath,proposalId:t.id,proposalKind:t.kind,portalMeta:"portal"===t.kind?t.portal:null,isAwaitingDecision:!0,showTaxonomyUpdatePopup:!0,autoAcceptCooldownMs:t.autoAcceptCooldownMs})},clearProposal:function(){e(j({},El))},acceptProposal:function(){var e,r=n().proposalId;r&&(null===(e=t())||void 0===e||e.acceptProposal(r),n().clearProposal())},rejectProposal:function(){var e,r=n().proposalId;r&&(null===(e=t())||void 0===e||e.rejectProposal(r),n().clearProposal())},manualOverride:function(e){var r,i=n().proposalId;i&&(null===(r=t())||void 0===r||r.manualOverride(i,e),n().clearProposal())}})})),this.routingManager=Ud({ensureRequiredSensors:function(e){return I(n,void 0,void 0,function(){return z(this,function(t){switch(t.label){case 0:return[4,this.userLocation.ensureRequiredSensors(e)];case 1:if(!t.sent())throw new Error("Required sensor permission failed");return[2]}})})},getInternalGpsPosition:function(){return I(n,void 0,void 0,function(){var e,t;return z(this,function(n){switch(n.label){case 0:return(null==(e=this.userLocation.getCurrentPosition())?void 0:e.coordinates)?[2,{coordinates:e.coordinates}]:[4,this.userLocation.getGPSPosition({enableHighAccuracy:!0,timeout:1e4,maximumAge:5e3})];case 1:if(!(null==(t=n.sent())?void 0:t.coordinates))throw new Error("Failed to get GPS position");return[2,{coordinates:t.coordinates}]}})})},getExternalGpsPosition:function(){return n.userLocation.getExternalGpsPosition()},onExternalGpsUsed:function(){n.userLocation.setFollow(!0)},enterNavigationMode:function(){n.userLocation.enterNavigationMode()},enterNormalMode:function(){n.userLocation.enterNormalMode()},display:{setDisplayRoute:function(e){n.routingDisplay.setDisplayRoute(e)},getDisplayRoute:function(){return n.routingDisplay.getDisplayRoute()},setPatchFeatures:function(e){n.routingDisplay.setPatchFeatures(e)},setAnimatedCoordinates:function(e){n.routingDisplay.setAnimatedCoordinates(e)},clear:function(){n.routingDisplay.clear()}},fitBounds:function(e,t){var r,i,o;null===(o=null===(i=null===(r=n.platform)||void 0===r?void 0:r.camera)||void 0===i?void 0:i.fitBounds)||void 0===o||o.call(i,e,t)}}),this.navigationEngine=new eh(this.routingManager,this.userLocation,this.autoFocusManager),this.routingManager.attachEngine(this.navigationEngine),this.readinessStore=fl(function(e){return j(j({},wl),{sync:function(t){e({ready:t.ready,missing:t.missing,modules:t.modules})}})}),this.mapDataService.onReadinessChange=function(){return n.syncReadiness()},this.syncReadiness()}return e.prototype.bootstrap=function(){var e;this.bootstrapped||(Hd.size>0&&"boolean"==typeof(e=globalThis.__DEV__)&&e&&console.warn("MetaAtlasRuntime: a second concurrent bootstrap was attempted. Multi-map support is not available."),Hd.add(this),this.bootstrapped=!0)},e.prototype.attach=function(e){var t,n,r,i;this.platform=e,e.style?this.focusManager.attachStyle(e.style):this.focusManager.detachStyle(),e.camera?this.cameraDirector.attachCamera(e.camera):this.cameraDirector.detachCamera(),this.userLocation.attachCameraDirector(this.cameraDirector),e.sensors?this.userLocation.attachSensors({gps:e.sensors.gps,compass:e.sensors.compass,motion:e.sensors.motion}):this.userLocation.detachSensors(),e.marker?this.userLocation.attachMarker(e.marker):this.userLocation.detachMarker(),e.routingDisplay?(this.routingDisplay=e.routingDisplay,this.routingManager.attachDisplay()):(this.routingDisplay={setDisplayRoute:function(){},getDisplayRoute:function(){return null},setPatchFeatures:function(){},setAnimatedCoordinates:function(){},clear:function(){}},this.routingManager.detachDisplay()),this.taxonomyUpdateDetach||(this.taxonomyUpdateDetach=(t=this.taxonomyUpdateStore,n=this.autoFocusManager,r=function(e){t.getState().openProposal(e)},i=function(){t.getState().clearProposal()},n.addWhereTaxonomyUpdateProposedListener(r),n.addWhereTaxonomyUpdateAutoRejectedListener(i),function(){n.removeWhereTaxonomyUpdateProposedListener(r),n.removeWhereTaxonomyUpdateAutoRejectedListener(i)})),this.autoFocusManager.start(),this.syncReadiness()},e.prototype.detach=function(){var e;this.autoFocusManager.stop(),null===(e=this.taxonomyUpdateDetach)||void 0===e||e.call(this),this.taxonomyUpdateDetach=null,this.taxonomyUpdateStore.getState().clearProposal(),this.userLocation.detachSensors(),this.userLocation.detachMarker(),this.userLocation.detachCameraDirector(),this.focusManager.detachStyle(),this.cameraDirector.detachCamera(),this.cameraDirector.detachFollowBreaker(),this.routingDisplay={setDisplayRoute:function(){},getDisplayRoute:function(){return null},setPatchFeatures:function(){},setAnimatedCoordinates:function(){},clear:function(){}},this.routingManager.detachDisplay(),this.platform=null,Hd.delete(this),this.bootstrapped=!1,this.syncReadiness()},e.prototype.notifyMapLoaded=function(){this.cameraDirector.notifyMapLoaded()},e.prototype.isAttached=function(){return null!==this.platform},e.prototype.syncReadiness=function(){var e={mapDataService:this.mapDataService.getReadiness(),focusManager:this.focusManager.getReadiness(),cameraDirector:this.cameraDirector.getReadiness(),userLocation:this.userLocation.getReadiness(),routingManager:this.routingManager.getReadiness(),navigationEngine:this.navigationEngine.getReadiness()};this.readinessStore.getState().sync(j(j({},function(e){for(var t=[],n=new Set,r=0,i=bl;r<i.length;r++)for(var o=0,a=e[i[r]].missing;o<a.length;o++){var s=a[o];n.has(s)||(n.add(s),t.push(s))}return{ready:0===t.length,missing:t}}(e)),{modules:e}))},e}();var Wd=function(){function e(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: (".concat(e,", ").concat(t,")"));if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}return e.prototype.wrap=function(){return new e(function(e,t,n){var r=n-t,i=((e-t)%r+r)%r+t;return i===t?n:i}(this.lng,-180,180),this.lat)},e.prototype.toArray=function(){return[this.lng,this.lat]},e.prototype.toString=function(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")},e.prototype.distanceTo=function(e){var t=Math.PI/180,n=this.lat*t,r=e.lat*t,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((e.lng-this.lng)*t);return 6371008.8*Math.acos(Math.min(i,1))},e.convert=function(t){if(t instanceof e)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new e(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"===te(t)&&null!==t)return new e(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")},e}(),Vd=function(){function e(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&(4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}return e.prototype.setNorthEast=function(e){return this._ne=e instanceof Wd?new Wd(e.lng,e.lat):Wd.convert(e),this},e.prototype.setSouthWest=function(e){return this._sw=e instanceof Wd?new Wd(e.lng,e.lat):Wd.convert(e),this},e.prototype.extend=function(t){var n,r,i=this._sw,o=this._ne;if(t instanceof Wd)n=t,r=t;else{if(!(t instanceof e)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){var a=t;return this.extend(e.convert(a))}var s=t;return this.extend(Wd.convert(s))}return t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(Wd.convert(t)):this}if(n=t._sw,r=t._ne,!n||!r)return this}return i||o?(i.lng=Math.min(n.lng,i.lng),i.lat=Math.min(n.lat,i.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new Wd(n.lng,n.lat),this._ne=new Wd(r.lng,r.lat)),this},e.prototype.getCenter=function(){return new Wd((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},e.prototype.getSouthWest=function(){return this._sw},e.prototype.getNorthEast=function(){return this._ne},e.prototype.getNorthWest=function(){return new Wd(this.getWest(),this.getNorth())},e.prototype.getSouthEast=function(){return new Wd(this.getEast(),this.getSouth())},e.prototype.getWest=function(){return this._sw.lng},e.prototype.getSouth=function(){return this._sw.lat},e.prototype.getEast=function(){return this._ne.lng},e.prototype.getNorth=function(){return this._ne.lat},e.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},e.prototype.toString=function(){return"LngLatBounds(".concat(this._sw.toString(),", ").concat(this._ne.toString(),")")},e.prototype.isEmpty=function(){return!(this._sw&&this._ne)},e.prototype.contains=function(e){var t=Wd.convert(e),n=t.lng,r=t.lat,i=this._sw.lat<=r&&r<=this._ne.lat,o=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(o=this._sw.lng>=n&&n>=this._ne.lng),i&&o},e.convert=function(t){return t instanceof e?t:t?new e(t):t},e.fromLngLat=function(t,n){void 0===n&&(n=0);var r=360*n/40075017,i=r/Math.cos(Math.PI/180*t.lat);return new e(new Wd(t.lng-i,t.lat-r),new Wd(t.lng+i,t.lat+r))},e}(),qd={type:"FeatureCollection",features:[{geometry:{coordinates:[[[103.9887700096493,1.362197288740075],[103.98372695828216,1.350203640412193],[103.984442,1.3499],[103.984522,1.349519],[103.984595,1.349021],[103.984565,1.348824],[103.984299,1.348207],[103.984136,1.347977],[103.983544,1.347659],[103.983441,1.347551],[103.983406,1.347433],[103.983438,1.347319],[103.98353,1.347197],[103.983795,1.347079],[103.983766,1.346924],[103.983353,1.346048],[103.983243,1.345936],[103.982807,1.34491],[103.98248,1.344461],[103.981917,1.344321],[103.981657,1.343706],[103.981226,1.343634],[103.97963,1.344317],[103.979559,1.344288],[103.979305,1.343685],[103.979333,1.343613],[103.980066,1.3433],[103.980216,1.343181],[103.980255,1.343074],[103.980445,1.342997],[103.980612,1.34296],[103.980632,1.343008],[103.981048,1.342832],[103.981052,1.342818],[103.981227,1.342745],[103.981024,1.342263],[103.981054,1.342188],[103.981315,1.342076],[103.981218,1.341848],[103.981229,1.341501],[103.981132,1.341272],[103.981005,1.341209],[103.981055,1.341086],[103.980457,1.339669],[103.980355,1.339515],[103.980135,1.338995],[103.979095,1.338198],[103.978279,1.33808],[103.975271,1.339366],[103.975204,1.340095],[103.974918,1.340087],[103.974943,1.339506],[103.972207,1.340676],[103.971501,1.341176],[103.971142,1.341811],[103.972739,1.345616],[103.973197,1.345431],[103.973555,1.346306],[103.973211,1.346453],[103.973054,1.346829],[103.974724,1.350763],[103.975653,1.350486],[103.980587,1.362174],[103.98131,1.363104],[103.981335,1.363107],[103.982564,1.366051],[103.982293,1.366167],[103.982119,1.365756],[103.98133,1.366093],[103.982618,1.369145],[103.98282,1.369273],[103.982831,1.369696],[103.98365,1.371667],[103.983928,1.371539],[103.984111,1.37199],[103.984496,1.371861],[103.985404,1.373591],[103.985121,1.374019],[103.985113,1.374014],[103.982647,1.371321],[103.982496,1.372373],[103.98168,1.372263],[103.981716,1.372072],[103.980021,1.371786],[103.979887,1.372243],[103.980729,1.37247],[103.980692,1.372603],[103.981091,1.372691],[103.981034,1.372998],[103.981337,1.372997],[103.981415,1.373516],[103.981322,1.373544],[103.981172,1.373714],[103.980969,1.373801],[103.980852,1.373993],[103.980606,1.374239],[103.97928,1.374501],[103.981086,1.37878],[103.982853,1.378401],[103.982635,1.378257],[103.982474,1.378058],[103.982393,1.377849],[103.982097,1.377612],[103.981862,1.376523],[103.985786,1.375761],[103.986733,1.376127],[103.987115,1.376646],[103.987447,1.377519],[103.987659,1.378416],[103.987955,1.379165],[103.988196,1.380074],[103.988279,1.380704],[103.989644,1.384016],[103.991056,1.387452],[103.991115,1.387492],[103.991621,1.387271],[103.991907,1.387951],[103.993194,1.387398],[103.993351,1.387769],[103.993603,1.387683],[103.99394,1.388483],[103.995052,1.388468],[103.995287,1.388368],[103.995056,1.387822],[103.995064,1.387801],[103.996031,1.38852],[103.996133,1.388744],[103.997576,1.388221],[103.998461,1.388714],[103.999043,1.387917],[103.999938,1.386438],[104.000151,1.386113],[104.000588,1.385316],[104.000768,1.38415],[104.000444,1.382669],[103.999984,1.38182],[103.999957,1.381676],[103.99978,1.3813],[103.999989,1.38094],[103.999901,1.378161],[104.000575,1.377859],[104.00064,1.373982],[104.001258,1.373986],[104.00125,1.372264],[104.000731,1.372053],[104.000573,1.371818],[104.000571,1.371054],[104.000705,1.370845],[104.001129,1.370664],[104.001219,1.370704],[104.006418,1.368481],[104.006488,1.368648],[104.015097,1.364966],[104.015027,1.3648],[104.019352,1.36295],[104.017473,1.358499],[104.017508,1.358413],[104.018449,1.358011],[104.004397,1.324724],[104.00394,1.324916],[104.00425,1.32565],[104.004093,1.325724],[104.00417,1.325903],[104.004083,1.326121],[104.004174,1.32613],[104.004166,1.326149],[104.004173,1.326152],[104.004163,1.326177],[104.004154,1.326173],[104.004072,1.326164],[104.004122,1.326278],[104.003918,1.326365],[104.000334,1.317873],[103.999845,1.317087],[103.998308,1.313445],[103.993946,1.31531],[103.993768,1.315219],[103.99308,1.315514],[103.996385,1.323344],[103.996638,1.323447],[104.006107,1.345878],[104.006018,1.346102],[104.005537,1.346307],[104.005938,1.347258],[104.005852,1.347472],[103.997773,1.350929],[103.997657,1.350891],[103.997481,1.350593],[103.997142,1.350738],[103.997042,1.350698],[103.996503,1.349419],[103.996637,1.349084],[103.996896,1.348973],[103.996911,1.348937],[103.996038,1.346869],[103.995996,1.346857],[103.995743,1.346965],[103.99541,1.34683],[103.994841,1.345481],[103.995596,1.345158],[103.99563,1.34516],[103.995702,1.345189],[103.995789,1.345396],[103.996936,1.344905],[103.996533,1.343951],[103.995387,1.344445],[103.995511,1.344736],[103.995481,1.344808],[103.995464,1.344827],[103.994861,1.345089],[103.994637,1.344998],[103.988369,1.330147],[103.988347,1.329713],[103.98857,1.328474],[103.987978,1.327071],[103.987955,1.326785],[103.987164,1.324911],[103.987081,1.324946],[103.98561,1.321461],[103.986331,1.321152],[103.985866,1.320051],[103.985468,1.320222],[103.985421,1.320111],[103.985409,1.320116],[103.985405,1.320108],[103.985358,1.320128],[103.985296,1.319981],[103.985334,1.319965],[103.985348,1.319944],[103.98515,1.319072],[103.980111,1.321228],[103.978578,1.322455],[103.983567,1.33428],[103.983476,1.335036],[103.983474,1.335069],[103.983009,1.335268],[103.98354933284033,1.3364946996522131],[103.98231231703316,1.3370245683484567],[103.98342436604707,1.3396729339712583],[103.98417983421598,1.3393514014339156],[103.9844931502899,1.3400841720206023],[103.98503039557389,1.3398560432442772],[103.98580504242307,1.3417286171903666],[103.9835684958817,1.3426734121936035],[103.983583,1.342772],[103.983691,1.343028],[103.983891,1.343501],[103.983783,1.343856],[103.984129,1.343961],[103.984026,1.344257],[103.983817,1.344347],[103.98423,1.345329],[103.98415,1.345913],[103.98415,1.345913],[103.98451944524408,1.346791860811539],[103.98493495319761,1.3466099688724271],[103.98503012886492,1.3465959003602783],[103.98510582249939,1.3466114463854497],[103.985247,1.346683],[103.985504,1.347296],[103.986192,1.347001],[103.9870399702827,1.3489902225591661],[103.99210440121716,1.3609279279595752],[103.9887700096493,1.362197288740075]]],type:"Polygon"},type:"Feature",properties:{}}]},Zd={},Yd={},$d={};Object.defineProperty($d,"__esModule",{value:!0}),$d.bytesToString=$d.stringToBytes=$d.NIL=$d.X500=$d.OID=$d.URL=$d.DNS=$d.hexToByte=$d.byteToHex=void 0;let Jd=[],Kd={};for(var Xd=0;Xd<256;Xd++)Jd[Xd]=(Xd+256).toString(16).substr(1),Kd[Jd[Xd]]=Xd;$d.byteToHex=Jd,$d.hexToByte=Kd,$d.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",$d.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",$d.OID="6ba7b812-9dad-11d1-80b4-00c04fd430c8",$d.X500="6ba7b814-9dad-11d1-80b4-00c04fd430c8",$d.NIL="00000000-0000-0000-0000-000000000000";$d.stringToBytes=e=>{e=unescape(encodeURIComponent(e));const t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t};$d.bytesToString=e=>{const t=new Uint8Array(e,0,e.byteLength);return String.fromCharCode.apply(null,Array.from(t))},Object.defineProperty(Yd,"__esModule",{value:!0}),Yd.parse=void 0;const Qd=$d;Yd.parse=(e,t,n)=>{let r=t&&n||0,i=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,e=>(i<16&&t&&(t[r+i++]=Qd.hexToByte[e]),""));i<16;)t[r+i++]=0;return t};var ep={};Object.defineProperty(ep,"__esModule",{value:!0}),ep.unparse=void 0;const tp=$d;ep.unparse=(e,t)=>{let n=t||0,r=tp.byteToHex;return r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]};var np={},rp={};Object.defineProperty(rp,"__esModule",{value:!0});rp.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;var ip=xe&&xe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(np,"__esModule",{value:!0}),np.validate=void 0;const op=ip(rp);np.validate=e=>"string"==typeof e&&op.default.test(e);var ap={};Object.defineProperty(ap,"__esModule",{value:!0}),ap.version=void 0;const sp=np;ap.version=e=>{if(!(0,sp.validate)(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)};var lp={},up={};Object.defineProperty(up,"__esModule",{value:!0}),up.stringify=void 0;const cp=np,hp=[];for(let e=0;e<256;++e)hp.push((e+256).toString(16).substr(1));up.stringify=(e,t=0)=>{const n=(hp[e[t+0]]+hp[e[t+1]]+hp[e[t+2]]+hp[e[t+3]]+"-"+hp[e[t+4]]+hp[e[t+5]]+"-"+hp[e[t+6]]+hp[e[t+7]]+"-"+hp[e[t+8]]+hp[e[t+9]]+"-"+hp[e[t+10]]+hp[e[t+11]]+hp[e[t+12]]+hp[e[t+13]]+hp[e[t+14]]+hp[e[t+15]]).toLowerCase();if(!(0,cp.validate)(n))throw TypeError("Stringified UUID is invalid");return n};var dp={};Object.defineProperty(dp,"__esModule",{value:!0}),dp.rng=void 0;dp.rng=()=>{let e=new Uint8Array(16);for(let t=0;t<16;t++)e[t]=255&256*Math.random()+0;return e},Object.defineProperty(lp,"__esModule",{value:!0}),lp.v1=void 0;const pp=up,fp=dp;let gp,mp,vp=0,yp=0;lp.v1=(e,t,n=0)=>{let r=t&&n||0;const i=t||new Uint8Array(16);let o=e&&e.node?e.node:gp,a=e&&e.clockseq?e.clockseq:mp;if(null==o||null==a){const t=e&&e.random?e.random:e&&e.rng?e.rng():(0,fp.rng)();null==o&&(o=gp=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==a&&(a=mp=16383&(t[6]<<8|t[7]))}let s=e&&e.msecs?e.msecs:Date.now(),l=e&&e.nsecs?e.nsecs:yp+1;const u=s-vp+(l-yp)/1e4;if(u<0&&e&&!e.clockseq&&(a=a+1&16383),(u<0||s>vp)&&e&&!e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");vp=s,yp=l,mp=a,s+=122192928e5;const c=(1e4*(268435455&s)+l)%4294967296;i[r++]=c>>>24&255,i[r++]=c>>>16&255,i[r++]=c>>>8&255,i[r++]=255&c;const h=s/4294967296*1e4&268435455;i[r++]=h>>>8&255,i[r++]=255&h,i[r++]=h>>>24&15|16,i[r++]=h>>>16&255,i[r++]=a>>>8|128,i[r++]=255&a;for(let e=0;e<6;++e)i[r+e]=o[e];return t||(0,pp.stringify)(i)};var wp={},bp={};Object.defineProperty(bp,"__esModule",{value:!0}),bp.v35=void 0;const _p=up,xp=Yd,Sp=$d;bp.v35=(e,t,n)=>(e,r,i,o=0)=>{if("string"==typeof e&&(e=(0,Sp.stringToBytes)(e)),"string"==typeof r&&(r=(0,xp.parse)(r)),r&&16!==r.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+e.length);if(a.set(r),a.set(e,r.length),a=(0,Sp.stringToBytes)(n((0,Sp.bytesToString)(a.buffer))),a[6]=15&a[6]|t,a[8]=63&a[8]|128,i)for(let e=0;e<16;++e)i[o+e]=a[e];return i||(0,_p.stringify)(a)};var Ap={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.any_hmac_md5=e.b64_hmac_md5=e.hex_hmac_md5=e.any_md5=e.b64_md5=e.hex_md5=void 0;let t=0,n="";e.hex_md5=e=>o(r(l(e))),e.default=e.hex_md5;e.b64_md5=e=>a(r(l(e)));e.any_md5=(e,t)=>s(r(l(e)),t);e.hex_hmac_md5=(e,t)=>o(i(l(e),l(t)));e.b64_hmac_md5=(e,t)=>a(i(l(e),l(t)));e.any_hmac_md5=(e,t,n)=>s(i(l(e),l(t)),n);const r=e=>c(h(u(e),8*e.length)),i=(e,t)=>{var n=u(e);n.length>16&&(n=h(n,8*e.length));let r=Array(16),i=Array(16);for(var o=0;o<16;o++)r[o]=909522486^n[o],i[o]=1549556828^n[o];var a=h(r.concat(u(t)),512+8*t.length);return c(h(i.concat(a),640))},o=e=>{for(var n,r=t?"0123456789ABCDEF":"0123456789abcdef",i="",o=0;o<e.length;o++)n=e.charCodeAt(o),i+=r.charAt(n>>>4&15)+r.charAt(15&n);return i},a=e=>{for(var t="",r=e.length,i=0;i<r;i+=3)for(var o=e.charCodeAt(i)<<16|(i+1<r?e.charCodeAt(i+1)<<8:0)|(i+2<r?e.charCodeAt(i+2):0),a=0;a<4;a++)8*i+6*a>8*e.length?t+=n:t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-a)&63);return t},s=(e,t)=>{var n,r,i,o,a,s=t.length,l=Array(Math.ceil(e.length/2));for(n=0;n<l.length;n++)l[n]=e.charCodeAt(2*n)<<8|e.charCodeAt(2*n+1);var u=Math.ceil(8*e.length/(Math.log(t.length)/Math.log(2))),c=Array(u);for(r=0;r<u;r++){for(a=[],o=0,n=0;n<l.length;n++)o=(o<<16)+l[n],o-=(i=Math.floor(o/s))*s,(a.length>0||i>0)&&(a[a.length]=i);c[r]=o,l=a}var h="";for(n=c.length-1;n>=0;n--)h+=t.charAt(c[n]);return h},l=e=>{for(var t,n,r="",i=-1;++i<e.length;)t=e.charCodeAt(i),n=i+1<e.length?e.charCodeAt(i+1):0,t>=55296&&t<=56319&&n>=56320&&n<=57343&&(t=65536+((1023&t)<<10)+(1023&n),i++),t<=127?r+=String.fromCharCode(t):t<=2047?r+=String.fromCharCode(192|t>>>6&31,128|63&t):t<=65535?r+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(r+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return r},u=e=>{let t=Array(e.length>>2);for(var n=0;n<t.length;n++)t[n]=0;for(n=0;n<8*e.length;n+=8)t[n>>5]|=(255&e.charCodeAt(n/8))<<n%32;return t},c=e=>{for(var t="",n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>n%32&255);return t},h=(e,t)=>{e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var n=1732584193,r=-271733879,i=-1732584194,o=271733878,a=0;a<e.length;a+=16){var s=n,l=r,u=i,c=o;n=p(n,r,i,o,e[a+0],7,-680876936),o=p(o,n,r,i,e[a+1],12,-389564586),i=p(i,o,n,r,e[a+2],17,606105819),r=p(r,i,o,n,e[a+3],22,-1044525330),n=p(n,r,i,o,e[a+4],7,-176418897),o=p(o,n,r,i,e[a+5],12,1200080426),i=p(i,o,n,r,e[a+6],17,-1473231341),r=p(r,i,o,n,e[a+7],22,-45705983),n=p(n,r,i,o,e[a+8],7,1770035416),o=p(o,n,r,i,e[a+9],12,-1958414417),i=p(i,o,n,r,e[a+10],17,-42063),r=p(r,i,o,n,e[a+11],22,-1990404162),n=p(n,r,i,o,e[a+12],7,1804603682),o=p(o,n,r,i,e[a+13],12,-40341101),i=p(i,o,n,r,e[a+14],17,-1502002290),r=p(r,i,o,n,e[a+15],22,1236535329),n=f(n,r,i,o,e[a+1],5,-165796510),o=f(o,n,r,i,e[a+6],9,-1069501632),i=f(i,o,n,r,e[a+11],14,643717713),r=f(r,i,o,n,e[a+0],20,-373897302),n=f(n,r,i,o,e[a+5],5,-701558691),o=f(o,n,r,i,e[a+10],9,38016083),i=f(i,o,n,r,e[a+15],14,-660478335),r=f(r,i,o,n,e[a+4],20,-405537848),n=f(n,r,i,o,e[a+9],5,568446438),o=f(o,n,r,i,e[a+14],9,-1019803690),i=f(i,o,n,r,e[a+3],14,-187363961),r=f(r,i,o,n,e[a+8],20,1163531501),n=f(n,r,i,o,e[a+13],5,-1444681467),o=f(o,n,r,i,e[a+2],9,-51403784),i=f(i,o,n,r,e[a+7],14,1735328473),r=f(r,i,o,n,e[a+12],20,-1926607734),n=g(n,r,i,o,e[a+5],4,-378558),o=g(o,n,r,i,e[a+8],11,-2022574463),i=g(i,o,n,r,e[a+11],16,1839030562),r=g(r,i,o,n,e[a+14],23,-35309556),n=g(n,r,i,o,e[a+1],4,-1530992060),o=g(o,n,r,i,e[a+4],11,1272893353),i=g(i,o,n,r,e[a+7],16,-155497632),r=g(r,i,o,n,e[a+10],23,-1094730640),n=g(n,r,i,o,e[a+13],4,681279174),o=g(o,n,r,i,e[a+0],11,-358537222),i=g(i,o,n,r,e[a+3],16,-722521979),r=g(r,i,o,n,e[a+6],23,76029189),n=g(n,r,i,o,e[a+9],4,-640364487),o=g(o,n,r,i,e[a+12],11,-421815835),i=g(i,o,n,r,e[a+15],16,530742520),r=g(r,i,o,n,e[a+2],23,-995338651),n=m(n,r,i,o,e[a+0],6,-198630844),o=m(o,n,r,i,e[a+7],10,1126891415),i=m(i,o,n,r,e[a+14],15,-1416354905),r=m(r,i,o,n,e[a+5],21,-57434055),n=m(n,r,i,o,e[a+12],6,1700485571),o=m(o,n,r,i,e[a+3],10,-1894986606),i=m(i,o,n,r,e[a+10],15,-1051523),r=m(r,i,o,n,e[a+1],21,-2054922799),n=m(n,r,i,o,e[a+8],6,1873313359),o=m(o,n,r,i,e[a+15],10,-30611744),i=m(i,o,n,r,e[a+6],15,-1560198380),r=m(r,i,o,n,e[a+13],21,1309151649),n=m(n,r,i,o,e[a+4],6,-145523070),o=m(o,n,r,i,e[a+11],10,-1120210379),i=m(i,o,n,r,e[a+2],15,718787259),r=m(r,i,o,n,e[a+9],21,-343485551),n=v(n,s),r=v(r,l),i=v(i,u),o=v(o,c)}return[n,r,i,o]},d=(e,t,n,r,i,o)=>v(y(v(v(t,e),v(r,o)),i),n),p=(e,t,n,r,i,o,a)=>d(t&n|~t&r,e,t,i,o,a),f=(e,t,n,r,i,o,a)=>d(t&r|n&~r,e,t,i,o,a),g=(e,t,n,r,i,o,a)=>d(t^n^r,e,t,i,o,a),m=(e,t,n,r,i,o,a)=>d(n^(t|~r),e,t,i,o,a),v=(e,t)=>{var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n},y=(e,t)=>e<<t|e>>>32-t}(Ap);var Pp=xe&&xe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wp,"__esModule",{value:!0}),wp.v3=void 0;const Mp=bp,Cp=Pp(Ap);wp.v3=(0,Mp.v35)("v3",48,Cp.default);var kp={};Object.defineProperty(kp,"__esModule",{value:!0}),kp.v4=void 0;const Ep=ep,Tp=dp;kp.v4=function(e,t,n){let r=t&&n||0,i=(0,Tp.rng)();if(!e||e instanceof String||(e.random&&(i=e.random),e.rng&&(i=e.rng())),i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;o++)t[r+o]=i[o];return t||(0,Ep.unparse)(i)};var Lp={},Rp={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.any_hmac_sha1=e.b64_hmac_sha1=e.hex_hmac_sha1=e.any_sha1=e.b64_sha1=e.hex_sha1=void 0;let t=0,n="";e.hex_sha1=e=>o(r(l(e))),e.default=e.hex_sha1;e.b64_sha1=e=>a(r(l(e)));e.any_sha1=(e,t)=>s(r(l(e)),t);e.hex_hmac_sha1=(e,t)=>o(i(l(e),l(t)));e.b64_hmac_sha1=(e,t)=>a(i(l(e),l(t)));e.any_hmac_sha1=(e,t,n)=>s(i(l(e),l(t)),n);const r=e=>c(h(u(e),8*e.length)),i=(e,t)=>{let n=u(e);n.length>16&&(n=h(n,8*e.length));let r=Array(16),i=Array(16);for(var o=0;o<16;o++)r[o]=909522486^n[o],i[o]=1549556828^n[o];var a=h(r.concat(u(t)),512+8*t.length);return c(h(i.concat(a),672))},o=e=>{for(var n,r=t?"0123456789ABCDEF":"0123456789abcdef",i="",o=0;o<e.length;o++)n=e.charCodeAt(o),i+=r.charAt(n>>>4&15)+r.charAt(15&n);return i},a=e=>{for(var t="",r=e.length,i=0;i<r;i+=3)for(var o=e.charCodeAt(i)<<16|(i+1<r?e.charCodeAt(i+1)<<8:0)|(i+2<r?e.charCodeAt(i+2):0),a=0;a<4;a++)8*i+6*a>8*e.length?t+=n:t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-a)&63);return t},s=(e,t)=>{var n,r,i,o,a=t.length,s=[],l=Array(Math.ceil(e.length/2));for(n=0;n<l.length;n++)l[n]=e.charCodeAt(2*n)<<8|e.charCodeAt(2*n+1);for(;l.length>0;){for(o=[],i=0,n=0;n<l.length;n++)i=(i<<16)+l[n],i-=(r=Math.floor(i/a))*a,(o.length>0||r>0)&&(o[o.length]=r);s[s.length]=i,l=o}var u="";for(n=s.length-1;n>=0;n--)u+=t.charAt(s[n]);var c=Math.ceil(8*e.length/(Math.log(t.length)/Math.log(2)));for(n=u.length;n<c;n++)u=t[0]+u;return u},l=e=>{for(var t,n,r="",i=-1;++i<e.length;)t=e.charCodeAt(i),n=i+1<e.length?e.charCodeAt(i+1):0,t>=55296&&t<=56319&&n>=56320&&n<=57343&&(t=65536+((1023&t)<<10)+(1023&n),i++),t<=127?r+=String.fromCharCode(t):t<=2047?r+=String.fromCharCode(192|t>>>6&31,128|63&t):t<=65535?r+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(r+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return r},u=e=>{for(var t=Array(e.length>>2),n=0;n<t.length;n++)t[n]=0;for(n=0;n<8*e.length;n+=8)t[n>>5]|=(255&e.charCodeAt(n/8))<<24-n%32;return t},c=e=>{for(var t="",n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>24-n%32&255);return t},h=(e,t)=>{e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var n=Array(80),r=1732584193,i=-271733879,o=-1732584194,a=271733878,s=-1009589776,l=0;l<e.length;l+=16){for(var u=r,c=i,h=o,m=a,v=s,y=0;y<80;y++){n[y]=y<16?e[l+y]:g(n[y-3]^n[y-8]^n[y-14]^n[y-16],1);let t=f(f(g(r,5),d(y,i,o,a)),f(f(s,n[y]),p(y)));s=a,a=o,o=g(i,30),i=r,r=t}r=f(r,u),i=f(i,c),o=f(o,h),a=f(a,m),s=f(s,v)}return[r,i,o,a,s]},d=(e,t,n,r)=>e<20?t&n|~t&r:e<40?t^n^r:e<60?t&n|t&r|n&r:t^n^r,p=e=>e<20?1518500249:e<40?1859775393:e<60?-1894007588:-899497514,f=(e,t)=>{var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n},g=(e,t)=>e<<t|e>>>32-t}(Rp);var Dp=xe&&xe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Lp,"__esModule",{value:!0}),Lp.v5=void 0;const Fp=bp,Op=Dp(Rp);Lp.v5=(0,Fp.v35)("v5",80,Op.default),Object.defineProperty(Zd,"__esModule",{value:!0});const Np=Yd,jp=ep,Ip=np,zp=ap,Bp=lp,Up=wp,Hp=kp,Gp=Lp,Wp=$d;var Vp,qp=Zd.default={parse:Np.parse,unparse:jp.unparse,validate:Ip.validate,version:zp.version,v1:Bp.v1,v3:Up.v3,v4:Hp.v4,v5:Gp.v5,NIL:Wp.NIL,DNS:Wp.DNS,URL:Wp.URL,OID:Wp.OID,X500:Wp.X500},Zp=f(function(e,t){var n=e.cameraRef,r=e.metaAtlasCoreRef,i=c([]),o=u(0)[1],a=function(){o(function(e){return e+1})};return d(t,function(){return{dropPin:function(e,t,n){return void 0===n&&(n=!0),I(this,void 0,void 0,function(){var o,s,l;return z(this,function(u){return o=function(e){return r.current.getMidPointOfFeature(e)}(e),g(t)?(s="",n&&i.current.length>0?(i.current[i.current.length-1]=j(j({},i.current[i.current.length-1]),{coordinates:o,customElement:t,isVisible:!0}),s=i.current[i.current.length-1].id):(l={id:qp.v4(),coordinates:o,customElement:t,isVisible:!0},s=l.id,i.current.push(l)),a(),[2,s]):(console.warn("Invalid react element passed to dropPin function"),[2,""])})})},hidePin:function(e){var t;if(void 0===e&&(e="-1"),"-1"===e){var n=i.current[i.current.length-1];if(!n)return void console.warn("No pins available to hide.");t=n.id}else t=e;var r=i.current.findIndex(function(e){return e.id===t});-1!==r?(i.current[r]=j(j({},i.current[r]),{isVisible:!1}),a()):console.warn("Pin with ID: ".concat(t," not found."))},hidePins:function(){i.current=i.current.map(function(e){return j(j({},e),{isVisible:!1})}),a()},showPin:function(e){return void 0===e&&(e="-1"),I(this,void 0,void 0,function(){var t,n,r;return z(this,function(o){if("-1"===e){if(!(n=i.current[i.current.length-1]))return console.warn("No pins available to show."),[2];t=n.id}else t=e;return-1===(r=i.current.findIndex(function(e){return e.id===t}))?(console.warn("Pin with ID: ".concat(t," not found.")),[2]):(i.current[r]=j(j({},i.current[r]),{isVisible:!0}),a(),[2])})})},showPins:function(){i.current=i.current.map(function(e){return j(j({},e),{isVisible:!0})}),a()},clearPin:function(e){var t;if(void 0===e&&(e="-1"),"-1"===e){if((t=i.current.length-1)<0)return void console.warn("No pins available to clear.")}else if(-1===(t=i.current.findIndex(function(t){return t.id===e})))return void console.warn("Pin with ID: ".concat(e," not found."));i.current.splice(t,1),a()},clearPins:function(){i.current=[],a()},fitViewToPins:function(e,t){var r;if(void 0===t&&(t=50),0!==i.current.length){var o=i.current.filter(function(t){return!!e.includes(t.id)});if(0!==o.length){for(var a=o[0].coordinates,s=new Wd(a[0],a[1]),l=new Wd(a[0],a[1]),u=new Vd(s,l),c=0;c<o.length;c++){var h=o[c];u.extend(h.coordinates)}var d=u.toArray();null===(r=null==n?void 0:n.current)||void 0===r||r.fitBounds([d[0][0],d[0][1],d[1][0],d[1][1]],{padding:{top:t,right:t,bottom:t,left:t},duration:1e3})}else console.warn("No pins to fit on the map.")}else console.warn("No pins to fit on the map.")}}}),l.createElement(l.Fragment,null,i.current.map(function(e){return e.isVisible&&g(e.customElement)&&l.createElement(S,{key:e.id,coordinate:e.coordinates},e.customElement)}))});function Yp(e){var t=this,n=o.create({page:{flex:1,backgroundColor:"#F5FCFF",alignItems:"center",justifyContent:e.isFullHeight?"center":"flex-start"},map:{flex:1,alignSelf:"stretch",maxHeight:e.isFullHeight?void 0:e.maxMapHeight}}),r=c(null);r.current||(r.current=new Gd);var i=r.current,s=c(i.mapDataService),p=c(null),f=c(null),g=c(null),y=c(i.userLocation),w=c(null),b=c(null),_=c(null),x=c(null),S=c(15.5),C=c(0),k=c(0),E=c(null);E.current||(E.current=ie({getCamera:function(){return f.current},getZoom:function(){return S.current},getViewport:function(){return{width:k.current,height:C.current}}}));var T=function(e){var t,n=null===(t=e.nativeEvent)||void 0===t?void 0:t.zoom;"number"==typeof n&&Number.isFinite(n)&&(S.current=n)},R=c(!1),D=c(!1),O=c(!1),N=c(!1),j=u(!1),B=j[0],U=j[1],H=c(null),G=u({center:[103.8218,1.2564],zoom:15.5,bearing:0}),W=G[0],V=G[1],q=u(""),Z=q[0],Y=q[1],$=c(""),J=function(e){var t=JSON.stringify(e);$.current=t,Y(t)},K=c(il),X=c(ol),Q=c(al),ee=c(sl),te=u(!1),ae=te[0],se=te[1],le=u(!1),ue=le[0],ce=le[1],he=u(null),de=he[0],fe=he[1],ge=u(!1),me=ge[0],ve=ge[1],ye="https://atoms.sandbox.spatialverse.online/sdk/2.1.2-sandbox/",we="https://atoms-map-tiles-middleware.sandbox.spatialverse.online/".concat(e.tileserverRoleName,"/latest/geojson?accessToken=").concat(e.accessToken),be=e.onNetworkModeUpdate?e.onNetworkModeUpdate:function(){},_e=function(){return I(t,void 0,void 0,function(){var t,n,r=this;return z(this,function(i){switch(i.label){case 0:return t=function(){return I(r,void 0,void 0,function(){var e;return z(this,function(t){switch(t.label){case 0:return[4,Se()];case 1:return e=t.sent(),ce(e),be(e?Vp.Offline:Vp.Online),[2]}})})},s.current.getOfflineMapStatus()===wc.Ready?[3,2]:(n=function(n){return I(r,void 0,void 0,function(){return z(this,function(r){return e.onOfflineMapsStatusUpdate(n),n&&t(),[2]})})},[4,s.current.setupOfflineMaps(n)]);case 1:return i.sent(),[3,3];case 2:t(),i.label=3;case 3:return[2]}})})},xe=function(){return I(t,void 0,void 0,function(){var e,t,n=this;return z(this,function(r){switch(r.label){case 0:return e=function(){return I(n,void 0,void 0,function(){var e,t;return z(this,function(n){switch(n.label){case 0:e="".concat(L.DocumentDirectoryPath,"/extracted/"),n.label=1;case 1:return n.trys.push([1,5,,6]),[4,L.exists(e)];case 2:return n.sent()?[4,ru(e)]:[3,4];case 3:n.sent(),be(Vp.Online),console.log("Unzipped files deleted from: ".concat(e)),n.label=4;case 4:return[3,6];case 5:return t=n.sent(),console.error("Error during cleanup:",t),[3,6];case 6:return[2]}})})},[4,e()];case 1:return r.sent(),t=JSON.parse(Z),il.sprite&&il.glyphs&&(t.glyphs=K.current.glyphs,t.sprite=K.current.sprite),J(t),ce(!1),xc.setState({data:""}),s.current.offlineMapStatus=wc.Awaiting,be(Vp.Online),[2]}})})},Se=function(){return I(t,void 0,void 0,function(){var e,t,n,r,i,o,a,s,l;return z(this,function(u){switch(u.label){case 0:e=xc.getState().data,t=Sc.getState().data,n=JSON.parse(Z),u.label=1;case 1:return u.trys.push([1,8,,9]),console.log("Paths Here:",e,t),(r=e)?[4,L.exists(e)]:[3,3];case 2:r=u.sent(),u.label=3;case 3:return r?(console.log("MBTiles path set:",e),i="".concat(t,"fonts"),(o=t)?[4,L.exists(i)]:[3,5]):(console.error("MBTiles file not found:",e),[2,!1]);case 4:o=u.sent(),u.label=5;case 5:return o?(console.log("Fonts path set:",i),n.glyphs="file://".concat(i,"/{fontstack}/{range}.pbf"),a="".concat(t,"sprites"),(s=t)?[4,L.exists(a)]:[3,7]):(console.error("Fonts directory not found:",i),[2,!1]);case 6:s=u.sent(),u.label=7;case 7:return s?(console.log("Sprites path set:",a),n.sprite="file://".concat(a,"/sprites"),J(n),[2,!0]):(console.error("Sprites directory not found:",a),[2,!1]);case 8:return l=u.sent(),console.error("Error setting up MBTiles, Fonts, and Sprites:",l),[2,!1];case 9:return[2]}})})},Ae=function(){var e,t,n;null===(e=r.current)||void 0===e||e.attach({style:{readLayers:function(){var e=$.current;if(!e)return[];try{var t=JSON.parse(e);return Array.isArray(t.layers)?t.layers:[]}catch(e){return[]}},commitLayers:function(e){var t,n=$.current;try{t=n?JSON.parse(n):{layers:[]}}catch(e){t={layers:[]}}t.layers=e,J(t)}},camera:null!==(t=E.current)&&void 0!==t?t:void 0,sensors:g.current&&w.current?{gps:g.current,compass:w.current,motion:x.current}:void 0,marker:null!==(n=b.current)&&void 0!==n?n:void 0,routingDisplay:{setDisplayRoute:function(e){var t;null===(t=_.current)||void 0===t||t.setDisplayRoute(e)},getDisplayRoute:function(){var e,t;return null!==(t=null===(e=_.current)||void 0===e?void 0:e.getDisplayRoute())&&void 0!==t?t:null},setPatchFeatures:function(e){var t;null===(t=_.current)||void 0===t||t.setPatchFeatures(e)},setAnimatedCoordinates:function(e){var t;null===(t=_.current)||void 0===t||t.setAnimatedCoordinates(e)},clear:function(){var e;null===(e=_.current)||void 0===e||e.clear()}}})};h(function(){var e,t;null===(e=r.current)||void 0===e||e.bootstrap(),g.current||(g.current=new ne),w.current||(w.current=new re),x.current||(x.current=new pe),Ae();var n=null===(t=r.current)||void 0===t?void 0:t.focusManager.subscribeToFocusChange(function(e){var t;null===(t=_.current)||void 0===t||t.filterRoutingLayersWhereDimension(e)});return function(){var e,t,i,o,a;null==n||n(),R.current=!1;try{null===(t=null===(e=g.current)||void 0===e?void 0:e.destroyGPS)||void 0===t||t.call(e)}catch(e){}try{null===(o=null===(i=w.current)||void 0===i?void 0:i.destroy)||void 0===o||o.call(i)}catch(e){}try{null===(a=r.current)||void 0===a||a.detach()}catch(e){}}},[]),h(function(){var e=F.addEventListener(function(e){fe(e.isConnected)});return function(){try{e&&e()}catch(e){}}},[]),h(function(){var n=function(){return I(t,void 0,void 0,function(){var t,n,r=this;return z(this,function(i){switch(i.label){case 0:return t=function(t){return I(r,void 0,void 0,function(){var n,r,i,o,a;return z(this,function(s){switch(s.label){case 0:return s.trys.push([0,5,,6]),n="".concat(ye+t),[4,fetch(n)];case 1:return r=s.sent(),(i=r.headers.get("Content-Type"))&&i.includes("application/json")?[4,r.json()]:[3,3];case 2:return o=s.sent(),l=o,u=e.secretKey,function(e,t){I(void 0,void 0,void 0,function(){var n;return z(this,function(r){switch(r.label){case 0:n="".concat(L.DocumentDirectoryPath+"/"+t),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,L.writeFile(n,e,"utf8")];case 2:return r.sent(),[3,4];case 3:return r.sent(),console.error("failed to save file to local storage",t),[3,4];case 4:return[2]}})})}(eu.AES.encrypt(JSON.stringify(l),u).toString(),t),[2,o];case 3:return console.warn("Invalid Content-Type: expected JSON but received ".concat(i," for URL: ").concat(n)),[2,nu(t,e.secretKey)];case 4:return[3,6];case 5:return a=s.sent(),console.error("Error fetching or parsing JSON for ".concat(t,":"),a),[2,nu(t,e.secretKey)];case 6:return[2]}var l,u})})},n=function(){return I(r,void 0,void 0,function(){var n,r,i,o,a;return z(this,function(s){switch(s.label){case 0:return s.trys.push([0,7,,8]),[4,t("combined_style.json")];case 1:return n=s.sent(),K.current=null!==n?n:K.current,[4,t("customerLayer.json")];case 2:return r=s.sent(),X.current=r.length>0?r:X.current,"firealarmteam"!==e.tileserverRoleName?[3,4]:[4,t("firealarmstyles.json")];case 3:i=s.sent(),Q.current=i.length>0?i:Q.current,s.label=4;case 4:return"airside"!==e.tileserverRoleName?[3,6]:[4,t("airsideLayers.json")];case 5:o=s.sent(),ee.current=o.length>0?o:ee.current,s.label=6;case 6:return[3,8];case 7:return a=s.sent(),console.error("Error fetching styles:",a),[3,8];case 8:return[2]}})})},[4,n()];case 1:return i.sent(),[2]}})})},r=!1;F.addEventListener(function(e){return I(t,void 0,void 0,function(){return z(this,function(t){switch(t.label){case 0:return r?[3,3]:(r=!0,e.isConnected?[4,n()]:[3,2]);case 1:t.sent(),t.label=2;case 2:se(!0),t.label=3;case 3:return[2]}})})})},[e.secretKey,e.tileserverRoleName]),h(function(){if(ae){var t=function(e,t,n){var r=e.layers,i=r.findIndex(function(e){return e.id===t}),o=r.findIndex(function(e){return e.id===n});if(-1===i||-1===o)throw new Error("One or both layer IDs not found.");var a=r.splice(i,1)[0],s=i<o?o-1:o;return r.splice(s,0,a),e},n=$o(K.current);if(function(e,t,n){var r=e.layers,i=r.findIndex(function(e){return e.id===n});if(-1===i)throw new Error("Target layer ID not found.");r.splice(i,0,t)}(n,{id:"airside-boundary",type:"fill",source:"boundary",paint:{"fill-color":"#e2e6ee"}},"highway_major_casing"),t(n,"landcover_grass","highway_major_casing"),t(n,"water","highway_major_casing"),("changi"===e.tileserverRoleName||"changipublic-airside"===e.tileserverRoleName)&&ee.current&&ee.current.length>0){for(var r=0;r<X.current.length;r++){(i=$o(X.current[r]))["source-layer"]="geojson",n.layers.push(i)}for(r=0;r<ee.current.length;r++){(i=$o(ee.current[r]))["source-layer"]="geojson",n.layers.push(i)}}else if("airside"===e.tileserverRoleName&&ee.current&&ee.current.length>0)for(r=0;r<ee.current.length;r++){(i=$o(ee.current[r]))["source-layer"]="geojson",n.layers.push(i)}else if("firealarmteam"===e.tileserverRoleName&&Q.current&&Q.current.length>0){for(r=0;r<X.current.length;r++){(i=$o(X.current[r]))["source-layer"]="geojson",n.layers.push(i)}for(r=0;r<Q.current.length;r++){(i=$o(Q.current[r]))["source-layer"]="geojson",n.layers.push(i)}}else for(r=0;r<X.current.length;r++){var i;(i=$o(X.current[r]))["source-layer"]="geojson",n.layers.push(i)}J(n)}},[e.tileserverRoleName,ae]),h(function(){s.current.init("https://atoms-api.sandbox.spatialverse.online",e.accessToken,e.secretKey,ye,e.tileserverRoleName)},[e.accessToken]),h(function(){console.log(de,"isNetworkConnected");var n,i=e.onRoutingStatusUpdate?e.onRoutingStatusUpdate:function(){},o=e.onSearchStatusUpdate?e.onSearchStatusUpdate:function(){};null!==de&&(de?s.current.getAtomsAPIAccessToken(function(e){return I(t,void 0,void 0,function(){var t,n,a,l,u,c;return z(this,function(h){switch(h.label){case 0:return D.current=!0,e.authenticated?[4,s.current.setupFocusTree()]:[3,2];case 1:return h.sent(),(t=Is()).length>0&&(n=t[0].taxonomyPath,(null==(a=s.current.getFlyToLocation(n,!0))?void 0:a.center)&&V({center:a.center,zoom:null!==(l=a.zoom)&&void 0!==l?l:15.5,bearing:null!==(u=a.bearing)&&void 0!==u?u:0}),null===(c=r.current)||void 0===c||c.focusManager.commit(n,{moveCamera:!0})),s.current.getRoutingStatus()!==wc.Ready&&s.current.setupRouting(i),s.current.getSearchStatus()!==wc.Ready&&s.current.setupMapObjectSearch(o),Ce(),[3,3];case 2:ke("Failed to authenticate token"),h.label=3;case 3:return[2]}})})}):(s.current.getRoutingStatus()!==wc.Ready&&s.current.setupRouting(i),s.current.getSearchStatus()!==wc.Ready&&s.current.setupMapObjectSearch(o),Ce()),me&&(n=de,I(t,void 0,void 0,function(){return z(this,function(e){return n?ue&&xe():_e(),[2]})})))},[de,me]);var Pe=i.routingManager,Me=function(){return!0===R.current&&null!==p.current};d(e.ref,function(){var t={getZoom:function(){var e;return I(this,void 0,void 0,function(){return z(this,function(t){switch(t.label){case 0:return Me()?[4,null===(e=p.current)||void 0===e?void 0:e.getZoom()]:[2,null];case 1:return[2,t.sent()]}})})},getCenter:function(){var e;return I(this,void 0,void 0,function(){return z(this,function(t){switch(t.label){case 0:return Me()?[4,null===(e=p.current)||void 0===e?void 0:e.getCenter()]:[2,null];case 1:return[2,t.sent()]}})})},getBearing:function(){var e;return I(this,void 0,void 0,function(){return z(this,function(t){switch(t.label){case 0:return Me()?[4,null===(e=p.current)||void 0===e?void 0:e.getBearing()]:[2,null];case 1:return[2,t.sent()]}})})},moveTo:function(e,t){var n;Me()&&(null===(n=f.current)||void 0===n||n.easeTo({center:e,easing:"ease",duration:t}))},zoomTo:function(e,t){var n;Me()&&(null===(n=f.current)||void 0===n||n.zoomTo(e,{duration:t,easing:"ease"}))},setupOfflineMaps:function(t){return I(this,void 0,void 0,function(){return z(this,function(n){switch(n.label){case 0:return s.current.getOfflineMapStatus()===wc.Ready?[3,2]:[4,s.current.setupOfflineMaps(e.onOfflineMapsStatusUpdate,t)];case 1:n.sent(),n.label=2;case 2:return[2]}})})},toggleMapMode:function(e){return I(this,void 0,void 0,function(){return z(this,function(t){return ve(!1),e===Vp.Offline?_e():e===Vp.Online&&xe(),[2]})})},focusTo:function(e,t){var n;void 0===t&&(t=!0),e&&(null===(n=r.current)||void 0===n||n.focusManager.commit(e,{moveCamera:t}))},subscribeToFocusChange:function(e){var t,n;return null!==(n=null===(t=r.current)||void 0===t?void 0:t.focusManager.subscribeToFocusChange(e))&&void 0!==n?n:function(){}},styleRouteLineLayer:function(e){var t;null===(t=_.current)||void 0===t||t.styleRouteLineLayer(e)},filterLayersByType:function(e,t,n){void 0===e&&(e=[]),void 0===n&&(n="");var r=JSON.parse(Z),i=function(e,t,n,r){if(n){for(var i=0;i<e.length;i+=1){var o=void 0,a=e[i].filter;if(o=r?["case",["!",["in",["get",t],["literal",n]]],!0,["all",["in",["get",t],["literal",n]],["!=",["geometry-type"],r]],!0,!1]:["!",["in",["get",t],["literal",n]]],a){for(var s=!1,l=0;l<a.length;l+=1){var u=a[l];if(r){if("case"===u[0]&&Array.isArray(u[1])&&Array.isArray(u[3])&&Array.isArray(u[3][1])&&Array.isArray(u[3][1])&&Array.isArray(u[3][1][1])&&Array.isArray(u[3][1][2])&&Array.isArray(u[3][2])&&u[3][1][1][1]===t&&u[3][2][2]===r){u[1][1][2]=["literal",n],u[1][1][1]=["get",t],u[3][1][2]=["literal",n],u[3][1][1]=["get",t],u[3][2][2]=r,s=!0;break}}else if(Array.isArray(u[1])&&Array.isArray(u[1][1])&&"!"===u[0]&&u[1][1][1]===t){u[0]="!",u[1][2]=["literal",n],s=!0;break}}s||(console.log("pushing: ",n,t),a.push(o))}}return e}}(r.layers,t,e,n);r.layers=i,J(r)},styleLayersByType:function(e,t,n,r){var i=JSON.parse(Z),o=function(e,t,n,r,i){if(n){for(var o=0;o<e.length;o+=1){var a=e[o],s=a.paint,l=a.type;if((l&&"fill"===l||"line"===l)&&s[r]){var u=s[r];if(u){var c=Ys(u,t,n,i);s[r]=c}}}return e}}(i.layers,t,e,n,r);i.layers=o,J(i)},clearStyleLayersByType:function(e,t,n){var r=JSON.parse(Z),i=function(e,t,n,r){for(var i=0;i<e.length;i+=1){var o=e[i],a=o.paint,s=o.type;if((s&&"fill"===s||"line"===s)&&a[r]){var l=a[r];if(l){var u=$s(l,t,n);a[r]=u}}}return e}(r.layers,e,t,n);r.layers=i,J(r)},flyTo:function(e,t){var n,r,i,o;return void 0===t&&(t=!0),I(this,void 0,void 0,function(){var a,s,l,u,c;return z(this,function(h){switch(h.label){case 0:return Me()?(t||this.clearPins(),[4,null===(n=p.current)||void 0===n?void 0:n.getCenter()]):[2];case 1:return(a=h.sent())?(s=e.center?e.center:a,e.zoomLevel?(u=e.zoomLevel,[3,4]):[3,2]):[2];case 2:return[4,null===(r=p.current)||void 0===r?void 0:r.getZoom()];case 3:u=h.sent(),h.label=4;case 4:return l=u,c=2*ta(a,s,{units:"meters"}),null!==e.bearing?null===(i=f.current)||void 0===i||i.setStop({center:s,zoom:l,duration:c,bearing:e.bearing,easing:"fly"}):null===(o=f.current)||void 0===o||o.setStop({center:s,zoom:l,duration:c,easing:"fly"}),[2]}})})},getFocusTree:function(){return s.current.getFocusTree()},getWhatTaxonomies:function(){return s.current.getWhatTaxonomies()},getCurrentFocus:function(){return s.current.getCurrentFocus()},getCurrentFocusBuilding:function(){return s.current.getCurrentFocusBuilding()},getCurrentFocusFloor:function(){return s.current.getCurrentFocusFloor()},getRootNodes:function(){return Is()},getChildNodes:function(e){return function(e){return Hs(e,1)}(e)},getNodesAtDepth:function(e,t){return Hs(e,t)},getNodeDepth:function(e){return function(e){if(!e)return null;var t=null;return js(Fs(),function(n,r){n.taxonomyPath===e&&(t=r)}),t}(e)},getSubtreeMaxRelativeDepth:function(e){return Gs(e)},getSelectorTierCount:function(e){return function(e){return Gs(e)+1}(e)},findNodeByTaxonomy:function(e){return zs(e)},getAncestors:function(e){return Bs(e)},getLastClickedFeature:function(){return s.current.getLastClickedFeature()},getAllMapObjects:function(){var e;return(e=s.current).getAllMapObjects.apply(e,arguments)},getMapObjectsByName:function(){var e;return(e=s.current).getMapObjectsByName.apply(e,arguments)},getMapObjectById:function(){var e;return(e=s.current).getMapObjectById.apply(e,arguments)},getMapObjectByLocalRef:function(){var e;return(e=s.current).getMapObjectByLocalRef.apply(e,arguments)},getMapObjectsByWhatTaxonomy:function(){var e;return(e=s.current).getMapObjectsByWhatTaxonomy.apply(e,arguments)},getMapObjectsByWhereTaxonomy:function(){var e;return(e=s.current).getMapObjectsByWhereTaxonomy.apply(e,arguments)},getMapObjectsByWhatAndWhereTaxonomy:function(){var e;return(e=s.current).getMapObjectsByWhatAndWhereTaxonomy.apply(e,arguments)},getMapObjectsInWhatTaxonomy:function(){var e;return(e=s.current).getMapObjectsInWhatTaxonomy.apply(e,arguments)},getMapObjectsInWhereTaxonomy:function(){var e;return(e=s.current).getMapObjectsInWhereTaxonomy.apply(e,arguments)},getMapObjectsInWhatAndWhereTaxonomy:function(){var e;return(e=s.current).getMapObjectsInWhatAndWhereTaxonomy.apply(e,arguments)},getMidPointOfFeature:function(e){return s.current.getMidPointOfFeature(e)},dropPin:function(e,t,n){var r;return void 0===n&&(n=!0),I(this,void 0,void 0,function(){return z(this,function(i){switch(i.label){case 0:return[4,null===(r=H.current)||void 0===r?void 0:r.dropPin(e,t,n)];case 1:return[2,i.sent()||""]}})})},hidePin:function(e){var t;void 0===e&&(e="-1"),null===(t=H.current)||void 0===t||t.hidePin(e)},hidePins:function(){var e;null===(e=H.current)||void 0===e||e.hidePins()},showPin:function(e){var t;return void 0===e&&(e="-1"),I(this,void 0,void 0,function(){return z(this,function(n){switch(n.label){case 0:return[4,null===(t=H.current)||void 0===t?void 0:t.showPin(e)];case 1:return n.sent(),[2]}})})},showPins:function(){var e;null===(e=H.current)||void 0===e||e.showPins()},clearPin:function(e){var t;void 0===e&&(e="-1"),null===(t=H.current)||void 0===t||t.clearPin(e)},clearPins:function(){var e;null===(e=H.current)||void 0===e||e.clearPins()},fitViewToPins:function(e,t){var n;void 0===t&&(t=50),Me()&&(null===(n=H.current)||void 0===n||n.fitViewToPins(e,t))},fitViewToFeatures:function(e,t){var n;if(void 0===t&&(t=50),Me())if(0!==e.length){for(var r=e[0].coordinates,i=new Wd(r[0],r[1]),o=new Wd(r[0],r[1]),a=new Vd(i,o),s=0;s<e.length;s++){var l=e[s];a.extend(l.coordinates)}var u=a.toArray();null===(n=f.current)||void 0===n||n.fitBounds([u[0][0],u[0][1],u[1][0],u[1][1]],{padding:{top:t,right:t,bottom:t,left:t},duration:1e3})}else console.warn("No pins to fit on the map.")},changeTerminalInFocusToUserViewpoint:function(e){var t;return void 0===e&&(e={}),I(this,void 0,void 0,function(){var n;return z(this,function(r){switch(r.label){case 0:return Me()?[4,null===(t=p.current)||void 0===t?void 0:t.getCenter()]:[2];case 1:return(n=r.sent())?(i.focusManager.changeToUserViewpoint(n,e),[2]):[2]}})})},computeRoute:function(e,t,n){return I(this,void 0,void 0,function(){return z(this,function(r){switch(r.label){case 0:return[4,Pe.computeRoute(e,t,n)];case 1:return[2,r.sent()]}})})},computeRoutes:function(e,t){return I(this,void 0,void 0,function(){return z(this,function(n){switch(n.label){case 0:return[4,Pe.computeRoutes(e,t)];case 1:return[2,n.sent()]}})})},computeRoutesFromLocation:function(e,t,n,r){return void 0===r&&(r=!1),I(this,void 0,void 0,function(){return z(this,function(i){switch(i.label){case 0:return[4,Pe.computeRoutesFromLocation(e,t,n,{wheelChairAccessible:r})];case 1:return[2,i.sent()]}})})},computeRouteFromCoordinates:function(e,t,n){return I(this,void 0,void 0,function(){return z(this,function(r){switch(r.label){case 0:return[4,Pe.computeRouteFromCoordinates(e,t,n)];case 1:return[2,r.sent()]}})})},setRoutingMode:Pe.setRoutingMode,startNavigation:Pe.startNavigation,startNavigationFromCoordinates:Pe.startNavigationFromCoordinates,stopNavigation:Pe.stopNavigation,recenter:function(e){var t;return null===(t=y.current)||void 0===t?void 0:t.recenter(e)},setActiveRoute:function(e){Pe.setActiveRoute(e)},getActiveRoute:function(){return Pe.getActiveRoute()},highlightRouteSegment:function(e){return I(this,void 0,void 0,function(){return z(this,function(t){switch(t.label){case 0:return[4,Pe.highlightRouteSegment(e)];case 1:return t.sent(),[2]}})})},isPositionWithinBounds:function(e){var t,n;return null!==(n=null===(t=y.current)||void 0===t?void 0:t.isPositionWithinBounds(e))&&void 0!==n&&n},clearRoute:function(){Pe.clearRoute()},getRoutingStatus:function(){return s.current.getRoutingStatus()},getRoutingParameters:function(){return Pe.getRoutingParameters()},requestGPSPermission:function(){var e,t;return I(this,void 0,void 0,function(){return z(this,function(n){switch(n.label){case 0:return[4,null===(t=null===(e=y.current)||void 0===e?void 0:e.requestGPSPermission)||void 0===t?void 0:t.call(e)];case 1:return[2,n.sent()]}})})},isGPSPermissionGranted:function(){var e,t;return I(this,void 0,void 0,function(){return z(this,function(n){switch(n.label){case 0:return[4,null===(t=null===(e=y.current)||void 0===e?void 0:e.isGPSPermissionGranted)||void 0===t?void 0:t.call(e)];case 1:return[2,n.sent()]}})})},enableGPS:function(e){var t,n;return I(this,void 0,void 0,function(){return z(this,function(r){switch(r.label){case 0:return[4,null===(n=null===(t=y.current)||void 0===t?void 0:t.enableGPS)||void 0===n?void 0:n.call(t,e)];case 1:return[2,r.sent()]}})})},disableGPS:function(){var e,t;null===(t=null===(e=y.current)||void 0===e?void 0:e.disableGPS)||void 0===t||t.call(e)},destroyGPS:function(){var e,t;null===(t=null===(e=y.current)||void 0===e?void 0:e.destroy)||void 0===t||t.call(e)},getCameraFollowState:function(){var e,t;return null!==(t=null===(e=y.current)||void 0===e?void 0:e.getCameraFollowState())&&void 0!==t?t:{mode:"normal",owner:"gps",isFollowing:!1}},setNormalModeHeadingCameraFollow:function(e){var t,n;null===(n=null===(t=y.current)||void 0===t?void 0:t.setNormalHeadingCameraFollow)||void 0===n||n.call(t,e)},isNormalModeHeadingCameraFollowEnabled:function(){var e,t,n;return null!==(n=null===(t=null===(e=y.current)||void 0===e?void 0:e.isNormalHeadingCameraFollowEnabled)||void 0===t?void 0:t.call(e))&&void 0!==n&&n},getGPSPosition:function(e){var t,n;return I(this,void 0,void 0,function(){return z(this,function(r){switch(r.label){case 0:return[4,null===(n=null===(t=y.current)||void 0===t?void 0:t.getGPSPosition)||void 0===n?void 0:n.call(t,e)];case 1:return[2,r.sent()]}})})},isGPSEnabled:function(){var e,t;return null===(t=null===(e=y.current)||void 0===e?void 0:e.isGPSEnabled)||void 0===t?void 0:t.call(e)},isFollowing:function(){var e=y.current;if(e)return e.getCameraFollowState().isFollowing},getCurrentGPSPosition:function(){var e,t;return null===(t=null===(e=y.current)||void 0===e?void 0:e.getCurrentPosition)||void 0===t?void 0:t.call(e)},triggerGPSUpdate:function(e){var t,n;null===(n=null===(t=y.current)||void 0===t?void 0:t.triggerGPSUpdate)||void 0===n||n.call(t,e)},onWhereTaxonomyUpdateProposed:function(e){i.autoFocusManager.addWhereTaxonomyUpdateProposedListener(e)},onWhereTaxonomyUpdated:function(e){i.autoFocusManager.addWhereTaxonomyUpdatedListener(e)},onWhereTaxonomyAutoRejected:function(e){i.autoFocusManager.addAutoRejectionListener(e)},acceptProposal:function(e){i.autoFocusManager.acceptProposal(e)},rejectProposal:function(e){i.autoFocusManager.rejectProposal(e)},manualOverride:function(e,t){i.autoFocusManager.manualOverride(e,t)},notifyManualFloorChange:function(e){i.autoFocusManager.notifyManualFloorChange(e,!1)},isNavigating:function(){return i.navigationEngine.getIsNavigating()},getAutoFocusLastAcceptedWhereTaxonomyPath:function(){return i.autoFocusManager.getLastAcceptedTaxonomyPath()},getAutoFocusManager:function(){return i.autoFocusManager},getTaxonomyUpdateStore:function(){return i.taxonomyUpdateStore},requestCompassPermission:function(){var e,t;return I(this,void 0,void 0,function(){return z(this,function(n){switch(n.label){case 0:return[4,null===(t=null===(e=w.current)||void 0===e?void 0:e.requestCompassPermission)||void 0===t?void 0:t.call(e)];case 1:return[2,n.sent()]}})})},enableCompass:function(e){var t,n;return I(this,void 0,void 0,function(){return z(this,function(r){switch(r.label){case 0:return[4,null===(n=null===(t=w.current)||void 0===t?void 0:t.enableCompass)||void 0===n?void 0:n.call(t,e)];case 1:return[2,r.sent()]}})})},disableCompass:function(){var e,t;null===(t=null===(e=w.current)||void 0===e?void 0:e.disableCompass)||void 0===t||t.call(e)},destroyCompass:function(){var e,t;null===(t=null===(e=w.current)||void 0===e?void 0:e.destroy)||void 0===t||t.call(e)},isCompassEnabled:function(){var e,t;return null===(t=null===(e=w.current)||void 0===e?void 0:e.isCompassEnabled)||void 0===t?void 0:t.call(e)},getCurrentCompassData:function(){var e,t;return null===(t=null===(e=w.current)||void 0===e?void 0:e.getCurrentCompassData)||void 0===t?void 0:t.call(e)},getCompassHeading:function(){var e,t;return null===(t=null===(e=w.current)||void 0===e?void 0:e.getCompassHeading)||void 0===t?void 0:t.call(e)},isCompassCalibrated:function(){var e,t;return null===(t=null===(e=w.current)||void 0===e?void 0:e.isCompassCalibrated)||void 0===t?void 0:t.call(e)}};return t},[Z,B]);var Ce=function(){!0===R.current&&!0===D.current&&!1===O.current&&e.onLoad&&(O.current=!0,e.onLoad())},ke=function(t){!1===N.current&&(N.current=!0,e.onLoadFail&&e.onLoadFail(t))},Ee={sw:[W.center[0]-.05,W.center[1]-.05],ne:[W.center[0]+.05,W.center[1]+.05]},Te=m(function(e){f.current=e,e&&Ae()},[]),Le=m(function(e){if(b.current=e,Ae(),e)return function(){var e;null===(e=r.current)||void 0===e||e.userLocation.detachMarker()}},[]);return l.createElement(a,{style:n.page,onLayout:function(e){C.current=e.nativeEvent.layout.height,k.current=e.nativeEvent.layout.width}},""!==Z?l.createElement(A,{onPress:function(n){return I(t,void 0,void 0,function(){var t,r,i,o,a,l,u,c;return z(this,function(h){switch(h.label){case 0:if(!Me())return[2];t=n.nativeEvent.point,h.label=1;case 1:return h.trys.push([1,4,,5]),[4,null===(u=p.current)||void 0===u?void 0:u.project(n.nativeEvent.lngLat)];case 2:return r=h.sent(),i=r||t,[4,null===(c=p.current)||void 0===c?void 0:c.queryRenderedFeatures(i)];case 3:return function(e){for(var t,n,r,i,o,a,l=e[0],u=0;u<e.length;u++){var c=e[u];s.current.isClickableFeature(c)&&(l=c)}if((null===(t=l.properties)||void 0===t?void 0:t.center)||l.geometry&&l.geometry.coordinates){var h=(null===(n=l.properties)||void 0===n?void 0:n.center)?l.properties.center:l.geometry.coordinates,d={mapObjectId:null===(r=l.properties)||void 0===r?void 0:r.myMapObjectId,coordinates:h,name:null===(i=l.properties)||void 0===i?void 0:i.title,whatDimension:null===(o=l.properties)||void 0===o?void 0:o.dimension_what,whereDimension:null===(a=l.properties)||void 0===a?void 0:a.dimension_where,geometry:l.geometry,properties:l.properties};s.current.setLastClickedFeature(s.current.hydrateClickedFeature(d))}}(o=h.sent()),e.onPress&&((a=null==o?void 0:o[0])?e.onPress(a):e.onPress(n.nativeEvent)),[3,5];case 4:return l=h.sent(),console.error("[onMapClicked] Error querying rendered features:",l),[3,5];case 5:return[2]}})})},onRegionWillChange:function(t){var n,r;T(t),t.nativeEvent.userInteraction&&(null===(n=y.current)||void 0===n||n.notifyUserGesture()),null===(r=e.onMoveStart)||void 0===r||r.call(e,t)},onRegionIsChanging:function(t){var n;T(t),null===(n=e.onMove)||void 0===n||n.call(e,t)},onRegionDidChange:function(n){return I(t,void 0,void 0,function(){var t;return z(this,function(r){return T(n),null===(t=e.onMoveEnd)||void 0===t||t.call(e,n),[2]})})},onDidFinishLoadingMap:function(){var e;!1===R.current&&(R.current=!0,null===(e=r.current)||void 0===e||e.notifyMapLoaded(),Ce())},onDidFailLoadingMap:function(){R.current=!1,ke("Failed to load map style")},style:n.map,logo:!1,ref:p,mapStyle:Z||null,attribution:!1,compass:!1},l.createElement(P,{ref:Te,duration:2e3,easing:"ease",initialViewState:{center:W.center,zoom:W.zoom,bearing:W.bearing,bounds:[Ee.sw[0],Ee.sw[1],Ee.ne[0],Ee.ne[1]]},maxZoom:22,minZoom:12}),l.createElement($p,{isOffline:ue,tileServer:we,props:e}),l.createElement(rl,{ref:_,metaAtlasCoreRef:s,triggerRender:function(){return U(!B)}}),l.createElement(v,{id:"boundary",data:qd}),l.createElement(M,{images:{"arrow-marker":"".concat(ye,"assets/gps-arrow.png")}}),l.createElement(oe,{ref:Le,position:null,showAccuracy:!0,pulse:!1}),l.createElement(Zp,{ref:H,cameraRef:f,metaAtlasCoreRef:s}),e.children):null)}Zp.displayName="MarkerOverlayContainer",function(e){e.Offline="offline",e.Online="online"}(Vp||(Vp={}));var $p=function(e){var t=e.isOffline,n=e.tileServer,r=e.props,i=u(""),o=i[0],a=i[1];return h(function(){var e;try{if(!xc||"function"!=typeof xc.getState)return void console.error("Invalid useMBTilesDataStore provided");var r=null===(e=xc.getState())||void 0===e?void 0:e.data;if(t&&!r)return void console.warn("Offline mode enabled but no MBTiles data available");var i=t&&r?"mbtiles://".concat(r):n;if(!i||"string"!=typeof i)return void console.error("Invalid source URL");a(i)}catch(e){console.error("Error setting up vector source:",e)}},[t,r]),""===o?null:l.createElement(C,{id:"custom",key:t?"offline":"online",url:o})};export{ju as LocationType,Yp as MetaAtlasSDK,Nd as NavigationStartError,Vu as ROUTE_MODE_REQUIRED_SENSORS,Gu as RouteMode,qu as resolveRequiredSensors};
29
+ su={get exports(){return wu},set exports(e){wu=e}},lu=wu,function(){var e,t="Expected a function",n="__lodash_hash_undefined__",r="__lodash_placeholder__",i=16,o=32,a=64,s=128,l=256,u=1/0,c=9007199254740991,h=NaN,d=4294967295,p=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",i],["flip",512],["partial",o],["partialRight",a],["rearg",l]],f="[object Arguments]",g="[object Array]",m="[object Boolean]",v="[object Date]",y="[object Error]",w="[object Function]",b="[object GeneratorFunction]",_="[object Map]",x="[object Number]",S="[object Object]",A="[object Promise]",P="[object RegExp]",M="[object Set]",C="[object String]",T="[object Symbol]",k="[object WeakMap]",E="[object ArrayBuffer]",R="[object DataView]",L="[object Float32Array]",D="[object Float64Array]",F="[object Int8Array]",N="[object Int16Array]",O="[object Int32Array]",j="[object Uint8Array]",I="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",U=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,V=/[&<>"']/g,q=RegExp(W.source),Z=RegExp(V.source),Y=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),ne=/^\s+/,re=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ue=/\\(\\)?/g,ce=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,fe=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ye=/($^)/,we=/['\n\r\u2028\u2029\\]/g,be="\\ud800-\\udfff",_e="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xe="\\u2700-\\u27bf",Se="a-z\\xdf-\\xf6\\xf8-\\xff",Ae="A-Z\\xc0-\\xd6\\xd8-\\xde",Pe="\\ufe0e\\ufe0f",Me="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Te="['’]",ke="["+be+"]",Ee="["+Me+"]",Re="["+_e+"]",Le="\\d+",De="["+xe+"]",Fe="["+Se+"]",Ne="[^"+be+Me+Le+xe+Se+Ae+"]",Oe="\\ud83c[\\udffb-\\udfff]",je="[^"+be+"]",Ie="(?:\\ud83c[\\udde6-\\uddff]){2}",ze="[\\ud800-\\udbff][\\udc00-\\udfff]",Be="["+Ae+"]",Ue="\\u200d",He="(?:"+Fe+"|"+Ne+")",Ge="(?:"+Be+"|"+Ne+")",We="(?:['’](?:d|ll|m|re|s|t|ve))?",Ve="(?:['’](?:D|LL|M|RE|S|T|VE))?",qe="(?:"+Re+"|"+Oe+")?",Ze="["+Pe+"]?",Ye=Ze+qe+"(?:"+Ue+"(?:"+[je,Ie,ze].join("|")+")"+Ze+qe+")*",$e="(?:"+[De,Ie,ze].join("|")+")"+Ye,Ke="(?:"+[je+Re+"?",Re,Ie,ze,ke].join("|")+")",Xe=RegExp(Te,"g"),Je=RegExp(Re,"g"),Qe=RegExp(Oe+"(?="+Oe+")|"+Ke+Ye,"g"),et=RegExp([Be+"?"+Fe+"+"+We+"(?="+[Ee,Be,"$"].join("|")+")",Ge+"+"+Ve+"(?="+[Ee,Be+He,"$"].join("|")+")",Be+"?"+He+"+"+We,Be+"+"+Ve,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Le,$e].join("|"),"g"),tt=RegExp("["+Ue+be+_e+Pe+"]"),nt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],it=-1,ot={};ot[L]=ot[D]=ot[F]=ot[N]=ot[O]=ot[j]=ot[I]=ot[z]=ot[B]=!0,ot[f]=ot[g]=ot[E]=ot[m]=ot[R]=ot[v]=ot[y]=ot[w]=ot[_]=ot[x]=ot[S]=ot[P]=ot[M]=ot[C]=ot[k]=!1;var at={};at[f]=at[g]=at[E]=at[R]=at[m]=at[v]=at[L]=at[D]=at[F]=at[N]=at[O]=at[_]=at[x]=at[S]=at[P]=at[M]=at[C]=at[T]=at[j]=at[I]=at[z]=at[B]=!0,at[y]=at[w]=at[k]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},lt=parseFloat,ut=parseInt,ct="object"==typeof Ce&&Ce&&Ce.Object===Object&&Ce,ht="object"==typeof self&&self&&self.Object===Object&&self,dt=ct||ht||Function("return this")(),pt=lu&&!lu.nodeType&&lu,ft=pt&&su&&!su.nodeType&&su,gt=ft&&ft.exports===pt,mt=gt&&ct.process,vt=function(){try{var e=ft&&ft.require&&ft.require("util").types;return e||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),yt=vt&&vt.isArrayBuffer,wt=vt&&vt.isDate,bt=vt&&vt.isMap,_t=vt&&vt.isRegExp,xt=vt&&vt.isSet,St=vt&&vt.isTypedArray;function At(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Pt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function Mt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Ct(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Tt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function kt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Et(e,t){return!(null==e||!e.length)&&Bt(e,t,0)>-1}function Rt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Lt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Dt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Ft(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function Nt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Ot(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var jt=Wt("length");function It(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function zt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Bt(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):zt(e,Ht,n)}function Ut(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Ht(e){return e!=e}function Gt(e,t){var n=null==e?0:e.length;return n?Zt(e,t)/n:h}function Wt(t){return function(n){return null==n?e:n[t]}}function Vt(t){return function(n){return null==t?e:t[n]}}function qt(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}function Zt(t,n){for(var r,i=-1,o=t.length;++i<o;){var a=n(t[i]);a!==e&&(r=r===e?a:r+a)}return r}function Yt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function $t(e){return e?e.slice(0,pn(e)+1).replace(ne,""):e}function Kt(e){return function(t){return e(t)}}function Xt(e,t){return Lt(t,function(t){return e[t]})}function Jt(e,t){return e.has(t)}function Qt(e,t){for(var n=-1,r=e.length;++n<r&&Bt(t,e[n],0)>-1;);return n}function en(e,t){for(var n=e.length;n--&&Bt(t,e[n],0)>-1;);return n}var tn=Vt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nn=Vt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function rn(e){return"\\"+st[e]}function on(e){return tt.test(e)}function an(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function sn(e,t){return function(n){return e(t(n))}}function ln(e,t){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var s=e[n];s!==t&&s!==r||(e[n]=r,a[o++]=n)}return a}function un(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function cn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function hn(e){return on(e)?function(e){for(var t=Qe.lastIndex=0;Qe.test(e);)++t;return t}(e):jt(e)}function dn(e){return on(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.split("")}(e)}function pn(e){for(var t=e.length;t--&&re.test(e.charAt(t)););return t}var fn=Vt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),gn=function re(be){var _e=(be=null==be?dt:gn.defaults(dt.Object(),be,gn.pick(dt,rt))).Array,xe=be.Date,Se=be.Error,Ae=be.Function,Pe=be.Math,Me=be.Object,Ce=be.RegExp,Te=be.String,ke=be.TypeError,Ee=_e.prototype,Re=Ae.prototype,Le=Me.prototype,De=be["__core-js_shared__"],Fe=Re.toString,Ne=Le.hasOwnProperty,Oe=0,je=function(){var e=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ie=Le.toString,ze=Fe.call(Me),Be=dt._,Ue=Ce("^"+Fe.call(Ne).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),He=gt?be.Buffer:e,Ge=be.Symbol,We=be.Uint8Array,Ve=He?He.allocUnsafe:e,qe=sn(Me.getPrototypeOf,Me),Ze=Me.create,Ye=Le.propertyIsEnumerable,$e=Ee.splice,Ke=Ge?Ge.isConcatSpreadable:e,Qe=Ge?Ge.iterator:e,tt=Ge?Ge.toStringTag:e,st=function(){try{var e=ho(Me,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=be.clearTimeout!==dt.clearTimeout&&be.clearTimeout,ht=xe&&xe.now!==dt.Date.now&&xe.now,pt=be.setTimeout!==dt.setTimeout&&be.setTimeout,ft=Pe.ceil,mt=Pe.floor,vt=Me.getOwnPropertySymbols,jt=He?He.isBuffer:e,Vt=be.isFinite,mn=Ee.join,vn=sn(Me.keys,Me),yn=Pe.max,wn=Pe.min,bn=xe.now,_n=be.parseInt,xn=Pe.random,Sn=Ee.reverse,An=ho(be,"DataView"),Pn=ho(be,"Map"),Mn=ho(be,"Promise"),Cn=ho(be,"Set"),Tn=ho(be,"WeakMap"),kn=ho(Me,"create"),En=Tn&&new Tn,Rn={},Ln=Io(An),Dn=Io(Pn),Fn=Io(Mn),Nn=Io(Cn),On=Io(Tn),jn=Ge?Ge.prototype:e,In=jn?jn.valueOf:e,zn=jn?jn.toString:e;function Bn(e){if(ts(e)&&!Wa(e)&&!(e instanceof Wn)){if(e instanceof Gn)return e;if(Ne.call(e,"__wrapped__"))return zo(e)}return new Gn(e)}var Un=function(){function t(){}return function(n){if(!es(n))return{};if(Ze)return Ze(n);t.prototype=n;var r=new t;return t.prototype=e,r}}();function Hn(){}function Gn(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=e}function Wn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Zn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Zn;++t<n;)this.add(e[t])}function $n(e){var t=this.__data__=new qn(e);this.size=t.size}function Kn(e,t){var n=Wa(e),r=!n&&Ga(e),i=!n&&!r&&Ya(e),o=!n&&!r&&!i&&us(e),a=n||r||i||o,s=a?Yt(e.length,Te):[],l=s.length;for(var u in e)!t&&!Ne.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||wo(u,l))||s.push(u);return s}function Xn(t){var n=t.length;return n?t[Yr(0,n-1)]:e}function Jn(e,t){return No(ki(e),sr(t,0,e.length))}function Qn(e){return No(ki(e))}function er(t,n,r){(r!==e&&!Ba(t[n],r)||r===e&&!(n in t))&&or(t,n,r)}function tr(t,n,r){var i=t[n];Ne.call(t,n)&&Ba(i,r)&&(r!==e||n in t)||or(t,n,r)}function nr(e,t){for(var n=e.length;n--;)if(Ba(e[n][0],t))return n;return-1}function rr(e,t,n,r){return dr(e,function(e,i,o){t(r,e,n(e),o)}),r}function ir(e,t){return e&&Ei(t,Rs(t),e)}function or(e,t,n){"__proto__"==t&&st?st(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ar(t,n){for(var r=-1,i=n.length,o=_e(i),a=null==t;++r<i;)o[r]=a?e:Ms(t,n[r]);return o}function sr(t,n,r){return t==t&&(r!==e&&(t=t<=r?t:r),n!==e&&(t=t>=n?t:n)),t}function lr(t,n,r,i,o,a){var s,l=1&n,u=2&n,c=4&n;if(r&&(s=o?r(t,i,o,a):r(t)),s!==e)return s;if(!es(t))return t;var h=Wa(t);if(h){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ne.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!l)return ki(t,s)}else{var d=go(t),p=d==w||d==b;if(Ya(t))return Si(t,l);if(d==S||d==f||p&&!o){if(s=u||p?{}:vo(t),!l)return u?function(e,t){return Ei(e,fo(e),t)}(t,function(e,t){return e&&Ei(t,Ls(t),e)}(s,t)):function(e,t){return Ei(e,po(e),t)}(t,ir(s,t))}else{if(!at[d])return o?t:{};s=function(e,t,n){var r,i=e.constructor;switch(t){case E:return Ai(e);case m:case v:return new i(+e);case R:return function(e,t){var n=t?Ai(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case L:case D:case F:case N:case O:case j:case I:case z:case B:return Pi(e,n);case _:return new i;case x:case C:return new i(e);case P:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case M:return new i;case T:return r=e,In?Me(In.call(r)):{}}}(t,d,l)}}a||(a=new $n);var g=a.get(t);if(g)return g;a.set(t,s),as(t)?t.forEach(function(e){s.add(lr(e,n,r,e,t,a))}):ns(t)&&t.forEach(function(e,i){s.set(i,lr(e,n,r,i,t,a))});var y=h?e:(c?u?io:ro:u?Ls:Rs)(t);return Mt(y||t,function(e,i){y&&(e=t[i=e]),tr(s,i,lr(e,n,r,i,t,a))}),s}function ur(t,n,r){var i=r.length;if(null==t)return!i;for(t=Me(t);i--;){var o=r[i],a=n[o],s=t[o];if(s===e&&!(o in t)||!a(s))return!1}return!0}function cr(n,r,i){if("function"!=typeof n)throw new ke(t);return Ro(function(){n.apply(e,i)},r)}function hr(e,t,n,r){var i=-1,o=Et,a=!0,s=e.length,l=[],u=t.length;if(!s)return l;n&&(t=Lt(t,Kt(n))),r?(o=Rt,a=!1):t.length>=200&&(o=Jt,a=!1,t=new Yn(t));e:for(;++i<s;){var c=e[i],h=null==n?c:n(c);if(c=r||0!==c?c:0,a&&h==h){for(var d=u;d--;)if(t[d]===h)continue e;l.push(c)}else o(t,h,r)||l.push(c)}return l}Bn.templateSettings={escape:Y,evaluate:$,interpolate:K,variable:"",imports:{_:Bn}},Bn.prototype=Hn.prototype,Bn.prototype.constructor=Bn,Gn.prototype=Un(Hn.prototype),Gn.prototype.constructor=Gn,Wn.prototype=Un(Hn.prototype),Wn.prototype.constructor=Wn,Vn.prototype.clear=function(){this.__data__=kn?kn(null):{},this.size=0},Vn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Vn.prototype.get=function(t){var r=this.__data__;if(kn){var i=r[t];return i===n?e:i}return Ne.call(r,t)?r[t]:e},Vn.prototype.has=function(t){var n=this.__data__;return kn?n[t]!==e:Ne.call(n,t)},Vn.prototype.set=function(t,r){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=kn&&r===e?n:r,this},qn.prototype.clear=function(){this.__data__=[],this.size=0},qn.prototype.delete=function(e){var t=this.__data__,n=nr(t,e);return!(n<0||(n==t.length-1?t.pop():$e.call(t,n,1),--this.size,0))},qn.prototype.get=function(t){var n=this.__data__,r=nr(n,t);return r<0?e:n[r][1]},qn.prototype.has=function(e){return nr(this.__data__,e)>-1},qn.prototype.set=function(e,t){var n=this.__data__,r=nr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Zn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(Pn||qn),string:new Vn}},Zn.prototype.delete=function(e){var t=uo(this,e).delete(e);return this.size-=t?1:0,t},Zn.prototype.get=function(e){return uo(this,e).get(e)},Zn.prototype.has=function(e){return uo(this,e).has(e)},Zn.prototype.set=function(e,t){var n=uo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Yn.prototype.add=Yn.prototype.push=function(e){return this.__data__.set(e,n),this},Yn.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.clear=function(){this.__data__=new qn,this.size=0},$n.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},$n.prototype.get=function(e){return this.__data__.get(e)},$n.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.set=function(e,t){var n=this.__data__;if(n instanceof qn){var r=n.__data__;if(!Pn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Zn(r)}return n.set(e,t),this.size=n.size,this};var dr=Di(br),pr=Di(_r,!0);function fr(e,t){var n=!0;return dr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function gr(t,n,r){for(var i=-1,o=t.length;++i<o;){var a=t[i],s=n(a);if(null!=s&&(l===e?s==s&&!ls(s):r(s,l)))var l=s,u=a}return u}function mr(e,t){var n=[];return dr(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function vr(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=yo),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?vr(s,t-1,n,r,i):Dt(i,s):r||(i[i.length]=s)}return i}var yr=Fi(),wr=Fi(!0);function br(e,t){return e&&yr(e,t,Rs)}function _r(e,t){return e&&wr(e,t,Rs)}function xr(e,t){return kt(t,function(t){return Xa(e[t])})}function Sr(t,n){for(var r=0,i=(n=wi(n,t)).length;null!=t&&r<i;)t=t[jo(n[r++])];return r&&r==i?t:e}function Ar(e,t,n){var r=t(e);return Wa(e)?r:Dt(r,n(e))}function Pr(t){return null==t?t===e?"[object Undefined]":"[object Null]":tt&&tt in Me(t)?function(t){var n=Ne.call(t,tt),r=t[tt];try{t[tt]=e;var i=!0}catch(e){}var o=Ie.call(t);return i&&(n?t[tt]=r:delete t[tt]),o}(t):function(e){return Ie.call(e)}(t)}function Mr(e,t){return e>t}function Cr(e,t){return null!=e&&Ne.call(e,t)}function Tr(e,t){return null!=e&&t in Me(e)}function kr(t,n,r){for(var i=r?Rt:Et,o=t[0].length,a=t.length,s=a,l=_e(a),u=1/0,c=[];s--;){var h=t[s];s&&n&&(h=Lt(h,Kt(n))),u=wn(h.length,u),l[s]=!r&&(n||o>=120&&h.length>=120)?new Yn(s&&h):e}h=t[0];var d=-1,p=l[0];e:for(;++d<o&&c.length<u;){var f=h[d],g=n?n(f):f;if(f=r||0!==f?f:0,!(p?Jt(p,g):i(c,g,r))){for(s=a;--s;){var m=l[s];if(!(m?Jt(m,g):i(t[s],g,r)))continue e}p&&p.push(g),c.push(f)}}return c}function Er(t,n,r){var i=null==(t=To(t,n=wi(n,t)))?t:t[jo(Ko(n))];return null==i?e:At(i,t,r)}function Rr(e){return ts(e)&&Pr(e)==f}function Lr(t,n,r,i,o){return t===n||(null==t||null==n||!ts(t)&&!ts(n)?t!=t&&n!=n:function(t,n,r,i,o,a){var s=Wa(t),l=Wa(n),u=s?g:go(t),c=l?g:go(n),h=(u=u==f?S:u)==S,d=(c=c==f?S:c)==S,p=u==c;if(p&&Ya(t)){if(!Ya(n))return!1;s=!0,h=!1}if(p&&!h)return a||(a=new $n),s||us(t)?to(t,n,r,i,o,a):function(e,t,n,r,i,o,a){switch(n){case R:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case E:return!(e.byteLength!=t.byteLength||!o(new We(e),new We(t)));case m:case v:case x:return Ba(+e,+t);case y:return e.name==t.name&&e.message==t.message;case P:case C:return e==t+"";case _:var s=an;case M:var l=1&r;if(s||(s=un),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var c=to(s(e),s(t),r,i,o,a);return a.delete(e),c;case T:if(In)return In.call(e)==In.call(t)}return!1}(t,n,u,r,i,o,a);if(!(1&r)){var w=h&&Ne.call(t,"__wrapped__"),b=d&&Ne.call(n,"__wrapped__");if(w||b){var A=w?t.value():t,k=b?n.value():n;return a||(a=new $n),o(A,k,r,i,a)}}return!!p&&(a||(a=new $n),function(t,n,r,i,o,a){var s=1&r,l=ro(t),u=l.length,c=ro(n),h=c.length;if(u!=h&&!s)return!1;for(var d=u;d--;){var p=l[d];if(!(s?p in n:Ne.call(n,p)))return!1}var f=a.get(t),g=a.get(n);if(f&&g)return f==n&&g==t;var m=!0;a.set(t,n),a.set(n,t);for(var v=s;++d<u;){var y=t[p=l[d]],w=n[p];if(i)var b=s?i(w,y,p,n,t,a):i(y,w,p,t,n,a);if(!(b===e?y===w||o(y,w,r,i,a):b)){m=!1;break}v||(v="constructor"==p)}if(m&&!v){var _=t.constructor,x=n.constructor;_==x||!("constructor"in t)||!("constructor"in n)||"function"==typeof _&&_ instanceof _&&"function"==typeof x&&x instanceof x||(m=!1)}return a.delete(t),a.delete(n),m}(t,n,r,i,o,a))}(t,n,r,i,Lr,o))}function Dr(t,n,r,i){var o=r.length,a=o,s=!i;if(null==t)return!a;for(t=Me(t);o--;){var l=r[o];if(s&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++o<a;){var u=(l=r[o])[0],c=t[u],h=l[1];if(s&&l[2]){if(c===e&&!(u in t))return!1}else{var d=new $n;if(i)var p=i(c,h,u,t,n,d);if(!(p===e?Lr(h,c,3,i,d):p))return!1}}return!0}function Fr(e){return!(!es(e)||(t=e,je&&je in t))&&(Xa(e)?Ue:fe).test(Io(e));var t}function Nr(e){return"function"==typeof e?e:null==e?rl:"object"==typeof e?Wa(e)?Ur(e[0],e[1]):Br(e):dl(e)}function Or(e){if(!Ao(e))return vn(e);var t=[];for(var n in Me(e))Ne.call(e,n)&&"constructor"!=n&&t.push(n);return t}function jr(e){if(!es(e))return function(e){var t=[];if(null!=e)for(var n in Me(e))t.push(n);return t}(e);var t=Ao(e),n=[];for(var r in e)("constructor"!=r||!t&&Ne.call(e,r))&&n.push(r);return n}function Ir(e,t){return e<t}function zr(e,t){var n=-1,r=qa(e)?_e(e.length):[];return dr(e,function(e,i,o){r[++n]=t(e,i,o)}),r}function Br(e){var t=co(e);return 1==t.length&&t[0][2]?Mo(t[0][0],t[0][1]):function(n){return n===e||Dr(n,e,t)}}function Ur(t,n){return _o(t)&&Po(n)?Mo(jo(t),n):function(r){var i=Ms(r,t);return i===e&&i===n?Cs(r,t):Lr(n,i,3)}}function Hr(t,n,r,i,o){t!==n&&yr(n,function(a,s){if(o||(o=new $n),es(a))!function(t,n,r,i,o,a,s){var l=ko(t,r),u=ko(n,r),c=s.get(u);if(c)er(t,r,c);else{var h=a?a(l,u,r+"",t,n,s):e,d=h===e;if(d){var p=Wa(u),f=!p&&Ya(u),g=!p&&!f&&us(u);h=u,p||f||g?Wa(l)?h=l:Za(l)?h=ki(l):f?(d=!1,h=Si(u,!0)):g?(d=!1,h=Pi(u,!0)):h=[]:is(u)||Ga(u)?(h=l,Ga(l)?h=vs(l):es(l)&&!Xa(l)||(h=vo(u))):d=!1}d&&(s.set(u,h),o(h,u,i,a,s),s.delete(u)),er(t,r,h)}}(t,n,s,r,Hr,i,o);else{var l=i?i(ko(t,s),a,s+"",t,n,o):e;l===e&&(l=a),er(t,s,l)}},Ls)}function Gr(t,n){var r=t.length;if(r)return wo(n+=n<0?r:0,r)?t[n]:e}function Wr(e,t,n){t=t.length?Lt(t,function(e){return Wa(e)?function(t){return Sr(t,1===e.length?e[0]:e)}:e}):[rl];var r=-1;t=Lt(t,Kt(lo()));var i=zr(e,function(e,n,i){var o=Lt(t,function(t){return t(e)});return{criteria:o,index:++r,value:e}});return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(i,function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;++r<a;){var l=Mi(i[r],o[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)})}function Vr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=Sr(e,a);n(s,a)&&Qr(o,wi(a,e),s)}return o}function qr(e,t,n,r){var i=r?Ut:Bt,o=-1,a=t.length,s=e;for(e===t&&(t=ki(t)),n&&(s=Lt(e,Kt(n)));++o<a;)for(var l=0,u=t[o],c=n?n(u):u;(l=i(s,c,l,r))>-1;)s!==e&&$e.call(s,l,1),$e.call(e,l,1);return e}function Zr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;wo(i)?$e.call(e,i,1):hi(e,i)}}return e}function Yr(e,t){return e+mt(xn()*(t-e+1))}function $r(e,t){var n="";if(!e||t<1||t>c)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Kr(e,t){return Lo(Co(e,t,rl),e+"")}function Xr(e){return Xn(Bs(e))}function Jr(e,t){var n=Bs(e);return No(n,sr(t,0,n.length))}function Qr(t,n,r,i){if(!es(t))return t;for(var o=-1,a=(n=wi(n,t)).length,s=a-1,l=t;null!=l&&++o<a;){var u=jo(n[o]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=s){var h=l[u];(c=i?i(h,u,l):e)===e&&(c=es(h)?h:wo(n[o+1])?[]:{})}tr(l,u,c),l=l[u]}return t}var ei=En?function(e,t){return En.set(e,t),e}:rl,ti=st?function(e,t){return st(e,"toString",{configurable:!0,enumerable:!1,value:el(t),writable:!0})}:rl;function ni(e){return No(Bs(e))}function ri(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=_e(i);++r<i;)o[r]=e[r+t];return o}function ii(e,t){var n;return dr(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function oi(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!ls(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return ai(e,t,rl,n)}function ai(t,n,r,i){var o=0,a=null==t?0:t.length;if(0===a)return 0;for(var s=(n=r(n))!=n,l=null===n,u=ls(n),c=n===e;o<a;){var h=mt((o+a)/2),d=r(t[h]),p=d!==e,f=null===d,g=d==d,m=ls(d);if(s)var v=i||g;else v=c?g&&(i||p):l?g&&p&&(i||!f):u?g&&p&&!f&&(i||!m):!f&&!m&&(i?d<=n:d<n);v?o=h+1:a=h}return wn(a,4294967294)}function si(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!Ba(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function li(e){return"number"==typeof e?e:ls(e)?h:+e}function ui(e){if("string"==typeof e)return e;if(Wa(e))return Lt(e,ui)+"";if(ls(e))return zn?zn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ci(e,t,n){var r=-1,i=Et,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=Rt;else if(o>=200){var u=t?null:$i(e);if(u)return un(u);a=!1,i=Jt,l=new Yn}else l=t?[]:s;e:for(;++r<o;){var c=e[r],h=t?t(c):c;if(c=n||0!==c?c:0,a&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),s.push(c)}else i(l,h,n)||(l!==s&&l.push(h),s.push(c))}return s}function hi(e,t){return null==(e=To(e,t=wi(t,e)))||delete e[jo(Ko(t))]}function di(e,t,n,r){return Qr(e,t,n(Sr(e,t)),r)}function pi(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?ri(e,r?0:o,r?o+1:i):ri(e,r?o+1:0,r?i:o)}function fi(e,t){var n=e;return n instanceof Wn&&(n=n.value()),Ft(t,function(e,t){return t.func.apply(t.thisArg,Dt([e],t.args))},n)}function gi(e,t,n){var r=e.length;if(r<2)return r?ci(e[0]):[];for(var i=-1,o=_e(r);++i<r;)for(var a=e[i],s=-1;++s<r;)s!=i&&(o[i]=hr(o[i]||a,e[s],t,n));return ci(vr(o,1),t,n)}function mi(t,n,r){for(var i=-1,o=t.length,a=n.length,s={};++i<o;){var l=i<a?n[i]:e;r(s,t[i],l)}return s}function vi(e){return Za(e)?e:[]}function yi(e){return"function"==typeof e?e:rl}function wi(e,t){return Wa(e)?e:_o(e,t)?[e]:Oo(ys(e))}var bi=Kr;function _i(t,n,r){var i=t.length;return r=r===e?i:r,!n&&r>=i?t:ri(t,n,r)}var xi=ct||function(e){return dt.clearTimeout(e)};function Si(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function Ai(e){var t=new e.constructor(e.byteLength);return new We(t).set(new We(e)),t}function Pi(e,t){var n=t?Ai(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Mi(t,n){if(t!==n){var r=t!==e,i=null===t,o=t==t,a=ls(t),s=n!==e,l=null===n,u=n==n,c=ls(n);if(!l&&!c&&!a&&t>n||a&&s&&u&&!l&&!c||i&&s&&u||!r&&u||!o)return 1;if(!i&&!a&&!c&&t<n||c&&r&&o&&!i&&!a||l&&r&&o||!s&&o||!u)return-1}return 0}function Ci(e,t,n,r){for(var i=-1,o=e.length,a=n.length,s=-1,l=t.length,u=yn(o-a,0),c=_e(l+u),h=!r;++s<l;)c[s]=t[s];for(;++i<a;)(h||i<o)&&(c[n[i]]=e[i]);for(;u--;)c[s++]=e[i++];return c}function Ti(e,t,n,r){for(var i=-1,o=e.length,a=-1,s=n.length,l=-1,u=t.length,c=yn(o-s,0),h=_e(c+u),d=!r;++i<c;)h[i]=e[i];for(var p=i;++l<u;)h[p+l]=t[l];for(;++a<s;)(d||i<o)&&(h[p+n[a]]=e[i++]);return h}function ki(e,t){var n=-1,r=e.length;for(t||(t=_e(r));++n<r;)t[n]=e[n];return t}function Ei(t,n,r,i){var o=!r;r||(r={});for(var a=-1,s=n.length;++a<s;){var l=n[a],u=i?i(r[l],t[l],l,r,t):e;u===e&&(u=t[l]),o?or(r,l,u):tr(r,l,u)}return r}function Ri(e,t){return function(n,r){var i=Wa(n)?Pt:rr,o=t?t():{};return i(n,e,lo(r,2),o)}}function Li(t){return Kr(function(n,r){var i=-1,o=r.length,a=o>1?r[o-1]:e,s=o>2?r[2]:e;for(a=t.length>3&&"function"==typeof a?(o--,a):e,s&&bo(r[0],r[1],s)&&(a=o<3?e:a,o=1),n=Me(n);++i<o;){var l=r[i];l&&t(n,l,i,a)}return n})}function Di(e,t){return function(n,r){if(null==n)return n;if(!qa(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Me(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Fi(e){return function(t,n,r){for(var i=-1,o=Me(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}function Ni(t){return function(n){var r=on(n=ys(n))?dn(n):e,i=r?r[0]:n.charAt(0),o=r?_i(r,1).join(""):n.slice(1);return i[t]()+o}}function Oi(e){return function(t){return Ft(Xs(Gs(t).replace(Xe,"")),e,"")}}function ji(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Un(e.prototype),r=e.apply(n,t);return es(r)?r:n}}function Ii(t){return function(n,r,i){var o=Me(n);if(!qa(n)){var a=lo(r,3);n=Rs(n),r=function(e){return a(o[e],e,o)}}var s=t(n,r,i);return s>-1?o[a?n[s]:s]:e}}function zi(n){return no(function(r){var i=r.length,o=i,a=Gn.prototype.thru;for(n&&r.reverse();o--;){var s=r[o];if("function"!=typeof s)throw new ke(t);if(a&&!l&&"wrapper"==ao(s))var l=new Gn([],!0)}for(o=l?o:i;++o<i;){var u=ao(s=r[o]),c="wrapper"==u?oo(s):e;l=c&&xo(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[ao(c[0])].apply(l,c[3]):1==s.length&&xo(s)?l[u]():l.thru(s)}return function(){var e=arguments,t=e[0];if(l&&1==e.length&&Wa(t))return l.plant(t).value();for(var n=0,o=i?r[n].apply(this,e):t;++n<i;)o=r[n].call(this,o);return o}})}function Bi(t,n,r,i,o,a,l,u,c,h){var d=n&s,p=1&n,f=2&n,g=24&n,m=512&n,v=f?e:ji(t);return function s(){for(var y=arguments.length,w=_e(y),b=y;b--;)w[b]=arguments[b];if(g)var _=so(s),x=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(w,_);if(i&&(w=Ci(w,i,o,g)),a&&(w=Ti(w,a,l,g)),y-=x,g&&y<h){var S=ln(w,_);return Zi(t,n,Bi,s.placeholder,r,w,S,u,c,h-y)}var A=p?r:this,P=f?A[t]:t;return y=w.length,u?w=function(t,n){for(var r=t.length,i=wn(n.length,r),o=ki(t);i--;){var a=n[i];t[i]=wo(a,r)?o[a]:e}return t}(w,u):m&&y>1&&w.reverse(),d&&c<y&&(w.length=c),this&&this!==dt&&this instanceof s&&(P=v||ji(P)),P.apply(A,w)}}function Ui(e,t){return function(n,r){return function(e,t,n,r){return br(e,function(e,i,o){t(r,n(e),i,o)}),r}(n,e,t(r),{})}}function Hi(t,n){return function(r,i){var o;if(r===e&&i===e)return n;if(r!==e&&(o=r),i!==e){if(o===e)return i;"string"==typeof r||"string"==typeof i?(r=ui(r),i=ui(i)):(r=li(r),i=li(i)),o=t(r,i)}return o}}function Gi(e){return no(function(t){return t=Lt(t,Kt(lo())),Kr(function(n){var r=this;return e(t,function(e){return At(e,r,n)})})})}function Wi(t,n){var r=(n=n===e?" ":ui(n)).length;if(r<2)return r?$r(n,t):n;var i=$r(n,ft(t/hn(n)));return on(n)?_i(dn(i),0,t).join(""):i.slice(0,t)}function Vi(t){return function(n,r,i){return i&&"number"!=typeof i&&bo(n,r,i)&&(r=i=e),n=ps(n),r===e?(r=n,n=0):r=ps(r),function(e,t,n,r){for(var i=-1,o=yn(ft((t-e)/(n||1)),0),a=_e(o);o--;)a[r?o:++i]=e,e+=n;return a}(n,r,i=i===e?n<r?1:-1:ps(i),t)}}function qi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ms(t),n=ms(n)),e(t,n)}}function Zi(t,n,r,i,s,l,u,c,h,d){var p=8&n;n|=p?o:a,4&(n&=~(p?a:o))||(n&=-4);var f=[t,n,s,p?l:e,p?u:e,p?e:l,p?e:u,c,h,d],g=r.apply(e,f);return xo(t)&&Eo(g,f),g.placeholder=i,Do(g,t,n)}function Yi(e){var t=Pe[e];return function(e,n){if(e=ms(e),(n=null==n?0:wn(fs(n),292))&&Vt(e)){var r=(ys(e)+"e").split("e");return+((r=(ys(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var $i=Cn&&1/un(new Cn([,-0]))[1]==u?function(e){return new Cn(e)}:ll;function Ki(e){return function(t){var n=go(t);return n==_?an(t):n==M?cn(t):function(e,t){return Lt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Xi(n,u,c,h,d,p,f,g){var m=2&u;if(!m&&"function"!=typeof n)throw new ke(t);var v=h?h.length:0;if(v||(u&=-97,h=d=e),f=f===e?f:yn(fs(f),0),g=g===e?g:fs(g),v-=d?d.length:0,u&a){var y=h,w=d;h=d=e}var b=m?e:oo(n),_=[n,u,c,h,d,y,w,p,f,g];if(b&&function(e,t){var n=e[1],i=t[1],o=n|i,a=o<131,u=i==s&&8==n||i==s&&n==l&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n;if(!a&&!u)return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var c=t[3];if(c){var h=e[3];e[3]=h?Ci(h,c,t[4]):c,e[4]=h?ln(e[3],r):t[4]}(c=t[5])&&(h=e[5],e[5]=h?Ti(h,c,t[6]):c,e[6]=h?ln(e[5],r):t[6]),(c=t[7])&&(e[7]=c),i&s&&(e[8]=null==e[8]?t[8]:wn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(_,b),n=_[0],u=_[1],c=_[2],h=_[3],d=_[4],!(g=_[9]=_[9]===e?m?0:n.length:yn(_[9]-v,0))&&24&u&&(u&=-25),u&&1!=u)x=8==u||u==i?function(t,n,r){var i=ji(t);return function o(){for(var a=arguments.length,s=_e(a),l=a,u=so(o);l--;)s[l]=arguments[l];var c=a<3&&s[0]!==u&&s[a-1]!==u?[]:ln(s,u);return(a-=c.length)<r?Zi(t,n,Bi,o.placeholder,e,s,c,e,e,r-a):At(this&&this!==dt&&this instanceof o?i:t,this,s)}}(n,u,g):u!=o&&33!=u||d.length?Bi.apply(e,_):function(e,t,n,r){var i=1&t,o=ji(e);return function t(){for(var a=-1,s=arguments.length,l=-1,u=r.length,c=_e(u+s),h=this&&this!==dt&&this instanceof t?o:e;++l<u;)c[l]=r[l];for(;s--;)c[l++]=arguments[++a];return At(h,i?n:this,c)}}(n,u,c,h);else var x=function(e,t,n){var r=1&t,i=ji(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(n,u,c);return Do((b?ei:Eo)(x,_),n,u)}function Ji(t,n,r,i){return t===e||Ba(t,Le[r])&&!Ne.call(i,r)?n:t}function Qi(t,n,r,i,o,a){return es(t)&&es(n)&&(a.set(n,t),Hr(t,n,e,Qi,a),a.delete(n)),t}function eo(t){return is(t)?e:t}function to(t,n,r,i,o,a){var s=1&r,l=t.length,u=n.length;if(l!=u&&!(s&&u>l))return!1;var c=a.get(t),h=a.get(n);if(c&&h)return c==n&&h==t;var d=-1,p=!0,f=2&r?new Yn:e;for(a.set(t,n),a.set(n,t);++d<l;){var g=t[d],m=n[d];if(i)var v=s?i(m,g,d,n,t,a):i(g,m,d,t,n,a);if(v!==e){if(v)continue;p=!1;break}if(f){if(!Ot(n,function(e,t){if(!Jt(f,t)&&(g===e||o(g,e,r,i,a)))return f.push(t)})){p=!1;break}}else if(g!==m&&!o(g,m,r,i,a)){p=!1;break}}return a.delete(t),a.delete(n),p}function no(t){return Lo(Co(t,e,Vo),t+"")}function ro(e){return Ar(e,Rs,po)}function io(e){return Ar(e,Ls,fo)}var oo=En?function(e){return En.get(e)}:ll;function ao(e){for(var t=e.name+"",n=Rn[t],r=Ne.call(Rn,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function so(e){return(Ne.call(Bn,"placeholder")?Bn:e).placeholder}function lo(){var e=Bn.iteratee||il;return e=e===il?Nr:e,arguments.length?e(arguments[0],arguments[1]):e}function uo(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function co(e){for(var t=Rs(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Po(i)]}return t}function ho(t,n){var r=function(t,n){return null==t?e:t[n]}(t,n);return Fr(r)?r:e}var po=vt?function(e){return null==e?[]:(e=Me(e),kt(vt(e),function(t){return Ye.call(e,t)}))}:gl,fo=vt?function(e){for(var t=[];e;)Dt(t,po(e)),e=qe(e);return t}:gl,go=Pr;function mo(e,t,n){for(var r=-1,i=(t=wi(t,e)).length,o=!1;++r<i;){var a=jo(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Qa(i)&&wo(a,i)&&(Wa(e)||Ga(e))}function vo(e){return"function"!=typeof e.constructor||Ao(e)?{}:Un(qe(e))}function yo(e){return Wa(e)||Ga(e)||!!(Ke&&e&&e[Ke])}function wo(e,t){var n=typeof e;return!!(t=null==t?c:t)&&("number"==n||"symbol"!=n&&me.test(e))&&e>-1&&e%1==0&&e<t}function bo(e,t,n){if(!es(n))return!1;var r=typeof t;return!!("number"==r?qa(n)&&wo(t,n.length):"string"==r&&t in n)&&Ba(n[t],e)}function _o(e,t){if(Wa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ls(e))||J.test(e)||!X.test(e)||null!=t&&e in Me(t)}function xo(e){var t=ao(e),n=Bn[t];if("function"!=typeof n||!(t in Wn.prototype))return!1;if(e===n)return!0;var r=oo(n);return!!r&&e===r[0]}(An&&go(new An(new ArrayBuffer(1)))!=R||Pn&&go(new Pn)!=_||Mn&&go(Mn.resolve())!=A||Cn&&go(new Cn)!=M||Tn&&go(new Tn)!=k)&&(go=function(t){var n=Pr(t),r=n==S?t.constructor:e,i=r?Io(r):"";if(i)switch(i){case Ln:return R;case Dn:return _;case Fn:return A;case Nn:return M;case On:return k}return n});var So=De?Xa:ml;function Ao(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Le)}function Po(e){return e==e&&!es(e)}function Mo(t,n){return function(r){return null!=r&&r[t]===n&&(n!==e||t in Me(r))}}function Co(t,n,r){return n=yn(n===e?t.length-1:n,0),function(){for(var e=arguments,i=-1,o=yn(e.length-n,0),a=_e(o);++i<o;)a[i]=e[n+i];i=-1;for(var s=_e(n+1);++i<n;)s[i]=e[i];return s[n]=r(a),At(t,this,s)}}function To(e,t){return t.length<2?e:Sr(e,ri(t,0,-1))}function ko(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Eo=Fo(ei),Ro=pt||function(e,t){return dt.setTimeout(e,t)},Lo=Fo(ti);function Do(e,t,n){var r=t+"";return Lo(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ie,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Mt(p,function(n){var r="_."+n[0];t&n[1]&&!Et(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(ae):[]}(r),n)))}function Fo(t){var n=0,r=0;return function(){var i=bn(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(e,arguments)}}function No(t,n){var r=-1,i=t.length,o=i-1;for(n=n===e?i:n;++r<n;){var a=Yr(r,o),s=t[a];t[a]=t[r],t[r]=s}return t.length=n,t}var Oo=function(e){var t=Fa(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Q,function(e,n,r,i){t.push(r?i.replace(ue,"$1"):n||e)}),t});function jo(e){if("string"==typeof e||ls(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Io(e){if(null!=e){try{return Fe.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function zo(e){if(e instanceof Wn)return e.clone();var t=new Gn(e.__wrapped__,e.__chain__);return t.__actions__=ki(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Bo=Kr(function(e,t){return Za(e)?hr(e,vr(t,1,Za,!0)):[]}),Uo=Kr(function(t,n){var r=Ko(n);return Za(r)&&(r=e),Za(t)?hr(t,vr(n,1,Za,!0),lo(r,2)):[]}),Ho=Kr(function(t,n){var r=Ko(n);return Za(r)&&(r=e),Za(t)?hr(t,vr(n,1,Za,!0),e,r):[]});function Go(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:fs(n);return i<0&&(i=yn(r+i,0)),zt(e,lo(t,3),i)}function Wo(t,n,r){var i=null==t?0:t.length;if(!i)return-1;var o=i-1;return r!==e&&(o=fs(r),o=r<0?yn(i+o,0):wn(o,i-1)),zt(t,lo(n,3),o,!0)}function Vo(e){return null!=e&&e.length?vr(e,1):[]}function qo(t){return t&&t.length?t[0]:e}var Zo=Kr(function(e){var t=Lt(e,vi);return t.length&&t[0]===e[0]?kr(t):[]}),Yo=Kr(function(t){var n=Ko(t),r=Lt(t,vi);return n===Ko(r)?n=e:r.pop(),r.length&&r[0]===t[0]?kr(r,lo(n,2)):[]}),$o=Kr(function(t){var n=Ko(t),r=Lt(t,vi);return(n="function"==typeof n?n:e)&&r.pop(),r.length&&r[0]===t[0]?kr(r,e,n):[]});function Ko(t){var n=null==t?0:t.length;return n?t[n-1]:e}var Xo=Kr(Jo);function Jo(e,t){return e&&e.length&&t&&t.length?qr(e,t):e}var Qo=no(function(e,t){var n=null==e?0:e.length,r=ar(e,t);return Zr(e,Lt(t,function(e){return wo(e,n)?+e:e}).sort(Mi)),r});function ea(e){return null==e?e:Sn.call(e)}var ta=Kr(function(e){return ci(vr(e,1,Za,!0))}),na=Kr(function(t){var n=Ko(t);return Za(n)&&(n=e),ci(vr(t,1,Za,!0),lo(n,2))}),ra=Kr(function(t){var n=Ko(t);return n="function"==typeof n?n:e,ci(vr(t,1,Za,!0),e,n)});function ia(e){if(!e||!e.length)return[];var t=0;return e=kt(e,function(e){if(Za(e))return t=yn(e.length,t),!0}),Yt(t,function(t){return Lt(e,Wt(t))})}function oa(t,n){if(!t||!t.length)return[];var r=ia(t);return null==n?r:Lt(r,function(t){return At(n,e,t)})}var aa=Kr(function(e,t){return Za(e)?hr(e,t):[]}),sa=Kr(function(e){return gi(kt(e,Za))}),la=Kr(function(t){var n=Ko(t);return Za(n)&&(n=e),gi(kt(t,Za),lo(n,2))}),ua=Kr(function(t){var n=Ko(t);return n="function"==typeof n?n:e,gi(kt(t,Za),e,n)}),ca=Kr(ia),ha=Kr(function(t){var n=t.length,r=n>1?t[n-1]:e;return r="function"==typeof r?(t.pop(),r):e,oa(t,r)});function da(e){var t=Bn(e);return t.__chain__=!0,t}function pa(e,t){return t(e)}var fa=no(function(t){var n=t.length,r=n?t[0]:0,i=this.__wrapped__,o=function(e){return ar(e,t)};return!(n>1||this.__actions__.length)&&i instanceof Wn&&wo(r)?((i=i.slice(r,+r+(n?1:0))).__actions__.push({func:pa,args:[o],thisArg:e}),new Gn(i,this.__chain__).thru(function(t){return n&&!t.length&&t.push(e),t})):this.thru(o)}),ga=Ri(function(e,t,n){Ne.call(e,n)?++e[n]:or(e,n,1)}),ma=Ii(Go),va=Ii(Wo);function ya(e,t){return(Wa(e)?Mt:dr)(e,lo(t,3))}function wa(e,t){return(Wa(e)?Ct:pr)(e,lo(t,3))}var ba=Ri(function(e,t,n){Ne.call(e,n)?e[n].push(t):or(e,n,[t])}),_a=Kr(function(e,t,n){var r=-1,i="function"==typeof t,o=qa(e)?_e(e.length):[];return dr(e,function(e){o[++r]=i?At(t,e,n):Er(e,t,n)}),o}),xa=Ri(function(e,t,n){or(e,n,t)});function Sa(e,t){return(Wa(e)?Lt:zr)(e,lo(t,3))}var Aa=Ri(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),Pa=Kr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&bo(e,t[0],t[1])?t=[]:n>2&&bo(t[0],t[1],t[2])&&(t=[t[0]]),Wr(e,vr(t,1),[])}),Ma=ht||function(){return dt.Date.now()};function Ca(t,n,r){return n=r?e:n,n=t&&null==n?t.length:n,Xi(t,s,e,e,e,e,n)}function Ta(n,r){var i;if("function"!=typeof r)throw new ke(t);return n=fs(n),function(){return--n>0&&(i=r.apply(this,arguments)),n<=1&&(r=e),i}}var ka=Kr(function(e,t,n){var r=1;if(n.length){var i=ln(n,so(ka));r|=o}return Xi(e,r,t,n,i)}),Ea=Kr(function(e,t,n){var r=3;if(n.length){var i=ln(n,so(Ea));r|=o}return Xi(t,r,e,n,i)});function Ra(n,r,i){var o,a,s,l,u,c,h=0,d=!1,p=!1,f=!0;if("function"!=typeof n)throw new ke(t);function g(t){var r=o,i=a;return o=a=e,h=t,l=n.apply(i,r)}function m(t){var n=t-c;return c===e||n>=r||n<0||p&&t-h>=s}function v(){var e=Ma();if(m(e))return y(e);u=Ro(v,function(e){var t=r-(e-c);return p?wn(t,s-(e-h)):t}(e))}function y(t){return u=e,f&&o?g(t):(o=a=e,l)}function w(){var t=Ma(),n=m(t);if(o=arguments,a=this,c=t,n){if(u===e)return function(e){return h=e,u=Ro(v,r),d?g(e):l}(c);if(p)return xi(u),u=Ro(v,r),g(c)}return u===e&&(u=Ro(v,r)),l}return r=ms(r)||0,es(i)&&(d=!!i.leading,s=(p="maxWait"in i)?yn(ms(i.maxWait)||0,r):s,f="trailing"in i?!!i.trailing:f),w.cancel=function(){u!==e&&xi(u),h=0,o=c=a=u=e},w.flush=function(){return u===e?l:y(Ma())},w}var La=Kr(function(e,t){return cr(e,1,t)}),Da=Kr(function(e,t,n){return cr(e,ms(t)||0,n)});function Fa(e,n){if("function"!=typeof e||null!=n&&"function"!=typeof n)throw new ke(t);var r=function(){var t=arguments,i=n?n.apply(this,t):t[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,t);return r.cache=o.set(i,a)||o,a};return r.cache=new(Fa.Cache||Zn),r}function Na(e){if("function"!=typeof e)throw new ke(t);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Fa.Cache=Zn;var Oa=bi(function(e,t){var n=(t=1==t.length&&Wa(t[0])?Lt(t[0],Kt(lo())):Lt(vr(t,1),Kt(lo()))).length;return Kr(function(r){for(var i=-1,o=wn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return At(e,this,r)})}),ja=Kr(function(t,n){var r=ln(n,so(ja));return Xi(t,o,e,n,r)}),Ia=Kr(function(t,n){var r=ln(n,so(Ia));return Xi(t,a,e,n,r)}),za=no(function(t,n){return Xi(t,l,e,e,e,n)});function Ba(e,t){return e===t||e!=e&&t!=t}var Ua=qi(Mr),Ha=qi(function(e,t){return e>=t}),Ga=Rr(function(){return arguments}())?Rr:function(e){return ts(e)&&Ne.call(e,"callee")&&!Ye.call(e,"callee")},Wa=_e.isArray,Va=yt?Kt(yt):function(e){return ts(e)&&Pr(e)==E};function qa(e){return null!=e&&Qa(e.length)&&!Xa(e)}function Za(e){return ts(e)&&qa(e)}var Ya=jt||ml,$a=wt?Kt(wt):function(e){return ts(e)&&Pr(e)==v};function Ka(e){if(!ts(e))return!1;var t=Pr(e);return t==y||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!is(e)}function Xa(e){if(!es(e))return!1;var t=Pr(e);return t==w||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ja(e){return"number"==typeof e&&e==fs(e)}function Qa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=c}function es(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ts(e){return null!=e&&"object"==typeof e}var ns=bt?Kt(bt):function(e){return ts(e)&&go(e)==_};function rs(e){return"number"==typeof e||ts(e)&&Pr(e)==x}function is(e){if(!ts(e)||Pr(e)!=S)return!1;var t=qe(e);if(null===t)return!0;var n=Ne.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Fe.call(n)==ze}var os=_t?Kt(_t):function(e){return ts(e)&&Pr(e)==P},as=xt?Kt(xt):function(e){return ts(e)&&go(e)==M};function ss(e){return"string"==typeof e||!Wa(e)&&ts(e)&&Pr(e)==C}function ls(e){return"symbol"==typeof e||ts(e)&&Pr(e)==T}var us=St?Kt(St):function(e){return ts(e)&&Qa(e.length)&&!!ot[Pr(e)]},cs=qi(Ir),hs=qi(function(e,t){return e<=t});function ds(e){if(!e)return[];if(qa(e))return ss(e)?dn(e):ki(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=go(e);return(t==_?an:t==M?un:Bs)(e)}function ps(e){return e?(e=ms(e))===u||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fs(e){var t=ps(e),n=t%1;return t==t?n?t-n:t:0}function gs(e){return e?sr(fs(e),0,d):0}function ms(e){if("number"==typeof e)return e;if(ls(e))return h;if(es(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=es(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=$t(e);var n=pe.test(e);return n||ge.test(e)?ut(e.slice(2),n?2:8):de.test(e)?h:+e}function vs(e){return Ei(e,Ls(e))}function ys(e){return null==e?"":ui(e)}var ws=Li(function(e,t){if(Ao(t)||qa(t))Ei(t,Rs(t),e);else for(var n in t)Ne.call(t,n)&&tr(e,n,t[n])}),bs=Li(function(e,t){Ei(t,Ls(t),e)}),_s=Li(function(e,t,n,r){Ei(t,Ls(t),e,r)}),xs=Li(function(e,t,n,r){Ei(t,Rs(t),e,r)}),Ss=no(ar),As=Kr(function(t,n){t=Me(t);var r=-1,i=n.length,o=i>2?n[2]:e;for(o&&bo(n[0],n[1],o)&&(i=1);++r<i;)for(var a=n[r],s=Ls(a),l=-1,u=s.length;++l<u;){var c=s[l],h=t[c];(h===e||Ba(h,Le[c])&&!Ne.call(t,c))&&(t[c]=a[c])}return t}),Ps=Kr(function(t){return t.push(e,Qi),At(Fs,e,t)});function Ms(t,n,r){var i=null==t?e:Sr(t,n);return i===e?r:i}function Cs(e,t){return null!=e&&mo(e,t,Tr)}var Ts=Ui(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ie.call(t)),e[t]=n},el(rl)),ks=Ui(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ie.call(t)),Ne.call(e,t)?e[t].push(n):e[t]=[n]},lo),Es=Kr(Er);function Rs(e){return qa(e)?Kn(e):Or(e)}function Ls(e){return qa(e)?Kn(e,!0):jr(e)}var Ds=Li(function(e,t,n){Hr(e,t,n)}),Fs=Li(function(e,t,n,r){Hr(e,t,n,r)}),Ns=no(function(e,t){var n={};if(null==e)return n;var r=!1;t=Lt(t,function(t){return t=wi(t,e),r||(r=t.length>1),t}),Ei(e,io(e),n),r&&(n=lr(n,7,eo));for(var i=t.length;i--;)hi(n,t[i]);return n}),Os=no(function(e,t){return null==e?{}:function(e,t){return Vr(e,t,function(t,n){return Cs(e,n)})}(e,t)});function js(e,t){if(null==e)return{};var n=Lt(io(e),function(e){return[e]});return t=lo(t),Vr(e,n,function(e,n){return t(e,n[0])})}var Is=Ki(Rs),zs=Ki(Ls);function Bs(e){return null==e?[]:Xt(e,Rs(e))}var Us=Oi(function(e,t,n){return t=t.toLowerCase(),e+(n?Hs(t):t)});function Hs(e){return Ks(ys(e).toLowerCase())}function Gs(e){return(e=ys(e))&&e.replace(ve,tn).replace(Je,"")}var Ws=Oi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Vs=Oi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),qs=Ni("toLowerCase"),Zs=Oi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ys=Oi(function(e,t,n){return e+(n?" ":"")+Ks(t)}),$s=Oi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ks=Ni("toUpperCase");function Xs(t,n,r){return t=ys(t),(n=r?e:n)===e?function(e){return nt.test(e)}(t)?function(e){return e.match(et)||[]}(t):function(e){return e.match(se)||[]}(t):t.match(n)||[]}var Js=Kr(function(t,n){try{return At(t,e,n)}catch(e){return Ka(e)?e:new Se(e)}}),Qs=no(function(e,t){return Mt(t,function(t){t=jo(t),or(e,t,ka(e[t],e))}),e});function el(e){return function(){return e}}var tl=zi(),nl=zi(!0);function rl(e){return e}function il(e){return Nr("function"==typeof e?e:lr(e,1))}var ol=Kr(function(e,t){return function(n){return Er(n,e,t)}}),al=Kr(function(e,t){return function(n){return Er(e,n,t)}});function sl(e,t,n){var r=Rs(t),i=xr(t,r);null!=n||es(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=xr(t,Rs(t)));var o=!(es(n)&&"chain"in n&&!n.chain),a=Xa(e);return Mt(i,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=ki(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Dt([this.value()],arguments))})}),e}function ll(){}var ul=Gi(Lt),cl=Gi(Tt),hl=Gi(Ot);function dl(e){return _o(e)?Wt(jo(e)):function(e){return function(t){return Sr(t,e)}}(e)}var pl=Vi(),fl=Vi(!0);function gl(){return[]}function ml(){return!1}var vl,yl=Hi(function(e,t){return e+t},0),wl=Yi("ceil"),bl=Hi(function(e,t){return e/t},1),_l=Yi("floor"),xl=Hi(function(e,t){return e*t},1),Sl=Yi("round"),Al=Hi(function(e,t){return e-t},0);return Bn.after=function(e,n){if("function"!=typeof n)throw new ke(t);return e=fs(e),function(){if(--e<1)return n.apply(this,arguments)}},Bn.ary=Ca,Bn.assign=ws,Bn.assignIn=bs,Bn.assignInWith=_s,Bn.assignWith=xs,Bn.at=Ss,Bn.before=Ta,Bn.bind=ka,Bn.bindAll=Qs,Bn.bindKey=Ea,Bn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Wa(e)?e:[e]},Bn.chain=da,Bn.chunk=function(t,n,r){n=(r?bo(t,n,r):n===e)?1:yn(fs(n),0);var i=null==t?0:t.length;if(!i||n<1)return[];for(var o=0,a=0,s=_e(ft(i/n));o<i;)s[a++]=ri(t,o,o+=n);return s},Bn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Bn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=_e(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Dt(Wa(n)?ki(n):[n],vr(t,1))},Bn.cond=function(e){var n=null==e?0:e.length,r=lo();return e=n?Lt(e,function(e){if("function"!=typeof e[1])throw new ke(t);return[r(e[0]),e[1]]}):[],Kr(function(t){for(var r=-1;++r<n;){var i=e[r];if(At(i[0],this,t))return At(i[1],this,t)}})},Bn.conforms=function(e){return function(e){var t=Rs(e);return function(n){return ur(n,e,t)}}(lr(e,1))},Bn.constant=el,Bn.countBy=ga,Bn.create=function(e,t){var n=Un(e);return null==t?n:ir(n,t)},Bn.curry=function t(n,r,i){var o=Xi(n,8,e,e,e,e,e,r=i?e:r);return o.placeholder=t.placeholder,o},Bn.curryRight=function t(n,r,o){var a=Xi(n,i,e,e,e,e,e,r=o?e:r);return a.placeholder=t.placeholder,a},Bn.debounce=Ra,Bn.defaults=As,Bn.defaultsDeep=Ps,Bn.defer=La,Bn.delay=Da,Bn.difference=Bo,Bn.differenceBy=Uo,Bn.differenceWith=Ho,Bn.drop=function(t,n,r){var i=null==t?0:t.length;return i?ri(t,(n=r||n===e?1:fs(n))<0?0:n,i):[]},Bn.dropRight=function(t,n,r){var i=null==t?0:t.length;return i?ri(t,0,(n=i-(n=r||n===e?1:fs(n)))<0?0:n):[]},Bn.dropRightWhile=function(e,t){return e&&e.length?pi(e,lo(t,3),!0,!0):[]},Bn.dropWhile=function(e,t){return e&&e.length?pi(e,lo(t,3),!0):[]},Bn.fill=function(t,n,r,i){var o=null==t?0:t.length;return o?(r&&"number"!=typeof r&&bo(t,n,r)&&(r=0,i=o),function(t,n,r,i){var o=t.length;for((r=fs(r))<0&&(r=-r>o?0:o+r),(i=i===e||i>o?o:fs(i))<0&&(i+=o),i=r>i?0:gs(i);r<i;)t[r++]=n;return t}(t,n,r,i)):[]},Bn.filter=function(e,t){return(Wa(e)?kt:mr)(e,lo(t,3))},Bn.flatMap=function(e,t){return vr(Sa(e,t),1)},Bn.flatMapDeep=function(e,t){return vr(Sa(e,t),u)},Bn.flatMapDepth=function(t,n,r){return r=r===e?1:fs(r),vr(Sa(t,n),r)},Bn.flatten=Vo,Bn.flattenDeep=function(e){return null!=e&&e.length?vr(e,u):[]},Bn.flattenDepth=function(t,n){return null!=t&&t.length?vr(t,n=n===e?1:fs(n)):[]},Bn.flip=function(e){return Xi(e,512)},Bn.flow=tl,Bn.flowRight=nl,Bn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Bn.functions=function(e){return null==e?[]:xr(e,Rs(e))},Bn.functionsIn=function(e){return null==e?[]:xr(e,Ls(e))},Bn.groupBy=ba,Bn.initial=function(e){return null!=e&&e.length?ri(e,0,-1):[]},Bn.intersection=Zo,Bn.intersectionBy=Yo,Bn.intersectionWith=$o,Bn.invert=Ts,Bn.invertBy=ks,Bn.invokeMap=_a,Bn.iteratee=il,Bn.keyBy=xa,Bn.keys=Rs,Bn.keysIn=Ls,Bn.map=Sa,Bn.mapKeys=function(e,t){var n={};return t=lo(t,3),br(e,function(e,r,i){or(n,t(e,r,i),e)}),n},Bn.mapValues=function(e,t){var n={};return t=lo(t,3),br(e,function(e,r,i){or(n,r,t(e,r,i))}),n},Bn.matches=function(e){return Br(lr(e,1))},Bn.matchesProperty=function(e,t){return Ur(e,lr(t,1))},Bn.memoize=Fa,Bn.merge=Ds,Bn.mergeWith=Fs,Bn.method=ol,Bn.methodOf=al,Bn.mixin=sl,Bn.negate=Na,Bn.nthArg=function(e){return e=fs(e),Kr(function(t){return Gr(t,e)})},Bn.omit=Ns,Bn.omitBy=function(e,t){return js(e,Na(lo(t)))},Bn.once=function(e){return Ta(2,e)},Bn.orderBy=function(t,n,r,i){return null==t?[]:(Wa(n)||(n=null==n?[]:[n]),Wa(r=i?e:r)||(r=null==r?[]:[r]),Wr(t,n,r))},Bn.over=ul,Bn.overArgs=Oa,Bn.overEvery=cl,Bn.overSome=hl,Bn.partial=ja,Bn.partialRight=Ia,Bn.partition=Aa,Bn.pick=Os,Bn.pickBy=js,Bn.property=dl,Bn.propertyOf=function(t){return function(n){return null==t?e:Sr(t,n)}},Bn.pull=Xo,Bn.pullAll=Jo,Bn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?qr(e,t,lo(n,2)):e},Bn.pullAllWith=function(t,n,r){return t&&t.length&&n&&n.length?qr(t,n,e,r):t},Bn.pullAt=Qo,Bn.range=pl,Bn.rangeRight=fl,Bn.rearg=za,Bn.reject=function(e,t){return(Wa(e)?kt:mr)(e,Na(lo(t,3)))},Bn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=lo(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return Zr(e,i),n},Bn.rest=function(n,r){if("function"!=typeof n)throw new ke(t);return Kr(n,r=r===e?r:fs(r))},Bn.reverse=ea,Bn.sampleSize=function(t,n,r){return n=(r?bo(t,n,r):n===e)?1:fs(n),(Wa(t)?Jn:Jr)(t,n)},Bn.set=function(e,t,n){return null==e?e:Qr(e,t,n)},Bn.setWith=function(t,n,r,i){return i="function"==typeof i?i:e,null==t?t:Qr(t,n,r,i)},Bn.shuffle=function(e){return(Wa(e)?Qn:ni)(e)},Bn.slice=function(t,n,r){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&bo(t,n,r)?(n=0,r=i):(n=null==n?0:fs(n),r=r===e?i:fs(r)),ri(t,n,r)):[]},Bn.sortBy=Pa,Bn.sortedUniq=function(e){return e&&e.length?si(e):[]},Bn.sortedUniqBy=function(e,t){return e&&e.length?si(e,lo(t,2)):[]},Bn.split=function(t,n,r){return r&&"number"!=typeof r&&bo(t,n,r)&&(n=r=e),(r=r===e?d:r>>>0)?(t=ys(t))&&("string"==typeof n||null!=n&&!os(n))&&!(n=ui(n))&&on(t)?_i(dn(t),0,r):t.split(n,r):[]},Bn.spread=function(e,n){if("function"!=typeof e)throw new ke(t);return n=null==n?0:yn(fs(n),0),Kr(function(t){var r=t[n],i=_i(t,0,n);return r&&Dt(i,r),At(e,this,i)})},Bn.tail=function(e){var t=null==e?0:e.length;return t?ri(e,1,t):[]},Bn.take=function(t,n,r){return t&&t.length?ri(t,0,(n=r||n===e?1:fs(n))<0?0:n):[]},Bn.takeRight=function(t,n,r){var i=null==t?0:t.length;return i?ri(t,(n=i-(n=r||n===e?1:fs(n)))<0?0:n,i):[]},Bn.takeRightWhile=function(e,t){return e&&e.length?pi(e,lo(t,3),!1,!0):[]},Bn.takeWhile=function(e,t){return e&&e.length?pi(e,lo(t,3)):[]},Bn.tap=function(e,t){return t(e),e},Bn.throttle=function(e,n,r){var i=!0,o=!0;if("function"!=typeof e)throw new ke(t);return es(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Ra(e,n,{leading:i,maxWait:n,trailing:o})},Bn.thru=pa,Bn.toArray=ds,Bn.toPairs=Is,Bn.toPairsIn=zs,Bn.toPath=function(e){return Wa(e)?Lt(e,jo):ls(e)?[e]:ki(Oo(ys(e)))},Bn.toPlainObject=vs,Bn.transform=function(e,t,n){var r=Wa(e),i=r||Ya(e)||us(e);if(t=lo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:es(e)&&Xa(o)?Un(qe(e)):{}}return(i?Mt:br)(e,function(e,r,i){return t(n,e,r,i)}),n},Bn.unary=function(e){return Ca(e,1)},Bn.union=ta,Bn.unionBy=na,Bn.unionWith=ra,Bn.uniq=function(e){return e&&e.length?ci(e):[]},Bn.uniqBy=function(e,t){return e&&e.length?ci(e,lo(t,2)):[]},Bn.uniqWith=function(t,n){return n="function"==typeof n?n:e,t&&t.length?ci(t,e,n):[]},Bn.unset=function(e,t){return null==e||hi(e,t)},Bn.unzip=ia,Bn.unzipWith=oa,Bn.update=function(e,t,n){return null==e?e:di(e,t,yi(n))},Bn.updateWith=function(t,n,r,i){return i="function"==typeof i?i:e,null==t?t:di(t,n,yi(r),i)},Bn.values=Bs,Bn.valuesIn=function(e){return null==e?[]:Xt(e,Ls(e))},Bn.without=aa,Bn.words=Xs,Bn.wrap=function(e,t){return ja(yi(t),e)},Bn.xor=sa,Bn.xorBy=la,Bn.xorWith=ua,Bn.zip=ca,Bn.zipObject=function(e,t){return mi(e||[],t||[],tr)},Bn.zipObjectDeep=function(e,t){return mi(e||[],t||[],Qr)},Bn.zipWith=ha,Bn.entries=Is,Bn.entriesIn=zs,Bn.extend=bs,Bn.extendWith=_s,sl(Bn,Bn),Bn.add=yl,Bn.attempt=Js,Bn.camelCase=Us,Bn.capitalize=Hs,Bn.ceil=wl,Bn.clamp=function(t,n,r){return r===e&&(r=n,n=e),r!==e&&(r=(r=ms(r))==r?r:0),n!==e&&(n=(n=ms(n))==n?n:0),sr(ms(t),n,r)},Bn.clone=function(e){return lr(e,4)},Bn.cloneDeep=function(e){return lr(e,5)},Bn.cloneDeepWith=function(t,n){return lr(t,5,n="function"==typeof n?n:e)},Bn.cloneWith=function(t,n){return lr(t,4,n="function"==typeof n?n:e)},Bn.conformsTo=function(e,t){return null==t||ur(e,t,Rs(t))},Bn.deburr=Gs,Bn.defaultTo=function(e,t){return null==e||e!=e?t:e},Bn.divide=bl,Bn.endsWith=function(t,n,r){t=ys(t),n=ui(n);var i=t.length,o=r=r===e?i:sr(fs(r),0,i);return(r-=n.length)>=0&&t.slice(r,o)==n},Bn.eq=Ba,Bn.escape=function(e){return(e=ys(e))&&Z.test(e)?e.replace(V,nn):e},Bn.escapeRegExp=function(e){return(e=ys(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Bn.every=function(t,n,r){var i=Wa(t)?Tt:fr;return r&&bo(t,n,r)&&(n=e),i(t,lo(n,3))},Bn.find=ma,Bn.findIndex=Go,Bn.findKey=function(e,t){return It(e,lo(t,3),br)},Bn.findLast=va,Bn.findLastIndex=Wo,Bn.findLastKey=function(e,t){return It(e,lo(t,3),_r)},Bn.floor=_l,Bn.forEach=ya,Bn.forEachRight=wa,Bn.forIn=function(e,t){return null==e?e:yr(e,lo(t,3),Ls)},Bn.forInRight=function(e,t){return null==e?e:wr(e,lo(t,3),Ls)},Bn.forOwn=function(e,t){return e&&br(e,lo(t,3))},Bn.forOwnRight=function(e,t){return e&&_r(e,lo(t,3))},Bn.get=Ms,Bn.gt=Ua,Bn.gte=Ha,Bn.has=function(e,t){return null!=e&&mo(e,t,Cr)},Bn.hasIn=Cs,Bn.head=qo,Bn.identity=rl,Bn.includes=function(e,t,n,r){e=qa(e)?e:Bs(e),n=n&&!r?fs(n):0;var i=e.length;return n<0&&(n=yn(i+n,0)),ss(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Bt(e,t,n)>-1},Bn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:fs(n);return i<0&&(i=yn(r+i,0)),Bt(e,t,i)},Bn.inRange=function(t,n,r){return n=ps(n),r===e?(r=n,n=0):r=ps(r),function(e,t,n){return e>=wn(t,n)&&e<yn(t,n)}(t=ms(t),n,r)},Bn.invoke=Es,Bn.isArguments=Ga,Bn.isArray=Wa,Bn.isArrayBuffer=Va,Bn.isArrayLike=qa,Bn.isArrayLikeObject=Za,Bn.isBoolean=function(e){return!0===e||!1===e||ts(e)&&Pr(e)==m},Bn.isBuffer=Ya,Bn.isDate=$a,Bn.isElement=function(e){return ts(e)&&1===e.nodeType&&!is(e)},Bn.isEmpty=function(e){if(null==e)return!0;if(qa(e)&&(Wa(e)||"string"==typeof e||"function"==typeof e.splice||Ya(e)||us(e)||Ga(e)))return!e.length;var t=go(e);if(t==_||t==M)return!e.size;if(Ao(e))return!Or(e).length;for(var n in e)if(Ne.call(e,n))return!1;return!0},Bn.isEqual=function(e,t){return Lr(e,t)},Bn.isEqualWith=function(t,n,r){var i=(r="function"==typeof r?r:e)?r(t,n):e;return i===e?Lr(t,n,e,r):!!i},Bn.isError=Ka,Bn.isFinite=function(e){return"number"==typeof e&&Vt(e)},Bn.isFunction=Xa,Bn.isInteger=Ja,Bn.isLength=Qa,Bn.isMap=ns,Bn.isMatch=function(e,t){return e===t||Dr(e,t,co(t))},Bn.isMatchWith=function(t,n,r){return r="function"==typeof r?r:e,Dr(t,n,co(n),r)},Bn.isNaN=function(e){return rs(e)&&e!=+e},Bn.isNative=function(e){if(So(e))throw new Se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Fr(e)},Bn.isNil=function(e){return null==e},Bn.isNull=function(e){return null===e},Bn.isNumber=rs,Bn.isObject=es,Bn.isObjectLike=ts,Bn.isPlainObject=is,Bn.isRegExp=os,Bn.isSafeInteger=function(e){return Ja(e)&&e>=-9007199254740991&&e<=c},Bn.isSet=as,Bn.isString=ss,Bn.isSymbol=ls,Bn.isTypedArray=us,Bn.isUndefined=function(t){return t===e},Bn.isWeakMap=function(e){return ts(e)&&go(e)==k},Bn.isWeakSet=function(e){return ts(e)&&"[object WeakSet]"==Pr(e)},Bn.join=function(e,t){return null==e?"":mn.call(e,t)},Bn.kebabCase=Ws,Bn.last=Ko,Bn.lastIndexOf=function(t,n,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==e&&(o=(o=fs(r))<0?yn(i+o,0):wn(o,i-1)),n==n?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(t,n,o):zt(t,Ht,o,!0)},Bn.lowerCase=Vs,Bn.lowerFirst=qs,Bn.lt=cs,Bn.lte=hs,Bn.max=function(t){return t&&t.length?gr(t,rl,Mr):e},Bn.maxBy=function(t,n){return t&&t.length?gr(t,lo(n,2),Mr):e},Bn.mean=function(e){return Gt(e,rl)},Bn.meanBy=function(e,t){return Gt(e,lo(t,2))},Bn.min=function(t){return t&&t.length?gr(t,rl,Ir):e},Bn.minBy=function(t,n){return t&&t.length?gr(t,lo(n,2),Ir):e},Bn.stubArray=gl,Bn.stubFalse=ml,Bn.stubObject=function(){return{}},Bn.stubString=function(){return""},Bn.stubTrue=function(){return!0},Bn.multiply=xl,Bn.nth=function(t,n){return t&&t.length?Gr(t,fs(n)):e},Bn.noConflict=function(){return dt._===this&&(dt._=Be),this},Bn.noop=ll,Bn.now=Ma,Bn.pad=function(e,t,n){e=ys(e);var r=(t=fs(t))?hn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Wi(mt(i),n)+e+Wi(ft(i),n)},Bn.padEnd=function(e,t,n){e=ys(e);var r=(t=fs(t))?hn(e):0;return t&&r<t?e+Wi(t-r,n):e},Bn.padStart=function(e,t,n){e=ys(e);var r=(t=fs(t))?hn(e):0;return t&&r<t?Wi(t-r,n)+e:e},Bn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),_n(ys(e).replace(ne,""),t||0)},Bn.random=function(t,n,r){if(r&&"boolean"!=typeof r&&bo(t,n,r)&&(n=r=e),r===e&&("boolean"==typeof n?(r=n,n=e):"boolean"==typeof t&&(r=t,t=e)),t===e&&n===e?(t=0,n=1):(t=ps(t),n===e?(n=t,t=0):n=ps(n)),t>n){var i=t;t=n,n=i}if(r||t%1||n%1){var o=xn();return wn(t+o*(n-t+lt("1e-"+((o+"").length-1))),n)}return Yr(t,n)},Bn.reduce=function(e,t,n){var r=Wa(e)?Ft:qt,i=arguments.length<3;return r(e,lo(t,4),n,i,dr)},Bn.reduceRight=function(e,t,n){var r=Wa(e)?Nt:qt,i=arguments.length<3;return r(e,lo(t,4),n,i,pr)},Bn.repeat=function(t,n,r){return n=(r?bo(t,n,r):n===e)?1:fs(n),$r(ys(t),n)},Bn.replace=function(){var e=arguments,t=ys(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Bn.result=function(t,n,r){var i=-1,o=(n=wi(n,t)).length;for(o||(o=1,t=e);++i<o;){var a=null==t?e:t[jo(n[i])];a===e&&(i=o,a=r),t=Xa(a)?a.call(t):a}return t},Bn.round=Sl,Bn.runInContext=re,Bn.sample=function(e){return(Wa(e)?Xn:Xr)(e)},Bn.size=function(e){if(null==e)return 0;if(qa(e))return ss(e)?hn(e):e.length;var t=go(e);return t==_||t==M?e.size:Or(e).length},Bn.snakeCase=Zs,Bn.some=function(t,n,r){var i=Wa(t)?Ot:ii;return r&&bo(t,n,r)&&(n=e),i(t,lo(n,3))},Bn.sortedIndex=function(e,t){return oi(e,t)},Bn.sortedIndexBy=function(e,t,n){return ai(e,t,lo(n,2))},Bn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=oi(e,t);if(r<n&&Ba(e[r],t))return r}return-1},Bn.sortedLastIndex=function(e,t){return oi(e,t,!0)},Bn.sortedLastIndexBy=function(e,t,n){return ai(e,t,lo(n,2),!0)},Bn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=oi(e,t,!0)-1;if(Ba(e[n],t))return n}return-1},Bn.startCase=Ys,Bn.startsWith=function(e,t,n){return e=ys(e),n=null==n?0:sr(fs(n),0,e.length),t=ui(t),e.slice(n,n+t.length)==t},Bn.subtract=Al,Bn.sum=function(e){return e&&e.length?Zt(e,rl):0},Bn.sumBy=function(e,t){return e&&e.length?Zt(e,lo(t,2)):0},Bn.template=function(t,n,r){var i=Bn.templateSettings;r&&bo(t,n,r)&&(n=e),t=ys(t),n=_s({},n,i,Ji);var o,a,s=_s({},n.imports,i.imports,Ji),l=Rs(s),u=Xt(s,l),c=0,h=n.interpolate||ye,d="__p += '",p=Ce((n.escape||ye).source+"|"+h.source+"|"+(h===K?ce:ye).source+"|"+(n.evaluate||ye).source+"|$","g"),f="//# sourceURL="+(Ne.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++it+"]")+"\n";t.replace(p,function(e,n,r,i,s,l){return r||(r=i),d+=t.slice(c,l).replace(we,rn),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=l+e.length,e}),d+="';\n";var g=Ne.call(n,"variable")&&n.variable;if(g){if(le.test(g))throw new Se("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(U,""):d).replace(H,"$1").replace(G,"$1;"),d="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=Js(function(){return Ae(l,f+"return "+d).apply(e,u)});if(m.source=d,Ka(m))throw m;return m},Bn.times=function(e,t){if((e=fs(e))<1||e>c)return[];var n=d,r=wn(e,d);t=lo(t),e-=d;for(var i=Yt(r,t);++n<e;)t(n);return i},Bn.toFinite=ps,Bn.toInteger=fs,Bn.toLength=gs,Bn.toLower=function(e){return ys(e).toLowerCase()},Bn.toNumber=ms,Bn.toSafeInteger=function(e){return e?sr(fs(e),-9007199254740991,c):0===e?e:0},Bn.toString=ys,Bn.toUpper=function(e){return ys(e).toUpperCase()},Bn.trim=function(t,n,r){if((t=ys(t))&&(r||n===e))return $t(t);if(!t||!(n=ui(n)))return t;var i=dn(t),o=dn(n);return _i(i,Qt(i,o),en(i,o)+1).join("")},Bn.trimEnd=function(t,n,r){if((t=ys(t))&&(r||n===e))return t.slice(0,pn(t)+1);if(!t||!(n=ui(n)))return t;var i=dn(t);return _i(i,0,en(i,dn(n))+1).join("")},Bn.trimStart=function(t,n,r){if((t=ys(t))&&(r||n===e))return t.replace(ne,"");if(!t||!(n=ui(n)))return t;var i=dn(t);return _i(i,Qt(i,dn(n))).join("")},Bn.truncate=function(t,n){var r=30,i="...";if(es(n)){var o="separator"in n?n.separator:o;r="length"in n?fs(n.length):r,i="omission"in n?ui(n.omission):i}var a=(t=ys(t)).length;if(on(t)){var s=dn(t);a=s.length}if(r>=a)return t;var l=r-hn(i);if(l<1)return i;var u=s?_i(s,0,l).join(""):t.slice(0,l);if(o===e)return u+i;if(s&&(l+=u.length-l),os(o)){if(t.slice(l).search(o)){var c,h=u;for(o.global||(o=Ce(o.source,ys(he.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var d=c.index;u=u.slice(0,d===e?l:d)}}else if(t.indexOf(ui(o),l)!=l){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+i},Bn.unescape=function(e){return(e=ys(e))&&q.test(e)?e.replace(W,fn):e},Bn.uniqueId=function(e){var t=++Oe;return ys(e)+t},Bn.upperCase=$s,Bn.upperFirst=Ks,Bn.each=ya,Bn.eachRight=wa,Bn.first=qo,sl(Bn,(vl={},br(Bn,function(e,t){Ne.call(Bn.prototype,t)||(vl[t]=e)}),vl),{chain:!1}),Bn.VERSION="4.17.21",Mt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Bn[e].placeholder=Bn}),Mt(["drop","take"],function(t,n){Wn.prototype[t]=function(r){r=r===e?1:yn(fs(r),0);var i=this.__filtered__&&!n?new Wn(this):this.clone();return i.__filtered__?i.__takeCount__=wn(r,i.__takeCount__):i.__views__.push({size:wn(r,d),type:t+(i.__dir__<0?"Right":"")}),i},Wn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Mt(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Wn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:lo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),Mt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Wn.prototype[e]=function(){return this[n](1).value()[0]}}),Mt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Wn.prototype[e]=function(){return this.__filtered__?new Wn(this):this[n](1)}}),Wn.prototype.compact=function(){return this.filter(rl)},Wn.prototype.find=function(e){return this.filter(e).head()},Wn.prototype.findLast=function(e){return this.reverse().find(e)},Wn.prototype.invokeMap=Kr(function(e,t){return"function"==typeof e?new Wn(this):this.map(function(n){return Er(n,e,t)})}),Wn.prototype.reject=function(e){return this.filter(Na(lo(e)))},Wn.prototype.slice=function(t,n){t=fs(t);var r=this;return r.__filtered__&&(t>0||n<0)?new Wn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==e&&(r=(n=fs(n))<0?r.dropRight(-n):r.take(n-t)),r)},Wn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Wn.prototype.toArray=function(){return this.take(d)},br(Wn.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),i=/^(?:head|last)$/.test(n),o=Bn[i?"take"+("last"==n?"Right":""):n],a=i||/^find/.test(n);o&&(Bn.prototype[n]=function(){var n=this.__wrapped__,s=i?[1]:arguments,l=n instanceof Wn,u=s[0],c=l||Wa(n),h=function(e){var t=o.apply(Bn,Dt([e],s));return i&&d?t[0]:t};c&&r&&"function"==typeof u&&1!=u.length&&(l=c=!1);var d=this.__chain__,p=!!this.__actions__.length,f=a&&!d,g=l&&!p;if(!a&&c){n=g?n:new Wn(this);var m=t.apply(n,s);return m.__actions__.push({func:pa,args:[h],thisArg:e}),new Gn(m,d)}return f&&g?t.apply(this,s):(m=this.thru(h),f?i?m.value()[0]:m.value():m)})}),Mt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ee[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Bn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Wa(i)?i:[],e)}return this[n](function(n){return t.apply(Wa(n)?n:[],e)})}}),br(Wn.prototype,function(e,t){var n=Bn[t];if(n){var r=n.name+"";Ne.call(Rn,r)||(Rn[r]=[]),Rn[r].push({name:t,func:n})}}),Rn[Bi(e,2).name]=[{name:"wrapper",func:e}],Wn.prototype.clone=function(){var e=new Wn(this.__wrapped__);return e.__actions__=ki(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ki(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ki(this.__views__),e},Wn.prototype.reverse=function(){if(this.__filtered__){var e=new Wn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Wn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Wa(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=wn(t,e+a);break;case"takeRight":e=yn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,u=r?s:a-1,c=this.__iteratees__,h=c.length,d=0,p=wn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return fi(e,this.__actions__);var f=[];e:for(;l--&&d<p;){for(var g=-1,m=e[u+=t];++g<h;){var v=c[g],y=v.iteratee,w=v.type,b=y(m);if(2==w)m=b;else if(!b){if(1==w)continue e;break e}}f[d++]=m}return f},Bn.prototype.at=fa,Bn.prototype.chain=function(){return da(this)},Bn.prototype.commit=function(){return new Gn(this.value(),this.__chain__)},Bn.prototype.next=function(){this.__values__===e&&(this.__values__=ds(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?e:this.__values__[this.__index__++]}},Bn.prototype.plant=function(t){for(var n,r=this;r instanceof Hn;){var i=zo(r);i.__index__=0,i.__values__=e,n?o.__wrapped__=i:n=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,n},Bn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Wn){var n=t;return this.__actions__.length&&(n=new Wn(this)),(n=n.reverse()).__actions__.push({func:pa,args:[ea],thisArg:e}),new Gn(n,this.__chain__)}return this.thru(ea)},Bn.prototype.toJSON=Bn.prototype.valueOf=Bn.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Bn.prototype.first=Bn.prototype.head,Qe&&(Bn.prototype[Qe]=function(){return this}),Bn}();ft?((ft.exports=gn)._=gn,pt._=gn):dt._=gn}.call(Ce),function(e){e[e.TwoWay=2]="TwoWay",e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(cu||(cu={})),function(e){e.Transit="transit",e.Public="public"}(hu||(hu={})),function(e){e.MapObject="map-object",e.Coordinate="coordinate"}(du||(du={})),function(e){e.Edge="what.route_edge",e.Network="what.route_network",e.PortalNetwork="what.link",e.AirsideNetwork="what.route.network"}(pu||(pu={})),function(e){e.Vehicle="vehicle",e.Plane="plane",e.Pedestrian="pedestrian"}(fu||(fu={})),function(e){e.escalator="escalator",e.lift="lift",e.liftAnchor="liftAnchor",e.bus="airport_transfer",e.skytrain="skytrain",e.entrance="entrance",e.exit="exit",e.staircase="staircase",e.unknown=""}(gu||(gu={})),function(e){e.RouteOverview="Route Overview",e.SectionOverview="Section Overview",e.LeftHairPinTurn="Left hairpin turn",e.RightHairPinTurn="Right hairpin turn",e.LeftTurn="Turn left",e.RightTurn="Turn right",e.ContinueStraight="Continue straight",e.EnterPortal="Enter Portal",e.TravelPortal="Travel Portal",e.ExitPortal="Exit Portal",e.Static="Static",e.ChangeZone="Change Zone",e.PassThroughImmigration="Pass Through Immigration",e.RoadChangeContinueStraight="Road Change Continue Straight",e.TurnLeftAndContinue="Turn Left and Continue",e.TurnSlightLeftAndContinue="Turn Slight Left and Continue",e.TurnRightAndContinue="Turn Right and Continue",e.TurnSlightRightAndContinue="Turn Slight Right and Continue",e.UTurnAndContinue="U-Turn and Continue"}(mu||(mu={})),function(e){e.Internal="Internal",e.External="External"}(vu||(vu={})),function(e){e.WithinTerminal="WithinTerminal",e.ToTerminal="ToTerminal",e.FromTerminal="FromTerminal",e.Airside="Airside"}(yu||(yu={}));var bu=((uu={})[yu.WithinTerminal]=["gps","compass","motion"],uu[yu.Airside]=["gps","compass"],uu[yu.ToTerminal]=[],uu[yu.FromTerminal]=[],uu);function _u(e,t){var n;return(null==t?void 0:t.requiredSensors)?t.requiredSensors:null!==(n=bu[e])&&void 0!==n?n:[]}function xu(e,t,n){void 0===n&&(n={});for(var r=aa(e).coordinates,i=0,o=0;o<r.length&&!(t>=i&&o===r.length-1);o++){if(i>=t){var a=t-i;if(a){var s=la(r[o],r[o-1])-180;return ua(r[o],a,s,n)}return ve(r[o])}i+=sa(r[o],r[o+1],n)}return ve(r[r.length-1])}var Su="where.changi.airside",Au="meters",Pu="Custom Location",Mu="custom_location",Cu="user_position";function Tu(e,t){var n,r=null!=t?t:{},i=r.vehicleTemplateType,o=r.distanceThreshold,a=void 0===o?30:o,s=Hu.getState().data;if(e.type===du.MapObject){var l=e.mapObjectId;if(!l||!s.hasOwnProperty(pu.Edge)||!s[pu.Edge].edges.hasOwnProperty(l))return;return wu.cloneDeep(s[pu.Edge].edges[l])}if(e.type!==du.Coordinate);else{var u=ku(e.whereDimension,!1,pu.Network,!0);if(u.length<1){var c="RouteNetworkData not found for the whereDimension: ".concat(e.whereDimension);throw console.error(c),new Error(c)}var h=e.coordinates,d=function(e,t,n,r){if(0===e.length||0===n)return;var i=e.map(function(e){return{feature:e,dist:sa(rs(e,t,{units:"meters"}).geometry.coordinates,t,{units:"meters"})}}).filter(function(e){return e.dist<=n}).sort(function(e,t){return e.dist-t.dist}).map(function(e){return e.feature}),o=function(e,t){if(0===e.length)return;var n=e.find(function(e){return!!Nu(e,null!=t?t:void 0)});if(!n)return;return n}(i,null!=r?r:void 0);return null!=o?o:void 0}(u,h,a,i);if(d){console.log("DEBUG - Nearest Accessible Network Feature:",d);var p=rs(d,h,{units:"meters"});Hu.getState().updateNetworkWithIntersection(d,p.geometry.coordinates);var f=ye([h,p.geometry.coordinates],{center:[h[0],h[1]],dimension_what:"what.route_edge",dimension_where:"where.changi.airside",direction:cu.TwoWay,mapObjectId:"",modified:1,myMapObjectId:"",title:Pu,uniqueId:"",zone:hu.Public});return{id:Cu,where:e.whereDimension,what:null===(n=f.properties)||void 0===n?void 0:n.dimension_what,name:Pu,coords:h,lines:[f],localRef:Mu,zone:hu.Public}}var g,m=function(){var e=Object.values(Hu.getState().data[pu.Edge].edges).filter(function(e){return"where.changi.airside"===e.where}),t=e.flatMap(function(e){return e.lines});return t}(),v=function(e,t,n){if(0===e.length||0===n)return;var r=e.map(function(e){return{feature:e,dist:rs(e,t,{units:"meters"}).properties.dist}}).filter(function(e){return e.dist<=n}).sort(function(e,t){return e.dist-t.dist});if(0===r.length)return;return r}(m,h,a),y=null==v?void 0:v.find(function(e){var t=function(e,t){var n,r=ve(e.geometry.coordinates.at(-1)),i=1/0;return t.forEach(function(e){var t=rs(e,r,{units:"meters"}).properties.dist;t<i&&(i=t,n=e)}),i<=1?n:void 0}(e.feature,u);return!(!t||!Nu(t,null!=i?i:void 0))&&(g=t,!0)});if(y)return console.log("DEBUG - Nearest Accessible Edge:",y),console.log("DEBUG - Accessible Network Feature:",g),function(e){if(!e)return;var t=oa(e),n=t[0],r=ye(t,{center:[n[0],n[1]],dimension_what:"what.route_edge",dimension_where:"where.changi.airside",direction:cu.TwoWay,mapObjectId:"",modified:1,myMapObjectId:"",title:Pu,uniqueId:"",zone:hu.Public}),i={id:Cu,where:Su,what:pu.Edge,name:Pu,coords:n,lines:[r],localRef:Mu,zone:hu.Public};return i}(y.feature);var w=function(e,t,n){void 0===n&&(n=.001);if(0===t.length)throw new Error("RouteNetworkData is empty");var r=ga();r.load(t);var i,o,a=dl(ve(e)),s=[a[0]-n,a[1]-n,a[2]+n,a[3]+n],l=r.search(s),u=1/0;l.features.forEach(function(t){var n=rs(t,e,{units:"meters"}),r=sa(n.geometry.coordinates,e,{units:"meters"});r<u&&(u=r,i=n,o=t)}),0===l.features.length&&(console.warn("No candidate features found in spatial index, falling back to brute force"),t.forEach(function(t){var n=rs(t,e,{units:"meters"}),r=sa(n.geometry.coordinates,e,{units:"meters"});r<u&&(u=r,i=n,o=t)}));return{nearestPoint:i,closestLine:o,minDistance:u}}(h,B(B([],u,!0),m,!0)).minDistance;if(void 0!==a){c="Your location is ".concat(w.toFixed(2),"m from the nearest road. Please move within ").concat(a,"m to start navigation.");throw console.error(c),new Error(c)}}}function ku(e,t,n,r){void 0===t&&(t=!0),void 0===r&&(r=!1);var i=Hu.getState().data;if(!i.hasOwnProperty(pu.Network))return[];for(var o=i[pu.Network],a=[],s=0;s<o.length;s++){var l=o[s];if(l&&l.properties&&l.properties.dimension_where){var u=!1;u=t?l.properties.dimension_where.includes(e):l.properties.dimension_where===e;var c=!0;n&&l.properties.dimension_what?c=r?l.properties.dimension_what.includes(n):l.properties.dimension_what===n:n&&!l.properties.dimension_what&&(c=!1),u&&c&&a.push(l)}}return wu.cloneDeep(a)}function Eu(e,t,n,r){return void 0===t&&(t=!0),void 0===r&&(r=!1),ku(e,t,n,r)}function Ru(e,t){return Tu(e,t)}function Lu(e){var t;return(t=Hu.getState().data).hasOwnProperty("portal")?t.portal:{edgeData:{},lines:[]}}function Du(e){return function(e){var t=Hu.getState().data;return e&&t.hasOwnProperty("what.service.immigration")&&t["what.service.immigration"].hasOwnProperty(e)?t["what.service.immigration"][e]:[]}(e)}function Fu(e,t,n){void 0===n&&(n=!0);var r=function(n,r){var i=rs(r,n);void 0!==i.properties.index&&(t.geometry.coordinates.splice(i.properties.index+1,0,e.geometry.coordinates),t.properties&&(t.properties.modified=1))};if(n){var i=function(e,t){var n=-1;return ca(e,function(e,r){if(-1===n){var i=ve(e);sa(t,i,{units:"meters"})<.001&&(n=r)}}),n}(t,e);-1===i?r(e.geometry.coordinates,t):(t.geometry.coordinates[i]=e.geometry.coordinates,t.properties&&(t.properties.modified=1))}else r(e.geometry.coordinates,t)}function Nu(e,t){var n,r;if(void 0===t)return!0;var i=t.customProperties,o=t.allowedRoadwayCategories,a=null!==(n=e.properties)&&void 0!==n?n:{},s=Object.entries(i).every(function(e){var t=e[0],n=e[1];return a[t]&&a[t].includes(n)}),l=o.includes(null!==(r=a.dimension_what)&&void 0!==r?r:"");return s&&l}function Ou(e){var t=e.split("."),n=t[t.length-1];return e.replace(".".concat(n),"")}var ju="where";function Iu(e,t){var n=[],r={};for(var i in e)if(e[i].where.includes(t)){var o=e[i];r[i]=o,n.push.apply(n,o.lines),o.links.forEach(function(e){n.push.apply(n,e.lines)})}return{edgeData:r,lines:n}}function zu(e,t){var n=[],r={};return t.forEach(function(i){if(i in e&&t.has(e[i].id)){var o=e[i];r[i]=o,n.push.apply(n,o.lines),o.links.forEach(function(e){n.push.apply(n,e.lines)})}}),{edgeData:r,lines:n}}var Bu,Uu,Hu=au(function(e,t){return{data:{},setRoute:function(t){return e({data:t})},updateNetworkWithIntersection:function(n,r){var i;if(n&&r){var o=t().data,a=o[pu.Network]||[];if(0!==a.length){var s=!1,l=a.map(function(e){wu.isEqual(e,n)&&(Fu(ve(r),e,!1),s=!0);return e});s&&e({data:j(j({},o),(i={},i[pu.Network]=l,i))})}}},upsertEdge:function(n){var r,i,o;if(n&&n.id){var a=t().data,s=j(j({},a),((r={})[pu.Edge]=j(j({},a[pu.Edge]),{edges:j(j({},(null===(o=a[pu.Edge])||void 0===o?void 0:o.edges)||{}),(i={},i[n.id]=n,i))}),r));e({data:s})}},getTemplateTypes:function(){return t().data.templatesData.templateTypes},getTemplateDefaults:function(){return t().data.templatesData.defaults}}}),Gu=au(function(e){return{data:{},setMapObjectsData:function(t){return e({data:t})}}}),Wu=au(function(e){return{data:{},setRoute:function(t){return e({data:t})}}}),Vu=au(function(e){return{data:{},setRoute:function(t){return e({data:t})}}});function qu(e){return e===Bu.Routing?"generate-route-json-per-role":e===Bu.MapObjects?"generate-map-objects-per-role":e===Bu.MBTiles?"generate-vector-tiles":e===Bu.Fonts?"generate-font-sprites":void 0}function Zu(e,t){return t.valueOf()+e}!function(e){e.Routing="routing",e.MapObjects="mapObjects",e.MBTiles="mbtiles",e.Fonts="fonts"}(Bu||(Bu={})),function(e){e.Ready="Ready",e.Awaiting="Awaiting",e.DownloadingResources="DownloadingResources",e.Unavailable="Unavailable"}(Uu||(Uu={}));var Yu=Hu.setState,$u=Gu.setState,Ku=Wu.setState,Xu=Vu.setState;function Ju(e,t,n){var r,i;return I(this,void 0,void 0,function(){var o,a,s,l,u,c,h,d,p,f,g,m,v,y,w,b,_,x,S,A,P,M,C,k=this;return z(this,function(E){switch(E.label){case 0:o=e.publishedDataType,a=Zu("version",o),s=Zu("roleName",o),l=null==e?void 0:e.roleName,u=Uu.Awaiting,c=function(e){return e===Bu.Routing?Yu:e===Bu.MapObjects?$u:e===Bu.MBTiles?Ku:e===Bu.Fonts?Xu:void 0}(o),h=e.secretKey,d="".concat(R.DocumentDirectoryPath,"/extracted/"),p=function(){return I(k,void 0,void 0,function(){var n;return z(this,function(r){return n=t.contains(a)?t.getString(a):"0.0.0",[2,new Promise(function(r,i){T({url:"".concat(e.URL,"/check-published-versions"),headers:{Authorization:"Bearer ".concat(e.accessToken),"Content-Type":"application/json"},method:"POST",data:JSON.stringify({version:n,dataType:qu(e.publishedDataType)})}).then(function(e){var n=e.data,i={currentVersion:void 0,remoteVersion:void 0,roleName:void 0,URL:void 0,data:void 0},c=t.getString(a),h=t.getString(s),d=c;if(n.hasOwnProperty("version")&&(d=n.version),i.currentVersion=c,i.remoteVersion=d,c){var p=t.getString(Zu("data",o));if(o===Bu.MBTiles||o===Bu.Fonts)p&&(i.data=p);else t.getString(Zu("encryptionTag",o))&&p&&(i.data=p)}if(l&&(i.roleName=l,h!==l))return n.hasOwnProperty("downloadUrl")&&(i.URL=n.downloadUrl),u=Uu.DownloadingResources,console.log("Role mismatch. Setting status to DownloadingResources: ",i.roleName,h),void r(i);d&&(n.hasOwnProperty("downloadUrl")&&(i.URL=n.downloadUrl),(c&&d>c||!c||!i.data)&&(u=i.URL?Uu.DownloadingResources:u)),console.log("final: ",i.URL,i.currentVersion,i.remoteVersion,i.roleName),r(i)}).catch(function(t){console.log("error while fetching published version: ",e.publishedDataType),t.response?(console.log(t.response.data),console.log(t.response.status),console.log(t.response.headers)):t.request?console.log(t.request):console.log("Error",t.message),console.log(t.config),i(t)})})]})})},f=function(e,n,r,i){try{return t.set(Zu("data",o),e),t.set(a,n),t.set(Zu("roleName",o),r),i&&t.set(Zu("encryptionTag",o),i),!0}catch(e){return console.log("error storing routing file from local storage",e),!1}},g=function(){return I(k,void 0,void 0,function(){var n,r,i,a;return z(this,function(s){switch(s.label){case 0:return n=t.getString(Zu("data",o)),o!==Bu.MBTiles&&o!==Bu.Fonts?[3,2]:[4,Qu(o,n,d,h)];case 1:return(r=s.sent())?(c({data:r}),u=Uu.Ready,[2,!0]):[2,!1];case 2:return i=t.getString(Zu("encryptionTag",o)),n&&i?[4,El(n,i,e.secretKey)]:[3,4];case 3:return a=s.sent(),c({data:a}),u=Uu.Ready,[2,!0];case 4:return[2,!1];case 5:return[2]}})})},m=function(){return I(k,void 0,void 0,function(){return z(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,g()];case 1:return e.sent()||(console.log("metaAtlasSDK: failed to load data",o),u=Uu.Unavailable),[3,3];case 2:return e.sent(),console.log("metaAtlasSDK: erro while loading data",o),u=Uu.Unavailable,t.clearAll(),[3,3];case 3:return[2]}})})},E.label=1;case 1:return E.trys.push([1,26,,28]),[4,p()];case 2:if(v=E.sent(),u!==Uu.DownloadingResources||!v.URL)return[3,15];console.log("metaAtlasSDK: downloading file from server",o),E.label=3;case 3:return E.trys.push([3,12,,14]),o!==Bu.MBTiles&&o!==Bu.Fonts?[3,7]:(y="".concat(R.DocumentDirectoryPath,"/").concat(o,".zip"),[4,R.downloadFile({fromUrl:v.URL,toFile:y,begin:function(e){var t,r=(e.contentLength/1048576).toFixed(2);n&&(null==n?void 0:n.onStart)&&(null===(t=null==n?void 0:n.onStart)||void 0===t||t.call(n,{totalSize:r})),console.log("Download started. Total size: ".concat(r," MB"))},progress:function(e){var t,r=e.bytesWritten/e.contentLength*100,i=(e.bytesWritten/1048576).toFixed(2),o=(e.contentLength/1048576).toFixed(2);n&&(null==n?void 0:n.onProgress)&&(null===(t=null==n?void 0:n.onProgress)||void 0===t||t.call(n,{downloaded:i,totalSize:o,progress:r.toFixed(2)})),console.log("Downloaded: ".concat(i," MB / ").concat(o," MB (").concat(r.toFixed(2),"%)"))}}).promise]);case 4:return w=E.sent(),[4,R.mkdir(d)];case 5:if(E.sent(),200!==w.statusCode)throw n&&(null==n?void 0:n.onError)&&(null===(r=null==n?void 0:n.onError)||void 0===r||r.call(n,w.statusCode.toString())),new Error("Download failed with status ".concat(w.statusCode));return n&&(null==n?void 0:n.onSuccess)&&(null===(i=null==n?void 0:n.onSuccess)||void 0===i||i.call(n,y)),console.log("File downloaded to: ".concat(y)),R.stat(y).then(function(e){var t=(e.size/1048576).toFixed(2);console.log("File size: ".concat(t," MB"))}).catch(function(e){console.error("Error getting file size:",e)}),x=f(y,v.remoteVersion,l),[4,Qu(o,y,d,h)];case 6:if(!(P=E.sent()))throw new Error("No MBTiles file found in the archive");return x&&(console.log("Loaded file"),c({data:P}),u=Uu.Ready),[3,11];case 7:return[4,fetch(v.URL)];case 8:if(!(w=E.sent()).ok)throw new Error("HTTP error! Status: ".concat(w.status));return[4,w.json()];case 9:return b=E.sent(),_=b.data,M=b.tag,[4,El(_,M,e.secretKey)];case 10:C=E.sent(),(x=f(_,v.remoteVersion,l,M))&&(console.log("loaded file"),c({data:C}),u=Uu.Ready),E.label=11;case 11:return[3,14];case 12:return S=E.sent(),console.error("Error fetching and decrypting data:",S),[4,m()];case 13:return E.sent(),[3,14];case 14:return[3,25];case 15:return o!==Bu.MBTiles&&o!==Bu.Fonts?[3,21]:(A=t.getString(Zu("data",o)),[4,R.exists(A)]);case 16:return E.sent()?console.log("File exists at: ".concat(A)):(console.log("File does not exist at: ".concat(A)),f("","","")),[4,Qu(o,A,d,h)];case 17:return P=E.sent(),A?(c({data:P}),u=Uu.Ready,[3,20]):[3,18];case 18:return[4,m()];case 19:E.sent(),E.label=20;case 20:return[3,25];case 21:return M=t.getString("encryptionTag"),v.data&&M?(console.log("loaded local file"),[4,El(v.data,M,e.secretKey)]):[3,23];case 22:return C=E.sent(),c({data:C}),u=Uu.Ready,[3,25];case 23:return[4,m()];case 24:E.sent(),E.label=25;case 25:return[3,28];case 26:return E.sent(),[4,m()];case 27:return E.sent(),[3,28];case 28:return[2,u]}})})}function Qu(e,t,n,r){return I(this,void 0,void 0,function(){var i,o,a,s,l,u,c,h,d,p,f,g,m,v,y,w,b,_,x,S,A;return z(this,function(P){switch(P.label){case 0:return P.trys.push([0,30,,31]),i="",[4,R.exists(n)];case 1:return P.sent()?[3,3]:[4,R.mkdir(n)];case 2:return P.sent(),console.log("Directory created at: ".concat(n)),[3,4];case 3:console.log("Directory already exists at: ".concat(n)),P.label=4;case 4:return e!==Bu.MBTiles?[3,24]:[4,D(t,n,r)];case 5:return P.sent(),[4,R.readDir(n)];case 6:o=P.sent(),a=o.filter(function(e){return e.name.endsWith(".mbtiles")}),s=0,l=a,P.label=7;case 7:return s<l.length?(u=l[s],[4,R.unlink(u.path)]):[3,10];case 8:P.sent(),P.label=9;case 9:return s++,[3,7];case 10:return[4,R.readDir(n)];case 11:return y=P.sent(),c=y.find(function(e){return e.name.endsWith(".zip")}),c?[4,L("".concat(n).concat(c.name),n)]:[3,15];case 12:return P.sent(),h="".concat(n).concat(c.name),[4,R.exists(h)];case 13:return P.sent()?[4,tc(h)]:[3,15];case 14:P.sent(),P.label=15;case 15:return[4,R.readDir(n)];case 16:return d=P.sent(),p=d.find(function(e){return e.name.endsWith(".mbtiles")}),p?(f="geojson_".concat(performance.now().toFixed(0),".mbtiles"),g="".concat(n).concat(f),[4,R.moveFile(p.path,g)]):[3,22];case 17:return P.sent(),[4,R.exists(p.path)];case 18:return P.sent()?[4,R.unlink(p.path)]:[3,20];case 19:P.sent(),P.label=20;case 20:return[4,R.readDir(n)];case 21:return m=P.sent(),console.log("All files in unzip destination:",m),i=g,[3,23];case 22:throw new Error("MBTiles file not found.");case 23:return[3,29];case 24:return e!==Bu.Fonts?[3,28]:[4,L(t,n)];case 25:return v=P.sent(),[4,R.readDir(v)];case 26:return y=P.sent(),w=y.map(function(e){return e.name}),[4,R.readDir("".concat(v,"sprites"))];case 27:if(b=P.sent(),_=b.map(function(e){return e.name}),console.log("Sprites Files:",_),x=w.includes("fonts"),S=w.includes("sprites"),!x||!S)throw new Error("Missing required directories: fonts or sprites.");return i=v,[3,29];case 28:throw new Error("Unsupported data type.");case 29:return[2,i];case 30:throw A=P.sent(),console.error("Error extracting offline file path:",A),A;case 31:return[2]}})})}var ec,tc=function(e){return I(void 0,void 0,void 0,function(){var t;return z(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,R.unlink(e)];case 1:return n.sent(),console.log("File deleted successfully"),[3,3];case 2:return t=n.sent(),console.error("Error deleting file:",t),[3,3];case 3:return[2]}})})};function nc(e){if(e&&"object"===te(e)&&!Array.isArray(e))return e}function rc(e,t){var n=nc(e),r=nc(t);if(n||r)return j(j({},null!=n?n:{}),null!=r?r:{})}function ic(e){var t,n,r,i,o,a,s,l,u,c,h,d,p=null!==(n=null!==(t=e.mID)&&void 0!==t?t:e.id)&&void 0!==n?n:e.mapObjectId,f={myMapObjectId:p,title:null!==(r=e.name)&&void 0!==r?r:e.title,localRef:e.localRef,dimension_what:null!==(i=e.what)&&void 0!==i?i:e.whatDimension,dimension_where:null!==(o=e.where)&&void 0!==o?o:e.whereDimension,isSearchable:!0},g=function(e){var t=nc(e),n=null==t?void 0:t.features;if(Array.isArray(n)&&0!==n.length){for(var r,i=0,o=n;i<o.length;i++){var a=nc(o[i]),s=nc(null==a?void 0:a.properties);if(s&&(r||(r=j({},s)),s.booth_info||s.metadata))return j({},s)}return r?j({},r):void 0}}(e.property_geojson),m=nc(e.properties),v=function(e){var t,n,r,i,o,a,s,l,u=nc(e.booth_info),c=null!==(n=null!==(t=e.images)&&void 0!==t?t:e.property_images)&&void 0!==n?n:null==u?void 0:u.images,h=null!==(i=null!==(r=e.logos)&&void 0!==r?r:e.property_logos)&&void 0!==i?i:null==u?void 0:u.logos,d=null!==(o=e.overview)&&void 0!==o?o:null==u?void 0:u.overview,p=null!==(a=e.products)&&void 0!==a?a:null==u?void 0:u.products,f=null!==(s=e.videos)&&void 0!==s?s:null==u?void 0:u.videos,g=null!==(l=e.files)&&void 0!==l?l:null==u?void 0:u.files;if(null!=d||null!=p||null!=c||null!=h||null!=f||null!=g||u)return j(j(j(j(j(j(j({},null!=u?u:{}),void 0!==d?{overview:d}:{}),void 0!==p?{products:p}:{}),void 0!==c?{images:c}:{}),void 0!==h?{logos:h}:{}),void 0!==f?{videos:f}:{}),void 0!==g?{files:g}:{})}(e),y=j(j(j({},f),null!=g?g:{}),null!=m?m:{});v&&Object.keys(v).length>0?y.booth_info=v:(null==g?void 0:g.booth_info)?y.booth_info=g.booth_info:(null==m?void 0:m.booth_info)&&(y.booth_info=m.booth_info);var w=rc(function(e){if(null!=e){if("object"===te(e)&&!Array.isArray(e))return e;if("string"==typeof e&&e.trim())try{return nc(JSON.parse(e))}catch(e){return}}}(e.metaData),rc(e.metadata,rc(null==g?void 0:g.metadata,null==m?void 0:m.metadata)));return w&&Object.keys(w).length>0&&(y.metadata=w),y.myMapObjectId=null!==(a=y.myMapObjectId)&&void 0!==a?a:p,y.title=null!==(l=null!==(s=y.title)&&void 0!==s?s:e.name)&&void 0!==l?l:e.title,y.dimension_what=null!==(c=null!==(u=y.dimension_what)&&void 0!==u?u:e.what)&&void 0!==c?c:e.whatDimension,y.dimension_where=null!==(d=null!==(h=y.dimension_where)&&void 0!==h?h:e.where)&&void 0!==d?d:e.whereDimension,y.isSearchable=!0,y}!function(e){e.Name="Name",e.WhereDimension="WhereDimension",e.Relevance="Relevance",e.RelevanceStrict="RelevanceStrict"}(ec||(ec={}));var oc=function(){function e(){this.searchableGeoJsonFeatures=[],this.token="",this.empApi="",this.HOST="",this.atomsAPIAccessToken="",this.apiRequestLimit=5e3,this.secretKeyForDecryption="",this.routingStatus=Uu.Awaiting,this.searchStatus=Uu.Awaiting,this.offlineMapStatus=Uu.Awaiting,this.storage=new fl,this.onReadinessChange=null,this.lastClicked={mapObjectId:null,coordinates:null,name:null,whatDimension:null,whereDimension:null,geometry:null,properties:null}}return e.prototype.init=function(e,t,n,r,i){this.empApi=e,this.token=t,this.HOST=r,this.secretKeyForDecryption=n,this.tileserverRoleName=i},Object.defineProperty(e.prototype,"defaultFocusedTaxonomy",{get:function(){return ll().getDefaultFocusedTaxonomy()},set:function(e){ll().setDefaultFocusedTaxonomy(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentFocus",{get:function(){return ll().getCurrentFocus()},set:function(e){ll().setCurrentFocus(e)},enumerable:!1,configurable:!0}),e.prototype.getAtomsAPIAccessToken=function(e){var t=this,n=JSON.stringify({strategy:"atomstoken",atomsSdkToken:this.token,clientEngine:"API",clientOS:"Linux"}),r={method:"post",url:"".concat(this.empApi,"/authentication"),headers:{"Content-Type":"application/json"},data:n};T(r).then(function(n){return I(t,void 0,void 0,function(){var t;return z(this,function(r){return(null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.accessToken)&&(this.atomsAPIAccessToken=n.data.accessToken,e({authenticated:!0})),[2]})})}).catch(function(t){e({authenticated:!1,error:t})})},e.prototype.setupFocusTree=function(){return I(this,void 0,void 0,function(){var e,t,n,r;return z(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e="".concat(this.empApi,"/role-based-camera-properties"),[4,T.get(e,{headers:{Authorization:"Bearer ".concat(this.atomsAPIAccessToken)}})];case 1:return(null==(t=i.sent())?void 0:t.data)&&Object.keys(t.data).length>0?(gs(t.data),(n=bs()).length>0&&!this.currentFocus&&(this.defaultFocusedTaxonomy=n[0].taxonomyPath,this.currentFocus=n[0].taxonomyPath),console.log("Focus tree loaded from ATOMS API",t.data)):(console.error("[focus-core] Empty focus tree response from ATOMS API"),gs({})),[3,3];case 2:return r=i.sent(),console.error("[focus-core] Failed to load focus tree from ATOMS API",r),gs({}),[3,3];case 3:return[2]}})})},e.prototype.hasPublishedDataVersion=function(e){return function(e,t){var n=Zu("version",e);return null!=t.getString(n)}(e,this.storage)},e.prototype.setupOfflineMaps=function(e,t){return I(this,void 0,void 0,function(){var n,r,i,o;return z(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,Ju({URL:this.empApi,accessToken:this.atomsAPIAccessToken,secretKey:this.secretKeyForDecryption,publishedDataType:Bu.MBTiles,roleName:this.tileserverRoleName},this.storage,t)];case 1:return n=a.sent(),[4,Ju({URL:this.empApi,accessToken:this.atomsAPIAccessToken,secretKey:this.secretKeyForDecryption,publishedDataType:Bu.Fonts,roleName:this.tileserverRoleName},this.storage,t)];case 2:return r=a.sent(),console.log("Offline Map & fonts status:",n,r),i=n===Uu.Ready&&r===Uu.Ready,this.offlineMapStatus=i?Uu.Ready:Uu.Unavailable,this.emitReadinessChange(),e&&e(this.offlineMapStatus===Uu.Ready),[2,i];case 3:return o=a.sent(),console.error("Error setting up offline maps:",o),this.offlineMapStatus=Uu.Unavailable,this.emitReadinessChange(),e&&e(!1),[3,4];case 4:return[2]}})})},e.prototype.getOfflineMapStatus=function(){return this.offlineMapStatus},e.prototype.setupRouting=function(e){return I(this,void 0,void 0,function(){var t;return z(this,function(n){switch(n.label){case 0:return[4,Ju({URL:this.empApi,accessToken:this.atomsAPIAccessToken,secretKey:this.secretKeyForDecryption,publishedDataType:Bu.Routing,roleName:this.tileserverRoleName},this.storage)];case 1:return t=n.sent(),this.routingStatus=t,this.emitReadinessChange(),console.log("routing status: ",t),e&&e(t===Uu.Ready),[2]}})})},e.prototype.getRoutingStatus=function(){return this.routingStatus},e.prototype.getReadiness=function(){var e=[];return this.routingStatus!==Uu.Ready&&e.push(Bu.Routing),this.searchStatus!==Uu.Ready&&e.push(Bu.MapObjects),this.offlineMapStatus!==Uu.Ready&&e.push(Bu.MBTiles),Js(e)},e.prototype.emitReadinessChange=function(){var e;null===(e=this.onReadinessChange)||void 0===e||e.call(this)},e.prototype.setLastClickedFeature=function(e){return this.lastClicked=e,this.lastClicked},e.prototype.hydrateClickedFeature=function(e){var t,n,r,i,o,a,s,l,u,c,h,d=null!==(r=null!==(t=e.mapObjectId)&&void 0!==t?t:null===(n=e.properties)||void 0===n?void 0:n.myMapObjectId)&&void 0!==r?r:null;if(null==d)return e;var p=this.searchableGeoJsonFeatures.find(function(e){var t,n,r=null!==(n=null===(t=e.properties)||void 0===t?void 0:t.myMapObjectId)&&void 0!==n?n:e.mapObjectId;return null!=r&&String(r)===String(d)});if(!(null==p?void 0:p.properties))return e;var f=function(e,t){var n,r,i,o,a,s,l=rc(e.metadata,t.metadata);return j(j(j(j({},e),t),{myMapObjectId:null!==(n=t.myMapObjectId)&&void 0!==n?n:e.myMapObjectId,title:null!==(r=t.title)&&void 0!==r?r:e.title,dimension_what:null!==(i=t.dimension_what)&&void 0!==i?i:e.dimension_what,dimension_where:null!==(o=t.dimension_where)&&void 0!==o?o:e.dimension_where,localRef:null!==(a=t.localRef)&&void 0!==a?a:e.localRef,booth_info:null!==(s=e.booth_info)&&void 0!==s?s:t.booth_info}),l?{metadata:l}:{})}(p.properties,null!==(i=e.properties)&&void 0!==i?i:{}),g=null!==(a=null!==(o=e.coordinates)&&void 0!==o?o:p.lngLat)&&void 0!==a?a:null;return{mapObjectId:String(d),coordinates:g,name:null!==(s=e.name)&&void 0!==s?s:"string"==typeof f.title?f.title:null,whatDimension:null!==(l=e.whatDimension)&&void 0!==l?l:"string"==typeof f.dimension_what?f.dimension_what:null,whereDimension:null!==(u=e.whereDimension)&&void 0!==u?u:"string"==typeof f.dimension_where?f.dimension_where:null,geometry:null!==(h=null!==(c=e.geometry)&&void 0!==c?c:p.geometry)&&void 0!==h?h:null,properties:f}},e.prototype.getLastClickedFeature=function(){var e=this.lastClicked;if(!this.lastClicked||this.lastClicked&&(null===this.lastClicked.name||null===this.lastClicked.whereDimension)){e=this.setLastClickedFeature({mapObjectId:null,coordinates:null,name:null,whatDimension:null,whereDimension:null,geometry:null,properties:null})}return e},e.prototype.isClickableFeature=function(e){return!!(e&&e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"isSearchable")&&e.properties.isSearchable&&"Transit"!==e.properties.title&&"Public"!==e.properties.title)},e.prototype.getMidPointOfFeature=function(e){if(!e)return null;if(e.lngLat)return e.lngLat;if(!e.geometry)return null;if("Point"===e.geometry.type)return e.geometry.coordinates;var t=me(e.geometry);if("LineString"===t.geometry.type||"MultiLineString"===t.geometry.type&&1==t.geometry.coordinates.length){var n=is(t=ye(e.geometry.coordinates));return pl(t,n/2,n).geometry.coordinates[0]}return function(e,t){void 0===t&&(t={});var n=dl(e);return ve([(n[0]+n[2])/2,(n[1]+n[3])/2],t.properties,t)}(t).geometry.coordinates},e.prototype.getFocusTree=function(){return ms()},e.prototype.getWhatTaxonomies=function(){if(this.searchStatus===Uu.Ready){for(var e=new Set,t=0,n=this.searchableGeoJsonFeatures;t<n.length;t++){var r=n[t];e.add(r.properties.dimension_what)}return Array.from(e)}return console.warn("getWhatTaxonomies called before Search APIs are ready"),[]},e.prototype.getCurrentFocus=function(){return ll().getCurrentFocus()},e.prototype.getCurrentFocusBuilding=function(){return ll().getCurrentFocusBuilding()},e.prototype.getCurrentFocusFloor=function(){return ll().getCurrentFocusFloor()},e.prototype.getUserViewportBuilding=function(e){return ll().getUserViewportBuilding(e)},e.prototype.checkUserViewport=function(e,t,n){return ll().checkUserViewport(e,t,n)},e.prototype.getFlyToLocation=function(e,t){return void 0===t&&(t=!0),ll().getFlyToLocation(e,t)},e.prototype.normalize=function(e){return e.trim().toLowerCase()},e.prototype.relevanceSort=function(e,t,n){function r(e){var r=[-1,0,e.name];if(e.name){var i=e.name.toLowerCase(),o=t.toLowerCase();return i===o?[1e3,-e.name.length,i]:i.startsWith(o)?[500,-e.name.length,i]:i.split(" ").some(function(e){return e.startsWith(o)})?[200,-e.name.length,i]:n?r:i.includes(o)?[0,-e.name.length,i]:r}return r}return void 0===n&&(n=!1),e.sort(function(e,t){var n=r(e),i=r(t);return i[0]-n[0]||i[1]-n[1]||n[2].localeCompare(i[2])}).filter(function(e){return r(e)[0]>=0})},e.prototype.sort=function(e,t,n){void 0===n&&(n="");var r=function(e,t){return e&&t?e.localeCompare(t):0};return t===ec.Name?e.sort(function(e,t){return r(e.name,t.name)}):t===ec.WhereDimension?e.sort(function(e,t){var n=r(e.whereDimension,t.whereDimension);return 0===n?r(e.name,t.name):n}):t===ec.Relevance?this.relevanceSort(e,n):t===ec.RelevanceStrict?this.relevanceSort(e,n,!0):void 0},e.prototype.setupMapObjectSearch=function(e){return I(this,void 0,void 0,function(){var t,n,r,i,o,a,s;return z(this,function(l){switch(l.label){case 0:return[4,Ju({URL:this.empApi,accessToken:this.atomsAPIAccessToken,secretKey:this.secretKeyForDecryption,publishedDataType:Bu.MapObjects,roleName:this.tileserverRoleName},this.storage)];case 1:for(t=l.sent(),this.searchStatus=t,this.emitReadinessChange(),console.log("search status: ",t),this.searchableGeoJsonFeatures=[],n=Gu.getState().data,r=0;r<n.length;r++)(i=n[r])&&(o=i,a=i.lngLat,s={mapObjectId:i.mID,lngLat:a,geometry:a?{type:"Point",coordinates:a}:i.geometry,properties:ic(o)},this.searchableGeoJsonFeatures.push(s));return e&&e(t===Uu.Ready),[2]}})})},e.prototype.getSearchStatus=function(){return this.searchStatus},e.prototype.createMetaFeature=function(e,t,n,r,i,o,a){return void 0===e&&(e=null),void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=null),void 0===o&&(o=null),void 0===a&&(a=null),{mapObjectId:e,coordinates:t,name:n,whatDimension:r,whereDimension:i,geometry:o,properties:null!=a?a:{},isSearchable:!0}},e.prototype.getAllMapObjects=function(e){for(var t,n,r,i=new Set,o=[],a=0,s=this.searchableGeoJsonFeatures;a<s.length;a++){var l=s[a],u=null===(t=l.properties)||void 0===t?void 0:t.myMapObjectId;if(null!=u&&!i.has(u)){i.add(u);var c=null!==(n=l.lngLat)&&void 0!==n?n:"Point"===(null===(r=l.geometry)||void 0===r?void 0:r.type)?l.geometry.coordinates:null;o.push(this.createMetaFeature(l.properties.myMapObjectId,c,l.properties.title,l.properties.dimension_what,l.properties.dimension_where,l.geometry,l.properties))}}e(o)},e.prototype.getMapObjectsByName=function(e,t,n,r){var i,o;void 0===t&&(t=!1);for(var a=new Set,s=[],l=this.normalize(e),u=0,c=this.searchableGeoJsonFeatures;u<c.length;u++){var h=c[u],d=h.properties.myMapObjectId,p=this.normalize(h.properties.title);if((!t||p.includes(l))&&((t||p===l)&&!a.has(d))){a.add(d);var f=null!==(i=h.lngLat)&&void 0!==i?i:"Point"===(null===(o=h.geometry)||void 0===o?void 0:o.type)?h.geometry.coordinates:null,g=this.createMetaFeature(h.properties.myMapObjectId,f,h.properties.title,h.properties.dimension_what,h.properties.dimension_where,h.geometry,h.properties);s.push(g)}}r(this.sort(s,n,e))},e.prototype.getMapObjectById=function(e,t){for(var n=[],r=0,i=this.searchableGeoJsonFeatures;r<i.length;r++){var o=i[r],a=o.properties.myMapObjectId;if(String(a)===String(e)){var s=this.createMetaFeature(o.properties.myMapObjectId,o.lngLat,o.properties.title,o.properties.dimension_what,o.properties.dimension_where,o.geometry,o.properties);n.push(s)}}t(n)},e.prototype.getMapObjectByLocalRef=function(e,t){for(var n=[],r=0,i=this.searchableGeoJsonFeatures;r<i.length;r++){var o=i[r],a=o.properties.localRef;if(String(a)===String(e)){var s=this.createMetaFeature(o.properties.myMapObjectId,o.lngLat,o.properties.title,o.properties.dimension_what,o.properties.dimension_where,o.geometry,o.properties);n.push(s)}}t(n)},e.prototype.getMapObjectsByWhatTaxonomy=function(e,t){for(var n=[],r=0,i=this.searchableGeoJsonFeatures;r<i.length;r++){var o=i[r],a=o.properties.dimension_what;if(String(a)===String(e)){var s=this.createMetaFeature(o.properties.myMapObjectId,o.lngLat,o.properties.title,o.properties.dimension_what,o.properties.dimension_where,o.geometry,o.properties);n.push(s)}}t(n)},e.prototype.getMapObjectsByWhereTaxonomy=function(e,t){for(var n=[],r=0,i=this.searchableGeoJsonFeatures;r<i.length;r++){var o=i[r],a=o.properties.dimension_where;if(String(a)===String(e)){var s=this.createMetaFeature(o.properties.myMapObjectId,o.lngLat,o.properties.title,o.properties.dimension_what,o.properties.dimension_where,o.geometry,o.properties);n.push(s)}}t(n)},e.prototype.getMapObjectsByWhatAndWhereTaxonomy=function(e,t,n){for(var r=[],i=0,o=this.searchableGeoJsonFeatures;i<o.length;i++){var a=o[i],s=a.properties.dimension_where,l=a.properties.dimension_what;if(String(s)===String(t)&&String(l)===String(e)){var u=this.createMetaFeature(a.properties.myMapObjectId,a.lngLat,a.properties.title,a.properties.dimension_what,a.properties.dimension_where,a.geometry,a.properties);r.push(u)}}n(r)},e.prototype.getMapObjectsInWhatTaxonomy=function(e,t){for(var n=[],r=0,i=this.searchableGeoJsonFeatures;r<i.length;r++){var o=i[r],a=o.properties.dimension_what;if(e.includes(String(a))){var s=this.createMetaFeature(o.properties.myMapObjectId,o.lngLat,o.properties.title,o.properties.dimension_what,o.properties.dimension_where,o.geometry,o.properties);n.push(s)}}t(n)},e.prototype.getMapObjectsInWhereTaxonomy=function(e,t){for(var n=[],r=0,i=this.searchableGeoJsonFeatures;r<i.length;r++){var o=i[r],a=o.properties.dimension_where;if(e.includes(String(a))){var s=this.createMetaFeature(o.properties.myMapObjectId,o.lngLat,o.properties.title,o.properties.dimension_what,o.properties.dimension_where,o.geometry,o.properties);n.push(s)}}t(n)},e.prototype.getMapObjectsInWhatAndWhereTaxonomy=function(e,t,n){for(var r=[],i=0,o=this.searchableGeoJsonFeatures;i<o.length;i++){var a=o[i],s=a.properties.dimension_where,l=a.properties.dimension_what;if(t.includes(String(s))&&e.includes(String(l))){var u=this.createMetaFeature(a.properties.myMapObjectId,a.lngLat,a.properties.title,a.properties.dimension_what,a.properties.dimension_where,a.geometry,a.properties);r.push(u)}}n(r)},e.prototype.geofence=function(e,t,n){var r=this;void 0===t&&(t=2),T({url:"".concat(this.empApi,"/geofence"),headers:{Authorization:"Bearer ".concat(this.atomsAPIAccessToken),"Content-Type":"application/json"},method:"POST",data:JSON.stringify({point:e,padding:t})}).then(function(e){return I(r,void 0,void 0,function(){var t;return z(this,function(r){return(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.searchableMOs)&&n(e.data.searchableMOs),[2]})})}).catch(function(e){console.log("error occured while geofencing",e),n([])})},e}(),ac=function(){function e(e){void 0===e&&(e={});var t,n,r,i,o=this;this.onCompassSensorUpdate=function(e){o.handleCompassUpdate(e)},this.cameraDirector=rl(),this.marker={show:function(){},hide:function(){},remove:function(){},update:function(){},updateHeading:function(){}},this.sensorsAttached=!1,this.markerAttached=!1,this.locationCallbacks=new Set,this.errorCallbacks=new Set,this.toggleCallbacks=new Set,this.compassCallbacks=new Set,this.lastProcessedPosition=null,this.lastExternalGpsPosition=null,this.lastAppliedPose=null,this.lastAppliedCameraStop=null,this.lastHeadingMarkerDeg=null,this.sdkMode="normal",this.follow=!0,this.headingFollow=!1,this.lastHeadingCameraUpdateMs=0,this.lastHeadingFollowCenterUpdateMs=0,this.lastHeadingCameraEaseDeg=null,this.lastCameraBearingUnwrapped=null,this.lastCameraUpdateMs=0,this.gps=null!==(t=e.gps)&&void 0!==t?t:qs(),this.compass=null!==(n=e.compass)&&void 0!==n?n:Zs(),this.motion=null!==(r=e.motion)&&void 0!==r?r:Ys(),this.getFocusTree=null!==(i=e.getFocusTree)&&void 0!==i?i:function(){return null},this.compass.addCallback({onCompassUpdate:this.onCompassSensorUpdate})}return e.prototype.attachSensors=function(e){this.installSensors(e),this.sensorsAttached=!0},e.prototype.detachSensors=function(){var e;this.gps.disableGPS(),this.compass.disableCompass(),null===(e=this.motion)||void 0===e||e.stop(),this.installSensors({gps:qs(),compass:Zs(),motion:Ys()}),this.sensorsAttached=!1},e.prototype.attachCameraDirector=function(e){var t=this;this.cameraDirector=e,e.attachFollowBreaker({breakFollow:function(){t.setFollow(!1)}})},e.prototype.detachCameraDirector=function(){this.cameraDirector.detachFollowBreaker(),this.cameraDirector=rl()},e.prototype.attachMarker=function(e){this.marker=e,this.markerAttached=!0},e.prototype.detachMarker=function(){this.marker={show:function(){},hide:function(){},remove:function(){},update:function(){},updateHeading:function(){}},this.markerAttached=!1},e.prototype.getReadiness=function(){var e=[];return this.sensorsAttached||e.push("sensors"),this.markerAttached||e.push("marker"),Js(e)},e.prototype.getSdkMode=function(){return this.sdkMode},e.prototype.getIsNavigating=function(){return"navigation"===this.sdkMode},e.prototype.isCompassPermissionDenied=function(){return this.compass.isCompassPermissionDenied()},e.prototype.enterNavigationMode=function(){this.clearNormalHeadingCameraFollowInternal({easeMapToNorthUp:!1}),this.sdkMode="navigation",this.follow=!0,this.marker.show()},e.prototype.enterNormalMode=function(){this.sdkMode="normal",this.follow=!0,this.marker.show(),this.marker.updateHeading(null),this.lastHeadingMarkerDeg=null},e.prototype.notifyUserGesture=function(){this.gps.isGPSEnabled()&&(this.follow=!1,this.emitToggle())},e.prototype.getCameraFollowState=function(){return"navigation"===this.sdkMode?{mode:"navigation",owner:"navigation",isFollowing:this.isFollowing()}:{mode:"normal",owner:"gps",isFollowing:this.gps.isGPSEnabled()&&this.isFollowing(),followsHeading:this.headingFollow}},e.prototype.applyPose=function(e){"navigation"===this.sdkMode&&this.writeMarker(e)},e.prototype.applyCameraStop=function(e,t){void 0===t&&(t={}),"navigation"===this.sdkMode&&this.commitCameraStop(e,t)},e.prototype.recenter=function(e){var t,n,r;return I(this,void 0,void 0,function(){var i,o,a;return z(this,function(s){switch(s.label){case 0:return this.follow=!0,this.emitToggle(),"navigation"===this.sdkMode?(i=this.lastAppliedCameraStop,o=this.lastAppliedPose,i||o?(a=(null==e?void 0:e.useDefaultZoom)?19:this.cameraDirector.getZoom()||(null==i?void 0:i.zoom)||19,this.commitCameraStop({center:null!==(t=null==i?void 0:i.center)&&void 0!==t?t:o.coordinates,bearing:null==i?void 0:i.bearing,pitch:null!==(n=null==i?void 0:i.pitch)&&void 0!==n?n:60,zoom:a,paddingFraction:null!==(r=null==i?void 0:i.paddingFraction)&&void 0!==r?r:{top:.3},durationMs:300,easing:"linear"},{force:!0}),[2]):[2]):[4,this.focusToGPS({flyToLocation:!0,duration:1e3})];case 1:return s.sent(),[2]}})})},e.prototype.addCallback=function(e){e.onLocationUpdate&&this.locationCallbacks.add(e.onLocationUpdate),e.onError&&this.errorCallbacks.add(e.onError),e.onToggle&&this.toggleCallbacks.add(e.onToggle),e.onCompassUpdate&&this.compassCallbacks.add(e.onCompassUpdate)},e.prototype.removeCallback=function(e){e.onLocationUpdate&&this.locationCallbacks.delete(e.onLocationUpdate),e.onError&&this.errorCallbacks.delete(e.onError),e.onToggle&&this.toggleCallbacks.delete(e.onToggle),e.onCompassUpdate&&this.compassCallbacks.delete(e.onCompassUpdate)},e.prototype.simulatePosition=function(e,t){void 0===t&&(t=5);var n={coordinates:e,accuracy:t,timestamp:Date.now()};this.applyGpsSample(n)},e.prototype.enableGPS=function(e){var t,n,r,i;return void 0===e&&(e={}),I(this,void 0,void 0,function(){var o,a,s,l,u,c=this;return z(this,function(h){switch(h.label){case 0:(null===(t=e.callbacks)||void 0===t?void 0:t.onLocationUpdate)&&this.locationCallbacks.add(e.callbacks.onLocationUpdate),(null===(n=e.callbacks)||void 0===n?void 0:n.onError)&&this.errorCallbacks.add(e.callbacks.onError),(null===(r=e.callbacks)||void 0===r?void 0:r.onToggle)&&this.toggleCallbacks.add(e.callbacks.onToggle),this.marker.show(),this.follow=!1!==e.trackUserLocation,h.label=1;case 1:return h.trys.push([1,9,,10]),[4,this.gps.isGPSPermissionGranted()];case 2:if(!h.sent())return o={type:"permission_denied",message:"GPS permission is required to enable location services."},this.fanoutError(o,o.message),[2,{success:!1,warning:o}];h.label=3;case 3:return h.trys.push([3,5,,6]),[4,this.compass.enableCompass()];case 4:case 5:return h.sent(),[3,6];case 6:return[4,this.gps.getGPSPosition(e)];case 7:return a=h.sent(),s=this.isPositionWithinBounds(a.coordinates),[4,this.gps.enableGPS(j(j({},e),{callbacks:{onLocationUpdate:function(t){var n;c.handleRealGPSUpdate(t,c.shouldFlyTo(e.flyToLocation),null!==(n=e.zoom)&&void 0!==n?n:18)},onError:function(e,t){c.fanoutError(e,t)},onToggle:function(e){c.toggleCallbacks.forEach(function(t){try{t(e)}catch(e){}})}}}))];case 8:return l=h.sent(),this.handleRealGPSUpdate(a,this.shouldFlyTo(e.flyToLocation),null!==(i=e.zoom)&&void 0!==i?i:18),l.success?s?[2,{success:!0}]:[2,{success:!0,warning:{type:"outside_bounds",message:"You are currently outside of operational boundaries. GPS functionality may be limited.",position:a}}]:[2,l];case 9:return u=h.sent(),this.fanoutError(u,"Failed to enable GPS due to an unexpected error."),[2,{success:!1,warning:{type:"unavailable",message:"Failed to enable GPS due to an unexpected error."}}];case 10:return[2]}})})},e.prototype.installSensors=function(e){var t;this.compass.removeCallback({onCompassUpdate:this.onCompassSensorUpdate}),this.gps=e.gps,this.compass=e.compass,this.motion=null!==(t=e.motion)&&void 0!==t?t:null,this.compass.addCallback({onCompassUpdate:this.onCompassSensorUpdate})},e.prototype.ensureRequiredSensors=function(e){var t,n,r;return I(this,void 0,void 0,function(){var i,o,a,s,l,u,c,h,d=this;return z(this,function(p){switch(p.label){case 0:if(!this.sensorsAttached)throw new Qs(["sensors"]);if(0===e.length)return[2,!0];i=e.includes("gps"),o=e.includes("compass"),a=e.includes("motion"),s=this.gps.isGPSEnabled(),l=this.compass.isCompassEnabled(),u=!1,c=!1,h=function(){u&&d.disableGPS(),c&&d.compass.disableCompass()},p.label=1;case 1:return p.trys.push([1,10,,11]),!i||s?[3,3]:[4,this.enableGPS({flyToLocation:!0,trackUserLocation:!0})];case 2:if(!p.sent().success)return[2,!1];u=!0,p.label=3;case 3:return!o||l?[3,5]:[4,this.compass.enableCompass()];case 4:if(!p.sent())return h(),[2,!1];c=!0,p.label=5;case 5:return a?[4,null===(n=null===(t=this.motion)||void 0===t?void 0:t.requestPermission)||void 0===n?void 0:n.call(t)]:[3,7];case 6:if(!(null===(r=p.sent())||void 0===r||r))return h(),[2,!1];p.label=7;case 7:return i?[4,this.gps.getGPSPosition({enableHighAccuracy:!0,timeout:1e4,maximumAge:5e3})]:[3,9];case 8:if(!p.sent())return h(),[2,!1];p.label=9;case 9:return[2,!0];case 10:return p.sent(),h(),[2,!1];case 11:return[2]}})})},e.prototype.disableGPS=function(){this.clearNormalHeadingCameraFollowInternal({easeMapToNorthUp:!0}),this.compass.disableCompass(),this.gps.disableGPS(),this.follow=!0,this.lastProcessedPosition=null,this.lastAppliedPose=null,this.lastAppliedCameraStop=null,this.lastHeadingMarkerDeg=null,this.lastHeadingCameraEaseDeg=null,this.lastCameraBearingUnwrapped=null,this.marker.hide(),this.emitToggle()},e.prototype.requestGPSPermission=function(){return I(this,void 0,void 0,function(){return z(this,function(e){return[2,this.gps.requestGPSPermission()]})})},e.prototype.isGPSPermissionGranted=function(){return I(this,void 0,void 0,function(){return z(this,function(e){return[2,this.gps.isGPSPermissionGranted()]})})},e.prototype.focusToGPS=function(e){var t,n,r;return void 0===e&&(e={}),I(this,void 0,void 0,function(){var i,o,a,s,l,u,c,h;return z(this,function(d){if(i=e.zoom,o=e.duration,a=void 0===o?1e3:o,s=e.flyToLocation,l=void 0===s||s,this.follow=!0,this.emitToggle(),!(u=null!==(n=null===(t=this.lastProcessedPosition)||void 0===t?void 0:t.coordinates)&&void 0!==n?n:null===(r=this.lastAppliedPose)||void 0===r?void 0:r.coordinates))throw{type:"unavailable",message:"Unable to determine current location. GPS may not be available."};return l&&(void 0===(c=i)&&(h=this.cameraDirector.getZoom(),c=h>0?h:18),this.commitCameraStop({center:u,zoom:c,durationMs:a,easing:"ease"},{force:!0})),[2,{success:!0}]})})},e.prototype.setNormalHeadingCameraFollow=function(e){if(e){if("navigation"===this.sdkMode)return;if(!this.gps.isGPSEnabled()||!this.follow||this.compass.isCompassPermissionDenied())return;if(!this.compass.isCompassEnabled())return;this.headingFollow=!0;var t=this.compass.getCompassHeading();return null!=t&&Number.isFinite(t)&&(this.lastHeadingCameraEaseDeg=null,this.applyNormalHeading(t)),void this.emitToggle()}this.clearNormalHeadingCameraFollowInternal({easeMapToNorthUp:!0})},e.prototype.isNormalHeadingCameraFollowEnabled=function(){return this.headingFollow},e.prototype.clearNormalHeadingCameraFollowForNavigation=function(){this.clearNormalHeadingCameraFollowInternal({easeMapToNorthUp:!1})},e.prototype.isFollowing=function(){return this.follow},e.prototype.setFollow=function(e){this.follow=e,this.emitToggle()},e.prototype.getGPSPosition=function(e){return I(this,void 0,void 0,function(){var t;return z(this,function(n){switch(n.label){case 0:return[4,this.gps.getGPSPosition(e)];case 1:return t=n.sent(),this.lastProcessedPosition=t,[2,t]}})})},e.prototype.showBlueDot=function(){this.marker.updateHeading(null),this.lastHeadingMarkerDeg=null},e.prototype.hideBlueDot=function(){null!=this.lastHeadingMarkerDeg&&this.marker.updateHeading(this.lastHeadingMarkerDeg)},e.prototype.show=function(){this.marker.show()},e.prototype.hide=function(){this.marker.hide()},e.prototype.getCurrentPosition=function(){return this.lastProcessedPosition},e.prototype.getExternalGpsPosition=function(){var e,t=null===(e=this.lastExternalGpsPosition)||void 0===e?void 0:e.coordinates;return!t||t.length<2?null:{coordinates:[t[0],t[1]]}},e.prototype.isGPSEnabled=function(){return this.gps.isGPSEnabled()},e.prototype.isCompassEnabled=function(){return this.compass.isCompassEnabled()},e.prototype.getZoom=function(){return this.cameraDirector.getZoom()},e.prototype.startMotion=function(e){var t;null===(t=this.motion)||void 0===t||t.start(e)},e.prototype.stopMotion=function(){var e;null===(e=this.motion)||void 0===e||e.stop()},e.prototype.destroy=function(){var e;this.clearNormalHeadingCameraFollowInternal({easeMapToNorthUp:!1}),this.gps.destroyGPS(),this.compass.disableCompass(),null===(e=this.motion)||void 0===e||e.stop(),this.marker.remove(),this.locationCallbacks.clear(),this.errorCallbacks.clear(),this.toggleCallbacks.clear(),this.compassCallbacks.clear(),this.lastProcessedPosition=null,this.lastExternalGpsPosition=null,this.lastAppliedPose=null,this.lastAppliedCameraStop=null,this.detachCameraDirector(),this.detachMarker()},e.prototype.applyGpsSample=function(e){this.marker.show(),this.handleRealGPSUpdate(e,!1)},e.prototype.triggerGPSUpdate=function(e){this.gps.isGPSEnabled()?console.error("Internal GPS is already enabled, skipping triggerGPSUpdate, please disable internal GPS first"):this.compass.isCompassEnabled()?console.error("Compass is already enabled, skipping triggerGPSUpdate, please disable compass first"):(this.lastExternalGpsPosition=function(e){return{coordinates:[e.coordinates[0],e.coordinates[1]],accuracy:e.accuracy,timestamp:e.timestamp||Date.now(),heading:e.heading,speed:e.speed,altitude:e.altitude,altitudeAccuracy:e.altitudeAccuracy}}(e),this.applyGpsSample(e),this.emitExternalHeading(e))},e.prototype.shouldFlyTo=function(e){return void 0===e&&(e=!0),this.follow&&e},e.prototype.handleRealGPSUpdate=function(e,t,n){var r,i,o;if(this.lastProcessedPosition={coordinates:[e.coordinates[0],e.coordinates[1]],accuracy:e.accuracy,timestamp:e.timestamp||Date.now(),heading:null!==(r=e.heading)&&void 0!==r?r:void 0,speed:null!==(i=e.speed)&&void 0!==i?i:void 0,altitude:e.altitude,altitudeAccuracy:e.altitudeAccuracy},this.locationCallbacks.forEach(function(t){try{t(e)}catch(e){}}),"navigation"!==this.sdkMode){var a=null!=this.lastHeadingMarkerDeg?this.lastHeadingMarkerDeg:null!==(o=e.heading)&&void 0!==o?o:null;this.writeMarker({coordinates:this.lastProcessedPosition.coordinates,accuracy:e.accuracy,heading:a}),this.headingFollow?this.syncHeadingFollowCenterFromGps():t&&this.focusToGPS({zoom:n,flyToLocation:t}).catch(function(){})}},e.prototype.handleCompassUpdate=function(e){this.compassCallbacks.forEach(function(t){try{t(e)}catch(e){}}),this.compass.isCompassPermissionDenied()||this.gps.isGPSEnabled()&&"navigation"!==this.sdkMode&&this.applyNormalHeading(e.heading)},e.prototype.applyNormalHeading=function(e){var t,n,r;if(null===e||!Number.isFinite(e))return this.lastHeadingMarkerDeg=null,this.lastHeadingCameraEaseDeg=null,this.lastCameraBearingUnwrapped=null,void this.marker.updateHeading(null);var i=null===(t=this.lastProcessedPosition)||void 0===t?void 0:t.coordinates,o=null!==(r=null===(n=this.lastProcessedPosition)||void 0===n?void 0:n.accuracy)&&void 0!==r?r:5;if(i?this.writeMarker({coordinates:i,accuracy:o,heading:e}):this.writeHeadingOnly(e),this.headingFollow&&this.follow&&"navigation"!==this.sdkMode&&!(null!==this.lastHeadingCameraEaseDeg&&sc(e,this.lastHeadingCameraEaseDeg)<3)&&i&&!(i.length<2)){var a=Date.now();if(!(a-this.lastHeadingCameraUpdateMs<48)){this.lastHeadingCameraUpdateMs=a,this.lastHeadingCameraEaseDeg=e;var s=this.unwrapCameraBearing(e);this.commitCameraStop({center:i,bearing:s,pitch:56,zoom:this.cameraDirector.getZoom()||18,paddingFraction:{top:.22},durationMs:280,easing:"linear"})}}},e.prototype.commitCameraStop=function(e,t){if(void 0===t&&(t={}),this.follow){var n=Date.now();!t.force&&n-this.lastCameraUpdateMs<48||(this.lastCameraUpdateMs=n,this.lastAppliedCameraStop=e,this.cameraDirector.submit(e,"user-location"))}},e.prototype.writeHeadingOnly=function(e){(null===this.lastHeadingMarkerDeg||sc(e,this.lastHeadingMarkerDeg)>=3)&&(this.marker.updateHeading(e),this.lastHeadingMarkerDeg=e)},e.prototype.writeMarker=function(e){var t=null!=e.heading&&Number.isFinite(e.heading)?e.heading:null;if(null==t)return this.marker.update(e.coordinates,e.accuracy,null),void(this.lastAppliedPose={coordinates:e.coordinates,accuracy:e.accuracy,heading:null});var n=null===this.lastHeadingMarkerDeg||sc(t,this.lastHeadingMarkerDeg)>=3,r=n?t:this.lastHeadingMarkerDeg;this.marker.update(e.coordinates,e.accuracy,r),n&&(this.lastHeadingMarkerDeg=t),this.lastAppliedPose={coordinates:e.coordinates,accuracy:e.accuracy,heading:r}},e.prototype.syncHeadingFollowCenterFromGps=function(){var e;if(this.headingFollow&&this.gps.isGPSEnabled()&&this.follow&&"navigation"!==this.sdkMode){var t=null===(e=this.lastProcessedPosition)||void 0===e?void 0:e.coordinates;if(t&&!(t.length<2)){var n=Date.now();n-this.lastHeadingFollowCenterUpdateMs<48||(this.lastHeadingFollowCenterUpdateMs=n,this.commitCameraStop(j(j({center:t},null!=this.lastCameraBearingUnwrapped?{bearing:this.lastCameraBearingUnwrapped}:{}),{pitch:56,durationMs:200,easing:"linear"})))}}},e.prototype.clearNormalHeadingCameraFollowInternal=function(e){var t,n=this.headingFollow;if(this.headingFollow=!1,this.lastHeadingCameraEaseDeg=null,n&&e.easeMapToNorthUp){var r=null===(t=this.lastProcessedPosition)||void 0===t?void 0:t.coordinates;if(r){var i=this.unwrapCameraBearing(0);this.commitCameraStop({center:r,bearing:i,pitch:0,durationMs:400,easing:"ease"},{force:!0})}}this.lastCameraBearingUnwrapped=null,n&&this.emitToggle()},e.prototype.unwrapCameraBearing=function(e){var t=this.lastCameraBearingUnwrapped;if(null==t)return this.lastCameraBearingUnwrapped=e,e;var n=t+function(e,t){var n=(e%360+360)%360,r=(t%360+360)%360-n;r>180&&(r-=360);r<-180&&(r+=360);return r}(t,e);return this.lastCameraBearingUnwrapped=n,n},e.prototype.isPositionWithinBounds=function(e){var t,n=this.getFocusTree();if(!n||"object"!==te(n))return!1;for(var r=e[0],i=e[1],o=0,a=Object.keys(n);o<a.length;o++){var s=n[a[o]],l=null==s?void 0:s.bounds;if(l&&Array.isArray(l))try{if(2===l.length&&Array.isArray(l[0])&&"number"==typeof l[0][0]&&Array.isArray(l[1])&&"number"==typeof l[1][0]&&!Array.isArray(l[0][0])){var u=l[0],c=l[1];if(r>=u[0]&&r<=c[0]&&i>=u[1]&&i<=c[1])return!0;continue}var h=Array.isArray(null===(t=l[0])||void 0===t?void 0:t[0])?l[0]:l;if(!Array.isArray(h)||h.length<3)continue;for(var d=1/0,p=1/0,f=-1/0,g=-1/0,m=0,v=h;m<v.length;m++){var y=v[m];Array.isArray(y)&&"number"==typeof y[0]&&(d=Math.min(d,y[0]),p=Math.min(p,y[1]),f=Math.max(f,y[0]),g=Math.max(g,y[1]))}if(Number.isFinite(d)&&r>=d&&r<=f&&i>=p&&i<=g)return!0}catch(e){continue}}return!1},e.prototype.emitToggle=function(){var e=this.gps.isGPSEnabled()&&this.isFollowing();this.toggleCallbacks.forEach(function(t){try{t(e)}catch(e){}})},e.prototype.fanoutError=function(e,t){this.errorCallbacks.forEach(function(n){try{n(e,t)}catch(e){}})},e.prototype.emitExternalHeading=function(e){if(void 0!==e.heading&&null!==e.heading){var t=e.heading,n={heading:t,accuracy:e.accuracy?Math.round(e.accuracy):null,timestamp:Date.now(),isCalibrated:Number.isFinite(t)};this.compassCallbacks.forEach(function(e){try{e(n)}catch(e){}})}},e}();function sc(e,t){var n=Math.abs(e-t)%360;return n>180?360-n:n}function lc(e){var t=JSON.parse(e);if(!Array.isArray(t))throw new Error("Dead zones JSON must be a top-level array");for(var n=0,r=t;n<r.length;n++){var i=r[n];if(!i||"object"!==te(i)||"string"!=typeof i.id)throw new Error("Each dead zone must have a string id");var o=i.geometry;if(!o||"Polygon"!==o.type||!Array.isArray(o.coordinates))throw new Error("Dead zone ".concat(i.id,": geometry must be GeoJSON Polygon"))}return t}function uc(e,t,n){if(!n.length)return null;for(var r=ve(e),i=0,o=n;i<o.length;i++){var a=o[i],s=a.whereDimension;if(null==s||""===s||t&&s===t)try{if(Ws(r,a.geometry))return a}catch(e){continue}}return null}var cc=function(e,t){for(var n=t-e;n>180;)n-=360;for(;n<-180;)n+=360;return n},hc=function(e){for(var t=e;t<0;)t+=360;for(;t>=360;)t-=360;return t};function dc(e,t){var n,r;void 0===t&&(t={});var i=null!==(n=t.turnAngleMinDeg)&&void 0!==n?n:22,o=null!==(r=t.minLegM)&&void 0!==r?r:3;if(!e||e.length<2)return[];for(var a=function(e){for(var t=[0],n=1;n<e.length;n+=1){var r=e[n-1],i=e[n];t.push(t[n-1]+sa(r,i,{units:"meters"}))}return t}(e),s=e.length,l=[],u=1;u<s-1;u+=1){var c=la(e[u-1],e[u]),h=la(e[u],e[u+1]);Math.abs(cc(c,h))>=i&&l.push(u)}for(var d=[],p=0,f=0,g=l;f<g.length;f++){var m=g[f],v=m;if(!(v<=p)){var y=e[p],w=e[v],b=a[v]-a[p],_=la(y,w);d.push({type:"straight",lengthM:b,bearingDeg:hc(_),startAlongM:a[p],endAlongM:a[v]});c=la(e[m-1],e[m]),h=la(e[m],e[m+1]);var x=cc(c,h);d.push({type:"turn",atAlongM:a[m],entryBearingDeg:hc(c),exitBearingDeg:hc(h),turnAngleDeg:x}),p=m}}if(p<s-1){y=e[p],w=e[s-1],b=a[s-1]-a[p],_=la(y,w);d.push({type:"straight",bearingDeg:hc(_),lengthM:b,startAlongM:a[p],endAlongM:a[s-1]})}return function(e,t){if(0===e.length||t<=0)return e;for(var n=[],r=0;r<e.length;r+=1){var i=e[r];if("straight"===i.type&&i.lengthM<t&&n.length>0){var o=n[n.length-1];if("straight"===o.type){n[n.length-1]={type:"straight",lengthM:o.lengthM+i.lengthM,bearingDeg:i.bearingDeg,startAlongM:o.startAlongM,endAlongM:i.endAlongM};continue}}n.push(i)}return n}(d,o)}function pc(e,t,n){if(!e.length||n<=0)return null;for(var r=Math.max(0,Math.min(t,n)),i=null,o=0,a=e;o<a.length;o++){var s=a[o];if("straight"===s.type){if(r>=s.startAlongM&&r<=s.endAlongM+1e-6)return s.bearingDeg;i=s.bearingDeg}}for(var l=e.length-1;l>=0;l-=1)if("straight"===e[l].type)return e[l].bearingDeg;return i}function fc(e,t){for(var n=Math.max(0,t),r=-1,i=0;i<e.length;i+=1){var o=e[i];if("straight"===o.type&&(r+=1,n>=o.startAlongM&&n<=o.endAlongM+1e-6))return r}return Math.max(0,r)}var gc=new Map;function mc(e,t,n){var r,i,o="".concat(e,"|").concat(function(e){for(var t=0,n=0;n<e.length;n+=1){var r=e[n];t=(t<<5)-t+(1e6*r[0]+r[1])*(n+1)|0}return String(t)}(t),"|").concat(null!==(r=null==n?void 0:n.turnAngleMinDeg)&&void 0!==r?r:"","|").concat(null!==(i=null==n?void 0:n.minLegM)&&void 0!==i?i:""),a=gc.get(o);return a||(a=dc(t,n),gc.set(o,a)),a}function vc(e){return e.length<2?0:is(ye(e),{units:"meters"})}function yc(e,t,n){for(var r=e,i=t-r;i>180;)i-=360;for(;i<-180;)i+=360;for(var o=r+i*n;o<0;)o+=360;for(;o>=360;)o-=360;return o}function wc(e,t){var n,r,i,o;if(!(null===(n=null==e?void 0:e.segments)||void 0===n?void 0:n.length))return null;for(var a=t.whereDimension,s=t.forwardFloor,l=t.requireWhereDimensionMatch,u=[],c=function(e,t){return Math.abs(e[0]-t[0])<1e-7&&Math.abs(e[1]-t[1])<1e-7},h=Math.max(0,s);h<e.segments.length;h+=1){var d=e.segments[h];if(d.maneuverType!==mu.RouteOverview&&d.maneuverType!==mu.SectionOverview&&(!l||!a||d.whereDimension===a)){var p=null!==(i=null===(r=d.features)||void 0===r?void 0:r.find(function(e){var t;return"LineString"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}))&&void 0!==i?i:null===(o=d.features)||void 0===o?void 0:o[1];if(p&&"LineString"===p.geometry.type){var f=p.geometry.coordinates;if(!(f.length<2)){var g=0;u.length>0&&c(u[u.length-1],f[0])&&(g=1);for(var m=g;m<f.length;m+=1)u.push(f[m])}}}}if(u.length<2)return null;var v=ye(u,{});return is(v,{units:"meters"})<=0?null:{line:v}}var bc=function(){function e(){this.built=null,this.snapped=!1,this.lastAlongM=0,this.lastDisplay=null,this.lastDisplayHeadingDeg=null,this.lastRawFix=null,this.lightSmoothRaw=null,this.transitionBlend=0,this.lastDebugSnapshot=null}return e.prototype.reset=function(){this.built=null,this.snapped=!1,this.lastAlongM=0,this.lastDisplay=null,this.lastDisplayHeadingDeg=null,this.lastRawFix=null,this.lightSmoothRaw=null,this.transitionBlend=0,this.lastDebugSnapshot=null},e.prototype.getDebugSnapshot=function(){return this.lastDebugSnapshot},e.prototype.setTrackingLine=function(e){this.built=e,e||(this.snapped=!1)},e.prototype.seedFromEnginePose=function(e,t,n){var r;this.lastDisplayHeadingDeg=null;var i=this.confidenceFromAccuracy(t),o=this.scaledThresholds(t),a=o.enter,s=o.exit;if(!this.built||this.built.line.geometry.coordinates.length<2){this.lastDisplay=null,this.lastDisplayHeadingDeg=null;var l=this.smoothUnsnapped(e,t);this.lastDisplay=l,this.snapped=!1,this.lastAlongM=0,this.lastRawFix={coords:e,t:n},this.lightSmoothRaw=B([],e,!0),this.transitionBlend=0;var u=Math.max(t,5);return this.lastDebugSnapshot={hasTrackingLine:!1,trackingLineLengthM:0,snapped:!1,reportedAccuracyM:t,accuracyForScalingM:u,enterThresholdM:a,exitThresholdM:s,rawDistanceToRouteM:1/0,smoothedDistanceForEnterM:1/0,lastAlongRouteM:this.lastAlongM,standstill:!1,confidence:i,routeHeadingDeg:null},{displayCoords:l,snapped:!1,rawDistanceToRouteM:1/0,displayHeadingDeg:null,confidence:i}}var c=this.built.line,h=is(c,{units:"meters"}),d=rs(c,ve(e),{units:"meters"}),p=null!==(r=d.properties.dist)&&void 0!==r?r:1/0;this.lightSmoothRaw=B([],e,!0);var f=p,g=this.snapped;this.snapped?p>s&&(g=!1,this.transitionBlend=1):f<=a&&(g=!0,this.transitionBlend=1),this.lastRawFix={coords:e,t:n};var m,v=Math.max(0,Math.min(h,d.properties.location));this.lastAlongM=v;var y=null;if(g){var w=xu(c,v,{units:"meters"}).geometry.coordinates,b=la(w,xu(c,Math.min(v+5,h),{units:"meters"}).geometry.coordinates);for(Number.isFinite(b)||(b=0);b<0;)b+=360;for(;b>=360;)b-=360;null===this.lastDisplayHeadingDeg?this.lastDisplayHeadingDeg=b:this.lastDisplayHeadingDeg=yc(this.lastDisplayHeadingDeg,b,.22+.12*(1-i)),y=this.lastDisplayHeadingDeg,m=w}else this.lastDisplayHeadingDeg=null,this.lastDisplay=null,m=this.smoothUnsnapped(e,t),y=null;this.snapped=g,this.lastDisplay=m;var _=Math.max(t,5);return this.lastDebugSnapshot={hasTrackingLine:!0,trackingLineLengthM:h,snapped:this.snapped,reportedAccuracyM:t,accuracyForScalingM:_,enterThresholdM:a,exitThresholdM:s,rawDistanceToRouteM:p,smoothedDistanceForEnterM:f,lastAlongRouteM:this.lastAlongM,standstill:!1,confidence:i,routeHeadingDeg:y},{displayCoords:m,snapped:this.snapped,rawDistanceToRouteM:p,displayHeadingDeg:y,confidence:i}},e.prototype.confidenceFromAccuracy=function(e){var t=Math.max(e,5);return Math.max(0,Math.min(1,1-(t-5)/45))},e.prototype.scaledThresholds=function(e){var t=Math.max(e,5);return{enter:14+.45*t,exit:Math.max(20,26+.75*t)}},e.prototype.update=function(e,t,n){var r,i,o=this.confidenceFromAccuracy(t),a=this.scaledThresholds(t),s=a.enter,l=a.exit;if(!this.built||this.built.line.geometry.coordinates.length<2){var u=this.smoothUnsnapped(e,t);this.lastDisplay=u,this.snapped=!1,this.lastRawFix={coords:e,t:n};var c=Math.max(t,5),h=this.scaledThresholds(t),d=h.enter,p=h.exit;return this.lastDebugSnapshot={hasTrackingLine:!1,trackingLineLengthM:0,snapped:!1,reportedAccuracyM:t,accuracyForScalingM:c,enterThresholdM:d,exitThresholdM:p,rawDistanceToRouteM:1/0,smoothedDistanceForEnterM:1/0,lastAlongRouteM:this.lastAlongM,standstill:!1,confidence:o,routeHeadingDeg:null},{displayCoords:u,snapped:!1,rawDistanceToRouteM:1/0,displayHeadingDeg:null,confidence:o}}var f=this.built.line,g=is(f,{units:"meters"}),m=rs(f,ve(e),{units:"meters"}),v=null!==(r=m.properties.dist)&&void 0!==r?r:1/0;if(this.lightSmoothRaw){c=.25+.35*(1-o);this.lightSmoothRaw=[this.lightSmoothRaw[0]*(1-c)+e[0]*c,this.lightSmoothRaw[1]*(1-c)+e[1]*c]}else this.lightSmoothRaw=B([],e,!0);var y=null!==(i=rs(f,ve(this.lightSmoothRaw),{units:"meters"}).properties.dist)&&void 0!==i?i:v,w=this.snapped;if(this.snapped)v>l&&(w=!1,this.transitionBlend=1);else if(y<=s){w=!0,this.transitionBlend=1;var b=m.properties.location;this.lastAlongM=Math.max(this.lastAlongM,b)}var _,x=!1;if(this.lastRawFix){var S=sa(this.lastRawFix.coords,e,{units:"meters"}),A=Math.max(0,n-this.lastRawFix.t);S<.85&&A<8e3&&(x=!0)}this.lastRawFix={coords:e,t:n};var P=null;if(w){var M=m.properties.location,C=void 0;if(x)C=this.lastAlongM;else{var T=Math.max(this.lastAlongM-3,M);C=Math.min(T,g),this.lastAlongM=C}var k=Math.max(0,Math.min(C,g)),E=xu(f,k,{units:"meters"}).geometry.coordinates,R=la(E,xu(f,Math.min(k+5,g),{units:"meters"}).geometry.coordinates);for(Number.isFinite(R)||(R=0);R<0;)R+=360;for(;R>=360;)R-=360;null===this.lastDisplayHeadingDeg?this.lastDisplayHeadingDeg=R:this.lastDisplayHeadingDeg=yc(this.lastDisplayHeadingDeg,R,.22+.12*(1-o)),P=this.lastDisplayHeadingDeg;var L=1+.2*(1-o);if(_=this.lastDisplay?[this.lastDisplay[0]*(1-L)+E[0]*L,this.lastDisplay[1]*(1-L)+E[1]*L]:E,this.transitionBlend>0&&this.lastDisplay&&!this.snapped){var D=.35;_=[_[0]*(1-D)+this.lastDisplay[0]*D,_[1]*(1-D)+this.lastDisplay[1]*D],this.transitionBlend=Math.max(0,this.transitionBlend-.25)}}else if(this.lastDisplayHeadingDeg=null,_=this.smoothUnsnapped(e,t),P=null,this.transitionBlend>0&&this.lastDisplay&&this.snapped){D=.35;_=[_[0]*(1-D)+this.lastDisplay[0]*D,_[1]*(1-D)+this.lastDisplay[1]*D],this.transitionBlend=Math.max(0,this.transitionBlend-.25)}this.snapped=w,this.lastDisplay=_;var F=Math.max(t,5);return this.lastDebugSnapshot={hasTrackingLine:!0,trackingLineLengthM:g,snapped:this.snapped,reportedAccuracyM:t,accuracyForScalingM:F,enterThresholdM:s,exitThresholdM:l,rawDistanceToRouteM:v,smoothedDistanceForEnterM:y,lastAlongRouteM:this.lastAlongM,standstill:x,confidence:o,routeHeadingDeg:P},{displayCoords:_,snapped:this.snapped,rawDistanceToRouteM:v,displayHeadingDeg:P,confidence:o}},e.prototype.smoothUnsnapped=function(e,t){var n=.88+.25*(1-this.confidenceFromAccuracy(t));if(!this.lastDisplay)return e;var r=this.lastDisplay[0]*(1-n)+e[0]*n,i=this.lastDisplay[1]*(1-n)+e[1]*n,o=sa(this.lastDisplay,[r,i],{units:"meters"});if(o>1){var a=1/o;r=this.lastDisplay[0]+(r-this.lastDisplay[0])*a,i=this.lastDisplay[1]+(i-this.lastDisplay[1])*a}return[r,i]},e.prototype.getSnapped=function(){return this.snapped},e}(),_c=function(){function e(){this.pieces=[],this.totalLenM=0,this.alongM=0,this.movementHeadingDeg=null,this.lastSampleMs=0,this.magSlow=9.81,this.lastPeakMs=0,this.lastBumpForPeak=0,this.stepLengthEma=.72,this.energyEma=0,this.stopSinceMs=null,this.straightIdx=0,this.turnConfirmForwardM=0,this.pendingTurnExitBearing=null}return e.prototype.reset=function(e){this.pieces=e.pieces,this.totalLenM=Math.max(0,e.totalLenM),this.alongM=Math.max(0,Math.min(e.startAlongM,this.totalLenM)),this.movementHeadingDeg=e.initialMovementHeadingDeg,this.lastSampleMs=0,this.magSlow=9.81,this.lastPeakMs=0,this.lastBumpForPeak=0,this.stepLengthEma=.72,this.energyEma=0,this.stopSinceMs=null,this.straightIdx=fc(this.pieces,this.alongM),this.turnConfirmForwardM=0,this.pendingTurnExitBearing=null},e.prototype.getAlongM=function(){return this.alongM},e.prototype.getMovementHeadingDeg=function(){return this.movementHeadingDeg},e.prototype.getStraightPieceIndex=function(){return this.straightIdx},e.prototype.feed=function(e){var t,n=e.timestampMs,r=this.lastSampleMs>0?Math.min(.2,Math.max(0,(n-this.lastSampleMs)/1e3)):0;this.lastSampleMs=n;var i=e.accelerationIncludingGravity,o=0;i&&(o=Math.sqrt(i.x*i.x+i.y*i.y+i.z*i.z)),this.magSlow=.92*this.magSlow+.08*o;var a=o-this.magSlow;this.energyEma=.9*this.energyEma+.1*Math.abs(a);var s=!1;i&&n-this.lastPeakMs>=380&&a>1.15&&a>.4*this.lastBumpForPeak&&(s=!0,this.lastPeakMs=n),this.lastBumpForPeak=a,this.energyEma<.35?this.stopSinceMs=null!==(t=this.stopSinceMs)&&void 0!==t?t:n:this.stopSinceMs=null;var l=!(null!=this.stopSinceMs&&n-this.stopSinceMs>900),u=pc(this.pieces,this.alongM,this.totalLenM),c=e.rotationRate;if(r>0&&l&&c&&null!=this.movementHeadingDeg){var h=c.gamma;if(Number.isFinite(h)){for(var d=this.movementHeadingDeg+h*r;d<0;)d+=360;for(;d>=360;)d-=360;this.movementHeadingDeg=d}}null!=u&&null==this.movementHeadingDeg&&(this.movementHeadingDeg=u),s&&null!=u&&null!=this.movementHeadingDeg&&(this.movementHeadingDeg=yc(this.movementHeadingDeg,u,.07));var p=0;if(null!=u&&null!=this.movementHeadingDeg){for(var f=u-this.movementHeadingDeg;f>180;)f-=360;for(;f<-180;)f+=360;p=Math.max(0,Math.cos(f*Math.PI/180))}else p=s?.55:0;if(this.updateTurnAnchorState(u,s?this.stepLengthEma*p:0),s&&l&&this.totalLenM>0){var g=this.stepLengthEma*p,m=Math.min(this.totalLenM,this.alongM+Math.max(0,g));if(p>.2&&m>this.alongM+.05){var v=(m-this.alongM)/Math.max(p,.2);this.stepLengthEma=.92*this.stepLengthEma+.08*v,this.stepLengthEma=Math.max(.45,Math.min(1.05,this.stepLengthEma))}this.alongM=m}return this.straightIdx=fc(this.pieces,this.alongM),{alongM:this.alongM,movementHeadingDeg:this.movementHeadingDeg,moving:l,straightPieceIndex:this.straightIdx,alignmentGain:p,stepDetected:s}},e.prototype.updateTurnAnchorState=function(e,t){var n=this,r=this.pieces.find(function(e){return"turn"===e.type&&n.alongM>=e.atAlongM-.5&&n.alongM<=e.atAlongM+2.5});if(r&&null!=e&&(this.pendingTurnExitBearing=r.exitBearingDeg),null!=this.pendingTurnExitBearing&&null!=this.movementHeadingDeg){for(var i=this.movementHeadingDeg-this.pendingTurnExitBearing;i>180;)i-=360;for(;i<-180;)i+=360;Math.abs(i)<42&&t>0?this.turnConfirmForwardM+=t:t>0&&(this.turnConfirmForwardM=Math.max(0,this.turnConfirmForwardM-.5*t)),this.turnConfirmForwardM>=1.2&&(this.pendingTurnExitBearing=null,this.turnConfirmForwardM=0)}},e}(),xc=function(){function e(e,t,n,r){var i,o=this;this.gpsCallbackRef=null,this.compassCallbackRef=null,this.unsubscribeFocus=null,this.uiHandlers={},this.lastEmittedSegmentIndex=-1,this.lerpedCoords=null,this.routeArc=[],this.currentRouteStep=0,this.targetRouteStep=0,this.routeSteps=500,this.animationSpeed=1,this.SNAP_WINDOW_METERS=5,this.OFF_ROUTE_THRESHOLD_METERS=25,this.REROUTE_COOLDOWN_MS=5e3,this.lastRerouteTime=0,this.lastKnownRemainingDistanceM=null,this.arrivalLockActive=!1,this.arrivalCameraFramingApplied=!1,this.navigationCompleteEmitted=!1,this.lastRawPosition=null,this.MIN_DISTANCE_FOR_VALID_HEADING_METERS=10,this.totalDistanceTraveled=0,this.currentHeading=null,this.currentPosition=null,this.cameraPitch=60,this.cameraZoomLevel=19,this.lastWhereUsedForTracking=null,this.isNavigating=!1,this.routeAlignedHeadingDeg=null,this.frozenUnsnappedHeadingDeg=null,this.navigationSnapped=!1,this.lastSnapStateForUi=!1,this.routeFollowingEstimator=new bc,this.routeTrackingEpoch=0,this.trackingLineCacheKey="",this.trackingLineCached=null,this.trackingLineLengthMCached=0,this.targetNavCoords=null,this.targetNavHeadingDeg=null,this.targetAlongMOnTrackingLine=null,this.targetAlongMCacheKey="",this.visualNavCoords=null,this.visualNavHeadingDeg=null,this.visualAlongMOnTrackingLine=null,this.visualAlongMCacheKey="",this.lastNavAccuracy=10,this.lastNavVisualFrameTime=0,this.lastAppliedVisualNavCoords=null,this.lastAppliedVisualHeadingDeg=null,this.tickNavVisual=function(){return o.runNavVisualFrame()},this.lastRouteProgressVisualMs=0,this.lastRouteSliceVisualNavCoords=null,this.lastBlueDotProgressVisualMs=0,this.lastAppliedRouteSliceSegmentIndex=-1,this.lastAppliedRouteSliceAlongM=-1,this.navigationLocMode="gps",this.deadZones=[],this.deadZonesUrl=null,this.deadZonesLoadPromise=null,this.activeDeadZoneId=null,this.deadZoneInsideConsecutive=0,this.pdrRawGpsOutsideConsecutive=0,this.lastDeadZoneModeSwitchMs=0,this.startAnchorLockActive=!1,this.startAnchorLockAnchorLngLat=null,this.startAnchorLockWhereTaxonomyPath=null,this.anchorPdrHandoffGoodFrames=0,this.anchorPdrBlendActive=!1,this.anchorPdrBlendW=0,this.anchorPdrBlendGpsTarget=null,this.anchorPdrLastBlendGpsTs=0,this.lastAnchorBlendBForOdom=null,this.qualityPdrBadConsecutive=0,this.qualityBlendRerouteSuppressed=!1,this.portalProgressHoldActive=!1,this.pdrLockedRouteSegmentIndex=-1,this.pdrAlongMeters=0,this.pdrLastAlongForDistanceM=null,this.pdrLockedLine=null,this.pdrEngine=new _c,this.pdrLastFeed=null,this.pdrNavigationAllowedByUi=!0,this.lastRouteFollowingConfidence=.75,this.routingManager=e,this.userLocation=t,this.autoFocusManager=n,(null==r?void 0:r.deadZonesUrl)&&(this.deadZonesUrl=r.deadZonesUrl),(null===(i=null==r?void 0:r.deadZones)||void 0===i?void 0:i.length)&&(this.deadZones=B([],r.deadZones,!0)),this.unsubscribeFocus=ll().subscribeToFocusChange(function(){o.onWhereTaxonomyUpdate()}),this.gpsCallbackRef=function(e){o.updateNavigationWithGPS(e)},this.userLocation.addCallback({onLocationUpdate:this.gpsCallbackRef}),this.compassCallbackRef=function(e){o.updateNavigationWithCompass(e)},this.userLocation.addCallback({onCompassUpdate:this.compassCallbackRef})}return e.prototype.getReadiness=function(){return Xs},e.prototype.focusedWhere=function(){return ll().getCurrentFocus()||null},e.prototype.emitUserPose=function(e){this.userLocation.applyPose(e)},e.prototype.emitUserCameraStop=function(e,t){this.userLocation.applyCameraStop(e,t)},e.prototype.setUIHandlers=function(e){this.uiHandlers=e||{}},e.prototype.setNavigationPdrOptions=function(e){void 0!==e.deadZonesUrl&&(this.deadZonesUrl=e.deadZonesUrl||null,this.deadZonesLoadPromise=null),void 0!==e.deadZones&&(this.deadZones=e.deadZones.length?B([],e.deadZones,!0):[])},e.prototype.setPdrNavigationAllowed=function(e){this.pdrNavigationAllowedByUi=e,e||"pdr"!==this.navigationLocMode||this.leavePdrMode()},e.prototype.getPdrNavigationDebug=function(){var e,t,n,r,i,o,a,s;return this.isNavigating?{mode:this.navigationLocMode,deadZoneId:this.activeDeadZoneId,anchorBlendActive:this.anchorPdrBlendActive,anchorBlendW:this.anchorPdrBlendW,lockedSegmentIndex:this.pdrLockedRouteSegmentIndex,pdrAlongMeters:this.pdrAlongMeters,subSegmentStraightIndex:null!==(t=null===(e=this.pdrLastFeed)||void 0===e?void 0:e.straightPieceIndex)&&void 0!==t?t:this.pdrEngine.getStraightPieceIndex(),movementHeadingDeg:this.pdrEngine.getMovementHeadingDeg(),moving:null!==(r=null===(n=this.pdrLastFeed)||void 0===n?void 0:n.moving)&&void 0!==r&&r,alignmentGain:null!==(o=null===(i=this.pdrLastFeed)||void 0===i?void 0:i.alignmentGain)&&void 0!==o?o:0,stepDetected:null!==(s=null===(a=this.pdrLastFeed)||void 0===a?void 0:a.stepDetected)&&void 0!==s&&s}:null},e.prototype.getSegmentLineStringFeature=function(e){var t,n,r,i,o=this.routingManager.getReferenceRouteForTracking(),a=null===(t=null==o?void 0:o.segments)||void 0===t?void 0:t[e];if(!a)return null;var s=null!==(r=null===(n=a.features)||void 0===n?void 0:n.find(function(e){var t;return"LineString"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}))&&void 0!==r?r:null===(i=a.features)||void 0===i?void 0:i[1];return s&&"LineString"===s.geometry.type?s:null},e.prototype.ensureDeadZonesLoaded=function(){return I(this,void 0,void 0,function(){var e=this;return z(this,function(t){switch(t.label){case 0:return this.deadZonesUrl?this.deadZonesLoadPromise?[4,this.deadZonesLoadPromise]:[3,2]:[2];case 1:case 3:return t.sent(),[2];case 2:return this.deadZonesLoadPromise=function(e){return I(this,void 0,void 0,function(){var t,n;return z(this,function(r){switch(r.label){case 0:return[4,fetch(e)];case 1:if(!(t=r.sent()).ok)throw new Error("Failed to load dead zones (".concat(t.status,"): ").concat(e));return n=lc,[4,t.text()];case 2:return[2,n.apply(void 0,[r.sent()])]}})})}(this.deadZonesUrl).then(function(t){e.deadZones=t}).catch(function(e){console.warn("[NavigationEngine] Failed to load dead zones",e)}),[4,this.deadZonesLoadPromise]}})})},e.prototype.leavePdrMode=function(){var e,t;if("pdr"===this.navigationLocMode){this.userLocation.stopMotion();var n=this.activeDeadZoneId;this.navigationLocMode="gps",this.resetAnchorPdrBlendState(),this.activeDeadZoneId=null,this.pdrLockedLine=null,this.pdrLockedRouteSegmentIndex=-1,this.pdrAlongMeters=0,this.pdrLastAlongForDistanceM=null,this.pdrLastFeed=null,this.pdrRawGpsOutsideConsecutive=0,this.lastDeadZoneModeSwitchMs=Date.now(),this.qualityBlendRerouteSuppressed=!1,null===(t=(e=this.uiHandlers).onNavigationLocModeChange)||void 0===t||t.call(e,"gps",null!=n?n:void 0)}},e.prototype.resetDeadZoneEvaluationState=function(){this.deadZoneInsideConsecutive=0,this.pdrRawGpsOutsideConsecutive=0,this.lastDeadZoneModeSwitchMs=0},e.prototype.resetAnchorPdrBlendState=function(){var e,t,n=this.anchorPdrBlendActive;this.anchorPdrBlendActive=!1,this.anchorPdrBlendW=0,this.anchorPdrBlendGpsTarget=null,this.anchorPdrLastBlendGpsTs=0,this.lastAnchorBlendBForOdom=null,this.anchorPdrHandoffGoodFrames=0,n&&(null===(t=(e=this.uiHandlers).onAnchorGpsBlendChange)||void 0===t||t.call(e,!1,0))},e.prototype.clearStartAnchorLock=function(){this.startAnchorLockActive=!1,this.startAnchorLockAnchorLngLat=null,this.startAnchorLockWhereTaxonomyPath=null,this.resetAnchorPdrBlendState()},e.prototype.configureStartAnchorLock=function(e){var t;this.clearStartAnchorLock();var n=null==e?void 0:e.startAnchorLngLat;n&&Number.isFinite(n[0])&&Number.isFinite(n[1])&&(this.startAnchorLockActive=!0,this.startAnchorLockAnchorLngLat=[n[0],n[1]],this.startAnchorLockWhereTaxonomyPath=null!==(t=null==e?void 0:e.lockWhereTaxonomyPath)&&void 0!==t?t:null)},e.prototype.evaluateStartAnchorLockScope=function(e){this.startAnchorLockActive&&this.startAnchorLockWhereTaxonomyPath&&this.focusedWhere()&&this.focusedWhere()!==this.startAnchorLockWhereTaxonomyPath&&this.clearStartAnchorLock()},e.prototype.tryEnterQualityRecoveryPdr=function(t,n,r){var i,o,a,s;if(!this.pdrNavigationAllowedByUi)return!1;if(this.arrivalLockActive)return!1;if(r-this.lastDeadZoneModeSwitchMs<e.DEAD_ZONE_MODE_SWITCH_COOLDOWN_MS)return!1;var l=null!==(a=null!==(o=null!==(i=this.visualNavCoords)&&void 0!==i?i:this.lerpedCoords)&&void 0!==o?o:this.targetNavCoords)&&void 0!==a?a:null===(s=this.currentPosition)||void 0===s?void 0:s.coordinates;if(!l||l.length<2)return!1;var u=sa(l,t.coordinates,{units:"meters"});return n>=e.QUALITY_PDR_BAD_ACCURACY_M||u>=e.QUALITY_PDR_MAX_RESIDUAL_M?(this.qualityPdrBadConsecutive+=1,!(this.qualityPdrBadConsecutive<e.QUALITY_PDR_CONSECUTIVE_BAD)&&(this.enterPdrFromRouteSeed(null,l)?(this.qualityPdrBadConsecutive=0,this.qualityBlendRerouteSuppressed=!0,!0):(this.qualityPdrBadConsecutive=0,!1))):(this.qualityPdrBadConsecutive=0,!1)},e.prototype.enterPdrFromRouteSeed=function(e,t){var n,r,i,o,a,s,l=this;if("pdr"===this.navigationLocMode)return!0;if(!this.pdrNavigationAllowedByUi)return!1;var u=this.routingManager.getReferenceRouteForTracking();if(!(null===(n=null==u?void 0:u.segments)||void 0===n?void 0:n.length))return!1;var c=null!==(i=null!==(r=null!=t?t:this.visualNavCoords)&&void 0!==r?r:this.lerpedCoords)&&void 0!==i?i:null===(o=this.currentPosition)||void 0===o?void 0:o.coordinates;if(!c)return!1;var h=this.findNearestSegmentIndexForCurrentWhere(u,c);this.maybeAdvanceLastEmittedSegmentIndex(h);var d=this.getSegmentLineStringFeature(h);if(!d)return!1;var p=d.geometry.coordinates;if(p.length<2)return!1;var f=vc(p);if(!(f>0))return!1;var g=rs(d,ve(c),{units:"meters"}),m=Math.max(0,Math.min(f,g.properties.location)),v=mc(h,p),y=pc(v,m,f);this.pdrLockedRouteSegmentIndex=h,this.pdrLockedLine=d,this.pdrAlongMeters=m,this.pdrLastAlongForDistanceM=m,this.activeDeadZoneId=e,this.navigationLocMode="pdr",this.lastDeadZoneModeSwitchMs=Date.now(),this.resetAnchorPdrBlendState(),this.pdrEngine.reset({totalLenM:f,startAlongM:m,pieces:v,initialMovementHeadingDeg:y});var w=xu(d,m,{units:"meters"});return this.setTargetNavCoords(w.geometry.coordinates),this.navigationSnapped=!0,this.routeAlignedHeadingDeg=y,this.frozenUnsnappedHeadingDeg=y,this.targetNavHeadingDeg=this.resolveNavigationHeadingTarget(),this.pdrLastFeed={moving:!1,alignmentGain:1,stepDetected:!1,straightPieceIndex:this.pdrEngine.getStraightPieceIndex()},this.userLocation.startMotion(function(e){return l.updateNavigationWithMotion(e)}),null===(s=(a=this.uiHandlers).onNavigationLocModeChange)||void 0===s||s.call(a,"pdr",null!=e?e:void 0),!0},e.prototype.tryEnterPdrMode=function(e,t){return this.enterPdrFromRouteSeed(e.id,t)},e.prototype.rebindPdrLockedLineAtSeed=function(e,t){var n,r,i;if("pdr"!==this.navigationLocMode)return!1;var o=this.routingManager.getReferenceRouteForTracking();if(!(null===(n=null==o?void 0:o.segments)||void 0===n?void 0:n.length))return this.leavePdrMode(),!1;var a=this.findNearestSegmentIndexForCurrentWhere(o,e);this.maybeAdvanceLastEmittedSegmentIndex(a);var s=this.getSegmentLineStringFeature(a);if(!s)return this.leavePdrMode(),!1;var l=s.geometry.coordinates;if(l.length<2)return this.leavePdrMode(),!1;var u=vc(l);if(!(u>0))return this.leavePdrMode(),!1;var c=rs(s,ve(e),{units:"meters"}),h=Math.max(0,Math.min(u,c.properties.location)),d=mc(a,l),p=pc(d,h,u);this.pdrLockedRouteSegmentIndex=a,this.pdrLockedLine=s,this.pdrAlongMeters=h,this.pdrLastAlongForDistanceM=h,this.activeDeadZoneId=t,null===t?this.resetAnchorPdrBlendState():this.anchorPdrHandoffGoodFrames=0,this.pdrEngine.reset({totalLenM:u,startAlongM:h,pieces:d,initialMovementHeadingDeg:p});var f=xu(s,h,{units:"meters"});return this.setTargetNavCoords(f.geometry.coordinates),this.navigationSnapped=!0,this.routeAlignedHeadingDeg=p,this.frozenUnsnappedHeadingDeg=p,this.targetNavHeadingDeg=this.resolveNavigationHeadingTarget(),this.pdrRawGpsOutsideConsecutive=0,this.pdrLastFeed={moving:!1,alignmentGain:1,stepDetected:!1,straightPieceIndex:this.pdrEngine.getStraightPieceIndex()},null===(i=(r=this.uiHandlers).onNavigationLocModeChange)||void 0===i||i.call(r,"pdr",null!=t?t:void 0),!0},e.prototype.rebindPdrToDeadZone=function(e,t){return this.rebindPdrLockedLineAtSeed(t,e.id)},e.prototype.getPdrPureCoords=function(){var e,t,n,r;return this.pdrLockedLine&&Number.isFinite(this.pdrAlongMeters)?xu(this.pdrLockedLine,this.pdrAlongMeters,{units:"meters"}).geometry.coordinates:null!==(r=null!==(t=null!==(e=this.visualNavCoords)&&void 0!==e?e:this.lerpedCoords)&&void 0!==t?t:null===(n=this.currentPosition)||void 0===n?void 0:n.coordinates)&&void 0!==r?r:[0,0]},e.prototype.anchorPdrReliabilityFromAccuracy=function(e){var t=Math.max(e,5);return Math.max(0,Math.min(1,1-(t-5)/45))},e.prototype.updateAnchorPdrBlendTowardGps=function(t,n,r){var i,o,a,s,l=t.coordinates,u=this.getBuiltTrackingLine();if(!u)return this.anchorPdrHandoffGoodFrames=0,!1;this.routeFollowingEstimator.setTrackingLine(u);var c=this.routeFollowingEstimator.update(l,n,r);if(this.lastRouteFollowingConfidence=c.confidence,c.snapped&&(this.anchorPdrBlendGpsTarget=[c.displayCoords[0],c.displayCoords[1]]),!this.anchorPdrBlendActive){if(c.snapped&&n<=e.ANCHOR_PDR_HANDOFF_MAX_ACCURACY_M&&c.confidence>=e.ANCHOR_PDR_HANDOFF_MIN_CONFIDENCE){if(this.anchorPdrHandoffGoodFrames+=1,this.anchorPdrHandoffGoodFrames>=e.ANCHOR_PDR_HANDOFF_CONSECUTIVE_GOOD){this.anchorPdrBlendActive=!0,this.anchorPdrBlendW=0,this.anchorPdrHandoffGoodFrames=0,this.anchorPdrLastBlendGpsTs=r;var h=this.getPdrPureCoords();this.lastAnchorBlendBForOdom=[h[0],h[1]],this.setTargetNavCoords(h),this.ensureNavVisualLoop(),null===(o=(i=this.uiHandlers).onAnchorGpsBlendChange)||void 0===o||o.call(i,!0,0)}}else this.anchorPdrHandoffGoodFrames=0;return!1}if(!this.anchorPdrBlendGpsTarget)return this.ensureNavVisualLoop(),!1;var d=(r-this.anchorPdrLastBlendGpsTs)/1e3;if((!Number.isFinite(d)||d<=0)&&(d=.12),d>2&&(d=.25),this.anchorPdrLastBlendGpsTs=r,c.snapped&&n<=e.ANCHOR_PDR_HANDOFF_MAX_ACCURACY_M){var p=this.anchorPdrReliabilityFromAccuracy(n),f=Math.min(.35,e.ANCHOR_PDR_BLEND_SPEED_PER_S*p*d);this.anchorPdrBlendW=Math.min(1,this.anchorPdrBlendW+f)}var g=this.getPdrPureCoords(),m=this.anchorPdrBlendGpsTarget,v=this.anchorPdrBlendW,y=[g[0]+(m[0]-g[0])*v,g[1]+(m[1]-g[1])*v];return this.setTargetNavCoords(y),this.lastAnchorBlendBForOdom&&(this.totalDistanceTraveled+=sa(this.lastAnchorBlendBForOdom,y,{units:"meters"})),this.lastAnchorBlendBForOdom=[y[0],y[1]],this.anchorPdrBlendW>=.995?this.completeAnchorBlendHandoff(c,t,n,r):(null===(s=(a=this.uiHandlers).onAnchorGpsBlendChange)||void 0===s||s.call(a,!0,this.anchorPdrBlendW),this.ensureNavVisualLoop(),!1)},e.prototype.completeAnchorBlendHandoff=function(e,t,n,r){var i,o,a=[e.displayCoords[0],e.displayCoords[1]];return this.leavePdrMode(),this.startAnchorLockActive&&(this.startAnchorLockActive=!1,this.startAnchorLockAnchorLngLat=null,this.startAnchorLockWhereTaxonomyPath=null),this.visualNavCoords=B([],a,!0),this.lerpedCoords=B([],a,!0),this.setTargetNavCoords(a),this.navigationSnapped=e.snapped,this.lastNavAccuracy=n,this.lastRawPosition={coords:t.coordinates,timestamp:r},e.snapped!==this.lastSnapStateForUi&&(this.lastSnapStateForUi=e.snapped,null===(o=(i=this.uiHandlers).onSnapStateChange)||void 0===o||o.call(i,e.snapped)),!0},e.prototype.updateNavigationWithMotion=function(e){if(this.isNavigating&&"pdr"===this.navigationLocMode&&this.pdrLockedLine){var t=this.pdrEngine.feed(e),n=null===this.activeDeadZoneId&&this.anchorPdrBlendActive;if(!n&&null!=this.pdrLastAlongForDistanceM&&Number.isFinite(this.pdrLastAlongForDistanceM)){var r=t.alongM-this.pdrLastAlongForDistanceM;r>0&&(this.totalDistanceTraveled+=r)}this.pdrLastAlongForDistanceM=t.alongM,this.pdrAlongMeters=t.alongM,this.pdrLastFeed={moving:t.moving,alignmentGain:t.alignmentGain,stepDetected:t.stepDetected,straightPieceIndex:t.straightPieceIndex};var i=xu(this.pdrLockedLine,t.alongM,{units:"meters"}).geometry.coordinates;if(n&&this.anchorPdrBlendGpsTarget){var o=this.anchorPdrBlendGpsTarget,a=this.anchorPdrBlendW,s=[i[0]+(o[0]-i[0])*a,i[1]+(o[1]-i[1])*a];this.setTargetNavCoords(s),this.lastAnchorBlendBForOdom&&(this.totalDistanceTraveled+=sa(this.lastAnchorBlendBForOdom,s,{units:"meters"})),this.lastAnchorBlendBForOdom=[s[0],s[1]]}else this.setTargetNavCoords(i);this.navigationSnapped=!0,this.ensureNavVisualLoop()}},e.prototype.resolveArrivalTargetFromRoute=function(e){var t,n,r,i,o;if(!(null===(t=null==e?void 0:e.segments)||void 0===t?void 0:t.length))return null;for(var a=e.segments.length-1;a>=0;a-=1){var s=e.segments[a];if(s.maneuverType!==mu.RouteOverview&&s.maneuverType!==mu.SectionOverview){var l=null===(n=s.features)||void 0===n?void 0:n.find(function(e){var t;return"Point"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}),u=null==l?void 0:l.geometry,c="Point"===(null==u?void 0:u.type)?u.coordinates:void 0;if(c&&Number.isFinite(c[0])&&Number.isFinite(c[1]))return[c[0],c[1]];var h=null!==(i=null===(r=s.features)||void 0===r?void 0:r.find(function(e){var t;return"LineString"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}))&&void 0!==i?i:null===(o=s.features)||void 0===o?void 0:o[1],d=null==h?void 0:h.geometry,p="LineString"===(null==d?void 0:d.type)?d.coordinates:void 0;if(p&&p.length>0){var f=p[p.length-1];if(Number.isFinite(f[0])&&Number.isFinite(f[1]))return[f[0],f[1]]}}}return null},e.prototype.applyArrivalCameraFraming=function(t,n){var r=la(t,n);for(Number.isFinite(r)||(r=0);r<0;)r+=360;for(;r>=360;)r-=360;this.emitUserCameraStop({center:n,bearing:r,pitch:e.ARRIVAL_CAMERA_PITCH,zoom:Math.max(e.ARRIVAL_CAMERA_ZOOM,this.userLocation.getZoom()),durationMs:1500,easing:"linear"})},e.prototype.maybeEnterArrivalLockAndFrame=function(e,t,n){var r,i;if(Number.isFinite(t)&&!(t>20||(this.arrivalLockActive||(this.arrivalLockActive=!0,this.navigationCompleteEmitted||(this.navigationCompleteEmitted=!0,null===(i=(r=this.uiHandlers).onNavigationComplete)||void 0===i||i.call(r))),this.arrivalCameraFramingApplied))){var o=this.resolveArrivalTargetFromRoute(n);o&&this.applyArrivalCameraFraming([e[0],e[1]],o),this.arrivalCameraFramingApplied=!0}},e.prototype.notifyReroute=function(e){this.leavePdrMode(),this.lastEmittedSegmentIndex=-1,this.lastKnownRemainingDistanceM=null,this.arrivalLockActive=!1,this.arrivalCameraFramingApplied=!1,this.navigationCompleteEmitted=!1,this.routeTrackingEpoch++,this.invalidateRouteTrackingCache(),this.lastAppliedRouteSliceSegmentIndex=-1,this.lastAppliedRouteSliceAlongM=-1,this.lastAppliedVisualNavCoords=null,this.lastAppliedVisualHeadingDeg=null,this.lastRouteSliceVisualNavCoords=null,this.lastBlueDotProgressVisualMs=0,this.autoFocusManager.resetPortalProposalSuppression(),this.uiHandlers.onReroute&&this.uiHandlers.onReroute(e)},e.prototype.invalidateRouteTrackingCache=function(){this.trackingLineCacheKey="",this.trackingLineCached=null,this.trackingLineLengthMCached=0,this.targetAlongMOnTrackingLine=null,this.targetAlongMCacheKey="",this.visualAlongMOnTrackingLine=null,this.visualAlongMCacheKey="",this.routeFollowingEstimator.reset()},e.prototype.getBuiltTrackingLine=function(){var e,t,n=this.routingManager.getReferenceRouteForTracking();if(!(null===(e=null==n?void 0:n.segments)||void 0===e?void 0:e.length))return null;var r=Math.max(0,this.lastEmittedSegmentIndex),i="".concat(this.routeTrackingEpoch,"|").concat(null!==(t=this.focusedWhere())&&void 0!==t?t:"","|").concat(r,"|").concat(n.segments.length);if(i===this.trackingLineCacheKey&&this.trackingLineCached)return this.trackingLineCached;var o=wc(n,{whereDimension:this.focusedWhere(),forwardFloor:r,requireWhereDimensionMatch:!0}),a=o?is(o.line,{units:"meters"}):0;return(!o||a<=0)&&(a=(o=wc(n,{whereDimension:this.focusedWhere(),forwardFloor:r,requireWhereDimensionMatch:!1}))?is(o.line,{units:"meters"}):0),this.trackingLineCacheKey=i,this.trackingLineCached=o,this.trackingLineLengthMCached=a,this.targetAlongMOnTrackingLine=null,this.targetAlongMCacheKey="",this.visualAlongMOnTrackingLine=null,this.visualAlongMCacheKey="",o},e.prototype.findNextNavigableSegmentIndex=function(e,t){if(!(null==e?void 0:e.length))return null;for(var n=t+1;n<e.length;n++){var r=e[n];if(r.maneuverType!==mu.RouteOverview&&r.maneuverType!==mu.SectionOverview)return n}return null},e.prototype.isPortalRouteSegment=function(e){if(e.isPortal)return!0;var t=e.maneuverType;return t===mu.EnterPortal||t===mu.TravelPortal||t===mu.ExitPortal},e.prototype.resolvePostPortalDestinationWhere=function(e,t){var n,r,i,o=e.segments,a=o.length;if(t<0||t>=a)return null;for(var s=t;s<a&&this.isPortalRouteSegment(o[s]);)s+=1;if(s<a){var l=null===(n=o[s])||void 0===n?void 0:n.whereDimension;if(l)return l}var u=s-1;if(u>=t){var c=null===(i=null===(r=o[u])||void 0===r?void 0:r.endEdge)||void 0===i?void 0:i.whereDimension;if(c)return c}return null},e.prototype.maybeProposePortalFloorChange=function(t,n,r,i){var o;if(this.autoFocusManager&&this.isNavigating&&null!=i&&!(i>e.PORTAL_PROPOSE_VICINITY_M)){var a=t.segments,s=this.findNextNavigableSegmentIndex(a,n),l=null,u=null;if(this.isPortalRouteSegment(r))l=n,u=r;else{if(null===s||!this.isPortalRouteSegment(a[s]))return;l=s,u=a[s]}var c=this.resolvePostPortalDestinationWhere(t,l);if(c&&c!==this.focusedWhere()){var h="".concat(l,":").concat(c),d=null===(o=u.instructions)||void 0===o?void 0:o[0];this.autoFocusManager.proposeFromNavigation({whereTaxonomyPath:c,portalDedupeKey:h,portal:{segmentIndex:l,instructionLine:d,portalName:u.portalName,description:u.description}}),i<=e.PORTAL_PROGRESS_HOLD_VICINITY_M&&(this.portalProgressHoldActive=!0)}}},e.prototype.findNearestSegmentIndexAlongRoute=function(e,t,n,r){var i=this,o=-1,a=1/0,s=null;return e.segments.forEach(function(e,l){var u,c,h;if(!(l<n)){var d=null!==(c=null===(u=e.features)||void 0===u?void 0:u.find(function(e){var t;return"LineString"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}))&&void 0!==c?c:null===(h=e.features)||void 0===h?void 0:h[1];if(e.maneuverType!==mu.RouteOverview&&e.maneuverType!==mu.SectionOverview&&d&&"LineString"===d.geometry.type&&(!r||e.whereDimension===i.focusedWhere())){var p=rs(d,t,{units:"meters"}),f=p.properties.dist;f<a&&(a=f,o=l,s=p.geometry.coordinates)}}}),{nearestIndex:o,minDistance:a,snappedCoords:s}},e.prototype.findNearestSegmentIndexForCurrentWhere=function(e,t){var n=Math.max(0,this.lastEmittedSegmentIndex),r=ve(t),i=this.findNearestSegmentIndexAlongRoute(e,r,n,!0).nearestIndex;return i>=0?i:n},e.prototype.maybeAdvanceLastEmittedSegmentIndex=function(e){var t,n;e<0||null===(n=(t=this.uiHandlers).onSegmentIndexChange)||void 0===n||n.call(t,e)},e.prototype.getCurrentPosition=function(){var e,t,n,r;return null!==(n=null!==(t=null!==(e=this.visualNavCoords)&&void 0!==e?e:this.lerpedCoords)&&void 0!==t?t:this.targetNavCoords)&&void 0!==n?n:null===(r=this.currentPosition)||void 0===r?void 0:r.coordinates},e.prototype.getNavigationPose=function(){var e,t,n=null!==(e=this.lerpedCoords)&&void 0!==e?e:null===(t=this.currentPosition)||void 0===t?void 0:t.coordinates;if(!n)return null;var r=null;return this.userLocation.isCompassPermissionDenied()||"number"!=typeof this.currentHeading||(r=this.currentHeading),{coordinates:n,headingDegrees:r,snapped:this.navigationSnapped,confidence:this.lastRouteFollowingConfidence}},e.prototype.getRouteFollowingDebug=function(){var t,n,r;if(!this.isNavigating)return null;var i=this.routeFollowingEstimator.getDebugSnapshot(),o=null!==(n=null===(t=this.currentPosition)||void 0===t?void 0:t.accuracy)&&void 0!==n?n:null,a={offRouteRerouteThresholdM:this.OFF_ROUTE_THRESHOLD_METERS,suppressRerouteBelowRemainingM:e.SUPPRESS_REROUTE_BELOW_REMAINING_M,lastKnownRemainingDistanceM:this.lastKnownRemainingDistanceM,whereTaxonomyPath:this.focusedWhere(),forwardFloor:Math.max(0,this.lastEmittedSegmentIndex),routeAlignedHeadingDeg:this.routeAlignedHeadingDeg,gpsReportedAccuracyM:"number"==typeof o&&Number.isFinite(o)?o:null};return j(i?j(j({},i),{snapped:this.navigationSnapped,routeHeadingDeg:null!==(r=this.routeAlignedHeadingDeg)&&void 0!==r?r:i.routeHeadingDeg}):{hasTrackingLine:!1,trackingLineLengthM:0,snapped:this.navigationSnapped,reportedAccuracyM:"number"==typeof o&&Number.isFinite(o)?o:NaN,accuracyForScalingM:NaN,enterThresholdM:NaN,exitThresholdM:NaN,rawDistanceToRouteM:NaN,smoothedDistanceForEnterM:NaN,lastAlongRouteM:0,standstill:!1,confidence:NaN,routeHeadingDeg:this.routeAlignedHeadingDeg},a)},e.prototype.regenerateRouteArc=function(){this.focusedWhere()&&this.onWhereTaxonomyUpdate()},e.prototype.resetAltitudeConfig=function(){console.log("Altitude config reset - handled by UserLocationController")},e.prototype.routeHasNavigableSegmentForWhere=function(e,t){var n,r,i,o,a;if(!(null===(n=null==e?void 0:e.segments)||void 0===n?void 0:n.length))return!1;for(var s=0,l=e.segments;s<l.length;s++){var u=l[s];if(u.maneuverType!==mu.RouteOverview&&u.maneuverType!==mu.SectionOverview&&u.whereDimension===t){var c=null!==(i=null===(r=u.features)||void 0===r?void 0:r.find(function(e){var t;return"LineString"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}))&&void 0!==i?i:null===(o=u.features)||void 0===o?void 0:o[1];if(c&&"LineString"===(null===(a=c.geometry)||void 0===a?void 0:a.type)){var h=c.geometry.coordinates;if(Array.isArray(h)&&h.length>=2)return!0}}}return!1},e.prototype.onWhereTaxonomyUpdate=function(){var e,t,n,r,i,o,a,s,l,u,c;if(this.isNavigating){var h=this.focusedWhere();if(h){var d=this.lastWhereUsedForTracking!==h;this.lastWhereUsedForTracking=h,this.evaluateStartAnchorLockScope(null!==(n=null!==(t=null===(e=this.currentPosition)||void 0===e?void 0:e.coordinates)&&void 0!==t?t:this.visualNavCoords)&&void 0!==n?n:void 0),this.portalProgressHoldActive&&(this.portalProgressHoldActive=!1),this.invalidateRouteTrackingCache(),this.lastAppliedRouteSliceSegmentIndex=-1,this.lastAppliedRouteSliceAlongM=-1,this.lastAppliedVisualNavCoords=null,this.lastAppliedVisualHeadingDeg=null,this.lastRouteSliceVisualNavCoords=null,this.lastBlueDotProgressVisualMs=0;var p=this.routingManager.getReferenceRouteForTracking();if(p){if(d&&this.isNavigating&&!this.routeHasNavigableSegmentForWhere(p,h)){var f=null!==(i=null!==(r=this.visualNavCoords)&&void 0!==r?r:this.lerpedCoords)&&void 0!==i?i:null===(o=this.currentPosition)||void 0===o?void 0:o.coordinates,g=Date.now();this.lastRerouteTime=g,this.routingManager.requestRerouteFromPosition(f).catch(function(e){console.warn("Re-route failed:",e)})}if(d&&this.isNavigating&&"pdr"===this.navigationLocMode){var m=null!==(s=null!==(a=this.visualNavCoords)&&void 0!==a?a:this.lerpedCoords)&&void 0!==s?s:null===(l=this.currentPosition)||void 0===l?void 0:l.coordinates;if(m)if(null!=this.activeDeadZoneId)if(this.deadZones.length>0){var v=uc(m,this.focusedWhere(),this.deadZones);v?this.rebindPdrToDeadZone(v,m):this.leavePdrMode()}else this.rebindPdrLockedLineAtSeed(m,this.activeDeadZoneId)||this.leavePdrMode();else this.rebindPdrLockedLineAtSeed(m,null)||this.leavePdrMode();else this.leavePdrMode()}var y=this.getCurrentPosition();y&&(this.updateRouteProgress(y),this.lastEmittedSegmentIndex>=0&&(null===(c=(u=this.uiHandlers).onSegmentIndexChange)||void 0===c||c.call(u,this.lastEmittedSegmentIndex)))}else console.warn("No reference route available for where taxonomy update")}else console.warn("No focused where-taxonomy available for where taxonomy update")}},e.prototype.generatePathForWhereTaxonomy=function(e,t){if(!e.segments||0===e.segments.length)return null;for(var n=[],r=1;r<e.segments.length;r+=1){(s=e.segments[r]).maneuverType!==mu.SectionOverview&&(s.whereDimension===t&&n.push(s))}if(0===n.length)return console.warn("No segments found for where taxonomy path: ".concat(t)),null;for(var i=[],o=0,a=n;o<a.length;o++)for(var s=a[o],l=0;l<s.coordinates.length;l+=1){var u=s.coordinates[l];i.push(u)}return i.length<2?(console.warn("Insufficient coordinates for path generation"),null):ye(i,{dimension_where:t,isNode:!1,featureBelongsToLineString:!0,isNonHighlightedOverview:"0"})},e.prototype.generateRouteArcFromPath=function(e){if("LineString"===e.geometry.type){var t=e,n=is(t,{units:"meters"});this.routeArc=[];for(var r=0;r<=this.routeSteps;r++){var i=xu(t,r/this.routeSteps*n,{units:"meters"});this.routeArc.push(i.geometry.coordinates)}this.currentRouteStep=0,this.targetRouteStep=0}else this.routeArc=[]},e.prototype.generateRouteArc=function(e,t,n){if(-1!==t&&e.segments[t]){var r=e.segments[t].features[1];if("LineString"===r.geometry.type){var i=r,o=is(i,{units:"meters"}),a=rs(i,ve(n),{units:"meters"}).properties.location;this.routeArc=[];for(var s=0;s<=this.routeSteps;s++){var l=xu(i,s/this.routeSteps*o,{units:"meters"});this.routeArc.push(l.geometry.coordinates)}this.currentRouteStep=Math.floor(a/o*this.routeSteps),this.currentRouteStep=Math.max(0,Math.min(this.routeSteps,this.currentRouteStep))}else this.routeArc=[]}else this.routeArc=[]},e.prototype.resetSmoothingState=function(){},e.prototype.startNavigation=function(e){var t,n,r,i,o;return I(this,void 0,void 0,function(){var a,s,l,u;return z(this,function(c){switch(c.label){case 0:return this.isNavigating?[2]:[4,this.ensureDeadZonesLoaded()];case 1:return c.sent(),this.configureStartAnchorLock(e),this.isNavigating=!0,this.portalProgressHoldActive=!1,this.userLocation.show(),a=this.routingManager.getActiveRoute(),(null===(t=null==a?void 0:a.segments)||void 0===t?void 0:t[0])&&(this.lastEmittedSegmentIndex=0,this.routingManager.highlightRouteSegment(0),this.onWhereTaxonomyUpdate()),this.startAnchorLockActive&&this.startAnchorLockAnchorLngLat&&this.enterPdrFromRouteSeed(null,this.startAnchorLockAnchorLngLat),s=this.startAnchorLockActive&&!!this.startAnchorLockAnchorLngLat&&"pdr"===this.navigationLocMode,l=this.userLocation.getCurrentPosition(),s?l&&Number.isFinite(l.accuracy)&&l.accuracy>=0?this.lastNavAccuracy=l.accuracy:l&&(this.lastNavAccuracy=null!==(n=l.accuracy)&&void 0!==n?n:10):(null==l?void 0:l.coordinates)&&(u=[l.coordinates[0],l.coordinates[1]],this.visualNavCoords=B([],u,!0),this.lastNavAccuracy=null!==(r=l.accuracy)&&void 0!==r?r:10,this.targetNavHeadingDeg=null,this.visualNavHeadingDeg=null,this.lerpedCoords=B([],u,!0),this.applyNavigationVisualFrame(u,this.lastNavAccuracy,null),this.setTargetNavCoords(u)),this.uiHandlers.onNavigationStart&&this.uiHandlers.onNavigationStart(),null===(o=(i=this.uiHandlers).onSegmentIndexChange)||void 0===o||o.call(i,0),this.resetSmoothingState(),this.lastKnownRemainingDistanceM=null,this.arrivalLockActive=!1,this.arrivalCameraFramingApplied=!1,this.navigationCompleteEmitted=!1,this.lastRouteProgressVisualMs=0,this.lastRouteSliceVisualNavCoords=null,this.lastBlueDotProgressVisualMs=0,this.resetDeadZoneEvaluationState(),this.qualityPdrBadConsecutive=0,this.qualityBlendRerouteSuppressed=!1,[2]}})})},e.prototype.getIsNavigating=function(){return"navigation"===this.userLocation.getSdkMode()},e.prototype.stopNavigation=function(){this.isNavigating&&(this.userLocation.stopMotion(),this.leavePdrMode(),this.isNavigating=!1,this.lastWhereUsedForTracking=null,this.portalProgressHoldActive=!1,this.stopNavVisualLoop(),this.setTargetNavCoords(null),this.targetNavHeadingDeg=null,this.visualNavCoords=null,this.visualNavHeadingDeg=null,this.frozenUnsnappedHeadingDeg=null,this.lastAppliedVisualNavCoords=null,this.lastAppliedVisualHeadingDeg=null,this.lastRouteSliceVisualNavCoords=null,this.lastBlueDotProgressVisualMs=0,this.lastRouteProgressVisualMs=0,this.lastAppliedRouteSliceSegmentIndex=-1,this.lastAppliedRouteSliceAlongM=-1,this.lerpedCoords=null,this.totalDistanceTraveled=0,this.currentHeading=null,this.currentPosition=null,this.navigationSnapped=!1,this.routeAlignedHeadingDeg=null,this.frozenUnsnappedHeadingDeg=null,this.lastSnapStateForUi=!1,this.invalidateRouteTrackingCache(),this.resetSmoothingState(),this.routeArc=[],this.currentRouteStep=0,this.targetRouteStep=0,this.lastKnownRemainingDistanceM=null,this.arrivalLockActive=!1,this.arrivalCameraFramingApplied=!1,this.navigationCompleteEmitted=!1,this.resetDeadZoneEvaluationState(),this.clearStartAnchorLock(),this.uiHandlers.onNavigationStop&&this.uiHandlers.onNavigationStop())},e.prototype.destroy=function(){var e,t;this.gpsCallbackRef&&this.userLocation.removeCallback({onLocationUpdate:this.gpsCallbackRef,onCompassUpdate:null!==(e=this.compassCallbackRef)&&void 0!==e?e:void 0}),this.gpsCallbackRef=null,this.compassCallbackRef=null,null===(t=this.unsubscribeFocus)||void 0===t||t.call(this),this.unsubscribeFocus=null,this.userLocation.stopMotion(),this.leavePdrMode(),this.isNavigating=!1,this.lastWhereUsedForTracking=null,this.portalProgressHoldActive=!1,this.stopNavVisualLoop(),this.setTargetNavCoords(null),this.targetNavHeadingDeg=null,this.visualNavCoords=null,this.visualNavHeadingDeg=null,this.frozenUnsnappedHeadingDeg=null,this.lastAppliedVisualNavCoords=null,this.lastAppliedVisualHeadingDeg=null,this.lastRouteSliceVisualNavCoords=null,this.lastBlueDotProgressVisualMs=0,this.lerpedCoords=null,this.totalDistanceTraveled=0,this.currentHeading=null,this.currentPosition=null,this.routeArc=[],this.currentRouteStep=0,this.targetRouteStep=0,this.resetDeadZoneEvaluationState(),this.qualityPdrBadConsecutive=0,this.qualityBlendRerouteSuppressed=!1,this.arrivalLockActive=!1,this.arrivalCameraFramingApplied=!1,this.navigationCompleteEmitted=!1,this.navigationSnapped=!1,this.routeAlignedHeadingDeg=null,this.frozenUnsnappedHeadingDeg=null,this.lastSnapStateForUi=!1,this.invalidateRouteTrackingCache(),this.lastRouteProgressVisualMs=0,this.lastAppliedRouteSliceSegmentIndex=-1,this.lastAppliedRouteSliceAlongM=-1,this.clearStartAnchorLock()},e.prototype.updateNavigationWithGPS=function(t){var n,r;if(this.isNavigating){this.currentPosition=t,this.evaluateStartAnchorLockScope(t.coordinates);var i=t.timestamp||Date.now(),o=i-this.lastDeadZoneModeSwitchMs<e.DEAD_ZONE_MODE_SWITCH_COOLDOWN_MS,a=Number.isFinite(t.accuracy)&&t.accuracy>=0?t.accuracy:50;if("pdr"===this.navigationLocMode)if(null!=this.activeDeadZoneId){var s=uc(t.coordinates,this.focusedWhere(),this.deadZones);if(!!s&&!!this.activeDeadZoneId&&s.id===this.activeDeadZoneId)return this.pdrRawGpsOutsideConsecutive=0,void(this.deadZoneInsideConsecutive=0);if(o)return;if(this.pdrRawGpsOutsideConsecutive+=1,this.pdrRawGpsOutsideConsecutive<e.DEAD_ZONE_EXIT_CONSECUTIVE_COUNT)return;this.pdrRawGpsOutsideConsecutive=0,this.leavePdrMode()}else if(!this.updateAnchorPdrBlendTowardGps(t,a,i))return;if(!(this.startAnchorLockActive&&this.startAnchorLockAnchorLngLat&&"pdr"!==this.navigationLocMode&&this.enterPdrFromRouteSeed(null,this.startAnchorLockAnchorLngLat))){if("gps"===this.navigationLocMode&&this.deadZones.length>0)if(o)this.deadZoneInsideConsecutive=0;else{var l=uc(t.coordinates,this.focusedWhere(),this.deadZones);if(l){if(this.deadZoneInsideConsecutive+=1,this.deadZoneInsideConsecutive>=e.DEAD_ZONE_ENTER_CONSECUTIVE_COUNT&&(this.deadZoneInsideConsecutive=0,this.tryEnterPdrMode(l,t.coordinates)))return}else this.deadZoneInsideConsecutive=0}if("gps"!==this.navigationLocMode||!this.tryEnterQualityRecoveryPdr(t,a,i)){var u=this.getBuiltTrackingLine();this.routeFollowingEstimator.setTrackingLine(u);var c=this.routeFollowingEstimator.update(t.coordinates,a,i);this.lastRouteFollowingConfidence=c.confidence;var h=[c.displayCoords[0],c.displayCoords[1]],d=!!this.arrivalLockActive||c.snapped;if(d!==this.lastSnapStateForUi&&(this.lastSnapStateForUi=d,null===(r=(n=this.uiHandlers).onSnapStateChange)||void 0===r||r.call(n,d)),this.navigationSnapped=d,this.routeAlignedHeadingDeg=null,this.lastRawPosition){var p=sa(this.lastRawPosition.coords,t.coordinates,{units:"meters"});this.totalDistanceTraveled+=p}this.lastRawPosition={coords:t.coordinates,timestamp:i},this.lastNavAccuracy=a,this.visualNavCoords||(this.visualNavCoords=[h[0],h[1]],this.visualNavHeadingDeg=this.frozenUnsnappedHeadingDeg),this.setTargetNavCoords([h[0],h[1]])}}}},e.prototype.updateNavigationWithCompass=function(e){if(this.isNavigating){if(this.userLocation.isCompassPermissionDenied())return this.currentHeading=null,void this.ensureNavVisualLoop();this.currentHeading=e.heading,this.ensureNavVisualLoop()}},e.prototype.headingFromAlongOnLine=function(t,n,r){if(!(n>0&&Number.isFinite(r)))return null;var i=Math.max(0,Math.min(n,r)),o=e.NAV_HEADING_LOOKAHEAD_M,a=Math.min(n,i+o);if(a<=i&&(a=Math.max(0,i-Math.min(1,o)))===i)return null;var s=la(xu(t,i,{units:"meters"}).geometry.coordinates,xu(t,a,{units:"meters"}).geometry.coordinates);if(!Number.isFinite(s))return null;for(;s<0;)s+=360;for(;s>=360;)s-=360;return s},e.prototype.computeHeadingFromGPS=function(){return this.userLocation.isCompassPermissionDenied()||"number"!=typeof this.currentHeading||Number.isNaN(this.currentHeading)?null:this.currentHeading},e.prototype.resolveNavigationHeadingTarget=function(){return"navigation"===this.userLocation.getSdkMode()&&null!==this.routeAlignedHeadingDeg&&Number.isFinite(this.routeAlignedHeadingDeg)?this.routeAlignedHeadingDeg:this.computeHeadingFromGPS()},e.prototype.ensureNavVisualLoop=function(){this.isNavigating&&void 0===this.navVisualRafId&&(this.lastNavVisualFrameTime=0,this.navVisualRafId=requestAnimationFrame(this.tickNavVisual))},e.prototype.setTargetNavCoords=function(e){this.targetNavCoords=e,this.targetAlongMOnTrackingLine=null,this.targetAlongMCacheKey="",null!==e&&this.ensureNavVisualLoop()},e.prototype.stopNavVisualLoop=function(){void 0!==this.navVisualRafId&&(cancelAnimationFrame(this.navVisualRafId),this.navVisualRafId=void 0),this.lastNavVisualFrameTime=0},e.approxMetersBetween=function(e,t){var n=Math.PI/180,r=.5*(e[1]+t[1])*n,i=(t[1]-e[1])*n,o=(t[0]-e[0])*n*Math.cos(r);return 6378137*Math.sqrt(i*i+o*o)},e.prototype.lerpVisualCoordsCartesian=function(t,n,r){var i=this.visualNavCoords,o=i[0]+(t[0]-i[0])*n,a=i[1]+(t[1]-i[1])*n,s=e.approxMetersBetween(i,[o,a]),l=e.NAV_VISUAL_MAX_FREE_MS*r;if(s>l&&s>0){var u=l/s;o=i[0]+(o-i[0])*u,a=i[1]+(a-i[1])*u}e.approxMetersBetween([o,a],t)<e.NAV_VISUAL_SNAP_DIST_M&&(o=t[0],a=t[1]),this.visualNavCoords=[o,a]},e.prototype.getOrSnapAlong=function(e,t,n,r,i){return null!==r&&i===n?{alongM:r,cacheKey:n}:{alongM:rs(e,ve(t),{units:"meters"}).properties.location,cacheKey:n}},e.prototype.advanceVisualAlongLine=function(t,n,r,i,o,a,s){var l,u;if(void 0===s&&(s=e.NAV_VISUAL_MAX_ALONG_MS),!(n>0)||!(null===(u=null===(l=null==t?void 0:t.geometry)||void 0===l?void 0:l.coordinates)||void 0===u?void 0:u.length)||t.geometry.coordinates.length<2)return!1;if(this.targetAlongMCacheKey!==i||null===this.targetAlongMOnTrackingLine){var c=rs(t,ve(r),{units:"meters"});this.targetAlongMOnTrackingLine=c.properties.location,this.targetAlongMCacheKey=i}if(this.visualAlongMCacheKey!==i||null===this.visualAlongMOnTrackingLine){var h=rs(t,ve(this.visualNavCoords),{units:"meters"});this.visualAlongMOnTrackingLine=h.properties.location,this.visualAlongMCacheKey=i}var d=Math.max(0,Math.min(n,this.targetAlongMOnTrackingLine)),p=Math.max(0,Math.min(n,this.visualAlongMOnTrackingLine)),f=(d-p)*o,g=s*a;Math.abs(f)>g&&(f=Math.sign(f)*g);var m=Math.max(0,Math.min(n,p+f));Math.abs(m-d)<e.NAV_VISUAL_SNAP_DIST_M&&(m=d),this.visualAlongMOnTrackingLine=m;var v=xu(t,m,{units:"meters"});return this.visualNavCoords=v.geometry.coordinates,!0},e.prototype.routeVisualProgressMinMs=function(t){return this.navigationSnapped?t?e.ROUTE_PROGRESS_VISUAL_MIN_INTERVAL_MS_ANCHOR_BLEND:e.ROUTE_PROGRESS_VISUAL_MIN_INTERVAL_MS:4*e.ROUTE_PROGRESS_VISUAL_MIN_INTERVAL_MS},e.prototype.routeVisualSliceMinDeltaM=function(){return this.navigationSnapped?e.ROUTE_SLICE_RESEND_MIN_DELTA_M:e.ROUTE_SLICE_RESEND_MIN_DELTA_M_UNSMAPPED},e.prototype.runNavVisualFrame=function(){var t,n,r,i;if(this.isNavigating){var o=this.targetNavCoords;if(o){var a=performance.now(),s=this.lastNavVisualFrameTime>0?Math.min(.12,(a-this.lastNavVisualFrameTime)/1e3):0;this.lastNavVisualFrameTime=a;var l="pdr"===this.navigationLocMode&&null===this.activeDeadZoneId&&this.anchorPdrBlendActive,u=!0;if(this.visualNavCoords){var c=this.visualNavCoords[0],h=this.visualNavCoords[1],d=l?e.NAV_VISUAL_POS_LAMBDA_ANCHOR_BLEND:e.NAV_VISUAL_POS_LAMBDA,p=s>0?1-Math.exp(-d*s):1;if("pdr"===this.navigationLocMode&&this.pdrLockedLine){var f=this.pdrLockedLine,g="pdr|".concat(this.pdrLockedRouteSegmentIndex),m=(null===(n=null===(t=null==f?void 0:f.geometry)||void 0===t?void 0:t.coordinates)||void 0===n?void 0:n.length)>=2?is(f,{units:"meters"}):0,v=l?e.NAV_VISUAL_MAX_ALONG_MS_ANCHOR_BLEND:e.NAV_VISUAL_MAX_ALONG_MS;this.advanceVisualAlongLine(f,m,o,g,p,s,v)||this.lerpVisualCoordsCartesian(o,p,s)}else if(this.navigationSnapped){f=null==(w=this.getBuiltTrackingLine())?void 0:w.line,m=this.trackingLineLengthMCached,g=this.trackingLineCacheKey;this.advanceVisualAlongLine(f,m,o,g,p,s)||this.lerpVisualCoordsCartesian(o,p,s)}else this.lerpVisualCoordsCartesian(o,p,s);if(this.navigationSnapped){var y=null;if("pdr"===this.navigationLocMode&&this.pdrLockedLine){m=(null===(i=null===(r=null==(f=this.pdrLockedLine)?void 0:f.geometry)||void 0===r?void 0:r.coordinates)||void 0===i?void 0:i.length)>=2?is(f,{units:"meters"}):0;null!==this.visualAlongMOnTrackingLine&&(y=this.headingFromAlongOnLine(f,m,this.visualAlongMOnTrackingLine))}else{var w;(f=null==(w=this.getBuiltTrackingLine())?void 0:w.line)&&null!==this.visualAlongMOnTrackingLine&&(y=this.headingFromAlongOnLine(f,this.trackingLineLengthMCached,this.visualAlongMOnTrackingLine))}null!==y?(this.routeAlignedHeadingDeg=y,this.frozenUnsnappedHeadingDeg=y,this.targetNavHeadingDeg=y):(this.routeAlignedHeadingDeg=null,this.targetNavHeadingDeg=this.frozenUnsnappedHeadingDeg)}else this.routeAlignedHeadingDeg=null,this.targetNavHeadingDeg=this.frozenUnsnappedHeadingDeg;var b=this.visualNavCoords[0]-c,_=this.visualNavCoords[1]-h;u=b*b+_*_>1e-18;var x=this.targetNavHeadingDeg,S=this.visualNavHeadingDeg;if(null!==x&&Number.isFinite(x))if(null!==S&&Number.isFinite(S)){var A=s>0?1-Math.exp(-e.NAV_VISUAL_HEAD_LAMBDA*s):1;this.visualNavHeadingDeg=yc(S,x,A)}else this.visualNavHeadingDeg=x;else this.visualNavHeadingDeg=null}else this.visualNavCoords=[o[0],o[1]],this.visualNavHeadingDeg=this.targetNavHeadingDeg;this.lerpedCoords=[this.visualNavCoords[0],this.visualNavCoords[1]];var P=this.headingDeltaDegrees(this.visualNavHeadingDeg,this.targetNavHeadingDeg),M=e.approxMetersBetween(this.visualNavCoords,o),C=!u&&M<e.NAV_VISUAL_SNAP_DIST_M&&P<.05;if(this.portalProgressHoldActive)this.isNavigating&&(this.navVisualRafId=requestAnimationFrame(this.tickNavVisual));else{var T=performance.now(),k=this.routeVisualProgressMinMs(l),E=this.routeVisualSliceMinDeltaM(),R=null,L=!1,D=!1;if(this.navigationSnapped){var F=T-this.lastRouteProgressVisualMs>=k,N=(null===this.lastAppliedVisualNavCoords?1/0:e.approxMetersBetween(this.lastAppliedVisualNavCoords,this.visualNavCoords))>=E;F&&N&&(R=this.computeRouteSliceGateSnapshot(this.visualNavCoords,E)),D=L=F&&N&&!!R}else{N=(null===this.lastRouteSliceVisualNavCoords?1/0:e.approxMetersBetween(this.lastRouteSliceVisualNavCoords,this.visualNavCoords))>=E;(F=T-this.lastRouteProgressVisualMs>=k)&&N&&(R=this.computeRouteSliceGateSnapshot(this.visualNavCoords,E)),L=F&&N&&!!R;var O=l?e.ROUTE_PROGRESS_VISUAL_MIN_INTERVAL_MS_ANCHOR_BLEND:e.ROUTE_PROGRESS_VISUAL_MIN_INTERVAL_MS,j=e.NAV_VISUAL_APPLY_MIN_DELTA_M,I=null===this.lastAppliedVisualNavCoords?1/0:e.approxMetersBetween(this.lastAppliedVisualNavCoords,this.visualNavCoords),z=T-this.lastBlueDotProgressVisualMs>=O,B=I>=j;D=L||null===this.lastAppliedVisualNavCoords||z&&B}if(L&&R&&(this.lastRouteProgressVisualMs=T,this.lastRouteSliceVisualNavCoords=[this.visualNavCoords[0],this.visualNavCoords[1]],this.updateRouteProgress(this.visualNavCoords,R)),D){this.lastBlueDotProgressVisualMs=T,this.applyNavigationVisualFrame(this.visualNavCoords,this.lastNavAccuracy,this.visualNavHeadingDeg);var U=this.getCurrentPosition();U&&U.length>=2&&this.updateCamera(U,this.visualNavHeadingDeg),this.lastAppliedVisualNavCoords=[this.visualNavCoords[0],this.visualNavCoords[1]],this.lastAppliedVisualHeadingDeg=this.visualNavHeadingDeg}else this.applyNavigationHeadingVisualOnly();if(C)return this.navVisualRafId=void 0,void(this.lastNavVisualFrameTime=0);this.isNavigating&&(this.navVisualRafId=requestAnimationFrame(this.tickNavVisual))}}else this.navVisualRafId=void 0}else this.navVisualRafId=void 0},e.prototype.headingDeltaDegrees=function(e,t){if(null===e||null===t||!Number.isFinite(e)||!Number.isFinite(t))return 0;var n=Math.abs(e-t)%360;return n>180&&(n=360-n),n},e.prototype.applyNavigationHeadingVisualOnly=function(){var e=this.computeHeadingFromGPS(),t=this.visualNavCoords;t&&this.emitUserPose({coordinates:t,accuracy:this.lastNavAccuracy,heading:e})},e.prototype.applyNavigationVisualFrame=function(e,t,n){var r=this.computeHeadingFromGPS();this.emitUserPose({coordinates:e,accuracy:t,heading:r})},e.prototype.computeRouteSliceGateSnapshot=function(t,n){var r,i,o,a,s,l,u,c;void 0===n&&(n=this.routeVisualSliceMinDeltaM());var h=this.routingManager.getReferenceRouteForTracking();if(!t||!h)return null;var d,p,f,g=ve([t[0],t[1]]),m=Math.max(0,this.lastEmittedSegmentIndex);if("pdr"===this.navigationLocMode&&this.pdrLockedRouteSegmentIndex>=0){d=this.pdrLockedRouteSegmentIndex;var v=h.segments[d],y=null!==(i=null===(r=null==v?void 0:v.features)||void 0===r?void 0:r.find(function(e){var t;return"LineString"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}))&&void 0!==i?i:null===(o=null==v?void 0:v.features)||void 0===o?void 0:o[1];if("LineString"===(null===(a=null==y?void 0:y.geometry)||void 0===a?void 0:a.type)){var w=rs(y,g,{units:"meters"});f=w.geometry.coordinates,p=w.properties.dist}else f=t,p=0}else{var b=this.findNearestSegmentIndexAlongRoute(h,g,m,!0);d=b.nearestIndex,p=b.minDistance,f=b.snappedCoords}if(-1===d)return null;var _=h.segments[d],x=null!==(l=null===(s=_.features)||void 0===s?void 0:s.find(function(e){var t;return"LineString"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}))&&void 0!==l?l:null===(u=_.features)||void 0===u?void 0:u[1];if("LineString"!==(null===(c=null==x?void 0:x.geometry)||void 0===c?void 0:c.type))return null;var S=null!=f?f:t,A=[S[0],S[1]],P=rs(x,ve(A),{units:"meters"}).properties.location,M=is(x,{units:"meters"}),C=Math.max(0,M-P),T=this.lastRouteSliceVisualNavCoords,k=null===T?1/0:e.approxMetersBetween(T,t);return{referenceRoute:h,nearestIndex:d,minDistance:p,referenceSegment:_,referenceLineFeature:x,ptCoords:A,snappedAlongM:P,originalLen:M,remainingSegmentDistance:C,slicePointChanged:d!==this.lastAppliedRouteSliceSegmentIndex||k>=n}},e.prototype.updateRouteProgress=function(t,n){var r,i,o=null!=n?n:this.computeRouteSliceGateSnapshot(t);if(t&&o){var a=o.referenceRoute,s=o.nearestIndex,l=o.minDistance,u=o.referenceSegment,c=o.referenceLineFeature,h=o.ptCoords,d=o.snappedAlongM,p=o.originalLen,f=o.remainingSegmentDistance,g=o.slicePointChanged;this.maybeProposePortalFloorChange(a,s,u,Number.isFinite(f)?f:null);var m=null;if(g){m=B([h],pl(c,d,p,{units:"meters"}).geometry.coordinates,!0);var v=null!==(i=null===(r=u.features)||void 0===r?void 0:r.findIndex(function(e){var t;return"LineString"===(null===(t=null==e?void 0:e.geometry)||void 0===t?void 0:t.type)}))&&void 0!==i?i:1,y=u.features.slice();if(v>=0&&y[v]){var w=y[v];y[v]=j(j({},w),{geometry:j(j({},w.geometry),{coordinates:m})})}var b=j(j({},u),{features:y}),_=a.segments.slice();_[s]=b;var x=j(j({},a),{segments:_});this.routingManager.setActiveRoute(x),this.routingManager.highlightRouteSegment(s,!0,!0,!1,!1),this.lastAppliedRouteSliceSegmentIndex=s,this.lastAppliedRouteSliceAlongM=d}try{for(var S=0,A=0,P=s;P<a.segments.length;P+=1)S+=a.segments[P].distance||0,A+=a.segments[P].time||0;var M=u.distance||0,C=u.time||0;if(p>0&&M>0){var T=Math.max(0,Math.min(1,f/p));S-=M,A-=C,S+=M*T,A+=C*T}this.lastKnownRemainingDistanceM=S,this.maybeEnterArrivalLockAndFrame([t[0],t[1]],S,a),this.uiHandlers.onProgressUpdate&&this.uiHandlers.onProgressUpdate({remainingTime:A,remainingDistance:S,segmentRemainingDistance:f})}catch(e){}if(this.uiHandlers.onBearingUpdate&&m&&m.length>=2){var k=la(m[0],m[1]);this.uiHandlers.onBearingUpdate(k)}this.maybeAdvanceLastEmittedSegmentIndex(s);var E=-1===s||l>this.OFF_ROUTE_THRESHOLD_METERS,R=null!=this.lastKnownRemainingDistanceM&&this.lastKnownRemainingDistanceM<e.SUPPRESS_REROUTE_BELOW_REMAINING_M;if(E&&!R&&!this.arrivalLockActive&&!this.startAnchorLockActive&&!this.qualityBlendRerouteSuppressed){var L=Date.now();L-this.lastRerouteTime>=this.REROUTE_COOLDOWN_MS&&(this.lastRerouteTime=L,this.routingManager.requestRerouteFromPosition(t).catch(function(e){console.warn("Re-route failed:",e)}))}return{nearestIndex:s,minDistance:l}}},e.prototype.updateCamera=function(e,t,n){void 0===n&&(n=!1),this.arrivalLockActive||!e||e.length<2||"number"!=typeof e[0]||"number"!=typeof e[1]||null!==t&&this.emitUserCameraStop({center:[e[0],e[1]],bearing:t,pitch:this.cameraPitch,zoom:this.cameraZoomLevel,paddingFraction:{top:.3},durationMs:300,easing:"linear"},{force:n})},e.NAV_VISUAL_APPLY_MIN_DELTA_M=.1,e.NAV_VISUAL_APPLY_MIN_DELTA_M_ANCHOR_BLEND=.05,e.NAV_VISUAL_APPLY_MIN_HEADING_DEG=1,e.NAV_VISUAL_POS_LAMBDA=9,e.NAV_VISUAL_POS_LAMBDA_ANCHOR_BLEND=17,e.NAV_VISUAL_HEAD_LAMBDA=12,e.NAV_VISUAL_SNAP_DIST_M=.04,e.NAV_HEADING_LOOKAHEAD_M=5,e.NAV_VISUAL_MAX_ALONG_MS=3,e.NAV_VISUAL_MAX_ALONG_MS_ANCHOR_BLEND=8,e.NAV_VISUAL_MAX_FREE_MS=4,e.ROUTE_PROGRESS_VISUAL_MIN_INTERVAL_MS=50,e.ROUTE_PROGRESS_VISUAL_MIN_INTERVAL_MS_ANCHOR_BLEND=28,e.ROUTE_SLICE_RESEND_MIN_DELTA_M=.5,e.ROUTE_SLICE_RESEND_MIN_DELTA_M_UNSMAPPED=2,e.DEAD_ZONE_MODE_SWITCH_COOLDOWN_MS=3e3,e.DEAD_ZONE_ENTER_CONSECUTIVE_COUNT=2,e.DEAD_ZONE_EXIT_CONSECUTIVE_COUNT=2,e.ANCHOR_PDR_HANDOFF_CONSECUTIVE_GOOD=4,e.ANCHOR_PDR_HANDOFF_MAX_ACCURACY_M=32,e.ANCHOR_PDR_HANDOFF_MIN_CONFIDENCE=.3,e.ANCHOR_PDR_BLEND_SPEED_PER_S=.55,e.QUALITY_PDR_BAD_ACCURACY_M=35,e.QUALITY_PDR_MAX_RESIDUAL_M=30,e.QUALITY_PDR_CONSECUTIVE_BAD=3,e.PORTAL_PROPOSE_VICINITY_M=15,e.PORTAL_PROGRESS_HOLD_VICINITY_M=5,e.SUPPRESS_REROUTE_BELOW_REMAINING_M=20,e.ARRIVAL_CAMERA_ZOOM=20,e.ARRIVAL_CAMERA_PITCH=55,e}();function Sc(e){if(!e)throw new Error("geojson is required");switch(e.type){case"Feature":return Ac(e);case"FeatureCollection":return function(e){var t={type:"FeatureCollection"};return Object.keys(e).forEach(function(n){switch(n){case"type":case"features":return;default:t[n]=e[n]}}),t.features=e.features.map(function(e){return Ac(e)}),t}(e);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Mc(e);default:throw new Error("unknown GeoJSON type")}}function Ac(e){var t={type:"Feature"};return Object.keys(e).forEach(function(n){switch(n){case"type":case"properties":case"geometry":return;default:t[n]=e[n]}}),t.properties=Pc(e.properties),t.geometry=Mc(e.geometry),t}function Pc(e){var t={};return e?(Object.keys(e).forEach(function(n){var r=e[n];"object"==typeof r?null===r?t[n]=null:Array.isArray(r)?t[n]=r.map(function(e){return e}):t[n]=Pc(r):t[n]=r}),t):t}function Mc(e){var t={type:e.type};return e.bbox&&(t.bbox=e.bbox),"GeometryCollection"===e.type?(t.geometries=e.geometries.map(function(e){return Mc(e)}),t):(t.coordinates=Cc(e.coordinates),t)}function Cc(e){var t=e;return"object"!=typeof t[0]?t.slice():t.map(function(e){return Cc(e)})}function Tc(e,t,n,r){void 0===r&&(r={});var i=t<0,o=function(e,t,n){if(void 0===t&&(t="kilometers"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("length must be a positive number");return _e(xe(e,t),n)}(Math.abs(t),r.units,"meters");i&&(o=-Math.abs(o));var a=ia(e),s=function(e,t,n,r){r=void 0===r?fe:Number(r);var i=t/r,o=e[0]*Math.PI/180,a=Ae(e[1]),s=Ae(n),l=i*Math.cos(s),u=a+l;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var c=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(a/2+Math.PI/4)),h=Math.abs(c)>1e-11?l/c:Math.cos(a),d=i*Math.sin(s)/h;return[(180*(o+d)/Math.PI+540)%360-180,180*u/Math.PI]}(a,o,n);return s[0]+=s[0]-a[0]>180?-360:a[0]-s[0]>180?360:0,ve(s,r.properties)}function kc(e,t,n,r){if(!Me(r=r||{}))throw new Error("options is invalid");var i=r.units,o=r.zTranslation,a=r.mutate;if(!e)throw new Error("geojson is required");if(null==t||isNaN(t))throw new Error("distance is required");if(o&&"number"!=typeof o&&isNaN(o))throw new Error("zTranslation is not a number");if(o=void 0!==o?o:0,0===t&&0===o)return e;if(null==n||isNaN(n))throw new Error("direction is required");return t<0&&(t=-t,n+=180),!1!==a&&void 0!==a||(e=Sc(e)),ca(e,function(e){var r=oa(Tc(e,t,n,{units:i}));e[0]=r[0],e[1]=r[1],o&&3===e.length&&(e[2]+=o)}),e}function Ec(e,t){void 0===t&&(t={});var n=aa(e);switch(t.properties||"Feature"!==e.type||(t.properties=e.properties),n.type){case"Polygon":return function(e,t){void 0===t&&(t={});var n=aa(e),r=n.coordinates,i=t.properties?t.properties:"Feature"===e.type?e.properties:{};return Rc(r,i)}(n,t);case"MultiPolygon":return function(e,t){void 0===t&&(t={});var n=aa(e),r=n.coordinates,i=t.properties?t.properties:"Feature"===e.type?e.properties:{},o=[];return r.forEach(function(e){o.push(Rc(e,i))}),we(o)}(n,t);default:throw new Error("invalid poly")}}function Rc(e,t){return e.length>1?function(e,t,n){return void 0===n&&(n={}),me({type:"MultiLineString",coordinates:e},t,n)}(e,t):ye(e[0],t)}function Lc(e,t){var n=!0;return da(e,function(e){da(t,function(t){if(!1===n)return!1;n=function(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return n=e.coordinates,r=t.coordinates,!(n[0]===r[0]&&n[1]===r[1]);case"LineString":return!Dc(t,e);case"Polygon":return!Ws(e,t)}break;case"LineString":switch(t.type){case"Point":return!Dc(e,t);case"LineString":return!function(e,t){if(ts(e,t).features.length>0)return!0;return!1}(e,t);case"Polygon":return!Fc(t,e)}break;case"Polygon":switch(t.type){case"Point":return!Ws(t,e);case"LineString":return!Fc(e,t);case"Polygon":return!function(e,t){for(var n=0,r=e.coordinates[0];n<r.length;n++){if(Ws(r[n],t))return!0}for(var i=0,o=t.coordinates[0];i<o.length;i++){if(Ws(o[i],e))return!0}var a=ts(Ec(e),Ec(t));if(a.features.length>0)return!0;return!1}(t,e)}}var n,r;return!1}(e.geometry,t.geometry)})}),n}function Dc(e,t){for(var n=0;n<e.coordinates.length-1;n++)if(Nc(e.coordinates[n],e.coordinates[n+1],t.coordinates))return!0;return!1}function Fc(e,t){for(var n=0,r=t.coordinates;n<r.length;n++){if(Ws(r[n],e))return!0}return ts(t,Ec(e)).features.length>0}function Nc(e,t,n){var r=n[0]-e[0],i=n[1]-e[1],o=t[0]-e[0],a=t[1]-e[1];return 0===r*a-i*o&&(Math.abs(o)>=Math.abs(a)?o>0?e[0]<=n[0]&&n[0]<=t[0]:t[0]<=n[0]&&n[0]<=e[0]:a>0?e[1]<=n[1]&&n[1]<=t[1]:t[1]<=n[1]&&n[1]<=e[1])}function Oc(e,t,n){var r,i=oa(n);if("LineString"!==("FeatureCollection"===(r=n).type?"FeatureCollection":"GeometryCollection"===r.type?"GeometryCollection":"Feature"===r.type&&null!==r.geometry?r.geometry.type:r.type))throw new Error("line must be a LineString");for(var o,a=rs(n,e),s=rs(n,t),l=[(o=a.properties.index<=s.properties.index?[a,s]:[s,a])[0].geometry.coordinates],u=o[0].properties.index+1;u<o[1].properties.index+1;u++)l.push(i[u]);return l.push(o[1].geometry.coordinates),ye(l,n.properties)}var jc={},Ic={get exports(){return jc},set exports(e){jc=e}},zc=Bc;function Bc(e,t){if(!(this instanceof Bc))return new Bc(e,t);if(Array.isArray(e)||(t=e,e=[]),t=t||{},this.data=e||[],this.length=this.data.length,this.compare=t.compare||Hc,this.setNodeId=t.setNodeId||Uc,this.length>0)for(var n=this.length>>1;n>=0;n--)this._down(n);if(t.setNodeId)for(n=0;n<this.length;++n)this.setNodeId(this.data[n],n)}function Uc(){}function Hc(e,t){return e-t}function Gc(e){this.node=e,this.parent=null,this.closed=!1,this.open=0,this.distanceToSource=Number.POSITIVE_INFINITY,this.fScore=Number.POSITIVE_INFINITY,this.heapIndex=-1}Bc.prototype={push:function(e){this.data.push(e),this.setNodeId(e,this.length),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var e=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this.setNodeId(this.data[0],0),this._down(0)),this.data.pop(),e}},peek:function(){return this.data[0]},updateItem:function(e){this._down(e),this._up(e)},_up:function(e){for(var t=this.data,n=this.compare,r=this.setNodeId,i=t[e];e>0;){var o=e-1>>1,a=t[o];if(n(i,a)>=0)break;t[e]=a,r(a,e),e=o}t[e]=i,r(i,e)},_down:function(e){for(var t=this.data,n=this.compare,r=this.length>>1,i=t[e],o=this.setNodeId;e<r;){var a=1+(e<<1),s=a+1,l=t[a];if(s<this.length&&n(t[s],l)<0&&(a=s,l=t[s]),n(l,i)>=0)break;t[e]=l,o(l,e),e=a}t[e]=i,o(i,e)}};var Wc=function(){var e=0,t=[];return{createNewState:function(n){var r=t[e];r?(r.node=n,r.parent=null,r.closed=!1,r.open=0,r.distanceToSource=Number.POSITIVE_INFINITY,r.fScore=Number.POSITIVE_INFINITY,r.heapIndex=-1):(r=new Gc(n),t[e]=r);return e++,r},reset:function(){e=0}}},Vc={l2:function(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)},l1:function(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.abs(n)+Math.abs(r)}};var qc=[];"function"==typeof Object.freeze&&Object.freeze(qc);var Zc={heuristic:function(){return 0},distance:function(){return 1},blocked:function(){return!1},compareFScore:function(e,t){return e.fScore-t.fScore},NO_PATH:qc,setHeapIndex:function(e,t){e.heapIndex=t},setH1:function(e,t){e.h1=t},setH2:function(e,t){e.h2=t},compareF1Score:function(e,t){return e.f1-t.f1},compareF2Score:function(e,t){return e.f2-t.f2}};Ic.exports=function(e,t){var n=(t=t||{}).oriented,r=t.blocked;r||(r=Xc.blocked);var i=t.heuristic;i||(i=Xc.heuristic);var o=t.distance;o||(o=Xc.distance);var a=$c();return{find:function(t,s){var l=e.getNode(t);if(!l)throw new Error("fromId is not defined in this graph: "+t);var u=e.getNode(s);if(!u)throw new Error("toId is not defined in this graph: "+s);a.reset();var c,h=new Map,d=new Yc({compare:Xc.compareFScore,setNodeId:Xc.setHeapIndex}),p=a.createNewState(l);h.set(t,p),p.fScore=i(l,u),p.distanceToSource=0,d.push(p),p.open=1;for(;d.length>0;){if(Qc(c=d.pop(),u))return eh(c);c.closed=!0,e.forEachLinkedNode(c.node.id,f,n)}return Jc;function f(e,t){var n=h.get(e.id);if(n||(n=a.createNewState(e),h.set(e.id,n)),!n.closed&&(0===n.open&&(d.push(n),n.open=1),!r(e,c.node,t))){var s=c.distanceToSource+o(e,c.node,t);s>=n.distanceToSource||(n.parent=c,n.distanceToSource=s,n.fScore=s+i(n.node,u),d.updateItem(n.heapIndex))}}}}};var Yc=zc,$c=Wc,Kc=Vc,Xc=Zc,Jc=Xc.NO_PATH;function Qc(e,t){return e.node===t}function eh(e){for(var t=[e.node],n=e.parent;n;)t.push(n.node),n=n.parent;return t}jc.l2=Kc.l2,jc.l1=Kc.l1;var th={};({get exports(){return th},set exports(e){th=e}}).exports=function(e,t){var n=(t=t||{}).oriented,r=t.blocked;r||(r=oh.blocked);var i=t.heuristic;i||(i=oh.heuristic);var o=t.distance;o||(o=oh.distance);var a=rh();return{find:function(t,s){var l=e.getNode(t);if(!l)throw new Error("fromId is not defined in this graph: "+t);var u=e.getNode(s);if(!u)throw new Error("toId is not defined in this graph: "+s);if(l===u)return[l];a.reset();var c=n?S:x,h=new Map,d=new nh({compare:oh.compareFScore,setNodeId:oh.setHeapIndex}),p=new nh({compare:oh.compareFScore,setNodeId:oh.setHeapIndex}),f=a.createNewState(l);h.set(t,f),f.fScore=i(l,u),f.distanceToSource=0,d.push(f),f.open=ah;var g=a.createNewState(u);g.fScore=i(u,l),g.distanceToSource=0,p.push(g),g.open=sh;var m,v,y=Number.POSITIVE_INFINITY,w=d,b=ah;for(;d.length>0&&p.length>0;){d.length<p.length?(b=ah,w=d):(b=sh,w=p);var _=w.pop();if(_.closed=!0,!(_.distanceToSource>y)&&(e.forEachLinkedNode(_.node.id,c),m&&v))return P(m,v)}return lh;function x(e,t){return M(e,t,_)}function S(e,t){if(b===ah){if(t.fromId===_.node.id)return M(e,t,_)}else if(b===sh&&t.toId===_.node.id)return M(e,t,_)}function A(e){var t=e.open;return!(!t||t===b)}function P(e,t){for(var n=[],r=e;r;)n.push(r.node),r=r.parent;for(var i=t;i;)n.unshift(i.node),i=i.parent;return n}function M(e,t,n){var s=h.get(e.id);if(s||(s=a.createNewState(e),h.set(e.id,s)),!s.closed&&!r(s.node,n.node,t))if(A(s)){var c=s.distanceToSource+n.distanceToSource;c<y&&(m=s,v=n,y=c)}else{var d=n.distanceToSource+o(s.node,n.node,t);if(!(d>=s.distanceToSource)){var p=b===ah?u:l,f=d+i(s.node,p);f>=y||(s.fScore=f,0===s.open&&(w.push(s),w.updateItem(s.heapIndex),s.open=b),s.parent=n,s.distanceToSource=d)}}}}}};var nh=zc,rh=Wc,ih=Vc,oh=Zc,ah=1,sh=2,lh=oh.NO_PATH;th.l2=ih.l2,th.l1=ih.l1;var uh={},ch=function(){var e=0,t=[];return{createNewState:function(n){var r=t[e];r?(r.node=n,r.p1=null,r.p2=null,r.closed=!1,r.g1=Number.POSITIVE_INFINITY,r.g2=Number.POSITIVE_INFINITY,r.f1=Number.POSITIVE_INFINITY,r.f2=Number.POSITIVE_INFINITY,r.h1=-1,r.h2=-1):(r=new hh(n),t[e]=r);return e++,r},reset:function(){e=0}}};function hh(e){this.node=e,this.p1=null,this.p2=null,this.closed=!1,this.g1=Number.POSITIVE_INFINITY,this.g2=Number.POSITIVE_INFINITY,this.f1=Number.POSITIVE_INFINITY,this.f2=Number.POSITIVE_INFINITY,this.h1=-1,this.h2=-1}({get exports(){return uh},set exports(e){uh=e}}).exports=function(e,t){var n=(t=t||{}).oriented,r=t.quitFast,i=t.blocked;i||(i=fh.blocked);var o=t.heuristic;o||(o=fh.heuristic);var a=t.distance;a||(a=fh.distance);var s=gh();return{find:function(t,l){var u=e.getNode(t);if(!u)throw new Error("fromId is not defined in this graph: "+t);var c=e.getNode(l);if(!c)throw new Error("toId is not defined in this graph: "+l);s.reset();var h,d=n?T:P,p=n?C:M,f=new Map,g=new dh({compare:fh.compareF1Score,setNodeId:fh.setH1}),m=new dh({compare:fh.compareF2Score,setNodeId:fh.setH2}),v=Number.POSITIVE_INFINITY,y=s.createNewState(u);f.set(t,y),y.g1=0;var w=o(u,c);y.f1=w,g.push(y);var b=s.createNewState(c);f.set(l,b),b.g2=0;var _,x=w;b.f2=x,m.push(b);for(;m.length&&g.length&&(g.length<m.length?S():A(),!r||!h););return function(e){if(!e)return mh;var t=[e.node],n=e.p1;for(;n;)t.push(n.node),n=n.p1;var r=e.p2;for(;r;)t.unshift(r.node),r=r.p2;return t}(h);function S(){(_=g.pop()).closed||(_.closed=!0,_.f1<v&&_.g1+x-o(u,_.node)<v&&e.forEachLinkedNode(_.node.id,d),g.length>0&&(w=g.peek().f1))}function A(){(_=m.pop()).closed||(_.closed=!0,_.f2<v&&_.g2+w-o(_.node,c)<v&&e.forEachLinkedNode(_.node.id,p),m.length>0&&(x=m.peek().f2))}function P(e,t){var n=f.get(e.id);if(n||(n=s.createNewState(e),f.set(e.id,n)),!n.closed&&!i(_.node,e,t)){var r=_.g1+a(_.node,e,t);r<n.g1&&(n.g1=r,n.f1=r+o(n.node,c),n.p1=_,n.h1<0?g.push(n):g.updateItem(n.h1));var l=n.g1+n.g2;l<v&&(v=l,h=n)}}function M(e,t){var n=f.get(e.id);if(n||(n=s.createNewState(e),f.set(e.id,n)),!n.closed&&!i(_.node,e,t)){var r=_.g2+a(_.node,e,t);r<n.g2&&(n.g2=r,n.f2=r+o(u,n.node),n.p2=_,n.h2<0?m.push(n):m.updateItem(n.h2));var l=n.g1+n.g2;l<v&&(v=l,h=n)}}function C(e,t){if(t.toId===_.node.id)return M(e,t)}function T(e,t){if(t.fromId===_.node.id)return P(e,t)}}}};var dh=zc,ph=Vc,fh=Zc,gh=ch,mh=fh.NO_PATH;uh.l2=ph.l2,uh.l1=ph.l1;var vh={aStar:jc,aGreedy:th,nba:uh};var yh=function(e){"uniqueLinkId"in(e=e||{})&&(console.warn("ngraph.graph: Starting from version 0.14 `uniqueLinkId` is deprecated.\nUse `multigraph` option instead\n","\n","Note: there is also change in default behavior: From now on each graph\nis considered to be not a multigraph by default (each edge is unique)."),e.multigraph=e.uniqueLinkId);void 0===e.multigraph&&(e.multigraph=!1);if("function"!=typeof Map)throw new Error("ngraph.graph requires `Map` to be defined. Please polyfill it before using ngraph");var t=new Map,n=new Map,r={},i=0,o=e.multigraph?function(e,t,n){var i=Sh(e,t),o=r.hasOwnProperty(i);if(o||b(e,t)){o||(r[i]=0);var a="@"+ ++r[i];i=Sh(e+a,t+a)}return new xh(e,t,n,i)}:function(e,t,r){var i=Sh(e,t),o=n.get(i);if(o)return o.data=r,o;return new xh(e,t,r,i)},a=[],s=_,l=_,u=_,c=_,h={version:20,addNode:f,addLink:function(e,t,r){u();var i=g(e)||f(e),a=g(t)||f(t),l=o(e,t,r),h=n.has(l.id);n.set(l.id,l),_h(i,l),e!==t&&_h(a,l);return s(l,h?"update":"add"),c(),l},removeLink:function(e,t){void 0!==t&&(e=b(e,t));return w(e)},removeNode:m,getNode:g,getNodeCount:v,getLinkCount:y,getEdgeCount:y,getLinksCount:y,getNodesCount:v,getLinks:function(e){var t=g(e);return t?t.links:null},forEachNode:A,forEachLinkedNode:function(e,n,r){var i=g(e);if(i&&i.links&&"function"==typeof n)return r?function(e,n,r){var i=e.values(),o=i.next();for(;!o.done;){var a=o.value;if(a.fromId===n&&r(t.get(a.toId),a))return!0;o=i.next()}}(i.links,e,n):function(e,n,r){var i=e.values(),o=i.next();for(;!o.done;){var a=o.value,s=a.fromId===n?a.toId:a.fromId;if(r(t.get(s),a))return!0;o=i.next()}}(i.links,e,n)},forEachLink:function(e){if("function"==typeof e)for(var t=n.values(),r=t.next();!r.done;){if(e(r.value))return!0;r=t.next()}},beginUpdate:u,endUpdate:c,clear:function(){u(),A(function(e){m(e.id)}),c()},hasLink:b,hasNode:g,getLink:b};return wh(h),function(){var e=h.on;function t(){return h.beginUpdate=u=x,h.endUpdate=c=S,s=d,l=p,h.on=e,e.apply(h,arguments)}h.on=t}(),h;function d(e,t){a.push({link:e,changeType:t})}function p(e,t){a.push({node:e,changeType:t})}function f(e,n){if(void 0===e)throw new Error("Invalid node identifier");u();var r=g(e);return r?(r.data=n,l(r,"update")):(r=new bh(e,n),l(r,"add")),t.set(e,r),c(),r}function g(e){return t.get(e)}function m(e){var n=g(e);if(!n)return!1;u();var r=n.links;return r&&(r.forEach(w),n.links=null),t.delete(e),l(n,"remove"),c(),!0}function v(){return t.size}function y(){return n.size}function w(e){if(!e)return!1;if(!n.get(e.id))return!1;u(),n.delete(e.id);var t=g(e.fromId),r=g(e.toId);return t&&t.links.delete(e),r&&r.links.delete(e),s(e,"remove"),c(),!0}function b(e,t){if(void 0!==e&&void 0!==t)return n.get(Sh(e,t))}function _(){}function x(){i+=1}function S(){0===(i-=1)&&a.length>0&&(h.fire("changed",a),a.length=0)}function A(e){if("function"!=typeof e)throw new Error("Function is expected to iterate over graph nodes. You passed "+e);for(var n=t.values(),r=n.next();!r.done;){if(e(r.value))return!0;r=n.next()}}},wh=function(e){!function(e){if(!e)throw new Error("Eventify cannot use falsy object as events subject");for(var t=["on","fire","off"],n=0;n<t.length;++n)if(e.hasOwnProperty(t[n]))throw new Error("Subject cannot be eventified, since it already has property '"+t[n]+"'")}(e);var t=function(e){var t=Object.create(null);return{on:function(n,r,i){if("function"!=typeof r)throw new Error("callback is expected to be a function");var o=t[n];return o||(o=t[n]=[]),o.push({callback:r,ctx:i}),e},off:function(n,r){if(void 0===n)return t=Object.create(null),e;if(t[n])if("function"!=typeof r)delete t[n];else for(var i=t[n],o=0;o<i.length;++o)i[o].callback===r&&i.splice(o,1);return e},fire:function(n){var r,i=t[n];if(!i)return e;arguments.length>1&&(r=Array.prototype.splice.call(arguments,1));for(var o=0;o<i.length;++o){var a=i[o];a.callback.apply(a.ctx,r)}return e}}}(e);return e.on=t.on,e.off=t.off,e.fire=t.fire,e};function bh(e,t){this.id=e,this.links=null,this.data=t}function _h(e,t){e.links?e.links.add(t):e.links=new Set([t])}function xh(e,t,n,r){this.fromId=e,this.toId=t,this.data=n,this.id=r}function Sh(e,t){return e.toString()+"👉 "+t.toString()}var Ah,Ph,Mh=function(){var e,t,n="custom_",r=hu.Transit,i=!0,o=!0,a=!1,s=null,l=!1,u={edgeData:{},lines:[]};function c(e,t,n,r,i,o,a,l,u){void 0===a&&(a=!1);var c="".concat(t.toString(),",").concat(r),h=e.getNode(c);if(void 0===h){var d=j(j({mapObjectId:n,coords:t,where:r,what:i,zone:o,zoneUnionVertex:!1,name:u},s?{localRef:l}:{}),s?{memberships:[{mapObjectId:n,localRef:l,name:u,what:i}]}:{});h=e.addNode(c,d)}else if(a){if(h.data.mapObjectId=n,h.data.what=i,h.data.where=r,s&&l&&(h.data.localRef=l),s&&u&&(h.data.name=u),h.data.zone!==o&&(h.data.zoneUnionVertex=!0),h.data.zone=o,s&&l)h.data.memberships.some(function(e){return e.localRef===l})||h.data.memberships.push({mapObjectId:n,localRef:l,name:u,what:i})}else{if(s&&l)h.data.memberships.some(function(e){return e.localRef===l})||h.data.memberships.push({mapObjectId:n,localRef:l,name:u,what:i})}return h}function h(e,t,r,o){var a=o.cost,l=o.description,u=o.isPortal?a/1:a;if(!i||i&&o.wheelChairAccesible){var c={weight:u,cost:a,description:l};o.dimension_what&&(c.dimension_what=o.dimension_what),o.name&&(c.name=o.name),s&&Object.keys(o).forEach(function(e){e.startsWith(n)&&(c[e]=o[e])}),e.addLink(t.id,r.id,c)}}function d(e,t){return sa(ve(e),ve(t),{units:"meters"})}function p(e,t,r){var i;if(s)for(var o=0,a=e;o<a.length;o++){var l=a[o];t.properties&&l in t.properties?r["".concat(n).concat(l)]=null!==(i=t.properties[l])&&void 0!==i?i:[]:t.properties&&!(l in t.properties)&&(r["".concat(n).concat(l)]=s.defaults[l]||[])}}function f(e,t){var n,r,i=t;if(i){for(var o=c(e,i.coords,i.id,i.where,i.what,i.zone||"public",!0,i.localRef,i.name),a=Object.keys((null==s?void 0:s.customProperties)||{}),l=0;l<i.lines.length;l+=1)for(var u=i.lines[l],f=oa(u),g=0;g<f.length-1;g+=1){var m=c(e,f[g],"vertex",i.where,pu.Edge,u.properties.zone,!1,(null===(n=u.properties)||void 0===n?void 0:n.localRef)||i.localRef,i.name),v=c(e,f[g+1],"vertex",i.where,pu.Edge,u.properties.zone,!1,(null===(r=u.properties)||void 0===r?void 0:r.localRef)||i.localRef,i.name);if(m.id!==v.id){var y=d(f[g],f[g+1]),w={wheelChairAccesible:u.properties.wheelchair,cost:y,isPortal:!1,description:null};s&&(p(a,u,w),w.dimension_what=i.what,w.name=i.name),u.properties.direction!==cu.Forward&&u.properties.direction!==cu.TwoWay||h(e,m,v,w),u.properties.direction!==cu.Backward&&u.properties.direction!==cu.TwoWay||h(e,v,m,w)}}return o}}function g(e,t){var n=t;if(void 0!==n)return c(e,n.coords,n.id,n.where,n.what,n.zone||r,!0,n.localRef)}function m(e){var t,n,i,o,a,s;return{type:"Feature",geometry:{type:"LineString",coordinates:[e.data.coords]},properties:{dimension_where:e.data.where,zone:(null===(t=e.data)||void 0===t?void 0:t.zone)?null===(n=e.data)||void 0===n?void 0:n.zone:r,cost:0,localRef:(null===(i=e.data)||void 0===i?void 0:i.localRef)?null===(o=e.data)||void 0===o?void 0:o.localRef:null,name:(null===(a=e.data)||void 0===a?void 0:a.name)?null===(s=e.data)||void 0===s?void 0:s.name:null,what:e.data.what}}}function v(e){var t;return((null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.memberships)||[]).map(function(e){return null==e?void 0:e.localRef}).filter(function(e){return Boolean(e)})}function y(e,t){var n,r,i,o,a=new Set(v(e)),s=new Set(v(t)),l=[];return a.forEach(function(e){s.has(e)&&l.push(e)}),1===l.length?l[0]:l.length>1?(null===(n=e.data)||void 0===n?void 0:n.localRef)&&l.includes(e.data.localRef)?e.data.localRef:(null===(r=t.data)||void 0===r?void 0:r.localRef)&&l.includes(t.data.localRef)?t.data.localRef:l.sort()[0]:(null===(i=t.data)||void 0===i?void 0:i.localRef)||(null===(o=e.data)||void 0===o?void 0:o.localRef)||null}function w(e,t){var n,r,i="";if((null===(n=e.data)||void 0===n?void 0:n.memberships)&&t){var o=e.data.memberships.find(function(e){return e.localRef===t});o&&o.name&&(i=o.name)}return!i&&(null===(r=e.data)||void 0===r?void 0:r.name)&&(i=e.data.name),"string"==typeof i&&"unknow"===i.trim().toLowerCase()?"":i}function b(e,t){var n,r,i="";if((null===(n=e.data)||void 0===n?void 0:n.memberships)&&t){var o=e.data.memberships.find(function(e){return e.localRef===t});o&&o.what&&(i=o.what)}return!i&&(null===(r=e.data)||void 0===r?void 0:r.what)&&(i=e.data.what),"string"==typeof i&&i.includes("taxiway_crossing_300_stands")&&(i=i.replace("taxiway_crossing_300_stands","taxiway_crossing")),i}function _(e,t,n,r){if(n.length<=1)throw new Error("Route not found");var i=e,o=t;if(s){var a=function(e,t){var n,r,i,o,a=[];if(!e||e.length<2)return a;for(var s=[],l=0;l<e.length-1;l+=1){var u=e[l],c=e[l+1],h=t.getLink(u.id,c.id),d=h&&h.data&&"number"==typeof h.data.cost?h.data.cost:0,p=y(u,c);s.push({a:u,b:c,ref:p,cost:d})}if(s.length<=2)return a;var f=s.length,g=m(e[0]);g.properties.localRef=null!==(r=null===(n=s[0])||void 0===n?void 0:n.ref)&&void 0!==r?r:g.properties.localRef,g.properties.name=w(e[0],null===(i=s[0])||void 0===i?void 0:i.ref),g.properties.what=b(e[0],null===(o=s[0])||void 0===o?void 0:o.ref);var v=e[0].data,_=null;for(l=0;l<f;l+=1){var x=s[l];x.ref!==g.properties.localRef&&(g.geometry.coordinates.length>1&&a.push({geojson:g,edges:[v.mapObjectId,x.a.data.mapObjectId],startFloor:v.where,endFloor:x.a.data.where,isPortal:!1,portalPath:void 0,cost:g.properties.cost,description:null}),(g=m(x.a)).properties.localRef=x.ref,g.properties.name=w(x.a,x.ref),g.properties.what=b(x.a,x.ref),v=x.a.data),g.geometry.coordinates.push(x.b.data.coords),g.properties.cost+=x.cost,_=x}return _&&g.geometry.coordinates.length>1&&(g.properties.name=w(_.b,_.ref),g.properties.what=b(_.b,_.ref),a.push({geojson:g,edges:[v.mapObjectId,_.b.data.mapObjectId],startFloor:v.where,endFloor:_.b.data.where,isPortal:!1,portalPath:void 0,cost:g.properties.cost,description:null})),a}(n,r);return{startNode:i,endNode:o,routes:a,distance:0}}for(var c=[],h=-1,d=0;d<n.length;d+=1)if(n[d].data.what===pu.Network){h=d;break}var p=-1;for(d=0;d<n.length;d+=1)n[d].data.what===pu.Network&&(p=d);for(var f=l&&null===s&&h>0,g=f?n[h]:n[0],v=f?h+1:1,_=g.data,x=[m(g)],S=v;S<n.length;S+=1){var A=n[S],P=n[S-1],M=x[x.length-1];if(null===s&&("vertex"!==A.data.mapObjectId||A.data.zoneUnionVertex)){var C=void 0;if(Oh(P.data.what)&&Oh(A.data.what)){P.data.zone!==A.data.zone&&console.warn("A portal is triggering a change in zone");var T=void 0;if(Fh(P.data.what)){var k=function(e,t,n,r){void 0===r&&(r=!1);var i=n.data.mapObjectId,o=zu(e,(new Set).add(i));if(o&&o.edgeData[i])for(var a=o.edgeData[i],s=0;s<a.links.length;s+=1){var l=a.links[s];if(l.id===t.data.mapObjectId&&l.pathFeatures&&l.pathFeatures.length>0){var u=l.pathFeatures[0],c=!1===r?n.data.coords:t.data.coords,h=!1===r?t.data.coords:n.data.coords;return ye(sa(c,u.geometry.coordinates[0])<sa(h,u.geometry.coordinates[0])?u.geometry.coordinates:u.geometry.coordinates.slice().reverse())}}return null};(T=k(u.edgeData,A,P,!1))||(T=k(u.edgeData,P,A,!0))}var E=(D=r.getLink(P.id,A.id))&&D.data.cost?D.data.cost:void 0,R=D&&D.data.description?D.data.description:void 0;C={geojson:be([P.data.coords,A.data.coords],{zone:A.data.zone}),edges:[P.data.mapObjectId,A.data.mapObjectId],startFloor:P.data.where,endFloor:A.data.where,isPortal:!0,portalPath:T,cost:E,description:R},c.push(C),_=A.data}else{var L=S+1<n.length?n[S+1]:void 0;A.data.zoneUnionVertex&&P&&L&&(null==P?void 0:P.data.zone)===(null==L?void 0:L.data.zone)?console.log("ignore zoneUnionVertex in segment"):(C={geojson:M,edges:[_.mapObjectId,A.data.mapObjectId],startFloor:_.where,endFloor:_.where,isPortal:!1,portalPath:void 0,cost:M.properties.cost,description:null},c.push(C),_=A.data)}}if(null===s)if(Oh(P.data.what)&&Oh(A.data.what))M.geometry.coordinates.length<2&&x.pop(),x.push(m(A));else{var D;E=(D=r.getLink(P.id,A.id))&&D.data.cost?D.data.cost:void 0;l&&p>=0&&S>p&&A.data.what!==pu.Network||(M.geometry.coordinates.push(A.data.coords),M.properties.cost+=E)}if(A.data.zoneUnionVertex&&!s){var F=S>0?n[S-1]:void 0;L=S+1<n.length?n[S+1]:void 0;if(F&&L&&(null==F?void 0:F.data.zone)===(null==L?void 0:L.data.zone))console.log("ignore zoneUnionVertex");else if(L){var N=wu.cloneDeep(A);N.data.zone=L.data.zone,x.push(m(N))}else x.push(m(A))}}if(l&&null===s){var O=x[x.length-1];if(O.geometry.coordinates.length>1){var j=c[c.length-1];if(!j||j.geojson!==O){var I=n[p>=0?p:n.length-1];c.push({geojson:O,edges:[_.mapObjectId,I.data.mapObjectId],startFloor:_.where,endFloor:I.data.where,isPortal:!1,portalPath:void 0,cost:O.properties.cost,description:null})}}}return{startNode:i,endNode:o,routes:c,distance:0}}function x(t,i,l,u){var m=yh(),v=f(m,t),y=f(m,i);if(v&&y){a||function(e,t){for(var n in t){for(var r=t[n],i=0;i<r.links.length;i+=1){var o=r.links[i],a=o.cost;a=wu.toInteger(a);var s=o.direction,l=o.wheelchair,u=o.description,c=g(e,r),d=g(e,o);void 0!==c&&void 0!==d&&c.id!==d.id&&(s!==cu.Forward&&s!==cu.TwoWay||h(e,c,d,{wheelChairAccesible:l,cost:a,description:u,isPortal:!0}),s!==cu.Backward&&s!==cu.TwoWay||h(e,d,c,{wheelChairAccesible:l,cost:a,description:u,isPortal:!0}),f(e,o))}f(e,r)}}(m,l),function(e,t){for(var n,i,o=Object.keys((null==s?void 0:s.customProperties)||{}),a=0;a<t.length;a+=1){var l=t[a];if("LineString"===l.geometry.type){var u=oa(l);if(l.properties)for(var f=l.properties.dimension_where,g=l.properties.dimension_what,m=l.properties.zone,v=null===(n=l.properties)||void 0===n?void 0:n.localRef,y=null===(i=l.properties)||void 0===i?void 0:i.title,w=0;w<u.length-1;w+=1){var b=c(e,u[w],"vertex",f,g,m||r,!0,v,y),_=c(e,u[w+1],"vertex",f,g,m||r,!0,v,y);if(b.id!==_.id){var x=d(u[w],u[w+1]),S={wheelChairAccesible:l.properties.wheelchair,cost:x,isPortal:!1,description:null};s&&(p(o,l,S),S.dimension_what=l.properties.dimension_what,S.name=y),l.properties.direction!==cu.Forward&&l.properties.direction!==cu.TwoWay||h(e,b,_,S),l.properties.direction!==cu.Backward&&l.properties.direction!==cu.TwoWay||h(e,_,b,S)}}}}}(m,u);var w=function(t,r,i){var l=null==s?void 0:s.customProperties,u=null,c=null,h=function(e){var t,n;return null===(n=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.dimension_what)||void 0===n?void 0:n.includes("what.route.network.vehicle.road.primary")},d=function(e,t,n){var r,i,o;if((null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.localRef)===(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.localRef))return null;if(!h(t))return null;var a=null;return null===(o=null==e?void 0:e.links)||void 0===o||o.forEach(function(e){var r,i,o,s;switch(n){case"start":null===a&&(null==e?void 0:e.toId)===(null==t?void 0:t.fromId)&&(a=null!==(i=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.localRef)&&void 0!==i?i:null);break;case"end":null===a&&(null==e?void 0:e.fromId)===(null==t?void 0:t.toId)&&(a=null!==(s=null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.localRef)&&void 0!==s?s:null);break;default:a=null}}),a},p=["twy-crs_unknown_1","twy-crs_unknown_2","twy-crs_unknown_3","twy-crs_unknown_4","twy-crs_unknown_5","twy-crs_unknown_6"],f=vh.aStar(i,{oriented:!0,distance:function(e,n,i){var o,s,l=i.data.cost;return a?(null===u&&(u=d(t,i,"start")),null===c&&(c=d(r,i,"end")),u&&(null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.localRef)===u&&h(i)&&(l*=.1),c&&(null===(s=null==i?void 0:i.data)||void 0===s?void 0:s.localRef)===c&&h(i)&&(l*=.1),l):l},blocked:function(i,u,c){if(o&&(null==i?void 0:i.data.zone)!==(null==u?void 0:u.data.zone)){var h=Ou(i.data.where),d=Ou(e.where),f=Ou(u.data.where);if(h!==d&&f!==d)return!0}if(a&&c.data.dimension_what&&c.data.dimension_what.includes(pu.AirsideNetwork)){if(s){if(!s.allowedRoadwayCategories.includes(c.data.dimension_what))return!0;var g=!0;for(var m in l)c.data["".concat(n).concat(m)].includes(l[m])||(console.log("Blocked on custom property '".concat(m,"' check. ").concat(c.data.name," ").concat(c.data.dimension_what.split(".").slice(5).map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join(" ")," Road allows ").concat(m,":[").concat(c.data["".concat(n).concat(m)],"]. Vehicle has ").concat(m,": ").concat(l[m])),g=!1);if(!1===g)return!0}var v=/3\d{2}/;if((!v.test(t.data.name)||"what.airside.apron.stand"!==t.data.what)&&(!v.test(r.data.name)||"what.airside.apron.stand"!==r.data.what)&&(null==s?void 0:s.allowedRoadwayCategories.includes("what.route.network.vehicle.road.tunnel"))&&"what.route.network.vehicle.road.taxiway_crossing"===c.data.dimension_what&&p.includes(c.data.localRef)&&(null==s?void 0:s.allowedRoadwayCategories.includes("what.route.network.vehicle.road.taxiway_crossing.300s")))return!0}return!1}}),g=f.find(t.id,r.id).reverse();return console.log("Shorest Path:",g),g}(v,y,m);try{return _(t,i,w,m)}catch(e){throw e}}return{}}function S(e,t,n){for(var r=new Set,i=0;n.routes&&i<n.routes.length;i+=1){var o=n.routes[i];o.isPortal&&(r.add(o.edges[0]),r.add(o.edges[1]))}var a=performance.now(),s=Eu(ju,!0,pu.Network,!1),l=zu(u.edgeData,r);console.log("time load: ",(performance.now()-a)/1e3),a=performance.now(),e.lines.concat(t.lines,l.lines);var c=s;return console.log("time network: ",(performance.now()-a)/1e3,s.length),x(e,t,l.edgeData,c)}function A(e,t,n){var r=performance.now();if(n){console.log("getDirectRoute() called for Airside Roadways Routing"),e.lines.concat(t.lines);var i=Eu("where.changi.airside",!1,pu.AirsideNetwork,!0);return console.log("Network Features:",i),console.log("time network: ",(performance.now()-r)/1e3),x(e,t,{},i)}console.log("getDirectRoute() called for In-Airport Routing");var o=Eu(Ou(e.where),!0,pu.Network,!1),a=Eu(Ou(t.where),!0,pu.Network,!1),s=Iu(u.edgeData,Ou(e.where)),l=Iu(u.edgeData,Ou(t.where));console.log("time load: ",(performance.now()-r)/1e3),r=performance.now(),e.lines.concat(t.lines,s.lines,l.lines);var c=o.concat(a);return console.log("time network: ",(performance.now()-r)/1e3,o.length),x(e,t,j(j({},s.edgeData),l.edgeData),c)}return{getRoute:function(n,r,c){var h=function(e){var t;return e.mode===yu.WithinTerminal&&null!==(t=e.config.wheelChairAccessible)&&void 0!==t&&t}(c),d=function(e){return e.mode===yu.Airside?e.config.vehicleType:null}(c),p=function(e){if(e.mode===yu.Airside)return e.config.distanceThreshold}(c);if(i=h,s=d,a=function(e){return e.mode===yu.Airside}(c),l=function(e){return Boolean(e.config.forRealtime)}(c),n.type===du.MapObject&&r.type===du.MapObject&&n.mapObjectId===r.mapObjectId)return console.warn("Start and end locations are the same for mode ".concat(c.mode)),{};if(n.type===du.Coordinate&&r.type===du.Coordinate&&n.coordinates[0]===r.coordinates[0]&&n.coordinates[1]===r.coordinates[1]){var f="Start and end locations are the same for mode ".concat(c.mode);throw console.warn(f),new Error(f)}var g=Ru(n,{distanceThreshold:p,vehicleTemplateType:s}),m=Ru(r,{distanceThreshold:p,vehicleTemplateType:s});console.log("Routing Mode:",c.mode),console.log("Node1:",g),console.log("Node2:",m),console.log("Config:",c.config),e=g,t=m;var v=performance.now();if(function(e){return[yu.WithinTerminal,yu.ToTerminal,yu.FromTerminal].includes(e.mode)}(c)&&(u=Lu(),console.log("time portal load with extrapolation: ",(performance.now()-v)/1e3)),v=performance.now(),e&&t){var y=function(){var n=A(e,t,d);if(console.log("Direct route",n),wu.isEmpty(n)){var r=function(e,t){var n=performance.now(),r=Eu(ju,!0,pu.Network,!1);console.log("time load: ",(performance.now()-n)/1e3),n=performance.now(),e.lines.concat(t.lines,u.lines);var i=r;return console.log("time network: ",(performance.now()-n)/1e3,r.length),x(e,t,u.edgeData,i)}(e,t);return S(e,t,r)}return S(e,t,n)},w=void 0;if(c.mode===yu.Airside){o=!1;var b=A(e,t,d);return console.log("Airside direct route",b),b}return o=function(e){return e.mode===yu.WithinTerminal}(c),w=y(),wu.isEmpty(w)&&(o=!1,w=y()),console.log("time total: ",(performance.now()-v)/1e3),w}return{}}}}(),Ch={getRoute:Mh.getRoute};function Th(e){var t,n,r,i,o,a,s,l,u,c,h,d=Ru({type:du.MapObject,mapObjectId:e.edges[0]}),p=Ru({type:du.MapObject,mapObjectId:e.edges[1]});return j(j(j({maneuverType:mu.Static,coordinates:[],distance:0,features:[],time:0,startEdge:{mapObjectId:e.edges[0],whereDimension:e.startFloor,whatDimension:d?d.what:"",name:d?d.name:null!==(r=null===(n=null===(t=e.geojson)||void 0===t?void 0:t.properties)||void 0===n?void 0:n.name)&&void 0!==r?r:""},endEdge:{mapObjectId:e.edges[1],whereDimension:e.endFloor,whatDimension:p?p.what:"",name:p?p.name:null===(o=null===(i=e.geojson)||void 0===i?void 0:i.properties)||void 0===o?void 0:o.name},isPortal:e.isPortal,segmentType:vu.Internal,instructions:[],patchNumber:-1,whereDimension:"",zone:"",cost:e.cost,description:e.description},(null===(s=null===(a=e.geojson)||void 0===a?void 0:a.properties)||void 0===s?void 0:s.localRef)?{localRef:e.geojson.properties.localRef}:{}),(null===(u=null===(l=e.geojson)||void 0===l?void 0:l.properties)||void 0===u?void 0:u.name)?{name:e.geojson.properties.name}:{}),(null===(h=null===(c=e.geojson)||void 0===c?void 0:c.properties)||void 0===h?void 0:h.what)?{whatTaxonomy:e.geojson.properties.what}:{})}function kh(e){return e.maneuverType===mu.RouteOverview||e.maneuverType===mu.SectionOverview}function Eh(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];r.properties.highlight=!!t}return e}function Rh(e,t,n,r,i){if(void 0===i&&(i=""),0===e.length)return[];var o=[ve(e,{segmentNumber:t,dimension_where:i,patchNumber:r,isNode:!0})];return Eh(o,n),o}function Lh(e,t,n,r,i,o,a,s,l){if(void 0===o&&(o=""),void 0===a&&(a=""),void 0===s&&(s=""),void 0===l&&(l=""),0===e.length)return[];var u=j(j(j({segmentNumber:t,dimension_where:o,patchNumber:r,isNode:!1,zone:i},l?{localRef:l}:{}),a?{whatTaxonomy:a}:{}),s?{name:s}:{}),c=ye(e,j(j({},u),{featureBelongsToLineString:!0})),h=ve(e[0],j(j({},u),{featureBelongsToLineString:!1})),d=ve(e[e.length-1],j(j({},u),{featureBelongsToLineString:!1})),p=[];return p.push(h,c,d),Eh(p,n),p}function Dh(e,t,n){var r,i,o,a,s,l;return I(this,void 0,void 0,function(){var u,c,h,d,p,f,g,m,v,y,w,b,_,x,S,A,P,M,C,T,k,E,R,L,D,F,N,O,I,B,U,H,G,W,V,q,Z,Y,$,K,X,J,Q,ee,te,ne,re,ie,oe,ae,se,le,ue,ce,he,de,pe,fe,ge,me,ve,we,be,_e,xe;return z(this,function(z){for(u=function(e){var t,n,r;return{shouldAddOverviewSegment:null===(t=e.config.shouldAddOverviewSegment)||void 0===t||t,shouldAddStartSegment:null===(n=e.config.shouldAddStartSegment)||void 0===n||n,shouldAddEndSegment:null===(r=e.config.shouldAddEndSegment)||void 0===r||r}}(n),c=u.shouldAddOverviewSegment,h=u.shouldAddStartSegment,d=u.shouldAddEndSegment,p=function(e){var t;return null!==(t=e.indexOffset)&&void 0!==t?t:0}(n),f=n.mode===yu.Airside,g=Ch.getRoute(e,t,n),m=g.routes,console.log("PathSegments:",m),v=[],w=0;m&&w<m.length;w+=1)if(b=m[w],_=b.geojson.properties.zone,b.isPortal)y=j(j({},Th(b)),{maneuverType:mu.Static,coordinates:[b.geojson.geometry.coordinates[1]],zone:_,isPortal:!1}),X=j(j({},Th(b)),{maneuverType:mu.EnterPortal,coordinates:[b.geojson.geometry.coordinates[0]]}),v.push(X),J=j(j({},Th(b)),{maneuverType:mu.ExitPortal,coordinates:[b.geojson.geometry.coordinates[1]]}),v.push(J),(Q=v.length>0?v[v.length-1]:void 0)&&Q.maneuverType===mu.ExitPortal&&(v.pop(),b.portalPath&&(ee=j(j({},Th(b)),{maneuverType:mu.TravelPortal,coordinates:b.portalPath.geometry.coordinates,zone:_}),v.push(ee)),v.push(J));else{if(x=b.geojson.geometry.coordinates,S=mu.Static,0===v.length&&h&&(A=j(j({},Th(b)),{maneuverType:mu.Static,coordinates:[x[0]]}),v.push(A)),w>0&&v.length>0&&(P=m[w-1],M=P.geojson.properties.zone,_===M||f||(C=P.geojson.geometry.coordinates,L=j(j({},Th(P)),{maneuverType:mu.ChangeZone,zone:_,coordinates:[C[C.length-1]]}),v.push(L),S=mu.ChangeZone)),x.length>2)for(se=0;se<x.length-2;se+=1)T=x[se],k=x[se+1],E=x[se+2],y=j(j({},Th(b)),{maneuverType:mu.Static,coordinates:[E],zone:_||""}),R=mu.ContinueStraight,L=j(j({},Th(b)),{maneuverType:R,zone:_}),S===mu.ContinueStraight?(se+3===x.length?v[v.length-1].coordinates.push(k,E):v[v.length-1].coordinates.push(k),v[v.length-1].maneuverType=R):(L.coordinates.push(T,k),v.push(L),se+3===x.length&&(R===mu.ContinueStraight?v[v.length-1].coordinates.push(E):v.push(j(j({},Th(b)),{maneuverType:mu.ContinueStraight,coordinates:[k,E],zone:_||""})))),S=R;else L=j(j({},Th(b)),{maneuverType:mu.ContinueStraight,coordinates:x,zone:_}),v.push(L),y=j(j({},Th(b)),{maneuverType:mu.Static,coordinates:[x[x.length-1]],zone:_||""});if(D=function(){if(v.length>0){var e=v[v.length-1];e.maneuverType===mu.ChangeZone&&e.zone===hu.Transit&&v.pop()}},(Q=v.length>0?v[v.length-1]:void 0)&&Q.maneuverType===mu.ContinueStraight)for(F=Du(Q.startEdge.whereDimension),N=ye(Q.coordinates),se=0;se<F.length;se+=1)O=F[se],Lc(N,O)||((I=ts(N,O)).features.length>1?(v.pop(),B=Oc(oa(N)[0],ia(I.features[0]),N),is(B,{units:"meters"})>=10?(U=j(j({},Th(b)),{maneuverType:mu.ContinueStraight,zone:_,coordinates:oa(B)}),v.push(U)):v.length>0&&((Q=v[v.length-1]).maneuverType===mu.ChangeZone?(H=oa(B),Q.coordinates=[H[H.length-1]],v.length>1&&((q=v[v.length-2]).coordinates=q.coordinates.concat(oa(B)))):Q.coordinates.concat(oa(B))),G=Oc(ia(I.features[0]),ia(I.features[1]),N),W=j(j({},Th(b)),{maneuverType:mu.PassThroughImmigration,zone:_,coordinates:oa(G)}),0===v.length&&(W.coordinates=B.geometry.coordinates.concat(W.coordinates)),D(),v.push(W),Y=oa(N),$=Oc(ia(I.features[1]),Y[Y.length-1],N),K=j(j({},Th(b)),{maneuverType:mu.ContinueStraight,zone:_,coordinates:oa($)}),v.push(K)):I.features.length>0&&(Ws(oa(N)[0],O)?(v.pop(),G=Oc(oa(N)[0],ia(I.features[0]),N),W=j(j({},Th(b)),{maneuverType:mu.PassThroughImmigration,zone:_,coordinates:oa(G)}),(Q=v.length>0?v[v.length-1]:void 0)&&Q.maneuverType===mu.ChangeZone&&(V=v.pop(),v.length>1&&(q=v[v.length-1]).maneuverType===mu.PassThroughImmigration&&(v.pop(),V.coordinates=[q.coordinates[0]],v.push(V),W.coordinates=q.coordinates.concat(W.coordinates))),D(),v.push(W),Y=oa(N),$=Oc(ia(I.features[0]),Y[Y.length-1],N),K=j(j({},Th(b)),{maneuverType:mu.ContinueStraight,zone:_,coordinates:oa($)}),v.push(K)):(Z=Oc(oa(N)[0],ia(I.features[0]),N),Q.coordinates=oa(Z),Y=oa(N),$=Oc(ia(I.features[0]),Y[Y.length-1],N),K=j(j({},Th(b)),{maneuverType:mu.PassThroughImmigration,zone:_,coordinates:oa($)}),v.push(K))))}if(y&&d&&v.push(y),f&&v.length>0&&function(e){if(0!==(null==e?void 0:e.length)){e[0].coordinates=[e[1].coordinates[e[1].coordinates.length-1]],e[e.length-1].coordinates=[e[e.length-2].coordinates[0]],e.splice(1,1),e.splice(e.length-2,1);for(var t=1;t<e.length;t+=1){var n=e[t-1],r=e[t];if((n.maneuverType===mu.ContinueStraight||n.maneuverType===mu.RoadChangeContinueStraight||n.maneuverType===mu.TurnLeftAndContinue||n.maneuverType===mu.TurnSlightLeftAndContinue||n.maneuverType===mu.TurnRightAndContinue||n.maneuverType===mu.TurnSlightRightAndContinue||n.maneuverType===mu.UTurnAndContinue)&&r.maneuverType===mu.ContinueStraight&&n.localRef!==r.localRef){var i=n.coordinates,o=r.coordinates;if(i.length>=2&&o.length>=2){var a=la(i[i.length-2],i[i.length-1]),s=la(o[0],o[1])-a;s>180&&(s-=360),s<-180&&(s+=360),r.maneuverType=s>-30&&s<30?mu.RoadChangeContinueStraight:s>=30&&s<60?mu.TurnSlightRightAndContinue:s>=60&&s<120?mu.TurnRightAndContinue:s<=-30&&s>-60?mu.TurnSlightLeftAndContinue:s<=-60&&s>-120?mu.TurnLeftAndContinue:mu.UTurnAndContinue}else r.maneuverType=mu.RoadChangeContinueStraight}}}}(v),te={segments:v,walkingDistance:0,transportDistance:0,walkingTime:0,transportTime:0,distanceUnit:Au,speed:1},f&&(te.speed=8.33),te.segments.length>0){for(re=0,(ne=c)&&((ie=wu.cloneDeep(te.segments[0])).maneuverType=mu.RouteOverview,te.segments.unshift(ie),re=1),oe=p+re,ae=te.segments.length>re?te.segments[re].startEdge.whereDimension:"",se=re;se<te.segments.length;se+=1){if(le=!1,ue=te.segments[se],ce=p+se,ue.isPortal){if(ue.maneuverType===mu.EnterPortal){for(de=Rh(ue.coordinates[0],ce,le,oe,ue.startEdge.whereDimension),pe=[],fe=0,ge=de;fe<ge.length;fe++)me=ge[fe],pe.push(me);ue.features=pe,ue.patchNumber=oe,ue.whereDimension=ae,(ve=te.segments.length>=se+2?te.segments[se+1]:void 0)&&ve.maneuverType!==mu.TravelPortal?(we=ue.cost,ue.time=we||0):ue.time=0,ue.distance=0}ue.maneuverType===mu.TravelPortal&&(ue.features=Lh(ue.coordinates,ce,le,oe,ue.zone,ue.startEdge.whereDimension),ue.patchNumber=oe,ue.whereDimension=ae,we=ue.cost,ue.time=we||0,be=void 0,be=ue.coordinates.length>1?is(ye(ue.coordinates),{units:te.distanceUnit}):0,ue.distance=be,se>0&&(te.segments[se-1].time=0)),ue.maneuverType===mu.ExitPortal&&(oe+=1,ae=ue.endEdge.whereDimension,te.segments.splice(se,1),se-=1),(_e=te.segments.length>=se+2?te.segments[se+1]:void 0)&&_e.maneuverType===mu.TravelPortal&&(oe+=1)}else ue.maneuverType===mu.Static||ue.maneuverType===mu.ChangeZone?(ue.features=Rh(ue.coordinates[0],ce,le,oe,ue.endEdge.whereDimension),ue.patchNumber=oe,ue.whereDimension=ae):(ue.features=Lh(ue.coordinates,ce,le,oe,ue.zone,ue.startEdge.whereDimension,null!==(o=null===(i=null===(r=ue.features[0])||void 0===r?void 0:r.properties)||void 0===i?void 0:i.what)&&void 0!==o?o:"",null!==(l=null===(s=null===(a=ue.features[0])||void 0===a?void 0:a.properties)||void 0===s?void 0:s.name)&&void 0!==l?l:"",ue.localRef),ue.patchNumber=oe,ue.whereDimension=ae),he=ue.coordinates,be=void 0,be=he.length>1?is(ye(he),{units:te.distanceUnit}):0,ue.distance=be,ue.maneuverType!==mu.PassThroughImmigration?ue.time=ue.distance/te.speed:ue.time=0;f||ue.maneuverType===mu.TravelPortal?(te.transportDistance+=ue.distance,te.transportTime+=ue.time):(te.walkingDistance+=ue.distance,te.walkingTime+=ue.time)}ne&&(xe=Kh(te,p),te.segments[0]=xe)}return[2,te]})})}function Fh(e){return!!Object.values(Ah).includes(e)}function Nh(e){return!!Object.values(Ph).includes(e)}function Oh(e){return!(!Fh(e)&&!Nh(e))}function jh(e){switch(e){case"what.transport.skytrain":return"Skytrain";case"what.service.airport_transfer":return"Bus";case"what.infra.escalator":return"Escalator";case"what.infra.lift":return"Lift";case"what.infra.entrance":case"what.infra.exit":return"";default:return e}}function Ih(e,t){var n,r=function(e){var t=e.split(".").slice(-2).join("").toUpperCase().match(/^(T\d+|JEWEL)([A-Za-z]\d+[A-Za-z]?)$/);if(t){var n=void 0;switch(t[1][0]){case"T":n="Terminal";break;case"J":n="Jewel";break;default:n="Level"}var r="Terminal"===n?"".concat(n," ").concat(t[1][1]):"".concat(n),i=void 0;switch(t[2][0]){case"L":default:i="Level";break;case"B":i="Basement"}return{Terminal:r,Level:"".concat(i," ").concat(t[2].substring(1))}}return null}(t);if(r){if((n=e)===Ah.Skytrain||n===Ah.Bus)return r.Terminal;if(e===Ah.Escalator||e===Ah.Lift)return r.Level;if(Nh(e))return r.Terminal}return t.split(".").slice(-2).join(" ").toUpperCase()}!function(e){e.Skytrain="what.transport.skytrain",e.Bus="what.service.airport_transfer",e.Escalator="what.infra.escalator",e.Lift="what.infra.lift"}(Ah||(Ah={})),function(e){e.Entrance="what.infra.entrance",e.Exit="what.infra.exit"}(Ph||(Ph={}));var zh=function(e){return(e="number"==typeof e?{precision:e}:e||{}).precision=e.precision||5,e.factor=e.factor||Math.pow(10,e.precision),e.dimension=e.dimension||2,e},Bh={encode:function(e,t){t=zh(t);var n=[];return e.forEach(function(e){if(2===t.dimension)n.push(e.lat||e[0]),n.push(e.lng||e[1]);else for(var r=0;r<t.dimension;++r)n.push(e[r])}),Bh.encodeDeltas(n,t)},decode:function(e,t){t=zh(t);for(var n=Bh.decodeDeltas(e,t),r=[],i=0;i<n.length;i+=2){var o=[],a=n[i],s=n[i+1];o.push(s,a),r.push(o)}return r},encodeDeltas:function(e,t){t=zh(t);var n=[];return e.forEach(function(r,i){var o=r-(n[i%t.dimension]||0);n[i%t.dimension]=r,e[i]=o}),Bh.encodeFloats(e,t)},decodeDeltas:function(e,t){t=zh(t);var n=[],r=Bh.decodeFloats(e,t);return r.forEach(function(e,i){r[i]=Math.round((n[i%t.dimension]=e+(n[i%t.dimension]||0))*t.factor)/t.factor}),r},encodeFloats:function(e,t){return t=zh(t),Bh.encodeSignedIntegers(e.map(function(e){return Math.round(e*t.factor)}))},decodeFloats:function(e,t){return t=zh(t),Bh.decodeSignedIntegers(e).map(function(e){return e/t.factor})},encodeSignedIntegers:function(e){return Bh.encodeUnsignedIntegers(e.map(function(e){return e<0?~(e<<1):e<<1}))},decodeSignedIntegers:function(e){return Bh.decodeUnsignedIntegers(e).map(function(e){return 1&e?~(e>>1):e>>1})},encodeUnsignedIntegers:function(e){return e.reduce(function(e,t){return e+Bh.encodeUnsignedInteger(t)},"")},decodeUnsignedIntegers:function(e){for(var t=[],n=0,r=0,i=0;i<e.length;i++){var o=e.charCodeAt(i)-63;n|=(31&o)<<r,o<32?(t.push(n),n=0,r=0):r+=5}return t},encodeSignedInteger:function(e){return Bh.encodeUnsignedInteger(e<0?~(e<<1):e<<1)},encodeUnsignedInteger:function(e){for(var t="";e>=32;)t+=String.fromCharCode(63+(32|31&e)),e>>=5;return t+=String.fromCharCode(e+63)}};function Uh(e,t,n,r){return I(this,void 0,void 0,function(){return z(this,function(e){return[2,null]})})}function Hh(e){return I(this,void 0,void 0,function(){return z(this,function(e){return[2,null]})})}function Gh(e){var t={maneuverType:mu.Static,coordinates:[],distance:e.distance,features:[],time:e.duration,startEdge:{mapObjectId:"",whereDimension:"where.external",whatDimension:"what.location",name:e.from.name},endEdge:{mapObjectId:"",whereDimension:"where.external",whatDimension:"what.location",name:e.to.name},isPortal:"WALK"!==e.mode,segmentType:vu.External,instructions:[],patchNumber:-1,whereDimension:"where.external",zone:""};return"WALK"!==e.mode&&(t.portalName=e.routeLongName),t}function Wh(e,t,n,r,i){var o;return void 0===t&&(t=!0),void 0===n&&(n=!0),void 0===r&&(r=!0),void 0===i&&(i=0),I(this,void 0,void 0,function(){var a,s,l,u,c,h,d,p,f,g,m,v,y,w,b,_,x,S,A,P,M,C,T,k;return z(this,function(E){try{if(a=null==e?void 0:e.legs,s=null===(o=null==e?void 0:e.legs)||void 0===o?void 0:o.length,l=[],n&&(u=j(j({},Gh(a[0])),{maneuverType:mu.Static,coordinates:[Bh.decode(a[0].legGeometry.points,5)[0]],distance:0,isPortal:!1,features:[],time:0}),l.push(u)),a.map(function(e){var t=Bh.decode(e.legGeometry.points,5);if("WALK"===e.mode){var n=j(j({},Gh(e)),{maneuverType:mu.ContinueStraight,coordinates:t,distance:e.distance,time:e.duration});l.push(n)}else{var r=[];if("BUS"===e.mode){var i=l[l.length-1];r=i.coordinates.length>2?i.coordinates[i.coordinates.length-1]:[],console.log("LAST_LINE:",i),console.log("LAST_VERTEX:",r)}var o=j(j({},Gh(e)),{maneuverType:mu.EnterPortal,coordinates:r.length>1?[r]:[t[0]],isPortal:!0,distance:0,time:0}),a=j(j({},Gh(e)),{maneuverType:mu.TravelPortal,coordinates:t,isPortal:!0,distance:e.distance,time:e.duration}),s=j(j({},Gh(e)),{maneuverType:mu.ExitPortal,coordinates:[t[t.length-1]],distance:0,time:0,isPortal:!0});l.push(o,a,s)}}),r&&(c=Bh.decode(a[s-1].legGeometry.points,5),h=j(j({},Gh(a[s-1])),{maneuverType:mu.Static,coordinates:[c[c.length-1]],distance:0,isPortal:!1,features:[],time:0}),l.push(h)),(d={segments:l,walkingDistance:0,transportDistance:0,walkingTime:0,transportTime:0,distanceUnit:Au,speed:1}).segments.length>0){for(f=0,(p=t)&&((g=wu.cloneDeep(d.segments[0])).maneuverType=mu.SectionOverview,d.segments.unshift(g),(g=wu.cloneDeep(d.segments[0])).maneuverType=mu.RouteOverview,d.segments.unshift(g),f=2),m=i+f,v=d.segments.length>f?d.segments[f].startEdge.whereDimension:"",y=f;y<d.segments.length;y+=1){if(w=!1,b=d.segments[y],_=i+y,b.isPortal){if(b.maneuverType===mu.EnterPortal){for(x=Yh(b.coordinates[0],_,w,m,b.startEdge.whereDimension),S=[],A=0,P=x;A<P.length;A++)M=P[A],S.push(M);b.features=S,b.patchNumber=m,b.whereDimension=v}b.maneuverType===mu.TravelPortal&&(b.features=$h(b.coordinates,_,w,m,b.zone,b.startEdge.whereDimension),b.patchNumber=m,b.whereDimension=v),b.maneuverType===mu.ExitPortal&&(d.segments.splice(y,1),y-=1)}else b.maneuverType===mu.Static?(b.features=Yh(b.coordinates[0],_,w,m,b.endEdge.whereDimension),b.patchNumber=m,b.whereDimension=v):(b.features=$h(b.coordinates,_,w,m,b.zone,b.startEdge.whereDimension),b.patchNumber=m,b.whereDimension=v),C=b.coordinates,T=void 0,T=C.length>1?is(ye(C),{units:d.distanceUnit}):0,b.distance=T;b.maneuverType===mu.ContinueStraight?(d.walkingDistance+=b.distance,d.walkingTime+=b.time):(d.transportDistance+=b.distance,d.transportTime+=b.time)}p&&(k=Kh(d,i),d.segments[0]=k,k=Kh(d,i+1),d.segments[1]=k)}return[2,d]}catch(e){return console.log("Error:",e),[2,void 0]}return[2]})})}function Vh(e,t,n,r,i){return I(this,void 0,void 0,function(){var i,o,a,s,l,u,c,h,d;return z(this,function(p){switch(p.label){case 0:if(!e)return console.error("ExternalTransitionPoint not received"),[2,void 0];if(t.type!==du.MapObject)return console.error("Internal location must be MapObject type for external routing"),[2,void 0];if(i=Number.POSITIVE_INFINITY,console.log("ExternalTransitionPoint",e),0===(a=void e.stopCode).length)return[2,void 0];if(console.log("AirportTransitionPoints:",a),!(a.length>0))return[3,5];s=0,p.label=1;case 1:return s<a.length?(l={type:du.MapObject,mapObjectId:a[s].id},u=void 0,c=void 0,"Inside"===r?(u=l,c=t):(u=t,c=l),[4,Xh(u,c,n)]):[3,4];case 2:h=p.sent(),(d=h.walkingTime+h.transportTime)<i&&(i=d,o=h),p.label=3;case 3:return s+=1,[3,1];case 4:return console.log("InternalShortestRoute:",o),console.log("InternalShortestTime",i/60),[3,6];case 5:return console.error("Internal transition points not found"),[2,void 0];case 6:return[2,o]}})})}function qh(e,t,n,r){return void 0===r&&(r="Inside"),I(this,void 0,void 0,function(){var i,o,a,s,l,u,c,h,d,p,f,g,m,v;return z(this,function(y){switch(y.label){case 0:a=e.plan.itineraries.length,s=e.plan.itineraries,l=Number.POSITIVE_INFINITY,u=0,y.label=1;case 1:return u<a?(function(e,t){"Inside"!==t||"WALK"!==e[e.length-1].mode||"SUBWAY"!==e[e.length-2].mode&&"BUS"!==e[e.length-2].mode?"Outside"!==t||"WALK"!==e[0].mode||"SUBWAY"!==e[1].mode&&"BUS"!==e[1].mode||e.shift():e.pop()}(c=s[u].legs,r),h=s[u].legs.length,d=void 0,p=null,f=void 0,"Inside"===r?(d=c[h-1].mode,p={name:c[h-1].to.name,lat:c[h-1].to.lat,lng:c[h-1].to.lon,stopId:c[h-1].to.stopId,stopCode:c[h-1].to.stopCode}):"Outside"===r&&(d=c[0].mode,p={name:c[0].from.name,lat:c[0].from.lat,lng:c[0].from.lon,stopId:c[0].from.stopId,stopCode:c[0].from.stopCode}),"WALK"!==d?[3,3]:("Inside"===r?(d=c[h-2].mode,p={name:c[h-2].to.name,lat:c[h-2].to.lat,lng:c[h-2].to.lon,stopId:c[h-2].to.stopId,stopCode:c[h-2].to.stopCode}):"Outside"===r&&(d=c[1].mode,p={name:c[1].from.name,lat:c[1].from.lat,lng:c[1].from.lon,stopId:c[1].from.stopId,stopCode:c[1].from.stopCode}),console.log("INFINITY_WALKMODE"),[4,Vh(p,t,n,r)])):[3,7];case 2:return f=y.sent(),[3,5];case 3:return[4,Vh(p,t,n,r)];case 4:f=y.sent(),y.label=5;case 5:if(!f||0===f.segments.length)return console.error("Internal route to nearest transition point not found"),[2,void 0];g=f.walkingTime+f.transportTime,m=s[u].duration,(v=g+m)<l&&(l=v,i=f,o=s[u]),y.label=6;case 6:return u+=1,[3,1];case 7:return[2,{shortestInternalRoute:i,shortestExternalRoute:o}]}})})}function Zh(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];r.properties.highlight=!!t}return e}function Yh(e,t,n,r,i){if(void 0===i&&(i=""),0===e.length)return[];var o=[ve(e,{segmentNumber:t,dimension_where:i,patchNumber:r,isNode:!0})];return Zh(o,n),o}function $h(e,t,n,r,i,o){if(void 0===o&&(o=""),0===e.length)return[];var a={segmentNumber:t,dimension_where:o,patchNumber:r,isNode:!1,zone:i},s=ye(e,j(j({},a),{featureBelongsToLineString:!0})),l=ve(e[0],j(j({},a),{featureBelongsToLineString:!1})),u=ve(e[e.length-1],j(j({},a),{featureBelongsToLineString:!1})),c=[];return c.push(l,s,u),Zh(c,n),c}function Kh(e,t){void 0===t&&(t=0);var n=wu.cloneDeep(e.segments[1]),r=e.segments.length>1?e.segments[1].startEdge.whereDimension:"";n.coordinates=[],n.features=[],n.time=0,n.distance=0,n.isPortal=!1,n.maneuverType=mu.RouteOverview,n.patchNumber=t,n.instructions=["Overview"];for(var i=1;i<e.segments.length;i+=1)if(e.segments[i].maneuverType!==mu.SectionOverview){for(var o=0;o<e.segments[i].coordinates.length;o+=1){var a=e.segments[i].coordinates[o];n.coordinates.push(a)}for(o=0;o<e.segments[i].features.length;o+=1){var s=wu.cloneDeep(e.segments[i].features[o]);s.properties&&!s.properties.isNode&&(s.properties.dimension_where!==r?s.properties.isNonHighlightedOverview="1":s.properties.isNonHighlightedOverview="0",s.properties.dimension_where=r,s.properties.patchNumber=n.patchNumber,s.properties.segmentNumber=n.patchNumber,n.features.push(s))}}return n.endEdge=wu.cloneDeep(e.segments[e.segments.length-1].endEdge),n.time=e.walkingTime+e.transportTime,n.distance=e.walkingDistance+e.transportDistance,n}function Xh(e,t,n){return I(this,void 0,void 0,function(){var r;return z(this,function(i){switch(i.label){case 0:return[4,Dh(e,t,n)];case 1:return r=i.sent(),console.log("internal generated: ",r),function(e){for(var t=function(t){return 0===t||1===t&&e.segments[t-1].maneuverType===mu.RouteOverview},n=function(e){return e.startEdge.whereDimension.toLowerCase().includes("l1")?"Clear Arrival Immigration":"Clear Departure Immigration"},r=function(e){return e?e.split(".").slice(5).join(" ").split(/[\s_]+/).map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join(" "):""},i=0;i<e.segments.length;i+=1){var o=e.segments[i];if(o.instructions=[],o.maneuverType===mu.RouteOverview){var a="Overview";o.instructions.push(a)}if(i>0&&o.maneuverType===mu.ChangeZone)a="",e.segments[i-1].zone===hu.Public&&o.zone===hu.Transit?a=n(o):e.segments[i-1].zone===hu.Transit&&o.zone===hu.Public&&(a="Exit Baggage Claim Hall"),o.instructions.push(a);else if(o.maneuverType===mu.ContinueStraight||o.maneuverType===mu.PassThroughImmigration){var s=o.maneuverType===mu.ContinueStraight?"".concat((null==o?void 0:o.localRef)?"Continue":"Walk"," for ").concat(Math.ceil(o.distance)," ").concat(e.distanceUnit):n(o);o.localRef&&(s=o.maneuverType===mu.ContinueStraight?"".concat((null==o?void 0:o.localRef)?"Continue":"Walk","\n ").concat((null==o?void 0:o.name)&&"unknown"!==o.name?"on ".concat(o.name):"","\n ").concat("".concat(r(o.whatTaxonomy)," Road"),"\n for ").concat(Math.ceil(o.distance)," ").concat(e.distanceUnit):n(o)),a=void 0,0===i||e.segments[i-1].maneuverType!==mu.ChangeZone&&(e.segments[i-1].maneuverType,mu.PassThroughImmigration),a=s,o.instructions.push(a)}else if(o.maneuverType===mu.Static)t(i)&&o.instructions.push("Start at ".concat(o.startEdge.name," on ").concat(o.startEdge.whereDimension.split(".").slice(-2).join(" ").toUpperCase())),i===e.segments.length-1&&o.instructions.push("Arrive at ".concat(o.endEdge.name," on ").concat(o.endEdge.whereDimension.split(".").slice(-2).join(" ").toUpperCase()));else if(o.maneuverType===mu.EnterPortal){if(a="Enter ".concat(o.startEdge.name," at ").concat(o.startEdge.whereDimension.split(".").slice(-2).join(" ").toUpperCase()),Nh(o.startEdge.whatDimension))a="Continue to ".concat(Ih(o.startEdge.whatDimension,o.endEdge.whereDimension)),o.instructions.push(a);else if(Fh(o.startEdge.whatDimension)){var l=i+1<=e.segments.length-1?e.segments[i+1]:void 0;if(l&&l.maneuverType===mu.TravelPortal){o.instructions.push(a),i+=1;var u=jh(l.startEdge.whatDimension);a="Take ".concat(u," to ").concat(Ih(o.startEdge.whatDimension,o.endEdge.whereDimension)),l.instructions.push(a),o.description&&l.instructions.push(o.description)}else{var c=jh(o.startEdge.whatDimension);a="Take ".concat(c," to ").concat(Ih(o.startEdge.whatDimension,o.endEdge.whereDimension)),o.instructions.push(a)}}}else o.maneuverType===mu.RoadChangeContinueStraight?(a="Continue on\n ".concat(o&&"unknown"!==o.name?o.name:"","\n ").concat("".concat(r(o.whatTaxonomy)," Road"),"\n for ").concat(Math.ceil(o.distance)," ").concat(e.distanceUnit),o.instructions.push(a)):o.maneuverType===mu.UTurnAndContinue?(a="Take U-Turn onto\n ".concat(o&&"unknown"!==o.name?o.name:"","\n ").concat("".concat(r(o.whatTaxonomy)," Road"),"\n for ").concat(Math.ceil(o.distance)," ").concat(e.distanceUnit),o.instructions.push(a)):o.maneuverType===mu.TurnSlightLeftAndContinue?(a="Turn Slight Left onto\n ".concat(o&&"unknown"!==o.name?o.name:"","\n ").concat("".concat(r(o.whatTaxonomy)," Road"),"\n & Continue for ").concat(Math.ceil(o.distance)," ").concat(e.distanceUnit),o.instructions.push(a)):o.maneuverType===mu.TurnLeftAndContinue?(a="Turn Left onto\n ".concat(o&&"unknown"!==o.name?o.name:"","\n ").concat("".concat(r(o.whatTaxonomy)," Road"),"\n & Continue for ").concat(Math.ceil(o.distance)," ").concat(e.distanceUnit),o.instructions.push(a)):o.maneuverType===mu.TurnRightAndContinue?(a="Turn Right onto\n ".concat(o&&"unknown"!==o.name?o.name:"","\n ").concat("".concat(r(o.whatTaxonomy)," Road"),"\n & Continue for ").concat(Math.ceil(o.distance)," ").concat(e.distanceUnit),o.instructions.push(a)):o.maneuverType===mu.TurnSlightRightAndContinue&&(a="Turn Slight Right onto\n ".concat(o&&"unknown"!==o.name?o.name:"","\n ").concat("".concat(r(o.whatTaxonomy)," Road"),"\n & Continue for ").concat(Math.ceil(o.distance)," ").concat(e.distanceUnit),o.instructions.push(a))}}(r),console.log(r.segments),[2,r]}})})}function Jh(e,t,n,r,i){return void 0===t&&(t=!0),void 0===n&&(n=!0),void 0===r&&(r=!0),void 0===i&&(i=0),I(this,void 0,void 0,function(){var o;return z(this,function(a){switch(a.label){case 0:return[4,Wh(e,t,n,r,i)];case 1:return o=a.sent(),console.log("GeneratedExternalRoute:",o),function(e){for(var t=0;t<e.segments.length;t+=1){var n=e.segments[t];if(n.instructions=[],n.maneuverType===mu.RouteOverview){var r="Overview";n.instructions.push(r)}n.maneuverType===mu.SectionOverview&&(r="",n.instructions.push(r)),t>0&&n.maneuverType===mu.ContinueStraight?(r="Walk for ".concat(Math.ceil(n.distance)," ").concat(e.distanceUnit),n.instructions.push(r)):t>0&&n.maneuverType===mu.TravelPortal?(r="Take ".concat(null==n?void 0:n.portalName," to ").concat(n.endEdge.name),n.instructions.push(r)):t>0&&n.maneuverType===mu.EnterPortal?(r="Enter ".concat(null==n?void 0:n.portalName," at ").concat(n.startEdge.name),n.instructions.push(r)):t>0&&n.maneuverType===mu.Static?t===e.segments.length-1?(r="Arrive at ".concat(n.endEdge.name),n.instructions.push(r)):1===t&&e.segments[t-1].maneuverType===mu.RouteOverview&&(r="Start at ".concat(n.startEdge.name),n.instructions.push(r)):0===t&&e.segments[t].maneuverType===mu.Static&&(r="Start at ".concat(n.startEdge.name),n.instructions.push(r))}}(o),[2,o]}})})}var Qh=new Map;function ed(e){return I(this,void 0,void 0,function(){var e;return z(this,function(t){switch(t.label){case 0:return[4,Hh()];case 1:return(e=t.sent())?[2,e.GeocodeInfo]:[2,void 0]}})})}function td(e){return I(this,void 0,void 0,function(){var t,n,r,i;return z(this,function(o){switch(o.label){case 0:return e.type===du.MapObject?(t=Ru(e))?[2,t.name||"Unknown Location"]:[2,"Unknown Location"]:e.type!==du.Coordinate?[3,3]:(n="".concat(e.coordinates[0],",").concat(e.coordinates[1]),"where.external"!==e.whereDimension?[3,2]:Qh.has(n)?[2,Qh.get(n)]:[4,ed()]);case 1:return r=o.sent(),i=n,r&&r.length>0&&(i="NIL"!==r[0].BUILDINGNAME&&"null"!==r[0].BUILDINGNAME?r[0].BUILDINGNAME:"NIL"!==r[0].ROAD&&"null"!==r[0].ROAD?r[0].ROAD:"".concat(e.coordinates[0].toFixed(5),",").concat(e.coordinates[1].toFixed(5))),Qh.set(n,i),[2,i];case 2:return[2,"".concat(e.coordinates[0].toFixed(6),",").concat(e.coordinates[1].toFixed(6))];case 3:return[2,"Unknown Location"]}})})}function nd(){return{segments:[],walkingDistance:0,transportDistance:0,walkingTime:0,transportTime:0,distanceUnit:Au,speed:1}}function rd(e,t,n,r,i){var o;return I(this,void 0,void 0,function(){var a,s,l,u,c,h,d,p,f,g,m,v,y;return z(this,function(w){switch(w.label){case 0:console.log("Case: Within Terminal (Pedestrian)"),a=null!==(o=t.wheelChairAccessible)&&void 0!==o&&o,s=nd(),l=nd(),s.segments.push({}),u=1,c=0,h=0,w.label=1;case 1:return h<e.length-1?(d={mode:yu.WithinTerminal,config:{wheelChairAccessible:a,shouldAddOverviewSegment:n,shouldAddStartSegment:r,shouldAddEndSegment:i,forRealtime:t.forRealtime},indexOffset:u},[4,Xh(e[h],e[h+1],d)]):[3,4];case 2:if(!((p=w.sent()).segments.length>0))return console.error("Within-terminal route not found"),[2,void 0];for((f=p.segments[0]).maneuverType=mu.SectionOverview,f.instructions=["".concat(f.startEdge.name," to ").concat(f.endEdge.name)],g=0;g<p.segments.length;g+=1)m=p.segments[g],s.segments.push(m),l.segments.push(m);s.walkingDistance+=p.walkingDistance,s.transportDistance+=p.transportDistance,s.walkingTime+=p.walkingTime,s.transportTime+=p.transportTime,l.walkingDistance+=p.walkingDistance,l.transportDistance+=p.transportDistance,l.walkingTime+=p.walkingTime,l.transportTime+=p.transportTime,u+=p.segments.length,w.label=3;case 3:return h+=1,[3,1];case 4:return v=Kh(l,c),s.segments[c]=v,l.segments.unshift(v),s.segments.length>1?(y=Kh(s),s.segments[0]=y):s.segments.length=0,console.log("Within-terminal route:",s),[2,s]}})})}function id(e,t,n,r,i){var o,a,s;return I(this,void 0,void 0,function(){var r,i,l,u,c,h,d,p,f,g,m,v,y,w,b,_,x,S,A,P,M,C,T,k,E,R,L,D,F,N;return z(this,function(O){switch(O.label){case 0:console.log("Case: To Terminal (External → Internal)"),r=t.departureDate,i=t.departureTime,l=t.wheelChairAccessible,u=void 0!==l&&l,c=nd(),h=nd(),d=nd(),c.segments.push({}),p=1,f=0,e.length>2&&(f=c.segments.length,p+=1,c.segments.push({})),g=0,O.label=1;case 1:return g<e.length-1?(m=e[g],e[g+1],m.type!==du.Coordinate?(console.error("ToTerminal mode: first location must be coordinate type"),[2,void 0]):(v=performance.now(),[4,Uh()])):[3,8];case 2:return(y=O.sent())?(w={mode:yu.ToTerminal,config:{departureDate:r,departureTime:i,shouldAddOverviewSegment:!0,shouldAddStartSegment:!0,shouldAddEndSegment:!0,forRealtime:t.forRealtime},indexOffset:p},[4,qh(y,e[g+1],w,"Inside")]):(console.error("External route not found"),[2,void 0]);case 3:return(b=O.sent())?(console.log("ShortestCompleteRoute:",b),_=performance.now(),console.log("EXECUTION_TIME:",_-v),[4,Jh(b.shortestExternalRoute,n,!0,!0,p)]):[2,void 0];case 4:return(x=O.sent()).segments.length?[4,td(e[g])]:(console.error("Something went wrong in computing external route"),[2,void 0]);case 5:return S=O.sent(),x.segments[2].instructions=["Start at ".concat(S)],p+=x.segments.length,p+=1,(A=null===(o=b.shortestInternalRoute)||void 0===o?void 0:o.segments)?(P={mode:yu.WithinTerminal,config:{wheelChairAccessible:u,shouldAddOverviewSegment:!0,shouldAddStartSegment:!0,shouldAddEndSegment:!0,forRealtime:t.forRealtime},indexOffset:p},M={type:du.MapObject,mapObjectId:A[0].startEdge.mapObjectId},C={type:du.MapObject,mapObjectId:A[A.length-1].endEdge.mapObjectId},[4,Xh(M,C,P)]):(console.error("Internal route segments empty"),[2,void 0]);case 6:if(!((T=O.sent()).segments.length>0))return console.error("Internal route not found"),[2,void 0];for((R=T.segments[0]).maneuverType=mu.SectionOverview,R.instructions=["".concat(R.startEdge.name," to ").concat(R.endEdge.name)],k=T.segments[1].startEdge.whereDimension.split("."),x.segments[x.segments.length-1].instructions=["Arrive at ".concat(T.segments[1].startEdge.name," at ").concat(k[3].toUpperCase()," ").concat(k[4].toUpperCase())],x.segments[x.segments.length-1].whereDimension=T.segments[1].startEdge.whereDimension,x.segments[x.segments.length-1].endEdge.whereDimension=T.segments[1].startEdge.whereDimension,x.segments[x.segments.length-1].features[0].geometry.coordinates=T.segments[1].coordinates,x.segments[x.segments.length-1].coordinates=T.segments[1].coordinates,x.segments[x.segments.length-1].patchNumber+=1,x.segments[x.segments.length-1].features[0].properties.patchNumber+=1,x.segments.length>0&&((E=x.segments[0]).maneuverType=mu.RouteOverview,E.instructions=["Overview"],(R=x.segments[1]).maneuverType=mu.SectionOverview,R.instructions=["".concat(S," to ").concat(null===(a=b.shortestInternalRoute)||void 0===a?void 0:a.segments[0].startEdge.name)],R.startEdge.name=S,R.endEdge.name=null===(s=b.shortestInternalRoute)||void 0===s?void 0:s.segments[0].startEdge.name),L=0;L<x.segments.length;L+=1)D=x.segments[L],c.segments.push(D),h.segments.push(D);if(c.walkingDistance+=x.walkingDistance,c.transportDistance+=x.transportDistance,c.walkingTime+=x.walkingTime,c.transportTime+=x.transportTime,h.walkingDistance+=x.walkingDistance,h.transportDistance+=x.transportDistance,h.walkingTime+=x.walkingTime,h.transportTime+=x.transportTime,f=c.segments.length,c.segments.push({}),T){for(L=0;L<T.segments.length;L+=1)D=null==T?void 0:T.segments[L],c.segments.push(D),d.segments.push(D);c.walkingDistance+=T.walkingDistance,c.transportDistance+=T.transportDistance,c.walkingTime+=T.walkingTime,c.transportTime+=T.transportTime,d.walkingDistance+=T.walkingDistance,d.transportDistance+=T.transportDistance,d.walkingTime+=T.walkingTime,d.transportTime+=T.transportTime,p+=T.segments.length}O.label=7;case 7:return g+=1,[3,1];case 8:return console.log("MergedExternalRoute:",h),console.log("MergedInternalRoute:",d),F=Kh(d,f),c.segments[f]=F,d.segments.unshift(F),c.segments.length>1?(N=Kh(c),c.segments[0]=N):c.segments.length=0,console.log("To-terminal route:",c),[2,{fullRoute:c,internalRoute:d,externalRoute:h}]}})})}function od(e,t,n,r,i){var o,a;return I(this,void 0,void 0,function(){var n,r,i,s,l,u,c,h,d,p,f,g,m,v,y,w,b,_,x,S,A,P;return z(this,function(M){switch(M.label){case 0:console.log("Case: From Terminal (Internal → External)"),n=t.departureDate,r=t.departureTime,t.wheelChairAccessible,i=nd(),s=nd(),l=nd(),i.segments.push({}),u=1,c=0,h=0,M.label=1;case 1:return h<e.length-1?(e[h],e[h+1].type!==du.Coordinate?(console.error("FromTerminal mode: last location must be coordinate type"),[2,void 0]):[4,Uh()]):[3,8];case 2:return(d=M.sent())?(2===e.length&&(u+=1),p={mode:yu.FromTerminal,config:{departureDate:n,departureTime:r,shouldAddOverviewSegment:!0,shouldAddStartSegment:!0,shouldAddEndSegment:!0,forRealtime:t.forRealtime},indexOffset:u},[4,qh(d,e[h],p,"Outside")]):(console.error("External route not found"),[2,void 0]);case 3:return(f=M.sent())&&(g=f.shortestInternalRoute)?(u+=g.segments.length,[4,Jh(f.shortestExternalRoute,!0,!0,!0,u)]):[2,void 0];case 4:return(m=M.sent()).segments.length?(m.segments[2].instructions=["Start at ".concat(null==g?void 0:g.segments[(null==g?void 0:g.segments.length)-1].endEdge.name)],m.segments[2].coordinates=g.segments[g.segments.length-1].coordinates,m.segments[2].features[0].geometry.coordinates=g.segments[g.segments.length-1].coordinates,[4,td(e[h+1])]):(console.error("Something went wrong in computing external route"),[2,void 0]);case 5:return v=M.sent(),m.segments[m.segments.length-1].instructions=["Arrive at ".concat(v)],m.segments[m.segments.length-1].endEdge.name=v,[4,td(e[h])];case 6:if(y=M.sent(),!(g&&g.segments.length>0))return console.log("Route not found"),[2,void 0];for((w=g.segments[0]).maneuverType=mu.SectionOverview,w.instructions=["".concat(y," to ").concat(g.segments[g.segments.length-1].endEdge.name)],m.segments.length>0&&((b=m.segments[0]).maneuverType=mu.RouteOverview,b.instructions=["Overview"],(_=m.segments[1]).maneuverType=mu.SectionOverview,_.instructions=["".concat(null===(o=f.shortestInternalRoute)||void 0===o?void 0:o.segments[f.shortestInternalRoute.segments.length-1].endEdge.name," to ").concat(v)],_.startEdge.name=null===(a=f.shortestInternalRoute)||void 0===a?void 0:a.segments[f.shortestInternalRoute.segments.length-1].endEdge.name,_.endEdge.name=v),2===e.length&&(c=i.segments.length,i.segments.push({})),x=0;x<g.segments.length;x+=1)S=g.segments[x],i.segments.push(S),l.segments.push(S);for(i.walkingDistance+=g.walkingDistance,i.transportDistance+=g.transportDistance,i.walkingTime+=g.walkingTime,i.transportTime+=g.transportTime,x=0;x<m.segments.length;x+=1)S=m.segments[x],i.segments.push(S),s.segments.push(S);i.walkingDistance+=m.walkingDistance,i.transportDistance+=m.transportDistance,i.walkingTime+=m.walkingTime,i.transportTime+=m.transportTime,s.walkingDistance+=m.walkingDistance,s.transportDistance+=m.transportDistance,s.walkingTime+=m.walkingTime,s.transportTime+=m.transportTime,u+=m.segments.length,M.label=7;case 7:return h+=1,[3,1];case 8:return console.log("MergedExternalRoute:",s),console.log("MergedInternalRoute:",l),A=Kh(l,c),i.segments[c]=A,l.segments.unshift(A),i.segments.length>1?(P=Kh(i),i.segments[0]=P):i.segments.length=0,console.log("From-terminal route:",i),[2,{fullRoute:i,internalRoute:l,externalRoute:s}]}})})}function ad(e,t,n,r,i){return I(this,void 0,void 0,function(){var o,a,s,l,u,c,h,d,p,f,g,m,v,y,w;return z(this,function(b){switch(b.label){case 0:console.log("Case: Airside Vehicle Routing"),o=t.vehicleType,a=t.distanceThreshold,s=void 0===a?30:a,l=nd(),u=nd(),l.segments.push({}),c=1,h=0,d=0,b.label=1;case 1:return d<e.length-1?(p={mode:yu.Airside,config:{vehicleType:o,distanceThreshold:s,shouldAddOverviewSegment:n,shouldAddStartSegment:r,shouldAddEndSegment:i,forRealtime:t.forRealtime},indexOffset:c},[4,Xh(e[d],e[d+1],p)]):[3,4];case 2:if(!((f=b.sent()).segments.length>0))return console.error("Airside route not found"),[2,void 0];for((g=f.segments[0]).maneuverType=mu.SectionOverview,g.instructions=["".concat(g.startEdge.name," to ").concat(g.endEdge.name)],m=0;m<f.segments.length;m+=1)v=f.segments[m],l.segments.push(v),u.segments.push(v);l.walkingDistance+=f.walkingDistance,l.transportDistance+=f.transportDistance,l.walkingTime+=f.walkingTime,l.transportTime+=f.transportTime,u.walkingDistance+=f.walkingDistance,u.transportDistance+=f.transportDistance,u.walkingTime+=f.walkingTime,u.transportTime+=f.transportTime,c+=f.segments.length,b.label=3;case 3:return d+=1,[3,1];case 4:return y=Kh(u,h),l.segments[h]=y,u.segments.unshift(y),l.segments.length>1?(w=Kh(l),l.segments[0]=w):l.segments.length=0,console.log("Airside route:",l),[2,l]}})})}var sd=function(e){function t(t,n,r,i){void 0===i&&(i=[]);var o=e.call(this,null!=r?r:"".concat(t,": ").concat(n))||this;return o.name="NavigationStartError",o.code=t,o.mode=n,o.missing=i,o}return O(t,e),t}(Error);function ld(e,t){if("string"!=typeof e||""===e.trim())throw new Error("".concat(t," is required to start navigation"));return e}function ud(e){if(null==e)throw new Error("Routing mode is not set. Call setRoutingMode before startNavigation.");if(e===yu.ToTerminal||e===yu.FromTerminal)throw new sd("UNSUPPORTED_ROUTE_MODE",e);if(e===yu.Airside&&!function(e){if(!e||"object"!==te(e))return!1;var t=e[pu.Network];if(!Array.isArray(t)||0===t.length)return!1;return t.some(function(e){var t,n=null===(t=null==e?void 0:e.properties)||void 0===t?void 0:t.dimension_what;return"string"==typeof n&&n.includes(pu.AirsideNetwork)})}(Hu.getState().data))throw new sd("MISSING_ROUTING_DATA",e);return e}function cd(e){return j(j({wheelChairAccessible:!1,shouldAddOverviewSegment:!0,shouldAddStartSegment:!0,shouldAddEndSegment:!0},e),{forRealtime:!0})}function hd(e){return e.startAnchorLngLat?e.startAnchorLngLat:e.useStartPositionAsAnchor?e.startLngLat:void 0}function dd(e){var t=this,n=null,r=!1,i=null,o=-1,a=[],s=null,l=!1,u=function(){var e=[];return l||e.push("routingDisplay"),e},c=function(e){var t=u();if(t.length>0)throw new sd("NOT_READY",e,void 0,t)},h=function(e,t){if(t instanceof Qs)throw new sd("NOT_READY",e,t.message,t.missing);throw t},d=function(){if(!s)throw new Error("NavigationEngine is not attached. Attach the engine after constructing Routing Manager.");return s},p=function(t){e.display.setDisplayRoute(t)},f=function(){return e.display.getDisplayRoute()},g=function(e){i=e},m=function(e){p(e),g(e)},v=function(n){return I(t,void 0,void 0,function(){var t,r,i,o,a,s;return z(this,function(l){switch(l.label){case 0:return t=!1!==n.useInternalGPS,r=_u(n.mode,n.config),(i=t?r:r.filter(function(e){return"motion"===e})).length>0?[4,e.ensureRequiredSensors(i)]:[3,2];case 1:l.sent(),l.label=2;case 2:return t?[4,e.getInternalGpsPosition()]:[3,4];case 3:return a=l.sent(),[3,5];case 4:a=e.getExternalGpsPosition(),l.label=5;case 5:if(!(null==(o=a)?void 0:o.coordinates)){if(!t&&n.mode===yu.Airside)throw new Error("No external GPS position available. Call triggerGPSUpdate() first or provide an initial position.");throw new Error("Unable to determine start location")}return t||null===(s=e.onExternalGpsUsed)||void 0===s||s.call(e),[2,o]}})})},y=function(e,r){return I(t,void 0,void 0,function(){var t,i,a,s,l,u,c,h,d;return z(this,function(p){return null===n?(console.error("Route mode not set. Please call setRoutingMode() before computing routes."),[2,void 0]):(t=function(e,t){var n=[];switch(e){case yu.Airside:t.vehicleType||n.push("vehicleType is required for Airside routing mode");break;case yu.ToTerminal:case yu.FromTerminal:var r=t;r.departureDate||n.push("departureDate is required for ToTerminal/FromTerminal routing modes"),r.departureTime||n.push("departureTime is required for ToTerminal/FromTerminal routing modes");break;case yu.WithinTerminal:break;default:n.push("Unknown routing mode: ".concat(e))}return{isValid:0===n.length,errors:n}}(n,r),t.isValid?e.length<2?(console.warn("Invalid array passed to computeRoutes"),[2,void 0]):function(e,t){if(e.length<2)return!1;switch(t){case yu.WithinTerminal:return e.every(function(e){return e.type===du.MapObject||e.type===du.Coordinate&&"string"==typeof e.whereDimension&&""!==e.whereDimension.trim()&&"where.external"!==e.whereDimension});case yu.ToTerminal:return e[0].type===du.Coordinate&&"where.external"===e[0].whereDimension&&e.slice(1).every(function(e){return e.type===du.MapObject});case yu.FromTerminal:var n=e.length-1;return e[n].type===du.Coordinate&&"where.external"===e[n].whereDimension&&e.slice(0,-1).every(function(e){return e.type===du.MapObject});case yu.Airside:return e.every(function(e){return e.type===du.MapObject||e.type===du.Coordinate&&e.whereDimension.includes("airside")});default:return!1}}(e,n)?(i=j({},r),n===yu.Airside&&(a=i).vehicleType&&(a.vehicleType=j(j({},a.vehicleType),{defaults:Hu.getState().getTemplateDefaults()})),s=i.shouldAddOverviewSegment,l=void 0===s||s,u=i.shouldAddStartSegment,c=void 0===u||u,h=i.shouldAddEndSegment,d=void 0===h||h,o=-1,[2,function(e){switch(e){case yu.WithinTerminal:return rd;case yu.ToTerminal:return id;case yu.FromTerminal:return od;case yu.Airside:return ad;default:throw new Error("Unknown route mode: ".concat(e))}}(n)(e,i,l,c,d)]):(console.error("Invalid location types for route mode: ".concat(n)),console.error("Locations:",e),[2,void 0]):(console.error("Config validation failed:",t.errors),[2,void 0]))})})},w=function(e,n,r,i){return I(t,void 0,void 0,function(){var t,o;return z(this,function(a){return 2!==e.length||""===n||r.length<1?(console.warn("Invalid input parameters passed to computeRoutesFromLocation"),[2,void 0]):(t={type:du.Coordinate,coordinates:e,whereDimension:n},o=r.map(function(e){return{type:du.MapObject,mapObjectId:e}}),[2,y(B([t],o,!0),null!=i?i:{})])})})},b=function(e,n,r,i){return I(t,void 0,void 0,function(){var t;return z(this,function(o){return 2!==e.length||""===n||r.type!==du.Coordinate?(console.warn("Invalid input parameters passed to computeRouteFromLocationToCoordinates"),[2,void 0]):(t={type:du.Coordinate,coordinates:e,whereDimension:n},[2,y([t,r],null!=i?i:{})])})})},_=function(t,n){var r={padding:{top:50,right:50,bottom:50,left:50},duration:1e3};if(n.coordinates.length>1){var i=function(e,t){void 0===t&&(t=0);for(var n=[],r=0;r<e.segments.length;r+=1){var i=e.segments[r];i.patchNumber===t&&(n=n.concat(i.features))}return n}(t,n.patchNumber);if(!i.length)return;e.fitBounds(function(e){var t=dl({type:"FeatureCollection",features:e});return[t[0],t[1],t[2],t[3]]}(i),r)}else{var o={type:"FeatureCollection",features:[ve(n.coordinates[0])]},a=kc(o,.025,3).features[0].geometry.coordinates,s=kc(o,-.025,-3).features[0].geometry.coordinates;e.fitBounds([s[0],s[1],a[0],a[1]],r)}},x=function(n,r,i,s,l){return void 0===r&&(r=!0),void 0===i&&(i=!1),void 0===s&&(s=!0),void 0===l&&(l=!0),I(t,void 0,void 0,function(){var t,u,c,h,d;return z(this,function(p){return!(t=f())||t.segments.length<=n?(console.warn("Invalid segment number passed to highlightRouteSegment"),[2]):(u=t.segments[n]).coordinates.length?(c=u.maneuverType===mu.ExitPortal||u.maneuverType===mu.Static?u.endEdge.whereDimension:u.startEdge.whereDimension,h=u.features[0].properties.patchNumber,(i||o!==h)&&(o=h,a=function(e,t,n,r){var i;void 0===r&&(r=-1);for(var o=[],a=0;a<e.segments.length;a+=1){var s=e.segments[a];if(!(r>=0&&a<r))if(n.includeOverviewFeatures){if(kh(s)){for(var l=[],u=[],c=0;c<s.features.length;c+=1){var h=s.features[c];void 0!==(null===(i=h.properties)||void 0===i?void 0:i.patchNumber)&&h.properties.patchNumber===n.patchNumberForOverviewFeatures&&void 0!==h.properties.isNonHighlightedOverview&&("1"===h.properties.isNonHighlightedOverview?l.push(h):u.push(h))}var d=l.concat(u);o=o.concat(d)}}else s.patchNumber===t&&(kh(s)||(o=o.concat(s.features)))}return o}(t,h,{includeOverviewFeatures:kh(u),patchNumberForOverviewFeatures:h},n)),c&&c!==ll().getCurrentFocus()&&r&&ll().commit(c,{moveCamera:!1}),d=function(e,t,n){void 0===n&&(n=!1);for(var r=0;r<e.length;r+=1){var i=e[r];i.properties.segmentNumber===t?n?!0===i.properties.startPoint&&Zh([i],!0):Zh([i],!0):Zh([i],!1)}return e}(a,n),a=d,e.display.setPatchFeatures({type:"FeatureCollection",features:d}),l&&!kh(u)?function(t,n,r){var i,o=t.segments[n];if(null===(i=null==o?void 0:o.features)||void 0===i?void 0:i.length){var a=function(e,t){void 0===t&&(t="");for(var n=[],r=0;r<e.features.length;r+=1){var i=e.features[r];i.properties.featureBelongsToLineString&&(""!==t?i.properties.dimension_where&&i.properties.dimension_where===t&&n.push(i):n.push(i))}return n}(o,r);if(0!==a.length){var s=a[0].geometry.coordinates;s.length<=2&&s.push(s[s.length-1]),e.display.setAnimatedCoordinates(s)}else e.display.setAnimatedCoordinates([])}else e.display.setAnimatedCoordinates([])}(t,n,c):e.display.setAnimatedCoordinates([]),s&&_(t,u),[2]):(console.log("at vertical portal segment, ignoring!"),[2])})})},S=function(){i=null,o=-1,a=[],e.display.clear()},A=function(){r&&(null==s||s.stopNavigation(),e.enterNormalMode(),r=!1),S()},P=function(n){return I(t,void 0,void 0,function(){var t,i;return z(this,function(o){switch(o.label){case 0:(t=d()).setUIHandlers(n.handlers),m(n.route),e.enterNavigationMode(),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,t.startNavigation({startAnchorLngLat:hd(n),lockWhereTaxonomyPath:n.lockWhereTaxonomyPath})];case 2:return o.sent(),[3,4];case 3:throw i=o.sent(),t.stopNavigation(),e.enterNormalMode(),r=!1,i;case 4:return r=!0,[2,n.route]}})})},M={attachEngine:function(e){s=e},attachDisplay:function(){l=!0},detachDisplay:function(){l=!1},getReadiness:function(){return Js(u())},requestRerouteFromPosition:function(e){return I(t,void 0,void 0,function(){var t,n,o,a;return z(this,function(l){switch(l.label){case 0:return r&&e?(t=function(e){for(var t,n,r,i=null!==(t=null==e?void 0:e.segments)&&void 0!==t?t:[],o=i.length-1;o>=0;o-=1){var a=null===(r=null===(n=i[o])||void 0===n?void 0:n.endEdge)||void 0===r?void 0:r.mapObjectId;if(a)return a}}(i),t?(n=ll().getCurrentFocus(),[4,w(e,n,[t],cd())]):[2]):[2];case 1:return o=l.sent(),(null===(a=null==o?void 0:o.segments)||void 0===a?void 0:a.length)?(m(o),[4,x(0,!0,!0,!1,!1)]):[2];case 2:return l.sent(),null==s||s.onWhereTaxonomyUpdate(),null==s||s.notifyReroute(o),[2]}})})},getActiveRoute:f,setActiveRoute:function(e){p(e)},getReferenceRouteForTracking:function(){return i},setReferenceRouteForTracking:g,highlightRouteSegment:x,setRoutingMode:function(t){var r;n=t,null===(r=e.onRoutingModeChange)||void 0===r||r.call(e,t)},getRoutingParameters:function(){return n===yu.Airside?{vehicleType:Hu.getState().getTemplateTypes()}:n===yu.WithinTerminal?{wheelChairAccessible:[!1,!0]}:void 0},computeRoute:function(e,t,n){return I(this,void 0,void 0,function(){return z(this,function(r){return[2,y([{type:du.MapObject,mapObjectId:e},{type:du.MapObject,mapObjectId:t}],n)]})})},computeRoutes:function(e,t){return I(this,void 0,void 0,function(){return z(this,function(n){return[2,y(e.map(function(e){return{type:du.MapObject,mapObjectId:e}}),t)]})})},computeRoutesFromLocation:w,computeRouteFromCoordinates:function(e,t,r){return I(this,void 0,void 0,function(){var i;return z(this,function(o){return n!==yu.Airside?(console.error("computeRouteFromCoordinates only works when routing mode is set to Airside"),[2,void 0]):e&&t&&2===e.length&&2===t.length?(i={vehicleType:null==r?void 0:r.vehicleType,shouldAddOverviewSegment:!0,shouldAddStartSegment:!0,shouldAddEndSegment:!0},[2,y([{type:du.Coordinate,coordinates:e,whereDimension:"where.changi.airside"},{type:du.Coordinate,coordinates:t,whereDimension:"where.changi.airside"}],i)]):(console.error("Invalid coordinates provided to computeRouteFromCoordinates"),[2,void 0])})})},startNavigation:function(e,r,i,o){return I(this,void 0,void 0,function(){var a,s,l,u,f,g,m;return z(this,function(y){switch(y.label){case 0:a=ld(null==o?void 0:o.userWhereDimension,"userWhereDimension"),s=ud(n),c(s),y.label=1;case 1:return y.trys.push([1,3,,4]),[4,v({mode:s,useInternalGPS:null==o?void 0:o.useInternalGPS,config:r})];case 2:return l=y.sent(),[3,4];case 3:return u=y.sent(),[2,h(s,u)];case 4:return f=l.coordinates,s!==yu.Airside?[3,6]:[4,w(f,a,[e],r)];case 5:return g=y.sent(),[2,(b={route:g,handlers:i},I(t,void 0,void 0,function(){return z(this,function(e){if(!b.route)throw A(),new Error("Failed to compute route from GPS location to destination");return p(b.route),b.handlers&&d().setUIHandlers(b.handlers),[2,b.route]})}))];case 6:return[4,w(f,a,[e],cd(r))];case 7:if(!(m=y.sent()))throw new Error("Failed to compute route from GPS location to destination");return[2,P({route:m,handlers:i,startLngLat:f,startAnchorLngLat:null==o?void 0:o.startAnchorLngLat,useStartPositionAsAnchor:null==o?void 0:o.useStartPositionAsAnchor,lockWhereTaxonomyPath:a})]}var b})})},startNavigationFromCoordinates:function(e,t,r,i){return I(this,void 0,void 0,function(){var o,a,s,l,u,d;return z(this,function(p){switch(p.label){case 0:o=ld(null==i?void 0:i.startWhereDimension,"startWhereDimension"),a=function(e){if(null==e)throw new Error("Routing mode is not set. Call setRoutingMode before startNavigation.");if(e===yu.ToTerminal||e===yu.FromTerminal)throw new sd("UNSUPPORTED_ROUTE_MODE",e);if(e===yu.Airside)throw new sd("MISSING_ROUTING_DATA",e);return e}(n),c(a),p.label=1;case 1:return p.trys.push([1,3,,4]),[4,v({mode:a,useInternalGPS:null==i?void 0:i.useInternalGPS,config:t})];case 2:return s=p.sent(),[3,4];case 3:return l=p.sent(),[2,h(a,l)];case 4:return u=s.coordinates,[4,b(u,o,e,cd(t))];case 5:if(!(d=p.sent()))throw new Error("Failed to compute route from GPS location to destination");return[2,P({route:d,handlers:r,startLngLat:u,startAnchorLngLat:null==i?void 0:i.startAnchorLngLat,useStartPositionAsAnchor:null==i?void 0:i.useStartPositionAsAnchor,lockWhereTaxonomyPath:o})]}})})},stopNavigation:A,clearRoute:function(){S()}};return M}var pd=new Set;var fd=function(){function e(){var e,t,n=this;this.bootstrapped=!1,this.platform=null,this.routingDisplay={setDisplayRoute:function(){},getDisplayRoute:function(){return null},setPatchFeatures:function(){},setAnimatedCoordinates:function(){},clear:function(){}},this.taxonomyUpdateDetach=null,this.focusManager=new sl,this.cameraDirector=new il,this.focusManager.attachCameraDirector(this.cameraDirector),e=this.focusManager,al=e,this.mapDataService=new oc,this.userLocation=new ac({getFocusTree:function(){return n.mapDataService.getFocusTree()}}),this.userLocation.attachCameraDirector(this.cameraDirector),this.autoFocusManager=new cl(this.userLocation,new ul),this.autoFocusManager.addWhereTaxonomyUpdateAcceptedListener(function(e,t){n.focusManager.commit(e,{moveCamera:t})}),this.taxonomyUpdateStore=(t=function(){return n.autoFocusManager},Ks(function(e,n){return j(j({},hl),{openProposal:function(t){n().isAwaitingDecision||e({pendingWhere:t.whereTaxonomyPath,proposalId:t.id,proposalKind:t.kind,portalMeta:"portal"===t.kind?t.portal:null,isAwaitingDecision:!0,showTaxonomyUpdatePopup:!0,autoAcceptCooldownMs:t.autoAcceptCooldownMs})},clearProposal:function(){e(j({},hl))},acceptProposal:function(){var e,r=n().proposalId;r&&(null===(e=t())||void 0===e||e.acceptProposal(r),n().clearProposal())},rejectProposal:function(){var e,r=n().proposalId;r&&(null===(e=t())||void 0===e||e.rejectProposal(r),n().clearProposal())},manualOverride:function(e){var r,i=n().proposalId;i&&(null===(r=t())||void 0===r||r.manualOverride(i,e),n().clearProposal())}})})),this.routingManager=dd({ensureRequiredSensors:function(e){return I(n,void 0,void 0,function(){return z(this,function(t){switch(t.label){case 0:return[4,this.userLocation.ensureRequiredSensors(e)];case 1:if(!t.sent())throw new Error("Required sensor permission failed");return[2]}})})},getInternalGpsPosition:function(){return I(n,void 0,void 0,function(){var e,t;return z(this,function(n){switch(n.label){case 0:return(null==(e=this.userLocation.getCurrentPosition())?void 0:e.coordinates)?[2,{coordinates:e.coordinates}]:[4,this.userLocation.getGPSPosition({enableHighAccuracy:!0,timeout:1e4,maximumAge:5e3})];case 1:if(!(null==(t=n.sent())?void 0:t.coordinates))throw new Error("Failed to get GPS position");return[2,{coordinates:t.coordinates}]}})})},getExternalGpsPosition:function(){return n.userLocation.getExternalGpsPosition()},onExternalGpsUsed:function(){n.userLocation.setFollow(!0)},enterNavigationMode:function(){n.userLocation.enterNavigationMode()},enterNormalMode:function(){n.userLocation.enterNormalMode()},display:{setDisplayRoute:function(e){n.routingDisplay.setDisplayRoute(e)},getDisplayRoute:function(){return n.routingDisplay.getDisplayRoute()},setPatchFeatures:function(e){n.routingDisplay.setPatchFeatures(e)},setAnimatedCoordinates:function(e){n.routingDisplay.setAnimatedCoordinates(e)},clear:function(){n.routingDisplay.clear()}},fitBounds:function(e,t){var r,i,o;null===(o=null===(i=null===(r=n.platform)||void 0===r?void 0:r.camera)||void 0===i?void 0:i.fitBounds)||void 0===o||o.call(i,e,t)}}),this.navigationEngine=new xc(this.routingManager,this.userLocation,this.autoFocusManager),this.routingManager.attachEngine(this.navigationEngine),this.readinessStore=Ks(function(e){return j(j({},tl),{sync:function(t){e({ready:t.ready,missing:t.missing,modules:t.modules})}})}),this.mapDataService.onReadinessChange=function(){return n.syncReadiness()},this.syncReadiness()}return e.prototype.bootstrap=function(){var e;this.bootstrapped||(pd.size>0&&"boolean"==typeof(e=globalThis.__DEV__)&&e&&console.warn("MetaAtlasRuntime: a second concurrent bootstrap was attempted. Multi-map support is not available."),pd.add(this),this.bootstrapped=!0)},e.prototype.attach=function(e){var t,n,r,i;this.platform=e,e.style?this.focusManager.attachStyle(e.style):this.focusManager.detachStyle(),e.camera?this.cameraDirector.attachCamera(e.camera):this.cameraDirector.detachCamera(),this.userLocation.attachCameraDirector(this.cameraDirector),e.sensors?this.userLocation.attachSensors({gps:e.sensors.gps,compass:e.sensors.compass,motion:e.sensors.motion}):this.userLocation.detachSensors(),e.marker?this.userLocation.attachMarker(e.marker):this.userLocation.detachMarker(),e.routingDisplay?(this.routingDisplay=e.routingDisplay,this.routingManager.attachDisplay()):(this.routingDisplay={setDisplayRoute:function(){},getDisplayRoute:function(){return null},setPatchFeatures:function(){},setAnimatedCoordinates:function(){},clear:function(){}},this.routingManager.detachDisplay()),this.taxonomyUpdateDetach||(this.taxonomyUpdateDetach=(t=this.taxonomyUpdateStore,n=this.autoFocusManager,r=function(e){t.getState().openProposal(e)},i=function(){t.getState().clearProposal()},n.addWhereTaxonomyUpdateProposedListener(r),n.addWhereTaxonomyUpdateAutoRejectedListener(i),function(){n.removeWhereTaxonomyUpdateProposedListener(r),n.removeWhereTaxonomyUpdateAutoRejectedListener(i)})),this.autoFocusManager.start(),this.syncReadiness()},e.prototype.detach=function(){var e;this.autoFocusManager.stop(),null===(e=this.taxonomyUpdateDetach)||void 0===e||e.call(this),this.taxonomyUpdateDetach=null,this.taxonomyUpdateStore.getState().clearProposal(),this.userLocation.detachSensors(),this.userLocation.detachMarker(),this.userLocation.detachCameraDirector(),this.focusManager.detachStyle(),this.cameraDirector.detachCamera(),this.cameraDirector.detachFollowBreaker(),this.routingDisplay={setDisplayRoute:function(){},getDisplayRoute:function(){return null},setPatchFeatures:function(){},setAnimatedCoordinates:function(){},clear:function(){}},this.routingManager.detachDisplay(),this.platform=null,pd.delete(this),this.bootstrapped=!1,this.syncReadiness()},e.prototype.notifyMapLoaded=function(){this.cameraDirector.notifyMapLoaded()},e.prototype.isAttached=function(){return null!==this.platform},e.prototype.syncReadiness=function(){var e={mapDataService:this.mapDataService.getReadiness(),focusManager:this.focusManager.getReadiness(),cameraDirector:this.cameraDirector.getReadiness(),userLocation:this.userLocation.getReadiness(),routingManager:this.routingManager.getReadiness(),navigationEngine:this.navigationEngine.getReadiness()};this.readinessStore.getState().sync(j(j({},function(e){for(var t=[],n=new Set,r=0,i=nl;r<i.length;r++)for(var o=0,a=e[i[r]].missing;o<a.length;o++){var s=a[o];n.has(s)||(n.add(s),t.push(s))}return{ready:0===t.length,missing:t}}(e)),{modules:e}))},e}();var gd=function(){function e(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: (".concat(e,", ").concat(t,")"));if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}return e.prototype.wrap=function(){return new e(function(e,t,n){var r=n-t,i=((e-t)%r+r)%r+t;return i===t?n:i}(this.lng,-180,180),this.lat)},e.prototype.toArray=function(){return[this.lng,this.lat]},e.prototype.toString=function(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")},e.prototype.distanceTo=function(e){var t=Math.PI/180,n=this.lat*t,r=e.lat*t,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((e.lng-this.lng)*t);return 6371008.8*Math.acos(Math.min(i,1))},e.convert=function(t){if(t instanceof e)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new e(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"===te(t)&&null!==t)return new e(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")},e}(),md=function(){function e(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&(4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}return e.prototype.setNorthEast=function(e){return this._ne=e instanceof gd?new gd(e.lng,e.lat):gd.convert(e),this},e.prototype.setSouthWest=function(e){return this._sw=e instanceof gd?new gd(e.lng,e.lat):gd.convert(e),this},e.prototype.extend=function(t){var n,r,i=this._sw,o=this._ne;if(t instanceof gd)n=t,r=t;else{if(!(t instanceof e)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){var a=t;return this.extend(e.convert(a))}var s=t;return this.extend(gd.convert(s))}return t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(gd.convert(t)):this}if(n=t._sw,r=t._ne,!n||!r)return this}return i||o?(i.lng=Math.min(n.lng,i.lng),i.lat=Math.min(n.lat,i.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new gd(n.lng,n.lat),this._ne=new gd(r.lng,r.lat)),this},e.prototype.getCenter=function(){return new gd((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},e.prototype.getSouthWest=function(){return this._sw},e.prototype.getNorthEast=function(){return this._ne},e.prototype.getNorthWest=function(){return new gd(this.getWest(),this.getNorth())},e.prototype.getSouthEast=function(){return new gd(this.getEast(),this.getSouth())},e.prototype.getWest=function(){return this._sw.lng},e.prototype.getSouth=function(){return this._sw.lat},e.prototype.getEast=function(){return this._ne.lng},e.prototype.getNorth=function(){return this._ne.lat},e.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},e.prototype.toString=function(){return"LngLatBounds(".concat(this._sw.toString(),", ").concat(this._ne.toString(),")")},e.prototype.isEmpty=function(){return!(this._sw&&this._ne)},e.prototype.contains=function(e){var t=gd.convert(e),n=t.lng,r=t.lat,i=this._sw.lat<=r&&r<=this._ne.lat,o=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(o=this._sw.lng>=n&&n>=this._ne.lng),i&&o},e.convert=function(t){return t instanceof e?t:t?new e(t):t},e.fromLngLat=function(t,n){void 0===n&&(n=0);var r=360*n/40075017,i=r/Math.cos(Math.PI/180*t.lat);return new e(new gd(t.lng-i,t.lat-r),new gd(t.lng+i,t.lat+r))},e}(),vd={type:"FeatureCollection",features:[{geometry:{coordinates:[[[103.9887700096493,1.362197288740075],[103.98372695828216,1.350203640412193],[103.984442,1.3499],[103.984522,1.349519],[103.984595,1.349021],[103.984565,1.348824],[103.984299,1.348207],[103.984136,1.347977],[103.983544,1.347659],[103.983441,1.347551],[103.983406,1.347433],[103.983438,1.347319],[103.98353,1.347197],[103.983795,1.347079],[103.983766,1.346924],[103.983353,1.346048],[103.983243,1.345936],[103.982807,1.34491],[103.98248,1.344461],[103.981917,1.344321],[103.981657,1.343706],[103.981226,1.343634],[103.97963,1.344317],[103.979559,1.344288],[103.979305,1.343685],[103.979333,1.343613],[103.980066,1.3433],[103.980216,1.343181],[103.980255,1.343074],[103.980445,1.342997],[103.980612,1.34296],[103.980632,1.343008],[103.981048,1.342832],[103.981052,1.342818],[103.981227,1.342745],[103.981024,1.342263],[103.981054,1.342188],[103.981315,1.342076],[103.981218,1.341848],[103.981229,1.341501],[103.981132,1.341272],[103.981005,1.341209],[103.981055,1.341086],[103.980457,1.339669],[103.980355,1.339515],[103.980135,1.338995],[103.979095,1.338198],[103.978279,1.33808],[103.975271,1.339366],[103.975204,1.340095],[103.974918,1.340087],[103.974943,1.339506],[103.972207,1.340676],[103.971501,1.341176],[103.971142,1.341811],[103.972739,1.345616],[103.973197,1.345431],[103.973555,1.346306],[103.973211,1.346453],[103.973054,1.346829],[103.974724,1.350763],[103.975653,1.350486],[103.980587,1.362174],[103.98131,1.363104],[103.981335,1.363107],[103.982564,1.366051],[103.982293,1.366167],[103.982119,1.365756],[103.98133,1.366093],[103.982618,1.369145],[103.98282,1.369273],[103.982831,1.369696],[103.98365,1.371667],[103.983928,1.371539],[103.984111,1.37199],[103.984496,1.371861],[103.985404,1.373591],[103.985121,1.374019],[103.985113,1.374014],[103.982647,1.371321],[103.982496,1.372373],[103.98168,1.372263],[103.981716,1.372072],[103.980021,1.371786],[103.979887,1.372243],[103.980729,1.37247],[103.980692,1.372603],[103.981091,1.372691],[103.981034,1.372998],[103.981337,1.372997],[103.981415,1.373516],[103.981322,1.373544],[103.981172,1.373714],[103.980969,1.373801],[103.980852,1.373993],[103.980606,1.374239],[103.97928,1.374501],[103.981086,1.37878],[103.982853,1.378401],[103.982635,1.378257],[103.982474,1.378058],[103.982393,1.377849],[103.982097,1.377612],[103.981862,1.376523],[103.985786,1.375761],[103.986733,1.376127],[103.987115,1.376646],[103.987447,1.377519],[103.987659,1.378416],[103.987955,1.379165],[103.988196,1.380074],[103.988279,1.380704],[103.989644,1.384016],[103.991056,1.387452],[103.991115,1.387492],[103.991621,1.387271],[103.991907,1.387951],[103.993194,1.387398],[103.993351,1.387769],[103.993603,1.387683],[103.99394,1.388483],[103.995052,1.388468],[103.995287,1.388368],[103.995056,1.387822],[103.995064,1.387801],[103.996031,1.38852],[103.996133,1.388744],[103.997576,1.388221],[103.998461,1.388714],[103.999043,1.387917],[103.999938,1.386438],[104.000151,1.386113],[104.000588,1.385316],[104.000768,1.38415],[104.000444,1.382669],[103.999984,1.38182],[103.999957,1.381676],[103.99978,1.3813],[103.999989,1.38094],[103.999901,1.378161],[104.000575,1.377859],[104.00064,1.373982],[104.001258,1.373986],[104.00125,1.372264],[104.000731,1.372053],[104.000573,1.371818],[104.000571,1.371054],[104.000705,1.370845],[104.001129,1.370664],[104.001219,1.370704],[104.006418,1.368481],[104.006488,1.368648],[104.015097,1.364966],[104.015027,1.3648],[104.019352,1.36295],[104.017473,1.358499],[104.017508,1.358413],[104.018449,1.358011],[104.004397,1.324724],[104.00394,1.324916],[104.00425,1.32565],[104.004093,1.325724],[104.00417,1.325903],[104.004083,1.326121],[104.004174,1.32613],[104.004166,1.326149],[104.004173,1.326152],[104.004163,1.326177],[104.004154,1.326173],[104.004072,1.326164],[104.004122,1.326278],[104.003918,1.326365],[104.000334,1.317873],[103.999845,1.317087],[103.998308,1.313445],[103.993946,1.31531],[103.993768,1.315219],[103.99308,1.315514],[103.996385,1.323344],[103.996638,1.323447],[104.006107,1.345878],[104.006018,1.346102],[104.005537,1.346307],[104.005938,1.347258],[104.005852,1.347472],[103.997773,1.350929],[103.997657,1.350891],[103.997481,1.350593],[103.997142,1.350738],[103.997042,1.350698],[103.996503,1.349419],[103.996637,1.349084],[103.996896,1.348973],[103.996911,1.348937],[103.996038,1.346869],[103.995996,1.346857],[103.995743,1.346965],[103.99541,1.34683],[103.994841,1.345481],[103.995596,1.345158],[103.99563,1.34516],[103.995702,1.345189],[103.995789,1.345396],[103.996936,1.344905],[103.996533,1.343951],[103.995387,1.344445],[103.995511,1.344736],[103.995481,1.344808],[103.995464,1.344827],[103.994861,1.345089],[103.994637,1.344998],[103.988369,1.330147],[103.988347,1.329713],[103.98857,1.328474],[103.987978,1.327071],[103.987955,1.326785],[103.987164,1.324911],[103.987081,1.324946],[103.98561,1.321461],[103.986331,1.321152],[103.985866,1.320051],[103.985468,1.320222],[103.985421,1.320111],[103.985409,1.320116],[103.985405,1.320108],[103.985358,1.320128],[103.985296,1.319981],[103.985334,1.319965],[103.985348,1.319944],[103.98515,1.319072],[103.980111,1.321228],[103.978578,1.322455],[103.983567,1.33428],[103.983476,1.335036],[103.983474,1.335069],[103.983009,1.335268],[103.98354933284033,1.3364946996522131],[103.98231231703316,1.3370245683484567],[103.98342436604707,1.3396729339712583],[103.98417983421598,1.3393514014339156],[103.9844931502899,1.3400841720206023],[103.98503039557389,1.3398560432442772],[103.98580504242307,1.3417286171903666],[103.9835684958817,1.3426734121936035],[103.983583,1.342772],[103.983691,1.343028],[103.983891,1.343501],[103.983783,1.343856],[103.984129,1.343961],[103.984026,1.344257],[103.983817,1.344347],[103.98423,1.345329],[103.98415,1.345913],[103.98415,1.345913],[103.98451944524408,1.346791860811539],[103.98493495319761,1.3466099688724271],[103.98503012886492,1.3465959003602783],[103.98510582249939,1.3466114463854497],[103.985247,1.346683],[103.985504,1.347296],[103.986192,1.347001],[103.9870399702827,1.3489902225591661],[103.99210440121716,1.3609279279595752],[103.9887700096493,1.362197288740075]]],type:"Polygon"},type:"Feature",properties:{}}]},yd={},wd={},bd={};Object.defineProperty(bd,"__esModule",{value:!0}),bd.bytesToString=bd.stringToBytes=bd.NIL=bd.X500=bd.OID=bd.URL=bd.DNS=bd.hexToByte=bd.byteToHex=void 0;let _d=[],xd={};for(var Sd=0;Sd<256;Sd++)_d[Sd]=(Sd+256).toString(16).substr(1),xd[_d[Sd]]=Sd;bd.byteToHex=_d,bd.hexToByte=xd,bd.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",bd.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",bd.OID="6ba7b812-9dad-11d1-80b4-00c04fd430c8",bd.X500="6ba7b814-9dad-11d1-80b4-00c04fd430c8",bd.NIL="00000000-0000-0000-0000-000000000000";bd.stringToBytes=e=>{e=unescape(encodeURIComponent(e));const t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t};bd.bytesToString=e=>{const t=new Uint8Array(e,0,e.byteLength);return String.fromCharCode.apply(null,Array.from(t))},Object.defineProperty(wd,"__esModule",{value:!0}),wd.parse=void 0;const Ad=bd;wd.parse=(e,t,n)=>{let r=t&&n||0,i=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,e=>(i<16&&t&&(t[r+i++]=Ad.hexToByte[e]),""));i<16;)t[r+i++]=0;return t};var Pd={};Object.defineProperty(Pd,"__esModule",{value:!0}),Pd.unparse=void 0;const Md=bd;Pd.unparse=(e,t)=>{let n=t||0,r=Md.byteToHex;return r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]};var Cd={},Td={};Object.defineProperty(Td,"__esModule",{value:!0});Td.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;var kd=Ce&&Ce.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.validate=void 0;const Ed=kd(Td);Cd.validate=e=>"string"==typeof e&&Ed.default.test(e);var Rd={};Object.defineProperty(Rd,"__esModule",{value:!0}),Rd.version=void 0;const Ld=Cd;Rd.version=e=>{if(!(0,Ld.validate)(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)};var Dd={},Fd={};Object.defineProperty(Fd,"__esModule",{value:!0}),Fd.stringify=void 0;const Nd=Cd,Od=[];for(let e=0;e<256;++e)Od.push((e+256).toString(16).substr(1));Fd.stringify=(e,t=0)=>{const n=(Od[e[t+0]]+Od[e[t+1]]+Od[e[t+2]]+Od[e[t+3]]+"-"+Od[e[t+4]]+Od[e[t+5]]+"-"+Od[e[t+6]]+Od[e[t+7]]+"-"+Od[e[t+8]]+Od[e[t+9]]+"-"+Od[e[t+10]]+Od[e[t+11]]+Od[e[t+12]]+Od[e[t+13]]+Od[e[t+14]]+Od[e[t+15]]).toLowerCase();if(!(0,Nd.validate)(n))throw TypeError("Stringified UUID is invalid");return n};var jd={};Object.defineProperty(jd,"__esModule",{value:!0}),jd.rng=void 0;jd.rng=()=>{let e=new Array(16);for(let t=0;t<16;t++)e[t]=255&256*Math.random()+0;return e},Object.defineProperty(Dd,"__esModule",{value:!0}),Dd.v1=void 0;const Id=Fd,zd=jd;let Bd,Ud,Hd=0,Gd=0;Dd.v1=(e,t,n=0)=>{let r=t&&n||0;const i=t||new Uint8Array(16);let o=e&&e.node?e.node:Bd,a=e&&e.clockseq?e.clockseq:Ud;if(null==o||null==a){const t=e&&e.random?e.random:e&&e.rng?e.rng():(0,zd.rng)();null==o&&(o=Bd=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==a&&(a=Ud=16383&(t[6]<<8|t[7]))}let s=e&&e.msecs?e.msecs:Date.now(),l=e&&e.nsecs?e.nsecs:Gd+1;const u=s-Hd+(l-Gd)/1e4;if(u<0&&e&&!e.clockseq&&(a=a+1&16383),(u<0||s>Hd)&&e&&!e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Hd=s,Gd=l,Ud=a,s+=122192928e5;const c=(1e4*(268435455&s)+l)%4294967296;i[r++]=c>>>24&255,i[r++]=c>>>16&255,i[r++]=c>>>8&255,i[r++]=255&c;const h=s/4294967296*1e4&268435455;i[r++]=h>>>8&255,i[r++]=255&h,i[r++]=h>>>24&15|16,i[r++]=h>>>16&255,i[r++]=a>>>8|128,i[r++]=255&a;for(let e=0;e<6;++e)i[r+e]=o[e];return t||(0,Id.stringify)(i)};var Wd={},Vd={};Object.defineProperty(Vd,"__esModule",{value:!0}),Vd.v35=void 0;const qd=Fd,Zd=wd,Yd=bd;Vd.v35=(e,t,n)=>(e,r,i,o=0)=>{if("string"==typeof e&&(e=(0,Yd.stringToBytes)(e)),"string"==typeof r&&(r=(0,Zd.parse)(r)),r&&16!==r.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+e.length);if(a.set(r),a.set(e,r.length),a=(0,Yd.stringToBytes)(n((0,Yd.bytesToString)(a))),a[6]=15&a[6]|t,a[8]=63&a[8]|128,i)for(let e=0;e<16;++e)i[o+e]=a[e];return i||(0,qd.stringify)(a)};var $d={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.any_hmac_md5=e.b64_hmac_md5=e.hex_hmac_md5=e.any_md5=e.b64_md5=e.hex_md5=void 0;let t=0,n="";e.hex_md5=e=>o(r(l(e))),e.default=e.hex_md5;e.b64_md5=e=>a(r(l(e)));e.any_md5=(e,t)=>s(r(l(e)),t);e.hex_hmac_md5=(e,t)=>o(i(l(e),l(t)));e.b64_hmac_md5=(e,t)=>a(i(l(e),l(t)));e.any_hmac_md5=(e,t,n)=>s(i(l(e),l(t)),n);const r=e=>c(h(u(e),8*e.length)),i=(e,t)=>{var n=u(e);n.length>16&&(n=h(n,8*e.length));let r=Array(16),i=Array(16);for(var o=0;o<16;o++)r[o]=909522486^n[o],i[o]=1549556828^n[o];var a=h(r.concat(u(t)),512+8*t.length);return c(h(i.concat(a),640))},o=e=>{for(var n,r=t?"0123456789ABCDEF":"0123456789abcdef",i="",o=0;o<e.length;o++)n=e.charCodeAt(o),i+=r.charAt(n>>>4&15)+r.charAt(15&n);return i},a=e=>{for(var t="",r=e.length,i=0;i<r;i+=3)for(var o=e.charCodeAt(i)<<16|(i+1<r?e.charCodeAt(i+1)<<8:0)|(i+2<r?e.charCodeAt(i+2):0),a=0;a<4;a++)8*i+6*a>8*e.length?t+=n:t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-a)&63);return t},s=(e,t)=>{var n,r,i,o,a,s=t.length,l=Array(Math.ceil(e.length/2));for(n=0;n<l.length;n++)l[n]=e.charCodeAt(2*n)<<8|e.charCodeAt(2*n+1);var u=Math.ceil(8*e.length/(Math.log(t.length)/Math.log(2))),c=Array(u);for(r=0;r<u;r++){for(a=[],o=0,n=0;n<l.length;n++)o=(o<<16)+l[n],o-=(i=Math.floor(o/s))*s,(a.length>0||i>0)&&(a[a.length]=i);c[r]=o,l=a}var h="";for(n=c.length-1;n>=0;n--)h+=t.charAt(c[n]);return h},l=e=>{for(var t,n,r="",i=-1;++i<e.length;)t=e.charCodeAt(i),n=i+1<e.length?e.charCodeAt(i+1):0,t>=55296&&t<=56319&&n>=56320&&n<=57343&&(t=65536+((1023&t)<<10)+(1023&n),i++),t<=127?r+=String.fromCharCode(t):t<=2047?r+=String.fromCharCode(192|t>>>6&31,128|63&t):t<=65535?r+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(r+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return r},u=e=>{let t=Array(e.length>>2);for(var n=0;n<t.length;n++)t[n]=0;for(n=0;n<8*e.length;n+=8)t[n>>5]|=(255&e.charCodeAt(n/8))<<n%32;return t},c=e=>{for(var t="",n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>n%32&255);return t},h=(e,t)=>{e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var n=1732584193,r=-271733879,i=-1732584194,o=271733878,a=0;a<e.length;a+=16){var s=n,l=r,u=i,c=o;n=p(n,r,i,o,e[a+0],7,-680876936),o=p(o,n,r,i,e[a+1],12,-389564586),i=p(i,o,n,r,e[a+2],17,606105819),r=p(r,i,o,n,e[a+3],22,-1044525330),n=p(n,r,i,o,e[a+4],7,-176418897),o=p(o,n,r,i,e[a+5],12,1200080426),i=p(i,o,n,r,e[a+6],17,-1473231341),r=p(r,i,o,n,e[a+7],22,-45705983),n=p(n,r,i,o,e[a+8],7,1770035416),o=p(o,n,r,i,e[a+9],12,-1958414417),i=p(i,o,n,r,e[a+10],17,-42063),r=p(r,i,o,n,e[a+11],22,-1990404162),n=p(n,r,i,o,e[a+12],7,1804603682),o=p(o,n,r,i,e[a+13],12,-40341101),i=p(i,o,n,r,e[a+14],17,-1502002290),r=p(r,i,o,n,e[a+15],22,1236535329),n=f(n,r,i,o,e[a+1],5,-165796510),o=f(o,n,r,i,e[a+6],9,-1069501632),i=f(i,o,n,r,e[a+11],14,643717713),r=f(r,i,o,n,e[a+0],20,-373897302),n=f(n,r,i,o,e[a+5],5,-701558691),o=f(o,n,r,i,e[a+10],9,38016083),i=f(i,o,n,r,e[a+15],14,-660478335),r=f(r,i,o,n,e[a+4],20,-405537848),n=f(n,r,i,o,e[a+9],5,568446438),o=f(o,n,r,i,e[a+14],9,-1019803690),i=f(i,o,n,r,e[a+3],14,-187363961),r=f(r,i,o,n,e[a+8],20,1163531501),n=f(n,r,i,o,e[a+13],5,-1444681467),o=f(o,n,r,i,e[a+2],9,-51403784),i=f(i,o,n,r,e[a+7],14,1735328473),r=f(r,i,o,n,e[a+12],20,-1926607734),n=g(n,r,i,o,e[a+5],4,-378558),o=g(o,n,r,i,e[a+8],11,-2022574463),i=g(i,o,n,r,e[a+11],16,1839030562),r=g(r,i,o,n,e[a+14],23,-35309556),n=g(n,r,i,o,e[a+1],4,-1530992060),o=g(o,n,r,i,e[a+4],11,1272893353),i=g(i,o,n,r,e[a+7],16,-155497632),r=g(r,i,o,n,e[a+10],23,-1094730640),n=g(n,r,i,o,e[a+13],4,681279174),o=g(o,n,r,i,e[a+0],11,-358537222),i=g(i,o,n,r,e[a+3],16,-722521979),r=g(r,i,o,n,e[a+6],23,76029189),n=g(n,r,i,o,e[a+9],4,-640364487),o=g(o,n,r,i,e[a+12],11,-421815835),i=g(i,o,n,r,e[a+15],16,530742520),r=g(r,i,o,n,e[a+2],23,-995338651),n=m(n,r,i,o,e[a+0],6,-198630844),o=m(o,n,r,i,e[a+7],10,1126891415),i=m(i,o,n,r,e[a+14],15,-1416354905),r=m(r,i,o,n,e[a+5],21,-57434055),n=m(n,r,i,o,e[a+12],6,1700485571),o=m(o,n,r,i,e[a+3],10,-1894986606),i=m(i,o,n,r,e[a+10],15,-1051523),r=m(r,i,o,n,e[a+1],21,-2054922799),n=m(n,r,i,o,e[a+8],6,1873313359),o=m(o,n,r,i,e[a+15],10,-30611744),i=m(i,o,n,r,e[a+6],15,-1560198380),r=m(r,i,o,n,e[a+13],21,1309151649),n=m(n,r,i,o,e[a+4],6,-145523070),o=m(o,n,r,i,e[a+11],10,-1120210379),i=m(i,o,n,r,e[a+2],15,718787259),r=m(r,i,o,n,e[a+9],21,-343485551),n=v(n,s),r=v(r,l),i=v(i,u),o=v(o,c)}return[n,r,i,o]},d=(e,t,n,r,i,o)=>v(y(v(v(t,e),v(r,o)),i),n),p=(e,t,n,r,i,o,a)=>d(t&n|~t&r,e,t,i,o,a),f=(e,t,n,r,i,o,a)=>d(t&r|n&~r,e,t,i,o,a),g=(e,t,n,r,i,o,a)=>d(t^n^r,e,t,i,o,a),m=(e,t,n,r,i,o,a)=>d(n^(t|~r),e,t,i,o,a),v=(e,t)=>{var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n},y=(e,t)=>e<<t|e>>>32-t}($d);var Kd=Ce&&Ce.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wd,"__esModule",{value:!0}),Wd.v3=void 0;const Xd=Vd,Jd=Kd($d);Wd.v3=(0,Xd.v35)("v3",48,Jd.default);var Qd={};Object.defineProperty(Qd,"__esModule",{value:!0}),Qd.v4=function(e,t,n){let r=t&&n||0,i=(0,tp.rng)();!e||e instanceof String||(e.random&&(i=e.random),e.rng&&(i=e.rng()));if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;o++)t[r+o]=i[o];return t||(0,ep.unparse)(i)};const ep=Pd,tp=jd;var np={},rp={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.any_hmac_sha1=e.b64_hmac_sha1=e.hex_hmac_sha1=e.any_sha1=e.b64_sha1=e.hex_sha1=void 0;let t=0,n="";e.hex_sha1=e=>o(r(l(e))),e.default=e.hex_sha1;e.b64_sha1=e=>a(r(l(e)));e.any_sha1=(e,t)=>s(r(l(e)),t);e.hex_hmac_sha1=(e,t)=>o(i(l(e),l(t)));e.b64_hmac_sha1=(e,t)=>a(i(l(e),l(t)));e.any_hmac_sha1=(e,t,n)=>s(i(l(e),l(t)),n);const r=e=>c(h(u(e),8*e.length)),i=(e,t)=>{let n=u(e);n.length>16&&(n=h(n,8*e.length));let r=Array(16),i=Array(16);for(var o=0;o<16;o++)r[o]=909522486^n[o],i[o]=1549556828^n[o];var a=h(r.concat(u(t)),512+8*t.length);return c(h(i.concat(a),672))},o=e=>{for(var n,r=t?"0123456789ABCDEF":"0123456789abcdef",i="",o=0;o<e.length;o++)n=e.charCodeAt(o),i+=r.charAt(n>>>4&15)+r.charAt(15&n);return i},a=e=>{for(var t="",r=e.length,i=0;i<r;i+=3)for(var o=e.charCodeAt(i)<<16|(i+1<r?e.charCodeAt(i+1)<<8:0)|(i+2<r?e.charCodeAt(i+2):0),a=0;a<4;a++)8*i+6*a>8*e.length?t+=n:t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-a)&63);return t},s=(e,t)=>{var n,r,i,o,a=t.length,s=[],l=Array(Math.ceil(e.length/2));for(n=0;n<l.length;n++)l[n]=e.charCodeAt(2*n)<<8|e.charCodeAt(2*n+1);for(;l.length>0;){for(o=[],i=0,n=0;n<l.length;n++)i=(i<<16)+l[n],i-=(r=Math.floor(i/a))*a,(o.length>0||r>0)&&(o[o.length]=r);s[s.length]=i,l=o}var u="";for(n=s.length-1;n>=0;n--)u+=t.charAt(s[n]);var c=Math.ceil(8*e.length/(Math.log(t.length)/Math.log(2)));for(n=u.length;n<c;n++)u=t[0]+u;return u},l=e=>{for(var t,n,r="",i=-1;++i<e.length;)t=e.charCodeAt(i),n=i+1<e.length?e.charCodeAt(i+1):0,t>=55296&&t<=56319&&n>=56320&&n<=57343&&(t=65536+((1023&t)<<10)+(1023&n),i++),t<=127?r+=String.fromCharCode(t):t<=2047?r+=String.fromCharCode(192|t>>>6&31,128|63&t):t<=65535?r+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(r+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return r},u=e=>{for(var t=Array(e.length>>2),n=0;n<t.length;n++)t[n]=0;for(n=0;n<8*e.length;n+=8)t[n>>5]|=(255&e.charCodeAt(n/8))<<24-n%32;return t},c=e=>{for(var t="",n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>24-n%32&255);return t},h=(e,t)=>{e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var n=Array(80),r=1732584193,i=-271733879,o=-1732584194,a=271733878,s=-1009589776,l=0;l<e.length;l+=16){for(var u=r,c=i,h=o,m=a,v=s,y=0;y<80;y++){n[y]=y<16?e[l+y]:g(n[y-3]^n[y-8]^n[y-14]^n[y-16],1);let t=f(f(g(r,5),d(y,i,o,a)),f(f(s,n[y]),p(y)));s=a,a=o,o=g(i,30),i=r,r=t}r=f(r,u),i=f(i,c),o=f(o,h),a=f(a,m),s=f(s,v)}return[r,i,o,a,s]},d=(e,t,n,r)=>e<20?t&n|~t&r:e<40?t^n^r:e<60?t&n|t&r|n&r:t^n^r,p=e=>e<20?1518500249:e<40?1859775393:e<60?-1894007588:-899497514,f=(e,t)=>{var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n},g=(e,t)=>e<<t|e>>>32-t}(rp);var ip=Ce&&Ce.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(np,"__esModule",{value:!0}),np.v5=void 0;const op=Vd,ap=ip(rp);np.v5=(0,op.v35)("v5",80,ap.default),Object.defineProperty(yd,"__esModule",{value:!0});const sp=wd,lp=Pd,up=Cd,cp=Rd,hp=Dd,dp=Wd,pp=Qd,fp=np,gp=bd;var mp,vp=yd.default={parse:sp.parse,unparse:lp.unparse,validate:up.validate,version:cp.version,v1:hp.v1,v3:dp.v3,v4:pp.v4,v5:fp.v5,NIL:gp.NIL,DNS:gp.DNS,URL:gp.URL,OID:gp.OID,X500:gp.X500},yp=f(function(e,t){var n=e.cameraRef,r=e.metaAtlasCoreRef,i=c([]),o=u(0)[1],a=function(){o(function(e){return e+1})};return d(t,function(){return{dropPin:function(e,t,n){return void 0===n&&(n=!0),I(this,void 0,void 0,function(){var o,s,l;return z(this,function(u){return o=function(e){return r.current.getMidPointOfFeature(e)}(e),g(t)?(s="",n&&i.current.length>0?(i.current[i.current.length-1]=j(j({},i.current[i.current.length-1]),{coordinates:o,customElement:t,isVisible:!0}),s=i.current[i.current.length-1].id):(l={id:vp.v4(),coordinates:o,customElement:t,isVisible:!0},s=l.id,i.current.push(l)),a(),[2,s]):(console.warn("Invalid react element passed to dropPin function"),[2,""])})})},hidePin:function(e){var t;if(void 0===e&&(e="-1"),"-1"===e){var n=i.current[i.current.length-1];if(!n)return void console.warn("No pins available to hide.");t=n.id}else t=e;var r=i.current.findIndex(function(e){return e.id===t});-1!==r?(i.current[r]=j(j({},i.current[r]),{isVisible:!1}),a()):console.warn("Pin with ID: ".concat(t," not found."))},hidePins:function(){i.current=i.current.map(function(e){return j(j({},e),{isVisible:!1})}),a()},showPin:function(e){return void 0===e&&(e="-1"),I(this,void 0,void 0,function(){var t,n,r;return z(this,function(o){if("-1"===e){if(!(n=i.current[i.current.length-1]))return console.warn("No pins available to show."),[2];t=n.id}else t=e;return-1===(r=i.current.findIndex(function(e){return e.id===t}))?(console.warn("Pin with ID: ".concat(t," not found.")),[2]):(i.current[r]=j(j({},i.current[r]),{isVisible:!0}),a(),[2])})})},showPins:function(){i.current=i.current.map(function(e){return j(j({},e),{isVisible:!0})}),a()},clearPin:function(e){var t;if(void 0===e&&(e="-1"),"-1"===e){if((t=i.current.length-1)<0)return void console.warn("No pins available to clear.")}else if(-1===(t=i.current.findIndex(function(t){return t.id===e})))return void console.warn("Pin with ID: ".concat(e," not found."));i.current.splice(t,1),a()},clearPins:function(){i.current=[],a()},fitViewToPins:function(e,t){var r;if(void 0===t&&(t=50),0!==i.current.length){var o=i.current.filter(function(t){return!!e.includes(t.id)});if(0!==o.length){for(var a=o[0].coordinates,s=new gd(a[0],a[1]),l=new gd(a[0],a[1]),u=new md(s,l),c=0;c<o.length;c++){var h=o[c];u.extend(h.coordinates)}var d=u.toArray();null===(r=null==n?void 0:n.current)||void 0===r||r.fitBounds([d[0][0],d[0][1],d[1][0],d[1][1]],{padding:{top:t,right:t,bottom:t,left:t},duration:1e3})}else console.warn("No pins to fit on the map.")}else console.warn("No pins to fit on the map.")}}}),l.createElement(l.Fragment,null,i.current.map(function(e){return e.isVisible&&g(e.customElement)&&l.createElement(S,{key:e.id,coordinate:e.coordinates},e.customElement)}))});function wp(e){var t=this,n=o.create({page:{flex:1,backgroundColor:"#F5FCFF",alignItems:"center",justifyContent:e.isFullHeight?"center":"flex-start"},map:{flex:1,alignSelf:"stretch",maxHeight:e.isFullHeight?void 0:e.maxMapHeight}}),r=c(null);r.current||(r.current=new fd);var i=r.current,s=c(i.mapDataService),p=c(null),f=c(null),g=c(null),y=c(i.userLocation),w=c(null),b=c(null),_=c(null),x=c(null),S=c(15.5),C=c(0),T=c(0),k=c(null);k.current||(k.current=ie({getCamera:function(){return f.current},getZoom:function(){return S.current},getViewport:function(){return{width:T.current,height:C.current}}}));var E=function(e){var t,n=null===(t=e.nativeEvent)||void 0===t?void 0:t.zoom;"number"==typeof n&&Number.isFinite(n)&&(S.current=n)},L=c(!1),D=c(!1),N=c(!1),O=c(!1),j=u(!1),B=j[0],U=j[1],H=c(null),G=u({center:[103.8218,1.2564],zoom:15.5,bearing:0}),W=G[0],V=G[1],q=u(""),Z=q[0],Y=q[1],$=c(""),K=function(e){var t=JSON.stringify(e);$.current=t,Y(t)},X=c(Bs),J=c(Us),Q=c(Hs),ee=c(Gs),te=u(!1),ae=te[0],se=te[1],le=u(!1),ue=le[0],ce=le[1],he=u(null),de=he[0],fe=he[1],ge=u(!1),me=ge[0],ve=ge[1],ye="https://atoms.sandbox.spatialverse.online/sdk/2.1.2-sandbox/",we="https://atoms-map-tiles-middleware.sandbox.spatialverse.online/".concat(e.tileserverRoleName,"/latest/geojson?accessToken=").concat(e.accessToken),be=e.onNetworkModeUpdate?e.onNetworkModeUpdate:function(){},_e=function(){return I(t,void 0,void 0,function(){var t,n,r=this;return z(this,function(i){switch(i.label){case 0:return t=function(){return I(r,void 0,void 0,function(){var e;return z(this,function(t){switch(t.label){case 0:return[4,Se()];case 1:return e=t.sent(),ce(e),be(e?mp.Offline:mp.Online),[2]}})})},s.current.getOfflineMapStatus()===Uu.Ready?[3,2]:(n=function(n){return I(r,void 0,void 0,function(){return z(this,function(r){return e.onOfflineMapsStatusUpdate(n),n&&t(),[2]})})},[4,s.current.setupOfflineMaps(n)]);case 1:return i.sent(),[3,3];case 2:t(),i.label=3;case 3:return[2]}})})},xe=function(){return I(t,void 0,void 0,function(){var e,t,n=this;return z(this,function(r){switch(r.label){case 0:return e=function(){return I(n,void 0,void 0,function(){var e,t;return z(this,function(n){switch(n.label){case 0:e="".concat(R.DocumentDirectoryPath,"/extracted/"),n.label=1;case 1:return n.trys.push([1,5,,6]),[4,R.exists(e)];case 2:return n.sent()?[4,Ll(e)]:[3,4];case 3:n.sent(),be(mp.Online),console.log("Unzipped files deleted from: ".concat(e)),n.label=4;case 4:return[3,6];case 5:return t=n.sent(),console.error("Error during cleanup:",t),[3,6];case 6:return[2]}})})},[4,e()];case 1:return r.sent(),t=JSON.parse(Z),Bs.sprite&&Bs.glyphs&&(t.glyphs=X.current.glyphs,t.sprite=X.current.sprite),K(t),ce(!1),Wu.setState({data:""}),s.current.offlineMapStatus=Uu.Awaiting,be(mp.Online),[2]}})})},Se=function(){return I(t,void 0,void 0,function(){var e,t,n,r,i,o,a,s,l;return z(this,function(u){switch(u.label){case 0:e=Wu.getState().data,t=Vu.getState().data,n=JSON.parse(Z),u.label=1;case 1:return u.trys.push([1,8,,9]),console.log("Paths Here:",e,t),(r=e)?[4,R.exists(e)]:[3,3];case 2:r=u.sent(),u.label=3;case 3:return r?(console.log("MBTiles path set:",e),i="".concat(t,"fonts"),(o=t)?[4,R.exists(i)]:[3,5]):(console.error("MBTiles file not found:",e),[2,!1]);case 4:o=u.sent(),u.label=5;case 5:return o?(console.log("Fonts path set:",i),n.glyphs="file://".concat(i,"/{fontstack}/{range}.pbf"),a="".concat(t,"sprites"),(s=t)?[4,R.exists(a)]:[3,7]):(console.error("Fonts directory not found:",i),[2,!1]);case 6:s=u.sent(),u.label=7;case 7:return s?(console.log("Sprites path set:",a),n.sprite="file://".concat(a,"/sprites"),K(n),[2,!0]):(console.error("Sprites directory not found:",a),[2,!1]);case 8:return l=u.sent(),console.error("Error setting up MBTiles, Fonts, and Sprites:",l),[2,!1];case 9:return[2]}})})},Ae=function(){var e,t,n;null===(e=r.current)||void 0===e||e.attach({style:{readLayers:function(){var e=$.current;if(!e)return[];try{var t=JSON.parse(e);return Array.isArray(t.layers)?t.layers:[]}catch(e){return[]}},commitLayers:function(e){var t,n=$.current;try{t=n?JSON.parse(n):{layers:[]}}catch(e){t={layers:[]}}t.layers=e,K(t)}},camera:null!==(t=k.current)&&void 0!==t?t:void 0,sensors:g.current&&w.current?{gps:g.current,compass:w.current,motion:x.current}:void 0,marker:null!==(n=b.current)&&void 0!==n?n:void 0,routingDisplay:{setDisplayRoute:function(e){var t;null===(t=_.current)||void 0===t||t.setDisplayRoute(e)},getDisplayRoute:function(){var e,t;return null!==(t=null===(e=_.current)||void 0===e?void 0:e.getDisplayRoute())&&void 0!==t?t:null},setPatchFeatures:function(e){var t;null===(t=_.current)||void 0===t||t.setPatchFeatures(e)},setAnimatedCoordinates:function(e){var t;null===(t=_.current)||void 0===t||t.setAnimatedCoordinates(e)},clear:function(){var e;null===(e=_.current)||void 0===e||e.clear()}}})};h(function(){var e,t;null===(e=r.current)||void 0===e||e.bootstrap(),g.current||(g.current=new ne),w.current||(w.current=new re),x.current||(x.current=new pe),Ae();var n=null===(t=r.current)||void 0===t?void 0:t.focusManager.subscribeToFocusChange(function(e){var t;null===(t=_.current)||void 0===t||t.filterRoutingLayersWhereDimension(e)});return function(){var e,t,i,o,a;null==n||n(),L.current=!1;try{null===(t=null===(e=g.current)||void 0===e?void 0:e.destroyGPS)||void 0===t||t.call(e)}catch(e){}try{null===(o=null===(i=w.current)||void 0===i?void 0:i.destroy)||void 0===o||o.call(i)}catch(e){}try{null===(a=r.current)||void 0===a||a.detach()}catch(e){}}},[]),h(function(){var e=F.addEventListener(function(e){fe(e.isConnected)});return function(){try{e&&e()}catch(e){}}},[]),h(function(){var n=function(){return I(t,void 0,void 0,function(){var t,n,r=this;return z(this,function(i){switch(i.label){case 0:return t=function(t){return I(r,void 0,void 0,function(){var n,r,i,o,a;return z(this,function(s){switch(s.label){case 0:return s.trys.push([0,5,,6]),n="".concat(ye+t),[4,fetch(n)];case 1:return r=s.sent(),(i=r.headers.get("Content-Type"))&&i.includes("application/json")?[4,r.json()]:[3,3];case 2:return o=s.sent(),l=o,u=e.secretKey,function(e,t){I(void 0,void 0,void 0,function(){var n;return z(this,function(r){switch(r.label){case 0:n="".concat(R.DocumentDirectoryPath+"/"+t),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,R.writeFile(n,e,"utf8")];case 2:return r.sent(),[3,4];case 3:return r.sent(),console.error("failed to save file to local storage",t),[3,4];case 4:return[2]}})})}(kl.AES.encrypt(JSON.stringify(l),u).toString(),t),[2,o];case 3:return console.warn("Invalid Content-Type: expected JSON but received ".concat(i," for URL: ").concat(n)),[2,Rl(t,e.secretKey)];case 4:return[3,6];case 5:return a=s.sent(),console.error("Error fetching or parsing JSON for ".concat(t,":"),a),[2,Rl(t,e.secretKey)];case 6:return[2]}var l,u})})},n=function(){return I(r,void 0,void 0,function(){var n,r,i,o,a;return z(this,function(s){switch(s.label){case 0:return s.trys.push([0,7,,8]),[4,t("combined_style.json")];case 1:return n=s.sent(),X.current=null!==n?n:X.current,[4,t("customerLayer.json")];case 2:return r=s.sent(),J.current=r.length>0?r:J.current,"firealarmteam"!==e.tileserverRoleName?[3,4]:[4,t("firealarmstyles.json")];case 3:i=s.sent(),Q.current=i.length>0?i:Q.current,s.label=4;case 4:return"airside"!==e.tileserverRoleName?[3,6]:[4,t("airsideLayers.json")];case 5:o=s.sent(),ee.current=o.length>0?o:ee.current,s.label=6;case 6:return[3,8];case 7:return a=s.sent(),console.error("Error fetching styles:",a),[3,8];case 8:return[2]}})})},[4,n()];case 1:return i.sent(),[2]}})})},r=!1;F.addEventListener(function(e){return I(t,void 0,void 0,function(){return z(this,function(t){switch(t.label){case 0:return r?[3,3]:(r=!0,e.isConnected?[4,n()]:[3,2]);case 1:t.sent(),t.label=2;case 2:se(!0),t.label=3;case 3:return[2]}})})})},[e.secretKey,e.tileserverRoleName]),h(function(){if(ae){var t=function(e,t,n){var r=e.layers,i=r.findIndex(function(e){return e.id===t}),o=r.findIndex(function(e){return e.id===n});if(-1===i||-1===o)throw new Error("One or both layer IDs not found.");var a=r.splice(i,1)[0],s=i<o?o-1:o;return r.splice(s,0,a),e},n=ea(X.current);if(function(e,t,n){var r=e.layers,i=r.findIndex(function(e){return e.id===n});if(-1===i)throw new Error("Target layer ID not found.");r.splice(i,0,t)}(n,{id:"airside-boundary",type:"fill",source:"boundary",paint:{"fill-color":"#e2e6ee"}},"highway_major_casing"),t(n,"landcover_grass","highway_major_casing"),t(n,"water","highway_major_casing"),("changi"===e.tileserverRoleName||"changipublic-airside"===e.tileserverRoleName)&&ee.current&&ee.current.length>0){for(var r=0;r<J.current.length;r++){(i=ea(J.current[r]))["source-layer"]="geojson",n.layers.push(i)}for(r=0;r<ee.current.length;r++){(i=ea(ee.current[r]))["source-layer"]="geojson",n.layers.push(i)}}else if("airside"===e.tileserverRoleName&&ee.current&&ee.current.length>0)for(r=0;r<ee.current.length;r++){(i=ea(ee.current[r]))["source-layer"]="geojson",n.layers.push(i)}else if("firealarmteam"===e.tileserverRoleName&&Q.current&&Q.current.length>0){for(r=0;r<J.current.length;r++){(i=ea(J.current[r]))["source-layer"]="geojson",n.layers.push(i)}for(r=0;r<Q.current.length;r++){(i=ea(Q.current[r]))["source-layer"]="geojson",n.layers.push(i)}}else for(r=0;r<J.current.length;r++){var i;(i=ea(J.current[r]))["source-layer"]="geojson",n.layers.push(i)}K(n)}},[e.tileserverRoleName,ae]),h(function(){s.current.init("https://atoms-api.sandbox.spatialverse.online",e.accessToken,e.secretKey,ye,e.tileserverRoleName)},[e.accessToken]),h(function(){console.log(de,"isNetworkConnected");var n,i=e.onRoutingStatusUpdate?e.onRoutingStatusUpdate:function(){},o=e.onSearchStatusUpdate?e.onSearchStatusUpdate:function(){};null!==de&&(de?s.current.getAtomsAPIAccessToken(function(e){return I(t,void 0,void 0,function(){var t,n,a,l,u,c;return z(this,function(h){switch(h.label){case 0:return D.current=!0,e.authenticated?[4,s.current.setupFocusTree()]:[3,2];case 1:return h.sent(),(t=bs()).length>0&&(n=t[0].taxonomyPath,(null==(a=s.current.getFlyToLocation(n,!0))?void 0:a.center)&&V({center:a.center,zoom:null!==(l=a.zoom)&&void 0!==l?l:15.5,bearing:null!==(u=a.bearing)&&void 0!==u?u:0}),null===(c=r.current)||void 0===c||c.focusManager.commit(n,{moveCamera:!0})),s.current.getRoutingStatus()!==Uu.Ready&&s.current.setupRouting(i),s.current.getSearchStatus()!==Uu.Ready&&s.current.setupMapObjectSearch(o),Ce(),[3,3];case 2:Te("Failed to authenticate token"),h.label=3;case 3:return[2]}})})}):(s.current.getRoutingStatus()!==Uu.Ready&&s.current.setupRouting(i),s.current.getSearchStatus()!==Uu.Ready&&s.current.setupMapObjectSearch(o),Ce()),me&&(n=de,I(t,void 0,void 0,function(){return z(this,function(e){return n?ue&&xe():_e(),[2]})})))},[de,me]);var Pe=i.routingManager,Me=function(){return!0===L.current&&null!==p.current};d(e.ref,function(){var t={getZoom:function(){var e;return I(this,void 0,void 0,function(){return z(this,function(t){switch(t.label){case 0:return Me()?[4,null===(e=p.current)||void 0===e?void 0:e.getZoom()]:[2,null];case 1:return[2,t.sent()]}})})},getCenter:function(){var e;return I(this,void 0,void 0,function(){return z(this,function(t){switch(t.label){case 0:return Me()?[4,null===(e=p.current)||void 0===e?void 0:e.getCenter()]:[2,null];case 1:return[2,t.sent()]}})})},getBearing:function(){var e;return I(this,void 0,void 0,function(){return z(this,function(t){switch(t.label){case 0:return Me()?[4,null===(e=p.current)||void 0===e?void 0:e.getBearing()]:[2,null];case 1:return[2,t.sent()]}})})},moveTo:function(e,t){var n;Me()&&(null===(n=f.current)||void 0===n||n.easeTo({center:e,easing:"ease",duration:t}))},zoomTo:function(e,t){var n;Me()&&(null===(n=f.current)||void 0===n||n.zoomTo(e,{duration:t,easing:"ease"}))},setupOfflineMaps:function(t){return I(this,void 0,void 0,function(){return z(this,function(n){switch(n.label){case 0:return s.current.getOfflineMapStatus()===Uu.Ready?[3,2]:[4,s.current.setupOfflineMaps(e.onOfflineMapsStatusUpdate,t)];case 1:n.sent(),n.label=2;case 2:return[2]}})})},toggleMapMode:function(e){return I(this,void 0,void 0,function(){return z(this,function(t){return ve(!1),e===mp.Offline?_e():e===mp.Online&&xe(),[2]})})},focusTo:function(e,t){var n;void 0===t&&(t=!0),e&&(null===(n=r.current)||void 0===n||n.focusManager.commit(e,{moveCamera:t}))},subscribeToFocusChange:function(e){var t,n;return null!==(n=null===(t=r.current)||void 0===t?void 0:t.focusManager.subscribeToFocusChange(e))&&void 0!==n?n:function(){}},styleRouteLineLayer:function(e){var t;null===(t=_.current)||void 0===t||t.styleRouteLineLayer(e)},filterLayersByType:function(e,t,n){void 0===e&&(e=[]),void 0===n&&(n="");var r=JSON.parse(Z),i=function(e,t,n,r){if(n){for(var i=0;i<e.length;i+=1){var o=void 0,a=e[i].filter;if(o=r?["case",["!",["in",["get",t],["literal",n]]],!0,["all",["in",["get",t],["literal",n]],["!=",["geometry-type"],r]],!0,!1]:["!",["in",["get",t],["literal",n]]],a){for(var s=!1,l=0;l<a.length;l+=1){var u=a[l];if(r){if("case"===u[0]&&Array.isArray(u[1])&&Array.isArray(u[3])&&Array.isArray(u[3][1])&&Array.isArray(u[3][1])&&Array.isArray(u[3][1][1])&&Array.isArray(u[3][1][2])&&Array.isArray(u[3][2])&&u[3][1][1][1]===t&&u[3][2][2]===r){u[1][1][2]=["literal",n],u[1][1][1]=["get",t],u[3][1][2]=["literal",n],u[3][1][1]=["get",t],u[3][2][2]=r,s=!0;break}}else if(Array.isArray(u[1])&&Array.isArray(u[1][1])&&"!"===u[0]&&u[1][1][1]===t){u[0]="!",u[1][2]=["literal",n],s=!0;break}}s||(console.log("pushing: ",n,t),a.push(o))}}return e}}(r.layers,t,e,n);r.layers=i,K(r)},styleLayersByType:function(e,t,n,r){var i=JSON.parse(Z),o=function(e,t,n,r,i){if(n){for(var o=0;o<e.length;o+=1){var a=e[o],s=a.paint,l=a.type;if((l&&"fill"===l||"line"===l)&&s[r]){var u=s[r];if(u){var c=Es(u,t,n,i);s[r]=c}}}return e}}(i.layers,t,e,n,r);i.layers=o,K(i)},clearStyleLayersByType:function(e,t,n){var r=JSON.parse(Z),i=function(e,t,n,r){for(var i=0;i<e.length;i+=1){var o=e[i],a=o.paint,s=o.type;if((s&&"fill"===s||"line"===s)&&a[r]){var l=a[r];if(l){var u=Rs(l,t,n);a[r]=u}}}return e}(r.layers,e,t,n);r.layers=i,K(r)},flyTo:function(e,t){var n,r,i,o;return void 0===t&&(t=!0),I(this,void 0,void 0,function(){var a,s,l,u,c;return z(this,function(h){switch(h.label){case 0:return Me()?(t||this.clearPins(),[4,null===(n=p.current)||void 0===n?void 0:n.getCenter()]):[2];case 1:return(a=h.sent())?(s=e.center?e.center:a,e.zoomLevel?(u=e.zoomLevel,[3,4]):[3,2]):[2];case 2:return[4,null===(r=p.current)||void 0===r?void 0:r.getZoom()];case 3:u=h.sent(),h.label=4;case 4:return l=u,c=2*sa(a,s,{units:"meters"}),null!==e.bearing?null===(i=f.current)||void 0===i||i.setStop({center:s,zoom:l,duration:c,bearing:e.bearing,easing:"fly"}):null===(o=f.current)||void 0===o||o.setStop({center:s,zoom:l,duration:c,easing:"fly"}),[2]}})})},getFocusTree:function(){return s.current.getFocusTree()},getWhatTaxonomies:function(){return s.current.getWhatTaxonomies()},getCurrentFocus:function(){return s.current.getCurrentFocus()},getCurrentFocusBuilding:function(){return s.current.getCurrentFocusBuilding()},getCurrentFocusFloor:function(){return s.current.getCurrentFocusFloor()},getRootNodes:function(){return bs()},getChildNodes:function(e){return function(e){return As(e,1)}(e)},getNodesAtDepth:function(e,t){return As(e,t)},getNodeDepth:function(e){return function(e){if(!e)return null;var t=null;return ws(ms(),function(n,r){n.taxonomyPath===e&&(t=r)}),t}(e)},getSubtreeMaxRelativeDepth:function(e){return Ps(e)},getSelectorTierCount:function(e){return function(e){return Ps(e)+1}(e)},findNodeByTaxonomy:function(e){return _s(e)},getAncestors:function(e){return xs(e)},getLastClickedFeature:function(){return s.current.getLastClickedFeature()},getAllMapObjects:function(){var e;return(e=s.current).getAllMapObjects.apply(e,arguments)},getMapObjectsByName:function(){var e;return(e=s.current).getMapObjectsByName.apply(e,arguments)},getMapObjectById:function(){var e;return(e=s.current).getMapObjectById.apply(e,arguments)},getMapObjectByLocalRef:function(){var e;return(e=s.current).getMapObjectByLocalRef.apply(e,arguments)},getMapObjectsByWhatTaxonomy:function(){var e;return(e=s.current).getMapObjectsByWhatTaxonomy.apply(e,arguments)},getMapObjectsByWhereTaxonomy:function(){var e;return(e=s.current).getMapObjectsByWhereTaxonomy.apply(e,arguments)},getMapObjectsByWhatAndWhereTaxonomy:function(){var e;return(e=s.current).getMapObjectsByWhatAndWhereTaxonomy.apply(e,arguments)},getMapObjectsInWhatTaxonomy:function(){var e;return(e=s.current).getMapObjectsInWhatTaxonomy.apply(e,arguments)},getMapObjectsInWhereTaxonomy:function(){var e;return(e=s.current).getMapObjectsInWhereTaxonomy.apply(e,arguments)},getMapObjectsInWhatAndWhereTaxonomy:function(){var e;return(e=s.current).getMapObjectsInWhatAndWhereTaxonomy.apply(e,arguments)},getMidPointOfFeature:function(e){return s.current.getMidPointOfFeature(e)},dropPin:function(e,t,n){var r;return void 0===n&&(n=!0),I(this,void 0,void 0,function(){return z(this,function(i){switch(i.label){case 0:return[4,null===(r=H.current)||void 0===r?void 0:r.dropPin(e,t,n)];case 1:return[2,i.sent()||""]}})})},hidePin:function(e){var t;void 0===e&&(e="-1"),null===(t=H.current)||void 0===t||t.hidePin(e)},hidePins:function(){var e;null===(e=H.current)||void 0===e||e.hidePins()},showPin:function(e){var t;return void 0===e&&(e="-1"),I(this,void 0,void 0,function(){return z(this,function(n){switch(n.label){case 0:return[4,null===(t=H.current)||void 0===t?void 0:t.showPin(e)];case 1:return n.sent(),[2]}})})},showPins:function(){var e;null===(e=H.current)||void 0===e||e.showPins()},clearPin:function(e){var t;void 0===e&&(e="-1"),null===(t=H.current)||void 0===t||t.clearPin(e)},clearPins:function(){var e;null===(e=H.current)||void 0===e||e.clearPins()},fitViewToPins:function(e,t){var n;void 0===t&&(t=50),Me()&&(null===(n=H.current)||void 0===n||n.fitViewToPins(e,t))},fitViewToFeatures:function(e,t){var n;if(void 0===t&&(t=50),Me())if(0!==e.length){for(var r=e[0].coordinates,i=new gd(r[0],r[1]),o=new gd(r[0],r[1]),a=new md(i,o),s=0;s<e.length;s++){var l=e[s];a.extend(l.coordinates)}var u=a.toArray();null===(n=f.current)||void 0===n||n.fitBounds([u[0][0],u[0][1],u[1][0],u[1][1]],{padding:{top:t,right:t,bottom:t,left:t},duration:1e3})}else console.warn("No pins to fit on the map.")},changeTerminalInFocusToUserViewpoint:function(e){var t;return void 0===e&&(e={}),I(this,void 0,void 0,function(){var n;return z(this,function(r){switch(r.label){case 0:return Me()?[4,null===(t=p.current)||void 0===t?void 0:t.getCenter()]:[2];case 1:return(n=r.sent())?(i.focusManager.changeToUserViewpoint(n,e),[2]):[2]}})})},computeRoute:function(e,t,n){return I(this,void 0,void 0,function(){return z(this,function(r){switch(r.label){case 0:return[4,Pe.computeRoute(e,t,n)];case 1:return[2,r.sent()]}})})},computeRoutes:function(e,t){return I(this,void 0,void 0,function(){return z(this,function(n){switch(n.label){case 0:return[4,Pe.computeRoutes(e,t)];case 1:return[2,n.sent()]}})})},computeRoutesFromLocation:function(e,t,n,r){return void 0===r&&(r=!1),I(this,void 0,void 0,function(){return z(this,function(i){switch(i.label){case 0:return[4,Pe.computeRoutesFromLocation(e,t,n,{wheelChairAccessible:r})];case 1:return[2,i.sent()]}})})},computeRouteFromCoordinates:function(e,t,n){return I(this,void 0,void 0,function(){return z(this,function(r){switch(r.label){case 0:return[4,Pe.computeRouteFromCoordinates(e,t,n)];case 1:return[2,r.sent()]}})})},setRoutingMode:Pe.setRoutingMode,startNavigation:Pe.startNavigation,startNavigationFromCoordinates:Pe.startNavigationFromCoordinates,stopNavigation:Pe.stopNavigation,recenter:function(e){var t;return null===(t=y.current)||void 0===t?void 0:t.recenter(e)},setActiveRoute:function(e){Pe.setActiveRoute(e)},getActiveRoute:function(){return Pe.getActiveRoute()},highlightRouteSegment:function(e){return I(this,void 0,void 0,function(){return z(this,function(t){switch(t.label){case 0:return[4,Pe.highlightRouteSegment(e)];case 1:return t.sent(),[2]}})})},isPositionWithinBounds:function(e){var t,n;return null!==(n=null===(t=y.current)||void 0===t?void 0:t.isPositionWithinBounds(e))&&void 0!==n&&n},clearRoute:function(){Pe.clearRoute()},getRoutingStatus:function(){return s.current.getRoutingStatus()},getRoutingParameters:function(){return Pe.getRoutingParameters()},requestGPSPermission:function(){var e,t;return I(this,void 0,void 0,function(){return z(this,function(n){switch(n.label){case 0:return[4,null===(t=null===(e=y.current)||void 0===e?void 0:e.requestGPSPermission)||void 0===t?void 0:t.call(e)];case 1:return[2,n.sent()]}})})},isGPSPermissionGranted:function(){var e,t;return I(this,void 0,void 0,function(){return z(this,function(n){switch(n.label){case 0:return[4,null===(t=null===(e=y.current)||void 0===e?void 0:e.isGPSPermissionGranted)||void 0===t?void 0:t.call(e)];case 1:return[2,n.sent()]}})})},enableGPS:function(e){var t,n;return I(this,void 0,void 0,function(){return z(this,function(r){switch(r.label){case 0:return[4,null===(n=null===(t=y.current)||void 0===t?void 0:t.enableGPS)||void 0===n?void 0:n.call(t,e)];case 1:return[2,r.sent()]}})})},disableGPS:function(){var e,t;null===(t=null===(e=y.current)||void 0===e?void 0:e.disableGPS)||void 0===t||t.call(e)},destroyGPS:function(){var e,t;null===(t=null===(e=y.current)||void 0===e?void 0:e.destroy)||void 0===t||t.call(e)},getCameraFollowState:function(){var e,t;return null!==(t=null===(e=y.current)||void 0===e?void 0:e.getCameraFollowState())&&void 0!==t?t:{mode:"normal",owner:"gps",isFollowing:!1}},setNormalModeHeadingCameraFollow:function(e){var t,n;null===(n=null===(t=y.current)||void 0===t?void 0:t.setNormalHeadingCameraFollow)||void 0===n||n.call(t,e)},isNormalModeHeadingCameraFollowEnabled:function(){var e,t,n;return null!==(n=null===(t=null===(e=y.current)||void 0===e?void 0:e.isNormalHeadingCameraFollowEnabled)||void 0===t?void 0:t.call(e))&&void 0!==n&&n},getGPSPosition:function(e){var t,n;return I(this,void 0,void 0,function(){return z(this,function(r){switch(r.label){case 0:return[4,null===(n=null===(t=y.current)||void 0===t?void 0:t.getGPSPosition)||void 0===n?void 0:n.call(t,e)];case 1:return[2,r.sent()]}})})},isGPSEnabled:function(){var e,t;return null===(t=null===(e=y.current)||void 0===e?void 0:e.isGPSEnabled)||void 0===t?void 0:t.call(e)},isFollowing:function(){var e=y.current;if(e)return e.getCameraFollowState().isFollowing},getCurrentGPSPosition:function(){var e,t;return null===(t=null===(e=y.current)||void 0===e?void 0:e.getCurrentPosition)||void 0===t?void 0:t.call(e)},triggerGPSUpdate:function(e){var t,n;null===(n=null===(t=y.current)||void 0===t?void 0:t.triggerGPSUpdate)||void 0===n||n.call(t,e)},onWhereTaxonomyUpdateProposed:function(e){i.autoFocusManager.addWhereTaxonomyUpdateProposedListener(e)},onWhereTaxonomyUpdated:function(e){i.autoFocusManager.addWhereTaxonomyUpdatedListener(e)},onWhereTaxonomyAutoRejected:function(e){i.autoFocusManager.addAutoRejectionListener(e)},acceptProposal:function(e){i.autoFocusManager.acceptProposal(e)},rejectProposal:function(e){i.autoFocusManager.rejectProposal(e)},manualOverride:function(e,t){i.autoFocusManager.manualOverride(e,t)},notifyManualFloorChange:function(e){i.autoFocusManager.notifyManualFloorChange(e,!1)},isNavigating:function(){return i.navigationEngine.getIsNavigating()},getAutoFocusLastAcceptedWhereTaxonomyPath:function(){return i.autoFocusManager.getLastAcceptedTaxonomyPath()},getAutoFocusManager:function(){return i.autoFocusManager},getTaxonomyUpdateStore:function(){return i.taxonomyUpdateStore},requestCompassPermission:function(){var e,t;return I(this,void 0,void 0,function(){return z(this,function(n){switch(n.label){case 0:return[4,null===(t=null===(e=w.current)||void 0===e?void 0:e.requestCompassPermission)||void 0===t?void 0:t.call(e)];case 1:return[2,n.sent()]}})})},enableCompass:function(e){var t,n;return I(this,void 0,void 0,function(){return z(this,function(r){switch(r.label){case 0:return[4,null===(n=null===(t=w.current)||void 0===t?void 0:t.enableCompass)||void 0===n?void 0:n.call(t,e)];case 1:return[2,r.sent()]}})})},disableCompass:function(){var e,t;null===(t=null===(e=w.current)||void 0===e?void 0:e.disableCompass)||void 0===t||t.call(e)},destroyCompass:function(){var e,t;null===(t=null===(e=w.current)||void 0===e?void 0:e.destroy)||void 0===t||t.call(e)},isCompassEnabled:function(){var e,t;return null===(t=null===(e=w.current)||void 0===e?void 0:e.isCompassEnabled)||void 0===t?void 0:t.call(e)},getCurrentCompassData:function(){var e,t;return null===(t=null===(e=w.current)||void 0===e?void 0:e.getCurrentCompassData)||void 0===t?void 0:t.call(e)},getCompassHeading:function(){var e,t;return null===(t=null===(e=w.current)||void 0===e?void 0:e.getCompassHeading)||void 0===t?void 0:t.call(e)},isCompassCalibrated:function(){var e,t;return null===(t=null===(e=w.current)||void 0===e?void 0:e.isCompassCalibrated)||void 0===t?void 0:t.call(e)}};return t},[Z,B]);var Ce=function(){!0===L.current&&!0===D.current&&!1===N.current&&e.onLoad&&(N.current=!0,e.onLoad())},Te=function(t){!1===O.current&&(O.current=!0,e.onLoadFail&&e.onLoadFail(t))},ke={sw:[W.center[0]-.05,W.center[1]-.05],ne:[W.center[0]+.05,W.center[1]+.05]},Ee=m(function(e){f.current=e,e&&Ae()},[]),Re=m(function(e){if(b.current=e,Ae(),e)return function(){var e;null===(e=r.current)||void 0===e||e.userLocation.detachMarker()}},[]);return l.createElement(a,{style:n.page,onLayout:function(e){C.current=e.nativeEvent.layout.height,T.current=e.nativeEvent.layout.width}},""!==Z?l.createElement(A,{onPress:function(n){return I(t,void 0,void 0,function(){var t,r,i,o,a,l,u,c;return z(this,function(h){switch(h.label){case 0:if(!Me())return[2];t=n.nativeEvent.point,h.label=1;case 1:return h.trys.push([1,4,,5]),[4,null===(u=p.current)||void 0===u?void 0:u.project(n.nativeEvent.lngLat)];case 2:return r=h.sent(),i=r||t,[4,null===(c=p.current)||void 0===c?void 0:c.queryRenderedFeatures(i)];case 3:return function(e){for(var t,n,r,i,o,a,l=e[0],u=0;u<e.length;u++){var c=e[u];s.current.isClickableFeature(c)&&(l=c)}if((null===(t=l.properties)||void 0===t?void 0:t.center)||l.geometry&&l.geometry.coordinates){var h=(null===(n=l.properties)||void 0===n?void 0:n.center)?l.properties.center:l.geometry.coordinates,d={mapObjectId:null===(r=l.properties)||void 0===r?void 0:r.myMapObjectId,coordinates:h,name:null===(i=l.properties)||void 0===i?void 0:i.title,whatDimension:null===(o=l.properties)||void 0===o?void 0:o.dimension_what,whereDimension:null===(a=l.properties)||void 0===a?void 0:a.dimension_where,geometry:l.geometry,properties:l.properties};s.current.setLastClickedFeature(s.current.hydrateClickedFeature(d))}}(o=h.sent()),e.onPress&&((a=null==o?void 0:o[0])?e.onPress(a):e.onPress(n.nativeEvent)),[3,5];case 4:return l=h.sent(),console.error("[onMapClicked] Error querying rendered features:",l),[3,5];case 5:return[2]}})})},onRegionWillChange:function(t){var n,r;E(t),t.nativeEvent.userInteraction&&(null===(n=y.current)||void 0===n||n.notifyUserGesture()),null===(r=e.onMoveStart)||void 0===r||r.call(e,t)},onRegionIsChanging:function(t){var n;E(t),null===(n=e.onMove)||void 0===n||n.call(e,t)},onRegionDidChange:function(n){return I(t,void 0,void 0,function(){var t;return z(this,function(r){return E(n),null===(t=e.onMoveEnd)||void 0===t||t.call(e,n),[2]})})},onDidFinishLoadingMap:function(){var e;!1===L.current&&(L.current=!0,null===(e=r.current)||void 0===e||e.notifyMapLoaded(),Ce())},onDidFailLoadingMap:function(){L.current=!1,Te("Failed to load map style")},style:n.map,logo:!1,ref:p,mapStyle:Z||null,attribution:!1,compass:!1},l.createElement(P,{ref:Ee,duration:2e3,easing:"ease",initialViewState:{center:W.center,zoom:W.zoom,bearing:W.bearing,bounds:[ke.sw[0],ke.sw[1],ke.ne[0],ke.ne[1]]},maxZoom:22,minZoom:12}),l.createElement(bp,{isOffline:ue,tileServer:we,props:e}),l.createElement(zs,{ref:_,metaAtlasCoreRef:s,triggerRender:function(){return U(!B)}}),l.createElement(v,{id:"boundary",data:vd}),l.createElement(M,{images:{"arrow-marker":"".concat(ye,"assets/gps-arrow.png")}}),l.createElement(oe,{ref:Re,position:null,showAccuracy:!0,pulse:!1}),l.createElement(yp,{ref:H,cameraRef:f,metaAtlasCoreRef:s}),e.children):null)}yp.displayName="MarkerOverlayContainer",function(e){e.Offline="offline",e.Online="online"}(mp||(mp={}));var bp=function(e){var t=e.isOffline,n=e.tileServer,r=e.props,i=u(""),o=i[0],a=i[1];return h(function(){var e;try{if(!Wu||"function"!=typeof Wu.getState)return void console.error("Invalid useMBTilesDataStore provided");var r=null===(e=Wu.getState())||void 0===e?void 0:e.data;if(t&&!r)return void console.warn("Offline mode enabled but no MBTiles data available");var i=t&&r?"mbtiles://".concat(r):n;if(!i||"string"!=typeof i)return void console.error("Invalid source URL");a(i)}catch(e){console.error("Error setting up vector source:",e)}},[t,r]),""===o?null:l.createElement(C,{id:"custom",key:t?"offline":"online",url:o})};export{du as LocationType,wp as MetaAtlasSDK,sd as NavigationStartError,bu as ROUTE_MODE_REQUIRED_SENSORS,yu as RouteMode,_u as resolveRequiredSensors};
30
30
  //# sourceMappingURL=index.js.map