@expofp/floorplan 3.2.7 → 3.2.9

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 (98) hide show
  1. package/dist/browser/{CookieConsent-C0WrwOQU.js → CookieConsent-CWY01nS_.js} +1787 -1803
  2. package/dist/browser/{Debug-7KOvbcgu.js → Debug-Ch39-r8o.js} +9 -9
  3. package/dist/browser/{Demo-BTrpOaT8.js → Demo-CA2Dtr9p.js} +11 -11
  4. package/dist/browser/Free-tZoGYbm5.js +63 -0
  5. package/dist/browser/{Gallery-PP-H3fui.js → Gallery-DQ-NTa6R.js} +9 -9
  6. package/dist/browser/{GpsLoader-pif05qaO.js → GpsLoader-Bznt_xLN.js} +14 -14
  7. package/dist/browser/{KioskStore-BmqfGXEW.js → KioskStore-A9vmXOZE.js} +3 -3
  8. package/dist/browser/{Mapbox-BEO3oA1E.js → Mapbox-eDkFWPPi.js} +37 -37
  9. package/dist/browser/{SetKioskMode-BjyRxPem.js → SetKioskMode-AU-W_Z-f.js} +17 -17
  10. package/dist/browser/{ShowKiosk-DrNFPO0o.js → ShowKiosk-CLuMqmTz.js} +10 -10
  11. package/dist/browser/{ThreeComponent-CkTRDPj-.js → ThreeComponent-DsCG_vs5.js} +156 -156
  12. package/dist/browser/{TouchHand-BX9ElW6V.js → TouchHand-B8RiBF7o.js} +4 -4
  13. package/dist/browser/{ViewerMenuPanel-BpxIaNdU.js → ViewerMenuPanel-DZ5vz7rp.js} +13 -13
  14. package/dist/browser/{add-debug-secret-listener-BV3Vlx9C.js → add-debug-secret-listener-qEasEfwK.js} +1 -1
  15. package/dist/browser/{boolean-editor-DfkvcIH0.js → boolean-editor-KFTxmdzj.js} +10 -10
  16. package/dist/browser/{bootIntercom-XKKrQyNd.js → bootIntercom-CNQeFaoJ.js} +2 -2
  17. package/dist/browser/{box-Cy-U95_G.js → box-DutTTrem.js} +5 -5
  18. package/dist/browser/{browser-oUjLaYcl.js → browser-CPxDQEuR.js} +2 -2
  19. package/dist/browser/bundle.json +53 -53
  20. package/dist/browser/{classnames-DpaK9tQ8.js → classnames-Ik0tGjEU.js} +2 -2
  21. package/dist/browser/{client-smunwL9U.js → client-nXMugISE.js} +4 -4
  22. package/dist/browser/{data-BVaCNE1I.js → data-CydM_gUZ.js} +44 -44
  23. package/dist/browser/{debug-overlay-CYWt6Xv8.js → debug-overlay-BSe6nuZ0.js} +11 -11
  24. package/dist/browser/{debug-ui-D63K4FZz.js → debug-ui-2Bawq2Zx.js} +6 -6
  25. package/dist/browser/{dist-irw0I8ne.js → dist-4or7mRbG.js} +5 -5
  26. package/dist/browser/{dist-BU_A8R-K.js → dist-CAmPggJH.js} +6 -6
  27. package/dist/browser/{dist-XBFUxmAT.js → dist-KO_kG62p.js} +3 -3
  28. package/dist/browser/{efp-debug-init-CPGmIrNj.js → efp-debug-init-B-QTb8ay.js} +2 -2
  29. package/dist/browser/{enum-editor-B_JVlLVN.js → enum-editor-_Giaelpg.js} +11 -11
  30. package/dist/browser/{exports-C5NN5UxX.js → exports-M1edBIa9.js} +1 -1
  31. package/dist/browser/{favicon-B0nAd4Pr.js → favicon-D-Go_G7E.js} +1 -1
  32. package/dist/browser/{fetch-retry.umd-DBq0GieJ.js → fetch-retry.umd-Bc9GSOuq.js} +2 -2
  33. package/dist/browser/{flex-DOhgUp1k.js → flex-BUqhIIGb.js} +6 -6
  34. package/dist/browser/{flex.props-D8JHoC5B.js → flex.props-BU9Dksr-.js} +2 -2
  35. package/dist/browser/{floorplan.loader-Cme4mipd.js → floorplan.loader-D-OUcFuZ.js} +9 -9
  36. package/dist/browser/{floorplan.ready-C25lQjgP.js → floorplan.ready-BWHY8wbf.js} +12 -12
  37. package/dist/browser/{fuse-D1o3bI0m.js → fuse-D01t_ZBu.js} +2 -2
  38. package/dist/browser/index.js +13 -13
  39. package/dist/browser/{is-debug-D9BzIDdu.js → is-debug-C0ORuwBz.js} +3 -3
  40. package/dist/browser/{jsx-runtime-C0zFKVvF.js → jsx-runtime-Cd4pI6Dj.js} +2 -2
  41. package/dist/browser/{lib-D2sBqUIY.js → lib-BjLS1Qen.js} +4 -4
  42. package/dist/browser/{main-GLYY8zv3.js → main-CBzEenbU.js} +1 -1
  43. package/dist/browser/{mobx-D5pYBM85.js → mobx-h7HhZjCg.js} +4 -4
  44. package/dist/browser/{particles.min-egXyIDIV.js → particles.min-V6djuJnx.js} +2 -2
  45. package/dist/browser/{prop-types-xhHzBbvi.js → prop-types-8DrggUgf.js} +2 -2
  46. package/dist/browser/{react-CanbjT5I.js → react-Dd6qt83k.js} +2 -2
  47. package/dist/browser/{react-dom-wNBYs_H5.js → react-dom-aRO55sP1.js} +3 -3
  48. package/dist/browser/{reset-all-settings-5oUUws5J.js → reset-all-settings-N7kAP_D7.js} +7 -7
  49. package/dist/browser/{rolldown-runtime-BKpHzyBK.js → rolldown-runtime-wY3V7GBs.js} +1 -1
  50. package/dist/browser/{settings-D5qqIejY.js → settings-D7A9piKA.js} +2 -2
  51. package/dist/browser/{settings-item-Blm7DAEt.js → settings-item-BVKYXscM.js} +6 -6
  52. package/dist/browser/{store-CM7rJpRZ.js → store-D670bJ4A.js} +4296 -4396
  53. package/dist/browser/{string-editor-CLdOCbq2.js → string-editor-Cg7jqVa9.js} +8 -8
  54. package/dist/browser/{theme-App4ywLP.js → theme-4dAp6vO1.js} +8 -8
  55. package/dist/browser/{ui-BN6m_5pK.js → ui-BzQCWHO0.js} +8 -8
  56. package/dist/esm/components/Map/Map.js +1 -1
  57. package/dist/esm/components/Map/drawing/config/config-all.js +1 -1
  58. package/dist/esm/components/Map/drawing/config/config-booths.js +1 -1
  59. package/dist/esm/components/SearchBox.js +1 -1
  60. package/dist/esm/load.js +1 -1
  61. package/dist/esm/services/routing.js +1 -1
  62. package/dist/esm/store/BoothStore.d.ts +0 -1
  63. package/dist/esm/store/BoothStore.js +1 -1
  64. package/dist/esm/store/RouteStore.js +1 -1
  65. package/dist/esm/store/UIState.js +1 -1
  66. package/dist/esm/store/init/init-booths.js +1 -1
  67. package/dist/esm/tools/track-event.js +1 -1
  68. package/dist/esm/utils/customCommands.d.ts +1 -1
  69. package/dist/esm/utils/customCommands.js +1 -1
  70. package/dist/esm/wayfinding/adapters/boothToEndpoint.d.ts +2 -6
  71. package/dist/esm/wayfinding/adapters/boothToEndpoint.js +1 -1
  72. package/dist/esm/wayfinding/adapters/index.d.ts +0 -1
  73. package/dist/esm/wayfinding/adapters/index.js +1 -1
  74. package/dist/esm/wayfinding/bindMobxReactions.js +1 -1
  75. package/dist/esm/wayfinding/core/createWayfindingEngine.d.ts +3 -3
  76. package/dist/esm/wayfinding/core/geometry/pointInPolygon.d.ts +11 -0
  77. package/dist/esm/wayfinding/core/geometry/pointInPolygon.js +1 -0
  78. package/dist/esm/wayfinding/core/index.d.ts +1 -2
  79. package/dist/esm/wayfinding/core/index.js +1 -1
  80. package/dist/esm/wayfinding/core/position/snapToRoute.js +1 -1
  81. package/dist/esm/wayfinding/core/rendering/computeTransitionPoints.js +1 -1
  82. package/dist/esm/wayfinding/core/routing/findNearestGraphPoint.d.ts +5 -20
  83. package/dist/esm/wayfinding/core/routing/findNearestGraphPoint.js +1 -1
  84. package/dist/esm/wayfinding/core/routing/resolveWaypointCandidates.d.ts +3 -6
  85. package/dist/esm/wayfinding/core/routing/resolveWaypointCandidates.js +1 -1
  86. package/dist/esm/wayfinding/core/types.d.ts +9 -26
  87. package/dist/esm/wayfinding/runtime/createWayfindingRuntime.js +1 -1
  88. package/dist/esm/wayfinding/runtime/types.d.ts +1 -1
  89. package/package.json +3 -3
  90. package/dist/browser/Free-1JPcV1Tq.js +0 -63
  91. package/dist/esm/components/Map/drawing/config/config-booth-scaled.d.ts +0 -14
  92. package/dist/esm/components/Map/drawing/config/config-booth-scaled.js +0 -1
  93. package/dist/esm/components/Map/drawing/config/config-yah.d.ts +0 -2
  94. package/dist/esm/components/Map/drawing/config/config-yah.js +0 -1
  95. package/dist/esm/utils/yah.d.ts +0 -8
  96. package/dist/esm/utils/yah.js +0 -1
  97. package/dist/esm/wayfinding/adapters/boothToWaypoint.d.ts +0 -12
  98. package/dist/esm/wayfinding/adapters/boothToWaypoint.js +0 -1
