@expofp/floorplan 3.23.3 → 3.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/browser/{Button-DphA9T0C.js → Button-Bw0hqT6o.js} +5 -5
  2. package/dist/browser/{CookieConsent-CYOOb4MI.js → CookieConsent-DAoC1-xI.js} +7 -7
  3. package/dist/browser/{Debug-BuFen3u4.js → Debug-3VToRuwQ.js} +7 -7
  4. package/dist/browser/{Demo-rRws_XVz.js → Demo-BYUTTvOd.js} +9 -9
  5. package/dist/browser/{Free-ltZWNzYB.js → Free-CtdSA5bo.js} +9 -9
  6. package/dist/browser/{GalleryContainer-Dv0dO1Vy.js → GalleryContainer-D7tIVZPr.js} +10 -10
  7. package/dist/browser/{GpsLoader-BVPXwirw.js → GpsLoader-q-Mc4g77.js} +35 -35
  8. package/dist/browser/{KioskStore-C-WuNdfs.js → KioskStore-CAS07rsa.js} +10 -8
  9. package/dist/browser/{MaplibreAdapter-CkxsIQmV.js → MaplibreAdapter-CEgsHtMU.js} +165 -165
  10. package/dist/browser/{ModalContainer-V1-dOftF.js → ModalContainer-gqVQe0mT.js} +10 -10
  11. package/dist/browser/{PermissionNotice-N12rSqcN.js → PermissionNotice-CNmf5lZ2.js} +6 -6
  12. package/dist/browser/{SetKioskMode-fDc-O4Le.js → SetKioskMode-C2jN1b9b.js} +9 -9
  13. package/dist/browser/{ShowKiosk-q792mt6t.js → ShowKiosk-8zZRT4DP.js} +10 -10
  14. package/dist/browser/{ViewerMenuPanel-6KMEZS87.js → ViewerMenuPanel-CLYKOSWi.js} +14 -14
  15. package/dist/browser/{add-debug-secret-listener-8-_Ppayq.js → add-debug-secret-listener-Dumma9XW.js} +1 -1
  16. package/dist/browser/{adopt-global-settings-BJlg46-r.js → adopt-global-settings-B2I-44tK.js} +9 -9
  17. package/dist/browser/{boolean-editor-CzIi7_OU.js → boolean-editor-BL-iAvZv.js} +9 -9
  18. package/dist/browser/{bootIntercom-CvQ3HC_W.js → bootIntercom-DNhRU_h3.js} +2 -2
  19. package/dist/browser/{booth-by-xy-BG9PxifM.js → booth-by-xy-BPzI_I_r.js} +266 -266
  20. package/dist/browser/bundle.json +65 -65
  21. package/dist/browser/{classnames-TGWSIxj9.js → classnames-BwuQCVfY.js} +2 -2
  22. package/dist/browser/{client-CI_o2Xvi.js → client-CkkTg10f.js} +4 -4
  23. package/dist/browser/{components-Hhp3TuZo.js → components-xW0xn4HR.js} +1857 -1856
  24. package/dist/browser/{debug-overlay-Bm4jbphv.js → debug-overlay-BY_f3k5v.js} +10 -10
  25. package/dist/browser/{debug-ui-Be_gXiCI.js → debug-ui-COPw_jJ2.js} +6 -6
  26. package/dist/browser/{dist-4KgeMEqm.js → dist-CZOs6dlD.js} +3 -3
  27. package/dist/browser/{dist-aolaQ4jq.js → dist-CmtO-q5U.js} +6 -6
  28. package/dist/browser/{dist-BElHdG8w.js → dist-D6TtmmNR.js} +5 -5
  29. package/dist/browser/{efp-debug-init-CfCkw1eG.js → efp-debug-init-DbuQ2yZ4.js} +3 -3
  30. package/dist/browser/{enum-editor-bbV2J4xR.js → enum-editor-ChCH_AbI.js} +4 -4
  31. package/dist/browser/{es5-BhauPiuE.js → es5-CHdGSiQh.js} +2 -2
  32. package/dist/browser/{event-not-found-9jDLvDo3.js → event-not-found-BehJpGAv.js} +1 -1
  33. package/dist/browser/{exports-DKfDniYl.js → exports-D6Lf24yv.js} +1 -1
  34. package/dist/browser/{favicon--bOLXAnM.js → favicon-C6VPDk5V.js} +1 -1
  35. package/dist/browser/{fetch-retry.umd-CLAxmO3V.js → fetch-retry.umd-CAHs6cmO.js} +2 -2
  36. package/dist/browser/{flex-Cguef9vk.js → flex-Dd2gfX5v.js} +5 -5
  37. package/dist/browser/{floorplan.loader-B91MUpZB.js → floorplan.loader-DNDB13gB.js} +10 -10
  38. package/dist/browser/{floorplan.ready-ChvzYlI4.js → floorplan.ready-DdXVp9Bo.js} +320 -320
  39. package/dist/browser/{fuse-Ct0U9AvB.js → fuse-DjbxK1_r.js} +2 -2
  40. package/dist/browser/{i18n-CkJeM36t.js → i18n-DNHCTIl_.js} +5 -5
  41. package/dist/browser/index.js +14 -14
  42. package/dist/browser/{index.module-B6dUR2Kk.js → index.module-BgjhhzkD.js} +4 -4
  43. package/dist/browser/{integrateKiosk-BcIA2hxJ.js → integrateKiosk-DJW2dIlz.js} +4 -4
  44. package/dist/browser/{is-webview-CDtTma1I.js → is-webview-ymBXdDWY.js} +1 -1
  45. package/dist/browser/{jsx-runtime-Dm__wAdC.js → jsx-runtime-9dbUZslp.js} +2 -2
  46. package/dist/browser/{kiosk-record-B6HDQu2a.js → kiosk-record-C-ZbQR1P.js} +1 -1
  47. package/dist/browser/{lib-1dFWBMXD.js → lib-CivfxMxt.js} +3 -3
  48. package/dist/browser/{loadImage-BAWWj-IY.js → loadImage-DOmtMmNj.js} +4 -4
  49. package/dist/browser/{logDeviceInfo-CtkjcYJ4.js → logDeviceInfo-ZMWKzrjm.js} +9 -9
  50. package/dist/browser/{main-gY41DHQA.js → main-BQPKEs3u.js} +1 -1
  51. package/dist/browser/{mobx-VFmJt0vO.js → mobx-CmQWlos3.js} +4 -4
  52. package/dist/browser/{optional-boolean-editor-CmjFII7L.js → optional-boolean-editor-DxUi2Auz.js} +3 -3
  53. package/dist/browser/{optional-enum-editor-Bh2TFCEo.js → optional-enum-editor-DH_Sbb5_.js} +4 -4
  54. package/dist/browser/{optional-string-editor-C5BFOuRC.js → optional-string-editor-DjvpIPIy.js} +4 -4
  55. package/dist/browser/{particles.min-DZVEwsiv.js → particles.min-BPPTx23M.js} +2 -2
  56. package/dist/browser/{react-CUv7KQR_.js → react-DC0_Dc5U.js} +2 -2
  57. package/dist/browser/{react-dom-D4NbkPH-.js → react-dom-BvbU6dCN.js} +3 -3
  58. package/dist/browser/{rolldown-runtime-CZrj27T0.js → rolldown-runtime-DhRBYm2e.js} +1 -1
  59. package/dist/browser/{select-BQnlSKoO.js → select-D0UxO-rY.js} +10 -10
  60. package/dist/browser/{settings-CUnnGHou.js → settings-DLUbCP3F.js} +2 -2
  61. package/dist/browser/{settings-item-BnE6X22h.js → settings-item-YF8fKRZY.js} +6 -6
  62. package/dist/browser/{store-YQ5qSOS0.js → store-Bn4GUIsw.js} +1195 -1162
  63. package/dist/browser/{string-editor-BEDZabVW.js → string-editor-BTNVGDDd.js} +4 -4
  64. package/dist/browser/{text-field-BqFAzKKT.js → text-field-Dtzv6Odi.js} +5 -5
  65. package/dist/browser/{theme-BBIVBrGe.js → theme-BRK-tpxv.js} +8 -8
  66. package/dist/browser/{ui-Dn5i6Fz3.js → ui-qNmuus3-.js} +8 -8
  67. package/dist/browser/{useRenderTarget--JWR8iNN.js → useRenderTarget-FWd5uFIq.js} +4 -4
  68. package/dist/esm/components/Bookmarks.d.ts +1 -1
  69. package/dist/esm/components/Kiosk/KioskStore.d.ts +1 -1
  70. package/dist/esm/components/Kiosk/KioskStore.js +1 -1
  71. package/dist/esm/components/Kiosk/kioskUrlParam.d.ts +1 -1
  72. package/dist/esm/components/Map/Map.js +1 -1
  73. package/dist/esm/components/Maplibre/utils/geo-config.js +1 -1
  74. package/dist/esm/components/OverlayContainer.js +1 -1
  75. package/dist/esm/components/TourPoints.d.ts +2 -1
  76. package/dist/esm/components/Visited.d.ts +2 -1
  77. package/dist/esm/floorplan.loader.d.ts +1 -1
  78. package/dist/esm/floorplan.ready.js +1 -1
  79. package/dist/esm/store/LayerStore.d.ts +7 -6
  80. package/dist/esm/store/LayerStore.js +1 -1
  81. package/dist/esm/store/RouteStore.d.ts +16 -16
  82. package/dist/esm/store/RouteStore.js +1 -1
  83. package/dist/esm/store/UIState.d.ts +21 -22
  84. package/dist/esm/store/UIState.js +1 -1
  85. package/dist/esm/store/init/init-ui.d.ts +11 -0
  86. package/dist/esm/store/init/init-ui.js +1 -1
  87. package/dist/esm/types.d.ts +21 -4
  88. package/dist/esm/wayfinding/index.d.ts +1 -0
  89. package/package.json +9 -9
@@ -1,14 +1,14 @@
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.23.3" };
4
+ e.SENTRY_RELEASE = { id: "3.24.0" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "0a67f4c1-0ef6-428f-92c6-94c57178bf21", e._sentryDebugIdIdentifier = "sentry-dbid-0a67f4c1-0ef6-428f-92c6-94c57178bf21");
7
7
  } catch {}
8
8
  })();
9
- import { t as e } from "./jsx-runtime-Dm__wAdC.js";
10
- import { t } from "./settings-item-BnE6X22h.js";
11
- import { t as n } from "./text-field-BqFAzKKT.js";
9
+ import { t as e } from "./jsx-runtime-9dbUZslp.js";
10
+ import { t } from "./settings-item-YF8fKRZY.js";
11
+ import { t as n } from "./text-field-Dtzv6Odi.js";
12
12
  //#region ../debug/src/lib/ui/string-editor.tsx
13
13
  var r = e(), i = (e) => {
14
14
  var i;
@@ -1,15 +1,15 @@
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.23.3" };
4
+ e.SENTRY_RELEASE = { id: "3.24.0" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "9c5a0877-c176-4e2d-b51c-123d50ab2b3c", e._sentryDebugIdIdentifier = "sentry-dbid-9c5a0877-c176-4e2d-b51c-123d50ab2b3c");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-CZrj27T0.js";
10
- import { t } from "./react-CUv7KQR_.js";
11
- import { D as n, i as r, l as i, n as a, s as o, u as s, y as c } from "./flex-Cguef9vk.js";
12
- import { t as l } from "./classnames-TGWSIxj9.js";
9
+ import { r as e } from "./rolldown-runtime-DhRBYm2e.js";
10
+ import { t } from "./react-DC0_Dc5U.js";
11
+ import { D as n, i as r, l as i, n as a, s as o, u as s, y as c } from "./flex-Dd2gfX5v.js";
12
+ import { t as l } from "./classnames-BwuQCVfY.js";
13
13
  //#region ../../node_modules/.pnpm/@radix-ui+themes@3.3.0_@types+react-dom@19.2.3_@types+react@19.2.17__@types+react@19.2._5ea800d4e947acedb1fa1275f1697b17/node_modules/@radix-ui/themes/dist/esm/components/text-field.props.js
14
14
  var u = /* @__PURE__ */ e(t()), d = /* @__PURE__ */ e(l()), f = {
15
15
  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.23.3" };
4
+ e.SENTRY_RELEASE = { id: "3.24.0" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "f658045a-5be7-4ea4-a4b2-ddea9ab9caf3", e._sentryDebugIdIdentifier = "sentry-dbid-f658045a-5be7-4ea4-a4b2-ddea9ab9caf3");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-CZrj27T0.js";
10
- import { t } from "./react-CUv7KQR_.js";
11
- import { t as n } from "./jsx-runtime-Dm__wAdC.js";
12
- import { t as r } from "./react-dom-D4NbkPH-.js";
13
- import { C as i, E as a, O as o, T as s, _ as c, o as l, v as u, w as d } from "./flex-Cguef9vk.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-aolaQ4jq.js";
15
- import { t as y } from "./classnames-TGWSIxj9.js";
9
+ import { r as e } from "./rolldown-runtime-DhRBYm2e.js";
10
+ import { t } from "./react-DC0_Dc5U.js";
11
+ import { t as n } from "./jsx-runtime-9dbUZslp.js";
12
+ import { t as r } from "./react-dom-BvbU6dCN.js";
13
+ import { C as i, E as a, O as o, T as s, _ as c, o as l, v as u, w as d } from "./flex-Dd2gfX5v.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-CmtO-q5U.js";
15
+ import { t as y } from "./classnames-BwuQCVfY.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.17__@ty_cffccd7838985066e8e1d993b5cb6017/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.23.3" };
4
+ e.SENTRY_RELEASE = { id: "3.24.0" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "3c34ab8b-5d65-4c06-8595-6ed371acabc5", e._sentryDebugIdIdentifier = "sentry-dbid-3c34ab8b-5d65-4c06-8595-6ed371acabc5");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-CZrj27T0.js";
10
- import { a as t, i as n, s as r } from "./efp-debug-init-CfCkw1eG.js";
11
- import { a as i, i as a } from "./adopt-global-settings-BJlg46-r.js";
12
- import { t as o } from "./jsx-runtime-Dm__wAdC.js";
13
- import "./settings-CUnnGHou.js";
14
- import { t as s } from "./add-debug-secret-listener-8-_Ppayq.js";
9
+ import { r as e } from "./rolldown-runtime-DhRBYm2e.js";
10
+ import { a as t, i as n, s as r } from "./efp-debug-init-DbuQ2yZ4.js";
11
+ import { a as i, i as a } from "./adopt-global-settings-B2I-44tK.js";
12
+ import { t as o } from "./jsx-runtime-9dbUZslp.js";
13
+ import "./settings-DLUbCP3F.js";
14
+ import { t as s } from "./add-debug-secret-listener-Dumma9XW.js";
15
15
  //#region ../debug/src/lib/ui/render-debug-ui.tsx
16
16
  var c = /* @__PURE__ */ e(r(), 1), l = o(), u = !1;
17
17
  function d() {
@@ -26,7 +26,7 @@ function d() {
26
26
  }
27
27
  });
