atriusmaps-node-sdk 3.3.917 → 3.3.919

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.
@@ -1 +1 @@
1
- var t="web-engine",e="3.3.917",s="UNLICENSED",r="module",o="src/main.ts",i=["demo","deploy","nodesdk","src/extModules/flexapi","services/*","libraries/*"],a={"build-storybook":"storybook build",colors:"cat utils/colors1.txt && node utils/processColors.ts | pbcopy && cat utils/colors2.txt",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 . --ext .js,.jsx,.ts,.tsx",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",storybook:"storybook dev -p 6006",test:"vitest run --project unit","test-watch":"vitest --watch","test:comp":"vitest run --project browser","test:comp:ci":"vitest run --project browser --reporter=dot","test:comp:ui":"VITE_COMP_UI=1 vitest --project browser --ui --browser.headless=false","test:all":"yarn lint && yarn format:check && yarn test && yarn playwright:ci","test:mod":"playwright test --config=playwright.mod.config.ts",typecheck:"tsc -p tsconfig.checkjs.json","typecheck:strict":"tsc -p tsconfig.strict.json"},l=["defaults"],n={"@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","@mapbox/mapbox-gl-draw":"^1.5.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@microsoft/applicationinsights-web":"^3.3.6","@styled-system/prop-types":"^5.1.5","@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":"^5.2.0","@zumer/snapdom":"^2.9.0","axe-core":"^4.10.3",browserslist:"^4.27.0","crypto-browserify":"^3.12.1",dompurify:"^3.3.3","file-loader":"^6.2.0",flexsearch:"^0.7.43","h3-js":"^4.1.0",i18next:"^26.0.0","i18next-browser-languagedetector":"^6.1.1",jsdom:"^25.0.1",jsonschema:"^1.5.0",luxon:"^3.5.0","maplibre-gl":"^4.7.1","mini-css-extract-plugin":"^2.9.2","node-polyfill-webpack-plugin":"^4.1.0","path-browserify":"^1.0.1",pmtiles:"^4.4.0","prop-types":"^15.8.1","qrcode.react":"^4.2.0",ramda:"^0.32.0",react:"^19.2.4","react-compound-slider":"^3.4.0","react-dom":"^19.2.4","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","styled-system":"^5.1.5","styled-tools":"^1.7.2","throttle-debounce":"^5.0.2","ua-parser-js":"^0.7.40",uuid:"^11.1.0",zousan:"^3.0.1","zousan-plus":"^4.0.1"},c={"@axe-core/playwright":"^4.10.2","@azure/identity":"^4.13.0","@azure/playwright":"^1.0.0","@playwright/test":"~1.59.1","@rollup/plugin-typescript":"^12.3.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/dom":"^10.4.1","@testing-library/jest-dom":"^6.6.3","@testing-library/react":"^16.3.0","@testing-library/user-event":"^14.5.2","@types/luxon":"^3.7.2","@types/react":"^19.0.10","@types/react-dom":"^19.0.4","@types/styled-system":"^5.1.25","@typescript-eslint/eslint-plugin":"^8.26.1","@typescript-eslint/parser":"^8.26.1","@vitest/browser":"4.1.6","@vitest/browser-playwright":"4.1.6","@vitest/ui":"4.1.6","css-loader":"^7.1.2",eslint:"^8.57.1","eslint-config-prettier":"^10.1.8","eslint-import-resolver-alias":"^1.1.2","eslint-plugin-playwright":"^2.2.2","eslint-plugin-react":"^7.37.4","eslint-plugin-vitest":"^0.5.4","fetch-mock":"^12.6.0",glob:"^11.0.1",husky:"^9.1.7","lint-staged":"^16.4.0","node-fetch":"^2.7.0",nx:"19.8.14","nx-remotecache-azure":"^19.0.0","os-browserify":"^0.3.0",prettier:"^3.8.3","rollup-plugin-esbuild":"^6.2.1","start-server-and-test":"^2.0.11",storybook:"^8.6.15",typescript:"^5.8.2",vite:"^7.3.2",vitest:"^4.1.8","webpack-merge":"^6.0.1"},p="yarn@4.13.0",d={node:"24.x"},y={},u={name:t,version:e,private:!0,license:s,type:r,main:o,workspaces:i,scripts:a,"lint-staged":{"*.{js,ts,tsx}":["eslint --fix","prettier --check"],"*.{json,md,css,ts,tsx,jsx}":["prettier --check"],"src/i18n/**/*.json":["node utils/sort-json.ts","prettier --write"]},browserslist:l,dependencies:n,devDependencies:c,packageManager:p,engines:d,nx:y};export{l as browserslist,u as default,n as dependencies,c as devDependencies,d as engines,s as license,o as main,t as name,y as nx,p as packageManager,a as scripts,r as type,e as version,i as workspaces};
1
+ var t="web-engine",e="3.3.919",s="UNLICENSED",r="module",o="src/main.ts",i=["demo","deploy","nodesdk","src/extModules/flexapi","services/*","libraries/*"],l={"build-storybook":"storybook build",colors:"cat utils/colors1.txt && node utils/processColors.ts | pbcopy && cat utils/colors2.txt",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 . --ext .js,.jsx,.ts,.tsx",mod:"demo/startMod.sh",mol:"demo/startMol.sh","mol:build":"demo/startMolBuild.sh","mol:preview":"demo/startMolPreview.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",storybook:"storybook dev -p 6006",test:"vitest run --project unit","test:all":"yarn lint && yarn format:check && yarn test && yarn playwright:ci","test:comp":"vitest run --project browser","test:comp:ci":"vitest run --project browser --reporter=dot","test:comp:ui":"VITE_COMP_UI=1 vitest --project browser --ui --browser.headless=false","test:mod":"playwright test --config=playwright.mod.config.ts","test-watch":"vitest --watch",typecheck:"tsc -p tsconfig.checkjs.json","typecheck:strict":"tsc -p tsconfig.strict.json"},a=["defaults"],n={"@swc/core":"1.15.40","@swc/plugin-styled-components":"12.14.0",vite:"7.3.2"},p={"@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","@fontsource/roboto":"^5.2.10","@mapbox/mapbox-gl-draw":"^1.5.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@microsoft/applicationinsights-web":"^3.3.6","@styled-system/prop-types":"^5.1.5","@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":"^5.2.0","@zumer/snapdom":"^2.9.0","axe-core":"^4.10.3",browserslist:"^4.27.0","crypto-browserify":"^3.12.1",dompurify:"^3.3.3",flexsearch:"^0.7.43","h3-js":"^4.1.0",i18next:"^26.0.0","i18next-browser-languagedetector":"^6.1.1",jsdom:"^25.0.1",jsonschema:"^1.5.0",luxon:"^3.5.0","maplibre-gl":"^4.7.1","path-browserify":"^1.0.1",pmtiles:"^4.4.0","prop-types":"^15.8.1","qrcode.react":"^4.2.0",ramda:"^0.32.0",react:"^19.2.4","react-compound-slider":"^3.4.0","react-dom":"^19.2.4","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","styled-system":"^5.1.5","styled-tools":"^1.7.2","throttle-debounce":"^5.0.2","ua-parser-js":"^0.7.40",uuid:"^11.1.0",zousan:"^3.0.1","zousan-plus":"^4.0.1"},c={"@axe-core/playwright":"^4.10.2","@azure/identity":"^4.13.0","@azure/playwright":"^1.0.0","@playwright/test":"~1.59.1","@rollup/plugin-typescript":"^12.3.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/dom":"^10.4.1","@testing-library/jest-dom":"^6.6.3","@testing-library/react":"^16.3.0","@testing-library/user-event":"^14.5.2","@types/luxon":"^3.7.2","@types/react":"^19.0.10","@types/react-dom":"^19.0.4","@types/styled-system":"^5.1.25","@typescript-eslint/eslint-plugin":"^8.26.1","@typescript-eslint/parser":"^8.26.1","@vitest/browser":"4.1.6","@vitest/browser-playwright":"4.1.6","@vitest/ui":"4.1.6",eslint:"^8.57.1","eslint-config-prettier":"^10.1.8","eslint-import-resolver-alias":"^1.1.2","eslint-plugin-playwright":"^2.2.2","eslint-plugin-react":"^7.37.4","eslint-plugin-vitest":"^0.5.4","fetch-mock":"^12.6.0",glob:"^11.0.1",husky:"^9.1.7","lint-staged":"^16.4.0","node-fetch":"^2.7.0",nx:"19.8.14","nx-remotecache-azure":"^19.0.0","os-browserify":"^0.3.0",prettier:"^3.8.3","rollup-plugin-esbuild":"^6.2.1","start-server-and-test":"^2.0.11",storybook:"^8.6.15",typescript:"^5.8.2",vite:"^7.3.2","vite-plugin-node-polyfills":"^0.26.0",vitest:"^4.1.8"},d="yarn@4.13.0",y={node:"24.x"},u={},g={name:t,version:e,private:!0,license:s,type:r,main:o,workspaces:i,scripts:l,"lint-staged":{"*.{js,ts,tsx}":["eslint --fix","prettier --write"],"*":["prettier --write --ignore-unknown"],"src/i18n/**/*.json":["node utils/sort-json.ts","prettier --write"]},browserslist:a,resolutions:n,dependencies:p,devDependencies:c,packageManager:d,engines:y,nx:u};export{a as browserslist,g as default,p as dependencies,c as devDependencies,y as engines,s as license,o as main,t as name,u as nx,d as packageManager,n as resolutions,l as scripts,r as type,e as version,i as workspaces};
@@ -1 +1 @@
1
- import{DateTime as t}from"luxon";import{pick as e,propOr as a,compose as r,path as i,last as l}from"ramda";import{formatTime as o,msToMin as s}from"../../../src/utils/date.js";import{FlightLabelStatus as n}from"../../../utils/constants.js";const m={ARRIVAL:"arr",DEPARTURE:"dep",ALL:"all"};function u(t,e,r,i,l){const{flightId:o,carrierFsCode:s,flightNumber:n,airline:u,flightType:d,departureAirport:g,arrivalAirport:c,airportResources:f,gatePoi:A,status:p}=e,R=E(e),{localTime:v,localOldTime:I}=h(R,i),_=T(d,p,t,v,I),$=d===m.DEPARTURE?"flightDetails:Departs _date_":"flightDetails:Arrives _date_";return{flightId:o,name:`${a("","name",u)} - ${s} ${n}`,status:_,statusText:r(`flightDetails:${L(_)}`),baggageClaim:d===m.ARRIVAL?U(f.arrivalBagClaim,r):void 0,connectionAirport:C(d,g,c,r),time:P(v,i,l),oldTime:P(I,i,l),date:r($,{date:N(v,i,l)}),dateStamp:v.toMillis(),gate:D(A),gateLabel:r("flightDetails:Gate")}}function d(t,r,i,l,o){const{flightNumber:s,flightType:n,departureAirport:u,arrivalAirport:d,airportResources:g,flightStatusUpdates:c,carrierFsCode:p,gatePoi:R,airline:v,status:I}=r,_=e(["city","iata"]),$=E(r),{localTime:y,localOldTime:O}=h($,l),S=T(n,I,t,y,O);return{flightType:n,flightTypeLabel:i(`flightDetails:${n===m.DEPARTURE?"Departure":"Arrival"}`),name:`${a("","name",v)} - ${p} ${s}`,status:S,statusText:i(`flightDetails:${L(S)}`),baggageClaim:n===m.ARRIVAL?U(g.arrivalBagClaim,i):void 0,departure:_(u),arrival:_(d),connectionAirport:C(n,u,d,i),flightIn:f(S,n,t,y,i),time:P(y,l,o),oldTime:P(O,l,o),date:N(y,l,o),lastUpdated:A(t,c,i),flightDuration:"",gateLabel:i("flightDetails:Gate"),gate:D(R),tags:[],flightIconBaseName:n===m.ARRIVAL?"arrivals":"departures"}}const g=(t,e)=>t.dateStamp-e.dateStamp,c=/[A-Z]?\d+[a-zA-Z]?/,D=t=>{if(!t)return{name:"-"};const e=t.name.match(c),a=e?e[0]:t.name;return{...t,name:a}},f=(t,e,a,r,i)=>{if(t===n.DEPARTED)return i("flightDetails:Departed");if(t===n.ARRIVED)return i("flightDetails:Arrived");if(t===n.CANCELLED)return null;return i(`flightDetails:${e===m.DEPARTURE?"Departs":"Arrives"} in _minutes_ minute`,{count:p(a,r)})},A=(t,e,a)=>{const o=r(i(["updatedAt","dateUtc"]),l)(e),s=p(t,_(o));return s<10?a("flightDetails:Last updated a few minutes ago"):s<60?a("flightDetails:Last updated _minutes_ minutes ago",{minutes:s}):a("flightDetails:Last updated over an hour ago")},p=(t,e)=>{const a=Math.abs(t-e);return s(a)},E=({flightType:t,operationalTimes:e,departureDate:a,arrivalDate:r})=>t===m.DEPARTURE?R(a,e.estimatedGateDeparture):R(r,e.estimatedGateArrival),R=(t,e)=>{const a=t.dateLocal||t.dateUtc,r=e.dateLocal||e.dateUtc;return r&&a!==r?{time:r,oldTime:a}:{time:a}},h=({time:t,oldTime:e},a)=>({localTime:_(t,a),localOldTime:_(e,a)});function T(t,e,a,r,i){return r?a>r?v(t):"C"===(e=e.toUpperCase())?n.CANCELLED:i?r>i?n.DELAYED:n.EARLY:n.ON_TIME:n.UNKNOWN}const L=t=>{switch(t){case n.ON_TIME:return"on-time";case n.EARLY:return"early";case n.DELAYED:return"delayed";case n.CANCELLED:return"cancelled";case n.DEPARTED:return"departed";case n.ARRIVED:return"arrived";default:return"unknown"}},v=t=>t===m.DEPARTURE?n.DEPARTED:n.ARRIVED,C=(t,e,a,r)=>t===m.DEPARTURE?r(I("To"),a):r(I("From"),e),I=t=>`flightDetails:${t} _city_ (_iata_)`,U=(t,e)=>t&&e("flightDetails:Collect luggage from Baggage Claim _claimNum_",{claimNum:t}),_=(e,a)=>e&&t.fromISO(e,{zone:a}),N=(e,a,r="en-US")=>e&&t.fromISO(e,{zone:a}).setLocale(r).toFormat("EEE, d MMMM"),P=(e,a,r="en-US")=>e&&o(t.fromISO(e,{zone:a}),r);export{m as FlightType,g as flightComparator,D as formatGate,c as gateNameRegex,d as mapFlightDetails,u as mapFlightListItem};
1
+ import{DateTime as t}from"luxon";import{pick as e,propOr as a,compose as i,path as r,last as l}from"ramda";import{formatTime as n,msToMin as o}from"../../../src/utils/date.js";import{FlightLabelStatus as s}from"../../../utils/constants.js";const u={ARRIVAL:"arr",DEPARTURE:"dep",ALL:"all"};function m(t,e,i,r,l){const{flightId:n,carrierFsCode:o,flightNumber:s,airline:m,flightType:d,departureAirport:g,arrivalAirport:c,airportResources:D,gatePoi:p,status:A}=e,R=E(e),{localTime:I,localOldTime:C}=h(R,r),_=T(d,A,t,I,C),N=d===u.DEPARTURE?"flightDetails:Departs _date_":"flightDetails:Arrives _date_";return{flightId:n,name:`${a("","name",m)} - ${o} ${s}`,status:_,statusText:i(`flightDetails:${L(_)}`),baggageClaim:d===u.ARRIVAL?U(D.arrivalBagClaim,i):void 0,connectionAirport:v(d,g,c,i),time:S(I?.toISO()??null,r,l),oldTime:S(C?.toISO()??null,r,l),date:i(N,{date:O(I?.toISO()??null,r,l)}),dateStamp:I?.toMillis()??0,gate:f(p),gateLabel:i("flightDetails:Gate")}}function d(t,i,r,l,n){const{flightNumber:o,flightType:s,departureAirport:m,arrivalAirport:d,airportResources:g,flightStatusUpdates:c,carrierFsCode:A,gatePoi:R,airline:I,status:C}=i,_=e(["city","iata"]),N=E(i),{localTime:P,localOldTime:$}=h(N,l),M=T(s,C,t,P,$);return{flightType:s,flightTypeLabel:r(`flightDetails:${s===u.DEPARTURE?"Departure":"Arrival"}`),name:`${a("","name",I)} - ${A} ${o}`,status:M,statusText:r(`flightDetails:${L(M)}`),baggageClaim:s===u.ARRIVAL?U(g.arrivalBagClaim,r):void 0,departure:_(m),arrival:_(d),connectionAirport:v(s,m,d,r),flightIn:D(M,s,t,P,r),time:S(P?.toISO()??null,l,n),oldTime:S($?.toISO()??null,l,n),date:O(P?.toISO()??null,l,n),lastUpdated:p(t,c??[],r),flightDuration:"",gateLabel:r("flightDetails:Gate"),gate:f(R),tags:[],flightIconBaseName:s===u.ARRIVAL?"arrivals":"departures"}}const g=(t,e)=>t.dateStamp-e.dateStamp,c=/[A-Z]?\d+[a-zA-Z]?/,f=t=>{if(!t)return{name:"-"};const e=t.name.match(c);return{...t,name:e?e[0]:t.name}},D=(t,e,a,i,r)=>{if(t===s.DEPARTED)return r("flightDetails:Departed");if(t===s.ARRIVED)return r("flightDetails:Arrived");if(t===s.CANCELLED)return null;if(!i)return null;return r(`flightDetails:${e===u.DEPARTURE?"Departs":"Arrives"} in _minutes_ minute`,{count:A(a,i)})},p=(t,e,a)=>{const n=i(r(["updatedAt","dateUtc"]),l)(e),o=_(n);if(!o)return a("flightDetails:Last updated a few minutes ago");const s=A(t,o);return s<10?a("flightDetails:Last updated a few minutes ago"):s<60?a("flightDetails:Last updated _minutes_ minutes ago",{minutes:s}):a("flightDetails:Last updated over an hour ago")},A=(t,e)=>o(Math.abs(t.toMillis()-e.toMillis())),E=({flightType:t,operationalTimes:e,departureDate:a,arrivalDate:i})=>t===u.DEPARTURE?R(a,e.estimatedGateDeparture):R(i,e.estimatedGateArrival),R=(t,e)=>{const a=t.dateLocal||t.dateUtc,i=e?.dateLocal||e?.dateUtc;return i&&a!==i?{time:i,oldTime:a}:{time:a}},h=({time:t,oldTime:e},a)=>({localTime:_(t,a),localOldTime:_(e,a)});function T(t,e,a,i,r){if(!i)return s.UNKNOWN;if(a>i)return I(t);return"C"===e.toUpperCase()?s.CANCELLED:r?i>r?s.DELAYED:s.EARLY:s.ON_TIME}const L=t=>{switch(t){case s.ON_TIME:return"on-time";case s.EARLY:return"early";case s.DELAYED:return"delayed";case s.CANCELLED:return"cancelled";case s.DEPARTED:return"departed";case s.ARRIVED:return"arrived";default:return"unknown"}},I=t=>t===u.DEPARTURE?s.DEPARTED:s.ARRIVED,v=(t,e,a,i)=>t===u.DEPARTURE?i(C("To"),a??{}):i(C("From"),e??{}),C=t=>`flightDetails:${t} _city_ (_iata_)`,U=(t,e)=>t?e("flightDetails:Collect luggage from Baggage Claim _claimNum_",{claimNum:t}):null,_=(e,a)=>e?t.fromISO(e,{zone:a}):null,O=(e,a,i="en-US")=>e?t.fromISO(e,{zone:a}).setLocale(i).toFormat("EEE, d MMMM"):null,S=(e,a,i="en-US")=>e?n(t.fromISO(e,{zone:a}),i):null;export{u as FlightType,g as flightComparator,f as formatGate,c as gateNameRegex,d as mapFlightDetails,m as mapFlightListItem};
@@ -1 +1 @@
1
- import t from"flexsearch";import{DateTime as a}from"luxon";import*as e from"ramda";import{FlightType as r,mapFlightDetails as i,mapFlightListItem as n,flightComparator as o}from"./flightDetailsMapper.js";import{searchFlights as s}from"./utils.js";function l(l,p){const u=()=>new t.Index({tokenize:"forward"}),g={lastUpdated:0,flights:{dep:null,arr:null},index:{dep:u(),arr:u()},gates:null,apiError:!1},c=(t,a)=>{g.index[t]=u(),g.flights[t]={},a.forEach(a=>{g.index[t].add(a.flightId,d(a)),g.flights[t][a.flightId]=a})},d=e.pipe(e.juxt(e.map(e.path,[["flightNumber"],["airline","iata"],["airline","name"],["arrivalAirport","iata"],["arrivalAirport","city"],["departureAirport","iata"],["departureAirport","city"]])),e.filter(e.identity),e.join(" ")),f=async()=>{if(null===g.gates){const t=await l.bus.get("poi/getByCategoryId",{categoryId:"gate"}),a=({name:t})=>e.tail(t.replace(",","").split(" ")),r=e.reduce((t,r)=>{const i=a(r);return[...t,...e.map(t=>[t,r],i)]},[],Object.values(t));g.gates=e.fromPairs(r)}return g},h=async()=>{await f();const t=await l.bus.get("venueData/getVenueData"),a=new URLSearchParams,i=l.i18n?.().language;if(i&&a.append("locale",i),p?.timeRange){const t=Date.now(),e=new Date(t-p.timeRange.beforeNowMs).toISOString(),r=new Date(t+p.timeRange.afterNowMs).toISOString();a.append("startDate",e),a.append("endDate",r)}const n=`https://marketplace.locuslabs.com/venueId/${t.baseVenueId}/flight-status`,o=a.toString()?`${n}?${a.toString()}`:n;try{const t=await fetch(o),a=await t.json();[r.ARRIVAL,r.DEPARTURE].forEach(t=>{const i=t===r.DEPARTURE?"departures":"arrivals",{airports:n,airlines:o}=a.data[i].appendix;c(t,((t,a,i,n)=>{const o=a.reduce((t,a)=>({...t,[a.iata]:a}),{}),s=i.flatMap(t=>[{code:t.iata,airline:t},{code:t.icao,airline:t}]).filter(({code:t})=>t).reduce((t,{code:a,airline:e})=>({...t,[a]:e}),{});return t.map(t=>{const a=n===r.DEPARTURE?e.pathOr("",["airportResources","departureGate"],t):e.pathOr("",["airportResources","arrivalGate"],t),i=g.gates[a];return{...t,flightType:n,gatePoi:i,airline:s[t.carrierFsCode],departureAirport:o[t.departureAirportFsCode],arrivalAirport:o[t.arrivalAirportFsCode]}})})(a.data[i].flightStatuses,n,o,t))}),g.apiError=!1}catch(t){g.apiError=!0,console.error("Error from flight status api call",t),[r.ARRIVAL,r.DEPARTURE].forEach(t=>{c(t,[])})}finally{g.lastUpdated=Date.now()}return g},m=async()=>{Date.now()-g.lastUpdated>6e4&&await h()};return l.bus.on("flightStatus/query",async({term:t=null,type:a=r.DEPARTURE}={})=>(await m(),s(t,a,g))),l.bus.on("flightStatus/getFlight",async({flightId:t})=>{await m();return g.flights.dep[t]||g.flights.arr[t]}),l.bus.on("flightStatus/mapFlightDetails",async({flight:t})=>i(a.local(),t,l.gt(),g.tz,l.i18n().language)),l.bus.on("flightStatus/mapFlightListItems",async({flights:t})=>t.map(t=>n(a.local(),t,l.gt(),g.tz,l.i18n().language)).sort(o)),{init:async()=>{g.tz=await l.bus.get("venueData/getVenueTimezone")},internal:{updateFlights:h,indexGatePois:f}}}export{l as create};
1
+ import t from"flexsearch";import{DateTime as a}from"luxon";import*as e from"ramda";import{FlightType as r,mapFlightDetails as i,mapFlightListItem as n,flightComparator as o}from"./flightDetailsMapper.js";import{searchFlights as s}from"./utils.js";function l(l,p){const g=()=>new t.Index({tokenize:"forward"}),c={lastUpdated:0,flights:{dep:{},arr:{}},index:{dep:g(),arr:g()},gates:null,apiError:!1},u=(t,a)=>{c.index[t]=g(),c.flights[t]={},a.forEach(a=>{c.index[t].add(a.flightId,f(a)),c.flights[t][a.flightId]=a})},d=[["flightNumber"],["airline","iata"],["airline","name"],["arrivalAirport","iata"],["arrivalAirport","city"],["departureAirport","iata"],["departureAirport","city"]],f=t=>d.map(a=>e.path(a,t)).filter(t=>"string"==typeof t&&t.length>0).join(" "),h=async()=>{if(null===c.gates){const t=await l.bus.get("poi/getByCategoryId",{categoryId:"gate"}),a=({name:t})=>e.tail(t.replace(",","").split(" ")),r=Object.values(t).flatMap(t=>a(t).map(a=>[a,t]));c.gates=e.fromPairs(r)}return c},m=async()=>{await h();const t=await l.bus.get("venueData/getVenueData"),a=new URLSearchParams,i=l.i18n?.().language;if(i&&a.append("locale",i),p?.timeRange){const t=Date.now();a.append("startDate",new Date(t-p.timeRange.beforeNowMs).toISOString()),a.append("endDate",new Date(t+p.timeRange.afterNowMs).toISOString())}const n=`https://marketplace.locuslabs.com/venueId/${t.baseVenueId}/flight-status`,o=a.toString()?`${n}?${a.toString()}`:n;try{const t=await fetch(o),a=await t.json();[r.ARRIVAL,r.DEPARTURE].forEach(t=>{const i=t===r.DEPARTURE?"departures":"arrivals",{airports:n,airlines:o}=a.data[i].appendix;u(t,((t,a,i,n)=>{const o=a.reduce((t,a)=>({...t,[a.iata]:a}),{}),s=i.flatMap(t=>[{code:t.iata,airline:t},{code:t.icao,airline:t}]).filter(t=>Boolean(t.code)).reduce((t,{code:a,airline:e})=>({...t,[a]:e}),{});return t.map(t=>{const a=n===r.DEPARTURE?e.pathOr("",["airportResources","departureGate"],t):e.pathOr("",["airportResources","arrivalGate"],t),i=c.gates?.[String(a)];return{...t,flightType:n,gatePoi:i,airline:s[t.carrierFsCode],departureAirport:o[t.departureAirportFsCode],arrivalAirport:o[t.arrivalAirportFsCode]}})})(a.data[i].flightStatuses,n,o,t))}),c.apiError=!1}catch(t){c.apiError=!0,console.error("Error from flight status api call",t),[r.ARRIVAL,r.DEPARTURE].forEach(t=>u(t,[]))}finally{c.lastUpdated=Date.now()}return c},R=async()=>{Date.now()-c.lastUpdated>6e4&&await m()};return l.bus.on("flightStatus/query",async({term:t=null,type:a=r.DEPARTURE}={})=>(await R(),s(t,a,c))),l.bus.on("flightStatus/getFlight",async({flightId:t})=>(await R(),c.flights.dep[t]||c.flights.arr[t])),l.bus.on("flightStatus/mapFlightDetails",async({flight:t})=>i(a.local(),t,l.gt(),c.tz,l.i18n?.().language??"en-US")),l.bus.on("flightStatus/mapFlightListItems",async({flights:t})=>t.map(t=>n(a.local(),t,l.gt(),c.tz,l.i18n?.().language??"en-US")).sort(o)),{init:async()=>{c.tz=await l.bus.get("venueData/getVenueTimezone")},internal:{updateFlights:m,indexGatePois:h}}}export{l as create};
@@ -1 +1 @@
1
- import{FlightType as t}from"./flightDetailsMapper.js";const r=(e,a,l)=>{const{index:p,flights:s,apiError:i}=l,o=a===t.ALL?[t.DEPARTURE,t.ARRIVAL]:[a];let f;if(f=e?o.flatMap(t=>p[t].search({query:e}).map(r=>s[t][r])):o.flatMap(t=>Object.values(s[t])),0===f.length&&/^\w\w\d{2,4}$/.test(e)){const t=e.replace(/(\w\w)(\d{2,4})/,"$1_$2");return r(t,a,l)}return{flights:f,apiError:i}};export{r as searchFlights};
1
+ import{FlightType as t}from"./flightDetailsMapper.js";const r=(e,a,l)=>{const{index:i,flights:p,apiError:o}=l,s=a===t.ALL?[t.DEPARTURE,t.ARRIVAL]:[a];let f;return f=e?s.flatMap(t=>i[t].search({query:e}).map(r=>p[t][String(r)]).filter(t=>Boolean(t))):s.flatMap(t=>Object.values(p[t])),0===f.length&&e&&/^\w\w\d{2,4}$/.test(e)?r(e.replace(/(\w\w)(\d{2,4})/,"$1_$2"),a,l):{flights:f,apiError:o}};export{r as searchFlights};
@@ -1 +1 @@
1
- import{b64DecodeUnicode as e,filterOb as i}from"../../../src/utils/funcs.js";import{setDeepLinksForParms as n}from"../../../src/configs/postproc-mol-url-parms.js";import{setStateFromStateString as o}from"../../../src/configs/postproc-stateTracking.js";function t(t){const{name:a,debug:r,headless:l,theme:c,defaultSearchTerms:p,venueId:u,accountId:d,poiCategories:g,preserveStateInURL:h,supportURLDeepLinks:m,initState:f,deepLinkParms:S,uiHide:v,renderDiv:k,parentConfig:L,desktopViewMinWidth:P,forceDesktop:w,hostAppId:A,hostAppVersion:V,hostAppProperties:b,logFilter:y,searchPlaceholder:D,dataFetch:I,engineName:Z,dynamicPoisUrlBaseV1:j,plugins:F,analytics2ActiveFlag:C,enablePoiSelection:O,showSurround:R,minZoom:T,maxZoom:U,noLangOptions:x,pinnedLocation:M,pinnedLocationZoom:W,pinnedLocationFocusAtStart:z,pinnedLocationBearing:B,pinnedLocationPitch:H}=t,E=L?[L]:l?["sdkHeadless"]:["sdkVisual"],N=(e,i)=>e&&e.length>i?e.substring(0,i):e,X={name:a,engineName:Z,extends:E,debug:r,logFilter:y,theme:c,uiHide:v,renderDiv:k,configPostProc:[],plugins:{venueDataLoader:{dataFetch:I,venueId:u,accountId:d},sdkServer:{headless:l},analytics2:{hostAppId:(q=A,q?N(q.toString(),128):void 0),hostAppVersion:(_=V,_?N(_.toString(),128):void 0),hostAppProperties:(e=>{if(!e||"object"!=typeof e)return;const i={},n=Object.keys(e);return n.length>10&&(n.length=10),n.forEach(n=>{let o=N(n.toString().replaceAll(/[^a-zA-Z0-9_]/g,""),128);o.match(/^[a-zA-Z]+/)||(o="X"+o);let t=e[n];null==t&&(t=""),t=N(t.toString(),128),i[o]=t}),i})(b)}},uuid:"undefined"!=typeof document&&document&&document.location?document.location.host:"unknown"};var _,q;void 0!==C&&(X.plugins.analytics2.active=C);const G=(e,i)=>void 0!==i?{[e]:i}:{};return l||(X.plugins["online/headerOnline"]={searchPlaceholder:D},X.plugins.mapRenderer={...G("enablePoiSelection",O),surroundConfig:R?{}:null,viewLimits:{...G("maxZoom",U),...G("minZoom",T)}},X.plugins.userMenu={noLangOptions:x},M&&(X.plugins["online/pinnedLocation"]={location:M,zoom:W,focusAtStart:z,bearing:B,pitch:H})),X.plugins.searchService=p?{defaultSearchTerms:p}:{},s(t,"defaultSearchTerms",X.plugins.searchService),E.includes("sdkVisual")&&(X.plugins["online/homeView"]=g?{poiCategories:g}:{},s(t,"poiCategories",X.plugins["online/homeView"])),F&&(F.draw&&(X.plugins.draw=F.draw),F.flightStatus&&(X.plugins.flightStatus=F.flightStatus,X.plugins["online/flightDetails"]={},X.plugins["online/flightDetailsSearch"]={})),h&&(X.configPostProc.push("stateTracking"),X.plugins.deepLinking={trackURL:!0}),m&&X.configPostProc.push("mol-url-parms"),f&&o(X,e(f),!0),S&&n(X,new URLSearchParams(S),!0),void 0!==P&&(X.desktopViewMinWidth=P),w&&(X.desktopViewMinWidth=0),j&&(X.plugins.dynamicPois={urlBaseV1:j}),i((e,i)=>void 0!==i,X)}function s(e,i,n){Object.keys(e).filter(e=>e.startsWith(i+"-")).forEach(i=>n[i]=e[i])}export{t as default};
1
+ import{b64DecodeUnicode as e,filterOb as i}from"../../../src/utils/funcs.js";import{setDeepLinksForParms as n}from"../../../src/configs/postproc-mol-url-parms.js";import{setStateFromStateString as o}from"../../../src/configs/postproc-stateTracking.js";const t=(e,i)=>{if(void 0===e)return;const n=e.toString();return n.length>i?n.substring(0,i):n},s=(e,i)=>void 0!==i?{[e]:i}:{},a=e=>{if(!e||"object"!=typeof e)return;const i={};return Object.keys(e).slice(0,10).forEach(n=>{let o=t(n.toString().replaceAll(/[^a-zA-Z0-9_]/g,""),128)??"X";o.match(/^[a-zA-Z]+/)||(o=`X${o}`);let s=e[n];null==s&&(s=""),i[o]=t(String(s),128)??""}),i};function r(e,i,n){Object.keys(e).filter(e=>e.startsWith(`${i}-`)).forEach(i=>{n[i]=e[i]})}function l(l){const{name:c,debug:p,headless:u,theme:d,defaultSearchTerms:g,venueId:h,accountId:m,poiCategories:f,preserveStateInURL:S,supportURLDeepLinks:v,initState:k,deepLinkParms:L,uiHide:P,renderDiv:w,parentConfig:A,desktopViewMinWidth:y,forceDesktop:V,hostAppId:b,hostAppVersion:j,hostAppProperties:D,logFilter:I,searchPlaceholder:Z,dataFetch:F,engineName:C,dynamicPoisUrlBaseV1:O,plugins:R,analytics2ActiveFlag:T,enablePoiSelection:U,showSurround:x,minZoom:M,maxZoom:W,noLangOptions:z,pinnedLocation:B,pinnedLocationZoom:H,pinnedLocationFocusAtStart:E,pinnedLocationBearing:N,pinnedLocationPitch:X}=l,$=A?[A]:u?["sdkHeadless"]:["sdkVisual"],_={name:c,engineName:C,extends:$,debug:p,logFilter:I,theme:d,uiHide:P,renderDiv:w,configPostProc:[],plugins:{venueDataLoader:{dataFetch:F,venueId:h,accountId:m},sdkServer:{headless:u},analytics2:{hostAppId:b?t(b,128):void 0,hostAppVersion:j?t(j,128):void 0,hostAppProperties:a(D)}},uuid:"undefined"!=typeof document&&document.location?document.location.host:"unknown"};if(void 0!==T&&(_.plugins.analytics2={..._.plugins.analytics2,active:T}),u||(_.plugins["online/headerOnline"]={searchPlaceholder:Z},_.plugins.mapRenderer={...s("enablePoiSelection",U),surroundConfig:x?{}:null,viewLimits:{...s("maxZoom",W),...s("minZoom",M)}},_.plugins.userMenu={noLangOptions:z},B&&(_.plugins["online/pinnedLocation"]={location:B,zoom:H,focusAtStart:E,bearing:N,pitch:X})),_.plugins.searchService=g?{defaultSearchTerms:g}:{},r(l,"defaultSearchTerms",_.plugins.searchService),$.includes("sdkVisual")&&(_.plugins["online/homeView"]=f?{poiCategories:f}:{},r(l,"poiCategories",_.plugins["online/homeView"])),R&&"object"==typeof R){const e=R;e.draw&&(_.plugins.draw=e.draw),e.flightStatus&&(_.plugins.flightStatus=e.flightStatus,_.plugins["online/flightDetails"]={},_.plugins["online/flightDetailsSearch"]={})}return S&&((_.configPostProc??[]).push("stateTracking"),_.plugins.deepLinking={trackURL:!0}),v&&(_.configPostProc??[]).push("mol-url-parms"),k&&o(_,e(k),!0),L&&n(_,new URLSearchParams(L),!0),void 0!==y&&(_.desktopViewMinWidth=y),V&&(_.desktopViewMinWidth=0),O&&(_.plugins.dynamicPois={urlBaseV1:O}),i((e,i)=>void 0!==i,_)}export{l as default};
@@ -1 +1 @@
1
- import*as e from"ramda";import{locationToEndpoint as t,getStructures as n}from"../../../src/utils/location.js";const i=[{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:"getDirectionsMultiple",args:[{name:"locations",type:"list",itemType:{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:"getSecurityWaitTimes",args:[{name:"isOpen",type:"boolean",optional:!0}]},{command:"search",args:[{name:"term",type:"string",minLength:2},{name:"details",type:"boolean",optional:!0}]},{command:"getFlightStatus",args:[{name:"term",type:"string",optional:!0},{name:"type",type:"string",optional:!0}]}];function s(i){i.bus.on("clientAPI/destroy",async()=>i.destroy()),i.bus.on("clientAPI/getDirections",async({from:n,to:s,accessible:a,queueTypes:o})=>{const c=await t(i,n),r=await t(i,s),m={requiresAccessibility:!!a};return o&&(m.selectedSecurityLanes={SecurityLane:o}),i.bus.get("wayfinder/getRoute",{fromEndpoint:c,toEndpoint:r,options:m}).then(e.pick(["distance","time","steps","navline","waypoints"]))}),i.bus.on("clientAPI/getDirectionsMultiple",async({locations:n,accessible:s,queueTypes:a})=>{const o=await Promise.all(n.map(async e=>t(i,e))),c={requiresAccessibility:!!s};a&&(c.selectedSecurityLanes={SecurityLane:a});const r=await Promise.all(e.aperture(2,o).map(async e=>i.bus.get("wayfinder/getRoute",{fromEndpoint:e[0],toEndpoint:e[1],options:c}))),m=e.map(e.pick(["distance","time","steps","navline","waypoints"]),r);return{total:{distance:e.sum(e.map(e=>e.distance,m)),time:e.sum(e.map(e=>e.time,m))},directions:m}}),i.bus.on("clientAPI/getPOIDetails",async({poiId:e})=>i.bus.get("poi/getById",{id:e})),i.bus.on("clientAPI/getAllPOIs",async()=>i.bus.get("poi/getAll")),i.bus.on("clientAPI/getStructures",()=>n(i)),i.bus.on("clientAPI/getSecurityWaitTimes",async({isOpen:e})=>i.bus.get("dynamicPois/getSecurityWaitTimes",{isOpen:e}));const s=e=>"function"!=typeof e;i.bus.on("clientAPI/getVenueData",async()=>{const t=await i.bus.get("venueData/getVenueData");return e.filter(s,t)}),i.bus.on("clientAPI/search",async({term:e,details:t})=>i.bus.get("search/queryAsync",{term:e}).then(n=>{const s=n.map(e=>e.poiId);return i.bus.send("event/search",{referrer:"prog",searchMethod:null,query:e,entities:s}),t?n:s})),i.bus.on("clientAPI/getFlightStatus",async({term:e,type:t="all"})=>i.bus.get("flightStatus/query",{term:e,type:t}))}export{s as handleHeadless,i as headlessCommands};
1
+ import*as e from"ramda";import{locationToEndpoint as t,getStructures as n}from"../../../src/utils/location.js";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:"getDirectionsMultiple",args:[{name:"locations",type:"list",itemType:{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:"getSecurityWaitTimes",args:[{name:"isOpen",type:"boolean",optional:!0}]},{command:"search",args:[{name:"term",type:"string",minLength:2},{name:"details",type:"boolean",optional:!0}]},{command:"getFlightStatus",args:[{name:"term",type:"string",optional:!0},{name:"type",type:"string",optional:!0}]}];function i(s){const i=e=>{const t=e;return{distance:t.distance,time:t.time,steps:t.steps,navline:t.navline,waypoints:t.waypoints}};s.bus.on("clientAPI/destroy",async()=>s.destroy?.()),s.bus.on("clientAPI/getDirections",async({from:e,to:n,accessible:a,queueTypes:o})=>{const c=await t(s,e),r=await t(s,n),m={requiresAccessibility:!!a};o&&(m.selectedSecurityLanes={SecurityLane:o});const l=await s.bus.get("wayfinder/getRoute",{fromEndpoint:c,toEndpoint:r,options:m});return i(l)}),s.bus.on("clientAPI/getDirectionsMultiple",async({locations:n,accessible:a,queueTypes:o})=>{const c=await Promise.all(n.map(async e=>t(s,e))),r={requiresAccessibility:!!a};o&&(r.selectedSecurityLanes={SecurityLane:o});const m=(await Promise.all(e.aperture(2,c).map(async e=>s.bus.get("wayfinder/getRoute",{fromEndpoint:e[0],toEndpoint:e[1],options:r})))).map(i);return{total:{distance:e.sum(m.map(e=>Number(e.distance??0))),time:e.sum(m.map(e=>Number(e.time??0)))},directions:m}}),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",()=>n(s)),s.bus.on("clientAPI/getSecurityWaitTimes",async({isOpen:e})=>s.bus.get("dynamicPois/getSecurityWaitTimes",{isOpen:e})),s.bus.on("clientAPI/getVenueData",async()=>{const e=await s.bus.get("venueData/getVenueData");return Object.fromEntries(Object.entries(e).filter(([,e])=>"function"!=typeof e))}),s.bus.on("clientAPI/search",async({term:e,details:t})=>s.bus.get("search/queryAsync",{term:e}).then(n=>{const i=n.map(e=>e.poiId);return s.bus.send("event/search",{referrer:"prog",searchMethod:null,query:e,entities:i}),t?n:i})),s.bus.on("clientAPI/getFlightStatus",async({term:e,type:t="all"})=>s.bus.get("flightStatus/query",{term:e,type:t}))}export{i as handleHeadless,s as headlessCommands};
@@ -1 +1 @@
1
- import{throttle as e}from"throttle-debounce";import{getStructureAndFloorAtPoint as o}from"../../../src/utils/geom.js";import t from"../../../src/utils/observable.js";import{headlessCommands as n,handleHeadless as s}from"./sdkHeadless.js";let a=null;function r(e,o){return"null"===e?"null-origin":e===o?"same-origin":"cross-origin"}function i(e,{messageType:o,senderOrigin:t,command:n,iframeOrigin:s}){e.send("appInsights/log",{name:"browserMessageObserved",properties:{command:n,deploymentHost:window.location.host,iframeOrigin:s,messageType:o,relation:r(t,s),senderOrigin:t,wouldRejectCrossOrigin:!l(t,s)}})}function l(e,o){return e===o}function d(e){const o=(e,o)=>{const t={payload:e,type:"LL-server"};o&&(t.clientMsgId=o);try{window.postMessage(t,"*")}catch{window.postMessage((e=>JSON.parse(JSON.stringify(e)))(t),"*")}};function t(t){const n=t.data;if(n&&"LL-client"===n.type){const s=window.location.origin;if(i(e.bus,{messageType:"LL-client",senderOrigin:t.origin,command:n.payload?.command,iframeOrigin:s}),!l(t.origin,s))return;e.bus.get("clientAPI/execute",n.payload).then(e=>o(e,n.msgId)).catch(o=>{e.config.debug&&console.error(o),((e,o)=>{const t={error:!0,payload:e,type:"LL-server"};o&&(t.clientMsgId=o),window.postMessage(t,"*")})(o.message,n.msgId)})}}return a&&a(),window.addEventListener("message",t),a=()=>window.removeEventListener("message",t),(e,o)=>{const t={event:e,payload:o,type:"LL-server"};window.postMessage(t,"*")}}async function m(a,r){const i=a.env.isBrowser?d(a):function(e){const o=t();return e.eventListener=o,(e,t)=>o.fire(e,t)}(a);return function(t,n){t.bus.monitor("map/userMoveStart",async({pitch:e,zoom:o,bearing:s})=>{const{lat:a,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");n("userMoveStart",{lat:a,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:o,bearing:s})}),t.bus.monitor("map/userMoving",e(500,async({pitch:e,zoom:o,bearing:s})=>{const{lat:a,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");n("userMoving",{lat:a,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:o,bearing:s})})),t.bus.monitor("map/moveEnd",async({pitch:e,zoom:o,bearing:s})=>{const{lat:a,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");n("moveEnd",{lat:a,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:o,bearing:s})}),t.bus.monitor("map/floorChanged",({structure:e,floor:o})=>n("levelChange",{floorId:o?o.id:null,floorName:o?o.name:null,ord:o?o.ordinal:null,structureId:e?e.id:null,structureName:e?e.name:null})),t.bus.monitor("map/poiClicked",({poi:e})=>n("poiSelected",e)),t.bus.monitor("poiDetails/showPoi",({poi:e})=>n("poiShown",e)),t.bus.monitor("map/click",async({lat:e,lng:s,ord:a})=>{const r=await t.bus.get("venueData/getStructures"),i=await t.bus.get("map/getViewBBox"),{building:l,floor:d}=o(r,e,s,a,i,!0);n("mapClicked",{lat:e,lng:s,ord:a,building:l,floor:d})})}(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),n.forEach(e=>a.bus.send("clientAPI/registerCommand",e)),s(a),r.headless||await import("../../../_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("system/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),a.bus.on("sdkServer/sendEvent",({eventName:e,...o})=>i(e,o))}}}export{m as create,r as describeMessageRelation,l as isSameOriginBrowserMessage,i as logBrowserMessageTelemetry};
1
+ import{throttle as e}from"throttle-debounce";import{getStructureAndFloorAtPoint as o}from"../../../src/utils/geom.js";import n from"../../../src/utils/observable.js";import{headlessCommands as t,handleHeadless as a}from"./sdkHeadless.js";let i=null;function r(e,o){return"null"===e?"null-origin":e===o?"same-origin":"cross-origin"}function s(e,o){e.send("appInsights/log",{name:"browserMessageObserved",properties:{command:o.command,deploymentHost:window.location.host,iframeOrigin:o.iframeOrigin,messageType:o.messageType,relation:r(o.senderOrigin,o.iframeOrigin),senderOrigin:o.senderOrigin,wouldRejectCrossOrigin:!l(o.senderOrigin,o.iframeOrigin)}})}function l(e,o){return e===o}function m(e){const o=(e,o)=>{const n={payload:e,type:"LL-server",clientMsgId:o};try{window.postMessage(n,"*")}catch{window.postMessage((t=n,JSON.parse(JSON.stringify(t))),"*")}var t},n=n=>{const t=n.data;if(!t||"LL-client"!==t.type)return;const a=window.location.origin;s(e.bus,{messageType:"LL-client",senderOrigin:n.origin,command:t.payload?.command,iframeOrigin:a}),l(n.origin,a)&&e.bus.get("clientAPI/execute",t.payload).then(e=>o(e,t.msgId)).catch(o=>{var n,a;e.config.debug&&console.error(o),n=o.message,a=t.msgId,window.postMessage({error:!0,payload:n,type:"LL-server",clientMsgId:a},"*")})};return i&&i(),window.addEventListener("message",n),i=()=>window.removeEventListener("message",n),(e,o)=>{window.postMessage({event:e,payload:o,type:"LL-server"},"*")}}async function d(i,r){const s=i.env.isBrowser?m(i):function(e){const o=n();return e.eventListener=o,(e,n)=>o.fire(e,n)}(i);return function(n,t){const a=async(e,o)=>{const{lat:a,lng:i,floorId:r,ordinal:s,structureId:l}=await n.bus.get("map/getMapCenter");t(e,{lat:a,lng:i,floorId:r,ord:s,structureId:l,...o})};n.bus.monitor("map/userMoveStart",e=>{a("userMoveStart",e)}),n.bus.monitor("map/userMoving",e(500,e=>{a("userMoving",e)})),n.bus.monitor("map/moveEnd",e=>{a("moveEnd",e)}),n.bus.monitor("map/floorChanged",({structure:e,floor:o})=>t("levelChange",{floorId:o?.id??null,floorName:o?.name??null,ord:o?.ordinal??null,structureId:e?.id??null,structureName:e?.name??null})),n.bus.monitor("map/poiClicked",({poi:e})=>t("poiSelected",e)),n.bus.monitor("poiDetails/showPoi",({poi:e})=>t("poiShown",e)),n.bus.monitor("map/click",async({lat:e,lng:a,ord:i})=>{const r=await n.bus.get("venueData/getStructures"),s=await n.bus.get("map/getViewBBox"),{building:l,floor:m}=o(r,e,a,i,s,!0);t("mapClicked",{lat:e,lng:a,ord:i,building:l,floor:m})})}(i,s),{init:async()=>{!function(e){[{name:"latLngOrdLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"ord",type:"integer"}]}},{name:"latLngFloorLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"floorId",type:"string"}]}},{name:"poiIdLocation",spec:{type:"object",props:[{name:"poiId",type:"integer",min:0}]}},{name:"location",spec:{type:"multi",types:[{type:"poiIdLocation"},{type:"latLngOrdLocation"},{type:"latLngFloorLocation"}]}},{name:"viewSettings",spec:{type:"object",props:[{name:"zoom",type:"float",optional:!0},{name:"pitch",type:"float",optional:!0},{name:"bearing",type:"float",optional:!0}]}}].forEach(o=>{e.bus.send("clientAPI/registerCustomType",o)})}(i),t.forEach(e=>i.bus.send("clientAPI/registerCommand",e)),a(i),r.headless||await import("../../../_virtual/_empty_module_placeholder.js").then(e=>{e.visualCommands.forEach(e=>i.bus.send("clientAPI/registerCommand",e)),e.handleVisual(i,s)});const e=async()=>{await i.bus.send("system/readywhenyouare"),i.bus.get("clientAPI/execute",{command:"getCommandJSON"}).then(e=>s("ready",{commandJSON:e})),!r.headless&&i.config.uiHide?.sidebar&&i.env.isDesktop()&&i.bus.send("map/changePadding",{padding:{left:55,right:55,top:72,bottom:22}})};r.headless?Promise.all([new Promise(e=>i.bus.monitor("venueData/navGraphLoaded",e)),new Promise(e=>i.bus.monitor("venueData/poiDataLoaded",e))]).then(e):i.bus.on("map/mapReadyToShow",e),i.bus.on("sdkServer/sendEvent",({eventName:e,...o})=>s(e,o))}}}export{d as create,r as describeMessageRelation,l as isSameOriginBrowserMessage,s as logBrowserMessageTelemetry};
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"./utils/i18n.js";import{startInitialStateListener as i}from"./utils/isInitialState.js";import*as 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){return n?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/index.js`).then(o=>(e.log.info(`Creating plugin ${t}`),o.create(e,n))):(e.log.info(`Plugin ${t} explicitly disabled`),null)}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}.ts`).then(e=>e.process(t));async function f(t){const d=Object.create(null);let f=t.extends?await p(t,t.extends):t;if(f.plugins?.monitoring){const e=f.plugins.monitoring;await import("../_virtual/_empty_module_placeholder.js").then(t=>t.activate(e))}f=await(async e=>e.configPostProc?n.series(e,...e.configPostProc.map(m)):e)(f);const w=(e=>{const t=e.supportedLanguages||["am","ar","de","el-GR","en","es","fr","hi","is","it","ja","ko","nl","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),h=await o(w,{debug:f.debug});d.i18n=()=>h,d.gt=()=>h.t.bind(h),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
+ import{map as e,mergeDeepRight as t}from"ramda";import n from"zousan-plus";import i from"./utils/i18n.js";import{startInitialStateListener as o}from"./utils/isInitialState.js";import*as 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){if(!n)return e.log.info(`Plugin ${t} explicitly disabled`),null;if(void 0!==n.active&&(!1===n.active||"notLocalhost"===n.active&&e.env.isLocalhost()))return e.log.info(`Plugin ${t} explicitly deativated`),null;return(t.includes("/")?(()=>{const[e,n]=t.split("/");return import(`../plugins/${e}/${n}/src/index.js`)})():import(`../plugins/${t}/src/index.js`)).then(i=>(e.log.info(`Creating plugin ${t}`),i.create(e,n)))}async function d(e){return c?import(`./configs/${e}.json`):import(`./configs/${e}.json.js`)}async function p(e,n){let i={};const o=await Promise.all(n.map(d));for(const e of o){let n=e.default;n=n.extends?await p(n,n.extends):n,i=t(i,n)}return i=t(i,e),i}const m=e=>t=>import(`./configs/postproc-${e}.ts`).then(e=>e.process(t));async function f(t){const d=Object.create(null);let f=t.extends?await p(t,t.extends):t;if(f.plugins?.monitoring)try{const e=await import("../_virtual/_empty_module_placeholder.js");await e.activate(f.plugins.monitoring)}catch(e){console.warn("Monitoring plugin failed to load (continuing without it):",e?.message||e)}f=await(async e=>e.configPostProc?n.series(e,...e.configPostProc.map(m)):e)(f);const w=(e=>{const t=e.supportedLanguages||["am","ar","de","el-GR","en","es","fr","hi","is","it","ja","ko","nl","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),h=await i(w,{debug:f.debug});d.i18n=()=>h,d.gt=()=>h.t.bind(h),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 i=n.initThemeManager(d);d.themePack=await i.buildTheme(f.theme,f.defaultTheme),o(),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
- const e={navFrom:"online/getDirectionsFromTo",navTo:"online/getDirectionsFromTo",waypoints:"online/getDirectionsFromTo",accessible:"online/getDirectionsFromTo",showNav:"online/getDirectionsFromTo",poiId:["online/getDirectionsFromTo","online/poiView"],vid:"venueDataLoader",stage:"venueDataLoader",contentStage:"venueDataLoader",accountId:"venueDataLoader",search:"online/headerOnline",ho:["online/getDirectionsFromTo","analytics2"],home:"online/homeView",zoom:"mapRenderer",pitch:"mapRenderer",bearing:"mapRenderer",lat:"mapRenderer",lng:"mapRenderer",radius:"mapRenderer",buildingId:"mapRenderer",floorId:"mapRenderer",visualTest:"mapRenderer",refInstallId:"analytics2",disableZoomToExplorePopup:"levelIndicator"};function o(o,n,r){if(n.has("lldebug"))try{o.debug=JSON.parse(n.get("lldebug")),null===o.debug&&(o.debug={})}catch{o.debug=!0}return Object.keys(e).forEach(i=>{if(n.has(i)){let a=e[i];Array.isArray(a)||(a=[a]),a.forEach(e=>{let a=o.plugins[e];!a&&r&&(a=o.plugins[e]={}),a.deepLinkProps={...a.deepLinkProps,[i]:n.get(i)}})}}),n.has("poiId")&&n.has("showNav")&&delete o.plugins["online/poiView"].deepLinkProps.poiId,o}export{o as setDeepLinksForParms};
1
+ const e={navFrom:"online/getDirectionsFromTo",navTo:"online/getDirectionsFromTo",waypoints:"online/getDirectionsFromTo",accessible:"online/getDirectionsFromTo",showNav:"online/getDirectionsFromTo",poiId:["online/getDirectionsFromTo","online/poiView"],vid:"venueDataLoader",stage:"venueDataLoader",contentStage:"venueDataLoader",accountId:"venueDataLoader",search:"online/headerOnline",ho:["online/getDirectionsFromTo","analytics2"],home:"online/homeView",zoom:"mapRenderer",pitch:"mapRenderer",bearing:"mapRenderer",lat:"mapRenderer",lng:"mapRenderer",radius:"mapRenderer",buildingId:"mapRenderer",floorId:"mapRenderer",visualTest:"mapRenderer",refInstallId:"analytics2",disableZoomToExplorePopup:"levelIndicator"};function n(n,o,r=!1){if(o.has("lldebug"))try{const e=JSON.parse(o.get("lldebug")??"null");n.debug=null===e?{}:e}catch{n.debug=!0}return Object.keys(e).forEach(i=>{if(!o.has(i))return;const a=e[i];(Array.isArray(a)?a:[a]).forEach(e=>{let a=n.plugins[e];!a&&r&&(a=n.plugins[e]={}),a&&(a.deepLinkProps={...a.deepLinkProps,[i]:o.get(i)})})}),o.has("poiId")&&o.has("showNav")&&delete n.plugins["online/poiView"]?.deepLinkProps?.poiId,n}export{n as setDeepLinksForParms};
@@ -1 +1 @@
1
- import*as e from"ramda";import"zousan";function o(o,r,n){const p=JSON.parse(r);return Object.keys(p).forEach(r=>{const s=p[r];let t=o.plugins[r];if(!t&&n&&(t=o.plugins[r]={}),t){const o=t.deepLinkProps;t.deepLinkProps=o?e.mergeDeepRight(o,s):s}}),o}export{o as setStateFromStateString};
1
+ import*as e from"ramda";import"zousan";function r(r,n,o=!1){const t=JSON.parse(n);return Object.keys(t).forEach(n=>{const p=t[n];let s=r.plugins[n];if(!s&&o&&(s=r.plugins[n]={}),!s)return;const i=s.deepLinkProps;s.deepLinkProps=i?e.mergeDeepRight(i,p):p}),r}export{r as setStateFromStateString};
@@ -1 +1 @@
1
- function t(t){this._observers.splice(this._observers.indexOf(t),1)}function e(t){const e=s();return this.observe(function(...r){t.apply(this,r)&&e.fire(...r)}),e}function r(t){return e.call(this,function(e){return t===e})}const n={detach:t,filter:e,fire:function(...t){const e=this._observers;if(e){for(let r=0;r<e.length;r++)try{e[r].apply(this,t)}catch(t){console.error(t)}return this}},observe:function(e){return this._observers||(this._observers=[]),this._observers.push(e),{detach:t.bind(this,e),ob:this}},on:function(t,e){return r.call(this,t).observe(e)}};function s(t){return t?function(t,e){for(const r in e)t[r]=e[r];return t}(t,n):Object.create(n)}export{s as default};
1
+ function t(t){this._observers?.splice(this._observers.indexOf(t),1)}function e(t){const e=n();return this.observe(function(...r){t.apply(this,r)&&e.fire(...r)}),e}function r(t){return e.call(this,function(e){return t===e})}const s={detach:t,filter:e,fire:function(...t){const e=this._observers;if(e){for(let r=0;r<e.length;r++)try{e[r].apply(this,t)}catch(t){console.error(t)}return this}},observe:function(e){return this._observers||(this._observers=[]),this._observers.push(e),{detach:t.bind(this,e),ob:this}},on:function(t,e){return r.call(this,t).observe(e)}};function n(t){return t?(e=t,r=s,Object.assign(e,r)):Object.create(s);var e,r}export{n as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atriusmaps-node-sdk",
3
- "version": "3.3.917",
3
+ "version": "3.3.919",
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",