atriusmaps-node-sdk 3.3.752 → 3.3.754

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.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var name = "web-engine";
6
- var version = "3.3.752";
6
+ var version = "3.3.754";
7
7
  var license = "UNLICENSED";
8
8
  var type = "module";
9
9
  var main = "src/main.js";
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var R = require('ramda');
4
- var geohasher = require('../../../src/extModules/geohasher.js');
5
4
  var geodesy = require('../../../src/utils/geodesy.js');
5
+ var geohasher = require('../../../src/extModules/geohasher.js');
6
6
  var minPriorityQueue = require('./minPriorityQueue.js');
7
7
 
8
8
  const DEFAULT_WALKING_SPEED_M_PER_MIN = 60;
@@ -2,13 +2,13 @@
2
2
 
3
3
  var R = require('ramda');
4
4
  var Zousan = require('zousan-plus');
5
+ var i18n = require('./utils/i18n.js');
6
+ var isInitialState = require('./utils/isInitialState.js');
5
7
  var _package = require('../package.json.js');
6
8
  var debugTools = require('./debugTools.js');
7
9
  var env = require('./env.js');
8
10
  var bustle = require('./extModules/bustle.js');
9
11
  var log = require('./extModules/log.js');
10
- var i18n = require('./utils/i18n.js');
11
- var isInitialState = require('./utils/isInitialState.js');
12
12
 
13
13
  function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); }
14
14
 
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var R = require('ramda');
4
- var navGraphDebug = require('../plugins/wayfinder/src/navGraphDebug.js');
5
4
  var dom = require('./utils/dom.js');
6
5
  var funcs = require('./utils/funcs.js');
6
+ var navGraphDebug = require('../plugins/wayfinder/src/navGraphDebug.js');
7
7
 
