@expofp/floorplan 3.10.0 → 3.10.1

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 (111) hide show
  1. package/dist/browser/{Button-CbNlJYq-.js → Button-DdPvRBTh.js} +5 -5
  2. package/dist/browser/{CookieConsent-BVLqsKtm.js → CookieConsent-C39dYjaQ.js} +7 -7
  3. package/dist/browser/{Debug-DniNgMUO.js → Debug-B5r6LCAX.js} +7 -7
  4. package/dist/browser/{Demo-BXOuVfdG.js → Demo-Dbrjn3oi.js} +9 -9
  5. package/dist/browser/{Free-DbDrs1SH.js → Free-DUcGDkLZ.js} +9 -9
  6. package/dist/browser/{Gallery-CK2yO-rS.js → Gallery-CvO5_8hs.js} +9 -9
  7. package/dist/browser/{GpsLoader-B5WB_xlb.js → GpsLoader-Cybs-6Z0.js} +21 -21
  8. package/dist/browser/{KioskStore-CzIrPa11.js → KioskStore-Df_lwtgJ.js} +34 -34
  9. package/dist/browser/{MaplibreAdapter-CSa9XGJa.js → MaplibreAdapter-BgOzaHlx.js} +2387 -2387
  10. package/dist/browser/{ModalContainer-CduduGaw.js → ModalContainer-DXVCm1fb.js} +10 -10
  11. package/dist/browser/{PermissionNotice-B62dyKda.js → PermissionNotice-B0OJFFky.js} +6 -6
  12. package/dist/browser/{SetKioskMode-DvbL360U.js → SetKioskMode-BdOX40be.js} +12 -12
  13. package/dist/browser/ShowKiosk-cvnSTpd2.js +28 -0
  14. package/dist/browser/{TouchHand-BHu7qEu9.js → TouchHand-RDWCILm_.js} +4 -4
  15. package/dist/browser/{ViewerMenuPanel-TTUNLqUt.js → ViewerMenuPanel-BlCzm_mm.js} +10 -10
  16. package/dist/browser/{add-debug-secret-listener-DN1tIBbN.js → add-debug-secret-listener-lYBneebf.js} +1 -1
  17. package/dist/browser/{boolean-editor-CcJuEdkU.js → boolean-editor-C_bdHxC2.js} +9 -9
  18. package/dist/browser/{bootIntercom-DyEAiiah.js → bootIntercom-Bf4CaruD.js} +2 -2
  19. package/dist/browser/booth-by-xy-WnHwiopn.js +1067 -0
  20. package/dist/browser/{browser-Ctb0x-hW.js → browser-BGtGwkTn.js} +2 -2
  21. package/dist/browser/bundle.json +62 -62
  22. package/dist/browser/{classnames-CeriETl9.js → classnames-DRy7JPyJ.js} +2 -2
  23. package/dist/browser/{client-hS_SUT9J.js → client-BE52OM0U.js} +4 -4
  24. package/dist/browser/{components-CcIkwnTn.js → components-BfKSs6sY.js} +1647 -1647
  25. package/dist/browser/{debug-overlay-DBRVNju-.js → debug-overlay-mKmIzOYk.js} +10 -10
  26. package/dist/browser/{debug-ui-Vy_hMYMs.js → debug-ui-DLxMK2XU.js} +6 -6
  27. package/dist/browser/{dist-CyHdGr2I.js → dist-DSRSA5oz.js} +6 -6
  28. package/dist/browser/{dist-Bimiy1i5.js → dist-QsCYWHCu.js} +5 -5
  29. package/dist/browser/{dist-D3O88lUU.js → dist-eojWwYB5.js} +3 -3
  30. package/dist/browser/{efp-debug-init-C0HXaTIA.js → efp-debug-init-C5HgsgC2.js} +2 -2
  31. package/dist/browser/{enum-editor-DkQTyshB.js → enum-editor-BqpFqXiM.js} +11 -11
  32. package/dist/browser/{es5-BI29YLB7.js → es5-7bslpbjj.js} +2 -2
  33. package/dist/browser/{event-not-found-C45GofSi.js → event-not-found-Bc1SpnKw.js} +1 -1
  34. package/dist/browser/{exports-B2fVUjK8.js → exports-CYJRF2aW.js} +1 -1
  35. package/dist/browser/{favicon-CZB9txqZ.js → favicon-CRiidRYo.js} +1 -1
  36. package/dist/browser/{fetch-retry.umd-C_1YSqZv.js → fetch-retry.umd-Btwt1fg_.js} +2 -2
  37. package/dist/browser/{flex-C4nAB--c.js → flex-ITkzmA3C.js} +5 -5
  38. package/dist/browser/{floorplan.loader-D9ci7TWk.js → floorplan.loader-DJVlfwah.js} +11 -11
  39. package/dist/browser/{floorplan.ready-Cou1AYpA.js → floorplan.ready-7KwBZy9I.js} +156 -156
  40. package/dist/browser/{fuse-DLH3KYAO.js → fuse-CcYz7YAl.js} +2 -2
  41. package/dist/browser/{i18n-C0K3C5Jv.js → i18n-CeVxHTr1.js} +4 -4
  42. package/dist/browser/index.js +12 -12
  43. package/dist/browser/{index.module-BMETmKP4.js → index.module-CV2WVv52.js} +4 -4
  44. package/dist/browser/{is-webview-CxvtAxIZ.js → is-webview-BOqof5Uq.js} +1 -1
  45. package/dist/browser/{jsx-runtime-B9nB58Uq.js → jsx-runtime-BiSrB4Oo.js} +2 -2
  46. package/dist/browser/{lib-CcxG8Udi.js → lib-Dg9vXDVM.js} +4 -4
  47. package/dist/browser/{loadImage-B-fxupzg.js → loadImage-VYhbBgH6.js} +4 -4
  48. package/dist/browser/{logDeviceInfo-kZTVPeyv.js → logDeviceInfo-B8Mi-9H5.js} +9 -9
  49. package/dist/browser/{main-B_62LzEM.js → main-D6ItQIYj.js} +1 -1
  50. package/dist/browser/{mobx-CUQ-tbco.js → mobx-Deoo_wpx.js} +4 -4
  51. package/dist/browser/{particles.min-Csuxu9yr.js → particles.min-BNwqgit-.js} +2 -2
  52. package/dist/browser/{prop-types-B7Gun2Sn.js → prop-types-CuEYshV7.js} +2 -2
  53. package/dist/browser/{react-ZKXuYPAa.js → react-BMPhuMz9.js} +2 -2
  54. package/dist/browser/{react-dom-D82ielqJ.js → react-dom-DSdkXj0b.js} +3 -3
  55. package/dist/browser/{reset-all-settings-BwbmLw6_.js → reset-all-settings-C2yTiJ1V.js} +7 -7
  56. package/dist/browser/{rolldown-runtime-75nnKCA3.js → rolldown-runtime-I1EwXf_t.js} +1 -1
  57. package/dist/browser/{settings-CfbArDtc.js → settings-Dr8bs0FB.js} +2 -2
  58. package/dist/browser/{settings-item-R9UibMb5.js → settings-item-DjfyQTQB.js} +6 -6
  59. package/dist/browser/{store-DANngpFy.js → store-CVdrQCza.js} +6737 -5892
  60. package/dist/browser/{string-editor-CURRcjvv.js → string-editor-3sN4j-ci.js} +7 -7
  61. package/dist/browser/{theme-Nw3wi1eA.js → theme-BSTLt6eV.js} +8 -8
  62. package/dist/browser/{ui-CzHA_XVw.js → ui-CiFfwrN8.js} +8 -8
  63. package/dist/browser/{useRenderTarget-KMx97ZHc.js → useRenderTarget-DF7LdnYr.js} +4 -4
  64. package/dist/esm/components/Map/Map.js +1 -1
  65. package/dist/esm/components/Maplibre/useWayfindingAndMarkers.js +1 -1
  66. package/dist/esm/store/RouteStore.d.ts +1 -2
  67. package/dist/esm/store/RouteStore.js +1 -1
  68. package/dist/esm/wayfinding/adapters/canvasIconProvider.d.ts +1 -1
  69. package/dist/esm/wayfinding/adapters/canvasIconProvider.js +1 -1
  70. package/dist/esm/wayfinding/adapters/graphDataSource.d.ts +2 -1
  71. package/dist/esm/wayfinding/adapters/graphDataSource.js +1 -1
  72. package/dist/esm/wayfinding/adapters/index.d.ts +3 -4
  73. package/dist/esm/wayfinding/adapters/index.js +1 -1
  74. package/dist/esm/wayfinding/bindMobxReactions.d.ts +6 -0
  75. package/dist/esm/wayfinding/bindMobxReactions.js +1 -1
  76. package/dist/esm/wayfinding/core/__tests__/helpers.d.ts +4 -4
  77. package/dist/esm/wayfinding/core/createWayfindingEngine.js +1 -1
  78. package/dist/esm/wayfinding/core/graph/buildGraph.d.ts +1 -1
  79. package/dist/esm/wayfinding/core/graph/buildNGraph.d.ts +2 -2
  80. package/dist/esm/wayfinding/core/graph/findShortestPath.d.ts +2 -2
  81. package/dist/esm/wayfinding/core/graph/graphHelpers.d.ts +4 -4
  82. package/dist/esm/wayfinding/core/graph/graphHelpers.js +1 -1
  83. package/dist/esm/wayfinding/core/graph/linkCost.d.ts +2 -2
  84. package/dist/esm/wayfinding/core/index.d.ts +8 -8
  85. package/dist/esm/wayfinding/core/index.js +1 -1
  86. package/dist/esm/wayfinding/core/position/gpsThreshold.d.ts +2 -2
  87. package/dist/esm/wayfinding/core/routing/getRouteLength.d.ts +1 -1
  88. package/dist/esm/wayfinding/core/types.d.ts +19 -9
  89. package/dist/esm/wayfinding/createWayfinding.d.ts +15 -1
  90. package/dist/esm/wayfinding/createWayfinding.js +1 -1
  91. package/dist/esm/wayfinding/handlers/yahHandler.d.ts +3 -3
  92. package/dist/esm/wayfinding/handlers/yahHandler.js +1 -1
  93. package/dist/esm/wayfinding/index.d.ts +13 -0
  94. package/dist/esm/wayfinding/index.js +1 -0
  95. package/dist/esm/wayfinding/renderer/createWayfindingRenderer.js +1 -1
  96. package/dist/esm/wayfinding/renderer/iconManager.d.ts +3 -3
  97. package/dist/esm/wayfinding/renderer/routeLineManager.d.ts +5 -5
  98. package/dist/esm/wayfinding/renderer/trailManager.d.ts +2 -2
  99. package/dist/esm/wayfinding/runtime/createWayfindingRuntime.js +1 -1
  100. package/dist/esm/wayfinding/runtime/endpointView.d.ts +1 -2
  101. package/dist/esm/wayfinding/runtime/positionTrailView.d.ts +5 -6
  102. package/dist/esm/wayfinding/runtime/positionView.d.ts +2 -3
  103. package/dist/esm/wayfinding/runtime/routeUpdate.d.ts +3 -3
  104. package/dist/esm/wayfinding/runtime/trailView.d.ts +1 -2
  105. package/dist/esm/wayfinding/runtime/transitionView.d.ts +2 -3
  106. package/dist/esm/wayfinding/runtime/types.d.ts +10 -2
  107. package/package.json +4 -4
  108. package/dist/browser/ShowKiosk-CK47Q2V7.js +0 -28
  109. package/dist/browser/createWayfinding-D3oRCnRo.js +0 -1892
  110. package/dist/esm/wayfinding/adapters/iconProvider.d.ts +0 -15
  111. package/dist/esm/wayfinding/adapters/iconProvider.js +0 -1
@@ -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.10.0" };
4
+ e.SENTRY_RELEASE = { id: "3.10.1" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "888fc155-fb35-4159-9302-91880886e35d", e._sentryDebugIdIdentifier = "sentry-dbid-888fc155-fb35-4159-9302-91880886e35d");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-75nnKCA3.js";
10
- import { t } from "./react-ZKXuYPAa.js";
11
- import { t as n } from "./jsx-runtime-B9nB58Uq.js";
12
- import { D as r, i, l as a, n as o, s, u as c, y as l } from "./flex-C4nAB--c.js";
13
- import { t as u } from "./classnames-CeriETl9.js";
14
- import { t as d } from "./settings-item-R9UibMb5.js";
9
+ import { r as e } from "./rolldown-runtime-I1EwXf_t.js";
10
+ import { t } from "./react-BMPhuMz9.js";
11
+ import { t as n } from "./jsx-runtime-BiSrB4Oo.js";
12
+ import { D as r, i, l as a, n as o, s, u as c, y as l } from "./flex-ITkzmA3C.js";
13
+ import { t as u } from "./classnames-DRy7JPyJ.js";
14
+ import { t as d } from "./settings-item-DjfyQTQB.js";
15
15
  //#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._925f851475345a9e5e368d312bb98178/node_modules/@radix-ui/themes/dist/esm/components/text-field.props.js
16
16
  var f = {
17
17
  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.10.0" };
4
+ e.SENTRY_RELEASE = { id: "3.10.1" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "b674b3f0-1e85-4d5b-b554-fb365f6d1945", e._sentryDebugIdIdentifier = "sentry-dbid-b674b3f0-1e85-4d5b-b554-fb365f6d1945");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-75nnKCA3.js";
10
- import { t } from "./react-ZKXuYPAa.js";
11
- import { t as n } from "./jsx-runtime-B9nB58Uq.js";
12
- import { t as r } from "./react-dom-D82ielqJ.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-C4nAB--c.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-CyHdGr2I.js";
15
- import { t as y } from "./classnames-CeriETl9.js";
9
+ import { r as e } from "./rolldown-runtime-I1EwXf_t.js";
10
+ import { t } from "./react-BMPhuMz9.js";
11
+ import { t as n } from "./jsx-runtime-BiSrB4Oo.js";
12
+ import { t as r } from "./react-dom-DSdkXj0b.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-ITkzmA3C.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-DSRSA5oz.js";
15
+ import { t as y } from "./classnames-DRy7JPyJ.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_070bcfa32421a5876e7dcb93369fcbee/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.10.0" };
4
+ e.SENTRY_RELEASE = { id: "3.10.1" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "43912113-9328-4069-8890-5091c8745c34", e._sentryDebugIdIdentifier = "sentry-dbid-43912113-9328-4069-8890-5091c8745c34");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-75nnKCA3.js";
10
- import { a as t, r as n } from "./reset-all-settings-BwbmLw6_.js";
11
- import { t as r } from "./jsx-runtime-B9nB58Uq.js";
12
- import "./settings-CfbArDtc.js";
13
- import { t as i } from "./browser-Ctb0x-hW.js";
14
- import { t as a } from "./add-debug-secret-listener-DN1tIBbN.js";
9
+ import { r as e } from "./rolldown-runtime-I1EwXf_t.js";
10
+ import { a as t, r as n } from "./reset-all-settings-C2yTiJ1V.js";
11
+ import { t as r } from "./jsx-runtime-BiSrB4Oo.js";
12
+ import "./settings-Dr8bs0FB.js";
13
+ import { t as i } from "./browser-BGtGwkTn.js";
14
+ import { t as a } from "./add-debug-secret-listener-lYBneebf.js";
15
15
  //#region ../debug/src/lib/ui/render-debug-ui.tsx
