@expofp/floorplan 3.1.15 → 3.2.0

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.
Files changed (67) hide show
  1. package/dist/browser/{CookieConsent-DluMvGt6.js → CookieConsent-gKZhRrjU.js} +32 -32
  2. package/dist/browser/{Debug-CGnX5qe7.js → Debug-Bbf66dnY.js} +6 -6
  3. package/dist/browser/{Demo-Bu1AOhOV.js → Demo-DBe82WQ6.js} +8 -8
  4. package/dist/browser/{Free-BstWtm-f.js → Free-DY_s2By3.js} +8 -8
  5. package/dist/browser/{Gallery-DhebOmxN.js → Gallery-DLEk_p5s.js} +8 -8
  6. package/dist/browser/{GpsLoader-D1BK1w6_.js → GpsLoader-DgQfhTqc.js} +8 -8
  7. package/dist/browser/{KioskStore-d59lnQNQ.js → KioskStore-CbyS4173.js} +3 -3
  8. package/dist/browser/{Mapbox-DT1R9lUO.js → Mapbox-QZ22Nh3z.js} +8 -8
  9. package/dist/browser/{SetKioskMode-KjSm7FzV.js → SetKioskMode-D014Wqhw.js} +7 -7
  10. package/dist/browser/{ShowKiosk-DuRFoj0_.js → ShowKiosk-CWYuE-yB.js} +9 -9
  11. package/dist/browser/{ThreeComponent-CEaPMpZs.js → ThreeComponent-BIW0yYXC.js} +9 -9
  12. package/dist/browser/{TouchHand-BLrmIEBK.js → TouchHand-DGxuS4O_.js} +4 -4
  13. package/dist/browser/{ViewerMenuPanel-qlA-KjBM.js → ViewerMenuPanel-DNppazX1.js} +7 -7
  14. package/dist/browser/{add-debug-secret-listener-DsegLEg-.js → add-debug-secret-listener-DNDSXFbz.js} +1 -1
  15. package/dist/browser/{boolean-editor-DKRVWRdP.js → boolean-editor-BX26HOsb.js} +10 -10
  16. package/dist/browser/{bootIntercom-CcvH4xaF.js → bootIntercom-8tb4_Emd.js} +1 -1
  17. package/dist/browser/{box-8fbRgl8D.js → box-c6-Ohm30.js} +5 -5
  18. package/dist/browser/{browser-BxSSsVWN.js → browser-Cw6KspTz.js} +2 -2
  19. package/dist/browser/bundle.json +53 -53
  20. package/dist/browser/{classnames-BrwghLjW.js → classnames-nXG1DBsV.js} +2 -2
  21. package/dist/browser/{client-y-v5N8Iq.js → client-CrSyex0f.js} +4 -4
  22. package/dist/browser/{data-DU74SK6X.js → data-BxocA-DZ.js} +3 -3
  23. package/dist/browser/debug-overlay-BWJaXoX0.js +1419 -0
  24. package/dist/browser/{debug-ui-Bbqu_7Wt.js → debug-ui-BlrYPttX.js} +6 -6
  25. package/dist/browser/{dist-BayrGxrB.js → dist-Bv9XsoP-.js} +6 -6
  26. package/dist/browser/{dist-Yrkvytqo.js → dist-CnhrlNBP.js} +5 -5
  27. package/dist/browser/{dist-ZLtFEWxN.js → dist-olVYsr6W.js} +3 -3
  28. package/dist/browser/{efp-debug-init-DNAHPotu.js → efp-debug-init-C-Xg10FP.js} +2 -2
  29. package/dist/browser/{enum-editor-DfiVoecn.js → enum-editor-CI8k7X9T.js} +11 -11
  30. package/dist/browser/{exports-C0EMA39e.js → exports-D1MJjHrR.js} +1 -1
  31. package/dist/browser/{favicon-CSgaZCRF.js → favicon-B5dazYTw.js} +1 -1
  32. package/dist/browser/{fetch-retry.umd-hiCeL3Xo.js → fetch-retry.umd-BV6WUlyF.js} +2 -2
  33. package/dist/browser/{flex-BhV72ONc.js → flex-DKO8gNsP.js} +6 -6
  34. package/dist/browser/{flex.props-CdSeYrhP.js → flex.props-CxuE8QTx.js} +2 -2
  35. package/dist/browser/{floorplan.loader-DD-dbQW1.js → floorplan.loader-BJGruogH.js} +12 -9
  36. package/dist/browser/{floorplan.ready-OPRco6vT.js → floorplan.ready-DqqAsiyG.js} +16 -13
  37. package/dist/browser/{fuse-CuCsVPmV.js → fuse-D6xTwO8k.js} +2 -2
  38. package/dist/browser/index.js +30 -27
  39. package/dist/browser/{is-debug-BNuBiGG6.js → is-debug-BTYeCS1r.js} +8 -12
  40. package/dist/browser/{jsx-runtime-DNJLxYWQ.js → jsx-runtime-CYRizIht.js} +2 -2
  41. package/dist/browser/{lib-Bx34qzLu.js → lib-2obxk3oS.js} +4 -4
  42. package/dist/browser/{main-Y9zKz6A3.js → main-BmLA18OJ.js} +1 -1
  43. package/dist/browser/{mobx-CQcqTdtF.js → mobx-B6ST57Qg.js} +4 -4
  44. package/dist/browser/{particles.min-C4VZSqi4.js → particles.min-zcJ4GvKk.js} +2 -2
  45. package/dist/browser/{prop-types-wcbYS1fK.js → prop-types-CDfJ6OzK.js} +2 -2
  46. package/dist/browser/{react-B6FNRVkv.js → react-Cf4fqQ5Z.js} +2 -2
  47. package/dist/browser/{react-dom-CBQpxcCw.js → react-dom-fIAcTJqF.js} +3 -3
  48. package/dist/browser/{reset-all-settings-lufwefSt.js → reset-all-settings-DAwLAjYW.js} +43 -51
  49. package/dist/browser/{rolldown-runtime-CAJXkpgX.js → rolldown-runtime-B_-bnmAA.js} +1 -1
  50. package/dist/browser/{settings-BNpqhphB.js → settings-CZ7MViuE.js} +2 -2
  51. package/dist/browser/{settings-item-xTdxd6XC.js → settings-item-BK4GcQpm.js} +6 -6
  52. package/dist/browser/{store-aB4lz41l.js → store-a9eLfQIp.js} +14 -13
  53. package/dist/browser/{string-editor-DdOa8XdC.js → string-editor-CVDC68vI.js} +8 -8
  54. package/dist/browser/{theme-BqzRLPFg.js → theme-CRuC_K7M.js} +8 -8
  55. package/dist/browser/{ui-G5Dwtl_M.js → ui-CZHI043u.js} +10 -14
  56. package/dist/esm/components/Wayfinding.js +1 -1
  57. package/dist/esm/floorplan.loader.d.ts +1 -0
  58. package/dist/esm/floorplan.loader.js +1 -1
  59. package/dist/esm/floorplan.ready.d.ts +1 -0
  60. package/dist/esm/floorplan.ready.js +1 -1
  61. package/dist/esm/services/routing.js +1 -1
  62. package/dist/esm/store/RouteStore.d.ts +1 -0
  63. package/dist/esm/store/RouteStore.js +1 -1
  64. package/dist/esm/utils/is-debug.d.ts +4 -7
  65. package/dist/esm/utils/is-debug.js +1 -1
  66. package/package.json +3 -3
  67. package/dist/browser/debug-overlay-CwVktU6Q.js +0 -1419