8
8
  function _interopNamespaceDefault(e) {
9
9
  var n = Object.create(null);
@@ -1 +1 @@
1
- var e="web-engine",t="3.3.752",s="UNLICENSED",r="module",o="src/main.js",i=["demo","deploy","nodesdk","src/extModules/flexapi","services/*","libraries/*"],l={colors:"cat utils/colors1.txt && node utils/processColors.js | pbcopy && cat utils/colors2.txt","cypress:comp":"cypress open --component --browser chrome","cypress:comp:ci":"cypress run --component",demo:"cd demo/ && yarn start",dev:"yarn mol e2e","format:check":"yarn prettier . --check","format:fix":"yarn prettier . --write",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh","icons:convert":"node scripts/convertSvgToJsx.mjs",lint:"eslint .",mod:"demo/startMod.sh",mol:"demo/startMol.sh","mol:build":"demo/startMolBuild.sh",molProd:"cd deploy && yarn buildAndRunMol","playwright:ci":"yarn playwright test --grep-invert sdk","playwright:ci:failed":"yarn playwright test --last-failed --grep-invert sdk","playwright:sdk":"yarn start-server-and-test 'cd ./deploy && yarn buildDev && yarn serveLocal' 8085 'cd ./test/sdk && npx http-server' 8080 'yarn playwright test sdk --ui'","playwright:ui":"yarn playwright test --ui --grep-invert sdk",prepare:"husky",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch","test:all":"yarn lint && yarn format:check && yarn test && yarn test:vitest && yarn cypress:comp:ci && yarn playwright:ci","test:mod":"playwright test --config=playwright.mod.config.ts","test:vitest":"vitest run",typecheck:"tsc -p tsconfig.checkjs.json",storybook:"storybook dev -p 6006","build-storybook":"storybook build"},a=["defaults"],n={react:"^18.3.1"},c={"@azure/event-hubs":"^5.12.2","@csstools/normalize.css":"^11.0.1","@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@locus-labs/mod-badge":"^0.1.102","@locus-labs/mod-footer":"^0.0.111","@locus-labs/mod-header":"^0.0.105","@locus-labs/mod-location-marker":"^0.0.104","@locus-labs/mod-map-legend":"^0.0.104","@locus-labs/mod-offscreen-indicator":"^0.0.104","@locus-labs/mod-pin":"^0.0.104","@locus-labs/mod-qr-code-card":"^0.0.104","@locus-labs/mod-qr-code-window":"^0.0.105","@locus-labs/mod-walk-time-matrix":"^0.0.103","@mapbox/mapbox-gl-draw":"^1.5.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@microsoft/applicationinsights-web":"^3.3.6","@turf/area":"^7.2.0","@turf/bbox-clip":"^7.2.0","@turf/bbox-polygon":"^7.2.0","@turf/bearing":"^7.2.0","@turf/circle":"^7.2.0","@turf/helpers":"^7.2.0","@turf/point-to-line-distance":"^7.2.0","@vitejs/plugin-react":"^4.3.4","axe-core":"^4.10.3",browserslist:"^4.27.0","crypto-browserify":"^3.12.1","cypress-multi-reporters":"^2.0.5","cypress-real-events":"^1.14.0","file-loader":"^6.2.0",flexsearch:"^0.7.43","h3-js":"^4.1.0",i18next:"^20.6.1","i18next-browser-languagedetector":"^6.1.1","jest-transform-css":"6.0.2",jsdom:"^25.0.1",jsonschema:"^1.5.0",luxon:"^3.5.0","maplibre-gl":"^4.7.1","mini-css-extract-plugin":"^2.9.2","mocha-junit-reporter":"^2.2.1",mochawesome:"^7.1.3","node-polyfill-webpack-plugin":"^4.1.0","path-browserify":"^1.0.1","prop-types":"^15.8.1","qrcode.react":"^4.2.0",ramda:"^0.30.1",react:"^18.3.1","react-compound-slider":"^3.4.0","react-dom":"^18.3.1","react-json-editor-ajrm":"^2.5.14","react-svg":"^16.3.0","react-virtualized-auto-sizer":"^1.0.25","react-window":"^1.8.11","smoothscroll-polyfill":"^0.4.4","styled-components":"^6.1.15","styled-normalize":"^8.1.1","throttle-debounce":"^5.0.2",trackjs:"^3.10.4","ua-parser-js":"^0.7.40",uuid:"11.1.0",zousan:"^3.0.1","zousan-plus":"^4.0.1"},p={"@applitools/eyes-playwright":"^1.44.1","@axe-core/playwright":"^4.10.2","@azure/identity":"^4.13.0","@azure/playwright":"^1.0.0","@babel/core":"^7.26.10","@babel/eslint-parser":"^7.26.10","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-assertions":"^7.26.0","@babel/plugin-transform-modules-commonjs":"^7.26.3","@babel/plugin-transform-runtime":"^7.26.10","@babel/preset-env":"^7.26.9","@babel/preset-react":"^7.26.3","@playwright/test":"^1.56.0","@storybook/addon-essentials":"^8.6.15","@storybook/blocks":"^8.6.15","@storybook/react":"^8.6.15","@storybook/react-vite":"^8.6.15","@testing-library/jest-dom":"^6.6.3","@types/react":"^19.0.10","@types/react-dom":"^19.0.4","@typescript-eslint/eslint-plugin":"^8.26.1","@typescript-eslint/parser":"^8.26.1","babel-jest":"^29.7.0","babel-loader":"^10.0.0","babel-plugin-inline-json-import":"^0.3.2","babel-plugin-module-resolver":"^5.0.2","babel-plugin-styled-components":"^2.1.4","chai-colors":"^1.0.1","css-loader":"^7.1.2",cypress:"^14.2.0","cypress-wait-until":"^3.0.2",eslint:"^8.57.1","eslint-config-prettier":"^10.1.8","eslint-config-standard":"^17.1.0","eslint-import-resolver-alias":"^1.1.2","eslint-import-resolver-typescript":"^3.9.1","eslint-plugin-cypress":"^2.15.2","eslint-plugin-import":"^2.31.0","eslint-plugin-jest":"^28.11.0","eslint-plugin-n":"^17.16.2","eslint-plugin-node":"^11.1.0","eslint-plugin-playwright":"^2.2.2","eslint-plugin-promise":"^5.2.0","eslint-plugin-react":"^7.37.4","eslint-plugin-standard":"^5.0.0","fetch-mock-jest":"^1.5.1",glob:"^11.0.1",husky:"^9.1.7",jest:"29.7.0","jest-environment-jsdom":"^29.7.0","lint-staged":"^15.5.0","node-fetch":"^2.7.0","null-loader":"^4.0.1",nx:"19.8.14","nx-remotecache-azure":"^19.0.0","os-browserify":"^0.3.0",prettier:"3.7.4","start-server-and-test":"^2.0.11",storybook:"^8.6.15",typescript:"^5.8.2",vite:"^4.3.9",vitest:"^4.0.17","webpack-merge":"^6.0.1"},d="yarn@4.7.0",m={node:"24.x"},y={},u={name:e,version:t,private:!0,license:s,type:r,main:o,workspaces:i,scripts:l,"lint-staged":{"*.js":["eslint --fix","prettier --check"],"*.{json,md,css,ts,tsx,jsx}":["prettier --check"]},browserslist:a,resolutions:n,dependencies:c,devDependencies:p,packageManager:d,engines:m,nx:y};export{a as browserslist,u as default,c as dependencies,p as devDependencies,m as engines,s as license,o as main,e as name,y as nx,d as packageManager,n as resolutions,l as scripts,r as type,t as version,i as workspaces};
1
+ var e="web-engine",t="3.3.754",s="UNLICENSED",r="module",o="src/main.js",i=["demo","deploy","nodesdk","src/extModules/flexapi","services/*","libraries/*"],l={colors:"cat utils/colors1.txt && node utils/processColors.js | pbcopy && cat utils/colors2.txt","cypress:comp":"cypress open --component --browser chrome","cypress:comp:ci":"cypress run --component",demo:"cd demo/ && yarn start",dev:"yarn mol e2e","format:check":"yarn prettier . --check","format:fix":"yarn prettier . --write",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh","icons:convert":"node scripts/convertSvgToJsx.mjs",lint:"eslint .",mod:"demo/startMod.sh",mol:"demo/startMol.sh","mol:build":"demo/startMolBuild.sh",molProd:"cd deploy && yarn buildAndRunMol","playwright:ci":"yarn playwright test --grep-invert sdk","playwright:ci:failed":"yarn playwright test --last-failed --grep-invert sdk","playwright:sdk":"yarn start-server-and-test 'cd ./deploy && yarn buildDev && yarn serveLocal' 8085 'cd ./test/sdk && npx http-server' 8080 'yarn playwright test sdk --ui'","playwright:ui":"yarn playwright test --ui --grep-invert sdk",prepare:"husky",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch","test:all":"yarn lint && yarn format:check && yarn test && yarn test:vitest && yarn cypress:comp:ci && yarn playwright:ci","test:mod":"playwright test --config=playwright.mod.config.ts","test:vitest":"vitest run",typecheck:"tsc -p tsconfig.checkjs.json",storybook:"storybook dev -p 6006","build-storybook":"storybook build"},a=["defaults"],n={react:"^18.3.1"},c={"@azure/event-hubs":"^5.12.2","@csstools/normalize.css":"^11.0.1","@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@locus-labs/mod-badge":"^0.1.102","@locus-labs/mod-footer":"^0.0.111","@locus-labs/mod-header":"^0.0.105","@locus-labs/mod-location-marker":"^0.0.104","@locus-labs/mod-map-legend":"^0.0.104","@locus-labs/mod-offscreen-indicator":"^0.0.104","@locus-labs/mod-pin":"^0.0.104","@locus-labs/mod-qr-code-card":"^0.0.104","@locus-labs/mod-qr-code-window":"^0.0.105","@locus-labs/mod-walk-time-matrix":"^0.0.103","@mapbox/mapbox-gl-draw":"^1.5.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@microsoft/applicationinsights-web":"^3.3.6","@turf/area":"^7.2.0","@turf/bbox-clip":"^7.2.0","@turf/bbox-polygon":"^7.2.0","@turf/bearing":"^7.2.0","@turf/circle":"^7.2.0","@turf/helpers":"^7.2.0","@turf/point-to-line-distance":"^7.2.0","@vitejs/plugin-react":"^4.3.4","axe-core":"^4.10.3",browserslist:"^4.27.0","crypto-browserify":"^3.12.1","cypress-multi-reporters":"^2.0.5","cypress-real-events":"^1.14.0","file-loader":"^6.2.0",flexsearch:"^0.7.43","h3-js":"^4.1.0",i18next:"^20.6.1","i18next-browser-languagedetector":"^6.1.1","jest-transform-css":"6.0.2",jsdom:"^25.0.1",jsonschema:"^1.5.0",luxon:"^3.5.0","maplibre-gl":"^4.7.1","mini-css-extract-plugin":"^2.9.2","mocha-junit-reporter":"^2.2.1",mochawesome:"^7.1.3","node-polyfill-webpack-plugin":"^4.1.0","path-browserify":"^1.0.1","prop-types":"^15.8.1","qrcode.react":"^4.2.0",ramda:"^0.30.1",react:"^18.3.1","react-compound-slider":"^3.4.0","react-dom":"^18.3.1","react-json-editor-ajrm":"^2.5.14","react-svg":"^16.3.0","react-virtualized-auto-sizer":"^1.0.25","react-window":"^1.8.11","smoothscroll-polyfill":"^0.4.4","styled-components":"^6.1.15","styled-normalize":"^8.1.1","throttle-debounce":"^5.0.2",trackjs:"^3.10.4","ua-parser-js":"^0.7.40",uuid:"11.1.0",zousan:"^3.0.1","zousan-plus":"^4.0.1"},p={"@applitools/eyes-playwright":"^1.44.1","@axe-core/playwright":"^4.10.2","@azure/identity":"^4.13.0","@azure/playwright":"^1.0.0","@babel/core":"^7.26.10","@babel/eslint-parser":"^7.26.10","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-assertions":"^7.26.0","@babel/plugin-transform-modules-commonjs":"^7.26.3","@babel/plugin-transform-runtime":"^7.26.10","@babel/preset-env":"^7.26.9","@babel/preset-react":"^7.26.3","@playwright/test":"^1.56.0","@storybook/addon-essentials":"^8.6.15","@storybook/blocks":"^8.6.15","@storybook/react":"^8.6.15","@storybook/react-vite":"^8.6.15","@testing-library/jest-dom":"^6.6.3","@types/react":"^19.0.10","@types/react-dom":"^19.0.4","@typescript-eslint/eslint-plugin":"^8.26.1","@typescript-eslint/parser":"^8.26.1","babel-jest":"^29.7.0","babel-loader":"^10.0.0","babel-plugin-inline-json-import":"^0.3.2","babel-plugin-module-resolver":"^5.0.2","babel-plugin-styled-components":"^2.1.4","chai-colors":"^1.0.1","css-loader":"^7.1.2",cypress:"^14.2.0","cypress-wait-until":"^3.0.2",eslint:"^8.57.1","eslint-config-prettier":"^10.1.8","eslint-config-standard":"^17.1.0","eslint-import-resolver-alias":"^1.1.2","eslint-import-resolver-typescript":"^3.9.1","eslint-plugin-cypress":"^2.15.2","eslint-plugin-import":"^2.31.0","eslint-plugin-jest":"^28.11.0","eslint-plugin-n":"^17.16.2","eslint-plugin-node":"^11.1.0","eslint-plugin-playwright":"^2.2.2","eslint-plugin-promise":"^5.2.0","eslint-plugin-react":"^7.37.4","eslint-plugin-standard":"^5.0.0","fetch-mock-jest":"^1.5.1",glob:"^11.0.1",husky:"^9.1.7",jest:"29.7.0","jest-environment-jsdom":"^29.7.0","lint-staged":"^15.5.0","node-fetch":"^2.7.0","null-loader":"^4.0.1",nx:"19.8.14","nx-remotecache-azure":"^19.0.0","os-browserify":"^0.3.0",prettier:"3.7.4","start-server-and-test":"^2.0.11",storybook:"^8.6.15",typescript:"^5.8.2",vite:"^4.3.9",vitest:"^4.0.17","webpack-merge":"^6.0.1"},d="yarn@4.7.0",m={node:"24.x"},y={},u={name:e,version:t,private:!0,license:s,type:r,main:o,workspaces:i,scripts:l,"lint-staged":{"*.js":["eslint --fix","prettier --check"],"*.{json,md,css,ts,tsx,jsx}":["prettier --check"]},browserslist:a,resolutions:n,dependencies:c,devDependencies:p,packageManager:d,engines:m,nx:y};export{a as browserslist,u as default,c as dependencies,p as devDependencies,m as engines,s as license,o as main,e as name,y as nx,d as packageManager,n as resolutions,l as scripts,r as type,t as version,i as workspaces};
@@ -1 +1 @@
1
- import{pick as t,isNil as o,map as n,omit as e,path as r}from"ramda";import{encode as i,calculateAdjacent as s}from"../../../src/extModules/geohasher.js";import{distance as l}from"../../../src/utils/geodesy.js";import u from"./minPriorityQueue.js";function d(r,s,l,u){const d={},c={},a=new Set;let h={};r.nodes.forEach(o=>{const n=s(o.floorId),e=l(o.floorId);!function(t){const o=t.floorId+":"+i(t.lat,t.lng).substr(0,7),n=t.floorId+":"+i(t.lat,t.lng).substr(0,8);c[o]||(c[o]=[]);c[o].push(t),c[n]||(c[n]=[]);c[n].push(t),d[t.id]=t}({...t(["id","lat","lng","floorId"],o),edges:[],ordinal:n,structureId:e})}),r.edges.forEach(t=>d[t.s].edges.push(function(t,n){const e=function(t){if(t.x)return"Security Checkpoint";if(""===t.t)return"Ground";return t.t}(t),r=e.toLowerCase(),i="escalator"!==r&&"stairs"!==r,s=f(t.s,t.d,n),l=t.l||s/60,u=t=>t.map(t=>({start:{lat:t.s[0],lng:t.s[1]},out:{lat:t.o[0],lng:t.o[1]},in:{lat:t.i[0],lng:t.i[1]},end:{lat:t.e[0],lng:t.e[1]}})),d=t.p?u(t.p):null;return{distance:s,dst:t.d,o:t.o,isAccessible:i,isDriveway:!o(t.h)&&!t.h,src:t.s,transitTime:l,type:e,path:d,weight:l}}(t,d)));const p=t=>{if(void 0===t.floorId&&void 0===t.ordinal)throw Error("Endpoint specified in findRoute without floorId nor an ordinal");const o=t.lat||t.latitude,n=t.lng||t.longitude;return t.floorId?w(t.floorId,o,n,c,d):T(t.ordinal,o,n,d)};return{_nodes:d,_geoDb:c,_nodesToAvoid:a,addNodesToAvoid:t=>function(t){a.clear(),t.forEach(t=>a.add(t))}(t),findClosestNode:(t,o,n)=>w(t,o,n,c,d),findShortestPath:(t,o,n)=>function(t,o,n,e={}){return I(p(t),p(o),n,a,h,u,e)}(t,o,d,n),findAllShortestPaths:function(t,o,n){const e=p(t),r=o.map(t=>p(t));return e&&r.length?function(t,o,n,e,r={},i={},s={}){return o.map(o=>{try{return I(t,o,n,e,r,i,s)}catch(t){return null}})}(e,r,d,a,h,u,n):[]},floorIdToOrdinal:s,floorIdToStructureId:l,updateWithSecurityWaitTime:function(t){h=n(e(["lastUpdated"]),t),y()},clearCache:y}}function f(t,o,n){const e=n[t],r=n[o];return l(e.lat,e.lng,r.lat,r.lng)}let c,a,h,p,g,m;const y=()=>{c={},a={},h={},p=new u,g=null,m={}};function I(t,o,n,e,i={},s={},l={}){for(t.id===g&&m===JSON.stringify(l)||(y(),p.offerWithPriority(t.id,0),c[t.id]=0,h[t.id]=!0,g=t.id,m=JSON.stringify(l));!p.isEmpty()&&!h[o.id];){const t=n[p.poll()],o=c[t.id];for(let n=0;n<t.edges.length;n++){const u=t.edges[n];if(e.size>0&&e.has(u.dst))continue;if(h[u.dst])continue;if(l.requiresAccessibility&&!u.isAccessible)continue;let d=u.weight;if(u.o&&i[u.o]){const t=i[u.o];t.queueTime&&(d=t.queueTime),t.isTemporarilyClosed&&(d=9999),u.securityWaitTimes=t}if(u.o&&s[u.o]){u.securityLane=s[u.o];const{type:t,id:o}=s[u.o],n=r(["selectedSecurityLanes",t],l);if(n&&!n.includes(o))continue}void 0===c[u.dst]?(a[u.dst]=t,c[u.dst]=o+d,p.offerWithPriority(u.dst,o+d)):c[u.dst]>o+d&&(c[u.dst]=o+d,a[u.dst]=t,p.raisePriority(u.dst,o+d))}h[t.id]=!0}if(!h[o.id])return null;const u=[];let d=o;for(;d;)u.push(d),d=a[d.id];return u.reverse()}function b(t,o,n,e){const r=o.substr(0,e),i=[];i.push(t+":"+s(s(r,"top"),"left")),i.push(t+":"+s(r,"top")),i.push(t+":"+s(s(r,"top"),"right")),i.push(t+":"+s(r,"left")),i.push(t+":"+r),i.push(t+":"+s(r,"right")),i.push(t+":"+s(s(r,"bottom"),"left")),i.push(t+":"+s(r,"bottom")),i.push(t+":"+s(s(r,"bottom"),"right"));const l=[];for(let t=0;t<i.length;t++){const o=n[i[t]];if(o)for(let t=0;t<o.length;t++)l.push(o[t])}return l}function w(t,o,n,e,r){const s=function(t,o,n){let e=b(t,o,n,8);return e.length>0?e:(e=b(t,o,n,7),e.length>0?e:null)}(t,i(o,n),e)||function(t,o,n,e){const r=Object.values(e).filter(o=>o.floorId===t).map(t=>[t,l(t.lat,t.lng,o,n)]);if(!r.length)throw Error(`findClosestNodeByFloor2 found no nodes on floor ${t}`);return v(r)}(t,o,n,r),u=[];for(let t=0;t<s.length;t++){const e=l(o,n,s[t].lat,s[t].lng);u.push([s[t],e])}u.sort(function(t,o){return t[1]-o[1]});const d=[];for(let t=0;t<u.length;t++)d.push(u[t][0]);return d[0]}function T(t,o,n,e){const r=Object.values(e).filter(o=>o.ordinal===t).map(t=>[t,l(t.lat,t.lng,o,n)]);if(!r.length)throw Error(`findClosestNodeByOrdinal found no nodes on ordinal ${t}`);return v(r)}function v(t){let o=t[0];for(let n=1;n<t.length;n++)t[n][1]<o[1]&&(o=t[n]);return o[0]}export{d as createNavGraph,T as findClosestNodeByOrdinal,I as findShortestPath};
1
+ import{pick as t,isNil as o,map as n,omit as e,path as r}from"ramda";import{distance as i}from"../../../src/utils/geodesy.js";import{encode as s,calculateAdjacent as l}from"../../../src/extModules/geohasher.js";import u from"./minPriorityQueue.js";function d(r,i,l,u){const d={},c={},a=new Set;let h={};r.nodes.forEach(o=>{const n=i(o.floorId),e=l(o.floorId);!function(t){const o=t.floorId+":"+s(t.lat,t.lng).substr(0,7),n=t.floorId+":"+s(t.lat,t.lng).substr(0,8);c[o]||(c[o]=[]);c[o].push(t),c[n]||(c[n]=[]);c[n].push(t),d[t.id]=t}({...t(["id","lat","lng","floorId"],o),edges:[],ordinal:n,structureId:e})}),r.edges.forEach(t=>d[t.s].edges.push(function(t,n){const e=function(t){if(t.x)return"Security Checkpoint";if(""===t.t)return"Ground";return t.t}(t),r=e.toLowerCase(),i="escalator"!==r&&"stairs"!==r,s=f(t.s,t.d,n),l=t.l||s/60,u=t=>t.map(t=>({start:{lat:t.s[0],lng:t.s[1]},out:{lat:t.o[0],lng:t.o[1]},in:{lat:t.i[0],lng:t.i[1]},end:{lat:t.e[0],lng:t.e[1]}})),d=t.p?u(t.p):null;return{distance:s,dst:t.d,o:t.o,isAccessible:i,isDriveway:!o(t.h)&&!t.h,src:t.s,transitTime:l,type:e,path:d,weight:l}}(t,d)));const p=t=>{if(void 0===t.floorId&&void 0===t.ordinal)throw Error("Endpoint specified in findRoute without floorId nor an ordinal");const o=t.lat||t.latitude,n=t.lng||t.longitude;return t.floorId?w(t.floorId,o,n,c,d):T(t.ordinal,o,n,d)};return{_nodes:d,_geoDb:c,_nodesToAvoid:a,addNodesToAvoid:t=>function(t){a.clear(),t.forEach(t=>a.add(t))}(t),findClosestNode:(t,o,n)=>w(t,o,n,c,d),findShortestPath:(t,o,n)=>function(t,o,n,e={}){return I(p(t),p(o),n,a,h,u,e)}(t,o,d,n),findAllShortestPaths:function(t,o,n){const e=p(t),r=o.map(t=>p(t));return e&&r.length?function(t,o,n,e,r={},i={},s={}){return o.map(o=>{try{return I(t,o,n,e,r,i,s)}catch(t){return null}})}(e,r,d,a,h,u,n):[]},floorIdToOrdinal:i,floorIdToStructureId:l,updateWithSecurityWaitTime:function(t){h=n(e(["lastUpdated"]),t),y()},clearCache:y}}function f(t,o,n){const e=n[t],r=n[o];return i(e.lat,e.lng,r.lat,r.lng)}let c,a,h,p,g,m;const y=()=>{c={},a={},h={},p=new u,g=null,m={}};function I(t,o,n,e,i={},s={},l={}){for(t.id===g&&m===JSON.stringify(l)||(y(),p.offerWithPriority(t.id,0),c[t.id]=0,h[t.id]=!0,g=t.id,m=JSON.stringify(l));!p.isEmpty()&&!h[o.id];){const t=n[p.poll()],o=c[t.id];for(let n=0;n<t.edges.length;n++){const u=t.edges[n];if(e.size>0&&e.has(u.dst))continue;if(h[u.dst])continue;if(l.requiresAccessibility&&!u.isAccessible)continue;let d=u.weight;if(u.o&&i[u.o]){const t=i[u.o];t.queueTime&&(d=t.queueTime),t.isTemporarilyClosed&&(d=9999),u.securityWaitTimes=t}if(u.o&&s[u.o]){u.securityLane=s[u.o];const{type:t,id:o}=s[u.o],n=r(["selectedSecurityLanes",t],l);if(n&&!n.includes(o))continue}void 0===c[u.dst]?(a[u.dst]=t,c[u.dst]=o+d,p.offerWithPriority(u.dst,o+d)):c[u.dst]>o+d&&(c[u.dst]=o+d,a[u.dst]=t,p.raisePriority(u.dst,o+d))}h[t.id]=!0}if(!h[o.id])return null;const u=[];let d=o;for(;d;)u.push(d),d=a[d.id];return u.reverse()}function b(t,o,n,e){const r=o.substr(0,e),i=[];i.push(t+":"+l(l(r,"top"),"left")),i.push(t+":"+l(r,"top")),i.push(t+":"+l(l(r,"top"),"right")),i.push(t+":"+l(r,"left")),i.push(t+":"+r),i.push(t+":"+l(r,"right")),i.push(t+":"+l(l(r,"bottom"),"left")),i.push(t+":"+l(r,"bottom")),i.push(t+":"+l(l(r,"bottom"),"right"));const s=[];for(let t=0;t<i.length;t++){const o=n[i[t]];if(o)for(let t=0;t<o.length;t++)s.push(o[t])}return s}function w(t,o,n,e,r){const l=function(t,o,n){let e=b(t,o,n,8);return e.length>0?e:(e=b(t,o,n,7),e.length>0?e:null)}(t,s(o,n),e)||function(t,o,n,e){const r=Object.values(e).filter(o=>o.floorId===t).map(t=>[t,i(t.lat,t.lng,o,n)]);if(!r.length)throw Error(`findClosestNodeByFloor2 found no nodes on floor ${t}`);return v(r)}(t,o,n,r),u=[];for(let t=0;t<l.length;t++){const e=i(o,n,l[t].lat,l[t].lng);u.push([l[t],e])}u.sort(function(t,o){return t[1]-o[1]});const d=[];for(let t=0;t<u.length;t++)d.push(u[t][0]);return d[0]}function T(t,o,n,e){const r=Object.values(e).filter(o=>o.ordinal===t).map(t=>[t,i(t.lat,t.lng,o,n)]);if(!r.length)throw Error(`findClosestNodeByOrdinal found no nodes on ordinal ${t}`);return v(r)}function v(t){let o=t[0];for(let n=1;n<t.length;n++)t[n][1]<o[1]&&(o=t[n]);return o[0]}export{d as createNavGraph,T as findClosestNodeByOrdinal,I as findShortestPath};
package/dist/src/app.js CHANGED
@@ -1 +1 @@
1
- import{map as e,mergeDeepRight as t}from"ramda";import n from"zousan-plus";import o from"../package.json.js";import i from"./debugTools.js";import{buildEnv as a}from"./env.js";import{create as r}from"./extModules/bustle.js";import{initLog as s}from"./extModules/log.js";import l from"./utils/i18n.js";import{startInitialStateListener as u}from"./utils/isInitialState.js";const c="undefined"!=typeof window;async function g(e,t,n){let o=t;if(o.includes("/")){const e=o.split("/");o=e[e.length-1]}return void 0!==n.active&&(!1===n.active||"notLocalhost"===n.active&&e.env.isLocalhost())?(e.log.info(`Plugin ${t} explicitly deativated`),null):import(`../plugins/${t}/src/${o}.js`).then(o=>(e.log.info(`Creating plugin ${t}`),o.create(e,n)))}async function d(e){return c?import(`./configs/${e}.json`):import(`./configs/${e}.json.js`)}async function p(e,n){let o={};const i=await Promise.all(n.map(d));for(const e of i){let n=e.default;n=n.extends?await p(n,n.extends):n,o=t(o,n)}return o=t(o,e),o}const m=e=>t=>import(`./configs/postproc-${e}.js`).then(e=>e.process(t));async function f(t){const d=Object.create(null);let f=t.extends?await p(t,t.extends):t;f.plugins.monitoring&&await import("../_virtual/_empty_module_placeholder.js").then(e=>e.activate(f.plugins.monitoring)),f=await(async e=>e.configPostProc?n.series(e,...e.configPostProc.map(m)):e)(f);const h=(e=>{const t=e.supportedLanguages||["am","ar","de","el-GR","en","es","fr","hi","is","it","ja","ko","pl","pt","ru","so","th","zh-Hans","zh-Hant"];if("undefined"!=typeof window){let e=new URLSearchParams(location.search).get("lang")||navigator.language;for(;e;){if(e&&t.includes(e))return e;e=e.substring(0,e.lastIndexOf("-"))}}return e.defaultLanguage||"en"})(f),w=await l(h,{debug:f.debug});d.i18n=()=>w,d.gt=()=>w.t.bind(w),d.config=f,d.plugins={};const y=s("web-engine",{enabled:!!f.debug,isBrowser:c,color:"cyan",logFilter:f.logFilter,truncateObjects:!c,trace:false});if(d.log=y.sublog(f.name),d.bus=r({showEvents:!0,reportAllErrors:!0,log:y}),d.info={wePkg:o},"undefined"!=typeof window&&(f.debug?(d.debug=e(e=>e.bind(d),i),i.dndGo.call(d)):d.debug={},window._app=d,window.document&&window.document.title&&f.setWindowTitle&&(document.title=f.name)),d.env=a(d),f.theme?await n.evaluate({name:"ThemeManagerModule",value:import("../_virtual/_empty_module_placeholder.js")},{name:"HistoryManager",value:import("./historyManager.js")},{name:"LayerManager",value:import("../_virtual/_empty_module_placeholder.js")}).then(async({LayerManager:e,HistoryManager:t,ThemeManagerModule:n})=>{const o=n.initThemeManager(d);d.themePack=await o.buildTheme(f.theme,f.defaultTheme),u(),e.initLayerManager(d),t.initHistoryManager(d),d.destroy=()=>e.destroy(d)}):d.destroy=()=>{},f.plugins){for(const e in f.plugins)try{const t=f.plugins[e];if(d.plugins[e])throw Error(`Duplicate plugin name "${e}"`);const n=await g(d,e,t);n&&(d.plugins[e]=n)}catch(t){y.error("Error instantiating plugin "+e),y.error(t)}for(const e in d.plugins)d.plugins[e].init()}return d}export{f as create};
1
+ import{map as e,mergeDeepRight as t}from"ramda";import n from"zousan-plus";import o from"./utils/i18n.js";import{startInitialStateListener as i}from"./utils/isInitialState.js";import a from"../package.json.js";import r from"./debugTools.js";import{buildEnv as s}from"./env.js";import{create as l}from"./extModules/bustle.js";import{initLog as u}from"./extModules/log.js";const c="undefined"!=typeof window;async function g(e,t,n){let o=t;if(o.includes("/")){const e=o.split("/");o=e[e.length-1]}return void 0!==n.active&&(!1===n.active||"notLocalhost"===n.active&&e.env.isLocalhost())?(e.log.info(`Plugin ${t} explicitly deativated`),null):import(`../plugins/${t}/src/${o}.js`).then(o=>(e.log.info(`Creating plugin ${t}`),o.create(e,n)))}async function d(e){return c?import(`./configs/${e}.json`):import(`./configs/${e}.json.js`)}async function p(e,n){let o={};const i=await Promise.all(n.map(d));for(const e of i){let n=e.default;n=n.extends?await p(n,n.extends):n,o=t(o,n)}return o=t(o,e),o}const m=e=>t=>import(`./configs/postproc-${e}.js`).then(e=>e.process(t));async function f(t){const d=Object.create(null);let f=t.extends?await p(t,t.extends):t;f.plugins.monitoring&&await import("../_virtual/_empty_module_placeholder.js").then(e=>e.activate(f.plugins.monitoring)),f=await(async e=>e.configPostProc?n.series(e,...e.configPostProc.map(m)):e)(f);const h=(e=>{const t=e.supportedLanguages||["am","ar","de","el-GR","en","es","fr","hi","is","it","ja","ko","pl","pt","ru","so","th","zh-Hans","zh-Hant"];if("undefined"!=typeof window){let e=new URLSearchParams(location.search).get("lang")||navigator.language;for(;e;){if(e&&t.includes(e))return e;e=e.substring(0,e.lastIndexOf("-"))}}return e.defaultLanguage||"en"})(f),w=await o(h,{debug:f.debug});d.i18n=()=>w,d.gt=()=>w.t.bind(w),d.config=f,d.plugins={};const y=u("web-engine",{enabled:!!f.debug,isBrowser:c,color:"cyan",logFilter:f.logFilter,truncateObjects:!c,trace:false});if(d.log=y.sublog(f.name),d.bus=l({showEvents:!0,reportAllErrors:!0,log:y}),d.info={wePkg:a},"undefined"!=typeof window&&(f.debug?(d.debug=e(e=>e.bind(d),r),r.dndGo.call(d)):d.debug={},window._app=d,window.document&&window.document.title&&f.setWindowTitle&&(document.title=f.name)),d.env=s(d),f.theme?await n.evaluate({name:"ThemeManagerModule",value:import("../_virtual/_empty_module_placeholder.js")},{name:"HistoryManager",value:import("./historyManager.js")},{name:"LayerManager",value:import("../_virtual/_empty_module_placeholder.js")}).then(async({LayerManager:e,HistoryManager:t,ThemeManagerModule:n})=>{const o=n.initThemeManager(d);d.themePack=await o.buildTheme(f.theme,f.defaultTheme),i(),e.initLayerManager(d),t.initHistoryManager(d),d.destroy=()=>e.destroy(d)}):d.destroy=()=>{},f.plugins){for(const e in f.plugins)try{const t=f.plugins[e];if(d.plugins[e])throw Error(`Duplicate plugin name "${e}"`);const n=await g(d,e,t);n&&(d.plugins[e]=n)}catch(t){y.error("Error instantiating plugin "+e),y.error(t)}for(const e in d.plugins)d.plugins[e].init()}return d}export{f as create};
@@ -1 +1 @@
1
- import*as e from"ramda";import{orphanTest as t}from"../plugins/wayfinder/src/navGraphDebug.js";import{$ as n,$$ as s,ad as o,del as a}from"./utils/dom.js";import{singleFile as r}from"./utils/funcs.js";"undefined"!=typeof window&&(window.R=e);const i=(e,t)=>d(()=>t.send(e),t),d=(e,t)=>{const n=t.monitor("homeview/performSearch",({term:t})=>{t||(e(),n())})};async function u(){const e=await this.bus.get("map/getPadding"),t=(e.left-e.right)/2,s=(e.top-e.bottom)/2,r=o({html:'<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path stroke="#fF000080" stroke-width="2" d="M0 50h45M55 50h45M50 0v45M50 55v45"/></svg>',styles:{position:"absolute",left:"50%",top:"50%","margin-left":-50+t+"px","margin-top":-50+s+"px"}},n(".maplibregl-map"));d(()=>a(r),this.bus)}var g={bounds:async function(){const e=await this.bus.get("venueData/getVenueCenter"),{venueRadius:t,bounds:n}=await this.bus.get("venueData/getVenueData");this.bus.send("map/showVenueBounds",{venueCenter:e,venueRadius:t,bounds:n}),i("map/resetVenueBounds",this.bus)},buildingBounds:async function(e){this.bus.send("map/showBuildingBounds",{nameFilter:e}),i("map/resetVenueBounds",this.bus),u.apply(this)},dndGo:function(){const e=this.bus,t=(e,t)=>{e.preventDefault(),t?e.target.classList.add("dragover"):e.target.classList.remove("dragover")},n={drop:async function(n){t(n,!1);for(const t of n.dataTransfer.files){const n=t.name;if("application/json"===t.type||t.type.startsWith("text/")){const s=new FileReader;s.onload=r(async s=>e.send("debugTools/fileDrop",{file:t,filename:n,content:s.target.result})),s.readAsText(t)}}},dragover:function(e){t(e,!0)},dragleave:function(e){t(e,!1)}};Object.keys(n).forEach(function(e){document.body.addEventListener(e,n[e])}),console.log("DnD Listeners installed")},floorBounds:async function(e){const t=this.bus;t.send("map/showFloorBounds",{nameFilter:e}),i("map/resetVenueBounds",t);const n=t.monitor("map/floorChanged",()=>t.send("map/showFloorBounds",{nameFilter:e}));d(n,t),u.apply(this)},getPoiById:function(e){return this.bus.send("poi/getById",{id:e}).then(e=>e[0])},highlightNodes:()=>o({tag:"style",html:"* { background-color: rgba(255,0,0,.2); } * * { background-color: rgba(0,255,0,.2); } * * * { background-color: rgba(0,0,255,.2); } * * * * { background-color: rgba(255,0,255,.2); } * * * * * { background-color: rgba(0,255,255,.2); } * * * * * * { background-color: rgba(255,255,0,.2); } * * * * * * * { background-color: rgba(255,0,0,.2); } * * * * * * * * { background-color: rgba(0,255,0,.2); } * * * * * * * * * { background-color: rgba(0,0,255,.2); }"},n("head")),orphanTest:t,padding:async function(){this.bus.send("map/togglePadding"),i("map/togglePadding",this.bus)},poisByCategory:function(){return this.bus.send("poi/getAll").then(e=>e[0]).then(e=>Object.values(e)).then(e.groupBy(e=>e.category))},showCenter:u,showgraph:async function(){const e=await this.bus.get("wayfinder/getNavGraphFeatures");this.bus.send("map/showNavGraphFeatures",{navGraph:e}),i("map/resetNavGraphFeatures",this.bus)},showIcons:()=>{n("#mapRenderDiv").innerHTML="<style> div { display: inline-block; text-align: center; border: 1px solid lightblue; }</style>"+s("svg symbol").map(e=>`<div><svg><use xlink:href="#${e.id}"/></svg><br/>${e.id}</div>`).join("")},showOrphaned:async function(){const e=await this.bus.get("wayfinder/_getNavGraph"),n=t(e._nodes);this.bus.send("map/showOrphanedGraphNodes",{orphanedNodes:n.orphaned})}};export{g as default};
1
+ import*as e from"ramda";import{$ as t,$$ as n,ad as s,del as o}from"./utils/dom.js";import{singleFile as a}from"./utils/funcs.js";import{orphanTest as r}from"../plugins/wayfinder/src/navGraphDebug.js";"undefined"!=typeof window&&(window.R=e);const i=(e,t)=>d(()=>t.send(e),t),d=(e,t)=>{const n=t.monitor("homeview/performSearch",({term:t})=>{t||(e(),n())})};async function u(){const e=await this.bus.get("map/getPadding"),n=(e.left-e.right)/2,a=(e.top-e.bottom)/2,r=s({html:'<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path stroke="#fF000080" stroke-width="2" d="M0 50h45M55 50h45M50 0v45M50 55v45"/></svg>',styles:{position:"absolute",left:"50%",top:"50%","margin-left":-50+n+"px","margin-top":-50+a+"px"}},t(".maplibregl-map"));d(()=>o(r),this.bus)}var g={bounds:async function(){const e=await this.bus.get("venueData/getVenueCenter"),{venueRadius:t,bounds:n}=await this.bus.get("venueData/getVenueData");this.bus.send("map/showVenueBounds",{venueCenter:e,venueRadius:t,bounds:n}),i("map/resetVenueBounds",this.bus)},buildingBounds:async function(e){this.bus.send("map/showBuildingBounds",{nameFilter:e}),i("map/resetVenueBounds",this.bus),u.apply(this)},dndGo:function(){const e=this.bus,t=(e,t)=>{e.preventDefault(),t?e.target.classList.add("dragover"):e.target.classList.remove("dragover")},n={drop:async function(n){t(n,!1);for(const t of n.dataTransfer.files){const n=t.name;if("application/json"===t.type||t.type.startsWith("text/")){const s=new FileReader;s.onload=a(async s=>e.send("debugTools/fileDrop",{file:t,filename:n,content:s.target.result})),s.readAsText(t)}}},dragover:function(e){t(e,!0)},dragleave:function(e){t(e,!1)}};Object.keys(n).forEach(function(e){document.body.addEventListener(e,n[e])}),console.log("DnD Listeners installed")},floorBounds:async function(e){const t=this.bus;t.send("map/showFloorBounds",{nameFilter:e}),i("map/resetVenueBounds",t);const n=t.monitor("map/floorChanged",()=>t.send("map/showFloorBounds",{nameFilter:e}));d(n,t),u.apply(this)},getPoiById:function(e){return this.bus.send("poi/getById",{id:e}).then(e=>e[0])},highlightNodes:()=>s({tag:"style",html:"* { background-color: rgba(255,0,0,.2); } * * { background-color: rgba(0,255,0,.2); } * * * { background-color: rgba(0,0,255,.2); } * * * * { background-color: rgba(255,0,255,.2); } * * * * * { background-color: rgba(0,255,255,.2); } * * * * * * { background-color: rgba(255,255,0,.2); } * * * * * * * { background-color: rgba(255,0,0,.2); } * * * * * * * * { background-color: rgba(0,255,0,.2); } * * * * * * * * * { background-color: rgba(0,0,255,.2); }"},t("head")),orphanTest:r,padding:async function(){this.bus.send("map/togglePadding"),i("map/togglePadding",this.bus)},poisByCategory:function(){return this.bus.send("poi/getAll").then(e=>e[0]).then(e=>Object.values(e)).then(e.groupBy(e=>e.category))},showCenter:u,showgraph:async function(){const e=await this.bus.get("wayfinder/getNavGraphFeatures");this.bus.send("map/showNavGraphFeatures",{navGraph:e}),i("map/resetNavGraphFeatures",this.bus)},showIcons:()=>{t("#mapRenderDiv").innerHTML="<style> div { display: inline-block; text-align: center; border: 1px solid lightblue; }</style>"+n("svg symbol").map(e=>`<div><svg><use xlink:href="#${e.id}"/></svg><br/>${e.id}</div>`).join("")},showOrphaned:async function(){const e=await this.bus.get("wayfinder/_getNavGraph"),t=r(e._nodes);this.bus.send("map/showOrphanedGraphNodes",{orphanedNodes:t.orphaned})}};export{g as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atriusmaps-node-sdk",
3
- "version": "3.3.752",
3
+ "version": "3.3.754",
4
4
  "description": "This project provides an API to Atrius Personal Wayfinder maps within a Node environment. See the README.md for more information",
5
5
  "keywords": [
6
6
  "map",