atriusmaps-node-sdk
Version:
This project provides an API to Atrius Personal Wayfinder maps within a Node environment. See the README.md for more information
2 lines (1 loc) • 2.71 kB
JavaScript
import{setDeepLinksForParms as e}from"../src/configs/postproc-mol-url-parms.js";import{setStateFromStateString as i}from"../src/configs/postproc-stateTracking.js";import{filterOb as n}from"../src/utils/funcs.js";function t(t){const{name:s,debug:a,headless:r,theme:l,defaultSearchTerms:c,venueId:p,accountId:u,poiCategories:d,preserveStateInURL:g,supportURLDeepLinks:h,initState:m,deepLinkParms:f,uiHide:S,renderDiv:v,parentConfig:k,desktopViewMinWidth:P,forceDesktop:L,hostAppId:A,hostAppVersion:w,hostAppProperties:V,logFilter:b,searchPlaceholder:y,dataFetch:D,engineName:I,dynamicPoisUrlBaseV1:Z,plugins:j,anaytics2ActiveFlag:F,enablePoiSelection:O,minZoom:R,maxZoom:T,noLangOptions:U,pinnedLocation:x,pinnedLocationZoom:C,pinnedLocationFocusAtStart:M}=t,W=k?[k]:r?["sdkHeadless"]:["sdkVisual"],z=(e,i)=>e&&e.length>i?e.substring(0,i):e,H={name:s,engineName:I,extends:W,debug:a,logFilter:b,theme:l,uiHide:S,renderDiv:v,configPostProc:[],plugins:{venueDataLoader:{dataFetch:D,venueId:p,accountId:u},sdkServer:{headless:r},analytics2:{hostAppId:(e=>e?z(e.toString(),128):void 0)(A),hostAppVersion:(e=>e?z(e.toString(),128):void 0)(w),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 t=z(n.toString().replaceAll(/[^a-zA-Z0-9_]/g,""),128);t.match(/^[a-zA-Z]+/)||(t="X"+t);let o=e[n];null==o&&(o=""),o=z(o.toString(),128),i[t]=o})),i})(V)}},uuid:"undefined"!=typeof document&&document&&document.location?document.location.host:"unknown"};void 0!==F&&(H.plugins.analytics2.active=F);const B=(e,i)=>void 0!==i?{[e]:i}:{};return r||(H.plugins["online/headerOnline"]={searchPlaceholder:y},H.plugins.mapRenderer={...B("enablePoiSelection",O),viewLimits:{...B("maxZoom",T),...B("minZoom",R)}},H.plugins.userMenu={noLangOptions:U},x&&(H.plugins["online/pinnedLocation"]={location:x,zoom:C,focusAtStart:M})),H.plugins.searchService=c?{defaultSearchTerms:c}:{},o(t,"defaultSearchTerms",H.plugins.searchService),W.includes("sdkVisual")&&(H.plugins["online/homeView"]=d?{poiCategories:d}:{},o(t,"poiCategories",H.plugins["online/homeView"])),j&&(j.draw&&(H.plugins.draw=j.draw),j.flightStatus&&(H.plugins.flightStatus=j.flightStatus,H.plugins["online/flightDetails"]={},H.plugins["online/flightDetailsSearch"]={})),g&&(H.configPostProc.push("stateTracking"),H.plugins.deepLinking={trackURL:!0}),h&&H.configPostProc.push("mol-url-parms"),m&&i(H,atob(m),!0),f&&e(H,new URLSearchParams(f),!0),void 0!==P&&(H.desktopViewMinWidth=P),L&&(H.desktopViewMinWidth=0),Z&&(H.plugins.dynamicPois={urlBaseV1:Z}),n(((e,i)=>void 0!==i),H)}function o(e,i,n){Object.keys(e).filter((e=>e.startsWith(i+"-"))).forEach((i=>n[i]=e[i]))}export{t as default};