atriusmaps-node-sdk 3.2.10 → 3.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -35
- package/config/rollup.config.cjs.js +31 -0
- package/dist/cjs/_virtual/_empty_module_placeholder.js +5 -0
- package/dist/cjs/deploy/nodeEntry.js +15 -0
- package/dist/cjs/deploy/prepareSDKConfig.js +9 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/package.json.js +11 -0
- package/dist/cjs/plugins/clientAPI/src/clientAPI.js +9 -0
- package/dist/cjs/plugins/dynamicPois/src/dynamicPois.js +33 -0
- package/dist/cjs/plugins/poiDataManager/src/poiDataManager.js +36 -0
- package/dist/cjs/plugins/sdkServer/src/sdkHeadless.js +31 -0
- package/dist/cjs/plugins/sdkServer/src/sdkServer.js +13 -0
- package/dist/cjs/plugins/sdkServer/src/util.js +10 -0
- package/dist/cjs/plugins/searchService/src/poiSearch.js +28 -0
- package/dist/cjs/plugins/searchService/src/searchService.js +37 -0
- package/dist/cjs/plugins/searchService/src/searchTypeahead.js +8 -0
- package/dist/cjs/plugins/searchService/src/utils.js +13 -0
- package/dist/cjs/plugins/venueDataLoader/src/venueDataLoader.js +36 -0
- package/dist/cjs/plugins/venueDataLoader/src/venueLoadingUtils.js +34 -0
- package/dist/cjs/plugins/wayfinder/src/findRoute.js +30 -0
- package/dist/cjs/plugins/wayfinder/src/minPriorityQueue.js +5 -0
- package/dist/cjs/plugins/wayfinder/src/navGraph.js +13 -0
- package/dist/cjs/plugins/wayfinder/src/navGraphDebug.js +30 -0
- package/dist/cjs/plugins/wayfinder/src/segmentBadges.js +5 -0
- package/dist/cjs/plugins/wayfinder/src/segmentBuilder.js +32 -0
- package/dist/cjs/plugins/wayfinder/src/segmentCategories.js +5 -0
- package/dist/cjs/plugins/wayfinder/src/stepBuilder.js +10 -0
- package/dist/cjs/plugins/wayfinder/src/wayfinder.js +40 -0
- package/dist/cjs/src/app.js +44 -0
- package/dist/cjs/src/auth/Auth.js +23 -0
- package/dist/cjs/src/configs/postproc-mol-url-parms.js +9 -0
- package/dist/cjs/src/configs/postproc-stateTracking.js +31 -0
- package/dist/cjs/src/configs/sdkHeadless.json.js +43 -0
- package/dist/cjs/src/controller.js +14 -0
- package/dist/cjs/src/debugTools.js +30 -0
- package/dist/cjs/src/env.js +7 -0
- package/dist/cjs/src/extModules/bustle.js +13 -0
- package/dist/cjs/src/extModules/flexapi/src/help.js +9 -0
- package/dist/cjs/src/extModules/flexapi/src/index.js +13 -0
- package/dist/cjs/src/extModules/flexapi/src/validate.js +10 -0
- package/dist/cjs/src/extModules/geohasher.js +8 -0
- package/dist/cjs/src/extModules/log.js +7 -0
- package/dist/cjs/src/historyManager.js +7 -0
- package/dist/cjs/src/utils/bounds.js +10 -0
- package/dist/cjs/src/utils/buildStructureLookup.js +29 -0
- package/dist/cjs/src/utils/configUtils.js +8 -0
- package/dist/cjs/src/utils/dom.js +10 -0
- package/dist/cjs/src/utils/funcs.js +15 -0
- package/dist/cjs/src/utils/geodesy.js +8 -0
- package/dist/cjs/src/utils/geom.js +35 -0
- package/dist/cjs/src/utils/i18n.js +14 -0
- package/dist/cjs/src/utils/observable.js +5 -0
- package/dist/cjs/src/utils/rand.js +8 -0
- package/lib/_virtual/_empty_module_placeholder.js +1 -0
- package/lib/deploy/nodeEntry.js +1 -1
- package/lib/deploy/prepareSDKConfig.js +1 -1
- package/lib/package.json.js +1 -1
- package/lib/plugins/dynamicPois/src/dynamicPois.js +1 -1
- package/lib/plugins/poiDataManager/src/poiDataManager.js +1 -1
- package/lib/plugins/sdkServer/src/sdkHeadless.js +1 -1
- package/lib/plugins/sdkServer/src/sdkServer.js +1 -1
- package/lib/plugins/sdkServer/src/util.js +1 -1
- package/lib/plugins/searchService/src/poiSearch.js +1 -1
- package/lib/plugins/searchService/src/searchTypeahead.js +1 -1
- package/lib/plugins/venueDataLoader/src/venueDataLoader.js +1 -1
- package/lib/plugins/venueDataLoader/src/venueLoadingUtils.js +1 -1
- package/lib/plugins/wayfinder/src/minPriorityQueue.js +1 -1
- package/lib/plugins/wayfinder/src/navGraph.js +1 -1
- package/lib/plugins/wayfinder/src/segmentBadges.js +1 -1
- package/lib/plugins/wayfinder/src/segmentBuilder.js +1 -1
- package/lib/plugins/wayfinder/src/segmentCategories.js +1 -1
- package/lib/plugins/wayfinder/src/stepBuilder.js +1 -1
- package/lib/plugins/wayfinder/src/wayfinder.js +1 -1
- package/lib/src/app.js +1 -1
- package/lib/src/auth/Auth.js +1 -1
- package/lib/src/configs/sdkHeadless.json +0 -4
- package/lib/src/configs/sdkHeadless.json.js +1 -1
- package/lib/src/debugTools.js +1 -1
- package/lib/src/extModules/bustle.js +1 -1
- package/lib/src/extModules/flexapi/src/index.js +1 -1
- package/lib/src/utils/configUtils.js +1 -1
- package/lib/src/utils/geom.js +1 -1
- package/lib/src/utils/i18n.js +1 -1
- package/lib/src/utils/observable.js +1 -1
- package/package.json +22 -6
- package/lib/_virtual/_empty_module_placeholder +0 -1
package/README.md
CHANGED
|
@@ -1,70 +1,76 @@
|
|
|
1
|
-
|
|
1
|
+
# atriusmaps-node-sdk
|
|
2
|
+
|
|
3
|
+
## To Install:
|
|
2
4
|
|
|
3
5
|
`npm install atriusmaps-node-sdk`
|
|
4
6
|
|
|
5
|
-
Or with yarn:
|
|
7
|
+
Or with yarn:
|
|
6
8
|
|
|
7
9
|
`yarn add atriusmaps-node-sdk`
|
|
8
10
|
|
|
9
|
-
Then within your code, import the map initializer via:
|
|
11
|
+
Then within your code, import the map initializer via:
|
|
10
12
|
|
|
11
13
|
`import Init from 'atriusmaps-node-sdk'`
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
or use `require`
|
|
16
|
+
|
|
17
|
+
`const Init = require("atriusmas-node-sdk")`
|
|
18
|
+
|
|
19
|
+
## To Use
|
|
20
|
+
|
|
21
|
+
The Init object contains 3 methods:
|
|
14
22
|
|
|
15
|
-
- `Init.setLogging(boolean logging)` : To turn on/off the logging
|
|
16
|
-
- `Init.getVersion()` : Returns the current version of the library
|
|
17
|
-
- `Init.newMap(Object configuration)` : This is how your initialize a new map. This returns a Promise that resolves to your map.
|
|
18
|
-
|
|
19
|
-
The configuration object is documented in full at https://locusmapsjs.readme.io/docs/sdk-configuration - with the only difference being that headless is forced to true.
|
|
20
|
-
|
|
21
|
-
At a minimum, a configuration would contain an accountId and a venueId:
|
|
23
|
+
- `Init.setLogging(boolean logging)` : To turn on/off the logging
|
|
24
|
+
- `Init.getVersion()` : Returns the current version of the library
|
|
25
|
+
- `Init.newMap(Object configuration)` : This is how your initialize a new map. This returns a Promise that resolves to your map.
|
|
26
|
+
|
|
27
|
+
The configuration object is documented in full at https://locusmapsjs.readme.io/docs/sdk-configuration - with the only difference being that headless is forced to true for this node (non-browser) version.
|
|
28
|
+
|
|
29
|
+
At a minimum, a configuration would contain an accountId and a venueId:
|
|
22
30
|
|
|
23
31
|
```js
|
|
24
|
-
const config = {
|
|
25
|
-
venueId: '<venueId>',
|
|
32
|
+
const config = {
|
|
33
|
+
venueId: '<venueId>',
|
|
26
34
|
accountId: '<accountId>'
|
|
27
|
-
}
|
|
35
|
+
}
|
|
28
36
|
```
|
|
29
37
|
|
|
30
|
-
You then initialize your map:
|
|
38
|
+
You then initialize your map:
|
|
31
39
|
|
|
32
40
|
```js
|
|
33
|
-
const map = await Init.newMap(config)
|
|
41
|
+
const map = await Init.newMap(config)
|
|
34
42
|
```
|
|
35
43
|
|
|
36
|
-
Your map function is ready to receive commands – of which the following are currently supported:
|
|
44
|
+
Your map function is ready to receive commands – of which the following are currently supported:
|
|
37
45
|
|
|
38
|
-
- `help` : Returns a string indicating all available commands and their arguments
|
|
39
|
-
- `getDirections`: Get time, distance and navigation steps from one point to another
|
|
40
|
-
- `getPOIDetails`: Get detailed information about a POI by ID
|
|
41
|
-
- `getAllPOIs`: Get a list of all POIs for the venue
|
|
42
|
-
- `getStructures`: Returns a list of structures (buildings) within the venue along with their properties
|
|
43
|
-
- `getVenueData`: Returns a complete venue object containing all venue details
|
|
44
|
-
- `search`: Performs a search against a term specified
|
|
46
|
+
- `help` : Returns a string indicating all available commands and their arguments
|
|
47
|
+
- `getDirections`: Get time, distance and navigation steps from one point to another
|
|
48
|
+
- `getPOIDetails`: Get detailed information about a POI by ID
|
|
49
|
+
- `getAllPOIs`: Get a list of all POIs for the venue
|
|
50
|
+
- `getStructures`: Returns a list of structures (buildings) within the venue along with their properties
|
|
51
|
+
- `getVenueData`: Returns a complete venue object containing all venue details
|
|
52
|
+
- `search`: Performs a search against a term specified
|
|
45
53
|
|
|
46
|
-
For details on these commands, including their arguments, return value formats, and examples, see https://locusmapsjs.readme.io/docs/commands
|
|
54
|
+
For details on these commands, including their arguments, return value formats, and examples, see https://locusmapsjs.readme.io/docs/commands
|
|
47
55
|
|
|
48
|
-
Note that all these commands are asynchronous, and return a promise. So use them with `await` or a `then` clause.
|
|
56
|
+
Note that all these commands are asynchronous, and return a promise. So use them with `await` or a `then` clause.
|
|
49
57
|
|
|
50
|
-
Examples:
|
|
58
|
+
Examples:
|
|
51
59
|
|
|
52
60
|
```js
|
|
53
|
-
const poi = await map.getPOIDetails(11)
|
|
54
|
-
console.log(`Got POI details for ${poi.name}.`)
|
|
61
|
+
const poi = await map.getPOIDetails(11)
|
|
62
|
+
console.log(`Got POI details for ${poi.name}.`)
|
|
55
63
|
```
|
|
56
64
|
|
|
57
|
-
Or
|
|
65
|
+
Or
|
|
58
66
|
|
|
59
67
|
```js
|
|
60
|
-
map.getPOIDetails(11)
|
|
61
|
-
.then(poi => console.log(`Got POI Details for ${poi.name}.`))
|
|
68
|
+
map.getPOIDetails(11)
|
|
69
|
+
.then(poi => console.log(`Got POI Details for ${poi.name}.`))
|
|
62
70
|
```
|
|
63
71
|
|
|
64
|
-
**Note**: This library involves loading JSON resources and thus requires the `--experimental-json-modules` flag be specified when launching.
|
|
65
|
-
|
|
66
72
|
For example:
|
|
67
73
|
|
|
68
74
|
```bash
|
|
69
|
-
node
|
|
75
|
+
node main.js
|
|
70
76
|
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import json from '@rollup/plugin-json'
|
|
2
|
+
// import { terser } from 'rollup-plugin-terser'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
input: [
|
|
6
|
+
'./lib/src/configs/sdkHeadless.json',
|
|
7
|
+
'./lib/src/utils/observable.js',
|
|
8
|
+
'./lib/plugins/clientAPI/src/clientAPI.js',
|
|
9
|
+
'./lib/plugins/dynamicPois/src/dynamicPois.js',
|
|
10
|
+
'./lib/plugins/poiDataManager/src/poiDataManager.js',
|
|
11
|
+
'./lib/plugins/sdkServer/src/sdkServer.js',
|
|
12
|
+
'./lib/plugins/searchService/src/searchService.js',
|
|
13
|
+
'./lib/plugins/venueDataLoader/src/venueDataLoader.js',
|
|
14
|
+
'./lib/plugins/wayfinder/src/wayfinder.js',
|
|
15
|
+
'./lib/deploy/nodeEntry.js'
|
|
16
|
+
],
|
|
17
|
+
output: {
|
|
18
|
+
format: 'cjs',
|
|
19
|
+
plugins: [
|
|
20
|
+
// terser()
|
|
21
|
+
],
|
|
22
|
+
inlineDynamicImports: false,
|
|
23
|
+
preserveModules: true,
|
|
24
|
+
preserveModulesRoot: "lib",
|
|
25
|
+
// file: 'dist/cjs/atriusmaps.js'
|
|
26
|
+
dir: 'dist/cjs/'
|
|
27
|
+
},
|
|
28
|
+
plugins: [
|
|
29
|
+
json()
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var e = require('node-fetch');
|
|
4
|
+
var package_json = require('../package.json.js');
|
|
5
|
+
var controller = require('../src/controller.js');
|
|
6
|
+
var observable = require('../src/utils/observable.js');
|
|
7
|
+
var prepareSDKConfig = require('./prepareSDKConfig.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var e__default = /*#__PURE__*/_interopDefaultLegacy(e);
|
|
12
|
+
|
|
13
|
+
const r=package_json["default"].version;globalThis.fetch||(globalThis.fetch=e__default["default"]);let c=!1;const i=e=>e.toString().length<2?"0"+e:e,a=()=>`AtriusMaps Node SDK (${(()=>{const e=new Date;return `${e.getHours()}:${i(e.getMinutes())}:${i(e.getSeconds())}.${e.getMilliseconds()}`})()}): `,g=function(){if(c){let e=a()+Array.from(arguments).map((e=>"object"==typeof e?JSON.stringify(e):e)).join(" ");const n=e.split("\n");n.length>1?e=n[0]+`… (+ ${n.length-1} lines)`:e.length>256&&(e=e.substring(0,255)+`… (length: ${e.length} chars)`),console.log(e);}};const l={getVersion:()=>r,newMap:e=>async function(e){return new Promise(((n,r)=>{e.headless=!0;const c=prepareSDKConfig(e);controller.create(c).then((e=>{const t=(n,t)=>("string"==typeof n&&(n={...t,command:n}),g("Sending command object: ",n),e.bus.get("clientAPI/execute",n).then((e=>(g("Received Message: ",e),e))).catch((e=>{throw g("Error: ",e.message),e})));observable(t),e.eventListener.observe((function(){t.fire.apply(t,arguments);})),t.on("ready",((e,o)=>{const{commands:s}=o.commandJSON;!function(e,n){n.forEach((n=>{e[n.command]=function(){const t={command:n.command};for(let e=0;e<arguments.length;e++)t[n.args[e].name]=arguments[e];return e(t)};}));}(t,s),n(t),g("map ready");}));}));}))}(e),setLogging:e=>{c=e,e&&g(`Atrius Maps JS SDK Client v${r} Logging enabled.`);}};
|
|
14
|
+
|
|
15
|
+
module.exports = l;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var postprocMolUrlParms = require('../src/configs/postproc-mol-url-parms.js');
|
|
4
|
+
var postprocStateTracking = require('../src/configs/postproc-stateTracking.js');
|
|
5
|
+
var funcs = require('../src/utils/funcs.js');
|
|
6
|
+
|
|
7
|
+
function i(i){const{name:s,debug:r,headless:a,theme:c,defaultSearchTerms:d,venueId:p,accountId:l,poiCategories:u,preserveStateInURL:h,supportURLDeepLinks:g,initState:m,deepLinkParms:f,uiHide:k,renderDiv:v,parentConfig:S,desktopViewMinWidth:P,forceDesktop:A,hostAppId:V,hostAppVersion:b,hostAppProperties:I,logFilter:L,searchPlaceholder:j,dataFetch:w,engineName:y}=i,D=S?[S]:a?["sdkHeadless"]:["sdkVisual"],T=(e,t)=>e&&e.length>t?e.substring(0,t):e,C={name:s,engineName:y,extends:D,debug:r,logFilter:L,theme:c,uiHide:k,renderDiv:v,configPostProc:[],plugins:{venueDataLoader:{dataFetch:w,venueId:p,accountId:l},sdkServer:{headless:a},analytics2:{hostAppId:(e=>e?T(e.toString(),128):void 0)(V),hostAppVersion:(e=>e?T(e.toString(),128):void 0)(b),hostAppProperties:(e=>{if(!e||"object"!=typeof e)return;const t={},o=Object.keys(e);return o.length>10&&(o.length=10),o.forEach((o=>{let i=T(o.toString().replaceAll(/[^a-zA-Z0-9_]/g,""),128);i.match(/^[a-zA-Z]+/)||(i="X"+i);let n=e[o];null==n&&(n=""),n=T(n.toString(),128),t[i]=n;})),t})(I)}},uuid:"undefined"!=typeof document&&document&&document.location?document.location.host:"unknown"};return a||(C.plugins["online/headerOnline"]={searchPlaceholder:j}),C.plugins.searchService=d?{defaultSearchTerms:d}:{},n(i,"defaultSearchTerms",C.plugins.searchService),D.includes("sdkVisual")&&(C.plugins["online/homeView"]=u?{poiCategories:u}:{},n(i,"poiCategories",C.plugins["online/homeView"])),h&&(C.configPostProc.push("stateTracking"),C.plugins.deepLinking={trackURL:!0}),g&&C.configPostProc.push("mol-url-parms"),m&&postprocStateTracking.setStateFromStateString(C,atob(m),!0),f&&postprocMolUrlParms.setDeepLinksForParms(C,f,!0),void 0!==P&&(C.desktopViewMinWidth=P),A&&(C.desktopViewMinWidth=0),funcs.filterOb(((e,t)=>void 0!==t),C)}function n(e,t,o){Object.keys(e).filter((e=>e.startsWith(t+"-"))).forEach((t=>o[t]=e[t]));}
|
|
8
|
+
|
|
9
|
+
module.exports = i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "type": "commonjs" }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var a={demo:"cd demo/ && yarn start",e2eTest:"percy exec -- cypress run --browser chrome",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh",mod:"demo/startMod.sh",mol:"demo/startMol.sh",mos:"demo/startMos.sh",prepare:"husky install",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch"},t={"@aws-amplify/auth":"^4.1.2","@azure/event-hubs":"^5.6.0","@john-osullivan/react-window-dynamic-fork":"^1.9.0-alpha.1","@locus-labs/mod-badge":"^0.1.11","@locus-labs/mod-default-theme":"^0.0.27","@locus-labs/mod-footer":"^0.0.25","@locus-labs/mod-header":"^0.0.19","@locus-labs/mod-location-marker":"^0.0.18","@locus-labs/mod-map-legend":"^0.0.18","@locus-labs/mod-offscreen-indicator":"^0.0.18","@locus-labs/mod-pin":"^0.0.18","@locus-labs/mod-qr-code-card":"^0.0.18","@locus-labs/mod-qr-code-window":"^0.0.19","@locus-labs/mod-walk-time-matrix":"^0.0.17","@locus-labs/mol-desktop-building-level-selector":"^0.1.15","@locus-labs/mol-desktop-compass":"^0.1.29","@locus-labs/mol-desktop-default-theme":"^0.2.13","@locus-labs/mol-desktop-icon":"^0.1.45","@locus-labs/mol-desktop-logo":"^0.1.10","@locus-labs/mol-desktop-map-nav-button":"^0.1.39","@locus-labs/mol-desktop-submenu":"^0.1.30","@locus-labs/mol-desktop-tooltip":"^0.3.11","@locus-labs/mol-desktop-zoom-control":"^0.1.37","@locus-labs/mol-mobile-floating-action-button":"^0.0.20","@locus-labs/mol-mobile-toast":"^0.1.11","@turf/circle":"^6.5.0",IObject:"^0.6.2","crypto-browserify":"^3.12.0","file-loader":"^6.2.0",flexsearch:"0.6.32",i18next:"^20.3.4","i18next-browser-languagedetector":"^6.1.1",jsonschema:"^1.2.6",luxon:"^2.0.1","maplibre-gl":"~2.1.9","mini-css-extract-plugin":"^1.6.0",msal:"1.4.11","node-polyfill-webpack-plugin":"^1.1.4","path-browserify":"^1.0.1",polished:"^4.0.2","prop-types":"^15.7.2","query-string":"7.0.1",ramda:"^0.27.0",react:"^17.0.2","react-compound-slider":"^3.3.1","react-dom":"^17.0.2","react-json-editor-ajrm":"^2.5.13","react-qr-svg":"^2.2.1","react-svg":"^11.2.5","react-tageditor":"^0.2.3","react-virtualized-auto-sizer":"^1.0.2","smoothscroll-polyfill":"^0.4.4","styled-components":"5.1.0","styled-normalize":"^8.0.6","throttle-debounce":"^3.0.1",trackjs:"^3.7.4","ua-parser-js":"^0.7.23",uuid:"3.3.2",zousan:"^3.0.1","zousan-plus":"^4.0.1"},r={"@babel/core":"^7.14.8","@babel/plugin-proposal-class-properties":"^7.8.3","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-transform-modules-commonjs":"^7.8.3","@babel/plugin-transform-runtime":"^7.8.3","@babel/preset-env":"^7.14.8","@babel/preset-react":"^7.8.3","@percy/cli":"^1.0.0-beta.60","@percy/cypress":"^3.1.0","babel-eslint":"^10.0.1","babel-jest":"^27.0.6","babel-loader":"^8.2.2","babel-plugin-inline-json-import":"^0.3.2","babel-plugin-module-resolver":"^4.0.0","babel-polyfill":"^6.26.0","chai-colors":"^1.0.1","css-loader":"^5.2.4",cypress:"9.5.2","cypress-wait-until":"^1.7.1",eslint:"^7.4.0","eslint-config-standard":"^16.0.3","eslint-plugin-cypress":"^2.11.1","eslint-plugin-import":"^2.16.0","eslint-plugin-jest":"^24.3.6","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.1.0","eslint-plugin-react":"^7.12.4","eslint-plugin-standard":"^5.0.0","fetch-mock-jest":"^1.3.0",husky:"^6.0.0",jest:"^26.0.0","jest-transform-css":"^2.0.0","lint-staged":"^11.0.1","node-fetch":"^2.6.0","null-loader":"^4.0.1",webpack:"^5.45.1","webpack-merge":"^5.8.0"},n=["demo","deploy","pageSrc","src/extModules/flexapi"],i={name:"web-engine",version:"3.2.30",main:"src/main.js",type:"module",scripts:a,dependencies:t,devDependencies:r,"lint-staged":{"*.js":["eslint --fix"]},license:"UNLICENSED",workspaces:n,private:!0};
|
|
6
|
+
|
|
7
|
+
exports["default"] = i;
|
|
8
|
+
exports.dependencies = t;
|
|
9
|
+
exports.devDependencies = r;
|
|
10
|
+
exports.scripts = a;
|
|
11
|
+
exports.workspaces = n;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var index = require('../../../src/extModules/flexapi/src/index.js');
|
|
6
|
+
|
|
7
|
+
function t(t,n){const s=index();return t.bus.on("clientAPI/registerCommand",(e=>s.registerCommand(e,(e=>t.bus.get(`clientAPI/${e.command}`,e))))),t.bus.on("clientAPI/registerCustomType",(({name:e,spec:t})=>s.registerCustomType(e,t))),t.bus.on("clientAPI/execute",(e=>s.execute(e))),{init:()=>{}}}
|
|
8
|
+
|
|
9
|
+
exports.create = t;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var e = require('ramda');
|
|
6
|
+
var a$1 = require('zousan');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
function _interopNamespace(e) {
|
|
11
|
+
if (e && e.__esModule) return e;
|
|
12
|
+
var n = Object.create(null);
|
|
13
|
+
if (e) {
|
|
14
|
+
Object.keys(e).forEach(function (k) {
|
|
15
|
+
if (k !== 'default') {
|
|
16
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return e[k]; }
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
n["default"] = e;
|
|
25
|
+
return Object.freeze(n);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
29
|
+
var a__default = /*#__PURE__*/_interopDefaultLegacy(a$1);
|
|
30
|
+
|
|
31
|
+
function a(a,n){let s=new a__default["default"];const i=new a__default["default"];function o(t,n){const s=e__namespace.pipe(e__namespace.filter((e=>"parking"===e.category)),e__namespace.map((a=>{const n=a.dynamicAttributes;if(!n)throw Error(`No dynamicAttributes defined for parking POI ${a.poiId}`);return {...(t-a.timestamp)/1e3<n["parking.timeToLive"]?e__namespace.pick(["lotStatus","rateDay","rateHour","timeIsReal","timeToTerminal1","timeToTerminal2"],a):{lotStatus:n["parking.default"],rateDay:"$ -",rateHour:"$ -",timeIsReal:!1},lastUpdated:a.timestamp,lotName:a.lotName}})))(n);a.bus.send("poi/setDynamicData",{plugin:"parking",idValuesMap:s});}function r(t,n){const s=e__namespace.pipe(e__namespace.map((e=>[e.poiId,u(t,e)])),e__namespace.fromPairs)(n);a.bus.send("poi/setDynamicData",{plugin:"security",idValuesMap:s});}const u=(e,t)=>({queueTime:t.queueTime,isTemporarilyClosed:t.isTemporarilyClosed,timeIsReal:!t.isQueueTimeDefault&&t.expiration>e,lastUpdated:e});return a.bus.on("venueData/venueDataLoaded",(({venueData:e})=>{s.v?s=a__default["default"].resolve(e):s.resolve(e);})),a.bus.on("sdk/readyWhenYouAre",(()=>i)),{init:async()=>{const e=n.urlBase||"https://rest.locuslabs.com/v3",t=n.urlBase||"https://rest.locuslabs.com/v1",u=a.config.plugins.venueDataLoader.accountId;async function c(){return s.then((e=>{let a=`${t}/venue/${e.id}/account/${u}/get-all-dynamic-pois/`;return (t.startsWith("./")||t.endsWith(".json"))&&(a=t),a}))}const l=async()=>s.then((t=>e.startsWith("./")||e.endsWith(".json")?e:`${e}/venueId/${t.id}/accountId/${u}/get-dynamic-queue-times/`)),m=async()=>{Promise.all([c().then(fetch).then((e=>e.json())).then((e=>o(Date.now(),e))),l().then(fetch).then((e=>e.json())).then((e=>r(Date.now(),e)))]).then((()=>i.resolve(!0))).catch((e=>{console.error(e),i.resolve(!0);}));},p=await a.bus.get("venueData/getQueueTypes");p.SecurityLane&&p.SecurityLane.length?s.then(m).then((()=>setInterval(m,3e4))):i.resolve(!0);},internal:{processSecurityWaitTimes:r,processParkingPOIS:o}}}
|
|
32
|
+
|
|
33
|
+
exports.create = a;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var e = require('ramda');
|
|
6
|
+
var a = require('zousan');
|
|
7
|
+
var buildStructureLookup = require('../../../src/utils/buildStructureLookup.js');
|
|
8
|
+
var configUtils = require('../../../src/utils/configUtils.js');
|
|
9
|
+
var i18n = require('../../../src/utils/i18n.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
function _interopNamespace(e) {
|
|
14
|
+
if (e && e.__esModule) return e;
|
|
15
|
+
var n = Object.create(null);
|
|
16
|
+
if (e) {
|
|
17
|
+
Object.keys(e).forEach(function (k) {
|
|
18
|
+
if (k !== 'default') {
|
|
19
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
20
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return e[k]; }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
n["default"] = e;
|
|
28
|
+
return Object.freeze(n);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
32
|
+
var a__default = /*#__PURE__*/_interopDefaultLegacy(a);
|
|
33
|
+
|
|
34
|
+
async function n(a,n){const s=a.log.sublog("poiDataManager"),u=()=>{a.bus.send("venueData/loadPoiData");};let p=new a__default["default"];const d=(o,e)=>{const{position:t}=o,i=e.floorIdToStructure(t.floorId);if(!i)return s.error(`No structure found for floorId: ${t.floorId} for POI ${o.poiId}`),{...o};const a=e.floorIdToFloor(t.floorId),n={...t,structureName:i.name,buildingId:i.id,floorName:a.name,floorOrdinal:a.ordinal};return {...o,position:n}},c=(o,e)=>{o.roomInfo||(o.roomInfo=[]),o.roomInfo.push(e);},l=e__namespace.pipe(e__namespace.propOr([],"externalIds"),e__namespace.find(e__namespace.propEq("type","roomId")),e__namespace.prop("id"),e__namespace.unless(e__namespace.isNil,e__namespace.tail));a.bus.on("venueData/poiDataLoaded",(async({pois:e,structures:n})=>{if(e=((e,t)=>e__namespace.pipe(e__namespace.values,e__namespace.map((o=>{o.distance=null,o.isNavigable=void 0===o.isNavigable||!0===o.isNavigable,o.capacity&&c(o,{name:`Seats ${o.capacity.join("-")}`,svgId:"number-of-seats"}),o.category.startsWith("meeting")&&c(o,{name:a.gt()("poiView:Conference Room"),svgId:"conference-room"});const e=l(o);return e&&(o.roomId=e),[o.poiId,d(o,t)]})),e__namespace.fromPairs)(e))(e,buildStructureLookup.buildStructuresLookup(n)),configUtils.debugIsTrue(a,"pseudoTransPois"))for(const o in e)e[o]=r(e[o],a.i18n().language);e=function(o){const e=[];return Object.values(o).forEach((o=>{try{const t=o.position;t?["buildingId","structureName","floorId","floorName","floorOrdinal","latitude","longitude"].forEach((i=>{null!==t[i]&&void 0!==t[i]||e.push({id:o.poiId,e:`invalid position property: ${i}: ${t[i]}`});})):e.push({poi:o,e:"No position information"});}catch(t){s.error(t),e.push({id:o.poiId,e:t.message});}})),e.length&&(s.warn("badPois:",e),e.forEach((e=>{delete o[e.id];}))),o}(e),await async function(o){for(const e of Object.values(o))await y(e);return o}(e),p.resolve(e),a.config.debug&&a.env.isBrowser&&(window._pois=e),a.config.debug&&async function(o){const e=Date.now(),t=[],i=await a.bus.get("wayfinder/_getNavGraph");Object.values(o).forEach((o=>{try{const e=o.position;i.findClosestNode(e.floorId,e.latitude,e.longitude)||t.push({id:o.poiId,e:"No closest Navgraph Node"});}catch(e){s.error(e),t.push({id:o.poiId,e:e.message});}})),t.length&&s.warn("badPois:",t),s(`Total time for navgraph POI check: ${Date.now()-e}ms`);}(e);})),a.bus.on("poi/getById",(async({id:o})=>p.then((e=>e[o])))),a.bus.on("poi/getByFloorId",(async({floorId:e})=>p.then(e__namespace.pickBy(e__namespace.pathEq(["position","floorId"],e))))),a.bus.on("poi/getByCategoryId",(async({categoryId:e})=>p.then(e__namespace.pickBy((o=>o.category===e||o.category.startsWith(e+".")))))),a.bus.on("poi/getAll",(async()=>p));const f=["queue","primaryQueueId"],m=(e,t,i)=>{const a=e__namespace.path(["queue","queueType"],t);if(!a)return null;const n=e[a],r=e__namespace.path(f,t);return i.filter(e__namespace.pathEq(f,r)).filter((o=>o.poiId!==t.poiId)).map((e=>{const t=e__namespace.path(["queue","queueSubtype"],e),i=g(t)(n);return {poiId:e.poiId,...i}}))},g=e=>{return e__namespace.pipe(e__namespace.find(e__namespace.propEq("id",e)),(t=`No queue found with ID: ${e}`,o=>{if(null!=o)return o;throw Error(t)}),e__namespace.pick(["displayText","imageId"]));var t;};async function y(t){if(!t)return;const i="undefined"==typeof window?1:window.devicePixelRatio||1;return e__namespace.length(t.images)?t.images[0].startsWith("https:")||(t.images=await a__default["default"].all(t.images.map((o=>a.bus.get("venueData/getPoiImageUrl",{imageName:o,size:`${351*i}x${197*i}`}))))):t.images=[],t}a.bus.on("poi/addOtherSecurityLanes",(({poi:e})=>(async e=>{if(!e__namespace.path(f,e))return e;const t=await a.bus.get("venueData/getQueueTypes"),i=await a.bus.get("poi/getByCategoryId",{categoryId:"security"}),n=Object.values(i);return e.queue.otherQueues=m(t,e,n),e})(e)));const I=e__namespace.memoizeWith(e__namespace.identity,e__namespace.pipe(e__namespace.pluck("category"),e__namespace.values,e__namespace.uniq));a.bus.on("poi/getAllCategories",(async()=>p.then(I))),a.bus.on("venueData/loadNewVenue",(()=>{p=new a__default["default"],u();})),a.bus.on("poi/setDynamicData",(({plugin:e,idValuesMap:t})=>{p.then((i=>{for(const a in t){const n=i[a].dynamicData||{};n[e]={...t[a]};const r=e__namespace.mergeRight(i[a],{dynamicData:n});i[a]=r;}}));}));return {init:u,runTest:async o=>(await o(),p),internal:{addImages:y,pseudoTransPoi:r}}}function r(o,e){return ["description","nearbyLandmark","name","phone","operationHours"].forEach((t=>{o[t]&&(o[t]=i18n.toLang(o[t],e));})),o.keywords&&(o.keywords=o.keywords.map((o=>(o.name=i18n.toLang(o.name,e),o)))),o.position.floorName&&(o.position.floorName=i18n.toLang(o.position.floorName,e)),o.position.structureName&&(o.position.structureName=i18n.toLang(o.position.structureName,e)),o}
|
|
35
|
+
|
|
36
|
+
exports.create = n;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var e = require('ramda');
|
|
6
|
+
var util = require('./util.js');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n["default"] = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
27
|
+
|
|
28
|
+
const s=[{command:"destroy"},{command:"getDirections",args:[{name:"from",type:"location"},{name:"to",type:"location"},{name:"accessible",type:"boolean",optional:!0},{name:"queueTypes",type:"list",itemType:{type:"string"},optional:!0}]},{command:"getPOIDetails",args:[{name:"poiId",type:"integer",min:0}]},{command:"getAllPOIs"},{command:"getStructures"},{command:"getVenueData"},{command:"search",args:[{name:"term",type:"string",minLength:2},{name:"details",type:"boolean",optional:!0}]}];function a(s){s.bus.on("clientAPI/destroy",(async()=>s.destroy())),s.bus.on("clientAPI/getDirections",(async({from:n,to:a,accessible:o,queueTypes:i})=>{const r=await util.locationToEndpoint(s,n),c=await util.locationToEndpoint(s,a),u={requiresAccessibility:!!o};return i&&(u.selectedSecurityLanes={SecurityLane:i}),s.bus.get("wayfinder/getRoute",{fromEndpoint:r,toEndpoint:c,options:u}).then(e__namespace.pick(["distance","time","steps","navline"]))})),s.bus.on("clientAPI/getPOIDetails",(async({poiId:e})=>s.bus.get("poi/getById",{id:e}))),s.bus.on("clientAPI/getAllPOIs",(async()=>s.bus.get("poi/getAll"))),s.bus.on("clientAPI/getStructures",(()=>util.getStructures(s)));const a=e=>"function"!=typeof e;s.bus.on("clientAPI/getVenueData",(async()=>{const t=await s.bus.get("venueData/getVenueData");return e__namespace.filter(a,t)})),s.bus.on("clientAPI/search",(async({term:e,details:t})=>s.bus.get("search/queryAsync",{term:e}).then((n=>{const a=n.map((e=>e.poiId));return s.bus.send("event/search",{referrer:"prog",searchMethod:null,query:e,entities:a}),t?n:a}))));}
|
|
29
|
+
|
|
30
|
+
exports.handleHeadless = a;
|
|
31
|
+
exports.headlessCommands = s;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var geom = require('../../../src/utils/geom.js');
|
|
6
|
+
var observable = require('../../../src/utils/observable.js');
|
|
7
|
+
var sdkHeadless = require('./sdkHeadless.js');
|
|
8
|
+
|
|
9
|
+
function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, 'default': e }); }
|
|
10
|
+
|
|
11
|
+
let a=null;function s(e){const t=(e,t)=>{const o={payload:e,type:"LL-server"};t&&(o.clientMsgId=t);try{window.postMessage(o,"*");}catch(e){window.postMessage((e=>JSON.parse(JSON.stringify(e)))(o),"*");}};function o(o){const n=o.data;n&&"LL-client"===n.type&&e.bus.get("clientAPI/execute",n.payload).then((e=>t(e,n.msgId))).catch((t=>{e.config.debug&&console.error(t),((e,t)=>{const o={error:!0,payload:e,type:"LL-server"};t&&(o.clientMsgId=t),window.postMessage(o,"*");})(t.message,n.msgId);}));}return a&&a(),window.addEventListener("message",o),a=()=>window.removeEventListener("message",o),(e,t)=>{const o={event:e,payload:t,type:"LL-server"};window.postMessage(o,"*");}}async function r(a,r){const i=a.env.isBrowser?s(a):function(e){const o=observable();return e.eventListener=o,(e,t)=>o.fire(e,t)}(a);return function(t,o){t.bus.monitor("map/userMoveStart",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("userMoveStart",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a});})),t.bus.monitor("map/userMoving",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("userMoving",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a});})),t.bus.monitor("map/moveEnd",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("moveEnd",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a});})),t.bus.monitor("map/floorChanged",(({structure:e,floor:t})=>o("levelChange",{floorId:t?t.id:null,floorName:t?t.name:null,ord:t?t.ordinal:null,structureId:e?e.id:null,structureName:e?e.name:null}))),t.bus.monitor("map/poiClicked",(({poi:e})=>o("poiSelected",e))),t.bus.monitor("map/click",(async({lat:n,lng:a,ord:s})=>{const r=await t.bus.get("venueData/getStructures"),{building:i,floor:l}=geom.getBuildingAndFloorAtPoint(r,n,a,s,!0);o("mapClicked",{lat:n,lng:a,ord:s,building:i,floor:l});}));}(a,i),{init:async()=>{!function(e){e.bus.send("clientAPI/registerCustomType",{name:"latLngOrdLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"ord",type:"integer"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"latLngFloorLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"floorId",type:"string"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"poiIdLocation",spec:{type:"object",props:[{name:"poiId",type:"integer",min:0}]}}),e.bus.send("clientAPI/registerCustomType",{name:"location",spec:{type:"multi",types:[{type:"poiIdLocation"},{type:"latLngOrdLocation"},{type:"latLngFloorLocation"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"viewSettings",spec:{type:"object",props:[{name:"zoom",type:"float",optional:!0},{name:"pitch",type:"float",optional:!0},{name:"bearing",type:"float",optional:!0}]}});}(a),sdkHeadless.headlessCommands.forEach((e=>a.bus.send("clientAPI/registerCommand",e))),sdkHeadless.handleHeadless(a),r.headless||await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('../../../_virtual/_empty_module_placeholder.js')); }).then((e=>{e.visualCommands.forEach((e=>a.bus.send("clientAPI/registerCommand",e))),e.handleVisual(a,i);}));const e=async()=>{await a.bus.send("sdk/readyWhenYouAre"),a.bus.get("clientAPI/execute",{command:"getCommandJSON"}).then((e=>i("ready",{commandJSON:e}))),!r.headless&&a.config.uiHide&&a.config.uiHide.sidebar&&a.env.isDesktop()&&a.bus.send("map/changePadding",{padding:{left:55,right:55,top:72,bottom:22}});};r.headless?Promise.all([new Promise((e=>a.bus.monitor("venueData/navGraphLoaded",e))),new Promise((e=>a.bus.monitor("venueData/poiDataLoaded",e)))]).then(e):a.bus.on("map/mapReadyToShow",e);}}}
|
|
12
|
+
|
|
13
|
+
exports.create = r;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var geom = require('../../../src/utils/geom.js');
|
|
6
|
+
|
|
7
|
+
const n=async o=>o.bus.get("venueData/getVenueData").then((o=>o.structures));async function i(i,r){if(r.poiId)return i.bus.get("wayfinder/getNavigationEndpoint",{ep:r.poiId});const{lat:l,lng:a,ord:e,floorId:d,title:u=""}=r,s=await n(i),f=void 0!==e?geom.getFloorAt(s,l,a,e):geom.getFloor(s,d);if(void 0!==e)return {lat:l,lng:a,ordinal:e,floorId:f?f.id:null,title:u};if(!f)throw Error("Call to locationToEndpoint with no ordinal and no floorId (or an invalid one): "+d);return {lat:l,lng:a,floorId:d,ordinal:f.ordinal,title:u}}
|
|
8
|
+
|
|
9
|
+
exports.getStructures = n;
|
|
10
|
+
exports.locationToEndpoint = i;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var e = require('ramda');
|
|
4
|
+
var utils = require('./utils.js');
|
|
5
|
+
|
|
6
|
+
function _interopNamespace(e) {
|
|
7
|
+
if (e && e.__esModule) return e;
|
|
8
|
+
var n = Object.create(null);
|
|
9
|
+
if (e) {
|
|
10
|
+
Object.keys(e).forEach(function (k) {
|
|
11
|
+
if (k !== 'default') {
|
|
12
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return e[k]; }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
n["default"] = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
25
|
+
|
|
26
|
+
function t(t,e){const o=utils.getFlexSearchInstance({lang:e});function n(r){return Object.values(r).map((r=>{const{poiId:t,category:e="",name:o,keywords:n=[],roomId:c=""}=r,i=e__namespace.path(["dynamicData","grab","tags"],r)||[],p=n.filter(e__namespace.prop("isUserSearchable")).map(e__namespace.prop("name")),s=`${o} ${e.split(".").join(" ")} ${c} ${p.join(" ")} ${i.join(" ")}`;return [Number(t),s]}))}return o.addMatcher({"['.,]":""}),n(t).forEach((([a,r])=>o.add(a,r))),{search:function(r){const e=o.search(r);return Object.values(e__namespace.pick(e,t))},updateMultiple:function(a){n(a).forEach((([a,r])=>o.update(a,r)));}}}
|
|
27
|
+
|
|
28
|
+
module.exports = t;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var e = require('ramda');
|
|
6
|
+
var a = require('zousan');
|
|
7
|
+
var configUtils = require('../../../src/utils/configUtils.js');
|
|
8
|
+
var rand = require('../../../src/utils/rand.js');
|
|
9
|
+
var poiSearch = require('./poiSearch.js');
|
|
10
|
+
var searchTypeahead = require('./searchTypeahead.js');
|
|
11
|
+
|
|
12
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
+
|
|
14
|
+
function _interopNamespace(e) {
|
|
15
|
+
if (e && e.__esModule) return e;
|
|
16
|
+
var n = Object.create(null);
|
|
17
|
+
if (e) {
|
|
18
|
+
Object.keys(e).forEach(function (k) {
|
|
19
|
+
if (k !== 'default') {
|
|
20
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
21
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return e[k]; }
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
n["default"] = e;
|
|
29
|
+
return Object.freeze(n);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
33
|
+
var a__default = /*#__PURE__*/_interopDefaultLegacy(a);
|
|
34
|
+
|
|
35
|
+
function o(o,i){const c={poiSearch:null,typeahead:null,indexesCreated:new a__default["default"],defaultSearchTerms:null,specialQueryTerms:{}},u=async()=>{const e=await o.bus.get("poi/getAll");c.poiSearch=poiSearch(e,o.i18n().language),c.typeahead=searchTypeahead(e,c.poiSearch.search,o.i18n().language),c.defaultSearchTerms=configUtils.getLocalized(i,"defaultSearchTerms",o.i18n().language),c.indexesCreated.resolve();};async function d(){const r=await o.bus.get("user/getPhysicalLocation"),a=await o.bus.get("poi/getByFloorId",{floorId:r.floorId}),s=Object.values(e__namespace.pickBy((e=>-1===e.category.indexOf("portal")&&"element.door"!==e.category),a)),t=await o.bus.get("wayfinder/addPathTimeMultiple",{pois:s,startLocation:r});return e__namespace.sortBy(e__namespace.prop("distance"),Object.values(t)).slice(0,50)}o.bus.on("search/queryNearby",(async()=>{const e=await d();return o.bus.send("search/showNearby",{pois:e,term:"Nearby"}),e})),o.bus.on("search/queryNearbyAsync",d),o.bus.on("search/queryCategory",(async({category:e,categoryName:r,searchTerm:a})=>{const s=await c.indexesCreated.then((()=>c.poiSearch.search({query:a||e})));return o.bus.send("search/showCategory",{pois:s,category:e,categoryName:r}),s})),o.bus.on("search/query",(({term:e})=>c.indexesCreated.then((()=>{const r=c.poiSearch.search({query:e});return o.bus.send("search/showSearchResults",{results:r,term:e}),r})))),o.bus.on("search/queryAsync",(({term:e})=>c.indexesCreated.then((()=>c.poiSearch.search({query:e}))))),o.bus.on("search/queryWithSpecial",(({term:e})=>{if(c.specialQueryTerms[e]){const{event:r,params:a}=c.specialQueryTerms[e];return o.bus.send(r,a)}return o.bus.get("search/query",{term:e})})),o.bus.on("search/getDefaultSearchTerms",(async({limit:e=5}={})=>{const r=c.defaultSearchTerms,a=r&&r.length?r:await async function(e){const r=(await o.bus.send("poi/getAllCategories"))[0],a=Array.from(new Set(r));return function(e){for(let r=e.length-1;r>0;r--){const a=Math.floor(Math.random()*(r+1));[e[r],e[a]]=[e[a],e[r]];}return e}(a).slice(0,e)}(e);return o.bus.send("search/showDefaultSearchKeywords",{keywords:a}),a})),o.bus.on("search/getDefaultSearchPois",(async({limit:r=5}={})=>{const a=await o.bus.get("poi/getAll"),t=e__namespace.pickBy(((e,r)=>e.isNavigable),a);return rand.arrayPick(Object.values(t),r)})),o.bus.on("search/registerSpecialQuery",(({term:e,event:r,params:a,addKeyword:s=!0})=>{c.indexesCreated.then((()=>{s&&c.typeahead.addKeyword(e),c.specialQueryTerms[e]={event:r,params:a};}));})),o.bus.on("search/addKeywords",(({keywords:e})=>c.indexesCreated.then((()=>e.forEach((e=>c.typeahead.addKeyword(e))))))),o.bus.on("search/typeahead",(({term:e,limit:r})=>c.indexesCreated.then((()=>{const{keywords:a,pois:s}=c.typeahead.query(e,r);return {keywords:a,pois:s,term:e}})))),o.bus.on("venueData/loadNewVenue",(()=>{c.indexesCreated=new a__default["default"],u();})),o.bus.on("poi/setDynamicData",(async({plugin:e,idValuesMap:r})=>{if("grab"!==e)return;const a=Object.keys(r).map((e=>o.bus.get("poi/getById",{id:e})));return Promise.all(a).then((e=>c.indexesCreated.then((()=>c.poiSearch.updateMultiple(e)))))}));return {init:u,runTest:async(e,r)=>(await r(),c)}}
|
|
36
|
+
|
|
37
|
+
exports.create = o;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var e = require('ramda');
|
|
4
|
+
var utils = require('./utils.js');
|
|
5
|
+
|
|
6
|
+
function s(s,d,u){const c=function(s,d){const u=function(e){return Object.values(e).map((e=>e.category)).map((e=>e.split("."))).map((e=>e[0]))}(s),c=e.pipe(e.values,e.chain(e.prop("keywords")),e.filter(e.prop("isUserSearchable")),e.pluck("name"))(s),m=[...u,...c],p=Array.from(new Set([...m])),l=utils.getFlexSearchInstance({lang:d,type:"typeahead"});p.forEach(((e,r)=>l.add(r,e)));return {search:e=>l.search(e).map((e=>p[e])),add:e=>{p.push(e),l.add(p.length-1,e);}}}(s,u);return {query:(e,r)=>{const t=c.search({query:e,limit:r}),a=!(e.length<3)&&t.length,n=r-t.length,o=a?function(e,r){const t=d({query:e,limit:r}),a=d({query:e,suggest:!0,limit:r}),n=t.map((e=>e.poiId)),o=a.filter((e=>-1===n.indexOf(e.poiId)));return t.concat(o)}(e,n):[];return {keywords:t,pois:o}},addKeyword:e=>{c.add(e);}}}
|
|
7
|
+
|
|
8
|
+
module.exports = s;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var e = require('flexsearch');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var e__default = /*#__PURE__*/_interopDefaultLegacy(e);
|
|
10
|
+
|
|
11
|
+
const a=["ko","ja","zh-Hans","zh-Hant"],n={encode:!1,split:/\s+/,tokenize:"full"},t={standard:{profile:"match"},typeahead:{encode:"advanced"},full:n},d=({lang:d,type:o="standard"})=>{const l=a.includes(d)?n:t[o];return new e__default["default"]({...l})};
|
|
12
|
+
|
|
13
|
+
exports.getFlexSearchInstance = d;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var e = require('ramda');
|
|
6
|
+
var a = require('zousan');
|
|
7
|
+
var Auth = require('../../../src/auth/Auth.js');
|
|
8
|
+
var funcs = require('../../../src/utils/funcs.js');
|
|
9
|
+
var venueLoadingUtils = require('./venueLoadingUtils.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
function _interopNamespace(e) {
|
|
14
|
+
if (e && e.__esModule) return e;
|
|
15
|
+
var n = Object.create(null);
|
|
16
|
+
if (e) {
|
|
17
|
+
Object.keys(e).forEach(function (k) {
|
|
18
|
+
if (k !== 'default') {
|
|
19
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
20
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return e[k]; }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
n["default"] = e;
|
|
28
|
+
return Object.freeze(n);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
32
|
+
var a__default = /*#__PURE__*/_interopDefaultLegacy(a);
|
|
33
|
+
|
|
34
|
+
async function i(i,l){const d=i.log.sublog("venueDataLoader");let c=new a__default["default"],p=new a__default["default"];const g=a=>a.defaultStructureId||e__namespace.path(["structureOrder",0],a)||e__namespace.path(["selectorOrder",0],a)||e__namespace.pipe(e__namespace.prop("structures"),Object.values,e__namespace.path([0,"id"]))(a);const v=e=>{const a=l.availableLanguages.find((a=>a.langCode===e));return a||{langCode:e,assetSuffix:""}};async function f(a){a.assetStage&&"prod"!==a.assetStage&&location.hostname;const l=a.auth?await async function(e){const a=await Auth(e,i);let s=null,u=0;for(;!s&&u<6;)s=await a.getToken(),u++,s||await funcs.delay(500)();return s?(i.bus.send("login/userLoggedIn",{token:s}),i.bus.on("app/logout",a.logout),s):i.bus.get("login/showLogin",{auth:a})}(a.auth):null,p=venueLoadingUtils.createFetchJson(l),f=venueLoadingUtils.createFetchText(l),b=await venueLoadingUtils.getVenueDataFromUrls(a,p),{accountId:m,venueId:h}=a;b.assetStage=a.assetStage,b.defaultOrdinal=b.defaultOrdinal||function(a){const t=g(a),n=Object.values(a.structures).find(e__namespace.propEq("id",t));return n.levels[n.defaultLevelId].ordinal}(b),b.structures=venueLoadingUtils.buildStructures(b);const y=i.i18n().language,D=v(y);return b.bareVenueId=h.slice(0,h.length-D.assetSuffix.length),b.getTranslatedContentPath=e=>`https://content.locuslabs.com/${b.category}/${e}/${h}/${m}`,b.fetchJson=p,b.fetchText=f,d.info("venueData ",b,D,y),i.config.debug&&i.env.isBrowser&&(window._venueData=b),b.queueTypes&&(b.securityQueueTypes=(()=>{const e=b.queueTypes.find((e=>"SecurityLane"===e.id));return e?e.subtypes.map((e=>e.id)):[]})()),i.bus.send("venueData/venueDataLoaded",{venueData:b}),c.resolve(b),c}function b(e){const a={id:"venueDataLoader"};e.id!==l.venueId&&(a.vid=e.id);const t=i.config.defaultLanguage||"en";return i.i18n().language!==t&&(a.lang=i.i18n().language),"prod"!==e.assetStage&&(a.stage=e.assetStage),i.bus.send("deepLinking/notifyState",a),e}i.bus.on("debugTools/fileDrop",(async({file:e,content:a})=>{if("application/json"===e.type){const e=JSON.parse(a);if(e.basemap&&e["basemap.venue"])return n=JSON.parse(a),void i.bus.send("map/replaceTheme",{theme:n});if(e.metadata&&e.metadata["mapbox:type"])return t=a,void i.bus.send("map/replaceStyle",{styleSrc:t})}var t,n;}));async function m(e){const a={...e},t=await i.bus.get("poi/getAll");return Object.values(a).forEach((e=>e.filter((e=>"poi"===e.properties.aiLayer&&"Point"===e.geometry.type)).forEach((e=>{const a=t[e.properties.id];a?a.mapLabel?e.properties.text=a.mapLabel:!1!==l.copyPOINamesToMap&&(e.properties.text=function(e){let a=e.name;return l.poiMapNameXForm?(Object.keys(l.poiMapNameXForm).filter((a=>((e,a)=>e===a||0===e.indexOf(a+"."))(e.category,a))).forEach((e=>{l.poiMapNameXForm[e].forEach((e=>a=a.replace(new RegExp(e.replace),e.with)));})),a):a}(a)):d.warn(`Unknown poi in style: ${e.properties.id}`);})))),a}const h=(a,t,n,s)=>{const u=a.replace(/-[^-]*$/,""),o=u===n?"landscape-background":`ordinal: ${s.find(e__namespace.hasPath(["levels",a])).levels[a].ordinal}`;return t.map((t=>{var s,r,i;return s="properties",r={venueId:n,structureId:u,ordinalId:o,levelId:a},i=t,t=e__namespace.over(e__namespace.lensProp(s),(a=>e__namespace.mergeRight(a||{},r)),i),t=e__namespace.assoc("id",t.properties.subid,t)}))};i.bus.on("venueData/loadMap",(async()=>{c.then((async a=>{const t=await a.fetchText(a.files.style),n=await a.fetchJson(a.files.theme),s=a.files.spritesheet,u=a.files.glyphs,{id:o,bounds:r,structures:d,venueCenter:c,venueRadius:g,defaultOrdinal:v}=a,f=await async function(a){return e__namespace.pipe(e__namespace.prop("structures"),e__namespace.map(e__namespace.prop("levels")),e__namespace.chain(e__namespace.keys),e__namespace.prepend(a.id),e__namespace.map((e=>a.files.geoJson.replace("${geoJsonId}",e))),e__namespace.map(a.fetchJson),e__namespace.map(e__namespace.andThen((e=>[e.id,h(e.id,e.features,a.id,a.structures)]))),(e=>Promise.all(e)),e__namespace.andThen(e__namespace.fromPairs))(a)}(a).then(m),b={mapFeatures:f,mapStyleSource:t,mapTheme:n,badgesSpriteUrl:s,mapGlyphsUrl:u,structures:d,defaultOrdinal:v,venueBounds:{n:r.ne.lat,s:r.sw.lat,e:r.ne.lng,w:r.sw.lng},venueId:o,venueCenter:c,venueRadius:g,accountId:l.accountId,secure:void 0!==l.auth};p.resolve(b),i.bus.send("venueData/mapDataLoaded",b);}));}));const y=e=>null==e.shouldDisplay||e.shouldDisplay;i.bus.on("venueData/loadBuildingSelectorData",(()=>c.then((async a=>{const t={buildings:a.structures.filter(y).map(e__namespace.evolve({levels:e__namespace.pipe(e__namespace.values,e__namespace.sortWith([e__namespace.descend(e__namespace.prop("ordinal"))]))})),structureOrder:a.structureOrder,selectorOrder:a.selectorOrder};return i.bus.send("venueData/buildingSelectorDataLoaded",t),t})))),i.bus.on("venueData/loadNavGraph",(async()=>c.then((async e=>{const a=await e.fetchJson(e.files.nav);i.bus.send("venueData/navGraphLoaded",{navGraphData:a,structures:e.structures});})))),i.bus.on("venueData/loadPoiData",(async()=>c.then((async e=>{const a=l.useOldDataModel?e.files.poisOld||e.files.pois:e.files.pois||e.files.poisOld,t=await e.fetchJson(a);i.bus.send("venueData/poiDataLoaded",{pois:t,structures:e.structures});})))),i.bus.on("venueData/getVenueCenter",(async()=>c.then((async e=>({lat:e.venueCenter[0],lng:e.venueCenter[1],ordinal:0}))))),i.bus.on("venueData/getContentUrl",(({type:e,name:a=""})=>c.then((t=>t.files[e]+a)))),i.bus.on("venueData/getFloorIdToNameMap",(()=>c.then(e__namespace.pipe(e__namespace.prop("structures"),e__namespace.map(e__namespace.prop("levels")),e__namespace.chain(e__namespace.values),e__namespace.map(e__namespace.props(["id","name"])),e__namespace.fromPairs)))),i.bus.on("venueData/getFloorIdName",(({floorId:a})=>c.then((async t=>{const n=e__namespace.pipe(e__namespace.values,e__namespace.find(e__namespace.hasPath(["levels",a])))(t.structures);return n?{structureId:n.id,structureName:n.name,floorName:n.levels[a].name}:null}))));const D=(a,t)=>()=>c.then(e__namespace.pipe(e__namespace.prop(a),e__namespace.defaultTo(t)));i.bus.on("venueData/getVenueData",(()=>c)),i.bus.on("venueData/getVenueName",D("name")),i.bus.on("venueData/getVenueCategory",D("category")),i.bus.on("venueData/getVenueTimezone",D("tz")),i.bus.on("venueData/getAccountId",(()=>l.accountId)),i.bus.on("venueData/getVenueId",D("id")),i.bus.on("venueData/getPositioningSupported",D("positioningSupported")),i.bus.on("venueData/getStructures",D("structures")),i.bus.on("venueData/loadNewVenue",(async({venueId:e,accountId:t,assetStage:n=l.assetStage})=>{c.reject(new Error("loadNewVenue called - previous loading ignored")),p.reject(new Error("loadNewVenue called - previous loading ignored")),c=new a__default["default"],p=new a__default["default"],f({...l,venueId:e,accountId:t,assetStage:n}).then(b);})),i.bus.on("venueData/changeVenueLanguage",(async({lang:e})=>c.then((async a=>{const t=v(e),n=`${a.bareVenueId}${t.assetSuffix}`;i.bus.send("venueData/loadNewVenue",{accountId:l.accountId,venueId:n});})))),i.bus.on("venueData/getPoiImageUrl",(({imageName:e,size:a})=>`https://img.locuslabs.com/resize/${l.accountId}/${a}cc/poi/${e}`)),i.bus.on("venueData/getDistributionId",(()=>c.then((e=>`${e.bareVenueId}-${l.accountId}`)))),i.bus.on("venueData/getCustomKeywords",(()=>c.then((e=>{const a=l.useOldDataModel&&e.files.searchOld||e.files.search;return e.fetchJson(a)})))),i.bus.on("venueData/isGrabEnabled",D("enableGrab")),i.bus.on("venueData/getGrabPoiIds",D("grabPoiIds",[])),i.bus.on("venueData/getAssetsTimestamp",D("version")),i.bus.on("venueData/getTranslatedFloorId",(async({floorId:e})=>c.then((a=>{const t=i.i18n().language,n=v(t);return `${a.bareVenueId}${n.assetSuffix}-${e.split("-").slice(1).join("-")}`})))),i.bus.on("venueData/getQueueTypes",(()=>c.then((e=>{const a=["tsapre","clear","globalEntry"];return e.queueTypes?e.queueTypes.reduce(((e,t)=>{const{id:n,subtypes:s}=t,u=s.map((e=>{const t=a.includes(e.id)&&`security-logo-${e.id.toLowerCase()}`;return {...e,imageId:t}}));return e[n]=u,e}),{}):{}}))));return {init:async()=>{const e=l.deepLinkProps||{},a=e.vid||l.venueId,t=l.useDynamicUrlParams&&e.stage?e.stage:l.assetStage,n="alpha"===t?"A1VPTJKREFJWX5":l.accountId;f({...l,venueId:a,accountId:n,assetStage:t}).then(b);},runTest:async({testRoutine:e,reset:t=!1,venueData:n=null})=>{let s,u;return (t||n)&&(c=new a__default["default"],p=new a__default["default"]),n&&(c=a__default["default"].resolve(n)),await e(),c.v&&(s=await c),p.v&&(u=await p),{venueDataObj:s,mapDataObj:u}},internal:{getDefaultStructureId:g}}}
|
|
35
|
+
|
|
36
|
+
exports.create = i;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var e = require('ramda');
|
|
6
|
+
var bounds = require('../../../src/utils/bounds.js');
|
|
7
|
+
var configUtils = require('../../../src/utils/configUtils.js');
|
|
8
|
+
|
|
9
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return e[k]; }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n["default"] = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
28
|
+
|
|
29
|
+
const s=async(t,a)=>t?fetch(a,{headers:{Authorization:t}}):fetch(a),o=t=>a=>s(t,a).then((t=>t.json())),c=t=>a=>s(t,a).then((t=>t.text())),n=t=>`https://api.content.locuslabs.com/${t}`,r=(a,e,s,o,c)=>e__namespace.mapObjIndexed(((t,e)=>((t,a,e,s,o,c)=>"theme"===c||"style"===c?`${n(e)}/${a}/${c}/${o}/${s}/${c}.json`:t.replace(/https:\/\/content.locuslabs.com/gi,n(e)))(t,a,s,o,c,e)),e),u=async(t,a)=>{const s={alpha:"alpha-a.locuslabs.com",beta:"beta-a.locuslabs.com",gamma:"gamma-a.locuslabs.com",prod:"a.locuslabs.com"},{assetStage:o,venueId:c,accountId:n,formatVersion:u}=t,l=`https://${s[o]||s.prod}/accounts/${n}`,i=u||"v5",h=t.dataFetch&&configUtils.global[t.dataFetch]&&configUtils.global[t.dataFetch].getFiles?await configUtils.global[t.dataFetch].getFiles(t):await a(`${l}/${i}.json`);if(!h[c])throw Error(`Attempt to access venue ${c} which is not within venue list: ${Object.keys(h)}`);const d=h[c].files,m=(t.dataFetch&&configUtils.global[t.dataFetch]&&configUtils.global[t.dataFetch].getVenueData?await configUtils.global[t.dataFetch].getVenueData(t):await a(d.venueData))[c];m.venueList=h;const p=(t=>{const a=t.deepLinkProps?t.deepLinkProps.contentStage:null;return "alpha"===a||"beta"===a||"prod"===a?a:null})(t);return m.files=p?r(m.category,d,p,n,c):d,m},l=t=>{const{structureOrder:e,structures:s}=t;return e.map((t=>{const e=s[t],o=bounds.findBoundsOfCoordinates(e.boundsPolygon);return {...e,bounds:o}}))};
|
|
30
|
+
|
|
31
|
+
exports.buildStructures = l;
|
|
32
|
+
exports.createFetchJson = o;
|
|
33
|
+
exports.createFetchText = c;
|
|
34
|
+
exports.getVenueDataFromUrls = u;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var e = require('ramda');
|
|
6
|
+
var wayfinder = require('./wayfinder.js');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n["default"] = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
27
|
+
|
|
28
|
+
const i=t=>i=>e__namespace.find((e=>e.dst===t),i.edges),r=(r,s,a,n={})=>{const o=[],u=[];let c=!1,l=!1;const d=((e,t,i,r)=>{if(!t||!i)throw Error("bad calculate Route request!");return e.findShortestPath(t,i,r)})(r,s,a,n);if(null===d)return null;let y=null;for(let r=0;r<d.length;r++){const s={distance:0,eta:0};if(y){const e=i(d[r].id)(y);null!=e&&(s.distance=e.distance,s.eta=e.transitTime,"Ground"!==e.type&&(s.portalType=e.type,s.isPortal=!0),e.o&&(s.poiId=e.o),e.path&&(s.curvedPathForward=e.path),e.securityWaitTimes&&(s.securityWaitTimes=e.securityWaitTimes,s.eta=s.securityWaitTimes.queueTime),e.securityLane&&(s.securityLane=e.securityLane,s.isSecurityCheckpoint=!0,e.securityLane.type===wayfinder.SecurityLaneType.SECURITY&&(c=!0),e.securityLane.type===wayfinder.SecurityLaneType.IMMIGRATION&&(l=!0),e.o&&u.push(e.o)));}s.levelDifference=y?d[r].ordinal-y.ordinal:0,s.position=e__namespace.omit(["edges","id"],{...d[r]}),o.push(s),y=d[r];}return e__namespace.last(o).isDestination=!0,{waypoints:o,queues:u,hasSecurity:c,hasImmigration:l}};
|
|
29
|
+
|
|
30
|
+
exports.findRoute = r;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
class h{constructor(){this.heap=[null],this.heapMap={};}offerWithPriority(h,i){const t=this.heap.push([h,i])-1;this.heapMap[h]=t,this.bubble(t);}raisePriority(h,i){const t=this.heapMap[h];this.heap[t][1]=i,this.bubble(t);}poll(){if(1===this.heap.length)return null;if(2===this.heap.length){const h=this.heap.pop()[0];return delete this.heapMap[h],h}const h=this.heap[1][0];return delete this.heapMap[h],this.heap[1]=this.heap.pop(),this.heapMap[this.heap[1][0]]=1,this.sink(1),h}isEmpty(){return 1===this.heap.length}bubble(h){for(;h>1;){const i=h>>1;if(!this.isHigherPriority(h,i))break;this.swap(h,i),h=i;}}sink(h){for(;2*h<this.heap.length;){const i=void 0!==this.heap[2*h+1]&&this.isHigherPriority(2*h+1,2*h)?2*h+1:2*h;if(this.isHigherPriority(h,i))break;this.swap(h,i),h=i;}}swap(h,i){this.heapMap[this.heap[h][0]]=i,this.heapMap[this.heap[i][0]]=h;const t=this.heap[h];this.heap[h]=this.heap[i],this.heap[i]=t;}isHigherPriority(h,i){return this.heap[h][1]<this.heap[i][1]}}
|
|
4
|
+
|
|
5
|
+
module.exports = h;
|