@expofp/floorplan 3.44.3 → 3.44.4
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-CNVBhsa-.js → Button-F_XLD8Fy.js} +5 -5
- package/dist/browser/{CookieConsent-Dxv1Wsat.js → CookieConsent-DZfbYufk.js} +7 -7
- package/dist/browser/{Debug-CFKoef7p.js → Debug-Bfe4H5gN.js} +7 -7
- package/dist/browser/{DebugTools-B8V3wXuK.js → DebugTools-D8ye4Kez.js} +6 -6
- package/dist/browser/{Demo-DM0A_1km.js → Demo-CuFsb-_M.js} +9 -9
- package/dist/browser/{Free-CzO-mFfd.js → Free-C0Nk9qPr.js} +10 -10
- package/dist/browser/{GalleryContainer-CbEnMCVB.js → GalleryContainer-CyAGAg4x.js} +11 -11
- package/dist/browser/{GpsLoader-CVbPQRMb.js → GpsLoader-CoB3sRdS.js} +14 -14
- package/dist/browser/{KioskStore-CwqXi5BX.js → KioskStore-CFuPEGt0.js} +10 -10
- package/dist/browser/{LayerStore-Zb7qIu0z.js → LayerStore-CoevODUO.js} +3164 -3107
- package/dist/browser/{MaplibreAdapter-CpqKTkaf.js → MaplibreAdapter-Cu_LsCXF.js} +647 -645
- package/dist/browser/{ModalContainer-DXJrM1Bp.js → ModalContainer-My0C_xoz.js} +10 -10
- package/dist/browser/{PermissionNotice-DDKii54V.js → PermissionNotice-BOGBP1GX.js} +6 -6
- package/dist/browser/{RouteStore-hvwT2i2u.js → RouteStore-Dm2o_5F2.js} +143 -143
- package/dist/browser/{SetKioskMode-BwmKtUXS.js → SetKioskMode-DPCRqozK.js} +12 -12
- package/dist/browser/{ShowKiosk-BRG5YHbS.js → ShowKiosk-DrNye8Aa.js} +11 -11
- package/dist/browser/{UIState-CE6LgRm0.js → UIState-BQFpVx6u.js} +81 -81
- package/dist/browser/{ViewerMenuPanel-mc608c2h.js → ViewerMenuPanel-CR4YhVRV.js} +11 -11
- package/dist/browser/{add-debug-secret-listener-BK7p-z9L.js → add-debug-secret-listener-ujLceXxU.js} +1 -1
- package/dist/browser/{adopt-global-settings-CRMYLGuM.js → adopt-global-settings-CN0GZTt5.js} +9 -9
- package/dist/browser/{boolean-editor-C-3p4K-F.js → boolean-editor-Ceq6Etwz.js} +9 -9
- package/dist/browser/{bootIntercom-Db2ZY2IP.js → bootIntercom-B1uR7uMB.js} +2 -2
- package/dist/browser/bundle.json +85 -85
- package/dist/browser/{camera-events-R9lBN0gH.js → camera-events-CvNcBo4O.js} +1 -1
- package/dist/browser/{classnames-BbFWiHL5.js → classnames-CrsP-Ebw.js} +2 -2
- package/dist/browser/{client-BEMnZXAF.js → client-BHrMhFVE.js} +5 -5
- package/dist/browser/{components-DliPPf5t.js → components-BqCyp8zM.js} +152 -152
- package/dist/browser/{create-live-plan-DAzphLxx.js → create-live-plan-CvZGo-XN.js} +77 -77
- package/dist/browser/{debug-context-CvwXOlAn.js → debug-context-i7l7Gx3K.js} +5 -5
- package/dist/browser/{debug-overlay-C4EOfo6K.js → debug-overlay-CRW_rbNG.js} +10 -10
- package/dist/browser/{debug-ui-C4ij0VwK.js → debug-ui-3YKCQhko.js} +6 -6
- package/dist/browser/{dimming-DDbaTusx.js → dimming-Dvu1pvil.js} +287 -287
- package/dist/browser/{dist-7WIWetl1.js → dist-Cle-ua_T.js} +3 -3
- package/dist/browser/{dist-Bec_HPvI.js → dist-DkwknQXP.js} +5 -5
- package/dist/browser/{dist-YzxDC-l3.js → dist-uDlhOKs3.js} +6 -6
- package/dist/browser/{efp-debug-init-DcPbyNJ4.js → efp-debug-init-BYeJPe2d.js} +3 -3
- package/dist/browser/{enum-editor-D7bIWtJ_.js → enum-editor-B_FawgZE.js} +4 -4
- package/dist/browser/{es5-BrgEa0Fa.js → es5-Dbukoinx.js} +2 -2
- package/dist/browser/{event-head-z1FHiOEx.js → event-head-D6VrYuEF.js} +1 -1
- package/dist/browser/{event-not-found-CmEMYoWH.js → event-not-found-BDz3WPij.js} +3 -3
- package/dist/browser/{event-scoped-cache-BYrRCtdG.js → event-scoped-cache-e6nGR3aQ.js} +2 -2
- package/dist/browser/{expofpUrl-CEUejCEN.js → expofpUrl-B0MZmxoe.js} +1 -1
- package/dist/browser/{exports-DKQt5QYX.js → exports-DEZevwDn.js} +1 -1
- package/dist/browser/{favicon-hXbIh_yH.js → favicon-u31TeYa4.js} +1 -1
- package/dist/browser/{fetch-retry.umd-CLXaW0xF.js → fetch-retry.umd-Cn-1aORd.js} +2 -2
- package/dist/browser/{flex-KPw9gVGD.js → flex-cYeXiUeX.js} +5 -5
- package/dist/browser/{floorplan.loader-D93gRJBq.js → floorplan.loader-DQ33Y83e.js} +12 -12
- package/dist/browser/{floorplan.ready-BNLEOdiv.js → floorplan.ready-DzJBQvVZ.js} +43 -43
- package/dist/browser/{freeBanner-oymjDdPI.js → freeBanner-DIcnNW6x.js} +2 -2
- package/dist/browser/{fuse-BFSl1xAm.js → fuse-ZGglAVb9.js} +2 -2
- package/dist/browser/{i18n-rk8cQWa3.js → i18n-DkibBSFF.js} +6 -6
- package/dist/browser/index.js +17 -17
- package/dist/browser/{index.module-CSdtATMD.js → index.module-BP-TB38-.js} +4 -4
- package/dist/browser/{init-ui-lJmr6-g1.js → init-ui-DwX0YEOm.js} +15 -15
- package/dist/browser/{integrateKiosk-CRw9kkw3.js → integrateKiosk-Di2HTJ8S.js} +6 -6
- package/dist/browser/{is-debug-BmKkiaOm.js → is-debug-DH7N8jQh.js} +4 -4
- package/dist/browser/{is-own-domain-WyB1g8Cb.js → is-own-domain-CE5Nyu9G.js} +1 -1
- package/dist/browser/{is-webview-zrRx507t.js → is-webview-BCZ5IIAQ.js} +1 -1
- package/dist/browser/{jsx-runtime-D9gYD2sV.js → jsx-runtime-DRF-BLHf.js} +2 -2
- package/dist/browser/{kiosk-mode-BpbUrRKq.js → kiosk-mode-AIiDx_CP.js} +5 -5
- package/dist/browser/{kiosk-record-B3e1fovJ.js → kiosk-record-DjdRCsw4.js} +1 -1
- package/dist/browser/{kioskApi-D_uzTtqk.js → kioskApi-CvKNO-wZ.js} +7 -7
- package/dist/browser/{lib-B3FA8Hoq.js → lib-D51yHChz.js} +3 -3
- package/dist/browser/{loadImage-BBg66Nnb.js → loadImage-mqrRnYPB.js} +1 -1
- package/dist/browser/{logDeviceInfo-WQQRX_vW.js → logDeviceInfo-BbgtT2xS.js} +9 -9
- package/dist/browser/{mobx-BvloKnDW.js → mobx-DzcgHXfh.js} +4 -4
- package/dist/browser/{mobx.module-CjTRKVWn.js → mobx.module-DXfPwJbY.js} +1 -1
- package/dist/browser/{optional-boolean-editor-CBiiGQUP.js → optional-boolean-editor-i9cNIguy.js} +3 -3
- package/dist/browser/{optional-enum-editor-BItRyjei.js → optional-enum-editor-OmCRikPm.js} +4 -4
- package/dist/browser/{optional-string-editor-B7jzDfQN.js → optional-string-editor-C5sw9XjO.js} +4 -4
- package/dist/browser/{particles.min-A7cunk1O.js → particles.min-Cj5RSf6H.js} +2 -2
- package/dist/browser/{react-DJbZe8VG.js → react-BU3jD5B2.js} +2 -2
- package/dist/browser/{react-dom-CF-AXfUm.js → react-dom-DJDMclnf.js} +3 -3
- package/dist/browser/{rolldown-runtime-BiG6A0mX.js → rolldown-runtime-CEvxUPK8.js} +1 -1
- package/dist/browser/{scene-CXn1c6mI.js → scene-B7RN58fT.js} +12 -12
- package/dist/browser/{scheduler-Dafdeh3M.js → scheduler-BZKT_e0-.js} +2 -2
- package/dist/browser/{select-BxjiQiLf.js → select-COMyfaY9.js} +10 -10
- package/dist/browser/{settings-BOBQS9z-.js → settings-Cg-yMbvI.js} +2 -2
- package/dist/browser/{settings-item-DUoTvDE-.js → settings-item-D1VQ8quC.js} +6 -6
- package/dist/browser/{store-D-LRnUif.js → store-XoxiSr-z.js} +2 -2
- package/dist/browser/{string-editor-DiDkcybB.js → string-editor-CWO5nIcD.js} +4 -4
- package/dist/browser/{text-field-CIc92NZ5.js → text-field-BqEB9Lpy.js} +5 -5
- package/dist/browser/{theme-0Xo52fpM.js → theme-Drd2jIAq.js} +8 -8
- package/dist/browser/{ui-D9VGB23k.js → ui-Bg4NEUSa.js} +8 -8
- package/dist/browser/{useRenderTarget-DZ5XMBlN.js → useRenderTarget-Bqxwvxh1.js} +4 -4
- package/dist/browser/{viewport-DBg-6DYR.js → viewport-BkMq7yU7.js} +3 -3
- package/dist/browser/{wayfinding-B87Zv5e1.js → wayfinding-BvV-kzMQ.js} +411 -411
- package/dist/esm/components/Map/drawing/config/canvases.d.ts +0 -9
- package/dist/esm/components/Map/drawing/config/canvases.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-outdoor-poi.js +1 -1
- package/dist/esm/components/Map/drawing/config/poi-pin-shape.d.ts +100 -0
- package/dist/esm/components/Map/drawing/config/poi-pin-shape.js +1 -0
- package/dist/esm/components/Map/drawing/config/poi-pin.d.ts +10 -0
- package/dist/esm/components/Map/drawing/config/poi-pin.js +1 -0
- package/dist/esm/components/Maplibre/usePoiMarkers.js +1 -1
- package/dist/esm/constants.d.ts +2 -2
- package/dist/esm/constants.js +1 -1
- package/package.json +10 -10
|
@@ -1,61 +1,61 @@
|
|
|
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.44.
|
|
4
|
+
e.SENTRY_RELEASE = { id: "3.44.4" };
|
|
5
5
|
var t = new e.Error().stack;
|
|
6
|
-
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "
|
|
6
|
+
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "26f7cfc6-3edc-4a9d-8ddb-25fdd365a6fd", e._sentryDebugIdIdentifier = "sentry-dbid-26f7cfc6-3edc-4a9d-8ddb-25fdd365a6fd");
|
|
7
7
|
} catch {}
|
|
8
8
|
})();
|
|
9
|
-
import { r as e, t } from "./rolldown-runtime-
|
|
10
|
-
import { o as n } from "./is-debug-
|
|
11
|
-
import { i as r, l as i } from "./mobx.module-
|
|
12
|
-
import {
|
|
9
|
+
import { r as e, t } from "./rolldown-runtime-CEvxUPK8.js";
|
|
10
|
+
import { o as n } from "./is-debug-DH7N8jQh.js";
|
|
11
|
+
import { i as r, l as i } from "./mobx.module-DXfPwJbY.js";
|
|
12
|
+
import { Ct as a, Gt as o, Jt as s, Mt as c, Rt as l, St as u, Ut as d, Vt as f, Wt as p, Xt as m, Yt as h, _t as g, bt as _, dt as v, gt as y, jt as b, qt as x, tt as S, xt as C, yt as w } from "./LayerStore-CoevODUO.js";
|
|
13
13
|
//#region ../geometry/src/lib/geo.ts
|
|
14
|
-
var
|
|
15
|
-
function T(e, t) {
|
|
16
|
-
let n = p(e.lat), r = p(t.lat), i = p(t.lat - e.lat), a = p(t.lng - e.lng), o = Math.sin(i / 2) * Math.sin(i / 2) + Math.cos(n) * Math.cos(r) * Math.sin(a / 2) * Math.sin(a / 2);
|
|
17
|
-
return w * (2 * Math.atan2(Math.sqrt(o), Math.sqrt(1 - o)));
|
|
18
|
-
}
|
|
14
|
+
var T = 6371e3;
|
|
19
15
|
function E(e, t) {
|
|
20
|
-
let n =
|
|
21
|
-
return (
|
|
16
|
+
let n = x(e.lat), r = x(t.lat), i = x(t.lat - e.lat), a = x(t.lng - e.lng), o = Math.sin(i / 2) * Math.sin(i / 2) + Math.cos(n) * Math.cos(r) * Math.sin(a / 2) * Math.sin(a / 2);
|
|
17
|
+
return T * (2 * Math.atan2(Math.sqrt(o), Math.sqrt(1 - o)));
|
|
22
18
|
}
|
|
23
|
-
function D(e, t
|
|
24
|
-
let
|
|
25
|
-
return
|
|
26
|
-
lat: S(s),
|
|
27
|
-
lng: S(l(c))
|
|
28
|
-
};
|
|
19
|
+
function D(e, t) {
|
|
20
|
+
let n = x(e.lat), r = x(t.lat), i = x(t.lng - e.lng), a = Math.sin(i) * Math.cos(r), o = Math.cos(n) * Math.sin(r) - Math.sin(n) * Math.cos(r) * Math.cos(i);
|
|
21
|
+
return (m(Math.atan2(a, o)) + 360) % 360;
|
|
29
22
|
}
|
|
30
23
|
function O(e, t, n) {
|
|
31
|
-
let r =
|
|
32
|
-
return
|
|
24
|
+
let r = t / T, i = x(n), a = x(e.lat), o = x(e.lng), s = Math.asin(Math.sin(a) * Math.cos(r) + Math.cos(a) * Math.sin(r) * Math.cos(i)), c = o + Math.atan2(Math.sin(i) * Math.sin(r) * Math.cos(a), Math.cos(r) - Math.sin(a) * Math.sin(s));
|
|
25
|
+
return {
|
|
26
|
+
lat: m(s),
|
|
27
|
+
lng: m(h(c))
|
|
28
|
+
};
|
|
33
29
|
}
|
|
34
30
|
function k(e, t, n) {
|
|
35
|
-
let r =
|
|
31
|
+
let r = n.local.x - t.local.x, i = n.local.y - t.local.y, a = Math.sqrt(r * r + i * i), o = e.x - t.local.x, s = e.y - t.local.y, c = Math.sqrt(o * o + s * s), l = m(Math.atan2(i, r)), u = m(Math.atan2(s, o)) - l, d = (a === 0 ? 0 : c / a) * E(t.geo, n.geo), f = D(t.geo, n.geo);
|
|
32
|
+
return O(t.geo, d, f + u);
|
|
33
|
+
}
|
|
34
|
+
function A(e, t, n) {
|
|
35
|
+
let r = E(t.geo, n.geo), i = D(t.geo, n.geo), a = E(t.geo, e), o = D(t.geo, e) - i, c = r === 0 ? 0 : a / r, l = n.local.x - t.local.x, u = n.local.y - t.local.y, d = Math.sqrt(l * l + u * u), f = Math.atan2(u, l), p = s(d * c, f + x(o));
|
|
36
36
|
return {
|
|
37
|
-
x: t.local.x +
|
|
38
|
-
y: t.local.y +
|
|
37
|
+
x: t.local.x + p.x,
|
|
38
|
+
y: t.local.y + p.y
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region ../geometry/src/lib/line.ts
|
|
43
|
-
function
|
|
44
|
-
return
|
|
43
|
+
function j(e) {
|
|
44
|
+
return p(e.p0, e.p1);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return
|
|
46
|
+
function ee(e, t) {
|
|
47
|
+
return o(e.p0, e.p1, .5, t);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function M(e, t) {
|
|
50
50
|
return Math.atan2(t.y - e.y, t.x - e.x);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function te(e, t, n) {
|
|
53
53
|
var r;
|
|
54
|
-
let i = e.p0.x,
|
|
55
|
-
m === 0 ? h = 0 : (h = ((
|
|
56
|
-
let g = (n == null ? new
|
|
57
|
-
x:
|
|
58
|
-
y:
|
|
54
|
+
let i = e.p0.x, a = e.p0.y, o = e.p1.x, s = e.p1.y, c = t.x, l = t.y, u = o - i, f = s - a, m = u * u + f * f, h;
|
|
55
|
+
m === 0 ? h = 0 : (h = ((c - i) * u + (l - a) * f) / m, h = h < 0 ? 0 : h > 1 ? 1 : h);
|
|
56
|
+
let g = (n == null ? new d() : n).set(i + u * h, a + f * h, (r = e.elevation) == null ? 0 : r), _ = p({
|
|
57
|
+
x: c,
|
|
58
|
+
y: l
|
|
59
59
|
}, g);
|
|
60
60
|
return {
|
|
61
61
|
projected: g,
|
|
@@ -65,21 +65,21 @@ function ne(e, t, n) {
|
|
|
65
65
|
}
|
|
66
66
|
//#endregion
|
|
67
67
|
//#region src/data/fpGeo.ts
|
|
68
|
-
function
|
|
69
|
-
return
|
|
68
|
+
function N() {
|
|
69
|
+
return b().__fpGeo;
|
|
70
70
|
}
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region src/utils/planBearing.ts
|
|
73
|
-
function
|
|
73
|
+
function P(e) {
|
|
74
74
|
return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + e * Math.PI / 360))) / 360;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
let n = (Math.atan2(
|
|
76
|
+
function F(e, t) {
|
|
77
|
+
let n = (Math.atan2(P(t.lat) - P(e.lat), (t.lng - e.lng) / 360) - Math.atan2(t.y - e.y, t.x - e.x)) * 180 / Math.PI % 360;
|
|
78
78
|
return Number.isFinite(n) ? (n + 360) % 360 : NaN;
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
81
|
//#region src/utils/gps.ts
|
|
82
|
-
function
|
|
82
|
+
function ne(e) {
|
|
83
83
|
return [{
|
|
84
84
|
local: {
|
|
85
85
|
x: e.p0.x,
|
|
@@ -100,47 +100,47 @@ function re(e) {
|
|
|
100
100
|
}
|
|
101
101
|
}];
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function I(e) {
|
|
104
104
|
return typeof e == "number" && Number.isFinite(e);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
if (!(
|
|
108
|
-
let { p0: a, p2: o } = i, s =
|
|
109
|
-
if (!
|
|
106
|
+
function re({ lat: e, lng: t, angle: r }, i) {
|
|
107
|
+
if (!(I(e) && I(t))) return null;
|
|
108
|
+
let { p0: a, p2: o } = i, s = E(a, o);
|
|
109
|
+
if (!I(s) || s <= 0) return n.warn("Invalid GPS config: zero or negative distance", {
|
|
110
110
|
fullGpsDistance: s,
|
|
111
111
|
p0: a,
|
|
112
112
|
p2: o
|
|
113
113
|
}), null;
|
|
114
|
-
let [c, l] =
|
|
114
|
+
let [c, l] = ne(i), u = A({
|
|
115
115
|
lat: e,
|
|
116
116
|
lng: t
|
|
117
117
|
}, c, l);
|
|
118
|
-
return
|
|
118
|
+
return j({
|
|
119
119
|
p0: u,
|
|
120
|
-
p1:
|
|
120
|
+
p1: ee({
|
|
121
121
|
p0: a,
|
|
122
122
|
p1: o
|
|
123
123
|
})
|
|
124
|
-
}) > 5 *
|
|
124
|
+
}) > 5 * p(a, o) ? (n.warn("Current position too far"), null) : {
|
|
125
125
|
...u,
|
|
126
126
|
angle: r
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
|
-
function
|
|
130
|
-
let [r, i] =
|
|
129
|
+
function ie(e, t, n) {
|
|
130
|
+
let [r, i] = ne(n), { lat: a, lng: o } = k({
|
|
131
131
|
x: e,
|
|
132
132
|
y: t
|
|
133
133
|
}, r, i);
|
|
134
134
|
return [o, a];
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function ae(e) {
|
|
137
137
|
var t, n;
|
|
138
|
-
let r = (t =
|
|
138
|
+
let r = (t = N()) == null || (t = t.properties) == null ? void 0 : t.config, i = r ? F(r.p0, r.p2) : NaN, a = Number.isFinite(i) ? i : (n = r == null ? void 0 : r.bearing) == null ? 0 : n;
|
|
139
139
|
return (e == null ? void 0 : e.angle) === null ? 0 : (((e.angle - a) % 360 + 360) % 360 - 90 + 360) % 360;
|
|
140
140
|
}
|
|
141
141
|
//#endregion
|
|
142
142
|
//#region ../wayfinding/src/core/graph/buildGraph.ts
|
|
143
|
-
function
|
|
143
|
+
function oe(e, t, n) {
|
|
144
144
|
var r, i;
|
|
145
145
|
return t.build(e.getLines(), {
|
|
146
146
|
oriented: (r = n.oriented) == null || r,
|
|
@@ -153,7 +153,7 @@ function se(e, t, n) {
|
|
|
153
153
|
}
|
|
154
154
|
//#endregion
|
|
155
155
|
//#region ../../node_modules/.pnpm/ngraph.events@1.4.0/node_modules/ngraph.events/dist/ngraph.events.cjs
|
|
156
|
-
var
|
|
156
|
+
var se = /* @__PURE__ */ t(((e, t) => {
|
|
157
157
|
function n(e) {
|
|
158
158
|
i(e);
|
|
159
159
|
let t = r(e);
|
|
@@ -202,38 +202,38 @@ var ce = /* @__PURE__ */ t(((e, t) => {
|
|
|
202
202
|
for (let n = 0; n < t.length; ++n) if (e.hasOwnProperty(t[n])) throw Error("Subject cannot be eventified, since it already has property '" + t[n] + "'");
|
|
203
203
|
}
|
|
204
204
|
t.exports = n;
|
|
205
|
-
})),
|
|
205
|
+
})), ce = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
206
206
|
t.exports = r;
|
|
207
|
-
var n =
|
|
207
|
+
var n = se();
|
|
208
208
|
function r(e) {
|
|
209
209
|
if (e = e || {}, "uniqueLinkId" in e && (console.warn("ngraph.graph: Starting from version 0.14 `uniqueLinkId` is deprecated.\nUse `multigraph` option instead\n", "\n", "Note: there is also change in default behavior: From now on each graph\nis considered to be not a multigraph by default (each edge is unique)."), e.multigraph = e.uniqueLinkId), e.multigraph === void 0 && (e.multigraph = !1), typeof Map != "function") throw Error("ngraph.graph requires `Map` to be defined. Please polyfill it before using ngraph");
|
|
210
|
-
var t = /* @__PURE__ */ new Map(), r = [], l = {}, u = 0, d = e.multigraph ?
|
|
210
|
+
var t = /* @__PURE__ */ new Map(), r = [], l = {}, u = 0, d = e.multigraph ? E : T, f = [], p = F, m = F, h = F, g = F, _ = {
|
|
211
211
|
addNode: x,
|
|
212
|
-
addLink:
|
|
213
|
-
removeLink:
|
|
212
|
+
addLink: w,
|
|
213
|
+
removeLink: A,
|
|
214
214
|
removeNode: C,
|
|
215
215
|
getNode: S,
|
|
216
|
-
getNodeCount:
|
|
217
|
-
getLinkCount:
|
|
218
|
-
getLinksCount:
|
|
219
|
-
getNodesCount:
|
|
220
|
-
getLinks:
|
|
221
|
-
forEachNode:
|
|
222
|
-
forEachLinkedNode:
|
|
223
|
-
forEachLink:
|
|
216
|
+
getNodeCount: D,
|
|
217
|
+
getLinkCount: O,
|
|
218
|
+
getLinksCount: O,
|
|
219
|
+
getNodesCount: D,
|
|
220
|
+
getLinks: k,
|
|
221
|
+
forEachNode: re,
|
|
222
|
+
forEachLinkedNode: te,
|
|
223
|
+
forEachLink: M,
|
|
224
224
|
beginUpdate: h,
|
|
225
225
|
endUpdate: g,
|
|
226
|
-
clear:
|
|
227
|
-
hasLink:
|
|
226
|
+
clear: ee,
|
|
227
|
+
hasLink: j,
|
|
228
228
|
hasNode: S,
|
|
229
|
-
getLink:
|
|
229
|
+
getLink: j
|
|
230
230
|
};
|
|
231
231
|
return n(_), v(), _;
|
|
232
232
|
function v() {
|
|
233
233
|
var e = _.on;
|
|
234
234
|
_.on = t;
|
|
235
235
|
function t() {
|
|
236
|
-
return _.beginUpdate = h =
|
|
236
|
+
return _.beginUpdate = h = ne, _.endUpdate = g = I, p = y, m = b, _.on = e, e.apply(_, arguments);
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
function y(e, t) {
|
|
@@ -264,38 +264,38 @@ var ce = /* @__PURE__ */ t(((e, t) => {
|
|
|
264
264
|
var r = n.links;
|
|
265
265
|
if (r) {
|
|
266
266
|
n.links = null;
|
|
267
|
-
for (var i = 0; i < r.length; ++i)
|
|
267
|
+
for (var i = 0; i < r.length; ++i) A(r[i]);
|
|
268
268
|
}
|
|
269
269
|
return t.delete(e), m(n, "remove"), g(), !0;
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function w(e, t, n) {
|
|
272
272
|
h();
|
|
273
273
|
var i = S(e) || x(e), a = S(t) || x(t), s = d(e, t, n);
|
|
274
274
|
return r.push(s), o(i, s), e !== t && o(a, s), p(s, "add"), g(), s;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function T(e, t, n) {
|
|
277
277
|
return new s(e, t, n, c(e, t));
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function E(e, t, n) {
|
|
280
280
|
var r = c(e, t), i = l.hasOwnProperty(r);
|
|
281
|
-
if (i ||
|
|
281
|
+
if (i || j(e, t)) {
|
|
282
282
|
i || (l[r] = 0);
|
|
283
283
|
var a = "@" + ++l[r];
|
|
284
284
|
r = c(e + a, t + a);
|
|
285
285
|
}
|
|
286
286
|
return new s(e, t, n, r);
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function D() {
|
|
289
289
|
return t.size;
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function O() {
|
|
292
292
|
return r.length;
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function k(e) {
|
|
295
295
|
var t = S(e);
|
|
296
296
|
return t ? t.links : null;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function A(e) {
|
|
299
299
|
if (!e) return !1;
|
|
300
300
|
var t = i(e, r);
|
|
301
301
|
if (t < 0) return !1;
|
|
@@ -303,7 +303,7 @@ var ce = /* @__PURE__ */ t(((e, t) => {
|
|
|
303
303
|
var n = S(e.fromId), a = S(e.toId);
|
|
304
304
|
return n && (t = i(e, n.links), t >= 0 && n.links.splice(t, 1)), a && (t = i(e, a.links), t >= 0 && a.links.splice(t, 1)), p(e, "remove"), g(), !0;
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function j(e, t) {
|
|
307
307
|
var n = S(e), r;
|
|
308
308
|
if (!n || !n.links) return null;
|
|
309
309
|
for (r = 0; r < n.links.length; ++r) {
|
|
@@ -312,39 +312,39 @@ var ce = /* @__PURE__ */ t(((e, t) => {
|
|
|
312
312
|
}
|
|
313
313
|
return null;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
h(),
|
|
315
|
+
function ee() {
|
|
316
|
+
h(), re(function(e) {
|
|
317
317
|
C(e.id);
|
|
318
318
|
}), g();
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function M(e) {
|
|
321
321
|
var t, n;
|
|
322
322
|
if (typeof e == "function") for (t = 0, n = r.length; t < n; ++t) e(r[t]);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function te(e, t, n) {
|
|
325
325
|
var r = S(e);
|
|
326
|
-
if (r && r.links && typeof t == "function") return n ?
|
|
326
|
+
if (r && r.links && typeof t == "function") return n ? P(r.links, e, t) : N(r.links, e, t);
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function N(e, n, r) {
|
|
329
329
|
for (var i, a = 0; a < e.length; ++a) {
|
|
330
330
|
var o = e[a], s = o.fromId === n ? o.toId : o.fromId;
|
|
331
331
|
if (i = r(t.get(s), o), i) return !0;
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function P(e, n, r) {
|
|
335
335
|
for (var i, a = 0; a < e.length; ++a) {
|
|
336
336
|
var o = e[a];
|
|
337
337
|
if (o.fromId === n && (i = r(t.get(o.toId), o), i)) return !0;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
function
|
|
341
|
-
function
|
|
340
|
+
function F() {}
|
|
341
|
+
function ne() {
|
|
342
342
|
u += 1;
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function I() {
|
|
345
345
|
--u, u === 0 && f.length > 0 && (_.fire("changed", f), f.length = 0);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function re(e) {
|
|
348
348
|
if (typeof e != "function") throw Error("Function is expected to iterate over graph nodes. You passed " + e);
|
|
349
349
|
for (var n = t.values(), r = n.next(); !r.done;) {
|
|
350
350
|
if (e(r.value)) return !0;
|
|
@@ -371,28 +371,28 @@ var ce = /* @__PURE__ */ t(((e, t) => {
|
|
|
371
371
|
function c(e, t) {
|
|
372
372
|
return e.toString() + "👉 " + t.toString();
|
|
373
373
|
}
|
|
374
|
-
})))(), 1),
|
|
374
|
+
})))(), 1), L = (e) => {
|
|
375
375
|
var t;
|
|
376
376
|
return `${(t = e.layer) == null ? "" : t}_${e.x}_${e.y}`;
|
|
377
|
-
},
|
|
377
|
+
}, le = 1, R = (e, t) => {
|
|
378
378
|
var n, r;
|
|
379
|
-
return ((n = e.layer) == null ? "" : n) === ((r = t.layer) == null ? "" : r) &&
|
|
380
|
-
},
|
|
381
|
-
function
|
|
382
|
-
return e.find((e) =>
|
|
379
|
+
return ((n = e.layer) == null ? "" : n) === ((r = t.layer) == null ? "" : r) && p(e, t) <= le;
|
|
380
|
+
}, ue = (e, t, n) => R(e.p0, t) && R(e.p1, n) || R(e.p0, n) && R(e.p1, t);
|
|
381
|
+
function de(e, t, n) {
|
|
382
|
+
return e.find((e) => ue(e, t, n));
|
|
383
383
|
}
|
|
384
|
-
var
|
|
385
|
-
function
|
|
384
|
+
var fe = x(5);
|
|
385
|
+
function pe(e, t) {
|
|
386
386
|
if (e.virtual !== t.virtual) return !1;
|
|
387
|
-
let n =
|
|
388
|
-
return i > Math.PI && (i = 2 * Math.PI - i), i <=
|
|
387
|
+
let n = M(e.p0, e.p1), r = M(t.p0, t.p1), i = Math.abs(r - n);
|
|
388
|
+
return i > Math.PI && (i = 2 * Math.PI - i), i <= fe;
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function me(e, t) {
|
|
391
391
|
let n = [];
|
|
392
392
|
for (let r = 1; r < e.length; r++) {
|
|
393
|
-
let i = e[r - 1], a = e[r], o =
|
|
393
|
+
let i = e[r - 1], a = e[r], o = de(t, i, a);
|
|
394
394
|
if (!o) {
|
|
395
|
-
console.warn(`WF: buildRouteSegments — no line found between ${
|
|
395
|
+
console.warn(`WF: buildRouteSegments — no line found between ${L(i)} and ${L(a)}`);
|
|
396
396
|
continue;
|
|
397
397
|
}
|
|
398
398
|
let s = {
|
|
@@ -400,7 +400,7 @@ function he(e, t) {
|
|
|
400
400
|
p1: a,
|
|
401
401
|
virtual: o.virtual
|
|
402
402
|
}, c = n[n.length - 1];
|
|
403
|
-
c &&
|
|
403
|
+
c && pe(c, s) ? n[n.length - 1] = {
|
|
404
404
|
...c,
|
|
405
405
|
p1: s.p1
|
|
406
406
|
} : n.push(s);
|
|
@@ -409,79 +409,79 @@ function he(e, t) {
|
|
|
409
409
|
}
|
|
410
410
|
//#endregion
|
|
411
411
|
//#region ../wayfinding/src/core/graph/constants.ts
|
|
412
|
-
var
|
|
412
|
+
var he = 1e4, ge = 1.01;
|
|
413
413
|
//#endregion
|
|
414
414
|
//#region ../wayfinding/src/core/graph/linkCost.ts
|
|
415
|
-
function
|
|
416
|
-
return
|
|
415
|
+
function _e(e) {
|
|
416
|
+
return p(e.p0, e.p1) / (e.weight || 4);
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function ve(e) {
|
|
419
419
|
var t, n;
|
|
420
420
|
return ((t = e.p0.layer) == null ? "" : t) !== ((n = e.p1.layer) == null ? "" : n);
|
|
421
421
|
}
|
|
422
|
-
function
|
|
423
|
-
return e.virtual ? e.virtualLength == null ?
|
|
422
|
+
function ye(e) {
|
|
423
|
+
return e.virtual ? e.virtualLength == null ? ve(e) ? he : 0 : e.virtualLength : _e(e);
|
|
424
424
|
}
|
|
425
425
|
//#endregion
|
|
426
426
|
//#region ../wayfinding/src/core/graph/buildNGraph.ts
|
|
427
|
-
function
|
|
428
|
-
let { oriented: n, onlyAccessible: r } = t, i = (0,
|
|
427
|
+
function be(e, t) {
|
|
428
|
+
let { oriented: n, onlyAccessible: r } = t, i = (0, ce.default)();
|
|
429
429
|
for (let t of e) {
|
|
430
430
|
if (r && t.unaccessible) continue;
|
|
431
|
-
let e =
|
|
431
|
+
let e = L(t.p0), a = L(t.p1), o = ye(t);
|
|
432
432
|
i.addLink(e, a, { distance: o }), n && !t.unidirection && i.addLink(a, e, { distance: o });
|
|
433
433
|
}
|
|
434
434
|
return i;
|
|
435
435
|
}
|
|
436
436
|
//#endregion
|
|
437
437
|
//#region ../wayfinding/src/core/graph/utils/a-star/defaultSettings.js
|
|
438
|
-
var
|
|
439
|
-
typeof Object.freeze == "function" && Object.freeze(
|
|
440
|
-
var
|
|
441
|
-
heuristic:
|
|
442
|
-
distance:
|
|
443
|
-
blocked:
|
|
444
|
-
compareFScore:
|
|
445
|
-
NO_PATH:
|
|
446
|
-
setHeapIndex:
|
|
447
|
-
setH1:
|
|
448
|
-
setH2:
|
|
449
|
-
compareF1Score:
|
|
450
|
-
compareF2Score:
|
|
438
|
+
var xe = [];
|
|
439
|
+
typeof Object.freeze == "function" && Object.freeze(xe);
|
|
440
|
+
var z = {
|
|
441
|
+
heuristic: Se,
|
|
442
|
+
distance: Ce,
|
|
443
|
+
blocked: we,
|
|
444
|
+
compareFScore: Te,
|
|
445
|
+
NO_PATH: xe,
|
|
446
|
+
setHeapIndex: Ee,
|
|
447
|
+
setH1: ke,
|
|
448
|
+
setH2: Ae,
|
|
449
|
+
compareF1Score: De,
|
|
450
|
+
compareF2Score: Oe
|
|
451
451
|
};
|
|
452
|
-
function
|
|
452
|
+
function Se() {
|
|
453
453
|
return 0;
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function Ce() {
|
|
456
456
|
return 1;
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function we() {
|
|
459
459
|
return !1;
|
|
460
460
|
}
|
|
461
|
-
function
|
|
461
|
+
function Te(e, t) {
|
|
462
462
|
return e.fScore - t.fScore;
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function Ee(e, t) {
|
|
465
465
|
e.heapIndex = t;
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function De(e, t) {
|
|
468
468
|
return e.f1 - t.f1;
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function Oe(e, t) {
|
|
471
471
|
return e.f2 - t.f2;
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function ke(e, t) {
|
|
474
474
|
e.h1 = t;
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function Ae(e, t) {
|
|
477
477
|
e.h2 = t;
|
|
478
478
|
}
|
|
479
479
|
//#endregion
|
|
480
480
|
//#region ../wayfinding/src/core/graph/utils/a-star/makeSearchStatePool.js
|
|
481
|
-
function
|
|
481
|
+
function je(e) {
|
|
482
482
|
this.node = e, this.parent = null, this.closed = !1, this.open = 0, this.distanceToSource = Infinity, this.fScore = Infinity, this.heapIndex = -1;
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function Me() {
|
|
485
485
|
let e = 0, t = [];
|
|
486
486
|
return {
|
|
487
487
|
createNewState: r,
|
|
@@ -492,21 +492,21 @@ function Ne() {
|
|
|
492
492
|
}
|
|
493
493
|
function r(n) {
|
|
494
494
|
let r = t[e];
|
|
495
|
-
return r ? (r.node = n, r.parent = null, r.closed = !1, r.open = 0, r.distanceToSource = Infinity, r.fScore = Infinity, r.heapIndex = -1) : (r = new
|
|
495
|
+
return r ? (r.node = n, r.parent = null, r.closed = !1, r.open = 0, r.distanceToSource = Infinity, r.fScore = Infinity, r.heapIndex = -1) : (r = new je(n), t[e] = r), e++, r;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
//#endregion
|
|
499
499
|
//#region ../wayfinding/src/core/graph/utils/a-star/NodeHeap.js
|
|
500
|
-
function
|
|
501
|
-
if (!(this instanceof
|
|
502
|
-
if (Array.isArray(e) || (t = e, e = []), t = t || {}, this.data = e || [], this.length = this.data.length, this.compare = t.compare ||
|
|
500
|
+
function B(e, t) {
|
|
501
|
+
if (!(this instanceof B)) return new B(e, t);
|
|
502
|
+
if (Array.isArray(e) || (t = e, e = []), t = t || {}, this.data = e || [], this.length = this.data.length, this.compare = t.compare || Pe, this.setNodeId = t.setNodeId || Ne, this.length > 0) for (let e = this.length >> 1; e >= 0; e--) this._down(e);
|
|
503
503
|
if (t.setNodeId) for (let e = 0; e < this.length; ++e) this.setNodeId(this.data[e], e);
|
|
504
504
|
}
|
|
505
|
-
function
|
|
506
|
-
function
|
|
505
|
+
function Ne() {}
|
|
506
|
+
function Pe(e, t) {
|
|
507
507
|
return e - t;
|
|
508
508
|
}
|
|
509
|
-
|
|
509
|
+
B.prototype = {
|
|
510
510
|
push: function(e) {
|
|
511
511
|
this.data.push(e), this.setNodeId(e, this.length), this.length++, this._up(this.length - 1);
|
|
512
512
|
},
|
|
@@ -542,16 +542,16 @@ z.prototype = {
|
|
|
542
542
|
};
|
|
543
543
|
//#endregion
|
|
544
544
|
//#region ../wayfinding/src/core/graph/utils/a-star/a-star.js
|
|
545
|
-
var
|
|
546
|
-
function
|
|
545
|
+
var Fe = z.NO_PATH;
|
|
546
|
+
function Ie(e, t) {
|
|
547
547
|
t = t || {};
|
|
548
548
|
let n = t.oriented, r = t.blocked;
|
|
549
|
-
r || (r =
|
|
549
|
+
r || (r = z.blocked);
|
|
550
550
|
let i = t.heuristic;
|
|
551
|
-
i || (i =
|
|
551
|
+
i || (i = z.heuristic);
|
|
552
552
|
let a = t.distance;
|
|
553
|
-
a || (a =
|
|
554
|
-
let o =
|
|
553
|
+
a || (a = z.distance);
|
|
554
|
+
let o = Me();
|
|
555
555
|
return { find: s };
|
|
556
556
|
function s(t, s) {
|
|
557
557
|
let c = e.getNode(t);
|
|
@@ -559,17 +559,17 @@ function Le(e, t) {
|
|
|
559
559
|
let l = e.getNode(s);
|
|
560
560
|
if (!l) throw Error("toId is not defined in this graph: " + s);
|
|
561
561
|
o.reset();
|
|
562
|
-
let u = /* @__PURE__ */ new Map(), d = new
|
|
563
|
-
compare:
|
|
564
|
-
setNodeId:
|
|
562
|
+
let u = /* @__PURE__ */ new Map(), d = new B({
|
|
563
|
+
compare: z.compareFScore,
|
|
564
|
+
setNodeId: z.setHeapIndex
|
|
565
565
|
}), f = o.createNewState(c);
|
|
566
566
|
u.set(t, f), f.fScore = i(c, l), f.distanceToSource = 0, d.push(f), f.open = 1;
|
|
567
567
|
let p;
|
|
568
568
|
for (; d.length > 0;) {
|
|
569
|
-
if (p = d.pop(),
|
|
569
|
+
if (p = d.pop(), Le(p, l)) return Re(p);
|
|
570
570
|
p.closed = !0, e.forEachLinkedNode(p.node.id, m, n);
|
|
571
571
|
}
|
|
572
|
-
return
|
|
572
|
+
return Fe;
|
|
573
573
|
function m(e, t) {
|
|
574
574
|
let n = u.get(e.id);
|
|
575
575
|
if (n || (n = o.createNewState(e), u.set(e.id, n)), n.closed || (n.open === 0 && (d.push(n), n.open = 1), r(e, p.node, t))) return;
|
|
@@ -578,17 +578,17 @@ function Le(e, t) {
|
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function Le(e, t) {
|
|
582
582
|
return e.node === t;
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function Re(e) {
|
|
585
585
|
let t = [e.node], n = e.parent;
|
|
586
586
|
for (; n;) t.push(n.node), n = n.parent;
|
|
587
587
|
return t;
|
|
588
588
|
}
|
|
589
589
|
//#endregion
|
|
590
590
|
//#region ../wayfinding/src/core/graph/pathfinder/parseNodeId.ts
|
|
591
|
-
function
|
|
591
|
+
function V(e) {
|
|
592
592
|
let t = e.lastIndexOf("_"), n = e.lastIndexOf("_", t - 1);
|
|
593
593
|
if (n === -1) throw Error(`WF: invalid node ID format "${e}", expected "{layer}_{x}_{y}"`);
|
|
594
594
|
return [
|
|
@@ -599,35 +599,35 @@ function B(e) {
|
|
|
599
599
|
}
|
|
600
600
|
//#endregion
|
|
601
601
|
//#region ../wayfinding/src/core/graph/pathfinder/aStarPathFinder.ts
|
|
602
|
-
function
|
|
602
|
+
function ze() {
|
|
603
603
|
return function(e, t, n) {
|
|
604
604
|
let r = 1;
|
|
605
605
|
if (t.parent) {
|
|
606
|
-
let [, n, i] =
|
|
607
|
-
|
|
606
|
+
let [, n, i] = V(t.parent.node.id), [, a, o] = V(t.node.id), [, s, c] = V(e.id);
|
|
607
|
+
M({
|
|
608
608
|
x: n,
|
|
609
609
|
y: i
|
|
610
610
|
}, {
|
|
611
611
|
x: a,
|
|
612
612
|
y: o
|
|
613
|
-
}) !==
|
|
613
|
+
}) !== M({
|
|
614
614
|
x: a,
|
|
615
615
|
y: o
|
|
616
616
|
}, {
|
|
617
617
|
x: s,
|
|
618
618
|
y: c
|
|
619
|
-
}) && (r =
|
|
619
|
+
}) && (r = ge);
|
|
620
620
|
}
|
|
621
621
|
return r * n.data.distance;
|
|
622
622
|
};
|
|
623
623
|
}
|
|
624
|
-
function
|
|
624
|
+
function Be() {
|
|
625
625
|
let e = null, t = null;
|
|
626
626
|
return {
|
|
627
627
|
build(n, r) {
|
|
628
|
-
t =
|
|
628
|
+
t = be(n, r), e = Ie(t, {
|
|
629
629
|
oriented: r.oriented,
|
|
630
|
-
distance:
|
|
630
|
+
distance: ze()
|
|
631
631
|
});
|
|
632
632
|
},
|
|
633
633
|
hasNode(e) {
|
|
@@ -637,7 +637,7 @@ function Ve() {
|
|
|
637
637
|
if (!e) return [];
|
|
638
638
|
let r = e.find(t, n);
|
|
639
639
|
return r.length ? r.map((e) => {
|
|
640
|
-
let [t, n, r] =
|
|
640
|
+
let [t, n, r] = V(e.id);
|
|
641
641
|
return {
|
|
642
642
|
id: e.id,
|
|
643
643
|
layer: t,
|
|
@@ -650,10 +650,10 @@ function Ve() {
|
|
|
650
650
|
}
|
|
651
651
|
//#endregion
|
|
652
652
|
//#region ../wayfinding/src/core/graph/graphCache.ts
|
|
653
|
-
function
|
|
653
|
+
function Ve() {
|
|
654
654
|
let e = null, t = !1;
|
|
655
655
|
return { getOrBuild(n, r) {
|
|
656
|
-
return e && t === r ? e : (e =
|
|
656
|
+
return e && t === r ? e : (e = oe(n, Be(), {
|
|
657
657
|
oriented: !0,
|
|
658
658
|
onlyAccessible: r
|
|
659
659
|
}), t = r, e);
|
|
@@ -661,71 +661,71 @@ function He() {
|
|
|
661
661
|
}
|
|
662
662
|
//#endregion
|
|
663
663
|
//#region ../wayfinding/src/core/routing/getRouteLength.ts
|
|
664
|
-
function
|
|
665
|
-
return e.reduce((e, t) => e +
|
|
664
|
+
function H(e) {
|
|
665
|
+
return e.reduce((e, t) => e + p(t.p0, t.p1), 0);
|
|
666
666
|
}
|
|
667
667
|
//#endregion
|
|
668
668
|
//#region ../wayfinding/src/core/graph/findShortestPath.ts
|
|
669
|
-
function
|
|
669
|
+
function He(e, t, n) {
|
|
670
670
|
return {
|
|
671
671
|
layer: e,
|
|
672
672
|
x: t,
|
|
673
673
|
y: n
|
|
674
674
|
};
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function Ue(e, t) {
|
|
677
677
|
let n = 0;
|
|
678
678
|
for (let r = 1; r < e.length; r++) {
|
|
679
|
-
let i =
|
|
680
|
-
i && (n +=
|
|
679
|
+
let i = de(t, e[r - 1], e[r]);
|
|
680
|
+
i && (n += ye(i));
|
|
681
681
|
}
|
|
682
682
|
return n;
|
|
683
683
|
}
|
|
684
|
-
function
|
|
684
|
+
function We(e, t, n) {
|
|
685
685
|
let r = e.dataSource.getLines(), i = null, a = Infinity;
|
|
686
686
|
for (let o of t) for (let t of n) {
|
|
687
|
-
let n =
|
|
687
|
+
let n = L(o), s = L(t);
|
|
688
688
|
if (!e.finder.hasNode(n) || !e.finder.hasNode(s)) {
|
|
689
689
|
console.debug(`WF. findShortestPath: node not in graph, skipping pair ${n} → ${s}`);
|
|
690
690
|
continue;
|
|
691
691
|
}
|
|
692
692
|
let c = e.finder.find(n, s);
|
|
693
693
|
if (!c.length) continue;
|
|
694
|
-
let l = c.map((e) =>
|
|
694
|
+
let l = c.map((e) => He(e.layer, e.x, e.y)), u = me(l, r);
|
|
695
695
|
if (!u.length) continue;
|
|
696
|
-
let d =
|
|
696
|
+
let d = Ue(l, r);
|
|
697
697
|
d < a && (a = d, i = {
|
|
698
698
|
lines: u,
|
|
699
|
-
distance:
|
|
699
|
+
distance: H(u)
|
|
700
700
|
});
|
|
701
701
|
}
|
|
702
702
|
return i;
|
|
703
703
|
}
|
|
704
704
|
//#endregion
|
|
705
705
|
//#region ../wayfinding/src/core/routing/routeResult.ts
|
|
706
|
-
var
|
|
706
|
+
var U = () => ({
|
|
707
707
|
lines: [],
|
|
708
708
|
totalDistance: 0
|
|
709
709
|
});
|
|
710
710
|
//#endregion
|
|
711
711
|
//#region ../wayfinding/src/core/routing/buildRoute.ts
|
|
712
|
-
function
|
|
713
|
-
if (!t.length || !n.length) return
|
|
714
|
-
let r =
|
|
712
|
+
function Ge(e, t, n) {
|
|
713
|
+
if (!t.length || !n.length) return U();
|
|
714
|
+
let r = We(e, t, n);
|
|
715
715
|
return r ? {
|
|
716
716
|
lines: r.lines,
|
|
717
717
|
totalDistance: r.distance
|
|
718
|
-
} :
|
|
718
|
+
} : U();
|
|
719
719
|
}
|
|
720
720
|
//#endregion
|
|
721
721
|
//#region ../wayfinding/src/core/routing/buildMultiPointRoute.ts
|
|
722
|
-
function
|
|
723
|
-
if (t.length < 2) return
|
|
722
|
+
function Ke(e, t) {
|
|
723
|
+
if (t.length < 2) return U();
|
|
724
724
|
let n = t.filter((e, n) => n === 0 || n === t.length - 1 || e.length > 0);
|
|
725
|
-
if (n.length < 2) return
|
|
726
|
-
if (n.length === 2) return
|
|
725
|
+
if (n.length < 2) return U();
|
|
726
|
+
if (n.length === 2) return Ge(e, n[0], n[1]);
|
|
727
727
|
let r = [];
|
|
728
|
-
for (let t = 0; t < n.length - 1; t++) r.push(
|
|
728
|
+
for (let t = 0; t < n.length - 1; t++) r.push(Ge(e, n[t], n[t + 1]));
|
|
729
729
|
return {
|
|
730
730
|
lines: r.flatMap((e) => e.lines),
|
|
731
731
|
totalDistance: r.reduce((e, t) => e + t.totalDistance, 0)
|
|
@@ -733,26 +733,26 @@ function qe(e, t) {
|
|
|
733
733
|
}
|
|
734
734
|
//#endregion
|
|
735
735
|
//#region ../wayfinding/src/core/routing/optimizeWaypointOrder.ts
|
|
736
|
-
var
|
|
737
|
-
function
|
|
736
|
+
var qe = 100, Je = -.01;
|
|
737
|
+
function Ye(e) {
|
|
738
738
|
let t = new Map(e), n = Array.from(t.keys());
|
|
739
739
|
if (n.length <= 2) return n;
|
|
740
|
-
let r =
|
|
741
|
-
return r.length < 4 ? r :
|
|
740
|
+
let r = Ze(n, t);
|
|
741
|
+
return r.length < 4 ? r : Qe(r, t);
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function Xe(e) {
|
|
744
744
|
if (e.length <= 3) return e;
|
|
745
745
|
let t = e[0], n = e[e.length - 1], r = e.slice(1, -1);
|
|
746
746
|
return [
|
|
747
747
|
t,
|
|
748
|
-
...
|
|
748
|
+
...Ye(r.map((e, t) => [String(t), {
|
|
749
749
|
x: e.x,
|
|
750
750
|
y: e.y
|
|
751
751
|
}])).map((e) => r[Number(e)]),
|
|
752
752
|
n
|
|
753
753
|
];
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function Ze(e, t) {
|
|
756
756
|
let n = [e[0]], r = new Set(e), i = e[0];
|
|
757
757
|
for (r.delete(e[0]); r.size > 0;) {
|
|
758
758
|
let e = t.get(i), a = "", o = Infinity;
|
|
@@ -765,13 +765,13 @@ function Qe(e, t) {
|
|
|
765
765
|
}
|
|
766
766
|
return n;
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function Qe(e, t) {
|
|
769
769
|
let n = [...e], r = !0;
|
|
770
|
-
for (let e = 0; r && e <
|
|
770
|
+
for (let e = 0; r && e < qe; e++) {
|
|
771
771
|
r = !1;
|
|
772
772
|
scan: for (let e = 1; e < n.length - 2; e++) for (let i = e + 1; i < n.length - 1; i++) {
|
|
773
773
|
let a = t.get(n[e - 1]), o = t.get(n[e]), s = t.get(n[i]), c = t.get(n[i + 1]);
|
|
774
|
-
if (Math.abs(a.x - s.x) + Math.abs(a.y - s.y) + Math.abs(o.x - c.x) + Math.abs(o.y - c.y) - (Math.abs(a.x - o.x) + Math.abs(a.y - o.y)) - (Math.abs(s.x - c.x) + Math.abs(s.y - c.y)) <
|
|
774
|
+
if (Math.abs(a.x - s.x) + Math.abs(a.y - s.y) + Math.abs(o.x - c.x) + Math.abs(o.y - c.y) - (Math.abs(a.x - o.x) + Math.abs(a.y - o.y)) - (Math.abs(s.x - c.x) + Math.abs(s.y - c.y)) < Je) {
|
|
775
775
|
for (let t = e, r = i; t < r; t++, r--) [n[t], n[r]] = [n[r], n[t]];
|
|
776
776
|
r = !0;
|
|
777
777
|
break scan;
|
|
@@ -782,8 +782,8 @@ function $e(e, t) {
|
|
|
782
782
|
}
|
|
783
783
|
//#endregion
|
|
784
784
|
//#region ../wayfinding/src/core/geometry/projectPointOnSegment.ts
|
|
785
|
-
function
|
|
786
|
-
let { projected: r, distance: i, t: a } =
|
|
785
|
+
function $e(e, t, n) {
|
|
786
|
+
let { projected: r, distance: i, t: a } = te({
|
|
787
787
|
p0: t,
|
|
788
788
|
p1: n
|
|
789
789
|
}, e);
|
|
@@ -798,40 +798,40 @@ function et(e, t, n) {
|
|
|
798
798
|
}
|
|
799
799
|
//#endregion
|
|
800
800
|
//#region ../wayfinding/src/core/geometry/pointInPolygon.ts
|
|
801
|
-
var
|
|
802
|
-
function
|
|
801
|
+
var et = .01;
|
|
802
|
+
function tt(e, t, n) {
|
|
803
803
|
return Math.abs(.5 * (e.x * (t.y - n.y) + t.x * (n.y - e.y) + n.x * (e.y - t.y)));
|
|
804
804
|
}
|
|
805
|
-
function
|
|
805
|
+
function nt(e) {
|
|
806
806
|
if (e.length < 3) return 0;
|
|
807
807
|
let t = 0;
|
|
808
|
-
for (let n = 1; n < e.length - 1; n++) t +=
|
|
808
|
+
for (let n = 1; n < e.length - 1; n++) t += tt(e[0], e[n], e[n + 1]);
|
|
809
809
|
return t;
|
|
810
810
|
}
|
|
811
|
-
function
|
|
811
|
+
function rt(e, t, n = nt(t)) {
|
|
812
812
|
if (n === 0) return !1;
|
|
813
813
|
let r = 0;
|
|
814
|
-
for (let n = 0, i = t.length - 1; n < t.length; i = n++) r +=
|
|
815
|
-
return Math.abs(n - r) < n *
|
|
814
|
+
for (let n = 0, i = t.length - 1; n < t.length; i = n++) r += tt(e, t[i], t[n]);
|
|
815
|
+
return Math.abs(n - r) < n * et;
|
|
816
816
|
}
|
|
817
817
|
//#endregion
|
|
818
818
|
//#region ../wayfinding/src/core/routing/graphPointResolvers.ts
|
|
819
|
-
function
|
|
820
|
-
let r =
|
|
821
|
-
return e.getLineEnds().filter((e) => (!n || e.layer === n) &&
|
|
819
|
+
function it(e, t, n) {
|
|
820
|
+
let r = nt(t);
|
|
821
|
+
return e.getLineEnds().filter((e) => (!n || e.layer === n) && rt(e, t, r));
|
|
822
822
|
}
|
|
823
823
|
//#endregion
|
|
824
824
|
//#region ../wayfinding/src/core/routing/resolveWaypointCandidates.ts
|
|
825
|
-
function
|
|
825
|
+
function at(e, t) {
|
|
826
826
|
var n;
|
|
827
827
|
if ((n = t.bounds) != null && n.length) return {
|
|
828
|
-
candidates:
|
|
828
|
+
candidates: it(e.dataSource, t.bounds, t.layer),
|
|
829
829
|
offGraphEntry: null
|
|
830
830
|
};
|
|
831
831
|
let r = null, i = Infinity;
|
|
832
832
|
for (let n of e.dataSource.getLines()) {
|
|
833
833
|
if (n.virtual || t.layer && n.p0.layer !== t.layer || n.p0.x === n.p1.x && n.p0.y === n.p1.y) continue;
|
|
834
|
-
let e =
|
|
834
|
+
let e = $e(t, n.p0, n.p1);
|
|
835
835
|
e.distance < i && (i = e.distance, r = {
|
|
836
836
|
segment: n,
|
|
837
837
|
proj: e
|
|
@@ -862,11 +862,11 @@ function ot(e, t) {
|
|
|
862
862
|
}
|
|
863
863
|
//#endregion
|
|
864
864
|
//#region ../wayfinding/src/core/createWayfindingEngine.ts
|
|
865
|
-
var
|
|
866
|
-
function
|
|
865
|
+
var ot = 1e-6, W = (e, t) => e.layer === t.layer && Math.abs(e.x - t.x) < ot && Math.abs(e.y - t.y) < ot;
|
|
866
|
+
function st(e, t) {
|
|
867
867
|
if (!e.length) return e;
|
|
868
|
-
let n = e[0], r = n.p0, i =
|
|
869
|
-
return
|
|
868
|
+
let n = e[0], r = n.p0, i = W(t.segment.p0, r) ? t.segment.p1 : t.segment.p0;
|
|
869
|
+
return W(n.p1, i) ? [{
|
|
870
870
|
...n,
|
|
871
871
|
p0: t.projection
|
|
872
872
|
}, ...e.slice(1)] : [{
|
|
@@ -875,10 +875,10 @@ function ct(e, t) {
|
|
|
875
875
|
p1: r
|
|
876
876
|
}, ...e];
|
|
877
877
|
}
|
|
878
|
-
function
|
|
878
|
+
function ct(e, t) {
|
|
879
879
|
if (!e.length) return e;
|
|
880
|
-
let n = e[e.length - 1], r = n.p1, i =
|
|
881
|
-
return
|
|
880
|
+
let n = e[e.length - 1], r = n.p1, i = W(t.segment.p0, r) ? t.segment.p1 : t.segment.p0;
|
|
881
|
+
return W(n.p0, i) ? [...e.slice(0, -1), {
|
|
882
882
|
...n,
|
|
883
883
|
p1: t.projection
|
|
884
884
|
}] : [...e, {
|
|
@@ -887,19 +887,19 @@ function lt(e, t) {
|
|
|
887
887
|
p1: t.projection
|
|
888
888
|
}];
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function lt(e, t, n) {
|
|
891
891
|
let r = e;
|
|
892
|
-
return t && (r =
|
|
892
|
+
return t && (r = st(r, t)), n && (r = ct(r, n)), r;
|
|
893
893
|
}
|
|
894
|
-
function
|
|
895
|
-
let t =
|
|
894
|
+
function ut(e) {
|
|
895
|
+
let t = Ve();
|
|
896
896
|
return {
|
|
897
897
|
buildRoute(n, r, i) {
|
|
898
898
|
var a;
|
|
899
|
-
let o = t.getOrBuild(e, (a = i == null ? void 0 : i.accessible) != null && a), s =
|
|
899
|
+
let o = t.getOrBuild(e, (a = i == null ? void 0 : i.accessible) != null && a), s = at(o, n), c = at(o, r), l = Ge(o, s.candidates, c.candidates), u = !!s.offGraphEntry || !!c.offGraphEntry, d = lt(l.lines, s.offGraphEntry, c.offGraphEntry);
|
|
900
900
|
return {
|
|
901
901
|
lines: d,
|
|
902
|
-
distance: u ?
|
|
902
|
+
distance: u ? H(d) : l.totalDistance
|
|
903
903
|
};
|
|
904
904
|
},
|
|
905
905
|
buildWaypointsRoute(n, r) {
|
|
@@ -908,19 +908,19 @@ function dt(e) {
|
|
|
908
908
|
lines: [],
|
|
909
909
|
distance: 0
|
|
910
910
|
};
|
|
911
|
-
let a = t.getOrBuild(e, (i = r == null ? void 0 : r.accessible) != null && i), o = (r != null && r.fastest ?
|
|
911
|
+
let a = t.getOrBuild(e, (i = r == null ? void 0 : r.accessible) != null && i), o = (r != null && r.fastest ? Xe(n) : n).map((e) => at(a, e)), s = Ke(a, o.map((e) => e.candidates)), c = o[0].offGraphEntry, l = o[o.length - 1].offGraphEntry, u = !!c || !!l, d = lt(s.lines, c, l);
|
|
912
912
|
return {
|
|
913
913
|
lines: d,
|
|
914
|
-
distance: u ?
|
|
914
|
+
distance: u ? H(d) : s.totalDistance
|
|
915
915
|
};
|
|
916
916
|
}
|
|
917
917
|
};
|
|
918
918
|
}
|
|
919
919
|
//#endregion
|
|
920
920
|
//#region ../wayfinding/src/core/rendering/computeTrailPoints.ts
|
|
921
|
-
var
|
|
922
|
-
function
|
|
923
|
-
let i =
|
|
921
|
+
var dt = .4, ft = 8;
|
|
922
|
+
function pt(e, t, n = ft, r = dt) {
|
|
923
|
+
let i = p(t, e);
|
|
924
924
|
if (i === 0 || n <= 0) return [];
|
|
925
925
|
let a = Math.max(Math.ceil(i / n) + 1, 2), o = {
|
|
926
926
|
x: (e.x + t.x) / 2,
|
|
@@ -928,11 +928,11 @@ function mt(e, t, n = pt, r = ft) {
|
|
|
928
928
|
}, s = [];
|
|
929
929
|
for (let n = 0; n < a; n++) {
|
|
930
930
|
let r = n / (a - 1);
|
|
931
|
-
s.push(
|
|
931
|
+
s.push(mt(e, o, t, r));
|
|
932
932
|
}
|
|
933
933
|
return s;
|
|
934
934
|
}
|
|
935
|
-
function
|
|
935
|
+
function mt(e, t, n, r) {
|
|
936
936
|
let i = 1 - r;
|
|
937
937
|
return {
|
|
938
938
|
x: i * i * e.x + 2 * i * r * t.x + r * r * n.x,
|
|
@@ -941,36 +941,36 @@ function ht(e, t, n, r) {
|
|
|
941
941
|
}
|
|
942
942
|
//#endregion
|
|
943
943
|
//#region ../wayfinding/src/core/rendering/computeTransitionPoints.ts
|
|
944
|
-
function
|
|
944
|
+
function G(e, t) {
|
|
945
945
|
return e.toLowerCase() === t.toLowerCase();
|
|
946
946
|
}
|
|
947
|
-
function
|
|
948
|
-
return e.findIndex((e) =>
|
|
947
|
+
function ht(e, t) {
|
|
948
|
+
return e.findIndex((e) => G(e, t));
|
|
949
949
|
}
|
|
950
|
-
function
|
|
951
|
-
let r =
|
|
950
|
+
function gt(e, t, n) {
|
|
951
|
+
let r = ht(e, t), i = ht(e, n);
|
|
952
952
|
return r === -1 || i === -1 ? "neutral" : i > r ? "up" : "down";
|
|
953
953
|
}
|
|
954
|
-
function
|
|
955
|
-
return e.find((e) =>
|
|
954
|
+
function _t(e, t, n) {
|
|
955
|
+
return e.find((e) => G(e.p0.layer, t) ? !n.has(e.p1.layer.toLowerCase()) : G(e.p1.layer, t) ? !n.has(e.p0.layer.toLowerCase()) : !1);
|
|
956
956
|
}
|
|
957
|
-
function
|
|
957
|
+
function vt(e, t, n, r) {
|
|
958
958
|
if (t.has(r.toLowerCase())) return r;
|
|
959
|
-
let i = r, a = /* @__PURE__ */ new Set([n.toLowerCase(), i.toLowerCase()]), o =
|
|
960
|
-
for (; o && (i =
|
|
959
|
+
let i = r, a = /* @__PURE__ */ new Set([n.toLowerCase(), i.toLowerCase()]), o = _t(e, i, a);
|
|
960
|
+
for (; o && (i = G(o.p0.layer, i) ? o.p1.layer : o.p0.layer, !t.has(i.toLowerCase()));) a.add(i.toLowerCase()), o = _t(e, i, a);
|
|
961
961
|
return i;
|
|
962
962
|
}
|
|
963
|
-
function
|
|
964
|
-
let { routeLines: t, currentLayerName: n, floorOrder: r } = e, i = t.filter((e) => e.virtual && !
|
|
963
|
+
function yt(e) {
|
|
964
|
+
let { routeLines: t, currentLayerName: n, floorOrder: r } = e, i = t.filter((e) => e.virtual && !G(e.p0.layer, e.p1.layer)), a = /* @__PURE__ */ new Set();
|
|
965
965
|
for (let e of t) e.virtual || (a.add(e.p0.layer.toLowerCase()), a.add(e.p1.layer.toLowerCase()));
|
|
966
|
-
let o = (n ? i.filter((e) =>
|
|
967
|
-
let t = !n ||
|
|
966
|
+
let o = (n ? i.filter((e) => G(e.p0.layer, n) || G(e.p1.layer, n)) : i).map((e) => {
|
|
967
|
+
let t = !n || G(e.p0.layer, n), o = t ? e.p0 : e.p1, s = t ? e.p1 : e.p0, c = vt(i, a, o.layer, s.layer);
|
|
968
968
|
return {
|
|
969
969
|
x: o.x,
|
|
970
970
|
y: o.y,
|
|
971
971
|
layer: o.layer,
|
|
972
972
|
targetLayer: c,
|
|
973
|
-
direction:
|
|
973
|
+
direction: gt(r, o.layer, c),
|
|
974
974
|
role: n ? t ? "exit" : "entry" : "exit"
|
|
975
975
|
};
|
|
976
976
|
}), s = new Set(o.filter((e) => e.role === "exit").map((e) => `${e.x}:${e.y}`)), c = /* @__PURE__ */ new Set();
|
|
@@ -981,37 +981,37 @@ function bt(e) {
|
|
|
981
981
|
}
|
|
982
982
|
//#endregion
|
|
983
983
|
//#region ../wayfinding/src/core/rendering/routeGeometry.ts
|
|
984
|
-
function
|
|
985
|
-
return
|
|
984
|
+
function bt(e) {
|
|
985
|
+
return l.fromPoints(e);
|
|
986
986
|
}
|
|
987
987
|
//#endregion
|
|
988
988
|
//#region ../wayfinding/src/core/position/gpsThreshold.ts
|
|
989
|
-
var
|
|
990
|
-
function
|
|
991
|
-
let { p0: n, p2: r } = t, i =
|
|
989
|
+
var xt = 7.5, St = 15, Ct = 20;
|
|
990
|
+
function wt(e, t) {
|
|
991
|
+
let { p0: n, p2: r } = t, i = E(n, r), a = p(n, r);
|
|
992
992
|
return !i || !a ? 0 : a / i * e;
|
|
993
993
|
}
|
|
994
|
-
var
|
|
994
|
+
var Tt = (e) => {
|
|
995
995
|
if (typeof e == "number" && Number.isFinite(e)) return e;
|
|
996
|
-
},
|
|
997
|
-
let n =
|
|
996
|
+
}, Et = (e, t) => {
|
|
997
|
+
let n = Tt(e);
|
|
998
998
|
return n === void 0 || n === 0 ? t : n;
|
|
999
999
|
};
|
|
1000
|
-
function
|
|
1000
|
+
function Dt({ thresholdInMeters: e, gpsConfig: t }) {
|
|
1001
1001
|
let n = 0;
|
|
1002
|
-
return e && t && (n =
|
|
1002
|
+
return e && t && (n = wt(e, t)), n || (n = Ct), n;
|
|
1003
1003
|
}
|
|
1004
|
-
function
|
|
1005
|
-
return
|
|
1006
|
-
thresholdInMeters:
|
|
1004
|
+
function Ot(e) {
|
|
1005
|
+
return Dt({
|
|
1006
|
+
thresholdInMeters: Et(e == null ? void 0 : e.rerouteThreshold, St),
|
|
1007
1007
|
gpsConfig: e
|
|
1008
1008
|
});
|
|
1009
1009
|
}
|
|
1010
1010
|
//#endregion
|
|
1011
1011
|
//#region ../wayfinding/src/core/position/distanceToRoute.ts
|
|
1012
|
-
function
|
|
1012
|
+
function kt(e, t, n, r, i, a) {
|
|
1013
1013
|
let o = i - n, s = a - r, c = e - n, l = t - r, u = o * o + s * s;
|
|
1014
|
-
if (u === 0) return
|
|
1014
|
+
if (u === 0) return p({
|
|
1015
1015
|
x: e,
|
|
1016
1016
|
y: t
|
|
1017
1017
|
}, {
|
|
@@ -1020,59 +1020,59 @@ function At(e, t, n, r, i, a) {
|
|
|
1020
1020
|
});
|
|
1021
1021
|
let d = (c * o + l * s) / u;
|
|
1022
1022
|
d < 0 ? d = 0 : d > 1 && (d = 1);
|
|
1023
|
-
let
|
|
1024
|
-
return
|
|
1023
|
+
let f = n + d * o, m = r + d * s;
|
|
1024
|
+
return p({
|
|
1025
1025
|
x: e,
|
|
1026
1026
|
y: t
|
|
1027
1027
|
}, {
|
|
1028
|
-
x:
|
|
1028
|
+
x: f,
|
|
1029
1029
|
y: m
|
|
1030
1030
|
});
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1032
|
+
function At(e, t) {
|
|
1033
1033
|
let n = Infinity;
|
|
1034
1034
|
for (let r of t) {
|
|
1035
1035
|
if (e.layer && (r.p0.layer !== e.layer || r.p1.layer !== e.layer)) continue;
|
|
1036
|
-
let t =
|
|
1036
|
+
let t = kt(e.x, e.y, r.p0.x, r.p0.y, r.p1.x, r.p1.y);
|
|
1037
1037
|
t < n && (n = t);
|
|
1038
1038
|
}
|
|
1039
1039
|
return n;
|
|
1040
1040
|
}
|
|
1041
1041
|
//#endregion
|
|
1042
1042
|
//#region ../wayfinding/src/core/position/rerouteController.ts
|
|
1043
|
-
function
|
|
1043
|
+
function jt(e) {
|
|
1044
1044
|
return { shouldReroute(t, n) {
|
|
1045
1045
|
if (!n.length) return !1;
|
|
1046
1046
|
let r = t.layer;
|
|
1047
|
-
return r && !n.some((e) => e.p0.layer === r && e.p1.layer === r) ? !0 :
|
|
1047
|
+
return r && !n.some((e) => e.p0.layer === r && e.p1.layer === r) ? !0 : At(t, n) > e;
|
|
1048
1048
|
} };
|
|
1049
1049
|
}
|
|
1050
1050
|
//#endregion
|
|
1051
1051
|
//#region ../wayfinding/src/core/position/snapToRoute.ts
|
|
1052
|
-
function
|
|
1052
|
+
function Mt(e, t, { snapThreshold: n }) {
|
|
1053
1053
|
let r = t.length;
|
|
1054
1054
|
if (!r) return { snapped: !1 };
|
|
1055
1055
|
let i = e.layer || null, a = Infinity, o = null, s = 0, c = i == null;
|
|
1056
1056
|
for (let n = 0; n < r; n++) {
|
|
1057
|
-
let r = t[n], { p0: l, p1: u } = r, d =
|
|
1057
|
+
let r = t[n], { p0: l, p1: u } = r, d = p(l, u);
|
|
1058
1058
|
if (d === 0) continue;
|
|
1059
1059
|
if (i != null && String(l.layer) !== i) {
|
|
1060
1060
|
s += d;
|
|
1061
1061
|
continue;
|
|
1062
1062
|
}
|
|
1063
1063
|
c = !0;
|
|
1064
|
-
let
|
|
1064
|
+
let f = $e({
|
|
1065
1065
|
x: e.x,
|
|
1066
1066
|
y: e.y
|
|
1067
1067
|
}, l, u);
|
|
1068
|
-
|
|
1068
|
+
f.distance < a && (a = f.distance, o = {
|
|
1069
1069
|
point: {
|
|
1070
1070
|
layer: l.layer,
|
|
1071
|
-
x:
|
|
1072
|
-
y:
|
|
1071
|
+
x: f.projected.x,
|
|
1072
|
+
y: f.projected.y
|
|
1073
1073
|
},
|
|
1074
1074
|
line: r,
|
|
1075
|
-
fromStart: s + d *
|
|
1075
|
+
fromStart: s + d * f.t
|
|
1076
1076
|
}), s += d;
|
|
1077
1077
|
}
|
|
1078
1078
|
return i != null && !c || !o || a > n ? { snapped: !1 } : {
|
|
@@ -1084,7 +1084,7 @@ function Nt(e, t, { snapThreshold: n }) {
|
|
|
1084
1084
|
}
|
|
1085
1085
|
//#endregion
|
|
1086
1086
|
//#region ../wayfinding/src/core/position/splitRouteByPoint.ts
|
|
1087
|
-
function
|
|
1087
|
+
function Nt(e, t) {
|
|
1088
1088
|
let n = 1e-6, r = -1, i = 0, a = Infinity;
|
|
1089
1089
|
for (let n = 0; n < e.length; n++) {
|
|
1090
1090
|
let o = e[n];
|
|
@@ -1126,11 +1126,11 @@ function Pt(e, t) {
|
|
|
1126
1126
|
}
|
|
1127
1127
|
//#endregion
|
|
1128
1128
|
//#region ../wayfinding/src/renderer/iconManager.ts
|
|
1129
|
-
function
|
|
1129
|
+
function Pt(e, t) {
|
|
1130
1130
|
let n = e.bounds, r = e.source, i = r.width * t, a = r.height * t;
|
|
1131
1131
|
if (!(n.size.x === i && n.size.y === a)) return n.set(n.center.x, n.center.y, i, a, n.rotation, n.elevation), [e];
|
|
1132
1132
|
}
|
|
1133
|
-
function
|
|
1133
|
+
function Ft(e, t, n, r = !1) {
|
|
1134
1134
|
let i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
1135
1135
|
function c(e) {
|
|
1136
1136
|
return e.onTop ? n.currentPosition : n.icons;
|
|
@@ -1142,28 +1142,28 @@ function It(e, t, n, r = !1) {
|
|
|
1142
1142
|
let n = a.get(e);
|
|
1143
1143
|
n || (n = /* @__PURE__ */ new Set(), a.set(e, n)), n.add(t), o.set(t, e);
|
|
1144
1144
|
}
|
|
1145
|
-
function
|
|
1145
|
+
function d(e) {
|
|
1146
1146
|
let t = o.get(e);
|
|
1147
1147
|
if (!t) return;
|
|
1148
1148
|
let n = a.get(t);
|
|
1149
1149
|
n && n.delete(e), o.delete(e);
|
|
1150
1150
|
}
|
|
1151
1151
|
function p(n, a, o, l = o.rotation) {
|
|
1152
|
-
var
|
|
1153
|
-
let h = c(o), g = (
|
|
1152
|
+
var d, p, m;
|
|
1153
|
+
let h = c(o), g = (d = o.screenSpace) == null ? r : d;
|
|
1154
1154
|
e.touchLayer(h);
|
|
1155
1155
|
let _ = {
|
|
1156
1156
|
source: o.canvas,
|
|
1157
|
-
bounds: new
|
|
1157
|
+
bounds: new f({
|
|
1158
1158
|
x: o.x,
|
|
1159
1159
|
y: o.y
|
|
1160
|
-
},
|
|
1160
|
+
}, It, l),
|
|
1161
1161
|
hidden: (p = o.hidden) != null && p,
|
|
1162
1162
|
dim: +!!o.dimmed,
|
|
1163
1163
|
origin: o.origin,
|
|
1164
1164
|
screenSpace: g
|
|
1165
1165
|
};
|
|
1166
|
-
o.cardinalSnap && !g && t.attachCardinalSnap(_), _.onScale = ({ pixelSize: e }) =>
|
|
1166
|
+
o.cardinalSnap && !g && t.attachCardinalSnap(_), _.onScale = ({ pixelSize: e }) => Pt(_, e), h.children.push(_);
|
|
1167
1167
|
let v = {
|
|
1168
1168
|
imageDef: _,
|
|
1169
1169
|
layer: h,
|
|
@@ -1174,7 +1174,7 @@ function It(e, t, n, r = !1) {
|
|
|
1174
1174
|
function m(t, n, r, a) {
|
|
1175
1175
|
var o;
|
|
1176
1176
|
let c = r.layer.children, l = c.indexOf(r.imageDef), u = (o = a.rotation) == null ? r.imageDef.bounds.rotation : o;
|
|
1177
|
-
r.imageDef.hidden = !0, e.touchDef(r.imageDef), l >= 0 && c.splice(l, 1), e.touchLayer(r.layer), i.delete(t), s.delete(r.imageDef),
|
|
1177
|
+
r.imageDef.hidden = !0, e.touchDef(r.imageDef), l >= 0 && c.splice(l, 1), e.touchLayer(r.layer), i.delete(t), s.delete(r.imageDef), d(t), p(t, n, a, u);
|
|
1178
1178
|
}
|
|
1179
1179
|
function h(t, r, i, a) {
|
|
1180
1180
|
var o, s, l;
|
|
@@ -1230,13 +1230,13 @@ function It(e, t, n, r = !1) {
|
|
|
1230
1230
|
}
|
|
1231
1231
|
};
|
|
1232
1232
|
}
|
|
1233
|
-
var
|
|
1233
|
+
var It = {
|
|
1234
1234
|
x: 0,
|
|
1235
1235
|
y: 0
|
|
1236
1236
|
};
|
|
1237
1237
|
//#endregion
|
|
1238
1238
|
//#region ../wayfinding/src/renderer/layerManager.ts
|
|
1239
|
-
function
|
|
1239
|
+
function Lt(e) {
|
|
1240
1240
|
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
1241
1241
|
return {
|
|
1242
1242
|
touchLayer(e) {
|
|
@@ -1258,8 +1258,8 @@ function Rt(e) {
|
|
|
1258
1258
|
}
|
|
1259
1259
|
//#endregion
|
|
1260
1260
|
//#region ../wayfinding/src/renderer/lineAnimation.ts
|
|
1261
|
-
var
|
|
1262
|
-
function
|
|
1261
|
+
var Rt = 1, zt = 0;
|
|
1262
|
+
function Bt(e, t, n, r = 0) {
|
|
1263
1263
|
let i = 0, a = 0, o = null, s = null;
|
|
1264
1264
|
if (!e.length) return;
|
|
1265
1265
|
let c = e.map((e) => ({
|
|
@@ -1293,9 +1293,9 @@ function Vt(e, t, n, r = 0) {
|
|
|
1293
1293
|
if (u[t] === n) return;
|
|
1294
1294
|
u[t] = n;
|
|
1295
1295
|
let r = e[t], i = c[t];
|
|
1296
|
-
if (r.hidden = n <=
|
|
1296
|
+
if (r.hidden = n <= zt, !r.hidden) {
|
|
1297
1297
|
let { p0: e, p1: t } = i;
|
|
1298
|
-
r.points = n >=
|
|
1298
|
+
r.points = n >= Rt ? i : {
|
|
1299
1299
|
p0: e,
|
|
1300
1300
|
p1: {
|
|
1301
1301
|
x: e.x + (t.x - e.x) * n,
|
|
@@ -1309,9 +1309,9 @@ function Vt(e, t, n, r = 0) {
|
|
|
1309
1309
|
function g() {
|
|
1310
1310
|
d.length = 0;
|
|
1311
1311
|
let n = i;
|
|
1312
|
-
for (let e = 0; e < n; e++) h(e,
|
|
1313
|
-
h(n, Math.min(a / l[n],
|
|
1314
|
-
for (let t = n + 1; t < e.length; t++) h(t,
|
|
1312
|
+
for (let e = 0; e < n; e++) h(e, Rt);
|
|
1313
|
+
h(n, Math.min(a / l[n], Rt));
|
|
1314
|
+
for (let t = n + 1; t < e.length; t++) h(t, zt);
|
|
1315
1315
|
d.length && t(d);
|
|
1316
1316
|
}
|
|
1317
1317
|
function _(t) {
|
|
@@ -1351,7 +1351,7 @@ function Vt(e, t, n, r = 0) {
|
|
|
1351
1351
|
}
|
|
1352
1352
|
//#endregion
|
|
1353
1353
|
//#region ../wayfinding/src/renderer/routeLineManager.ts
|
|
1354
|
-
function
|
|
1354
|
+
function Vt({ p0: e, p1: t }, n) {
|
|
1355
1355
|
return {
|
|
1356
1356
|
points: {
|
|
1357
1357
|
p0: {
|
|
@@ -1367,7 +1367,7 @@ function Ht({ p0: e, p1: t }, n) {
|
|
|
1367
1367
|
width: 10
|
|
1368
1368
|
};
|
|
1369
1369
|
}
|
|
1370
|
-
function
|
|
1370
|
+
function Ht(e, t, n, r) {
|
|
1371
1371
|
let i = r.lines, a = r.linesAnimated, o = null, s = 1;
|
|
1372
1372
|
function c(e) {
|
|
1373
1373
|
s = e;
|
|
@@ -1384,16 +1384,16 @@ function Ut(e, t, n, r) {
|
|
|
1384
1384
|
e.touchLayer(i), e.touchLayer(a), a.onScale = ({ pixelSize: e }) => c(e);
|
|
1385
1385
|
let m = (f = d == null ? void 0 : d.resetAnimation) == null || f, h = 0;
|
|
1386
1386
|
o && (m || (h = o.getProgress()), o.stop(), o = null), u(i), u(a);
|
|
1387
|
-
let g = r.map((e) =>
|
|
1387
|
+
let g = r.map((e) => Vt(e, t.passed)), _ = l.map((e) => Vt(e, t.remaining));
|
|
1388
1388
|
if (i.children = [...g, ..._], !_.length) {
|
|
1389
1389
|
a.children = [];
|
|
1390
1390
|
return;
|
|
1391
1391
|
}
|
|
1392
1392
|
let v = l.map((e) => ({
|
|
1393
|
-
...
|
|
1393
|
+
...Vt(e, t.active),
|
|
1394
1394
|
hidden: !0
|
|
1395
1395
|
}));
|
|
1396
|
-
a.children = v, o = (p =
|
|
1396
|
+
a.children = v, o = (p = Bt(v, (e) => n.update(...e), () => s, h)) == null ? null : p;
|
|
1397
1397
|
},
|
|
1398
1398
|
clearLines() {
|
|
1399
1399
|
o && (o.stop(), o = null), l(i), l(a);
|
|
@@ -1405,8 +1405,8 @@ function Ut(e, t, n, r) {
|
|
|
1405
1405
|
}
|
|
1406
1406
|
//#endregion
|
|
1407
1407
|
//#region ../wayfinding/src/renderer/trailManager.ts
|
|
1408
|
-
var
|
|
1409
|
-
function
|
|
1408
|
+
var Ut = 40;
|
|
1409
|
+
function Wt(e, t) {
|
|
1410
1410
|
let n = /* @__PURE__ */ new Map(), r = 1, i = !1;
|
|
1411
1411
|
function a(e) {
|
|
1412
1412
|
r = e;
|
|
@@ -1428,18 +1428,18 @@ function Gt(e, t) {
|
|
|
1428
1428
|
}
|
|
1429
1429
|
function c(n) {
|
|
1430
1430
|
s();
|
|
1431
|
-
let i =
|
|
1431
|
+
let i = Ut * r, a = pt(n.from, n.to, i), c = n.canvas, l = {
|
|
1432
1432
|
x: c.width * r,
|
|
1433
1433
|
y: c.height * r
|
|
1434
|
-
}, u = n.dotDefs,
|
|
1435
|
-
for (let e = 0; e <
|
|
1434
|
+
}, u = n.dotDefs, d = Math.min(u.length, a.length), p = [];
|
|
1435
|
+
for (let e = 0; e < d; e++) {
|
|
1436
1436
|
let t = u[e].bounds;
|
|
1437
1437
|
t.set(a[e].x, a[e].y, l.x, l.y, t.rotation, t.elevation), p.push(u[e]);
|
|
1438
1438
|
}
|
|
1439
|
-
if (a.length >
|
|
1440
|
-
let n = a.slice(
|
|
1439
|
+
if (a.length > d) {
|
|
1440
|
+
let n = a.slice(d).map((e) => ({
|
|
1441
1441
|
source: c,
|
|
1442
|
-
bounds: new
|
|
1442
|
+
bounds: new f({
|
|
1443
1443
|
x: e.x,
|
|
1444
1444
|
y: e.y
|
|
1445
1445
|
}, l)
|
|
@@ -1449,8 +1449,8 @@ function Gt(e, t) {
|
|
|
1449
1449
|
membershipChanged: !0
|
|
1450
1450
|
};
|
|
1451
1451
|
}
|
|
1452
|
-
if (u.length >
|
|
1453
|
-
let e = u.splice(
|
|
1452
|
+
if (u.length > d) {
|
|
1453
|
+
let e = u.splice(d);
|
|
1454
1454
|
return o(n, e), p.push(...e), {
|
|
1455
1455
|
changed: p,
|
|
1456
1456
|
membershipChanged: !0
|
|
@@ -1501,16 +1501,16 @@ function Gt(e, t) {
|
|
|
1501
1501
|
}
|
|
1502
1502
|
//#endregion
|
|
1503
1503
|
//#region ../wayfinding/src/renderer/createWayfindingRenderer.ts
|
|
1504
|
-
var
|
|
1504
|
+
var Gt = {
|
|
1505
1505
|
passed: "#B5B7BC",
|
|
1506
1506
|
remaining: "#A4CCE2",
|
|
1507
1507
|
active: "#0794EA"
|
|
1508
1508
|
};
|
|
1509
|
-
function
|
|
1509
|
+
function Kt(e, t, n = {}) {
|
|
1510
1510
|
let r = {
|
|
1511
|
-
...
|
|
1511
|
+
...Gt,
|
|
1512
1512
|
...n.colors
|
|
1513
|
-
}, i =
|
|
1513
|
+
}, i = Lt(e), a = Ft(i, e, t, n.screenSpaceIcons), o = Wt(i, t.trail), s = Ht(i, r, e, t), c = {
|
|
1514
1514
|
setIcon: (...e) => a.setIcon(...e),
|
|
1515
1515
|
clearIcons: (...e) => a.clearIcons(...e),
|
|
1516
1516
|
setTrail: (...e) => o.setTrail(...e),
|
|
@@ -1529,11 +1529,15 @@ function qt(e, t, n = {}) {
|
|
|
1529
1529
|
}
|
|
1530
1530
|
//#endregion
|
|
1531
1531
|
//#region ../wayfinding/src/renderer/layers.ts
|
|
1532
|
-
var
|
|
1533
|
-
function
|
|
1532
|
+
var qt = "wayfinding", Jt = "wf-trail-points", Yt = "wf-lines", Xt = "wf-lines-animated", Zt = "wf-points", Qt = "wf-current-position";
|
|
1533
|
+
function $t(e = {}) {
|
|
1534
1534
|
return {
|
|
1535
|
-
name:
|
|
1535
|
+
name: qt,
|
|
1536
1536
|
children: [
|
|
1537
|
+
{
|
|
1538
|
+
name: Jt,
|
|
1539
|
+
children: []
|
|
1540
|
+
},
|
|
1537
1541
|
{
|
|
1538
1542
|
name: Yt,
|
|
1539
1543
|
children: []
|
|
@@ -1549,18 +1553,14 @@ function en(e = {}) {
|
|
|
1549
1553
|
{
|
|
1550
1554
|
name: Qt,
|
|
1551
1555
|
children: []
|
|
1552
|
-
},
|
|
1553
|
-
{
|
|
1554
|
-
name: $t,
|
|
1555
|
-
children: []
|
|
1556
1556
|
}
|
|
1557
1557
|
],
|
|
1558
1558
|
dim: 0,
|
|
1559
1559
|
overlay: e.overlay
|
|
1560
1560
|
};
|
|
1561
1561
|
}
|
|
1562
|
-
function
|
|
1563
|
-
let t = e.children.find((e) => "name" in e && e.name ===
|
|
1562
|
+
function en(e) {
|
|
1563
|
+
let t = e.children.find((e) => "name" in e && e.name === qt && "children" in e);
|
|
1564
1564
|
if (!t) throw Error("The scene holds no wayfinding block — mount `root` first.");
|
|
1565
1565
|
let n = new Map(t.children.map((e) => [e.name, e]));
|
|
1566
1566
|
function r(e) {
|
|
@@ -1569,20 +1569,20 @@ function tn(e) {
|
|
|
1569
1569
|
return t;
|
|
1570
1570
|
}
|
|
1571
1571
|
return {
|
|
1572
|
-
trail: r(
|
|
1573
|
-
lines: r(
|
|
1574
|
-
linesAnimated: r(
|
|
1575
|
-
icons: r(
|
|
1576
|
-
currentPosition: r(
|
|
1572
|
+
trail: r(Jt),
|
|
1573
|
+
lines: r(Yt),
|
|
1574
|
+
linesAnimated: r(Xt),
|
|
1575
|
+
icons: r(Zt),
|
|
1576
|
+
currentPosition: r(Qt)
|
|
1577
1577
|
};
|
|
1578
1578
|
}
|
|
1579
1579
|
//#endregion
|
|
1580
1580
|
//#region ../wayfinding/src/runtime/positionView.ts
|
|
1581
|
-
var
|
|
1581
|
+
var tn = "current-position", nn = "position";
|
|
1582
1582
|
function rn({ renderer: e, iconProvider: t }) {
|
|
1583
1583
|
return {
|
|
1584
1584
|
place(n, r) {
|
|
1585
|
-
let i = Number.isFinite(n.heading), a = i ? "current_arrow" : "current", o = i ?
|
|
1585
|
+
let i = Number.isFinite(n.heading), a = i ? "current_arrow" : "current", o = i ? x(n.heading) : void 0;
|
|
1586
1586
|
e.setIcon(nn, {
|
|
1587
1587
|
canvas: t.getIcon(a).canvas,
|
|
1588
1588
|
onTop: !0,
|
|
@@ -1644,7 +1644,7 @@ function sn({ engine: e, from: t, to: n, waypoints: r, accessible: i }) {
|
|
|
1644
1644
|
//#region ../wayfinding/src/runtime/snapPositionToRoute.ts
|
|
1645
1645
|
function cn(e, t, n) {
|
|
1646
1646
|
if (!(t != null && t.bounds)) return !1;
|
|
1647
|
-
let r = n == null || !t.layer || t.layer === n, i =
|
|
1647
|
+
let r = n == null || !t.layer || t.layer === n, i = rt({
|
|
1648
1648
|
x: e.x,
|
|
1649
1649
|
y: e.y
|
|
1650
1650
|
}, t.bounds);
|
|
@@ -1659,7 +1659,7 @@ function ln(e, t, n, r, i) {
|
|
|
1659
1659
|
snapped: !0,
|
|
1660
1660
|
snappedPoint: e.p0,
|
|
1661
1661
|
snappedLine: e,
|
|
1662
|
-
distance:
|
|
1662
|
+
distance: H(t)
|
|
1663
1663
|
};
|
|
1664
1664
|
}
|
|
1665
1665
|
if (cn(e, r, a)) {
|
|
@@ -1671,7 +1671,7 @@ function ln(e, t, n, r, i) {
|
|
|
1671
1671
|
distance: 0
|
|
1672
1672
|
};
|
|
1673
1673
|
}
|
|
1674
|
-
return
|
|
1674
|
+
return Mt(e, t, { snapThreshold: i });
|
|
1675
1675
|
}
|
|
1676
1676
|
//#endregion
|
|
1677
1677
|
//#region ../wayfinding/src/runtime/positionTrailView.ts
|
|
@@ -1724,9 +1724,9 @@ function fn({ routeLines: e, currentRouteLayer: t, snap: n }) {
|
|
|
1724
1724
|
if (!(n != null && n.snapped)) return {
|
|
1725
1725
|
passed: [],
|
|
1726
1726
|
remaining: i(r),
|
|
1727
|
-
distance:
|
|
1727
|
+
distance: H(r)
|
|
1728
1728
|
};
|
|
1729
|
-
let { passed: a, remaining: o } =
|
|
1729
|
+
let { passed: a, remaining: o } = Nt(r, n.snappedPoint), s = o !== r && o.length > 0 && o[0].p0.layer === n.snappedPoint.layer ? [{
|
|
1730
1730
|
...o[0],
|
|
1731
1731
|
p0: n.snappedPoint
|
|
1732
1732
|
}, ...o.slice(1)] : o;
|
|
@@ -1741,7 +1741,7 @@ function fn({ routeLines: e, currentRouteLayer: t, snap: n }) {
|
|
|
1741
1741
|
function pn(e, t) {
|
|
1742
1742
|
return {
|
|
1743
1743
|
lines: e.filter((e) => !e.virtual),
|
|
1744
|
-
bounds:
|
|
1744
|
+
bounds: bt(t.flatMap((e) => [e.p0, e.p1]))
|
|
1745
1745
|
};
|
|
1746
1746
|
}
|
|
1747
1747
|
//#endregion
|
|
@@ -1787,7 +1787,7 @@ function gn({ renderer: e, iconProvider: t, floorContext: n, onTransitionClick:
|
|
|
1787
1787
|
if (!e) return;
|
|
1788
1788
|
a = e;
|
|
1789
1789
|
}
|
|
1790
|
-
let o =
|
|
1790
|
+
let o = yt({
|
|
1791
1791
|
routeLines: i,
|
|
1792
1792
|
currentLayerName: a,
|
|
1793
1793
|
floorOrder: n.getFloorOrder()
|
|
@@ -1811,8 +1811,8 @@ function _n(e, t) {
|
|
|
1811
1811
|
//#endregion
|
|
1812
1812
|
//#region ../wayfinding/src/runtime/createWayfindingRuntime.ts
|
|
1813
1813
|
var vn = (e) => e.flatMap((e) => [e.p0, e.p1]);
|
|
1814
|
-
function yn({ engine: e, renderer: t, iconProvider: n, floorContext: r, snapThreshold: i, rerouteThreshold: a, onTransitionClick:
|
|
1815
|
-
let u =
|
|
1814
|
+
function yn({ engine: e, renderer: t, iconProvider: n, floorContext: r, snapThreshold: i, rerouteThreshold: a, onTransitionClick: o, onRouteUpdate: s, onRouteDistance: c }) {
|
|
1815
|
+
let u = jt(a), d = on({
|
|
1816
1816
|
renderer: t,
|
|
1817
1817
|
iconProvider: n,
|
|
1818
1818
|
floorContext: r
|
|
@@ -1820,7 +1820,7 @@ function yn({ engine: e, renderer: t, iconProvider: n, floorContext: r, snapThre
|
|
|
1820
1820
|
renderer: t,
|
|
1821
1821
|
iconProvider: n,
|
|
1822
1822
|
floorContext: r,
|
|
1823
|
-
onTransitionClick:
|
|
1823
|
+
onTransitionClick: o
|
|
1824
1824
|
}), p = un({
|
|
1825
1825
|
renderer: t,
|
|
1826
1826
|
iconProvider: n,
|
|
@@ -1839,10 +1839,10 @@ function yn({ engine: e, renderer: t, iconProvider: n, floorContext: r, snapThre
|
|
|
1839
1839
|
let e = S();
|
|
1840
1840
|
return e === null ? h.filter((e) => !e.virtual) : h.filter((t) => t.p0.layer === e && !t.virtual);
|
|
1841
1841
|
}
|
|
1842
|
-
function
|
|
1842
|
+
function w(e) {
|
|
1843
1843
|
return u.shouldReroute(e, h.filter((e) => !e.virtual));
|
|
1844
1844
|
}
|
|
1845
|
-
function
|
|
1845
|
+
function T() {
|
|
1846
1846
|
if (!g || !_) return null;
|
|
1847
1847
|
let e = C();
|
|
1848
1848
|
return e.length ? {
|
|
@@ -1852,7 +1852,7 @@ function yn({ engine: e, renderer: t, iconProvider: n, floorContext: r, snapThre
|
|
|
1852
1852
|
visibleLines: e
|
|
1853
1853
|
} : null;
|
|
1854
1854
|
}
|
|
1855
|
-
function
|
|
1855
|
+
function E(e = null, t = !1) {
|
|
1856
1856
|
if (!g || !_) return;
|
|
1857
1857
|
let n = fn({
|
|
1858
1858
|
routeLines: h,
|
|
@@ -1861,8 +1861,8 @@ function yn({ engine: e, renderer: t, iconProvider: n, floorContext: r, snapThre
|
|
|
1861
1861
|
});
|
|
1862
1862
|
m.draw(n, t), y = n.distance;
|
|
1863
1863
|
}
|
|
1864
|
-
function
|
|
1865
|
-
let t =
|
|
1864
|
+
function D(e) {
|
|
1865
|
+
let t = T();
|
|
1866
1866
|
if (!t) {
|
|
1867
1867
|
p.setTrail(null, null);
|
|
1868
1868
|
return;
|
|
@@ -1878,32 +1878,32 @@ function yn({ engine: e, renderer: t, iconProvider: n, floorContext: r, snapThre
|
|
|
1878
1878
|
let a = r(t.to);
|
|
1879
1879
|
p.setTrail(a ? t.routePoints[t.routePoints.length - 1] : null, a);
|
|
1880
1880
|
}
|
|
1881
|
-
function
|
|
1881
|
+
function O() {
|
|
1882
1882
|
if (!g || !_) return;
|
|
1883
|
-
let e =
|
|
1883
|
+
let e = T();
|
|
1884
1884
|
if (!e) {
|
|
1885
|
-
d.hide(), f.clear(), p.clearTrail(),
|
|
1885
|
+
d.hide(), f.clear(), p.clearTrail(), E();
|
|
1886
1886
|
return;
|
|
1887
1887
|
}
|
|
1888
|
-
d.place(g, _, e.routePoints, x), f.place(h),
|
|
1888
|
+
d.place(g, _, e.routePoints, x), f.place(h), E(), D(null);
|
|
1889
1889
|
}
|
|
1890
|
-
function
|
|
1890
|
+
function k() {
|
|
1891
1891
|
if (!g || !_) return;
|
|
1892
|
-
let e =
|
|
1892
|
+
let e = T();
|
|
1893
1893
|
e && d.place(g, _, e.routePoints, x);
|
|
1894
1894
|
}
|
|
1895
|
-
function
|
|
1895
|
+
function A() {
|
|
1896
1896
|
if (x = !1, !v || !g || !_) return null;
|
|
1897
1897
|
let e = h.filter((e) => !e.virtual);
|
|
1898
1898
|
if (!e.length) return null;
|
|
1899
|
-
let t =
|
|
1899
|
+
let t = T(), n = t ? p.applyToRoute(v, t, e) : ln(v, e, g, _, i);
|
|
1900
1900
|
return n.snapped && (b = !0), x = n.snapped, n;
|
|
1901
1901
|
}
|
|
1902
|
-
function
|
|
1902
|
+
function j() {
|
|
1903
1903
|
let e = pn(h, C());
|
|
1904
|
-
return
|
|
1904
|
+
return s(e.lines, e.bounds), e;
|
|
1905
1905
|
}
|
|
1906
|
-
function
|
|
1906
|
+
function ee({ from: n, to: r, waypoints: i, accessible: a }) {
|
|
1907
1907
|
let o = sn({
|
|
1908
1908
|
engine: e,
|
|
1909
1909
|
from: n,
|
|
@@ -1911,54 +1911,54 @@ function yn({ engine: e, renderer: t, iconProvider: n, floorContext: r, snapThre
|
|
|
1911
1911
|
waypoints: i,
|
|
1912
1912
|
accessible: a
|
|
1913
1913
|
});
|
|
1914
|
-
if (!o.length) return
|
|
1915
|
-
b = !1, g = n, _ = r, h = o,
|
|
1916
|
-
let { lines: s } =
|
|
1917
|
-
return
|
|
1914
|
+
if (!o.length) return N(), !1;
|
|
1915
|
+
b = !1, g = n, _ = r, h = o, O();
|
|
1916
|
+
let { lines: s } = j(), l = A();
|
|
1917
|
+
return k(), D(l), l && E(l, !0), c(l ? y : H(s)), t.flush(), !0;
|
|
1918
1918
|
}
|
|
1919
|
-
function
|
|
1919
|
+
function M(e) {
|
|
1920
1920
|
let n = v !== null;
|
|
1921
1921
|
if (v = e, !e) {
|
|
1922
|
-
x = !1, p.hideIcon(),
|
|
1922
|
+
x = !1, p.hideIcon(), D(null), n && k(), E(), c(y), t.flush();
|
|
1923
1923
|
return;
|
|
1924
1924
|
}
|
|
1925
1925
|
p.placeIcon(e);
|
|
1926
|
-
let r =
|
|
1927
|
-
|
|
1926
|
+
let r = A();
|
|
1927
|
+
k(), D(r), r && E(r, !0), c(y), t.flush();
|
|
1928
1928
|
}
|
|
1929
|
-
function
|
|
1930
|
-
|
|
1931
|
-
let e =
|
|
1932
|
-
|
|
1933
|
-
}
|
|
1934
|
-
function M() {
|
|
1935
|
-
b = !1, h = [], g = null, _ = null, y = 0, d.hide(), f.clear(), p.clearTrail(), m.clear(), c([], new o()), l(0), t.flush();
|
|
1929
|
+
function te() {
|
|
1930
|
+
O();
|
|
1931
|
+
let e = A();
|
|
1932
|
+
k(), D(e), e && E(e, !0), h.length && j(), c(y), t.flush();
|
|
1936
1933
|
}
|
|
1937
1934
|
function N() {
|
|
1938
|
-
|
|
1935
|
+
b = !1, h = [], g = null, _ = null, y = 0, d.hide(), f.clear(), p.clearTrail(), m.clear(), s([], new l()), c(0), t.flush();
|
|
1936
|
+
}
|
|
1937
|
+
function P() {
|
|
1938
|
+
N(), v = null, t.destroy();
|
|
1939
1939
|
}
|
|
1940
1940
|
return {
|
|
1941
|
-
setRoute:
|
|
1942
|
-
onPositionChanged:
|
|
1943
|
-
onFloorChanged:
|
|
1944
|
-
shouldReroute:
|
|
1945
|
-
clearRoute:
|
|
1946
|
-
destroy:
|
|
1941
|
+
setRoute: ee,
|
|
1942
|
+
onPositionChanged: M,
|
|
1943
|
+
onFloorChanged: te,
|
|
1944
|
+
shouldReroute: w,
|
|
1945
|
+
clearRoute: N,
|
|
1946
|
+
destroy: P
|
|
1947
1947
|
};
|
|
1948
1948
|
}
|
|
1949
1949
|
//#endregion
|
|
1950
1950
|
//#region ../wayfinding/src/createWayfinding.ts
|
|
1951
1951
|
function bn(e) {
|
|
1952
|
-
let { dataSource: t, renderer: n, iconProvider: r, floorContext: i, layers: a, gpsConfig: o } = e, s =
|
|
1952
|
+
let { dataSource: t, renderer: n, iconProvider: r, floorContext: i, layers: a, gpsConfig: o } = e, s = ut(t), c = Kt(n, a, { screenSpaceIcons: e.screenSpaceIcons }), l = yn({
|
|
1953
1953
|
engine: s,
|
|
1954
1954
|
renderer: c,
|
|
1955
1955
|
iconProvider: r,
|
|
1956
1956
|
floorContext: i,
|
|
1957
|
-
snapThreshold:
|
|
1958
|
-
thresholdInMeters:
|
|
1957
|
+
snapThreshold: Dt({
|
|
1958
|
+
thresholdInMeters: Et(o == null ? void 0 : o.snapThreshold, xt),
|
|
1959
1959
|
gpsConfig: o
|
|
1960
1960
|
}),
|
|
1961
|
-
rerouteThreshold:
|
|
1961
|
+
rerouteThreshold: Ot(o),
|
|
1962
1962
|
onTransitionClick: (t) => {
|
|
1963
1963
|
var n;
|
|
1964
1964
|
return (n = e.onTransitionClick) == null ? void 0 : n.call(e, t);
|
|
@@ -2005,7 +2005,7 @@ function Cn(e, t, n) {
|
|
|
2005
2005
|
//#region src/wayfinding/adapters/boothToEndpoint.ts
|
|
2006
2006
|
function wn(e) {
|
|
2007
2007
|
var t, n;
|
|
2008
|
-
let r = e.rect, i =
|
|
2008
|
+
let r = e.rect, i = f.fromMinMax(r.min, r.max, e.rotate).corners();
|
|
2009
2009
|
return {
|
|
2010
2010
|
x: r.center.x,
|
|
2011
2011
|
y: r.center.y,
|
|
@@ -2018,7 +2018,7 @@ function wn(e) {
|
|
|
2018
2018
|
var Tn = "#00A2FF", En = "#FF9F06", q = 34, Dn = 56;
|
|
2019
2019
|
function J(e, t, n, r, i, a) {
|
|
2020
2020
|
let o = e.get(t);
|
|
2021
|
-
return o ? (o.id = t,
|
|
2021
|
+
return o ? (o.id = t, C(o, n, r, i)) : a();
|
|
2022
2022
|
}
|
|
2023
2023
|
function Y(e) {
|
|
2024
2024
|
return {
|
|
@@ -2030,11 +2030,11 @@ function Y(e) {
|
|
|
2030
2030
|
function On(e) {
|
|
2031
2031
|
var t, n;
|
|
2032
2032
|
let { iconMap: r, pixelRatio: i } = e, a = (t = e.sourceColor) == null ? Tn : t, o = (n = e.destinationColor) == null ? En : n, s = /* @__PURE__ */ new Map();
|
|
2033
|
-
s.set("destination", Y(J(r, "destination", q, q, i, () =>
|
|
2034
|
-
let c =
|
|
2033
|
+
s.set("destination", Y(J(r, "destination", q, q, i, () => u(i, o)))), s.set("source", Y(J(r, "departure", q, q, i, () => _(i, a)))), s.set("source_inactive", Y(J(r, "departure_inactive", q, q, i, () => _(i, a))));
|
|
2034
|
+
let c = _(i, a);
|
|
2035
2035
|
c.id = "current-location", s.set("current", Y(c));
|
|
2036
|
-
let l = J(r, "transition", q, q, i, () =>
|
|
2037
|
-
return s.set("transition", Y(l)), s.set("transition_up", Y(J(r, "transition_up", Dn, q, i, () => l))), s.set("transition_down", Y(J(r, "transition_down", Dn, q, i, () => l))), s.set("transition_entry", Y(J(r, "departure", q, q, i, () =>
|
|
2036
|
+
let l = J(r, "transition", q, q, i, () => _(i, a));
|
|
2037
|
+
return s.set("transition", Y(l)), s.set("transition_up", Y(J(r, "transition_up", Dn, q, i, () => l))), s.set("transition_down", Y(J(r, "transition_down", Dn, q, i, () => l))), s.set("transition_entry", Y(J(r, "departure", q, q, i, () => _(i, a)))), s.set("current_arrow", Y(J(r, "direction", q, q, i, () => w(i, a)))), s.set("trail", Y(g(4, "#b5b7bc"))), { getIcon(e) {
|
|
2038
2038
|
let t = s.get(e);
|
|
2039
2039
|
if (!t) throw Error(`Unknown icon: ${e}`);
|
|
2040
2040
|
return t;
|
|
@@ -2068,17 +2068,17 @@ function jn() {
|
|
|
2068
2068
|
return {
|
|
2069
2069
|
getLines: () => {
|
|
2070
2070
|
var e, t;
|
|
2071
|
-
return (e = (t =
|
|
2071
|
+
return (e = (t = c()) == null ? void 0 : t.lines) == null ? [] : e;
|
|
2072
2072
|
},
|
|
2073
2073
|
getLineEnds: () => {
|
|
2074
2074
|
var e, t;
|
|
2075
|
-
return (e = (t =
|
|
2075
|
+
return (e = (t = c()) == null ? void 0 : t.lineEnds) == null ? [] : e;
|
|
2076
2076
|
}
|
|
2077
2077
|
};
|
|
2078
2078
|
}
|
|
2079
2079
|
//#endregion
|
|
2080
2080
|
//#region src/utils/math.ts
|
|
2081
|
-
var Mn = /* @__PURE__ */ e(
|
|
2081
|
+
var Mn = /* @__PURE__ */ e(y(), 1);
|
|
2082
2082
|
function X(e, t) {
|
|
2083
2083
|
return e * (1 - t / 100);
|
|
2084
2084
|
}
|
|
@@ -2090,9 +2090,9 @@ function Ln(e, t) {
|
|
|
2090
2090
|
if (r) {
|
|
2091
2091
|
r.id = "kiosk";
|
|
2092
2092
|
let e = t ? t / 100 : 1;
|
|
2093
|
-
return
|
|
2093
|
+
return C(r, X(Nn * e, Fn), X(Pn * e, Fn), n);
|
|
2094
2094
|
}
|
|
2095
|
-
return
|
|
2095
|
+
return w(n, (0, Mn.default)(In).hex());
|
|
2096
2096
|
}
|
|
2097
2097
|
//#endregion
|
|
2098
2098
|
//#region src/wayfinding/adapters/positionInput.ts
|
|
@@ -2141,7 +2141,7 @@ function Bn({ wayfinding: e, kioskHandler: t, yahHandler: n, stores: { routeStor
|
|
|
2141
2141
|
let n = a.currentPosition, r = o.selectedRoute;
|
|
2142
2142
|
if (!n || !(r != null && r.to)) return;
|
|
2143
2143
|
let i = !r.from, s = ((t = r.from) == null ? void 0 : t.id) === "current-position" && e.shouldReroute(Rn(n));
|
|
2144
|
-
!i && !s || a.rebuildRouteFromPosition(Cn(n, xn,
|
|
2144
|
+
!i && !s || a.rebuildRouteFromPosition(Cn(n, xn, tn));
|
|
2145
2145
|
}
|
|
2146
2146
|
function f() {
|
|
2147
2147
|
var e, n;
|
|
@@ -2153,7 +2153,7 @@ function Bn({ wayfinding: e, kioskHandler: t, yahHandler: n, stores: { routeStor
|
|
|
2153
2153
|
let t = o.selectedRoute, n = a.currentPosition;
|
|
2154
2154
|
if (!(t != null && t.to) || !n || ((e = t.from) == null ? void 0 : e.id) !== "current-position" || a.routeLines.length > 0) return;
|
|
2155
2155
|
let r = n.z == null ? "" : String(n.z);
|
|
2156
|
-
t.from.x === n.x && t.from.y === n.y && t.from.layer === r || a.rebuildRouteFromPosition(Cn(n, xn,
|
|
2156
|
+
t.from.x === n.x && t.from.y === n.y && t.from.layer === r || a.rebuildRouteFromPosition(Cn(n, xn, tn));
|
|
2157
2157
|
}
|
|
2158
2158
|
c.push(i(() => s.layersLoaded, () => {
|
|
2159
2159
|
l(), u();
|
|
@@ -2207,7 +2207,7 @@ function Hn({ wayfinding: e, kioskIconMap: t }) {
|
|
|
2207
2207
|
canvas: r(t.iconSizePercent),
|
|
2208
2208
|
x: t.x,
|
|
2209
2209
|
y: t.y,
|
|
2210
|
-
rotation:
|
|
2210
|
+
rotation: x((a = t.heading) == null ? 0 : a),
|
|
2211
2211
|
screenSpace: !1
|
|
2212
2212
|
}), e.flush();
|
|
2213
2213
|
};
|
|
@@ -2217,7 +2217,7 @@ function Hn({ wayfinding: e, kioskIconMap: t }) {
|
|
|
2217
2217
|
var Q = "yah", Un = "#ff4343", Wn = 64, Gn = 90, Kn = 32;
|
|
2218
2218
|
function qn(e, t) {
|
|
2219
2219
|
let n = e.get(Q);
|
|
2220
|
-
return n ? (n.id = Q,
|
|
2220
|
+
return n ? (n.id = Q, C(n, X(Wn, Kn), X(Gn, Kn), t)) : a(t, Un);
|
|
2221
2221
|
}
|
|
2222
2222
|
function Jn({ wayfinding: e, iconMap: t, pixelRatio: n, floorContext: r }) {
|
|
2223
2223
|
let i = qn(t, n);
|
|
@@ -2251,12 +2251,12 @@ function Zn(e, t, n) {
|
|
|
2251
2251
|
return Xn().wayfinding.buildRoute(e, t, n);
|
|
2252
2252
|
}
|
|
2253
2253
|
function Qn(e) {
|
|
2254
|
-
let { scene: t, store: n, canvas: r } = e, i =
|
|
2255
|
-
attachCardinalSnap:
|
|
2256
|
-
update:
|
|
2254
|
+
let { scene: t, store: n, canvas: r } = e, i = en(t.rootLayer), { wayfinding: a, dispose: o } = $n(n, i, {
|
|
2255
|
+
attachCardinalSnap: S,
|
|
2256
|
+
update: v
|
|
2257
2257
|
}), s = i.icons;
|
|
2258
|
-
return s.onClick = (e) => tr(a, e), s.onPointerMove = (e) => nr(a, r, e), s.onPointerOut = () => nr(a, r),
|
|
2259
|
-
s.onClick = void 0, s.onPointerMove = void 0, s.onPointerOut = void 0, r.current && (r.current.style.cursor = ""),
|
|
2258
|
+
return s.onClick = (e) => tr(a, e), s.onPointerMove = (e) => nr(a, r, e), s.onPointerOut = () => nr(a, r), v(s), () => {
|
|
2259
|
+
s.onClick = void 0, s.onPointerMove = void 0, s.onPointerOut = void 0, r.current && (r.current.style.cursor = ""), v(s), o();
|
|
2260
2260
|
};
|
|
2261
2261
|
}
|
|
2262
2262
|
function $n(e, t, n) {
|
|
@@ -2270,7 +2270,7 @@ function $n(e, t, n) {
|
|
|
2270
2270
|
iconProvider: a,
|
|
2271
2271
|
floorContext: o,
|
|
2272
2272
|
layers: t,
|
|
2273
|
-
gpsConfig: (r =
|
|
2273
|
+
gpsConfig: (r = N()) == null || (r = r.properties) == null ? void 0 : r.config,
|
|
2274
2274
|
screenSpaceIcons: e.uiState.is3DView,
|
|
2275
2275
|
onTransitionClick: (t) => {
|
|
2276
2276
|
t.role === "exit" && e.layerStore.updateVisibility(t.targetLayer, !0);
|
|
@@ -2319,4 +2319,4 @@ function nr(e, t, n) {
|
|
|
2319
2319
|
r.style.cursor = i ? "pointer" : "";
|
|
2320
2320
|
}
|
|
2321
2321
|
//#endregion
|
|
2322
|
-
export {
|
|
2322
|
+
export { M as _, xn as a, tn as c, ae as d, re as f, N as g, F as h, wn as i, $t as l, I as m, Qn as n, Sn as o, ie as p, Yn as r, Cn as s, Zn as t, Ye as u, E as v };
|