@expofp/floorplan 3.23.1 → 3.23.2
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.
- package/dist/browser/{Button-Cu9clsSR.js → Button-DBTihmKU.js} +5 -5
- package/dist/browser/{CookieConsent-mvgZy0jC.js → CookieConsent-DlDte0lk.js} +7 -7
- package/dist/browser/{Debug-CnnGHGZJ.js → Debug-BtvsTOMr.js} +7 -7
- package/dist/browser/{Demo-DQlgp6cY.js → Demo-_YQZ9fif.js} +9 -9
- package/dist/browser/{Free-DgGCDTNd.js → Free-D6J6-cXi.js} +9 -9
- package/dist/browser/{GalleryContainer-ixlqlJ9Q.js → GalleryContainer-BnUt1PNs.js} +10 -10
- package/dist/browser/{GpsLoader-9JLK7S2S.js → GpsLoader-OUCQ7ZMm.js} +10 -10
- package/dist/browser/{KioskStore-ZtZBfHyG.js → KioskStore-dFbTmzRX.js} +4 -4
- package/dist/browser/{MaplibreAdapter-C__Oc26V.js → MaplibreAdapter-Dm0ssNYr.js} +24 -15
- package/dist/browser/{ModalContainer-DsyDwSqY.js → ModalContainer-dPz6CJEz.js} +10 -10
- package/dist/browser/{PermissionNotice-CZ4QlKe_.js → PermissionNotice-CkPfMzyD.js} +6 -6
- package/dist/browser/{SetKioskMode-Bf4b4bnh.js → SetKioskMode-B-vMQm34.js} +8 -8
- package/dist/browser/{ShowKiosk-BdAccxwG.js → ShowKiosk-jHz_HhEH.js} +10 -10
- package/dist/browser/{ViewerMenuPanel-_Y9M630H.js → ViewerMenuPanel-6QP-3jhe.js} +9 -9
- package/dist/browser/{add-debug-secret-listener-DQl3P4ki.js → add-debug-secret-listener-CKkrKZtV.js} +1 -1
- package/dist/browser/{adopt-global-settings-DTFmFw7D.js → adopt-global-settings-DDOfuPoA.js} +9 -9
- package/dist/browser/{boolean-editor-DRaZvwNE.js → boolean-editor-DbE8wBID.js} +9 -9
- package/dist/browser/{bootIntercom-Bxi_kVm1.js → bootIntercom-W2WvsUkQ.js} +2 -2
- package/dist/browser/{booth-by-xy-RZ4XM07z.js → booth-by-xy-Bl9WXuO-.js} +6 -6
- package/dist/browser/bundle.json +65 -65
- package/dist/browser/{classnames-yCHhGUHk.js → classnames-Bg5rLqNN.js} +2 -2
- package/dist/browser/{client-dzWvVFIu.js → client-DeQq5mQU.js} +4 -4
- package/dist/browser/{components-DiWraxYJ.js → components-on0LMU5X.js} +36 -36
- package/dist/browser/{debug-overlay-By2JKe98.js → debug-overlay-DxDWBv6z.js} +10 -10
- package/dist/browser/{debug-ui-B7iMFZL2.js → debug-ui-EkvTnZPW.js} +6 -6
- package/dist/browser/{dist-D0sDuIMU.js → dist-BSIFCb0t.js} +5 -5
- package/dist/browser/{dist-BJYZuYz5.js → dist-UfmPsoUY.js} +3 -3
- package/dist/browser/{dist-XtgimJG-.js → dist-iqnveclN.js} +6 -6
- package/dist/browser/{efp-debug-init-Cm4noHZv.js → efp-debug-init-C0OHRZNn.js} +3 -3
- package/dist/browser/{enum-editor-CmI32f5A.js → enum-editor-Beyz9Cw7.js} +4 -4
- package/dist/browser/{es5-97nOnIxB.js → es5-BLugQzbi.js} +2 -2
- package/dist/browser/{event-not-found-Gs3WorrR.js → event-not-found-BVuVRHWg.js} +1 -1
- package/dist/browser/{exports-BzI9isE4.js → exports-DbyVbUOC.js} +1 -1
- package/dist/browser/{favicon-NX_igce1.js → favicon-DpMbk9tx.js} +1 -1
- package/dist/browser/{fetch-retry.umd-BdBGrOUm.js → fetch-retry.umd-BkW3rJuZ.js} +2 -2
- package/dist/browser/{flex-D0Cx6ssp.js → flex-DPKB0RuC.js} +5 -5
- package/dist/browser/{floorplan.loader-BNASIC9N.js → floorplan.loader-Bt4oybgX.js} +10 -10
- package/dist/browser/{floorplan.ready-Bdm_nBoS.js → floorplan.ready-CwF4F1tf.js} +14 -14
- package/dist/browser/{fuse-CArwLmpE.js → fuse-DDDXbqE_.js} +2 -2
- package/dist/browser/{i18n-DJDkRNUS.js → i18n-D_PeYM0A.js} +5 -5
- package/dist/browser/index.js +14 -14
- package/dist/browser/{index.module-AN1k6qf9.js → index.module-DPKx9U0o.js} +4 -4
- package/dist/browser/{integrateKiosk-BHslPH6W.js → integrateKiosk-BQaVMEWM.js} +4 -4
- package/dist/browser/{is-webview-CpxNA1hf.js → is-webview-BvcAtwvK.js} +1 -1
- package/dist/browser/{jsx-runtime-BTmKWYLh.js → jsx-runtime-CiltolM1.js} +2 -2
- package/dist/browser/{kiosk-record-Dar5bcb3.js → kiosk-record-CDOXD0YR.js} +1 -1
- package/dist/browser/{lib-CH0lKOWr.js → lib-CLR-Jqc_.js} +3 -3
- package/dist/browser/{loadImage-Cyucj9ZO.js → loadImage-Bv8NDM3i.js} +4 -4
- package/dist/browser/{logDeviceInfo-DrWNwkiz.js → logDeviceInfo-IqDo_h8W.js} +9 -9
- package/dist/browser/{main-DDG4oAN0.js → main-BfGxlpV2.js} +1 -1
- package/dist/browser/{mobx-CCrzy0oK.js → mobx-DqXBQLr3.js} +4 -4
- package/dist/browser/{optional-boolean-editor-B9ghixUw.js → optional-boolean-editor-C2OpCDdc.js} +3 -3
- package/dist/browser/{optional-enum-editor-ymdwpZCG.js → optional-enum-editor-Bn_IuNy7.js} +4 -4
- package/dist/browser/{optional-string-editor-B7GvxUp0.js → optional-string-editor-BAnOpEsC.js} +4 -4
- package/dist/browser/{particles.min-DR9RAdSY.js → particles.min-BizTykKa.js} +2 -2
- package/dist/browser/{react-Di1u_Olu.js → react-1v6olhrH.js} +2 -2
- package/dist/browser/{react-dom-DgZLuRw2.js → react-dom-CXdU7G-n.js} +3 -3
- package/dist/browser/{rolldown-runtime-Bq2YTOlP.js → rolldown-runtime-MTWZj7PQ.js} +1 -1
- package/dist/browser/{select-1HLg5zVy.js → select-BMOhi0jB.js} +10 -10
- package/dist/browser/{settings-CiVCMVtK.js → settings-C2XBSodv.js} +2 -2
- package/dist/browser/{settings-item-BdvpCLdo.js → settings-item-DCdMf74g.js} +6 -6
- package/dist/browser/{store-CYrJjLi8.js → store-W6DIPr1q.js} +6167 -6146
- package/dist/browser/{string-editor-OFy8aOQQ.js → string-editor-BKRgpXC1.js} +4 -4
- package/dist/browser/{text-field-BXXmJXFF.js → text-field-7VmhUoTM.js} +5 -5
- package/dist/browser/{theme-DpPZfgKy.js → theme-B3dhDzGI.js} +8 -8
- package/dist/browser/{ui-CJ0nQkSv.js → ui-Cj76n3w6.js} +8 -8
- package/dist/browser/{useRenderTarget-roc5qoAU.js → useRenderTarget-DfvYoh2A.js} +4 -4
- package/dist/esm/components/Maplibre/useCameraReactions.js +1 -1
- package/dist/esm/store/RouteStore.d.ts +13 -0
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/store/reveal-layer.d.ts +29 -0
- package/dist/esm/store/reveal-layer.js +1 -0
- package/package.json +9 -9
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
(function() {
|
|
2
2
|
try {
|
|
3
3
|
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
4
|
-
e.SENTRY_RELEASE = { id: "3.23.
|
|
4
|
+
e.SENTRY_RELEASE = { id: "3.23.2" };
|
|
5
5
|
var t = new e.Error().stack;
|
|
6
6
|
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "0a67f4c1-0ef6-428f-92c6-94c57178bf21", e._sentryDebugIdIdentifier = "sentry-dbid-0a67f4c1-0ef6-428f-92c6-94c57178bf21");
|
|
7
7
|
} catch {}
|
|
8
8
|
})();
|
|
9
|
-
import { t as e } from "./jsx-runtime-
|
|
10
|
-
import { t } from "./settings-item-
|
|
11
|
-
import { t as n } from "./text-field-
|
|
9
|
+
import { t as e } from "./jsx-runtime-CiltolM1.js";
|
|
10
|
+
import { t } from "./settings-item-DCdMf74g.js";
|
|
11
|
+
import { t as n } from "./text-field-7VmhUoTM.js";
|
|
12
12
|
//#region ../debug/src/lib/ui/string-editor.tsx
|
|
13
13
|
var r = e(), i = (e) => {
|
|
14
14
|
var i;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
(function() {
|
|
2
2
|
try {
|
|
3
3
|
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
4
|
-
e.SENTRY_RELEASE = { id: "3.23.
|
|
4
|
+
e.SENTRY_RELEASE = { id: "3.23.2" };
|
|
5
5
|
var t = new e.Error().stack;
|
|
6
6
|
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "9c5a0877-c176-4e2d-b51c-123d50ab2b3c", e._sentryDebugIdIdentifier = "sentry-dbid-9c5a0877-c176-4e2d-b51c-123d50ab2b3c");
|
|
7
7
|
} catch {}
|
|
8
8
|
})();
|
|
9
|
-
import { r as e } from "./rolldown-runtime-
|
|
10
|
-
import { t } from "./react-
|
|
11
|
-
import { D as n, i as r, l as i, n as a, s as o, u as s, y as c } from "./flex-
|
|
12
|
-
import { t as l } from "./classnames-
|
|
9
|
+
import { r as e } from "./rolldown-runtime-MTWZj7PQ.js";
|
|
10
|
+
import { t } from "./react-1v6olhrH.js";
|
|
11
|
+
import { D as n, i as r, l as i, n as a, s as o, u as s, y as c } from "./flex-DPKB0RuC.js";
|
|
12
|
+
import { t as l } from "./classnames-Bg5rLqNN.js";
|
|
13
13
|
//#region ../../node_modules/.pnpm/@radix-ui+themes@3.3.0_@types+react-dom@19.2.3_@types+react@19.2.17__@types+react@19.2._5ea800d4e947acedb1fa1275f1697b17/node_modules/@radix-ui/themes/dist/esm/components/text-field.props.js
|
|
14
14
|
var u = /* @__PURE__ */ e(t()), d = /* @__PURE__ */ e(l()), f = {
|
|
15
15
|
size: {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
(function() {
|
|
2
2
|
try {
|
|
3
3
|
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
4
|
-
e.SENTRY_RELEASE = { id: "3.23.
|
|
4
|
+
e.SENTRY_RELEASE = { id: "3.23.2" };
|
|
5
5
|
var t = new e.Error().stack;
|
|
6
6
|
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "f658045a-5be7-4ea4-a4b2-ddea9ab9caf3", e._sentryDebugIdIdentifier = "sentry-dbid-f658045a-5be7-4ea4-a4b2-ddea9ab9caf3");
|
|
7
7
|
} catch {}
|
|
8
8
|
})();
|
|
9
|
-
import { r as e } from "./rolldown-runtime-
|
|
10
|
-
import { t } from "./react-
|
|
11
|
-
import { t as n } from "./jsx-runtime-
|
|
12
|
-
import { t as r } from "./react-dom-
|
|
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-
|
|
14
|
-
import { c as f, i as p, n as m, o as h, r as g, s as _, t as v } from "./dist-
|
|
15
|
-
import { t as y } from "./classnames-
|
|
9
|
+
import { r as e } from "./rolldown-runtime-MTWZj7PQ.js";
|
|
10
|
+
import { t } from "./react-1v6olhrH.js";
|
|
11
|
+
import { t as n } from "./jsx-runtime-CiltolM1.js";
|
|
12
|
+
import { t as r } from "./react-dom-CXdU7G-n.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-DPKB0RuC.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-iqnveclN.js";
|
|
15
|
+
import { t as y } from "./classnames-Bg5rLqNN.js";
|
|
16
16
|
//#region ../../node_modules/.pnpm/@radix-ui+react-visually-hidden@1.2.3_@types+react-dom@19.2.3_@types+react@19.2.17__@ty_cffccd7838985066e8e1d993b5cb6017/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
17
17
|
var b = /* @__PURE__ */ e(r(), 1), x = /* @__PURE__ */ e(t(), 1), S = n(), C = Object.freeze({
|
|
18
18
|
position: "absolute",
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
(function() {
|
|
2
2
|
try {
|
|
3
3
|
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
4
|
-
e.SENTRY_RELEASE = { id: "3.23.
|
|
4
|
+
e.SENTRY_RELEASE = { id: "3.23.2" };
|
|
5
5
|
var t = new e.Error().stack;
|
|
6
6
|
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "3c34ab8b-5d65-4c06-8595-6ed371acabc5", e._sentryDebugIdIdentifier = "sentry-dbid-3c34ab8b-5d65-4c06-8595-6ed371acabc5");
|
|
7
7
|
} catch {}
|
|
8
8
|
})();
|
|
9
|
-
import { r as e } from "./rolldown-runtime-
|
|
10
|
-
import { a as t, i as n, s as r } from "./efp-debug-init-
|
|
11
|
-
import { a as i, i as a } from "./adopt-global-settings-
|
|
12
|
-
import { t as o } from "./jsx-runtime-
|
|
13
|
-
import "./settings-
|
|
14
|
-
import { t as s } from "./add-debug-secret-listener-
|
|
9
|
+
import { r as e } from "./rolldown-runtime-MTWZj7PQ.js";
|
|
10
|
+
import { a as t, i as n, s as r } from "./efp-debug-init-C0OHRZNn.js";
|
|
11
|
+
import { a as i, i as a } from "./adopt-global-settings-DDOfuPoA.js";
|
|
12
|
+
import { t as o } from "./jsx-runtime-CiltolM1.js";
|
|
13
|
+
import "./settings-C2XBSodv.js";
|
|
14
|
+
import { t as s } from "./add-debug-secret-listener-CKkrKZtV.js";
|
|
15
15
|
//#region ../debug/src/lib/ui/render-debug-ui.tsx
|
|
16
16
|
var c = /* @__PURE__ */ e(r(), 1), l = o(), u = !1;
|
|
17
17
|
function d() {
|
|
@@ -26,7 +26,7 @@ function d() {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
let o = async (t) => {
|
|
29
|
-
let { DebugUi: n } = await import("./debug-ui-
|
|
29
|
+
let { DebugUi: n } = await import("./debug-ui-EkvTnZPW.js"), { createRoot: i } = await import("./client-DeQq5mQU.js").then((t) => /* @__PURE__ */ e(t.default, 1)), a = document.createElement("div");
|
|
30
30
|
document.body.appendChild(a), i(a).render(/* @__PURE__ */ (0, l.jsx)(n, {
|
|
31
31
|
useDebugButtonState: r.useState,
|
|
32
32
|
open: t
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
(function() {
|
|
2
2
|
try {
|
|
3
3
|
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
4
|
-
e.SENTRY_RELEASE = { id: "3.23.
|
|
4
|
+
e.SENTRY_RELEASE = { id: "3.23.2" };
|
|
5
5
|
var t = new e.Error().stack;
|
|
6
6
|
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "7407e64e-4c4e-4bfb-b2ef-80063ad22998", e._sentryDebugIdIdentifier = "sentry-dbid-7407e64e-4c4e-4bfb-b2ef-80063ad22998");
|
|
7
7
|
} catch {}
|
|
8
8
|
})();
|
|
9
|
-
import { r as e } from "./rolldown-runtime-
|
|
10
|
-
import { t } from "./react-
|
|
11
|
-
import { l as n } from "./store-
|
|
9
|
+
import { r as e } from "./rolldown-runtime-MTWZj7PQ.js";
|
|
10
|
+
import { t } from "./react-1v6olhrH.js";
|
|
11
|
+
import { l as n } from "./store-W6DIPr1q.js";
|
|
12
12
|
//#region ../ui/src/shared/activeElement.ts
|
|
13
13
|
var r = (e) => !!e && "activeElement" in e;
|
|
14
14
|
function i(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Box as
|
|
1
|
+
import{Box as h}from"@expofp/geometry";import{svgArea as p,svgAreaExplicit as y}from"../../data/svg";import u,{uiState as s}from"../../store";import{convertLocalToGps as P}from"../../utils/gps";import{useReaction as l}from"../../utils/mobx";import{expandRectByPercent as b,getVenueFitMarginPercent as v,resolveVenueFitRect as x}from"../../utils/scene-bounds";import{fitMapToLocalRect as d,getVisibleRectFitPadding as M,isLngLatInVisibleViewport as S}from"./utils/geo-config";const a=s,O=15,g=24;function L(e){return b(e,v(e,p))}function R(e,r){return Math.min(Math.max(r,e.getMinZoom()),e.getMaxZoom())}function B(e,r,m){if(m.length!==1)return!1;const o=m[0]?.id,t=u.poiMarkerStore.markers.find(c=>c.boothId===o);if(!t)return!1;const n=P(t.center.x,t.center.y,r.gpsConfig),i=M(g);return S(e,n,i)||e.easeTo({center:n,zoom:R(e,O),bearing:r.bearing,duration:500,essential:!0}),!0}export function useCameraReactions(e,r,m){l(()=>a.moveToBooths,o=>{const t=e.current;if(!o||!t||!r)return;const n=o.filter(c=>c.rect);if(n.length===0)return;if(B(t,r,n)){a.moveToBooths=null;return}const i=h.fromUnion(...n.map(c=>c.rect));d(t,L(i),r),a.moveToBooths=null}),l(()=>a.moveToRect,o=>{const t=e.current;!o||!t||!r||(d(t,o,r,{paddingPercent:a.moveToRectPaddingPercent}),a.moveToRect=null,a.moveToRectPaddingPercent=null)}),l(()=>a.zoomBy,o=>{const t=e.current;!o||!t||(t.flyTo({zoom:t.getZoom()+(o>1?.5:-.5),animate:!0,duration:500}),a.zoomBy=null)}),l(()=>[s.moveToLocation,u.maplibreStore.cameraPort,u.routeStore.currentPosition],([o])=>{if(!o)return;const t=e.current,n=u.routeStore.currentPosition;if(!n){s.moveToLocation=!1;return}if(!t)return;const{lng:i,lat:c}=n,T=typeof i=="number"&&Number.isFinite(i)&&typeof c=="number"&&Number.isFinite(c);s.moveToLocation=!1;let f;if(T)f=[i,c];else{if(!r)return;f=P(n.x,n.y,r.gpsConfig)}t.flyTo({center:f,animate:!0,duration:1e3})}),l(()=>s.centerMap,o=>{const t=e.current;if(!o||!t||!r)return;if(!(s.list.type==="search"&&!s.list.text)){const{rect:i}=x({layerViewbox:u.layerStore.viewboxRectangle,explicitArea:y?p:null,layerRectangle:u.layerStore.rectangle,sceneDef:m,svgArea:p});d(t,i,r)}s.centerMap=!1})}
|
|
@@ -17,6 +17,8 @@ export default class RouteStore {
|
|
|
17
17
|
prevZ: string;
|
|
18
18
|
markersData: MarkersData;
|
|
19
19
|
prevMarkers: Marker[];
|
|
20
|
+
/** Cancels the camera move still waiting for a floor to come on screen (see `revealLayer`). */
|
|
21
|
+
private pendingReveal;
|
|
20
22
|
showAccessible: boolean;
|
|
21
23
|
onlyAccessible: boolean;
|
|
22
24
|
currentRouteLayer: Layer;
|
|
@@ -47,6 +49,17 @@ export default class RouteStore {
|
|
|
47
49
|
clickRoute(from: Booth, to: Booth): void;
|
|
48
50
|
selectCurrentPosition(point: CurrentPosition, focus?: boolean, icon?: number): void;
|
|
49
51
|
findLocation(): void;
|
|
52
|
+
/** The dot, plus — when it lies outside the drawing — enough of the nearest map edge for context. */
|
|
53
|
+
private findLocationRect;
|
|
54
|
+
/**
|
|
55
|
+
* Focus for a position update (first fix, or the dot changing floor): bring
|
|
56
|
+
* its floor on screen, then move the camera onto it keeping the zoom —
|
|
57
|
+
* `panTo` in the floor plan renderer; under MapLibre the renderer camera is
|
|
58
|
+
* an external-mode no-op stub, so the move goes through the adapter's
|
|
59
|
+
* `moveToLocation` reaction instead. Waits for the floor to be visible first
|
|
60
|
+
* (see `revealLayer`).
|
|
61
|
+
*/
|
|
62
|
+
private focusOnPosition;
|
|
50
63
|
routeUnits: string;
|
|
51
64
|
get routeInfo(): {
|
|
52
65
|
distance: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as n}from"tslib";import{action as f,computed as g,observable as u}from"mobx";import{Box as R,Point as _,boxContainsPoint as O,pointDistance as T}from"@expofp/geometry";import c,{layersStore as x}from".";import{fpGeo as S}from"../data/fpGeo";import{getName as F}from"../components/Kiosk/SetKiosk";import{DEFAULT_UNITS as L,ORIENTATION_GRANTED_KEY as G}from"../constants";import E from"../data";import{getLayerSvg as B,svgArea as m}from"../data/svg";import{GaEventActions as U,sendEventToGa as $}from"../tools/gtag";import P from"../tools/logger";import{areLayersEnabled as V}from"../utils/areLayersEnabled";import{calcSpeed as D}from"../utils/calcSpeed";import{calcTravelTime as w}from"../utils/calcTravelTime";import{calculateRelativeBearing as K,convertGpsToLocal as A,isValidPointCoords as I}from"../utils/gps";import{boothToEndpoint as C,buildRoute as W,CURRENT_LOCATION_NAME as Z,CURRENT_POSITION_POINT_ID as q,isWayfindingReady as j,KIOSK_ANCHOR_POINT_ID as X,toArbitraryPoint as M}from"../wayfinding";import{BoothBase as y}from"./BoothStore";import{uiState as h}from"./index";import{LayersMode as Y}from"./LayerStore";const d=o=>typeof o=="string"?Number(o.replace(",",".")):o;export default class i{constructor(t){this.routeLines=[],this.routeDistance=null,this.currentPosition=null,this.requestCompass=!1,this.iconType=0,this.tempToBooth=null,this.focusEnabled=!0,this.prevZ=null,this.markersData={icons:[],markers:[]},this.prevMarkers=[],this.showAccessible=!1,this.onlyAccessible=!1,this.currentRouteLayer=null,this.currentRouteExhibitor=null,this.routeUnits=L,this.isGpsTrackingEnabled=!0,this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!h.kioskData||!!this.currentPosition}selectRoute(t,e=!0,r=!1){if(e&&(h.list={type:"search",text:"",focused:!1}),t&&!t.from&&t.to){const l=this.resolveFallbackFrom();l&&(t=new Route(l,t.to,t.waypoints))}t?.from&&t?.to&&t.from===t.to&&(t=null);let s=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from instanceof y&&t.from.visible&&s.push(t.from),t?.to instanceof y&&t.to.visible&&(this.tempToBooth=null,s.push(t.to)),!t&&c.fp.onDirection&&c.fp.onDirection(null);const a=()=>{if(this.rootStore.moveToList(s),h.details=t,t&&(!t.from||!t.to)&&c.showOverlay(),t?.to&&t?.from){const l=H(t.from);l&&this.rootStore.layerStore.updateVisibility(l,!0)}if(!this.currentRouteLayer){const l=N(this.rootStore.layerStore,t?.from),p=N(this.rootStore.layerStore,t?.to);l?this.currentRouteLayer=l:p&&(this.currentRouteLayer=p)}e&&t?.from&&t?.to&&$(U.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)};r?a():setTimeout(a,200)}rebuildRouteFromPosition(t){const e=h.selectedRoute;e?.to&&this.selectRoute(new Route(t,e.to,e.waypoints),!1,!0)}resolveFallbackFrom(){if(this.currentPosition)return M(this.currentPosition,Z,q);const t=h.kioskData;return t?M({x:t.x,y:t.y,z:t.z},F(),X):null}setStartPoint(t){const e=h.selectedRoute;if(e?.to&&!e?.from&&t){const r=new Route(t,e.to,e.waypoints);this.selectRoute(r)}}get pathLayers(){return c.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,r)=>r.indexOf(t)===e).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 r=t.lat&&t.lng?A(t,S.properties.config):t;return this.rootStore.boothStore.booths.filter(s=>x.mode===Y.Default||!e?s.visible&&s.rect:s.rect&&(typeof t.z!="number"&&!t.z&&s.visible||e.name===s.layer?.name)).sort((s,a)=>T(r,s.rect.center)-T(r,a.rect.center))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(J),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const r=this.markersData.markers.find(a=>a.id===t);this.markersData.markers.forEach(a=>a.active=!1),r&&(r.active=!0);let s=c.layerStore.findLayer(r?.z);if(e&&r){const a=c.rendererService.renderer;return s&&!s?.visible&&x.updateVisibility(s,!0),a?a.controls.panTo(r.x,r.y):(P.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).forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>c.layerStore.layers.find(r=>r.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,h.list.type==="route-planner"&&(h.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(t,e))}selectCurrentPosition(t,e=!0,r){clearTimeout(this.cpTimeout),t&&(t.x=d(t.x),t.y=d(t.y),t.lat=d(t.lat),t.lng=d(t.lng),V()||(t.z=null));const s=e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),a=e&&!s&&(this.focusEnabled||this.prevZ!=t?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=r?1:0;const l=t?Q(t):null;if(!l){this.currentPosition=null;return}const p=c.layerStore.findLayer(t.z),b=new CurrentPosition(l.x,l.y,p?.name||this.currentRouteLayer?.name,K(l),t.lat,t.lng);let v=!this.routeLines?.length;if(p&&this.routeLines?.length&&(v=!!this.routeLines.find(k=>k.p0.layer===p.name||k.p1.layer===p.name)),a&&v){const k=c.rendererService.renderer;if(p&&!p?.visible&&x.updateVisibility(p,!0),!k){P.warn("Renderer is not initialized. Cannot pan to current position.");return}k.controls.panTo(b.x,b.y)}this.currentPosition=b,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(!this.canFindLocation)return;if(c.maplibreStore.showMaplibre){h.moveToLocation=!0;return}const t=this.currentPosition??h.kioskData;if(!t)return;this.currentPosition&&localStorage.getItem(G)==="false"&&(c.routeStore.requestCompass=!0);const e=R.fromCenter(t,{x:100,y:100});let r;if(e.intersects(m))r=e;else{const a=Math.max(m.min.x,Math.min(t.x,m.max.x)),l=Math.max(m.min.y,Math.min(t.y,m.max.y)),p=Math.min(m.size.width,m.size.height)*.3,b=R.fromCenter({x:a,y:l},{x:p,y:p}).intersection(m);r=b?R.fromUnion(e,b):e}h.moveToRect=r;const s=c.layerStore.findLayer(t.z);s&&x.updateVisibility(s,!0)}get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:w(t,D(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=B(),r=(e.getAttribute("units")||L).toLowerCase?.().trim(),s=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(s?1:10)),this.routeUnits=r,this.updateRoutePoints()}updateRoutePoints(){const t=h.selectedRoute,e=this.routeDistance,r=this.routeUnits;c.fp.onDirection&&setTimeout(()=>{c.fp.onDirection({from:z(t?.from??null),to:z(t?.to??null),lines:this.routeLines,distance:`${e}${r}`,units:r,time:w(e,D(r))})},200)}checkRoutes(){if(!j()){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 r=t[e];for(let s=e+1;s<t.length;s++){const a=t[s];W(C(r),C(a)).lines.length||console.warn(`No route found from ${r.name} to ${a.name}`)}}console.info("Route check done....")}setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return E.autoTrackingGps&&this.isGpsTrackingEnabled&&!E.enableIPS}setOnlyAccessible(t){this.onlyAccessible=t}}n([u],i.prototype,"routeLines",void 0),n([u],i.prototype,"routeDistance",void 0),n([u],i.prototype,"currentPosition",void 0),n([u],i.prototype,"requestCompass",void 0),n([u],i.prototype,"iconType",void 0),n([u],i.prototype,"tempToBooth",void 0),n([u],i.prototype,"focusEnabled",void 0),n([u],i.prototype,"prevZ",void 0),n([u],i.prototype,"markersData",void 0),n([u],i.prototype,"prevMarkers",void 0),n([u],i.prototype,"showAccessible",void 0),n([u],i.prototype,"onlyAccessible",void 0),n([u],i.prototype,"currentRouteLayer",void 0),n([u],i.prototype,"currentRouteExhibitor",void 0),n([g],i.prototype,"canFindLocation",null),n([f],i.prototype,"selectRoute",null),n([f],i.prototype,"rebuildRouteFromPosition",null),n([f],i.prototype,"setStartPoint",null),n([g({keepAlive:!0})],i.prototype,"pathLayers",null),n([f],i.prototype,"setMarkers",null),n([f],i.prototype,"selectMarker",null),n([g({keepAlive:!0})],i.prototype,"selectedMarkers",null),n([g({keepAlive:!0})],i.prototype,"layers",null),n([f],i.prototype,"clickRoute",null),n([f],i.prototype,"selectCurrentPosition",null),n([f],i.prototype,"findLocation",null),n([u],i.prototype,"routeUnits",void 0),n([g],i.prototype,"routeInfo",null),n([f],i.prototype,"updateRoute",null),n([f],i.prototype,"updateRouteDistance",null),n([f],i.prototype,"updateRoutePoints",null),n([f],i.prototype,"checkRoutes",null),n([u],i.prototype,"isGpsTrackingEnabled",void 0),n([f],i.prototype,"setGpsTrackingEnabled",null),n([g({keepAlive:!0})],i.prototype,"gpsEnabled",null),n([f],i.prototype,"setOnlyAccessible",null);function H(o){if(o)return o instanceof y?o.layer?.name:o.layer}function N(o,t){return t?t instanceof y?t.layer??null:o.findLayer(t.layer):null}function J(o){return{...o,x:d(o.x),y:d(o.y),lat:d(o.lat),lng:d(o.lng)}}function Q(o){let t=null,e=null;return S&&(t=S.properties.config),t&&O({min:t.p0,max:t.p2},o)?e={...o}:t&&I(o.lat)&&I(o.lng)?e=A(o,t):t||(e=o),e||null}export function findBooth(o){return c.boothStore.findBooth(o)||c.exhibitorStore.findExhibitor(o)?.booths[0]}export function findEntityByExternalId(o){const t=c.boothStore.boothByExternalId.get(o);if(t)return{type:"booth",entity:t};const e=c.exhibitorStore.exhibitorByExternalId.get(o);if(e)return{type:"exhibitor",entity:e}}export function separateExternalIds(o){const t=[],e=[];for(const r of o){const s=findEntityByExternalId(r);s&&(s.type==="booth"?t.push(r):e.push(r))}return{boothExternalIds:t,exhibitorExternalIds:e}}export function extractRoute(o,t,e){return new Route(findBooth(o)??null,findBooth(t)??null,e?.map(r=>findBooth(r)))}export class Route{constructor(t,e,r){this.from=t,this.to=e,this.waypoints=r;const s=t instanceof y?t.id:void 0,a=e instanceof y?e.id:void 0;this.waypoints=r?.filter(l=>l&&l.id!==s&&l.id!==a)}}function z(o){return o?o instanceof y?{id:o.id,name:o.name,externalId:o.externalId,layer:{name:o.layer?.name,description:o.layer?.description}}:{id:Number.MAX_SAFE_INTEGER,name:o.name,externalId:void 0,layer:{name:o.layer,description:void 0}}:null}export class CurrentPosition extends _{constructor(t,e,r,s,a,l){super(t,e),this.x=t,this.y=e,this.z=r,this.angle=s,this.lat=a,this.lng=l}}
|
|
1
|
+
import{__decorate as n}from"tslib";import{action as f,computed as b,observable as u}from"mobx";import{Box as R,Point as F,boxContainsPoint as G,pointDistance as L}from"@expofp/geometry";import c,{layersStore as g}from".";import{fpGeo as k}from"../data/fpGeo";import{getName as B}from"../components/Kiosk/SetKiosk";import{DEFAULT_UNITS as T,ORIENTATION_GRANTED_KEY as U}from"../constants";import E from"../data";import{getLayerSvg as $,svgArea as m}from"../data/svg";import{GaEventActions as V,sendEventToGa as K}from"../tools/gtag";import P from"../tools/logger";import{areLayersEnabled as W}from"../utils/areLayersEnabled";import{calcSpeed as w}from"../utils/calcSpeed";import{calcTravelTime as D}from"../utils/calcTravelTime";import{calculateRelativeBearing as Z,convertGpsToLocal as A,isValidPointCoords as I}from"../utils/gps";import{boothToEndpoint as C,buildRoute as q,CURRENT_LOCATION_NAME as j,CURRENT_POSITION_POINT_ID as X,isWayfindingReady as Y,KIOSK_ANCHOR_POINT_ID as H,toArbitraryPoint as M}from"../wayfinding";import{BoothBase as y}from"./BoothStore";import{uiState as p}from"./index";import{LayersMode as J}from"./LayerStore";import{revealLayer as N}from"./reveal-layer.js";const d=o=>typeof o=="string"?Number(o.replace(",",".")):o;export default class i{constructor(t){this.routeLines=[],this.routeDistance=null,this.currentPosition=null,this.requestCompass=!1,this.iconType=0,this.tempToBooth=null,this.focusEnabled=!0,this.prevZ=null,this.markersData={icons:[],markers:[]},this.prevMarkers=[],this.pendingReveal=null,this.showAccessible=!1,this.onlyAccessible=!1,this.currentRouteLayer=null,this.currentRouteExhibitor=null,this.routeUnits=T,this.isGpsTrackingEnabled=!0,this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!p.kioskData||!!this.currentPosition}selectRoute(t,e=!0,r=!1){if(e&&(p.list={type:"search",text:"",focused:!1}),t&&!t.from&&t.to){const l=this.resolveFallbackFrom();l&&(t=new Route(l,t.to,t.waypoints))}t?.from&&t?.to&&t.from===t.to&&(t=null);let s=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from instanceof y&&t.from.visible&&s.push(t.from),t?.to instanceof y&&t.to.visible&&(this.tempToBooth=null,s.push(t.to)),!t&&c.fp.onDirection&&c.fp.onDirection(null);const a=()=>{if(this.rootStore.moveToList(s),p.details=t,t&&(!t.from||!t.to)&&c.showOverlay(),t?.to&&t?.from){const l=Q(t.from);l&&this.rootStore.layerStore.updateVisibility(l,!0)}if(!this.currentRouteLayer){const l=O(this.rootStore.layerStore,t?.from),h=O(this.rootStore.layerStore,t?.to);l?this.currentRouteLayer=l:h&&(this.currentRouteLayer=h)}e&&t?.from&&t?.to&&K(V.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)};r?a():setTimeout(a,200)}rebuildRouteFromPosition(t){const e=p.selectedRoute;e?.to&&this.selectRoute(new Route(t,e.to,e.waypoints),!1,!0)}resolveFallbackFrom(){if(this.currentPosition)return M(this.currentPosition,j,X);const t=p.kioskData;return t?M({x:t.x,y:t.y,z:t.z},B(),H):null}setStartPoint(t){const e=p.selectedRoute;if(e?.to&&!e?.from&&t){const r=new Route(t,e.to,e.waypoints);this.selectRoute(r)}}get pathLayers(){return c.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,r)=>r.indexOf(t)===e).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 r=t.lat&&t.lng?A(t,k.properties.config):t;return this.rootStore.boothStore.booths.filter(s=>g.mode===J.Default||!e?s.visible&&s.rect:s.rect&&(typeof t.z!="number"&&!t.z&&s.visible||e.name===s.layer?.name)).sort((s,a)=>L(r,s.rect.center)-L(r,a.rect.center))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(tt),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const r=this.markersData.markers.find(a=>a.id===t);this.markersData.markers.forEach(a=>a.active=!1),r&&(r.active=!0);let s=c.layerStore.findLayer(r?.z);if(e&&r){const a=c.rendererService.renderer;return s&&!s?.visible&&g.updateVisibility(s,!0),a?a.controls.panTo(r.x,r.y):(P.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).forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>c.layerStore.layers.find(r=>r.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,p.list.type==="route-planner"&&(p.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(t,e))}selectCurrentPosition(t,e=!0,r){clearTimeout(this.cpTimeout),t&&(t.x=d(t.x),t.y=d(t.y),t.lat=d(t.lat),t.lng=d(t.lng),W()||(t.z=null));const s=e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),a=e&&!s&&(this.focusEnabled||this.prevZ!=t?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=r?1:0;const l=t?et(t):null;if(!l){this.currentPosition=null;return}const h=c.layerStore.findLayer(t.z),x=new CurrentPosition(l.x,l.y,h?.name||this.currentRouteLayer?.name,Z(l),t.lat,t.lng);let v=!this.routeLines?.length;h&&this.routeLines?.length&&(v=!!this.routeLines.find(S=>S.p0.layer===h.name||S.p1.layer===h.name));const _=a&&v;this.currentPosition=x,_&&this.focusOnPosition(x,h),this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(!this.canFindLocation)return;const t=this.currentPosition??p.kioskData;t&&(this.currentPosition&&localStorage.getItem(U)==="false"&&(c.routeStore.requestCompass=!0),this.pendingReveal?.(),this.pendingReveal=N({layer:c.layerStore.findLayer(t.z),show:e=>g.updateVisibility(e,!0),then:()=>{if(c.maplibreStore.showMaplibre){p.moveToLocation=!0;return}p.moveToRect=this.findLocationRect(t)}}))}findLocationRect(t){const e=R.fromCenter(t,{x:100,y:100});if(e.intersects(m))return e;const r=Math.max(m.min.x,Math.min(t.x,m.max.x)),s=Math.max(m.min.y,Math.min(t.y,m.max.y)),a=Math.min(m.size.width,m.size.height)*.3,l=R.fromCenter({x:r,y:s},{x:a,y:a}).intersection(m);return l?R.fromUnion(e,l):e}focusOnPosition(t,e){this.pendingReveal?.(),this.pendingReveal=N({layer:e,show:r=>g.updateVisibility(r,!0),then:()=>{if(c.maplibreStore.showMaplibre){p.moveToLocation=!0;return}const r=c.rendererService.renderer;if(!r){P.warn("Renderer is not initialized. Cannot pan to current position.");return}r.controls.panTo(t.x,t.y)}})}get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:D(t,w(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=$(),r=(e.getAttribute("units")||T).toLowerCase?.().trim(),s=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(s?1:10)),this.routeUnits=r,this.updateRoutePoints()}updateRoutePoints(){const t=p.selectedRoute,e=this.routeDistance,r=this.routeUnits;c.fp.onDirection&&setTimeout(()=>{c.fp.onDirection({from:z(t?.from??null),to:z(t?.to??null),lines:this.routeLines,distance:`${e}${r}`,units:r,time:D(e,w(r))})},200)}checkRoutes(){if(!Y()){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 r=t[e];for(let s=e+1;s<t.length;s++){const a=t[s];q(C(r),C(a)).lines.length||console.warn(`No route found from ${r.name} to ${a.name}`)}}console.info("Route check done....")}setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return E.autoTrackingGps&&this.isGpsTrackingEnabled&&!E.enableIPS}setOnlyAccessible(t){this.onlyAccessible=t}}n([u],i.prototype,"routeLines",void 0),n([u],i.prototype,"routeDistance",void 0),n([u],i.prototype,"currentPosition",void 0),n([u],i.prototype,"requestCompass",void 0),n([u],i.prototype,"iconType",void 0),n([u],i.prototype,"tempToBooth",void 0),n([u],i.prototype,"focusEnabled",void 0),n([u],i.prototype,"prevZ",void 0),n([u],i.prototype,"markersData",void 0),n([u],i.prototype,"prevMarkers",void 0),n([u],i.prototype,"showAccessible",void 0),n([u],i.prototype,"onlyAccessible",void 0),n([u],i.prototype,"currentRouteLayer",void 0),n([u],i.prototype,"currentRouteExhibitor",void 0),n([b],i.prototype,"canFindLocation",null),n([f],i.prototype,"selectRoute",null),n([f],i.prototype,"rebuildRouteFromPosition",null),n([f],i.prototype,"setStartPoint",null),n([b({keepAlive:!0})],i.prototype,"pathLayers",null),n([f],i.prototype,"setMarkers",null),n([f],i.prototype,"selectMarker",null),n([b({keepAlive:!0})],i.prototype,"selectedMarkers",null),n([b({keepAlive:!0})],i.prototype,"layers",null),n([f],i.prototype,"clickRoute",null),n([f],i.prototype,"selectCurrentPosition",null),n([f],i.prototype,"findLocation",null),n([u],i.prototype,"routeUnits",void 0),n([b],i.prototype,"routeInfo",null),n([f],i.prototype,"updateRoute",null),n([f],i.prototype,"updateRouteDistance",null),n([f],i.prototype,"updateRoutePoints",null),n([f],i.prototype,"checkRoutes",null),n([u],i.prototype,"isGpsTrackingEnabled",void 0),n([f],i.prototype,"setGpsTrackingEnabled",null),n([b({keepAlive:!0})],i.prototype,"gpsEnabled",null),n([f],i.prototype,"setOnlyAccessible",null);function Q(o){if(o)return o instanceof y?o.layer?.name:o.layer}function O(o,t){return t?t instanceof y?t.layer??null:o.findLayer(t.layer):null}function tt(o){return{...o,x:d(o.x),y:d(o.y),lat:d(o.lat),lng:d(o.lng)}}function et(o){let t=null,e=null;return k&&(t=k.properties.config),t&&G({min:t.p0,max:t.p2},o)?e={...o}:t&&I(o.lat)&&I(o.lng)?e=A(o,t):t||(e=o),e||null}export function findBooth(o){return c.boothStore.findBooth(o)||c.exhibitorStore.findExhibitor(o)?.booths[0]}export function findEntityByExternalId(o){const t=c.boothStore.boothByExternalId.get(o);if(t)return{type:"booth",entity:t};const e=c.exhibitorStore.exhibitorByExternalId.get(o);if(e)return{type:"exhibitor",entity:e}}export function separateExternalIds(o){const t=[],e=[];for(const r of o){const s=findEntityByExternalId(r);s&&(s.type==="booth"?t.push(r):e.push(r))}return{boothExternalIds:t,exhibitorExternalIds:e}}export function extractRoute(o,t,e){return new Route(findBooth(o)??null,findBooth(t)??null,e?.map(r=>findBooth(r)))}export class Route{constructor(t,e,r){this.from=t,this.to=e,this.waypoints=r;const s=t instanceof y?t.id:void 0,a=e instanceof y?e.id:void 0;this.waypoints=r?.filter(l=>l&&l.id!==s&&l.id!==a)}}function z(o){return o?o instanceof y?{id:o.id,name:o.name,externalId:o.externalId,layer:{name:o.layer?.name,description:o.layer?.description}}:{id:Number.MAX_SAFE_INTEGER,name:o.name,externalId:void 0,layer:{name:o.layer,description:void 0}}:null}export class CurrentPosition extends F{constructor(t,e,r,s,a,l){super(t,e),this.x=t,this.y=e,this.z=r,this.angle=s,this.lat=a,this.lng=l}}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** The slice of a `Layer` this helper needs: an observable `visible` flag. */
|
|
2
|
+
export interface RevealableLayer {
|
|
3
|
+
readonly visible: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface RevealLayerArgs<L extends RevealableLayer> {
|
|
6
|
+
/** The floor the target sits on; `null`/`undefined` when the plan has no floors or the floor is unknown. */
|
|
7
|
+
readonly layer: L | null | undefined;
|
|
8
|
+
/** Switches the floor on (`LayerStore.updateVisibility(layer, true)`); its effect lands asynchronously. */
|
|
9
|
+
readonly show: (layer: L) => void;
|
|
10
|
+
/** The camera move to run once the floor is on screen. */
|
|
11
|
+
readonly then: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Brings a target's floor on screen, then runs the camera move.
|
|
15
|
+
*
|
|
16
|
+
* - no floor, or floor already visible → the move runs right away;
|
|
17
|
+
* - otherwise the floor is switched on and the move waits for `visible` to
|
|
18
|
+
* actually flip — `LayerStore.updateVisibility` resolves that after the layer
|
|
19
|
+
* payload loads, so a move issued synchronously would either frame the old
|
|
20
|
+
* floor (legacy renderer) or be superseded by the floor-change fit the
|
|
21
|
+
* MapLibre adapter performs when the visible floor changes
|
|
22
|
+
* (`useLayerVisibilitySync`). Deferring the move behind the same `visible`
|
|
23
|
+
* flip makes it the *last* camera command of that change, so it wins.
|
|
24
|
+
*
|
|
25
|
+
* Returns a disposer for the pending wait (no-op once the move has run) —
|
|
26
|
+
* callers cancel a previous reveal before starting a new one.
|
|
27
|
+
*/
|
|
28
|
+
export declare function revealLayer<L extends RevealableLayer>({ layer, show, then, }: RevealLayerArgs<L>): () => void;
|
|
29
|
+
//# sourceMappingURL=reveal-layer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{when as o}from"mobx";const r=()=>{};export function revealLayer({layer:i,show:e,then:n}){return!i||i.visible?(n(),r):(e(i),o(()=>i.visible,n))}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expofp/floorplan",
|
|
3
|
-
"version": "3.23.
|
|
3
|
+
"version": "3.23.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/expofp/efp-app.git",
|
|
@@ -70,14 +70,14 @@
|
|
|
70
70
|
"tslib": "^2.3.0",
|
|
71
71
|
"uuid": "^9.0.1",
|
|
72
72
|
"zod": "4.4.3",
|
|
73
|
-
"@expofp/config": "3.23.
|
|
74
|
-
"@expofp/debug": "3.23.
|
|
75
|
-
"@expofp/geometry": "3.23.
|
|
76
|
-
"@expofp/resolve": "3.23.
|
|
77
|
-
"@expofp/schema": "3.23.
|
|
78
|
-
"@expofp/
|
|
79
|
-
"@expofp/utils": "3.23.
|
|
80
|
-
"@expofp/
|
|
73
|
+
"@expofp/config": "3.23.2",
|
|
74
|
+
"@expofp/debug": "3.23.2",
|
|
75
|
+
"@expofp/geometry": "3.23.2",
|
|
76
|
+
"@expofp/resolve": "3.23.2",
|
|
77
|
+
"@expofp/schema": "3.23.2",
|
|
78
|
+
"@expofp/wayfinding": "3.23.2",
|
|
79
|
+
"@expofp/utils": "3.23.2",
|
|
80
|
+
"@expofp/ui": "3.23.2"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@babel/plugin-proposal-decorators": "^8.0.2",
|