atriusmaps-node-sdk 3.3.31 → 3.3.225
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 +19 -1
- package/dist/cjs/_virtual/_empty_module_placeholder.js +2 -2
- package/dist/cjs/deploy/prepareSDKConfig.js +152 -2
- package/dist/cjs/nodesdk/nodeEntry.js +109 -0
- package/dist/cjs/package.json.js +190 -7
- package/dist/cjs/plugins/clientAPI/src/clientAPI.js +11 -2
- package/dist/cjs/plugins/dynamicPois/src/dynamicPois.js +218 -21
- package/dist/cjs/plugins/poiDataManager/src/poiDataManager.js +292 -21
- package/dist/cjs/plugins/sdkServer/src/sdkHeadless.js +99 -20
- package/dist/cjs/plugins/sdkServer/src/sdkServer.js +219 -2
- package/dist/cjs/plugins/sdkServer/src/util.js +16 -3
- package/dist/cjs/plugins/searchService/src/poiSearch.js +57 -19
- package/dist/cjs/plugins/searchService/src/searchService.js +246 -21
- package/dist/cjs/plugins/searchService/src/searchTypeahead.js +60 -3
- package/dist/cjs/plugins/searchService/src/utils.js +23 -4
- package/dist/cjs/plugins/venueDataLoader/src/venueDataLoader.js +472 -23
- package/dist/cjs/plugins/venueDataLoader/src/venueLoadingUtils.js +191 -23
- package/dist/cjs/plugins/wayfinder/src/findRoute.js +147 -19
- package/dist/cjs/plugins/wayfinder/src/minPriorityQueue.js +88 -2
- package/dist/cjs/plugins/wayfinder/src/navGraph.js +393 -5
- package/dist/cjs/plugins/wayfinder/src/navGraphDebug.js +110 -20
- package/dist/cjs/plugins/wayfinder/src/segmentBadges.js +28 -2
- package/dist/cjs/plugins/wayfinder/src/segmentBuilder.js +257 -19
- package/dist/cjs/plugins/wayfinder/src/segmentCategories.js +29 -2
- package/dist/cjs/plugins/wayfinder/src/stepBuilder.js +238 -3
- package/dist/cjs/plugins/wayfinder/src/wayfinder.js +597 -22
- package/dist/cjs/src/app.js +191 -25
- package/dist/cjs/src/configs/postproc-mol-url-parms.js +58 -2
- package/dist/cjs/src/configs/postproc-stateTracking.js +53 -19
- package/dist/cjs/src/controller.js +43 -4
- package/dist/cjs/src/debugTools.js +128 -23
- package/dist/cjs/src/env.js +17 -2
- package/dist/cjs/src/extModules/bustle.js +128 -4
- package/dist/cjs/src/extModules/flexapi/src/help.js +23 -4
- package/dist/cjs/src/extModules/flexapi/src/index.js +65 -4
- package/dist/cjs/src/extModules/flexapi/src/validate.js +133 -5
- package/dist/cjs/src/extModules/geohasher.js +90 -3
- package/dist/cjs/src/extModules/log.js +69 -2
- package/dist/cjs/src/historyManager.js +29 -2
- package/dist/cjs/src/utils/bounds.js +22 -4
- package/dist/cjs/src/utils/buildStructureLookup.js +31 -19
- package/dist/cjs/src/utils/configUtils.js +71 -3
- package/dist/cjs/src/utils/dom.js +48 -5
- package/dist/cjs/src/utils/funcs.js +30 -7
- package/dist/cjs/src/utils/geodesy.js +35 -3
- package/dist/cjs/src/utils/geom.js +212 -25
- package/dist/cjs/src/utils/i18n.js +69 -5
- package/dist/cjs/src/utils/observable.js +73 -2
- package/dist/cjs/src/utils/rand.js +82 -3
- package/dist/nodesdk/nodeEntry.js +1 -0
- package/dist/package.json.js +1 -0
- package/dist/plugins/dynamicPois/src/dynamicPois.js +1 -0
- package/dist/plugins/sdkServer/src/sdkHeadless.js +1 -0
- package/{lib → dist}/plugins/sdkServer/src/sdkServer.js +1 -1
- package/dist/plugins/searchService/src/poiSearch.js +1 -0
- package/dist/plugins/searchService/src/searchService.js +1 -0
- package/dist/plugins/venueDataLoader/src/venueDataLoader.js +1 -0
- package/dist/plugins/venueDataLoader/src/venueLoadingUtils.js +1 -0
- package/dist/plugins/wayfinder/src/navGraph.js +1 -0
- package/{lib → dist}/plugins/wayfinder/src/segmentBuilder.js +1 -1
- package/dist/plugins/wayfinder/src/stepBuilder.js +1 -0
- package/dist/plugins/wayfinder/src/wayfinder.js +1 -0
- package/dist/src/app.js +1 -0
- package/dist/src/configs/postproc-mol-url-parms.js +1 -0
- package/{lib → dist}/src/configs/sdkHeadless.json.js +1 -1
- package/dist/src/extModules/bustle.js +1 -0
- package/dist/src/extModules/log.js +1 -0
- package/dist/src/utils/funcs.js +1 -0
- package/dist/src/utils/geom.js +1 -0
- package/dist/src/utils/i18n.js +1 -0
- package/package.json +17 -9
- package/config/rollup.config.cjs.js +0 -31
- package/dist/cjs/deploy/nodeEntry.js +0 -15
- package/dist/cjs/src/auth/Auth.js +0 -23
- package/lib/deploy/nodeEntry.js +0 -1
- package/lib/package.json.js +0 -1
- package/lib/plugins/dynamicPois/src/dynamicPois.js +0 -1
- package/lib/plugins/sdkServer/src/sdkHeadless.js +0 -1
- package/lib/plugins/searchService/src/poiSearch.js +0 -1
- package/lib/plugins/searchService/src/searchService.js +0 -1
- package/lib/plugins/venueDataLoader/src/venueDataLoader.js +0 -1
- package/lib/plugins/venueDataLoader/src/venueLoadingUtils.js +0 -1
- package/lib/plugins/wayfinder/src/navGraph.js +0 -1
- package/lib/plugins/wayfinder/src/stepBuilder.js +0 -1
- package/lib/plugins/wayfinder/src/wayfinder.js +0 -1
- package/lib/src/app.js +0 -1
- package/lib/src/auth/Auth.js +0 -1
- package/lib/src/configs/postproc-mol-url-parms.js +0 -1
- package/lib/src/configs/sdkHeadless.json +0 -28
- package/lib/src/extModules/bustle.js +0 -1
- package/lib/src/extModules/log.js +0 -1
- package/lib/src/utils/funcs.js +0 -1
- package/lib/src/utils/geom.js +0 -1
- package/lib/src/utils/i18n.js +0 -1
- /package/{lib → dist}/_virtual/_empty_module_placeholder.js +0 -0
- /package/{lib → dist}/deploy/prepareSDKConfig.js +0 -0
- /package/{lib → dist}/plugins/clientAPI/src/clientAPI.js +0 -0
- /package/{lib → dist}/plugins/poiDataManager/src/poiDataManager.js +0 -0
- /package/{lib → dist}/plugins/sdkServer/src/util.js +0 -0
- /package/{lib → dist}/plugins/searchService/src/searchTypeahead.js +0 -0
- /package/{lib → dist}/plugins/searchService/src/utils.js +0 -0
- /package/{lib → dist}/plugins/wayfinder/src/findRoute.js +0 -0
- /package/{lib → dist}/plugins/wayfinder/src/minPriorityQueue.js +0 -0
- /package/{lib → dist}/plugins/wayfinder/src/navGraphDebug.js +0 -0
- /package/{lib → dist}/plugins/wayfinder/src/segmentBadges.js +0 -0
- /package/{lib → dist}/plugins/wayfinder/src/segmentCategories.js +0 -0
- /package/{lib → dist}/src/configs/postproc-stateTracking.js +0 -0
- /package/{lib → dist}/src/controller.js +0 -0
- /package/{lib → dist}/src/debugTools.js +0 -0
- /package/{lib → dist}/src/env.js +0 -0
- /package/{lib → dist}/src/extModules/flexapi/src/help.js +0 -0
- /package/{lib → dist}/src/extModules/flexapi/src/index.js +0 -0
- /package/{lib → dist}/src/extModules/flexapi/src/validate.js +0 -0
- /package/{lib → dist}/src/extModules/geohasher.js +0 -0
- /package/{lib → dist}/src/historyManager.js +0 -0
- /package/{lib → dist}/src/utils/bounds.js +0 -0
- /package/{lib → dist}/src/utils/buildStructureLookup.js +0 -0
- /package/{lib → dist}/src/utils/configUtils.js +0 -0
- /package/{lib → dist}/src/utils/dom.js +0 -0
- /package/{lib → dist}/src/utils/geodesy.js +0 -0
- /package/{lib → dist}/src/utils/observable.js +0 -0
- /package/{lib → dist}/src/utils/rand.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"ramda";import a from"zousan";import t from"../../../src/auth/Auth.js";import{delay as n}from"../../../src/utils/funcs.js";import{normalizeCoords as s,getVenueDataFromUrls as u,buildStructures as o,createFetchJson as r,createFetchText as i}from"./venueLoadingUtils.js";async function l(l,d){const c=l.log.sublog("venueDataLoader");let p=new a,g=new a;const v=a=>a.defaultStructureId||e.path(["structureOrder",0],a)||e.path(["selectorOrder",0],a)||e.pipe(e.prop("structures"),Object.values,e.path([0,"id"]))(a);const f=e=>{const a=d.availableLanguages.find((a=>a.langCode===e));return a||{langCode:e,assetSuffix:""}};async function b(a){a.assetStage&&"prod"!==a.assetStage&&location.hostname;const s=a.auth?await async function(e){const a=await t(e,l);let s=null,u=0;for(;!s&&u<6;)s=await a.getToken(),u++,s||await n(500)();return s?(l.bus.send("login/userLoggedIn",{token:s}),l.bus.on("app/logout",a.logout),s):l.bus.get("login/showLogin",{auth:a})}(a.auth):null,d=r(s),g=i(s),b=await u(a,d),{accountId:m,venueId:h}=a;b.assetStage=a.assetStage,b.defaultOrdinal=b.defaultOrdinal||function(a){const t=v(a),n=Object.values(a.structures).find(e.propEq("id",t));return n.levels[n.defaultLevelId].ordinal}(b),b.structures=o(b);const y=l.i18n().language,D=f(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=d,b.fetchText=g,c.info("venueData ",b,D,y),l.config.debug&&l.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)):[]})()),l.bus.send("venueData/venueDataLoaded",{venueData:b}),p.resolve(b),p}function m(e){const a={id:"venueDataLoader"};e.id!==d.venueId&&(a.vid=e.id);const t=l.config.defaultLanguage||"en";return l.i18n().language!==t&&(a.lang=l.i18n().language),"prod"!==e.assetStage&&(a.stage=e.assetStage),l.bus.send("deepLinking/notifyState",a),e}l.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 l.bus.send("map/replaceTheme",{theme:n});if(e.metadata&&e.metadata["mapbox:type"])return t=a,void l.bus.send("map/replaceStyle",{styleSrc:t})}var t,n}));async function h(e){const a={...e},t=await l.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!==d.copyPOINamesToMap&&(e.properties.text=function(e){let a=e.name;return d.poiMapNameXForm?(Object.keys(d.poiMapNameXForm).filter((a=>((e,a)=>e===a||0===e.indexOf(a+"."))(e.category,a))).forEach((e=>{d.poiMapNameXForm[e].forEach((e=>a=a.replace(new RegExp(e.replace),e.with)))})),a):a}(a)):c.warn(`Unknown poi in style: ${e.properties.id}`)})))),a}const y=(a,t,n,s)=>{const u=a.replace(/-[^-]*$/,""),o=u===n?"landscape-background":`ordinal: ${s.find(e.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.over(e.lensProp(s),(a=>e.mergeRight(a||{},r)),i),t=e.assoc("id",t.properties.subid,t)}))};l.bus.on("venueData/loadMap",(async()=>{p.then((async t=>{const n=await t.fetchText(t.files.style),s=await t.fetchJson(t.files.theme),u=t.files.spritesheet,o=t.files.glyphs,{id:r,bounds:i,structures:c,venueCenter:p,venueRadius:v,defaultOrdinal:f}=t,b=t.venueList[r].mapTokens?{[r]:[]}:await async function(t){return e.pipe(e.prop("structures"),e.map(e.prop("levels")),e.chain(e.keys),e.prepend(t.id),e.map((e=>t.files.geoJson.replace("${geoJsonId}",e))),e.map(t.fetchJson),e.map(e.andThen((e=>[e.id,y(e.id,e.features,t.id,t.structures)]))),(e=>a.all(e)),e.andThen(e.fromPairs))(t)}(t).then(h),m={mapFeatures:b,mapStyleSource:n,mapTheme:s,badgesSpriteUrl:u,mapGlyphsUrl:o,structures:c,defaultOrdinal:f,venueBounds:{n:i.ne.lat,s:i.sw.lat,e:i.ne.lng,w:i.sw.lng},venueId:r,venueCenter:p,venueRadius:v,accountId:d.accountId,secure:void 0!==d.auth,tileServerAuthInfo:t.tileServerAuthInfo};g.resolve(m),l.bus.send("venueData/mapDataLoaded",m)}))}));const D=e=>null==e.shouldDisplay||e.shouldDisplay;l.bus.on("venueData/loadBuildingSelectorData",(()=>p.then((async a=>{const t={buildings:a.structures.filter(D).map(e.evolve({levels:e.pipe(e.values,e.sortWith([e.descend(e.prop("ordinal"))]))})),structureOrder:a.structureOrder,selectorOrder:a.selectorOrder};return l.bus.send("venueData/buildingSelectorDataLoaded",t),t})))),l.bus.on("venueData/normalizeCoords",(({coords:e})=>p.then((a=>s(e,a.bounds)))));const I={edges:[],nodes:[]};l.bus.on("venueData/loadNavGraph",(async()=>p.then((async e=>{const a={navGraphData:e.files.nav?await e.fetchJson(e.files.nav):I,structures:e.structures};return l.bus.send("venueData/navGraphLoaded",a),a})))),l.bus.on("venueData/loadPoiData",(async()=>p.then((async e=>{const a=d.useOldDataModel?e.files.poisOld||e.files.pois:e.files.pois||e.files.poisOld;if(a){const t=await e.fetchJson(a);l.bus.send("venueData/poiDataLoaded",{pois:t,structures:e.structures})}})))),l.bus.on("venueData/getVenueCenter",(async()=>p.then((async e=>({lat:e.venueCenter[0],lng:e.venueCenter[1],ordinal:0}))))),l.bus.on("venueData/getContentUrl",(({type:e,name:a=""})=>p.then((t=>t.files[e]+a)))),l.bus.on("venueData/getFloorIdToNameMap",(()=>p.then(e.pipe(e.prop("structures"),e.map(e.prop("levels")),e.chain(e.values),e.map(e.props(["id","name"])),e.fromPairs)))),l.bus.on("venueData/getFloorIdName",(({floorId:a})=>p.then((async t=>{const n=e.pipe(e.values,e.find(e.hasPath(["levels",a])))(t.structures);return n?{structureId:n.id,structureName:n.name,floorName:n.levels[a].name}:null}))));const w=(a,t)=>()=>p.then(e.pipe(e.prop(a),e.defaultTo(t)));l.bus.on("venueData/getVenueData",(()=>p)),l.bus.on("venueData/getVenueName",w("name")),l.bus.on("venueData/getVenueCategory",w("category")),l.bus.on("venueData/getVenueTimezone",w("tz")),l.bus.on("venueData/getAccountId",(()=>d.accountId)),l.bus.on("venueData/getVenueId",w("id")),l.bus.on("venueData/getPositioningSupported",w("positioningSupported")),l.bus.on("venueData/getStructures",w("structures")),l.bus.on("venueData/loadNewVenue",(async({venueId:e,accountId:t,assetStage:n=d.assetStage})=>{p.reject(new Error("loadNewVenue called - previous loading ignored")),g.reject(new Error("loadNewVenue called - previous loading ignored")),p=new a,g=new a,b({...d,venueId:e,accountId:t,assetStage:n}).then(m)})),l.bus.on("venueData/changeVenueLanguage",(async({lang:e})=>p.then((async a=>{const t=f(e),n=`${a.bareVenueId}${t.assetSuffix}`;l.bus.send("venueData/loadNewVenue",{accountId:d.accountId,venueId:n})})))),l.bus.on("venueData/getPoiImageUrl",(({imageName:e,size:a})=>`https://img.locuslabs.com/resize/${d.accountId}/${a}cc/poi/${e}`)),l.bus.on("venueData/getDistributionId",(()=>p.then((e=>`${e.bareVenueId}-${d.accountId}`)))),l.bus.on("venueData/getCustomKeywords",(()=>p.then((e=>{const a=d.useOldDataModel&&e.files.searchOld||e.files.search;return e.fetchJson(a)})))),l.bus.on("venueData/isGrabEnabled",w("enableGrab")),l.bus.on("venueData/getGrabPoiIds",w("grabPoiIds",[])),l.bus.on("venueData/getAssetsTimestamp",w("version")),l.bus.on("venueData/getTranslatedFloorId",(async({floorId:e})=>p.then((a=>{const t=l.i18n().language,n=f(t);return`${a.bareVenueId}${n.assetSuffix}-${e.split("-").slice(1).join("-")}`})))),l.bus.on("venueData/getQueueTypes",(()=>p.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=d.deepLinkProps||{},a=e.vid||d.venueId,t=d.useDynamicUrlParams&&e.stage?e.stage:d.assetStage,n=e.accountId||("alpha"===t?"A1VPTJKREFJWX5":d.accountId);b({...d,venueId:a,accountId:n,assetStage:t}).then(m)},runTest:async({testRoutine:e,reset:t=!1,venueData:n=null})=>{let s,u;return(t||n)&&(p=new a,g=new a),n&&(p=a.resolve(n)),await e(),p.v&&(s=await p),g.v&&(u=await g),{venueDataObj:s,mapDataObj:u}},internal:{getDefaultStructureId:v}}}export{l as create};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as t from"ramda";import{findBoundsOfCoordinates as e}from"../../../src/utils/bounds.js";import{global as a}from"../../../src/utils/configUtils.js";const n=async(t,e)=>t?fetch(e,{headers:{Authorization:t}}):fetch(e),s=t=>e=>n(t,e).then((t=>t.json())),o=t=>e=>n(t,e).then((t=>t.text())),l=t=>`https://api.content.locuslabs.com/${t}`,r=(e,a,n,s,o)=>t.mapObjIndexed(((t,a)=>((t,e,a,n,s,o)=>"theme"===o||"style"===o?`${l(a)}/${e}/${o}/${s}/${n}/${o}.json`:t.replace(/https:\/\/content.locuslabs.com/gi,l(a)))(t,e,n,s,o,a)),a),i=async(t,e)=>{const n={alpha:"alpha-a.locuslabs.com",beta:"beta-a.locuslabs.com",gamma:"gamma-a.locuslabs.com",prod:"a.locuslabs.com"},{assetStage:s,venueId:o,accountId:l,formatVersion:i}=t,c=`https://${n[s]||n.prod}/accounts/${l}`,u=i||"v5",d=t.dataFetch&&a[t.dataFetch]&&a[t.dataFetch].getFiles?await a[t.dataFetch].getFiles(t):await e(`${c}/${u}.json`);if(!d[o])throw Error(`Attempt to access venue ${o} which is not within venue list: ${Object.keys(d)}`);const g=d[o].files,h=(t.dataFetch&&a[t.dataFetch]&&a[t.dataFetch].getVenueData?await a[t.dataFetch].getVenueData(t):await e(g.venueData))[o];h.tileServerAuthInfo&&function(t){const e={defaultOrdinal:0,defaultStructureId:"singleBuilding",formatVersion:"v5",structures:{singleBuilding:{name:"singleBuilding",boundsPolygon:[],defaultLevelId:"singleLevel",id:"singleBuilding",levels:{singleLevel:{boundsPolygon:[],clfloor:0,details:"",id:"singleLevel",name:"singleLevel",ordinal:0}}}},structureOrder:["singleBuilding"]};for(const a in e)t[a]=e[a]}(h),h.venueList=d;const m=(t=>{const e=t.deepLinkProps?t.deepLinkProps.contentStage:null;return"alpha"===e||"beta"===e||"prod"===e?e:null})(t);return h.files=m?r(h.category,g,m,l,o):g,h},c=t=>{const{structureOrder:a,structures:n}=t;return a.map((t=>{const a=n[t],s=e(a.boundsPolygon);return{...a,bounds:s}}))};const u=([t,e,...a])=>[e,t,...a],d=(t,e)=>{return!t||!Array.isArray(t)||t.length<1?t:(a=t[0][0],n=e.ne.lng,s=e.sw.lng,(a>n?a<=s:t=>s)?t:t.map(u));var a,n,s};export{c as buildStructures,s as createFetchJson,o as createFetchText,i as getVenueDataFromUrls,d as normalizeCoords};
|
|
@@ -1 +0,0 @@
|
|
|
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={};let a={};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){return t.x?"Security Checkpoint":""===t.t?"Ground":t.t}(t),r="escalator"!==e.toLowerCase()&&"stairs"!==e.toLowerCase(),i=f(t.s,t.d,n),s=t.l||i/60,l=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]}}))),u=t.p?l(t.p):null;return{distance:i,dst:t.d,o:t.o,isAccessible:r,isDriveway:!o(t.h)&&!t.h,src:t.s,transitTime:s,type:e,path:u,weight:s}}(t,d))));const h=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):C(t.ordinal,o,n,d)};return{_nodes:d,_geoDb:c,findClosestNode:(t,o,n)=>w(t,o,n,c,d),findShortestPath:(t,o,n)=>function(t,o,n,e={}){return I(h(t),h(o),n,a,u,e)}(t,o,d,n),findAllShortestPaths:function(t,o,n){const e=h(t),r=o.map((t=>h(t)));return e&&r.length?function(t,o,n,e={},r={},i={}){return o.map((o=>{try{return I(t,o,n,e,r,i)}catch(t){return null}}))}(e,r,d,a,u,n):[]},floorIdToOrdinal:s,floorIdToStructureId:l,updateWithSecurityWaitTime:function(t){a=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={}){for(t.id===g&&m===JSON.stringify(s)||(y(),p.offerWithPriority(t.id,0),c[t.id]=0,h[t.id]=!0,g=t.id,m=JSON.stringify(s));!p.isEmpty()&&!h[o.id];){const t=n[p.poll()],o=c[t.id];for(let n=0;n<t.edges.length;n++){const l=t.edges[n];if(h[l.dst])continue;if(s.requiresAccessibility&&!l.isAccessible)continue;let u=l.weight;if(l.o&&e[l.o]){const t=e[l.o];t.queueTime&&(u=t.queueTime),t.isTemporarilyClosed&&(u=9999),l.securityWaitTimes=t}if(l.o&&i[l.o]){l.securityLane=i[l.o];const{type:t,id:o}=i[l.o],n=r(["selectedSecurityLanes",t],s);if(n&&!n.includes(o))continue}void 0===c[l.dst]?(a[l.dst]=t,c[l.dst]=o+u,p.offerWithPriority(l.dst,o+u)):c[l.dst]>o+u&&(c[l.dst]=o+u,a[l.dst]=t,p.raisePriority(l.dst,o+u))}h[t.id]=!0}if(!h[o.id])return null;const l=[];let u=o;for(;u;)l.push(u),u=a[u.id];return l.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,e){let r=b(t,o,n,8);return r.length>0?r:(r=b(t,o,n,7),r.length>0?r: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 S(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 C(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 S(r)}function S(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,C as findClosestNodeByOrdinal,I as findShortestPath};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{compose as e,not as t,includes as r,__ as a,toLower as n,prop as s,find as c,drop as u,last as i,propEq as T}from"ramda";import{findBoundsOfWaypoints as o}from"../../../src/utils/bounds.js";import A from"./segmentBadges.js";import _ from"./segmentCategories.js";function R(e,t="",r="",a,n,c={}){return e.map(((u,T)=>{const R=N("securityWaitTimes")(u.waypoints),L=R&&!R.isTemporarilyClosed?R.queueTime:Math.round(1===(W=u.waypoints).length?W[0].eta:W.map(s("eta")).slice(1).reduce(((e,t)=>e+t),0));var W;const y=Math.round(function(e){return 1===e.length?e[0].distance:e.map((e=>e.distance)).slice(1).reduce(((e,t)=>e+t),0)}(u.waypoints)),I=function(e){switch(e){case _.START:return A.START;case _.WALKING_TO_END:return A.END;case _.ELEVATOR:return A.ELEVATOR;case _.ELEVATOR_UP:return A.ELEVATOR_UP;case _.ELEVATOR_DOWN:return A.ELEVATOR_DOWN;case _.STAIRS:return A.STAIRS;case _.STAIRS_UP:return A.STAIRS_UP;case _.STAIRS_DOWN:return A.STAIRS_DOWN;case _.ESCALATOR:return A.ESCALATOR;case _.ESCALATOR_UP:return A.ESCALATOR_UP;case _.ESCALATOR_DOWN:return A.ESCALATOR_DOWN;case _.WALKING_TO_PORTAL:case _.WALK:case _.WALK_DOWN:case _.WALK_UP:return A.WALK;case _.TRAIN:return A.TRAIN;case _.TRAIN_UP:return A.TRAIN_UP;case _.TRAIN_DOWN:return A.TRAIN_DOWN;case _.BUS:return A.BUS;case _.BUS_UP:return A.BUS_UP;case _.BUS_DOWN:return A.BUS_DOWN;case _.SECURITY_CHECKPOINT:return A.SECURITY_CHECKPOINT;case _.RAMP:return A.RAMP;case _.RAMP_UP:return A.RAMP_UP;case _.RAMP_DOWN:return A.RAMP_DOWN;default:return A.WALK}}(u.segmentCategory),m=function(e,t){let r;switch(e){case _.START:r=0;break;case _.WALKING_TO_END:r=t.length-1;break;case _.WALKING_TO_PORTAL:r=Math.min(t.length-1,Math.ceil(t.length/2));break;default:r=t.length-1}return t[r].position}(u.segmentCategory,u.waypoints),p=function(e,t,r,a,n,s){const c=e[t];switch(c.segmentCategory){case _.START:return O(c.waypoints[0].position,r);case _.WALKING_TO_END:return O(c.waypoints[c.waypoints.length-1].position,a);case _.WALKING_TO_SECURITY_CHECKPOINT:case _.WALKING_TO_PORTAL:return s(`wayfinder:${e[t+1].type}`);case _.SECURITY_CHECKPOINT:case _.ELEVATOR:case _.ELEVATOR_DOWN:case _.ELEVATOR_UP:case _.ESCALATOR:case _.ESCALATOR_DOWN:case _.ESCALATOR_UP:case _.STAIRS:case _.STAIRS_DOWN:case _.STAIRS_UP:return function(e,t){return t[i(e.waypoints).position.floorId]}(c,n);default:return s(`wayfinder:${c.type}`)}}(e,T,t,r,a,n),P=function(e,t,r,a){const n=S(t,a);switch(e.segmentCategory){case _.START:return a("wayfinder:Begin route at");case _.ELEVATOR:return a("wayfinder:Take elevator to");case _.ELEVATOR_UP:return a("wayfinder:Take elevator up to");case _.ELEVATOR_DOWN:return a("wayfinder:Take elevator down to");case _.STAIRS:return a("wayfinder:Take stairs to");case _.STAIRS_UP:return a("wayfinder:Take stairs up to");case _.STAIRS_DOWN:return a("wayfinder:Take stairs down to");case _.ESCALATOR:return a("wayfinder:Take escalator to");case _.ESCALATOR_UP:return a("wayfinder:Take escalator up to");case _.ESCALATOR_DOWN:return a("wayfinder:Take escalator down to");case _.WALK:case _.WALKING_TO_SECURITY_CHECKPOINT:case _.WALKING_TO_PORTAL:case _.WALKING_TO_END:return n("Walk <1 minute to","Walk xx minute to");case _.WALK_DOWN:return n("Walk <1 minute down to","Walk xx minute down to");case _.WALK_UP:return n("Walk <1 minute up to","Walk xx minute up to");case _.TRAIN:return n("Take train <1 minute","Take train xx minute");case _.BUS:return n("Take bus <1 minute","Take bus xx minute");case _.SECURITY_CHECKPOINT:return r?a("wayfinder:Through _security_ to",{name:r}):a("wayfinder:Through security to");case _.RAMP:return a("wayfinder:Take ramp to");case _.RAMP_UP:return a("wayfinder:Take ramp up to");case _.RAMP_DOWN:return a("wayfinder:Take ramp down to");default:return""}}(u,L,d(c,u.waypoints),n),w={primaryText:p,secondaryText:P,icon:I,animationAnchor:m,eta:L,distance:y,bounds:o(u.waypoints),isAccessible:E(u),securityWaitTimes:R};return u.poiId&&(w.poiId=u.poiId),w}))}function O(e,t){return e.name?e.name:t}const S=(e,t)=>(r,a)=>0===e?t("wayfinder:"+r):t("wayfinder:"+a,{count:e}),E=e(t,r(a,["escalator","stairs"]),n,s("type")),d=(e,t)=>{const r=N("securityLane")(t);if(!r)return;const a=s(r.type,e),n=c(T("id",r.id),a);return s("displayText",n)},N=t=>e(s(t),c(s(t)),u(1));export{R as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as t from"ramda";import n from"zousan";import{buildStructuresLookup as o}from"../../../src/utils/buildStructureLookup.js";import{distance as e}from"../../../src/utils/geodesy.js";import{findRoute as i}from"./findRoute.js";import{createNavGraph as r}from"./navGraph.js";import{enrichDebugNavGraph as a}from"./navGraphDebug.js";import{buildSegments as s}from"./segmentBuilder.js";const u={SECURITY:"SecurityLane",IMMIGRATION:"ImmigrationLane"};function d(d,p){const l=d.log.sublog("wayfinder"),c=async()=>{d.bus.send("venueData/loadNavGraph")};let f=new n;d.bus.on("wayfinder/_getNavGraph",(()=>f)),d.bus.on("venueData/navGraphLoaded",(async({navGraphData:t,structures:n})=>{const e=o(n),i=await y(),a=r(t,e.floorIdToOrdinal,e.floorIdToStructureId,i);f.resolve(a)}));const y=async()=>{const n=await d.bus.get("poi/getByCategoryId",{categoryId:"security"});return t.pipe(t.map(m),t.filter(t.identity))(n)},m=n=>n.queue&&{type:t.path(["queue","queueType"],n),id:t.path(["queue","queueSubtype"],n)};d.bus.on("wayfinder/showNavLineFromPhysicalLocation",(async({toEndpoint:t,selectedSecurityLanes:n=null,requiresAccessibility:o})=>async function(t,n,o){const e=await b({fromEndpoint:t,toEndpoint:n,options:o});if(e){const{segments:t}=e;o.primary&&d.bus.send("map/resetNavlineFeatures"),d.bus.send("map/showNavlineFeatures",{segments:t,alternative:!o.primary})}return e}(await d.bus.get("user/getPhysicalLocation"),t,{selectedSecurityLanes:n,requiresAccessibility:o,primary:!0})));const I=(t,n)=>d.bus.get("poi/getById",{id:t}).then((o=>{if(o&&o.position)return w(o,n);throw Error("Unknown POI ID "+t)}));const g=["lat","lng","floorId","ordinal"],h=t.pipe(t.pick(g),t.keys,t.propEq("length",g.length),Boolean),w=(t,n)=>({lat:t.position.latitude,lng:t.position.longitude,floorId:t.position.floorId,ordinal:n(t.position.floorId),title:t.name});async function b({fromEndpoint:t,toEndpoint:n,options:o={}}){return f.then((async e=>{o.compareFindPaths=p.compareFindPaths;const r=i(e,t,n,o);if(!r)return null;t.floorId&&n.floorId&&v(t,n,r);const a=await d.bus.get("venueData/getFloorIdToNameMap"),u=await d.bus.get("venueData/getQueueTypes"),c=d.gt(),{steps:f,segments:y}=s(r.waypoints,t,n,a,c,u);l.info("route",r);const m=Math.round(r.waypoints.reduce(((t,{eta:n})=>t+n),0)),I=Math.round(r.waypoints.reduce(((t,{distance:n})=>t+n),0));return{...r,segments:y,steps:f,time:m,distance:I}}))}d.bus.on("wayfinder/getNavigationEndpoint",(({ep:t})=>async function(t){return f.then((n=>{if(!t)throw Error("wayfinder: Invalid endpoint definition",t);if("number"==typeof t)return I(t,n.floorIdToOrdinal);if("string"==typeof t){if(t.match(/^\d+$/))return I(parseInt(t),n.floorIdToOrdinal);if(t.indexOf(",")>0){let[o,e,i,r]=t.split(",");if(!n.floorIdToStructureId(i))throw Error("Unknown floorId in endpoint: "+i);return r||(r="Starting Point"),{lat:parseFloat(o),lng:parseFloat(e),ordinal:n.floorIdToOrdinal(i),floorId:i,title:r}}}if(h(t))return t;if(t.latitude)return{lat:t.latitude,lng:t.longitude,floorId:t.floorId,ordinal:n.floorIdToOrdinal(t.floorId),title:t.title};if(t.position&&t.name)return w(t,n.floorIdToOrdinal);throw Error("Invalid start or end point: "+t)}))}(t))),d.bus.on("wayfinder/checkIfPathHasSecurity",(({fromEndpoint:n,toEndpoint:o,options:e={}})=>f.then((r=>{e.compareFindPaths=p.compareFindPaths;const a=i(r,n,o,e);if(!a)return{routeExists:!1};const s=n=>Boolean(a.waypoints.find(t.pathEq(["securityLane","type"],n)));return{routeExists:!0,queues:a.waypoints.filter((n=>t.pathEq(["securityLane","type"],u.SECURITY,n)||t.pathEq(["securityLane","type"],u.IMMIGRATION,n))),hasSecurity:s(u.SECURITY),hasImmigration:s(u.IMMIGRATION)}})))),d.bus.on("wayfinder/getRoute",b);const v=(t,n,o)=>d.bus.send("session/submitEvent",{type:"navigation",startPosition:{venueId:t.floorId.split("-")[0],buildingId:o.waypoints[0].position.structureId,floorId:o.waypoints[0].position.floorId,lat:o.waypoints[0].position.lat,lng:o.waypoints[0].position.lng},endPosition:{venueId:n.floorId.split("-")[0],buildingId:o.waypoints[o.waypoints.length-1].position.structureId,floorId:o.waypoints[o.waypoints.length-1].position.floorId,lat:o.waypoints[o.waypoints.length-1].position.lat,lng:o.waypoints[o.waypoints.length-1].position.lng}});function T(t){return S(t,"transitTime")}function E(t){return S(t,"distance")}function S(n,o){return t.aperture(2,n).map((([n,o])=>{return(e=o.id,n=>t.find((t=>t.dst===e),n.edges))(n);var e})).map(t.prop(o)).reduce(((t,n)=>t+n),0)}function L(t,n){return t.distance=e(n.lat,n.lng,t.position.latitude,t.position.longitude),t}return d.bus.on("wayfinder/addPathTimeSingle",(async({poi:t,startLocation:n,options:o={}})=>n?f.then((e=>function(t,n,o,e){const i=w(o,t.floorIdToOrdinal),r=t.findShortestPath(e,i,n);if(!r)return(o=L(o,e)).transitTime=o.distance/60,o;return Object.assign(o,{transitTime:T(r),distance:E(r)})}(e,o,t,n))):t)),d.bus.on("wayfinder/addPathTimeMultiple",(async({pois:t,startLocation:n,options:o={}})=>n?f.then((e=>function(t,n,o,e){try{const i=o.map((n=>w(n,t.floorIdToOrdinal))),r=t.findAllShortestPaths(e,i,n);return o.map(((t,n)=>function(t,n,o){n&&n.length?t=Object.assign(t,{transitTime:T(n),distance:E(n)}):(t=L(t,o)).transitTime=t.distance/60;return t}(t,r[n],e)))}catch(t){return l.error(t),o}}(e,o,t,n))):t)),d.bus.on("venueData/loadNewVenue",(()=>{f=new n,c()})),d.bus.on("poi/setDynamicData",(({plugin:t,idValuesMap:n})=>{"security"===t&&f.then((t=>t.updateWithSecurityWaitTime(n)))})),d.bus.on("wayfinder/getNavGraphFeatures",(()=>f.then((({_nodes:t})=>a(t))))),{init:c,internal:{resolveNavGraph:t=>f.resolve(t),prepareSecurityLanes:y}}}export{u as SecurityLaneType,d as create};
|
package/lib/src/app.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"IObject";import n from"query-string";import{map as t,mergeDeepRight as o}from"ramda";import i from"zousan-plus";import r from"../package.json.js";import a 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";import g from"./utils/i18n.js";const c="undefined"!=typeof window;async function d(e,n,t){let o=n;if(o.includes("/")){const e=o.split("/");o=e[e.length-1]}if(void 0!==t.active){if(!1===t.active||"notLocalhost"===t.active&&e.env.isLocalhost())return e.log.info(`Plugin ${n} explicitly deativated`),null;e.log.info(`Plugin ${n} being instantiated!`,JSON.stringify(t))}else e.log.info(`Plugin ${n} being instantiated!`,JSON.stringify(t));return import(`../plugins/${n}/src/${o}.js`).then((o=>(e.log.info(`Creating plugin ${n}`),o.create(e,t))))}async function p(e){return c?import(`./configs/${e}.json`):import(`./configs/${e}.json.js`)}async function m(e,n){let t={};const i=await Promise.all(n.map(p));for(const e of i){let n=e.default;n=n.extends?await m(n,n.extends):n,t=o(t,n)}return t=o(t,e),t}const f=e=>n=>import(`./configs/postproc-${e}.js`).then((e=>e.process(n)));async function y(o){const p=Object.create(null);let y=o.extends?await m(o,o.extends):o;y.plugins.monitoring&&import("../_virtual/_empty_module_placeholder.js").then((e=>e.activate(y))),y=await(async e=>e.configPostProc?i.series(e,...e.configPostProc.map(f)):e)(y);const w=(e=>{const t=e.supportedLanguages||["ar","en","es","fr","ja","ko","zh-Hans","zh-Hant"];if("undefined"!=typeof window){let e=n.parse(location.search).lang||navigator.language;for(;e;){if(e&&t.includes(e))return e;e=e.substring(0,e.lastIndexOf("-"))}}return e.defaultLanguage||"en"})(y),h=await g(w,{debug:y.debug});p.i18n=()=>h,p.gt=()=>h.t.bind(h),p.config=y,p.plugins=new e;const b=u("web-engine",{enabled:!!y.debug,isBrowser:c,color:"cyan",logFilter:y.logFilter,truncateObjects:!c});if(p.log=b.sublog(y.name),p.bus=l({trace:!1,showEvents:!0,reportAllErrors:!0,log:b}),p.info={wePkg:r},"undefined"!=typeof window&&(y.debug?(p.debug=t((e=>e.bind(p)),a),a.dndGo.call(p)):p.debug={},window._app=p,window.document&&window.document.title&&y.setWindowTitle&&(document.title=y.name)),p.env=s(p),y.theme?await i.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:n,ThemeManagerModule:t})=>{const o=t.initThemeManager(p);p.themePack=await o.buildTheme(y.theme,y.defaultTheme),e.initLayerManager(p),n.initHistoryManager(p),p.destroy=()=>e.destroy(p)})):p.destroy=()=>{},y.plugins){for(const e in y.plugins)try{const n=y.plugins[e];if(p.plugins[e])throw Error(`Duplicate plugin name "${e}"`);const t=await d(p,e,n);t&&(p.plugins=p.plugins.set(e,t))}catch(n){b.error("Error instantiating plugin "+e),b.error(n)}for(const e in p.plugins)p.plugins[e].init()}return p}export{y as create};
|
package/lib/src/auth/Auth.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
async function t(t,e){const o=await(async()=>{if(!t||!t.type)throw Error("No authentication type found in config");return Promise.resolve((t=>{switch(t.type){case"ms":return"MSAuth";case"cognito":return"CognitoAuth";case"google":return"GoogleAuth";default:throw Error(`Unknown auth type: '${t.type}'`)}})(t)).then((t=>import(`./${t}`))).then((o=>o.default(t.config,e)))})();return{getToken:async()=>o.getToken(),isLoggedIn:async()=>o.isLoggedIn(),federatedLogin:async()=>o.federatedLogin(),logout:()=>o.logout(),getAccountInfo:()=>o.getAccountInfo(),getType:()=>t.type}}export{t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"query-string";const e={navFrom:"online/getDirectionsFromTo",navTo:"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",refInstallId:"analytics2"};function n(n,o,r){if(void 0!==o.lldebug)try{n.debug=JSON.parse(o.lldebug),null===n.debug&&(n.debug={})}catch(e){n.debug=!0}return Object.keys(e).forEach((i=>{if(void 0!==o[i]){let a=e[i];Array.isArray(a)||(a=[a]),a.forEach((e=>{let a=n.plugins[e];!a&&r&&(a=n.plugins[e]={}),a.deepLinkProps={...a.deepLinkProps,[i]:o[i]}}))}})),o.poiId&&o.showNav&&delete n.plugins["online/poiView"].deepLinkProps.poiId,n}export{n as setDeepLinksForParms};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "SDK headless",
|
|
3
|
-
"plugins": {
|
|
4
|
-
"analytics2": {
|
|
5
|
-
"productName": "LocusMaps JS SDK",
|
|
6
|
-
"active": false,
|
|
7
|
-
"disableSending": false
|
|
8
|
-
},
|
|
9
|
-
"clientAPI": {},
|
|
10
|
-
"dynamicPois": {},
|
|
11
|
-
"poiDataManager": {},
|
|
12
|
-
"sdkServer": { },
|
|
13
|
-
"searchService": {},
|
|
14
|
-
"venueDataLoader": {
|
|
15
|
-
"assetStage": "prod",
|
|
16
|
-
"formatVersion": "v5",
|
|
17
|
-
"availableLanguages": [
|
|
18
|
-
{
|
|
19
|
-
"langCode": "en",
|
|
20
|
-
"assetSuffix": ""
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
},
|
|
24
|
-
"wayfinder": {
|
|
25
|
-
"compareFindPaths": false
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import o from"zousan";const n=(o,n)=>o.splice(n,1)[0],t=(o,t)=>{let r=0;do{r=o.indexOf(t,r),r>=0&&n(o,r)}while(r>=0);return o};function r(n){const r=n.log?n.log.sublog?n.log.sublog("bustle",{color:"pink"}):n.log:console,e={},s={};function c(o,n){e[o]&&t(e[o],n)}function u(o,n){s[o]&&t(s[o],n)}function l(t,c){return n.trace&&(c||(c={}),c._stack=Error().stack),n.showEvents&&("function"==typeof n.showEvents?n.showEvents(t,c)&&r.info("send with",t," and ",c):r.info("send with",t," and ",c)),new o((u=>o.soon(((t,c,u)=>()=>{const l=e[t],f=s[t],i=[];if(l)for(const t of l)try{i.push(t(c))}catch(t){n.reportAllErrors&&r.error(t),n.rejectOnError?i.push(o.reject(t)):i.push(t)}const h=o.all(i);if(f)for(const o of f)try{o(c,h)}catch(o){n.reportAllErrors&&r.error(o)}u(h)})(t,c,u))))}return{get:(n,t)=>l(n,t).then((t=>1!==t.length?o.reject(`${n} event did not return a single result, but ${t.length} results.`):t[0])),moff:u,monitor:function(o,n){return s[o]||(s[o]=[]),s[o].push(n),()=>u(o,n)},off:c,on:function(o,n){return e[o]||(e[o]=[]),e[o].push(n),()=>c(o,n)},send:l}}export{r as create};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e={black:"[30m",red:"[31m",green:"[32m",yellow:"[33m",blue:"[34m",magenta:"[35m",cyan:"[36m",white:"[37m"};function o(n,r){const t=function(o,n={}){let r=o+": ",t=null;if(n.color)if(n.isBrowser)r="%c"+r,t=`color: ${n.color}`;else{const o=e[n.color];o&&(r=o+r)}const l=(e,o)=>e&&e.length>o?e.substring(0,o)+"...":e,c=(e,o)=>"string"==typeof o?e[0].includes(o):o.test(e[0]);function s(e){return function(){if(void 0===n.enabled||!!n.enabled||e===console.error){let o=Array.from(arguments);t&&o.unshift(t),o.unshift(r),n.truncateObjects&&e!==console.error&&(o=o.map((e=>"object"==typeof e?l(JSON.stringify(e),parseInt(n.truncateObjects)||100):e))),(!n.logFilter||c(o,n.logFilter)||e===console.error)&&e.apply(console,o)}}}const i=s(console.log);return i.info=i,i.warn=s(console.warn),i.detailed=s(console.debug),i.error=s(console.error),i.setEnabled=e=>{n.enabled=e},i}(n,r);return t.sublog=(e,t)=>o(n+"."+e,Object.assign(Object.create(r),t)),t}export{o as initLog};
|
package/lib/src/utils/funcs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import n from"zousan";let t=null;const e=n=>function(){return t=t?t.then((()=>n.apply(null,arguments))):n.apply(null,arguments),t},o=t=>{const e=e=>new n((n=>setTimeout(n,t,e))),o=new n((n=>setTimeout(n,t)));return e.then=o.then.bind(o),e};function u(n,t){const e={};return Object.keys(t).forEach((o=>{n(o,t[o])&&(e[o]=t[o])})),e}export{o as delay,u as filterOb,e as singleFile};
|
package/lib/src/utils/geom.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as n from"ramda";const e=(n,e)=>{const t=n[0],r=n[1];let l=!1;for(let n=0,o=e.length-1;n<e.length;o=n++){const u=e[n][0],s=e[n][1],c=e[o][0],i=e[o][1];s>r!=i>r&&t<(c-u)*(r-s)/(i-s)+u&&(l=!l)}return l};function t(t,l,u,s){if(!n.length(t))return null;t=t.filter((n=>null==n.shouldDisplay||!0===n.shouldDisplay));const c=n.curry(e)([l,u]),i=t.filter(n.compose(c,r));if(0===i.length)return null;if(1===i.length&&!s)return n.head(i);const d=i.filter(n.compose(c,n.prop("boundsPolygon")));return 1===d.length?n.head(d):d.length?o(i):s?null:o(i)}const r=n=>{const{n:e,s:t,e:r,w:l}=n.bounds;return[[e,r],[e,l],[t,l],[t,r]]},l=n=>{if(!n.bounds)return 0;const{n:e,s:t,e:r,w:l}=n.bounds;return Math.abs((e-t)*(r-l))},o=n=>{return n.reduce((e=l,(n,t)=>e(n)<e(t)?n:t));var e},u=(n,e)=>Object.values(n.levels).reduce(((n,t)=>t.ordinal===e?t:n),void 0),s=(n,e)=>n.reduce(((n,t)=>Object.values(t.levels).reduce(((n,t)=>t.id===e?t:n),null)||n),void 0);function c(n,e,r,l,o){const s=t(n,e,r,o);return{building:s,floor:s?u(s,l):null}}const i=(n,e,t,r,l)=>c(n,e,t,r,l).floor;function d(n,e,t,r,l,o,u,s){let c=0,i=0,d=0,f=0,a=0;const h=[{x:n,y:e}];for(let g=1,p=0;g<=20;++g)p=g/20,c=1-p,i=c*c,d=i*c,f=p*p,a=f*p,h.push({x:d*n+3*i*p*t+3*c*f*l+a*u,y:d*e+3*i*p*r+3*c*f*o+a*s});return h}export{d as bezierCurveTo,c as getBuildingAndFloorAtPoint,s as getFloor,i as getFloorAt,t as getStructureAtPoint,u as ordToFloor,e as pointInPolygon};
|
package/lib/src/utils/i18n.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import n from"i18next";async function e(e,{debugMode:t,fallbackLng:a}){const o=n.createInstance();return o.init({debug:t,interpolation:{escapeValue:!1},resources:{en:{translation:{"Walk xx minutes to":"Walk {{count}} minute to","Walk xx minutes to_plural":"Walk {{count}} minutes to"}}},fallbackLng:void 0===a?"en":a,lng:e,postProcess:["pseudoTrans"]}).then((()=>(t&&o.on("missingKey",(function(n,e,t,a){console.error("i18nNext: key not found. Language: "+o.language+", Key: "+t+", namespace: "+e+", lngs: ",n)})),o)))}const t={ar:"بال عن أمام الأخذ البرية. ثم كما وقام شاسعة الجنوبي, أمدها الإمداد عن انه. ٣٠ فكانت والكساد انه. أساسي الشمال الإتفاقية بال أم. زهاء المؤلّفة حين عل, سكان قررت هذه ان, شعار باستخدام ولم مع.\n\nدول الأمور الصفحة الأوروبية قد. تم حدى فاتّبع الهجوم, ما أوسع معاملة فعل, خلاف الأوروبية، إيو كل. تُصب واندونيسيا، حين قد. أي حاول حقول وهولندا، هذا, بين عن لهيمنة بالسيطرة.\n\nأعمال الإتحاد العمليات من وصل. وقوعها، باستخدام قد أخر, بل حتى علاقة التبرعات. فقد لم الأرض استبدال. حتى الخاسر اقتصادية بـ. أصقاع أعلنت اتفاقية تلك بل, كان إذ بحشد أخرى ليبين. الشتاء، اليابان، مكن أم, به، قد العالم، أوراقهم, بل لعدم لغزو أواخر مكن.\n",ja:"私は場合いよいよある所有らってのの末がしたた。無論結果に圧迫顔もよくその発展ないですまでを決するてみるでしでも発展云いませたから、そうには描いたないたた。機会へ載っない方は別に今をひょろひょろでずまし。むしろ嘉納さんを意味方面そう#「を積んない権力この自分何か記念をというおお尋ねだろででですで、ある今はこれか頼み例があるで、ネルソンさんののの引込のあなたにもっともお努力といと私赤に実建設が起っようにとやかくご附随を描いですましから、どうもとにかく相違に云おでてならますのが行っないませ。"},a=(n,e)=>"en"===e?n:o(n,t[e]),o=(n,e)=>n.length<e.length?e.substring(0,n.length):e;export{e as default,a as toLang};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{lib → dist}/src/env.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|