@@ -1 +1 @@
1
- import{createBrowserHistory as oe}from"history";import{autorun as A,reaction as k}from"mobx";import{handleCustomCommand as F}from"../utils/customCommands";import{BUILD_ROUTE_KEY as se,KIOSK_ENABLE_KEY as $,MAP_SETTINGS_KEY as re,PREVIEW_MODE_QUERY as E,PREVIEW_MODE_STORAGE_KEY as N,SEPARATOR as R,PATHWAY_KEY as W,PLANNER_KEY as P,PLANNER_SOURCE_KEY as K,PLANNER_FROM_KEY as Y,LANG_KEY as V,UI_SCALE_PARAM_KEY as H,UI_SCALE_RESET_PARAM_KEY as G,VIEWER_MODE_QUERY as I,VIEWER_MODE_STORAGE_KEY as D,LANGUAGE_TYPE as x}from"../constants";import v from"../data";import s,{uiState as i}from"../store";import{CurrentPosition as ae,extractRoute as ie,findBooth as le}from"../store/RouteStore";import{setConsentSettings as z}from"../tools/gtag";import U from"../tools/logger";import{isLocalStorageAvailable as L}from"../utils/localStorage";import{yahKey as ne}from"../utils/yah";import{areLayersEnabled as ce}from"../utils/areLayersEnabled";import ue from"../core/Rect";import{getMostFrequent as he}from"../utils/getMostFrequent";import{runInAction as C}from"mobx";import{recoverKioskFromUrlPrams as fe}from"../components/Kiosk/recoverKioskFromUrlPrams";import{hasLocale as de,setLocale as me}from"../utils/i18n";let m=!1,_=!1,j=null,q=null,Q=null,J;const h=oe(),B=window.location.pathname,S=[];export function getLocationHistory(){return S}function b(t){return B+t}function pe(t){m||h.push(b(t))}export function historyReplace(t){m||h.push(b(t))}function f(t){return t.replace(/=&/g,"&").replace(/=$/,"")}function X(){let t="";const l=i.selectedExhibitor,a=i.selectedBooth,e=i.selectedEventItem,o=i.selectedRoute,r=i.selectedSpeaker,n=i.setKioskModeEnabled;if(i.list.type==="route-planner"&&!l&&!a&&!e){const d=s.routePlannerStore;if(d.source==="bookmarks")t=`${P}&${K}=bookmarks`;else{const w=d.items.map(g=>g.entity.slug).filter(Boolean).join(R);t=`${P}=${w}`}const p=d.startPoint?.slug;p&&(t+=`&${Y}=${p}`)}else if(o&&!i.isMultiPointRoute){const d=o.from?`:${o.from.slug}`:"",p=o.to?`:${o.to.slug}`:"",w=s.routeStore.onlyAccessible?":true":":false",g=o.waypoints?.map(u=>`:${u.slug}`).join("");t=`route${p}${d}${w}${g||""}`}else if(l)t=l.slug;else if(a)t=a.slug;else if(e)t=e.slug;else if(r)t=r.slug;else if(n)t="";else switch(i.list.type){case"bookmarks":t="bookmarks";break;case"visited":t="visited";break;case"category":t=i.selectedCategory.slug;break;case"search":t=i.list.text||"";break;case x:t=x;break;case"filter":t=`${i.list.query.key}=${i.list.query.value}`;break;case"sessions":t="sessions";break;case"exhibitors":t="exhibitors";break;case"speakers":t="speakers";break;case"tours":t="tours";break;case"multi-point-tour":t=`tour=${i.list.tourId}`;break;default:throw new Error("Unkown list.type")}if(_)return;const c=t?"?"+encodeURIComponent(t):"";h.location.search!==c&&(l!==j||a!==q||e!==Q?pe(c):historyReplace(c),j=l,q=a,Q=e)}function Z(){const t=i.selectedExhibitor,l=i.selectedEventItem,a=i.selectedSpeaker;let e="";t?e=t.name:l?e=l.name:a?e=a.name:i.list.type==="search"&&i.list.text?e="`"+(i.list.text||"")+"`":i.list.type==="multi-point-tour"&&i.tourTitle&&(e=i.tourTitle),e.length&&(e+=" \u2013 "),e+=v.title,v.subtitle&&(e+=" \u2013 "+v.subtitle),e+=" \u2013 Expo Floor Plan by ExpoFP",document.title=e}function T(){const t=h.location.search.length>1?decodeURIComponent(h.location.search.substring(1)):"";return F(t,!1)}function y(){const t=h.location.search.length>1?decodeURIComponent(h.location.search.substring(1)):"";_=!0;const l=s.boothStore.booths.find(e=>e.slug?.toLowerCase()===t?.toLowerCase()||e.externalId?.toLowerCase()===t?.toLowerCase()||e.externalId?.toLowerCase()?.replace(/\s+/g,"")===t?.toLowerCase()),a=new URLSearchParams(decodeURIComponent(window.location.search));if(fe(a),ge(a),!T())if(a.has("yah")){const e=a.get("yah");F(`${ne} ${e}`,!0)}else if(a.has($)){const e=a.get($);e==="1"?i.kiosk=!0:e==="0"&&(i.kiosk=!1,i.resetUIScale())}else if(t==="tours")s.selectTours();else if(t.startsWith("tour=")){const e=t.split("=")[1],o=s.toursStore.getTourById(e);o?s.toursStore.launchTour(o,o.name,o.description):(console.warn(`Route with id "${e}" not found`),s.selectTours())}else if(a.has(P)){const e=a.get(K),o=a.get(Y),r=o?le(o):null;if(e==="bookmarks")s.routePlannerStore.launchFromBookmarks(r??void 0);else{const n=(a.get(P)||"").split(R).filter(Boolean);s.routePlannerStore.launchFromSlugs(n,r??void 0)}}else if(t.startsWith("route")){const e=t.split(R);C(()=>{s.routeStore.onlyAccessible=e[3]==="true"});const o=ie(e[2],e[1],e.slice(4));s.routeStore.selectRoute(o);const n=e.slice(4).length>0;s.uiState.setIsMultiPointRoute(n);const d=new URLSearchParams(window.location.search).get("title");d&&s.uiState.setRouteTitle(d)}else if(t==="bookmarks")s.selectBookmarks();else if(t==="visited")s.selectVisited();else if(t===x)s.selectLanguage();else if(a.has(V)){const e=a.get(V)?.toLowerCase();de(e)&&me(e)}else if(t==="sessions")s.selectSessions();else if(t==="exhibitors")s.selectExhibitors();else if(t==="speakers")s.selectSpeakers();else if(t==="-pdf")s.uiState.printingPdf=!0;else if(t.startsWith("hide"))s.uiState.setVisibility(new URLSearchParams(t).get("hide").split(",").filter(Boolean).reduce((e,o)=>({...e,[o]:!1}),{}));else if(l)setTimeout(()=>s.selectBooth(l),250);else if(t===se)s.uiState.startBuildRoute();else if(a.get(W)){const e=a.get(W),o=a.get("booths")?.split(",")||[],r=a.get("exhibitors")?.split(",")||[],n=a.get("tour");if(n){const u=s.toursStore.getTourById(n);u&&C(()=>{s.uiState.setTourTitle(u.name),s.uiState.setTourDescription(u.description),s.uiState.setIsMultiPointTour(!0),s.uiState.setMultiPointTourList(u.id)})}const c=s.boothStore.booths,d=s.exhibitorStore.exhibitors,p=c.filter(u=>o.includes(u.externalId)),w=d.filter(u=>r.includes(u.externalId)).flatMap(u=>u.booths),g=[...p,...w];if(ce()){const u=g.map(te=>te.layer.name),O=he(u);O&&s.fp.activateFloor({name:O})}(o.length>0||r.length>0)&&s.fp.highlightEntities([...o,...r]),s.layerStore.showPathWay(e),g.length>0&&C(()=>{s.uiState.moveToRect=ue.fromMultiple(g.map(u=>u.rect).filter(Boolean)),s.uiState.rollReset=!0})}else{const e=s.eventStore.eventItems.find(o=>o.slug?.toLowerCase()===t?.toLowerCase()||o.externalId?.toLowerCase()===t?.toLowerCase());if(e)s.selectEventItem(e,!0);else{const o=s.exhibitorStore.exhibitors.find(r=>r.slug?.toLowerCase()===t?.toLowerCase()||r.externalId?.toLowerCase()===t?.toLowerCase());if(t.startsWith("exhibitors")){const r=t.split("=")[1].split(",");setTimeout(()=>s.fp.selectExhibitor(r),250)}else if(o)setTimeout(()=>s.clickExhibitor(o),250);else if(t.includes("=")&&(t.startsWith("categories=")||t.startsWith("poiType=")))U.log("Skipping filter parameter in dispatchFromUrl:",t);else{const n=s.categoryStore.categories.find(c=>c.slug===t);if(n)s.selectCategory(n);else{const c=s.speakerStore.findBySlug(t);c?s.selectSpeaker(c,!0):t.includes("heatmap=true")||s.searchStore.selectSearch(t)}}}}_=!1,X(),Z()}function M(){const t=h.location.search;if(t.includes("heatmap")){const e=new URL(window.location.href);if(e.searchParams.get("heatmap")==="true")if(e.searchParams.get("type")==="yah"){let r=f(e.search);m=!0,historyReplace(r),s.uiState.heatmapYah=!0,s.uiState.monochrome=!0,s.uiState.hideLogoInBooth=!0,s.uiState.hideHeaderLogo=!0,s.uiState.disableBookmarked=!0}else{e.searchParams.delete("heatmap");let r=f(e.search);m=!0,historyReplace(r),s.uiState.heatmap=!0}}if(t.startsWith("?preview="))historyReplace("?");else if(t.startsWith("?b="))historyReplace("?bookmarks");else if(t.startsWith("?ba=")){const e=new URL(window.location.href),o=parseInt(e.searchParams.get("ba")),r=s.exhibitorStore.exhibitorById.get(o);historyReplace(r?"?"+r.slug:"?bookmarks")}else t.startsWith("?mapbox=false")&&(s.mapboxStore.isMapbox=!1,historyReplace("?"));if(t.includes("blue-dot")){const e=new URL(window.location.href),o=e.searchParams.get("blue-dot").split(",");if(e.searchParams.delete("blue-dot"),o.length>1){const n=s.layerStore.findLayer(o[2])?.name,c=new ae(Number(o[0])||void 0,Number(o[1])||void 0,n,void 0,Number(o[3])||void 0,Number(o[4])||void 0);s.layerStore.layersLoaded?s.routeStore.selectCurrentPosition(c,!1,1):k(()=>s.layerStore.layersLoaded,()=>{s.routeStore.selectCurrentPosition(c,!1,1)})}let r=f(e.search);historyReplace(r)}if(t.includes("copy_exh")){const e=new URL(window.location.href),o=e.searchParams.get("copy_exh");e.searchParams.delete("copy_exh"),historyReplace("?")}if(t.includes("noOverlay")){const e=new URL(window.location.href),o=e.searchParams.get("noOverlay");e.searchParams.delete("noOverlay");let r=f(e.search);o==="true"?s.uiState.hideOverlay=!0:o==="false"&&(s.uiState.hideOverlay=!1),historyReplace(r)}if(t.includes("allowConsent")){const e=new URL(window.location.href),o=e.searchParams.get("allowConsent");e.searchParams.delete("allowConsent");const r=f(e.search);o==="true"?z(!0):o==="false"&&z(!1),historyReplace(r)}if(t.includes("hideHeaderLogo")){const e=new URL(window.location.href),o=e.searchParams.get("hideHeaderLogo");e.searchParams.delete("hideHeaderLogo");const r=f(e.search);o==="true"&&(i.hideHeaderLogo=!0),historyReplace(r)}if(t.includes("hideLogoInBooth")){const e=new URL(window.location.href),o=e.searchParams.get("hideLogoInBooth");e.searchParams.delete("hideLogoInBooth");const r=f(e.search);o==="true"&&(i.hideLogoInBooth=!0),historyReplace(r)}if(t.includes("disableFeatured")){const e=new URL(window.location.href),o=e.searchParams.get("disableFeatured");e.searchParams.delete("disableFeatured");const r=f(e.search);o==="true"&&s.exhibitorStore.exhibitors.forEach(n=>n.featured=!1),historyReplace(r)}if(t.includes("disableBookmarked")){const e=new URL(window.location.href),o=e.searchParams.get("disableBookmarked");e.searchParams.delete("disableBookmarked");const r=f(e.search);o==="true"&&(i.disableBookmarked=!0),historyReplace(r)}if(t.includes("disableGps")){const e=new URL(window.location.href),o=e.searchParams.get("disableGps");e.searchParams.delete("disableGps");const r=f(e.search);o==="true"&&s.routeStore.setGpsTrackingEnabled(!1),historyReplace(r)}if(t.includes("monochrome")){const e=new URL(window.location.href),o=e.searchParams.get("monochrome");e.searchParams.delete("monochrome");const r=f(e.search);o==="true"&&(i.monochrome=!0),historyReplace(r)}if((t.startsWith("?fbclid")||t.startsWith("?_ga"))&&historyReplace("?"),t.includes(I)){const e=new URL(window.location.href),o=e.searchParams.get(I);o==="1"||o==="true"?L&&localStorage.setItem(D,"1"):(o==="0"||o==="false")&&L&&localStorage.removeItem(D),e.searchParams.delete(I),historyReplace(f(e.search))}if(t.includes(E)){const e=new URL(window.location.href),o=e.searchParams.get(E);o==="true"?L&&localStorage.setItem(N,"1"):o==="false"&&L&&localStorage.removeItem(N),e.searchParams.delete(E),historyReplace(f(e.search))}if(i.previewExhibitor&&historyReplace("?"+i.previewExhibitor.slug),h.location.search.includes("&")||h.location.search.includes("%26")){let e=h.location.search;e=e.startsWith("?")?e.slice(1):e;const o=e.includes("&")?"&":"%26",n=e.split(o).map(c=>{const d=s.exhibitorStore.exhibitors.find(p=>p.slug===c||p.externalId===c);return d?d.name:c}).join("&");historyReplace("?"+n)}const l=new URLSearchParams(window.location.search);if(l.has(G)){s.uiState.resetUIScale();const e=new URL(window.location.href);e.searchParams.delete(G);let o=f(e.search);m=!0,historyReplace(o),m=!1}const a=l.get(H);if(a){const e=a.replace(",","."),o=parseFloat(e);!isNaN(o)&&o>=.8&&o<=1.4?s.uiState.setUIScale(o,!0):U.warn(`Invalid ui-scale parameter: ${a}. Must be a number between 0.8 and 1.4.`);const r=new URL(window.location.href);r.searchParams.delete(H);let n=f(r.search);m=!0,historyReplace(n),m=!1}}export function initRouting(t=!1){m=t,!m&&b(h.location.search)===B&&S.push(b(h.location.search)),J=h.listen((l,a)=>{m||(S.push(b(l.search)),U.log("history",a,l),a==="POP"&&y())}),M(),T(),k(()=>s.layerStore.layersLoaded,()=>{s.urlFilterManager&&!s.urlFilterManager.isInitialized&&s.urlFilterManager.initialize(),y(),A(Z),A(X),i.viewerMode&&(i.menu=!0)})}export function applyParameters(t=""){historyReplace("?"+decodeURIComponent(t.toString())),s.layerStore.layersLoaded?(M(),y()):(T(),k(()=>s.layerStore.layersLoaded,()=>{M(),y()}))}export function destroyHistory(){J()}export function goBack(){if(console.log("goBack"),S.length>1){S.pop();const l=S[S.length-1].replace(B,"");return m=!0,h.replace(l),m=!1,y(),!0}else return h.go(-1),!1}function ge(t){try{let l={};const a=i.defaultMapSettings;if(new Set(t.keys()).size)l=ee(Object.fromEntries(t.entries()),a);else{const e=sessionStorage.getItem(re);e&&(l=ee(JSON.parse(e),a))}if(i.setMapSettings(l),l.z){const e=s.layerStore.layers.find(o=>o.name===l.z);e&&s.layerStore.updateVisibility(e,!0)}}catch(l){console.error("Failed to process or save map settings.",l)}}function ee(t,l){const a={};for(const e in t){if(!Object.prototype.hasOwnProperty.call(l,e)||!Object.prototype.hasOwnProperty.call(t,e))continue;const o=t[e];typeof l[e]=="number"&&typeof o=="string"?a[e]=parseFloat(o):a[e]=o}return a}
1
+ import{createBrowserHistory as oe}from"history";import{autorun as O,reaction as k}from"mobx";import{handleCustomCommand as A}from"../utils/customCommands";import{BUILD_ROUTE_KEY as se,KIOSK_ENABLE_KEY as F,MAP_SETTINGS_KEY as re,PREVIEW_MODE_QUERY as E,PREVIEW_MODE_STORAGE_KEY as $,SEPARATOR as R,PATHWAY_KEY as N,PLANNER_KEY as P,PLANNER_SOURCE_KEY as W,PLANNER_FROM_KEY as K,LANG_KEY as Y,UI_SCALE_PARAM_KEY as V,UI_SCALE_RESET_PARAM_KEY as H,VIEWER_MODE_QUERY as I,VIEWER_MODE_STORAGE_KEY as G,LANGUAGE_TYPE as x}from"../constants";import v from"../data";import s,{uiState as i}from"../store";import{CurrentPosition as ae,extractRoute as ie,findBooth as le}from"../store/RouteStore";import{setConsentSettings as D}from"../tools/gtag";import U from"../tools/logger";import{isLocalStorageAvailable as L}from"../utils/localStorage";import{yahKey as ne}from"../utils/yah";import{areLayersEnabled as ce}from"../utils/areLayersEnabled";import ue from"../core/Rect";import{getMostFrequent as he}from"../utils/getMostFrequent";import{runInAction as z}from"mobx";import{recoverKioskFromUrlPrams as fe}from"../components/Kiosk/recoverKioskFromUrlPrams";import{hasLocale as de,setLocale as me}from"../utils/i18n";let m=!1,C=!1,j=null,q=null,Q=null,J;const h=oe(),_=window.location.pathname,S=[];export function getLocationHistory(){return S}function b(t){return _+t}function pe(t){m||h.push(b(t))}export function historyReplace(t){m||h.push(b(t))}function f(t){return t.replace(/=&/g,"&").replace(/=$/,"")}function X(){let t="";const l=i.selectedExhibitor,a=i.selectedBooth,e=i.selectedEventItem,o=i.selectedRoute,r=i.selectedSpeaker,n=i.setKioskModeEnabled;if(i.list.type==="route-planner"&&!l&&!a&&!e){const d=s.routePlannerStore;if(d.source==="bookmarks")t=`${P}&${W}=bookmarks`;else{const w=d.items.map(g=>g.entity.slug).filter(Boolean).join(R);t=`${P}=${w}`}const p=d.startPoint?.slug;p&&(t+=`&${K}=${p}`)}else if(o&&!i.isMultiPointRoute){const d=o.from?`:${o.from.slug}`:"",p=o.to?`:${o.to.slug}`:"",w=s.routeStore.onlyAccessible?":true":":false",g=o.waypoints?.map(u=>`:${u.slug}`).join("");t=`route${p}${d}${w}${g||""}`}else if(l)t=l.slug;else if(a)t=a.slug;else if(e)t=e.slug;else if(r)t=r.slug;else if(n)t="";else switch(i.list.type){case"bookmarks":t="bookmarks";break;case"visited":t="visited";break;case"category":t=i.selectedCategory.slug;break;case"search":t=i.list.text||"";break;case x:t=x;break;case"filter":t=`${i.list.query.key}=${i.list.query.value}`;break;case"sessions":t="sessions";break;case"exhibitors":t="exhibitors";break;case"speakers":t="speakers";break;case"tours":t="tours";break;case"multi-point-tour":t=`tour=${i.list.tourId}`;break;default:throw new Error("Unkown list.type")}if(C)return;const c=t?"?"+encodeURIComponent(t):"";h.location.search!==c&&(l!==j||a!==q||e!==Q?pe(c):historyReplace(c),j=l,q=a,Q=e)}function Z(){const t=i.selectedExhibitor,l=i.selectedEventItem,a=i.selectedSpeaker;let e="";t?e=t.name:l?e=l.name:a?e=a.name:i.list.type==="search"&&i.list.text?e="`"+(i.list.text||"")+"`":i.list.type==="multi-point-tour"&&i.tourTitle&&(e=i.tourTitle),e.length&&(e+=" \u2013 "),e+=v.title,v.subtitle&&(e+=" \u2013 "+v.subtitle),e+=" \u2013 Expo Floor Plan by ExpoFP",document.title=e}function B(){const t=h.location.search.length>1?decodeURIComponent(h.location.search.substring(1)):"";return A(t,!1)}function y(){const t=h.location.search.length>1?decodeURIComponent(h.location.search.substring(1)):"";C=!0;const l=s.boothStore.booths.find(e=>e.slug?.toLowerCase()===t?.toLowerCase()||e.externalId?.toLowerCase()===t?.toLowerCase()||e.externalId?.toLowerCase()?.replace(/\s+/g,"")===t?.toLowerCase()),a=new URLSearchParams(decodeURIComponent(window.location.search));if(fe(a),ge(a),!B())if(a.has("yah")){const e=a.get("yah");A(`${ne} ${e}`,!0)}else if(a.has(F)){const e=a.get(F);e==="1"?i.kiosk=!0:e==="0"&&(i.kiosk=!1,i.resetUIScale())}else if(t==="tours")s.selectTours();else if(t.startsWith("tour=")){const e=t.split("=")[1],o=s.toursStore.getTourById(e);o?s.toursStore.launchTour(o,o.name,o.description):(console.warn(`Route with id "${e}" not found`),s.selectTours())}else if(a.has(P)){const e=a.get(W),o=a.get(K),r=o?le(o):null;if(e==="bookmarks")s.routePlannerStore.launchFromBookmarks(r??void 0);else{const n=(a.get(P)||"").split(R).filter(Boolean);s.routePlannerStore.launchFromSlugs(n,r??void 0)}}else if(t.startsWith("route")){const e=t.split(R);s.routeStore.setOnlyAccessible(e[3]==="true");const o=ie(e[2],e[1],e.slice(4));s.routeStore.selectRoute(o);const n=e.slice(4).length>0;s.uiState.setIsMultiPointRoute(n);const d=new URLSearchParams(window.location.search).get("title");d&&s.uiState.setRouteTitle(d)}else if(t==="bookmarks")s.selectBookmarks();else if(t==="visited")s.selectVisited();else if(t===x)s.selectLanguage();else if(a.has(Y)){const e=a.get(Y)?.toLowerCase();de(e)&&me(e)}else if(t==="sessions")s.selectSessions();else if(t==="exhibitors")s.selectExhibitors();else if(t==="speakers")s.selectSpeakers();else if(t==="-pdf")s.uiState.printingPdf=!0;else if(t.startsWith("hide"))s.uiState.setVisibility(new URLSearchParams(t).get("hide").split(",").filter(Boolean).reduce((e,o)=>({...e,[o]:!1}),{}));else if(l)setTimeout(()=>s.selectBooth(l),250);else if(t===se)s.uiState.startBuildRoute();else if(a.get(N)){const e=a.get(N),o=a.get("booths")?.split(",")||[],r=a.get("exhibitors")?.split(",")||[],n=a.get("tour");if(n){const u=s.toursStore.getTourById(n);u&&z(()=>{s.uiState.setTourTitle(u.name),s.uiState.setTourDescription(u.description),s.uiState.setIsMultiPointTour(!0),s.uiState.setMultiPointTourList(u.id)})}const c=s.boothStore.booths,d=s.exhibitorStore.exhibitors,p=c.filter(u=>o.includes(u.externalId)),w=d.filter(u=>r.includes(u.externalId)).flatMap(u=>u.booths),g=[...p,...w];if(ce()){const u=g.map(te=>te.layer.name),M=he(u);M&&s.fp.activateFloor({name:M})}(o.length>0||r.length>0)&&s.fp.highlightEntities([...o,...r]),s.layerStore.showPathWay(e),g.length>0&&z(()=>{s.uiState.moveToRect=ue.fromMultiple(g.map(u=>u.rect).filter(Boolean)),s.uiState.rollReset=!0})}else{const e=s.eventStore.eventItems.find(o=>o.slug?.toLowerCase()===t?.toLowerCase()||o.externalId?.toLowerCase()===t?.toLowerCase());if(e)s.selectEventItem(e,!0);else{const o=s.exhibitorStore.exhibitors.find(r=>r.slug?.toLowerCase()===t?.toLowerCase()||r.externalId?.toLowerCase()===t?.toLowerCase());if(t.startsWith("exhibitors")){const r=t.split("=")[1].split(",");setTimeout(()=>s.fp.selectExhibitor(r),250)}else if(o)setTimeout(()=>s.clickExhibitor(o),250);else if(t.includes("=")&&(t.startsWith("categories=")||t.startsWith("poiType=")))U.log("Skipping filter parameter in dispatchFromUrl:",t);else{const n=s.categoryStore.categories.find(c=>c.slug===t);if(n)s.selectCategory(n);else{const c=s.speakerStore.findBySlug(t);c?s.selectSpeaker(c,!0):t.includes("heatmap=true")||s.searchStore.selectSearch(t)}}}}C=!1,X(),Z()}function T(){const t=h.location.search;if(t.includes("heatmap")){const e=new URL(window.location.href);if(e.searchParams.get("heatmap")==="true")if(e.searchParams.get("type")==="yah"){let r=f(e.search);m=!0,historyReplace(r),s.uiState.heatmapYah=!0,s.uiState.monochrome=!0,s.uiState.hideLogoInBooth=!0,s.uiState.hideHeaderLogo=!0,s.uiState.disableBookmarked=!0}else{e.searchParams.delete("heatmap");let r=f(e.search);m=!0,historyReplace(r),s.uiState.heatmap=!0}}if(t.startsWith("?preview="))historyReplace("?");else if(t.startsWith("?b="))historyReplace("?bookmarks");else if(t.startsWith("?ba=")){const e=new URL(window.location.href),o=parseInt(e.searchParams.get("ba")),r=s.exhibitorStore.exhibitorById.get(o);historyReplace(r?"?"+r.slug:"?bookmarks")}else t.startsWith("?mapbox=false")&&(s.mapboxStore.isMapbox=!1,historyReplace("?"));if(t.includes("blue-dot")){const e=new URL(window.location.href),o=e.searchParams.get("blue-dot").split(",");if(e.searchParams.delete("blue-dot"),o.length>1){const n=s.layerStore.findLayer(o[2])?.name,c=new ae(Number(o[0])||void 0,Number(o[1])||void 0,n,void 0,Number(o[3])||void 0,Number(o[4])||void 0);s.layerStore.layersLoaded?s.routeStore.selectCurrentPosition(c,!1,1):k(()=>s.layerStore.layersLoaded,()=>{s.routeStore.selectCurrentPosition(c,!1,1)})}let r=f(e.search);historyReplace(r)}if(t.includes("copy_exh")){const e=new URL(window.location.href),o=e.searchParams.get("copy_exh");e.searchParams.delete("copy_exh"),historyReplace("?")}if(t.includes("noOverlay")){const e=new URL(window.location.href),o=e.searchParams.get("noOverlay");e.searchParams.delete("noOverlay");let r=f(e.search);o==="true"?s.uiState.hideOverlay=!0:o==="false"&&(s.uiState.hideOverlay=!1),historyReplace(r)}if(t.includes("allowConsent")){const e=new URL(window.location.href),o=e.searchParams.get("allowConsent");e.searchParams.delete("allowConsent");const r=f(e.search);o==="true"?D(!0):o==="false"&&D(!1),historyReplace(r)}if(t.includes("hideHeaderLogo")){const e=new URL(window.location.href),o=e.searchParams.get("hideHeaderLogo");e.searchParams.delete("hideHeaderLogo");const r=f(e.search);o==="true"&&(i.hideHeaderLogo=!0),historyReplace(r)}if(t.includes("hideLogoInBooth")){const e=new URL(window.location.href),o=e.searchParams.get("hideLogoInBooth");e.searchParams.delete("hideLogoInBooth");const r=f(e.search);o==="true"&&(i.hideLogoInBooth=!0),historyReplace(r)}if(t.includes("disableFeatured")){const e=new URL(window.location.href),o=e.searchParams.get("disableFeatured");e.searchParams.delete("disableFeatured");const r=f(e.search);o==="true"&&s.exhibitorStore.exhibitors.forEach(n=>n.featured=!1),historyReplace(r)}if(t.includes("disableBookmarked")){const e=new URL(window.location.href),o=e.searchParams.get("disableBookmarked");e.searchParams.delete("disableBookmarked");const r=f(e.search);o==="true"&&(i.disableBookmarked=!0),historyReplace(r)}if(t.includes("disableGps")){const e=new URL(window.location.href),o=e.searchParams.get("disableGps");e.searchParams.delete("disableGps");const r=f(e.search);o==="true"&&s.routeStore.setGpsTrackingEnabled(!1),historyReplace(r)}if(t.includes("monochrome")){const e=new URL(window.location.href),o=e.searchParams.get("monochrome");e.searchParams.delete("monochrome");const r=f(e.search);o==="true"&&(i.monochrome=!0),historyReplace(r)}if((t.startsWith("?fbclid")||t.startsWith("?_ga"))&&historyReplace("?"),t.includes(I)){const e=new URL(window.location.href),o=e.searchParams.get(I);o==="1"||o==="true"?L&&localStorage.setItem(G,"1"):(o==="0"||o==="false")&&L&&localStorage.removeItem(G),e.searchParams.delete(I),historyReplace(f(e.search))}if(t.includes(E)){const e=new URL(window.location.href),o=e.searchParams.get(E);o==="true"?L&&localStorage.setItem($,"1"):o==="false"&&L&&localStorage.removeItem($),e.searchParams.delete(E),historyReplace(f(e.search))}if(i.previewExhibitor&&historyReplace("?"+i.previewExhibitor.slug),h.location.search.includes("&")||h.location.search.includes("%26")){let e=h.location.search;e=e.startsWith("?")?e.slice(1):e;const o=e.includes("&")?"&":"%26",n=e.split(o).map(c=>{const d=s.exhibitorStore.exhibitors.find(p=>p.slug===c||p.externalId===c);return d?d.name:c}).join("&");historyReplace("?"+n)}const l=new URLSearchParams(window.location.search);if(l.has(H)){s.uiState.resetUIScale();const e=new URL(window.location.href);e.searchParams.delete(H);let o=f(e.search);m=!0,historyReplace(o),m=!1}const a=l.get(V);if(a){const e=a.replace(",","."),o=parseFloat(e);!isNaN(o)&&o>=.8&&o<=1.4?s.uiState.setUIScale(o,!0):U.warn(`Invalid ui-scale parameter: ${a}. Must be a number between 0.8 and 1.4.`);const r=new URL(window.location.href);r.searchParams.delete(V);let n=f(r.search);m=!0,historyReplace(n),m=!1}}export function initRouting(t=!1){m=t,!m&&b(h.location.search)===_&&S.push(b(h.location.search)),J=h.listen((l,a)=>{m||(S.push(b(l.search)),U.log("history",a,l),a==="POP"&&y())}),T(),B(),k(()=>s.layerStore.layersLoaded,()=>{s.urlFilterManager&&!s.urlFilterManager.isInitialized&&s.urlFilterManager.initialize(),y(),O(Z),O(X),i.viewerMode&&(i.menu=!0)})}export function applyParameters(t=""){historyReplace("?"+decodeURIComponent(t.toString())),s.layerStore.layersLoaded?(T(),y()):(B(),k(()=>s.layerStore.layersLoaded,()=>{T(),y()}))}export function destroyHistory(){J()}export function goBack(){if(console.log("goBack"),S.length>1){S.pop();const l=S[S.length-1].replace(_,"");return m=!0,h.replace(l),m=!1,y(),!0}else return h.go(-1),!1}function ge(t){try{let l={};const a=i.defaultMapSettings;if(new Set(t.keys()).size)l=ee(Object.fromEntries(t.entries()),a);else{const e=sessionStorage.getItem(re);e&&(l=ee(JSON.parse(e),a))}if(i.setMapSettings(l),l.z){const e=s.layerStore.layers.find(o=>o.name===l.z);e&&s.layerStore.updateVisibility(e,!0)}}catch(l){console.error("Failed to process or save map settings.",l)}}function ee(t,l){const a={};for(const e in t){if(!Object.prototype.hasOwnProperty.call(l,e)||!Object.prototype.hasOwnProperty.call(t,e))continue;const o=t[e];typeof l[e]=="number"&&typeof o=="string"?a[e]=parseFloat(o):a[e]=o}return a}
@@ -51,6 +51,7 @@ export default class RouteStore {
51
51
  isGpsTrackingEnabled: boolean;
52
52
  setGpsTrackingEnabled(value: boolean): void;
53
53
  get gpsEnabled(): boolean;
54
+ setOnlyAccessible(value: boolean): void;
54
55
  }
