@expofp/floorplan 3.44.8 → 3.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/{Button-C1iQgU3z.js → Button-6lV64H09.js} +5 -5
- package/dist/browser/{CookieConsent-Dv1LCPG3.js → CookieConsent-k11VHxoM.js} +7 -7
- package/dist/browser/{Debug-DPy0A0cw.js → Debug-DbfbGWb0.js} +7 -7
- package/dist/browser/{DebugTools-Dp8d4gPZ.js → DebugTools-BjHOBi_k.js} +6 -6
- package/dist/browser/{Demo-CHH4a7sZ.js → Demo-CrFjKybB.js} +9 -9
- package/dist/browser/{Free-BidfuRjG.js → Free-4IN6GHrY.js} +10 -10
- package/dist/browser/{GalleryContainer-7IYWWKkK.js → GalleryContainer-BWd-8Nhp.js} +11 -11
- package/dist/browser/{GpsLoader-CrO61Fpj.js → GpsLoader-C43ADyfU.js} +13 -13
- package/dist/browser/{KioskStore-BE_V60tp.js → KioskStore-0xBjJ9AG.js} +14 -20
- package/dist/browser/{LayerStore-BM7GOQ3J.js → LayerStore-BifpIwHB.js} +3726 -3220
- package/dist/browser/{MaplibreAdapter-DmrCTw3Q.js → MaplibreAdapter-CxETR3-R.js} +2517 -2517
- package/dist/browser/{ModalContainer-DqsSRv60.js → ModalContainer-IvkrtwT_.js} +10 -10
- package/dist/browser/{PermissionNotice--Vn_MkaQ.js → PermissionNotice-C4Nu1dPO.js} +6 -6
- package/dist/browser/{RouteStore-D7G9YROM.js → RouteStore-ltbgXRLP.js} +28 -28
- package/dist/browser/{SetKioskMode-CMndo5d3.js → SetKioskMode-BWzFzO_Q.js} +12 -12
- package/dist/browser/{ShowKiosk-CUiprdS9.js → ShowKiosk-BYOTTOrX.js} +10 -10
- package/dist/browser/{UIState-D0GHKRf4.js → UIState-BG-A7rPb.js} +230 -230
- package/dist/browser/{ViewerMenuPanel-B7corw44.js → ViewerMenuPanel-DscD3jCY.js} +11 -11
- package/dist/browser/{add-debug-secret-listener-uMLIuPW5.js → add-debug-secret-listener-qgQOxLV_.js} +1 -1
- package/dist/browser/{adopt-global-settings-BVVdz-YX.js → adopt-global-settings-CB1YrOJs.js} +9 -9
- package/dist/browser/{boolean-editor-Dg3cfoLy.js → boolean-editor-DcFqYLg6.js} +9 -9
- package/dist/browser/{bootIntercom-7FTJ0piX.js → bootIntercom-DJEOZaFU.js} +2 -2
- package/dist/browser/bundle.json +87 -87
- package/dist/browser/{camera-events-DbYubA01.js → camera-events-BwP3bfY4.js} +1 -1
- package/dist/browser/{classnames-BryLpfgQ.js → classnames-C6CE8V3C.js} +2 -2
- package/dist/browser/{client-DnnJr0Ks.js → client-B42ooBdH.js} +5 -5
- package/dist/browser/{components-DHNMQbqJ.js → components-DelXq6ex.js} +461 -461
- package/dist/browser/{create-live-plan-BgCjK-Kh.js → create-live-plan-jO-YW94S.js} +263 -245
- package/dist/browser/{debug-context-BEABO7OL.js → debug-context-BFAUm0Rv.js} +5 -5
- package/dist/browser/{debug-overlay-Bv-C1rmT.js → debug-overlay-0pLu5_hz.js} +10 -10
- package/dist/browser/{debug-ui-FirQ0EQb.js → debug-ui-CPF3Fr0y.js} +6 -6
- package/dist/browser/{dist-sup8YcEL.js → dist-5MtJlmvC.js} +5 -5
- package/dist/browser/{dist-p14a9te8.js → dist-BImkgFoY.js} +6 -6
- package/dist/browser/{dist-DN5ATV5p.js → dist-D7lv86ly.js} +3 -3
- package/dist/browser/{efp-debug-init-DUPmVtYg.js → efp-debug-init-DBnQHIuj.js} +3 -3
- package/dist/browser/{enum-editor-g46R4Zq7.js → enum-editor-wagTer9Z.js} +4 -4
- package/dist/browser/{es5-D_WEVRPo.js → es5-ClZJZH3H.js} +2 -2
- package/dist/browser/{event-head-DBemDpob.js → event-head-Dvg64Dl9.js} +1 -1
- package/dist/browser/{event-not-found-m_QUX3nl.js → event-not-found-CmHnmais.js} +3 -3
- package/dist/browser/{event-scoped-cache-BpjbCC59.js → event-scoped-cache-blYstzYW.js} +2 -2
- package/dist/browser/{expofpUrl-CAOzqFzt.js → expofpUrl-D99TqyHD.js} +1 -1
- package/dist/browser/{exports-svWN4mLB.js → exports-BBJtyyI0.js} +1 -1
- package/dist/browser/{favicon-hR5BaEm4.js → favicon-Bac0ZnSB.js} +1 -1
- package/dist/browser/{fetch-retry.umd-DS-5XmpN.js → fetch-retry.umd-Dkr69k7z.js} +2 -2
- package/dist/browser/{flex-BAz1Zlx4.js → flex-2znF0sHW.js} +5 -5
- package/dist/browser/{floorplan.loader-DPHmWNvd.js → floorplan.loader-B2NptbPQ.js} +12 -12
- package/dist/browser/{floorplan.ready-clG372Lo.js → floorplan.ready-DTyG-lkM.js} +344 -335
- package/dist/browser/{freeBanner-D0nU1aT0.js → freeBanner-yyOqSdAy.js} +2 -2
- package/dist/browser/{fuse-DFf-hk6f.js → fuse-x_QTzSiL.js} +2 -2
- package/dist/browser/{i18n-CPJmxFQX.js → i18n-CLEztXjo.js} +6 -6
- package/dist/browser/index.js +17 -17
- package/dist/browser/{index.module-COSPv-bu.js → index.module-C9C4kJk7.js} +4 -4
- package/dist/browser/{init-ui-Cj38w8tb.js → init-ui-rxZzKF4X.js} +16 -16
- package/dist/browser/{integrateKiosk-Du5HThkw.js → integrateKiosk-DsU-d7uk.js} +5 -5
- package/dist/browser/{is-debug-CmeNjnvW.js → is-debug-Bnj4naYd.js} +4 -4
- package/dist/browser/{is-own-domain-z0V4JpKp.js → is-own-domain-DNjOZllq.js} +1 -1
- package/dist/browser/{is-webview-JHA9dtnx.js → is-webview-Drer0GOu.js} +1 -1
- package/dist/browser/{jsx-runtime-D-d_UIhH.js → jsx-runtime-DB8EwfzE.js} +2 -2
- package/dist/browser/{kiosk-mode-ZBMSIWbK.js → kiosk-mode-B89VL0oY.js} +3 -3
- package/dist/browser/{kiosk-record-Djd0ZbEF.js → kiosk-record-rnTon4Lp.js} +1 -1
- package/dist/browser/{kioskApi-CXqDoN71.js → kioskApi-opoHdUqq.js} +7 -7
- package/dist/browser/{lib-GyGKAKXf.js → lib-eiqwFHwk.js} +3 -3
- package/dist/browser/{loadImage-cnbZD9uN.js → loadImage-BS80HTUK.js} +1 -1
- package/dist/browser/{logDeviceInfo-BSf9sLzS.js → logDeviceInfo-BqSbYo5l.js} +9 -9
- package/dist/browser/{mobx-D3NQFhEq.js → mobx-9NGoPiek.js} +4 -4
- package/dist/browser/{mobx.module-CAKsDOYI.js → mobx.module-BP1vMHLz.js} +1 -1
- package/dist/browser/{optional-boolean-editor-IR9THgLK.js → optional-boolean-editor-D6hR19BE.js} +3 -3
- package/dist/browser/{optional-enum-editor-PRQn6yzK.js → optional-enum-editor-BQPM-fRt.js} +4 -4
- package/dist/browser/{optional-string-editor-bZCuZ1tn.js → optional-string-editor-DUXoDnXB.js} +4 -4
- package/dist/browser/{particles.min-CwWuVwyg.js → particles.min-CBeInmmW.js} +2 -2
- package/dist/browser/{react-DQVTc7xG.js → react-Dg88gKA7.js} +2 -2
- package/dist/browser/{react-dom-BsqqKfoG.js → react-dom-C3PpoQeD.js} +3 -3
- package/dist/browser/{rolldown-runtime-Cyn7iuGp.js → rolldown-runtime-C7pJ6q0h.js} +1 -1
- package/dist/browser/{scene-CqJCEbSr.js → scene-CV1XFwO9.js} +12 -12
- package/dist/browser/{scheduler-CVY86sNW.js → scheduler-D-EvNbvQ.js} +2 -2
- package/dist/browser/{select-Du3T8Mpj.js → select-CQPuihmE.js} +10 -10
- package/dist/browser/{settings-NB72PTux.js → settings-BBn9P5W0.js} +2 -2
- package/dist/browser/{settings-item-BIPeCHmD.js → settings-item-BOVedxqA.js} +6 -6
- package/dist/browser/{store-BvnDl4Sc.js → store-D73yMRu5.js} +2 -2
- package/dist/browser/{string-editor-o-TMbaK8.js → string-editor-Drmcb4Uw.js} +4 -4
- package/dist/browser/{text-field-BZ5346fV.js → text-field-CnzYOUfF.js} +5 -5
- package/dist/browser/{theme-CPcxdYz7.js → theme-B4d7ReQC.js} +8 -8
- package/dist/browser/{ui-CesJTtUW.js → ui-DQ22eDdk.js} +8 -8
- package/dist/browser/useManageTraffic-C-4Maw9l.js +1439 -0
- package/dist/browser/{useRenderTarget-DpLNpx1f.js → useRenderTarget-BaCkqntS.js} +4 -4
- package/dist/browser/{viewport-QrHclV_L.js → viewport-CcbGLmJI.js} +3 -3
- package/dist/browser/{wayfinding-v9-TVwHq.js → wayfinding-4TI6Xwmj.js} +416 -383
- package/dist/esm/components/Kiosk/KioskStore.d.ts +5 -0
- package/dist/esm/components/Kiosk/KioskStore.js +1 -1
- package/dist/esm/components/Map/drawing/config/TextFitter.d.ts +2 -2
- package/dist/esm/components/Map/drawing/config/TextFitter.js +1 -1
- package/dist/esm/components/Map/drawing/config/canvases.d.ts +90 -2
- package/dist/esm/components/Map/drawing/config/canvases.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-all.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-badge.d.ts +3 -3
- package/dist/esm/components/Map/drawing/config/config-booth-bookmark.d.ts +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-bookmark.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-labels-special.d.ts +3 -4
- package/dist/esm/components/Map/drawing/config/config-booth-labels-special.js +2 -2
- package/dist/esm/components/Map/drawing/config/config-booth-labels.d.ts +2 -2
- package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-markers.d.ts +17 -1
- package/dist/esm/components/Map/drawing/config/config-markers.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-pins.d.ts +40 -0
- package/dist/esm/components/Map/drawing/config/config-pins.js +1 -0
- package/dist/esm/components/Map/drawing/config/pin-geometry.d.ts +65 -0
- package/dist/esm/components/Map/drawing/config/pin-geometry.js +1 -0
- package/dist/esm/components/Map/traffic/useBuildRoute.d.ts +1 -1
- package/dist/esm/components/Map/traffic/useBuildRoute.js +4 -4
- package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
- package/dist/esm/engine/defs.d.ts +5 -0
- package/dist/esm/engine/defs.js +3 -3
- package/dist/esm/engine/update-def.d.ts +13 -1
- package/dist/esm/engine/update-def.js +1 -1
- package/dist/esm/services/url-dispatch.js +1 -1
- package/dist/esm/store/init/init-heatmap.d.ts +1 -1
- package/dist/esm/store/init/init-heatmap.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsActions.d.ts +9 -0
- package/dist/esm/store/search-buttons/SearchButtonsActions.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsStore.d.ts +15 -0
- package/dist/esm/store/search-buttons/SearchButtonsStore.js +1 -1
- package/dist/esm/test/store-harness.d.ts +13 -0
- package/dist/esm/test/store-harness.js +1 -1
- package/dist/esm/utils/dimming.js +1 -1
- package/dist/esm/wayfinding/adapters/canvasIconProvider.js +1 -1
- package/dist/esm/wayfinding/handlers/kioskHandler.js +1 -1
- package/dist/esm/wayfinding/handlers/yahHandler.js +1 -1
- package/package.json +10 -10
- package/dist/browser/dimming-B7lpw_UN.js +0 -1214
- package/dist/esm/engine/canvases.d.ts +0 -5
- package/dist/esm/engine/canvases.js +0 -1
|
@@ -0,0 +1,1439 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
try {
|
|
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.45.0" };
|
|
5
|
+
var t = new e.Error().stack;
|
|
6
|
+
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "4354dba9-9579-49e0-95d7-670e0032a740", e._sentryDebugIdIdentifier = "sentry-dbid-4354dba9-9579-49e0-95d7-670e0032a740");
|
|
7
|
+
} catch {}
|
|
8
|
+
})();
|
|
9
|
+
import { r as e } from "./rolldown-runtime-C7pJ6q0h.js";
|
|
10
|
+
import { g as t } from "./i18n-CLEztXjo.js";
|
|
11
|
+
import { t as n } from "./react-Dg88gKA7.js";
|
|
12
|
+
import { i as r, l as i } from "./mobx.module-BP1vMHLz.js";
|
|
13
|
+
import { t as a } from "./loadImage-BS80HTUK.js";
|
|
14
|
+
import { r as o } from "./debug-context-BFAUm0Rv.js";
|
|
15
|
+
import { a as s, l as c, t as l, u } from "./store-D73yMRu5.js";
|
|
16
|
+
import { $t as d, At as f, D as p, Ft as m, G as h, Gt as g, It as _, J as v, Mt as y, Nt as b, Pt as x, Qt as S, Rt as C, St as w, Tt as T, Vt as E, W as D, X as O, Xt as k, Y as A, Z as ee, _t as j, an as te, at as ne, b as re, bt as ie, d as ae, en as oe, et as se, f as ce, ft as M, i as le, in as N, it as ue, jt as de, kt as P, nn as fe, q as pe, qt as me, rt as he, t as ge, vt as _e, wt as ve, x as ye, xt as be } from "./LayerStore-BifpIwHB.js";
|
|
17
|
+
import { _ as xe, l as Se } from "./wayfinding-4TI6Xwmj.js";
|
|
18
|
+
import { i as Ce, n as we } from "./viewport-CcbGLmJI.js";
|
|
19
|
+
import { r as Te } from "./scene-CV1XFwO9.js";
|
|
20
|
+
//#region src/components/Map/traffic/trafficLayers.ts
|
|
21
|
+
var Ee = "traffic_route", De = "traffic_route_stop", F = "traffic_vehicles", Oe = "build_route_lines", ke = "build_route_dots", Ae = 5;
|
|
22
|
+
function je() {
|
|
23
|
+
let e = [];
|
|
24
|
+
for (let t = 0; t < Ae; t++) e.push({
|
|
25
|
+
name: Me(t),
|
|
26
|
+
children: []
|
|
27
|
+
}), e.push({
|
|
28
|
+
name: Ne(t),
|
|
29
|
+
children: []
|
|
30
|
+
});
|
|
31
|
+
return e.push({
|
|
32
|
+
name: F,
|
|
33
|
+
children: []
|
|
34
|
+
}), e.push({
|
|
35
|
+
name: Oe,
|
|
36
|
+
children: []
|
|
37
|
+
}), e.push({
|
|
38
|
+
name: ke,
|
|
39
|
+
children: []
|
|
40
|
+
}), e;
|
|
41
|
+
}
|
|
42
|
+
function Me(e) {
|
|
43
|
+
return `${Ee}_${e + 1}`;
|
|
44
|
+
}
|
|
45
|
+
function Ne(e) {
|
|
46
|
+
return `${De}_${e + 1}`;
|
|
47
|
+
}
|
|
48
|
+
function Pe() {
|
|
49
|
+
return RegExp(`^${Ee}_\\d+$`);
|
|
50
|
+
}
|
|
51
|
+
function Fe() {
|
|
52
|
+
return RegExp(`^${De}_\\d+$`);
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/components/Map/drawing/config/booth-badge-anchor.ts
|
|
56
|
+
var Ie = /* @__PURE__ */ e(j(), 1), Le = .5, Re = .3, ze = 10, Be = 8, Ve = 4, He = 50, I = class e {
|
|
57
|
+
constructor(e, t, n, r) {
|
|
58
|
+
this.booth = e, this.triangles = t, this.border = n, this.source = r, this.fits = [], this.prefetchRotation = 0, this.polygon = void 0, this.bbox = void 0, this.vertices = null, this.polygon = We(t), this.bbox = Ue(t);
|
|
59
|
+
}
|
|
60
|
+
fit(e, t) {
|
|
61
|
+
let n = this.fits[e];
|
|
62
|
+
return n || (this.fits[e] = n = this.compute(e, t), this.fits.filter(Boolean).length === 4 && (this.vertices = null)), n;
|
|
63
|
+
}
|
|
64
|
+
prefetch(t) {
|
|
65
|
+
e.idle.has(this) || (this.prefetchRotation = t, e.idle.add(this), e.scheduleIdle());
|
|
66
|
+
}
|
|
67
|
+
cancelPrefetch() {
|
|
68
|
+
e.idle.delete(this);
|
|
69
|
+
}
|
|
70
|
+
static scheduleIdle() {
|
|
71
|
+
e.idleScheduled || !e.idle.size || (e.idleScheduled = !0, typeof requestIdleCallback == "function" ? requestIdleCallback(e.runIdle) : typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => setTimeout(e.runSlice, 0)) : setTimeout(e.runSlice, He));
|
|
72
|
+
}
|
|
73
|
+
static runSlice() {
|
|
74
|
+
let t = performance.now() + Ve;
|
|
75
|
+
e.runIdle({ timeRemaining: () => t - performance.now() });
|
|
76
|
+
}
|
|
77
|
+
static runIdle(t) {
|
|
78
|
+
e.idleScheduled = !1;
|
|
79
|
+
let n = performance.now() + Be;
|
|
80
|
+
try {
|
|
81
|
+
for (let r of e.idle) {
|
|
82
|
+
if (t.timeRemaining() <= 0 || performance.now() >= n) break;
|
|
83
|
+
let i = !1;
|
|
84
|
+
try {
|
|
85
|
+
i = r.prefetchNext();
|
|
86
|
+
} finally {
|
|
87
|
+
i || e.idle.delete(r);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
} finally {
|
|
91
|
+
e.scheduleIdle();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
prefetchNext() {
|
|
95
|
+
for (let e = 1; e < 4; e++) if (!this.fits[e]) return this.fit(e, this.prefetchRotation + e * Math.PI / 2), e < 3;
|
|
96
|
+
return !1;
|
|
97
|
+
}
|
|
98
|
+
compute(e, t) {
|
|
99
|
+
let n = e === 0 || e === 3 ? 1 : -1, r = e === 0 || e === 1 ? 1 : -1, i = this.findAnchor(n, r), a = this.clampScale(i.x, i.y, this.rectMaxScale(e % 2 == 1), t);
|
|
100
|
+
return {
|
|
101
|
+
x: i.x,
|
|
102
|
+
y: i.y,
|
|
103
|
+
maxScale: a
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
rectMaxScale(e) {
|
|
107
|
+
let t = this.booth.rect.size.width, n = this.booth.rect.size.height, r = e ? n : t, i = e ? t : n;
|
|
108
|
+
return Math.min(r > 0 ? r * Le / this.source.x : Infinity, i > 0 ? i * Re / this.source.y : Infinity);
|
|
109
|
+
}
|
|
110
|
+
findAnchor(e, t) {
|
|
111
|
+
var n;
|
|
112
|
+
let { booth: r, border: i, bbox: a } = this;
|
|
113
|
+
if (a) {
|
|
114
|
+
let n = e > 0 ? a.min.x : a.max.x, r = t > 0 ? a.min.y : a.max.y, o = [];
|
|
115
|
+
for (let [a, s] of this.distinctVertices()) {
|
|
116
|
+
let c = a + i * e, l = s + i * t, u = Math.abs(c - n) + Math.abs(l - r);
|
|
117
|
+
u < Infinity && o.push({
|
|
118
|
+
x: c,
|
|
119
|
+
y: l,
|
|
120
|
+
score: u,
|
|
121
|
+
order: o.length
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
o.sort((e, t) => e.score - t.score || e.order - t.order);
|
|
125
|
+
for (let e of o) {
|
|
126
|
+
let t = {
|
|
127
|
+
x: e.x,
|
|
128
|
+
y: e.y
|
|
129
|
+
};
|
|
130
|
+
if (this.polygon.containsPoint(t)) return t;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
let o = e > 0 ? r.rect.min.x + i : r.rect.max.x - i, s = t > 0 ? r.rect.min.y + i : r.rect.max.y - i, c = (n = r.rotate) == null ? 0 : n;
|
|
134
|
+
return c ? N({
|
|
135
|
+
x: o,
|
|
136
|
+
y: s
|
|
137
|
+
}, c, r.rect.center) : {
|
|
138
|
+
x: o,
|
|
139
|
+
y: s
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
clampScale(e, t, n, r) {
|
|
143
|
+
let { polygon: i, source: a } = this;
|
|
144
|
+
if (!this.triangles.length) return n;
|
|
145
|
+
let o = {
|
|
146
|
+
x: e,
|
|
147
|
+
y: t
|
|
148
|
+
};
|
|
149
|
+
if (!i.containsPoint(o)) return n;
|
|
150
|
+
let s = 0, c = n;
|
|
151
|
+
for (let n = 0; n < ze; n++) {
|
|
152
|
+
let n = (s + c) / 2, l = a.x * n, u = a.y * n;
|
|
153
|
+
i.containsPoint(N({
|
|
154
|
+
x: e + l,
|
|
155
|
+
y: t
|
|
156
|
+
}, r, o)) && i.containsPoint(N({
|
|
157
|
+
x: e,
|
|
158
|
+
y: t + u
|
|
159
|
+
}, r, o)) && i.containsPoint(N({
|
|
160
|
+
x: e + l,
|
|
161
|
+
y: t + u
|
|
162
|
+
}, r, o)) ? s = n : c = n;
|
|
163
|
+
}
|
|
164
|
+
return s;
|
|
165
|
+
}
|
|
166
|
+
distinctVertices() {
|
|
167
|
+
if (this.vertices) return this.vertices;
|
|
168
|
+
let e = /* @__PURE__ */ new Set(), t = [];
|
|
169
|
+
for (let n of this.triangles) for (let r of n) {
|
|
170
|
+
let n = `${r[0]},${r[1]}`;
|
|
171
|
+
e.has(n) || (e.add(n), t.push([r[0], r[1]]));
|
|
172
|
+
}
|
|
173
|
+
return this.vertices = t;
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
I.idle = /* @__PURE__ */ new Set(), I.idleScheduled = !1;
|
|
177
|
+
function Ue(e) {
|
|
178
|
+
if (!e.length) return null;
|
|
179
|
+
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
|
|
180
|
+
for (let a of e) for (let [e, o] of a) e < t && (t = e), o < n && (n = o), e > r && (r = e), o > i && (i = o);
|
|
181
|
+
return k.fromMinMax({
|
|
182
|
+
x: t,
|
|
183
|
+
y: n
|
|
184
|
+
}, {
|
|
185
|
+
x: r,
|
|
186
|
+
y: i
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function We(e) {
|
|
190
|
+
let t = [], n = [];
|
|
191
|
+
for (let r of e) {
|
|
192
|
+
let e = t.length;
|
|
193
|
+
t.push({
|
|
194
|
+
x: r[0][0],
|
|
195
|
+
y: r[0][1]
|
|
196
|
+
}), t.push({
|
|
197
|
+
x: r[1][0],
|
|
198
|
+
y: r[1][1]
|
|
199
|
+
}), t.push({
|
|
200
|
+
x: r[2][0],
|
|
201
|
+
y: r[2][1]
|
|
202
|
+
}), n.push([
|
|
203
|
+
e,
|
|
204
|
+
e + 1,
|
|
205
|
+
e + 2
|
|
206
|
+
]);
|
|
207
|
+
}
|
|
208
|
+
return new oe(t, n);
|
|
209
|
+
}
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region src/components/Map/drawing/config/config-booth-badge-eligibility.ts
|
|
212
|
+
function Ge(e) {
|
|
213
|
+
return e.hideExhibitorBoothNumber || e.hideBoothBadges || !e.hasExhibitors ? !1 : e.noLabels || !e.hideLogoInBooth && e.hasLogoInBooth;
|
|
214
|
+
}
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region src/components/Map/drawing/config/config-booth-badge.ts
|
|
217
|
+
var Ke = 15, qe = 24, Je = 30, Ye = 12, Xe = .8, Ze = document.createElement("canvas").getContext("2d");
|
|
218
|
+
function Qe(e) {
|
|
219
|
+
return e.length <= Ke ? e : e.slice(0, Ke - 1) + "…";
|
|
220
|
+
}
|
|
221
|
+
function $e(e) {
|
|
222
|
+
var t, n;
|
|
223
|
+
if (!((t = e.paths) != null && t.length)) return [];
|
|
224
|
+
let r = ((n = e.layer) == null ? void 0 : n.name) || "", i = [];
|
|
225
|
+
for (let t of e.paths) for (let e of E(t.index, r)) i.push(e);
|
|
226
|
+
return i;
|
|
227
|
+
}
|
|
228
|
+
function L(e) {
|
|
229
|
+
return e && e !== "none" ? e : void 0;
|
|
230
|
+
}
|
|
231
|
+
function et(e) {
|
|
232
|
+
var t;
|
|
233
|
+
let n = L(e.borderColor) || L(C.boothBorderColor) || C.colors.booths.default;
|
|
234
|
+
return ((t = e.paths) == null ? void 0 : t.length) > 1 && L(e.paths[e.paths.length - 1].color) || n;
|
|
235
|
+
}
|
|
236
|
+
function tt(e) {
|
|
237
|
+
var t;
|
|
238
|
+
let n = Qe(e.title || e.name), r = et(e), a = Te((0, Ie.default)(r).hex()), o = ae();
|
|
239
|
+
Ze.font = f(Je, o);
|
|
240
|
+
let s = Ze.measureText(n).width, c = Math.ceil(s + Ye * 2), p = (e.borderWidth || l.borderWidth) / 2, m = c * Xe, h = 54 * Xe, g = new I(e, $e(e), p, {
|
|
241
|
+
x: m,
|
|
242
|
+
y: h
|
|
243
|
+
}), _ = (t = e.rotate) == null ? 0 : t, y = 0, b = 0, x = 0, S = 0, C = () => {
|
|
244
|
+
let e = g.fit(y, _);
|
|
245
|
+
b = e.x, x = e.y, S = e.maxScale;
|
|
246
|
+
};
|
|
247
|
+
C();
|
|
248
|
+
let w = (t, n) => {
|
|
249
|
+
let r = t / 2, i = n / 2;
|
|
250
|
+
return new d(N({
|
|
251
|
+
x: b + r,
|
|
252
|
+
y: x + i
|
|
253
|
+
}, _, {
|
|
254
|
+
x: b,
|
|
255
|
+
y: x
|
|
256
|
+
}), {
|
|
257
|
+
x: t,
|
|
258
|
+
y: n
|
|
259
|
+
}, _, e.elevation);
|
|
260
|
+
}, T = ce(o, ee()), E = pe(w(1, 1), r);
|
|
261
|
+
E.hidden = !0, E.dim = e.skipDim ? 0 : void 0;
|
|
262
|
+
let D = v(A([[n], []], a, 0, [T, T]), w(1, 1), [0, 0], {
|
|
263
|
+
horizontal: "center",
|
|
264
|
+
vertical: "center"
|
|
265
|
+
});
|
|
266
|
+
D.hidden = !0, D.dim = e.skipDim ? 0 : void 0;
|
|
267
|
+
let O = {
|
|
268
|
+
booth: e,
|
|
269
|
+
anchor: {
|
|
270
|
+
x: b,
|
|
271
|
+
y: x
|
|
272
|
+
},
|
|
273
|
+
source: {
|
|
274
|
+
x: m,
|
|
275
|
+
y: h
|
|
276
|
+
},
|
|
277
|
+
rotation: _,
|
|
278
|
+
maxScale: S,
|
|
279
|
+
bg: E,
|
|
280
|
+
text: D
|
|
281
|
+
}, k = new nt(O);
|
|
282
|
+
E.onScale = ({ pixelSize: e }) => k.layOutBg(e), D.onScale = ({ pixelSize: e }) => k.layOutText(e);
|
|
283
|
+
let j = [];
|
|
284
|
+
return j.push(i(() => e.skipDim, (e) => {
|
|
285
|
+
E.dim = e ? 0 : void 0, D.dim = e ? 0 : void 0, M(E, D);
|
|
286
|
+
})), j.push(i(() => {
|
|
287
|
+
var t, n;
|
|
288
|
+
return (t = (n = e.layer) == null ? void 0 : n.visible) == null || t;
|
|
289
|
+
}, (e) => {
|
|
290
|
+
E.hidden = !e, D.hidden = !e, M(E, D);
|
|
291
|
+
})), j.push(i(() => u.mapSettings, ({ roll: t }) => {
|
|
292
|
+
var n;
|
|
293
|
+
ue(t == null ? 0 : t) && (g.prefetch((n = e.rotate) == null ? 0 : n), E.onRoll = ({ roll: e, pixelSize: t }) => {
|
|
294
|
+
let n = he(e, _);
|
|
295
|
+
if (n !== 0) return _ += n * Math.PI / 2, y = ((y + n) % 4 + 4) % 4, C(), O.anchor.x = b, O.anchor.y = x, O.rotation = _, O.maxScale = S, [...k.layOutBg(t), ...k.layOutText(t)];
|
|
296
|
+
});
|
|
297
|
+
}, { fireImmediately: !0 }), () => g.cancelPrefetch()), {
|
|
298
|
+
bg: E,
|
|
299
|
+
text: D,
|
|
300
|
+
dispose: () => {
|
|
301
|
+
j.forEach((e) => e()), j.length = 0;
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
var nt = class {
|
|
306
|
+
constructor(e) {
|
|
307
|
+
this.placement = e;
|
|
308
|
+
}
|
|
309
|
+
layOutBg(e) {
|
|
310
|
+
let { bg: t } = this.placement;
|
|
311
|
+
return t.shape = this.rectScaled(e), t.hidden = this.isHidden(), t.hidden ? [] : [t];
|
|
312
|
+
}
|
|
313
|
+
layOutText(e) {
|
|
314
|
+
let { text: t, maxScale: n } = this.placement;
|
|
315
|
+
return t.lines[0].fontSize = qe * Math.min(e, n), t.bounds = this.rectScaled(e), t.hidden = this.isHidden(), t.hidden ? [] : [t];
|
|
316
|
+
}
|
|
317
|
+
rectScaled(e) {
|
|
318
|
+
let { anchor: t, booth: n, source: r, rotation: i, maxScale: a } = this.placement, o = Math.min(e, a), s = r.x * o, c = r.y * o;
|
|
319
|
+
return new d(N({
|
|
320
|
+
x: t.x + s / 2,
|
|
321
|
+
y: t.y + c / 2
|
|
322
|
+
}, i, t), {
|
|
323
|
+
x: s,
|
|
324
|
+
y: c
|
|
325
|
+
}, i, n.elevation);
|
|
326
|
+
}
|
|
327
|
+
isHidden() {
|
|
328
|
+
let { booth: e } = this.placement;
|
|
329
|
+
return !!(e.layer && !e.layer.visible);
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
function rt(e, t) {
|
|
333
|
+
let n = [], r = [], i = [];
|
|
334
|
+
for (let e of t) if (e instanceof se && Ge({
|
|
335
|
+
hideExhibitorBoothNumber: g.hideExhibitorBoothNumber,
|
|
336
|
+
hideBoothBadges: g.hideBoothBadges,
|
|
337
|
+
hideLogoInBooth: u.hideLogoInBooth,
|
|
338
|
+
noLabels: e.noLabels,
|
|
339
|
+
hasExhibitors: e.exhibitors.length > 0,
|
|
340
|
+
hasLogoInBooth: e.exhibitors.some((e) => e.logoInBooth && e.logo)
|
|
341
|
+
})) {
|
|
342
|
+
let { bg: t, text: a, dispose: o } = tt(e);
|
|
343
|
+
n.push(t), r.push(a), i.push(o);
|
|
344
|
+
}
|
|
345
|
+
let a = () => {
|
|
346
|
+
i.forEach((e) => e()), i.length = 0;
|
|
347
|
+
};
|
|
348
|
+
return n.length ? {
|
|
349
|
+
layer: {
|
|
350
|
+
name: `${e}:badges`,
|
|
351
|
+
children: [{
|
|
352
|
+
name: `${e}:badgeBgs`,
|
|
353
|
+
children: n
|
|
354
|
+
}, {
|
|
355
|
+
name: `${e}:badgeTexts`,
|
|
356
|
+
children: r
|
|
357
|
+
}]
|
|
358
|
+
},
|
|
359
|
+
cleanup: a
|
|
360
|
+
} : {
|
|
361
|
+
layer: null,
|
|
362
|
+
cleanup: a
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
//#endregion
|
|
366
|
+
//#region src/components/Map/drawing/config/config-markers.ts
|
|
367
|
+
var it = "_selected", at = "markers";
|
|
368
|
+
function ot(e, t, n) {
|
|
369
|
+
let { center: r, rotation: i, elevation: a } = e.bounds, { width: o, height: s } = t;
|
|
370
|
+
return e.bounds = P(r.x, r.y, o, s, n, i, a), [e];
|
|
371
|
+
}
|
|
372
|
+
function st(e) {
|
|
373
|
+
R = e;
|
|
374
|
+
}
|
|
375
|
+
function ct(e) {
|
|
376
|
+
let { scene: t } = e, n = [], r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = [], l = t.rootLayer.children.find((e) => e.name === at);
|
|
377
|
+
l.onScale = ({ pixelSize: e }) => st(e), re(lt), M(l);
|
|
378
|
+
async function d(e) {
|
|
379
|
+
let t = [];
|
|
380
|
+
e.forEach((e) => {
|
|
381
|
+
let { name: n, content: i, width: a, height: o, scale: s } = e;
|
|
382
|
+
if (r.has(n)) return;
|
|
383
|
+
let c = new Image(), l = new Promise((e, t) => {
|
|
384
|
+
c.onload = () => {
|
|
385
|
+
r.set(n, {
|
|
386
|
+
img: c,
|
|
387
|
+
width: a,
|
|
388
|
+
height: o,
|
|
389
|
+
scale: s
|
|
390
|
+
}), e();
|
|
391
|
+
}, c.onerror = (e) => {
|
|
392
|
+
t(e);
|
|
393
|
+
};
|
|
394
|
+
});
|
|
395
|
+
t.push(l), c.src = i, c.crossOrigin = "anonymous";
|
|
396
|
+
}), await Promise.all(t);
|
|
397
|
+
}
|
|
398
|
+
let f = (e, t) => {
|
|
399
|
+
e.onScale = ({ pixelSize: n }) => ot(e, t, n);
|
|
400
|
+
}, p = (e) => {
|
|
401
|
+
e.screenSpace || (e.onRoll = ({ roll: t }) => {
|
|
402
|
+
if (t !== e.bounds.rotation) return e.bounds.rotate(t - e.bounds.rotation, e.bounds), [e];
|
|
403
|
+
});
|
|
404
|
+
};
|
|
405
|
+
function m(e, t) {
|
|
406
|
+
let n = a.get(e);
|
|
407
|
+
if (n) return n;
|
|
408
|
+
let r = ve(t.img, t.width, t.height, window.devicePixelRatio, t.scale || 1);
|
|
409
|
+
return a.set(e, r), r;
|
|
410
|
+
}
|
|
411
|
+
function h() {
|
|
412
|
+
let e = c.routeStore.markersData.markers;
|
|
413
|
+
if (!e.length) return;
|
|
414
|
+
o = [];
|
|
415
|
+
let t = u.is3DView;
|
|
416
|
+
e.forEach((e) => {
|
|
417
|
+
var n, i;
|
|
418
|
+
let a = r.get(e.icon);
|
|
419
|
+
if (!a) return;
|
|
420
|
+
let c = r.get(e.selectedIcon);
|
|
421
|
+
if (!c) return;
|
|
422
|
+
let l = a.scale || 1, u = m(e.icon, a), d = m(e.selectedIcon, c), p = (n = (i = s.findLayer(e.z)) == null ? void 0 : i.visible) == null || n, h = de(a.img, a.width, a.height, l), g = de(c.img, c.width, c.height, l), _ = P(e.x, e.y, h.width, h.height, 1, 0), v = P(e.x, e.y, g.width, g.height, 1, 0), y;
|
|
423
|
+
switch (e.position) {
|
|
424
|
+
case "lefttop":
|
|
425
|
+
y = [0, 0];
|
|
426
|
+
break;
|
|
427
|
+
case "centertop":
|
|
428
|
+
y = [.5, 0];
|
|
429
|
+
break;
|
|
430
|
+
case "centerbottom":
|
|
431
|
+
y = [.5, 1];
|
|
432
|
+
break;
|
|
433
|
+
default: y = [.5, .5];
|
|
434
|
+
}
|
|
435
|
+
let b = {
|
|
436
|
+
...D(u, _, {
|
|
437
|
+
hidden: !p,
|
|
438
|
+
origin: y
|
|
439
|
+
}),
|
|
440
|
+
id: e.id,
|
|
441
|
+
scale: l,
|
|
442
|
+
screenSpace: t
|
|
443
|
+
}, x = {
|
|
444
|
+
...D(d, v, {
|
|
445
|
+
hidden: !(p && e.active),
|
|
446
|
+
origin: y
|
|
447
|
+
}),
|
|
448
|
+
id: `${e.id}${it}`,
|
|
449
|
+
scale: l,
|
|
450
|
+
screenSpace: t
|
|
451
|
+
};
|
|
452
|
+
f(b, h), f(x, g), o.push(b, x);
|
|
453
|
+
}), l.children = o, o.forEach(p);
|
|
454
|
+
}
|
|
455
|
+
function g() {
|
|
456
|
+
l.children = [], o = [];
|
|
457
|
+
}
|
|
458
|
+
function _() {
|
|
459
|
+
let e = c.routeStore.markersData.markers;
|
|
460
|
+
e.length && e.forEach((e) => {
|
|
461
|
+
var t, n;
|
|
462
|
+
let r = o.find((t) => t.id === e.id), i = o.find((t) => t.id === `${e.id}${it}`);
|
|
463
|
+
if (!r || !i) return;
|
|
464
|
+
let a = (t = (n = s.findLayer(e.z)) == null ? void 0 : n.visible) == null || t;
|
|
465
|
+
e.active ? (r.hidden = !0, i.hidden = !(a && e.active)) : (r.hidden = !a, i.hidden = !0);
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
return n.push(i(() => [c.routeStore.selectedMarkers, c.layerStore.visible], () => {
|
|
469
|
+
if (!c.routeStore.markersData.markers.length) {
|
|
470
|
+
g(), M(l);
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
_(), M(...o);
|
|
474
|
+
})), n.push(i(() => c.routeStore.markersData.markers, () => {
|
|
475
|
+
d(c.routeStore.markersData.icons).then(() => {
|
|
476
|
+
h(), M(l);
|
|
477
|
+
});
|
|
478
|
+
}, { fireImmediately: !0 })), function() {
|
|
479
|
+
n.forEach((e) => e()), n.length = 0, l.onScale = void 0, re(), R = 1, M(l);
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
function lt(e, t) {
|
|
483
|
+
return ut(e, t, R);
|
|
484
|
+
}
|
|
485
|
+
function ut(e, t, n) {
|
|
486
|
+
for (let r of c.routeStore.markersData.markers) {
|
|
487
|
+
let i = c.routeStore.markersData.icons.find((e) => e.name === r.icon);
|
|
488
|
+
if (!i) continue;
|
|
489
|
+
let a = i.width * (i.scale || 1) * n, o = i.height * (i.scale || 1) * n;
|
|
490
|
+
if (dt(e, t, r.x, r.y, a, o)) {
|
|
491
|
+
let e = c.layerStore.findLayer(r.z);
|
|
492
|
+
if (!e || e && e.visible) return r;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
return null;
|
|
496
|
+
}
|
|
497
|
+
function dt(e, t, n, r, i, a) {
|
|
498
|
+
return k.fromCenter({
|
|
499
|
+
x: n,
|
|
500
|
+
y: r
|
|
501
|
+
}, {
|
|
502
|
+
x: 2 * i,
|
|
503
|
+
y: 2 * a
|
|
504
|
+
}).containsPoint({
|
|
505
|
+
x: e,
|
|
506
|
+
y: t
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
var R = 1, ft = .5, pt = "cubic";
|
|
510
|
+
function mt(e, t) {
|
|
511
|
+
return !e || e.rootLayer.dim === t ? !1 : (e.rootLayer.dim = t, !0);
|
|
512
|
+
}
|
|
513
|
+
function ht(e, t = 300, n = pt) {
|
|
514
|
+
let r = null, i = 0, a = 0, o = 0, s = 0, c = Math.max(t, 0);
|
|
515
|
+
function l() {
|
|
516
|
+
r === null || typeof cancelAnimationFrame != "function" || (cancelAnimationFrame(r), r = null);
|
|
517
|
+
}
|
|
518
|
+
function u(t) {
|
|
519
|
+
l(), i = t, e(i);
|
|
520
|
+
}
|
|
521
|
+
function d(t) {
|
|
522
|
+
let l = t - s, u = Math.min(Math.max(l / c, 0), 1), f = gt(u, n);
|
|
523
|
+
if (i = a + (o - a) * f, e(i), u < 1) {
|
|
524
|
+
r = requestAnimationFrame(d);
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
r = null, i = o, e(i);
|
|
528
|
+
}
|
|
529
|
+
return {
|
|
530
|
+
getValue() {
|
|
531
|
+
return i;
|
|
532
|
+
},
|
|
533
|
+
setTarget(e, t = {}) {
|
|
534
|
+
let n = +!!e;
|
|
535
|
+
if (!(!t.immediate && n === o && r === null)) {
|
|
536
|
+
if (o = n, t.immediate || c === 0 || typeof requestAnimationFrame != "function") {
|
|
537
|
+
u(o);
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
l(), a = i, s = typeof performance > "u" ? Date.now() : performance.now(), r = requestAnimationFrame(d);
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
stop() {
|
|
544
|
+
l();
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
function gt(e, t) {
|
|
549
|
+
return t === "linear" ? e : _t(e);
|
|
550
|
+
}
|
|
551
|
+
function _t(e) {
|
|
552
|
+
return e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2;
|
|
553
|
+
}
|
|
554
|
+
//#endregion
|
|
555
|
+
//#region src/components/Map/drawing/config/config-pins.ts
|
|
556
|
+
function vt(e, t, n) {
|
|
557
|
+
let a = [], o = [], s = [], c = [];
|
|
558
|
+
function d() {
|
|
559
|
+
let e = u.selectedPoiTypeFilters;
|
|
560
|
+
if (!e.length) return [];
|
|
561
|
+
let t = new Set(e.map((e) => e.id));
|
|
562
|
+
return l.booths.filter((e) => e.visible && t.has(e.poiTypeId) && e.rect);
|
|
563
|
+
}
|
|
564
|
+
let f = (e) => {
|
|
565
|
+
o.push(e);
|
|
566
|
+
};
|
|
567
|
+
function p() {
|
|
568
|
+
o.forEach((e) => e.stop()), o = [];
|
|
569
|
+
}
|
|
570
|
+
function m() {
|
|
571
|
+
e.children = s.map((e) => Ct(e, f));
|
|
572
|
+
}
|
|
573
|
+
function h() {
|
|
574
|
+
c = Array.from({ length: Math.floor(s.length / 2) }, () => Tt(f)), t.children = c.map((e) => e.image), n.children = c.map((e) => e.count);
|
|
575
|
+
}
|
|
576
|
+
function g(e, t) {
|
|
577
|
+
let n = /* @__PURE__ */ new Set(), r = (e) => e == null ? void 0 : e.forEach((e) => n.add(e)), i = Dt(c, e, Nt * t.pixelSize);
|
|
578
|
+
i.forEach((t, n) => {
|
|
579
|
+
kt(t, e[n]) && r([t.image, t.count]), r(t.fader.place(!0));
|
|
580
|
+
});
|
|
581
|
+
let a = new Set(i);
|
|
582
|
+
for (let e of c) a.has(e) || r(e.fader.place(!1));
|
|
583
|
+
return n.size ? [...n] : void 0;
|
|
584
|
+
}
|
|
585
|
+
return e.clustering = {
|
|
586
|
+
onCluster: (e, t) => g(e, t),
|
|
587
|
+
marker: {
|
|
588
|
+
width: V,
|
|
589
|
+
height: H,
|
|
590
|
+
origin: B
|
|
591
|
+
}
|
|
592
|
+
}, a.push(i(() => d(), (r) => {
|
|
593
|
+
s = r, p(), m(), h(), M(e, t, n);
|
|
594
|
+
}, {
|
|
595
|
+
equals: r.shallow,
|
|
596
|
+
fireImmediately: !0
|
|
597
|
+
})), function() {
|
|
598
|
+
a.forEach((e) => e()), a.length = 0, p(), c = [], e.clustering = void 0, e.children = [], t.children = [], n.children = [], M(e, t, n);
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
function yt(e, t, n, r, i) {
|
|
602
|
+
let a, o = i, s = !1, c = !1, l = (r) => {
|
|
603
|
+
let i = 1 - Math.min(Math.max(r, 0), 1), a = !1;
|
|
604
|
+
if (n() !== i && (t(i), a = !0), !o && r >= 1 && e.some((e) => !e.hidden)) {
|
|
605
|
+
for (let t of e) t.hidden = !0;
|
|
606
|
+
a = !0;
|
|
607
|
+
}
|
|
608
|
+
a && (s ? c = !0 : M(...e));
|
|
609
|
+
}, u = () => {
|
|
610
|
+
if (!a && (a = ht(l, 300), r(a), !i)) {
|
|
611
|
+
let e = s;
|
|
612
|
+
s = !0, a.setTarget(!0, { immediate: !0 }), s = e;
|
|
613
|
+
}
|
|
614
|
+
return a;
|
|
615
|
+
};
|
|
616
|
+
return { place(t) {
|
|
617
|
+
if (t === o) return;
|
|
618
|
+
o = t;
|
|
619
|
+
let n = !1;
|
|
620
|
+
if (t && e.some((e) => e.hidden)) {
|
|
621
|
+
for (let t of e) t.hidden = !1;
|
|
622
|
+
n = !0;
|
|
623
|
+
}
|
|
624
|
+
return s = !0, c = !1, u().setTarget(!t), s = !1, n || c ? e : void 0;
|
|
625
|
+
} };
|
|
626
|
+
}
|
|
627
|
+
function bt(e, t, n, r) {
|
|
628
|
+
let { bounds: i } = e, a = t * r, o = t * n * r;
|
|
629
|
+
if (!(i.size.x === a && i.size.y === o)) return i.set(i.center.x, i.center.y, a, o, i.rotation, i.elevation), [e];
|
|
630
|
+
}
|
|
631
|
+
function xt() {
|
|
632
|
+
return U || (U = T(z, window.devicePixelRatio)), U;
|
|
633
|
+
}
|
|
634
|
+
function St() {
|
|
635
|
+
return W || (W = w(V, window.devicePixelRatio)), W;
|
|
636
|
+
}
|
|
637
|
+
function Ct(e, t) {
|
|
638
|
+
let n = new d(e.rect.center, {
|
|
639
|
+
x: z,
|
|
640
|
+
y: z * b
|
|
641
|
+
}, 0, e.elevation * 2), r = {
|
|
642
|
+
...D(xt(), n, {
|
|
643
|
+
hidden: !1,
|
|
644
|
+
origin: B
|
|
645
|
+
}),
|
|
646
|
+
screenSpace: !0,
|
|
647
|
+
opacity: 1
|
|
648
|
+
};
|
|
649
|
+
r.onScale = ({ pixelSize: e }) => bt(r, z, b, e);
|
|
650
|
+
let i = yt([r], (e) => {
|
|
651
|
+
r.opacity = e;
|
|
652
|
+
}, () => {
|
|
653
|
+
var e;
|
|
654
|
+
return (e = r.opacity) == null ? 1 : e;
|
|
655
|
+
}, t, !0);
|
|
656
|
+
return r.placement = { onPlace: (e) => i.place(e) }, r;
|
|
657
|
+
}
|
|
658
|
+
function wt(e) {
|
|
659
|
+
return `${Pt}${Math.round(Math.min(Math.max(e, 0), 1) * 255).toString(16).padStart(2, "0")}`;
|
|
660
|
+
}
|
|
661
|
+
function Tt(e) {
|
|
662
|
+
let t = new d({
|
|
663
|
+
x: 0,
|
|
664
|
+
y: 0
|
|
665
|
+
}, {
|
|
666
|
+
x: V,
|
|
667
|
+
y: H
|
|
668
|
+
}, 0, 0), n = {
|
|
669
|
+
...D(St(), t, {
|
|
670
|
+
hidden: !0,
|
|
671
|
+
origin: B
|
|
672
|
+
}),
|
|
673
|
+
screenSpace: !0,
|
|
674
|
+
opacity: 0
|
|
675
|
+
};
|
|
676
|
+
n.onScale = ({ pixelSize: e }) => bt(n, V, b, e);
|
|
677
|
+
let r = Et(n);
|
|
678
|
+
return {
|
|
679
|
+
image: n,
|
|
680
|
+
count: r,
|
|
681
|
+
fader: yt([n, r], (e) => {
|
|
682
|
+
n.opacity = e, r.lines[0].color = wt(e);
|
|
683
|
+
}, () => {
|
|
684
|
+
var e;
|
|
685
|
+
return (e = n.opacity) == null ? 1 : e;
|
|
686
|
+
}, e, !1)
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
function Et(e) {
|
|
690
|
+
let t = {
|
|
691
|
+
lines: [{
|
|
692
|
+
text: m(2),
|
|
693
|
+
color: wt(0),
|
|
694
|
+
fontUrl: O,
|
|
695
|
+
fontSize: 0
|
|
696
|
+
}],
|
|
697
|
+
bounds: new d({
|
|
698
|
+
x: e.bounds.center.x,
|
|
699
|
+
y: e.bounds.center.y
|
|
700
|
+
}, {
|
|
701
|
+
x: 0,
|
|
702
|
+
y: 0
|
|
703
|
+
}, 0, e.bounds.elevation),
|
|
704
|
+
padding: [0, 0],
|
|
705
|
+
alignment: {
|
|
706
|
+
horizontal: "center",
|
|
707
|
+
vertical: "top",
|
|
708
|
+
text: "center"
|
|
709
|
+
},
|
|
710
|
+
screenSpace: !0,
|
|
711
|
+
hidden: !0
|
|
712
|
+
};
|
|
713
|
+
return t.onScale = ({ pixelSize: n }) => {
|
|
714
|
+
let r = x(Ft.r) * n, i = V * n, a = 2 * ((H - Ft.cy) * n + y * r), { bounds: o } = t, [s] = t.lines;
|
|
715
|
+
if (!(s.fontSize === r && o.size.x === i && o.size.y === a)) return s.fontSize = r, o.set(e.bounds.center.x, e.bounds.center.y, i, a, o.rotation, e.bounds.elevation), [t];
|
|
716
|
+
}, t;
|
|
717
|
+
}
|
|
718
|
+
function Dt(e, t, n) {
|
|
719
|
+
let r = Math.min(t.length, e.length), i = [], a = /* @__PURE__ */ new Set(), o = [];
|
|
720
|
+
e.forEach(({ image: e }, i) => {
|
|
721
|
+
if (!e.hidden) for (let a = 0; a < r; a++) {
|
|
722
|
+
let { x: r, y: s } = t[a], c = Math.hypot(r - e.bounds.center.x, s - e.bounds.center.y);
|
|
723
|
+
c <= n && o.push({
|
|
724
|
+
distance: c,
|
|
725
|
+
cluster: a,
|
|
726
|
+
unit: i
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
}), o.sort((e, t) => e.distance - t.distance || e.cluster - t.cluster || e.unit - t.unit);
|
|
730
|
+
for (let { cluster: t, unit: n } of o) i[t] || a.has(e[n]) || (i[t] = e[n], a.add(e[n]));
|
|
731
|
+
let s = e.map((e, t) => ({
|
|
732
|
+
unit: e,
|
|
733
|
+
index: t
|
|
734
|
+
})).filter(({ unit: e }) => !a.has(e)).sort((e, t) => Ot(e.unit) - Ot(t.unit) || e.index - t.index), c = 0;
|
|
735
|
+
for (let e = 0; e < r; e++) i[e] || (i[e] = s[c++].unit);
|
|
736
|
+
return i;
|
|
737
|
+
}
|
|
738
|
+
function Ot({ image: e }) {
|
|
739
|
+
var t;
|
|
740
|
+
return e.hidden ? 0 : (t = e.opacity) == null ? 1 : t;
|
|
741
|
+
}
|
|
742
|
+
function kt({ image: e, count: t }, n) {
|
|
743
|
+
let { x: r, y: i, elevation: a, unitCount: o } = n, s = m(o), [c] = t.lines, l = e.bounds;
|
|
744
|
+
if (l.center.x === r && l.center.y === i && l.elevation === a && c.text === s) return !1;
|
|
745
|
+
l.set(r, i, l.size.x, l.size.y, l.rotation, a);
|
|
746
|
+
let { bounds: u } = t;
|
|
747
|
+
return u.set(r, i, u.size.x, u.size.y, u.rotation, a), c.text = s, !0;
|
|
748
|
+
}
|
|
749
|
+
var At = "poiFilterPins", jt = "poiFilterPinClusters", Mt = "poiFilterPinCounts", z = 32, B = [.5, 1], V = 44, Nt = V, Pt = "#000000", Ft = _(V), H = V * b, U, W;
|
|
750
|
+
//#endregion
|
|
751
|
+
//#region src/components/Map/drawing/config/config-all.ts
|
|
752
|
+
function It() {
|
|
753
|
+
let { defaultLayer: e } = c.layerStore, { layers: t } = c.layerStore;
|
|
754
|
+
if (e) {
|
|
755
|
+
let n = [...t], r = t.indexOf(e);
|
|
756
|
+
n.splice(r, 1), t = [e, ...n];
|
|
757
|
+
}
|
|
758
|
+
let n = t.filter((e) => !e.rootParent).map((e) => le(e));
|
|
759
|
+
return Promise.all(n).then((e) => {
|
|
760
|
+
var t;
|
|
761
|
+
let n = h(at, []);
|
|
762
|
+
n.overlay = u.is3DView;
|
|
763
|
+
let r = u.is3DView ? Lt() : void 0, i = Se({ overlay: u.is3DView }), a = [], o = [];
|
|
764
|
+
for (let t of e.flat()) p(t.name) ? (t.dim = 0, o.push(t)) : a.push(t);
|
|
765
|
+
let { layer: s, cleanup: c } = rt("root", l.booths);
|
|
766
|
+
return {
|
|
767
|
+
layers: [
|
|
768
|
+
...a,
|
|
769
|
+
...s ? [s] : [],
|
|
770
|
+
...o,
|
|
771
|
+
...je(),
|
|
772
|
+
n,
|
|
773
|
+
...(t = r == null ? void 0 : r.layers) == null ? [] : t,
|
|
774
|
+
i
|
|
775
|
+
],
|
|
776
|
+
cleanup: () => {
|
|
777
|
+
c(), r == null || r.cleanup();
|
|
778
|
+
}
|
|
779
|
+
};
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
function Lt() {
|
|
783
|
+
let e = [
|
|
784
|
+
At,
|
|
785
|
+
jt,
|
|
786
|
+
Mt
|
|
787
|
+
].map((e) => {
|
|
788
|
+
let t = h(e, []);
|
|
789
|
+
return t.overlay = !0, t.dim = 0, t;
|
|
790
|
+
}), [t, n, r] = e;
|
|
791
|
+
return {
|
|
792
|
+
layers: e,
|
|
793
|
+
cleanup: vt(t, n, r)
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
//#endregion
|
|
797
|
+
//#region src/components/Map/MapCursorCoords.tsx
|
|
798
|
+
var G = /* @__PURE__ */ e(n(), 1), Rt = 2;
|
|
799
|
+
function zt(e) {
|
|
800
|
+
let { canvas: t } = e, n = ne(), r = o(), i = (0, G.useCallback)(() => r("cursor", void 0), [r]), a = (0, G.useEffectEvent)((e) => {
|
|
801
|
+
if (!e.isPrimary) return;
|
|
802
|
+
let t = n.canvasToPlan({
|
|
803
|
+
x: e.offsetX,
|
|
804
|
+
y: e.offsetY
|
|
805
|
+
});
|
|
806
|
+
r("cursor", t ? Vt(t, Bt()) : void 0);
|
|
807
|
+
});
|
|
808
|
+
return (0, G.useEffect)(() => {
|
|
809
|
+
let e = t.current;
|
|
810
|
+
if (!e) return;
|
|
811
|
+
let n = (e) => a(e), r = () => i();
|
|
812
|
+
return e.addEventListener("pointermove", n), e.addEventListener("pointerleave", r), () => {
|
|
813
|
+
e.removeEventListener("pointermove", n), e.removeEventListener("pointerleave", r);
|
|
814
|
+
};
|
|
815
|
+
}, [t, i]), null;
|
|
816
|
+
}
|
|
817
|
+
function Bt() {
|
|
818
|
+
let e = c.layerStore.layers.find((e) => e.visible && (e.mode === ge.TurnedOn || e.mode === ge.TurnedOff));
|
|
819
|
+
return (e == null ? void 0 : e.name) || null;
|
|
820
|
+
}
|
|
821
|
+
function Vt(e, t) {
|
|
822
|
+
let n = `[${e.x.toFixed(Rt)}, ${e.y.toFixed(Rt)}]`;
|
|
823
|
+
return t ? `${n} · layer ${t}` : n;
|
|
824
|
+
}
|
|
825
|
+
//#endregion
|
|
826
|
+
//#region src/components/Map/MapViewport.tsx
|
|
827
|
+
function Ht() {
|
|
828
|
+
let e = ne(), t = (0, G.useRef)({ api: e }), [n] = (0, G.useState)(() => we(t));
|
|
829
|
+
return (0, G.useLayoutEffect)(() => {
|
|
830
|
+
t.current = { api: e };
|
|
831
|
+
}), (0, G.useEffect)(() => (Ce(n), () => Ce(void 0)), [n]), null;
|
|
832
|
+
}
|
|
833
|
+
//#endregion
|
|
834
|
+
//#region src/components/Map/traffic/UpdateQueue.ts
|
|
835
|
+
var Ut = class {
|
|
836
|
+
constructor() {
|
|
837
|
+
this.queue = [], this.isProcessing = !1, this.rafId = null, this.CHUNK_SIZE = 100, this.TIME_BUDGET = 4;
|
|
838
|
+
}
|
|
839
|
+
add(e) {
|
|
840
|
+
this.queue.push(e), this.scheduleProcessing();
|
|
841
|
+
}
|
|
842
|
+
scheduleProcessing() {
|
|
843
|
+
this.isProcessing || this.queue.length === 0 || (this.isProcessing = !0, this.queue.length <= this.CHUNK_SIZE * 2 ? Promise.resolve().then(() => this.processMicrotaskQueue()) : this.rafId = requestAnimationFrame((e) => {
|
|
844
|
+
this.processQueue(e);
|
|
845
|
+
}));
|
|
846
|
+
}
|
|
847
|
+
processMicrotaskQueue() {
|
|
848
|
+
let e = performance.now(), t = 0;
|
|
849
|
+
for (; this.queue.length > 0 && t < this.CHUNK_SIZE;) {
|
|
850
|
+
let n = this.queue.shift();
|
|
851
|
+
try {
|
|
852
|
+
n();
|
|
853
|
+
} catch (e) {
|
|
854
|
+
console.warn("UpdateQueue task error:", e);
|
|
855
|
+
}
|
|
856
|
+
if (t++, performance.now() - e > this.TIME_BUDGET) break;
|
|
857
|
+
}
|
|
858
|
+
this.queue.length > 0 ? Promise.resolve().then(() => this.processMicrotaskQueue()) : this.isProcessing = !1;
|
|
859
|
+
}
|
|
860
|
+
processQueue(e) {
|
|
861
|
+
this.rafId = null;
|
|
862
|
+
let t = 0;
|
|
863
|
+
for (; this.queue.length > 0 && t < this.CHUNK_SIZE;) {
|
|
864
|
+
let n = this.queue.shift();
|
|
865
|
+
try {
|
|
866
|
+
n();
|
|
867
|
+
} catch (e) {
|
|
868
|
+
console.warn("UpdateQueue task error:", e);
|
|
869
|
+
}
|
|
870
|
+
if (t++, performance.now() - e > this.TIME_BUDGET) break;
|
|
871
|
+
}
|
|
872
|
+
this.queue.length > 0 ? this.rafId = requestAnimationFrame((e) => this.processQueue(e)) : this.isProcessing = !1;
|
|
873
|
+
}
|
|
874
|
+
destroy() {
|
|
875
|
+
this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null), this.queue = [], this.isProcessing = !1;
|
|
876
|
+
}
|
|
877
|
+
}, K = 49, Wt = `hsl(257, 76%, ${K}%)`, Gt = `hsl(339.903, 82%, ${K}%)`, Kt = `hsl(257, 76%, ${Math.round(K * 1.82)}%)`, q = 4, J = _e(q), qt = q, Jt = "U", Yt = "R", Xt = "S", Zt = "P", Qt = class {
|
|
878
|
+
constructor() {
|
|
879
|
+
this._state = [[]], this.index = 0, this.pointHashSet = /* @__PURE__ */ new Set(), this.locked = !1, this.storageKey = "expofp_build_route_state", this._selected = 0;
|
|
880
|
+
}
|
|
881
|
+
get points() {
|
|
882
|
+
return this._state[this.index];
|
|
883
|
+
}
|
|
884
|
+
set points(e) {
|
|
885
|
+
this._state.push(e), this.setIndex(), this.save();
|
|
886
|
+
}
|
|
887
|
+
setIndex() {
|
|
888
|
+
this.index = Math.max(this._state.length - 1, 0);
|
|
889
|
+
}
|
|
890
|
+
genPointHash(e) {
|
|
891
|
+
return `${e.x},${e.y}`;
|
|
892
|
+
}
|
|
893
|
+
add(e) {
|
|
894
|
+
let t = this.genPointHash(e);
|
|
895
|
+
this.pointHashSet.has(t) || (this.pointHashSet.add(t), this.points = [...this.points, e]);
|
|
896
|
+
}
|
|
897
|
+
undo() {
|
|
898
|
+
this.index && (this._state.pop(), this.setIndex(), this.save(), this.select(this.points.length - 1));
|
|
899
|
+
}
|
|
900
|
+
execute(e) {
|
|
901
|
+
try {
|
|
902
|
+
if (this.locked) return;
|
|
903
|
+
this.locked = !0, e();
|
|
904
|
+
} finally {
|
|
905
|
+
requestAnimationFrame(() => {
|
|
906
|
+
this.locked = !1;
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
log(e, t = 12) {
|
|
911
|
+
console.log(`%c${e}`, `color: black; font-size: ${t}px; background: LemonChiffon;`);
|
|
912
|
+
}
|
|
913
|
+
instruct() {
|
|
914
|
+
this.log(`How to Build a Route:
|
|
915
|
+
Add Point: Click on the map.
|
|
916
|
+
Apply Smoothing: Press ${Yt}.
|
|
917
|
+
Apply Simplification: Press ${Xt}.
|
|
918
|
+
Undo: Press ${Jt}.
|
|
919
|
+
Enable/Disable Preview: Press ${Zt}.
|
|
920
|
+
`, 16);
|
|
921
|
+
}
|
|
922
|
+
applyChaikinSmoothing(e, t, n) {
|
|
923
|
+
let r;
|
|
924
|
+
if (n >= 1 && e.length >= 2) {
|
|
925
|
+
r = [e[0]];
|
|
926
|
+
for (let t = 1; t < e.length; t++) {
|
|
927
|
+
let i = e[t - 1], a = e[t];
|
|
928
|
+
for (let e = 1; e <= n; e++) {
|
|
929
|
+
let t = e / (n + 1);
|
|
930
|
+
r.push({
|
|
931
|
+
x: i.x + (a.x - i.x) * t,
|
|
932
|
+
y: i.y + (a.y - i.y) * t
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
r.push(a);
|
|
936
|
+
}
|
|
937
|
+
} else r = e.slice();
|
|
938
|
+
for (let e = 0; e < t && !(r.length < 2); e++) {
|
|
939
|
+
let e = [{ ...r[0] }];
|
|
940
|
+
for (let t = 1; t < r.length; t++) {
|
|
941
|
+
let n = r[t - 1], i = r[t];
|
|
942
|
+
e.push({
|
|
943
|
+
x: .75 * n.x + .25 * i.x,
|
|
944
|
+
y: .75 * n.y + .25 * i.y
|
|
945
|
+
}), e.push({
|
|
946
|
+
x: .25 * n.x + .75 * i.x,
|
|
947
|
+
y: .25 * n.y + .75 * i.y
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
e.push({ ...r[r.length - 1] }), r = e;
|
|
951
|
+
}
|
|
952
|
+
return r;
|
|
953
|
+
}
|
|
954
|
+
applySmoothing() {
|
|
955
|
+
this.points.length < 3 || (this.points = this.applyChaikinSmoothing(this.points, 1, 0), this.select(this.points.length - 1));
|
|
956
|
+
}
|
|
957
|
+
save() {
|
|
958
|
+
try {
|
|
959
|
+
this.points.length ? sessionStorage.setItem(this.storageKey, JSON.stringify(this.points)) : sessionStorage.removeItem(this.storageKey);
|
|
960
|
+
} catch (e) {
|
|
961
|
+
console.warn(e);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
restore() {
|
|
965
|
+
try {
|
|
966
|
+
let e = sessionStorage.getItem(this.storageKey);
|
|
967
|
+
if (!e) return;
|
|
968
|
+
let t = JSON.parse(e);
|
|
969
|
+
if (!Array.isArray(t)) return;
|
|
970
|
+
t.forEach((e) => this.add(e)), this.select(this.points.length - 1);
|
|
971
|
+
} catch (e) {
|
|
972
|
+
console.warn(e);
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
topologyPreservingSimplify(e, t) {
|
|
976
|
+
if (e.length <= 2) return e.map((e) => ({ ...e }));
|
|
977
|
+
let n = (e, t, n) => {
|
|
978
|
+
let r = e.x, i = e.y, a = t.x, o = t.y, s = n.x, c = n.y;
|
|
979
|
+
return Math.abs((c - o) * r - (s - a) * i + s * o - c * a) / (Math.sqrt((c - o) ** 2 + (s - a) ** 2) || 1e-10);
|
|
980
|
+
}, r = (e, t, n, r) => {
|
|
981
|
+
let i = S({
|
|
982
|
+
p0: e,
|
|
983
|
+
p1: t
|
|
984
|
+
}, {
|
|
985
|
+
p0: n,
|
|
986
|
+
p1: r
|
|
987
|
+
});
|
|
988
|
+
return i !== null && i.onLine1 && i.onLine2;
|
|
989
|
+
}, i = Array(e.length).fill(!1);
|
|
990
|
+
i[0] = i[i.length - 1] = !0;
|
|
991
|
+
let a = [], o = (s, c) => {
|
|
992
|
+
if (c <= s + 1) return;
|
|
993
|
+
let l = e[s], u = e[c], d = 0, f = 0;
|
|
994
|
+
for (let t = s + 1; t < c; t++) {
|
|
995
|
+
let r = n(e[t], l, u);
|
|
996
|
+
r > d && (d = r, f = t);
|
|
997
|
+
}
|
|
998
|
+
if (d > t) {
|
|
999
|
+
let t = e[f], n = !0;
|
|
1000
|
+
for (let e = 0; e < a.length - 1; e++) if (r(a[e], a[e + 1], l, t) || r(a[e], a[e + 1], t, u)) {
|
|
1001
|
+
n = !1;
|
|
1002
|
+
break;
|
|
1003
|
+
}
|
|
1004
|
+
n && (i[f] = !0, o(s, f), o(f, c));
|
|
1005
|
+
}
|
|
1006
|
+
};
|
|
1007
|
+
return o(0, e.length - 1), e.filter((e, t) => i[t]);
|
|
1008
|
+
}
|
|
1009
|
+
applySimplification() {
|
|
1010
|
+
this.points = this.topologyPreservingSimplify(this.points, .5), this.select(this.points.length - 1);
|
|
1011
|
+
}
|
|
1012
|
+
get selected() {
|
|
1013
|
+
return this._selected;
|
|
1014
|
+
}
|
|
1015
|
+
select(e) {
|
|
1016
|
+
this._selected = Math.max(0, Math.min(e, this.points.length - 1));
|
|
1017
|
+
}
|
|
1018
|
+
};
|
|
1019
|
+
function $t({ enabled: e, scene: t }) {
|
|
1020
|
+
let n = (0, G.useRef)(!1), r = (0, G.useRef)(1), i = (0, G.useMemo)(() => be(q, Wt), []), a = (0, G.useMemo)(() => be(q, Gt), []), o = (0, G.useMemo)(() => new Qt(), []), s = (0, G.useRef)(new Ut()), c = (0, G.useMemo)(() => {
|
|
1021
|
+
if (!t) return {};
|
|
1022
|
+
let e = t.rootLayer.children;
|
|
1023
|
+
return {
|
|
1024
|
+
linesLayer: e.find((e) => e.name === Oe),
|
|
1025
|
+
pointsLayer: e.find((e) => e.name === ke)
|
|
1026
|
+
};
|
|
1027
|
+
}, [t]), l = (0, G.useCallback)(() => {
|
|
1028
|
+
if (!c || !i || !a) return;
|
|
1029
|
+
let { linesLayer: e, pointsLayer: t } = c;
|
|
1030
|
+
if (!e || !t) return;
|
|
1031
|
+
let l = o.points, u = n.current;
|
|
1032
|
+
u ? t.children.length = 0 : t.children = l.map(({ x: e, y: t }, n) => ({
|
|
1033
|
+
source: n == o.selected ? a : i,
|
|
1034
|
+
bounds: P(e, t, J, J, r.current)
|
|
1035
|
+
}));
|
|
1036
|
+
let d = [];
|
|
1037
|
+
for (let e = 1; e < l.length; e++) {
|
|
1038
|
+
let t = l[e - 1], n = l[e];
|
|
1039
|
+
d.push({
|
|
1040
|
+
points: {
|
|
1041
|
+
p0: t,
|
|
1042
|
+
p1: n
|
|
1043
|
+
},
|
|
1044
|
+
color: u ? Wt : Kt,
|
|
1045
|
+
width: qt
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1048
|
+
d.length ? e.children = d : e.children.length = 0, s.current.add(() => M(t, e)), o.instruct(), o.log(JSON.stringify(o.points));
|
|
1049
|
+
}, [
|
|
1050
|
+
o,
|
|
1051
|
+
c,
|
|
1052
|
+
i,
|
|
1053
|
+
a
|
|
1054
|
+
]), u = (0, G.useCallback)((e) => {
|
|
1055
|
+
let t = e.key.toUpperCase();
|
|
1056
|
+
o.execute(() => {
|
|
1057
|
+
switch (t) {
|
|
1058
|
+
case Jt:
|
|
1059
|
+
e.preventDefault(), o.undo(), n.current = !1, l();
|
|
1060
|
+
break;
|
|
1061
|
+
case Yt:
|
|
1062
|
+
e.preventDefault(), o.applySmoothing(), n.current = !1, l();
|
|
1063
|
+
break;
|
|
1064
|
+
case Xt:
|
|
1065
|
+
e.preventDefault(), o.applySimplification(), n.current = !1, l();
|
|
1066
|
+
break;
|
|
1067
|
+
case Zt:
|
|
1068
|
+
e.preventDefault(), n.current = !n.current, l();
|
|
1069
|
+
break;
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
}, [o, l]), d = (0, G.useCallback)((e) => {
|
|
1073
|
+
r.current = e;
|
|
1074
|
+
let { pointsLayer: t } = c;
|
|
1075
|
+
if (!t) return [];
|
|
1076
|
+
let n = [];
|
|
1077
|
+
return o.execute(() => {
|
|
1078
|
+
let e = t.children;
|
|
1079
|
+
for (let t of e) t.bounds = P(t.bounds.center.x, t.bounds.center.y, J, J, r.current), n.push(t);
|
|
1080
|
+
}), n;
|
|
1081
|
+
}, [c, o]), f = (0, G.useCallback)((e) => {
|
|
1082
|
+
o.execute(() => {
|
|
1083
|
+
o.add({
|
|
1084
|
+
x: e.x,
|
|
1085
|
+
y: e.y
|
|
1086
|
+
}), o.select(o.points.length - 1), l();
|
|
1087
|
+
});
|
|
1088
|
+
}, [o, l]);
|
|
1089
|
+
(0, G.useEffect)(() => {
|
|
1090
|
+
var t, n;
|
|
1091
|
+
if (!e || !(c != null && c.pointsLayer)) return;
|
|
1092
|
+
let { pointsLayer: i } = c;
|
|
1093
|
+
r.current = (t = (n = me()) == null ? void 0 : n.state().pixelSize) == null ? 1 : t, o.execute(() => {
|
|
1094
|
+
o.restore(), l();
|
|
1095
|
+
}), i.onScale = ({ pixelSize: e }) => d(e);
|
|
1096
|
+
let a = s.current;
|
|
1097
|
+
return a.add(() => M(i)), ye(f), window.addEventListener("keyup", u), () => {
|
|
1098
|
+
window.removeEventListener("keyup", u), ye(), i.onScale = void 0, a.destroy();
|
|
1099
|
+
};
|
|
1100
|
+
}, [
|
|
1101
|
+
e,
|
|
1102
|
+
c,
|
|
1103
|
+
o,
|
|
1104
|
+
l,
|
|
1105
|
+
f,
|
|
1106
|
+
d,
|
|
1107
|
+
u
|
|
1108
|
+
]);
|
|
1109
|
+
}
|
|
1110
|
+
//#endregion
|
|
1111
|
+
//#region src/components/Map/traffic/useManageTraffic.ts
|
|
1112
|
+
var en = 2, tn = en * 3.5, Y = en * 12, X = Y * .7, nn = 8, rn = 2, an = .6, on = 8, sn = "transport_locations", cn = 150, ln = "#a4aab6", un = 1e3, dn = 2e4, fn = 500;
|
|
1113
|
+
function pn({ permission: e, scene: n, dataJsonUrl: r, websocketUrl: i }) {
|
|
1114
|
+
let o = (0, G.useRef)(1), s = (0, G.useRef)(/* @__PURE__ */ new Map()), c = (0, G.useRef)(/* @__PURE__ */ new Map()), l = (0, G.useRef)(null), u = (0, G.useRef)(null), d = (0, G.useRef)(0), f = (0, G.useRef)(1), p = (0, G.useRef)(new Ut()), m = (0, G.useRef)(/* @__PURE__ */ new Map()), h = (0, G.useRef)(un), g = (0, G.useRef)(/* @__PURE__ */ new Map()), _ = (0, G.useRef)(void 0);
|
|
1115
|
+
(0, G.useEffect)(() => {
|
|
1116
|
+
if (!e || !n) return;
|
|
1117
|
+
let v = !1, y, b = n.rootLayer.children, x = c.current, S = s.current, C = p.current;
|
|
1118
|
+
async function w() {
|
|
1119
|
+
try {
|
|
1120
|
+
var e, n;
|
|
1121
|
+
let i;
|
|
1122
|
+
try {
|
|
1123
|
+
let e = await fetch(r, {
|
|
1124
|
+
method: "GET",
|
|
1125
|
+
headers: { "Content-Type": "application/json" }
|
|
1126
|
+
});
|
|
1127
|
+
if (!e.ok || e.status === 204) return;
|
|
1128
|
+
i = await e.json();
|
|
1129
|
+
} catch (e) {
|
|
1130
|
+
console.warn("useManageTraffic failed to get JSON", e);
|
|
1131
|
+
}
|
|
1132
|
+
if (v || !i || i.disabled || i.error) return;
|
|
1133
|
+
o.current = gn((e = (n = me()) == null ? void 0 : n.state().pixelSize) == null ? 1 : e);
|
|
1134
|
+
let c = new Map(i.routes.map(({ id: e, color: t }) => [e, t])), l = /* @__PURE__ */ new Map();
|
|
1135
|
+
c.forEach((e) => {
|
|
1136
|
+
l.set(e, vn({
|
|
1137
|
+
radius: tn,
|
|
1138
|
+
color: e,
|
|
1139
|
+
scale: window.devicePixelRatio
|
|
1140
|
+
}));
|
|
1141
|
+
});
|
|
1142
|
+
let p = Pe(), h = b.filter((e) => p.test(e.name)), _ = Fe(), y = b.filter((e) => _.test(e.name));
|
|
1143
|
+
i.routes.slice(0, h.length).forEach(({ id: e, color: t, path: n, stops: r, hiddenPoints: i }, a) => {
|
|
1144
|
+
m.current.set(e, n);
|
|
1145
|
+
let s = h[a];
|
|
1146
|
+
if (s) {
|
|
1147
|
+
var c;
|
|
1148
|
+
let e = new Map((c = i == null ? void 0 : i.map((e) => [Dn(e), e])) == null ? [] : c);
|
|
1149
|
+
for (let r = 1; r < n.length; r++) {
|
|
1150
|
+
let i = n[r - 1], a = n[r];
|
|
1151
|
+
e.has(Dn(i)) || e.has(Dn(a)) || s.children.push({
|
|
1152
|
+
points: {
|
|
1153
|
+
p0: i,
|
|
1154
|
+
p1: a
|
|
1155
|
+
},
|
|
1156
|
+
color: t,
|
|
1157
|
+
width: en
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
s.children.length && C.add(() => M(s));
|
|
1161
|
+
}
|
|
1162
|
+
let u = y[a], d = l.get(t);
|
|
1163
|
+
u && d && r != null && r.length && (r.forEach((e) => {
|
|
1164
|
+
u.children.push({
|
|
1165
|
+
source: d,
|
|
1166
|
+
bounds: P(e.x, e.y, ...Z(d), o.current)
|
|
1167
|
+
});
|
|
1168
|
+
}), u.children.length && C.add(() => M(u)));
|
|
1169
|
+
});
|
|
1170
|
+
let w = b.find((e) => e.name === F);
|
|
1171
|
+
if (!w) {
|
|
1172
|
+
console.warn(`useManageTraffic: the scene has no "${F}" layer`);
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
let O = /* @__PURE__ */ new Map();
|
|
1176
|
+
w.onScale = ({ pixelSize: e }) => {
|
|
1177
|
+
o.current = gn(e);
|
|
1178
|
+
let t = [];
|
|
1179
|
+
for (let e of y) {
|
|
1180
|
+
let n = e.children;
|
|
1181
|
+
for (let e of n) {
|
|
1182
|
+
let n = e.source;
|
|
1183
|
+
e.bounds = P(e.bounds.center.x, e.bounds.center.y, ...Z(n), o.current, e.bounds.rotation), t.push(e);
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
for (let e of s.current.values()) {
|
|
1187
|
+
let n = e.source;
|
|
1188
|
+
e.bounds = P(e.bounds.center.x, e.bounds.center.y, ...Z(n), o.current, e.bounds.rotation), t.push(e);
|
|
1189
|
+
}
|
|
1190
|
+
return t;
|
|
1191
|
+
}, C.add(() => M(w)), c.forEach((e, t) => {
|
|
1192
|
+
O.set(t, yn({
|
|
1193
|
+
id: t,
|
|
1194
|
+
width: Y,
|
|
1195
|
+
height: Y,
|
|
1196
|
+
color: e,
|
|
1197
|
+
scale: window.devicePixelRatio
|
|
1198
|
+
}));
|
|
1199
|
+
});
|
|
1200
|
+
let k = yn({
|
|
1201
|
+
id: "orphan",
|
|
1202
|
+
width: Y,
|
|
1203
|
+
height: Y,
|
|
1204
|
+
color: ln,
|
|
1205
|
+
scale: window.devicePixelRatio
|
|
1206
|
+
}), A = null;
|
|
1207
|
+
try {
|
|
1208
|
+
let e = await a(`${t}icons/bus-white.svg`);
|
|
1209
|
+
if (v) return;
|
|
1210
|
+
A = ve(e, X, X, window.devicePixelRatio);
|
|
1211
|
+
let { width: n, height: r } = de(e, X, X);
|
|
1212
|
+
$.set(A, [n, r]);
|
|
1213
|
+
} catch (e) {
|
|
1214
|
+
console.error(e);
|
|
1215
|
+
}
|
|
1216
|
+
u.current = (e) => {
|
|
1217
|
+
try {
|
|
1218
|
+
var t;
|
|
1219
|
+
let n = JSON.parse(e.data);
|
|
1220
|
+
if (n.type !== sn) return;
|
|
1221
|
+
let r = e.timeStamp || performance.now();
|
|
1222
|
+
f.current = Math.round(r - d.current), d.current = r;
|
|
1223
|
+
let i = Math.max((t = f.current) == null ? fn : t, fn), a = w.children, s = !1;
|
|
1224
|
+
n.data.forEach(({ id: e, x: t, y: n, route_id: r, hidden: c }) => {
|
|
1225
|
+
var l;
|
|
1226
|
+
if (x.has(e)) {
|
|
1227
|
+
var u;
|
|
1228
|
+
(u = x.get(e)) == null || u(), x.delete(e);
|
|
1229
|
+
}
|
|
1230
|
+
let d = S.get(e), f = (l = S.get(xn(e))) == null ? null : l;
|
|
1231
|
+
if (c && d && f) {
|
|
1232
|
+
d.hidden = !0, f.hidden = !0, C.add(() => M(d, f));
|
|
1233
|
+
return;
|
|
1234
|
+
}
|
|
1235
|
+
if (g.current.set(e, performance.now()), !d) {
|
|
1236
|
+
var p;
|
|
1237
|
+
let i = (p = O.get(r)) == null ? k : p, c = {
|
|
1238
|
+
source: i,
|
|
1239
|
+
bounds: P(t, n, ...Z(i), o.current, 0)
|
|
1240
|
+
};
|
|
1241
|
+
if (S.set(e, c), A) {
|
|
1242
|
+
let r = xn(e), i = {
|
|
1243
|
+
source: A,
|
|
1244
|
+
bounds: P(t, n, ...Z(A), o.current, 0)
|
|
1245
|
+
};
|
|
1246
|
+
A.setAttribute("id", r), S.set(r, i), a.push(c, i);
|
|
1247
|
+
} else a.push(c);
|
|
1248
|
+
s = !0;
|
|
1249
|
+
return;
|
|
1250
|
+
}
|
|
1251
|
+
let h = d.bounds.center, _ = Tn(h, {
|
|
1252
|
+
x: t,
|
|
1253
|
+
y: n
|
|
1254
|
+
}, m.current.get(r));
|
|
1255
|
+
if (_.reduce((e, t, n) => n === 0 ? e : e + bn(_[n - 1], t), 0) >= cn || document.hidden) Sn({
|
|
1256
|
+
updateQueue: C,
|
|
1257
|
+
vehicle: d,
|
|
1258
|
+
vehicleFinery: f,
|
|
1259
|
+
x: t,
|
|
1260
|
+
y: n,
|
|
1261
|
+
scale: o.current,
|
|
1262
|
+
angle: _n(d.bounds.center, {
|
|
1263
|
+
x: t,
|
|
1264
|
+
y: n
|
|
1265
|
+
})
|
|
1266
|
+
});
|
|
1267
|
+
else {
|
|
1268
|
+
let t = En(_, i, (e) => {
|
|
1269
|
+
Sn({
|
|
1270
|
+
updateQueue: C,
|
|
1271
|
+
vehicle: d,
|
|
1272
|
+
vehicleFinery: f,
|
|
1273
|
+
x: e.x,
|
|
1274
|
+
y: e.y,
|
|
1275
|
+
scale: o.current,
|
|
1276
|
+
angle: e.angle
|
|
1277
|
+
});
|
|
1278
|
+
});
|
|
1279
|
+
x.set(e, t);
|
|
1280
|
+
}
|
|
1281
|
+
}), s && C.add(() => M(w));
|
|
1282
|
+
} catch (e) {
|
|
1283
|
+
console.error("handleSocketMessage", e);
|
|
1284
|
+
}
|
|
1285
|
+
}, d.current = performance.now(), T(), window.addEventListener("online", E), D(i.config ? (Number(i.config.vehicle_inactive_interval) || 20) * 1e3 : dn);
|
|
1286
|
+
} catch (e) {
|
|
1287
|
+
console.warn(e);
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
w();
|
|
1291
|
+
function T() {
|
|
1292
|
+
var e, t;
|
|
1293
|
+
v || ((e = l.current) == null ? void 0 : e.readyState) === WebSocket.OPEN || ((t = l.current) == null ? void 0 : t.readyState) === WebSocket.CONNECTING || (l.current = new WebSocket(i), l.current.onmessage = u.current, l.current.onopen = () => {
|
|
1294
|
+
h.current = un;
|
|
1295
|
+
}, l.current.onclose = () => {
|
|
1296
|
+
v || !navigator.onLine || (y = window.setTimeout(T, h.current), h.current = Math.min(h.current * 2, 3e4));
|
|
1297
|
+
});
|
|
1298
|
+
}
|
|
1299
|
+
function E() {
|
|
1300
|
+
T();
|
|
1301
|
+
}
|
|
1302
|
+
function D(e) {
|
|
1303
|
+
clearInterval(_.current), !v && (_.current = window.setInterval(() => {
|
|
1304
|
+
let t = performance.now(), n = [], r = [];
|
|
1305
|
+
g.current.forEach((i, a) => {
|
|
1306
|
+
if (t - i < e) return;
|
|
1307
|
+
let o = S.get(a);
|
|
1308
|
+
o && (o.hidden = !0, r.push(o), n.push(a));
|
|
1309
|
+
let s = xn(a), c = S.get(s);
|
|
1310
|
+
c && (c.hidden = !0, r.push(c), n.push(s));
|
|
1311
|
+
}), r.length && C.add(() => M(...r)), n.forEach((e) => g.current.delete(e));
|
|
1312
|
+
}, e));
|
|
1313
|
+
}
|
|
1314
|
+
return () => {
|
|
1315
|
+
v = !0, clearTimeout(y);
|
|
1316
|
+
let e = l.current;
|
|
1317
|
+
e && (e.onopen = null, e.onmessage = null, e.onclose = null, e.close(), l.current = null), u.current = null;
|
|
1318
|
+
let t = b.find((e) => e.name === F);
|
|
1319
|
+
t && (t.onScale = void 0), x.forEach((e) => e == null ? void 0 : e()), x.clear(), S.clear(), C.destroy(), window.removeEventListener("online", E), clearInterval(_.current);
|
|
1320
|
+
};
|
|
1321
|
+
}, [
|
|
1322
|
+
e,
|
|
1323
|
+
n,
|
|
1324
|
+
r,
|
|
1325
|
+
i
|
|
1326
|
+
]);
|
|
1327
|
+
}
|
|
1328
|
+
function Z(e) {
|
|
1329
|
+
let t = $.get(e);
|
|
1330
|
+
if (!t) throw Error("useManageTraffic: an icon was drawn without a recorded CSS size");
|
|
1331
|
+
return t;
|
|
1332
|
+
}
|
|
1333
|
+
function mn(e) {
|
|
1334
|
+
return e * 2;
|
|
1335
|
+
}
|
|
1336
|
+
function hn(e, t) {
|
|
1337
|
+
let n = t * an, r = on * 2;
|
|
1338
|
+
return [t + rn + n / 2 + r, e + n + rn + r];
|
|
1339
|
+
}
|
|
1340
|
+
function gn(e) {
|
|
1341
|
+
return Math.min(e || 1, nn);
|
|
1342
|
+
}
|
|
1343
|
+
function _n(e, t) {
|
|
1344
|
+
return xe(e, t);
|
|
1345
|
+
}
|
|
1346
|
+
function vn({ radius: e, scale: t, color: n }) {
|
|
1347
|
+
let r = Math.ceil(e * 2 * t), i = ie(r, r, t);
|
|
1348
|
+
$.set(i, [mn(e), mn(e)]);
|
|
1349
|
+
let a = i.getContext("2d");
|
|
1350
|
+
a.imageSmoothingEnabled = !1;
|
|
1351
|
+
let o = r / 2, s = e * .78, c = e * .33;
|
|
1352
|
+
return a.translate(o, o), a.scale(t, t), a.beginPath(), a.arc(0, 0, e, 0, 2 * Math.PI), a.fillStyle = "#FFFFFF", a.fill(), a.beginPath(), a.arc(0, 0, s, 0, 2 * Math.PI), a.fillStyle = n, a.fill(), a.beginPath(), a.arc(0, 0, c, 0, 2 * Math.PI), a.fillStyle = "#FFFFFF", a.fill(), i;
|
|
1353
|
+
}
|
|
1354
|
+
function yn({ id: e, width: t, height: n, color: r, scale: i }) {
|
|
1355
|
+
let a = rn * i, o = t / 2 * i, s = n * i, c = an, l = .01, u = s * c, d = s, f = on * i, p = d + a + u / 2 + f * 2, m = o * 2 + u + a + f * 2, h = ie(p, m, i);
|
|
1356
|
+
$.set(h, hn(t, n)), h.setAttribute("id", e);
|
|
1357
|
+
let g = h.getContext("2d"), _ = p / 2, v = m / 2;
|
|
1358
|
+
g.save(), g.translate(_, v), g.rotate(-Math.PI / 2), g.translate(-_, -v);
|
|
1359
|
+
let y = _, b = v - d / 2 + o, x = b + u;
|
|
1360
|
+
return g.shadowColor = "rgba(16, 24, 40, 0.2)", g.shadowBlur = f / 2, g.beginPath(), g.arc(y, b, o, Math.PI, 0, !1), g.bezierCurveTo(y + o, b + s * .3, y + l * o, x, y, x), g.bezierCurveTo(y - l * o, x, y - o, b + s * .3, y - o, b), g.closePath(), g.fillStyle = r, g.fill(), g.strokeStyle = "#FFFFFF", g.lineWidth = a, g.stroke(), g.restore(), h;
|
|
1361
|
+
}
|
|
1362
|
+
function bn(e, t) {
|
|
1363
|
+
return fe(e, t);
|
|
1364
|
+
}
|
|
1365
|
+
function xn(e) {
|
|
1366
|
+
return `${e}_finery`;
|
|
1367
|
+
}
|
|
1368
|
+
function Sn({ updateQueue: e, vehicle: t, vehicleFinery: n, x: r, y: i, scale: a, angle: o }) {
|
|
1369
|
+
let s = t.source;
|
|
1370
|
+
if (t.bounds = P(r, i, ...Z(s), a, o), t.hidden = !1, n) {
|
|
1371
|
+
var c, l;
|
|
1372
|
+
let o = (c = (l = me()) == null ? void 0 : l.state().roll) == null ? 0 : c, s = n.source;
|
|
1373
|
+
n.bounds = P(r, i, ...Z(s), a, te(o)), n.hidden = !1, e.add(() => M(n, t));
|
|
1374
|
+
} else e.add(() => M(t));
|
|
1375
|
+
}
|
|
1376
|
+
function Q(e, t, n) {
|
|
1377
|
+
return {
|
|
1378
|
+
x: e.x + (t.x - e.x) * n,
|
|
1379
|
+
y: e.y + (t.y - e.y) * n
|
|
1380
|
+
};
|
|
1381
|
+
}
|
|
1382
|
+
function Cn(e, t) {
|
|
1383
|
+
let n = Infinity, r = {
|
|
1384
|
+
index: 0,
|
|
1385
|
+
t: 0
|
|
1386
|
+
};
|
|
1387
|
+
for (let i = 0; i < t.length - 1; i++) {
|
|
1388
|
+
let a = t[i], o = t[i + 1], s = o.x - a.x, c = o.y - a.y, l = s * s + c * c, u = l ? ((e.x - a.x) * s + (e.y - a.y) * c) / l : 0, d = Math.max(0, Math.min(1, u)), f = bn(e, Q(a, o, d));
|
|
1389
|
+
f < n && (n = f, r = {
|
|
1390
|
+
index: i,
|
|
1391
|
+
t: d
|
|
1392
|
+
});
|
|
1393
|
+
}
|
|
1394
|
+
return r;
|
|
1395
|
+
}
|
|
1396
|
+
function wn(e, t, n) {
|
|
1397
|
+
let r = bn(e, t), i = Math.max(2, Math.ceil(r / n) + 1), a = [];
|
|
1398
|
+
for (let n = 0; n < i; n++) {
|
|
1399
|
+
let r = Q(e, t, n / (i - 1));
|
|
1400
|
+
a.push(r);
|
|
1401
|
+
}
|
|
1402
|
+
return a;
|
|
1403
|
+
}
|
|
1404
|
+
function Tn(e, t, n) {
|
|
1405
|
+
if (!n || !n.length) return wn(e, t, 10);
|
|
1406
|
+
let r = Cn(e, n), i = Cn(t, n), a = [], o = (e) => a.push(e);
|
|
1407
|
+
r.index + 1 < n.length ? o(Q(n[r.index], n[r.index + 1], r.t)) : o(n[r.index]);
|
|
1408
|
+
for (let e = r.index + 1; e <= i.index && e < n.length; e++) o(n[e]);
|
|
1409
|
+
return i.index + 1 < n.length ? o(Q(n[i.index], n[i.index + 1], i.t)) : o(n[i.index]), a;
|
|
1410
|
+
}
|
|
1411
|
+
function En(e, t, n, r) {
|
|
1412
|
+
if (e.length < 2) return () => {};
|
|
1413
|
+
let i = null, a, o = [], s = 0;
|
|
1414
|
+
for (let t = 0; t < e.length - 1; t++) {
|
|
1415
|
+
let n = fe(e[t], e[t + 1]);
|
|
1416
|
+
o.push(n), s += n;
|
|
1417
|
+
}
|
|
1418
|
+
let c = (l) => {
|
|
1419
|
+
i || (i = l);
|
|
1420
|
+
let u = l - i, d = Math.min(u / t, 1), f = d * s, p = 0, m = 0;
|
|
1421
|
+
for (; m < o.length && p + o[m] < f;) p += o[m], m++;
|
|
1422
|
+
m >= o.length && (m = o.length - 1);
|
|
1423
|
+
let h = e[m], g = e[Math.min(m + 1, e.length - 1)], _ = o[m] || 0, v = _ === 0 ? 0 : (f - p) / _;
|
|
1424
|
+
n({
|
|
1425
|
+
x: h.x + (g.x - h.x) * v,
|
|
1426
|
+
y: h.y + (g.y - h.y) * v,
|
|
1427
|
+
angle: xe(h, g)
|
|
1428
|
+
}), d < 1 ? a = requestAnimationFrame(c) : r && r();
|
|
1429
|
+
};
|
|
1430
|
+
return a = requestAnimationFrame(c), () => {
|
|
1431
|
+
a && cancelAnimationFrame(a);
|
|
1432
|
+
};
|
|
1433
|
+
}
|
|
1434
|
+
function Dn(e) {
|
|
1435
|
+
return `${e.x},${e.y}`;
|
|
1436
|
+
}
|
|
1437
|
+
var $ = /* @__PURE__ */ new WeakMap();
|
|
1438
|
+
//#endregion
|
|
1439
|
+
export { It as a, ht as c, zt as i, ct as l, $t as n, ft as o, Ht as r, mt as s, pn as t };
|