16
16
  var o = /* @__PURE__ */ e(i(), 1), s = r(), c = !1;
17
17
  function l() {
@@ -26,7 +26,7 @@ function l() {
26
26
  }
27
27
  });
28
28
  let i = async (t) => {
29
- let { DebugUi: n } = await import("./debug-ui-Vy_hMYMs.js"), { createRoot: i } = await import("./client-hS_SUT9J.js").then((t) => /* @__PURE__ */ e(t.default, 1)), a = document.createElement("div");
29
+ let { DebugUi: n } = await import("./debug-ui-DLxMK2XU.js"), { createRoot: i } = await import("./client-BE52OM0U.js").then((t) => /* @__PURE__ */ e(t.default, 1)), a = document.createElement("div");
30
30
  document.body.appendChild(a), i(a).render(/* @__PURE__ */ (0, s.jsx)(n, {
31
31
  useDebugButtonState: r.useState,
32
32
  open: t
@@ -1,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.10.0" };
4
+ e.SENTRY_RELEASE = { id: "3.10.1" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "d4febe97-784c-4cf8-93f1-f2e3b29f8347", e._sentryDebugIdIdentifier = "sentry-dbid-d4febe97-784c-4cf8-93f1-f2e3b29f8347");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-75nnKCA3.js";
10
- import { t } from "./react-ZKXuYPAa.js";
11
- import { s as n } from "./store-DANngpFy.js";
9
+ import { r as e } from "./rolldown-runtime-I1EwXf_t.js";
10
+ import { t } from "./react-BMPhuMz9.js";
11
+ import { s as n } from "./store-CVdrQCza.js";
12
12
  //#region src/utils/getRenderTargetFromRoot.ts
13
13
  var r = /* @__PURE__ */ e(t(), 1);
14
14
  function i(e) {
@@ -1 +1 @@
1
- import{jsx as C,jsxs as N,Fragment as oe}from"react/jsx-runtime";import{Box as k}from"@expofp/geometry";import te from"classnames";import re from"color";import{observable as ne,reaction as ie}from"mobx";import{useObserver as ae}from"mobx-react-lite";import{useEffect as se,useMemo as le,useRef as S,useState as me}from"react";import{DEBUG_STORAGE_KEY as O}from"../../constants";import ce from"../../data";import{fpGeo as fe}from"../../data/fpGeo";import{svgArea as X}from"../../data/svg";import{boxToRenderer as L,createSceneDef as de,mapRollSetting as U}from"../../renderer";import{pickDefaultScene as A,pickDefaultScenePoint as ue}from"../../renderer/engine-core/defs";import a,{boothStore as pe,layersStore as h,uiState as o}from"../../store";import{BoothBase as j}from"../../store/BoothStore";import{Category as he}from"../../store/CategoryStore";import{Exhibitor as Z}from"../../store/ExhibitorStore";import{LayerMode as R}from"../../store/LayerStore";import{CurrentPosition as ve,Route as ye}from"../../store/RouteStore";import B from"../../tools/logger";import p from"../../tools/settings";import be from"../../ui/Draggable";import{areLayersEnabled as ge}from"../../utils/areLayersEnabled";import{applyVenueDimValue as we,createDimmingAnimator as Se}from"../../utils/dimming";import{convertGpsToLocal as Re}from"../../utils/gps";import y from"../../utils/is-debug";import{isPathwayLayer as $}from"../../utils/is-pathway-layer";import{useReaction as d}from"../../utils/mobx";import{createWayfinding as xe}from"../../wayfinding/createWayfinding";import K from"./booth-by-xy";import Te from"./drawing/config/config-all";import{configMarkers as Ce,getMarkerFromClick as ke}from"./drawing/config/config-markers";import{loadLayersImages as Le}from"./drawing/config/loadBoothsImages";import{useBuildRoute as Be}from"./traffic/useBuildRoute";import{useManageTraffic as Ee}from"./traffic/useManageTraffic";const V=Number.isFinite(p.maxZoom);export default function Me(){let E={};const W="#ebebeb",v=S(),b=le(()=>ne({moving:!1,prevLevel:a.layerStore.layers.find(e=>!e.frozen&&e.visible)}),[]),l=a.rendererService,x=S(Se(e=>we(l,e)));let s;const g=S(null),M=S(null);let P=null,z=null,I=!1;function _(){h.layers.forEach(e=>{e.configured=!1,e.children=[],e.loaded=!1})}const[H,q]=me(()=>typeof window<"u"&&window.localStorage?localStorage.getItem(O)!=="false":!0);d(()=>a.routeStore.currentRouteLayer,()=>{if(!l.scene||b.prevLevel===a.routeStore.currentRouteLayer)return;const e=l.scene.rootLayer.children.filter(t=>a.layerStore.floors.some(n=>t.name.includes(n.name)));let r=a.routeStore.currentRouteLayer.name;if(!e.find(t=>t.name===r))return;const i=e?.map(t=>(t.name===r&&(t.hidden=!1),t.name===b.prevLevel?.name&&(t.hidden=!0),t));b.prevLevel=a.routeStore.currentRouteLayer,l.update(...i)}),d(()=>o.centerMap,()=>{!o.centerMap||a.maplibreStore.showMaplibre||(s.controls.resetCamera({zoom:!!(o.list.type==="search"&&o.list.text)}),o.centerMap=!1)}),se(()=>{if(!v.current)return;async function e(){_(),h.layersLoaded=!1;let r={};try{if(y){const t=document.createElement("canvas").getContext("webgl2"),n=t&&t.getExtension("EXT_disjoint_timer_query_webgl2"),m=(await import("stats-gl")).default,f=new m({trackGPU:n,horizontal:!0}),u=M.current;if(!u)throw new Error("memoryInfoPanel not found.");f.dom.style.position="relative",u.style.width=`${90*(n?3:2)}px`,u.style.height="48px",u.appendChild(f.dom),r={stats:f,memoryInfoPanel:u}}}catch(i){console.error(i)}s=l.create({canvas:v.current,ui:r}),g.current=s,ie(()=>o.canvasVisibleRectPx,(i,t)=>{i&&(s.visibleRect=L(i)),t.dispose()},{fireImmediately:!0}),Te(l).then(i=>{if(I||g.current!==s)return;y&&console.log("Renderer settings",s);const t=re(p.backgroundColor==="none"?W:p.backgroundColor).string();E=de(i,X,t),l.start(E),x.current.setTarget(o.dimmed,{immediate:!0}),U(s,a.fp.enableRotation?1:0),V&&s.viewport.setMaxZoom(p.maxZoom),h.layersLoaded=!0,a.fp.onFpConfigured&&a.fp?.onFpConfigured(),P=xe(l),z=Ce(l),Le(l)}),s.events.addEventListener("pointer:move",({data:i})=>{if(o.setKioskModeEnabled)return;const{point:t,defs:n}=A(i),c=K(t.x,t.y),m=D(n[0]);o.hoveredBooth=c||m}),s.events.addEventListener("pointer:out",()=>{o.setKioskModeEnabled||(o.hoveredBooth=null)}),s.events.addEventListener("pointer:click",({data:i})=>{if(!o?.rootElement)return;window.__resett&&window.__resett(),o.overlayPosition==="bottom"&&o.overlaySize==="full"&&a.showMap();const{point:t,defs:n}=A(i),{x:c,y:m}=t;if(o.onGetCoordsClick){const w=a.layerStore.layers.find(T=>T.visible&&(T.mode===R.TurnedOn||T.mode===R.TurnedOff));o.onGetCoordsClick({x:c,y:m,z:w?.name||null})}if(o.setKioskModeEnabled)return;if(o.onMarkerClick){const w=ke(c,m,l.scale);y&&console.log("marker",w),o.onMarkerClick(w)}const f=K(t.x,t.y),u=D(n[0]);y&&console.log("boothIdFromClientXy",f,"boothByShape",u,"pointer:click point",t),a.clickBooth(f||u)}),s.events.addEventListener("navigation:change",()=>window.__resett&&window.__resett())}return e(),a.fp.getCenterCoordinates=Q,()=>J()},[]);function J(){I=!0,x.current.stop(),P?.(),z?.(),_(),h.layersLoaded=!1,l.disposeIfCurrent(g.current),g.current=null}function Q(){const e=v.current;if(!v.current)throw new Error("Canvas not ready");const r=ue(s.viewport.canvasToSvg({x:e.clientWidth/2,y:e.clientHeight/2})),t=a.layerStore.visible.find(n=>n.mode===R.TurnedOff||n.mode===R.TurnedOn)?.name||null;return{...r,z:t}}function D(e){return!e||!e.shape?null:pe.booths.find(r=>r.shapes?.find(i=>i.shape==e.shape))}d(()=>o.zoomBy,()=>{if(!o.zoomBy||a.maplibreStore.showMaplibre)return;const e=o.zoomBy;s.controls.zoomBy(e),o.zoomBy=null}),d(()=>o.dimmed,e=>{x.current.setTarget(e)}),d(()=>o.details,()=>{if(!o.onDetails)return;if(!o.details){o.onDetails(null);return}var e=o.details;if(p.EXPO==="wineparis"&&(e instanceof Z&&(e=e.booths[0]),!e))return;let r=null,i=[];e instanceof Z?(r="exhibitor",i=e.booths.map(n=>n.name).sort((n,c)=>n==a.routeStore.tempToBooth?.name?-1:c==a.routeStore.tempToBooth?.name?1:0)):e instanceof j?(r="booth",i=[e.name]):e instanceof ye?(r="route",i=[e.from?.name,e.to?.name].filter(n=>!!n)):e instanceof he&&(r="category",i=e.exhibitors.map(n=>n.booths.map(c=>c.name)).flat());var t={type:r,name:e?.name,id:e?.id,externalId:e?.externalId,boothsNames:i};o.onDetails({...t,...r==="route"?{routeInfo:a.routeStore.routeInfo}:{}})}),d(()=>o.canvasVisibleRectPx,e=>{l.renderer&&(l.renderer.visibleRect=L(e))},{fireImmediately:!0}),d(()=>o.moveToRect,()=>{!o.moveToRect||a.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&&G(o.moveToRect),o.moveToRect=null)}),d(()=>o.rollReset,e=>{e&&(s.controls.resetCamera({roll:!0}),o.rollReset=!1)}),d(()=>o.moveToBooths,()=>{if(B.log("this.moveToBooths",o.moveToBooths),!o.moveToBooths||a.maplibreStore.showMaplibre)return;B.log("watched moveToBooths",o.moveToBooths);const e=o.moveToBooths.filter(r=>r.rect).map(r=>r.rect);e.length!==0&&(G(k.fromUnion(...e)),o.moveToBooths=null)}),d(()=>o.mapSettings,({zoomtime:e,center:r,centerxy:i,bearing:t,roll:n,z:c})=>{if(!(a.maplibreStore.showMaplibre||!l.renderer))try{e&&e!==o.defaultMapSettings.zoomtime&&l.renderer.controls.configure({zoomTime:e/1e3}),a.fp.enableRotation&&U(s,n);let m;if(r){const f=r.split(",").map(Number),u=new ve(void 0,void 0,void 0,void 0,f[0],f[1]);m=Re(u,fe.properties.config)}else if(i){const f=i.split(",").map(Number);m={x:f[0],y:f[1]}}c&&a.fp.activateFloor({name:c}),(m?.x||m?.y)&&l.renderer.controls.panTo(m.x,m.y),Number.isFinite(t)&&l.renderer.controls.rollTo(t)}catch(m){B.error("Error in mapSettings reaction",m)}}),Be({enabled:h.layersLoaded&&o.buildRoute,rendererService:l});const F="routes-api.expofp.com",Y=ce.flags?.busRoutes??!1;Ee({permission:h.layersLoaded&&Y,rendererService:l,dataJsonUrl:`https://${F}/v1/routes?expo=${p.EXPO}`,websocketUrl:`wss://${F}/locations?expo=${p.EXPO}`}),d(()=>a.layerStore.visible,e=>{if(!l.scene)return;const r=e.filter(n=>$(n.name)),t=l.scene.rootLayer.children.filter(n=>$(n.name));t.forEach(n=>{n.hidden=!r.find(c=>c.name===n.name)}),l.update(...t)});function G(e){let r=e;const i=ee(e,X),t=o.selectedRoute?.from,n=t instanceof j?t.layer?.name:t?.layer;o.kioskData&&(!ge()||n===a.routeStore.currentRouteLayer?.name)&&(r=k.fromUnion(e,new k(o.kioskData.x,o.kioskData.y,1,1)));const c=L(r),m={paddingPercent:i,maxZoom:V?void 0:10};if(o.shouldShiftMapRect){s.visibleRect.min={...s.visibleRect.min,x:s.visibleRect.min.x+o.overlayWidthPx},s.visibleRect=s.visibleRect;try{s.controls.zoomTo(c,m)}finally{s.visibleRect.min={...s.visibleRect.min,x:s.visibleRect.min.x-o.overlayWidthPx}}}else s.controls.zoomTo(c,m)}function ee(e,r){return!e||!r?0:(e.area/r.area>.1?15:25)/100}return ae(()=>N(oe,{children:[C("canvas",{style:{width:"100%",height:"100%"},ref:v,className:te({map:!0,moving:b.moving,hidden:a.maplibreStore.showMaplibre}),children:"ExpoFP.com"}),y&&H&&N(be,{className:"debug-fps",children:[C("div",{ref:M}),C("button",{onClick:()=>{typeof window<"u"&&window.localStorage&&localStorage.setItem(O,"false"),q(!1)},style:{padding:"4px 8px",fontSize:"11px",cursor:"pointer",backgroundColor:"#333",color:"#fff",border:"1px solid #555",width:"100%"},children:"Hide debug"})]})]}))}
1
+ import{jsx as C,jsxs as N,Fragment as oe}from"react/jsx-runtime";import{Box as k}from"@expofp/geometry";import te from"classnames";import re from"color";import{observable as ne,reaction as ie}from"mobx";import{useObserver as ae}from"mobx-react-lite";import{useEffect as se,useMemo as le,useRef as S,useState as me}from"react";import{DEBUG_STORAGE_KEY as O}from"../../constants";import ce from"../../data";import{fpGeo as fe}from"../../data/fpGeo";import{svgArea as X}from"../../data/svg";import{boxToRenderer as L,createSceneDef as de,mapRollSetting as U}from"../../renderer";import{pickDefaultScene as A,pickDefaultScenePoint as ue}from"../../renderer/engine-core/defs";import a,{boothStore as pe,layersStore as h,uiState as o}from"../../store";import{BoothBase as j}from"../../store/BoothStore";import{Category as he}from"../../store/CategoryStore";import{Exhibitor as Z}from"../../store/ExhibitorStore";import{LayerMode as R}from"../../store/LayerStore";import{CurrentPosition as ve,Route as ye}from"../../store/RouteStore";import B from"../../tools/logger";import p from"../../tools/settings";import be from"../../ui/Draggable";import{areLayersEnabled as ge}from"../../utils/areLayersEnabled";import{applyVenueDimValue as we,createDimmingAnimator as Se}from"../../utils/dimming";import{convertGpsToLocal as Re}from"../../utils/gps";import y from"../../utils/is-debug";import{isPathwayLayer as $}from"../../utils/is-pathway-layer";import{useReaction as d}from"../../utils/mobx";import{createWayfinding as xe}from"../../wayfinding";import K from"./booth-by-xy";import Te from"./drawing/config/config-all";import{configMarkers as Ce,getMarkerFromClick as ke}from"./drawing/config/config-markers";import{loadLayersImages as Le}from"./drawing/config/loadBoothsImages";import{useBuildRoute as Be}from"./traffic/useBuildRoute";import{useManageTraffic as Ee}from"./traffic/useManageTraffic";const V=Number.isFinite(p.maxZoom);export default function Me(){let E={};const W="#ebebeb",v=S(),b=le(()=>ne({moving:!1,prevLevel:a.layerStore.layers.find(e=>!e.frozen&&e.visible)}),[]),l=a.rendererService,x=S(Se(e=>we(l,e)));let s;const g=S(null),M=S(null);let P=null,z=null,I=!1;function _(){h.layers.forEach(e=>{e.configured=!1,e.children=[],e.loaded=!1})}const[H,q]=me(()=>typeof window<"u"&&window.localStorage?localStorage.getItem(O)!=="false":!0);d(()=>a.routeStore.currentRouteLayer,()=>{if(!l.scene||b.prevLevel===a.routeStore.currentRouteLayer)return;const e=l.scene.rootLayer.children.filter(t=>a.layerStore.floors.some(n=>t.name.includes(n.name)));let r=a.routeStore.currentRouteLayer.name;if(!e.find(t=>t.name===r))return;const i=e?.map(t=>(t.name===r&&(t.hidden=!1),t.name===b.prevLevel?.name&&(t.hidden=!0),t));b.prevLevel=a.routeStore.currentRouteLayer,l.update(...i)}),d(()=>o.centerMap,()=>{!o.centerMap||a.maplibreStore.showMaplibre||(s.controls.resetCamera({zoom:!!(o.list.type==="search"&&o.list.text)}),o.centerMap=!1)}),se(()=>{if(!v.current)return;async function e(){_(),h.layersLoaded=!1;let r={};try{if(y){const t=document.createElement("canvas").getContext("webgl2"),n=t&&t.getExtension("EXT_disjoint_timer_query_webgl2"),m=(await import("stats-gl")).default,f=new m({trackGPU:n,horizontal:!0}),u=M.current;if(!u)throw new Error("memoryInfoPanel not found.");f.dom.style.position="relative",u.style.width=`${90*(n?3:2)}px`,u.style.height="48px",u.appendChild(f.dom),r={stats:f,memoryInfoPanel:u}}}catch(i){console.error(i)}s=l.create({canvas:v.current,ui:r}),g.current=s,ie(()=>o.canvasVisibleRectPx,(i,t)=>{i&&(s.visibleRect=L(i)),t.dispose()},{fireImmediately:!0}),Te(l).then(i=>{if(I||g.current!==s)return;y&&console.log("Renderer settings",s);const t=re(p.backgroundColor==="none"?W:p.backgroundColor).string();E=de(i,X,t),l.start(E),x.current.setTarget(o.dimmed,{immediate:!0}),U(s,a.fp.enableRotation?1:0),V&&s.viewport.setMaxZoom(p.maxZoom),h.layersLoaded=!0,a.fp.onFpConfigured&&a.fp?.onFpConfigured(),P=xe(l,a),z=Ce(l),Le(l)}),s.events.addEventListener("pointer:move",({data:i})=>{if(o.setKioskModeEnabled)return;const{point:t,defs:n}=A(i),c=K(t.x,t.y),m=D(n[0]);o.hoveredBooth=c||m}),s.events.addEventListener("pointer:out",()=>{o.setKioskModeEnabled||(o.hoveredBooth=null)}),s.events.addEventListener("pointer:click",({data:i})=>{if(!o?.rootElement)return;window.__resett&&window.__resett(),o.overlayPosition==="bottom"&&o.overlaySize==="full"&&a.showMap();const{point:t,defs:n}=A(i),{x:c,y:m}=t;if(o.onGetCoordsClick){const w=a.layerStore.layers.find(T=>T.visible&&(T.mode===R.TurnedOn||T.mode===R.TurnedOff));o.onGetCoordsClick({x:c,y:m,z:w?.name||null})}if(o.setKioskModeEnabled)return;if(o.onMarkerClick){const w=ke(c,m,l.scale);y&&console.log("marker",w),o.onMarkerClick(w)}const f=K(t.x,t.y),u=D(n[0]);y&&console.log("boothIdFromClientXy",f,"boothByShape",u,"pointer:click point",t),a.clickBooth(f||u)}),s.events.addEventListener("navigation:change",()=>window.__resett&&window.__resett())}return e(),a.fp.getCenterCoordinates=Q,()=>J()},[]);function J(){I=!0,x.current.stop(),P?.(),z?.(),_(),h.layersLoaded=!1,l.disposeIfCurrent(g.current),g.current=null}function Q(){const e=v.current;if(!v.current)throw new Error("Canvas not ready");const r=ue(s.viewport.canvasToSvg({x:e.clientWidth/2,y:e.clientHeight/2})),t=a.layerStore.visible.find(n=>n.mode===R.TurnedOff||n.mode===R.TurnedOn)?.name||null;return{...r,z:t}}function D(e){return!e||!e.shape?null:pe.booths.find(r=>r.shapes?.find(i=>i.shape==e.shape))}d(()=>o.zoomBy,()=>{if(!o.zoomBy||a.maplibreStore.showMaplibre)return;const e=o.zoomBy;s.controls.zoomBy(e),o.zoomBy=null}),d(()=>o.dimmed,e=>{x.current.setTarget(e)}),d(()=>o.details,()=>{if(!o.onDetails)return;if(!o.details){o.onDetails(null);return}var e=o.details;if(p.EXPO==="wineparis"&&(e instanceof Z&&(e=e.booths[0]),!e))return;let r=null,i=[];e instanceof Z?(r="exhibitor",i=e.booths.map(n=>n.name).sort((n,c)=>n==a.routeStore.tempToBooth?.name?-1:c==a.routeStore.tempToBooth?.name?1:0)):e instanceof j?(r="booth",i=[e.name]):e instanceof ye?(r="route",i=[e.from?.name,e.to?.name].filter(n=>!!n)):e instanceof he&&(r="category",i=e.exhibitors.map(n=>n.booths.map(c=>c.name)).flat());var t={type:r,name:e?.name,id:e?.id,externalId:e?.externalId,boothsNames:i};o.onDetails({...t,...r==="route"?{routeInfo:a.routeStore.routeInfo}:{}})}),d(()=>o.canvasVisibleRectPx,e=>{l.renderer&&(l.renderer.visibleRect=L(e))},{fireImmediately:!0}),d(()=>o.moveToRect,()=>{!o.moveToRect||a.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&&G(o.moveToRect),o.moveToRect=null)}),d(()=>o.rollReset,e=>{e&&(s.controls.resetCamera({roll:!0}),o.rollReset=!1)}),d(()=>o.moveToBooths,()=>{if(B.log("this.moveToBooths",o.moveToBooths),!o.moveToBooths||a.maplibreStore.showMaplibre)return;B.log("watched moveToBooths",o.moveToBooths);const e=o.moveToBooths.filter(r=>r.rect).map(r=>r.rect);e.length!==0&&(G(k.fromUnion(...e)),o.moveToBooths=null)}),d(()=>o.mapSettings,({zoomtime:e,center:r,centerxy:i,bearing:t,roll:n,z:c})=>{if(!(a.maplibreStore.showMaplibre||!l.renderer))try{e&&e!==o.defaultMapSettings.zoomtime&&l.renderer.controls.configure({zoomTime:e/1e3}),a.fp.enableRotation&&U(s,n);let m;if(r){const f=r.split(",").map(Number),u=new ve(void 0,void 0,void 0,void 0,f[0],f[1]);m=Re(u,fe.properties.config)}else if(i){const f=i.split(",").map(Number);m={x:f[0],y:f[1]}}c&&a.fp.activateFloor({name:c}),(m?.x||m?.y)&&l.renderer.controls.panTo(m.x,m.y),Number.isFinite(t)&&l.renderer.controls.rollTo(t)}catch(m){B.error("Error in mapSettings reaction",m)}}),Be({enabled:h.layersLoaded&&o.buildRoute,rendererService:l});const F="routes-api.expofp.com",Y=ce.flags?.busRoutes??!1;Ee({permission:h.layersLoaded&&Y,rendererService:l,dataJsonUrl:`https://${F}/v1/routes?expo=${p.EXPO}`,websocketUrl:`wss://${F}/locations?expo=${p.EXPO}`}),d(()=>a.layerStore.visible,e=>{if(!l.scene)return;const r=e.filter(n=>$(n.name)),t=l.scene.rootLayer.children.filter(n=>$(n.name));t.forEach(n=>{n.hidden=!r.find(c=>c.name===n.name)}),l.update(...t)});function G(e){let r=e;const i=ee(e,X),t=o.selectedRoute?.from,n=t instanceof j?t.layer?.name:t?.layer;o.kioskData&&(!ge()||n===a.routeStore.currentRouteLayer?.name)&&(r=k.fromUnion(e,new k(o.kioskData.x,o.kioskData.y,1,1)));const c=L(r),m={paddingPercent:i,maxZoom:V?void 0:10};if(o.shouldShiftMapRect){s.visibleRect.min={...s.visibleRect.min,x:s.visibleRect.min.x+o.overlayWidthPx},s.visibleRect=s.visibleRect;try{s.controls.zoomTo(c,m)}finally{s.visibleRect.min={...s.visibleRect.min,x:s.visibleRect.min.x-o.overlayWidthPx}}}else s.controls.zoomTo(c,m)}function ee(e,r){return!e||!r?0:(e.area/r.area>.1?15:25)/100}return ae(()=>N(oe,{children:[C("canvas",{style:{width:"100%",height:"100%"},ref:v,className:te({map:!0,moving:b.moving,hidden:a.maplibreStore.showMaplibre}),children:"ExpoFP.com"}),y&&H&&N(be,{className:"debug-fps",children:[C("div",{ref:M}),C("button",{onClick:()=>{typeof window<"u"&&window.localStorage&&localStorage.setItem(O,"false"),q(!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{useEffect as a}from"react";import{createWayfinding as i}from"../../wayfinding/createWayfinding";import{configMarkers as m}from"../Map/drawing/config/config-markers";export function useWayfindingAndMarkers(n,f){a(()=>{if(!n)return;const o=i(f),t=m(f);return()=>{o?.(),t?.()}},[n,f])}
1
+ import{useEffect as r}from"react";import i from"../../store";import{createWayfinding as m}from"../../wayfinding";import{configMarkers as a}from"../Map/drawing/config/config-markers";export function useWayfindingAndMarkers(t,o){r(()=>{if(!t)return;const f=m(o,i),n=a(o);return()=>{f?.(),n?.()}},[t,o])}
@@ -1,6 +1,5 @@
1
1
  import { Point } from '@expofp/geometry';
2
- import { ArbitraryPoint } from '../wayfinding/adapters';
3
- import { RouteLine } from '../wayfinding/core';
2
+ import { ArbitraryPoint, type RouteLine } from '../wayfinding';
4
3
  import { Booth } from './BoothStore';
5
4
  import { Exhibitor } from './ExhibitorStore';
6
5
  import { Layer } from './LayerStore';
@@ -1 +1 @@
1
- import{__esDecorate as a,__runInitializers as r}from"tslib";import{action as h,computed as E,observable as f}from"mobx";import{Box as S,Point as He,boxContainsPoint as Je,pointDistance as Fe}from"@expofp/geometry";import c,{layersStore as L}from".";import{fpGeo as P}from"../data/fpGeo";import{getName as Qe}from"../components/Kiosk/SetKiosk";import{DEFAULT_UNITS as Ne,ORIENTATION_GRANTED_KEY as et}from"../constants";import Be from"../data";import{getLayerSvg as tt,svgArea as k}from"../data/svg";import{GaEventActions as st,sendEventToGa as it}from"../tools/gtag";import Ue from"../tools/logger";import{areLayersEnabled as at}from"../utils/areLayersEnabled";import{calcSpeed as Ze}from"../utils/calcSpeed";import{calcTravelTime as qe}from"../utils/calcTravelTime";import{calculateRelativeBearing as rt,convertGpsToLocal as $e,isValidPointCoords as Ve}from"../utils/gps";import{boothToEndpoint as Ke,CURRENT_LOCATION_NAME as nt,CURRENT_POSITION_POINT_ID as ot,graphDataSource as je,KIOSK_ANCHOR_POINT_ID as lt,toArbitraryPoint as We}from"../wayfinding/adapters";import{createWayfindingEngine as ct}from"../wayfinding/core";import{BoothBase as R}from"./BoothStore";import{uiState as _}from"./index";import{LayersMode as ut}from"./LayerStore";const b=s=>typeof s=="string"?Number(s.replace(",",".")):s;let dt=(()=>{let s=[],n,l=[],p=[],y,v=[],g=[],z,D=[],I=[],A,w=[],M=[],C,G=[],O=[],F,N=[],B=[],U,Z=[],q=[],$,V=[],K=[],j,W=[],X=[],Y,H=[],J=[],Q,ee=[],te=[],se,ie=[],ae=[],re,ne=[],oe=[],le,ce=[],ue=[],de,fe,me,he,pe,_e,ye,ge,ke,be,Re,ve,xe,Ee=[],Te=[],Le,Se,Pe,ze,De,Ie,Ae=[],we=[],Me,Ce,Ge;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[f],y=[f],z=[f],A=[f],C=[f],F=[f],U=[f],$=[f],j=[f],Y=[f],Q=[f],se=[f],re=[f],le=[f],de=[E],fe=[h],me=[h],he=[h],pe=[E({keepAlive:!0})],_e=[h],ye=[h],ge=[E({keepAlive:!0})],ke=[E({keepAlive:!0})],be=[h],Re=[h],ve=[h],xe=[f],Le=[E],Se=[h],Pe=[h],ze=[h],De=[h],Ie=[f],Me=[h],Ce=[E({keepAlive:!0})],Ge=[h],a(this,null,de,{kind:"getter",name:"canFindLocation",static:!1,private:!1,access:{has:e=>"canFindLocation"in e,get:e=>e.canFindLocation},metadata:t},null,s),a(this,null,fe,{kind:"method",name:"selectRoute",static:!1,private:!1,access:{has:e=>"selectRoute"in e,get:e=>e.selectRoute},metadata:t},null,s),a(this,null,me,{kind:"method",name:"rebuildRouteFromPosition",static:!1,private:!1,access:{has:e=>"rebuildRouteFromPosition"in e,get:e=>e.rebuildRouteFromPosition},metadata:t},null,s),a(this,null,he,{kind:"method",name:"setStartPoint",static:!1,private:!1,access:{has:e=>"setStartPoint"in e,get:e=>e.setStartPoint},metadata:t},null,s),a(this,null,pe,{kind:"getter",name:"pathLayers",static:!1,private:!1,access:{has:e=>"pathLayers"in e,get:e=>e.pathLayers},metadata:t},null,s),a(this,null,_e,{kind:"method",name:"setMarkers",static:!1,private:!1,access:{has:e=>"setMarkers"in e,get:e=>e.setMarkers},metadata:t},null,s),a(this,null,ye,{kind:"method",name:"selectMarker",static:!1,private:!1,access:{has:e=>"selectMarker"in e,get:e=>e.selectMarker},metadata:t},null,s),a(this,null,ge,{kind:"getter",name:"selectedMarkers",static:!1,private:!1,access:{has:e=>"selectedMarkers"in e,get:e=>e.selectedMarkers},metadata:t},null,s),a(this,null,ke,{kind:"getter",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers},metadata:t},null,s),a(this,null,be,{kind:"method",name:"clickRoute",static:!1,private:!1,access:{has:e=>"clickRoute"in e,get:e=>e.clickRoute},metadata:t},null,s),a(this,null,Re,{kind:"method",name:"selectCurrentPosition",static:!1,private:!1,access:{has:e=>"selectCurrentPosition"in e,get:e=>e.selectCurrentPosition},metadata:t},null,s),a(this,null,ve,{kind:"method",name:"findLocation",static:!1,private:!1,access:{has:e=>"findLocation"in e,get:e=>e.findLocation},metadata:t},null,s),a(this,null,Le,{kind:"getter",name:"routeInfo",static:!1,private:!1,access:{has:e=>"routeInfo"in e,get:e=>e.routeInfo},metadata:t},null,s),a(this,null,Se,{kind:"method",name:"updateRoute",static:!1,private:!1,access:{has:e=>"updateRoute"in e,get:e=>e.updateRoute},metadata:t},null,s),a(this,null,Pe,{kind:"method",name:"updateRouteDistance",static:!1,private:!1,access:{has:e=>"updateRouteDistance"in e,get:e=>e.updateRouteDistance},metadata:t},null,s),a(this,null,ze,{kind:"method",name:"updateRoutePoints",static:!1,private:!1,access:{has:e=>"updateRoutePoints"in e,get:e=>e.updateRoutePoints},metadata:t},null,s),a(this,null,De,{kind:"method",name:"checkRoutes",static:!1,private:!1,access:{has:e=>"checkRoutes"in e,get:e=>e.checkRoutes},metadata:t},null,s),a(this,null,Me,{kind:"method",name:"setGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"setGpsTrackingEnabled"in e,get:e=>e.setGpsTrackingEnabled},metadata:t},null,s),a(this,null,Ce,{kind:"getter",name:"gpsEnabled",static:!1,private:!1,access:{has:e=>"gpsEnabled"in e,get:e=>e.gpsEnabled},metadata:t},null,s),a(this,null,Ge,{kind:"method",name:"setOnlyAccessible",static:!1,private:!1,access:{has:e=>"setOnlyAccessible"in e,get:e=>e.setOnlyAccessible},metadata:t},null,s),a(null,null,n,{kind:"field",name:"routeLines",static:!1,private:!1,access:{has:e=>"routeLines"in e,get:e=>e.routeLines,set:(e,i)=>{e.routeLines=i}},metadata:t},l,p),a(null,null,y,{kind:"field",name:"routeDistance",static:!1,private:!1,access:{has:e=>"routeDistance"in e,get:e=>e.routeDistance,set:(e,i)=>{e.routeDistance=i}},metadata:t},v,g),a(null,null,z,{kind:"field",name:"currentPosition",static:!1,private:!1,access:{has:e=>"currentPosition"in e,get:e=>e.currentPosition,set:(e,i)=>{e.currentPosition=i}},metadata:t},D,I),a(null,null,A,{kind:"field",name:"requestCompass",static:!1,private:!1,access:{has:e=>"requestCompass"in e,get:e=>e.requestCompass,set:(e,i)=>{e.requestCompass=i}},metadata:t},w,M),a(null,null,C,{kind:"field",name:"iconType",static:!1,private:!1,access:{has:e=>"iconType"in e,get:e=>e.iconType,set:(e,i)=>{e.iconType=i}},metadata:t},G,O),a(null,null,F,{kind:"field",name:"tempToBooth",static:!1,private:!1,access:{has:e=>"tempToBooth"in e,get:e=>e.tempToBooth,set:(e,i)=>{e.tempToBooth=i}},metadata:t},N,B),a(null,null,U,{kind:"field",name:"focusEnabled",static:!1,private:!1,access:{has:e=>"focusEnabled"in e,get:e=>e.focusEnabled,set:(e,i)=>{e.focusEnabled=i}},metadata:t},Z,q),a(null,null,$,{kind:"field",name:"prevZ",static:!1,private:!1,access:{has:e=>"prevZ"in e,get:e=>e.prevZ,set:(e,i)=>{e.prevZ=i}},metadata:t},V,K),a(null,null,j,{kind:"field",name:"markersData",static:!1,private:!1,access:{has:e=>"markersData"in e,get:e=>e.markersData,set:(e,i)=>{e.markersData=i}},metadata:t},W,X),a(null,null,Y,{kind:"field",name:"prevMarkers",static:!1,private:!1,access:{has:e=>"prevMarkers"in e,get:e=>e.prevMarkers,set:(e,i)=>{e.prevMarkers=i}},metadata:t},H,J),a(null,null,Q,{kind:"field",name:"showAccessible",static:!1,private:!1,access:{has:e=>"showAccessible"in e,get:e=>e.showAccessible,set:(e,i)=>{e.showAccessible=i}},metadata:t},ee,te),a(null,null,se,{kind:"field",name:"onlyAccessible",static:!1,private:!1,access:{has:e=>"onlyAccessible"in e,get:e=>e.onlyAccessible,set:(e,i)=>{e.onlyAccessible=i}},metadata:t},ie,ae),a(null,null,re,{kind:"field",name:"currentRouteLayer",static:!1,private:!1,access:{has:e=>"currentRouteLayer"in e,get:e=>e.currentRouteLayer,set:(e,i)=>{e.currentRouteLayer=i}},metadata:t},ne,oe),a(null,null,le,{kind:"field",name:"currentRouteExhibitor",static:!1,private:!1,access:{has:e=>"currentRouteExhibitor"in e,get:e=>e.currentRouteExhibitor,set:(e,i)=>{e.currentRouteExhibitor=i}},metadata:t},ce,ue),a(null,null,xe,{kind:"field",name:"routeUnits",static:!1,private:!1,access:{has:e=>"routeUnits"in e,get:e=>e.routeUnits,set:(e,i)=>{e.routeUnits=i}},metadata:t},Ee,Te),a(null,null,Ie,{kind:"field",name:"isGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"isGpsTrackingEnabled"in e,get:e=>e.isGpsTrackingEnabled,set:(e,i)=>{e.isGpsTrackingEnabled=i}},metadata:t},Ae,we),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=r(this,s);cpTimeout;routeLines=r(this,l,[]);routeDistance=(r(this,p),r(this,v,null));currentPosition=(r(this,g),r(this,D,null));requestCompass=(r(this,I),r(this,w,!1));iconType=(r(this,M),r(this,G,0));tempToBooth=(r(this,O),r(this,N,null));focusEnabled=(r(this,B),r(this,Z,!0));prevZ=(r(this,q),r(this,V,null));markersData=(r(this,K),r(this,W,{icons:[],markers:[]}));prevMarkers=(r(this,X),r(this,H,[]));showAccessible=(r(this,J),r(this,ee,!!je.getLines().find(t=>t.unaccessible)));onlyAccessible=(r(this,te),r(this,ie,!1));currentRouteLayer=(r(this,ae),r(this,ne,null));currentRouteExhibitor=(r(this,oe),r(this,ce,null));constructor(t){r(this,we),this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!_.kioskData||!!this.currentPosition}selectRoute(t,e=!0,i=!1){if(e&&(_.list={type:"search",text:"",focused:!1}),t&&!t.from&&t.to){const d=this.resolveFallbackFrom();d&&(t=new Route(d,t.to,t.waypoints))}t?.from&&t?.to&&t.from===t.to&&(t=null);let o=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from instanceof R&&t.from.visible&&o.push(t.from),t?.to instanceof R&&t.to.visible&&(this.tempToBooth=null,o.push(t.to)),!t&&c.fp.onDirection&&c.fp.onDirection(null);const u=()=>{if(this.rootStore.moveToList(o),_.details=t,t&&(!t.from||!t.to)&&c.showOverlay(),t?.to&&t?.from){const d=ft(t.from);d&&this.rootStore.layerStore.updateVisibility(d,!0)}if(!this.currentRouteLayer){const d=Xe(this.rootStore.layerStore,t?.from),m=Xe(this.rootStore.layerStore,t?.to);d?this.currentRouteLayer=d:m&&(this.currentRouteLayer=m)}e&&t?.from&&t?.to&&it(st.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)};i?u():setTimeout(u,200)}rebuildRouteFromPosition(t){const e=_.selectedRoute;e?.to&&this.selectRoute(new Route(t,e.to,e.waypoints),!1,!0)}resolveFallbackFrom(){if(this.currentPosition)return We(this.currentPosition,nt,ot);const t=_.kioskData;return t?We({x:t.x,y:t.y,z:t.z},Qe(),lt):null}setStartPoint(t){const e=_.selectedRoute;if(e?.to&&!e?.from&&t){const i=new Route(t,e.to,e.waypoints);this.selectRoute(i)}}get pathLayers(){return c.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,i)=>i.indexOf(t)===e).reverse().map((t,e)=>({id:e+1,layer:c.layerStore.findLayer(t)}))}getNearestBooth(t){if(!t)return null;let e=this.rootStore.layerStore.findLayer(t.z);const i=t.lat&&t.lng?$e(t,P.properties.config):t;return this.rootStore.boothStore.booths.filter(o=>L.mode===ut.Default||!e?o.visible&&o.rect:o.rect&&(typeof t.z!="number"&&!t.z&&o.visible||e.name===o.layer?.name)).sort((o,u)=>Fe(i,o.rect.center)-Fe(i,u.rect.center))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(mt),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const i=this.markersData.markers.find(u=>u.id===t);this.markersData.markers.forEach(u=>u.active=!1),i&&(i.active=!0);let o=c.layerStore.findLayer(i?.z);if(e&&i){const u=c.rendererService.renderer;return o&&!o?.visible&&L.updateVisibility(o,!0),u?u.controls.panTo(i.x,i.y):(Ue.warn("Renderer is not initialized. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(t=>t.active)}get layers(){var t=[];return c.routeStore.routeLines?.map(e=>e.p0.layer).reverse().forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>c.layerStore.layers.find(i=>i.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,_.list.type==="route-planner"&&(_.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(t,e))}selectCurrentPosition(t,e=!0,i){clearTimeout(this.cpTimeout),t&&(t.x=b(t.x),t.y=b(t.y),t.lat=b(t.lat),t.lng=b(t.lng),at()||(t.z=null));const o=e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),u=e&&!o&&(this.focusEnabled||this.prevZ!=t?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=i?1:0;const d=t?ht(t):null;if(!d){this.currentPosition=null;return}const m=c.layerStore.findLayer(t.z),x=new CurrentPosition(d.x,d.y,m?.name||this.currentRouteLayer?.name,rt(d),t.lat,t.lng);let Oe=!this.routeLines?.length;if(m&&this.routeLines?.length&&(Oe=!!this.routeLines.find(T=>T.p0.layer===m.name||T.p1.layer===m.name)),u&&Oe){const T=c.rendererService.renderer;if(m&&!m?.visible&&L.updateVisibility(m,!0),!T){Ue.warn("Renderer is not initialized. Cannot pan to current position.");return}T.controls.panTo(x.x,x.y)}this.currentPosition=x,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(!this.canFindLocation)return;if(c.maplibreStore.showMaplibre){_.moveToLocation=!0;return}const t=this.currentPosition??_.kioskData;if(!t)return;this.currentPosition&&localStorage.getItem(et)==="false"&&(c.routeStore.requestCompass=!0);const e=S.fromCenter(t,{x:100,y:100});let i;if(e.intersects(k))i=e;else{const u=Math.max(k.min.x,Math.min(t.x,k.max.x)),d=Math.max(k.min.y,Math.min(t.y,k.max.y)),m=Math.min(k.size.width,k.size.height)*.3,x=S.fromCenter({x:u,y:d},{x:m,y:m}).intersection(k);i=x?S.fromUnion(e,x):e}_.moveToRect=i;const o=c.layerStore.findLayer(t.z);o&&L.updateVisibility(o,!0)}routeUnits=(r(this,ue),r(this,Ee,Ne));get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:qe(t,Ze(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=tt(),i=(e.getAttribute("units")||Ne).toLowerCase?.().trim(),o=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(o?1:10)),this.routeUnits=i,this.updateRoutePoints()}updateRoutePoints(){const t=_.selectedRoute,e=this.routeDistance,i=this.routeUnits;c.fp.onDirection&&setTimeout(()=>{c.fp.onDirection({from:Ye(t?.from??null),to:Ye(t?.to??null),lines:this.routeLines,distance:`${e}${i}`,units:i,time:qe(e,Ze(i))})},200)}checkRoutes(){const t=ct(je),e=c.boothStore.booths;console.info(`Route check started ${e.length}.... `);for(let i=0;i<e.length;i++){const o=e[i];for(let u=i+1;u<e.length;u++){const d=e[u];t.buildRoute(Ke(o),Ke(d)).lines.length||console.warn(`No route found from ${o.name} to ${d.name}`)}}console.info("Route check done....")}isGpsTrackingEnabled=(r(this,Te),r(this,Ae,!0));setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return Be.autoTrackingGps&&this.isGpsTrackingEnabled&&!Be.enableIPS}setOnlyAccessible(t){this.onlyAccessible=t}}})();export default dt;function ft(s){if(s)return s instanceof R?s.layer?.name:s.layer}function Xe(s,n){return n?n instanceof R?n.layer??null:s.findLayer(n.layer):null}function mt(s){return{...s,x:b(s.x),y:b(s.y),lat:b(s.lat),lng:b(s.lng)}}function ht(s){let n=null,l=null;return P&&(n=P.properties.config),n&&Je({min:n.p0,max:n.p2},s)?l={...s}:n&&Ve(s.lat)&&Ve(s.lng)?l=$e(s,n):n||(l=s),l||null}export function findBooth(s){return c.boothStore.findBooth(s)||c.exhibitorStore.findExhibitor(s)?.booths[0]}export function findEntityByExternalId(s){const n=c.boothStore.boothByExternalId.get(s);if(n)return{type:"booth",entity:n};const l=c.exhibitorStore.exhibitorByExternalId.get(s);if(l)return{type:"exhibitor",entity:l}}export function separateExternalIds(s){const n=[],l=[];for(const p of s){const y=findEntityByExternalId(p);y&&(y.type==="booth"?n.push(p):l.push(p))}return{boothExternalIds:n,exhibitorExternalIds:l}}export function extractRoute(s,n,l){return new Route(findBooth(s)??null,findBooth(n)??null,l?.map(p=>findBooth(p)))}export class Route{from;to;waypoints;constructor(n,l,p){this.from=n,this.to=l,this.waypoints=p;const y=n instanceof R?n.id:void 0,v=l instanceof R?l.id:void 0;this.waypoints=p?.filter(g=>g&&g.id!==y&&g.id!==v)}}function Ye(s){return s?s instanceof R?{id:s.id,name:s.name,externalId:s.externalId,layer:{name:s.layer?.name,description:s.layer?.description}}:{id:Number.MAX_SAFE_INTEGER,name:s.name,externalId:void 0,layer:{name:s.layer,description:void 0}}:null}export class CurrentPosition extends He{x;y;z;angle;lat;lng;constructor(n,l,p,y,v,g){super(n,l),this.x=n,this.y=l,this.z=p,this.angle=y,this.lat=v,this.lng=g}}
1
+ import{__esDecorate as a,__runInitializers as r}from"tslib";import{action as m,computed as E,observable as f}from"mobx";import{Box as S,Point as Ye,boxContainsPoint as He,pointDistance as Fe}from"@expofp/geometry";import c,{layersStore as L}from".";import{fpGeo as P}from"../data/fpGeo";import{getName as Je}from"../components/Kiosk/SetKiosk";import{DEFAULT_UNITS as Ne,ORIENTATION_GRANTED_KEY as Qe}from"../constants";import Be from"../data";import{getLayerSvg as et,svgArea as g}from"../data/svg";import{GaEventActions as tt,sendEventToGa as st}from"../tools/gtag";import Ue from"../tools/logger";import{areLayersEnabled as it}from"../utils/areLayersEnabled";import{calcSpeed as Ze}from"../utils/calcSpeed";import{calcTravelTime as qe}from"../utils/calcTravelTime";import{calculateRelativeBearing as at,convertGpsToLocal as $e,isValidPointCoords as Ve}from"../utils/gps";import{boothToEndpoint as Ke,buildRoute as rt,CURRENT_LOCATION_NAME as nt,CURRENT_POSITION_POINT_ID as ot,isWayfindingReady as lt,KIOSK_ANCHOR_POINT_ID as ct,toArbitraryPoint as je}from"../wayfinding";import{BoothBase as R}from"./BoothStore";import{uiState as _}from"./index";import{LayersMode as ut}from"./LayerStore";const b=s=>typeof s=="string"?Number(s.replace(",",".")):s;let dt=(()=>{let s=[],n,l=[],h=[],y,v=[],k=[],z,D=[],I=[],A,w=[],M=[],C,G=[],O=[],F,N=[],B=[],U,Z=[],q=[],$,V=[],K=[],j,W=[],X=[],Y,H=[],J=[],Q,ee=[],te=[],se,ie=[],ae=[],re,ne=[],oe=[],le,ce=[],ue=[],de,fe,me,he,pe,_e,ye,ke,ge,be,Re,ve,xe,Ee=[],Te=[],Le,Se,Pe,ze,De,Ie,Ae=[],we=[],Me,Ce,Ge;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[f],y=[f],z=[f],A=[f],C=[f],F=[f],U=[f],$=[f],j=[f],Y=[f],Q=[f],se=[f],re=[f],le=[f],de=[E],fe=[m],me=[m],he=[m],pe=[E({keepAlive:!0})],_e=[m],ye=[m],ke=[E({keepAlive:!0})],ge=[E({keepAlive:!0})],be=[m],Re=[m],ve=[m],xe=[f],Le=[E],Se=[m],Pe=[m],ze=[m],De=[m],Ie=[f],Me=[m],Ce=[E({keepAlive:!0})],Ge=[m],a(this,null,de,{kind:"getter",name:"canFindLocation",static:!1,private:!1,access:{has:e=>"canFindLocation"in e,get:e=>e.canFindLocation},metadata:t},null,s),a(this,null,fe,{kind:"method",name:"selectRoute",static:!1,private:!1,access:{has:e=>"selectRoute"in e,get:e=>e.selectRoute},metadata:t},null,s),a(this,null,me,{kind:"method",name:"rebuildRouteFromPosition",static:!1,private:!1,access:{has:e=>"rebuildRouteFromPosition"in e,get:e=>e.rebuildRouteFromPosition},metadata:t},null,s),a(this,null,he,{kind:"method",name:"setStartPoint",static:!1,private:!1,access:{has:e=>"setStartPoint"in e,get:e=>e.setStartPoint},metadata:t},null,s),a(this,null,pe,{kind:"getter",name:"pathLayers",static:!1,private:!1,access:{has:e=>"pathLayers"in e,get:e=>e.pathLayers},metadata:t},null,s),a(this,null,_e,{kind:"method",name:"setMarkers",static:!1,private:!1,access:{has:e=>"setMarkers"in e,get:e=>e.setMarkers},metadata:t},null,s),a(this,null,ye,{kind:"method",name:"selectMarker",static:!1,private:!1,access:{has:e=>"selectMarker"in e,get:e=>e.selectMarker},metadata:t},null,s),a(this,null,ke,{kind:"getter",name:"selectedMarkers",static:!1,private:!1,access:{has:e=>"selectedMarkers"in e,get:e=>e.selectedMarkers},metadata:t},null,s),a(this,null,ge,{kind:"getter",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers},metadata:t},null,s),a(this,null,be,{kind:"method",name:"clickRoute",static:!1,private:!1,access:{has:e=>"clickRoute"in e,get:e=>e.clickRoute},metadata:t},null,s),a(this,null,Re,{kind:"method",name:"selectCurrentPosition",static:!1,private:!1,access:{has:e=>"selectCurrentPosition"in e,get:e=>e.selectCurrentPosition},metadata:t},null,s),a(this,null,ve,{kind:"method",name:"findLocation",static:!1,private:!1,access:{has:e=>"findLocation"in e,get:e=>e.findLocation},metadata:t},null,s),a(this,null,Le,{kind:"getter",name:"routeInfo",static:!1,private:!1,access:{has:e=>"routeInfo"in e,get:e=>e.routeInfo},metadata:t},null,s),a(this,null,Se,{kind:"method",name:"updateRoute",static:!1,private:!1,access:{has:e=>"updateRoute"in e,get:e=>e.updateRoute},metadata:t},null,s),a(this,null,Pe,{kind:"method",name:"updateRouteDistance",static:!1,private:!1,access:{has:e=>"updateRouteDistance"in e,get:e=>e.updateRouteDistance},metadata:t},null,s),a(this,null,ze,{kind:"method",name:"updateRoutePoints",static:!1,private:!1,access:{has:e=>"updateRoutePoints"in e,get:e=>e.updateRoutePoints},metadata:t},null,s),a(this,null,De,{kind:"method",name:"checkRoutes",static:!1,private:!1,access:{has:e=>"checkRoutes"in e,get:e=>e.checkRoutes},metadata:t},null,s),a(this,null,Me,{kind:"method",name:"setGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"setGpsTrackingEnabled"in e,get:e=>e.setGpsTrackingEnabled},metadata:t},null,s),a(this,null,Ce,{kind:"getter",name:"gpsEnabled",static:!1,private:!1,access:{has:e=>"gpsEnabled"in e,get:e=>e.gpsEnabled},metadata:t},null,s),a(this,null,Ge,{kind:"method",name:"setOnlyAccessible",static:!1,private:!1,access:{has:e=>"setOnlyAccessible"in e,get:e=>e.setOnlyAccessible},metadata:t},null,s),a(null,null,n,{kind:"field",name:"routeLines",static:!1,private:!1,access:{has:e=>"routeLines"in e,get:e=>e.routeLines,set:(e,i)=>{e.routeLines=i}},metadata:t},l,h),a(null,null,y,{kind:"field",name:"routeDistance",static:!1,private:!1,access:{has:e=>"routeDistance"in e,get:e=>e.routeDistance,set:(e,i)=>{e.routeDistance=i}},metadata:t},v,k),a(null,null,z,{kind:"field",name:"currentPosition",static:!1,private:!1,access:{has:e=>"currentPosition"in e,get:e=>e.currentPosition,set:(e,i)=>{e.currentPosition=i}},metadata:t},D,I),a(null,null,A,{kind:"field",name:"requestCompass",static:!1,private:!1,access:{has:e=>"requestCompass"in e,get:e=>e.requestCompass,set:(e,i)=>{e.requestCompass=i}},metadata:t},w,M),a(null,null,C,{kind:"field",name:"iconType",static:!1,private:!1,access:{has:e=>"iconType"in e,get:e=>e.iconType,set:(e,i)=>{e.iconType=i}},metadata:t},G,O),a(null,null,F,{kind:"field",name:"tempToBooth",static:!1,private:!1,access:{has:e=>"tempToBooth"in e,get:e=>e.tempToBooth,set:(e,i)=>{e.tempToBooth=i}},metadata:t},N,B),a(null,null,U,{kind:"field",name:"focusEnabled",static:!1,private:!1,access:{has:e=>"focusEnabled"in e,get:e=>e.focusEnabled,set:(e,i)=>{e.focusEnabled=i}},metadata:t},Z,q),a(null,null,$,{kind:"field",name:"prevZ",static:!1,private:!1,access:{has:e=>"prevZ"in e,get:e=>e.prevZ,set:(e,i)=>{e.prevZ=i}},metadata:t},V,K),a(null,null,j,{kind:"field",name:"markersData",static:!1,private:!1,access:{has:e=>"markersData"in e,get:e=>e.markersData,set:(e,i)=>{e.markersData=i}},metadata:t},W,X),a(null,null,Y,{kind:"field",name:"prevMarkers",static:!1,private:!1,access:{has:e=>"prevMarkers"in e,get:e=>e.prevMarkers,set:(e,i)=>{e.prevMarkers=i}},metadata:t},H,J),a(null,null,Q,{kind:"field",name:"showAccessible",static:!1,private:!1,access:{has:e=>"showAccessible"in e,get:e=>e.showAccessible,set:(e,i)=>{e.showAccessible=i}},metadata:t},ee,te),a(null,null,se,{kind:"field",name:"onlyAccessible",static:!1,private:!1,access:{has:e=>"onlyAccessible"in e,get:e=>e.onlyAccessible,set:(e,i)=>{e.onlyAccessible=i}},metadata:t},ie,ae),a(null,null,re,{kind:"field",name:"currentRouteLayer",static:!1,private:!1,access:{has:e=>"currentRouteLayer"in e,get:e=>e.currentRouteLayer,set:(e,i)=>{e.currentRouteLayer=i}},metadata:t},ne,oe),a(null,null,le,{kind:"field",name:"currentRouteExhibitor",static:!1,private:!1,access:{has:e=>"currentRouteExhibitor"in e,get:e=>e.currentRouteExhibitor,set:(e,i)=>{e.currentRouteExhibitor=i}},metadata:t},ce,ue),a(null,null,xe,{kind:"field",name:"routeUnits",static:!1,private:!1,access:{has:e=>"routeUnits"in e,get:e=>e.routeUnits,set:(e,i)=>{e.routeUnits=i}},metadata:t},Ee,Te),a(null,null,Ie,{kind:"field",name:"isGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"isGpsTrackingEnabled"in e,get:e=>e.isGpsTrackingEnabled,set:(e,i)=>{e.isGpsTrackingEnabled=i}},metadata:t},Ae,we),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=r(this,s);cpTimeout;routeLines=r(this,l,[]);routeDistance=(r(this,h),r(this,v,null));currentPosition=(r(this,k),r(this,D,null));requestCompass=(r(this,I),r(this,w,!1));iconType=(r(this,M),r(this,G,0));tempToBooth=(r(this,O),r(this,N,null));focusEnabled=(r(this,B),r(this,Z,!0));prevZ=(r(this,q),r(this,V,null));markersData=(r(this,K),r(this,W,{icons:[],markers:[]}));prevMarkers=(r(this,X),r(this,H,[]));showAccessible=(r(this,J),r(this,ee,!1));onlyAccessible=(r(this,te),r(this,ie,!1));currentRouteLayer=(r(this,ae),r(this,ne,null));currentRouteExhibitor=(r(this,oe),r(this,ce,null));constructor(t){r(this,we),this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!_.kioskData||!!this.currentPosition}selectRoute(t,e=!0,i=!1){if(e&&(_.list={type:"search",text:"",focused:!1}),t&&!t.from&&t.to){const d=this.resolveFallbackFrom();d&&(t=new Route(d,t.to,t.waypoints))}t?.from&&t?.to&&t.from===t.to&&(t=null);let o=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from instanceof R&&t.from.visible&&o.push(t.from),t?.to instanceof R&&t.to.visible&&(this.tempToBooth=null,o.push(t.to)),!t&&c.fp.onDirection&&c.fp.onDirection(null);const u=()=>{if(this.rootStore.moveToList(o),_.details=t,t&&(!t.from||!t.to)&&c.showOverlay(),t?.to&&t?.from){const d=ft(t.from);d&&this.rootStore.layerStore.updateVisibility(d,!0)}if(!this.currentRouteLayer){const d=We(this.rootStore.layerStore,t?.from),p=We(this.rootStore.layerStore,t?.to);d?this.currentRouteLayer=d:p&&(this.currentRouteLayer=p)}e&&t?.from&&t?.to&&st(tt.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)};i?u():setTimeout(u,200)}rebuildRouteFromPosition(t){const e=_.selectedRoute;e?.to&&this.selectRoute(new Route(t,e.to,e.waypoints),!1,!0)}resolveFallbackFrom(){if(this.currentPosition)return je(this.currentPosition,nt,ot);const t=_.kioskData;return t?je({x:t.x,y:t.y,z:t.z},Je(),ct):null}setStartPoint(t){const e=_.selectedRoute;if(e?.to&&!e?.from&&t){const i=new Route(t,e.to,e.waypoints);this.selectRoute(i)}}get pathLayers(){return c.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,i)=>i.indexOf(t)===e).reverse().map((t,e)=>({id:e+1,layer:c.layerStore.findLayer(t)}))}getNearestBooth(t){if(!t)return null;let e=this.rootStore.layerStore.findLayer(t.z);const i=t.lat&&t.lng?$e(t,P.properties.config):t;return this.rootStore.boothStore.booths.filter(o=>L.mode===ut.Default||!e?o.visible&&o.rect:o.rect&&(typeof t.z!="number"&&!t.z&&o.visible||e.name===o.layer?.name)).sort((o,u)=>Fe(i,o.rect.center)-Fe(i,u.rect.center))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(mt),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const i=this.markersData.markers.find(u=>u.id===t);this.markersData.markers.forEach(u=>u.active=!1),i&&(i.active=!0);let o=c.layerStore.findLayer(i?.z);if(e&&i){const u=c.rendererService.renderer;return o&&!o?.visible&&L.updateVisibility(o,!0),u?u.controls.panTo(i.x,i.y):(Ue.warn("Renderer is not initialized. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(t=>t.active)}get layers(){var t=[];return c.routeStore.routeLines?.map(e=>e.p0.layer).reverse().forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>c.layerStore.layers.find(i=>i.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,_.list.type==="route-planner"&&(_.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(t,e))}selectCurrentPosition(t,e=!0,i){clearTimeout(this.cpTimeout),t&&(t.x=b(t.x),t.y=b(t.y),t.lat=b(t.lat),t.lng=b(t.lng),it()||(t.z=null));const o=e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),u=e&&!o&&(this.focusEnabled||this.prevZ!=t?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=i?1:0;const d=t?ht(t):null;if(!d){this.currentPosition=null;return}const p=c.layerStore.findLayer(t.z),x=new CurrentPosition(d.x,d.y,p?.name||this.currentRouteLayer?.name,at(d),t.lat,t.lng);let Oe=!this.routeLines?.length;if(p&&this.routeLines?.length&&(Oe=!!this.routeLines.find(T=>T.p0.layer===p.name||T.p1.layer===p.name)),u&&Oe){const T=c.rendererService.renderer;if(p&&!p?.visible&&L.updateVisibility(p,!0),!T){Ue.warn("Renderer is not initialized. Cannot pan to current position.");return}T.controls.panTo(x.x,x.y)}this.currentPosition=x,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(!this.canFindLocation)return;if(c.maplibreStore.showMaplibre){_.moveToLocation=!0;return}const t=this.currentPosition??_.kioskData;if(!t)return;this.currentPosition&&localStorage.getItem(Qe)==="false"&&(c.routeStore.requestCompass=!0);const e=S.fromCenter(t,{x:100,y:100});let i;if(e.intersects(g))i=e;else{const u=Math.max(g.min.x,Math.min(t.x,g.max.x)),d=Math.max(g.min.y,Math.min(t.y,g.max.y)),p=Math.min(g.size.width,g.size.height)*.3,x=S.fromCenter({x:u,y:d},{x:p,y:p}).intersection(g);i=x?S.fromUnion(e,x):e}_.moveToRect=i;const o=c.layerStore.findLayer(t.z);o&&L.updateVisibility(o,!0)}routeUnits=(r(this,ue),r(this,Ee,Ne));get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:qe(t,Ze(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=et(),i=(e.getAttribute("units")||Ne).toLowerCase?.().trim(),o=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(o?1:10)),this.routeUnits=i,this.updateRoutePoints()}updateRoutePoints(){const t=_.selectedRoute,e=this.routeDistance,i=this.routeUnits;c.fp.onDirection&&setTimeout(()=>{c.fp.onDirection({from:Xe(t?.from??null),to:Xe(t?.to??null),lines:this.routeLines,distance:`${e}${i}`,units:i,time:qe(e,Ze(i))})},200)}checkRoutes(){if(!lt()){console.warn("checkRoutes: wayfinding is not initialized \u2014 call createWayfinding() first. Skipping route check.");return}const t=c.boothStore.booths;console.info(`Route check started ${t.length}.... `);for(let e=0;e<t.length;e++){const i=t[e];for(let o=e+1;o<t.length;o++){const u=t[o];rt(Ke(i),Ke(u)).lines.length||console.warn(`No route found from ${i.name} to ${u.name}`)}}console.info("Route check done....")}isGpsTrackingEnabled=(r(this,Te),r(this,Ae,!0));setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return Be.autoTrackingGps&&this.isGpsTrackingEnabled&&!Be.enableIPS}setOnlyAccessible(t){this.onlyAccessible=t}}})();export default dt;function ft(s){if(s)return s instanceof R?s.layer?.name:s.layer}function We(s,n){return n?n instanceof R?n.layer??null:s.findLayer(n.layer):null}function mt(s){return{...s,x:b(s.x),y:b(s.y),lat:b(s.lat),lng:b(s.lng)}}function ht(s){let n=null,l=null;return P&&(n=P.properties.config),n&&He({min:n.p0,max:n.p2},s)?l={...s}:n&&Ve(s.lat)&&Ve(s.lng)?l=$e(s,n):n||(l=s),l||null}export function findBooth(s){return c.boothStore.findBooth(s)||c.exhibitorStore.findExhibitor(s)?.booths[0]}export function findEntityByExternalId(s){const n=c.boothStore.boothByExternalId.get(s);if(n)return{type:"booth",entity:n};const l=c.exhibitorStore.exhibitorByExternalId.get(s);if(l)return{type:"exhibitor",entity:l}}export function separateExternalIds(s){const n=[],l=[];for(const h of s){const y=findEntityByExternalId(h);y&&(y.type==="booth"?n.push(h):l.push(h))}return{boothExternalIds:n,exhibitorExternalIds:l}}export function extractRoute(s,n,l){return new Route(findBooth(s)??null,findBooth(n)??null,l?.map(h=>findBooth(h)))}export class Route{from;to;waypoints;constructor(n,l,h){this.from=n,this.to=l,this.waypoints=h;const y=n instanceof R?n.id:void 0,v=l instanceof R?l.id:void 0;this.waypoints=h?.filter(k=>k&&k.id!==y&&k.id!==v)}}function Xe(s){return s?s instanceof R?{id:s.id,name:s.name,externalId:s.externalId,layer:{name:s.layer?.name,description:s.layer?.description}}:{id:Number.MAX_SAFE_INTEGER,name:s.name,externalId:void 0,layer:{name:s.layer,description:void 0}}:null}export class CurrentPosition extends Ye{x;y;z;angle;lat;lng;constructor(n,l,h,y,v,k){super(n,l),this.x=n,this.y=l,this.z=h,this.angle=y,this.lat=v,this.lng=k}}
@@ -5,7 +5,7 @@
5
5
  * All canvases are pre-created eagerly.
6
6
  * Fallback canvases are used when custom images are not available.
7
7
  */
8
- import type { IconProvider } from './iconProvider';
8
+ import type { IconProvider } from '../runtime/types';
9
9
  interface CanvasIconProviderConfig {
10
10
  /** Icon image map — typically store.fp.icons */
11
11
  readonly iconMap: Map<string, HTMLImageElement>;
@@ -1 +1 @@
1
- import{createArrowCurrentCanvas as m,createCurrentCanvas as C,createImageCanvas as _,createTargetCanvas as w,createYahCanvas as g}from"../../components/Map/drawing/config/canvases";import{createCircleCanvas as F}from"../../renderer";import{decreaseByPercentage as h}from"../../utils/math";const I="#00A2FF",O="#FF9F06",e=34;function s(o,n,t,i,u,r){const c=o.get(n);return c?(c.id=n,_(c,t,i,u)):r()}function v(o,n,t,i,u){const r=o.get(n);return r?(r.id=n,_(r,t,i,u)):null}function a(o){return{canvas:o,width:o.width,height:o.height}}export function createCanvasIconProvider(o){const{iconMap:n,pixelRatio:t}=o,i=o.sourceColor??I,u=o.destinationColor??O,r=new Map;r.set("destination",a(s(n,"destination",e,e,t,()=>w(t,u)))),r.set("source",a(s(n,"departure",e,e,t,()=>C(t,i)))),r.set("source_inactive",a(s(n,"departure_inactive",e,e,t,()=>C(t,i))));const c=C(t,i);c.id="current-location",r.set("current",a(c));const d=s(n,"transition",e,e,t,()=>C(t,i));r.set("transition",a(d)),r.set("transition_up",a(v(n,"transition_up",56,e,t)??d)),r.set("transition_down",a(v(n,"transition_down",56,e,t)??d)),r.set("transition_entry",a(s(n,"departure",e,e,t,()=>C(t,i)))),r.set("current_arrow",a(s(n,"direction",e,e,t,()=>m(t,i))));const p=s(n,"yah",h(64,32),h(90,32),t,()=>g(t,"#ff4343"));return p.id="current-location-2",r.set("yah",a(p)),r.set("trail",a(F(4,"#b5b7bc"))),{getIcon(f){const l=r.get(f);if(!l)throw new Error(`Unknown icon: ${f}`);return l}}}
1
+ import{createArrowCurrentCanvas as w,createCurrentCanvas as u,createImageCanvas as I,createTargetCanvas as O}from"../../components/Map/drawing/config/canvases";import{createCircleCanvas as v}from"../../renderer";const A="#00A2FF",F="#FF9F06",n=34,l=56;function a(i,e,t,s,C,r){const c=i.get(e);return c?(c.id=e,I(c,t,s,C)):r()}function o(i){return{canvas:i,width:i.width,height:i.height}}export function createCanvasIconProvider(i){const{iconMap:e,pixelRatio:t}=i,s=i.sourceColor??A,C=i.destinationColor??F,r=new Map;r.set("destination",o(a(e,"destination",n,n,t,()=>O(t,C)))),r.set("source",o(a(e,"departure",n,n,t,()=>u(t,s)))),r.set("source_inactive",o(a(e,"departure_inactive",n,n,t,()=>u(t,s))));const c=u(t,s);c.id="current-location",r.set("current",o(c));const d=a(e,"transition",n,n,t,()=>u(t,s));return r.set("transition",o(d)),r.set("transition_up",o(a(e,"transition_up",l,n,t,()=>d))),r.set("transition_down",o(a(e,"transition_down",l,n,t,()=>d))),r.set("transition_entry",o(a(e,"departure",n,n,t,()=>u(t,s)))),r.set("current_arrow",o(a(e,"direction",n,n,t,()=>w(t,s)))),r.set("trail",o(v(4,"#b5b7bc"))),{getIcon(_){const p=r.get(_);if(!p)throw new Error(`Unknown icon: ${_}`);return p}}}
@@ -1,3 +1,4 @@
1
1
  import { type GraphDataSource } from '../core';
2
- export declare const graphDataSource: GraphDataSource;
2
+ /** Reads the app's wayfinding graph data from `window.__wfData`. */
3
+ export declare function createGraphDataSource(): GraphDataSource;
3
4
  //# sourceMappingURL=graphDataSource.d.ts.map
@@ -1 +1 @@
1
- function n(){return window.__wfData}export const graphDataSource={getLines:()=>n()?.lines??[],getLineEnds:()=>n()?.lineEnds??[]};
1
+ function n(){return window.__wfData}export function createGraphDataSource(){return{getLines:()=>n()?.lines??[],getLineEnds:()=>n()?.lineEnds??[]}}
@@ -1,10 +1,9 @@
1
+ export type { ArbitraryPoint, ArbitraryPointId } from './arbitraryPoint';
2
+ export { CURRENT_LOCATION_NAME, CURRENT_POSITION_POINT_ID, KIOSK_ANCHOR_POINT_ID, toArbitraryPoint, } from './arbitraryPoint';
1
3
  export { boothToEndpoint } from './boothToEndpoint';
2
4
  export { createCanvasIconProvider } from './canvasIconProvider';
3
5
  export { createFloorContext } from './floorContext';
4
- export { graphDataSource } from './graphDataSource';
6
+ export { createGraphDataSource } from './graphDataSource';
5
7
  export { createKioskCanvas } from './kioskCanvas';
6
- export { CURRENT_LOCATION_NAME, CURRENT_POSITION_POINT_ID, KIOSK_ANCHOR_POINT_ID, toArbitraryPoint, } from './arbitraryPoint';
7
- export type { ArbitraryPoint, ArbitraryPointId } from './arbitraryPoint';
8
8
  export { positionInput } from './positionInput';
9
- export type { IconAsset, IconName, IconProvider } from './iconProvider';
10
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- export{boothToEndpoint}from"./boothToEndpoint";export{createCanvasIconProvider}from"./canvasIconProvider";export{createFloorContext}from"./floorContext";export{graphDataSource}from"./graphDataSource";export{createKioskCanvas}from"./kioskCanvas";export{CURRENT_LOCATION_NAME,CURRENT_POSITION_POINT_ID,KIOSK_ANCHOR_POINT_ID,toArbitraryPoint}from"./arbitraryPoint";export{positionInput}from"./positionInput";
1
+ export{CURRENT_LOCATION_NAME,CURRENT_POSITION_POINT_ID,KIOSK_ANCHOR_POINT_ID,toArbitraryPoint}from"./arbitraryPoint";export{boothToEndpoint}from"./boothToEndpoint";export{createCanvasIconProvider}from"./canvasIconProvider";export{createFloorContext}from"./floorContext";export{createGraphDataSource}from"./graphDataSource";export{createKioskCanvas}from"./kioskCanvas";export{positionInput}from"./positionInput";
@@ -8,6 +8,12 @@ interface BindMobxReactionsArgs {
8
8
  readonly runtime: WayfindingRuntime;
9
9
  readonly kioskHandler: KioskHandler;
10
10
  readonly yahHandler: YahHandler;
11
+ /**
12
+ * TODO (improvement): typing these as concrete `store/*` classes couples this
13
+ * glue to the store and produces type-only madge cycles (harmless at runtime —
14
+ * `import type` is erased). To make the wf glue fully store-type-free, invert
15
+ * into local ports (as done for `FloorContext`/`IconProvider`).
16
+ */
11
17
  readonly stores: {
12
18
  readonly routeStore: RouteStore;
13
19
  readonly uiState: UIState;
@@ -1 +1 @@
1
- import{comparer as E,reaction as c}from"mobx";import{CURRENT_LOCATION_NAME as P,CURRENT_POSITION_POINT_ID as a,boothToEndpoint as C,positionInput as x,toArbitraryPoint as T}from"./adapters";import{createRerouteController as k}from"./core";const b=i=>"rect"in i?C(i):i;export function bindMobxReactions({runtime:i,kioskHandler:A,yahHandler:R,stores:{routeStore:t,uiState:e,layerStore:l},rerouteThresholdSvg:g}){const f=[],F=k(g);function m(){const o=e.selectedRoute,n=o?.from?b(o.from):null,s=o?.to?b(o.to):null;if(!n||!s){i.clearRoute();return}i.setRoute({from:n,to:s,waypoints:o?.waypoints?.map(C),accessible:t.onlyAccessible})===!1&&console.error(new Error(`Route not found: (${n.x},${n.y}) \u2192 (${s.x},${s.y})`))}function u(){const o=t.currentPosition,n=t.iconType!==0,s=e.selectedRoute,d=!!(s?.from&&s?.to),y=n&&!d;if(!o){i.onPositionChanged(null),R(null);return}const p=x(o);y?(i.onPositionChanged(null),R({x:p.x,y:p.y,layer:p.layer})):(R(null),i.onPositionChanged(p))}function I(){const o=t.currentPosition,n=e.selectedRoute;if(!o||!n?.to)return;const s=!n.from,y=n.from?.id===a&&F.shouldReroute(x(o),t.routeLines);!s&&!y||t.rebuildRouteFromPosition(T(o,P,a))}function h(){const o=l.floors.find(n=>n.active)?.name;A(e.kioskData??null,o,l.mode)}function L(){const o=e.selectedRoute,n=t.currentPosition;if(!o?.to||!n||o.from?.id!==a||t.routeLines.length>0)return;const s=n.z!=null?String(n.z):"";o.from.x===n.x&&o.from.y===n.y&&o.from.layer===s||t.rebuildRouteFromPosition(T(n,P,a))}f.push(c(()=>l.layersLoaded,()=>{m(),u()}),c(()=>[e.selectedRoute,t.onlyAccessible],()=>{m(),u()}),c(()=>t.currentPosition,()=>{u()}),c(()=>{const o=t.currentPosition;return o?{x:o.x,y:o.y,z:o.z}:null},()=>{I(),L()},{equals:E.structural}),c(()=>[e.kioskData,l.floors.find(o=>o.active)],()=>h()));let r=null;const N=c(()=>[t.currentRouteLayer,e.getRouteNextFloor],()=>{l.layersLoaded&&(r!==null&&clearTimeout(r),r=setTimeout(()=>{i.onFloorChanged(),u(),r=null},0))});return f.push(()=>{r!==null&&clearTimeout(r),N()}),m(),u(),h(),()=>{for(const o of f)o();f.length=0}}
1
+ import{comparer as E,reaction as c}from"mobx";import{boothToEndpoint as P,CURRENT_LOCATION_NAME as C,CURRENT_POSITION_POINT_ID as a,positionInput as x,toArbitraryPoint as T}from"./adapters";import{createRerouteController as k}from"./core";const b=i=>"rect"in i?P(i):i;export function bindMobxReactions({runtime:i,kioskHandler:A,yahHandler:R,stores:{routeStore:t,uiState:e,layerStore:l},rerouteThresholdSvg:g}){const f=[],F=k(g);function m(){const o=e.selectedRoute,n=o?.from?b(o.from):null,s=o?.to?b(o.to):null;if(!n||!s){i.clearRoute();return}i.setRoute({from:n,to:s,waypoints:o?.waypoints?.map(P),accessible:t.onlyAccessible})===!1&&console.error(new Error(`Route not found: (${n.x},${n.y}) \u2192 (${s.x},${s.y})`))}function u(){const o=t.currentPosition,n=t.iconType!==0,s=e.selectedRoute,d=!!(s?.from&&s?.to),y=n&&!d;if(!o){i.onPositionChanged(null),R(null);return}const p=x(o);y?(i.onPositionChanged(null),R({x:p.x,y:p.y,layer:p.layer})):(R(null),i.onPositionChanged(p))}function I(){const o=t.currentPosition,n=e.selectedRoute;if(!o||!n?.to)return;const s=!n.from,y=n.from?.id===a&&F.shouldReroute(x(o),t.routeLines);!s&&!y||t.rebuildRouteFromPosition(T(o,C,a))}function h(){const o=l.floors.find(n=>n.active)?.name;A(e.kioskData??null,o,l.mode)}function L(){const o=e.selectedRoute,n=t.currentPosition;if(!o?.to||!n||o.from?.id!==a||t.routeLines.length>0)return;const s=n.z!=null?String(n.z):"";o.from.x===n.x&&o.from.y===n.y&&o.from.layer===s||t.rebuildRouteFromPosition(T(n,C,a))}f.push(c(()=>l.layersLoaded,()=>{m(),u()}),c(()=>[e.selectedRoute,t.onlyAccessible],()=>{m(),u()}),c(()=>t.currentPosition,()=>{u()}),c(()=>{const o=t.currentPosition;return o?{x:o.x,y:o.y,z:o.z}:null},()=>{I(),L()},{equals:E.structural}),c(()=>[e.kioskData,l.floors.find(o=>o.active)],()=>h()));let r=null;const N=c(()=>[t.currentRouteLayer,e.getRouteNextFloor],()=>{l.layersLoaded&&(r!==null&&clearTimeout(r),r=setTimeout(()=>{i.onFloorChanged(),u(),r=null},0))});return f.push(()=>{r!==null&&clearTimeout(r),N()}),m(),u(),h(),()=>{for(const o of f)o();f.length=0}}
@@ -1,13 +1,13 @@
1
- import { type GraphBuildOptions, type GraphDataSource, type GraphInstance, type PathNode, type RouteLine, type RoutePoint } from '../types';
1
+ import { type GraphBuildOptions, type GraphDataSource, type GraphInstance, type GraphLine, type PathNode, type RoutePoint } from '../types';
2
2
  export declare function makePoint(layer: string, x: number, y: number): RoutePoint;
3
- export declare function makeLine(p0: RoutePoint, p1: RoutePoint, overrides?: Partial<Omit<RouteLine, 'p0' | 'p1'>>): RouteLine;
3
+ export declare function makeLine(p0: RoutePoint, p1: RoutePoint, overrides?: Partial<Omit<GraphLine, 'p0' | 'p1'>>): GraphLine;
4
4
  export declare function makeNode(layer: string, x: number, y: number): PathNode;
5
5
  export declare function createMockDataSource(options?: {
6
- lines?: RouteLine[];
6
+ lines?: GraphLine[];
7
7
  lineEnds?: RoutePoint[];
8
8
  }): GraphDataSource;
9
9
  export declare function createMockGraph(options?: {
10
- lines?: RouteLine[];
10
+ lines?: GraphLine[];
11
11
  lineEnds?: RoutePoint[];
12
12
  hasNodeResult?: boolean | ((id: string) => boolean);
13
13
  findResult?: PathNode[] | ((fromId: string, toId: string) => PathNode[]);
@@ -1 +1 @@
1
- import{createGraphCache as G}from"./graph/graphCache";import{getRouteLength as m}from"./routing/getRouteLength";import{buildRoute as b}from"./routing/buildRoute";import{buildMultiPointRoute as R}from"./routing/buildMultiPointRoute";import{resolveWaypointCandidates as h}from"./routing/resolveWaypointCandidates";import{reorderWaypoints as y}from"./routing/optimizeWaypointOrder";const g=1e-6,u=(e,t)=>e.layer===t.layer&&Math.abs(e.x-t.x)<g&&Math.abs(e.y-t.y)<g;function O(e,t){if(!e.length)return e;const n=e[e.length-1],o=n.p1,r=u(t.segment.p0,o)?t.segment.p1:t.segment.p0;return u(n.p0,r)?[...e.slice(0,-1),{...n,p1:t.projection}]:[...e,{...t.segment,p0:o,p1:t.projection}]}function j(e,t){if(!e.length)return e;const n=e[0],o=n.p0,r=u(t.segment.p0,o)?t.segment.p1:t.segment.p0;return u(n.p1,r)?[{...n,p0:t.projection},...e.slice(1)]:[{...t.segment,p0:t.projection,p1:o},...e]}function E(e,t,n){let o=e;return t&&(o=O(o,t)),n&&(o=j(o,n)),o}export function createWayfindingEngine(e){const t=G();return{buildRoute(n,o,r){const i=t.getOrBuild(e,r?.accessible??!1),s=h(i,n),a=h(i,o),c=b(i,s.candidates,a.candidates),p=!!s.offGraphEntry||!!a.offGraphEntry,f=E(c.lines,s.offGraphEntry,a.offGraphEntry);return{lines:f,distance:p?m(f):c.totalDistance}},buildWaypointsRoute(n,o){if(n.length<2)return{lines:[],distance:0};const r=t.getOrBuild(e,o?.accessible??!1),s=(o?.fastest?y(n):n).map(d=>h(r,d)),a=R(r,s.map(d=>d.candidates)),c=s[0].offGraphEntry,p=s[s.length-1].offGraphEntry,f=!!c||!!p,l=E(a.lines,c,p);return{lines:l,distance:f?m(l):a.totalDistance}}}}
1
+ import{createGraphCache as G}from"./graph/graphCache";import{buildMultiPointRoute as b}from"./routing/buildMultiPointRoute";import{buildRoute as R}from"./routing/buildRoute";import{getRouteLength as m}from"./routing/getRouteLength";import{reorderWaypoints as y}from"./routing/optimizeWaypointOrder";import{resolveWaypointCandidates as h}from"./routing/resolveWaypointCandidates";const g=1e-6,u=(e,t)=>e.layer===t.layer&&Math.abs(e.x-t.x)<g&&Math.abs(e.y-t.y)<g;function O(e,t){if(!e.length)return e;const n=e[e.length-1],o=n.p1,r=u(t.segment.p0,o)?t.segment.p1:t.segment.p0;return u(n.p0,r)?[...e.slice(0,-1),{...n,p1:t.projection}]:[...e,{...t.segment,p0:o,p1:t.projection}]}function j(e,t){if(!e.length)return e;const n=e[0],o=n.p0,r=u(t.segment.p0,o)?t.segment.p1:t.segment.p0;return u(n.p1,r)?[{...n,p0:t.projection},...e.slice(1)]:[{...t.segment,p0:t.projection,p1:o},...e]}function E(e,t,n){let o=e;return t&&(o=O(o,t)),n&&(o=j(o,n)),o}export function createWayfindingEngine(e){const t=G();return{buildRoute(n,o,r){const i=t.getOrBuild(e,r?.accessible??!1),s=h(i,n),a=h(i,o),c=R(i,s.candidates,a.candidates),p=!!s.offGraphEntry||!!a.offGraphEntry,f=E(c.lines,s.offGraphEntry,a.offGraphEntry);return{lines:f,distance:p?m(f):c.totalDistance}},buildWaypointsRoute(n,o){if(n.length<2)return{lines:[],distance:0};const r=t.getOrBuild(e,o?.accessible??!1),s=(o?.fastest?y(n):n).map(d=>h(r,d)),a=b(r,s.map(d=>d.candidates)),c=s[0].offGraphEntry,p=s[s.length-1].offGraphEntry,f=!!c||!!p,l=E(a.lines,c,p);return{lines:l,distance:f?m(l):a.totalDistance}}}}
@@ -1,3 +1,3 @@
1
- import { GraphBuildOptions, GraphDataSource, GraphInstance, PathFinder } from '../types';
1
+ import { type GraphBuildOptions, type GraphDataSource, type GraphInstance, type PathFinder } from '../types';
2
2
  export declare function buildGraph(dataSource: GraphDataSource, pathFinder: PathFinder, options: GraphBuildOptions): GraphInstance;
3
3
  //# sourceMappingURL=buildGraph.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { type Graph } from 'ngraph.graph';
2
- import { type PathFinderOptions, type RouteLine } from '../types';
2
+ import { type GraphLine, type PathFinderOptions } from '../types';
3
3
  interface LinkData {
4
4
  distance: number;
5
5
  }
6
6
  /** Builds an ngraph instance from route lines, filtering and linking per options. */
7
- export declare function buildNGraph(lines: RouteLine[], options: PathFinderOptions): Graph<unknown, LinkData>;
7
+ export declare function buildNGraph(lines: GraphLine[], options: PathFinderOptions): Graph<unknown, LinkData>;
8
8
  export {};
9
9
  //# sourceMappingURL=buildNGraph.d.ts.map
@@ -1,6 +1,6 @@
1
- import { type GraphInstance, type RouteLine, type RoutePoint, type ShortestPathResult } from '../types';
1
+ import { type GraphInstance, type GraphLine, type RoutePoint, type ShortestPathResult } from '../types';
2
2
  /** Computes the weighted path cost matching the graph link distance formula. */
3
- export declare function computeWeightedPathCost(points: RoutePoint[], lines: RouteLine[]): number;
3
+ export declare function computeWeightedPathCost(points: RoutePoint[], lines: GraphLine[]): number;
4
4
  /**
5
5
  * Finds the shortest path between candidate point sets by trying all from×to
6
6
  * pairs and picking the one with the lowest weighted cost.
@@ -1,8 +1,8 @@
1
- import { RouteLine, RoutePoint } from '../types';
1
+ import { type GraphLine, type RouteLine, type RoutePoint } from '../types';
2
2
  export declare const toNodeId: (p: RoutePoint) => string;
3
3
  export declare const arePointsClose: (p1: RoutePoint, p2: RoutePoint) => boolean;
4
- export declare const matchesLine: (line: RouteLine, p0: RoutePoint, p1: RoutePoint) => boolean;
5
- export declare function findLineByEndpoints(lines: RouteLine[], p0: RoutePoint, p1: RoutePoint): RouteLine | undefined;
4
+ export declare const matchesLine: (line: GraphLine, p0: RoutePoint, p1: RoutePoint) => boolean;
5
+ export declare function findLineByEndpoints(lines: GraphLine[], p0: RoutePoint, p1: RoutePoint): GraphLine | undefined;
6
6
  export declare function canMergeSegments(lastSegment: RouteLine, segment: RouteLine): boolean;
7
- export declare function buildRouteSegments(points: RoutePoint[], lines: RouteLine[]): RouteLine[];
7
+ export declare function buildRouteSegments(points: RoutePoint[], lines: GraphLine[]): RouteLine[];
8
8
  //# sourceMappingURL=graphHelpers.d.ts.map
@@ -1 +1 @@
1
- import{degToRad as a,lineAngle as l,pointDistance as f}from"@expofp/geometry";export const toNodeId=t=>`${t.layer}_${t.x}_${t.y}`;const p=1;export const arePointsClose=(t,n)=>t.layer===n.layer&&f(t,n)<=p,matchesLine=(t,n,e)=>arePointsClose(t.p0,n)&&arePointsClose(t.p1,e)||arePointsClose(t.p0,e)&&arePointsClose(t.p1,n);export function findLineByEndpoints(t,n,e){return t.find(o=>matchesLine(o,n,e))}const d=a(5);export function canMergeSegments(t,n){if(t.virtual!==n.virtual)return!1;const e=l(t.p0,t.p1),o=l(n.p0,n.p1);let i=Math.abs(o-e);return i>Math.PI&&(i=2*Math.PI-i),i<=d}export function buildRouteSegments(t,n){const e=[];for(let o=1;o<t.length;o++){const i=t[o-1],s=t[o],r=findLineByEndpoints(n,i,s);if(!r){console.warn(`WF: buildRouteSegments \u2014 no line found between ${toNodeId(i)} and ${toNodeId(s)}`);continue}const c={p0:i,p1:s,unaccessible:r.unaccessible,unidirection:r.unidirection,virtual:r.virtual,weight:r.weight},u=e[e.length-1];u&&canMergeSegments(u,c)?e[e.length-1]={...u,p1:c.p1}:e.push(c)}return e}
1
+ import{degToRad as a,lineAngle as u,pointDistance as f}from"@expofp/geometry";export const toNodeId=t=>`${t.layer}_${t.x}_${t.y}`;const p=1;export const arePointsClose=(t,n)=>t.layer===n.layer&&f(t,n)<=p,matchesLine=(t,n,e)=>arePointsClose(t.p0,n)&&arePointsClose(t.p1,e)||arePointsClose(t.p0,e)&&arePointsClose(t.p1,n);export function findLineByEndpoints(t,n,e){return t.find(o=>matchesLine(o,n,e))}const d=a(5);export function canMergeSegments(t,n){if(t.virtual!==n.virtual)return!1;const e=u(t.p0,t.p1),o=u(n.p0,n.p1);let r=Math.abs(o-e);return r>Math.PI&&(r=2*Math.PI-r),r<=d}export function buildRouteSegments(t,n){const e=[];for(let o=1;o<t.length;o++){const r=t[o-1],i=t[o],l=findLineByEndpoints(n,r,i);if(!l){console.warn(`WF: buildRouteSegments \u2014 no line found between ${toNodeId(r)} and ${toNodeId(i)}`);continue}const s={p0:r,p1:i,virtual:l.virtual},c=e[e.length-1];c&&canMergeSegments(c,s)?e[e.length-1]={...c,p1:s.p1}:e.push(s)}return e}
@@ -1,4 +1,4 @@
1
- import { type RouteLine } from '../types';
1
+ import { type GraphLine } from '../types';
2
2
  /** Weighted cost of a route line for A* graph edge (legacy formula). */
3
- export declare function linkCost(line: RouteLine): number;
3
+ export declare function linkCost(line: GraphLine): number;
4
4
  //# sourceMappingURL=linkCost.d.ts.map
@@ -1,17 +1,17 @@
1
+ export type { Route, WayfindingEngine } from './createWayfindingEngine';
1
2
  export { createWayfindingEngine } from './createWayfindingEngine';
2
- export type { WayfindingEngine, Route } from './createWayfindingEngine';
3
- export type { GraphDataSource, RouteEndpoint, RouteLine, RoutePoint, RouteSnapResult, SnapToRouteConfig, } from './types';
4
- export { projectPointOnSegment } from './geometry/projectPointOnSegment';
3
+ export type { GraphDataSource, GraphLine, RouteEndpoint, RouteLine, RoutePoint, RouteSnapResult, SnapToRouteConfig, } from './types';
5
4
  export type { SegmentProjection } from './geometry/projectPointOnSegment';
6
- export { computeTransitionPoints } from './rendering/computeTransitionPoints';
7
- export type { TransitionPointDef } from './rendering/computeTransitionPoints';
5
+ export { projectPointOnSegment } from './geometry/projectPointOnSegment';
8
6
  export { computeTrailPoints } from './rendering/computeTrailPoints';
9
- export { computeBoundingBox } from './rendering/routeGeometry';
7
+ export type { TransitionPointDef } from './rendering/computeTransitionPoints';
8
+ export { computeTransitionPoints } from './rendering/computeTransitionPoints';
10
9
  export { normalizeRouteDirection } from './rendering/normalizeRouteDirection';
10
+ export { computeBoundingBox } from './rendering/routeGeometry';
11
11
  export { getRouteLength } from './routing/getRouteLength';
12
- export { SNAP_THRESHOLD_METERS, getThresholdFromMetersToSvg, getThresholdSafe, resolveRerouteThresholdSvg, } from './position/gpsThreshold';
13
- export { createRerouteController } from './position/rerouteController';
12
+ export { getThresholdFromMetersToSvg, getThresholdSafe, resolveRerouteThresholdSvg, SNAP_THRESHOLD_METERS, } from './position/gpsThreshold';
14
13
  export type { RerouteController } from './position/rerouteController';
14
+ export { createRerouteController } from './position/rerouteController';
15
15
  export { snapToRoute } from './position/snapToRoute';
16
16
  export { splitRouteByPoint } from './position/splitRouteByPoint';
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- export{createWayfindingEngine}from"./createWayfindingEngine";export{projectPointOnSegment}from"./geometry/projectPointOnSegment";export{computeTransitionPoints}from"./rendering/computeTransitionPoints";export{computeTrailPoints}from"./rendering/computeTrailPoints";export{computeBoundingBox}from"./rendering/routeGeometry";export{normalizeRouteDirection}from"./rendering/normalizeRouteDirection";export{getRouteLength}from"./routing/getRouteLength";export{SNAP_THRESHOLD_METERS,getThresholdFromMetersToSvg,getThresholdSafe,resolveRerouteThresholdSvg}from"./position/gpsThreshold";export{createRerouteController}from"./position/rerouteController";export{snapToRoute}from"./position/snapToRoute";export{splitRouteByPoint}from"./position/splitRouteByPoint";
1
+ export{createWayfindingEngine}from"./createWayfindingEngine";export{projectPointOnSegment}from"./geometry/projectPointOnSegment";export{computeTrailPoints}from"./rendering/computeTrailPoints";export{computeTransitionPoints}from"./rendering/computeTransitionPoints";export{normalizeRouteDirection}from"./rendering/normalizeRouteDirection";export{computeBoundingBox}from"./rendering/routeGeometry";export{getRouteLength}from"./routing/getRouteLength";export{getThresholdFromMetersToSvg,getThresholdSafe,resolveRerouteThresholdSvg,SNAP_THRESHOLD_METERS}from"./position/gpsThreshold";export{createRerouteController}from"./position/rerouteController";export{snapToRoute}from"./position/snapToRoute";export{splitRouteByPoint}from"./position/splitRouteByPoint";
@@ -1,5 +1,5 @@
1
1
  export declare const SNAP_THRESHOLD_METERS = 7.5;
2
- type GpsProjectionConfig = {
2
+ interface GpsProjectionConfig {
3
3
  p0: {
4
4
  x: number;
5
5
  y: number;
@@ -12,7 +12,7 @@ type GpsProjectionConfig = {
12
12
  lat: number;
13
13
  lng: number;
14
14
  };
15
- };
15
+ }
16
16
  export declare const getThresholdSafe: (value?: number) => number | undefined;
17
17
  export declare function getThresholdFromMetersToSvg({ thresholdInMeters, gpsConfig, }: {
18
18
  thresholdInMeters?: number;
@@ -1,3 +1,3 @@
1
- import { RouteLine } from '../types';
1
+ import { type RouteLine } from '../types';
2
2
  export declare function getRouteLength(routeLines: RouteLine[]): number;
3
3
  //# sourceMappingURL=getRouteLength.d.ts.map
@@ -7,18 +7,28 @@ export interface RoutePoint {
7
7
  readonly y: number;
8
8
  readonly layer: string;
9
9
  }
10
+ /**
11
+ * A computed route segment — the public output of routing, consumed by the
12
+ * runtime and rendering. Carries only what consumers read; graph-build
13
+ * properties (direction, cost) live on {@link GraphLine}, not here.
14
+ */
10
15
  export interface RouteLine {
11
16
  readonly p0: RoutePoint;
12
17
  readonly p1: RoutePoint;
13
- /**
14
- * Internal graph properties from external wayfinding data (wf.data.js).
15
- * Temporarily public because config-wf.ts and RouteStore read RouteLine directly.
16
- * After Phase 7 (WayfindingRuntime), consumers will receive filtered data
17
- * through RenderPort/WayfindingStore and these fields will become internal.
18
- */
18
+ /** Virtual (floor-transition) link rather than a physical path segment. */
19
+ readonly virtual: boolean;
20
+ }
21
+ /**
22
+ * A source graph line from external wayfinding data (wf.data.js) — the input to
23
+ * graph building. Extends {@link RouteLine} with build-only properties
24
+ * (accessibility, direction, cost) that never reach a computed route.
25
+ */
26
+ export interface GraphLine extends RouteLine {
27
+ /** Flagged inaccessible in source data: graph-build filter + the venue accessible toggle. */
19
28
  readonly unaccessible: boolean;
29
+ /** One-way link: in oriented mode no reverse edge is added. */
20
30
  readonly unidirection: boolean;
21
- readonly virtual: boolean;
31
+ /** Link weight for cost (`0` = unset → `DEFAULT_LINE_WEIGHT`). */
22
32
  readonly weight: number;
23
33
  /**
24
34
  * Optional custom cost for virtual (floor-transition) links, configured
@@ -40,12 +50,12 @@ export interface PathFinderOptions {
40
50
  readonly onlyAccessible: boolean;
41
51
  }
42
52
  export interface PathFinder {
43
- build(lines: RouteLine[], options: PathFinderOptions): void;
53
+ build(lines: GraphLine[], options: PathFinderOptions): void;
44
54
  find(fromId: string, toId: string): PathNode[];
45
55
  hasNode(id: string): boolean;
46
56
  }
47
57
  export interface GraphDataSource {
48
- getLines(): RouteLine[];
58
+ getLines(): GraphLine[];
49
59
  getLineEnds(): RoutePoint[];
50
60
  }
51
61
  export interface GraphInstance {
@@ -1,3 +1,17 @@
1
1
  import type { RendererService } from '../renderer';
2
- export declare function createWayfinding(rendererService: RendererService): () => void;
2
+ import type RootStore from '../store/RootStore';
3
+ import { type Route, type RouteEndpoint } from './core';
4
+ /** Whether `createWayfinding` has run and not yet been disposed. */
5
+ export declare function isWayfindingReady(): boolean;
6
+ /**
7
+ * Build a route between two endpoints. Throws if wayfinding is not initialized.
8
+ *
9
+ * TODO: compromise for the public SDK (`RouteStore.checkRoutes` diagnostic). Ad-hoc
10
+ * route building should not be a public capability — routing belongs to the runtime.
11
+ * Remove once the SDK surface no longer needs standalone route checks.
12
+ */
13
+ export declare function buildRoute(from: RouteEndpoint, to: RouteEndpoint, options?: {
14
+ accessible?: boolean;
15
+ }): Route;
16
+ export declare function createWayfinding(rendererService: RendererService, store: RootStore): () => void;
3
17
  //# sourceMappingURL=createWayfinding.d.ts.map
@@ -1 +1 @@
1
- import{fpGeo as i}from"../data/fpGeo";import o,{layersStore as n,uiState as l}from"../store";import{createCanvasIconProvider as g,createFloorContext as h,graphDataSource as T}from"./adapters";import{bindMobxReactions as A}from"./bindMobxReactions";import{SNAP_THRESHOLD_METERS as y,createWayfindingEngine as M,getThresholdFromMetersToSvg as N,getThresholdSafe as I,resolveRerouteThresholdSvg as L}from"./core";import{createKioskHandler as v}from"./handlers/kioskHandler";import{createYahHandler as W}from"./handlers/yahHandler";import{WF_CURRENT_POSITION_LAYER_NAME as x,WF_LINES_ANIMATED_LAYER_NAME as F,WF_LINES_LAYER_NAME as P,WF_POINTS_LAYER_NAME as k,WF_TRAIL_LAYER_NAME as C}from"./layers";import{createWayfindingRuntime as H}from"./runtime/createWayfindingRuntime";import{createWayfindingRenderer as Y}from"./renderer";export function createWayfinding(d){const f=M(T),s=g({iconMap:o.fp.icons,pixelRatio:devicePixelRatio}),r=Y(d),a=h(n,o.routeStore),t={points:k,trail:C,lines:P,linesAnimated:F,currentPosition:x},m=I(i?.properties?.config?.snapThreshold)||y,u=N({thresholdInMeters:m,gpsConfig:i?.properties?.config}),c=H({engine:f,renderer:r,iconProvider:s,floorContext:a,layers:t,snapThreshold:u,onTransitionClick:e=>{e.role==="exit"&&n.updateVisibility(e.targetLayer,!0)},onRouteUpdate:(e,p)=>{o.routeStore.updateRoute(e),p.isEmpty()||(l.moveToRect=p)},onRouteDistance:e=>o.routeStore.updateRouteDistance(e)}),R=v({renderer:r,kioskIconMap:o.fp.icons,layer:t.points}),S=W({renderer:r,iconProvider:s,floorContext:a,layer:t.points}),E=L(i?.properties?.config),_=A({runtime:c,kioskHandler:R,yahHandler:S,stores:{routeStore:o.routeStore,uiState:l,layerStore:n},rerouteThresholdSvg:E});return r.flush(),()=>{_(),c.destroy()}}
1
+ import{fpGeo as c}from"../data/fpGeo";import{createCanvasIconProvider as E,createFloorContext as _,createGraphDataSource as A}from"./adapters";import{bindMobxReactions as T}from"./bindMobxReactions";import{createWayfindingEngine as W,getThresholdFromMetersToSvg as M,getThresholdSafe as N,resolveRerouteThresholdSvg as v,SNAP_THRESHOLD_METERS as x}from"./core";import{createKioskHandler as L}from"./handlers/kioskHandler";import{createYahHandler as I}from"./handlers/yahHandler";import{WF_CURRENT_POSITION_LAYER_NAME as P,WF_LINES_ANIMATED_LAYER_NAME as b,WF_LINES_LAYER_NAME as F,WF_POINTS_LAYER_NAME as k,WF_TRAIL_LAYER_NAME as C}from"./layers";import{createWayfindingRenderer as H}from"./renderer";import{createWayfindingRuntime as Y}from"./runtime/createWayfindingRuntime";let t=null;export function isWayfindingReady(){return t!==null}function w(){if(!t)throw new Error("Wayfinding is not initialized \u2014 call createWayfinding() first.");return t}export function buildRoute(n,e,i){return w().engine.buildRoute(n,e,i)}export function createWayfinding(n,e){const i=A(),s=W(i),p=E({iconMap:e.fp.icons,pixelRatio:devicePixelRatio}),r=H(n),l=_(e.layerStore,e.routeStore),a={points:k,trail:C,lines:F,linesAnimated:b,currentPosition:P},R=N(c?.properties?.config?.snapThreshold)||x,S=M({thresholdInMeters:R,gpsConfig:c?.properties?.config}),u=Y({engine:s,renderer:r,iconProvider:p,floorContext:l,layers:a,snapThreshold:S,onTransitionClick:o=>{o.role==="exit"&&e.layerStore.updateVisibility(o.targetLayer,!0)},onRouteUpdate:(o,d)=>{e.routeStore.updateRoute(o),d.isEmpty()||(e.uiState.moveToRect=d)},onRouteDistance:o=>e.routeStore.updateRouteDistance(o)}),g=L({renderer:r,kioskIconMap:e.fp.icons,layer:a.points}),m=I({renderer:r,iconMap:e.fp.icons,pixelRatio:devicePixelRatio,floorContext:l,layer:a.points}),y=v(c?.properties?.config),h=T({runtime:u,kioskHandler:g,yahHandler:m,stores:{routeStore:e.routeStore,uiState:e.uiState,layerStore:e.layerStore},rerouteThresholdSvg:y});e.routeStore.showAccessible=i.getLines().some(o=>o.unaccessible);const f={engine:s};return t=f,r.flush(),()=>{t===f&&(t=null,e.routeStore.showAccessible=!1),h(),u.destroy()}}