@@ -1,18 +1,18 @@
1
1
  (function() {
2
2
  try {
3
3
  var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
4
- e.SENTRY_RELEASE = { id: "3.2.7" };
4
+ e.SENTRY_RELEASE = { id: "3.2.9" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "d6998a34-2e60-485b-acb4-511cd67af42e", e._sentryDebugIdIdentifier = "sentry-dbid-d6998a34-2e60-485b-acb4-511cd67af42e");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-BKpHzyBK.js";
10
- import { t } from "./react-CanbjT5I.js";
11
- import { t as n } from "./jsx-runtime-C0zFKVvF.js";
12
- import { E as r, c as i, l as a, o, r as s, v as c } from "./box-Cy-U95_G.js";
13
- import { t as l } from "./classnames-DpaK9tQ8.js";
14
- import { t as u } from "./flex.props-D8JHoC5B.js";
15
- import { t as d } from "./settings-item-Blm7DAEt.js";
9
+ import { r as e } from "./rolldown-runtime-wY3V7GBs.js";
10
+ import { t } from "./react-Dd6qt83k.js";
11
+ import { t as n } from "./jsx-runtime-Cd4pI6Dj.js";
12
+ import { E as r, c as i, l as a, o, r as s, v as c } from "./box-DutTTrem.js";
13
+ import { t as l } from "./classnames-Ik0tGjEU.js";
14
+ import { t as u } from "./flex.props-BU9Dksr-.js";
15
+ import { t as d } from "./settings-item-BVKYXscM.js";
16
16
  //#region ../../node_modules/.pnpm/@radix-ui+themes@3.3.0_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react@19.2._d6d76dcfd4c9de055b7c51247e12b902/node_modules/@radix-ui/themes/dist/esm/components/text-field.props.js
17
17
  var f = {
18
18
  size: {
@@ -1,18 +1,18 @@
1
1
  (function() {
2
2
  try {
3
3
  var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
4
- e.SENTRY_RELEASE = { id: "3.2.7" };
4
+ e.SENTRY_RELEASE = { id: "3.2.9" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "7ef9ec30-23fe-46ab-9eef-b60026a43ae8", e._sentryDebugIdIdentifier = "sentry-dbid-7ef9ec30-23fe-46ab-9eef-b60026a43ae8");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-BKpHzyBK.js";
10
- import { t } from "./react-CanbjT5I.js";
11
- import { t as n } from "./jsx-runtime-C0zFKVvF.js";
12
- import { t as r } from "./react-dom-wNBYs_H5.js";
13
- import { C as i, D as a, S as o, T as s, _ as c, a as l, g as u, w as d } from "./box-Cy-U95_G.js";
14
- import { c as f, i as p, n as m, o as h, r as g, s as _, t as v } from "./dist-BU_A8R-K.js";
15
- import { t as y } from "./classnames-DpaK9tQ8.js";
9
+ import { r as e } from "./rolldown-runtime-wY3V7GBs.js";
10
+ import { t } from "./react-Dd6qt83k.js";
11
+ import { t as n } from "./jsx-runtime-Cd4pI6Dj.js";
12
+ import { t as r } from "./react-dom-aRO55sP1.js";
13
+ import { C as i, D as a, S as o, T as s, _ as c, a as l, g as u, w as d } from "./box-DutTTrem.js";
14
+ import { c as f, i as p, n as m, o as h, r as g, s as _, t as v } from "./dist-CAmPggJH.js";
15
+ import { t as y } from "./classnames-Ik0tGjEU.js";
16
16
  //#region ../../node_modules/.pnpm/@radix-ui+react-visually-hidden@1.2.3_@types+react-dom@19.2.3_@types+react@19.2.14__@ty_d1be9c417e0b55d219bafdc186d26ce0/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
17
17
  var b = /* @__PURE__ */ e(r(), 1), x = /* @__PURE__ */ e(t(), 1), S = n(), C = Object.freeze({
18
18
  position: "absolute",
@@ -1,17 +1,17 @@
1
1
  (function() {
2
2
  try {
3
3
  var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
4
- e.SENTRY_RELEASE = { id: "3.2.7" };
4
+ e.SENTRY_RELEASE = { id: "3.2.9" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "92182a39-8df3-47fb-a7de-39aa7bf1975b", e._sentryDebugIdIdentifier = "sentry-dbid-92182a39-8df3-47fb-a7de-39aa7bf1975b");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-BKpHzyBK.js";
10
- import { i as t, r as n } from "./reset-all-settings-5oUUws5J.js";
11
- import { t as r } from "./jsx-runtime-C0zFKVvF.js";
12
- import "./settings-D5qqIejY.js";
13
- import { t as i } from "./browser-oUjLaYcl.js";
14
- import { t as a } from "./add-debug-secret-listener-BV3Vlx9C.js";
9
+ import { r as e } from "./rolldown-runtime-wY3V7GBs.js";
10
+ import { i as t, r as n } from "./reset-all-settings-N7kAP_D7.js";
11
+ import { t as r } from "./jsx-runtime-Cd4pI6Dj.js";
12
+ import "./settings-D7A9piKA.js";
13
+ import { t as i } from "./browser-CPxDQEuR.js";
14
+ import { t as a } from "./add-debug-secret-listener-qEasEfwK.js";
15
15
  //#region ../debug/src/lib/ui/render-debug-ui.tsx
16
16
  var o = /* @__PURE__ */ e(i(), 1), s = r(), c = !1;
17
17
  function l() {
@@ -26,7 +26,7 @@ function l() {
26
26
  }
27
27
  });
28
28
  let i = async (t) => {
29
- let { DebugUi: n } = await import("./debug-ui-D63K4FZz.js"), { createRoot: i } = await import("./client-smunwL9U.js").then((t) => /* @__PURE__ */ e(t.default, 1)), a = document.createElement("div");
29
+ let { DebugUi: n } = await import("./debug-ui-2Bawq2Zx.js"), { createRoot: i } = await import("./client-nXMugISE.js").then((t) => /* @__PURE__ */ e(t.default, 1)), a = document.createElement("div");
30
30
  document.body.appendChild(a), i(a).render(/* @__PURE__ */ (0, s.jsx)(n, {
31
31
  useDebugButtonState: r.useState,
32
32
  open: t
@@ -1 +1 @@
1
- import{jsx as S,jsxs as I,Fragment as H}from"react/jsx-runtime";import{useObserver as Y}from"mobx-react-lite";import q from"classnames";import{useEffect as J,useMemo as Q,useRef as z,useState as ee}from"react";import{observable as oe}from"mobx";import i,{boothStore as te,layersStore as R,uiState as e}from"../../store";import re from"./drawing/config/config-all";import{useReaction as d}from"../../utils/mobx";import{LayerMode as g}from"../../store/LayerStore";import p from"../../tools/settings";import{Rect as x}from"./drawing/config/Rect";import C from"../../core/Rect";import{Exhibitor as F}from"../../store/ExhibitorStore";import{BoothBase as ne}from"../../store/BoothStore";import{CurrentPosition as ie,Route as ae}from"../../store/RouteStore";import{Category as se}from"../../store/CategoryStore";import T from"../../tools/logger";import{svgArea as D}from"../../data/svg";import{configMarkers as le,getMarkerFromClick as me}from"./drawing/config/config-markers";import ce from"color";import{createWayfinding as fe}from"../../wayfinding/createWayfinding";import{createSceneDef as de}from"../../renderer";import{convertGpsToLocal as ue}from"../../utils/gps";import{fpGeo as pe}from"../../data/fpGeo";import v from"../../utils/is-debug";import{Draggable as he}from"../Draggable";import{useBuildRoute as ve}from"./traffic/useBuildRoute";import{useManageTraffic as be}from"./traffic/useManageTraffic";import{DEBUG_STORAGE_KEY as G,PATHWAY_KEY as N}from"../../constants";import O from"./booth-by-xy";import{mapRollSetting as X}from"../../renderer";import{loadLayersImages as ye}from"./drawing/config/loadBoothsImages";import{areLayersEnabled as ge}from"../../utils/areLayersEnabled";import{pickDefaultScene as A,pickDefaultScenePoint as xe}from"../../renderer/engine-core/defs";const j=Number.isFinite(p.maxZoom);export default function we(){let k={};const K="#ebebeb",h=z(),b=Q(()=>oe({moving:!1,prevLevel:i.layerStore.layers.find(o=>!o.frozen&&o.visible)}),[]),s=i.rendererService;let l;const L=z(null);let B=null,M=null;const[U,V]=ee(()=>typeof window<"u"&&window.localStorage?localStorage.getItem(G)!=="false":!0);d(()=>i.routeStore.currentRouteLayer,()=>{if(!s.scene||b.prevLevel===i.routeStore.currentRouteLayer)return;const o=s.scene.rootLayer.children.filter(r=>i.layerStore.floors.some(n=>r.name.includes(n.name)));let t=i.routeStore.currentRouteLayer.name;if(!o.find(r=>r.name===t))return;const a=o?.map(r=>(r.name===t&&(r.hidden=!1),r.name===b.prevLevel?.name&&(r.hidden=!0),r));b.prevLevel=i.routeStore.currentRouteLayer,s.update(...a)}),d(()=>e.centerMap,()=>{!e.centerMap||i.mapboxStore.showMapbox||(l.controls.resetCamera({zoom:!!(e.list.type==="search"&&e.list.text)}),e.centerMap=!1)}),J(()=>{if(!h.current)return;async function o(){let t={};try{if(v){const r=document.createElement("canvas").getContext("webgl2"),n=r&&r.getExtension("EXT_disjoint_timer_query_webgl2"),m=(await import("stats-gl")).default,f=new m({trackGPU:n,horizontal:!0}),u=L.current;if(!u)throw new Error("memoryInfoPanel not found.");f.dom.style.position="relative",u.style.width=`${90*(n?3:2)}px`,u.style.height="48px",u.appendChild(f.dom),t={stats:f,memoryInfoPanel:u}}}catch(a){console.error(a)}l=s.create({canvas:h.current,ui:t}),e.canvasVisibleRectPx&&(l.visibleRect=x.fromCoreRect(e.canvasVisibleRectPx)),re(s).then(a=>{v&&console.log("Renderer settings",l);const r=ce(p.backgroundColor==="none"?K:p.backgroundColor).string("rgba");k=de(a,x.fromCoreRect(D),r),s.start(k),X(l,i.fp.enableRotation?1:0),j&&l.viewport.setMaxZoom(p.maxZoom),R.layersLoaded=!0,i.fp.onFpConfigured&&i.fp?.onFpConfigured(),B=fe(s),M=le(s),ye(s)}),l.events.addEventListener("pointer:move",({data:a})=>{if(e.setKioskModeEnabled)return;const{point:r,defs:n}=A(a),c=O(r.x,r.y),m=E(n[0]);e.hoveredBooth=c||m}),l.events.addEventListener("pointer:out",()=>{e.setKioskModeEnabled||(e.hoveredBooth=null)}),l.events.addEventListener("pointer:click",({data:a})=>{if(!e?.rootElement)return;window.__resett&&window.__resett(),e.overlayPosition==="bottom"&&e.overlaySize==="full"&&i.showMap();const{point:r,defs:n}=A(a),{x:c,y:m}=r;if(e.onGetCoordsClick){const y=i.layerStore.layers.find(w=>w.visible&&(w.mode===g.TurnedOn||w.mode===g.TurnedOff));e.onGetCoordsClick({x:c,y:m,z:y?.name||null})}if(e.setKioskModeEnabled)return;if(e.onMarkerClick){const y=me(c,m,s.scale);v&&console.log("marker",y),e.onMarkerClick(y)}const f=O(r.x,r.y),u=E(n[0]);v&&console.log("boothIdFromClientXy",f,"boothByShape",u,"pointer:click point",r),i.clickBooth(f||u)}),l.events.addEventListener("navigation:change",()=>window.__resett&&window.__resett())}return o(),i.fp.getCenterCoordinates=Z,()=>W()},[]);function W(){B?.(),M?.(),s.dispose()}function Z(){const o=h.current;if(!h.current)throw new Error("Canvas not ready");const t=xe(l.viewport.canvasToSvg({x:o.clientWidth/2,y:o.clientHeight/2})),r=i.layerStore.visible.find(n=>n.mode===g.TurnedOff||n.mode===g.TurnedOn)?.name||null;return{...t,z:r}}function E(o){return!o||!o.shape?null:te.booths.find(t=>t.shapes?.find(a=>a.shape==o.shape))}d(()=>e.zoomBy,()=>{if(!e.zoomBy||i.mapboxStore.showMapbox)return;const o=e.zoomBy;l.controls.zoomBy(o),e.zoomBy=null}),d(()=>e.dimmed,o=>{if(!s.scene)return;const t=s.scene.rootLayer;t.dim!==o&&(t.dim=o,s.update(t))}),d(()=>e.details,()=>{if(!e.onDetails)return;if(!e.details){e.onDetails(null);return}var o=e.details;if(p.EXPO==="wineparis"&&(o instanceof F&&(o=o.booths[0]),!o))return;let t=null,a=[];o instanceof F?(t="exhibitor",a=o.booths.map(n=>n.name).sort((n,c)=>n==i.routeStore.tempToBooth?.name?-1:c==i.routeStore.tempToBooth?.name?1:0)):o instanceof ne?(t="booth",a=[o.name]):o instanceof ae?(t="route",a=[o.from?.name,o.to?.name].filter(n=>!!n)):o instanceof se&&(t="category",a=o.exhibitors.map(n=>n.booths.map(c=>c.name)).flat());var r={type:t,name:o?.name,id:o?.id,externalId:o?.externalId,boothsNames:a};e.onDetails({...r,...t==="route"?{routeInfo:i.routeStore.routeInfo}:{}})}),d(()=>e.canvasVisibleRectPx,()=>{s.renderer&&(s.renderer.visibleRect=x.fromCoreRect(e.canvasVisibleRectPx))},{fireImmediately:!0}),d(()=>e.moveToRect,()=>{!e.moveToRect||i.mapboxStore.showMapbox||(e.moveToRect&&e.moveToRect.h!==1/0&&e.moveToRect.w!==1/0&&e.moveToRect.h>0&&e.moveToRect.w>0&&_(e.moveToRect),e.moveToRect=null)}),d(()=>e.rollReset,o=>{o&&(l.controls.resetCamera({roll:!0}),e.rollReset=!1)}),d(()=>e.moveToBooths,()=>{if(T.log("this.moveToBooths",e.moveToBooths),!e.moveToBooths||i.mapboxStore.showMapbox)return;T.log("watched moveToBooths",e.moveToBooths);const o=e.moveToBooths.filter(t=>t.rect).map(t=>t.rect);o.length!==0&&(_(C.fromMultiple(o)),e.moveToBooths=null)}),d(()=>e.mapSettings,({zoomtime:o,center:t,centerxy:a,bearing:r,roll:n,z:c})=>{if(!(i.mapboxStore.showMapbox||!s.renderer))try{o&&o!==e.defaultMapSettings.zoomtime&&s.renderer.controls.configure({zoomTime:o/1e3}),i.fp.enableRotation&&X(l,n);let m;if(t){const f=t.split(",").map(Number),u=new ie(void 0,void 0,void 0,void 0,f[0],f[1]);m=ue(u,pe.properties.config)}else if(a){const f=a.split(",").map(Number);m={x:f[0],y:f[1]}}c&&i.fp.activateFloor({name:c}),(m?.x||m?.y)&&s.renderer.controls.panTo(m.x,m.y),Number.isFinite(r)&&s.renderer.controls.rollTo(r)}catch(m){T.error("Error in mapSettings reaction",m)}}),ve({enabled:R.layersLoaded&&e.buildRoute,rendererService:s});const P="routes-api.expofp.com";be({permission:R.layersLoaded,rendererService:s,dataJsonUrl:`https://${P}/v1/routes?expo=${p.EXPO}`,websocketUrl:`wss://${P}/locations?expo=${p.EXPO}`}),d(()=>i.layerStore.visible,o=>{if(!s.scene)return;const t=o.filter(n=>n.name.toLowerCase().includes(N)),r=s.scene.rootLayer.children.filter(n=>n.name.toLowerCase().includes(N));r.forEach(n=>{n.hidden=!t.find(c=>c.name===n.name)}),s.update(...r)});function _(o){let t=o;const a=$(o,D);e.kioskData&&(!ge()||i.routeStore.defaultFrom?.layer?.name===i.routeStore.currentRouteLayer?.name)&&(t=C.fromMultiple([o,C.fromXywh(e.kioskData.x,e.kioskData.y,1,1)]));const r=x.fromCoreRect(t),n={paddingPercent:a,maxZoom:j?void 0:10};if(e.shouldShiftMapRect){l.visibleRect.min={...l.visibleRect.min,x:l.visibleRect.min.x+e.overlayWidthPx};try{l.controls.zoomTo(r,n)}finally{l.visibleRect.min={...l.visibleRect.min,x:l.visibleRect.min.x-e.overlayWidthPx}}}else l.controls.zoomTo(r,n)}function $(o,t){return!o||!t?0:(o.w*o.h/(t.h*t.w)>.1?15:25)/100}return Y(()=>I(H,{children:[S("canvas",{style:{width:"100%",height:"100%"},ref:h,className:q({map:!0,moving:b.moving,hidden:i.mapboxStore.showMapbox}),children:"ExpoFP.com"}),v&&U&&I(he,{className:"debug-fps",children:[S("div",{ref:L}),S("button",{onClick:()=>{typeof window<"u"&&window.localStorage&&localStorage.setItem(G,"false"),V(!1)},style:{padding:"4px 8px",fontSize:"11px",cursor:"pointer",backgroundColor:"#333",color:"#fff",border:"1px solid #555",width:"100%"},children:"Hide debug"})]})]}))}
1
+ import{jsx as S,jsxs as I,Fragment as H}from"react/jsx-runtime";import{useObserver as Y}from"mobx-react-lite";import q from"classnames";import{useEffect as J,useMemo as Q,useRef as z,useState as ee}from"react";import{observable as oe}from"mobx";import i,{boothStore as te,layersStore as R,uiState as e}from"../../store";import re from"./drawing/config/config-all";import{useReaction as d}from"../../utils/mobx";import{LayerMode as g}from"../../store/LayerStore";import p from"../../tools/settings";import{Rect as x}from"./drawing/config/Rect";import C from"../../core/Rect";import{Exhibitor as F}from"../../store/ExhibitorStore";import{BoothBase as ne}from"../../store/BoothStore";import{CurrentPosition as ie,Route as ae}from"../../store/RouteStore";import{Category as se}from"../../store/CategoryStore";import T from"../../tools/logger";import{svgArea as D}from"../../data/svg";import{configMarkers as le,getMarkerFromClick as me}from"./drawing/config/config-markers";import ce from"color";import{createWayfinding as fe}from"../../wayfinding/createWayfinding";import{createSceneDef as de}from"../../renderer";import{convertGpsToLocal as ue}from"../../utils/gps";import{fpGeo as pe}from"../../data/fpGeo";import v from"../../utils/is-debug";import{Draggable as he}from"../Draggable";import{useBuildRoute as ve}from"./traffic/useBuildRoute";import{useManageTraffic as be}from"./traffic/useManageTraffic";import{DEBUG_STORAGE_KEY as G,PATHWAY_KEY as N}from"../../constants";import O from"./booth-by-xy";import{mapRollSetting as X}from"../../renderer";import{loadLayersImages as ye}from"./drawing/config/loadBoothsImages";import{areLayersEnabled as ge}from"../../utils/areLayersEnabled";import{pickDefaultScene as A,pickDefaultScenePoint as xe}from"../../renderer/engine-core/defs";const j=Number.isFinite(p.maxZoom);export default function we(){let k={};const K="#ebebeb",h=z(),b=Q(()=>oe({moving:!1,prevLevel:i.layerStore.layers.find(o=>!o.frozen&&o.visible)}),[]),s=i.rendererService;let l;const L=z(null);let B=null,M=null;const[U,V]=ee(()=>typeof window<"u"&&window.localStorage?localStorage.getItem(G)!=="false":!0);d(()=>i.routeStore.currentRouteLayer,()=>{if(!s.scene||b.prevLevel===i.routeStore.currentRouteLayer)return;const o=s.scene.rootLayer.children.filter(r=>i.layerStore.floors.some(n=>r.name.includes(n.name)));let t=i.routeStore.currentRouteLayer.name;if(!o.find(r=>r.name===t))return;const a=o?.map(r=>(r.name===t&&(r.hidden=!1),r.name===b.prevLevel?.name&&(r.hidden=!0),r));b.prevLevel=i.routeStore.currentRouteLayer,s.update(...a)}),d(()=>e.centerMap,()=>{!e.centerMap||i.mapboxStore.showMapbox||(l.controls.resetCamera({zoom:!!(e.list.type==="search"&&e.list.text)}),e.centerMap=!1)}),J(()=>{if(!h.current)return;async function o(){let t={};try{if(v){const r=document.createElement("canvas").getContext("webgl2"),n=r&&r.getExtension("EXT_disjoint_timer_query_webgl2"),m=(await import("stats-gl")).default,f=new m({trackGPU:n,horizontal:!0}),u=L.current;if(!u)throw new Error("memoryInfoPanel not found.");f.dom.style.position="relative",u.style.width=`${90*(n?3:2)}px`,u.style.height="48px",u.appendChild(f.dom),t={stats:f,memoryInfoPanel:u}}}catch(a){console.error(a)}l=s.create({canvas:h.current,ui:t}),e.canvasVisibleRectPx&&(l.visibleRect=x.fromCoreRect(e.canvasVisibleRectPx)),re(s).then(a=>{v&&console.log("Renderer settings",l);const r=ce(p.backgroundColor==="none"?K:p.backgroundColor).string("rgba");k=de(a,x.fromCoreRect(D),r),s.start(k),X(l,i.fp.enableRotation?1:0),j&&l.viewport.setMaxZoom(p.maxZoom),R.layersLoaded=!0,i.fp.onFpConfigured&&i.fp?.onFpConfigured(),B=fe(s),M=le(s),ye(s)}),l.events.addEventListener("pointer:move",({data:a})=>{if(e.setKioskModeEnabled)return;const{point:r,defs:n}=A(a),c=O(r.x,r.y),m=E(n[0]);e.hoveredBooth=c||m}),l.events.addEventListener("pointer:out",()=>{e.setKioskModeEnabled||(e.hoveredBooth=null)}),l.events.addEventListener("pointer:click",({data:a})=>{if(!e?.rootElement)return;window.__resett&&window.__resett(),e.overlayPosition==="bottom"&&e.overlaySize==="full"&&i.showMap();const{point:r,defs:n}=A(a),{x:c,y:m}=r;if(e.onGetCoordsClick){const y=i.layerStore.layers.find(w=>w.visible&&(w.mode===g.TurnedOn||w.mode===g.TurnedOff));e.onGetCoordsClick({x:c,y:m,z:y?.name||null})}if(e.setKioskModeEnabled)return;if(e.onMarkerClick){const y=me(c,m,s.scale);v&&console.log("marker",y),e.onMarkerClick(y)}const f=O(r.x,r.y),u=E(n[0]);v&&console.log("boothIdFromClientXy",f,"boothByShape",u,"pointer:click point",r),i.clickBooth(f||u)}),l.events.addEventListener("navigation:change",()=>window.__resett&&window.__resett())}return o(),i.fp.getCenterCoordinates=Z,()=>W()},[]);function W(){B?.(),M?.(),s.dispose()}function Z(){const o=h.current;if(!h.current)throw new Error("Canvas not ready");const t=xe(l.viewport.canvasToSvg({x:o.clientWidth/2,y:o.clientHeight/2})),r=i.layerStore.visible.find(n=>n.mode===g.TurnedOff||n.mode===g.TurnedOn)?.name||null;return{...t,z:r}}function E(o){return!o||!o.shape?null:te.booths.find(t=>t.shapes?.find(a=>a.shape==o.shape))}d(()=>e.zoomBy,()=>{if(!e.zoomBy||i.mapboxStore.showMapbox)return;const o=e.zoomBy;l.controls.zoomBy(o),e.zoomBy=null}),d(()=>e.dimmed,o=>{if(!s.scene)return;const t=s.scene.rootLayer;t.dim!==o&&(t.dim=o,s.update(t))}),d(()=>e.details,()=>{if(!e.onDetails)return;if(!e.details){e.onDetails(null);return}var o=e.details;if(p.EXPO==="wineparis"&&(o instanceof F&&(o=o.booths[0]),!o))return;let t=null,a=[];o instanceof F?(t="exhibitor",a=o.booths.map(n=>n.name).sort((n,c)=>n==i.routeStore.tempToBooth?.name?-1:c==i.routeStore.tempToBooth?.name?1:0)):o instanceof ne?(t="booth",a=[o.name]):o instanceof ae?(t="route",a=[o.from?.name,o.to?.name].filter(n=>!!n)):o instanceof se&&(t="category",a=o.exhibitors.map(n=>n.booths.map(c=>c.name)).flat());var r={type:t,name:o?.name,id:o?.id,externalId:o?.externalId,boothsNames:a};e.onDetails({...r,...t==="route"?{routeInfo:i.routeStore.routeInfo}:{}})}),d(()=>e.canvasVisibleRectPx,()=>{s.renderer&&(s.renderer.visibleRect=x.fromCoreRect(e.canvasVisibleRectPx))},{fireImmediately:!0}),d(()=>e.moveToRect,()=>{!e.moveToRect||i.mapboxStore.showMapbox||(e.moveToRect&&e.moveToRect.h!==1/0&&e.moveToRect.w!==1/0&&e.moveToRect.h>0&&e.moveToRect.w>0&&_(e.moveToRect),e.moveToRect=null)}),d(()=>e.rollReset,o=>{o&&(l.controls.resetCamera({roll:!0}),e.rollReset=!1)}),d(()=>e.moveToBooths,()=>{if(T.log("this.moveToBooths",e.moveToBooths),!e.moveToBooths||i.mapboxStore.showMapbox)return;T.log("watched moveToBooths",e.moveToBooths);const o=e.moveToBooths.filter(t=>t.rect).map(t=>t.rect);o.length!==0&&(_(C.fromMultiple(o)),e.moveToBooths=null)}),d(()=>e.mapSettings,({zoomtime:o,center:t,centerxy:a,bearing:r,roll:n,z:c})=>{if(!(i.mapboxStore.showMapbox||!s.renderer))try{o&&o!==e.defaultMapSettings.zoomtime&&s.renderer.controls.configure({zoomTime:o/1e3}),i.fp.enableRotation&&X(l,n);let m;if(t){const f=t.split(",").map(Number),u=new ie(void 0,void 0,void 0,void 0,f[0],f[1]);m=ue(u,pe.properties.config)}else if(a){const f=a.split(",").map(Number);m={x:f[0],y:f[1]}}c&&i.fp.activateFloor({name:c}),(m?.x||m?.y)&&s.renderer.controls.panTo(m.x,m.y),Number.isFinite(r)&&s.renderer.controls.rollTo(r)}catch(m){T.error("Error in mapSettings reaction",m)}}),ve({enabled:R.layersLoaded&&e.buildRoute,rendererService:s});const P="routes-api.expofp.com";be({permission:R.layersLoaded,rendererService:s,dataJsonUrl:`https://${P}/v1/routes?expo=${p.EXPO}`,websocketUrl:`wss://${P}/locations?expo=${p.EXPO}`}),d(()=>i.layerStore.visible,o=>{if(!s.scene)return;const t=o.filter(n=>n.name.toLowerCase().includes(N)),r=s.scene.rootLayer.children.filter(n=>n.name.toLowerCase().includes(N));r.forEach(n=>{n.hidden=!t.find(c=>c.name===n.name)}),s.update(...r)});function _(o){let t=o;const a=$(o,D);e.kioskData&&(!ge()||i.routeStore.defaultFrom?.layer?.name===i.routeStore.currentRouteLayer?.name)&&(t=C.fromMultiple([o,C.fromXywh(e.kioskData.x,e.kioskData.y,1,1)]));const r=x.fromCoreRect(t),n={paddingPercent:a,maxZoom:j?void 0:10};if(e.shouldShiftMapRect){l.visibleRect.min={...l.visibleRect.min,x:l.visibleRect.min.x+e.overlayWidthPx},l.visibleRect=l.visibleRect;try{l.controls.zoomTo(r,n)}finally{l.visibleRect.min={...l.visibleRect.min,x:l.visibleRect.min.x-e.overlayWidthPx}}}else l.controls.zoomTo(r,n)}function $(o,t){return!o||!t?0:(o.w*o.h/(t.h*t.w)>.1?15:25)/100}return Y(()=>I(H,{children:[S("canvas",{style:{width:"100%",height:"100%"},ref:h,className:q({map:!0,moving:b.moving,hidden:i.mapboxStore.showMapbox}),children:"ExpoFP.com"}),v&&U&&I(he,{className:"debug-fps",children:[S("div",{ref:L}),S("button",{onClick:()=>{typeof window<"u"&&window.localStorage&&localStorage.setItem(G,"false"),V(!1)},style:{padding:"4px 8px",fontSize:"11px",cursor:"pointer",backgroundColor:"#333",color:"#fff",border:"1px solid #555",width:"100%"},children:"Hide debug"})]})]}))}
@@ -1 +1 @@
1
- import c from"../../../../store";import E from"./config-load-layer";import{createLayerDef as t}from"../../../../renderer";import{WF_LINES_ANIMATED_LAYER_NAME as _,WF_LINES_LAYER_NAME as d,WF_POINTS_LAYER_NAME as p,WF_TRAIL_LAYER_NAME as y}from"../../../../wayfinding/layers";import{MARKER_LAYER_NAME as N}from"./config-markers";import R from"./config-yah";import{createTrafficLayers as Y}from"../../traffic/trafficLayers";import{PATHWAY_KEY as u}from"../../../../constants";import{configBoothsBadges as M}from"./config-booth-badge";export default function h(f){R();let{layers:r,defaultLayer:s}=c.layerStore;if(s){const o=[].concat(r),e=r.find(i=>i===s),a=r.indexOf(e);o.splice(a,1),r=[e].concat(o)}const L=r.filter(o=>!o.rootParent).map(o=>E(o,f));return Promise.all(L).then(o=>{const e=t(p,[],{dim:!1,interactive:!0}),a=t(d,[],{dim:!1}),i=t(N,[]),l=t(y,[],{dim:!1}),A=t(_,[],{dim:!1});o.forEach(m=>{m.name.toLowerCase().includes(u)&&(m.dim=!1)});const n=M(f,"root",c.boothStore.booths);return[...o.flat(),...n?[n]:[],...Y(),i,l,a,A,e]})}
1
+ import c from"../../../../store";import E from"./config-load-layer";import{createLayerDef as t}from"../../../../renderer";import{WF_LINES_ANIMATED_LAYER_NAME as _,WF_LINES_LAYER_NAME as d,WF_POINTS_LAYER_NAME as p,WF_TRAIL_LAYER_NAME as y}from"../../../../wayfinding/layers";import{MARKER_LAYER_NAME as N}from"./config-markers";import{createTrafficLayers as R}from"../../traffic/trafficLayers";import{PATHWAY_KEY as u}from"../../../../constants";import{configBoothsBadges as M}from"./config-booth-badge";export default function Y(f){let{layers:r,defaultLayer:s}=c.layerStore;if(s){const o=[].concat(r),e=r.find(i=>i===s),a=r.indexOf(e);o.splice(a,1),r=[e].concat(o)}const L=r.filter(o=>!o.rootParent).map(o=>E(o,f));return Promise.all(L).then(o=>{const e=t(p,[],{dim:!1,interactive:!0}),a=t(d,[],{dim:!1}),i=t(N,[]),l=t(y,[],{dim:!1}),A=t(_,[],{dim:!1});o.forEach(m=>{m.name.toLowerCase().includes(u)&&(m.dim=!1)});const n=M(f,"root",c.boothStore.booths);return[...o.flat(),...n?[n]:[],...R(),i,l,a,A,e]})}
@@ -1 +1 @@
1
- import U from"./config-booth-bg";import{Rect as g}from"./Rect";import W from"./config-booth-labels";import{SEPARATOR as s}from"../../../../constants";import F from"./config-booth-labels-special";import K from"./config-booth-border";import P from"./config-booth-bookmark";import Z from"../../../../tools/settings";import R,{boothStore as j,uiState as q}from"../../../../store";import z from"./config-booth-scaled";import{loadImagesInBatchesById as G}from"../../../../utils/loadImagesInBatches";import{createBoothImg as J,getImageLayerName as M,mapBoothsLogos as Q}from"./loadBoothsImages";import{degToRad as V}from"three/src/math/MathUtils";import{createImageDef as X}from"../../../../renderer";export const BOOTHS_CHUNK_SIZE=350;export default function Y(a,d,D){return(l=>{const t=d,b=[],m=[],f=[],B=[],u=[],y=M(t),L={name:y,children:[]};for(const o of l){const i=U(a,o)?.getShape();i&&b.push(...i);const n=W(a,o)?.getShape();n&&m.push(...n);const c=F(a,o)?.getShape();if(c&&f.push(...c),!Z.borderless){const e=K(a,o)?.getShape();e&&B.push(e)}const h=P(a,o)?.getShape();h&&u.push(h)}const x=m.filter(o=>o.lines),_=f.filter(o=>o.lines),w=m.filter(o=>o.source),N=f.filter(o=>o.source);if(!q.hideLogoInBooth){const o=Q(l);a.onLayerImages(y,async()=>{const i=await G(o,BOOTHS_CHUNK_SIZE),n=[];for(const[c,h]of i){const e=R.boothStore.boothById.get(c);if(!e)continue;const{bounds:{x:I,y:S,height:O,angle:T,width:A},htmlImage:C}=J(e,h),k=X(C,new g({x:I,y:S},{x:I+A,y:S+O},V(T))),E=g.fromCoreRect(e.rect,e.rotate),H=g.inflateRect(E,e.borderWidth||j.borderWidth);e.shapes.push(k),n.push({shape:k,parentRect:H})}return{layer:L,children:n}})}let p=[];l.length&&(p=[{name:`${t}${s}boothBackground`,children:b,interactive:!0},{name:`${t}${s}labels`,children:x},{name:`${t}${s}specialLabels`,children:_},{name:`${t}${s}bots`,children:w},{name:`${t}${s}specialDots`,children:N},L,{name:`${t}${s}boothsBookmark`,children:u},{name:`${t}${s}boothBorder`,children:B}]);const{defaultFrom:r}=R.routeStore,$=(d+":").split(":")[0];if(r?.layer===null||r?.layer?.name===$||r?.layer?.childLayers.find(o=>o.name===$)){const o=z(a,r);o&&p.push({name:`${t}${s}yahBooth`,children:o.getShape()})}return{name:t,children:p}})(D)}
1
+ import E from"./config-booth-bg";import{Rect as f}from"./Rect";import H from"./config-booth-labels";import{SEPARATOR as s}from"../../../../constants";import U from"./config-booth-labels-special";import W from"./config-booth-border";import _ from"./config-booth-bookmark";import K from"../../../../tools/settings";import P,{boothStore as Z,uiState as j}from"../../../../store";import{loadImagesInBatchesById as q}from"../../../../utils/loadImagesInBatches";import{createBoothImg as z,getImageLayerName as F,mapBoothsLogos as G}from"./loadBoothsImages";import{degToRad as J}from"three/src/math/MathUtils";import{createImageDef as M}from"../../../../renderer";export const BOOTHS_CHUNK_SIZE=350;export default function Q(a,I,k){return(h=>{const t=I,p=[],m=[],l=[],g=[],b=[],d=F(t),B={name:d,children:[]};for(const o of h){const r=E(a,o)?.getShape();r&&p.push(...r);const n=H(a,o)?.getShape();n&&m.push(...n);const i=U(a,o)?.getShape();if(i&&l.push(...i),!K.borderless){const e=W(a,o)?.getShape();e&&g.push(e)}const c=_(a,o)?.getShape();c&&b.push(c)}const S=m.filter(o=>o.lines),R=l.filter(o=>o.lines),D=m.filter(o=>o.source),x=l.filter(o=>o.source);if(!j.hideLogoInBooth){const o=G(h);a.onLayerImages(d,async()=>{const r=await q(o,BOOTHS_CHUNK_SIZE),n=[];for(const[i,c]of r){const e=P.boothStore.boothById.get(i);if(!e)continue;const{bounds:{x:L,y:$,height:w,angle:N,width:O},htmlImage:T}=z(e,c),y=M(T,new f({x:L,y:$},{x:L+O,y:$+w},J(N))),A=f.fromCoreRect(e.rect,e.rotate),C=f.inflateRect(A,e.borderWidth||Z.borderWidth);e.shapes.push(y),n.push({shape:y,parentRect:C})}return{layer:B,children:n}})}let u=[];return h.length&&(u=[{name:`${t}${s}boothBackground`,children:p,interactive:!0},{name:`${t}${s}labels`,children:S},{name:`${t}${s}specialLabels`,children:R},{name:`${t}${s}bots`,children:D},{name:`${t}${s}specialDots`,children:x},B,{name:`${t}${s}boothsBookmark`,children:b},{name:`${t}${s}boothBorder`,children:g}]),{name:t,children:u}})(k)}
@@ -1 +1 @@
1
- import{jsx as a,jsxs as f}from"react/jsx-runtime";import b from"classnames";import{useObserver as D}from"mobx-react-lite";import k,{useEffect as v,useRef as C,useCallback as T}from"react";import o,{searchStore as e}from"../store";import{t as i}from"../utils/i18n";import{useAutorun as l}from"../utils/mobx";import z from"../tools/debounce";import{GaEventActions as j,sendEventToGa as K}from"../tools/gtag";import{handleCustomCommand as L}from"../utils/customCommands";import{Badge as P}from"./";import"./SearchBox.scss";const G=1e3;function R({className:g}){const B=C(),p=C(null);function w(t){let s=0;switch(t.key){case"Down":case"ArrowDown":s=1;break;case"Up":case"ArrowUp":s=-1;break;case"Enter":t.preventDefault(),o.openActiveListItem();const n=c();n&&L(n.value,!0);return;case"Escape":t.preventDefault(),e.closeSearch();return}s&&(t.preventDefault(),o.changeActiveListIndex(s))}function c(){return p.current}const[I,u]=k.useState(""),[h,E]=k.useState(!1);l(()=>{E(o.uiState.kiosk&&o.uiState.inIdle)}),v(()=>{if(!h){u("");return}const t=[i("Find Companies..."),i("Find Categories..."),i("Find Sessions..."),i("Search...")];let s=0,n=0,r=!1,S;const _=()=>{const d=t[s];r?(u(d.substring(0,n-1)),n--):(u(d.substring(0,n+1)),n++);let m=r?50:100;!r&&n===d.length?(r=!0,m=2e3):r&&n===0&&(r=!1,s=(s+1)%t.length,m=500),S=setTimeout(_,m)};return _(),()=>clearTimeout(S)},[h]),l(()=>{const t=document.activeElement;o.uiState.overlaySize!=="full"&&t===c()&&!e.isFocused&&c()?.blur()}),l(()=>{o.uiState.menu&&o.uiState.kiosk&&e.setFocused(!1)}),l(()=>{const t=c(),s=document.activeElement;t&&e.isFocused&&s!==t&&!e.skipInputFocus&&t.focus()}),v(()=>{o.fuzzySearchEngineStore.loadEngine()},[]);const N=T(z(()=>{e.searchText&&K(j.Search,e.searchText),window.__resett?.()},G),[]);function y(){e.setSearchText(c()?.value||""),N()}function M(){e.setFocused(!0),window.__resett?.()}function A(){e.isFocused||(e.handleSearchAction(),setTimeout(()=>{c()?.focus()},100))}function F(){e.handleBackAction()}function x(){e.closeSearch()}return D(()=>f("div",{className:b("search-box",g,e.searchBoxClass,{"efp-semi-transparent":o.uiState.setKioskModeEnabled}),ref:B,children:[a("button",{className:b("search-box__button","search-box__button--back",{"is-mobile-details":e.isMobileDetailsMode}),onClick:F,type:"button","aria-label":e.backMode==="back"?i("Go back"):i("Main menu"),children:a("i",{className:e.backMode==="back"?"icon-chevron-left":o.uiState.viewerMode?"icon-home":"icon-menu"})}),a("div",{className:"search-box__input-wrapper",children:e.shouldShowSearchInput?a("input",{ref:p,type:"search",className:"search-box__input",placeholder:h?I:e.placeholder,"aria-label":"Search",value:e.searchText,onChange:y,onKeyDown:w,onFocus:M,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",disabled:o.uiState.setKioskModeEnabled}):f("div",{className:"search-box__title",children:[e.searchBoxIcon&&a("i",{className:b("search-box__title-icon",e.searchBoxIcon)}),f("div",{className:"search-box__title-content",children:[a("strong",{className:"search-box__title-text",children:e.searchBoxTitle}),e.searchBoxSubtitle&&a("span",{className:"search-box__title-subtitle",children:e.searchBoxSubtitle})]}),e.searchBoxBadge?a(P,{variant:"lightgray",size:"md",rounded:!0,noMargins:!0,children:e.searchBoxBadge}):null]})}),!e.shouldShowSearchInput&&e.searchBoxActions.map(t=>a("button",{className:"search-box__button search-box__button--ui-action",onClick:t.handler,type:"button","aria-label":t.label,title:t.label,children:a("i",{className:t.icon})},t.id)),a("button",{className:"search-box__button search-box__button--action",onClick:e.shouldShowSearchInput?e.shouldShowCloseButton?x:A:x,type:"button","aria-label":e.ariaLabel,children:a("i",{className:e.actionButtonIcon})})]}))}export default R;
1
+ import{jsx as a,jsxs as f}from"react/jsx-runtime";import b from"classnames";import{useObserver as D}from"mobx-react-lite";import k,{useEffect as v,useRef as C,useCallback as T}from"react";import o,{searchStore as e}from"../store";import{t as i}from"../utils/i18n";import{useAutorun as l}from"../utils/mobx";import z from"../tools/debounce";import{GaEventActions as j,sendEventToGa as K}from"../tools/gtag";import{handleCustomCommand as L}from"../utils/customCommands";import{Badge as P}from"./";import"./SearchBox.scss";const G=1e3;function R({className:g}){const B=C(),p=C(null);function w(t){let s=0;switch(t.key){case"Down":case"ArrowDown":s=1;break;case"Up":case"ArrowUp":s=-1;break;case"Enter":t.preventDefault(),o.openActiveListItem();const n=c();n&&L(n.value);return;case"Escape":t.preventDefault(),e.closeSearch();return}s&&(t.preventDefault(),o.changeActiveListIndex(s))}function c(){return p.current}const[I,u]=k.useState(""),[h,E]=k.useState(!1);l(()=>{E(o.uiState.kiosk&&o.uiState.inIdle)}),v(()=>{if(!h){u("");return}const t=[i("Find Companies..."),i("Find Categories..."),i("Find Sessions..."),i("Search...")];let s=0,n=0,r=!1,S;const _=()=>{const d=t[s];r?(u(d.substring(0,n-1)),n--):(u(d.substring(0,n+1)),n++);let m=r?50:100;!r&&n===d.length?(r=!0,m=2e3):r&&n===0&&(r=!1,s=(s+1)%t.length,m=500),S=setTimeout(_,m)};return _(),()=>clearTimeout(S)},[h]),l(()=>{const t=document.activeElement;o.uiState.overlaySize!=="full"&&t===c()&&!e.isFocused&&c()?.blur()}),l(()=>{o.uiState.menu&&o.uiState.kiosk&&e.setFocused(!1)}),l(()=>{const t=c(),s=document.activeElement;t&&e.isFocused&&s!==t&&!e.skipInputFocus&&t.focus()}),v(()=>{o.fuzzySearchEngineStore.loadEngine()},[]);const N=T(z(()=>{e.searchText&&K(j.Search,e.searchText),window.__resett?.()},G),[]);function y(){e.setSearchText(c()?.value||""),N()}function M(){e.setFocused(!0),window.__resett?.()}function A(){e.isFocused||(e.handleSearchAction(),setTimeout(()=>{c()?.focus()},100))}function F(){e.handleBackAction()}function x(){e.closeSearch()}return D(()=>f("div",{className:b("search-box",g,e.searchBoxClass,{"efp-semi-transparent":o.uiState.setKioskModeEnabled}),ref:B,children:[a("button",{className:b("search-box__button","search-box__button--back",{"is-mobile-details":e.isMobileDetailsMode}),onClick:F,type:"button","aria-label":e.backMode==="back"?i("Go back"):i("Main menu"),children:a("i",{className:e.backMode==="back"?"icon-chevron-left":o.uiState.viewerMode?"icon-home":"icon-menu"})}),a("div",{className:"search-box__input-wrapper",children:e.shouldShowSearchInput?a("input",{ref:p,type:"search",className:"search-box__input",placeholder:h?I:e.placeholder,"aria-label":"Search",value:e.searchText,onChange:y,onKeyDown:w,onFocus:M,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",disabled:o.uiState.setKioskModeEnabled}):f("div",{className:"search-box__title",children:[e.searchBoxIcon&&a("i",{className:b("search-box__title-icon",e.searchBoxIcon)}),f("div",{className:"search-box__title-content",children:[a("strong",{className:"search-box__title-text",children:e.searchBoxTitle}),e.searchBoxSubtitle&&a("span",{className:"search-box__title-subtitle",children:e.searchBoxSubtitle})]}),e.searchBoxBadge?a(P,{variant:"lightgray",size:"md",rounded:!0,noMargins:!0,children:e.searchBoxBadge}):null]})}),!e.shouldShowSearchInput&&e.searchBoxActions.map(t=>a("button",{className:"search-box__button search-box__button--ui-action",onClick:t.handler,type:"button","aria-label":t.label,title:t.label,children:a("i",{className:t.icon})},t.id)),a("button",{className:"search-box__button search-box__button--action",onClick:e.shouldShowSearchInput?e.shouldShowCloseButton?x:A:x,type:"button","aria-label":e.ariaLabel,children:a("i",{className:e.actionButtonIcon})})]}))}export default R;
package/dist/esm/load.js CHANGED
@@ -53,4 +53,4 @@ import"./utils/silence-mobx-react-lite-warning";import{resolve as c}from"@expofp
53
53
  <svg viewBox="25 25 50 50">
54
54
  <circle r="20" cy="50" cx="50"></circle>
55
55
  </svg>
56
- </div>`,requestAnimationFrame(()=>{const r=a.querySelector(`.${t}`);r.style.opacity="1"})}
56
+ </div>`,requestAnimationFrame(()=>{a.querySelector(`.${t}`)?.style.setProperty("opacity","1")})}
@@ -1 +1 @@
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}
1
+ import{createBrowserHistory as te}from"history";import{autorun as O,reaction as k}from"mobx";import{handleCustomCommand as oe}from"../utils/customCommands";import{BUILD_ROUTE_KEY as se,KIOSK_ENABLE_KEY as A,MAP_SETTINGS_KEY as re,PREVIEW_MODE_QUERY as E,PREVIEW_MODE_STORAGE_KEY as F,SEPARATOR as R,PATHWAY_KEY as N,PLANNER_KEY as P,PLANNER_SOURCE_KEY as W,PLANNER_FROM_KEY as $,LANG_KEY as K,UI_SCALE_PARAM_KEY as Y,UI_SCALE_RESET_PARAM_KEY as V,VIEWER_MODE_QUERY as I,VIEWER_MODE_STORAGE_KEY as H,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 G}from"../tools/gtag";import U from"../tools/logger";import{isLocalStorageAvailable as L}from"../utils/localStorage";import{areLayersEnabled as ne}from"../utils/areLayersEnabled";import ce from"../core/Rect";import{getMostFrequent as ue}from"../utils/getMostFrequent";import{runInAction as D}from"mobx";import{recoverKioskFromUrlPrams as he}from"../components/Kiosk/recoverKioskFromUrlPrams";import{hasLocale as fe,setLocale as de}from"../utils/i18n";let m=!1,C=!1,z=null,j=null,q=null,Q;const h=te(),_=window.location.pathname,S=[];export function getLocationHistory(){return S}function b(t){return _+t}function me(t){m||h.push(b(t))}export function historyReplace(t){m||h.push(b(t))}function f(t){return t.replace(/=&/g,"&").replace(/=$/,"")}function J(){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+=`&${$}=${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!==z||a!==j||e!==q?me(c):historyReplace(c),z=l,j=a,q=e)}function X(){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 oe(t)}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(he(a),pe(a),!B())if(a.has(A)){const e=a.get(A);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($),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(K)){const e=a.get(K)?.toLowerCase();fe(e)&&de(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&&D(()=>{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(ne()){const u=g.map(ee=>ee.layer.name),M=ue(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&&D(()=>{s.uiState.moveToRect=ce.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,J(),X()}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"?G(!0):o==="false"&&G(!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(H,"1"):(o==="0"||o==="false")&&L&&localStorage.removeItem(H),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(F,"1"):o==="false"&&L&&localStorage.removeItem(F),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(V)){s.uiState.resetUIScale();const e=new URL(window.location.href);e.searchParams.delete(V);let o=f(e.search);m=!0,historyReplace(o),m=!1}const a=l.get(Y);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(Y);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)),Q=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(X),O(J),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(){Q()}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 pe(t){try{let l={};const a=i.defaultMapSettings;if(new Set(t.keys()).size)l=Z(Object.fromEntries(t.entries()),a);else{const e=sessionStorage.getItem(re);e&&(l=Z(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 Z(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}
@@ -43,7 +43,6 @@ export declare abstract class BoothBase {
43
43
  readonly poiTypeId: number;
44
44
  readonly poiType: RawPoiType;
45
45
  readonly poiIcon: string;
46
- readonly yah: boolean;
47
46
  readonly meta: Record<string, string>;
48
47
  layer: Layer;
49
48
  bookmarkedDirectly: boolean;
@@ -1 +1 @@
1
- import{__esDecorate as s,__runInitializers as l}from"tslib";import{lineLength as M,lineRectangleIntersections as C,pointInsideRectangle as L,Rect as N}from"simple-geometry";import{action as R,computed as i,observable as S}from"mobx";import E from"../tools/settings";import{uiState as j}from"./index";let O=(()=>{let o=[],c,m=[],u=[],b,g=[],k=[],y,p,f,_,v,B,x;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;c=[S],b=[S],y=[i({keepAlive:!0})],p=[i({keepAlive:!0})],f=[i({keepAlive:!0})],_=[i({keepAlive:!0})],v=[i({keepAlive:!0})],B=[i],x=[R],s(this,null,y,{kind:"getter",name:"boothById",static:!1,private:!1,access:{has:e=>"boothById"in e,get:e=>e.boothById},metadata:t},null,o),s(this,null,p,{kind:"getter",name:"boothByExternalId",static:!1,private:!1,access:{has:e=>"boothByExternalId"in e,get:e=>e.boothByExternalId},metadata:t},null,o),s(this,null,f,{kind:"getter",name:"boothByName",static:!1,private:!1,access:{has:e=>"boothByName"in e,get:e=>e.boothByName},metadata:t},null,o),s(this,null,_,{kind:"getter",name:"boothBySlug",static:!1,private:!1,access:{has:e=>"boothBySlug"in e,get:e=>e.boothBySlug},metadata:t},null,o),s(this,null,v,{kind:"getter",name:"borderWidth",static:!1,private:!1,access:{has:e=>"borderWidth"in e,get:e=>e.borderWidth},metadata:t},null,o),s(this,null,B,{kind:"getter",name:"bookmarked",static:!1,private:!1,access:{has:e=>"bookmarked"in e,get:e=>e.bookmarked},metadata:t},null,o),s(this,null,x,{kind:"method",name:"replaceBookmarked",static:!1,private:!1,access:{has:e=>"replaceBookmarked"in e,get:e=>e.replaceBookmarked},metadata:t},null,o),s(null,null,c,{kind:"field",name:"booths",static:!1,private:!1,access:{has:e=>"booths"in e,get:e=>e.booths,set:(e,r)=>{e.booths=r}},metadata:t},m,u),s(null,null,b,{kind:"field",name:"highlightedByExternalIds",static:!1,private:!1,access:{has:e=>"highlightedByExternalIds"in e,get:e=>e.highlightedByExternalIds,set:(e,r)=>{e.highlightedByExternalIds=r}},metadata:t},g,k),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=l(this,o);booths=l(this,m,[]);highlightedByExternalIds=(l(this,u),l(this,g,[]));get boothById(){return new Map(this.booths.map(t=>[t.id,t]))}get boothByExternalId(){return new Map(this.booths.map(t=>[t.externalId,t]))}get boothByName(){return new Map(this.booths.map(t=>[t.name.toLowerCase(),t]))}get boothBySlug(){return new Map(this.booths.map(t=>[t.slug,t]))}get borderWidth(){if(E.boothBorderWidth)return E.boothBorderWidth;if(E.EXPO==="groomexpo")return .4;const t=this.booths.filter(e=>e.rect).map(e=>e.rect.w+e.rect.h);return t.reduce((e,r)=>e+r,0)/t.length/80}constructor(t){l(this,k),this.rootStore=t}get bookmarked(){return this.booths.filter(t=>t.bookmarkedDirectly)}getNearestBooth(t){var e=null;const d=this.booths.map(a=>{const{x1:n,x2:I,y1:h,y2:D}=a.rect,A=Math.abs(I-n),z=Math.abs(D-h);return{lineLength:M(t,C({p0:t,p1:{x:a.rect.cx,y:a.rect.cy}},new N({x:n,y:h},{x:n+A,y:h},{x:n+A,y:h+z},{x:n,y:h+z}))[0]),name:a.name}}).sort((a,n)=>a.lineLength-n.lineLength)[0];return e=this.booths.find(a=>a.name===d.name),e}getBoothAtPoint(t){return this.booths.find(e=>{const{x1:r,x2:d,y1:a,y2:n}=e.rect,I=Math.abs(d-r),h=Math.abs(n-a),D=new N({x:r,y:a},{x:r+I,y:a},{x:r+I,y:a+h},{x:r,y:a+h});return L(t,D)})}findBooth(t){return this.boothByExternalId.get(t)||this.boothByName.get(t.toLowerCase())||this.boothBySlug.get(t)}replaceBookmarked(t){const e=(t||[]).map(a=>this.boothById.get(a)).filter(a=>a),r=new Set(e),d=this.bookmarked.filter(a=>!r.has(a));for(const a of d)a.bookmarkedDirectly=!1;for(const a of e)a.bookmarkedDirectly=!0}}})();export default O;let w=(()=>{let o=[],c,m=[],u=[],b,g=[],k=[],y,p,f,_,v,B,x;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;c=[S],b=[S],y=[i({keepAlive:!0})],p=[i({keepAlive:!0})],f=[i({keepAlive:!0})],_=[i({keepAlive:!0})],v=[i({keepAlive:!0})],B=[i({keepAlive:!0})],x=[i({keepAlive:!0})],s(this,null,y,{kind:"getter",name:"bookmarked",static:!1,private:!1,access:{has:e=>"bookmarked"in e,get:e=>e.bookmarked},metadata:t},null,o),s(this,null,p,{kind:"getter",name:"uiState",static:!1,private:!1,access:{has:e=>"uiState"in e,get:e=>e.uiState},metadata:t},null,o),s(this,null,f,{kind:"getter",name:"fullName",static:!1,private:!1,access:{has:e=>"fullName"in e,get:e=>e.fullName},metadata:t},null,o),s(this,null,_,{kind:"getter",name:"visible",static:!1,private:!1,access:{has:e=>"visible"in e,get:e=>e.visible},metadata:t},null,o),s(this,null,v,{kind:"getter",name:"hover",static:!1,private:!1,access:{has:e=>"hover"in e,get:e=>e.hover},metadata:t},null,o),s(this,null,B,{kind:"getter",name:"selected",static:!1,private:!1,access:{has:e=>"selected"in e,get:e=>e.selected},metadata:t},null,o),s(this,null,x,{kind:"getter",name:"skipDim",static:!1,private:!1,access:{has:e=>"skipDim"in e,get:e=>e.skipDim},metadata:t},null,o),s(null,null,c,{kind:"field",name:"layer",static:!1,private:!1,access:{has:e=>"layer"in e,get:e=>e.layer,set:(e,r)=>{e.layer=r}},metadata:t},m,u),s(null,null,b,{kind:"field",name:"bookmarkedDirectly",static:!1,private:!1,access:{has:e=>"bookmarkedDirectly"in e,get:e=>e.bookmarkedDirectly,set:(e,r)=>{e.bookmarkedDirectly=r}},metadata:t},g,k),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}store=l(this,o);id;name;externalId;title;rect;borderWidth;borderColor;noLabels;rotate;paths;pathsWithRect;slug;error;description;exhibitors;labelColor;schedule;poiTypeId;poiType;poiIcon;yah;meta;layer=l(this,m,void 0);bookmarkedDirectly=(l(this,u),l(this,g,!1));get bookmarked(){return j.disableBookmarked?!1:this.schedule?.some(t=>t.bookmarked)?!0:this.exhibitors.length>0?!!this.exhibitors.find(t=>t.bookmarked):this.bookmarkedDirectly}get uiState(){return this.store.rootStore.uiState}get fullName(){let t=`${this.yah?this.title:this.name}`;const e=this.meta?Object.entries(this.meta).filter(([r])=>!r.startsWith("_")).map(([r,d])=>`${r} ${d}`).join(" "):"";return`${t} ${e}`.replace(/\s+/g," ").trim()}get visible(){return this.layer?.visible??!0}get hover(){return this.uiState.hoveredBooths.has(this)}get selected(){return this.uiState.selectedBooths.has(this)}get skipDim(){return this.uiState.highlightedBooths.has(this.id.toString())}constructor(){l(this,k)}}})();export{w as BoothBase};export class RegularBooth extends w{buyUrl;reserveUrl;type;status;price;entity={type:"booth",variant:"regular"};size;availColor;soldColor;holdColor;onHold;reserved;shapes}export class SpecialBooth extends w{color;shapes;entity={type:"booth",variant:"special"}}
1
+ import{__esDecorate as s,__runInitializers as l}from"tslib";import{lineLength as M,lineRectangleIntersections as C,pointInsideRectangle as L,Rect as N}from"simple-geometry";import{action as R,computed as i,observable as S}from"mobx";import E from"../tools/settings";import{uiState as j}from"./index";let O=(()=>{let o=[],d,c=[],m=[],u,b=[],g=[],k,p,y,f,_,v,B;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;d=[S],u=[S],k=[i({keepAlive:!0})],p=[i({keepAlive:!0})],y=[i({keepAlive:!0})],f=[i({keepAlive:!0})],_=[i({keepAlive:!0})],v=[i],B=[R],s(this,null,k,{kind:"getter",name:"boothById",static:!1,private:!1,access:{has:e=>"boothById"in e,get:e=>e.boothById},metadata:t},null,o),s(this,null,p,{kind:"getter",name:"boothByExternalId",static:!1,private:!1,access:{has:e=>"boothByExternalId"in e,get:e=>e.boothByExternalId},metadata:t},null,o),s(this,null,y,{kind:"getter",name:"boothByName",static:!1,private:!1,access:{has:e=>"boothByName"in e,get:e=>e.boothByName},metadata:t},null,o),s(this,null,f,{kind:"getter",name:"boothBySlug",static:!1,private:!1,access:{has:e=>"boothBySlug"in e,get:e=>e.boothBySlug},metadata:t},null,o),s(this,null,_,{kind:"getter",name:"borderWidth",static:!1,private:!1,access:{has:e=>"borderWidth"in e,get:e=>e.borderWidth},metadata:t},null,o),s(this,null,v,{kind:"getter",name:"bookmarked",static:!1,private:!1,access:{has:e=>"bookmarked"in e,get:e=>e.bookmarked},metadata:t},null,o),s(this,null,B,{kind:"method",name:"replaceBookmarked",static:!1,private:!1,access:{has:e=>"replaceBookmarked"in e,get:e=>e.replaceBookmarked},metadata:t},null,o),s(null,null,d,{kind:"field",name:"booths",static:!1,private:!1,access:{has:e=>"booths"in e,get:e=>e.booths,set:(e,r)=>{e.booths=r}},metadata:t},c,m),s(null,null,u,{kind:"field",name:"highlightedByExternalIds",static:!1,private:!1,access:{has:e=>"highlightedByExternalIds"in e,get:e=>e.highlightedByExternalIds,set:(e,r)=>{e.highlightedByExternalIds=r}},metadata:t},b,g),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=l(this,o);booths=l(this,c,[]);highlightedByExternalIds=(l(this,m),l(this,b,[]));get boothById(){return new Map(this.booths.map(t=>[t.id,t]))}get boothByExternalId(){return new Map(this.booths.map(t=>[t.externalId,t]))}get boothByName(){return new Map(this.booths.map(t=>[t.name.toLowerCase(),t]))}get boothBySlug(){return new Map(this.booths.map(t=>[t.slug,t]))}get borderWidth(){if(E.boothBorderWidth)return E.boothBorderWidth;if(E.EXPO==="groomexpo")return .4;const t=this.booths.filter(e=>e.rect).map(e=>e.rect.w+e.rect.h);return t.reduce((e,r)=>e+r,0)/t.length/80}constructor(t){l(this,g),this.rootStore=t}get bookmarked(){return this.booths.filter(t=>t.bookmarkedDirectly)}getNearestBooth(t){var e=null;const x=this.booths.map(a=>{const{x1:n,x2:I,y1:h,y2:D}=a.rect,A=Math.abs(I-n),z=Math.abs(D-h);return{lineLength:M(t,C({p0:t,p1:{x:a.rect.cx,y:a.rect.cy}},new N({x:n,y:h},{x:n+A,y:h},{x:n+A,y:h+z},{x:n,y:h+z}))[0]),name:a.name}}).sort((a,n)=>a.lineLength-n.lineLength)[0];return e=this.booths.find(a=>a.name===x.name),e}getBoothAtPoint(t){return this.booths.find(e=>{const{x1:r,x2:x,y1:a,y2:n}=e.rect,I=Math.abs(x-r),h=Math.abs(n-a),D=new N({x:r,y:a},{x:r+I,y:a},{x:r+I,y:a+h},{x:r,y:a+h});return L(t,D)})}findBooth(t){return this.boothByExternalId.get(t)||this.boothByName.get(t.toLowerCase())||this.boothBySlug.get(t)}replaceBookmarked(t){const e=(t||[]).map(a=>this.boothById.get(a)).filter(a=>a),r=new Set(e),x=this.bookmarked.filter(a=>!r.has(a));for(const a of x)a.bookmarkedDirectly=!1;for(const a of e)a.bookmarkedDirectly=!0}}})();export default O;let w=(()=>{let o=[],d,c=[],m=[],u,b=[],g=[],k,p,y,f,_,v,B;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;d=[S],u=[S],k=[i({keepAlive:!0})],p=[i({keepAlive:!0})],y=[i({keepAlive:!0})],f=[i({keepAlive:!0})],_=[i({keepAlive:!0})],v=[i({keepAlive:!0})],B=[i({keepAlive:!0})],s(this,null,k,{kind:"getter",name:"bookmarked",static:!1,private:!1,access:{has:e=>"bookmarked"in e,get:e=>e.bookmarked},metadata:t},null,o),s(this,null,p,{kind:"getter",name:"uiState",static:!1,private:!1,access:{has:e=>"uiState"in e,get:e=>e.uiState},metadata:t},null,o),s(this,null,y,{kind:"getter",name:"fullName",static:!1,private:!1,access:{has:e=>"fullName"in e,get:e=>e.fullName},metadata:t},null,o),s(this,null,f,{kind:"getter",name:"visible",static:!1,private:!1,access:{has:e=>"visible"in e,get:e=>e.visible},metadata:t},null,o),s(this,null,_,{kind:"getter",name:"hover",static:!1,private:!1,access:{has:e=>"hover"in e,get:e=>e.hover},metadata:t},null,o),s(this,null,v,{kind:"getter",name:"selected",static:!1,private:!1,access:{has:e=>"selected"in e,get:e=>e.selected},metadata:t},null,o),s(this,null,B,{kind:"getter",name:"skipDim",static:!1,private:!1,access:{has:e=>"skipDim"in e,get:e=>e.skipDim},metadata:t},null,o),s(null,null,d,{kind:"field",name:"layer",static:!1,private:!1,access:{has:e=>"layer"in e,get:e=>e.layer,set:(e,r)=>{e.layer=r}},metadata:t},c,m),s(null,null,u,{kind:"field",name:"bookmarkedDirectly",static:!1,private:!1,access:{has:e=>"bookmarkedDirectly"in e,get:e=>e.bookmarkedDirectly,set:(e,r)=>{e.bookmarkedDirectly=r}},metadata:t},b,g),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}store=l(this,o);id;name;externalId;title;rect;borderWidth;borderColor;noLabels;rotate;paths;pathsWithRect;slug;error;description;exhibitors;labelColor;schedule;poiTypeId;poiType;poiIcon;meta;layer=l(this,c,void 0);bookmarkedDirectly=(l(this,m),l(this,b,!1));get bookmarked(){return j.disableBookmarked?!1:this.schedule?.some(t=>t.bookmarked)?!0:this.exhibitors.length>0?!!this.exhibitors.find(t=>t.bookmarked):this.bookmarkedDirectly}get uiState(){return this.store.rootStore.uiState}get fullName(){const t=this.meta?Object.entries(this.meta).filter(([e])=>!e.startsWith("_")).map(([e,r])=>`${e} ${r}`).join(" "):"";return`${this.name} ${t}`.replace(/\s+/g," ").trim()}get visible(){return this.layer?.visible??!0}get hover(){return this.uiState.hoveredBooths.has(this)}get selected(){return this.uiState.selectedBooths.has(this)}get skipDim(){return this.uiState.highlightedBooths.has(this.id.toString())}constructor(){l(this,g)}}})();export{w as BoothBase};export class RegularBooth extends w{buyUrl;reserveUrl;type;status;price;entity={type:"booth",variant:"regular"};size;availColor;soldColor;holdColor;onHold;reserved;shapes}export class SpecialBooth extends w{color;shapes;entity={type:"booth",variant:"special"}}
@@ -1 +1 @@
1
- import{__esDecorate as i,__runInitializers as r}from"tslib";import{action as m,computed as x,observable as d}from"mobx";import{Point as Ke,lineLength as Ge}from"simple-geometry";import n,{boothStore as Xe,layersStore as T}from".";import{fpGeo as E}from"../data/fpGeo";import z from"../core/Rect";import{GaEventActions as He,sendEventToGa as Je}from"../tools/gtag";import{convertGpsToLocal as Oe,isValidPointCoords as Ue,calculateRelativeBearing as Qe}from"../utils/gps";import{getLayerSvg as et,svgArea as k}from"../data/svg";import{createWayfindingEngine as tt}from"../wayfinding/core";import{boothToWaypoint as Ne,graphDataSource as Ze}from"../wayfinding/adapters";import{LayersMode as st}from"./LayerStore";import{uiState as g}from"./index";import{calcSpeed as qe}from"../utils/calcSpeed";import{calcTravelTime as $e}from"../utils/calcTravelTime";import{DEFAULT_UNITS as Ve,ORIENTATION_GRANTED_KEY as at}from"../constants";import{areLayersEnabled as it}from"../utils/areLayersEnabled";import{shouldReroute as rt}from"../wayfinding/core";import{findBoothInRadius as nt}from"../wayfinding/utils/findBoothInRadius";import We from"../data";import je from"../tools/logger";const b=a=>typeof a=="string"?Number(a.replace(",",".")):a;let ot=(()=>{let a=[],o,l=[],f=[],h,S=[],L=[],P,D=[],I=[],w,A=[],M=[],C,B=[],F=[],G,O=[],U=[],N,Z=[],q=[],$,V=[],W=[],j,Y=[],K=[],X,H=[],J=[],Q,ee=[],te=[],se,ae=[],ie=[],re,ne=[],oe=[],le,ce=[],ue=[],de,fe,me,he,pe,_e,ye,ge,ke,be,ve,xe,Re,Se=[],Le=[],Te,Ee,ze,Pe,De,Ie,we=[],Ae=[],Me,Ce,Be;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;o=[d],h=[d],P=[d],w=[d],C=[d],G=[d],N=[d],$=[d],j=[d],X=[d],Q=[d],se=[d],re=[d],le=[d],de=[x],fe=[m],me=[m],he=[x({keepAlive:!0})],pe=[x({keepAlive:!0})],_e=[m],ye=[m],ge=[x({keepAlive:!0})],ke=[x({keepAlive:!0})],be=[m],ve=[m],xe=[m],Re=[d],Te=[x],Ee=[m],ze=[m],Pe=[m],De=[m],Ie=[d],Me=[m],Ce=[x({keepAlive:!0})],Be=[m],i(this,null,de,{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,fe,{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,me,{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,he,{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,pe,{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,_e,{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,ye,{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,ge,{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,ke,{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,be,{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,ve,{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,xe,{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,Te,{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,Ee,{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,ze,{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,Pe,{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,De,{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,Me,{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,Ce,{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,Be,{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,o,{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},S,L),i(null,null,P,{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},D,I),i(null,null,w,{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},A,M),i(null,null,C,{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},B,F),i(null,null,G,{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},O,U),i(null,null,N,{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},Z,q),i(null,null,$,{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},V,W),i(null,null,j,{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},Y,K),i(null,null,X,{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},H,J),i(null,null,Q,{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},ee,te),i(null,null,se,{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},ae,ie),i(null,null,re,{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},ne,oe),i(null,null,le,{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},ce,ue),i(null,null,Re,{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},Se,Le),i(null,null,Ie,{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},we,Ae),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,S,null));currentPosition=(r(this,L),r(this,D,null));requestCompass=(r(this,I),r(this,A,!1));iconType=(r(this,M),r(this,B,0));tempToBooth=(r(this,F),r(this,O,null));defaultFrom=(r(this,U),r(this,Z,null));focusEnabled=(r(this,q),r(this,V,!0));prevZ=(r(this,W),r(this,Y,null));markersData=(r(this,K),r(this,H,{icons:[],markers:[]}));prevMarkers=(r(this,J),r(this,ee,[]));showAccessible=(r(this,te),r(this,ae,!!Ze.getLines().find(t=>t.unaccessible)));onlyAccessible=(r(this,ie),r(this,ne,!1));currentRouteLayer=(r(this,oe),r(this,ce,null));constructor(t){r(this,Ae),this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!this.defaultFrom||!!this.currentPosition}selectRoute(t,e=!0){e&&(g.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&&n.fp.onDirection&&n.fp.onDirection(null),setTimeout(()=>{this.rootStore.moveToList(s),g.details=t,t&&(!t.from||!t.to)&&n.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&&Je(He.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)},200)}setStartPoint(t){const e=g.selectedRoute;if(e?.to&&!e?.from&&t){const s=new Route(t,e.to,e.waypoints);this.selectRoute(s)}}get pathLayers(){return n.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,s)=>s.indexOf(t)===e).reverse().map((t,e)=>({id:e+1,layer:n.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?Oe(t,E.properties.config):t;return this.rootStore.boothStore.booths.filter(c=>T.mode===st.Default||!e?c.visible&&c.rect:c.rect&&(typeof t.z!="number"&&!t.z&&c.visible||e.name===c.layer?.name)).sort((c,u)=>Ge(s,{x:c.rect.cx,y:c.rect.cy})-Ge(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=n.layerStore.findLayer(s?.z);if(e&&s){const u=n.rendererService.renderer;return c&&!c?.visible&&T.updateVisibility(c,!0),u?u.controls.panTo(s.x,s.y):(je.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 n.routeStore.routeLines?.map(e=>e.p0.layer).reverse().forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>n.layerStore.layers.find(s=>s.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,g.list.type==="route-planner"&&(g.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=b(t.x),t.y=b(t.y),t.lat=b(t.lat),t.lng=b(t.lng),it()||(t.z=null));const c=e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),u=e&&!c&&(this.focusEnabled||this.prevZ!=t?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=s?1:0;const _=t?ct(t):null;if(!_){this.currentPosition=null;return}const p=n.layerStore.findLayer(t.z),y=new CurrentPosition(_.x,_.y,p?.name||this.currentRouteLayer?.name,Qe(_),t.lat,t.lng),R=g.selectedRoute;let Fe=!this.routeLines?.length;if(p&&this.routeLines?.length&&(Fe=!!this.routeLines.find(v=>v.p0.layer===p.name||v.p1.layer===p.name)),u&&Fe){const v=n.rendererService.renderer;if(p&&!p?.visible&&T.updateVisibility(p,!0),!v){je.warn("Renderer is not initialized. Cannot pan to current position.");return}v.controls.panTo(y.x,y.y)}const Ye=E?.properties?.config?.enableExperimentalRerouting&&rt(y,this.routeLines)&&!!nt(y,Xe.booths,[R?.to]);if(e&&R&&Ye){const v=n.routeStore.getNearestBooth(y);n.routeStore.selectRoute(new Route(v,R?.to),!1)}this.currentPosition=y,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(this.canFindLocation){if(n.mapboxStore.showMapbox){g.moveToLocation=!0;return}if(n.routeStore.currentPosition){const t=n.routeStore.currentPosition,e=z.fromCxcywh(t.x,t.y,100,100);let s;if(e.intersects(k))s=e;else{const _=Math.max(k.x1,Math.min(t.x,k.x2)),p=Math.max(k.y1,Math.min(t.y,k.y2)),y=Math.min(k.w,k.h)*.3,R=z.fromCxcywh(_,p,y,y).getIntersection(k);s=z.fromMultiple([e,R])}localStorage.getItem(at)==="false"&&(n.routeStore.requestCompass=!0),g.moveToRect=s;const u=n.layerStore.findLayer(n.routeStore.currentPosition?.z);u&&T.updateVisibility(u,!0)}else n.selectBooth(n.routeStore.defaultFrom)}}routeUnits=(r(this,ue),r(this,Se,Ve));get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:$e(t,qe(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=et(),s=(e.getAttribute("units")||Ve).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=g.selectedRoute,e=this.routeDistance,s=this.routeUnits;n.fp.onDirection&&setTimeout(()=>{n.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:$e(e,qe(s))})},200)}checkRoutes(){const t=tt(Ze),e=n.boothStore.booths;console.info(`Route check started ${e.length}.... `);for(let s=0;s<e.length;s++){const c=e[s];for(let u=s+1;u<e.length;u++){const _=e[u];t.buildRoute(Ne(c),Ne(_)).lines.length||console.warn(`No route found from ${c.name} to ${_.name}`)}}console.info("Route check done....")}isGpsTrackingEnabled=(r(this,Le),r(this,we,!0));setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return We.autoTrackingGps&&this.isGpsTrackingEnabled&&!We.enableIPS}setOnlyAccessible(t){this.onlyAccessible=t}}})();export default ot;function lt(a){return{...a,x:b(a.x),y:b(a.y),lat:b(a.lat),lng:b(a.lng)}}function ct(a){let o=null,l=null;return E&&(o=E.properties.config),o&&a.x>=o.p0.x&&a.x<=o.p2.x&&a.y>=o.p0.y&&a.y<=o.p2.y?l={...a}:o&&Ue(a.lat)&&Ue(a.lng)?l=Oe(a,o):o||(l=a),l||null}export function findBooth(a){return n.boothStore.findBooth(a)||n.exhibitorStore.findExhibitor(a)?.booths[0]}export function findEntityByExternalId(a){const o=n.boothStore.boothByExternalId.get(a);if(o)return{type:"booth",entity:o};const l=n.exhibitorStore.exhibitorByExternalId.get(a);if(l)return{type:"exhibitor",entity:l}}export function separateExternalIds(a){const o=[],l=[];for(const f of a){const h=findEntityByExternalId(f);h&&(h.type==="booth"?o.push(f):l.push(f))}return{boothExternalIds:o,exhibitorExternalIds:l}}export function extractRoute(a,o,l){return new Route(findBooth(a)??n.routeStore.defaultFrom??null,findBooth(o),l?.map(f=>findBooth(f)))}export class Route{from;to;waypoints;constructor(o,l,f){this.from=o,this.to=l,this.waypoints=f,this.waypoints=f?.filter(h=>h&&h.id!==o?.id&&h.id!==l?.id)}}export class CurrentPosition extends Ke{x;y;z;angle;lat;lng;constructor(o,l,f,h,S,L){super(o,l),this.x=o,this.y=l,this.z=f,this.angle=h,this.lat=S,this.lng=L}}
1
+ import{__esDecorate as i,__runInitializers as r}from"tslib";import{action as m,computed as x,observable as d}from"mobx";import{Point as Ke,lineLength as Ge}from"simple-geometry";import n,{boothStore as Xe,layersStore as T}from".";import{fpGeo as E}from"../data/fpGeo";import z from"../core/Rect";import{GaEventActions as He,sendEventToGa as Je}from"../tools/gtag";import{convertGpsToLocal as Oe,isValidPointCoords as Ue,calculateRelativeBearing as Qe}from"../utils/gps";import{getLayerSvg as et,svgArea as k}from"../data/svg";import{createWayfindingEngine as tt}from"../wayfinding/core";import{boothToEndpoint as Ne,graphDataSource as Ze}from"../wayfinding/adapters";import{LayersMode as st}from"./LayerStore";import{uiState as g}from"./index";import{calcSpeed as qe}from"../utils/calcSpeed";import{calcTravelTime as $e}from"../utils/calcTravelTime";import{DEFAULT_UNITS as Ve,ORIENTATION_GRANTED_KEY as at}from"../constants";import{areLayersEnabled as it}from"../utils/areLayersEnabled";import{shouldReroute as rt}from"../wayfinding/core";import{findBoothInRadius as nt}from"../wayfinding/utils/findBoothInRadius";import je from"../data";import We from"../tools/logger";const b=a=>typeof a=="string"?Number(a.replace(",",".")):a;let ot=(()=>{let a=[],o,l=[],f=[],h,S=[],L=[],P,D=[],I=[],w,A=[],M=[],C,B=[],F=[],G,O=[],U=[],N,Z=[],q=[],$,V=[],j=[],W,Y=[],K=[],X,H=[],J=[],Q,ee=[],te=[],se,ae=[],ie=[],re,ne=[],oe=[],le,ce=[],ue=[],de,fe,me,he,pe,_e,ye,ge,ke,be,ve,xe,Re,Se=[],Le=[],Te,Ee,ze,Pe,De,Ie,we=[],Ae=[],Me,Ce,Be;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;o=[d],h=[d],P=[d],w=[d],C=[d],G=[d],N=[d],$=[d],W=[d],X=[d],Q=[d],se=[d],re=[d],le=[d],de=[x],fe=[m],me=[m],he=[x({keepAlive:!0})],pe=[x({keepAlive:!0})],_e=[m],ye=[m],ge=[x({keepAlive:!0})],ke=[x({keepAlive:!0})],be=[m],ve=[m],xe=[m],Re=[d],Te=[x],Ee=[m],ze=[m],Pe=[m],De=[m],Ie=[d],Me=[m],Ce=[x({keepAlive:!0})],Be=[m],i(this,null,de,{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,fe,{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,me,{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,he,{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,pe,{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,_e,{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,ye,{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,ge,{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,ke,{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,be,{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,ve,{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,xe,{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,Te,{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,Ee,{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,ze,{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,Pe,{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,De,{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,Me,{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,Ce,{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,Be,{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,o,{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},S,L),i(null,null,P,{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},D,I),i(null,null,w,{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},A,M),i(null,null,C,{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},B,F),i(null,null,G,{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},O,U),i(null,null,N,{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},Z,q),i(null,null,$,{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},V,j),i(null,null,W,{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},Y,K),i(null,null,X,{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},H,J),i(null,null,Q,{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},ee,te),i(null,null,se,{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},ae,ie),i(null,null,re,{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},ne,oe),i(null,null,le,{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},ce,ue),i(null,null,Re,{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},Se,Le),i(null,null,Ie,{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},we,Ae),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,S,null));currentPosition=(r(this,L),r(this,D,null));requestCompass=(r(this,I),r(this,A,!1));iconType=(r(this,M),r(this,B,0));tempToBooth=(r(this,F),r(this,O,null));defaultFrom=(r(this,U),r(this,Z,null));focusEnabled=(r(this,q),r(this,V,!0));prevZ=(r(this,j),r(this,Y,null));markersData=(r(this,K),r(this,H,{icons:[],markers:[]}));prevMarkers=(r(this,J),r(this,ee,[]));showAccessible=(r(this,te),r(this,ae,!!Ze.getLines().find(t=>t.unaccessible)));onlyAccessible=(r(this,ie),r(this,ne,!1));currentRouteLayer=(r(this,oe),r(this,ce,null));constructor(t){r(this,Ae),this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!this.defaultFrom||!!this.currentPosition}selectRoute(t,e=!0){e&&(g.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&&n.fp.onDirection&&n.fp.onDirection(null),setTimeout(()=>{this.rootStore.moveToList(s),g.details=t,t&&(!t.from||!t.to)&&n.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&&Je(He.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)},200)}setStartPoint(t){const e=g.selectedRoute;if(e?.to&&!e?.from&&t){const s=new Route(t,e.to,e.waypoints);this.selectRoute(s)}}get pathLayers(){return n.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,s)=>s.indexOf(t)===e).reverse().map((t,e)=>({id:e+1,layer:n.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?Oe(t,E.properties.config):t;return this.rootStore.boothStore.booths.filter(c=>T.mode===st.Default||!e?c.visible&&c.rect:c.rect&&(typeof t.z!="number"&&!t.z&&c.visible||e.name===c.layer?.name)).sort((c,u)=>Ge(s,{x:c.rect.cx,y:c.rect.cy})-Ge(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=n.layerStore.findLayer(s?.z);if(e&&s){const u=n.rendererService.renderer;return c&&!c?.visible&&T.updateVisibility(c,!0),u?u.controls.panTo(s.x,s.y):(We.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 n.routeStore.routeLines?.map(e=>e.p0.layer).reverse().forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>n.layerStore.layers.find(s=>s.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,g.list.type==="route-planner"&&(g.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=b(t.x),t.y=b(t.y),t.lat=b(t.lat),t.lng=b(t.lng),it()||(t.z=null));const c=e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),u=e&&!c&&(this.focusEnabled||this.prevZ!=t?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=s?1:0;const _=t?ct(t):null;if(!_){this.currentPosition=null;return}const p=n.layerStore.findLayer(t.z),y=new CurrentPosition(_.x,_.y,p?.name||this.currentRouteLayer?.name,Qe(_),t.lat,t.lng),R=g.selectedRoute;let Fe=!this.routeLines?.length;if(p&&this.routeLines?.length&&(Fe=!!this.routeLines.find(v=>v.p0.layer===p.name||v.p1.layer===p.name)),u&&Fe){const v=n.rendererService.renderer;if(p&&!p?.visible&&T.updateVisibility(p,!0),!v){We.warn("Renderer is not initialized. Cannot pan to current position.");return}v.controls.panTo(y.x,y.y)}const Ye=E?.properties?.config?.enableExperimentalRerouting&&rt(y,this.routeLines)&&!!nt(y,Xe.booths,[R?.to]);if(e&&R&&Ye){const v=n.routeStore.getNearestBooth(y);n.routeStore.selectRoute(new Route(v,R?.to),!1)}this.currentPosition=y,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(this.canFindLocation){if(n.mapboxStore.showMapbox){g.moveToLocation=!0;return}if(n.routeStore.currentPosition){const t=n.routeStore.currentPosition,e=z.fromCxcywh(t.x,t.y,100,100);let s;if(e.intersects(k))s=e;else{const _=Math.max(k.x1,Math.min(t.x,k.x2)),p=Math.max(k.y1,Math.min(t.y,k.y2)),y=Math.min(k.w,k.h)*.3,R=z.fromCxcywh(_,p,y,y).getIntersection(k);s=z.fromMultiple([e,R])}localStorage.getItem(at)==="false"&&(n.routeStore.requestCompass=!0),g.moveToRect=s;const u=n.layerStore.findLayer(n.routeStore.currentPosition?.z);u&&T.updateVisibility(u,!0)}else n.selectBooth(n.routeStore.defaultFrom)}}routeUnits=(r(this,ue),r(this,Se,Ve));get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:$e(t,qe(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=et(),s=(e.getAttribute("units")||Ve).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=g.selectedRoute,e=this.routeDistance,s=this.routeUnits;n.fp.onDirection&&setTimeout(()=>{n.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:$e(e,qe(s))})},200)}checkRoutes(){const t=tt(Ze),e=n.boothStore.booths;console.info(`Route check started ${e.length}.... `);for(let s=0;s<e.length;s++){const c=e[s];for(let u=s+1;u<e.length;u++){const _=e[u];t.buildRoute(Ne(c),Ne(_)).lines.length||console.warn(`No route found from ${c.name} to ${_.name}`)}}console.info("Route check done....")}isGpsTrackingEnabled=(r(this,Le),r(this,we,!0));setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return je.autoTrackingGps&&this.isGpsTrackingEnabled&&!je.enableIPS}setOnlyAccessible(t){this.onlyAccessible=t}}})();export default ot;function lt(a){return{...a,x:b(a.x),y:b(a.y),lat:b(a.lat),lng:b(a.lng)}}function ct(a){let o=null,l=null;return E&&(o=E.properties.config),o&&a.x>=o.p0.x&&a.x<=o.p2.x&&a.y>=o.p0.y&&a.y<=o.p2.y?l={...a}:o&&Ue(a.lat)&&Ue(a.lng)?l=Oe(a,o):o||(l=a),l||null}export function findBooth(a){return n.boothStore.findBooth(a)||n.exhibitorStore.findExhibitor(a)?.booths[0]}export function findEntityByExternalId(a){const o=n.boothStore.boothByExternalId.get(a);if(o)return{type:"booth",entity:o};const l=n.exhibitorStore.exhibitorByExternalId.get(a);if(l)return{type:"exhibitor",entity:l}}export function separateExternalIds(a){const o=[],l=[];for(const f of a){const h=findEntityByExternalId(f);h&&(h.type==="booth"?o.push(f):l.push(f))}return{boothExternalIds:o,exhibitorExternalIds:l}}export function extractRoute(a,o,l){return new Route(findBooth(a)??n.routeStore.defaultFrom??null,findBooth(o),l?.map(f=>findBooth(f)))}export class Route{from;to;waypoints;constructor(o,l,f){this.from=o,this.to=l,this.waypoints=f,this.waypoints=f?.filter(h=>h&&h.id!==o?.id&&h.id!==l?.id)}}export class CurrentPosition extends Ke{x;y;z;angle;lat;lng;constructor(o,l,f,h,S,L){super(o,l),this.x=o,this.y=l,this.z=f,this.angle=h,this.lat=S,this.lng=L}}