28
28
  let o = async (t) => {
29
- let { DebugUi: n } = await import("./debug-ui-Be_gXiCI.js"), { createRoot: i } = await import("./client-CI_o2Xvi.js").then((t) => /* @__PURE__ */ e(t.default, 1)), a = document.createElement("div");
29
+ let { DebugUi: n } = await import("./debug-ui-COPw_jJ2.js"), { createRoot: i } = await import("./client-CkkTg10f.js").then((t) => /* @__PURE__ */ e(t.default, 1)), a = document.createElement("div");
30
30
  document.body.appendChild(a), i(a).render(/* @__PURE__ */ (0, l.jsx)(n, {
31
31
  useDebugButtonState: r.useState,
32
32
  open: t
@@ -1,14 +1,14 @@
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.23.3" };
4
+ e.SENTRY_RELEASE = { id: "3.24.0" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "7407e64e-4c4e-4bfb-b2ef-80063ad22998", e._sentryDebugIdIdentifier = "sentry-dbid-7407e64e-4c4e-4bfb-b2ef-80063ad22998");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-CZrj27T0.js";
10
- import { t } from "./react-CUv7KQR_.js";
11
- import { l as n } from "./store-YQ5qSOS0.js";
9
+ import { r as e } from "./rolldown-runtime-DhRBYm2e.js";
10
+ import { t } from "./react-DC0_Dc5U.js";
11
+ import { l as n } from "./store-Bn4GUIsw.js";
12
12
  //#region ../ui/src/shared/activeElement.ts
13
13
  var r = (e) => !!e && "activeElement" in e;
14
14
  function i(e) {
@@ -1,3 +1,3 @@
1
1
  export default _default;
2
- declare function _default(): false;
2
+ declare function _default(): false | import("react").JSX.Element;
3
3
  //# sourceMappingURL=Bookmarks.d.ts.map
@@ -2,7 +2,7 @@ import { type AlertProps } from '@expofp/ui';
2
2
  import { type Kiosk, type StatusMessage } from './SetKiosk';
3
3
  import { type SetKioskChangeEvent } from './SetKiosk/types';
4
4
  declare class KioskStore {
5
- get kiosk(): Kiosk;
5
+ get kiosk(): Kiosk | null;
6
6
  setKiosk(kiosk: Kiosk | null): void;
7
7
  get renderer(): import("@expofp/renderer").Renderer | null;
8
8
  private getCameraState;
@@ -1 +1 @@
1
- import{__decorate as r}from"tslib";import{action as o,computed as m,observable as d,toJS as c,when as k}from"mobx";import a from"../../store";import{areLayersEnabled as S}from"../../utils/areLayersEnabled";import{t as h}from"../../utils/i18n";import{isPointVisible as g}from"../Map/visibleArea";import{getPtScaleZoomRatio as f,toFiniteNumber as u}from"./kiosk-record";import{updateKiosk as C}from"./kioskApi";import{getSavedKiosk as y,removeKiosk as M,saveKiosk as K}from"./SetKiosk";const v=2e4;class s{constructor(){this.savedKiosk=null,this.statusMessages=[],this.statusMessageTimer=0,this.isResettingCamera=!1}get kiosk(){return a.uiState.kioskData}setKiosk(e){a.uiState.setKioskData(e)}get renderer(){return a.rendererService.renderer}getCameraState(){if(a.maplibreStore.showMaplibre){const t=a.maplibreStore.cameraPort?.getCameraState();return t?{mapCenterLng:t.lng,mapCenterLat:t.lat,mapZoom:t.zoom,mapBearingDegrees:t.bearing,mapPitchDegrees:t.pitch}:{}}const e=a.rendererService.getCameraState();return e?{mapInitialPtScale:this.initialPtScale,mapPtScale:e.ptScale,mapCenterX:e.center.x,mapCenterY:e.center.y,mapRollDegrees:e.roll,mapPitch:e.pitch}:{}}get hasUnsavedChanges(){const e=this.savedKiosk,t=c(this.kiosk);if(!t||!e)return!!t!=!!e;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!0;for(const l of n)if(!(l in t)||e[l]!==t[l])return!0;return!1}addStatusMessage(e){this.statusMessages=[{...e,id:Date.now()}],this.startCleanupMessages()}clearStatusMessages(){this.statusMessages=[]}startCleanupMessages(){clearTimeout(this.statusMessageTimer),this.statusMessageTimer=window.setTimeout(()=>this.clearStatusMessages(),1e3)}async resetCamera(){if(!this.isResettingCamera){this.isResettingCamera=!0;try{if(a.maplibreStore.showMaplibre&&await this.resetMaplibreCamera())return;await this.resetRendererCamera()}finally{this.isResettingCamera=!1}}}async resetMaplibreCamera(){const e=await this.waitForMaplibreCameraPort();if(!e)return!1;const t=this.kiosk;t?.z!=null&&a.fp.activateFloor({name:String(t.z)});const n=u(t?.mapCenterLng),i=u(t?.mapCenterLat),l=u(t?.mapZoom);return n===void 0||i===void 0||l===void 0?(e.resetPitch(),a.uiState.fitBounds(),!0):(e.applyCameraState({lng:n,lat:i,zoom:l,bearing:u(t?.mapBearingDegrees),pitch:u(t?.mapPitchDegrees)}),!0)}async waitForMaplibreCameraPort(){const{maplibreStore:e}=a;if(e.cameraPort)return e.cameraPort;try{await k(()=>!!e.cameraPort||!e.showMaplibre,{timeout:v})}catch{return null}return e.cameraPort}async resetRendererCamera(){const e=this.renderer;if(!e)return;const t=this.kiosk;await e.controls.resetCamera({pan:!0,zoom:!0,roll:!0,pitch:!0},!0),t?.z!=null&&a.fp.activateFloor({name:String(t.z)});const n=f(t);n!==void 0&&await e.controls.zoomBy(n,!0);const i=u(t?.mapCenterX),l=u(t?.mapCenterY);i!==void 0&&l!==void 0&&await e.controls.panTo(i,l,!0);const p=u(t?.mapRollDegrees);p!==void 0&&await e.controls.rollTo(p,!0)}restoreData(){const e=y();e&&(this.setKiosk(e),this.savedKiosk=e,a.uiState.kiosk=!0)}handleSetupReady(){this.restoreData(),a.uiState.kiosk=!0,a.uiState.hideFreeOrDemo=!0,a.uiState.setForceDim(!0),a.searchStore.setSearchText(""),a.searchStore.setFocused(!1),this.resetCamera()}handleClose(){this.setKiosk(null),a.uiState.setForceDim(!1),a.uiState.enableSetKioskMode(!1),a.searchStore.closeSearch()}handleDelete(){M(),this.setKiosk(null),a.uiState.resetMapSettings(),a.uiState.resetUIScale(),this.addStatusMessage({variant:"success",title:h("Deleted")})}handleSave(){const e=this.renderer;if(!e)return;const t=c(this.kiosk),n=this.getCameraState(),i={...t,...n};if(!g(e,i)){this.addStatusMessage({variant:"error",title:h("Kiosk not visible")});return}this.setKiosk(i),K(i),C(i,"https://app.expofp.com/"),a.uiState.setUIScale(i.uiScale,!0),this.addStatusMessage({variant:"success",title:h("Saved")}),this.savedKiosk=i}delayChange(e){requestAnimationFrame(()=>e?.())}handleChange(e){const t=c(this.kiosk);t&&(Number.isFinite(e.angle)&&this.setKiosk({...t,heading:e.angle}),Number.isFinite(e.scale)&&(this.setKiosk({...t,uiScale:e.scale}),this.delayChange(()=>a.uiState.setUIScale(e.scale,!1))),Number.isFinite(e.percent)&&this.setKiosk({...t,iconSizePercent:e.percent}))}setInitialPtScale(e){if(this.initialPtScale)return;this.initialPtScale=e;const t=c(this.kiosk);t&&this.setKiosk({...t,mapInitialPtScale:e})}handleClick(e){const t=c(this.kiosk),n=a.fp.getFloors(),i=S()?n.find(p=>p.active)?.name??null:null,l=a.uiState.uiScale;this.setKiosk({...t,x:e.x,y:e.y,z:i,uiScale:t?.uiScale||l,heading:t?.heading||0,iconSizePercent:t?.iconSizePercent||100,...this.getCameraState()})}handleNavigationChange(){const e=c(this.kiosk);e&&this.setKiosk({...e,...this.getCameraState()})}}r([m({keepAlive:!0})],s.prototype,"kiosk",null),r([o],s.prototype,"setKiosk",null),r([m({keepAlive:!0})],s.prototype,"renderer",null),r([d],s.prototype,"savedKiosk",void 0),r([m({keepAlive:!0})],s.prototype,"hasUnsavedChanges",null),r([d],s.prototype,"statusMessages",void 0),r([o],s.prototype,"addStatusMessage",null),r([o],s.prototype,"clearStatusMessages",null),r([o],s.prototype,"startCleanupMessages",null),r([o],s.prototype,"resetCamera",null),r([o],s.prototype,"restoreData",null),r([o],s.prototype,"handleSetupReady",null),r([o],s.prototype,"handleClose",null),r([o],s.prototype,"handleDelete",null),r([o],s.prototype,"handleSave",null),r([o],s.prototype,"handleChange",null),r([o],s.prototype,"setInitialPtScale",null),r([o],s.prototype,"handleClick",null),r([o],s.prototype,"handleNavigationChange",null);export default new s;
1
+ import{__decorate as r}from"tslib";import{action as o,computed as m,observable as d,toJS as c,when as k}from"mobx";import a from"../../store";import{areLayersEnabled as S}from"../../utils/areLayersEnabled";import{t as h}from"../../utils/i18n";import{isPointVisible as g}from"../Map/visibleArea";import{getPtScaleZoomRatio as f,toFiniteNumber as u}from"./kiosk-record";import{updateKiosk as C}from"./kioskApi";import{getSavedKiosk as y,removeKiosk as M,saveKiosk as K}from"./SetKiosk";const v=2e4;class s{constructor(){this.savedKiosk=null,this.statusMessages=[],this.statusMessageTimer=0,this.isResettingCamera=!1}get kiosk(){return a.uiState.kioskData}setKiosk(e){a.uiState.setKioskData(e)}get renderer(){return a.rendererService.renderer}getCameraState(){if(a.maplibreStore.showMaplibre){const t=a.maplibreStore.cameraPort?.getCameraState();return t?{mapCenterLng:t.lng,mapCenterLat:t.lat,mapZoom:t.zoom,mapBearingDegrees:t.bearing,mapPitchDegrees:t.pitch}:{}}const e=a.rendererService.getCameraState();return e?{mapInitialPtScale:this.initialPtScale,mapPtScale:e.ptScale,mapCenterX:e.center.x,mapCenterY:e.center.y,mapRollDegrees:e.roll,mapPitch:e.pitch}:{}}get hasUnsavedChanges(){const e=this.savedKiosk,t=c(this.kiosk);if(!t||!e)return!!t!=!!e;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!0;for(const l of n)if(!(l in t)||e[l]!==t[l])return!0;return!1}addStatusMessage(e){this.statusMessages=[{...e,id:Date.now()}],this.startCleanupMessages()}clearStatusMessages(){this.statusMessages=[]}startCleanupMessages(){clearTimeout(this.statusMessageTimer),this.statusMessageTimer=window.setTimeout(()=>this.clearStatusMessages(),1e3)}async resetCamera(){if(!this.isResettingCamera){this.isResettingCamera=!0;try{if(a.maplibreStore.showMaplibre&&await this.resetMaplibreCamera())return;await this.resetRendererCamera()}finally{this.isResettingCamera=!1}}}async resetMaplibreCamera(){const e=await this.waitForMaplibreCameraPort();if(!e)return!1;const t=this.kiosk;t?.z!=null&&a.fp.activateFloor({name:String(t.z)});const n=u(t?.mapCenterLng),i=u(t?.mapCenterLat),l=u(t?.mapZoom);return n===void 0||i===void 0||l===void 0?(e.resetPitch(),a.uiState.fitBounds(),!0):(e.applyCameraState({lng:n,lat:i,zoom:l,bearing:u(t?.mapBearingDegrees),pitch:u(t?.mapPitchDegrees)}),!0)}async waitForMaplibreCameraPort(){const{maplibreStore:e}=a;if(e.cameraPort)return e.cameraPort;try{await k(()=>!!e.cameraPort||!e.showMaplibre,{timeout:v})}catch{return null}return e.cameraPort}async resetRendererCamera(){const e=this.renderer;if(!e)return;const t=this.kiosk;await e.controls.resetCamera({pan:!0,zoom:!0,roll:!0,pitch:!0},!0),t?.z!=null&&a.fp.activateFloor({name:String(t.z)});const n=f(t);n!==void 0&&await e.controls.zoomBy(n,!0);const i=u(t?.mapCenterX),l=u(t?.mapCenterY);i!==void 0&&l!==void 0&&await e.controls.panTo(i,l,!0);const p=u(t?.mapRollDegrees);p!==void 0&&await e.controls.rollTo(p,!0)}restoreData(){const e=y();e&&(this.setKiosk(e),this.savedKiosk=e,a.uiState.kiosk=!0)}handleSetupReady(){this.restoreData(),a.uiState.kiosk=!0,a.uiState.hideFreeOrDemo=!0,a.uiState.setForceDim(!0),a.searchStore.setSearchText(""),a.searchStore.setFocused(!1),this.resetCamera()}handleClose(){this.setKiosk(null),a.uiState.setForceDim(!1),a.uiState.enableSetKioskMode(!1),a.searchStore.closeSearch()}handleDelete(){M(),this.setKiosk(null),a.uiState.resetMapSettings(),a.uiState.resetUIScale(),this.addStatusMessage({variant:"success",title:h("Deleted")})}handleSave(){const e=this.renderer;if(!e)return;const t=c(this.kiosk);if(!t)return;const n=this.getCameraState(),i={...t,...n};if(!g(e,i)){this.addStatusMessage({variant:"error",title:h("Kiosk not visible")});return}this.setKiosk(i),K(i),C(i,"https://app.expofp.com/"),a.uiState.setUIScale(i.uiScale,!0),this.addStatusMessage({variant:"success",title:h("Saved")}),this.savedKiosk=i}delayChange(e){requestAnimationFrame(()=>e?.())}handleChange(e){const t=c(this.kiosk);t&&(Number.isFinite(e.angle)&&this.setKiosk({...t,heading:e.angle}),Number.isFinite(e.scale)&&(this.setKiosk({...t,uiScale:e.scale}),this.delayChange(()=>a.uiState.setUIScale(e.scale,!1))),Number.isFinite(e.percent)&&this.setKiosk({...t,iconSizePercent:e.percent}))}setInitialPtScale(e){if(this.initialPtScale)return;this.initialPtScale=e;const t=c(this.kiosk);t&&this.setKiosk({...t,mapInitialPtScale:e})}handleClick(e){const t=c(this.kiosk),n=a.fp.getFloors(),i=S()?n.find(p=>p.active)?.name??null:null,l=a.uiState.uiScale;this.setKiosk({...t,x:e.x,y:e.y,z:i,uiScale:t?.uiScale||l,heading:t?.heading||0,iconSizePercent:t?.iconSizePercent||100,...this.getCameraState()})}handleNavigationChange(){const e=c(this.kiosk);e&&this.setKiosk({...e,...this.getCameraState()})}}r([m({keepAlive:!0})],s.prototype,"kiosk",null),r([o],s.prototype,"setKiosk",null),r([m({keepAlive:!0})],s.prototype,"renderer",null),r([d],s.prototype,"savedKiosk",void 0),r([m({keepAlive:!0})],s.prototype,"hasUnsavedChanges",null),r([d],s.prototype,"statusMessages",void 0),r([o],s.prototype,"addStatusMessage",null),r([o],s.prototype,"clearStatusMessages",null),r([o],s.prototype,"startCleanupMessages",null),r([o],s.prototype,"resetCamera",null),r([o],s.prototype,"restoreData",null),r([o],s.prototype,"handleSetupReady",null),r([o],s.prototype,"handleClose",null),r([o],s.prototype,"handleDelete",null),r([o],s.prototype,"handleSave",null),r([o],s.prototype,"handleChange",null),r([o],s.prototype,"setInitialPtScale",null),r([o],s.prototype,"handleClick",null),r([o],s.prototype,"handleNavigationChange",null);export default new s;
@@ -3,6 +3,6 @@ import { type Kiosk } from './SetKiosk';
3
3
  declare const ANCHOR_KEYS: readonly ['x', 'y', 'z'];
4
4
  type KioskAnchor = Partial<Pick<Kiosk, (typeof ANCHOR_KEYS)[number]>>;
5
5
  export declare function collectKioskUrlParams(searchParams: URLSearchParams): KioskAnchor;
6
- export declare function setKioskUrlParams(searchParams: URLSearchParams, kioskData: KioskAnchor): void;
6
+ export declare function setKioskUrlParams(searchParams: URLSearchParams, kioskData: KioskAnchor | null | undefined): void;
7
7
  export {};
8
8
  //# sourceMappingURL=kioskUrlParam.d.ts.map
@@ -1 +1 @@
1
- import{Fragment as ne,jsx as k,jsxs as U}from"react/jsx-runtime";import{Box as L}from"@expofp/geometry";import{Draggable as ie}from"@expofp/ui";import ae from"classnames";import se from"color";import{observable as le,reaction as me}from"mobx";import{useObserver as ce}from"mobx-react-lite";import{useEffect as fe,useMemo as de,useRef as x,useState as ue}from"react";import{DEBUG_STORAGE_KEY as Z}from"../../constants";import pe from"../../data";import{fpGeo as he}from"../../data/fpGeo";import{svgArea as j}from"../../data/svg";import{boxToRenderer as B,createSceneDef as ve,mapRollSetting as A}from"../../renderer";import{pickDefaultScene as $,pickDefaultScenePoint as ye}from"../../renderer/engine-core/defs";import i,{boothStore as ge,layersStore as v,uiState as o}from"../../store";import{BoothBase as K}from"../../store/BoothStore";import{Category as be}from"../../store/CategoryStore";import{Exhibitor as V}from"../../store/ExhibitorStore";import{LayerMode as R}from"../../store/LayerStore";import{Route as Se}from"../../store/RouteStore";import E from"../../tools/logger";import h from"../../tools/settings";import{areLayersEnabled as we}from"../../utils/areLayersEnabled";import{parseNumberPair as W}from"../../utils/camera-map-settings";import{applyVenueDimValue as xe,createDimmingAnimator as Re}from"../../utils/dimming";import{convertGpsToLocal as Te}from"../../utils/gps";import y from"../../utils/is-debug";import{isPathwayLayer as H}from"../../utils/is-pathway-layer";import{useReaction as u}from"../../utils/mobx";import{createWayfinding as Ce}from"../../wayfinding";import q from"./booth-by-xy";import ke from"./drawing/config/config-all";import{configMarkers as Le,getMarkerFromClick as Be}from"./drawing/config/config-markers";import{loadLayersImages as Ee}from"./drawing/config/loadBoothsImages";import{useBuildRoute as Me}from"./traffic/useBuildRoute";import{useManageTraffic as Pe}from"./traffic/useManageTraffic";const M=Number.isFinite(h.maxZoom)?h.maxZoom:void 0,ze=M!==void 0;export default function Ie(){let P={};const J="#ebebeb",g=x(null),b=de(()=>le({moving:!1,prevLevel:i.layerStore.layers.find(e=>!e.frozen&&e.visible)}),[]),a=i.rendererService,T=x(Re(e=>xe(a,e)));let l;const S=x(null),z=x(null);let I=null,_=null,D=null,F=!1;function G(){v.layers.forEach(e=>{e.configured=!1,e.children=[],e.loaded=!1})}const[Q,Y]=ue(()=>typeof window<"u"&&window.localStorage?localStorage.getItem(Z)!=="false":!0);u(()=>i.routeStore.currentRouteLayer,()=>{if(!a.scene||b.prevLevel===i.routeStore.currentRouteLayer)return;const e=a.scene.rootLayer.children.filter(r=>i.layerStore.floors.some(t=>r.name.includes(t.name))),n=i.routeStore.currentRouteLayer.name;if(!e.find(r=>r.name===n))return;const s=e?.map(r=>(r.name===n&&(r.hidden=!1),r.name===b.prevLevel?.name&&(r.hidden=!0),r));b.prevLevel=i.routeStore.currentRouteLayer,a.update(...s)}),u(()=>o.centerMap,()=>{!o.centerMap||i.maplibreStore.showMaplibre||(l.controls.resetCamera({zoom:!!(o.list.type==="search"&&o.list.text)}),o.centerMap=!1)}),fe(()=>{if(!g.current)return;async function e(){const n=g.current;if(!n)return;G(),v.layersLoaded=!1;let s={};try{if(y){const t=document.createElement("canvas").getContext("webgl2"),m=t&&t.getExtension("EXT_disjoint_timer_query_webgl2"),f=(await import("stats-gl")).default,c=new f({trackGPU:m,horizontal:!0}),p=z.current;if(!p)throw new Error("memoryInfoPanel not found.");c.dom.style.position="relative",p.style.width=`${90*(m?3:2)}px`,p.style.height="48px",p.appendChild(c.dom),s={stats:c,memoryInfoPanel:p}}}catch(r){console.error(r)}l=a.create({canvas:n,ui:s}),S.current=l,me(()=>o.canvasVisibleRectPx,(r,t)=>{r&&(l.visibleRect=B(r)),t.dispose()},{fireImmediately:!0}),ke(a).then(({layers:r,cleanup:t})=>{if(F||S.current!==l){t();return}D=t,y&&console.log("Renderer settings",l);const m=se(h.backgroundColor==="none"?J:h.backgroundColor).string();P=ve(r,j,m),a.start(P),T.current.setTarget(o.dimmed,{immediate:!0}),A(l,i.fp.enableRotation?1:0),M!==void 0&&l.viewport.setMaxZoom(M),v.layersLoaded=!0,i.fp.onFpConfigured&&i.fp?.onFpConfigured(),I=Ce(a,i),_=Le(a),Ee(a)}),l.events.addEventListener("pointer:move",({data:r})=>{if(o.setKioskModeEnabled)return;const{point:t,defs:m}=$(r),d=q(t.x,t.y),f=N(m[0]);o.hoveredBooth=d||f}),l.events.addEventListener("pointer:out",()=>{o.setKioskModeEnabled||(o.hoveredBooth=null)}),l.events.addEventListener("pointer:click",({data:r})=>{if(!o?.rootElement)return;window.__resett&&window.__resett(),o.overlayPosition==="bottom"&&o.overlaySize==="full"&&i.showMap();const{point:t,defs:m}=$(r),{x:d,y:f}=t;if(o.onGetCoordsClick){const w=i.layerStore.layers.find(C=>C.visible&&(C.mode===R.TurnedOn||C.mode===R.TurnedOff));o.onGetCoordsClick({x:d,y:f,z:w?.name||null})}if(o.setKioskModeEnabled)return;if(o.onMarkerClick){const w=Be(d,f,a.scale);y&&console.log("marker",w),o.onMarkerClick(w)}const c=q(t.x,t.y),p=N(m[0]);y&&console.log("boothIdFromClientXy",c,"boothByShape",p,"pointer:click point",t),i.clickBooth(c||p)}),l.events.addEventListener("navigation:change",()=>window.__resett&&window.__resett())}return e(),i.fp.getCenterCoordinates=oe,()=>ee()},[]);function ee(){F=!0,T.current.stop(),I?.(),_?.(),D?.(),G(),v.layersLoaded=!1,a.disposeIfCurrent(S.current),S.current=null}function oe(){const e=g.current;if(!e)throw new Error("Canvas not ready");const n=ye(l.viewport.canvasToSvg({x:e.clientWidth/2,y:e.clientHeight/2})),r=i.layerStore.visible.find(t=>t.mode===R.TurnedOff||t.mode===R.TurnedOn)?.name||null;return{...n,z:r}}function N(e){return!e||!e.shape?null:ge.booths.find(n=>n.shapes?.find(s=>s.shape==e.shape))??null}u(()=>o.zoomBy,()=>{if(!o.zoomBy||i.maplibreStore.showMaplibre)return;const e=o.zoomBy;l.controls.zoomBy(e),o.zoomBy=null}),u(()=>o.dimmed,e=>{T.current.setTarget(e)}),u(()=>o.details,()=>{if(!o.onDetails)return;if(!o.details){o.onDetails(null);return}let e=o.details;if(h.EXPO==="wineparis"&&(e instanceof V&&(e=e.booths[0]),!e))return;let n=null,s=[];e instanceof V?(n="exhibitor",s=e.booths.map(t=>t.name).sort((t,m)=>t==i.routeStore.tempToBooth?.name?-1:m==i.routeStore.tempToBooth?.name?1:0)):e instanceof K?(n="booth",s=[e.name]):e instanceof Se?(n="route",s=[e.from?.name,e.to?.name].filter(t=>!!t)):e instanceof be&&(n="category",s=e.exhibitors.map(t=>t.booths.map(m=>m.name)).flat());const r={type:n,name:e?.name,id:e?.id,externalId:e?.externalId,boothsNames:s};o.onDetails({...r,...n==="route"?{routeInfo:i.routeStore.routeInfo??void 0}:{}})}),u(()=>o.canvasVisibleRectPx,e=>{a.renderer&&(a.renderer.visibleRect=B(e))},{fireImmediately:!0}),u(()=>o.moveToRect,()=>{!o.moveToRect||i.maplibreStore.showMaplibre||(o.moveToRect&&o.moveToRect.size.height!==1/0&&o.moveToRect.size.width!==1/0&&o.moveToRect.size.height>0&&o.moveToRect.size.width>0&&X(o.moveToRect,o.moveToRectPaddingPercent),o.moveToRect=null,o.moveToRectPaddingPercent=null)}),u(()=>o.rollReset,e=>{e&&(l.controls.resetCamera({roll:!0}),o.rollReset=!1)}),u(()=>o.moveToBooths,()=>{if(E.log("this.moveToBooths",o.moveToBooths),!o.moveToBooths||i.maplibreStore.showMaplibre)return;E.log("watched moveToBooths",o.moveToBooths);const e=o.moveToBooths.filter(n=>n.rect).map(n=>n.rect);e.length!==0&&(X(L.fromUnion(...e)),o.moveToBooths=null)}),u(()=>o.mapSettings,({zoomtime:e,center:n,centerxy:s,bearing:r,roll:t,z:m})=>{if(!(i.maplibreStore.showMaplibre||!a.renderer))try{e&&e!==o.defaultMapSettings.zoomtime&&a.renderer.controls.configure({zoomTime:e/1e3}),i.fp.enableRotation&&A(l,t??0);let d;if(n){const f=W(n),c=he?.properties.config;if(!c)throw new Error("Map center given in GPS, but the plan has no GPS config");f&&(d=Te({lat:f[0],lng:f[1]},c)??void 0)}else if(s){const f=W(s);f&&(d={x:f[0],y:f[1]})}m&&i.fp.activateFloor({name:m}),d&&a.renderer.controls.panTo(d.x,d.y),typeof r=="number"&&Number.isFinite(r)&&a.renderer.controls.rollTo(r)}catch(d){E.error("Error in mapSettings reaction",d)}}),Me({enabled:v.layersLoaded&&o.buildRoute,rendererService:a});const O="routes-api.expofp.com",te=pe.busRoutes??!1;Pe({permission:v.layersLoaded&&te,rendererService:a,dataJsonUrl:`https://${O}/v1/routes?expo=${h.EXPO}`,websocketUrl:`wss://${O}/locations?expo=${h.EXPO}`}),u(()=>i.layerStore.visible,e=>{if(!a.scene)return;const n=e.filter(t=>H(t.name)),r=a.scene.rootLayer.children.filter(t=>H(t.name));r.forEach(t=>{t.hidden=!n.find(m=>m.name===t.name)}),a.update(...r)});function X(e,n){let s=e;const r=n??re(e,j),t=o.selectedRoute?.from,m=t instanceof K?t.layer?.name:t?.layer;o.kioskData&&(!we()||m===i.routeStore.currentRouteLayer?.name)&&(s=L.fromUnion(e,new L(o.kioskData.x,o.kioskData.y,1,1)));const d=B(s),f={paddingPercent:r,maxZoom:ze?void 0:10},c=l.visibleRect;if(o.shouldShiftMapRect&&c){c.min={...c.min,x:c.min.x+o.overlayWidthPx},l.visibleRect=c;try{l.controls.zoomTo(d,f)}finally{c.min={...c.min,x:c.min.x-o.overlayWidthPx}}}else l.controls.zoomTo(d,f)}function re(e,n){return!e||!n?0:(e.area/n.area>.1?15:25)/100}return ce(()=>U(ne,{children:[k("canvas",{style:{width:"100%",height:"100%"},ref:g,className:ae({map:!0,moving:b.moving,hidden:i.maplibreStore.showMaplibre}),children:"ExpoFP.com"}),y&&Q&&U(ie,{className:"debug-fps",children:[k("div",{ref:z}),k("button",{onClick:()=>{typeof window<"u"&&window.localStorage&&localStorage.setItem(Z,"false"),Y(!1)},style:{padding:"4px 8px",fontSize:"11px",cursor:"pointer",backgroundColor:"#333",color:"#fff",border:"1px solid #555",width:"100%"},children:"Hide debug"})]})]}))}
1
+ import{Fragment as ne,jsx as k,jsxs as U}from"react/jsx-runtime";import{Box as L}from"@expofp/geometry";import{Draggable as ie}from"@expofp/ui";import ae from"classnames";import se from"color";import{observable as le,reaction as me}from"mobx";import{useObserver as ce}from"mobx-react-lite";import{useEffect as fe,useMemo as de,useRef as x,useState as ue}from"react";import{DEBUG_STORAGE_KEY as Z}from"../../constants";import pe from"../../data";import{fpGeo as he}from"../../data/fpGeo";import{svgArea as j}from"../../data/svg";import{boxToRenderer as B,createSceneDef as ve,mapRollSetting as A}from"../../renderer";import{pickDefaultScene as $,pickDefaultScenePoint as ye}from"../../renderer/engine-core/defs";import n,{boothStore as ge,layersStore as v,uiState as o}from"../../store";import{BoothBase as K}from"../../store/BoothStore";import{Category as be}from"../../store/CategoryStore";import{Exhibitor as V}from"../../store/ExhibitorStore";import{LayerMode as R}from"../../store/LayerStore";import{Route as we}from"../../store/RouteStore";import E from"../../tools/logger";import h from"../../tools/settings";import{areLayersEnabled as Se}from"../../utils/areLayersEnabled";import{parseNumberPair as W}from"../../utils/camera-map-settings";import{applyVenueDimValue as xe,createDimmingAnimator as Re}from"../../utils/dimming";import{convertGpsToLocal as Te}from"../../utils/gps";import y from"../../utils/is-debug";import{isPathwayLayer as H}from"../../utils/is-pathway-layer";import{useReaction as u}from"../../utils/mobx";import{createWayfinding as Ce}from"../../wayfinding";import q from"./booth-by-xy";import ke from"./drawing/config/config-all";import{configMarkers as Le,getMarkerFromClick as Be}from"./drawing/config/config-markers";import{loadLayersImages as Ee}from"./drawing/config/loadBoothsImages";import{useBuildRoute as Me}from"./traffic/useBuildRoute";import{useManageTraffic as Pe}from"./traffic/useManageTraffic";const M=Number.isFinite(h.maxZoom)?h.maxZoom:void 0,ze=M!==void 0;export default function Ie(){let P={};const J="#ebebeb",g=x(null),b=de(()=>le({moving:!1,prevLevel:n.layerStore.layers.find(e=>!e.frozen&&e.visible)}),[]),a=n.rendererService,T=x(Re(e=>xe(a,e)));let m;const w=x(null),z=x(null);let I=null,_=null,D=null,F=!1;function G(){v.layers.forEach(e=>{e.configured=!1,e.children=[],e.loaded=!1})}const[Q,Y]=ue(()=>typeof window<"u"&&window.localStorage?localStorage.getItem(Z)!=="false":!0);u(()=>n.routeStore.currentRouteLayer,()=>{const e=n.routeStore.currentRouteLayer;if(!a.scene||!e||b.prevLevel===e)return;const r=a.scene.rootLayer.children.filter(t=>n.layerStore.floors.some(l=>t.name.includes(l.name))),s=e.name;if(!r.find(t=>t.name===s))return;const i=r?.map(t=>(t.name===s&&(t.hidden=!1),t.name===b.prevLevel?.name&&(t.hidden=!0),t));b.prevLevel=e,a.update(...i)}),u(()=>o.centerMap,()=>{!o.centerMap||n.maplibreStore.showMaplibre||(m.controls.resetCamera({zoom:!!(o.list.type==="search"&&o.list.text)}),o.centerMap=!1)}),fe(()=>{if(!g.current)return;async function e(){const r=g.current;if(!r)return;G(),v.layersLoaded=!1;let s={};try{if(y){const t=document.createElement("canvas").getContext("webgl2"),l=t&&t.getExtension("EXT_disjoint_timer_query_webgl2"),f=(await import("stats-gl")).default,c=new f({trackGPU:l,horizontal:!0}),p=z.current;if(!p)throw new Error("memoryInfoPanel not found.");c.dom.style.position="relative",p.style.width=`${90*(l?3:2)}px`,p.style.height="48px",p.appendChild(c.dom),s={stats:c,memoryInfoPanel:p}}}catch(i){console.error(i)}m=a.create({canvas:r,ui:s}),w.current=m,me(()=>o.canvasVisibleRectPx,(i,t)=>{i&&(m.visibleRect=B(i)),t.dispose()},{fireImmediately:!0}),ke(a).then(({layers:i,cleanup:t})=>{if(F||w.current!==m){t();return}D=t,y&&console.log("Renderer settings",m);const l=se(h.backgroundColor==="none"?J:h.backgroundColor).string();P=ve(i,j,l),a.start(P),T.current.setTarget(o.dimmed,{immediate:!0}),A(m,n.fp.enableRotation?1:0),M!==void 0&&m.viewport.setMaxZoom(M),v.layersLoaded=!0,n.fp.onFpConfigured&&n.fp?.onFpConfigured(),I=Ce(a,n),_=Le(a),Ee(a)}),m.events.addEventListener("pointer:move",({data:i})=>{if(o.setKioskModeEnabled)return;const{point:t,defs:l}=$(i),d=q(t.x,t.y),f=N(l[0]);o.hoveredBooth=d||f}),m.events.addEventListener("pointer:out",()=>{o.setKioskModeEnabled||(o.hoveredBooth=null)}),m.events.addEventListener("pointer:click",({data:i})=>{if(!o?.rootElement)return;window.__resett&&window.__resett(),o.overlayPosition==="bottom"&&o.overlaySize==="full"&&n.showMap();const{point:t,defs:l}=$(i),{x:d,y:f}=t;if(o.onGetCoordsClick){const S=n.layerStore.layers.find(C=>C.visible&&(C.mode===R.TurnedOn||C.mode===R.TurnedOff));o.onGetCoordsClick({x:d,y:f,z:S?.name||null})}if(o.setKioskModeEnabled)return;if(o.onMarkerClick){const S=Be(d,f,a.scale);y&&console.log("marker",S),o.onMarkerClick(S)}const c=q(t.x,t.y),p=N(l[0]);y&&console.log("boothIdFromClientXy",c,"boothByShape",p,"pointer:click point",t),n.clickBooth(c||p)}),m.events.addEventListener("navigation:change",()=>window.__resett&&window.__resett())}return e(),n.fp.getCenterCoordinates=oe,()=>ee()},[]);function ee(){F=!0,T.current.stop(),I?.(),_?.(),D?.(),G(),v.layersLoaded=!1,a.disposeIfCurrent(w.current),w.current=null}function oe(){const e=g.current;if(!e)throw new Error("Canvas not ready");const r=ye(m.viewport.canvasToSvg({x:e.clientWidth/2,y:e.clientHeight/2})),i=n.layerStore.visible.find(t=>t.mode===R.TurnedOff||t.mode===R.TurnedOn)?.name||null;return{...r,z:i}}function N(e){return!e||!e.shape?null:ge.booths.find(r=>r.shapes?.find(s=>s.shape==e.shape))??null}u(()=>o.zoomBy,()=>{if(!o.zoomBy||n.maplibreStore.showMaplibre)return;const e=o.zoomBy;m.controls.zoomBy(e),o.zoomBy=null}),u(()=>o.dimmed,e=>{T.current.setTarget(e)}),u(()=>o.details,()=>{if(!o.onDetails)return;if(!o.details){o.onDetails(null);return}let e=o.details;if(h.EXPO==="wineparis"&&(e instanceof V&&(e=e.booths[0]),!e))return;let r=null,s=[];e instanceof V?(r="exhibitor",s=e.booths.map(t=>t.name).sort((t,l)=>t==n.routeStore.tempToBooth?.name?-1:l==n.routeStore.tempToBooth?.name?1:0)):e instanceof K?(r="booth",s=[e.name]):e instanceof we?(r="route",s=[e.from?.name,e.to?.name].filter(t=>!!t)):e instanceof be&&(r="category",s=e.exhibitors.map(t=>t.booths.map(l=>l.name)).flat());const i={type:r,name:e?.name,id:e?.id,externalId:e?.externalId,boothsNames:s};o.onDetails({...i,...r==="route"?{routeInfo:n.routeStore.routeInfo??void 0}:{}})}),u(()=>o.canvasVisibleRectPx,e=>{a.renderer&&(a.renderer.visibleRect=B(e))},{fireImmediately:!0}),u(()=>o.moveToRect,()=>{!o.moveToRect||n.maplibreStore.showMaplibre||(o.moveToRect&&o.moveToRect.size.height!==1/0&&o.moveToRect.size.width!==1/0&&o.moveToRect.size.height>0&&o.moveToRect.size.width>0&&X(o.moveToRect,o.moveToRectPaddingPercent),o.moveToRect=null,o.moveToRectPaddingPercent=null)}),u(()=>o.rollReset,e=>{e&&(m.controls.resetCamera({roll:!0}),o.rollReset=!1)}),u(()=>o.moveToBooths,()=>{if(E.log("this.moveToBooths",o.moveToBooths),!o.moveToBooths||n.maplibreStore.showMaplibre)return;E.log("watched moveToBooths",o.moveToBooths);const e=o.moveToBooths.filter(r=>r.rect).map(r=>r.rect);e.length!==0&&(X(L.fromUnion(...e)),o.moveToBooths=null)}),u(()=>o.mapSettings,({zoomtime:e,center:r,centerxy:s,bearing:i,roll:t,z:l})=>{if(!(n.maplibreStore.showMaplibre||!a.renderer))try{e&&e!==o.defaultMapSettings.zoomtime&&a.renderer.controls.configure({zoomTime:e/1e3}),n.fp.enableRotation&&A(m,t??0);let d;if(r){const f=W(r),c=he?.properties.config;if(!c)throw new Error("Map center given in GPS, but the plan has no GPS config");f&&(d=Te({lat:f[0],lng:f[1]},c)??void 0)}else if(s){const f=W(s);f&&(d={x:f[0],y:f[1]})}l&&n.fp.activateFloor({name:l}),d&&a.renderer.controls.panTo(d.x,d.y),typeof i=="number"&&Number.isFinite(i)&&a.renderer.controls.rollTo(i)}catch(d){E.error("Error in mapSettings reaction",d)}}),Me({enabled:v.layersLoaded&&o.buildRoute,rendererService:a});const O="routes-api.expofp.com",te=pe.busRoutes??!1;Pe({permission:v.layersLoaded&&te,rendererService:a,dataJsonUrl:`https://${O}/v1/routes?expo=${h.EXPO}`,websocketUrl:`wss://${O}/locations?expo=${h.EXPO}`}),u(()=>n.layerStore.visible,e=>{if(!a.scene)return;const r=e.filter(t=>H(t.name)),i=a.scene.rootLayer.children.filter(t=>H(t.name));i.forEach(t=>{t.hidden=!r.find(l=>l.name===t.name)}),a.update(...i)});function X(e,r){let s=e;const i=r??re(e,j),t=o.selectedRoute?.from,l=t instanceof K?t.layer?.name:t?.layer;o.kioskData&&(!Se()||l===n.routeStore.currentRouteLayer?.name)&&(s=L.fromUnion(e,new L(o.kioskData.x,o.kioskData.y,1,1)));const d=B(s),f={paddingPercent:i,maxZoom:ze?void 0:10},c=m.visibleRect;if(o.shouldShiftMapRect&&c){c.min={...c.min,x:c.min.x+o.overlayWidthPx},m.visibleRect=c;try{m.controls.zoomTo(d,f)}finally{c.min={...c.min,x:c.min.x-o.overlayWidthPx}}}else m.controls.zoomTo(d,f)}function re(e,r){return!e||!r?0:(e.area/r.area>.1?15:25)/100}return ce(()=>U(ne,{children:[k("canvas",{style:{width:"100%",height:"100%"},ref:g,className:ae({map:!0,moving:b.moving,hidden:n.maplibreStore.showMaplibre}),children:"ExpoFP.com"}),y&&Q&&U(ie,{className:"debug-fps",children:[k("div",{ref:z}),k("button",{onClick:()=>{typeof window<"u"&&window.localStorage&&localStorage.setItem(Z,"false"),Y(!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{LngLatBounds as D,MercatorCoordinate as E}from"maplibre-gl";import{fpGeo as I}from"../../../data/fpGeo";import{svgArea as x}from"../../../data/svg";import{uiState as z}from"../../../store";import{convertLocalToGps as u}from"../../../utils/gps";import{planBearing as N}from"../../../utils/planBearing";export const MAP_BOUNDS_PADDING_FACTOR=3,MAP_BOUNDS_MIN_PADDING_DEGREES=.02,INITIAL_FIT_ZOOM_ADJUSTMENT=.15;const T=1.42,F=.35,S=.9,A=.85,P=8,B=.05;export function deriveVenueMapBounds(t){const n=[[x.min.x,x.min.y],[x.max.x,x.min.y],[x.max.x,x.max.y],[x.min.x,x.max.y]].map(([c,l])=>u(c,l,t));if(!n.every(([c,l])=>Number.isFinite(c)&&Number.isFinite(l)))return;const e=n.map(([c])=>c),o=n.map(([,c])=>c),i=Math.min(...e),r=Math.max(...e),s=Math.min(...o),a=Math.max(...o),m=Math.max((r-i)*MAP_BOUNDS_PADDING_FACTOR,MAP_BOUNDS_MIN_PADDING_DEGREES),h=Math.max((a-s)*MAP_BOUNDS_PADDING_FACTOR,MAP_BOUNDS_MIN_PADDING_DEGREES);return[[i-m,s-h],[r+m,a+h]]}function O(t,n,e,o){const i=Math.min(t.getZoom(),n),r=(e-i)*Math.min(1,o/T);return i+r>=t.getMinZoom()-B}function w(t,n,e){if(O(t,n,e,T))return T;if(!O(t,n,e,F))return null;let o=F,i=T;for(let r=0;r<P;r++){const s=(o+i)/2;O(t,n,e,s)?o=s:i=s}return o}export function getLocalRectGeoBounds(t,n){const e=[u(t.min.x,t.min.y,n),u(t.max.x,t.min.y,n),u(t.max.x,t.max.y,n),u(t.min.x,t.max.y,n)],o=e.map(([r])=>r),i=e.map(([,r])=>r);return[[Math.min(...o),Math.min(...i)],[Math.max(...o),Math.max(...i)]]}const R=512;export function cameraForLocalRect(t,n,e,o,i){const r=[u(t.min.x,t.min.y,n),u(t.max.x,t.min.y,n),u(t.max.x,t.max.y,n),u(t.min.x,t.max.y,n)].map(([M,p])=>E.fromLngLat({lng:M,lat:p}));if(!r.every(({x:M,y:p})=>Number.isFinite(M)&&Number.isFinite(p)))return null;const s=-e*Math.PI/180,a=Math.cos(s),m=Math.sin(s),h=r.map(({x:M,y:p})=>M*a-p*m),c=r.map(({x:M,y:p})=>M*m+p*a),l=Math.max(...h)-Math.min(...h),y=Math.max(...c)-Math.min(...c);if(l<=0||y<=0)return null;const b=o.width-i.left-i.right,f=o.height-i.top-i.bottom;if(b<=0||f<=0)return null;const d=Math.min(b/(l*R),f/(y*R));if(!(d>0))return null;const g=R*d,L=(Math.min(...h)+Math.max(...h))/2-(i.left-i.right)/2/g,_=(Math.min(...c)+Math.max(...c))/2-(i.top-i.bottom)/2/g,{lng:v,lat:C}=new E(L*a+_*m,-L*m+_*a).toLngLat();return{center:[v,C],zoom:Math.log2(d)}}function U(t,n){return{top:t.top+n.top,bottom:t.bottom+n.bottom,left:t.left+n.left,right:t.right+n.right}}export function getVisibleRectFitPadding(t=0){const n=z.canvasVisibleRectPx,e=z.screenSize;return!n||!e?{top:t,bottom:t,left:t,right:t}:{top:Math.max(0,n.min.y)+t,bottom:Math.max(0,e.height-n.max.y)+t,left:Math.max(0,n.min.x)+t,right:Math.max(0,e.width-n.max.x)+t}}export function isLngLatInVisibleViewport(t,n,e){const o=t.project(n),i=t.getCanvas();return o.x>=e.left&&o.x<=i.clientWidth-e.right&&o.y>=e.top&&o.y<=i.clientHeight-e.bottom}export function deriveGeoConfig(){if(!I?.properties?.config)return null;const t=I.properties.config,n=(t.p0.lng+t.p2.lng)/2,e=(t.p0.lat+t.p2.lat)/2,o=N(t.p0,t.p2),i=Number.isFinite(o)?o:t.bearing??0;return{center:[n,e],bearing:i,zoom:16,gpsConfig:t}}export function fitMapToLocalRect(t,n,e,o={}){if(!t||!n||!e||n.size.height===1/0||n.size.width===1/0||n.size.height<=0||n.size.width<=0)return;const i=getLocalRectGeoBounds(n,e.gpsConfig),r=t.getCanvas(),s=o.paddingPercent==null?getVisibleRectFitPadding(o.padding??50):U(getVisibleRectFitPadding(0),{top:r.clientHeight*o.paddingPercent,bottom:r.clientHeight*o.paddingPercent,left:r.clientWidth*o.paddingPercent,right:r.clientWidth*o.paddingPercent}),a=cameraForLocalRect(n,e.gpsConfig,e.bearing,{width:r.clientWidth,height:r.clientHeight},s);if(!a){t.fitBounds(i,{padding:s,bearing:e.bearing,essential:!0});return}const m=t.project(t.getCenter()),h=t.project(a.center),c=Math.max(t.getCanvas().clientWidth,t.getCanvas().clientHeight,1),l=Math.hypot(h.x-m.x,h.y-m.y)/c,y=Math.abs(t.getZoom()-a.zoom),b=o.duration??Math.min(2800,500+l*450+y*150),f={center:a.center,zoom:a.zoom,bearing:e.bearing,duration:b,essential:!0};if(l<=1.2&&y<=1.5){t.easeTo(f);return}const d=t.getBounds().extend(D.convert(i)),g=t.cameraForBounds(d,{padding:s,bearing:e.bearing});if(!g?.center||typeof g.zoom!="number"||g.zoom>=t.getZoom()-.2){t.easeTo(f);return}const L=w(t,a.zoom,g.zoom);if(L!==null){const _=Math.max(F,L*S),v=Math.round(b*A);t.flyTo({...f,curve:_,duration:v});return}t.easeTo(f)}
1
+ import{LngLatBounds as D,MercatorCoordinate as E}from"maplibre-gl";import{fpGeo as I}from"../../../data/fpGeo";import{svgArea as x}from"../../../data/svg";import{uiState as z}from"../../../store";import{convertLocalToGps as u}from"../../../utils/gps";import{planBearing as N}from"../../../utils/planBearing";export const MAP_BOUNDS_PADDING_FACTOR=3,MAP_BOUNDS_MIN_PADDING_DEGREES=.02,INITIAL_FIT_ZOOM_ADJUSTMENT=.15;const T=1.42,F=.35,S=.9,A=.85,P=8,B=.05;export function deriveVenueMapBounds(t){const n=[[x.min.x,x.min.y],[x.max.x,x.min.y],[x.max.x,x.max.y],[x.min.x,x.max.y]].map(([c,l])=>u(c,l,t));if(!n.every(([c,l])=>Number.isFinite(c)&&Number.isFinite(l)))return;const e=n.map(([c])=>c),o=n.map(([,c])=>c),i=Math.min(...e),r=Math.max(...e),s=Math.min(...o),a=Math.max(...o),m=Math.max((r-i)*MAP_BOUNDS_PADDING_FACTOR,MAP_BOUNDS_MIN_PADDING_DEGREES),h=Math.max((a-s)*MAP_BOUNDS_PADDING_FACTOR,MAP_BOUNDS_MIN_PADDING_DEGREES);return[[i-m,s-h],[r+m,a+h]]}function O(t,n,e,o){const i=Math.min(t.getZoom(),n),r=(e-i)*Math.min(1,o/T);return i+r>=t.getMinZoom()-B}function w(t,n,e){if(O(t,n,e,T))return T;if(!O(t,n,e,F))return null;let o=F,i=T;for(let r=0;r<P;r++){const s=(o+i)/2;O(t,n,e,s)?o=s:i=s}return o}export function getLocalRectGeoBounds(t,n){const e=[u(t.min.x,t.min.y,n),u(t.max.x,t.min.y,n),u(t.max.x,t.max.y,n),u(t.min.x,t.max.y,n)],o=e.map(([r])=>r),i=e.map(([,r])=>r);return[[Math.min(...o),Math.min(...i)],[Math.max(...o),Math.max(...i)]]}const R=512;export function cameraForLocalRect(t,n,e,o,i){const r=[u(t.min.x,t.min.y,n),u(t.max.x,t.min.y,n),u(t.max.x,t.max.y,n),u(t.min.x,t.max.y,n)].map(([M,p])=>E.fromLngLat({lng:M,lat:p}));if(!r.every(({x:M,y:p})=>Number.isFinite(M)&&Number.isFinite(p)))return null;const s=-e*Math.PI/180,a=Math.cos(s),m=Math.sin(s),h=r.map(({x:M,y:p})=>M*a-p*m),c=r.map(({x:M,y:p})=>M*m+p*a),l=Math.max(...h)-Math.min(...h),y=Math.max(...c)-Math.min(...c);if(l<=0||y<=0)return null;const b=o.width-i.left-i.right,f=o.height-i.top-i.bottom;if(b<=0||f<=0)return null;const d=Math.min(b/(l*R),f/(y*R));if(!(d>0))return null;const g=R*d,L=(Math.min(...h)+Math.max(...h))/2-(i.left-i.right)/2/g,_=(Math.min(...c)+Math.max(...c))/2-(i.top-i.bottom)/2/g,{lng:v,lat:C}=new E(L*a+_*m,-L*m+_*a).toLngLat();return{center:[v,C],zoom:Math.log2(d)}}function U(t,n){return{top:t.top+n.top,bottom:t.bottom+n.bottom,left:t.left+n.left,right:t.right+n.right}}export function getVisibleRectFitPadding(t=0){const n=z.canvasVisibleRectPx,e=z.screenSize;return n?{top:Math.max(0,n.min.y)+t,bottom:Math.max(0,e.height-n.max.y)+t,left:Math.max(0,n.min.x)+t,right:Math.max(0,e.width-n.max.x)+t}:{top:t,bottom:t,left:t,right:t}}export function isLngLatInVisibleViewport(t,n,e){const o=t.project(n),i=t.getCanvas();return o.x>=e.left&&o.x<=i.clientWidth-e.right&&o.y>=e.top&&o.y<=i.clientHeight-e.bottom}export function deriveGeoConfig(){if(!I?.properties?.config)return null;const t=I.properties.config,n=(t.p0.lng+t.p2.lng)/2,e=(t.p0.lat+t.p2.lat)/2,o=N(t.p0,t.p2),i=Number.isFinite(o)?o:t.bearing??0;return{center:[n,e],bearing:i,zoom:16,gpsConfig:t}}export function fitMapToLocalRect(t,n,e,o={}){if(!t||!n||!e||n.size.height===1/0||n.size.width===1/0||n.size.height<=0||n.size.width<=0)return;const i=getLocalRectGeoBounds(n,e.gpsConfig),r=t.getCanvas(),s=o.paddingPercent==null?getVisibleRectFitPadding(o.padding??50):U(getVisibleRectFitPadding(0),{top:r.clientHeight*o.paddingPercent,bottom:r.clientHeight*o.paddingPercent,left:r.clientWidth*o.paddingPercent,right:r.clientWidth*o.paddingPercent}),a=cameraForLocalRect(n,e.gpsConfig,e.bearing,{width:r.clientWidth,height:r.clientHeight},s);if(!a){t.fitBounds(i,{padding:s,bearing:e.bearing,essential:!0});return}const m=t.project(t.getCenter()),h=t.project(a.center),c=Math.max(t.getCanvas().clientWidth,t.getCanvas().clientHeight,1),l=Math.hypot(h.x-m.x,h.y-m.y)/c,y=Math.abs(t.getZoom()-a.zoom),b=o.duration??Math.min(2800,500+l*450+y*150),f={center:a.center,zoom:a.zoom,bearing:e.bearing,duration:b,essential:!0};if(l<=1.2&&y<=1.5){t.easeTo(f);return}const d=t.getBounds().extend(D.convert(i)),g=t.cameraForBounds(d,{padding:s,bearing:e.bearing});if(!g?.center||typeof g.zoom!="number"||g.zoom>=t.getZoom()-.2){t.easeTo(f);return}const L=w(t,a.zoom,g.zoom);if(L!==null){const _=Math.max(F,L*S),v=Math.round(b*A);t.flyTo({...f,curve:_,duration:v});return}t.easeTo(f)}
@@ -1 +1 @@
1
- import{jsx as o,jsxs as v}from"react/jsx-runtime";import{Overlay as y}from"@expofp/ui";import S from"classnames";import{observer as h}from"mobx-react-lite";import{useCallback as l,useMemo as a}from"react";import{overlayStore as m,uiState as e}from"../store";import{t as k}from"../utils/i18n";import C from"./Bookmarks";import g from"./Booth/Booth";import z from"./Category";import b from"./Event";import O from"./Exhibitor";import x from"./Filter";import M from"./Language";import P from"./Menu";import A from"./OverlayParticles";import w from"./RoutePlanner/RoutePlanner";import E from"./Search";import _ from"./Sessions";import j from"./Speaker";import F from"./Speakers";import R from"./TourPoints";import B from"./Tours";import I from"./Visited";import K from"./Wayfinding";const L={full:"full",medium:"medium",small:"medium"},N=t=>L[t],T=h(({isGDPR:t,consent:n})=>{const c=l(r=>{e.desiredOverlaySize=r},[]),d=l(r=>{e.setOverlayScrolled(r)},[]),p=N(e.overlaySize),f=a(()=>[e.list.type,e.details],[e.list.type,e.details]),u=a(()=>{const r={"-backdrop":e.canvasStarted&&e.shouldUseBackdrop&&!e.dimmed&&!e.galleryActive,"-no-transition":e.dimmed,"-gallery-active":e.galleryActive,collapsed:e.overlayCollapsed,kiosk:e.kiosk,start:e.overlayPosition==="left",bottom:e.overlayPosition!=="left",[e.overlaySize]:!0},i=S(r),s=e.overlayInterfaceClasses.join(" ");return s?`${i} ${s}`:i},[e.canvasStarted,e.shouldUseBackdrop,e.dimmed,e.galleryActive,e.overlayCollapsed,e.kiosk,e.inIdle,e.setKioskModeEnabled,e.overlayPosition,e.overlaySize,e.overlayInterfaceClasses]);return v(y,{open:e.isOverlayOpen,size:p,particles:e.isFeaturedExhibitorActive?o(A,{}):null,className:u,mediumSizeMultiplier:m.mediumSizeMultiplier,fullSizeOffset:m.fullSizeOffset,disableDrag:e.viewerMode&&e.menu,forceFull:e.viewerMode&&e.menu,scrollResetKey:f,noContentLabel:k("No content"),onChangeSize:c,onScrollStateChange:d,onScrollActivity:()=>window.__resett?.(),children:[o(P,{isGDPR:t,consent:n}),o(E,{}),o(O,{}),o(g,{}),o(C,{}),o(I,{}),o(M,{}),o(z,{}),o(K,{}),o(x,{}),o(_,{showFilters:!0}),o(F,{showFilters:!0}),o(B,{}),o(R,{}),o(w,{}),o(b,{}),o(j,{})]})});export default T;
1
+ import{jsx as o,jsxs as v}from"react/jsx-runtime";import{Overlay as y}from"@expofp/ui";import S from"classnames";import{observer as h}from"mobx-react-lite";import{useCallback as s,useMemo as a}from"react";import{overlayStore as m,uiState as e}from"../store";import{t as k}from"../utils/i18n";import z from"./Bookmarks";import C from"./Booth/Booth";import g from"./Category";import b from"./Event";import O from"./Exhibitor";import x from"./Filter";import M from"./Language";import P from"./Menu";import A from"./OverlayParticles";import w from"./RoutePlanner/RoutePlanner";import E from"./Search";import _ from"./Sessions";import j from"./Speaker";import F from"./Speakers";import R from"./TourPoints";import B from"./Tours";import I from"./Visited";import K from"./Wayfinding";const L={full:"full",medium:"medium",small:"medium"},N=t=>L[t],T=h(({isGDPR:t,consent:n})=>{const c=s(r=>{e.desiredOverlaySize=r},[]),d=s(r=>{e.setOverlayScrolled(r)},[]),p=e.overlaySize&&N(e.overlaySize),f=a(()=>[e.list.type,e.details],[e.list.type,e.details]),u=a(()=>{const r={"-backdrop":e.canvasStarted&&e.shouldUseBackdrop&&!e.dimmed&&!e.galleryActive,"-no-transition":e.dimmed,"-gallery-active":e.galleryActive,collapsed:e.overlayCollapsed,kiosk:e.kiosk,start:e.overlayPosition==="left",bottom:e.overlayPosition!=="left",...e.overlaySize&&{[e.overlaySize]:!0}},i=S(r),l=e.overlayInterfaceClasses.join(" ");return l?`${i} ${l}`:i},[e.canvasStarted,e.shouldUseBackdrop,e.dimmed,e.galleryActive,e.overlayCollapsed,e.kiosk,e.inIdle,e.setKioskModeEnabled,e.overlayPosition,e.overlaySize,e.overlayInterfaceClasses]);return v(y,{open:e.isOverlayOpen,size:p,particles:e.isFeaturedExhibitorActive?o(A,{}):null,className:u,mediumSizeMultiplier:m.mediumSizeMultiplier,fullSizeOffset:m.fullSizeOffset,disableDrag:e.viewerMode&&e.menu,forceFull:e.viewerMode&&e.menu,scrollResetKey:f,noContentLabel:k("No content"),onChangeSize:c,onScrollStateChange:d,onScrollActivity:()=>window.__resett?.(),children:[o(P,{isGDPR:t,consent:n}),o(E,{}),o(O,{}),o(C,{}),o(z,{}),o(I,{}),o(M,{}),o(g,{}),o(K,{}),o(x,{}),o(_,{showFilters:!0}),o(F,{showFilters:!0}),o(B,{}),o(R,{}),o(w,{}),o(b,{}),o(j,{})]})});export default T;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  export default _default;
2
- declare function _default(): false;
3
+ declare function _default(): false | React.JSX.Element | null;
3
4
  //# sourceMappingURL=TourPoints.d.ts.map
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  export default _default;
2
- declare function _default(): boolean;
3
+ declare function _default(): false | React.JSX.Element;
3
4
  //# sourceMappingURL=Visited.d.ts.map
@@ -33,7 +33,7 @@ export default class FloorPlanLoader implements FloorPlan {
33
33
  onVisitedClick: (e: FloorPlanVisitedClickEvent) => void;
34
34
  onCategoryClick: (e: FloorPlanCategory) => void;
35
35
  onFpConfigured: () => void;
36
- onDirection: (e: FloorPlanDirectionEvent) => void;
36
+ onDirection: (e: FloorPlanDirectionEvent | null) => void;
37
37
  onDetails: (e: FloorPlanDetailsEvent) => void;
38
38
  onExhibitorCustomButtonClick: (e: FloorPlanCustomButtonEvent) => void;
39
39
  onGetCoordsClick: (e: FloorPlanGetCoordsEvent) => void;
@@ -1 +1 @@
1
- import{Fragment as A,jsx as x,jsxs as T}from"react/jsx-runtime";import{Box as E}from"@expofp/geometry";import{CameraSchema as I}from"@expofp/schema";import{optimizeWaypointOrder as M}from"@expofp/wayfinding";import{ErrorBoundary as R}from"@sentry/react";import $ from"debug";import{reaction as V}from"mobx";import{createRoot as z}from"react-dom/client";import{install as j}from"resize-observer";import G from"./components/Layout";import{MAX_ROUTE_WAYPOINTS as d}from"./constants";import N from"./data";import{fpGeo as b}from"./data/fpGeo";import q from"./floorplan.loader";import{shouldLoadIntercom as O}from"./intercom";import{BoundsSchema as U,POISelectorsSchema as w,ZoomToOptionsSchema as P}from"./schemas/sdk.schemas";import{applyDeclarativeConfig as H,applyParameters as Y,applyPathway as _,initUrlRouting as D}from"./services/url-dispatch";import{destroyUrlSync as W}from"./services/url-sync";import r from"./store";import{destroyUiHandlers as X}from"./store/init/init-ui";import{findBooth as S,Route as v,separateExternalIds as B}from"./store/RouteStore";import{destroyGtag as K,GaEventActions as k,sendEventToGa as F,setConsentSettings as Q}from"./tools/gtag";import Z from"./tools/report-error";import{resetGlobalVariables as J}from"./tools/reset";import ee from"./tools/track-event";import{cameraToMapSettings as te,mapSettingsToCamera as re}from"./utils/camera-map-settings";import{getStorage as L}from"./utils/entity-storage";import{getMostFrequent as oe}from"./utils/getMostFrequent";import{convertLocalToGps as ie,isValidPointCoords as y}from"./utils/gps";import{getLocales as se,hasLocale as ne,setLocale as ae}from"./utils/i18n";import{mapEntity as g}from"./utils/mapEntity";const p=$("efp:api");j();export default class he extends q{init(){H(),this.ignoreQuery||D(this.offHistory),ee("load"),r.fp=this,Q(this.consent),F(k.Load,""),this.root=z(this.renderTarget),this.root.render(x(R,{children:x(G,{offHistory:this.offHistory,consent:this.consent})})),F(k.Rendered,""),V(()=>r.layerStore.layersLoaded,()=>{this.resolveReady(),r.initialized||this.onInit?.(this),r.initialized=!0});const e=O(N);e&&import("./intercom/bootIntercom").then(({bootIntercom:t})=>t(e)).catch(()=>{})}selectBooth(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectBooth","Parameter must be a string or an array of strings.","EFP000000");return}const t=r.boothStore.booths.filter(o=>typeof e=="string"?o.name===e||o.externalId===e:e.includes(o.name)||e.includes(o.externalId));r.selectBooth(t)}selectExhibitor(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectExhibitor","Parameter must be a string or an array of strings.","EFP000100");return}if(!e?.length){r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null;return}const t=r.exhibitorStore.exhibitors.filter(s=>typeof e=="string"?s.name===e||s.externalId===e:e.includes(s.name)||e.includes(s.externalId));if(!t?.length)return;if(typeof e=="string"){r.selectExhibitor(t[0]),r.moveToList([t[0]]);return}const o=t.flatMap(s=>s.booths.map(i=>i.layer)),n=oe(o.map(s=>s.description));n&&r.layerStore.updateVisibility(n,!0),r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null,r.uiState.list={type:"filter",items:t,query:{key:"exhibitors",value:t.map(s=>s.name).join(",")}},r.moveToList()}highlightExhibitors(e){Array.isArray(e)||a("highlightExhibitors","Parameter must be an array of strings.","EFP000200"),r.boothStore.highlightedByExternalIds=[],r.exhibitorStore.highlightedByExternalIds=[...e]}highlightBooths(e){Array.isArray(e)||a("highlightBooths","Parameter must be an array of strings.","EFP000300"),r.exhibitorStore.highlightedByExternalIds=[],r.boothStore.highlightedByExternalIds=[...e]}highlightEntities(e){Array.isArray(e)||a("highlightEntities","Parameter must be an array of strings.","EFP000400");const{boothExternalIds:t,exhibitorExternalIds:o}=B(e);r.boothStore.highlightedByExternalIds=[...t],r.exhibitorStore.highlightedByExternalIds=[...o]}selectRoute(e,t){if(Array.isArray(e)){let o=[...e];const n=o.shift(),s=o.pop();if(o.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);if(!n||!s){a("selectRoute","Invalid route format: When providing an array, it must include at least two points: a start and a destination.","EFP000401");return}r.routeStore.selectRoute(new v(m(n),m(s),o.map(m)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),r.routeStore.selectRoute(new v(m(e),m(t)))}getOptimizedRoutes(e){if(!Array.isArray(e))return a("getOptimizedRoutes","Parameter must be an array.","EFP000500"),[];if(e.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);const t=e.map(m).filter(n=>!!n);if(!t.length)throw new Error("No booths found for the provided waypoints.");const o=new Map;for(const n of t){const s=n.layer?.name??"",i=o.get(s);i?i.push(n):o.set(s,[n])}return Array.from(o.values()).map(n=>({waypoints:M(n.map(s=>[s.name,{x:s.rect.center.x,y:s.rect.center.y}]))}))}selectCurrentPosition(e,t,o){const n=y(e.x)&&y(e.y),s=y(e.lng)&&y(e.lat);!n&&!s&&a("selectCurrentPosition","A point must be passed. Either (x,y) or (lat,lng) are required.","EFP000600"),r.routeStore.selectCurrentPosition(e,t,o),this.onCurrentPositionChanged?.(e)}setBookmarks(e){(!Array.isArray(e)||!e.length)&&a("setBookmarks","Parameter must be an array.","EFP000700"),e.forEach(t=>{const o=r.exhibitorStore.exhibitors.find(n=>n.name===t.name||n.externalId===t.externalId);o&&(o.bookmarked=t.bookmarked)})}setEntitiesBookmarks(e){if(!Array.isArray(e)||!e.length){a("setEntitiesBookmarks","Parameter must be an array.","EFP000701");return}const t=["exhibitor","event","speaker","booth"],o=e.find(i=>!i.type||!t.includes(i.type));if(o){a("setEntitiesBookmarks",`Invalid entity type: ${o.type}. Must be one of: ${t.join(", ")}.`,"EFP000702");return}const n=L("bookmarked"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:i=>r.exhibitorStore.findExhibitor(i),replacer:i=>r.exhibitorStore.replaceBookmarked(i)},event:{existingIds:new Set(n.events||[]),finder:i=>r.eventStore.findByNameOrSlug(i),replacer:i=>r.eventStore.replaceBookmarked(i)},speaker:{existingIds:new Set(n.speakers||[]),finder:i=>r.speakerStore.speakers.find(h=>h.name===i||h.externalId===i||h.slug===i),replacer:i=>r.speakerStore.replaceBookmarked(i)},booth:{existingIds:new Set(n.booths||[]),finder:i=>{const h=r.boothStore.findBooth(i);return h?.exhibitors.length===0?h:void 0},replacer:i=>r.boothStore.replaceBookmarked(i)}};e.forEach(i=>{const h=s[i.type],u=i.name||i.externalId||"",c=h.finder(u);c?i.bookmarked?h.existingIds.add(c.id):h.existingIds.delete(c.id):console.warn(`Entity not found: ${i.type} with query "${u}"`)}),Object.values(s).forEach(i=>{i.replacer(Array.from(i.existingIds))})}setEntitiesVisited(e){if(!Array.isArray(e)||!e.length){a("setEntitiesVisited","Parameter must be an array.","EFP000703");return}const t=["exhibitor","event"],o=e.find(i=>!i.type||!t.includes(i.type));if(o){a("setEntitiesVisited",`Invalid entity type: ${o.type}. Must be one of: ${t.join(", ")}.`,"EFP000704");return}const n=L("visited"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:i=>r.exhibitorStore.findExhibitor(i),replacer:i=>r.exhibitorStore.replaceVisited(i)},event:{existingIds:new Set(n.events||[]),finder:i=>r.eventStore.findByNameOrSlug(i),replacer:i=>r.eventStore.replaceVisited(i)}};e.forEach(i=>{const h=s[i.type],u=i.name||i.externalId||"",c=h.finder(u);c?i.visited?h.existingIds.add(c.id):h.existingIds.delete(c.id):console.warn(`Entity not found: ${i.type} with query "${u}"`)}),Object.values(s).forEach(i=>{i.replacer(Array.from(i.existingIds))})}setMarkers(e){if(!e||!Array.isArray(e.icons)||!Array.isArray(e.markers)){a("setMarkers","Invalid input.","EFP000800");return}r.routeStore.setMarkers(e)}selectMarker(e,t=!0){return typeof e!="string"&&a("selectMarker","The identifier must be passed.","EFP000900"),r.routeStore.selectMarker(e,t)}drawCircles(e){Array.isArray(e)||a("drawCircles","Invalid input.","EFP000A00"),r.uiState.debugCircles=e}checkRoutes(){r.routeStore.checkRoutes()}updateLayerVisibility(e,t){typeof e!="string"&&a("updateLayerVisibility","The layer name (string) must be passed.","EFP000B00"),t||a("updateLayerVisibility","Passing a false value to visible will have no effect.","EFP000B01"),r.layerStore.updateVisibility(e,t)}getCenterCoordinates(){return r.fp.getCenterCoordinates()}exhibitorsList(){return r.exhibitorStore.exhibitors.map(e=>g(e))}boothsList(){return r.boothStore.booths.map(e=>g(e))}categoriesList(){return r.categoryStore.categories.map(e=>g(e))}selectCategory(e){if(e==null||typeof e!="string"){r.searchStore.selectSearch();return}const t=e?.toLowerCase(),o=r.categoryStore.categories.find(({name:n,slug:s})=>n?.toLowerCase()===t||s?.toLowerCase()===t);if(!o){a("selectCategory",`Category ${e} not found.`,"EFP000C01");return}r.selectCategory(o)}select(e){if(typeof e!="string"){a("select","Parameter must be a string.","EFP001700");return}const t=e,o=t?.toLowerCase(),n=r.boothStore.booths.find(c=>c.slug?.toLowerCase()===o||c.externalId?.toLowerCase()===o||c.externalId?.toLowerCase()?.replace(/\s+/g,"")===o);if(n){setTimeout(()=>r.selectBooth(n),250);return}const s=r.eventStore.eventItems.find(c=>c.slug?.toLowerCase()===o||c.externalId?.toLowerCase()===o);if(s){r.selectEventItem(s,!0);return}const i=r.exhibitorStore.exhibitors.find(c=>c.slug?.toLowerCase()===o||c.externalId?.toLowerCase()===o);if(i){setTimeout(()=>r.clickExhibitor(i),250);return}const h=r.categoryStore.categories.find(c=>c.slug===t);if(h){r.selectCategory(h);return}const u=r.speakerStore.findBySlug(t);if(u){r.selectSpeaker(u,!0);return}t.includes("heatmap=true")||r.searchStore.selectSearch(t)}showList(e){const t={bookmarks:()=>r.selectBookmarks(),visited:()=>r.selectVisited(),sessions:()=>r.selectSessions(),exhibitors:()=>r.selectExhibitors(),speakers:()=>r.selectSpeakers(),tours:()=>r.selectTours(),language:()=>r.selectLanguage()},o=t[e];if(!o){a("showList",`Unknown list "${e}". Must be one of: ${Object.keys(t).join(", ")}.`,"EFP001800");return}o()}selectTour(e){if(typeof e!="string"||!e){a("selectTour","A tour id must be passed.","EFP001900");return}const t=r.toursStore.getTourById(e);t?r.toursStore.launchTour(t,t.name,t.description):(console.warn(`Route with id "${e}" not found`),r.selectTours())}openPlanner(e={}){if(typeof e!="object"||e===null){a("openPlanner","An options object must be passed.","EFP001A00");return}const t=e.from?S(e.from):null;e.fromBookmarks?r.routePlannerStore.launchFromBookmarks(t??void 0):r.routePlannerStore.launchFromSlugs(e.items??[],t??void 0)}startBuildRoute(){r.uiState.startBuildRoute()}applyParameters(e){typeof e!="string"&&a("applyParameters","A query string must be passed.","EFP000D00"),Y(e)}getVisibility(){return r.uiState.visibility}setVisibility(e){(typeof e!="object"||!Object.keys(e).length)&&a("setVisibility","The parameter must be passed.","EFP000E00"),r.uiState.setVisibility(e)}findLocation(){r.routeStore.findLocation()}zoomIn(){r.uiState.zoomIn()}zoomOut(){r.uiState.zoomOut()}switchView(){r.maplibreStore.activateMaplibre()}setCamera(e){p("setCamera called with camera=%O",e);const t=I.safeParse(e);if(!t.success){a("setCamera",t.error.message,"EFP001B00");return}r.uiState.setMapSettings(te(t.data))}getCamera(){return re(r.uiState.mapSettings)}zoomTo(e,t){p("zoomTo called with selectors=%O options=%O",e,t);const o=w.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const n=P.safeParse(t);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const s=this.getBounds(e);s&&this.fitBounds(s,t)}getBounds(e){p("getBounds called with selectors=%O",e);const t=w.safeParse(e);if(!t.success){a("getBounds",t.error.message,"EFP001400");return}const o=[];if(e.booths?.forEach(s=>{let i;s.externalId?i=r.boothStore.boothByExternalId.get(s.externalId):s.name&&(i=r.boothStore.boothByName.get(s.name.toLowerCase())),i?.rect&&o.push(i.rect)}),e.exhibitors?.forEach(s=>{let i;s.externalId?i=r.exhibitorStore.exhibitorByExternalId.get(s.externalId):s.name&&(i=r.exhibitorStore.exhibitorByName.get(s.name.toLowerCase())),i?.booths?.forEach(h=>{h.rect&&o.push(h.rect)})}),o.length===0)return;const n=E.fromUnion(...o);return{leftTop:{x:n.min.x,y:n.min.y},rightBottom:{x:n.max.x,y:n.max.y}}}fitBounds(e,t){if(p("fitBounds called with bounds=%O options=%O",e,t),!e){r.uiState.fitBounds();return}const o=U.safeParse(e);if(!o.success){a("fitBounds",o.error.message,"EFP001500");return}const n=P.safeParse(t);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}const s=E.fromMinMax({x:e.leftTop.x,y:e.leftTop.y},{x:e.rightBottom.x,y:e.rightBottom.y});r.uiState.moveToRect=t?.padding?s.expand(t.padding):s}getBoothRect(e){typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00");const t=S(e)?.rect;return t?l.fromBox(t):void 0}convertToGeo(e,t){if(!b?.properties?.config){a("convertToGeo","The coordinates cannot be converted because the GPS configuration is not defined.","EFP001000");return}if(!e||!t){a("convertToGeo","Both coordinates must be passed.","EFP001001");return}return ie(e,t,b.properties.config)}getGeoConfig(){const e=b?.properties?.config;return e?{bearing:e.bearing??0,p0:e.p0,p1:e.p1,p2:e.p2}:null}unstable_destroy(){let e=window.__efpElement.firstChild;J(),window.removeEventListener("__efpStyleLoad",this.efpStyleLoadHandler),window.removeEventListener("error",Z),r.maplibreStore.dispose(),W(),X(),K(),this.root.unmount(),e.remove()}search(e){return typeof e!="string"&&a("search","A search string must be passed.","EFP001100"),r.fuzzySearchEngineStore.loadEngine().then(()=>(r.searchStore.selectSearch(e),r.uiState.fuzzySearchItems.map(t=>({item:g(t.item),score:t.score}))))}getFloors(){return r.layerStore.floors.map(e=>({name:e.name,shortName:e.shortName,description:e.description,active:e.active,disabled:e.disabled,index:e.index}))}activateFloor(e){if(!e?.name&&e?.index==null){a("activateFloor","Invalid floorId. It must contain either a name or an index.","EFP001200");return}const t=this.getFloors();if(e.name){const o=t.find(n=>n.name===e.name||n.shortName===e.name);if(!o){a("activateFloor",`Floor with name "${e.name}" not found.`,"EFP001201");return}if(o.active)return;this.updateLayerVisibility(o.name,!0);return}if(e.index!==null){const o=t.find(s=>s.index===e.index),n=o?.name;if(!n){a("activateFloor",`Floor at index ${e.index} does not exist.`,"EFP001203");return}if(o.active)return;this.updateLayerVisibility(n,!0);return}}showPathway(e,t){const{boothExternalIds:o,exhibitorExternalIds:n}=t?.length?B(t):{boothExternalIds:[],exhibitorExternalIds:[]};_({pathwayId:e,boothIds:o,exhibitorIds:n})}showPathwayOnly(e,t){this.activateFloor({name:t}),r.layerStore.showPathWay(e),r.uiState.setPathwayOnlyMode(!0);const o=r.layerStore.findLayer(e),n=r.layerStore.findLayer(t),s=o?.rect||o?.viewbox?o:n;if(s?.rect||s?.viewbox){const i=s.viewbox??s.rect;r.uiState.moveToRect=i.clone()}}hidePathways(){this.highlightBooths([]),r.layerStore.hidePathways(),r.uiState.setPathwayOnlyMode(!1)}showSearch(){r.selectSearch("")}changeLanguage(e){const t=e?.toLowerCase?.();if(!ne(t)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${se().map(o=>o.id).join(",")}`,"EFP001300");return}ae(t)}isGpsTrackingEnabled(){return r.routeStore.gpsEnabled}setGpsTrackingEnabled(e){r.routeStore.setGpsTrackingEnabled(e)}deselectCurrentPosition(){r.routeStore.selectCurrentPosition(null,!1)}deselectRoute(){r.routeStore.selectRoute(null),r.routeStore.setOnlyAccessible(!1)}reset(){this.selectBooth(""),this.selectExhibitor(""),this.selectCategory(),this.deselectCurrentPosition(),this.deselectRoute(),this.highlightEntities([]),r.uiState.kioskData&&r.resetCameraFn?r.resetCameraFn?.():this.fitBounds()}selectAccessibleRoute(e){r.routeStore.setOnlyAccessible(!0),this.selectRoute(e)}}function m(f){return typeof f=="string"?S(f):r.routeStore.getNearestBooth(f)}let C=0;function a(f,e,t){const o=`Error calling "${f}" SDK method.`,n=`${e.endsWith(".")?e:e+"."} More information at`;let s="https://js-sdk.expofp.com/api/packages";if(t&&(s+=`#error-${t}`),console.error(`${o} ${n} ${s}`),r.fp.disableRuntimeAlerts)return;r.uiState.setGlobalErrorMessage({title:o,body:T(A,{children:[n," ",x("a",{href:s,target:"_blank",rel:"noreferrer",children:s})]})}),clearTimeout(C);const i=8e3;C=window.setTimeout(()=>{const h=async()=>{r.uiState.globalErrorMessages.length>0&&(r.uiState.popGlobalErrorMessage(),await new Promise(u=>setTimeout(u,i/2)),h())};h()},i)}class l{get h(){return Math.abs(this.y2-this.y1)}get w(){return Math.abs(this.x2-this.x1)}get cx(){return(this.x1+this.x2)/2}get cy(){return(this.y1+this.y2)/2}constructor(e,t,o,n){if(e>o){const s=e;e=o,o=s}if(t>n){const s=t;t=n,n=s}this.x1=e,this.y1=t,this.x2=o,this.y2=n}static fromBox(e){return new l(e.min.x,e.min.y,e.max.x,e.max.y)}static fromCxcywh(e,t,o,n){return new l(e-o/2,t-n/2,e+o/2,t+n/2)}contains(e){return e.x1>=this.x1&&e.x2<=this.x2&&e.y1>=this.y1&&e.y2<=this.y2}intersects(e){const t=Math.max(this.x1,e.x1),o=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),s=Math.min(this.y2,e.y2);return o>=t&&s>=n}getIntersection(e){const t=Math.max(this.x1,e.x1),o=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),s=Math.min(this.y2,e.y2);return o>=t&&s>=n?new l(t,n,o,s):new l(0,0,0,0)}getRotated90(){return l.fromCxcywh(this.cx,this.cy,this.h,this.w)}normalize(e,t){return new l(this.x1/e,this.y1/t,this.x2/e,this.y2/t)}withPadding(e,t=e){return this.w<e*2||this.h<t*2?this:l.fromCxcywh(this.cx,this.cy,this.w-e*2,this.h-t*2)}scale(e){return new l(this.x1*e,this.y1*e,this.x2*e,this.y2*e)}getArea(){return this.w*this.h}clone(){return new l(this.x1,this.y1,this.x2,this.y2)}translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this}equals(e){return e.x1===this.x1&&e.x2===this.x2&&e.y1===this.y1&&e.y2===this.y2}toString(){return this.x1+","+this.y1+","+this.w+","+this.h}containsPoint(e,t){return e>=this.x1&&e<=this.x2&&t>=this.y1&&t<=this.y2}}
1
+ import{Fragment as A,jsx as x,jsxs as T}from"react/jsx-runtime";import{Box as E}from"@expofp/geometry";import{CameraSchema as I}from"@expofp/schema";import{optimizeWaypointOrder as M}from"@expofp/wayfinding";import{ErrorBoundary as R}from"@sentry/react";import $ from"debug";import{reaction as V}from"mobx";import{createRoot as z}from"react-dom/client";import{install as j}from"resize-observer";import G from"./components/Layout";import{MAX_ROUTE_WAYPOINTS as d}from"./constants";import N from"./data";import{fpGeo as b}from"./data/fpGeo";import q from"./floorplan.loader";import{shouldLoadIntercom as O}from"./intercom";import{BoundsSchema as U,POISelectorsSchema as w,ZoomToOptionsSchema as P}from"./schemas/sdk.schemas";import{applyDeclarativeConfig as H,applyParameters as Y,applyPathway as _,initUrlRouting as D}from"./services/url-dispatch";import{destroyUrlSync as W}from"./services/url-sync";import r from"./store";import{bindRootElement as X,destroyUiHandlers as K}from"./store/init/init-ui";import{findBooth as S,Route as v,separateExternalIds as B}from"./store/RouteStore";import{destroyGtag as Q,GaEventActions as k,sendEventToGa as F,setConsentSettings as Z}from"./tools/gtag";import J from"./tools/report-error";import{resetGlobalVariables as ee}from"./tools/reset";import te from"./tools/track-event";import{cameraToMapSettings as re,mapSettingsToCamera as oe}from"./utils/camera-map-settings";import{getStorage as L}from"./utils/entity-storage";import{getMostFrequent as ie}from"./utils/getMostFrequent";import{convertLocalToGps as se,isValidPointCoords as y}from"./utils/gps";import{getLocales as ne,hasLocale as ae,setLocale as he}from"./utils/i18n";import{mapEntity as g}from"./utils/mapEntity";const p=$("efp:api");j();export default class ce extends q{init(){H(),this.ignoreQuery||D(this.offHistory),te("load"),X(r),r.fp=this,Z(this.consent),F(k.Load,""),this.root=z(this.renderTarget),this.root.render(x(R,{children:x(G,{offHistory:this.offHistory,consent:this.consent})})),F(k.Rendered,""),V(()=>r.layerStore.layersLoaded,()=>{this.resolveReady(),r.initialized||this.onInit?.(this),r.initialized=!0});const e=O(N);e&&import("./intercom/bootIntercom").then(({bootIntercom:t})=>t(e)).catch(()=>{})}selectBooth(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectBooth","Parameter must be a string or an array of strings.","EFP000000");return}const t=r.boothStore.booths.filter(o=>typeof e=="string"?o.name===e||o.externalId===e:e.includes(o.name)||e.includes(o.externalId));r.selectBooth(t)}selectExhibitor(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectExhibitor","Parameter must be a string or an array of strings.","EFP000100");return}if(!e?.length){r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null;return}const t=r.exhibitorStore.exhibitors.filter(s=>typeof e=="string"?s.name===e||s.externalId===e:e.includes(s.name)||e.includes(s.externalId));if(!t?.length)return;if(typeof e=="string"){r.selectExhibitor(t[0]),r.moveToList([t[0]]);return}const o=t.flatMap(s=>s.booths.map(i=>i.layer)),n=ie(o.map(s=>s.description));n&&r.layerStore.updateVisibility(n,!0),r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null,r.uiState.list={type:"filter",items:t,query:{key:"exhibitors",value:t.map(s=>s.name).join(",")}},r.moveToList()}highlightExhibitors(e){Array.isArray(e)||a("highlightExhibitors","Parameter must be an array of strings.","EFP000200"),r.boothStore.highlightedByExternalIds=[],r.exhibitorStore.highlightedByExternalIds=[...e]}highlightBooths(e){Array.isArray(e)||a("highlightBooths","Parameter must be an array of strings.","EFP000300"),r.exhibitorStore.highlightedByExternalIds=[],r.boothStore.highlightedByExternalIds=[...e]}highlightEntities(e){Array.isArray(e)||a("highlightEntities","Parameter must be an array of strings.","EFP000400");const{boothExternalIds:t,exhibitorExternalIds:o}=B(e);r.boothStore.highlightedByExternalIds=[...t],r.exhibitorStore.highlightedByExternalIds=[...o]}selectRoute(e,t){if(Array.isArray(e)){let o=[...e];const n=o.shift(),s=o.pop();if(o.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);if(!n||!s){a("selectRoute","Invalid route format: When providing an array, it must include at least two points: a start and a destination.","EFP000401");return}r.routeStore.selectRoute(new v(m(n),m(s),o.map(m)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),r.routeStore.selectRoute(new v(m(e),m(t)))}getOptimizedRoutes(e){if(!Array.isArray(e))return a("getOptimizedRoutes","Parameter must be an array.","EFP000500"),[];if(e.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);const t=e.map(m).filter(n=>!!n);if(!t.length)throw new Error("No booths found for the provided waypoints.");const o=new Map;for(const n of t){const s=n.layer?.name??"",i=o.get(s);i?i.push(n):o.set(s,[n])}return Array.from(o.values()).map(n=>({waypoints:M(n.map(s=>[s.name,{x:s.rect.center.x,y:s.rect.center.y}]))}))}selectCurrentPosition(e,t,o){const n=y(e.x)&&y(e.y),s=y(e.lng)&&y(e.lat);!n&&!s&&a("selectCurrentPosition","A point must be passed. Either (x,y) or (lat,lng) are required.","EFP000600"),r.routeStore.selectCurrentPosition(e,t,o),this.onCurrentPositionChanged?.(e)}setBookmarks(e){(!Array.isArray(e)||!e.length)&&a("setBookmarks","Parameter must be an array.","EFP000700"),e.forEach(t=>{const o=r.exhibitorStore.exhibitors.find(n=>n.name===t.name||n.externalId===t.externalId);o&&(o.bookmarked=t.bookmarked)})}setEntitiesBookmarks(e){if(!Array.isArray(e)||!e.length){a("setEntitiesBookmarks","Parameter must be an array.","EFP000701");return}const t=["exhibitor","event","speaker","booth"],o=e.find(i=>!i.type||!t.includes(i.type));if(o){a("setEntitiesBookmarks",`Invalid entity type: ${o.type}. Must be one of: ${t.join(", ")}.`,"EFP000702");return}const n=L("bookmarked"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:i=>r.exhibitorStore.findExhibitor(i),replacer:i=>r.exhibitorStore.replaceBookmarked(i)},event:{existingIds:new Set(n.events||[]),finder:i=>r.eventStore.findByNameOrSlug(i),replacer:i=>r.eventStore.replaceBookmarked(i)},speaker:{existingIds:new Set(n.speakers||[]),finder:i=>r.speakerStore.speakers.find(h=>h.name===i||h.externalId===i||h.slug===i),replacer:i=>r.speakerStore.replaceBookmarked(i)},booth:{existingIds:new Set(n.booths||[]),finder:i=>{const h=r.boothStore.findBooth(i);return h?.exhibitors.length===0?h:void 0},replacer:i=>r.boothStore.replaceBookmarked(i)}};e.forEach(i=>{const h=s[i.type],u=i.name||i.externalId||"",c=h.finder(u);c?i.bookmarked?h.existingIds.add(c.id):h.existingIds.delete(c.id):console.warn(`Entity not found: ${i.type} with query "${u}"`)}),Object.values(s).forEach(i=>{i.replacer(Array.from(i.existingIds))})}setEntitiesVisited(e){if(!Array.isArray(e)||!e.length){a("setEntitiesVisited","Parameter must be an array.","EFP000703");return}const t=["exhibitor","event"],o=e.find(i=>!i.type||!t.includes(i.type));if(o){a("setEntitiesVisited",`Invalid entity type: ${o.type}. Must be one of: ${t.join(", ")}.`,"EFP000704");return}const n=L("visited"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:i=>r.exhibitorStore.findExhibitor(i),replacer:i=>r.exhibitorStore.replaceVisited(i)},event:{existingIds:new Set(n.events||[]),finder:i=>r.eventStore.findByNameOrSlug(i),replacer:i=>r.eventStore.replaceVisited(i)}};e.forEach(i=>{const h=s[i.type],u=i.name||i.externalId||"",c=h.finder(u);c?i.visited?h.existingIds.add(c.id):h.existingIds.delete(c.id):console.warn(`Entity not found: ${i.type} with query "${u}"`)}),Object.values(s).forEach(i=>{i.replacer(Array.from(i.existingIds))})}setMarkers(e){if(!e||!Array.isArray(e.icons)||!Array.isArray(e.markers)){a("setMarkers","Invalid input.","EFP000800");return}r.routeStore.setMarkers(e)}selectMarker(e,t=!0){return typeof e!="string"&&a("selectMarker","The identifier must be passed.","EFP000900"),r.routeStore.selectMarker(e,t)}drawCircles(e){Array.isArray(e)||a("drawCircles","Invalid input.","EFP000A00"),r.uiState.debugCircles=e}checkRoutes(){r.routeStore.checkRoutes()}updateLayerVisibility(e,t){typeof e!="string"&&a("updateLayerVisibility","The layer name (string) must be passed.","EFP000B00"),t||a("updateLayerVisibility","Passing a false value to visible will have no effect.","EFP000B01"),r.layerStore.updateVisibility(e,t)}getCenterCoordinates(){return r.fp.getCenterCoordinates()}exhibitorsList(){return r.exhibitorStore.exhibitors.map(e=>g(e))}boothsList(){return r.boothStore.booths.map(e=>g(e))}categoriesList(){return r.categoryStore.categories.map(e=>g(e))}selectCategory(e){if(e==null||typeof e!="string"){r.searchStore.selectSearch();return}const t=e?.toLowerCase(),o=r.categoryStore.categories.find(({name:n,slug:s})=>n?.toLowerCase()===t||s?.toLowerCase()===t);if(!o){a("selectCategory",`Category ${e} not found.`,"EFP000C01");return}r.selectCategory(o)}select(e){if(typeof e!="string"){a("select","Parameter must be a string.","EFP001700");return}const t=e,o=t?.toLowerCase(),n=r.boothStore.booths.find(c=>c.slug?.toLowerCase()===o||c.externalId?.toLowerCase()===o||c.externalId?.toLowerCase()?.replace(/\s+/g,"")===o);if(n){setTimeout(()=>r.selectBooth(n),250);return}const s=r.eventStore.eventItems.find(c=>c.slug?.toLowerCase()===o||c.externalId?.toLowerCase()===o);if(s){r.selectEventItem(s,!0);return}const i=r.exhibitorStore.exhibitors.find(c=>c.slug?.toLowerCase()===o||c.externalId?.toLowerCase()===o);if(i){setTimeout(()=>r.clickExhibitor(i),250);return}const h=r.categoryStore.categories.find(c=>c.slug===t);if(h){r.selectCategory(h);return}const u=r.speakerStore.findBySlug(t);if(u){r.selectSpeaker(u,!0);return}t.includes("heatmap=true")||r.searchStore.selectSearch(t)}showList(e){const t={bookmarks:()=>r.selectBookmarks(),visited:()=>r.selectVisited(),sessions:()=>r.selectSessions(),exhibitors:()=>r.selectExhibitors(),speakers:()=>r.selectSpeakers(),tours:()=>r.selectTours(),language:()=>r.selectLanguage()},o=t[e];if(!o){a("showList",`Unknown list "${e}". Must be one of: ${Object.keys(t).join(", ")}.`,"EFP001800");return}o()}selectTour(e){if(typeof e!="string"||!e){a("selectTour","A tour id must be passed.","EFP001900");return}const t=r.toursStore.getTourById(e);t?r.toursStore.launchTour(t,t.name,t.description):(console.warn(`Route with id "${e}" not found`),r.selectTours())}openPlanner(e={}){if(typeof e!="object"||e===null){a("openPlanner","An options object must be passed.","EFP001A00");return}const t=e.from?S(e.from):null;e.fromBookmarks?r.routePlannerStore.launchFromBookmarks(t??void 0):r.routePlannerStore.launchFromSlugs(e.items??[],t??void 0)}startBuildRoute(){r.uiState.startBuildRoute()}applyParameters(e){typeof e!="string"&&a("applyParameters","A query string must be passed.","EFP000D00"),Y(e)}getVisibility(){return r.uiState.visibility}setVisibility(e){(typeof e!="object"||!Object.keys(e).length)&&a("setVisibility","The parameter must be passed.","EFP000E00"),r.uiState.setVisibility(e)}findLocation(){r.routeStore.findLocation()}zoomIn(){r.uiState.zoomIn()}zoomOut(){r.uiState.zoomOut()}switchView(){r.maplibreStore.activateMaplibre()}setCamera(e){p("setCamera called with camera=%O",e);const t=I.safeParse(e);if(!t.success){a("setCamera",t.error.message,"EFP001B00");return}r.uiState.setMapSettings(re(t.data))}getCamera(){return oe(r.uiState.mapSettings)}zoomTo(e,t){p("zoomTo called with selectors=%O options=%O",e,t);const o=w.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const n=P.safeParse(t);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const s=this.getBounds(e);s&&this.fitBounds(s,t)}getBounds(e){p("getBounds called with selectors=%O",e);const t=w.safeParse(e);if(!t.success){a("getBounds",t.error.message,"EFP001400");return}const o=[];if(e.booths?.forEach(s=>{let i;s.externalId?i=r.boothStore.boothByExternalId.get(s.externalId):s.name&&(i=r.boothStore.boothByName.get(s.name.toLowerCase())),i?.rect&&o.push(i.rect)}),e.exhibitors?.forEach(s=>{let i;s.externalId?i=r.exhibitorStore.exhibitorByExternalId.get(s.externalId):s.name&&(i=r.exhibitorStore.exhibitorByName.get(s.name.toLowerCase())),i?.booths?.forEach(h=>{h.rect&&o.push(h.rect)})}),o.length===0)return;const n=E.fromUnion(...o);return{leftTop:{x:n.min.x,y:n.min.y},rightBottom:{x:n.max.x,y:n.max.y}}}fitBounds(e,t){if(p("fitBounds called with bounds=%O options=%O",e,t),!e){r.uiState.fitBounds();return}const o=U.safeParse(e);if(!o.success){a("fitBounds",o.error.message,"EFP001500");return}const n=P.safeParse(t);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}const s=E.fromMinMax({x:e.leftTop.x,y:e.leftTop.y},{x:e.rightBottom.x,y:e.rightBottom.y});r.uiState.moveToRect=t?.padding?s.expand(t.padding):s}getBoothRect(e){typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00");const t=S(e)?.rect;return t?l.fromBox(t):void 0}convertToGeo(e,t){if(!b?.properties?.config){a("convertToGeo","The coordinates cannot be converted because the GPS configuration is not defined.","EFP001000");return}if(!e||!t){a("convertToGeo","Both coordinates must be passed.","EFP001001");return}return se(e,t,b.properties.config)}getGeoConfig(){const e=b?.properties?.config;return e?{bearing:e.bearing??0,p0:e.p0,p1:e.p1,p2:e.p2}:null}unstable_destroy(){let e=window.__efpElement.firstChild;ee(),window.removeEventListener("__efpStyleLoad",this.efpStyleLoadHandler),window.removeEventListener("error",J),r.maplibreStore.dispose(),W(),K(),Q(),this.root.unmount(),e.remove()}search(e){return typeof e!="string"&&a("search","A search string must be passed.","EFP001100"),r.fuzzySearchEngineStore.loadEngine().then(()=>(r.searchStore.selectSearch(e),r.uiState.fuzzySearchItems.map(t=>({item:g(t.item),score:t.score}))))}getFloors(){return r.layerStore.floors.map(e=>({name:e.name,shortName:e.shortName,description:e.description,active:e.active,disabled:e.disabled,index:e.index}))}activateFloor(e){if(!e?.name&&e?.index==null){a("activateFloor","Invalid floorId. It must contain either a name or an index.","EFP001200");return}const t=this.getFloors();if(e.name){const o=t.find(n=>n.name===e.name||n.shortName===e.name);if(!o){a("activateFloor",`Floor with name "${e.name}" not found.`,"EFP001201");return}if(o.active)return;this.updateLayerVisibility(o.name,!0);return}if(e.index!==null){const o=t.find(s=>s.index===e.index),n=o?.name;if(!n){a("activateFloor",`Floor at index ${e.index} does not exist.`,"EFP001203");return}if(o.active)return;this.updateLayerVisibility(n,!0);return}}showPathway(e,t){const{boothExternalIds:o,exhibitorExternalIds:n}=t?.length?B(t):{boothExternalIds:[],exhibitorExternalIds:[]};_({pathwayId:e,boothIds:o,exhibitorIds:n})}showPathwayOnly(e,t){this.activateFloor({name:t}),r.layerStore.showPathWay(e),r.uiState.setPathwayOnlyMode(!0);const o=r.layerStore.findLayer(e),n=r.layerStore.findLayer(t),s=o?.rect||o?.viewbox?o:n;if(s?.rect||s?.viewbox){const i=s.viewbox??s.rect;r.uiState.moveToRect=i.clone()}}hidePathways(){this.highlightBooths([]),r.layerStore.hidePathways(),r.uiState.setPathwayOnlyMode(!1)}showSearch(){r.selectSearch("")}changeLanguage(e){const t=e?.toLowerCase?.();if(!ae(t)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${ne().map(o=>o.id).join(",")}`,"EFP001300");return}he(t)}isGpsTrackingEnabled(){return r.routeStore.gpsEnabled}setGpsTrackingEnabled(e){r.routeStore.setGpsTrackingEnabled(e)}deselectCurrentPosition(){r.routeStore.selectCurrentPosition(null,!1)}deselectRoute(){r.routeStore.selectRoute(null),r.routeStore.setOnlyAccessible(!1)}reset(){this.selectBooth(""),this.selectExhibitor(""),this.selectCategory(),this.deselectCurrentPosition(),this.deselectRoute(),this.highlightEntities([]),r.uiState.kioskData&&r.resetCameraFn?r.resetCameraFn?.():this.fitBounds()}selectAccessibleRoute(e){r.routeStore.setOnlyAccessible(!0),this.selectRoute(e)}}function m(f){return typeof f=="string"?S(f):r.routeStore.getNearestBooth(f)}let C=0;function a(f,e,t){const o=`Error calling "${f}" SDK method.`,n=`${e.endsWith(".")?e:e+"."} More information at`;let s="https://js-sdk.expofp.com/api/packages";if(t&&(s+=`#error-${t}`),console.error(`${o} ${n} ${s}`),r.fp.disableRuntimeAlerts)return;r.uiState.setGlobalErrorMessage({title:o,body:T(A,{children:[n," ",x("a",{href:s,target:"_blank",rel:"noreferrer",children:s})]})}),clearTimeout(C);const i=8e3;C=window.setTimeout(()=>{const h=async()=>{r.uiState.globalErrorMessages.length>0&&(r.uiState.popGlobalErrorMessage(),await new Promise(u=>setTimeout(u,i/2)),h())};h()},i)}class l{get h(){return Math.abs(this.y2-this.y1)}get w(){return Math.abs(this.x2-this.x1)}get cx(){return(this.x1+this.x2)/2}get cy(){return(this.y1+this.y2)/2}constructor(e,t,o,n){if(e>o){const s=e;e=o,o=s}if(t>n){const s=t;t=n,n=s}this.x1=e,this.y1=t,this.x2=o,this.y2=n}static fromBox(e){return new l(e.min.x,e.min.y,e.max.x,e.max.y)}static fromCxcywh(e,t,o,n){return new l(e-o/2,t-n/2,e+o/2,t+n/2)}contains(e){return e.x1>=this.x1&&e.x2<=this.x2&&e.y1>=this.y1&&e.y2<=this.y2}intersects(e){const t=Math.max(this.x1,e.x1),o=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),s=Math.min(this.y2,e.y2);return o>=t&&s>=n}getIntersection(e){const t=Math.max(this.x1,e.x1),o=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),s=Math.min(this.y2,e.y2);return o>=t&&s>=n?new l(t,n,o,s):new l(0,0,0,0)}getRotated90(){return l.fromCxcywh(this.cx,this.cy,this.h,this.w)}normalize(e,t){return new l(this.x1/e,this.y1/t,this.x2/e,this.y2/t)}withPadding(e,t=e){return this.w<e*2||this.h<t*2?this:l.fromCxcywh(this.cx,this.cy,this.w-e*2,this.h-t*2)}scale(e){return new l(this.x1*e,this.y1*e,this.x2*e,this.y2*e)}getArea(){return this.w*this.h}clone(){return new l(this.x1,this.y1,this.x2,this.y2)}translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this}equals(e){return e.x1===this.x1&&e.x2===this.x2&&e.y1===this.y1&&e.y2===this.y2}toString(){return this.x1+","+this.y1+","+this.w+","+this.h}containsPoint(e,t){return e>=this.x1&&e<=this.x2&&t>=this.y1&&t<=this.y2}}
@@ -1,5 +1,6 @@
1
1
  import { Box } from '@expofp/geometry';
2
- import { LayerDef } from '@expofp/renderer';
2
+ import { type LayerDef } from '@expofp/renderer';
3
+ import { type Floor } from '../types';
3
4
  export declare enum LayersMode {
4
5
  Default = 0,// one floor plans
5
6
  Separated = 1,// outdated
@@ -18,11 +19,11 @@ export declare class Layer {
18
19
  name: string;
19
20
  description: string;
20
21
  frozen: boolean;
21
- rect: Box;
22
- viewbox: Box;
22
+ rect: Box | null;
23
+ viewbox: Box | null;
23
24
  configured: boolean;
24
25
  childLayers: Layer[];
25
- rootParent: Layer;
26
+ rootParent: Layer | null;
26
27
  mode: LayerMode;
27
28
  children: LayerDef[];
28
29
  pathway?: boolean;
@@ -33,7 +34,7 @@ export declare class Layer {
33
34
  }
34
35
  export default class LayerStore {
35
36
  layers: Layer[];
36
- defaultLayer: Layer;
37
+ defaultLayer?: Layer;
37
38
  mode: LayersMode;
38
39
  layersLoaded: boolean;
39
40
  private updateVisibilityTimeout;
@@ -48,7 +49,7 @@ export default class LayerStore {
48
49
  })[];
49
50
  selectFloor(layer: Layer): void;
50
51
  updateVisibility(layerOrName: string | Layer, visible: boolean): void;
51
- findLayer(z: string | number): Layer;
52
+ findLayer(z: string | number | null | undefined): Layer | null;
52
53
  getPathwayList(): Layer[];
53
54
  showPathWay(name: string): Promise<void>;
54
55
  hidePathways(): void;
@@ -1 +1 @@
1
- import{__decorate as a}from"tslib";import{Box as y}from"@expofp/geometry";import{action as c,computed as f,observable as h,runInAction as m}from"mobx";import d from"../components/Map/drawing/config/config-load-layer";import{getFpSvgJs as v}from"../data/fp-payloads";import w from"../tools/settings";import{areLayersEnabled as b}from"../utils/areLayersEnabled";import{shortenName as g}from"../utils/shortenName";import s from".";const S=["money2020usa","rodion2","possible2025","2025virtuosotravelweek","zscalerskofy26","gamescom2025"];export var LayersMode;(function(i){i[i.Default=0]="Default",i[i.Separated=1]="Separated",i[i.Radio=2]="Radio",i[i.CheckBox=3]="CheckBox"})(LayersMode||(LayersMode={}));export var LayerMode;(function(i){i[i.Unset=0]="Unset",i[i.AlwaysVisible=1]="AlwaysVisible",i[i.AlwaysHidden=2]="AlwaysHidden",i[i.TurnedOn=3]="TurnedOn",i[i.TurnedOff=4]="TurnedOff"})(LayerMode||(LayerMode={}));export class Layer{constructor(){this.rect=null,this.viewbox=null,this.childLayers=[],this.rootParent=null,this.children=[]}get shortName(){return g(this.description)}}a([h],Layer.prototype,"loaded",void 0),a([h],Layer.prototype,"visible",void 0);export default class l{constructor(){this.layers=[],this.layersLoaded=!1,this.updateVisibilityTimeout=0,this.selectFloorTimeout=0}get visible(){return this.layers.filter(t=>t.frozen||t.visible)}get loaded(){return this.layers.filter(t=>t.loaded)}get rectangle(){var t=this.visible.filter(r=>!r.frozen).map(r=>r.viewbox??r.rect);return this.mode!==LayersMode.Radio||!t.length?null:y.fromUnion(...t)||null}get viewboxRectangle(){var t=this.visible.filter(r=>!r.frozen&&r.viewbox).map(r=>r.viewbox);return t.length&&y.fromUnion(...t)||null}get pathwayLayers(){return this.layers.filter(t=>t.pathway)}get floors(){if(!b())return[];const t=new Set(this.layers.filter(e=>e&&!e.frozen&&!e.rootParent&&!e.pathway).concat(s.routeStore.layers.filter(e=>e&&e.mode!==LayerMode.AlwaysHidden&&e.mode!==LayerMode.AlwaysVisible))),r=Array.from(t).reverse();return r.map((e,o)=>{const n=s.routeStore.layers.length>0&&s.routeStore.layers.indexOf(e)===-1,u=s.toursStore.tourLayers.length>0&&s.toursStore.tourLayers.indexOf(e)===-1;return{layer:e,name:e.name,shortName:e.shortName,description:e.description,active:e.visible,disabled:!!(n||u),index:e.floorIndex??r.length-o-1}})}selectFloor(t){if(this.selectFloorTimeout)return;this.selectFloorTimeout=setTimeout(()=>this.selectFloorTimeout=0,500);const r=this.layers.find(o=>o.description===t.description);if(!r)return;if(this.mode===LayersMode.Radio){if(this.updateVisibility(r,!0),s.maplibreStore.showMaplibre)return;if(!!v().__fpSettings?.fpVer||S.includes(w.EXPO)){const n=r.viewbox??r.rect;s.uiState.moveToRect=n}else{const n=this.layers.indexOf(this.layers.filter(p=>!p.frozen&&p.visible)[0]),u=this.layers.indexOf(r);if(n===u)return;s.uiState.zoomBy=u<n?.95:1.05}}else this.updateVisibility(r,!r.visible);const e=s.toursStore.getTourLayerInfo(r.name)||s.toursStore.getTourLayerInfo(r.description);if(e){this.showPathWay(e.id);return}s.toursStore.stopTour()}updateVisibility(t,r){if(this.mode===LayersMode.Radio&&!r)return;const e=t instanceof Layer?t:this.findLayer(t);if(!e||e.visible===r){e&&s.routeStore.currentRouteLayer!==e&&(s.routeStore.currentRouteLayer=e);return}d(e,s.rendererService).then(()=>{this.mode===LayersMode.Radio&&this.layers.filter(o=>!o.pathway).forEach(o=>{o.name!==e.name&&!o.frozen&&o.visible&&(o.visible=!1,o.childLayers.forEach(n=>{n.visible=!1}))}),e&&(e.visible=r,e.childLayers.forEach(o=>{o.visible=r}),r&&(s.routeStore.currentRouteLayer=e),typeof s.fp.onFloorActivated=="function"&&(clearTimeout(this.updateVisibilityTimeout),this.updateVisibilityTimeout=setTimeout(()=>{const o=s.fp.getFloors();s.fp.onFloorActivated(o.find(n=>n.name===e.name))})))})}findLayer(t){if(t==null)return null;const r=this.layers.filter(o=>!o.rootParent);if(typeof t=="number"&&(e=r.filter(o=>!o.frozen)[t],e))return e;t=t.toString().toLowerCase();var e=r.find(o=>{const n=(o.name.match(/(-?[0-9]+)/)||"")[0];return t===o?.name.toLowerCase()||t===o?.description.toLowerCase()||t===o?.shortName.toLowerCase()||t===n});return!e&&!/\D/.test(t)&&(e=r.filter(o=>!o.frozen)[parseInt(t)]),e}getPathwayList(){return this.layers.filter(t=>t.pathway)}async showPathWay(t){try{const r=this.findLayer(t);if(!r)throw new Error(`There is no pathway with this name. ${t}`);await d(r,s.rendererService);const e=this.getPathwayList();m(()=>{e.forEach(o=>{const n=o.name===t;o.visible=n,o.childLayers.forEach(u=>{u.visible=n})})})}catch(r){console.error("showPathWay",r)}}hidePathways(){this.getPathwayList().forEach(r=>{r.visible=!1,r.childLayers.forEach(e=>{e.visible=!1})})}}a([h],l.prototype,"layers",void 0),a([h],l.prototype,"defaultLayer",void 0),a([h],l.prototype,"mode",void 0),a([h],l.prototype,"layersLoaded",void 0),a([f({keepAlive:!0})],l.prototype,"visible",null),a([f({keepAlive:!0})],l.prototype,"loaded",null),a([f({keepAlive:!0})],l.prototype,"rectangle",null),a([f({keepAlive:!0})],l.prototype,"viewboxRectangle",null),a([f],l.prototype,"pathwayLayers",null),a([f],l.prototype,"floors",null),a([c],l.prototype,"selectFloor",null),a([c],l.prototype,"updateVisibility",null),a([c],l.prototype,"showPathWay",null),a([c],l.prototype,"hidePathways",null);
1
+ import{__decorate as a}from"tslib";import{Box as d}from"@expofp/geometry";import{action as c,computed as f,observable as h,runInAction as m}from"mobx";import y from"../components/Map/drawing/config/config-load-layer";import{getFpSvgJs as w}from"../data/fp-payloads";import b from"../tools/settings";import{areLayersEnabled as v}from"../utils/areLayersEnabled";import{shortenName as g}from"../utils/shortenName";import n from".";const x=["money2020usa","rodion2","possible2025","2025virtuosotravelweek","zscalerskofy26","gamescom2025"];export var LayersMode;(function(s){s[s.Default=0]="Default",s[s.Separated=1]="Separated",s[s.Radio=2]="Radio",s[s.CheckBox=3]="CheckBox"})(LayersMode||(LayersMode={}));export var LayerMode;(function(s){s[s.Unset=0]="Unset",s[s.AlwaysVisible=1]="AlwaysVisible",s[s.AlwaysHidden=2]="AlwaysHidden",s[s.TurnedOn=3]="TurnedOn",s[s.TurnedOff=4]="TurnedOff"})(LayerMode||(LayerMode={}));export class Layer{constructor(){this.basePriority=0,this.name="",this.description="",this.frozen=!1,this.rect=null,this.viewbox=null,this.configured=!1,this.childLayers=[],this.rootParent=null,this.mode=LayerMode.Unset,this.children=[],this.loaded=!1,this.visible=!1}get shortName(){return g(this.description)}}a([h],Layer.prototype,"loaded",void 0),a([h],Layer.prototype,"visible",void 0);export default class l{constructor(){this.layers=[],this.mode=LayersMode.Default,this.layersLoaded=!1,this.updateVisibilityTimeout=0,this.selectFloorTimeout=0}get visible(){return this.layers.filter(r=>r.frozen||r.visible)}get loaded(){return this.layers.filter(r=>r.loaded)}get rectangle(){const r=this.visible.filter(t=>!t.frozen).map(t=>t.viewbox??t.rect).filter(t=>!!t);return this.mode!==LayersMode.Radio||!r.length?null:d.fromUnion(...r)||null}get viewboxRectangle(){const r=this.visible.filter(t=>!t.frozen).map(t=>t.viewbox).filter(t=>!!t);return r.length&&d.fromUnion(...r)||null}get pathwayLayers(){return this.layers.filter(r=>r.pathway)}get floors(){if(!v())return[];const r=new Set(this.layers.filter(e=>e&&!e.frozen&&!e.rootParent&&!e.pathway).concat(n.routeStore.layers.filter(e=>e&&e.mode!==LayerMode.AlwaysHidden&&e.mode!==LayerMode.AlwaysVisible))),t=Array.from(r).reverse();return t.map((e,i)=>{const o=n.routeStore.layers.length>0&&n.routeStore.layers.indexOf(e)===-1,u=n.toursStore.tourLayers.length>0&&n.toursStore.tourLayers.indexOf(e)===-1;return{layer:e,name:e.name,shortName:e.shortName,description:e.description,active:e.visible,disabled:!!(o||u),index:e.floorIndex??t.length-i-1}})}selectFloor(r){if(this.selectFloorTimeout)return;this.selectFloorTimeout=window.setTimeout(()=>this.selectFloorTimeout=0,500);const t=this.layers.find(i=>i.description===r.description);if(!t)return;if(this.mode===LayersMode.Radio){if(this.updateVisibility(t,!0),n.maplibreStore.showMaplibre)return;if(!!w().__fpSettings?.fpVer||x.includes(b.EXPO)){const o=t.viewbox??t.rect;n.uiState.moveToRect=o}else{const o=this.layers.indexOf(this.layers.filter(p=>!p.frozen&&p.visible)[0]),u=this.layers.indexOf(t);if(o===u)return;n.uiState.zoomBy=u<o?.95:1.05}}else this.updateVisibility(t,!t.visible);const e=n.toursStore.getTourLayerInfo(t.name)||n.toursStore.getTourLayerInfo(t.description);if(e){this.showPathWay(e.id);return}n.toursStore.stopTour()}updateVisibility(r,t){if(this.mode===LayersMode.Radio&&!t)return;const e=r instanceof Layer?r:this.findLayer(r);if(!e||e.visible===t){e&&n.routeStore.currentRouteLayer!==e&&(n.routeStore.currentRouteLayer=e);return}y(e,n.rendererService).then(()=>{this.mode===LayersMode.Radio&&this.layers.filter(i=>!i.pathway).forEach(i=>{i.name!==e.name&&!i.frozen&&i.visible&&(i.visible=!1,i.childLayers.forEach(o=>{o.visible=!1}))}),e&&(e.visible=t,e.childLayers.forEach(i=>{i.visible=t}),t&&(n.routeStore.currentRouteLayer=e),typeof n.fp.onFloorActivated=="function"&&(clearTimeout(this.updateVisibilityTimeout),this.updateVisibilityTimeout=window.setTimeout(()=>{const i=n.fp.getFloors();n.fp.onFloorActivated(i.find(o=>o.name===e.name))})))})}findLayer(r){if(r==null)return null;const t=this.layers.filter(o=>!o.rootParent);if(typeof r=="number"){const o=t.filter(u=>!u.frozen)[r];if(o)return o}const e=r.toString().toLowerCase(),i=t.find(o=>{const u=(o.name.match(/(-?[0-9]+)/)||"")[0];return e===o?.name.toLowerCase()||e===o?.description.toLowerCase()||e===o?.shortName.toLowerCase()||e===u});return i||(/\D/.test(e)?null:t.filter(o=>!o.frozen)[parseInt(e)]??null)}getPathwayList(){return this.layers.filter(r=>r.pathway)}async showPathWay(r){try{const t=this.findLayer(r);if(!t)throw new Error(`There is no pathway with this name. ${r}`);await y(t,n.rendererService);const e=this.getPathwayList();m(()=>{e.forEach(i=>{const o=i.name===r;i.visible=o,i.childLayers.forEach(u=>{u.visible=o})})})}catch(t){console.error("showPathWay",t)}}hidePathways(){this.getPathwayList().forEach(t=>{t.visible=!1,t.childLayers.forEach(e=>{e.visible=!1})})}}a([h],l.prototype,"layers",void 0),a([h],l.prototype,"defaultLayer",void 0),a([h],l.prototype,"mode",void 0),a([h],l.prototype,"layersLoaded",void 0),a([f({keepAlive:!0})],l.prototype,"visible",null),a([f({keepAlive:!0})],l.prototype,"loaded",null),a([f({keepAlive:!0})],l.prototype,"rectangle",null),a([f({keepAlive:!0})],l.prototype,"viewboxRectangle",null),a([f],l.prototype,"pathwayLayers",null),a([f],l.prototype,"floors",null),a([c],l.prototype,"selectFloor",null),a([c],l.prototype,"updateVisibility",null),a([c],l.prototype,"showPathWay",null),a([c],l.prototype,"hidePathways",null);
@@ -1,28 +1,27 @@
1
- import { Point } from '@expofp/geometry';
2
- import { ArbitraryPoint, type RouteLine } from '../wayfinding';
3
- import { Booth } from './BoothStore';
4
- import { Exhibitor } from './ExhibitorStore';
5
- import { Layer } from './LayerStore';
6
- import RootStore from './RootStore';
1
+ import { type ArbitraryPoint, type RouteLine } from '../wayfinding';
2
+ import { type Booth } from './BoothStore';
3
+ import type { Exhibitor } from './ExhibitorStore';
4
+ import { type Layer } from './LayerStore';
5
+ import type RootStore from './RootStore';
7
6
  export default class RouteStore {
8
7
  rootStore: RootStore;
9
- cpTimeout: number;
8
+ cpTimeout: number | undefined;
10
9
  routeLines: RouteLine[];
11
- routeDistance: number;
12
- currentPosition: CurrentPosition;
10
+ routeDistance: number | null;
11
+ currentPosition: CurrentPosition | null;
13
12
  requestCompass: boolean;
14
13
  iconType: number;
15
- tempToBooth: Booth;
14
+ tempToBooth: Booth | null;
16
15
  focusEnabled: boolean;
17
- prevZ: string;
16
+ prevZ: string | null;
18
17
  markersData: MarkersData;
19
18
  prevMarkers: Marker[];
20
19
  /** Cancels the camera move still waiting for a floor to come on screen (see `revealLayer`). */
21
20
  private pendingReveal;
22
21
  showAccessible: boolean;
23
22
  onlyAccessible: boolean;
24
- currentRouteLayer: Layer;
25
- currentRouteExhibitor: Exhibitor;
23
+ currentRouteLayer: Layer | null;
24
+ currentRouteExhibitor: Exhibitor | null;
26
25
  constructor(rootStore: RootStore);
27
26
  get canFindLocation(): boolean;
28
27
  selectRoute(route: Route | null, resetList?: boolean, immediate?: boolean): void;
@@ -33,7 +32,7 @@ export default class RouteStore {
33
32
  setStartPoint(booth: Booth): void;
34
33
  get pathLayers(): {
35
34
  id: number;
36
- layer: Layer;
35
+ layer: Layer | null;
37
36
  }[];
38
37
  /**
39
38
  * Used only by the SDK `getBooth(RouteWaypoint)` path for coord-form
@@ -47,7 +46,7 @@ export default class RouteStore {
47
46
  get selectedMarkers(): Marker[];
48
47
  get layers(): Layer[];
49
48
  clickRoute(from: Booth, to: Booth): void;
50
- selectCurrentPosition(point: CurrentPosition, focus?: boolean, icon?: number): void;
49
+ selectCurrentPosition(point: CurrentPosition | null, focus?: boolean, icon?: number): void;
51
50
  findLocation(): void;
52
51
  /** The dot, plus — when it lies outside the drawing — enough of the nearest map edge for context. */
53
52
  private findLocationRect;
@@ -91,7 +90,8 @@ export declare class Route {
91
90
  waypoints?: Booth[] | undefined;
92
91
  constructor(from: Booth | ArbitraryPoint | null, to: Booth | ArbitraryPoint | null, waypoints?: Booth[] | undefined);
93
92
  }
94
- export declare class CurrentPosition extends Point {
93
+ /** Where the blue dot is: plan coordinates, the floor it sits on, and the bearing it faces. */
94
+ export declare class CurrentPosition {
95
95
  x: number;
96
96
  y: number;
97
97
  z?: number | string | undefined;