55
56
  export declare function findBooth(str: string): Booth | undefined;
56
57
  export declare function findEntityByExternalId(externalId: string): {
@@ -1 +1 @@
1
- import{__esDecorate as i,__runInitializers as r}from"tslib";import{action as m,computed as k,observable as d}from"mobx";import{Point as Ve,lineLength as Me}from"simple-geometry";import o,{boothStore as je,layersStore as x}from".";import{fpGeo as T}from"../data/fpGeo";import We from"../core/Rect";import{GaEventActions as Ke,sendEventToGa as Xe}from"../tools/gtag";import{convertGpsToLocal as Be,isValidPointCoords as Ce,calculateRelativeBearing as Ye}from"../utils/gps";import{getLayerSvg as He,svgArea as Je}from"../data/svg";import{getGraphLines as Qe,boothToWaypoint as Fe,graphDataSource as Ge}from"../wayfinding";import{LayersMode as et}from"./LayerStore";import{uiState as p}from"./index";import{calcSpeed as Ue}from"../utils/calcSpeed";import{calcTravelTime as Oe}from"../utils/calcTravelTime";import{DEFAULT_UNITS as Ne,ORIENTATION_GRANTED_KEY as tt}from"../constants";import{areLayersEnabled as st}from"../utils/areLayersEnabled";import{distancePointToRouteOnLayer as at,findBoothInRadius as it}from"../components/Map/drawing/config/route-snapping";import Ze from"../data";import qe from"../tools/logger";import rt from"../tools/settings";const g=a=>typeof a=="string"?Number(a.replace(",",".")):a;let nt=(()=>{let a=[],n,l=[],f=[],h,v=[],R=[],L,E=[],z=[],P,D=[],I=[],w,A=[],M=[],B,C=[],F=[],G,U=[],O=[],N,Z=[],q=[],$,V=[],j=[],W,K=[],X=[],Y,H=[],J=[],Q,ee=[],te=[],se,ae=[],ie=[],re,ne=[],oe=[],le,ce,ue,de,fe,he,me,pe,_e,ge,ye,ke,be,ve=[],Re=[],xe,Se,Te,Le,Ee,ze,Pe=[],De=[],Ie,we;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[d],h=[d],L=[d],P=[d],w=[d],B=[d],G=[d],N=[d],$=[d],W=[d],Y=[d],Q=[d],se=[d],re=[d],le=[k],ce=[m],ue=[m],de=[k({keepAlive:!0})],fe=[k({keepAlive:!0})],he=[m],me=[m],pe=[k({keepAlive:!0})],_e=[k({keepAlive:!0})],ge=[m],ye=[m],ke=[m],be=[d],xe=[k],Se=[m],Te=[m],Le=[m],Ee=[m],ze=[d],Ie=[m],we=[k({keepAlive:!0})],i(this,null,le,{kind:"getter",name:"canFindLocation",static:!1,private:!1,access:{has:e=>"canFindLocation"in e,get:e=>e.canFindLocation},metadata:t},null,a),i(this,null,ce,{kind:"method",name:"selectRoute",static:!1,private:!1,access:{has:e=>"selectRoute"in e,get:e=>e.selectRoute},metadata:t},null,a),i(this,null,ue,{kind:"method",name:"setStartPoint",static:!1,private:!1,access:{has:e=>"setStartPoint"in e,get:e=>e.setStartPoint},metadata:t},null,a),i(this,null,de,{kind:"getter",name:"pathLayers",static:!1,private:!1,access:{has:e=>"pathLayers"in e,get:e=>e.pathLayers},metadata:t},null,a),i(this,null,fe,{kind:"getter",name:"nearestBooth",static:!1,private:!1,access:{has:e=>"nearestBooth"in e,get:e=>e.nearestBooth},metadata:t},null,a),i(this,null,he,{kind:"method",name:"setMarkers",static:!1,private:!1,access:{has:e=>"setMarkers"in e,get:e=>e.setMarkers},metadata:t},null,a),i(this,null,me,{kind:"method",name:"selectMarker",static:!1,private:!1,access:{has:e=>"selectMarker"in e,get:e=>e.selectMarker},metadata:t},null,a),i(this,null,pe,{kind:"getter",name:"selectedMarkers",static:!1,private:!1,access:{has:e=>"selectedMarkers"in e,get:e=>e.selectedMarkers},metadata:t},null,a),i(this,null,_e,{kind:"getter",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers},metadata:t},null,a),i(this,null,ge,{kind:"method",name:"clickRoute",static:!1,private:!1,access:{has:e=>"clickRoute"in e,get:e=>e.clickRoute},metadata:t},null,a),i(this,null,ye,{kind:"method",name:"selectCurrentPosition",static:!1,private:!1,access:{has:e=>"selectCurrentPosition"in e,get:e=>e.selectCurrentPosition},metadata:t},null,a),i(this,null,ke,{kind:"method",name:"findLocation",static:!1,private:!1,access:{has:e=>"findLocation"in e,get:e=>e.findLocation},metadata:t},null,a),i(this,null,xe,{kind:"getter",name:"routeInfo",static:!1,private:!1,access:{has:e=>"routeInfo"in e,get:e=>e.routeInfo},metadata:t},null,a),i(this,null,Se,{kind:"method",name:"updateRoute",static:!1,private:!1,access:{has:e=>"updateRoute"in e,get:e=>e.updateRoute},metadata:t},null,a),i(this,null,Te,{kind:"method",name:"updateRouteDistance",static:!1,private:!1,access:{has:e=>"updateRouteDistance"in e,get:e=>e.updateRouteDistance},metadata:t},null,a),i(this,null,Le,{kind:"method",name:"updateRoutePoints",static:!1,private:!1,access:{has:e=>"updateRoutePoints"in e,get:e=>e.updateRoutePoints},metadata:t},null,a),i(this,null,Ee,{kind:"method",name:"checkRoutes",static:!1,private:!1,access:{has:e=>"checkRoutes"in e,get:e=>e.checkRoutes},metadata:t},null,a),i(this,null,Ie,{kind:"method",name:"setGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"setGpsTrackingEnabled"in e,get:e=>e.setGpsTrackingEnabled},metadata:t},null,a),i(this,null,we,{kind:"getter",name:"gpsEnabled",static:!1,private:!1,access:{has:e=>"gpsEnabled"in e,get:e=>e.gpsEnabled},metadata:t},null,a),i(null,null,n,{kind:"field",name:"routeLines",static:!1,private:!1,access:{has:e=>"routeLines"in e,get:e=>e.routeLines,set:(e,s)=>{e.routeLines=s}},metadata:t},l,f),i(null,null,h,{kind:"field",name:"routeDistance",static:!1,private:!1,access:{has:e=>"routeDistance"in e,get:e=>e.routeDistance,set:(e,s)=>{e.routeDistance=s}},metadata:t},v,R),i(null,null,L,{kind:"field",name:"currentPosition",static:!1,private:!1,access:{has:e=>"currentPosition"in e,get:e=>e.currentPosition,set:(e,s)=>{e.currentPosition=s}},metadata:t},E,z),i(null,null,P,{kind:"field",name:"requestCompass",static:!1,private:!1,access:{has:e=>"requestCompass"in e,get:e=>e.requestCompass,set:(e,s)=>{e.requestCompass=s}},metadata:t},D,I),i(null,null,w,{kind:"field",name:"iconType",static:!1,private:!1,access:{has:e=>"iconType"in e,get:e=>e.iconType,set:(e,s)=>{e.iconType=s}},metadata:t},A,M),i(null,null,B,{kind:"field",name:"tempToBooth",static:!1,private:!1,access:{has:e=>"tempToBooth"in e,get:e=>e.tempToBooth,set:(e,s)=>{e.tempToBooth=s}},metadata:t},C,F),i(null,null,G,{kind:"field",name:"defaultFrom",static:!1,private:!1,access:{has:e=>"defaultFrom"in e,get:e=>e.defaultFrom,set:(e,s)=>{e.defaultFrom=s}},metadata:t},U,O),i(null,null,N,{kind:"field",name:"focusEnabled",static:!1,private:!1,access:{has:e=>"focusEnabled"in e,get:e=>e.focusEnabled,set:(e,s)=>{e.focusEnabled=s}},metadata:t},Z,q),i(null,null,$,{kind:"field",name:"prevZ",static:!1,private:!1,access:{has:e=>"prevZ"in e,get:e=>e.prevZ,set:(e,s)=>{e.prevZ=s}},metadata:t},V,j),i(null,null,W,{kind:"field",name:"markersData",static:!1,private:!1,access:{has:e=>"markersData"in e,get:e=>e.markersData,set:(e,s)=>{e.markersData=s}},metadata:t},K,X),i(null,null,Y,{kind:"field",name:"prevMarkers",static:!1,private:!1,access:{has:e=>"prevMarkers"in e,get:e=>e.prevMarkers,set:(e,s)=>{e.prevMarkers=s}},metadata:t},H,J),i(null,null,Q,{kind:"field",name:"showAccessible",static:!1,private:!1,access:{has:e=>"showAccessible"in e,get:e=>e.showAccessible,set:(e,s)=>{e.showAccessible=s}},metadata:t},ee,te),i(null,null,se,{kind:"field",name:"onlyAccessible",static:!1,private:!1,access:{has:e=>"onlyAccessible"in e,get:e=>e.onlyAccessible,set:(e,s)=>{e.onlyAccessible=s}},metadata:t},ae,ie),i(null,null,re,{kind:"field",name:"currentRouteLayer",static:!1,private:!1,access:{has:e=>"currentRouteLayer"in e,get:e=>e.currentRouteLayer,set:(e,s)=>{e.currentRouteLayer=s}},metadata:t},ne,oe),i(null,null,be,{kind:"field",name:"routeUnits",static:!1,private:!1,access:{has:e=>"routeUnits"in e,get:e=>e.routeUnits,set:(e,s)=>{e.routeUnits=s}},metadata:t},ve,Re),i(null,null,ze,{kind:"field",name:"isGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"isGpsTrackingEnabled"in e,get:e=>e.isGpsTrackingEnabled,set:(e,s)=>{e.isGpsTrackingEnabled=s}},metadata:t},Pe,De),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=r(this,a);cpTimeout;routeLines=r(this,l,[]);routeDistance=(r(this,f),r(this,v,null));currentPosition=(r(this,R),r(this,E,null));requestCompass=(r(this,z),r(this,D,!1));iconType=(r(this,I),r(this,A,0));tempToBooth=(r(this,M),r(this,C,null));defaultFrom=(r(this,F),r(this,U,null));focusEnabled=(r(this,O),r(this,Z,!0));prevZ=(r(this,q),r(this,V,null));markersData=(r(this,j),r(this,K,{icons:[],markers:[]}));prevMarkers=(r(this,X),r(this,H,[]));showAccessible=(r(this,J),r(this,ee,!!Ge.getLines().find(t=>t.unaccessible)));onlyAccessible=(r(this,te),r(this,ae,!1));currentRouteLayer=(r(this,ie),r(this,ne,null));constructor(t){r(this,De),this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!this.defaultFrom||!!this.currentPosition}selectRoute(t,e=!0){e&&(p.list={type:"search",text:"",focused:!1}),!t?.from&&t?.to&&this.currentPosition&&(t.from=this.nearestBooth),t?.from&&t?.to&&t.from===t.to&&(t=null);let s=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from?.visible&&s.push(t.from),t?.to?.visible&&(this.tempToBooth=null,s.push(t.to)),!t&&o.fp.onDirection&&o.fp.onDirection(null),setTimeout(()=>{this.rootStore.moveToList(s),p.details=t,t&&(!t.from||!t.to)&&o.showOverlay(),t?.to&&t?.from?.layer&&this.rootStore.layerStore.updateVisibility(t.from.layer,!0),!this.currentRouteLayer&&t?.from?.layer&&(this.currentRouteLayer=t?.from?.layer),e&&t?.from&&t?.to&&Xe(Ke.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)},200)}setStartPoint(t){const e=p.selectedRoute;if(e?.to&&!e?.from&&t){const s=new Route(t,e.to,e.waypoints);this.selectRoute(s)}}get pathLayers(){return o.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,s)=>s.indexOf(t)===e).reverse().map((t,e)=>({id:e+1,layer:o.layerStore.findLayer(t)}))}get nearestBooth(){return this.getNearestBooth(this.currentPosition)}getNearestBooth(t){if(!t)return null;let e=this.rootStore.layerStore.findLayer(t.z);const s=t.lat&&t.lng?Be(t,T.properties.config):t;return this.rootStore.boothStore.booths.filter(c=>x.mode===et.Default||!e?c.visible&&c.rect:c.rect&&(typeof t.z!="number"&&!t.z&&c.visible||e.name===c.layer?.name)).sort((c,u)=>Me(s,{x:c.rect.cx,y:c.rect.cy})-Me(s,{x:u.rect.cx,y:u.rect.cy}))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(ot),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const s=this.markersData.markers.find(u=>u.id===t);this.markersData.markers.forEach(u=>u.active=!1),s&&(s.active=!0);let c=o.layerStore.findLayer(s?.z);if(e&&s){const u=o.rendererService.renderer;return c&&!c?.visible&&x.updateVisibility(c,!0),u?u.controls.panTo(s.x,s.y):(qe.warn("Renderer is not initialized. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(t=>t.active)}get layers(){var t=[];return o.routeStore.routeLines?.map(e=>e.p0.layer).reverse().forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>o.layerStore.layers.find(s=>s.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,p.list.type==="route-planner"&&(p.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(this.defaultFrom||t,e))}selectCurrentPosition(t,e=!0,s){clearTimeout(this.cpTimeout),t&&(t.x=g(t.x),t.y=g(t.y),t.lat=g(t.lat),t.lng=g(t.lng),st()||(t.z=null)),e=!(e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route))&&(this.focusEnabled||this.prevZ!=t?.z),this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=s?1:0;const u=t?lt(t):null;if(!u){this.currentPosition=null;return}const _=o.layerStore.findLayer(t.z),b=new CurrentPosition(u.x,u.y,_?.name||this.currentRouteLayer?.name,Ye(u),t.lat,t.lng),S=p.selectedRoute;let Ae=!this.routeLines?.length;if(_&&this.routeLines?.length&&(Ae=!!this.routeLines.find(y=>y.p0.layer===_.name||y.p1.layer===_.name)),e&&Ae){const y=o.rendererService.renderer;if(_&&!_?.visible&&x.updateVisibility(_,!0),!y){qe.warn("Renderer is not initialized. Cannot pan to current position.");return}y.controls.panTo(b.x,b.y)}const $e=!(rt.EXPO==="cloudnext26")&&ct(b,this.routeLines)&&!!it(b,je.booths,[S?.to]);if(S&&$e){const y=o.routeStore.getNearestBooth(b);o.routeStore.selectRoute(new Route(y,S?.to),!1)}this.currentPosition=b,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(this.canFindLocation){if(o.mapboxStore.showMapbox){p.moveToLocation=!0;return}if(o.routeStore.currentPosition){const t=o.routeStore.currentPosition,e=We.fromCxcywh(t.x,t.y,100,100);if(!e.intersects(Je))return;localStorage.getItem(tt)==="false"&&(o.routeStore.requestCompass=!0),p.moveToRect=e;const c=o.layerStore.findLayer(o.routeStore.currentPosition?.z);c&&x.updateVisibility(c,!0)}else o.selectBooth(o.routeStore.defaultFrom)}}routeUnits=(r(this,oe),r(this,ve,Ne));get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:Oe(t,Ue(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=He(),s=(e.getAttribute("units")||Ne).toLowerCase?.().trim(),c=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(c?1:10)),this.routeUnits=s,this.updateRoutePoints()}updateRoutePoints(){const t=p.selectedRoute,e=this.routeDistance,s=this.routeUnits;o.fp.onDirection&&setTimeout(()=>{o.fp.onDirection({from:t?.from?{id:t.from.id,name:t.from.name,externalId:t.from.externalId,layer:{name:t.from?.layer?.name,description:t.from?.layer?.description}}:null,to:t?.to?{id:t.to.id,name:t.to.name,externalId:t.to.externalId,layer:{name:t.to.layer?.name,description:t.to.layer?.description}}:null,lines:this.routeLines,distance:`${e}${s}`,units:s,time:Oe(e,Ue(s))})},200)}checkRoutes(){let t=o.boothStore.booths;console.info(`Route check started ${t.length}.... `);for(let e=0;e<t.length;e++){const s=t[e];for(let c=e+1;c<t.length;c++){const u=t[c];Qe(Ge,Fe(s),Fe(u)).length||console.warn(`No route found from ${s.name} to ${u.name}`)}}console.info("Route check done....")}isGpsTrackingEnabled=(r(this,Re),r(this,Pe,!0));setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return Ze.autoTrackingGps&&this.isGpsTrackingEnabled&&!Ze.enableIPS}}})();export default nt;function ot(a){return{...a,x:g(a.x),y:g(a.y),lat:g(a.lat),lng:g(a.lng)}}function lt(a){let n=null,l=null;return T&&(n=T.properties.config),n&&a.x>=n.p0.x&&a.x<=n.p2.x&&a.y>=n.p0.y&&a.y<=n.p2.y?l={...a}:n&&Ce(a.lat)&&Ce(a.lng)?l=Be(a,n):n||(l=a),l||null}export function findBooth(a){return o.boothStore.findBooth(a)||o.exhibitorStore.findExhibitor(a)?.booths[0]}export function findEntityByExternalId(a){const n=o.boothStore.boothByExternalId.get(a);if(n)return{type:"booth",entity:n};const l=o.exhibitorStore.exhibitorByExternalId.get(a);if(l)return{type:"exhibitor",entity:l}}export function separateExternalIds(a){const n=[],l=[];for(const f of a){const h=findEntityByExternalId(f);h&&(h.type==="booth"?n.push(f):l.push(f))}return{boothExternalIds:n,exhibitorExternalIds:l}}export function extractRoute(a,n,l){return new Route(findBooth(a)??o.routeStore.defaultFrom??null,findBooth(n),l?.map(f=>findBooth(f)))}export class Route{from;to;waypoints;constructor(n,l,f){this.from=n,this.to=l,this.waypoints=f,this.waypoints=f?.filter(h=>h&&h.id!==n?.id&&h.id!==l?.id)}}export class CurrentPosition extends Ve{x;y;z;angle;lat;lng;constructor(n,l,f,h,v,R){super(n,l),this.x=n,this.y=l,this.z=f,this.angle=h,this.lat=v,this.lng=R}}function ct(a,n,l=10){if(!a||!n?.length)return!1;const f={layer:a.z?String(a.z):void 0,x:a.x,y:a.y},h=at(f,n);return isFinite(h)&&h>l}
1
+ import{__esDecorate as i,__runInitializers as r}from"tslib";import{action as m,computed as k,observable as d}from"mobx";import{Point as je,lineLength as Be}from"simple-geometry";import o,{boothStore as We,layersStore as x}from".";import{fpGeo as T}from"../data/fpGeo";import Ke from"../core/Rect";import{GaEventActions as Xe,sendEventToGa as Ye}from"../tools/gtag";import{convertGpsToLocal as Ce,isValidPointCoords as Fe,calculateRelativeBearing as He}from"../utils/gps";import{getLayerSvg as Je,svgArea as Qe}from"../data/svg";import{getGraphLines as et,boothToWaypoint as Ge,graphDataSource as Oe}from"../wayfinding";import{LayersMode as tt}from"./LayerStore";import{uiState as p}from"./index";import{calcSpeed as Ue}from"../utils/calcSpeed";import{calcTravelTime as Ne}from"../utils/calcTravelTime";import{DEFAULT_UNITS as Ze,ORIENTATION_GRANTED_KEY as st}from"../constants";import{areLayersEnabled as at}from"../utils/areLayersEnabled";import{distancePointToRouteOnLayer as it,findBoothInRadius as rt}from"../components/Map/drawing/config/route-snapping";import qe from"../data";import $e from"../tools/logger";import nt from"../tools/settings";const y=a=>typeof a=="string"?Number(a.replace(",",".")):a;let ot=(()=>{let a=[],n,l=[],f=[],h,v=[],R=[],L,E=[],z=[],P,D=[],I=[],A,w=[],M=[],B,C=[],F=[],G,O=[],U=[],N,Z=[],q=[],$,V=[],j=[],W,K=[],X=[],Y,H=[],J=[],Q,ee=[],te=[],se,ae=[],ie=[],re,ne=[],oe=[],le,ce,ue,de,fe,he,me,pe,_e,ye,ge,ke,be,ve=[],Re=[],xe,Se,Te,Le,Ee,ze,Pe=[],De=[],Ie,Ae,we;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[d],h=[d],L=[d],P=[d],A=[d],B=[d],G=[d],N=[d],$=[d],W=[d],Y=[d],Q=[d],se=[d],re=[d],le=[k],ce=[m],ue=[m],de=[k({keepAlive:!0})],fe=[k({keepAlive:!0})],he=[m],me=[m],pe=[k({keepAlive:!0})],_e=[k({keepAlive:!0})],ye=[m],ge=[m],ke=[m],be=[d],xe=[k],Se=[m],Te=[m],Le=[m],Ee=[m],ze=[d],Ie=[m],Ae=[k({keepAlive:!0})],we=[m],i(this,null,le,{kind:"getter",name:"canFindLocation",static:!1,private:!1,access:{has:e=>"canFindLocation"in e,get:e=>e.canFindLocation},metadata:t},null,a),i(this,null,ce,{kind:"method",name:"selectRoute",static:!1,private:!1,access:{has:e=>"selectRoute"in e,get:e=>e.selectRoute},metadata:t},null,a),i(this,null,ue,{kind:"method",name:"setStartPoint",static:!1,private:!1,access:{has:e=>"setStartPoint"in e,get:e=>e.setStartPoint},metadata:t},null,a),i(this,null,de,{kind:"getter",name:"pathLayers",static:!1,private:!1,access:{has:e=>"pathLayers"in e,get:e=>e.pathLayers},metadata:t},null,a),i(this,null,fe,{kind:"getter",name:"nearestBooth",static:!1,private:!1,access:{has:e=>"nearestBooth"in e,get:e=>e.nearestBooth},metadata:t},null,a),i(this,null,he,{kind:"method",name:"setMarkers",static:!1,private:!1,access:{has:e=>"setMarkers"in e,get:e=>e.setMarkers},metadata:t},null,a),i(this,null,me,{kind:"method",name:"selectMarker",static:!1,private:!1,access:{has:e=>"selectMarker"in e,get:e=>e.selectMarker},metadata:t},null,a),i(this,null,pe,{kind:"getter",name:"selectedMarkers",static:!1,private:!1,access:{has:e=>"selectedMarkers"in e,get:e=>e.selectedMarkers},metadata:t},null,a),i(this,null,_e,{kind:"getter",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers},metadata:t},null,a),i(this,null,ye,{kind:"method",name:"clickRoute",static:!1,private:!1,access:{has:e=>"clickRoute"in e,get:e=>e.clickRoute},metadata:t},null,a),i(this,null,ge,{kind:"method",name:"selectCurrentPosition",static:!1,private:!1,access:{has:e=>"selectCurrentPosition"in e,get:e=>e.selectCurrentPosition},metadata:t},null,a),i(this,null,ke,{kind:"method",name:"findLocation",static:!1,private:!1,access:{has:e=>"findLocation"in e,get:e=>e.findLocation},metadata:t},null,a),i(this,null,xe,{kind:"getter",name:"routeInfo",static:!1,private:!1,access:{has:e=>"routeInfo"in e,get:e=>e.routeInfo},metadata:t},null,a),i(this,null,Se,{kind:"method",name:"updateRoute",static:!1,private:!1,access:{has:e=>"updateRoute"in e,get:e=>e.updateRoute},metadata:t},null,a),i(this,null,Te,{kind:"method",name:"updateRouteDistance",static:!1,private:!1,access:{has:e=>"updateRouteDistance"in e,get:e=>e.updateRouteDistance},metadata:t},null,a),i(this,null,Le,{kind:"method",name:"updateRoutePoints",static:!1,private:!1,access:{has:e=>"updateRoutePoints"in e,get:e=>e.updateRoutePoints},metadata:t},null,a),i(this,null,Ee,{kind:"method",name:"checkRoutes",static:!1,private:!1,access:{has:e=>"checkRoutes"in e,get:e=>e.checkRoutes},metadata:t},null,a),i(this,null,Ie,{kind:"method",name:"setGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"setGpsTrackingEnabled"in e,get:e=>e.setGpsTrackingEnabled},metadata:t},null,a),i(this,null,Ae,{kind:"getter",name:"gpsEnabled",static:!1,private:!1,access:{has:e=>"gpsEnabled"in e,get:e=>e.gpsEnabled},metadata:t},null,a),i(this,null,we,{kind:"method",name:"setOnlyAccessible",static:!1,private:!1,access:{has:e=>"setOnlyAccessible"in e,get:e=>e.setOnlyAccessible},metadata:t},null,a),i(null,null,n,{kind:"field",name:"routeLines",static:!1,private:!1,access:{has:e=>"routeLines"in e,get:e=>e.routeLines,set:(e,s)=>{e.routeLines=s}},metadata:t},l,f),i(null,null,h,{kind:"field",name:"routeDistance",static:!1,private:!1,access:{has:e=>"routeDistance"in e,get:e=>e.routeDistance,set:(e,s)=>{e.routeDistance=s}},metadata:t},v,R),i(null,null,L,{kind:"field",name:"currentPosition",static:!1,private:!1,access:{has:e=>"currentPosition"in e,get:e=>e.currentPosition,set:(e,s)=>{e.currentPosition=s}},metadata:t},E,z),i(null,null,P,{kind:"field",name:"requestCompass",static:!1,private:!1,access:{has:e=>"requestCompass"in e,get:e=>e.requestCompass,set:(e,s)=>{e.requestCompass=s}},metadata:t},D,I),i(null,null,A,{kind:"field",name:"iconType",static:!1,private:!1,access:{has:e=>"iconType"in e,get:e=>e.iconType,set:(e,s)=>{e.iconType=s}},metadata:t},w,M),i(null,null,B,{kind:"field",name:"tempToBooth",static:!1,private:!1,access:{has:e=>"tempToBooth"in e,get:e=>e.tempToBooth,set:(e,s)=>{e.tempToBooth=s}},metadata:t},C,F),i(null,null,G,{kind:"field",name:"defaultFrom",static:!1,private:!1,access:{has:e=>"defaultFrom"in e,get:e=>e.defaultFrom,set:(e,s)=>{e.defaultFrom=s}},metadata:t},O,U),i(null,null,N,{kind:"field",name:"focusEnabled",static:!1,private:!1,access:{has:e=>"focusEnabled"in e,get:e=>e.focusEnabled,set:(e,s)=>{e.focusEnabled=s}},metadata:t},Z,q),i(null,null,$,{kind:"field",name:"prevZ",static:!1,private:!1,access:{has:e=>"prevZ"in e,get:e=>e.prevZ,set:(e,s)=>{e.prevZ=s}},metadata:t},V,j),i(null,null,W,{kind:"field",name:"markersData",static:!1,private:!1,access:{has:e=>"markersData"in e,get:e=>e.markersData,set:(e,s)=>{e.markersData=s}},metadata:t},K,X),i(null,null,Y,{kind:"field",name:"prevMarkers",static:!1,private:!1,access:{has:e=>"prevMarkers"in e,get:e=>e.prevMarkers,set:(e,s)=>{e.prevMarkers=s}},metadata:t},H,J),i(null,null,Q,{kind:"field",name:"showAccessible",static:!1,private:!1,access:{has:e=>"showAccessible"in e,get:e=>e.showAccessible,set:(e,s)=>{e.showAccessible=s}},metadata:t},ee,te),i(null,null,se,{kind:"field",name:"onlyAccessible",static:!1,private:!1,access:{has:e=>"onlyAccessible"in e,get:e=>e.onlyAccessible,set:(e,s)=>{e.onlyAccessible=s}},metadata:t},ae,ie),i(null,null,re,{kind:"field",name:"currentRouteLayer",static:!1,private:!1,access:{has:e=>"currentRouteLayer"in e,get:e=>e.currentRouteLayer,set:(e,s)=>{e.currentRouteLayer=s}},metadata:t},ne,oe),i(null,null,be,{kind:"field",name:"routeUnits",static:!1,private:!1,access:{has:e=>"routeUnits"in e,get:e=>e.routeUnits,set:(e,s)=>{e.routeUnits=s}},metadata:t},ve,Re),i(null,null,ze,{kind:"field",name:"isGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"isGpsTrackingEnabled"in e,get:e=>e.isGpsTrackingEnabled,set:(e,s)=>{e.isGpsTrackingEnabled=s}},metadata:t},Pe,De),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=r(this,a);cpTimeout;routeLines=r(this,l,[]);routeDistance=(r(this,f),r(this,v,null));currentPosition=(r(this,R),r(this,E,null));requestCompass=(r(this,z),r(this,D,!1));iconType=(r(this,I),r(this,w,0));tempToBooth=(r(this,M),r(this,C,null));defaultFrom=(r(this,F),r(this,O,null));focusEnabled=(r(this,U),r(this,Z,!0));prevZ=(r(this,q),r(this,V,null));markersData=(r(this,j),r(this,K,{icons:[],markers:[]}));prevMarkers=(r(this,X),r(this,H,[]));showAccessible=(r(this,J),r(this,ee,!!Oe.getLines().find(t=>t.unaccessible)));onlyAccessible=(r(this,te),r(this,ae,!1));currentRouteLayer=(r(this,ie),r(this,ne,null));constructor(t){r(this,De),this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!this.defaultFrom||!!this.currentPosition}selectRoute(t,e=!0){e&&(p.list={type:"search",text:"",focused:!1}),!t?.from&&t?.to&&this.currentPosition&&(t.from=this.nearestBooth),t?.from&&t?.to&&t.from===t.to&&(t=null);let s=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from?.visible&&s.push(t.from),t?.to?.visible&&(this.tempToBooth=null,s.push(t.to)),!t&&o.fp.onDirection&&o.fp.onDirection(null),setTimeout(()=>{this.rootStore.moveToList(s),p.details=t,t&&(!t.from||!t.to)&&o.showOverlay(),t?.to&&t?.from?.layer&&this.rootStore.layerStore.updateVisibility(t.from.layer,!0),!this.currentRouteLayer&&t?.from?.layer&&(this.currentRouteLayer=t?.from?.layer),e&&t?.from&&t?.to&&Ye(Xe.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)},200)}setStartPoint(t){const e=p.selectedRoute;if(e?.to&&!e?.from&&t){const s=new Route(t,e.to,e.waypoints);this.selectRoute(s)}}get pathLayers(){return o.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,s)=>s.indexOf(t)===e).reverse().map((t,e)=>({id:e+1,layer:o.layerStore.findLayer(t)}))}get nearestBooth(){return this.getNearestBooth(this.currentPosition)}getNearestBooth(t){if(!t)return null;let e=this.rootStore.layerStore.findLayer(t.z);const s=t.lat&&t.lng?Ce(t,T.properties.config):t;return this.rootStore.boothStore.booths.filter(c=>x.mode===tt.Default||!e?c.visible&&c.rect:c.rect&&(typeof t.z!="number"&&!t.z&&c.visible||e.name===c.layer?.name)).sort((c,u)=>Be(s,{x:c.rect.cx,y:c.rect.cy})-Be(s,{x:u.rect.cx,y:u.rect.cy}))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(lt),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const s=this.markersData.markers.find(u=>u.id===t);this.markersData.markers.forEach(u=>u.active=!1),s&&(s.active=!0);let c=o.layerStore.findLayer(s?.z);if(e&&s){const u=o.rendererService.renderer;return c&&!c?.visible&&x.updateVisibility(c,!0),u?u.controls.panTo(s.x,s.y):($e.warn("Renderer is not initialized. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(t=>t.active)}get layers(){var t=[];return o.routeStore.routeLines?.map(e=>e.p0.layer).reverse().forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>o.layerStore.layers.find(s=>s.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,p.list.type==="route-planner"&&(p.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(this.defaultFrom||t,e))}selectCurrentPosition(t,e=!0,s){clearTimeout(this.cpTimeout),t&&(t.x=y(t.x),t.y=y(t.y),t.lat=y(t.lat),t.lng=y(t.lng),at()||(t.z=null)),e=!(e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route))&&(this.focusEnabled||this.prevZ!=t?.z),this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=s?1:0;const u=t?ct(t):null;if(!u){this.currentPosition=null;return}const _=o.layerStore.findLayer(t.z),b=new CurrentPosition(u.x,u.y,_?.name||this.currentRouteLayer?.name,He(u),t.lat,t.lng),S=p.selectedRoute;let Me=!this.routeLines?.length;if(_&&this.routeLines?.length&&(Me=!!this.routeLines.find(g=>g.p0.layer===_.name||g.p1.layer===_.name)),e&&Me){const g=o.rendererService.renderer;if(_&&!_?.visible&&x.updateVisibility(_,!0),!g){$e.warn("Renderer is not initialized. Cannot pan to current position.");return}g.controls.panTo(b.x,b.y)}const Ve=!(nt.EXPO==="cloudnext26")&&ut(b,this.routeLines)&&!!rt(b,We.booths,[S?.to]);if(S&&Ve){const g=o.routeStore.getNearestBooth(b);o.routeStore.selectRoute(new Route(g,S?.to),!1)}this.currentPosition=b,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(this.canFindLocation){if(o.mapboxStore.showMapbox){p.moveToLocation=!0;return}if(o.routeStore.currentPosition){const t=o.routeStore.currentPosition,e=Ke.fromCxcywh(t.x,t.y,100,100);if(!e.intersects(Qe))return;localStorage.getItem(st)==="false"&&(o.routeStore.requestCompass=!0),p.moveToRect=e;const c=o.layerStore.findLayer(o.routeStore.currentPosition?.z);c&&x.updateVisibility(c,!0)}else o.selectBooth(o.routeStore.defaultFrom)}}routeUnits=(r(this,oe),r(this,ve,Ze));get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:Ne(t,Ue(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=Je(),s=(e.getAttribute("units")||Ze).toLowerCase?.().trim(),c=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(c?1:10)),this.routeUnits=s,this.updateRoutePoints()}updateRoutePoints(){const t=p.selectedRoute,e=this.routeDistance,s=this.routeUnits;o.fp.onDirection&&setTimeout(()=>{o.fp.onDirection({from:t?.from?{id:t.from.id,name:t.from.name,externalId:t.from.externalId,layer:{name:t.from?.layer?.name,description:t.from?.layer?.description}}:null,to:t?.to?{id:t.to.id,name:t.to.name,externalId:t.to.externalId,layer:{name:t.to.layer?.name,description:t.to.layer?.description}}:null,lines:this.routeLines,distance:`${e}${s}`,units:s,time:Ne(e,Ue(s))})},200)}checkRoutes(){let t=o.boothStore.booths;console.info(`Route check started ${t.length}.... `);for(let e=0;e<t.length;e++){const s=t[e];for(let c=e+1;c<t.length;c++){const u=t[c];et(Oe,Ge(s),Ge(u)).length||console.warn(`No route found from ${s.name} to ${u.name}`)}}console.info("Route check done....")}isGpsTrackingEnabled=(r(this,Re),r(this,Pe,!0));setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return qe.autoTrackingGps&&this.isGpsTrackingEnabled&&!qe.enableIPS}setOnlyAccessible(t){this.onlyAccessible=t}}})();export default ot;function lt(a){return{...a,x:y(a.x),y:y(a.y),lat:y(a.lat),lng:y(a.lng)}}function ct(a){let n=null,l=null;return T&&(n=T.properties.config),n&&a.x>=n.p0.x&&a.x<=n.p2.x&&a.y>=n.p0.y&&a.y<=n.p2.y?l={...a}:n&&Fe(a.lat)&&Fe(a.lng)?l=Ce(a,n):n||(l=a),l||null}export function findBooth(a){return o.boothStore.findBooth(a)||o.exhibitorStore.findExhibitor(a)?.booths[0]}export function findEntityByExternalId(a){const n=o.boothStore.boothByExternalId.get(a);if(n)return{type:"booth",entity:n};const l=o.exhibitorStore.exhibitorByExternalId.get(a);if(l)return{type:"exhibitor",entity:l}}export function separateExternalIds(a){const n=[],l=[];for(const f of a){const h=findEntityByExternalId(f);h&&(h.type==="booth"?n.push(f):l.push(f))}return{boothExternalIds:n,exhibitorExternalIds:l}}export function extractRoute(a,n,l){return new Route(findBooth(a)??o.routeStore.defaultFrom??null,findBooth(n),l?.map(f=>findBooth(f)))}export class Route{from;to;waypoints;constructor(n,l,f){this.from=n,this.to=l,this.waypoints=f,this.waypoints=f?.filter(h=>h&&h.id!==n?.id&&h.id!==l?.id)}}export class CurrentPosition extends je{x;y;z;angle;lat;lng;constructor(n,l,f,h,v,R){super(n,l),this.x=n,this.y=l,this.z=f,this.angle=h,this.lat=v,this.lng=R}}function ut(a,n,l=10){if(!a||!n?.length)return!1;const f={layer:a.z?String(a.z):void 0,x:a.x,y:a.y},h=it(f,n);return isFinite(h)&&h>l}
@@ -1,12 +1,9 @@
1
1
  declare global {
2
2
  interface Window {
3
- efpDebug?: {
4
- settings?: Record<string, {
5
- type: "boolean";
6
- label?: string;
7
- default?: boolean;
8
- }>;
9
- };
3
+ efpDebugUi?: Record<string, {
4
+ type: "boolean";
5
+ default?: boolean;
6
+ }>;
10
7
  }
11
8
  }
12
9
  declare const isDebug: boolean;
@@ -1 +1 @@
1
- import{DEBUG_STORAGE_KEY as e}from"../constants";import{isLocalStorageAvailable as t}from"./localStorage";if(typeof window<"u"){const o=window.efpDebug??={};(o.settings??={})[e]={type:"boolean",label:"Debug Mode"}}const i=t&&localStorage.getItem(e)==="true";export default i;
1
+ import{DEBUG_STORAGE_KEY as e}from"../constants";import{isLocalStorageAvailable as o}from"./localStorage";typeof window<"u"&&((window.efpDebugUi??={})[e]={type:"boolean"});const t=o&&localStorage.getItem(e)==="true";export default t;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expofp/floorplan",
3
- "version": "3.1.15",
3
+ "version": "3.2.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/expofp/efp-app.git",
@@ -76,8 +76,8 @@
76
76
  "twgl.js": "^4.14.0",
77
77
  "uuid": "^9.0.1",
78
78
  "zod": "4.3.5",
79
- "@expofp/debug": "3.1.15",
80
- "@expofp/resolve": "3.1.15"
79
+ "@expofp/debug": "3.2.0",
80
+ "@expofp/resolve": "3.2.0"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@babel/plugin-proposal-decorators": "^7.29.0",