@eyeon/map 2.0.44 → 2.0.45
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/chunks/MapViewer.js +2215 -2216
- package/dist/chunks/MapViewer.js.map +1 -1
- package/dist/chunks/responsive.js +1623 -1616
- package/dist/chunks/responsive.js.map +1 -1
- package/dist/core/publish/index.d.ts +3 -3
- package/dist/core/publish/index.d.ts.map +1 -1
- package/dist/editor/MapEditor.d.ts.map +1 -1
- package/dist/editor/index.js +816 -811
- package/dist/editor/index.js.map +1 -1
- package/dist/editor/previewDocument.d.ts +2 -0
- package/dist/editor/previewDocument.d.ts.map +1 -1
- package/dist/viewer/MapViewer.d.ts.map +1 -1
- package/dist/viewer/components/LevelMeshes.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/editor/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as v, jsx as s, Fragment as je } from "react/jsx-runtime";
|
|
2
2
|
import pl, { useState as T, useMemo as xe, useEffect as ue, useRef as ae, useImperativeHandle as Ma, useLayoutEffect as bs, useCallback as sn, useId as Da, Suspense as Pa } from "react";
|
|
3
|
-
import { ar as $a, aK as Bi, bW as uo, U as fl, av as Fn, cw as Fa, aa as ml, d as so, aM as jn, b0 as Go, g as za, ae as Mr, W as Ba, c3 as Wa, bg as Ka, bf as ot, cq as Ha, ao as
|
|
4
|
-
import { c as Sc, d as Ec, g as Oc, m as Ac, e as Rc, f as Lc, h as tt, i as Ci, j as Tc, k as Mc, l as Dc, n as Pc, b as $c, o as oi, p as Fc, q as zc, B as Bc, D as ri, G as Wc, r as Kc, s as Hc, M as
|
|
3
|
+
import { ar as $a, aK as Bi, bW as uo, U as fl, av as Fn, cw as Fa, aa as ml, d as so, aM as jn, b0 as Go, g as za, ae as Mr, W as Ba, c3 as Wa, bg as Ka, bf as ot, cq as Ha, ao as Ua, k as zr, bX as Va, a2 as ja, D as xi, a0 as Xa, a4 as Ga, bz as Yo, c1 as Ya, a1 as Za, bZ as gl, bm as yl, bV as Ja, cd as Io, cp as qa, cy as Qa, cv as ec, cf as xs, au as qr, a as ro, bl as nc, a8 as ws, bu as tc, aj as So, aN as oc, bq as _l, by as rc, ac as wi, bK as Lt, a6 as ic, L as sc, T as bo, ai as lc, Y as Ni, a3 as Wi, ax as io, _ as vl, c7 as kl, c as zt, ag as ac, af as cc, ct as dc, B as uc, bk as hc, $ as Il, b as Zo, b3 as pc, ab as fc, al as mc, bJ as Bt, bt as gc, bx as yc, bs as _c, aY as Qr, cg as ei, c5 as ni, cK as vc, bU as kc, aw as Ic, q as bc, M as xc, cj as wc, aO as Nc, K as Cc, a5 as ti } from "../chunks/responsive.js";
|
|
4
|
+
import { c as Sc, d as Ec, g as Oc, m as Ac, e as Rc, f as Lc, h as tt, i as Ci, j as Tc, k as Mc, l as Dc, n as Pc, b as $c, o as oi, p as Fc, q as zc, B as Bc, D as ri, G as Wc, r as Kc, s as Hc, M as Uc, t as Vc } from "../chunks/MapViewer.js";
|
|
5
5
|
import { n as jc, o as Xc, r as Gc } from "../chunks/wheelZoom.js";
|
|
6
6
|
import { createPortal as bl } from "react-dom";
|
|
7
7
|
function Or(e) {
|
|
@@ -487,7 +487,7 @@ function bd({
|
|
|
487
487
|
}) {
|
|
488
488
|
const i = mr.filter((c) => c.group !== "route"), r = mr.filter(
|
|
489
489
|
(c) => c.group === "route" && c.id !== "draw-route"
|
|
490
|
-
), l = o === "route" ? mr.filter((c) => c.also === "route") : [],
|
|
490
|
+
), l = o === "route" ? mr.filter((c) => c.also === "route") : [], d = o !== "route", h = o !== "map", a = mr.find((c) => c.id === "select"), p = o === "route" && a ? [a, ...r, ...l] : r, f = (c) => {
|
|
491
491
|
const _ = _d[c.id];
|
|
492
492
|
return /* @__PURE__ */ v(
|
|
493
493
|
"button",
|
|
@@ -508,11 +508,11 @@ function bd({
|
|
|
508
508
|
);
|
|
509
509
|
};
|
|
510
510
|
return /* @__PURE__ */ v("div", { className: "eyeon-map-editor__tool-icons", role: "toolbar", "aria-label": "Map tools", children: [
|
|
511
|
-
|
|
511
|
+
d ? i.map((c) => /* @__PURE__ */ v(pl.Fragment, { children: [
|
|
512
512
|
c.sepBefore ? /* @__PURE__ */ s("span", { className: "eyeon-map-editor__tool-sep", "aria-hidden": "true" }) : null,
|
|
513
513
|
f(c)
|
|
514
514
|
] }, c.id)) : null,
|
|
515
|
-
|
|
515
|
+
d && h ? /* @__PURE__ */ s("span", { className: "eyeon-map-editor__tool-sep", "aria-hidden": "true" }) : null,
|
|
516
516
|
h ? p.map(f) : null
|
|
517
517
|
] });
|
|
518
518
|
}
|
|
@@ -613,39 +613,39 @@ function Nd(e, n, t, o, i) {
|
|
|
613
613
|
};
|
|
614
614
|
}
|
|
615
615
|
function Oi(e, n, t, o, i) {
|
|
616
|
-
const r = Rt(e, n, i), l = Rt(n, t, i),
|
|
616
|
+
const r = Rt(e, n, i), l = Rt(n, t, i), d = Rt(t, o, i), h = Rt(r, l, i), a = Rt(l, d, i), p = Rt(h, a, i);
|
|
617
617
|
return {
|
|
618
618
|
left: { c1: r, c2: h, to: p },
|
|
619
|
-
right: { c1: a, c2:
|
|
619
|
+
right: { c1: a, c2: d, to: o }
|
|
620
620
|
};
|
|
621
621
|
}
|
|
622
622
|
function Cd(e, n, t, o, i, r, l) {
|
|
623
623
|
if (Ct(e, l)) return [];
|
|
624
|
-
let
|
|
625
|
-
if (
|
|
624
|
+
let d = Math.abs(n), h = Math.abs(t);
|
|
625
|
+
if (d === 0 || h === 0 || !Number.isFinite(d) || !Number.isFinite(h))
|
|
626
626
|
return [];
|
|
627
|
-
const a = o % 360 * Math.PI / 180, p = Math.cos(a), f = Math.sin(a), c = (e.x - l.x) / 2, _ = (e.y - l.y) / 2, C = p * c + f * _, R = -f * c + p * _, w = C * C / (
|
|
627
|
+
const a = o % 360 * Math.PI / 180, p = Math.cos(a), f = Math.sin(a), c = (e.x - l.x) / 2, _ = (e.y - l.y) / 2, C = p * c + f * _, R = -f * c + p * _, w = C * C / (d * d) + R * R / (h * h);
|
|
628
628
|
if (w > 1) {
|
|
629
629
|
const le = Math.sqrt(w);
|
|
630
|
-
|
|
630
|
+
d *= le, h *= le;
|
|
631
631
|
}
|
|
632
|
-
const x =
|
|
633
|
-
let
|
|
634
|
-
!r &&
|
|
632
|
+
const x = d * d, A = h * h, S = x * A - x * R * R - A * C * C, B = x * R * R + A * C * C, G = Math.sqrt(Math.max(0, S / B)) * (i === r ? -1 : 1), q = G * d * R / h, j = -G * h * C / d, oe = p * q - f * j + (e.x + l.x) / 2, Ie = f * q + p * j + (e.y + l.y) / 2, M = (C - q) / d, re = (R - j) / h, Ee = (-C - q) / d, ne = (-R - j) / h, ye = Math.atan2(re, M);
|
|
633
|
+
let U = Math.atan2(M * ne - re * Ee, M * Ee + re * ne);
|
|
634
|
+
!r && U > 0 ? U -= 2 * Math.PI : r && U < 0 && (U += 2 * Math.PI);
|
|
635
635
|
const ln = (le) => {
|
|
636
636
|
const Je = Math.cos(le), ee = Math.sin(le);
|
|
637
637
|
return {
|
|
638
|
-
x: oe +
|
|
639
|
-
y: Ie +
|
|
638
|
+
x: oe + d * p * Je - h * f * ee,
|
|
639
|
+
y: Ie + d * f * Je + h * p * ee
|
|
640
640
|
};
|
|
641
641
|
}, Q = (le) => {
|
|
642
|
-
const Je = Math.cos(le), ee = Math.sin(le), Ae = -
|
|
642
|
+
const Je = Math.cos(le), ee = Math.sin(le), Ae = -d * ee, we = h * Je;
|
|
643
643
|
return {
|
|
644
644
|
x: p * Ae - f * we,
|
|
645
645
|
y: f * Ae + p * we
|
|
646
646
|
};
|
|
647
647
|
}, Re = [];
|
|
648
|
-
let Me = ye, He =
|
|
648
|
+
let Me = ye, He = U;
|
|
649
649
|
for (; Math.abs(He) > 1e-8; ) {
|
|
650
650
|
const le = Math.sign(He) * Math.min(Math.abs(He), Math.PI / 2), Je = Me + le, ee = 4 / 3 * Math.tan(le / 4), Ae = ln(Me), we = ln(Je), an = Q(Me), W = Q(Je);
|
|
651
651
|
Re.push({
|
|
@@ -658,7 +658,7 @@ function Cd(e, n, t, o, i, r, l) {
|
|
|
658
658
|
}
|
|
659
659
|
function Sd(e) {
|
|
660
660
|
const n = Fa(e), t = [];
|
|
661
|
-
let o = [], i = [], r = 0, l = 0,
|
|
661
|
+
let o = [], i = [], r = 0, l = 0, d = 0, h = 0, a = null, p = 0, f = "", c = !1;
|
|
662
662
|
const _ = () => Number(n[p++]), C = (w) => {
|
|
663
663
|
w && o.length > 1 && Ct(o[0], o[o.length - 1]) && o.pop();
|
|
664
664
|
const x = w ? o.length : Math.max(0, o.length - 1);
|
|
@@ -678,7 +678,7 @@ function Sd(e) {
|
|
|
678
678
|
case "M":
|
|
679
679
|
case "m": {
|
|
680
680
|
const x = f === "m", A = x ? r + _() : _(), S = x ? l + _() : _();
|
|
681
|
-
c && C(!1), r = A, l = S,
|
|
681
|
+
c && C(!1), r = A, l = S, d = r, h = l, R({ x: r, y: l }), c = !0, a = null, f = x ? "l" : "L";
|
|
682
682
|
break;
|
|
683
683
|
}
|
|
684
684
|
case "L":
|
|
@@ -750,7 +750,7 @@ function Sd(e) {
|
|
|
750
750
|
}
|
|
751
751
|
case "Z":
|
|
752
752
|
case "z": {
|
|
753
|
-
Ct({ x: r, y: l }, { x:
|
|
753
|
+
Ct({ x: r, y: l }, { x: d, y: h }) || i.push({ kind: "line" }), r = d, l = h, C(!0), a = null;
|
|
754
754
|
break;
|
|
755
755
|
}
|
|
756
756
|
default:
|
|
@@ -794,8 +794,8 @@ function Ad(e) {
|
|
|
794
794
|
if (o < Dr) return !1;
|
|
795
795
|
let i = 0, r = 0;
|
|
796
796
|
for (let l = 1; l < e.length - 1; l++) {
|
|
797
|
-
const
|
|
798
|
-
i = Math.max(i,
|
|
797
|
+
const d = uo(e[l], n, t);
|
|
798
|
+
i = Math.max(i, d.distance);
|
|
799
799
|
const h = Math.sign(
|
|
800
800
|
(t.x - n.x) * (e[l].y - n.y) - (t.y - n.y) * (e[l].x - n.x)
|
|
801
801
|
);
|
|
@@ -814,9 +814,9 @@ function Ad(e) {
|
|
|
814
814
|
function Rd(e) {
|
|
815
815
|
const n = e[0], t = e[e.length - 1];
|
|
816
816
|
let o = e[Math.floor(e.length / 2)], i = 0;
|
|
817
|
-
for (let
|
|
818
|
-
const h = uo(e[
|
|
819
|
-
h > i && (i = h, o = e[
|
|
817
|
+
for (let d = 1; d < e.length - 1; d++) {
|
|
818
|
+
const h = uo(e[d], n, t).distance;
|
|
819
|
+
h > i && (i = h, o = e[d]);
|
|
820
820
|
}
|
|
821
821
|
const { c1: r, c2: l } = Cl(n, t, o);
|
|
822
822
|
return { kind: "cubic", c1: r, c2: l };
|
|
@@ -853,7 +853,7 @@ function Dd(e) {
|
|
|
853
853
|
if (_ == null) return e;
|
|
854
854
|
l = _;
|
|
855
855
|
}
|
|
856
|
-
const
|
|
856
|
+
const d = [], h = [], a = e.closed ? n : n - 1, p = (_, C) => {
|
|
857
857
|
const R = [];
|
|
858
858
|
for (let x = _; x <= C; x++)
|
|
859
859
|
R.push(e.anchors[t(l + x)]);
|
|
@@ -861,24 +861,24 @@ function Dd(e) {
|
|
|
861
861
|
const S = e.edges[t(l + _ + A)];
|
|
862
862
|
return !S || S.kind === "line";
|
|
863
863
|
});
|
|
864
|
-
if (
|
|
865
|
-
|
|
864
|
+
if (d.length === 0 && d.push(ge(R[0])), w && Ad(R)) {
|
|
865
|
+
d.push(ge(R[R.length - 1])), h.push(Rd(R));
|
|
866
866
|
return;
|
|
867
867
|
}
|
|
868
868
|
for (let x = 1; x < R.length; x++)
|
|
869
|
-
|
|
869
|
+
d.push(ge(R[x])), h.push(e.edges[t(l + _ + x - 1)] ?? { kind: "line" });
|
|
870
870
|
};
|
|
871
871
|
let f = 0;
|
|
872
872
|
for (let _ = 1; _ <= a; _++) {
|
|
873
873
|
const C = t(l + _);
|
|
874
874
|
(_ === a || r(C)) && (p(f, _), f = _);
|
|
875
875
|
}
|
|
876
|
-
e.closed &&
|
|
877
|
-
const c = e.closed ?
|
|
876
|
+
e.closed && d.length > 1 && Ct(d[0], d[d.length - 1]) && d.pop();
|
|
877
|
+
const c = e.closed ? d.length : Math.max(0, d.length - 1);
|
|
878
878
|
for (; h.length > c; ) h.pop();
|
|
879
|
-
return
|
|
879
|
+
return d.length < 2 ? e : { closed: e.closed, anchors: d, edges: h };
|
|
880
880
|
}
|
|
881
|
-
function
|
|
881
|
+
function Ue(e) {
|
|
882
882
|
const n = e.paths.flatMap((o) => Sd(o.d));
|
|
883
883
|
return (n.some((o) => o.anchors.length >= 2) ? n.filter((o) => o.anchors.length >= 2) : e.polygons.filter((o) => o.length >= 2).map((o) => wd(o, !0))).map((o) => Md(Dd(o)));
|
|
884
884
|
}
|
|
@@ -888,12 +888,12 @@ function Os(e, n, t) {
|
|
|
888
888
|
}
|
|
889
889
|
function or(e, n, t, o, i) {
|
|
890
890
|
const r = fl(n, t, o, i, 16);
|
|
891
|
-
let l = 0,
|
|
891
|
+
let l = 0, d = r[0], h = Fn(e, r[0]);
|
|
892
892
|
for (let a = 1; a < r.length; a++) {
|
|
893
893
|
const p = Fn(e, r[a]);
|
|
894
|
-
p < h && (h = p,
|
|
894
|
+
p < h && (h = p, d = r[a], l = a / (r.length - 1));
|
|
895
895
|
}
|
|
896
|
-
return { t: l, point:
|
|
896
|
+
return { t: l, point: d, distance: h };
|
|
897
897
|
}
|
|
898
898
|
function Pd(e) {
|
|
899
899
|
return e.map((n) => n.map((t) => ({ x: t.x, y: t.y })));
|
|
@@ -917,7 +917,7 @@ function Jo(e) {
|
|
|
917
917
|
polygons: n
|
|
918
918
|
};
|
|
919
919
|
}
|
|
920
|
-
function
|
|
920
|
+
function Vt(e) {
|
|
921
921
|
return rt(e);
|
|
922
922
|
}
|
|
923
923
|
function Ll(e, n) {
|
|
@@ -927,7 +927,7 @@ function Hi(e, n) {
|
|
|
927
927
|
return e.closed || n < e.anchors.length - 1 ? n : null;
|
|
928
928
|
}
|
|
929
929
|
function As(e, n, t) {
|
|
930
|
-
const o = { x: n, y: t }, i =
|
|
930
|
+
const o = { x: n, y: t }, i = Ue(e).map((r) => ({
|
|
931
931
|
closed: r.closed,
|
|
932
932
|
anchors: r.anchors.map((l) => Mn(l, o)),
|
|
933
933
|
edges: r.edges.map(
|
|
@@ -940,18 +940,18 @@ function As(e, n, t) {
|
|
|
940
940
|
}));
|
|
941
941
|
if (i.length === 0) {
|
|
942
942
|
const r = Pd(e.polygons).map(
|
|
943
|
-
(l) => l.map((
|
|
943
|
+
(l) => l.map((d) => ({ x: d.x + n, y: d.y + t }))
|
|
944
944
|
);
|
|
945
945
|
return Jo(r);
|
|
946
946
|
}
|
|
947
|
-
return
|
|
947
|
+
return Vt(i);
|
|
948
948
|
}
|
|
949
949
|
function Fd(e, n, t, o) {
|
|
950
950
|
if (o.x === 0 && o.y === 0) return e;
|
|
951
|
-
const i =
|
|
951
|
+
const i = Ue(e), r = i[n];
|
|
952
952
|
if (!r || t < 0 || t >= yt(r)) return e;
|
|
953
|
-
const l = t,
|
|
954
|
-
r.anchors[l] = Mn(r.anchors[l], o), r.anchors[
|
|
953
|
+
const l = t, d = (t + 1) % r.anchors.length;
|
|
954
|
+
r.anchors[l] = Mn(r.anchors[l], o), r.anchors[d] = Mn(r.anchors[d], o);
|
|
955
955
|
const h = r.edges[t];
|
|
956
956
|
(h == null ? void 0 : h.kind) === "cubic" && (h.c1 = Mn(h.c1, o), h.c2 = Mn(h.c2, o));
|
|
957
957
|
const a = Ll(r, l);
|
|
@@ -959,60 +959,60 @@ function Fd(e, n, t, o) {
|
|
|
959
959
|
const f = r.edges[a];
|
|
960
960
|
(f == null ? void 0 : f.kind) === "cubic" && (f.c2 = Mn(f.c2, o));
|
|
961
961
|
}
|
|
962
|
-
const p = Hi(r,
|
|
962
|
+
const p = Hi(r, d);
|
|
963
963
|
if (p != null && p !== t) {
|
|
964
964
|
const f = r.edges[p];
|
|
965
965
|
(f == null ? void 0 : f.kind) === "cubic" && (f.c1 = Mn(f.c1, o));
|
|
966
966
|
}
|
|
967
|
-
return
|
|
967
|
+
return Vt(i);
|
|
968
968
|
}
|
|
969
969
|
function zd(e, n, t) {
|
|
970
|
-
const i =
|
|
970
|
+
const i = Ue(e)[n];
|
|
971
971
|
if (!i || i.anchors.length < 2) return [];
|
|
972
972
|
if (t < 0 || t >= i.anchors.length) return [];
|
|
973
|
-
const r = i.anchors.length, l = i.anchors[(t - 1 + r) % r],
|
|
974
|
-
return (l.x !==
|
|
973
|
+
const r = i.anchors.length, l = i.anchors[(t - 1 + r) % r], d = i.anchors[(t + 1) % r], h = [ge(l)];
|
|
974
|
+
return (l.x !== d.x || l.y !== d.y) && h.push(ge(d)), h;
|
|
975
975
|
}
|
|
976
976
|
function Bd(e, n, t, o) {
|
|
977
|
-
const i =
|
|
977
|
+
const i = Ue(e), r = i[n];
|
|
978
978
|
if (!r || t < 0 || t >= r.anchors.length)
|
|
979
979
|
return e;
|
|
980
|
-
const l = r.anchors[t],
|
|
980
|
+
const l = r.anchors[t], d = Ei(o, l);
|
|
981
981
|
r.anchors[t] = ge(o);
|
|
982
982
|
const h = Ll(r, t), a = Hi(r, t);
|
|
983
983
|
if (h != null) {
|
|
984
984
|
const p = r.edges[h];
|
|
985
|
-
(p == null ? void 0 : p.kind) === "cubic" && (p.c2 = Mn(p.c2,
|
|
985
|
+
(p == null ? void 0 : p.kind) === "cubic" && (p.c2 = Mn(p.c2, d));
|
|
986
986
|
}
|
|
987
987
|
if (a != null) {
|
|
988
988
|
const p = r.edges[a];
|
|
989
|
-
(p == null ? void 0 : p.kind) === "cubic" && (p.c1 = Mn(p.c1,
|
|
989
|
+
(p == null ? void 0 : p.kind) === "cubic" && (p.c1 = Mn(p.c1, d));
|
|
990
990
|
}
|
|
991
|
-
return
|
|
991
|
+
return Vt(i);
|
|
992
992
|
}
|
|
993
993
|
function Wd(e, n, t, o, i) {
|
|
994
|
-
const r =
|
|
995
|
-
return !
|
|
994
|
+
const r = Ue(e), l = r[n], d = l == null ? void 0 : l.edges[t];
|
|
995
|
+
return !d || d.kind !== "cubic" ? e : (o === 1 ? d.c1 = ge(i) : d.c2 = ge(i), Vt(r));
|
|
996
996
|
}
|
|
997
997
|
function Rs(e, n, t) {
|
|
998
|
-
const o =
|
|
999
|
-
return !r || r.kind !== "cubic" ? e : (i.edges[t] = { kind: "line" },
|
|
998
|
+
const o = Ue(e), i = o[n], r = i == null ? void 0 : i.edges[t];
|
|
999
|
+
return !r || r.kind !== "cubic" ? e : (i.edges[t] = { kind: "line" }, Vt(o));
|
|
1000
1000
|
}
|
|
1001
1001
|
function Kd(e, n, t, o) {
|
|
1002
|
-
const i =
|
|
1002
|
+
const i = Ue(e), r = i[n];
|
|
1003
1003
|
if (!r || t < 0 || t >= yt(r)) return e;
|
|
1004
|
-
const l = it(r, t),
|
|
1005
|
-
return r.edges[t] = { kind: "cubic", c1: h, c2: a },
|
|
1004
|
+
const l = it(r, t), d = Xn(r, t), { c1: h, c2: a } = Cl(l, d, o);
|
|
1005
|
+
return r.edges[t] = { kind: "cubic", c1: h, c2: a }, Vt(i);
|
|
1006
1006
|
}
|
|
1007
1007
|
function Hd(e, n, t, o) {
|
|
1008
|
-
const i =
|
|
1008
|
+
const i = Ue(e), r = i[n];
|
|
1009
1009
|
if (!r || t < 0 || t >= r.anchors.length)
|
|
1010
1010
|
return e;
|
|
1011
1011
|
const l = Hi(r, t);
|
|
1012
1012
|
if (l == null) return e;
|
|
1013
|
-
const
|
|
1014
|
-
if (
|
|
1015
|
-
const { t: p } = or(o, h,
|
|
1013
|
+
const d = r.edges[l] ?? { kind: "line" }, h = it(r, l), a = Xn(r, l);
|
|
1014
|
+
if (d.kind === "cubic") {
|
|
1015
|
+
const { t: p } = or(o, h, d.c1, d.c2, a), f = Math.min(0.95, Math.max(0.05, p)), c = Oi(h, d.c1, d.c2, a, f);
|
|
1016
1016
|
r.anchors.splice(t + 1, 0, ge(c.left.to)), r.edges.splice(l, 1, { kind: "cubic", c1: c.left.c1, c2: c.left.c2 }, {
|
|
1017
1017
|
kind: "cubic",
|
|
1018
1018
|
c1: c.right.c1,
|
|
@@ -1020,54 +1020,54 @@ function Hd(e, n, t, o) {
|
|
|
1020
1020
|
});
|
|
1021
1021
|
} else
|
|
1022
1022
|
r.anchors.splice(t + 1, 0, ge(o)), r.edges.splice(l, 1, { kind: "line" }, { kind: "line" });
|
|
1023
|
-
return
|
|
1023
|
+
return Vt(i);
|
|
1024
1024
|
}
|
|
1025
1025
|
function Ls(e, n, t) {
|
|
1026
|
-
const o =
|
|
1026
|
+
const o = Ue(e), i = o[n];
|
|
1027
1027
|
if (!i) return e;
|
|
1028
1028
|
const r = i.closed ? 3 : 2;
|
|
1029
1029
|
if (i.anchors.length <= r || t < 0 || t >= i.anchors.length) return e;
|
|
1030
1030
|
const l = i.anchors.length;
|
|
1031
1031
|
if (i.closed) {
|
|
1032
1032
|
i.anchors.splice(t, 1), i.edges.splice(t, 1);
|
|
1033
|
-
const
|
|
1034
|
-
i.edges[
|
|
1033
|
+
const d = t === 0 ? i.anchors.length - 1 : t - 1;
|
|
1034
|
+
i.edges[d] && (i.edges[d] = { kind: "line" });
|
|
1035
1035
|
} else t === 0 ? (i.anchors.splice(0, 1), i.edges.splice(0, 1)) : t === l - 1 ? (i.anchors.pop(), i.edges.pop()) : (i.anchors.splice(t, 1), i.edges.splice(t, 1), i.edges[t - 1] = { kind: "line" });
|
|
1036
|
-
return
|
|
1036
|
+
return Vt(o);
|
|
1037
1037
|
}
|
|
1038
1038
|
function ai(e, n, t) {
|
|
1039
1039
|
let o = null;
|
|
1040
|
-
return
|
|
1041
|
-
i.anchors.forEach((l,
|
|
1040
|
+
return Ue(e).forEach((i, r) => {
|
|
1041
|
+
i.anchors.forEach((l, d) => {
|
|
1042
1042
|
const h = Math.hypot(l.x - n.x, l.y - n.y);
|
|
1043
1043
|
h <= t && (!o || h < o.distance) && (o = {
|
|
1044
1044
|
polygonIndex: r,
|
|
1045
|
-
vertexIndex:
|
|
1045
|
+
vertexIndex: d,
|
|
1046
1046
|
point: { x: l.x, y: l.y },
|
|
1047
1047
|
distance: h
|
|
1048
1048
|
});
|
|
1049
1049
|
});
|
|
1050
1050
|
}), o;
|
|
1051
1051
|
}
|
|
1052
|
-
function
|
|
1052
|
+
function Ud(e, n, t) {
|
|
1053
1053
|
let o = null;
|
|
1054
|
-
return
|
|
1054
|
+
return Ue(e).forEach((i, r) => {
|
|
1055
1055
|
const l = yt(i);
|
|
1056
|
-
for (let
|
|
1057
|
-
const h = i.edges[
|
|
1056
|
+
for (let d = 0; d < l; d++) {
|
|
1057
|
+
const h = i.edges[d];
|
|
1058
1058
|
if ((h == null ? void 0 : h.kind) === "cubic")
|
|
1059
1059
|
for (const a of [1, 2]) {
|
|
1060
1060
|
const p = a === 1 ? h.c1 : h.c2, f = Math.hypot(p.x - n.x, p.y - n.y);
|
|
1061
|
-
f <= t && (!o || f < o.distance) && (o = { ringIndex: r, edgeIndex:
|
|
1061
|
+
f <= t && (!o || f < o.distance) && (o = { ringIndex: r, edgeIndex: d, handle: a, point: ge(p), distance: f });
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
1064
|
}), o;
|
|
1065
1065
|
}
|
|
1066
1066
|
function Tl(e, n, t, o) {
|
|
1067
1067
|
let i = null;
|
|
1068
|
-
return
|
|
1069
|
-
const
|
|
1070
|
-
for (let h = 0; h <
|
|
1068
|
+
return Ue(e).forEach((r, l) => {
|
|
1069
|
+
const d = yt(r);
|
|
1070
|
+
for (let h = 0; h < d; h++) {
|
|
1071
1071
|
const a = it(r, h), p = Xn(r, h), f = r.edges[h] ?? { kind: "line" };
|
|
1072
1072
|
let c, _;
|
|
1073
1073
|
if (o)
|
|
@@ -1089,7 +1089,7 @@ function Tl(e, n, t, o) {
|
|
|
1089
1089
|
}
|
|
1090
1090
|
}), i;
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1092
|
+
function Vd(e, n, t) {
|
|
1093
1093
|
return Tl(e, n, t, !0);
|
|
1094
1094
|
}
|
|
1095
1095
|
function Ml(e, n, t) {
|
|
@@ -1099,13 +1099,13 @@ const jd = 4;
|
|
|
1099
1099
|
function Ts(e) {
|
|
1100
1100
|
return e === "unit" || e === "amenity" || e === "parking_zone";
|
|
1101
1101
|
}
|
|
1102
|
-
function
|
|
1102
|
+
function Vo(e, n) {
|
|
1103
1103
|
return e.shapeId === n.shapeId && e.ringIndex === n.ringIndex && e.end === n.end;
|
|
1104
1104
|
}
|
|
1105
1105
|
function En(e) {
|
|
1106
1106
|
return e.kind === "line" ? { kind: "line" } : { kind: "cubic", c1: ge(e.c1), c2: ge(e.c2) };
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function Ut(e) {
|
|
1109
1109
|
return {
|
|
1110
1110
|
closed: e.closed,
|
|
1111
1111
|
anchors: e.anchors.map(ge),
|
|
@@ -1126,7 +1126,7 @@ function Dl(e, n) {
|
|
|
1126
1126
|
if (e.closed || e.anchors.length < 3) return e;
|
|
1127
1127
|
const t = e.anchors[0], o = e.anchors[e.anchors.length - 1];
|
|
1128
1128
|
if (!Ct(t, o, n)) return e;
|
|
1129
|
-
const i =
|
|
1129
|
+
const i = Ut(e);
|
|
1130
1130
|
i.anchors.pop(), i.closed = !0;
|
|
1131
1131
|
const r = i.anchors.length;
|
|
1132
1132
|
for (; i.edges.length > r; ) i.edges.pop();
|
|
@@ -1135,7 +1135,7 @@ function Dl(e, n) {
|
|
|
1135
1135
|
}
|
|
1136
1136
|
function qo(e) {
|
|
1137
1137
|
const n = [];
|
|
1138
|
-
return
|
|
1138
|
+
return Ue(e).forEach((t, o) => {
|
|
1139
1139
|
t.closed || t.anchors.length < 2 || (n.push({
|
|
1140
1140
|
ringIndex: o,
|
|
1141
1141
|
end: "start",
|
|
@@ -1160,7 +1160,7 @@ function ci(e, n, t) {
|
|
|
1160
1160
|
function Pl(e, n, t, o = jd) {
|
|
1161
1161
|
const i = { x: (e.x + n.x) / 2, y: (e.y + n.y) / 2 };
|
|
1162
1162
|
for (const r of t) {
|
|
1163
|
-
if (
|
|
1163
|
+
if (Ue(r.geometry).some(
|
|
1164
1164
|
(a) => ci(e, a, o) && ci(n, a, o) && ci(i, a, o)
|
|
1165
1165
|
)) return !0;
|
|
1166
1166
|
const h = qo(r.geometry);
|
|
@@ -1174,17 +1174,17 @@ function Pl(e, n, t, o = jd) {
|
|
|
1174
1174
|
function $l(e, n, t, o) {
|
|
1175
1175
|
const i = n.x - e.x, r = n.y - e.y, l = Math.hypot(i, r);
|
|
1176
1176
|
if (l < 1e-6) return null;
|
|
1177
|
-
const
|
|
1178
|
-
if (
|
|
1177
|
+
const d = Math.min(Math.max(o, 0.35) / 2, l * 0.2);
|
|
1178
|
+
if (d < 0.12) return null;
|
|
1179
1179
|
const h = i / l, a = r / l, p = uo(t, e, n).point;
|
|
1180
1180
|
let f = (p.x - e.x) * h + (p.y - e.y) * a;
|
|
1181
|
-
return f = Math.min(l -
|
|
1182
|
-
p1: { x: e.x + h * (f -
|
|
1183
|
-
p2: { x: e.x + h * (f +
|
|
1181
|
+
return f = Math.min(l - d, Math.max(d, f)), {
|
|
1182
|
+
p1: { x: e.x + h * (f - d), y: e.y + a * (f - d) },
|
|
1183
|
+
p2: { x: e.x + h * (f + d), y: e.y + a * (f + d) }
|
|
1184
1184
|
};
|
|
1185
1185
|
}
|
|
1186
1186
|
function Fl(e, n, t, o, i) {
|
|
1187
|
-
const { t: r } = or(o, e, n.c1, n.c2, t), l = Math.hypot(t.x - e.x, t.y - e.y),
|
|
1187
|
+
const { t: r } = or(o, e, n.c1, n.c2, t), l = Math.hypot(t.x - e.x, t.y - e.y), d = l > 1e-6 ? Math.min(0.04, Math.max(6e-3, i / (2 * l))) : 0.015, h = Math.min(0.92, Math.max(0.04, r - d)), a = Math.min(0.96, Math.max(h + 0.012, r + d));
|
|
1188
1188
|
if (a - h < 0.01) return null;
|
|
1189
1189
|
const p = Oi(e, n.c1, n.c2, t, h), f = (a - h) / Math.max(1e-6, 1 - h), c = Oi(
|
|
1190
1190
|
p.left.to,
|
|
@@ -1201,16 +1201,16 @@ function Fl(e, n, t, o, i) {
|
|
|
1201
1201
|
};
|
|
1202
1202
|
}
|
|
1203
1203
|
function Yd(e, n, t, o, i, r) {
|
|
1204
|
-
const l = e.anchors.length,
|
|
1204
|
+
const l = e.anchors.length, d = n, h = (n + 1) % l, a = [ge(o), ge(e.anchors[h])], p = [En(r)];
|
|
1205
1205
|
let f = h;
|
|
1206
|
-
for (; f !==
|
|
1206
|
+
for (; f !== d; ) {
|
|
1207
1207
|
const c = (f + 1) % l;
|
|
1208
1208
|
p.push(En(e.edges[f])), a.push(ge(e.anchors[c])), f = c;
|
|
1209
1209
|
}
|
|
1210
1210
|
return a.push(ge(t)), p.push(En(i)), { closed: !1, anchors: a, edges: p };
|
|
1211
1211
|
}
|
|
1212
1212
|
function Zd(e, n, t, o, i, r) {
|
|
1213
|
-
const l = n,
|
|
1213
|
+
const l = n, d = n + 1, h = {
|
|
1214
1214
|
closed: !1,
|
|
1215
1215
|
anchors: [...e.anchors.slice(0, l + 1).map(ge), ge(t)],
|
|
1216
1216
|
edges: [
|
|
@@ -1219,13 +1219,13 @@ function Zd(e, n, t, o, i, r) {
|
|
|
1219
1219
|
]
|
|
1220
1220
|
}, a = {
|
|
1221
1221
|
closed: !1,
|
|
1222
|
-
anchors: [ge(o), ...e.anchors.slice(
|
|
1223
|
-
edges: [En(r), ...e.edges.slice(
|
|
1222
|
+
anchors: [ge(o), ...e.anchors.slice(d).map(ge)],
|
|
1223
|
+
edges: [En(r), ...e.edges.slice(d).map(En)]
|
|
1224
1224
|
};
|
|
1225
1225
|
return [h, a].filter((p) => p.anchors.length >= 2);
|
|
1226
1226
|
}
|
|
1227
1227
|
function Ai(e, n, t) {
|
|
1228
|
-
const o =
|
|
1228
|
+
const o = Ue(e).map(Ut), i = o[n];
|
|
1229
1229
|
if (!i || t < 0 || t >= yt(i)) return e;
|
|
1230
1230
|
if (i.closed) {
|
|
1231
1231
|
const h = i.anchors.length;
|
|
@@ -1250,20 +1250,20 @@ function Ai(e, n, t) {
|
|
|
1250
1250
|
closed: !1,
|
|
1251
1251
|
anchors: i.anchors.slice(t + 1).map(ge),
|
|
1252
1252
|
edges: i.edges.slice(t + 1).map(En)
|
|
1253
|
-
},
|
|
1254
|
-
return o.splice(n, 1, ...
|
|
1253
|
+
}, d = [r, l].filter((h) => h.anchors.length >= 2);
|
|
1254
|
+
return o.splice(n, 1, ...d), rt(o);
|
|
1255
1255
|
}
|
|
1256
1256
|
function Jd(e, n, t, o, i) {
|
|
1257
|
-
const r =
|
|
1257
|
+
const r = Ue(e).map(Ut), l = r[n];
|
|
1258
1258
|
if (!l || t < 0 || t >= yt(l)) return e;
|
|
1259
|
-
const
|
|
1259
|
+
const d = it(l, t), h = Xn(l, t), a = l.edges[t] ?? { kind: "line" };
|
|
1260
1260
|
let p, f, c, _;
|
|
1261
1261
|
if (a.kind === "cubic") {
|
|
1262
|
-
const R = Fl(
|
|
1262
|
+
const R = Fl(d, a, h, o, i);
|
|
1263
1263
|
if (!R) return Ai(e, n, t);
|
|
1264
1264
|
p = R.p1, f = R.p2, c = R.leftEdge, _ = R.rightEdge;
|
|
1265
1265
|
} else {
|
|
1266
|
-
const R = $l(
|
|
1266
|
+
const R = $l(d, h, o, i);
|
|
1267
1267
|
if (!R) return Ai(e, n, t);
|
|
1268
1268
|
p = R.p1, f = R.p2, c = { kind: "line" }, _ = { kind: "line" };
|
|
1269
1269
|
}
|
|
@@ -1287,8 +1287,8 @@ function Jd(e, n, t, o, i) {
|
|
|
1287
1287
|
return r.splice(n, 1, ...C), rt(r);
|
|
1288
1288
|
}
|
|
1289
1289
|
function qd(e, n, t) {
|
|
1290
|
-
const o = e.anchors[e.anchors.length - 1], i = n.anchors[0], r = Ct(o, i, t), l = r ? [...e.anchors.map(ge), ...n.anchors.slice(1).map(ge)] : [...e.anchors.map(ge), ...n.anchors.map(ge)],
|
|
1291
|
-
return Dl({ closed: !1, anchors: l, edges:
|
|
1290
|
+
const o = e.anchors[e.anchors.length - 1], i = n.anchors[0], r = Ct(o, i, t), l = r ? [...e.anchors.map(ge), ...n.anchors.slice(1).map(ge)] : [...e.anchors.map(ge), ...n.anchors.map(ge)], d = r ? [...e.edges.map(En), ...n.edges.map(En)] : [...e.edges.map(En), { kind: "line" }, ...n.edges.map(En)];
|
|
1291
|
+
return Dl({ closed: !1, anchors: l, edges: d }, t);
|
|
1292
1292
|
}
|
|
1293
1293
|
function Qd(e, n) {
|
|
1294
1294
|
return Ct(
|
|
@@ -1302,11 +1302,11 @@ function Qd(e, n) {
|
|
|
1302
1302
|
};
|
|
1303
1303
|
}
|
|
1304
1304
|
function Ds(e, n, t, o = so) {
|
|
1305
|
-
const i =
|
|
1305
|
+
const i = Ue(e).map(Ut), r = i[n.ringIndex], l = i[t.ringIndex];
|
|
1306
1306
|
if (!r || !l || r.closed || l.closed) return e;
|
|
1307
1307
|
if (n.ringIndex === t.ringIndex)
|
|
1308
1308
|
return n.end === t.end ? e : (i[n.ringIndex] = Qd(r, o), rt(i));
|
|
1309
|
-
const
|
|
1309
|
+
const d = n.end === "end" ? Ut(r) : Ms(r), h = t.end === "start" ? Ut(l) : Ms(l), a = qd(d, h, o), p = Math.min(n.ringIndex, t.ringIndex), f = Math.max(n.ringIndex, t.ringIndex);
|
|
1310
1310
|
return i[p] = a, i.splice(f, 1), rt(i);
|
|
1311
1311
|
}
|
|
1312
1312
|
function zl(e, n, t, o) {
|
|
@@ -1319,7 +1319,7 @@ function zl(e, n, t, o) {
|
|
|
1319
1319
|
geometry: Ds(c[i].geometry, n, t, o)
|
|
1320
1320
|
}, { shapes: c, deleteIds: [] };
|
|
1321
1321
|
}
|
|
1322
|
-
const l =
|
|
1322
|
+
const l = Ue(e[i].geometry).map(Ut), d = Ue(e[r].geometry).map(Ut), h = l.length, a = rt([...l, ...d]), p = Ds(
|
|
1323
1323
|
a,
|
|
1324
1324
|
n,
|
|
1325
1325
|
{ ringIndex: t.ringIndex + h, end: t.end },
|
|
@@ -1350,13 +1350,13 @@ function eu(e, n = so) {
|
|
|
1350
1350
|
c <= _ && (!l || c < l.dist) && (l = { a: p, b: f, dist: c });
|
|
1351
1351
|
}
|
|
1352
1352
|
if (!l) break;
|
|
1353
|
-
const
|
|
1354
|
-
t =
|
|
1353
|
+
const d = zl(t, l.a, l.b, n);
|
|
1354
|
+
t = d.shapes, o.push(...d.deleteIds);
|
|
1355
1355
|
}
|
|
1356
1356
|
return { shapes: t, deleteIds: o };
|
|
1357
1357
|
}
|
|
1358
1358
|
function nu(e) {
|
|
1359
|
-
const n =
|
|
1359
|
+
const n = Ue(e.geometry), t = n.filter((i) => i.closed && i.anchors.length >= 3), o = n.filter((i) => !i.closed && i.anchors.length >= 2);
|
|
1360
1360
|
return t.length <= 1 ? { keep: e, extras: [] } : {
|
|
1361
1361
|
keep: {
|
|
1362
1362
|
...e,
|
|
@@ -1379,38 +1379,38 @@ function Bl(e, n, t) {
|
|
|
1379
1379
|
style: a.style
|
|
1380
1380
|
});
|
|
1381
1381
|
}
|
|
1382
|
-
const
|
|
1382
|
+
const d = [], h = new Map(e.map((a) => [a.id, a]));
|
|
1383
1383
|
for (const a of l) {
|
|
1384
1384
|
const p = h.get(a.id);
|
|
1385
|
-
p && JSON.stringify(p.geometry) !== JSON.stringify(a.geometry) &&
|
|
1385
|
+
p && JSON.stringify(p.geometry) !== JSON.stringify(a.geometry) && d.push({
|
|
1386
1386
|
action: "update",
|
|
1387
1387
|
shapeId: a.id,
|
|
1388
1388
|
geometry: a.geometry
|
|
1389
1389
|
});
|
|
1390
1390
|
}
|
|
1391
1391
|
for (const a of r)
|
|
1392
|
-
|
|
1392
|
+
d.push({
|
|
1393
1393
|
action: "create",
|
|
1394
1394
|
kind: a.kind,
|
|
1395
1395
|
geometry: a.geometry,
|
|
1396
1396
|
style: a.style
|
|
1397
1397
|
});
|
|
1398
1398
|
for (const a of i)
|
|
1399
|
-
h.has(a) &&
|
|
1400
|
-
return
|
|
1399
|
+
h.has(a) && d.push({ action: "delete", shapeId: a });
|
|
1400
|
+
return d;
|
|
1401
1401
|
}
|
|
1402
1402
|
function tu(e, n, t) {
|
|
1403
1403
|
const o = e.find((c) => c.id === n.shapeId);
|
|
1404
1404
|
if (!o) return [];
|
|
1405
|
-
const i = e.filter((c) => c.id !== n.shapeId), l =
|
|
1405
|
+
const i = e.filter((c) => c.id !== n.shapeId), l = Ue(o.geometry)[n.ringIndex];
|
|
1406
1406
|
if (!l) return [];
|
|
1407
|
-
const
|
|
1407
|
+
const d = it(l, n.edgeIndex), h = Xn(l, n.edgeIndex), p = Pl(d, h, i) ? Ai(o.geometry, n.ringIndex, n.edgeIndex) : Jd(o.geometry, n.ringIndex, n.edgeIndex, n.point, t), f = e.map(
|
|
1408
1408
|
(c) => c.id === n.shapeId ? { ...c, geometry: p } : c
|
|
1409
1409
|
);
|
|
1410
1410
|
return Bl(e, f, []);
|
|
1411
1411
|
}
|
|
1412
1412
|
function ou(e, n, t) {
|
|
1413
|
-
if (
|
|
1413
|
+
if (Vo(n, t)) return [];
|
|
1414
1414
|
const o = zl(e, n, t, so);
|
|
1415
1415
|
return Bl(e, o.shapes, o.deleteIds);
|
|
1416
1416
|
}
|
|
@@ -1418,16 +1418,16 @@ function _r(e, n, t, o) {
|
|
|
1418
1418
|
let i = null;
|
|
1419
1419
|
for (const r of e)
|
|
1420
1420
|
for (const l of qo(r.geometry)) {
|
|
1421
|
-
const
|
|
1421
|
+
const d = {
|
|
1422
1422
|
shapeId: r.id,
|
|
1423
1423
|
ringIndex: l.ringIndex,
|
|
1424
1424
|
end: l.end
|
|
1425
1425
|
};
|
|
1426
|
-
if (o &&
|
|
1426
|
+
if (o && Vo(o, d)) continue;
|
|
1427
1427
|
const h = Fn(n, l.point);
|
|
1428
1428
|
if (h > t) continue;
|
|
1429
1429
|
const a = o && (r.id !== o.shapeId || l.ringIndex !== o.ringIndex), p = i && o && (i.shapeId !== o.shapeId || i.ringIndex !== o.ringIndex);
|
|
1430
|
-
(!i || a && !p || a === p && h < i.distance) && (i = { ...
|
|
1430
|
+
(!i || a && !p || a === p && h < i.distance) && (i = { ...d, point: l.point, distance: h });
|
|
1431
1431
|
}
|
|
1432
1432
|
return i;
|
|
1433
1433
|
}
|
|
@@ -1436,7 +1436,7 @@ function Ps(e, n, t) {
|
|
|
1436
1436
|
for (const i of e) {
|
|
1437
1437
|
const r = Ml(i.geometry, n, t);
|
|
1438
1438
|
if (r && (!o || r.distance < o.distance)) {
|
|
1439
|
-
const
|
|
1439
|
+
const d = Ue(i.geometry)[r.polygonIndex], h = d ? it(d, r.afterVertexIndex) : n, a = d ? Xn(d, r.afterVertexIndex) : n;
|
|
1440
1440
|
o = {
|
|
1441
1441
|
shapeId: i.id,
|
|
1442
1442
|
ringIndex: r.polygonIndex,
|
|
@@ -1454,14 +1454,14 @@ function Ps(e, n, t) {
|
|
|
1454
1454
|
return o;
|
|
1455
1455
|
}
|
|
1456
1456
|
function ru(e, n, t, o, i) {
|
|
1457
|
-
const l =
|
|
1457
|
+
const l = Ue(e)[n];
|
|
1458
1458
|
if (!l) return null;
|
|
1459
|
-
const
|
|
1459
|
+
const d = it(l, t), h = Xn(l, t), a = l.edges[t] ?? { kind: "line" };
|
|
1460
1460
|
if (a.kind === "cubic") {
|
|
1461
|
-
const p = Fl(
|
|
1461
|
+
const p = Fl(d, a, h, o, i);
|
|
1462
1462
|
return p ? { p1: p.p1, p2: p.p2 } : null;
|
|
1463
1463
|
}
|
|
1464
|
-
return $l(
|
|
1464
|
+
return $l(d, h, o, i);
|
|
1465
1465
|
}
|
|
1466
1466
|
function iu(e, n, t) {
|
|
1467
1467
|
let o = null;
|
|
@@ -1514,7 +1514,7 @@ function lu(e) {
|
|
|
1514
1514
|
function Wl(e, n, t = !1) {
|
|
1515
1515
|
let o = n.x, i = n.y;
|
|
1516
1516
|
if (t) {
|
|
1517
|
-
const
|
|
1517
|
+
const d = n.x - e.x, h = n.y - e.y, a = Math.max(Math.abs(d), Math.abs(h)), p = d === 0 ? h === 0 ? 1 : Math.sign(h) : Math.sign(d), f = h === 0 ? d === 0 ? 1 : Math.sign(d) : Math.sign(h);
|
|
1518
1518
|
o = e.x + p * a, i = e.y + f * a;
|
|
1519
1519
|
}
|
|
1520
1520
|
const r = Math.abs(o - e.x) / 2, l = Math.abs(i - e.y) / 2;
|
|
@@ -1534,7 +1534,7 @@ function cu(e, n, t = !1) {
|
|
|
1534
1534
|
au(Wl(e, n, t))
|
|
1535
1535
|
]);
|
|
1536
1536
|
}
|
|
1537
|
-
const wo = "Text", Qo = 48,
|
|
1537
|
+
const wo = "Text", Qo = 48, Ui = Sc, Vi = Ec, du = 0.5;
|
|
1538
1538
|
function Rr(e) {
|
|
1539
1539
|
var n, t;
|
|
1540
1540
|
return e.kind === "label" && !!((t = (n = e.label) == null ? void 0 : n.text) != null && t.trim());
|
|
@@ -1555,14 +1555,14 @@ function hu(e, n) {
|
|
|
1555
1555
|
const t = ji(e), o = uu();
|
|
1556
1556
|
let i = 0;
|
|
1557
1557
|
if (o) {
|
|
1558
|
-
o.font = `${n}px ${
|
|
1558
|
+
o.font = `${n}px ${Ui}`;
|
|
1559
1559
|
for (const r of t)
|
|
1560
1560
|
i = Math.max(i, o.measureText(r || " ").width);
|
|
1561
1561
|
} else
|
|
1562
|
-
i = t.reduce((l,
|
|
1562
|
+
i = t.reduce((l, d) => Math.max(l, d.length), 1) * n * du;
|
|
1563
1563
|
return {
|
|
1564
1564
|
width: Math.max(i, n * 0.2),
|
|
1565
|
-
height: Math.max(t.length, 1) * n *
|
|
1565
|
+
height: Math.max(t.length, 1) * n * Vi,
|
|
1566
1566
|
lines: t
|
|
1567
1567
|
};
|
|
1568
1568
|
}
|
|
@@ -1632,9 +1632,9 @@ function ku(e, n, t, o) {
|
|
|
1632
1632
|
const i = n.width > 0 ? n.width : Math.max(e.width, 1), r = n.height > 0 ? n.height : Math.max(e.height, 1), l = Math.min(e.width / i, e.height / r);
|
|
1633
1633
|
if (!(l > 0) || !Number.isFinite(l))
|
|
1634
1634
|
return { x: n.x, y: n.y };
|
|
1635
|
-
const
|
|
1635
|
+
const d = e.left + (e.width - i * l) / 2, h = e.top + (e.height - r * l) / 2;
|
|
1636
1636
|
return {
|
|
1637
|
-
x: n.x + (t -
|
|
1637
|
+
x: n.x + (t - d) / l,
|
|
1638
1638
|
y: n.y + (o - h) / l
|
|
1639
1639
|
};
|
|
1640
1640
|
}
|
|
@@ -1642,7 +1642,7 @@ function Iu(e, n) {
|
|
|
1642
1642
|
const t = n.width > 0 ? n.width : Math.max(e.width, 1), o = n.height > 0 ? n.height : Math.max(e.height, 1), i = Math.min(e.width / t, e.height / o);
|
|
1643
1643
|
return i > 0 && Number.isFinite(i) ? i : 1;
|
|
1644
1644
|
}
|
|
1645
|
-
function
|
|
1645
|
+
function Ul(e) {
|
|
1646
1646
|
var i;
|
|
1647
1647
|
const n = (i = e.viewBox) == null ? void 0 : i.baseVal;
|
|
1648
1648
|
if (n && n.width > 0 && n.height > 0)
|
|
@@ -1653,14 +1653,14 @@ function Vl(e) {
|
|
|
1653
1653
|
return o.length !== 4 || o.some((r) => !Number.isFinite(r)) || o[2] <= 0 || o[3] <= 0 ? null : { x: o[0], y: o[1], width: o[2], height: o[3] };
|
|
1654
1654
|
}
|
|
1655
1655
|
function no(e, n, t) {
|
|
1656
|
-
const o =
|
|
1656
|
+
const o = Ul(e);
|
|
1657
1657
|
if (o)
|
|
1658
1658
|
return ku(e.getBoundingClientRect(), o, n, t);
|
|
1659
1659
|
const i = e.getScreenCTM();
|
|
1660
1660
|
return i ? vu(i, n, t) : { x: 0, y: 0 };
|
|
1661
1661
|
}
|
|
1662
1662
|
function bu(e) {
|
|
1663
|
-
const n =
|
|
1663
|
+
const n = Ul(e);
|
|
1664
1664
|
if (n) return Iu(e.getBoundingClientRect(), n);
|
|
1665
1665
|
const t = e.getScreenCTM();
|
|
1666
1666
|
return t ? wu(t) : 1;
|
|
@@ -1672,13 +1672,13 @@ function Li(e, n, t) {
|
|
|
1672
1672
|
y: (e.y - n.y) / o
|
|
1673
1673
|
};
|
|
1674
1674
|
}
|
|
1675
|
-
const
|
|
1675
|
+
const Vl = 0.2, jl = 128;
|
|
1676
1676
|
function Bs(e) {
|
|
1677
|
-
return Math.min(jl, Math.max(
|
|
1677
|
+
return Math.min(jl, Math.max(Vl, e));
|
|
1678
1678
|
}
|
|
1679
1679
|
function xu(e, n) {
|
|
1680
1680
|
return jc(e, n.deltaY, {
|
|
1681
|
-
min:
|
|
1681
|
+
min: Vl,
|
|
1682
1682
|
max: jl
|
|
1683
1683
|
});
|
|
1684
1684
|
}
|
|
@@ -1775,7 +1775,7 @@ function Mu(e, n, t) {
|
|
|
1775
1775
|
return !t || !Xl(e) ? n : Math.min(1, n + 0.1);
|
|
1776
1776
|
}
|
|
1777
1777
|
function ko(e, n) {
|
|
1778
|
-
return n ?
|
|
1778
|
+
return n ? Ua(e) : e;
|
|
1779
1779
|
}
|
|
1780
1780
|
function Du(e) {
|
|
1781
1781
|
var t;
|
|
@@ -1786,17 +1786,17 @@ function Du(e) {
|
|
|
1786
1786
|
function Pu(e, n, t, o = [], i) {
|
|
1787
1787
|
var c;
|
|
1788
1788
|
if (e.kind === "label" || e.kind === "entrance") return null;
|
|
1789
|
-
const r = Du(t), l =
|
|
1789
|
+
const r = Du(t), l = Va(e, n, r);
|
|
1790
1790
|
if (!ja(n, l)) return null;
|
|
1791
|
-
const
|
|
1791
|
+
const d = jn(e.geometry), h = l.size || (n == null ? void 0 : n.size) || xi, a = Xa(
|
|
1792
1792
|
n,
|
|
1793
1793
|
r,
|
|
1794
1794
|
l
|
|
1795
1795
|
), p = a ? void 0 : Ga(n, o), f = a || p ? void 0 : ((c = l.text) == null ? void 0 : c.trim()) || void 0;
|
|
1796
1796
|
return !a && !p && !f ? null : {
|
|
1797
1797
|
shapeId: e.id,
|
|
1798
|
-
x: (
|
|
1799
|
-
y: (
|
|
1798
|
+
x: (d.minX + d.maxX) / 2 + (l.offsetX ?? 0),
|
|
1799
|
+
y: (d.minY + d.maxY) / 2 + (l.offsetY ?? 0),
|
|
1800
1800
|
rotate: l.rotate ?? 0,
|
|
1801
1801
|
size: a ? Za(h, n) : h,
|
|
1802
1802
|
color: Ya(
|
|
@@ -1818,10 +1818,10 @@ function $u(e) {
|
|
|
1818
1818
|
e.assignments.map((r) => [r.shapeId, r])
|
|
1819
1819
|
), o = e.amenities ?? [], i = [];
|
|
1820
1820
|
for (const r of [...e.underlayShapes ?? [], ...e.shapes]) {
|
|
1821
|
-
const l = t.get(r.id),
|
|
1821
|
+
const l = t.get(r.id), d = (l == null ? void 0 : l.retailerId) != null ? n.get(l.retailerId) ?? null : null, h = Pu(
|
|
1822
1822
|
r,
|
|
1823
1823
|
l,
|
|
1824
|
-
|
|
1824
|
+
d,
|
|
1825
1825
|
o,
|
|
1826
1826
|
e.theme
|
|
1827
1827
|
);
|
|
@@ -1840,7 +1840,7 @@ function zu({
|
|
|
1840
1840
|
overlay: e,
|
|
1841
1841
|
imageProxyUrl: n
|
|
1842
1842
|
}) {
|
|
1843
|
-
const { x: t, y: o, rotate: i, size: r, color: l, align:
|
|
1843
|
+
const { x: t, y: o, rotate: i, size: r, color: l, align: d, text: h } = e, a = Fu(e, n), p = i ? `rotate(${i} ${t} ${o})` : void 0;
|
|
1844
1844
|
return /* @__PURE__ */ s(
|
|
1845
1845
|
"g",
|
|
1846
1846
|
{
|
|
@@ -1866,7 +1866,7 @@ function zu({
|
|
|
1866
1866
|
y: o,
|
|
1867
1867
|
size: r,
|
|
1868
1868
|
color: l,
|
|
1869
|
-
align:
|
|
1869
|
+
align: d
|
|
1870
1870
|
}
|
|
1871
1871
|
) : null
|
|
1872
1872
|
}
|
|
@@ -1880,11 +1880,11 @@ function Bu({
|
|
|
1880
1880
|
color: i,
|
|
1881
1881
|
align: r
|
|
1882
1882
|
}) {
|
|
1883
|
-
const l = ji(e),
|
|
1883
|
+
const l = ji(e), d = o * Vi, h = l.length * d;
|
|
1884
1884
|
return /* @__PURE__ */ s(
|
|
1885
1885
|
"text",
|
|
1886
1886
|
{
|
|
1887
|
-
fontFamily:
|
|
1887
|
+
fontFamily: Ui,
|
|
1888
1888
|
fontSize: o,
|
|
1889
1889
|
fill: i,
|
|
1890
1890
|
textAnchor: yl(r),
|
|
@@ -1893,7 +1893,7 @@ function Bu({
|
|
|
1893
1893
|
"tspan",
|
|
1894
1894
|
{
|
|
1895
1895
|
x: n,
|
|
1896
|
-
y: t - h / 2 + (p + 0.5) *
|
|
1896
|
+
y: t - h / 2 + (p + 0.5) * d,
|
|
1897
1897
|
dominantBaseline: "central",
|
|
1898
1898
|
children: a || " "
|
|
1899
1899
|
},
|
|
@@ -1909,7 +1909,7 @@ function Wu({
|
|
|
1909
1909
|
theme: o,
|
|
1910
1910
|
includeBackground: i = !1
|
|
1911
1911
|
}) {
|
|
1912
|
-
const [r, l] = T(null),
|
|
1912
|
+
const [r, l] = T(null), d = xe(
|
|
1913
1913
|
() => t ? [...t].sort().join("\0") : "",
|
|
1914
1914
|
[t]
|
|
1915
1915
|
);
|
|
@@ -1932,9 +1932,9 @@ function Wu({
|
|
|
1932
1932
|
}, [e, n]);
|
|
1933
1933
|
const h = xe(() => {
|
|
1934
1934
|
if (!r) return [];
|
|
1935
|
-
const a =
|
|
1935
|
+
const a = d ? new Set(d.split("\0").filter(Boolean)) : void 0;
|
|
1936
1936
|
return Xc(r, a, o, i);
|
|
1937
|
-
}, [r,
|
|
1937
|
+
}, [r, d, o, i]);
|
|
1938
1938
|
return h.length === 0 ? null : /* @__PURE__ */ s("g", { className: "eyeon-map-canvas__outdoor-svg", pointerEvents: "none", children: h.map((a, p) => /* @__PURE__ */ s(
|
|
1939
1939
|
"path",
|
|
1940
1940
|
{
|
|
@@ -1960,10 +1960,10 @@ const Hs = 28, et = 10;
|
|
|
1960
1960
|
function Gl(e, n = !1) {
|
|
1961
1961
|
return e === "draw-route" || e === "create-route" || e === "create-route-multi" ? !0 : n && (e === "select" || e === "curve");
|
|
1962
1962
|
}
|
|
1963
|
-
function
|
|
1963
|
+
function Uu(e) {
|
|
1964
1964
|
return e.routeDraftPoint != null && e.storeLinkPreview == null ? "clear-only" : "clear-and-undo";
|
|
1965
1965
|
}
|
|
1966
|
-
function
|
|
1966
|
+
function Vu(e, n) {
|
|
1967
1967
|
return e ? { nextDraft: null, start: e, end: n } : { nextDraft: n, start: null, end: null };
|
|
1968
1968
|
}
|
|
1969
1969
|
function hi(e, n) {
|
|
@@ -1972,7 +1972,7 @@ function hi(e, n) {
|
|
|
1972
1972
|
function vr(e) {
|
|
1973
1973
|
return zr.includes(e);
|
|
1974
1974
|
}
|
|
1975
|
-
function
|
|
1975
|
+
function Us(e) {
|
|
1976
1976
|
return (e == null ? void 0 : e.kind) !== "outdoor";
|
|
1977
1977
|
}
|
|
1978
1978
|
function Yl(e) {
|
|
@@ -2013,20 +2013,20 @@ function Ti(e) {
|
|
|
2013
2013
|
function Xu(e) {
|
|
2014
2014
|
return Ti(e);
|
|
2015
2015
|
}
|
|
2016
|
-
function
|
|
2016
|
+
function Vs(e, n) {
|
|
2017
2017
|
return n ? { ...e, curve: n } : e;
|
|
2018
2018
|
}
|
|
2019
2019
|
function Gi(e, n, t, o, i, r) {
|
|
2020
|
-
const l = r.get(e.fromAnchorId),
|
|
2021
|
-
if (l &&
|
|
2022
|
-
const a = qa(l,
|
|
2020
|
+
const l = r.get(e.fromAnchorId), d = r.get(e.toAnchorId), h = Io(e);
|
|
2021
|
+
if (l && d && h) {
|
|
2022
|
+
const a = qa(l, d, h, t);
|
|
2023
2023
|
return {
|
|
2024
2024
|
point: a.point,
|
|
2025
|
-
left:
|
|
2025
|
+
left: Vs(
|
|
2026
2026
|
oo(i(), o, e.fromAnchorId, n, e.kind),
|
|
2027
2027
|
a.left
|
|
2028
2028
|
),
|
|
2029
|
-
right:
|
|
2029
|
+
right: Vs(
|
|
2030
2030
|
oo(i(), o, n, e.toAnchorId, e.kind),
|
|
2031
2031
|
a.right
|
|
2032
2032
|
)
|
|
@@ -2046,13 +2046,13 @@ function Wo(e, n) {
|
|
|
2046
2046
|
return t;
|
|
2047
2047
|
}
|
|
2048
2048
|
function wt(e, n, t, o, i, r = new Map(
|
|
2049
|
-
n.map((
|
|
2049
|
+
n.map((d) => [d.id, d])
|
|
2050
2050
|
), l = "junction") {
|
|
2051
|
-
let
|
|
2051
|
+
let d = null, h = null;
|
|
2052
2052
|
for (const a of n) {
|
|
2053
2053
|
if (o.has(a.id)) continue;
|
|
2054
2054
|
const p = Fn(a, e);
|
|
2055
|
-
p > i || (!
|
|
2055
|
+
p > i || (!d || p < d.distance) && (d = {
|
|
2056
2056
|
type: "junction",
|
|
2057
2057
|
anchorId: a.id,
|
|
2058
2058
|
point: { x: a.x, y: a.y },
|
|
@@ -2074,7 +2074,7 @@ function wt(e, n, t, o, i, r = new Map(
|
|
|
2074
2074
|
distance: c.distance
|
|
2075
2075
|
});
|
|
2076
2076
|
}
|
|
2077
|
-
return l === "edge" ? h :
|
|
2077
|
+
return l === "edge" ? h : d ?? h;
|
|
2078
2078
|
}
|
|
2079
2079
|
function oo(e, n, t, o, i = "walk") {
|
|
2080
2080
|
return {
|
|
@@ -2090,7 +2090,7 @@ function oo(e, n, t, o, i = "walk") {
|
|
|
2090
2090
|
}
|
|
2091
2091
|
function Gu(e) {
|
|
2092
2092
|
const { shape: n, anchors: t, allocId: o } = e, i = e.point ?? ju(n), r = t.find(
|
|
2093
|
-
(
|
|
2093
|
+
(d) => d.shapeId === n.id && Fn(d, i) <= so
|
|
2094
2094
|
);
|
|
2095
2095
|
if (r) return { ops: [], anchorId: r.id };
|
|
2096
2096
|
const l = {
|
|
@@ -2105,7 +2105,7 @@ function Gu(e) {
|
|
|
2105
2105
|
return { ops: [{ op: "upsert_anchor", anchor: l }], anchorId: l.id };
|
|
2106
2106
|
}
|
|
2107
2107
|
function Yu(e) {
|
|
2108
|
-
const { shape: n, anchors: t, edges: o, mapId: i, from: r, drop: l, maxDist:
|
|
2108
|
+
const { shape: n, anchors: t, edges: o, mapId: i, from: r, drop: l, maxDist: d, allocId: h } = e, a = [];
|
|
2109
2109
|
let p = t.find(
|
|
2110
2110
|
(R) => R.shapeId === n.id && Fn(R, r) <= so
|
|
2111
2111
|
) ?? null;
|
|
@@ -2123,7 +2123,7 @@ function Yu(e) {
|
|
|
2123
2123
|
t,
|
|
2124
2124
|
o,
|
|
2125
2125
|
/* @__PURE__ */ new Set([p.id]),
|
|
2126
|
-
|
|
2126
|
+
d
|
|
2127
2127
|
);
|
|
2128
2128
|
if (!f || Fn(p, f.point) <= so) return a;
|
|
2129
2129
|
let c;
|
|
@@ -2165,7 +2165,7 @@ function Yu(e) {
|
|
|
2165
2165
|
}), a;
|
|
2166
2166
|
}
|
|
2167
2167
|
function Zu(e) {
|
|
2168
|
-
const { anchor: n, anchors: t, edges: o, mapId: i, drop: r, maxDist: l, allocId:
|
|
2168
|
+
const { anchor: n, anchors: t, edges: o, mapId: i, drop: r, maxDist: l, allocId: d } = e, h = o.filter(
|
|
2169
2169
|
(c) => c.fromAnchorId === n.id || c.toAnchorId === n.id
|
|
2170
2170
|
);
|
|
2171
2171
|
if (n.shapeId != null || h.length > 1) return [];
|
|
@@ -2194,7 +2194,7 @@ function Zu(e) {
|
|
|
2194
2194
|
n.id,
|
|
2195
2195
|
a.anchorId,
|
|
2196
2196
|
o,
|
|
2197
|
-
|
|
2197
|
+
d
|
|
2198
2198
|
), _ = [
|
|
2199
2199
|
{
|
|
2200
2200
|
op: "upsert_anchor",
|
|
@@ -2210,7 +2210,7 @@ function Zu(e) {
|
|
|
2210
2210
|
n.id,
|
|
2211
2211
|
a.point,
|
|
2212
2212
|
i,
|
|
2213
|
-
|
|
2213
|
+
d,
|
|
2214
2214
|
new Map(t.map((c) => [c.id, c]))
|
|
2215
2215
|
);
|
|
2216
2216
|
return [
|
|
@@ -2230,21 +2230,21 @@ function Jl(e, n, t, o, i) {
|
|
|
2230
2230
|
};
|
|
2231
2231
|
}
|
|
2232
2232
|
function Ju(e) {
|
|
2233
|
-
const { levelId: n, mapId: t, edge: o, point: i, allocId: r, anchors: l = [] } = e,
|
|
2233
|
+
const { levelId: n, mapId: t, edge: o, point: i, allocId: r, anchors: l = [] } = e, d = r(), h = Gi(
|
|
2234
2234
|
o,
|
|
2235
|
-
|
|
2235
|
+
d,
|
|
2236
2236
|
i,
|
|
2237
2237
|
t,
|
|
2238
2238
|
r,
|
|
2239
2239
|
new Map(l.map((a) => [a.id, a]))
|
|
2240
2240
|
);
|
|
2241
2241
|
return {
|
|
2242
|
-
junctionId:
|
|
2242
|
+
junctionId: d,
|
|
2243
2243
|
ops: [
|
|
2244
2244
|
{
|
|
2245
2245
|
op: "upsert_anchor",
|
|
2246
2246
|
anchor: {
|
|
2247
|
-
id:
|
|
2247
|
+
id: d,
|
|
2248
2248
|
levelId: n,
|
|
2249
2249
|
shapeId: null,
|
|
2250
2250
|
kind: "junction",
|
|
@@ -2278,11 +2278,11 @@ function ql(e, n) {
|
|
|
2278
2278
|
)
|
|
2279
2279
|
], l = r.length === 2 && !rr(n, r[0], r[1]) ? [r[0], r[1]] : null;
|
|
2280
2280
|
l && i.push({ fromAnchorId: l[0], toAnchorId: l[1] });
|
|
2281
|
-
const
|
|
2281
|
+
const d = [e], h = /* @__PURE__ */ new Set([e]);
|
|
2282
2282
|
for (const a of t)
|
|
2283
2283
|
for (const p of [a.fromAnchorId, a.toAnchorId])
|
|
2284
|
-
h.has(p) || (h.add(p), Xi(p, i) ||
|
|
2285
|
-
return { incident: t, heal: l, removedAnchorIds:
|
|
2284
|
+
h.has(p) || (h.add(p), Xi(p, i) || d.push(p));
|
|
2285
|
+
return { incident: t, heal: l, removedAnchorIds: d };
|
|
2286
2286
|
}
|
|
2287
2287
|
function Qu(e, n) {
|
|
2288
2288
|
return ql(e, n).removedAnchorIds;
|
|
@@ -2291,17 +2291,17 @@ function eh(e, n, t, o) {
|
|
|
2291
2291
|
const { incident: i, heal: r, removedAnchorIds: l } = ql(
|
|
2292
2292
|
e,
|
|
2293
2293
|
t
|
|
2294
|
-
),
|
|
2294
|
+
), d = i.map((h) => ({
|
|
2295
2295
|
op: "delete_edge",
|
|
2296
2296
|
edgeId: h.id
|
|
2297
2297
|
}));
|
|
2298
|
-
r &&
|
|
2298
|
+
r && d.push({
|
|
2299
2299
|
op: "upsert_edge",
|
|
2300
2300
|
edge: oo(o(), n, r[0], r[1])
|
|
2301
2301
|
});
|
|
2302
2302
|
for (const h of l)
|
|
2303
|
-
|
|
2304
|
-
return
|
|
2303
|
+
d.push({ op: "delete_anchor", anchorId: h });
|
|
2304
|
+
return d;
|
|
2305
2305
|
}
|
|
2306
2306
|
const pi = 9, js = 11, Xs = 16, fi = 2, nh = "#ea580c", Ko = 7, Gs = 9, Kt = 14, nt = 2, kr = 5, Ir = 6, Ht = 12, br = 2.25, xr = 4, wr = 4, th = 4, Ys = 7, At = 16;
|
|
2307
2307
|
function oh(e, n) {
|
|
@@ -2318,7 +2318,7 @@ function Zs(e, n) {
|
|
|
2318
2318
|
function Nr(e) {
|
|
2319
2319
|
return { "--map-stroke-width": e };
|
|
2320
2320
|
}
|
|
2321
|
-
function
|
|
2321
|
+
function Vn({
|
|
2322
2322
|
cx: e,
|
|
2323
2323
|
cy: n,
|
|
2324
2324
|
r: t,
|
|
@@ -2326,7 +2326,7 @@ function Un({
|
|
|
2326
2326
|
fill: i,
|
|
2327
2327
|
stroke: r,
|
|
2328
2328
|
strokeWidth: l,
|
|
2329
|
-
cursor:
|
|
2329
|
+
cursor: d,
|
|
2330
2330
|
fillOpacity: h = 1,
|
|
2331
2331
|
strokeDasharray: a,
|
|
2332
2332
|
onPointerDown: p,
|
|
@@ -2342,7 +2342,7 @@ function Un({
|
|
|
2342
2342
|
onPointerLeave: c,
|
|
2343
2343
|
onMouseDown: (C) => C.preventDefault(),
|
|
2344
2344
|
onDoubleClick: _,
|
|
2345
|
-
style:
|
|
2345
|
+
style: d ? { cursor: d } : void 0,
|
|
2346
2346
|
children: /* @__PURE__ */ s("g", { transform: `translate(${e} ${n})`, children: /* @__PURE__ */ v("g", { className: "eyeon-map-screen-const", children: [
|
|
2347
2347
|
/* @__PURE__ */ s("circle", { cx: 0, cy: 0, r: o, fill: "transparent" }),
|
|
2348
2348
|
/* @__PURE__ */ s(
|
|
@@ -2390,7 +2390,7 @@ const Ql = pl.forwardRef(
|
|
|
2390
2390
|
edges: i,
|
|
2391
2391
|
assignments: r,
|
|
2392
2392
|
retailers: l = [],
|
|
2393
|
-
amenities:
|
|
2393
|
+
amenities: d = [],
|
|
2394
2394
|
theme: h,
|
|
2395
2395
|
tool: a,
|
|
2396
2396
|
selectedShapeId: p,
|
|
@@ -2414,7 +2414,7 @@ const Ql = pl.forwardRef(
|
|
|
2414
2414
|
onCreateRouteSegment: Ee,
|
|
2415
2415
|
onLinkRouteAnchors: ne,
|
|
2416
2416
|
onInsertRouteJunction: ye,
|
|
2417
|
-
onDeleteRouteAnchor:
|
|
2417
|
+
onDeleteRouteAnchor: U,
|
|
2418
2418
|
onDeleteRouteEdge: ln,
|
|
2419
2419
|
onConnectShapeToRoute: Q,
|
|
2420
2420
|
onConnectRouteAnchorToRoute: Re,
|
|
@@ -2445,47 +2445,47 @@ const Ql = pl.forwardRef(
|
|
|
2445
2445
|
un != null || Ce.length > 0 || De.length > 0
|
|
2446
2446
|
);
|
|
2447
2447
|
}, [De.length, W, Ce.length, un]), ue(() => {
|
|
2448
|
-
tn != null && (o.some((
|
|
2448
|
+
tn != null && (o.some((u) => u.id === tn) || (yn(null), Te(null)));
|
|
2449
2449
|
}, [o, tn]);
|
|
2450
|
-
const [Ke, _n] = T(null), [Ye, jt] = T(null), [Jn, Xt] = T({ x: 0, y: 0 }), [wn, Sn] = T(null), [In, rn] = T(null), [F, bn] = T(null), [at, qn] = T(null), [Xe,
|
|
2450
|
+
const [Ke, _n] = T(null), [Ye, jt] = T(null), [Jn, Xt] = T({ x: 0, y: 0 }), [wn, Sn] = T(null), [In, rn] = T(null), [F, bn] = T(null), [at, qn] = T(null), [Xe, Ve] = T(null), [Mt, It] = T(null), [ho, ct] = T(null), [fn, dt] = T(null), [Et, po] = T(
|
|
2451
2451
|
null
|
|
2452
|
-
), Oo = M, bt = (
|
|
2453
|
-
po(null), Oo(
|
|
2452
|
+
), Oo = M, bt = (u) => {
|
|
2453
|
+
po(null), Oo(u);
|
|
2454
2454
|
};
|
|
2455
2455
|
ue(() => {
|
|
2456
|
-
Et != null && (i.some((
|
|
2456
|
+
Et != null && (i.some((u) => u.id === Et) || po(null));
|
|
2457
2457
|
}, [i, Et]);
|
|
2458
|
-
const Qn = (fn == null ? void 0 : fn.type) === "edge" ? { edgeId: fn.edgeId, point: fn.point } : null, [ut, Dt] = T(null), ht = ae(null), [Kr, Ao] = T(!1), D = (
|
|
2458
|
+
const Qn = (fn == null ? void 0 : fn.type) === "edge" ? { edgeId: fn.edgeId, point: fn.point } : null, [ut, Dt] = T(null), ht = ae(null), [Kr, Ao] = T(!1), D = (u) => Nu(u, Fe.current.zoom, _t), ir = (u, g) => {
|
|
2459
2459
|
const k = Ge.current;
|
|
2460
2460
|
k && (k.setAttribute(
|
|
2461
2461
|
"transform",
|
|
2462
|
-
`translate(${
|
|
2462
|
+
`translate(${u.x}, ${u.y}) scale(${g})`
|
|
2463
2463
|
), k.style.setProperty(
|
|
2464
2464
|
"--map-handle-scale",
|
|
2465
2465
|
String(Cu(St.current, g))
|
|
2466
2466
|
));
|
|
2467
|
-
}, Ro = (
|
|
2468
|
-
Gt(), Fe.current = { pan:
|
|
2467
|
+
}, Ro = (u, g) => {
|
|
2468
|
+
Gt(), Fe.current = { pan: u, zoom: g }, Yn(u), Ln(g);
|
|
2469
2469
|
}, Hr = () => {
|
|
2470
2470
|
Dn.current = null;
|
|
2471
|
-
const { pan:
|
|
2472
|
-
ir(
|
|
2471
|
+
const { pan: u, zoom: g } = Fe.current;
|
|
2472
|
+
ir(u, g);
|
|
2473
2473
|
}, sr = () => {
|
|
2474
2474
|
On.current = null;
|
|
2475
|
-
const { pan:
|
|
2476
|
-
Yn(
|
|
2477
|
-
},
|
|
2475
|
+
const { pan: u, zoom: g } = Fe.current;
|
|
2476
|
+
Yn(u), Ln(g);
|
|
2477
|
+
}, Ur = () => {
|
|
2478
2478
|
Dn.current == null && (Dn.current = requestAnimationFrame(Hr)), On.current != null && clearTimeout(On.current), On.current = setTimeout(sr, 80);
|
|
2479
2479
|
}, Gt = () => {
|
|
2480
2480
|
Dn.current != null && (cancelAnimationFrame(Dn.current), Dn.current = null), On.current != null && (clearTimeout(On.current), On.current = null);
|
|
2481
2481
|
}, Pt = ae(null), vn = () => {
|
|
2482
2482
|
Pt.current != null && (cancelAnimationFrame(Pt.current), Pt.current = null);
|
|
2483
|
-
}, fo = (
|
|
2483
|
+
}, fo = (u, g) => {
|
|
2484
2484
|
Gt(), vn();
|
|
2485
2485
|
const k = {
|
|
2486
2486
|
pan: { ...Fe.current.pan },
|
|
2487
2487
|
zoom: Fe.current.zoom
|
|
2488
|
-
}, N = { pan:
|
|
2488
|
+
}, N = { pan: u, zoom: g };
|
|
2489
2489
|
if (k.zoom === N.zoom && k.pan.x === N.pan.x && k.pan.y === N.pan.y)
|
|
2490
2490
|
return;
|
|
2491
2491
|
const b = performance.now(), L = (Z) => {
|
|
@@ -2497,24 +2497,24 @@ const Ql = pl.forwardRef(
|
|
|
2497
2497
|
Pt.current = null;
|
|
2498
2498
|
};
|
|
2499
2499
|
Pt.current = requestAnimationFrame(L);
|
|
2500
|
-
}, Lo = (
|
|
2500
|
+
}, Lo = (u) => {
|
|
2501
2501
|
const g = X.current;
|
|
2502
2502
|
if (!g) return;
|
|
2503
2503
|
const k = g.getBoundingClientRect(), N = no(
|
|
2504
2504
|
g,
|
|
2505
2505
|
k.left + k.width / 2,
|
|
2506
2506
|
k.top + k.height / 2
|
|
2507
|
-
), { pan: b, zoom: L } = Fe.current, Z = Bs(L *
|
|
2507
|
+
), { pan: b, zoom: L } = Fe.current, Z = Bs(L * u);
|
|
2508
2508
|
Z !== L && fo(Ws(N, b, L, Z), Z);
|
|
2509
2509
|
};
|
|
2510
2510
|
Ma(pe, () => ({
|
|
2511
2511
|
consumeRouteUndo: () => {
|
|
2512
|
-
const
|
|
2513
|
-
if (
|
|
2514
|
-
return gn(
|
|
2512
|
+
const u = kd(Ce);
|
|
2513
|
+
if (u.consumed)
|
|
2514
|
+
return gn(u.points), lt(null), Ne(null), u.points.length === 0 && Te(null), "clear-only";
|
|
2515
2515
|
if (De.length > 0)
|
|
2516
2516
|
return dn([]), K(!1), "clear-only";
|
|
2517
|
-
const g =
|
|
2517
|
+
const g = Uu({
|
|
2518
2518
|
routeDraftPoint: un,
|
|
2519
2519
|
storeLinkPreview: Pe
|
|
2520
2520
|
});
|
|
@@ -2533,108 +2533,108 @@ const Ql = pl.forwardRef(
|
|
|
2533
2533
|
},
|
|
2534
2534
|
[]
|
|
2535
2535
|
), ue(() => {
|
|
2536
|
-
dn([]), K(!1), gn([]), yn(null), Cn(null), kt(null), Te(null), _n(null), It(null), ct(null), jt(null), Sn(null), z(null), _e(null), We(null), Oe(null), bn(null), qn(null), dt(null),
|
|
2536
|
+
dn([]), K(!1), gn([]), yn(null), Cn(null), kt(null), Te(null), _n(null), It(null), ct(null), jt(null), Sn(null), z(null), _e(null), We(null), Oe(null), bn(null), qn(null), dt(null), Ve(null), Bn(null), eo(a) || (st(null), Zn(null)), lt(null), Xt({ x: 0, y: 0 });
|
|
2537
2537
|
}, [a]), ue(() => {
|
|
2538
|
-
rn(null), bn(null), qn(null),
|
|
2538
|
+
rn(null), bn(null), qn(null), Ve(null), Dt(null), It(null), jt(null), Sn(null), Xt({ x: 0, y: 0 });
|
|
2539
2539
|
}, [p]), ue(() => {
|
|
2540
2540
|
on(), _n(null), dt(null), Dt(null), It(null), ct(null);
|
|
2541
2541
|
}, [n == null ? void 0 : n.id]);
|
|
2542
|
-
const Wn = Qa(n == null ? void 0 : n.sourceViewbox, _), ar = C ?? w ?? ((n == null ? void 0 : n.kind) === "outdoor" ? c : null),
|
|
2542
|
+
const Wn = Qa(n == null ? void 0 : n.sourceViewbox, _), ar = C ?? w ?? ((n == null ? void 0 : n.kind) === "outdoor" ? c : null), Vr = xe(
|
|
2543
2543
|
() => ec([...x, ...t], {
|
|
2544
2544
|
omitStaticLayers: S
|
|
2545
2545
|
}),
|
|
2546
2546
|
[x, t, S]
|
|
2547
2547
|
);
|
|
2548
2548
|
bs(() => {
|
|
2549
|
-
const
|
|
2550
|
-
if (!
|
|
2549
|
+
const u = X.current;
|
|
2550
|
+
if (!u) return;
|
|
2551
2551
|
const g = () => {
|
|
2552
|
-
const N = bu(
|
|
2552
|
+
const N = bu(u);
|
|
2553
2553
|
vt((b) => Math.abs(b - N) < 1e-6 ? b : N);
|
|
2554
2554
|
};
|
|
2555
2555
|
g();
|
|
2556
2556
|
const k = new ResizeObserver(g);
|
|
2557
|
-
return k.observe(
|
|
2557
|
+
return k.observe(u), () => k.disconnect();
|
|
2558
2558
|
}, [n == null ? void 0 : n.id, Wn.x, Wn.y, Wn.width, Wn.height]);
|
|
2559
2559
|
const Kn = xe(
|
|
2560
|
-
() => t.filter((
|
|
2560
|
+
() => t.filter((u) => rh(u, S)),
|
|
2561
2561
|
[t, S]
|
|
2562
2562
|
), To = xe(
|
|
2563
|
-
() => Kn.filter((
|
|
2563
|
+
() => Kn.filter((u) => u.kind === "void"),
|
|
2564
2564
|
[Kn]
|
|
2565
|
-
), y = `eyeon-opening-clip-${(n == null ? void 0 : n.id) ?? "none"}`, I = `eyeon-opening-hatch-${(n == null ? void 0 : n.id) ?? "none"}`, m = Kn.find((
|
|
2566
|
-
() => Kn.filter((
|
|
2567
|
-
id:
|
|
2568
|
-
kind:
|
|
2569
|
-
style:
|
|
2570
|
-
geometry:
|
|
2565
|
+
), y = `eyeon-opening-clip-${(n == null ? void 0 : n.id) ?? "none"}`, I = `eyeon-opening-hatch-${(n == null ? void 0 : n.id) ?? "none"}`, m = Kn.find((u) => u.id === p) ?? null, O = xe(() => m ? Ye && Ye.shapeId === m.id ? As(Ye.originGeometry, Jn.x, Jn.y) : m.geometry : null, [m, Ye, Jn]), P = xe(
|
|
2566
|
+
() => Kn.filter((u) => Ts(u.kind) && !jo(u)).map((u) => ({
|
|
2567
|
+
id: u.id,
|
|
2568
|
+
kind: u.kind,
|
|
2569
|
+
style: u.style,
|
|
2570
|
+
geometry: u.geometry
|
|
2571
2571
|
})),
|
|
2572
2572
|
[Kn]
|
|
2573
2573
|
), de = xe(() => {
|
|
2574
|
-
const
|
|
2574
|
+
const u = [];
|
|
2575
2575
|
for (const g of Kn)
|
|
2576
2576
|
if (!jo(g))
|
|
2577
|
-
for (const k of
|
|
2578
|
-
|
|
2579
|
-
return
|
|
2580
|
-
}, [Kn]), ve = (
|
|
2581
|
-
(k) => ai(k.geometry,
|
|
2582
|
-
), Tn = (
|
|
2577
|
+
for (const k of Ue(g.geometry))
|
|
2578
|
+
u.push(...k.anchors);
|
|
2579
|
+
return u;
|
|
2580
|
+
}, [Kn]), ve = (u, g) => _r(P, u, g) ? !0 : P.some(
|
|
2581
|
+
(k) => ai(k.geometry, u, g) != null
|
|
2582
|
+
), Tn = (u) => {
|
|
2583
2583
|
const g = Ce.length >= 3 ? [Ce[0]] : [];
|
|
2584
2584
|
return iu(
|
|
2585
|
-
|
|
2585
|
+
u,
|
|
2586
2586
|
[...g, ...de],
|
|
2587
2587
|
D(At)
|
|
2588
2588
|
);
|
|
2589
|
-
}, Pn = (
|
|
2590
|
-
if (!
|
|
2591
|
-
Ae == null || Ae(
|
|
2589
|
+
}, Pn = (u) => {
|
|
2590
|
+
if (!u.length) return;
|
|
2591
|
+
Ae == null || Ae(u);
|
|
2592
2592
|
const g = new Set(
|
|
2593
|
-
|
|
2593
|
+
u.filter((k) => k.action === "delete").map((k) => k.shapeId)
|
|
2594
2594
|
);
|
|
2595
2595
|
if (p != null && g.has(p)) {
|
|
2596
|
-
const k =
|
|
2596
|
+
const k = u.find((N) => N.action === "update");
|
|
2597
2597
|
Ie(k && k.action === "update" ? k.shapeId : null);
|
|
2598
2598
|
}
|
|
2599
|
-
}, Nn = (
|
|
2599
|
+
}, Nn = (u) => {
|
|
2600
2600
|
if (!eo(a) || j) return !1;
|
|
2601
|
-
const g = Tt ?? _r(P,
|
|
2602
|
-
return g ? hn ?
|
|
2603
|
-
}, An = (
|
|
2604
|
-
if (Nn(
|
|
2601
|
+
const g = Tt ?? _r(P, u, D(At), hn);
|
|
2602
|
+
return g ? hn ? Vo(hn, g) ? (st(null), Zn(null), !0) : (Pn(ou(P, hn, g)), st(null), Bn(null), Zn(null), !0) : (st(g), Ie(g.shapeId), Qt(a) && (ce == null || ce("select")), !0) : !1;
|
|
2603
|
+
}, An = (u) => {
|
|
2604
|
+
if (Nn(u)) return !0;
|
|
2605
2605
|
if (!Qt(a) || j) return !1;
|
|
2606
|
-
const g = D(At), k = D(Kt), N = Ps(P,
|
|
2607
|
-
return N && !ve(
|
|
2606
|
+
const g = D(At), k = D(Kt), N = Ps(P, u, k);
|
|
2607
|
+
return N && !ve(u, g) ? (Pn(
|
|
2608
2608
|
tu(P, N, D(Ys))
|
|
2609
2609
|
), st(null), Bn(null), Zn(null), Ie(N.shapeId), !0) : hn ? (st(null), Zn(null), !0) : !1;
|
|
2610
|
-
}, Ze = (
|
|
2610
|
+
}, Ze = (u, g) => {
|
|
2611
2611
|
const k = X.current;
|
|
2612
2612
|
if (!k) return { x: 0, y: 0 };
|
|
2613
2613
|
const { pan: N, zoom: b } = Fe.current;
|
|
2614
2614
|
return Li(
|
|
2615
|
-
no(k,
|
|
2615
|
+
no(k, u, g),
|
|
2616
2616
|
N,
|
|
2617
2617
|
b
|
|
2618
2618
|
);
|
|
2619
|
-
}, pt = (
|
|
2619
|
+
}, pt = (u, g) => {
|
|
2620
2620
|
var N;
|
|
2621
2621
|
const k = (N = en.current) == null ? void 0 : N.getBoundingClientRect();
|
|
2622
2622
|
k && Dt({
|
|
2623
|
-
x:
|
|
2624
|
-
y:
|
|
2623
|
+
x: u.clientX - k.left,
|
|
2624
|
+
y: u.clientY - k.top,
|
|
2625
2625
|
text: Hu(g)
|
|
2626
2626
|
});
|
|
2627
|
-
}, Ot = (
|
|
2628
|
-
const b = Hd(
|
|
2629
|
-
ee(
|
|
2627
|
+
}, Ot = (u, g, k, N) => {
|
|
2628
|
+
const b = Hd(u.geometry, g, k, N);
|
|
2629
|
+
ee(u.id, b), rn({
|
|
2630
2630
|
polygonIndex: g,
|
|
2631
2631
|
vertexIndex: k + 1
|
|
2632
2632
|
}), bn(null), qn(null);
|
|
2633
|
-
}, cr = (
|
|
2633
|
+
}, cr = (u, g, k, N) => {
|
|
2634
2634
|
var b, L;
|
|
2635
|
-
m && (N.stopPropagation(), (L = (b = N.currentTarget).setPointerCapture) == null || L.call(b, N.pointerId),
|
|
2635
|
+
m && (N.stopPropagation(), (L = (b = N.currentTarget).setPointerCapture) == null || L.call(b, N.pointerId), Ve({
|
|
2636
2636
|
shapeId: m.id,
|
|
2637
|
-
ringIndex:
|
|
2637
|
+
ringIndex: u,
|
|
2638
2638
|
edgeIndex: g,
|
|
2639
2639
|
start: Ze(N.clientX, N.clientY),
|
|
2640
2640
|
clientX: N.clientX,
|
|
@@ -2643,16 +2643,16 @@ const Ql = pl.forwardRef(
|
|
|
2643
2643
|
originGeometry: O ?? m.geometry,
|
|
2644
2644
|
dragging: !1
|
|
2645
2645
|
}));
|
|
2646
|
-
}, dr = (
|
|
2646
|
+
}, dr = (u, g) => {
|
|
2647
2647
|
if (!m) return;
|
|
2648
|
-
const k = Ls(m.geometry,
|
|
2648
|
+
const k = Ls(m.geometry, u, g);
|
|
2649
2649
|
k !== m.geometry && (ee(m.id, k), rn(null), bn(null), Sn(null));
|
|
2650
|
-
}, rs = (
|
|
2650
|
+
}, rs = (u, g) => {
|
|
2651
2651
|
var N, b;
|
|
2652
2652
|
if (!m || !O) return !1;
|
|
2653
2653
|
const k = ai(
|
|
2654
2654
|
O,
|
|
2655
|
-
|
|
2655
|
+
u,
|
|
2656
2656
|
D(Kt)
|
|
2657
2657
|
);
|
|
2658
2658
|
return !k || _r(P, k.point, D(4)) ? !1 : g.detail >= 2 ? (dr(k.polygonIndex, k.vertexIndex), !0) : (rn({
|
|
@@ -2664,37 +2664,37 @@ const Ql = pl.forwardRef(
|
|
|
2664
2664
|
polygonIndex: k.polygonIndex,
|
|
2665
2665
|
vertexIndex: k.vertexIndex
|
|
2666
2666
|
}), (b = (N = g.currentTarget).setPointerCapture) == null || b.call(N, g.pointerId), !0);
|
|
2667
|
-
}, Mo = (
|
|
2667
|
+
}, Mo = (u, g) => {
|
|
2668
2668
|
if (!m) return;
|
|
2669
|
-
const k = Rs(m.geometry,
|
|
2669
|
+
const k = Rs(m.geometry, u, g);
|
|
2670
2670
|
k !== m.geometry && (ee(m.id, k), bn(null), Sn(null));
|
|
2671
|
-
}, is = (
|
|
2671
|
+
}, is = (u, g, k, N) => {
|
|
2672
2672
|
if (!m) return;
|
|
2673
|
-
const b = Ze(k, N), L =
|
|
2673
|
+
const b = Ze(k, N), L = Ue(O ?? m.geometry)[u];
|
|
2674
2674
|
qn({
|
|
2675
|
-
ringIndex:
|
|
2675
|
+
ringIndex: u,
|
|
2676
2676
|
edgeIndex: g,
|
|
2677
2677
|
point: L ? Os(L, g, b) : b
|
|
2678
2678
|
});
|
|
2679
2679
|
}, kn = xe(
|
|
2680
|
-
() => new Map(o.map((
|
|
2680
|
+
() => new Map(o.map((u) => [u.id, u])),
|
|
2681
2681
|
[o]
|
|
2682
2682
|
), fa = xe(() => {
|
|
2683
|
-
const
|
|
2683
|
+
const u = /* @__PURE__ */ new Set();
|
|
2684
2684
|
return i.forEach((g) => {
|
|
2685
|
-
|
|
2686
|
-
}),
|
|
2685
|
+
u.add(g.fromAnchorId), u.add(g.toAnchorId);
|
|
2686
|
+
}), u;
|
|
2687
2687
|
}, [i]), ss = xe(() => {
|
|
2688
|
-
const
|
|
2688
|
+
const u = /* @__PURE__ */ new Map();
|
|
2689
2689
|
return i.forEach((g) => {
|
|
2690
|
-
|
|
2690
|
+
u.set(
|
|
2691
2691
|
g.fromAnchorId,
|
|
2692
|
-
(
|
|
2693
|
-
),
|
|
2692
|
+
(u.get(g.fromAnchorId) ?? 0) + 1
|
|
2693
|
+
), u.set(
|
|
2694
2694
|
g.toAnchorId,
|
|
2695
|
-
(
|
|
2695
|
+
(u.get(g.toAnchorId) ?? 0) + 1
|
|
2696
2696
|
);
|
|
2697
|
-
}),
|
|
2697
|
+
}), u;
|
|
2698
2698
|
}, [i]), ls = xe(
|
|
2699
2699
|
() => E == null ? /* @__PURE__ */ new Set() : Zl(E, i),
|
|
2700
2700
|
[E, i]
|
|
@@ -2705,27 +2705,27 @@ const Ql = pl.forwardRef(
|
|
|
2705
2705
|
ls,
|
|
2706
2706
|
D(et),
|
|
2707
2707
|
kn
|
|
2708
|
-
) : null,
|
|
2708
|
+
) : null, Un = xe(() => {
|
|
2709
2709
|
if (E == null || !J) return kn;
|
|
2710
|
-
const
|
|
2711
|
-
if (!
|
|
2710
|
+
const u = kn.get(E);
|
|
2711
|
+
if (!u) return kn;
|
|
2712
2712
|
const g = new Map(kn);
|
|
2713
2713
|
return g.set(E, {
|
|
2714
|
-
...
|
|
2714
|
+
...u,
|
|
2715
2715
|
...(Hn == null ? void 0 : Hn.point) ?? J
|
|
2716
2716
|
}), g;
|
|
2717
2717
|
}, [kn, E, J, Hn]), as = xe(
|
|
2718
|
-
() => i.map((
|
|
2719
|
-
const g =
|
|
2718
|
+
() => i.map((u) => {
|
|
2719
|
+
const g = Un.get(u.fromAnchorId), k = Un.get(u.toAnchorId);
|
|
2720
2720
|
return !g || !k ? "" : xs(
|
|
2721
2721
|
g,
|
|
2722
2722
|
k,
|
|
2723
|
-
qr(
|
|
2723
|
+
qr(u, kn, Un)
|
|
2724
2724
|
);
|
|
2725
2725
|
}).filter(Boolean).join(" "),
|
|
2726
|
-
[kn,
|
|
2726
|
+
[kn, Un, i]
|
|
2727
2727
|
), jr = xe(
|
|
2728
|
-
() => new Map(r.map((
|
|
2728
|
+
() => new Map(r.map((u) => [u.shapeId, u])),
|
|
2729
2729
|
[r]
|
|
2730
2730
|
), ma = xe(
|
|
2731
2731
|
() => he ? $u({
|
|
@@ -2733,11 +2733,11 @@ const Ql = pl.forwardRef(
|
|
|
2733
2733
|
underlayShapes: x,
|
|
2734
2734
|
assignments: r,
|
|
2735
2735
|
retailers: l,
|
|
2736
|
-
amenities:
|
|
2736
|
+
amenities: d,
|
|
2737
2737
|
theme: h
|
|
2738
2738
|
}) : [],
|
|
2739
2739
|
[
|
|
2740
|
-
|
|
2740
|
+
d,
|
|
2741
2741
|
r,
|
|
2742
2742
|
Kn,
|
|
2743
2743
|
l,
|
|
@@ -2745,8 +2745,8 @@ const Ql = pl.forwardRef(
|
|
|
2745
2745
|
x,
|
|
2746
2746
|
he
|
|
2747
2747
|
]
|
|
2748
|
-
), ga = (
|
|
2749
|
-
const k = Ze(
|
|
2748
|
+
), ga = (u, g) => {
|
|
2749
|
+
const k = Ze(u, g);
|
|
2750
2750
|
(un || Pe || mn(a) && tn != null) && Te(k), dt(
|
|
2751
2751
|
wt(
|
|
2752
2752
|
k,
|
|
@@ -2766,7 +2766,7 @@ const Ql = pl.forwardRef(
|
|
|
2766
2766
|
Je("unit", Jo([Ce])), gn([]), Te(null), lt(null);
|
|
2767
2767
|
};
|
|
2768
2768
|
ue(() => {
|
|
2769
|
-
const
|
|
2769
|
+
const u = (k) => {
|
|
2770
2770
|
if (k.key === "Shift") {
|
|
2771
2771
|
const b = k.type === "keydown";
|
|
2772
2772
|
vo(a) && K(b), b || Ne(null);
|
|
@@ -2778,11 +2778,11 @@ const Ql = pl.forwardRef(
|
|
|
2778
2778
|
}, g = () => {
|
|
2779
2779
|
ze.current = !1, Se(!1);
|
|
2780
2780
|
};
|
|
2781
|
-
return window.addEventListener("keydown",
|
|
2782
|
-
window.removeEventListener("keydown",
|
|
2781
|
+
return window.addEventListener("keydown", u), window.addEventListener("keyup", u), window.addEventListener("blur", g), () => {
|
|
2782
|
+
window.removeEventListener("keydown", u), window.removeEventListener("keyup", u), window.removeEventListener("blur", g);
|
|
2783
2783
|
};
|
|
2784
2784
|
}, [a]), ue(() => {
|
|
2785
|
-
const
|
|
2785
|
+
const u = (g) => {
|
|
2786
2786
|
if (_o(a) && (g.key === "Enter" ? (g.preventDefault(), cs()) : g.key === "Escape" && (gn([]), Te(null), lt(null), Ne(null))), g.key === "Escape" && !Ar(g.target) && hn != null) {
|
|
2787
2787
|
g.preventDefault(), st(null), Bn(null), Zn(null);
|
|
2788
2788
|
return;
|
|
@@ -2806,7 +2806,7 @@ const Ql = pl.forwardRef(
|
|
|
2806
2806
|
k !== m.geometry && (ee(m.id, k), bn(null));
|
|
2807
2807
|
}
|
|
2808
2808
|
};
|
|
2809
|
-
return window.addEventListener("keydown",
|
|
2809
|
+
return window.addEventListener("keydown", u), () => window.removeEventListener("keydown", u);
|
|
2810
2810
|
}, [
|
|
2811
2811
|
a,
|
|
2812
2812
|
Ce,
|
|
@@ -2819,8 +2819,8 @@ const Ql = pl.forwardRef(
|
|
|
2819
2819
|
hn,
|
|
2820
2820
|
an
|
|
2821
2821
|
]), ue(() => {
|
|
2822
|
-
const
|
|
2823
|
-
if (!
|
|
2822
|
+
const u = en.current;
|
|
2823
|
+
if (!u) return;
|
|
2824
2824
|
const g = (k) => {
|
|
2825
2825
|
if (k.preventDefault(), k.deltaY === 0) return;
|
|
2826
2826
|
const N = X.current;
|
|
@@ -2830,63 +2830,63 @@ const Ql = pl.forwardRef(
|
|
|
2830
2830
|
se !== Z && (Fe.current = {
|
|
2831
2831
|
pan: Ws(b, L, Z, se),
|
|
2832
2832
|
zoom: se
|
|
2833
|
-
},
|
|
2833
|
+
}, Ur());
|
|
2834
2834
|
};
|
|
2835
|
-
return
|
|
2836
|
-
Gt(),
|
|
2835
|
+
return u.addEventListener("wheel", g, { passive: !1, capture: !0 }), () => {
|
|
2836
|
+
Gt(), u.removeEventListener("wheel", g, { capture: !0 });
|
|
2837
2837
|
};
|
|
2838
2838
|
}, [!!n]);
|
|
2839
2839
|
const ya = () => {
|
|
2840
2840
|
Gt(), vn();
|
|
2841
|
-
const
|
|
2842
|
-
if (!
|
|
2843
|
-
const k = { x: (g[0].x + g[1].x) / 2, y: (g[0].y + g[1].y) / 2 }, N = no(
|
|
2841
|
+
const u = X.current, g = [...cn.current.values()];
|
|
2842
|
+
if (!u || g.length < 2) return;
|
|
2843
|
+
const k = { x: (g[0].x + g[1].x) / 2, y: (g[0].y + g[1].y) / 2 }, N = no(u, k.x, k.y), { pan: b, zoom: L } = Fe.current;
|
|
2844
2844
|
nn.current = {
|
|
2845
2845
|
startDist: Math.max(1, Math.hypot(g[1].x - g[0].x, g[1].y - g[0].y)),
|
|
2846
2846
|
startZoom: L,
|
|
2847
2847
|
world: Li(N, b, L)
|
|
2848
2848
|
}, ht.current = null, Ao(!1), dn([]), jt(null), Sn(null), z(null), _e(null);
|
|
2849
|
-
}, _a = (
|
|
2850
|
-
if (cn.current.set(
|
|
2851
|
-
|
|
2849
|
+
}, _a = (u) => {
|
|
2850
|
+
if (cn.current.set(u.pointerId, { x: u.clientX, y: u.clientY }), cn.current.size >= 2) {
|
|
2851
|
+
u.preventDefault(), u.stopPropagation(), ya();
|
|
2852
2852
|
return;
|
|
2853
2853
|
}
|
|
2854
|
-
!ze.current ||
|
|
2855
|
-
}, va = (
|
|
2856
|
-
if (cn.current.has(
|
|
2854
|
+
!ze.current || u.button !== 0 || (u.preventDefault(), u.stopPropagation(), $t(u, !1));
|
|
2855
|
+
}, va = (u) => {
|
|
2856
|
+
if (cn.current.has(u.pointerId) && cn.current.set(u.pointerId, { x: u.clientX, y: u.clientY }), !nn.current || cn.current.size < 2) return;
|
|
2857
2857
|
const g = X.current;
|
|
2858
2858
|
if (!g) return;
|
|
2859
|
-
|
|
2859
|
+
u.stopPropagation();
|
|
2860
2860
|
const k = [...cn.current.values()], N = Math.hypot(k[1].x - k[0].x, k[1].y - k[0].y), b = { x: (k[0].x + k[1].x) / 2, y: (k[0].y + k[1].y) / 2 }, L = no(g, b.x, b.y), Z = Bs(
|
|
2861
2861
|
nn.current.startZoom * (N / nn.current.startDist)
|
|
2862
2862
|
);
|
|
2863
2863
|
Ro(Su(L, nn.current.world, Z), Z);
|
|
2864
|
-
}, ds = (
|
|
2864
|
+
}, ds = (u) => {
|
|
2865
2865
|
const g = nn.current != null;
|
|
2866
|
-
cn.current.delete(
|
|
2867
|
-
}, $t = (
|
|
2866
|
+
cn.current.delete(u.pointerId), cn.current.size < 2 && (nn.current = null), g && u.stopPropagation();
|
|
2867
|
+
}, $t = (u, g) => {
|
|
2868
2868
|
var L;
|
|
2869
2869
|
vn();
|
|
2870
|
-
const k = X.current, N = k ? no(k,
|
|
2870
|
+
const k = X.current, N = k ? no(k, u.clientX, u.clientY) : { x: u.clientX, y: u.clientY };
|
|
2871
2871
|
ht.current = {
|
|
2872
2872
|
x: N.x,
|
|
2873
2873
|
y: N.y,
|
|
2874
2874
|
panX: Fe.current.pan.x,
|
|
2875
2875
|
panY: Fe.current.pan.y,
|
|
2876
|
-
clientX:
|
|
2877
|
-
clientY:
|
|
2876
|
+
clientX: u.clientX,
|
|
2877
|
+
clientY: u.clientY,
|
|
2878
2878
|
fromEmptySelect: g
|
|
2879
2879
|
}, Ao(!0);
|
|
2880
|
-
const b = X.current ??
|
|
2881
|
-
(L = b.setPointerCapture) == null || L.call(b,
|
|
2882
|
-
}, us = (
|
|
2883
|
-
const k = ye(
|
|
2880
|
+
const b = X.current ?? u.currentTarget;
|
|
2881
|
+
(L = b.setPointerCapture) == null || L.call(b, u.pointerId);
|
|
2882
|
+
}, us = (u, g) => {
|
|
2883
|
+
const k = ye(u, g);
|
|
2884
2884
|
mn(a) && typeof k == "number" && (un ? (re(un, k), Cn(null), yn(Wt(a, k))) : tn != null && tn !== k ? (ne == null || ne(tn, k), yn(Wt(a, k))) : yn(k)), bt(typeof k == "number" ? [k] : []);
|
|
2885
|
-
}, ka = (
|
|
2885
|
+
}, ka = (u) => {
|
|
2886
2886
|
if (j || !he) return;
|
|
2887
|
-
const g = i.find((k) => k.id ===
|
|
2888
|
-
if (ln(
|
|
2889
|
-
const k = i.filter((b) => b.id !==
|
|
2887
|
+
const g = i.find((k) => k.id === u);
|
|
2888
|
+
if (ln(u), g) {
|
|
2889
|
+
const k = i.filter((b) => b.id !== u), N = [g.fromAnchorId, g.toAnchorId].filter(
|
|
2890
2890
|
(b) => !Xi(b, k)
|
|
2891
2891
|
);
|
|
2892
2892
|
yn(
|
|
@@ -2894,35 +2894,35 @@ const Ql = pl.forwardRef(
|
|
|
2894
2894
|
);
|
|
2895
2895
|
}
|
|
2896
2896
|
dt(null);
|
|
2897
|
-
}, Ia = (
|
|
2897
|
+
}, Ia = (u) => {
|
|
2898
2898
|
if (j || !he) return;
|
|
2899
|
-
const g = new Set(Qu(
|
|
2900
|
-
|
|
2899
|
+
const g = new Set(Qu(u, i));
|
|
2900
|
+
U(u), yn(
|
|
2901
2901
|
(k) => k != null && g.has(k) ? null : k
|
|
2902
2902
|
), z(null), _e(null), kt(null), Cn(null), Te(null), ct((k) => k != null && g.has(k) ? null : k);
|
|
2903
|
-
}, ba = (
|
|
2903
|
+
}, ba = (u) => {
|
|
2904
2904
|
var k, N, b, L, Z, se, ke, $e;
|
|
2905
2905
|
if (nn.current) return;
|
|
2906
2906
|
if (ze.current) {
|
|
2907
|
-
$t(
|
|
2907
|
+
$t(u, !1);
|
|
2908
2908
|
return;
|
|
2909
2909
|
}
|
|
2910
|
-
if (j || a === "pan" ||
|
|
2911
|
-
$t(
|
|
2910
|
+
if (j || a === "pan" || u.button === 1) {
|
|
2911
|
+
$t(u, !1);
|
|
2912
2912
|
return;
|
|
2913
2913
|
}
|
|
2914
|
-
const g = Ze(
|
|
2914
|
+
const g = Ze(u.clientX, u.clientY);
|
|
2915
2915
|
if (q && !wl(a)) {
|
|
2916
2916
|
ce == null || ce("select");
|
|
2917
2917
|
return;
|
|
2918
2918
|
}
|
|
2919
2919
|
if (Qt(a)) {
|
|
2920
|
-
if (rs(g,
|
|
2921
|
-
$t(
|
|
2920
|
+
if (rs(g, u) || An(g)) return;
|
|
2921
|
+
$t(u, !0);
|
|
2922
2922
|
return;
|
|
2923
2923
|
}
|
|
2924
2924
|
if (_o(a)) {
|
|
2925
|
-
const
|
|
2925
|
+
const V = Tn(g) ?? pn, Y = u.shiftKey && !V && Ce.length > 0 ? Fs(Ce[Ce.length - 1], g) : null, te = V ?? (Y == null ? void 0 : Y.point) ?? g;
|
|
2926
2926
|
if (Ne(Y), Ce.length >= 3) {
|
|
2927
2927
|
const qe = Ce[0];
|
|
2928
2928
|
if (Math.hypot(te.x - qe.x, te.y - qe.y) <= D(At)) {
|
|
@@ -2948,14 +2948,14 @@ const Ql = pl.forwardRef(
|
|
|
2948
2948
|
Oo([]), po(qe.id);
|
|
2949
2949
|
return;
|
|
2950
2950
|
}
|
|
2951
|
-
$t(
|
|
2951
|
+
$t(u, !0);
|
|
2952
2952
|
return;
|
|
2953
2953
|
}
|
|
2954
|
-
const
|
|
2954
|
+
const V = Wo(o, Pe), Y = wt(
|
|
2955
2955
|
g,
|
|
2956
2956
|
o,
|
|
2957
2957
|
i,
|
|
2958
|
-
|
|
2958
|
+
V,
|
|
2959
2959
|
D(et),
|
|
2960
2960
|
kn
|
|
2961
2961
|
);
|
|
@@ -2968,7 +2968,7 @@ const Ql = pl.forwardRef(
|
|
|
2968
2968
|
), kt(null), Te(null);
|
|
2969
2969
|
return;
|
|
2970
2970
|
}
|
|
2971
|
-
if (gr(a) &&
|
|
2971
|
+
if (gr(a) && u.detail >= 2) return;
|
|
2972
2972
|
if ((Y == null ? void 0 : Y.type) === "edge") {
|
|
2973
2973
|
if (!mn(a)) {
|
|
2974
2974
|
Oo([]), po(Y.edgeId);
|
|
@@ -2992,7 +2992,7 @@ const Ql = pl.forwardRef(
|
|
|
2992
2992
|
), Te(g);
|
|
2993
2993
|
return;
|
|
2994
2994
|
}
|
|
2995
|
-
const te =
|
|
2995
|
+
const te = Vu(un, g);
|
|
2996
2996
|
if (Cn(te.nextDraft), Te(g), te.start && te.end) {
|
|
2997
2997
|
const qe = Ee(te.start, te.end);
|
|
2998
2998
|
yn(
|
|
@@ -3004,15 +3004,15 @@ const Ql = pl.forwardRef(
|
|
|
3004
3004
|
}
|
|
3005
3005
|
return;
|
|
3006
3006
|
}
|
|
3007
|
-
$t(
|
|
3007
|
+
$t(u, !0);
|
|
3008
3008
|
return;
|
|
3009
3009
|
}
|
|
3010
3010
|
if (a === "draw-text") {
|
|
3011
|
-
const
|
|
3011
|
+
const V = zs();
|
|
3012
3012
|
Je(
|
|
3013
3013
|
"label",
|
|
3014
|
-
Kl(g, wo,
|
|
3015
|
-
{ label: fu(wo,
|
|
3014
|
+
Kl(g, wo, V),
|
|
3015
|
+
{ label: fu(wo, V, h.STORE_TEXT_COLOR) }
|
|
3016
3016
|
);
|
|
3017
3017
|
return;
|
|
3018
3018
|
}
|
|
@@ -3025,30 +3025,30 @@ const Ql = pl.forwardRef(
|
|
|
3025
3025
|
return;
|
|
3026
3026
|
}
|
|
3027
3027
|
if (a === "draw-unit" || vo(a)) {
|
|
3028
|
-
(N = (k =
|
|
3028
|
+
(N = (k = u.currentTarget).setPointerCapture) == null || N.call(k, u.pointerId), K(u.shiftKey), dn([g, g]);
|
|
3029
3029
|
return;
|
|
3030
3030
|
}
|
|
3031
3031
|
if (gt(a) && m && O) {
|
|
3032
|
-
const
|
|
3033
|
-
if (
|
|
3034
|
-
if (
|
|
3035
|
-
Mo(
|
|
3032
|
+
const V = Ud(O, g, D(Ht));
|
|
3033
|
+
if (V) {
|
|
3034
|
+
if (u.detail >= 2) {
|
|
3035
|
+
Mo(V.ringIndex, V.edgeIndex);
|
|
3036
3036
|
return;
|
|
3037
3037
|
}
|
|
3038
3038
|
bn({
|
|
3039
|
-
ringIndex:
|
|
3040
|
-
edgeIndex:
|
|
3041
|
-
handle:
|
|
3039
|
+
ringIndex: V.ringIndex,
|
|
3040
|
+
edgeIndex: V.edgeIndex,
|
|
3041
|
+
handle: V.handle
|
|
3042
3042
|
}), rn(null), Sn({
|
|
3043
3043
|
type: "handle",
|
|
3044
3044
|
shapeId: m.id,
|
|
3045
|
-
ringIndex:
|
|
3046
|
-
edgeIndex:
|
|
3047
|
-
handle:
|
|
3048
|
-
}), (L = (b =
|
|
3045
|
+
ringIndex: V.ringIndex,
|
|
3046
|
+
edgeIndex: V.edgeIndex,
|
|
3047
|
+
handle: V.handle
|
|
3048
|
+
}), (L = (b = u.currentTarget).setPointerCapture) == null || L.call(b, u.pointerId);
|
|
3049
3049
|
return;
|
|
3050
3050
|
}
|
|
3051
|
-
const Y =
|
|
3051
|
+
const Y = Vd(
|
|
3052
3052
|
O,
|
|
3053
3053
|
g,
|
|
3054
3054
|
D(Ht)
|
|
@@ -3059,15 +3059,15 @@ const Ql = pl.forwardRef(
|
|
|
3059
3059
|
shapeId: m.id,
|
|
3060
3060
|
ringIndex: Y.polygonIndex,
|
|
3061
3061
|
edgeIndex: Y.afterVertexIndex
|
|
3062
|
-
}), (se = (Z =
|
|
3062
|
+
}), (se = (Z = u.currentTarget).setPointerCapture) == null || se.call(Z, u.pointerId);
|
|
3063
3063
|
return;
|
|
3064
3064
|
}
|
|
3065
3065
|
}
|
|
3066
3066
|
if (!(eo(a) && Nn(g))) {
|
|
3067
3067
|
if (zo(a) && m && O) {
|
|
3068
|
-
const
|
|
3068
|
+
const V = D(Kt), Y = ai(O, g, V);
|
|
3069
3069
|
if (Y) {
|
|
3070
|
-
if (
|
|
3070
|
+
if (u.detail >= 2) {
|
|
3071
3071
|
dr(Y.polygonIndex, Y.vertexIndex);
|
|
3072
3072
|
return;
|
|
3073
3073
|
}
|
|
@@ -3079,31 +3079,31 @@ const Ql = pl.forwardRef(
|
|
|
3079
3079
|
shapeId: m.id,
|
|
3080
3080
|
polygonIndex: Y.polygonIndex,
|
|
3081
3081
|
vertexIndex: Y.vertexIndex
|
|
3082
|
-
}), ($e = (ke =
|
|
3082
|
+
}), ($e = (ke = u.currentTarget).setPointerCapture) == null || $e.call(ke, u.pointerId);
|
|
3083
3083
|
return;
|
|
3084
3084
|
}
|
|
3085
3085
|
}
|
|
3086
3086
|
if (a === "select" && m && O) {
|
|
3087
|
-
const
|
|
3088
|
-
if (
|
|
3087
|
+
const V = Ml(O, g, D(Kt));
|
|
3088
|
+
if (V) {
|
|
3089
3089
|
cr(
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3090
|
+
V.polygonIndex,
|
|
3091
|
+
V.afterVertexIndex,
|
|
3092
|
+
V.point,
|
|
3093
|
+
u
|
|
3094
3094
|
);
|
|
3095
3095
|
return;
|
|
3096
3096
|
}
|
|
3097
3097
|
}
|
|
3098
|
-
Nl(a) && $t(
|
|
3098
|
+
Nl(a) && $t(u, a === "select");
|
|
3099
3099
|
}
|
|
3100
|
-
}, xa = (
|
|
3100
|
+
}, xa = (u) => {
|
|
3101
3101
|
var g, k;
|
|
3102
3102
|
if (!nn.current) {
|
|
3103
3103
|
if (ht.current) {
|
|
3104
3104
|
const N = X.current;
|
|
3105
3105
|
if (!N) return;
|
|
3106
|
-
const b = no(N,
|
|
3106
|
+
const b = no(N, u.clientX, u.clientY), L = {
|
|
3107
3107
|
x: ht.current.panX + (b.x - ht.current.x),
|
|
3108
3108
|
y: ht.current.panY + (b.y - ht.current.y)
|
|
3109
3109
|
};
|
|
@@ -3111,12 +3111,12 @@ const Ql = pl.forwardRef(
|
|
|
3111
3111
|
return;
|
|
3112
3112
|
}
|
|
3113
3113
|
if (Xe && m) {
|
|
3114
|
-
const N = Ze(
|
|
3115
|
-
|
|
3116
|
-
|
|
3114
|
+
const N = Ze(u.clientX, u.clientY), b = Math.hypot(
|
|
3115
|
+
u.clientX - Xe.clientX,
|
|
3116
|
+
u.clientY - Xe.clientY
|
|
3117
3117
|
);
|
|
3118
3118
|
if (!Xe.dragging && b < th) return;
|
|
3119
|
-
Xe.dragging || (
|
|
3119
|
+
Xe.dragging || (Ve({ ...Xe, dragging: !0 }), qn(null));
|
|
3120
3120
|
const L = Fd(
|
|
3121
3121
|
Xe.originGeometry,
|
|
3122
3122
|
Xe.ringIndex,
|
|
@@ -3127,18 +3127,18 @@ const Ql = pl.forwardRef(
|
|
|
3127
3127
|
return;
|
|
3128
3128
|
}
|
|
3129
3129
|
if (Ke) {
|
|
3130
|
-
const N = Ze(
|
|
3130
|
+
const N = Ze(u.clientX, u.clientY);
|
|
3131
3131
|
_n({ ...Ke, cursor: N });
|
|
3132
3132
|
return;
|
|
3133
3133
|
}
|
|
3134
3134
|
if (E != null) {
|
|
3135
|
-
_e(Ze(
|
|
3135
|
+
_e(Ze(u.clientX, u.clientY));
|
|
3136
3136
|
return;
|
|
3137
3137
|
}
|
|
3138
3138
|
if (fe && le) {
|
|
3139
|
-
const N = i.find((Z) => Z.id === fe.edgeId), b = N ?
|
|
3139
|
+
const N = i.find((Z) => Z.id === fe.edgeId), b = N ? Un.get(N.fromAnchorId) : void 0, L = N ? Un.get(N.toAnchorId) : void 0;
|
|
3140
3140
|
if (N && b && L) {
|
|
3141
|
-
const Z = Ze(
|
|
3141
|
+
const Z = Ze(u.clientX, u.clientY), se = fe.type === "bend" ? ws(b, L, Z) : tc(
|
|
3142
3142
|
Io(N) ?? ws(b, L, Z),
|
|
3143
3143
|
fe.handle,
|
|
3144
3144
|
Z
|
|
@@ -3149,10 +3149,10 @@ const Ql = pl.forwardRef(
|
|
|
3149
3149
|
}
|
|
3150
3150
|
if (wn && m) {
|
|
3151
3151
|
try {
|
|
3152
|
-
(k = (g = X.current) == null ? void 0 : g.setPointerCapture) == null || k.call(g,
|
|
3152
|
+
(k = (g = X.current) == null ? void 0 : g.setPointerCapture) == null || k.call(g, u.pointerId);
|
|
3153
3153
|
} catch {
|
|
3154
3154
|
}
|
|
3155
|
-
const N = Ze(
|
|
3155
|
+
const N = Ze(u.clientX, u.clientY), b = u.shiftKey && wn.type === "anchor" ? su(
|
|
3156
3156
|
N,
|
|
3157
3157
|
zd(
|
|
3158
3158
|
m.geometry,
|
|
@@ -3182,7 +3182,7 @@ const Ql = pl.forwardRef(
|
|
|
3182
3182
|
return;
|
|
3183
3183
|
}
|
|
3184
3184
|
if (Ye) {
|
|
3185
|
-
const N = Ze(
|
|
3185
|
+
const N = Ze(u.clientX, u.clientY);
|
|
3186
3186
|
Xt({
|
|
3187
3187
|
x: N.x - Ye.start.x,
|
|
3188
3188
|
y: N.y - Ye.start.y
|
|
@@ -3190,14 +3190,14 @@ const Ql = pl.forwardRef(
|
|
|
3190
3190
|
return;
|
|
3191
3191
|
}
|
|
3192
3192
|
if ((a === "draw-unit" || vo(a)) && De.length > 0) {
|
|
3193
|
-
const N = Ze(
|
|
3194
|
-
vo(a) && K(
|
|
3193
|
+
const N = Ze(u.clientX, u.clientY);
|
|
3194
|
+
vo(a) && K(u.shiftKey), dn((b) => b.length === 0 ? b : [b[0], N]);
|
|
3195
3195
|
}
|
|
3196
3196
|
if (_o(a) && Ce.length > 0) {
|
|
3197
|
-
const N = Ze(
|
|
3197
|
+
const N = Ze(u.clientX, u.clientY), b = Tn(N);
|
|
3198
3198
|
if (b)
|
|
3199
3199
|
lt(b), Te(b), Ne(null);
|
|
3200
|
-
else if (
|
|
3200
|
+
else if (u.shiftKey) {
|
|
3201
3201
|
const L = Fs(
|
|
3202
3202
|
Ce[Ce.length - 1],
|
|
3203
3203
|
N
|
|
@@ -3206,8 +3206,8 @@ const Ql = pl.forwardRef(
|
|
|
3206
3206
|
} else
|
|
3207
3207
|
lt(null), Te(N), Ne(null);
|
|
3208
3208
|
}
|
|
3209
|
-
if (he && !Ke && E == null && fe == null && ga(
|
|
3210
|
-
const N = Ze(
|
|
3209
|
+
if (he && !Ke && E == null && fe == null && ga(u.clientX, u.clientY), eo(a) && !j) {
|
|
3210
|
+
const N = Ze(u.clientX, u.clientY), b = D(At), L = _r(
|
|
3211
3211
|
P,
|
|
3212
3212
|
N,
|
|
3213
3213
|
b,
|
|
@@ -3223,14 +3223,14 @@ const Ql = pl.forwardRef(
|
|
|
3223
3223
|
dn([]);
|
|
3224
3224
|
return;
|
|
3225
3225
|
}
|
|
3226
|
-
const [
|
|
3227
|
-
if (Zs(
|
|
3226
|
+
const [u, g] = [De[0], De[De.length - 1]];
|
|
3227
|
+
if (Zs(u, g) < 2) {
|
|
3228
3228
|
dn([]);
|
|
3229
3229
|
return;
|
|
3230
3230
|
}
|
|
3231
|
-
const k = oh(
|
|
3231
|
+
const k = oh(u, g);
|
|
3232
3232
|
Je("unit", Jo([k])), dn([]), K(!1);
|
|
3233
|
-
}, Na = (
|
|
3233
|
+
}, Na = (u) => {
|
|
3234
3234
|
if (De.length < 2) {
|
|
3235
3235
|
dn([]), K(!1);
|
|
3236
3236
|
return;
|
|
@@ -3240,22 +3240,22 @@ const Ql = pl.forwardRef(
|
|
|
3240
3240
|
dn([]), K(!1);
|
|
3241
3241
|
return;
|
|
3242
3242
|
}
|
|
3243
|
-
Je("unit", cu(g, k,
|
|
3244
|
-
}, hs = (
|
|
3243
|
+
Je("unit", cu(g, k, u)), dn([]), K(!1);
|
|
3244
|
+
}, hs = (u) => {
|
|
3245
3245
|
var k, N;
|
|
3246
3246
|
if (nn.current) return;
|
|
3247
3247
|
const g = ht.current;
|
|
3248
|
-
if (ht.current = null, Ao(!1),
|
|
3249
|
-
|
|
3250
|
-
|
|
3248
|
+
if (ht.current = null, Ao(!1), u.shiftKey || Ne(null), g != null && g.fromEmptySelect && Math.hypot(
|
|
3249
|
+
u.clientX - g.clientX,
|
|
3250
|
+
u.clientY - g.clientY
|
|
3251
3251
|
) < 4 && (Ie(null), bt([]), rn(null), bn(null), qn(null), st(null), Zn(null), Te(null)), we == null || we(), Ke) {
|
|
3252
3252
|
try {
|
|
3253
|
-
(N = (k = X.current) == null ? void 0 : k.releasePointerCapture) == null || N.call(k,
|
|
3253
|
+
(N = (k = X.current) == null ? void 0 : k.releasePointerCapture) == null || N.call(k, u.pointerId);
|
|
3254
3254
|
} catch {
|
|
3255
3255
|
}
|
|
3256
3256
|
Math.hypot(
|
|
3257
|
-
|
|
3258
|
-
|
|
3257
|
+
u.clientX - Ke.clientX,
|
|
3258
|
+
u.clientY - Ke.clientY
|
|
3259
3259
|
) >= 4 && Q(
|
|
3260
3260
|
Ke.shapeId,
|
|
3261
3261
|
Ke.origin,
|
|
@@ -3270,7 +3270,7 @@ const Ql = pl.forwardRef(
|
|
|
3270
3270
|
Xe.ringIndex,
|
|
3271
3271
|
Xe.edgeIndex,
|
|
3272
3272
|
Xe.insertAt
|
|
3273
|
-
),
|
|
3273
|
+
), Ve(null);
|
|
3274
3274
|
return;
|
|
3275
3275
|
}
|
|
3276
3276
|
if (wn) {
|
|
@@ -3298,7 +3298,7 @@ const Ql = pl.forwardRef(
|
|
|
3298
3298
|
const b = o.find((Z) => Z.id === E), L = J ?? b;
|
|
3299
3299
|
if (b && L) {
|
|
3300
3300
|
if (a === "select" && b.shapeId == null && (ss.get(b.id) ?? 0) <= 1) {
|
|
3301
|
-
const se = Ze(
|
|
3301
|
+
const se = Ze(u.clientX, u.clientY), ke = wt(
|
|
3302
3302
|
se,
|
|
3303
3303
|
o,
|
|
3304
3304
|
i,
|
|
@@ -3324,22 +3324,22 @@ const Ql = pl.forwardRef(
|
|
|
3324
3324
|
z(null), _e(null);
|
|
3325
3325
|
return;
|
|
3326
3326
|
}
|
|
3327
|
-
a === "draw-unit" && wa(), vo(a) && Na(
|
|
3328
|
-
}, ps = (
|
|
3329
|
-
const g =
|
|
3330
|
-
return g.length > 0 ? g.map(Sl).join(" ") :
|
|
3331
|
-
}, ur = (
|
|
3327
|
+
a === "draw-unit" && wa(), vo(a) && Na(u.shiftKey);
|
|
3328
|
+
}, ps = (u) => {
|
|
3329
|
+
const g = Ue(u);
|
|
3330
|
+
return g.length > 0 ? g.map(Sl).join(" ") : u.paths.map((k) => k.d).join(" ") || mi(u.polygons);
|
|
3331
|
+
}, ur = (u) => p === u.id && O && (Ye == null ? void 0 : Ye.shapeId) === u.id ? ps(O) : ps(u.geometry), Xr = Ke ? Wo(o, Ke) : Pe ? Wo(o, Pe) : null, Rn = Ke && Xr ? wt(
|
|
3332
3332
|
Ke.cursor,
|
|
3333
3333
|
o,
|
|
3334
3334
|
i,
|
|
3335
3335
|
Xr,
|
|
3336
3336
|
D(Hs),
|
|
3337
3337
|
kn
|
|
3338
|
-
) : Pe && $ && Xr ? fn : null, Gr = tn != null ? kn.get(tn) : void 0, Yr = !Ke && !Pe && $ && (un || mn(a) && tn != null) ? fn : null, fs = ((Hn == null ? void 0 : Hn.type) === "edge" ? Hn.edgeId : null) ?? ((Rn == null ? void 0 : Rn.type) === "edge" ? Rn.edgeId : null) ?? (Qn == null ? void 0 : Qn.edgeId) ?? null ?? (a === "select" || a === "curve" ? Et : null), mo = fs == null ? null : i.find((
|
|
3338
|
+
) : Pe && $ && Xr ? fn : null, Gr = tn != null ? kn.get(tn) : void 0, Yr = !Ke && !Pe && $ && (un || mn(a) && tn != null) ? fn : null, fs = ((Hn == null ? void 0 : Hn.type) === "edge" ? Hn.edgeId : null) ?? ((Rn == null ? void 0 : Rn.type) === "edge" ? Rn.edgeId : null) ?? (Qn == null ? void 0 : Qn.edgeId) ?? null ?? (a === "select" || a === "curve" ? Et : null), mo = fs == null ? null : i.find((u) => u.id === fs) ?? null, ms = mo ? Un.get(mo.fromAnchorId) : null, gs = mo ? Un.get(mo.toAnchorId) : null, Zr = mo && ms && gs ? xs(
|
|
3339
3339
|
ms,
|
|
3340
3340
|
gs,
|
|
3341
|
-
qr(mo, kn,
|
|
3342
|
-
) : null, ft = ((Hn == null ? void 0 : Hn.type) === "edge" ? Hn.point : null) ?? ((Rn == null ? void 0 : Rn.type) === "edge" ? Rn.point : null) ?? (Qn == null ? void 0 : Qn.point) ?? null, Ca = (Ke == null ? void 0 : Ke.origin) ?? (Pe == null ? void 0 : Pe.origin) ?? un ?? (mn(a) && Gr ? { x: Gr.x, y: Gr.y } : null), Sa = Ke != null ? (Rn == null ? void 0 : Rn.point) ?? Ke.cursor : (Rn == null ? void 0 : Rn.point) ?? (Yr == null ? void 0 : Yr.point) ?? (Qn == null ? void 0 : Qn.point) ?? $, Yt = Ke != null || Pe != null || un != null || mn(a) && tn != null && $ != null ? hi(Ca, Sa) : null, Do = _o(a) && Ce.length > 0 ? hi(Ce[Ce.length - 1], $) : null, Po = _o(a) && Ce.length >= 2 ? hi($, Ce[0]) : null, hr = Mt != null ? Kn.find((
|
|
3341
|
+
qr(mo, kn, Un)
|
|
3342
|
+
) : null, ft = ((Hn == null ? void 0 : Hn.type) === "edge" ? Hn.point : null) ?? ((Rn == null ? void 0 : Rn.type) === "edge" ? Rn.point : null) ?? (Qn == null ? void 0 : Qn.point) ?? null, Ca = (Ke == null ? void 0 : Ke.origin) ?? (Pe == null ? void 0 : Pe.origin) ?? un ?? (mn(a) && Gr ? { x: Gr.x, y: Gr.y } : null), Sa = Ke != null ? (Rn == null ? void 0 : Rn.point) ?? Ke.cursor : (Rn == null ? void 0 : Rn.point) ?? (Yr == null ? void 0 : Yr.point) ?? (Qn == null ? void 0 : Qn.point) ?? $, Yt = Ke != null || Pe != null || un != null || mn(a) && tn != null && $ != null ? hi(Ca, Sa) : null, Do = _o(a) && Ce.length > 0 ? hi(Ce[Ce.length - 1], $) : null, Po = _o(a) && Ce.length >= 2 ? hi($, Ce[0]) : null, hr = Mt != null ? Kn.find((u) => u.id === Mt) : null, Ea = he && !j && mn(a) && hr != null && vr(hr.kind) && !Rr(hr) && !Go(hr), Oa = mn(a) && (fn == null ? void 0 : fn.type) === "edge" && !Ke, Aa = fn != null && !Ke, ys = Lu({
|
|
3343
3343
|
tool: a,
|
|
3344
3344
|
readOnly: j,
|
|
3345
3345
|
spaceHeld: be,
|
|
@@ -3382,15 +3382,15 @@ const Ql = pl.forwardRef(
|
|
|
3382
3382
|
onPointerLeave: () => {
|
|
3383
3383
|
dt(null);
|
|
3384
3384
|
},
|
|
3385
|
-
onMouseDown: (
|
|
3386
|
-
a !== "draw-text" &&
|
|
3385
|
+
onMouseDown: (u) => {
|
|
3386
|
+
a !== "draw-text" && u.preventDefault();
|
|
3387
3387
|
},
|
|
3388
|
-
onDoubleClick: (
|
|
3388
|
+
onDoubleClick: (u) => {
|
|
3389
3389
|
var k;
|
|
3390
|
-
if (
|
|
3390
|
+
if (u.preventDefault(), (k = window.getSelection()) == null || k.removeAllRanges(), j || !he || !gr(a))
|
|
3391
3391
|
return;
|
|
3392
3392
|
const g = (fn == null ? void 0 : fn.type) === "edge" ? fn.edgeId : null;
|
|
3393
|
-
g != null && (
|
|
3393
|
+
g != null && (u.stopPropagation(), ka(g));
|
|
3394
3394
|
},
|
|
3395
3395
|
children: /* @__PURE__ */ v(
|
|
3396
3396
|
"g",
|
|
@@ -3413,28 +3413,28 @@ const Ql = pl.forwardRef(
|
|
|
3413
3413
|
]
|
|
3414
3414
|
}
|
|
3415
3415
|
),
|
|
3416
|
-
To.length > 0 ? /* @__PURE__ */ s("clipPath", { id: y, children: To.map((
|
|
3416
|
+
To.length > 0 ? /* @__PURE__ */ s("clipPath", { id: y, children: To.map((u) => /* @__PURE__ */ s("path", { d: ur(u) }, u.id)) }) : null
|
|
3417
3417
|
] }),
|
|
3418
3418
|
ar ? /* @__PURE__ */ s(
|
|
3419
3419
|
Wu,
|
|
3420
3420
|
{
|
|
3421
3421
|
url: ar,
|
|
3422
3422
|
imageProxyUrl: R,
|
|
3423
|
-
suppressIds:
|
|
3423
|
+
suppressIds: Vr,
|
|
3424
3424
|
theme: h,
|
|
3425
3425
|
includeBackground: h.SURROUNDINGS === "google"
|
|
3426
3426
|
}
|
|
3427
3427
|
) : null,
|
|
3428
|
-
x.filter(Ks).map((
|
|
3429
|
-
const g = !he && Ku(
|
|
3430
|
-
|
|
3428
|
+
x.filter(Ks).map((u) => {
|
|
3429
|
+
const g = !he && Ku(u.kind), k = g && Mt === u.id, N = ui(
|
|
3430
|
+
u,
|
|
3431
3431
|
h,
|
|
3432
|
-
jr.get(
|
|
3432
|
+
jr.get(u.id)
|
|
3433
3433
|
);
|
|
3434
3434
|
return /* @__PURE__ */ s(
|
|
3435
3435
|
"path",
|
|
3436
3436
|
{
|
|
3437
|
-
d:
|
|
3437
|
+
d: u.geometry.paths.map((b) => b.d).join(" ") || mi(u.geometry.polygons),
|
|
3438
3438
|
fill: ko(N, k),
|
|
3439
3439
|
fillOpacity: k ? 0.4 : g ? 0.22 : 0.32,
|
|
3440
3440
|
stroke: k ? ko(N, !0) : "#94a3b8",
|
|
@@ -3443,41 +3443,41 @@ const Ql = pl.forwardRef(
|
|
|
3443
3443
|
pointerEvents: g ? "auto" : "none",
|
|
3444
3444
|
style: { cursor: g ? "pointer" : void 0 },
|
|
3445
3445
|
onPointerEnter: g ? (b) => {
|
|
3446
|
-
It(
|
|
3446
|
+
It(u.id), pt(b, u.kind);
|
|
3447
3447
|
} : void 0,
|
|
3448
|
-
onPointerMove: g ? (b) => pt(b,
|
|
3448
|
+
onPointerMove: g ? (b) => pt(b, u.kind) : void 0,
|
|
3449
3449
|
onPointerLeave: g ? () => {
|
|
3450
|
-
It((b) => b ===
|
|
3450
|
+
It((b) => b === u.id ? null : b), Dt(null);
|
|
3451
3451
|
} : void 0,
|
|
3452
3452
|
onPointerDown: g ? (b) => {
|
|
3453
|
-
b.stopPropagation(), Dt(null), Ie(
|
|
3453
|
+
b.stopPropagation(), Dt(null), Ie(u.id);
|
|
3454
3454
|
} : void 0
|
|
3455
3455
|
},
|
|
3456
|
-
`base-${
|
|
3456
|
+
`base-${u.id}`
|
|
3457
3457
|
);
|
|
3458
3458
|
}),
|
|
3459
|
-
To.length > 0 && A.length > 0 ? /* @__PURE__ */ s("g", { clipPath: `url(#${y})`, pointerEvents: "none", children: A.filter(Ks).map((
|
|
3459
|
+
To.length > 0 && A.length > 0 ? /* @__PURE__ */ s("g", { clipPath: `url(#${y})`, pointerEvents: "none", children: A.filter(Ks).map((u) => /* @__PURE__ */ s(
|
|
3460
3460
|
"path",
|
|
3461
3461
|
{
|
|
3462
|
-
d:
|
|
3462
|
+
d: u.geometry.paths.map((g) => g.d).join(" ") || mi(u.geometry.polygons),
|
|
3463
3463
|
fill: ui(
|
|
3464
|
-
|
|
3464
|
+
u,
|
|
3465
3465
|
h,
|
|
3466
|
-
jr.get(
|
|
3466
|
+
jr.get(u.id)
|
|
3467
3467
|
),
|
|
3468
3468
|
fillOpacity: 0.55,
|
|
3469
3469
|
stroke: "#94a3b8",
|
|
3470
3470
|
strokeWidth: 0.8 / ie
|
|
3471
3471
|
},
|
|
3472
|
-
`below-${
|
|
3472
|
+
`below-${u.id}`
|
|
3473
3473
|
)) }) : null,
|
|
3474
|
-
Kn.map((
|
|
3475
|
-
const g = Xl(
|
|
3474
|
+
Kn.map((u) => {
|
|
3475
|
+
const g = Xl(u.kind), k = p === u.id, N = g && Mt === u.id && !k, b = (Ye == null ? void 0 : Ye.shapeId) === u.id, L = Rr(u), Z = Go(u), se = L || Z, ke = be ? void 0 : Tu({
|
|
3476
3476
|
tool: a,
|
|
3477
3477
|
selected: k,
|
|
3478
3478
|
highlightable: g,
|
|
3479
3479
|
dragging: b,
|
|
3480
|
-
wayfinding: he && !j && vr(
|
|
3480
|
+
wayfinding: he && !j && vr(u.kind) && !se,
|
|
3481
3481
|
textLabel: L,
|
|
3482
3482
|
entranceIcon: Z
|
|
3483
3483
|
}) ?? (Si(a) || Fo(a, q) && !j ? void 0 : Ki(a) ? "cell" : "default"), $e = (Qe) => {
|
|
@@ -3497,17 +3497,17 @@ const Ql = pl.forwardRef(
|
|
|
3497
3497
|
kn,
|
|
3498
3498
|
a === "curve" ? "edge" : "junction"
|
|
3499
3499
|
);
|
|
3500
|
-
if (a === "curve" || pr != null || a === "select" && (!vr(
|
|
3500
|
+
if (a === "curve" || pr != null || a === "select" && (!vr(u.kind) || se))
|
|
3501
3501
|
return;
|
|
3502
3502
|
}
|
|
3503
|
-
if (he && mn(a) &&
|
|
3503
|
+
if (he && mn(a) && Us(n) && vr(u.kind) && !se) {
|
|
3504
3504
|
Qe.stopPropagation();
|
|
3505
3505
|
const qt = Ze(Qe.clientX, Qe.clientY);
|
|
3506
|
-
Me(
|
|
3506
|
+
Me(u.id, qt), Cn(null), yn(null), kt({ shapeId: u.id, origin: qt }), Te(qt);
|
|
3507
3507
|
return;
|
|
3508
3508
|
}
|
|
3509
3509
|
if (se && Si(a)) {
|
|
3510
|
-
Qe.stopPropagation(), Ie(
|
|
3510
|
+
Qe.stopPropagation(), Ie(u.id), ce == null || ce("select");
|
|
3511
3511
|
return;
|
|
3512
3512
|
}
|
|
3513
3513
|
if (!Fo(a, q)) return;
|
|
@@ -3515,27 +3515,27 @@ const Ql = pl.forwardRef(
|
|
|
3515
3515
|
const $n = Ze(Qe.clientX, Qe.clientY);
|
|
3516
3516
|
if (Qt(a)) {
|
|
3517
3517
|
if (rs($n, Qe)) return;
|
|
3518
|
-
(!Ts(
|
|
3518
|
+
(!Ts(u.kind) || !An($n)) && Ie(u.id);
|
|
3519
3519
|
return;
|
|
3520
3520
|
}
|
|
3521
|
-
if (Nn($n) || (Ie(
|
|
3522
|
-
const yo = Ze(Qe.clientX, Qe.clientY), $o = k && O ? O :
|
|
3521
|
+
if (Nn($n) || (Ie(u.id), a !== "select") || !(k || g)) return;
|
|
3522
|
+
const yo = Ze(Qe.clientX, Qe.clientY), $o = k && O ? O : u.geometry;
|
|
3523
3523
|
jt({
|
|
3524
|
-
shapeId:
|
|
3524
|
+
shapeId: u.id,
|
|
3525
3525
|
start: yo,
|
|
3526
3526
|
originGeometry: $o
|
|
3527
3527
|
}), Xt({ x: 0, y: 0 }), (Jt = (Ft = Qe.currentTarget).setPointerCapture) == null || Jt.call(Ft, Qe.pointerId);
|
|
3528
|
-
},
|
|
3529
|
-
onPointerEnter: () => It(
|
|
3530
|
-
onPointerLeave: () => It((Qe) => Qe ===
|
|
3528
|
+
}, V = g ? {
|
|
3529
|
+
onPointerEnter: () => It(u.id),
|
|
3530
|
+
onPointerLeave: () => It((Qe) => Qe === u.id ? null : Qe)
|
|
3531
3531
|
} : void 0;
|
|
3532
3532
|
if (Z) {
|
|
3533
|
-
const Qe = k && O ? O :
|
|
3534
|
-
|
|
3535
|
-
const go =
|
|
3536
|
-
|
|
3533
|
+
const Qe = k && O ? O : u.geometry, $n = jn(Qe);
|
|
3534
|
+
u.label.size ?? ro;
|
|
3535
|
+
const go = u.label.rotate ?? 0, { x: yo, y: $o } = Ri($n), Ft = Lc(
|
|
3536
|
+
u.label.color ?? h.STORE_TEXT_COLOR
|
|
3537
3537
|
), Jt = ko(
|
|
3538
|
-
|
|
3538
|
+
u.label.color ?? h.STORE_TEXT_COLOR,
|
|
3539
3539
|
k || N
|
|
3540
3540
|
);
|
|
3541
3541
|
return /* @__PURE__ */ v(
|
|
@@ -3543,12 +3543,12 @@ const Ql = pl.forwardRef(
|
|
|
3543
3543
|
{
|
|
3544
3544
|
transform: go ? `rotate(${go} ${yo} ${$o})` : void 0,
|
|
3545
3545
|
style: he ? void 0 : { cursor: ke ?? "pointer" },
|
|
3546
|
-
...
|
|
3546
|
+
...V,
|
|
3547
3547
|
children: [
|
|
3548
3548
|
/* @__PURE__ */ s(
|
|
3549
3549
|
"path",
|
|
3550
3550
|
{
|
|
3551
|
-
d: ur({ ...
|
|
3551
|
+
d: ur({ ...u, geometry: Qe }),
|
|
3552
3552
|
fill: "transparent",
|
|
3553
3553
|
stroke: k || N ? Jt : "transparent",
|
|
3554
3554
|
strokeWidth: k || N ? 1.5 / ie : 0,
|
|
@@ -3568,12 +3568,12 @@ const Ql = pl.forwardRef(
|
|
|
3568
3568
|
) : null
|
|
3569
3569
|
]
|
|
3570
3570
|
},
|
|
3571
|
-
|
|
3571
|
+
u.id
|
|
3572
3572
|
);
|
|
3573
3573
|
}
|
|
3574
|
-
if (Rr(
|
|
3575
|
-
const Qe = k && O ? O :
|
|
3576
|
-
|
|
3574
|
+
if (Rr(u)) {
|
|
3575
|
+
const Qe = k && O ? O : u.geometry, $n = jn(Qe), go = u.label.size ?? zs(), yo = u.label.rotate ?? 0, { x: $o, y: Ft } = Ri($n), Jt = Yo(u.label.align), qt = nc($n, Jt), pr = ji(u.label.text ?? ""), ks = go * Vi, Ra = pr.length * ks, La = ko(
|
|
3576
|
+
u.label.color ?? h.STORE_TEXT_COLOR,
|
|
3577
3577
|
k || N
|
|
3578
3578
|
);
|
|
3579
3579
|
return /* @__PURE__ */ v(
|
|
@@ -3581,12 +3581,12 @@ const Ql = pl.forwardRef(
|
|
|
3581
3581
|
{
|
|
3582
3582
|
transform: yo ? `rotate(${yo} ${$o} ${Ft})` : void 0,
|
|
3583
3583
|
style: he ? void 0 : { cursor: ke ?? "pointer" },
|
|
3584
|
-
...
|
|
3584
|
+
...V,
|
|
3585
3585
|
children: [
|
|
3586
3586
|
/* @__PURE__ */ s(
|
|
3587
3587
|
"path",
|
|
3588
3588
|
{
|
|
3589
|
-
d: ur({ ...
|
|
3589
|
+
d: ur({ ...u, geometry: Qe }),
|
|
3590
3590
|
fill: "transparent",
|
|
3591
3591
|
stroke: k || N ? La : "transparent",
|
|
3592
3592
|
strokeWidth: k || N ? 1.5 / ie : 0,
|
|
@@ -3596,9 +3596,9 @@ const Ql = pl.forwardRef(
|
|
|
3596
3596
|
/* @__PURE__ */ s(
|
|
3597
3597
|
"text",
|
|
3598
3598
|
{
|
|
3599
|
-
fontFamily:
|
|
3599
|
+
fontFamily: Ui,
|
|
3600
3600
|
fontSize: go,
|
|
3601
|
-
fill:
|
|
3601
|
+
fill: u.label.color ?? h.STORE_TEXT_COLOR,
|
|
3602
3602
|
textAnchor: yl(Jt),
|
|
3603
3603
|
style: {
|
|
3604
3604
|
userSelect: "none",
|
|
@@ -3619,13 +3619,13 @@ const Ql = pl.forwardRef(
|
|
|
3619
3619
|
)
|
|
3620
3620
|
]
|
|
3621
3621
|
},
|
|
3622
|
-
|
|
3622
|
+
u.id
|
|
3623
3623
|
);
|
|
3624
3624
|
}
|
|
3625
|
-
const Y = Ru(
|
|
3626
|
-
|
|
3625
|
+
const Y = Ru(u.kind), te = u.kind === "void", qe = k || N, Zt = ui(
|
|
3626
|
+
u,
|
|
3627
3627
|
h,
|
|
3628
|
-
jr.get(
|
|
3628
|
+
jr.get(u.id)
|
|
3629
3629
|
), Jr = ko(
|
|
3630
3630
|
te ? "#94a3b8" : Zt,
|
|
3631
3631
|
qe
|
|
@@ -3633,10 +3633,10 @@ const Ql = pl.forwardRef(
|
|
|
3633
3633
|
return /* @__PURE__ */ s(
|
|
3634
3634
|
"path",
|
|
3635
3635
|
{
|
|
3636
|
-
d: ur(
|
|
3636
|
+
d: ur(u),
|
|
3637
3637
|
fill: te ? `url(#${I})` : ko(Zt, qe),
|
|
3638
3638
|
fillOpacity: te ? 1 : Mu(
|
|
3639
|
-
|
|
3639
|
+
u.kind,
|
|
3640
3640
|
Y,
|
|
3641
3641
|
qe
|
|
3642
3642
|
),
|
|
@@ -3645,24 +3645,24 @@ const Ql = pl.forwardRef(
|
|
|
3645
3645
|
strokeDasharray: te && !k && !N ? `${6 / ie} ${4 / ie}` : void 0,
|
|
3646
3646
|
onPointerDown: $e,
|
|
3647
3647
|
style: he ? void 0 : ke ? { cursor: ke } : void 0,
|
|
3648
|
-
...
|
|
3648
|
+
...V
|
|
3649
3649
|
},
|
|
3650
|
-
|
|
3650
|
+
u.id
|
|
3651
3651
|
);
|
|
3652
3652
|
}),
|
|
3653
|
-
ma.map((
|
|
3653
|
+
ma.map((u) => /* @__PURE__ */ s(
|
|
3654
3654
|
zu,
|
|
3655
3655
|
{
|
|
3656
|
-
overlay:
|
|
3656
|
+
overlay: u,
|
|
3657
3657
|
imageProxyUrl: R
|
|
3658
3658
|
},
|
|
3659
|
-
`assign-overlay-${
|
|
3659
|
+
`assign-overlay-${u.shapeId}`
|
|
3660
3660
|
)),
|
|
3661
|
-
Fo(a, q) && m && !jo(m) &&
|
|
3662
|
-
(
|
|
3663
|
-
const k = yt(
|
|
3661
|
+
Fo(a, q) && m && !jo(m) && Ue(O ?? m.geometry).map(
|
|
3662
|
+
(u, g) => {
|
|
3663
|
+
const k = yt(u), N = [];
|
|
3664
3664
|
for (let b = 0; b < k; b++) {
|
|
3665
|
-
const L =
|
|
3665
|
+
const L = u.edges[b], Z = it(u, b), se = Xn(u, b), ke = (at == null ? void 0 : at.ringIndex) === g && at.edgeIndex === b, $e = Ss(u, b);
|
|
3666
3666
|
if (a === "select" && (N.push(
|
|
3667
3667
|
/* @__PURE__ */ s(
|
|
3668
3668
|
"path",
|
|
@@ -3675,28 +3675,28 @@ const Ql = pl.forwardRef(
|
|
|
3675
3675
|
style: {
|
|
3676
3676
|
cursor: Xe != null && Xe.dragging ? "grabbing" : "none"
|
|
3677
3677
|
},
|
|
3678
|
-
onPointerEnter: (
|
|
3679
|
-
onPointerMove: (
|
|
3678
|
+
onPointerEnter: (V) => is(g, b, V.clientX, V.clientY),
|
|
3679
|
+
onPointerMove: (V) => is(g, b, V.clientX, V.clientY),
|
|
3680
3680
|
onPointerLeave: () => qn(
|
|
3681
|
-
(
|
|
3681
|
+
(V) => (V == null ? void 0 : V.ringIndex) === g && V.edgeIndex === b ? null : V
|
|
3682
3682
|
),
|
|
3683
|
-
onPointerDown: (
|
|
3683
|
+
onPointerDown: (V) => {
|
|
3684
3684
|
if (a !== "select") return;
|
|
3685
|
-
const Y = Ze(
|
|
3685
|
+
const Y = Ze(V.clientX, V.clientY), te = Ue(
|
|
3686
3686
|
O ?? m.geometry
|
|
3687
3687
|
)[g];
|
|
3688
3688
|
cr(
|
|
3689
3689
|
g,
|
|
3690
3690
|
b,
|
|
3691
3691
|
te ? Os(te, b, Y) : Y,
|
|
3692
|
-
|
|
3692
|
+
V
|
|
3693
3693
|
);
|
|
3694
3694
|
}
|
|
3695
3695
|
},
|
|
3696
3696
|
`edge-hit-${m.id}-${g}-${b}`
|
|
3697
3697
|
)
|
|
3698
3698
|
), ke && at && !(Xe != null && Xe.dragging))) {
|
|
3699
|
-
const
|
|
3699
|
+
const V = at.point, Y = D(5);
|
|
3700
3700
|
N.push(
|
|
3701
3701
|
/* @__PURE__ */ s(
|
|
3702
3702
|
"path",
|
|
@@ -3734,8 +3734,8 @@ const Ql = pl.forwardRef(
|
|
|
3734
3734
|
/* @__PURE__ */ s(
|
|
3735
3735
|
"circle",
|
|
3736
3736
|
{
|
|
3737
|
-
cx:
|
|
3738
|
-
cy:
|
|
3737
|
+
cx: V.x,
|
|
3738
|
+
cy: V.y,
|
|
3739
3739
|
r: D(9),
|
|
3740
3740
|
fill: "#fff",
|
|
3741
3741
|
stroke: me,
|
|
@@ -3745,7 +3745,7 @@ const Ql = pl.forwardRef(
|
|
|
3745
3745
|
/* @__PURE__ */ s(
|
|
3746
3746
|
"path",
|
|
3747
3747
|
{
|
|
3748
|
-
d: `M ${
|
|
3748
|
+
d: `M ${V.x} ${V.y - Y} L ${V.x} ${V.y + Y} M ${V.x - Y} ${V.y} L ${V.x + Y} ${V.y}`,
|
|
3749
3749
|
fill: "none",
|
|
3750
3750
|
stroke: me,
|
|
3751
3751
|
strokeWidth: D(2),
|
|
@@ -3760,7 +3760,7 @@ const Ql = pl.forwardRef(
|
|
|
3760
3760
|
}
|
|
3761
3761
|
if (gt(a))
|
|
3762
3762
|
if ((L == null ? void 0 : L.kind) === "cubic") {
|
|
3763
|
-
const
|
|
3763
|
+
const V = (F == null ? void 0 : F.ringIndex) === g && F.edgeIndex === b && F.handle === 1, Y = (F == null ? void 0 : F.ringIndex) === g && F.edgeIndex === b && F.handle === 2;
|
|
3764
3764
|
N.push(
|
|
3765
3765
|
/* @__PURE__ */ s(
|
|
3766
3766
|
"line",
|
|
@@ -3819,13 +3819,13 @@ const Ql = pl.forwardRef(
|
|
|
3819
3819
|
`hl2-${m.id}-${g}-${b}`
|
|
3820
3820
|
),
|
|
3821
3821
|
/* @__PURE__ */ s(
|
|
3822
|
-
|
|
3822
|
+
Vn,
|
|
3823
3823
|
{
|
|
3824
3824
|
cx: L.c1.x,
|
|
3825
3825
|
cy: L.c1.y,
|
|
3826
|
-
r: D(
|
|
3826
|
+
r: D(V ? Ir : kr),
|
|
3827
3827
|
hitR: D(Ht),
|
|
3828
|
-
fill:
|
|
3828
|
+
fill: V ? me : "#fff",
|
|
3829
3829
|
stroke: me,
|
|
3830
3830
|
strokeWidth: D(nt),
|
|
3831
3831
|
cursor: "crosshair",
|
|
@@ -3855,7 +3855,7 @@ const Ql = pl.forwardRef(
|
|
|
3855
3855
|
`h1-${m.id}-${g}-${b}`
|
|
3856
3856
|
),
|
|
3857
3857
|
/* @__PURE__ */ s(
|
|
3858
|
-
|
|
3858
|
+
Vn,
|
|
3859
3859
|
{
|
|
3860
3860
|
cx: L.c2.x,
|
|
3861
3861
|
cy: L.c2.y,
|
|
@@ -3892,16 +3892,16 @@ const Ql = pl.forwardRef(
|
|
|
3892
3892
|
)
|
|
3893
3893
|
);
|
|
3894
3894
|
} else {
|
|
3895
|
-
const
|
|
3895
|
+
const V = {
|
|
3896
3896
|
x: (Z.x + se.x) / 2,
|
|
3897
3897
|
y: (Z.y + se.y) / 2
|
|
3898
3898
|
};
|
|
3899
3899
|
N.push(
|
|
3900
3900
|
/* @__PURE__ */ s(
|
|
3901
|
-
|
|
3901
|
+
Vn,
|
|
3902
3902
|
{
|
|
3903
|
-
cx:
|
|
3904
|
-
cy:
|
|
3903
|
+
cx: V.x,
|
|
3904
|
+
cy: V.y,
|
|
3905
3905
|
r: D(wr),
|
|
3906
3906
|
hitR: D(Ht),
|
|
3907
3907
|
fill: "#fff",
|
|
@@ -3923,13 +3923,13 @@ const Ql = pl.forwardRef(
|
|
|
3923
3923
|
);
|
|
3924
3924
|
}
|
|
3925
3925
|
}
|
|
3926
|
-
return zo(a) &&
|
|
3927
|
-
if (eo(a) && !
|
|
3926
|
+
return zo(a) && u.anchors.forEach((b, L) => {
|
|
3927
|
+
if (eo(a) && !u.closed && (L === 0 || L === u.anchors.length - 1))
|
|
3928
3928
|
return;
|
|
3929
3929
|
const Z = (In == null ? void 0 : In.polygonIndex) === g && (In == null ? void 0 : In.vertexIndex) === L;
|
|
3930
3930
|
N.push(
|
|
3931
3931
|
/* @__PURE__ */ s(
|
|
3932
|
-
|
|
3932
|
+
Vn,
|
|
3933
3933
|
{
|
|
3934
3934
|
cx: b.x,
|
|
3935
3935
|
cy: b.y,
|
|
@@ -4044,7 +4044,7 @@ const Ql = pl.forwardRef(
|
|
|
4044
4044
|
}
|
|
4045
4045
|
),
|
|
4046
4046
|
(Ke || Pe) && /* @__PURE__ */ s(
|
|
4047
|
-
|
|
4047
|
+
Vn,
|
|
4048
4048
|
{
|
|
4049
4049
|
cx: Yt.to.x,
|
|
4050
4050
|
cy: Yt.to.y,
|
|
@@ -4059,7 +4059,7 @@ const Ql = pl.forwardRef(
|
|
|
4059
4059
|
)
|
|
4060
4060
|
] }),
|
|
4061
4061
|
he && un && /* @__PURE__ */ s(
|
|
4062
|
-
|
|
4062
|
+
Vn,
|
|
4063
4063
|
{
|
|
4064
4064
|
cx: un.x,
|
|
4065
4065
|
cy: un.y,
|
|
@@ -4072,20 +4072,20 @@ const Ql = pl.forwardRef(
|
|
|
4072
4072
|
cursor: "default"
|
|
4073
4073
|
}
|
|
4074
4074
|
),
|
|
4075
|
-
he && gt(a) ? i.filter((
|
|
4076
|
-
if (!Ti(
|
|
4077
|
-
const g =
|
|
4075
|
+
he && gt(a) ? i.filter((u) => u.id === Et).map((u) => {
|
|
4076
|
+
if (!Ti(u)) return null;
|
|
4077
|
+
const g = Un.get(u.fromAnchorId), k = Un.get(u.toAnchorId);
|
|
4078
4078
|
if (!g || !k || g.levelId !== k.levelId) return null;
|
|
4079
|
-
const N = qr(
|
|
4079
|
+
const N = qr(u, kn, Un);
|
|
4080
4080
|
if (N) {
|
|
4081
|
-
const L = (Le == null ? void 0 : Le.edgeId) ===
|
|
4082
|
-
var
|
|
4081
|
+
const L = (Le == null ? void 0 : Le.edgeId) === u.id && Le.handle === 1, Z = (Le == null ? void 0 : Le.edgeId) === u.id && Le.handle === 2, se = (ke, $e) => {
|
|
4082
|
+
var V, Y;
|
|
4083
4083
|
if (!(j || !le)) {
|
|
4084
4084
|
if ($e.stopPropagation(), $e.detail >= 2) {
|
|
4085
|
-
le(
|
|
4085
|
+
le(u.id, null), Oe(null), We(null);
|
|
4086
4086
|
return;
|
|
4087
4087
|
}
|
|
4088
|
-
Oe({ edgeId:
|
|
4088
|
+
Oe({ edgeId: u.id, handle: ke }), We({ type: "handle", edgeId: u.id, handle: ke }), (Y = (V = X.current) == null ? void 0 : V.setPointerCapture) == null || Y.call(V, $e.pointerId);
|
|
4089
4089
|
}
|
|
4090
4090
|
};
|
|
4091
4091
|
return /* @__PURE__ */ v("g", { children: [
|
|
@@ -4142,7 +4142,7 @@ const Ql = pl.forwardRef(
|
|
|
4142
4142
|
}
|
|
4143
4143
|
),
|
|
4144
4144
|
/* @__PURE__ */ s(
|
|
4145
|
-
|
|
4145
|
+
Vn,
|
|
4146
4146
|
{
|
|
4147
4147
|
cx: N.c1.x,
|
|
4148
4148
|
cy: N.c1.y,
|
|
@@ -4153,13 +4153,13 @@ const Ql = pl.forwardRef(
|
|
|
4153
4153
|
strokeWidth: D(nt),
|
|
4154
4154
|
cursor: "crosshair",
|
|
4155
4155
|
onDoubleClick: (ke) => {
|
|
4156
|
-
ke.stopPropagation(), ke.preventDefault(), !(j || !le) && (le(
|
|
4156
|
+
ke.stopPropagation(), ke.preventDefault(), !(j || !le) && (le(u.id, null), Oe(null), We(null));
|
|
4157
4157
|
},
|
|
4158
4158
|
onPointerDown: (ke) => se(1, ke)
|
|
4159
4159
|
}
|
|
4160
4160
|
),
|
|
4161
4161
|
/* @__PURE__ */ s(
|
|
4162
|
-
|
|
4162
|
+
Vn,
|
|
4163
4163
|
{
|
|
4164
4164
|
cx: N.c2.x,
|
|
4165
4165
|
cy: N.c2.y,
|
|
@@ -4170,16 +4170,16 @@ const Ql = pl.forwardRef(
|
|
|
4170
4170
|
strokeWidth: D(nt),
|
|
4171
4171
|
cursor: "crosshair",
|
|
4172
4172
|
onDoubleClick: (ke) => {
|
|
4173
|
-
ke.stopPropagation(), ke.preventDefault(), !(j || !le) && (le(
|
|
4173
|
+
ke.stopPropagation(), ke.preventDefault(), !(j || !le) && (le(u.id, null), Oe(null), We(null));
|
|
4174
4174
|
},
|
|
4175
4175
|
onPointerDown: (ke) => se(2, ke)
|
|
4176
4176
|
}
|
|
4177
4177
|
)
|
|
4178
|
-
] }, `route-curve-${
|
|
4178
|
+
] }, `route-curve-${u.id}`);
|
|
4179
4179
|
}
|
|
4180
4180
|
const b = { x: (g.x + k.x) / 2, y: (g.y + k.y) / 2 };
|
|
4181
4181
|
return /* @__PURE__ */ s(
|
|
4182
|
-
|
|
4182
|
+
Vn,
|
|
4183
4183
|
{
|
|
4184
4184
|
cx: b.x,
|
|
4185
4185
|
cy: b.y,
|
|
@@ -4191,23 +4191,23 @@ const Ql = pl.forwardRef(
|
|
|
4191
4191
|
cursor: "grab",
|
|
4192
4192
|
onPointerDown: (L) => {
|
|
4193
4193
|
var Z, se;
|
|
4194
|
-
j || !le || (L.stopPropagation(), Oe(null), We({ type: "bend", edgeId:
|
|
4194
|
+
j || !le || (L.stopPropagation(), Oe(null), We({ type: "bend", edgeId: u.id }), (se = (Z = X.current) == null ? void 0 : Z.setPointerCapture) == null || se.call(Z, L.pointerId));
|
|
4195
4195
|
}
|
|
4196
4196
|
},
|
|
4197
|
-
`route-bend-${
|
|
4197
|
+
`route-bend-${u.id}`
|
|
4198
4198
|
);
|
|
4199
4199
|
}) : null,
|
|
4200
|
-
he && o.filter((
|
|
4201
|
-
const g = f.includes(
|
|
4202
|
-
if ($e ===
|
|
4203
|
-
const
|
|
4204
|
-
return
|
|
4205
|
-
|
|
4206
|
-
|
|
4200
|
+
he && o.filter((u) => Us(n) || u.shapeId == null).map((u) => {
|
|
4201
|
+
const g = f.includes(u.id), k = ho === u.id, N = u.shapeId != null, b = fa.has(u.id), L = Un.get(u.id) ?? u, Z = E === u.id && Hn != null, se = g && f.some(($e) => {
|
|
4202
|
+
if ($e === u.id) return !1;
|
|
4203
|
+
const V = kn.get($e);
|
|
4204
|
+
return V && Math.hypot(
|
|
4205
|
+
V.x - L.x,
|
|
4206
|
+
V.y - L.y
|
|
4207
4207
|
) <= 2.5;
|
|
4208
4208
|
}), ke = g || N ? js : pi;
|
|
4209
4209
|
return /* @__PURE__ */ s("g", { children: /* @__PURE__ */ s(
|
|
4210
|
-
|
|
4210
|
+
Vn,
|
|
4211
4211
|
{
|
|
4212
4212
|
cx: L.x,
|
|
4213
4213
|
cy: L.y,
|
|
@@ -4217,19 +4217,19 @@ const Ql = pl.forwardRef(
|
|
|
4217
4217
|
fillOpacity: 1,
|
|
4218
4218
|
stroke: g && N ? me : "#fff",
|
|
4219
4219
|
strokeWidth: D(fi),
|
|
4220
|
-
cursor: he ? void 0 : j ? "default" : E ===
|
|
4220
|
+
cursor: he ? void 0 : j ? "default" : E === u.id ? "grabbing" : "pointer",
|
|
4221
4221
|
onPointerEnter: () => {
|
|
4222
|
-
j || ct(
|
|
4222
|
+
j || ct(u.id);
|
|
4223
4223
|
},
|
|
4224
|
-
onPointerLeave: () => ct(($e) => $e ===
|
|
4224
|
+
onPointerLeave: () => ct(($e) => $e === u.id ? null : $e),
|
|
4225
4225
|
onDoubleClick: ($e) => {
|
|
4226
|
-
$e.stopPropagation(), $e.preventDefault(), gr(a) && Ia(
|
|
4226
|
+
$e.stopPropagation(), $e.preventDefault(), gr(a) && Ia(u.id);
|
|
4227
4227
|
},
|
|
4228
4228
|
onPointerDown: ($e) => {
|
|
4229
4229
|
var qe, Zt;
|
|
4230
4230
|
if ($e.stopPropagation(), j || !he || gr(a) && $e.detail >= 2) return;
|
|
4231
|
-
const
|
|
4232
|
-
|
|
4231
|
+
const V = Ze($e.clientX, $e.clientY), Y = Wo(o, Pe), te = wt(
|
|
4232
|
+
V,
|
|
4233
4233
|
o,
|
|
4234
4234
|
i,
|
|
4235
4235
|
Y,
|
|
@@ -4237,7 +4237,7 @@ const Ql = pl.forwardRef(
|
|
|
4237
4237
|
kn
|
|
4238
4238
|
);
|
|
4239
4239
|
if (Pe) {
|
|
4240
|
-
if (Y.has(
|
|
4240
|
+
if (Y.has(u.id) && (te == null ? void 0 : te.type) !== "edge" && (te == null ? void 0 : te.type) !== "junction")
|
|
4241
4241
|
return;
|
|
4242
4242
|
if ((te == null ? void 0 : te.type) === "edge" || (te == null ? void 0 : te.type) === "junction") {
|
|
4243
4243
|
Q(
|
|
@@ -4248,7 +4248,7 @@ const Ql = pl.forwardRef(
|
|
|
4248
4248
|
), kt(null), Te(null);
|
|
4249
4249
|
return;
|
|
4250
4250
|
}
|
|
4251
|
-
if (Y.has(
|
|
4251
|
+
if (Y.has(u.id)) return;
|
|
4252
4252
|
Q(
|
|
4253
4253
|
Pe.shapeId,
|
|
4254
4254
|
Pe.origin,
|
|
@@ -4262,36 +4262,36 @@ const Ql = pl.forwardRef(
|
|
|
4262
4262
|
return;
|
|
4263
4263
|
}
|
|
4264
4264
|
if (mn(a) && un) {
|
|
4265
|
-
re(un,
|
|
4265
|
+
re(un, u.id), Cn(null), yn(Wt(a, u.id)), Te({ x: L.x, y: L.y }), bt([u.id]);
|
|
4266
4266
|
return;
|
|
4267
4267
|
}
|
|
4268
|
-
if (mn(a) && tn != null && tn !==
|
|
4269
|
-
ne == null || ne(tn,
|
|
4268
|
+
if (mn(a) && tn != null && tn !== u.id) {
|
|
4269
|
+
ne == null || ne(tn, u.id), yn(Wt(a, u.id)), Te({ x: L.x, y: L.y }), bt([u.id]);
|
|
4270
4270
|
return;
|
|
4271
4271
|
}
|
|
4272
4272
|
if (mn(a) && N && !b) {
|
|
4273
4273
|
Cn(null), yn(null), kt({
|
|
4274
|
-
shapeId:
|
|
4274
|
+
shapeId: u.shapeId,
|
|
4275
4275
|
origin: { x: L.x, y: L.y }
|
|
4276
4276
|
}), Te({ x: L.x, y: L.y });
|
|
4277
4277
|
return;
|
|
4278
4278
|
}
|
|
4279
|
-
yn(
|
|
4280
|
-
$e.shiftKey ? f.includes(
|
|
4281
|
-
), z(
|
|
4279
|
+
yn(u.id), bt(
|
|
4280
|
+
$e.shiftKey ? f.includes(u.id) ? f.filter((Jr) => Jr !== u.id) : [...f, u.id] : [u.id]
|
|
4281
|
+
), z(u.id), _e({
|
|
4282
4282
|
x: L.x,
|
|
4283
4283
|
y: L.y
|
|
4284
4284
|
}), (Zt = (qe = $e.currentTarget).setPointerCapture) == null || Zt.call(qe, $e.pointerId);
|
|
4285
4285
|
}
|
|
4286
4286
|
}
|
|
4287
|
-
) },
|
|
4287
|
+
) }, u.id);
|
|
4288
4288
|
}),
|
|
4289
|
-
eo(a) && !j && P.flatMap((
|
|
4290
|
-
const g =
|
|
4289
|
+
eo(a) && !j && P.flatMap((u) => {
|
|
4290
|
+
const g = Ue(u.geometry), k = [];
|
|
4291
4291
|
return Qt(a) && g.forEach((N, b) => {
|
|
4292
4292
|
const L = yt(N);
|
|
4293
4293
|
for (let Z = 0; Z < L; Z++) {
|
|
4294
|
-
const se = (xn == null ? void 0 : xn.shapeId) ===
|
|
4294
|
+
const se = (xn == null ? void 0 : xn.shapeId) === u.id && xn.ringIndex === b && xn.edgeIndex === Z;
|
|
4295
4295
|
k.push(
|
|
4296
4296
|
/* @__PURE__ */ s(
|
|
4297
4297
|
"path",
|
|
@@ -4304,25 +4304,25 @@ const Ql = pl.forwardRef(
|
|
|
4304
4304
|
strokeLinecap: "round",
|
|
4305
4305
|
style: { cursor: "cell" },
|
|
4306
4306
|
onPointerLeave: () => Bn(
|
|
4307
|
-
(ke) => (ke == null ? void 0 : ke.shapeId) ===
|
|
4307
|
+
(ke) => (ke == null ? void 0 : ke.shapeId) === u.id && ke.ringIndex === b && ke.edgeIndex === Z ? null : ke
|
|
4308
4308
|
),
|
|
4309
4309
|
onPointerDown: (ke) => {
|
|
4310
4310
|
ke.stopPropagation(), An(Ze(ke.clientX, ke.clientY));
|
|
4311
4311
|
}
|
|
4312
4312
|
},
|
|
4313
|
-
`sj-hit-${
|
|
4313
|
+
`sj-hit-${u.id}-${b}-${Z}`
|
|
4314
4314
|
)
|
|
4315
4315
|
);
|
|
4316
4316
|
}
|
|
4317
|
-
}), qo(
|
|
4317
|
+
}), qo(u.geometry).forEach((N) => {
|
|
4318
4318
|
const b = {
|
|
4319
|
-
shapeId:
|
|
4319
|
+
shapeId: u.id,
|
|
4320
4320
|
ringIndex: N.ringIndex,
|
|
4321
4321
|
end: N.end
|
|
4322
|
-
}, L = hn != null &&
|
|
4322
|
+
}, L = hn != null && Vo(hn, b), Z = Tt != null && Vo(Tt, b);
|
|
4323
4323
|
k.push(
|
|
4324
4324
|
/* @__PURE__ */ s(
|
|
4325
|
-
|
|
4325
|
+
Vn,
|
|
4326
4326
|
{
|
|
4327
4327
|
cx: N.point.x,
|
|
4328
4328
|
cy: N.point.y,
|
|
@@ -4336,18 +4336,18 @@ const Ql = pl.forwardRef(
|
|
|
4336
4336
|
se.stopPropagation(), Nn(N.point);
|
|
4337
4337
|
}
|
|
4338
4338
|
},
|
|
4339
|
-
`sj-end-${
|
|
4339
|
+
`sj-end-${u.id}-${N.ringIndex}-${N.end}`
|
|
4340
4340
|
)
|
|
4341
4341
|
);
|
|
4342
4342
|
}), k;
|
|
4343
4343
|
}),
|
|
4344
4344
|
Qt(a) && xn && !xn.shared && !Tt && !ve(xn.point, D(At)) && (() => {
|
|
4345
|
-
const
|
|
4345
|
+
const u = P.find(
|
|
4346
4346
|
(N) => N.id === xn.shapeId
|
|
4347
4347
|
);
|
|
4348
|
-
if (!
|
|
4348
|
+
if (!u) return null;
|
|
4349
4349
|
const g = ru(
|
|
4350
|
-
|
|
4350
|
+
u.geometry,
|
|
4351
4351
|
xn.ringIndex,
|
|
4352
4352
|
xn.edgeIndex,
|
|
4353
4353
|
xn.point,
|
|
@@ -4382,9 +4382,9 @@ const Ql = pl.forwardRef(
|
|
|
4382
4382
|
})(),
|
|
4383
4383
|
eo(a) && hn && $ && (() => {
|
|
4384
4384
|
var N;
|
|
4385
|
-
const
|
|
4385
|
+
const u = P.find(
|
|
4386
4386
|
(b) => b.id === hn.shapeId
|
|
4387
|
-
), g =
|
|
4387
|
+
), g = u ? (N = qo(u.geometry).find(
|
|
4388
4388
|
(b) => b.ringIndex === hn.ringIndex && b.end === hn.end
|
|
4389
4389
|
)) == null ? void 0 : N.point : null;
|
|
4390
4390
|
if (!g) return null;
|
|
@@ -4405,7 +4405,7 @@ const Ql = pl.forwardRef(
|
|
|
4405
4405
|
);
|
|
4406
4406
|
})(),
|
|
4407
4407
|
De.length > 1 && vo(a) && (() => {
|
|
4408
|
-
const
|
|
4408
|
+
const u = Wl(
|
|
4409
4409
|
De[0],
|
|
4410
4410
|
De[De.length - 1],
|
|
4411
4411
|
H
|
|
@@ -4413,10 +4413,10 @@ const Ql = pl.forwardRef(
|
|
|
4413
4413
|
return /* @__PURE__ */ s(
|
|
4414
4414
|
"ellipse",
|
|
4415
4415
|
{
|
|
4416
|
-
cx:
|
|
4417
|
-
cy:
|
|
4418
|
-
rx: Math.max(
|
|
4419
|
-
ry: Math.max(
|
|
4416
|
+
cx: u.cx,
|
|
4417
|
+
cy: u.cy,
|
|
4418
|
+
rx: Math.max(u.rx, 0),
|
|
4419
|
+
ry: Math.max(u.ry, 0),
|
|
4420
4420
|
fill: h.STORE_DEFAULT_COLOR,
|
|
4421
4421
|
fillOpacity: 0.2,
|
|
4422
4422
|
stroke: me,
|
|
@@ -4457,7 +4457,7 @@ const Ql = pl.forwardRef(
|
|
|
4457
4457
|
/* @__PURE__ */ s(
|
|
4458
4458
|
"polyline",
|
|
4459
4459
|
{
|
|
4460
|
-
points: Ce.map((
|
|
4460
|
+
points: Ce.map((u) => `${u.x},${u.y}`).join(" "),
|
|
4461
4461
|
fill: "none",
|
|
4462
4462
|
stroke: me,
|
|
4463
4463
|
strokeWidth: 2 / ie,
|
|
@@ -4491,13 +4491,13 @@ const Ql = pl.forwardRef(
|
|
|
4491
4491
|
strokeLinecap: "round"
|
|
4492
4492
|
}
|
|
4493
4493
|
),
|
|
4494
|
-
Ce.map((
|
|
4495
|
-
const k = $s(pn,
|
|
4494
|
+
Ce.map((u, g) => {
|
|
4495
|
+
const k = $s(pn, u);
|
|
4496
4496
|
return /* @__PURE__ */ s(
|
|
4497
|
-
|
|
4497
|
+
Vn,
|
|
4498
4498
|
{
|
|
4499
|
-
cx:
|
|
4500
|
-
cy:
|
|
4499
|
+
cx: u.x,
|
|
4500
|
+
cy: u.y,
|
|
4501
4501
|
r: D(g === 0 ? Gs : Ko),
|
|
4502
4502
|
hitR: D(At),
|
|
4503
4503
|
fill: g === 0 || k ? me : "#fff",
|
|
@@ -4508,8 +4508,8 @@ const Ql = pl.forwardRef(
|
|
|
4508
4508
|
`pp-${g}`
|
|
4509
4509
|
);
|
|
4510
4510
|
}),
|
|
4511
|
-
pn && !Ce.some((
|
|
4512
|
-
|
|
4511
|
+
pn && !Ce.some((u) => $s(pn, u)) && /* @__PURE__ */ s(
|
|
4512
|
+
Vn,
|
|
4513
4513
|
{
|
|
4514
4514
|
cx: pn.x,
|
|
4515
4515
|
cy: pn.y,
|
|
@@ -4583,12 +4583,12 @@ function No(e) {
|
|
|
4583
4583
|
if (!t) return null;
|
|
4584
4584
|
const i = n.slice(t.prefix.length).replace(/^-+/, "").split("-").filter(Boolean);
|
|
4585
4585
|
let r, l;
|
|
4586
|
-
const
|
|
4586
|
+
const d = [];
|
|
4587
4587
|
for (const h of i)
|
|
4588
|
-
h === "up" || h === "down" ? r = h : h === "start" || h === "end" ? l = h :
|
|
4588
|
+
h === "up" || h === "down" ? r = h : h === "start" || h === "end" ? l = h : d.push(h);
|
|
4589
4589
|
return {
|
|
4590
4590
|
family: t.family,
|
|
4591
|
-
group:
|
|
4591
|
+
group: d.join("-") || "1",
|
|
4592
4592
|
direction: r,
|
|
4593
4593
|
role: l
|
|
4594
4594
|
};
|
|
@@ -4644,8 +4644,8 @@ function gh(e, n, t, o = /* @__PURE__ */ new Set()) {
|
|
|
4644
4644
|
let i = null, r = 1 / 0;
|
|
4645
4645
|
for (const l of e) {
|
|
4646
4646
|
if (l.levelId !== n || o.has(l.id) || l.kind !== "junction" && l.kind !== "unit") continue;
|
|
4647
|
-
const
|
|
4648
|
-
|
|
4647
|
+
const d = Fn(l, t);
|
|
4648
|
+
d < r && (i = l, r = d);
|
|
4649
4649
|
}
|
|
4650
4650
|
return i;
|
|
4651
4651
|
}
|
|
@@ -4670,7 +4670,7 @@ function na(e, n, t, o) {
|
|
|
4670
4670
|
(f) => f.kind === "connector" && f.directed && r.has(f.fromAnchorId) && r.has(f.toAnchorId)
|
|
4671
4671
|
);
|
|
4672
4672
|
if (!l) return null;
|
|
4673
|
-
const
|
|
4673
|
+
const d = n.find((f) => f.id === l.fromAnchorId), h = n.find((f) => f.id === l.toAnchorId), a = o.find((f) => f.id === (d == null ? void 0 : d.shapeId)), p = o.find((f) => f.id === (h == null ? void 0 : h.shapeId));
|
|
4674
4674
|
return !a || !p ? null : { from: a, to: p };
|
|
4675
4675
|
}
|
|
4676
4676
|
function ta(e, n) {
|
|
@@ -4707,8 +4707,8 @@ function _h(e, n, t, o, i = []) {
|
|
|
4707
4707
|
const r = [];
|
|
4708
4708
|
for (const l of e) {
|
|
4709
4709
|
if (l.kind !== "escalator") continue;
|
|
4710
|
-
const
|
|
4711
|
-
o.filter((p) =>
|
|
4710
|
+
const d = new Set(Eo(l.id, n)), h = oa(
|
|
4711
|
+
o.filter((p) => d.has(p.id)),
|
|
4712
4712
|
i
|
|
4713
4713
|
), a = na(l.id, n, t, o);
|
|
4714
4714
|
if (a) {
|
|
@@ -4727,8 +4727,8 @@ function _h(e, n, t, o, i = []) {
|
|
|
4727
4727
|
members: h
|
|
4728
4728
|
});
|
|
4729
4729
|
}
|
|
4730
|
-
return r.sort((l,
|
|
4731
|
-
const h = l.members[0] ?? l.from, a =
|
|
4730
|
+
return r.sort((l, d) => {
|
|
4731
|
+
const h = l.members[0] ?? l.from, a = d.members[0] ?? d.from, p = So(
|
|
4732
4732
|
Co(h.levelId, i),
|
|
4733
4733
|
Co(a.levelId, i)
|
|
4734
4734
|
);
|
|
@@ -4744,20 +4744,20 @@ function kh(e, n, t, o) {
|
|
|
4744
4744
|
const i = [];
|
|
4745
4745
|
for (const r of e) {
|
|
4746
4746
|
if (r.kind !== "elevator") continue;
|
|
4747
|
-
const l = new Set(Eo(r.id, n)),
|
|
4748
|
-
|
|
4747
|
+
const l = new Set(Eo(r.id, n)), d = t.filter((h) => l.has(h.id));
|
|
4748
|
+
d.length !== 0 && i.push({
|
|
4749
4749
|
connectorId: r.id,
|
|
4750
|
-
lines: ra(
|
|
4750
|
+
lines: ra(d, o)
|
|
4751
4751
|
});
|
|
4752
4752
|
}
|
|
4753
4753
|
return i.sort((r, l) => {
|
|
4754
|
-
const
|
|
4755
|
-
if (!
|
|
4756
|
-
const a = t.find((c) => c.id ===
|
|
4754
|
+
const d = r.lines[0], h = l.lines[0];
|
|
4755
|
+
if (!d || !h) return 0;
|
|
4756
|
+
const a = t.find((c) => c.id === d.shapeId), p = t.find((c) => c.id === h.shapeId), f = So(
|
|
4757
4757
|
Co((a == null ? void 0 : a.levelId) ?? -1, o),
|
|
4758
4758
|
Co((p == null ? void 0 : p.levelId) ?? -1, o)
|
|
4759
4759
|
);
|
|
4760
|
-
return f !== 0 ? f :
|
|
4760
|
+
return f !== 0 ? f : d.key.localeCompare(h.key);
|
|
4761
4761
|
});
|
|
4762
4762
|
}
|
|
4763
4763
|
function Ih(e, n, t, o, i, r = []) {
|
|
@@ -4770,15 +4770,15 @@ function Ih(e, n, t, o, i, r = []) {
|
|
|
4770
4770
|
const f = Qs(e.id, n, o, i);
|
|
4771
4771
|
return f.length === 1 ? `${e.key} → ${f[0].key}` : null;
|
|
4772
4772
|
}
|
|
4773
|
-
const
|
|
4774
|
-
if (
|
|
4773
|
+
const d = [e, ...Qs(e.id, n, o, i)];
|
|
4774
|
+
if (d.length < 2) return null;
|
|
4775
4775
|
const h = new Map(
|
|
4776
4776
|
r.map((p, f) => [
|
|
4777
4777
|
p.id,
|
|
4778
4778
|
(p.ordering ?? p.levelIndex ?? f) * 1e3 + (p.levelIndex ?? f)
|
|
4779
4779
|
])
|
|
4780
4780
|
);
|
|
4781
|
-
return
|
|
4781
|
+
return d.slice().sort((p, f) => {
|
|
4782
4782
|
const c = h.get(p.levelId) ?? Number.POSITIVE_INFINITY, _ = h.get(f.levelId) ?? Number.POSITIVE_INFINITY;
|
|
4783
4783
|
return c - _;
|
|
4784
4784
|
}).map((p) => yh(p, r)).join(" ↔ ");
|
|
@@ -4792,12 +4792,12 @@ function Pr(e, n, t, o) {
|
|
|
4792
4792
|
const i = ph(n.id, e.anchors), r = i ? { x: i.x, y: i.y } : fh(n);
|
|
4793
4793
|
if (i) {
|
|
4794
4794
|
if (i.connectorId !== t || i.kind !== "connector") {
|
|
4795
|
-
const
|
|
4795
|
+
const d = {
|
|
4796
4796
|
...i,
|
|
4797
4797
|
kind: "connector",
|
|
4798
4798
|
connectorId: t
|
|
4799
4799
|
};
|
|
4800
|
-
return o.push({ op: "upsert_anchor", anchor:
|
|
4800
|
+
return o.push({ op: "upsert_anchor", anchor: d }), e.anchors = e.anchors.map((h) => h.id === d.id ? d : h), d;
|
|
4801
4801
|
}
|
|
4802
4802
|
return i;
|
|
4803
4803
|
}
|
|
@@ -4852,12 +4852,12 @@ function Lr(e, n) {
|
|
|
4852
4852
|
return bh(e, n);
|
|
4853
4853
|
}
|
|
4854
4854
|
function xh(e, n, t, o, i) {
|
|
4855
|
-
const r = (t == null ? void 0 : t.levelIndex) ?? 0, l = (o == null ? void 0 : o.levelIndex) ?? 0,
|
|
4856
|
-
return i === "down" ? { board: h, exit:
|
|
4855
|
+
const r = (t == null ? void 0 : t.levelIndex) ?? 0, l = (o == null ? void 0 : o.levelIndex) ?? 0, d = r <= l ? e : n, h = r <= l ? n : e, a = r <= l ? t : o, p = r <= l ? o : t;
|
|
4856
|
+
return i === "down" ? { board: h, exit: d, boardLevel: p, exitLevel: a } : { board: d, exit: h, boardLevel: a, exitLevel: p };
|
|
4857
4857
|
}
|
|
4858
4858
|
function wh(e, n, t, o) {
|
|
4859
4859
|
var q, j;
|
|
4860
|
-
const i = e.levels.find((oe) => oe.id === n.levelId), r = e.levels.find((oe) => oe.id === t.levelId), l = o == null ? void 0 : o.direction,
|
|
4860
|
+
const i = e.levels.find((oe) => oe.id === n.levelId), r = e.levels.find((oe) => oe.id === t.levelId), l = o == null ? void 0 : o.direction, d = l === "up" || l === "down" ? xh(n, t, i, r, l) : null, h = (d == null ? void 0 : d.board) ?? n, a = (d == null ? void 0 : d.exit) ?? t, p = (d == null ? void 0 : d.boardLevel) ?? i, f = (d == null ? void 0 : d.exitLevel) ?? r, c = mh(
|
|
4861
4861
|
(p == null ? void 0 : p.levelIndex) ?? 0,
|
|
4862
4862
|
(f == null ? void 0 : f.levelIndex) ?? 0,
|
|
4863
4863
|
l ?? ((q = No(n.sourceSvgId)) == null ? void 0 : q.direction) ?? ((j = No(t.sourceSvgId)) == null ? void 0 : j.direction)
|
|
@@ -4907,26 +4907,26 @@ function Nh(e, n, t) {
|
|
|
4907
4907
|
}
|
|
4908
4908
|
];
|
|
4909
4909
|
if (r.length < 2) return l;
|
|
4910
|
-
const
|
|
4910
|
+
const d = {
|
|
4911
4911
|
...e,
|
|
4912
4912
|
anchors: e.anchors.slice(),
|
|
4913
4913
|
edges: e.edges.slice(),
|
|
4914
4914
|
connectors: e.connectors.slice()
|
|
4915
4915
|
}, h = new Set(
|
|
4916
|
-
|
|
4916
|
+
d.anchors.filter((f) => f.connectorId === n).map((f) => f.id)
|
|
4917
4917
|
);
|
|
4918
|
-
for (const f of Yi(
|
|
4918
|
+
for (const f of Yi(d.edges, h))
|
|
4919
4919
|
l.push({ op: "delete_edge", edgeId: f.id });
|
|
4920
|
-
|
|
4920
|
+
d.edges = d.edges.filter(
|
|
4921
4921
|
(f) => !(f.kind === "connector" && h.has(f.fromAnchorId) && h.has(f.toAnchorId))
|
|
4922
4922
|
);
|
|
4923
4923
|
const p = (t === "down" ? r.slice().reverse() : r).map(
|
|
4924
|
-
(f) => Pr(
|
|
4924
|
+
(f) => Pr(d, f, n, l)
|
|
4925
4925
|
);
|
|
4926
4926
|
for (let f = 0; f < p.length - 1; f++) {
|
|
4927
4927
|
const c = {
|
|
4928
|
-
id:
|
|
4929
|
-
mapId:
|
|
4928
|
+
id: d.allocId(),
|
|
4929
|
+
mapId: d.mapId,
|
|
4930
4930
|
fromAnchorId: p[f].id,
|
|
4931
4931
|
toAnchorId: p[f + 1].id,
|
|
4932
4932
|
weight: null,
|
|
@@ -4934,7 +4934,7 @@ function Nh(e, n, t) {
|
|
|
4934
4934
|
accessible: !1,
|
|
4935
4935
|
kind: "connector"
|
|
4936
4936
|
};
|
|
4937
|
-
l.push({ op: "upsert_edge", edge: c }),
|
|
4937
|
+
l.push({ op: "upsert_edge", edge: c }), d.edges = [...d.edges, c];
|
|
4938
4938
|
}
|
|
4939
4939
|
return l;
|
|
4940
4940
|
}
|
|
@@ -4946,10 +4946,10 @@ function Ch(e, n, t) {
|
|
|
4946
4946
|
anchors: e.anchors.slice(),
|
|
4947
4947
|
edges: e.edges.slice(),
|
|
4948
4948
|
connectors: e.connectors.slice()
|
|
4949
|
-
},
|
|
4949
|
+
}, d = new Set(
|
|
4950
4950
|
i.map((c) => er(c.id, l.anchors)).filter((c) => c != null)
|
|
4951
|
-
), h = (t == null ? void 0 : t.connectorId) ?? (
|
|
4952
|
-
for (const c of
|
|
4951
|
+
), h = (t == null ? void 0 : t.connectorId) ?? (d.size === 1 ? [...d][0] : void 0);
|
|
4952
|
+
for (const c of d) {
|
|
4953
4953
|
if (c === h) {
|
|
4954
4954
|
const _ = l.anchors.filter((w) => w.connectorId === c), C = new Set(i.map((w) => w.id)), R = new Set(_.map((w) => w.id));
|
|
4955
4955
|
for (const w of Yi(l.edges, R))
|
|
@@ -5017,7 +5017,7 @@ function Sh(e, n) {
|
|
|
5017
5017
|
const r = e.shapes.find((h) => h.id === i), l = o.geometry ?? (r == null ? void 0 : r.geometry) ?? {
|
|
5018
5018
|
paths: [],
|
|
5019
5019
|
polygons: []
|
|
5020
|
-
},
|
|
5020
|
+
}, d = {
|
|
5021
5021
|
id: i,
|
|
5022
5022
|
levelId: o.levelId ?? (r == null ? void 0 : r.levelId) ?? 0,
|
|
5023
5023
|
key: o.key ?? (r == null ? void 0 : r.key) ?? `shape-${i}`,
|
|
@@ -5036,7 +5036,7 @@ function Sh(e, n) {
|
|
|
5036
5036
|
geometryLocked: o.geometryLocked ?? (o.geometry != null ? !0 : r == null ? void 0 : r.geometryLocked) ?? !1,
|
|
5037
5037
|
orphanedAt: o.orphanedAt ?? (r == null ? void 0 : r.orphanedAt) ?? null
|
|
5038
5038
|
};
|
|
5039
|
-
return { ...e, shapes: Cr(e.shapes,
|
|
5039
|
+
return { ...e, shapes: Cr(e.shapes, d) };
|
|
5040
5040
|
}
|
|
5041
5041
|
case "delete_shape":
|
|
5042
5042
|
return {
|
|
@@ -5056,7 +5056,7 @@ function Sh(e, n) {
|
|
|
5056
5056
|
case "upsert_anchor": {
|
|
5057
5057
|
const o = n.anchor, i = o.id;
|
|
5058
5058
|
if (i == null) return e;
|
|
5059
|
-
const r = e.anchors.find((
|
|
5059
|
+
const r = e.anchors.find((d) => d.id === i), l = {
|
|
5060
5060
|
id: i,
|
|
5061
5061
|
levelId: o.levelId ?? (r == null ? void 0 : r.levelId) ?? 0,
|
|
5062
5062
|
shapeId: o.shapeId ?? (r == null ? void 0 : r.shapeId) ?? null,
|
|
@@ -5078,7 +5078,7 @@ function Sh(e, n) {
|
|
|
5078
5078
|
case "upsert_edge": {
|
|
5079
5079
|
const o = n.edge, i = o.id;
|
|
5080
5080
|
if (i == null) return e;
|
|
5081
|
-
const r = e.edges.find((h) => h.id === i), l = o.curve !== void 0 ? Io({ curve: o.curve }) : Io(r),
|
|
5081
|
+
const r = e.edges.find((h) => h.id === i), l = o.curve !== void 0 ? Io({ curve: o.curve }) : Io(r), d = {
|
|
5082
5082
|
id: i,
|
|
5083
5083
|
mapId: o.mapId ?? (r == null ? void 0 : r.mapId) ?? e.mapId,
|
|
5084
5084
|
fromAnchorId: o.fromAnchorId ?? (r == null ? void 0 : r.fromAnchorId) ?? 0,
|
|
@@ -5089,21 +5089,21 @@ function Sh(e, n) {
|
|
|
5089
5089
|
kind: o.kind ?? (r == null ? void 0 : r.kind) ?? "walk",
|
|
5090
5090
|
...l ? { curve: l } : {}
|
|
5091
5091
|
};
|
|
5092
|
-
return { ...e, edges: Cr(e.edges,
|
|
5092
|
+
return { ...e, edges: Cr(e.edges, d) };
|
|
5093
5093
|
}
|
|
5094
5094
|
case "delete_edge":
|
|
5095
5095
|
return { ...e, edges: e.edges.filter((o) => o.id !== n.edgeId) };
|
|
5096
5096
|
case "weld_anchors": {
|
|
5097
|
-
const o = (n.anchorIds ?? []).filter((
|
|
5097
|
+
const o = (n.anchorIds ?? []).filter((d) => Number.isFinite(d));
|
|
5098
5098
|
if (o.length < 2) return e;
|
|
5099
|
-
const i = o[0], r = new Set(o.slice(1)), l = e.edges.map((
|
|
5100
|
-
...
|
|
5101
|
-
fromAnchorId: r.has(
|
|
5102
|
-
toAnchorId: r.has(
|
|
5103
|
-
})).filter((
|
|
5099
|
+
const i = o[0], r = new Set(o.slice(1)), l = e.edges.map((d) => ({
|
|
5100
|
+
...d,
|
|
5101
|
+
fromAnchorId: r.has(d.fromAnchorId) ? i : d.fromAnchorId,
|
|
5102
|
+
toAnchorId: r.has(d.toAnchorId) ? i : d.toAnchorId
|
|
5103
|
+
})).filter((d) => d.fromAnchorId !== d.toAnchorId);
|
|
5104
5104
|
return {
|
|
5105
5105
|
...e,
|
|
5106
|
-
anchors: e.anchors.filter((
|
|
5106
|
+
anchors: e.anchors.filter((d) => !r.has(d.id)),
|
|
5107
5107
|
edges: l
|
|
5108
5108
|
};
|
|
5109
5109
|
}
|
|
@@ -5114,7 +5114,7 @@ function Sh(e, n) {
|
|
|
5114
5114
|
case "upsert_connector": {
|
|
5115
5115
|
const o = n.connector, i = o.id;
|
|
5116
5116
|
if (i == null) return e;
|
|
5117
|
-
const r = e.connectors.find((
|
|
5117
|
+
const r = e.connectors.find((d) => d.id === i), l = {
|
|
5118
5118
|
id: i,
|
|
5119
5119
|
mapId: o.mapId ?? (r == null ? void 0 : r.mapId) ?? e.mapId,
|
|
5120
5120
|
kind: o.kind ?? (r == null ? void 0 : r.kind) ?? "escalator",
|
|
@@ -5172,8 +5172,8 @@ function Oh(e, n) {
|
|
|
5172
5172
|
function Ah(e) {
|
|
5173
5173
|
let n = !1;
|
|
5174
5174
|
const t = e.shapes.map((o) => {
|
|
5175
|
-
const i = rc(o.geometry), r = wi(o) ?? o.label, l = i !== o.geometry,
|
|
5176
|
-
return !l && !
|
|
5175
|
+
const i = rc(o.geometry), r = wi(o) ?? o.label, l = i !== o.geometry, d = r !== o.label;
|
|
5176
|
+
return !l && !d ? o : (n = !0, {
|
|
5177
5177
|
...o,
|
|
5178
5178
|
geometry: i,
|
|
5179
5179
|
bbox: l ? jn(i) : o.bbox,
|
|
@@ -5293,9 +5293,9 @@ function Rh(e) {
|
|
|
5293
5293
|
), l = [];
|
|
5294
5294
|
for (const c of e)
|
|
5295
5295
|
c.op === "upsert_anchor" && c.anchor.id != null && t.has(c.anchor.id) || c.op === "delete_anchor" && c.anchorId < 0 && i.has(c.anchorId) || c.op === "upsert_edge" && c.edge.id != null && n.has(c.edge.id) || c.op === "delete_edge" && c.edgeId < 0 && o.has(c.edgeId) || c.op === "upsert_edge" && (r.has(c.edge.fromAnchorId) || r.has(c.edge.toAnchorId)) || l.push(c);
|
|
5296
|
-
const
|
|
5296
|
+
const d = /* @__PURE__ */ new Map();
|
|
5297
5297
|
l.forEach((c, _) => {
|
|
5298
|
-
c.op === "upsert_edge" &&
|
|
5298
|
+
c.op === "upsert_edge" && d.set(Ho(c.edge), _);
|
|
5299
5299
|
});
|
|
5300
5300
|
const h = /* @__PURE__ */ new Map();
|
|
5301
5301
|
l.forEach((c) => {
|
|
@@ -5304,7 +5304,7 @@ function Rh(e) {
|
|
|
5304
5304
|
const a = /* @__PURE__ */ new Set(), p = [];
|
|
5305
5305
|
return l.forEach((c, _) => {
|
|
5306
5306
|
if (c.op !== "upsert_edge") return;
|
|
5307
|
-
const C =
|
|
5307
|
+
const C = d.get(Ho(c.edge));
|
|
5308
5308
|
if (C == null || C === _) return;
|
|
5309
5309
|
a.add(_);
|
|
5310
5310
|
const R = l[C];
|
|
@@ -5391,7 +5391,7 @@ function Nt({
|
|
|
5391
5391
|
onChange: i,
|
|
5392
5392
|
onStep: r,
|
|
5393
5393
|
onHoldStart: l,
|
|
5394
|
-
onHoldEnd:
|
|
5394
|
+
onHoldEnd: d
|
|
5395
5395
|
}) {
|
|
5396
5396
|
const [h, a] = T(() => String(n)), p = ae(!1), f = ae(!1);
|
|
5397
5397
|
ue(() => {
|
|
@@ -5414,8 +5414,8 @@ function Nt({
|
|
|
5414
5414
|
"aria-label": `Decrease ${e}`,
|
|
5415
5415
|
onClick: () => r(-1),
|
|
5416
5416
|
onMouseDown: () => l(-1),
|
|
5417
|
-
onMouseUp:
|
|
5418
|
-
onMouseLeave:
|
|
5417
|
+
onMouseUp: d,
|
|
5418
|
+
onMouseLeave: d,
|
|
5419
5419
|
children: "−"
|
|
5420
5420
|
}
|
|
5421
5421
|
),
|
|
@@ -5451,8 +5451,8 @@ function Nt({
|
|
|
5451
5451
|
"aria-label": `Increase ${e}`,
|
|
5452
5452
|
onClick: () => r(1),
|
|
5453
5453
|
onMouseDown: () => l(1),
|
|
5454
|
-
onMouseUp:
|
|
5455
|
-
onMouseLeave:
|
|
5454
|
+
onMouseUp: d,
|
|
5455
|
+
onMouseLeave: d,
|
|
5456
5456
|
children: "+"
|
|
5457
5457
|
}
|
|
5458
5458
|
)
|
|
@@ -5468,7 +5468,7 @@ function qi({
|
|
|
5468
5468
|
disabled: i,
|
|
5469
5469
|
emptyIsTransparent: r = !0,
|
|
5470
5470
|
onHexChange: l,
|
|
5471
|
-
onCommit:
|
|
5471
|
+
onCommit: d,
|
|
5472
5472
|
onPick: h
|
|
5473
5473
|
}) {
|
|
5474
5474
|
const a = ae(gi(o || t)), p = ot(t) || r && !n.trim();
|
|
@@ -5508,7 +5508,7 @@ function qi({
|
|
|
5508
5508
|
placeholder: "Transparent",
|
|
5509
5509
|
value: p ? "" : n,
|
|
5510
5510
|
onChange: (c) => l(c.target.value),
|
|
5511
|
-
onBlur:
|
|
5511
|
+
onBlur: d,
|
|
5512
5512
|
onKeyDown: (c) => {
|
|
5513
5513
|
c.key === "Enter" && (c.preventDefault(), c.target.blur());
|
|
5514
5514
|
}
|
|
@@ -5524,10 +5524,10 @@ function $r({
|
|
|
5524
5524
|
onChange: i,
|
|
5525
5525
|
onReset: r
|
|
5526
5526
|
}) {
|
|
5527
|
-
const l = ot(n),
|
|
5527
|
+
const l = ot(n), d = l ? bo : n.trim() ? n : t, [h, a] = T(l ? "" : d);
|
|
5528
5528
|
ue(() => {
|
|
5529
|
-
a(l ? "" :
|
|
5530
|
-
}, [
|
|
5529
|
+
a(l ? "" : d);
|
|
5530
|
+
}, [d, l]);
|
|
5531
5531
|
const p = (f) => {
|
|
5532
5532
|
if (!f.trim() || ot(f)) {
|
|
5533
5533
|
a(""), i(bo);
|
|
@@ -5535,7 +5535,7 @@ function $r({
|
|
|
5535
5535
|
}
|
|
5536
5536
|
const c = ao(f);
|
|
5537
5537
|
if (!c) {
|
|
5538
|
-
a(l ? "" :
|
|
5538
|
+
a(l ? "" : d);
|
|
5539
5539
|
return;
|
|
5540
5540
|
}
|
|
5541
5541
|
a(c), i(c);
|
|
@@ -5550,7 +5550,7 @@ function $r({
|
|
|
5550
5550
|
{
|
|
5551
5551
|
label: e,
|
|
5552
5552
|
hex: h,
|
|
5553
|
-
swatch:
|
|
5553
|
+
swatch: d,
|
|
5554
5554
|
fallback: t,
|
|
5555
5555
|
disabled: o,
|
|
5556
5556
|
onHexChange: a,
|
|
@@ -5656,8 +5656,8 @@ function ia({
|
|
|
5656
5656
|
showTextColor: r = !0,
|
|
5657
5657
|
onPatch: l
|
|
5658
5658
|
}) {
|
|
5659
|
-
const
|
|
5660
|
-
|
|
5659
|
+
const d = ae(e);
|
|
5660
|
+
d.current = e;
|
|
5661
5661
|
const h = ae({});
|
|
5662
5662
|
ue(
|
|
5663
5663
|
() => () => {
|
|
@@ -5668,7 +5668,7 @@ function ia({
|
|
|
5668
5668
|
[]
|
|
5669
5669
|
);
|
|
5670
5670
|
const a = (c, _) => {
|
|
5671
|
-
l({ [c]: (
|
|
5671
|
+
l({ [c]: (d.current[c] ?? 0) + _ });
|
|
5672
5672
|
}, p = (c, _) => {
|
|
5673
5673
|
f(c), h.current[c] = window.setInterval(() => a(c, _), 200);
|
|
5674
5674
|
}, f = (c) => {
|
|
@@ -5796,7 +5796,7 @@ function Bh({
|
|
|
5796
5796
|
assignment: i = null,
|
|
5797
5797
|
storeDefaultColor: r,
|
|
5798
5798
|
storeTextColor: l,
|
|
5799
|
-
onApplyOps:
|
|
5799
|
+
onApplyOps: d,
|
|
5800
5800
|
onSaveAssignment: h,
|
|
5801
5801
|
onSelectShape: a
|
|
5802
5802
|
}) {
|
|
@@ -5828,7 +5828,7 @@ function Bh({
|
|
|
5828
5828
|
ue(() => {
|
|
5829
5829
|
A(C ? String(C.levelId) : ""), B(C ? String(C.id) : "");
|
|
5830
5830
|
}, [e.id, p == null ? void 0 : p.id, C == null ? void 0 : C.id, C == null ? void 0 : C.levelId]);
|
|
5831
|
-
const ye = el(w, t.levels),
|
|
5831
|
+
const ye = el(w, t.levels), U = w.filter(
|
|
5832
5832
|
(W) => String(W.levelId) === x
|
|
5833
5833
|
), ln = w.filter((W) => !f.includes(W.id)), Q = el(ln, t.levels), Re = ln.filter(
|
|
5834
5834
|
(W) => String(W.levelId) === G
|
|
@@ -5845,11 +5845,11 @@ function Bh({
|
|
|
5845
5845
|
);
|
|
5846
5846
|
return X !== 0 ? X : W.key.localeCompare(ce.key);
|
|
5847
5847
|
}), He = (W, ce) => {
|
|
5848
|
-
|
|
5848
|
+
d(
|
|
5849
5849
|
wh(t, W, ce, { direction: Ie })
|
|
5850
5850
|
);
|
|
5851
5851
|
}, le = (W) => {
|
|
5852
|
-
W.length < 2 ||
|
|
5852
|
+
W.length < 2 || d(
|
|
5853
5853
|
Ch(t, W, {
|
|
5854
5854
|
name: p == null ? void 0 : p.name,
|
|
5855
5855
|
accessible: (p == null ? void 0 : p.accessible) ?? !0,
|
|
@@ -5866,7 +5866,7 @@ function Bh({
|
|
|
5866
5866
|
}, Ae = (W) => {
|
|
5867
5867
|
if (!o || !p) return;
|
|
5868
5868
|
if (c.length <= 2) {
|
|
5869
|
-
|
|
5869
|
+
d(Lr(t, p.id));
|
|
5870
5870
|
return;
|
|
5871
5871
|
}
|
|
5872
5872
|
const ce = c.filter((pe) => pe.id !== W.id);
|
|
@@ -5877,7 +5877,7 @@ function Bh({
|
|
|
5877
5877
|
}, we = (W) => {
|
|
5878
5878
|
if (!(W !== "up" && W !== "down") && o) {
|
|
5879
5879
|
if (p) {
|
|
5880
|
-
|
|
5880
|
+
d(Nh(t, p.id, W));
|
|
5881
5881
|
return;
|
|
5882
5882
|
}
|
|
5883
5883
|
oe(W);
|
|
@@ -5948,7 +5948,7 @@ function Bh({
|
|
|
5948
5948
|
disabled: !o || !x,
|
|
5949
5949
|
placeholder: x ? "Choose an escalator on that floor" : "Choose a floor first",
|
|
5950
5950
|
searchable: !0,
|
|
5951
|
-
options: an(
|
|
5951
|
+
options: an(U, "escalator"),
|
|
5952
5952
|
onChange: Je
|
|
5953
5953
|
}
|
|
5954
5954
|
)
|
|
@@ -5969,7 +5969,7 @@ function Bh({
|
|
|
5969
5969
|
"button",
|
|
5970
5970
|
{
|
|
5971
5971
|
type: "button",
|
|
5972
|
-
onClick: () =>
|
|
5972
|
+
onClick: () => d(Lr(t, p.id)),
|
|
5973
5973
|
children: "Unlink"
|
|
5974
5974
|
}
|
|
5975
5975
|
) }) : null
|
|
@@ -6045,7 +6045,7 @@ function Bh({
|
|
|
6045
6045
|
"button",
|
|
6046
6046
|
{
|
|
6047
6047
|
type: "button",
|
|
6048
|
-
onClick: () =>
|
|
6048
|
+
onClick: () => d(Lr(t, p.id)),
|
|
6049
6049
|
children: "Unlink shaft"
|
|
6050
6050
|
}
|
|
6051
6051
|
) }) : null
|
|
@@ -6108,10 +6108,10 @@ const Wh = {
|
|
|
6108
6108
|
function la(e) {
|
|
6109
6109
|
return !Hh.includes(e);
|
|
6110
6110
|
}
|
|
6111
|
-
function
|
|
6111
|
+
function Uh(e) {
|
|
6112
6112
|
return sa.includes(e) ? Kh[e] : ca(e);
|
|
6113
6113
|
}
|
|
6114
|
-
function
|
|
6114
|
+
function Vh(e) {
|
|
6115
6115
|
return e === "escalator" || e === "elevator";
|
|
6116
6116
|
}
|
|
6117
6117
|
function aa(e, n, t) {
|
|
@@ -6159,7 +6159,7 @@ function da(e) {
|
|
|
6159
6159
|
return new Map(e.map((n) => [n.shapeId, n]));
|
|
6160
6160
|
}
|
|
6161
6161
|
function qh(e, n) {
|
|
6162
|
-
const t = da(n), o = [], i = [], r = [], l = [],
|
|
6162
|
+
const t = da(n), o = [], i = [], r = [], l = [], d = [], h = [], a = [], p = [], f = [];
|
|
6163
6163
|
for (const c of e) {
|
|
6164
6164
|
if (c.orphanedAt) continue;
|
|
6165
6165
|
const _ = t.get(c.id) ?? null;
|
|
@@ -6167,14 +6167,14 @@ function qh(e, n) {
|
|
|
6167
6167
|
sl(_) ? a.push(c) : p.push(c);
|
|
6168
6168
|
continue;
|
|
6169
6169
|
}
|
|
6170
|
-
Yh(_) ? o.push(c) : Zh(_) ? i.push(c) : Jh(_) ? r.push(c) : co(c.kind) && !sl(_) && (f.push(c), Gh(c.kind) ? l.push(c) : c.kind === "amenity" ?
|
|
6170
|
+
Yh(_) ? o.push(c) : Zh(_) ? i.push(c) : Jh(_) ? r.push(c) : co(c.kind) && !sl(_) && (f.push(c), Gh(c.kind) ? l.push(c) : c.kind === "amenity" ? d.push(c) : c.kind === "kiosk_screen" && h.push(c));
|
|
6171
6171
|
}
|
|
6172
6172
|
return {
|
|
6173
6173
|
stores: o,
|
|
6174
6174
|
amenities: i,
|
|
6175
6175
|
kiosks: r,
|
|
6176
6176
|
unassignedStores: l,
|
|
6177
|
-
unassignedAmenities:
|
|
6177
|
+
unassignedAmenities: d,
|
|
6178
6178
|
unassignedKiosks: h,
|
|
6179
6179
|
custom: a,
|
|
6180
6180
|
unassignedCustom: p,
|
|
@@ -6257,7 +6257,7 @@ function dp(e) {
|
|
|
6257
6257
|
}
|
|
6258
6258
|
function up(e, n, t) {
|
|
6259
6259
|
if (e.indexOf(n) < 0) return e;
|
|
6260
|
-
const i = e.filter((
|
|
6260
|
+
const i = e.filter((d) => d !== n), r = Math.max(0, Math.min(t, i.length)), l = [...i];
|
|
6261
6261
|
return l.splice(r, 0, n), l;
|
|
6262
6262
|
}
|
|
6263
6263
|
function hp(e, n, t, o) {
|
|
@@ -6331,11 +6331,11 @@ function yp({
|
|
|
6331
6331
|
screen: i,
|
|
6332
6332
|
onScreenChange: r,
|
|
6333
6333
|
onCreateLevel: l,
|
|
6334
|
-
onUpdateLevel:
|
|
6334
|
+
onUpdateLevel: d,
|
|
6335
6335
|
onDeleteLevel: h,
|
|
6336
6336
|
onReorderLevels: a
|
|
6337
6337
|
}) {
|
|
6338
|
-
const [p, f] = T(""), [c, _] = T(null), [C, R] = T(!1), [w, x] = T(null), [A, S] = T(null), [B, G] = T(!1), [q, j] = T(null), [oe, Ie] = T(!1), [M, re] = T(null), [Ee, ne] = T(null), [ye,
|
|
6338
|
+
const [p, f] = T(""), [c, _] = T(null), [C, R] = T(!1), [w, x] = T(null), [A, S] = T(null), [B, G] = T(!1), [q, j] = T(null), [oe, Ie] = T(!1), [M, re] = T(null), [Ee, ne] = T(null), [ye, U] = T(null), [ln, Q] = T(!1), [Re, Me] = T(null), He = ae(null), le = ae(null), Je = ae(null), ee = ae(null), Ae = ae(null), we = xe(
|
|
6339
6339
|
() => e.find((H) => H.kind === "outdoor") ?? null,
|
|
6340
6340
|
[e]
|
|
6341
6341
|
), an = !!(we != null && we.sourceSvgKey || we != null && we.sourceSvgUrl), W = (H) => (t == null ? void 0 : t[H]) ?? 0, ce = xe(
|
|
@@ -6347,7 +6347,7 @@ function yp({
|
|
|
6347
6347
|
), he = xe(() => {
|
|
6348
6348
|
const H = M != null ? pe : ye ?? pe, K = new Map(ce.map((be) => [be.id, be]));
|
|
6349
6349
|
return H.map((be) => K.get(be)).filter((be) => be != null);
|
|
6350
|
-
}, [ce, pe, M, ye]), X = i.mode === "edit" ? e.find((H) => H.id === i.levelId) ?? null : null, Ge = i.mode === "add-base" || (X == null ? void 0 : X.kind) === "outdoor", en = o && !!l && !!
|
|
6350
|
+
}, [ce, pe, M, ye]), X = i.mode === "edit" ? e.find((H) => H.id === i.levelId) ?? null : null, Ge = i.mode === "add-base" || (X == null ? void 0 : X.kind) === "outdoor", en = o && !!l && !!d, Yn = en && !!a && ce.length > 1;
|
|
6351
6351
|
ue(() => {
|
|
6352
6352
|
i.mode === "add-base" || (X == null ? void 0 : X.kind) === "outdoor" ? (f("Outdoor"), _(null)) : i.mode === "add-floor" ? (f(""), _(null)) : i.mode === "edit" && X && (f(X.name), _(null)), x(null), j(null), Ie(!1), S(null), Q(!1);
|
|
6353
6353
|
}, [i, X == null ? void 0 : X.id, X == null ? void 0 : X.kind, X == null ? void 0 : X.name]), ue(() => {
|
|
@@ -6364,7 +6364,7 @@ function yp({
|
|
|
6364
6364
|
const H = URL.createObjectURL(c);
|
|
6365
6365
|
return Me(H), Q(!1), () => URL.revokeObjectURL(H);
|
|
6366
6366
|
}, [c]), ee.current = ye, Ae.current = M, ue(() => {
|
|
6367
|
-
M != null || ye == null || vi(pe, ye) &&
|
|
6367
|
+
M != null || ye == null || vi(pe, ye) && U(null);
|
|
6368
6368
|
}, [pe, M, ye]);
|
|
6369
6369
|
const ie = (H) => {
|
|
6370
6370
|
if (H) {
|
|
@@ -6401,7 +6401,7 @@ function yp({
|
|
|
6401
6401
|
buildingId: ((be = n[0]) == null ? void 0 : be.id) ?? null,
|
|
6402
6402
|
file: K ?? void 0,
|
|
6403
6403
|
onProgress: S
|
|
6404
|
-
})) : i.mode === "edit" && X && await (
|
|
6404
|
+
})) : i.mode === "edit" && X && await (d == null ? void 0 : d({
|
|
6405
6405
|
levelId: X.id,
|
|
6406
6406
|
name: X.kind === "outdoor" ? "Outdoor" : p.trim(),
|
|
6407
6407
|
file: K ?? void 0,
|
|
@@ -6507,18 +6507,18 @@ function yp({
|
|
|
6507
6507
|
);
|
|
6508
6508
|
K.dropIndex !== be && (K.dropIndex = be, ne(be));
|
|
6509
6509
|
const Se = up(K.originIds, K.id, be), ze = ee.current ?? K.originIds;
|
|
6510
|
-
vi(ze, Se) ||
|
|
6510
|
+
vi(ze, Se) || U(Se);
|
|
6511
6511
|
}, cn = async () => {
|
|
6512
6512
|
const H = ee.current;
|
|
6513
6513
|
if (!(!a || H == null)) {
|
|
6514
6514
|
if (vi(H, pe)) {
|
|
6515
|
-
|
|
6515
|
+
U(null);
|
|
6516
6516
|
return;
|
|
6517
6517
|
}
|
|
6518
6518
|
try {
|
|
6519
6519
|
await a(H);
|
|
6520
6520
|
} catch (K) {
|
|
6521
|
-
|
|
6521
|
+
U(null), x(K instanceof Error ? K.message : "Could not reorder floors.");
|
|
6522
6522
|
}
|
|
6523
6523
|
}
|
|
6524
6524
|
}, nn = () => {
|
|
@@ -6561,7 +6561,7 @@ function yp({
|
|
|
6561
6561
|
originIds: pe,
|
|
6562
6562
|
dropIndex: pe.indexOf(H.id)
|
|
6563
6563
|
};
|
|
6564
|
-
Ae.current = Ce, re(Ce), ne(pe.indexOf(H.id)),
|
|
6564
|
+
Ae.current = Ce, re(Ce), ne(pe.indexOf(H.id)), U(pe);
|
|
6565
6565
|
}, dn = M && Ee != null ? pp(
|
|
6566
6566
|
M.originIds.indexOf(M.id),
|
|
6567
6567
|
Ee,
|
|
@@ -7264,21 +7264,21 @@ function ki({
|
|
|
7264
7264
|
onChange: o,
|
|
7265
7265
|
onReset: i
|
|
7266
7266
|
}) {
|
|
7267
|
-
const r = ot(n) || !n.trim(), [l,
|
|
7267
|
+
const r = ot(n) || !n.trim(), [l, d] = T(r ? "" : n);
|
|
7268
7268
|
ue(() => {
|
|
7269
|
-
|
|
7269
|
+
d(r ? "" : n);
|
|
7270
7270
|
}, [r, n]);
|
|
7271
7271
|
const h = (a) => {
|
|
7272
7272
|
if (!a.trim() || ot(a)) {
|
|
7273
|
-
|
|
7273
|
+
d(""), r || o(bo);
|
|
7274
7274
|
return;
|
|
7275
7275
|
}
|
|
7276
7276
|
const p = ao(a);
|
|
7277
7277
|
if (!p) {
|
|
7278
|
-
|
|
7278
|
+
d(r ? "" : n);
|
|
7279
7279
|
return;
|
|
7280
7280
|
}
|
|
7281
|
-
|
|
7281
|
+
d(p), p !== n.toLowerCase() && p !== n && o(p);
|
|
7282
7282
|
};
|
|
7283
7283
|
return /* @__PURE__ */ s(Tr, { label: e, onReset: i, children: /* @__PURE__ */ s(
|
|
7284
7284
|
qi,
|
|
@@ -7287,7 +7287,7 @@ function ki({
|
|
|
7287
7287
|
hex: l,
|
|
7288
7288
|
swatch: r ? bo : n,
|
|
7289
7289
|
fallback: t,
|
|
7290
|
-
onHexChange:
|
|
7290
|
+
onHexChange: d,
|
|
7291
7291
|
onCommit: () => h(l),
|
|
7292
7292
|
onPick: h
|
|
7293
7293
|
}
|
|
@@ -7301,7 +7301,7 @@ function $p({
|
|
|
7301
7301
|
selectedShapeId: i,
|
|
7302
7302
|
selectedShapeIds: r,
|
|
7303
7303
|
onSelectShape: l,
|
|
7304
|
-
onHoverShape:
|
|
7304
|
+
onHoverShape: d,
|
|
7305
7305
|
onListFocus: h,
|
|
7306
7306
|
retailers: a = [],
|
|
7307
7307
|
kiosks: p = [],
|
|
@@ -7325,16 +7325,16 @@ function $p({
|
|
|
7325
7325
|
showSurroundings: Ee = !1,
|
|
7326
7326
|
surroundingsPanel: ne,
|
|
7327
7327
|
settingsExtra: ye,
|
|
7328
|
-
footer:
|
|
7328
|
+
footer: U
|
|
7329
7329
|
}) {
|
|
7330
7330
|
const [ln, Q] = T({ mode: "list" });
|
|
7331
7331
|
ue(() => {
|
|
7332
7332
|
e !== "floors" && Q({ mode: "list" });
|
|
7333
7333
|
}, [e]), ue(
|
|
7334
7334
|
() => () => {
|
|
7335
|
-
|
|
7335
|
+
d == null || d(null);
|
|
7336
7336
|
},
|
|
7337
|
-
[e,
|
|
7337
|
+
[e, d]
|
|
7338
7338
|
);
|
|
7339
7339
|
const Re = xe(
|
|
7340
7340
|
() => qh(t.shapes, t.assignments),
|
|
@@ -7417,8 +7417,8 @@ function $p({
|
|
|
7417
7417
|
return E;
|
|
7418
7418
|
}, [t.shapes]), nn = r ?? (i != null ? [i] : []), De = (E) => nn.includes(E), dn = j != null ? p.find((E) => E.id === j) ?? null : null, H = e === "kiosks" && dn != null, K = sp(e, nn.length) || H;
|
|
7419
7419
|
ue(() => {
|
|
7420
|
-
K && (
|
|
7421
|
-
}, [K,
|
|
7420
|
+
K && (d == null || d(null));
|
|
7421
|
+
}, [K, d]);
|
|
7422
7422
|
const be = (() => {
|
|
7423
7423
|
if (H && dn) {
|
|
7424
7424
|
const z = Fr(
|
|
@@ -7465,8 +7465,8 @@ function $p({
|
|
|
7465
7465
|
onMouseDown: (Oe) => {
|
|
7466
7466
|
Oe.shiftKey && Oe.preventDefault();
|
|
7467
7467
|
},
|
|
7468
|
-
onMouseEnter: () =>
|
|
7469
|
-
onMouseLeave: () =>
|
|
7468
|
+
onMouseEnter: () => d == null ? void 0 : d(_e.id),
|
|
7469
|
+
onMouseLeave: () => d == null ? void 0 : d(null),
|
|
7470
7470
|
onClick: (Oe) => Se(_e.id, Oe),
|
|
7471
7471
|
children: [
|
|
7472
7472
|
We ? /* @__PURE__ */ s(
|
|
@@ -7506,9 +7506,9 @@ function $p({
|
|
|
7506
7506
|
Oe.shiftKey && Oe.preventDefault();
|
|
7507
7507
|
},
|
|
7508
7508
|
onMouseEnter: () => {
|
|
7509
|
-
fe != null && (
|
|
7509
|
+
fe != null && (d == null || d(fe));
|
|
7510
7510
|
},
|
|
7511
|
-
onMouseLeave: () =>
|
|
7511
|
+
onMouseLeave: () => d == null ? void 0 : d(null),
|
|
7512
7512
|
onClick: (Oe) => {
|
|
7513
7513
|
fe != null && Se(fe, Oe);
|
|
7514
7514
|
},
|
|
@@ -7561,7 +7561,7 @@ function $p({
|
|
|
7561
7561
|
return;
|
|
7562
7562
|
}
|
|
7563
7563
|
if (K) {
|
|
7564
|
-
l(null),
|
|
7564
|
+
l(null), d == null || d(null);
|
|
7565
7565
|
return;
|
|
7566
7566
|
}
|
|
7567
7567
|
n(null);
|
|
@@ -7848,7 +7848,7 @@ function $p({
|
|
|
7848
7848
|
G
|
|
7849
7849
|
] })
|
|
7850
7850
|
] }),
|
|
7851
|
-
|
|
7851
|
+
U
|
|
7852
7852
|
] });
|
|
7853
7853
|
}
|
|
7854
7854
|
function Ii(e, n = 8) {
|
|
@@ -7865,7 +7865,7 @@ async function Fp(e) {
|
|
|
7865
7865
|
}
|
|
7866
7866
|
return n || `Request failed (HTTP ${e.status})`;
|
|
7867
7867
|
}
|
|
7868
|
-
async function
|
|
7868
|
+
async function Uo(e, n, t) {
|
|
7869
7869
|
const o = e.replace(/\/$/, ""), i = await fetch(`${o}${n}`, {
|
|
7870
7870
|
credentials: "include",
|
|
7871
7871
|
...t,
|
|
@@ -7887,24 +7887,24 @@ function zp({
|
|
|
7887
7887
|
onMapVersionChanged: i,
|
|
7888
7888
|
onClassicAssignmentsCopied: r
|
|
7889
7889
|
}) {
|
|
7890
|
-
const [l,
|
|
7890
|
+
const [l, d] = T(!1), [h, a] = T("unknown"), [p, f] = T(0), [c, _] = T(null), [C, R] = T(null), [w, x] = T(!1), [A, S] = T(!1), [B, G] = T(null);
|
|
7891
7891
|
ue(() => {
|
|
7892
7892
|
if (!e || !n) return;
|
|
7893
7893
|
let ne = !1;
|
|
7894
|
-
return
|
|
7894
|
+
return d(!1), a("unknown"), f(0), (async () => {
|
|
7895
7895
|
try {
|
|
7896
|
-
const ye = await
|
|
7896
|
+
const ye = await Uo(
|
|
7897
7897
|
e,
|
|
7898
7898
|
"/v1/auth/is-authenticated"
|
|
7899
7899
|
);
|
|
7900
7900
|
if (ne) return;
|
|
7901
|
-
|
|
7901
|
+
d((ye == null ? void 0 : ye.is_developer) === !0);
|
|
7902
7902
|
} catch {
|
|
7903
|
-
ne || (
|
|
7903
|
+
ne || (d(!1), a("no"), f(0));
|
|
7904
7904
|
return;
|
|
7905
7905
|
}
|
|
7906
7906
|
try {
|
|
7907
|
-
const ye = await
|
|
7907
|
+
const ye = await Uo(
|
|
7908
7908
|
e,
|
|
7909
7909
|
`/v1/map/setup-status?center_id=${n}`
|
|
7910
7910
|
);
|
|
@@ -7923,7 +7923,7 @@ function zp({
|
|
|
7923
7923
|
if (!(A || !e || !n)) {
|
|
7924
7924
|
S(!0), G(null);
|
|
7925
7925
|
try {
|
|
7926
|
-
await
|
|
7926
|
+
await Uo(e, `/v1/map/version?center_id=${n}`, {
|
|
7927
7927
|
method: "PUT",
|
|
7928
7928
|
body: JSON.stringify({ map_version: 1 })
|
|
7929
7929
|
}), R(null), i == null || i(1);
|
|
@@ -7937,7 +7937,7 @@ function zp({
|
|
|
7937
7937
|
if (!(A || !w || !e || !n)) {
|
|
7938
7938
|
S(!0), G(null);
|
|
7939
7939
|
try {
|
|
7940
|
-
await
|
|
7940
|
+
await Uo(e, `/v1/map/classic-data?center_id=${n}`, {
|
|
7941
7941
|
method: "DELETE"
|
|
7942
7942
|
}), a("no"), f(0), R(null), x(!1);
|
|
7943
7943
|
} catch (ne) {
|
|
@@ -7950,7 +7950,7 @@ function zp({
|
|
|
7950
7950
|
if (!(A || o || !e || !n)) {
|
|
7951
7951
|
S(!0), G(null);
|
|
7952
7952
|
try {
|
|
7953
|
-
const ne = await
|
|
7953
|
+
const ne = await Uo(
|
|
7954
7954
|
e,
|
|
7955
7955
|
`/v1/map/copy-classic-assignments?center_id=${n}`,
|
|
7956
7956
|
{ method: "POST" }
|
|
@@ -8175,7 +8175,7 @@ function Bp({
|
|
|
8175
8175
|
searchable: n.length > 8,
|
|
8176
8176
|
placeholder: l ? "No kiosk shapes on the map" : "Choose a kiosk shape…",
|
|
8177
8177
|
options: n,
|
|
8178
|
-
onChange: (
|
|
8178
|
+
onChange: (d) => i(d ? Number(d) : null)
|
|
8179
8179
|
}
|
|
8180
8180
|
),
|
|
8181
8181
|
/* @__PURE__ */ s("div", { className: "eyeon-map-assign__actions", children: o && r ? /* @__PURE__ */ s(
|
|
@@ -8212,7 +8212,7 @@ const Wp = {
|
|
|
8212
8212
|
function Hp(e) {
|
|
8213
8213
|
return Wp[e] ?? e.replace(/_/g, "");
|
|
8214
8214
|
}
|
|
8215
|
-
function
|
|
8215
|
+
function Up(e = Kp) {
|
|
8216
8216
|
const n = new Uint8Array(e);
|
|
8217
8217
|
globalThis.crypto.getRandomValues(n);
|
|
8218
8218
|
let t = "";
|
|
@@ -8223,14 +8223,14 @@ function Vp(e = Kp) {
|
|
|
8223
8223
|
function $i(e, n) {
|
|
8224
8224
|
return e.filter((t) => t.levelId === n && !t.orphanedAt).map((t) => t.key);
|
|
8225
8225
|
}
|
|
8226
|
-
function
|
|
8226
|
+
function Vp(e, n) {
|
|
8227
8227
|
return e.filter((t) => t.id !== n);
|
|
8228
8228
|
}
|
|
8229
|
-
function Fi(e, n, t =
|
|
8229
|
+
function Fi(e, n, t = Up) {
|
|
8230
8230
|
const o = Hp(e), i = n instanceof Set ? n : new Set(n);
|
|
8231
8231
|
for (let l = 0; l < 24; l++) {
|
|
8232
|
-
const
|
|
8233
|
-
if (!i.has(
|
|
8232
|
+
const d = `${o}-${t()}`;
|
|
8233
|
+
if (!i.has(d)) return d;
|
|
8234
8234
|
}
|
|
8235
8235
|
let r = 2;
|
|
8236
8236
|
for (; i.has(`${o}-${r}`); ) r += 1;
|
|
@@ -8284,7 +8284,7 @@ function Yp({
|
|
|
8284
8284
|
kiosks: i = [],
|
|
8285
8285
|
canEdit: r,
|
|
8286
8286
|
storeDefaultColor: l,
|
|
8287
|
-
storeTextColor:
|
|
8287
|
+
storeTextColor: d,
|
|
8288
8288
|
amenityIconColor: h,
|
|
8289
8289
|
kioskIconColor: a,
|
|
8290
8290
|
onChange: p,
|
|
@@ -8338,8 +8338,8 @@ function Yp({
|
|
|
8338
8338
|
{
|
|
8339
8339
|
AMENITY_ICON_COLOR: h,
|
|
8340
8340
|
KIOSK_ICON_COLOR: a,
|
|
8341
|
-
CONNECTOR_ICON_COLOR:
|
|
8342
|
-
STORE_TEXT_COLOR:
|
|
8341
|
+
CONNECTOR_ICON_COLOR: d,
|
|
8342
|
+
STORE_TEXT_COLOR: d
|
|
8343
8343
|
},
|
|
8344
8344
|
e.kind
|
|
8345
8345
|
), Ie = vl(c);
|
|
@@ -8641,7 +8641,7 @@ function Jp({
|
|
|
8641
8641
|
storeTextColor: i,
|
|
8642
8642
|
amenityIconColor: r,
|
|
8643
8643
|
kioskIconColor: l,
|
|
8644
|
-
onPatch:
|
|
8644
|
+
onPatch: d
|
|
8645
8645
|
}) {
|
|
8646
8646
|
var w, x;
|
|
8647
8647
|
const h = e.filter((A) => co(A.kind)).map((A) => {
|
|
@@ -8666,7 +8666,7 @@ function Jp({
|
|
|
8666
8666
|
{
|
|
8667
8667
|
value: a.size,
|
|
8668
8668
|
disabled: !t,
|
|
8669
|
-
onCommit: (A) =>
|
|
8669
|
+
onCommit: (A) => d({ size: A })
|
|
8670
8670
|
}
|
|
8671
8671
|
),
|
|
8672
8672
|
/* @__PURE__ */ s(
|
|
@@ -8677,7 +8677,7 @@ function Jp({
|
|
|
8677
8677
|
fallback: R,
|
|
8678
8678
|
mixed: a.bgColorMixed,
|
|
8679
8679
|
disabled: !t,
|
|
8680
|
-
onCommit: (A) =>
|
|
8680
|
+
onCommit: (A) => d({ bgColor: A })
|
|
8681
8681
|
}
|
|
8682
8682
|
),
|
|
8683
8683
|
/* @__PURE__ */ s(
|
|
@@ -8688,7 +8688,7 @@ function Jp({
|
|
|
8688
8688
|
fallback: C,
|
|
8689
8689
|
mixed: a.textColorMixed,
|
|
8690
8690
|
disabled: !t,
|
|
8691
|
-
onCommit: (A) =>
|
|
8691
|
+
onCommit: (A) => d({ textColor: A })
|
|
8692
8692
|
}
|
|
8693
8693
|
)
|
|
8694
8694
|
] });
|
|
@@ -8713,7 +8713,7 @@ function qp({
|
|
|
8713
8713
|
return;
|
|
8714
8714
|
}
|
|
8715
8715
|
i(String(p.render)), t(p.render), a && i(String(p.render));
|
|
8716
|
-
},
|
|
8716
|
+
}, d = (h) => {
|
|
8717
8717
|
const p = (e === "" ? xi : e) + h;
|
|
8718
8718
|
i(String(p)), t(p);
|
|
8719
8719
|
};
|
|
@@ -8726,7 +8726,7 @@ function qp({
|
|
|
8726
8726
|
type: "button",
|
|
8727
8727
|
disabled: n,
|
|
8728
8728
|
"aria-label": "Decrease Size",
|
|
8729
|
-
onClick: () =>
|
|
8729
|
+
onClick: () => d(-1),
|
|
8730
8730
|
children: "−"
|
|
8731
8731
|
}
|
|
8732
8732
|
),
|
|
@@ -8762,7 +8762,7 @@ function qp({
|
|
|
8762
8762
|
type: "button",
|
|
8763
8763
|
disabled: n,
|
|
8764
8764
|
"aria-label": "Increase Size",
|
|
8765
|
-
onClick: () =>
|
|
8765
|
+
onClick: () => d(1),
|
|
8766
8766
|
children: "+"
|
|
8767
8767
|
}
|
|
8768
8768
|
)
|
|
@@ -8777,10 +8777,10 @@ function dl({
|
|
|
8777
8777
|
disabled: i,
|
|
8778
8778
|
onCommit: r
|
|
8779
8779
|
}) {
|
|
8780
|
-
const l = !o && ot(n),
|
|
8780
|
+
const l = !o && ot(n), d = o ? "" : l ? bo : n.trim() ? n : t, h = o || !!n.trim(), [a, p] = T(l ? "" : d);
|
|
8781
8781
|
ue(() => {
|
|
8782
|
-
p(l ? "" :
|
|
8783
|
-
}, [
|
|
8782
|
+
p(l ? "" : d);
|
|
8783
|
+
}, [d, l]);
|
|
8784
8784
|
const f = (c) => {
|
|
8785
8785
|
if (!c.trim() || ot(c)) {
|
|
8786
8786
|
p(""), o || r(bo);
|
|
@@ -8788,7 +8788,7 @@ function dl({
|
|
|
8788
8788
|
}
|
|
8789
8789
|
const _ = ao(c);
|
|
8790
8790
|
if (!_) {
|
|
8791
|
-
p(l ? "" :
|
|
8791
|
+
p(l ? "" : d);
|
|
8792
8792
|
return;
|
|
8793
8793
|
}
|
|
8794
8794
|
p(_), r(_);
|
|
@@ -8810,7 +8810,7 @@ function dl({
|
|
|
8810
8810
|
{
|
|
8811
8811
|
label: e,
|
|
8812
8812
|
hex: a,
|
|
8813
|
-
swatch:
|
|
8813
|
+
swatch: d,
|
|
8814
8814
|
fallback: t,
|
|
8815
8815
|
disabled: i,
|
|
8816
8816
|
emptyIsTransparent: !o,
|
|
@@ -8849,8 +8849,8 @@ function ef({
|
|
|
8849
8849
|
disabled: n = !1,
|
|
8850
8850
|
onCopyToLevel: t
|
|
8851
8851
|
}) {
|
|
8852
|
-
const o = Da(), i = ae(null), r = ae(null), [l,
|
|
8853
|
-
|
|
8852
|
+
const o = Da(), i = ae(null), r = ae(null), [l, d] = T(!1), [h, a] = T(null), [p, f] = T(null), c = sn(() => {
|
|
8853
|
+
d(!1), f(null);
|
|
8854
8854
|
}, []), _ = sn(() => {
|
|
8855
8855
|
const w = i.current;
|
|
8856
8856
|
if (!w) return;
|
|
@@ -8923,7 +8923,7 @@ function ef({
|
|
|
8923
8923
|
"aria-controls": l ? o : void 0,
|
|
8924
8924
|
disabled: n,
|
|
8925
8925
|
onClick: () => {
|
|
8926
|
-
n || (a(null),
|
|
8926
|
+
n || (a(null), d((w) => !w));
|
|
8927
8927
|
},
|
|
8928
8928
|
children: [
|
|
8929
8929
|
"Duplicate",
|
|
@@ -8942,11 +8942,11 @@ function tf({
|
|
|
8942
8942
|
storeTextColor: t,
|
|
8943
8943
|
onChange: o
|
|
8944
8944
|
}) {
|
|
8945
|
-
const [i, r] = T(e.size ?? ro), [l,
|
|
8945
|
+
const [i, r] = T(e.size ?? ro), [l, d] = T(e.rotate ?? 0), h = ae(i), a = ae(l);
|
|
8946
8946
|
h.current = i, a.current = l;
|
|
8947
8947
|
const p = ae({});
|
|
8948
8948
|
ue(() => {
|
|
8949
|
-
r(e.size ?? ro),
|
|
8949
|
+
r(e.size ?? ro), d(e.rotate ?? 0);
|
|
8950
8950
|
}, [e]), ue(
|
|
8951
8951
|
() => () => {
|
|
8952
8952
|
Object.values(p.current).forEach(
|
|
@@ -8959,7 +8959,7 @@ function tf({
|
|
|
8959
8959
|
(w, x) => {
|
|
8960
8960
|
if (!n) return;
|
|
8961
8961
|
const A = Mr(w.size ?? h.current), S = w.rotate ?? a.current;
|
|
8962
|
-
w.size != null && (r(A), h.current = A), w.rotate != null && (
|
|
8962
|
+
w.size != null && (r(A), h.current = A), w.rotate != null && (d(S), a.current = S), o(
|
|
8963
8963
|
{
|
|
8964
8964
|
...e,
|
|
8965
8965
|
...w,
|
|
@@ -9039,11 +9039,11 @@ function of({
|
|
|
9039
9039
|
storeTextColor: t,
|
|
9040
9040
|
onChange: o
|
|
9041
9041
|
}) {
|
|
9042
|
-
const [i, r] = T(e.text ?? ""), [l,
|
|
9042
|
+
const [i, r] = T(e.text ?? ""), [l, d] = T(e.size ?? Qo), [h, a] = T(e.rotate ?? 0), p = ae(l), f = ae(h), c = ae(!1);
|
|
9043
9043
|
p.current = l, f.current = h;
|
|
9044
9044
|
const _ = ae({});
|
|
9045
9045
|
ue(() => {
|
|
9046
|
-
c.current || r(e.text ?? ""),
|
|
9046
|
+
c.current || r(e.text ?? ""), d(e.size ?? Qo), a(e.rotate ?? 0);
|
|
9047
9047
|
}, [e]), ue(
|
|
9048
9048
|
() => () => {
|
|
9049
9049
|
Object.values(_.current).forEach(
|
|
@@ -9056,7 +9056,7 @@ function of({
|
|
|
9056
9056
|
(S, B) => {
|
|
9057
9057
|
if (!n) return;
|
|
9058
9058
|
const G = Math.max(bi, S.size ?? p.current), q = S.rotate ?? f.current;
|
|
9059
|
-
S.size != null && (
|
|
9059
|
+
S.size != null && (d(G), p.current = G), S.rotate != null && (a(q), f.current = q);
|
|
9060
9060
|
const j = S.text === void 0 ? i : S.text === "" ? e.text ?? wo : S.text;
|
|
9061
9061
|
o(
|
|
9062
9062
|
{
|
|
@@ -9175,7 +9175,7 @@ function rf({
|
|
|
9175
9175
|
kiosks: i = [],
|
|
9176
9176
|
levelShapeKeys: r = [],
|
|
9177
9177
|
anchors: l = [],
|
|
9178
|
-
connectors:
|
|
9178
|
+
connectors: d = [],
|
|
9179
9179
|
canEdit: h,
|
|
9180
9180
|
showAssignment: a = !0,
|
|
9181
9181
|
emptyHint: p = "Pick an item from the list below, or click it on the map.",
|
|
@@ -9196,7 +9196,7 @@ function rf({
|
|
|
9196
9196
|
amenityIconColor: Ie,
|
|
9197
9197
|
kioskIconColor: M
|
|
9198
9198
|
}) {
|
|
9199
|
-
const [re, Ee] = T((e == null ? void 0 : e.key) ?? ""), [ne, ye] = T(null), [
|
|
9199
|
+
const [re, Ee] = T((e == null ? void 0 : e.key) ?? ""), [ne, ye] = T(null), [U, ln] = T(null);
|
|
9200
9200
|
if (ue(() => {
|
|
9201
9201
|
Ee((e == null ? void 0 : e.key) ?? ""), ye(null), ln(null);
|
|
9202
9202
|
}, [e, n]), a && B.length > 1 && q)
|
|
@@ -9226,7 +9226,7 @@ function rf({
|
|
|
9226
9226
|
return;
|
|
9227
9227
|
}
|
|
9228
9228
|
ye(null), f(re);
|
|
9229
|
-
}, Re =
|
|
9229
|
+
}, Re = Vp(R, e.levelId), Me = !a && h && C && Re.length > 0 ? /* @__PURE__ */ s(
|
|
9230
9230
|
ef,
|
|
9231
9231
|
{
|
|
9232
9232
|
destinations: Re,
|
|
@@ -9254,7 +9254,7 @@ function rf({
|
|
|
9254
9254
|
}
|
|
9255
9255
|
) : null
|
|
9256
9256
|
] });
|
|
9257
|
-
const He = aa(e, l,
|
|
9257
|
+
const He = aa(e, l, d);
|
|
9258
9258
|
return /* @__PURE__ */ v("div", { className: "eyeon-map-inspector", children: [
|
|
9259
9259
|
Go(e) ? S ? /* @__PURE__ */ s(
|
|
9260
9260
|
tf,
|
|
@@ -9300,7 +9300,7 @@ function rf({
|
|
|
9300
9300
|
searchable: !1,
|
|
9301
9301
|
options: jh(He).map((le) => ({
|
|
9302
9302
|
value: le,
|
|
9303
|
-
label:
|
|
9303
|
+
label: Uh(le)
|
|
9304
9304
|
})),
|
|
9305
9305
|
onChange: (le) => c(le)
|
|
9306
9306
|
}
|
|
@@ -9328,7 +9328,7 @@ function rf({
|
|
|
9328
9328
|
}
|
|
9329
9329
|
) })
|
|
9330
9330
|
] }),
|
|
9331
|
-
|
|
9331
|
+
U ? /* @__PURE__ */ s("p", { className: "eyeon-map-rail__hint", style: { color: "#b91c1c" }, children: U }) : null
|
|
9332
9332
|
] }) : null,
|
|
9333
9333
|
h && (Me || w) ? /* @__PURE__ */ v("div", { className: "eyeon-map-assign__actions", children: [
|
|
9334
9334
|
Me,
|
|
@@ -9352,7 +9352,7 @@ function ul({
|
|
|
9352
9352
|
selectedShapeIds: i,
|
|
9353
9353
|
hoveredShapeId: r,
|
|
9354
9354
|
focusNonce: l,
|
|
9355
|
-
activeLevelId:
|
|
9355
|
+
activeLevelId: d,
|
|
9356
9356
|
onActiveLevelChange: h,
|
|
9357
9357
|
routeOnSelect: a,
|
|
9358
9358
|
imageProxyUrl: p,
|
|
@@ -9376,7 +9376,7 @@ function ul({
|
|
|
9376
9376
|
selectedShapeIds: i,
|
|
9377
9377
|
hoveredShapeId: r,
|
|
9378
9378
|
focusNonce: l,
|
|
9379
|
-
activeLevelId:
|
|
9379
|
+
activeLevelId: d,
|
|
9380
9380
|
onActiveLevelChange: h,
|
|
9381
9381
|
routeOnSelect: a,
|
|
9382
9382
|
imageProxyUrl: p,
|
|
@@ -9396,18 +9396,21 @@ function sf(e, n, t) {
|
|
|
9396
9396
|
return n == null ? [] : t != null && t.additive ? e.includes(n) ? e.filter((o) => o !== n) : [...e, n] : [n];
|
|
9397
9397
|
}
|
|
9398
9398
|
function lf(e, n) {
|
|
9399
|
-
|
|
9399
|
+
var i, r;
|
|
9400
|
+
const t = e.levels.find((l) => l.kind === "outdoor"), o = (i = n == null ? void 0 : n.sourceDocument) == null ? void 0 : i.levels.find(
|
|
9401
|
+
(l) => l.kind === "outdoor"
|
|
9402
|
+
);
|
|
9400
9403
|
return mc({
|
|
9401
9404
|
revisionId: (n == null ? void 0 : n.revisionId) ?? 0,
|
|
9402
9405
|
revisionNumber: (n == null ? void 0 : n.revisionNumber) ?? 0,
|
|
9403
9406
|
centerId: e.centerId,
|
|
9404
9407
|
mapId: e.mapId,
|
|
9405
9408
|
theme: e.theme,
|
|
9406
|
-
baseSvgUrl: e.baseSvgUrl ?? (t == null ? void 0 : t.sourceSvgUrl) ?? null,
|
|
9409
|
+
baseSvgUrl: ((r = n == null ? void 0 : n.sourceDocument) == null ? void 0 : r.baseSvgUrl) ?? e.baseSvgUrl ?? (o == null ? void 0 : o.sourceSvgUrl) ?? (t == null ? void 0 : t.sourceSvgUrl) ?? null,
|
|
9407
9410
|
baseViewbox: (t == null ? void 0 : t.sourceViewbox) ?? null,
|
|
9408
9411
|
buildings: e.buildings,
|
|
9409
9412
|
levels: e.levels,
|
|
9410
|
-
shapes: e.shapes.filter((
|
|
9413
|
+
shapes: e.shapes.filter((l) => !l.orphanedAt),
|
|
9411
9414
|
assignments: e.assignments,
|
|
9412
9415
|
anchors: e.anchors,
|
|
9413
9416
|
edges: e.edges,
|
|
@@ -9418,12 +9421,13 @@ function lf(e, n) {
|
|
|
9418
9421
|
retailers: n == null ? void 0 : n.retailers,
|
|
9419
9422
|
georeference: e.georeference,
|
|
9420
9423
|
/** Prefer already-resolved CDN URLs on draft levels (outdoor SVG). */
|
|
9421
|
-
resolveSvgUrl: (
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
|
|
9424
|
+
resolveSvgUrl: (l) => {
|
|
9425
|
+
var a;
|
|
9426
|
+
if (!l) return null;
|
|
9427
|
+
const d = e.levels.find(
|
|
9428
|
+
(p) => p.sourceSvgKey === l || p.sourceSvgUrl === l
|
|
9429
|
+
), h = d && ((a = n == null ? void 0 : n.sourceDocument) == null ? void 0 : a.levels.find((p) => p.id === d.id));
|
|
9430
|
+
return h != null && h.sourceSvgUrl ? h.sourceSvgUrl : (d == null ? void 0 : d.sourceSvgUrl) ?? l;
|
|
9427
9431
|
}
|
|
9428
9432
|
});
|
|
9429
9433
|
}
|
|
@@ -9517,7 +9521,7 @@ function yf({
|
|
|
9517
9521
|
onMallOpacity: i,
|
|
9518
9522
|
onSatellite: r,
|
|
9519
9523
|
onHeading: l,
|
|
9520
|
-
onZoom:
|
|
9524
|
+
onZoom: d,
|
|
9521
9525
|
onPanTo: h
|
|
9522
9526
|
}) {
|
|
9523
9527
|
const [a, p] = T(""), [f, c] = T(!1), [_, C] = T(null), [R, w] = T(() => Er(n.lat)), [x, A] = T(() => Er(n.lng)), [S, B] = T(null), G = ae(!1), q = ae(!1), j = ae(n.heading), oe = ae(n.zoom), Ie = ae(null);
|
|
@@ -9538,10 +9542,10 @@ function yf({
|
|
|
9538
9542
|
}, Ee = (Q) => {
|
|
9539
9543
|
M(), Ie.current = window.setInterval(() => re(Q), 200);
|
|
9540
9544
|
}, ne = (Q) => {
|
|
9541
|
-
|
|
9545
|
+
d(oi(oe.current + Q * Bc));
|
|
9542
9546
|
}, ye = (Q) => {
|
|
9543
9547
|
M(), Ie.current = window.setInterval(() => ne(Q), 200);
|
|
9544
|
-
},
|
|
9548
|
+
}, U = async () => {
|
|
9545
9549
|
const Q = a.trim();
|
|
9546
9550
|
if (!(!Q || !e)) {
|
|
9547
9551
|
c(!0), C(null);
|
|
@@ -9577,7 +9581,7 @@ function yf({
|
|
|
9577
9581
|
{
|
|
9578
9582
|
className: "eyeon-map-rail__field",
|
|
9579
9583
|
onSubmit: (Q) => {
|
|
9580
|
-
Q.preventDefault(),
|
|
9584
|
+
Q.preventDefault(), U();
|
|
9581
9585
|
},
|
|
9582
9586
|
children: [
|
|
9583
9587
|
/* @__PURE__ */ s("span", { children: "Find the mall" }),
|
|
@@ -9593,7 +9597,7 @@ function yf({
|
|
|
9593
9597
|
]
|
|
9594
9598
|
}
|
|
9595
9599
|
),
|
|
9596
|
-
/* @__PURE__ */ s("div", { className: "eyeon-map-rail__actions", children: /* @__PURE__ */ s("button", { type: "button", onClick: () => void
|
|
9600
|
+
/* @__PURE__ */ s("div", { className: "eyeon-map-rail__actions", children: /* @__PURE__ */ s("button", { type: "button", onClick: () => void U(), disabled: f || !a.trim(), children: f ? "Searching…" : "Search" }) }),
|
|
9597
9601
|
_ ? /* @__PURE__ */ s("p", { className: "eyeon-map-rail__hint", children: _ }) : null,
|
|
9598
9602
|
/* @__PURE__ */ s("div", { className: "eyeon-map-surroundings__or", role: "separator", children: /* @__PURE__ */ s("span", { children: "OR" }) }),
|
|
9599
9603
|
/* @__PURE__ */ v(
|
|
@@ -9675,7 +9679,7 @@ function yf({
|
|
|
9675
9679
|
label: "Zoom",
|
|
9676
9680
|
value: oi(n.zoom),
|
|
9677
9681
|
disabled: !1,
|
|
9678
|
-
onChange: (Q) =>
|
|
9682
|
+
onChange: (Q) => d(oi(Q)),
|
|
9679
9683
|
onStep: ne,
|
|
9680
9684
|
onHoldStart: ye,
|
|
9681
9685
|
onHoldEnd: M
|
|
@@ -9739,7 +9743,7 @@ function Sf({
|
|
|
9739
9743
|
canFloors: i = !0,
|
|
9740
9744
|
canSettings: r = !0,
|
|
9741
9745
|
canResponsiveness: l = !1,
|
|
9742
|
-
onBatch:
|
|
9746
|
+
onBatch: d,
|
|
9743
9747
|
onPublish: h,
|
|
9744
9748
|
onSaveResponsive: a,
|
|
9745
9749
|
onDiscard: p,
|
|
@@ -9763,7 +9767,7 @@ function Sf({
|
|
|
9763
9767
|
onGridPrefsChange: Ee,
|
|
9764
9768
|
googleMapsApiKey: ne
|
|
9765
9769
|
}) {
|
|
9766
|
-
const ye = hl(n.mapId), [
|
|
9770
|
+
const ye = hl(n.mapId), [U, ln] = T(() => pf(n.mapId) ? "floors" : (ye == null ? void 0 : ye.section) ?? null), [Q, Re] = T(
|
|
9767
9771
|
() => (ye == null ? void 0 : ye.device) ?? "admin_portal"
|
|
9768
9772
|
), [Me, He] = T({}), [le, Je] = T(0), [ee, Ae] = T(() => {
|
|
9769
9773
|
var I;
|
|
@@ -9775,7 +9779,7 @@ function Sf({
|
|
|
9775
9779
|
() => Bt(n.georeference) ?? ri
|
|
9776
9780
|
), [De, dn] = T(0.82), [H, K] = T(!1), [be, Se] = T(0), [ze, Be] = T(!1), [Ne, Ce] = T(!1), [gn, E] = T(mt), [z, J] = T(!1), _e = ae(null), fe = ae(gn), We = ae([]), Le = ae(-1), Oe = ae(!1), tn = ae(M);
|
|
9777
9781
|
fe.current = gn;
|
|
9778
|
-
const yn = e === "PORTAL", un = Yc(e,
|
|
9782
|
+
const yn = e === "PORTAL", un = Yc(e, U), Cn = un === "editor", Pe = ae({
|
|
9779
9783
|
isEditMap: Cn,
|
|
9780
9784
|
selectedShapeId: pe,
|
|
9781
9785
|
selectedAnchorIds: Yn
|
|
@@ -9792,28 +9796,28 @@ function Sf({
|
|
|
9792
9796
|
ue(() => {
|
|
9793
9797
|
We.current = [], Le.current = -1, Oe.current = !1, Se(0), Be(!1), He({}), fe.current = mt(), E(mt());
|
|
9794
9798
|
}, [n.mapId, n.centerId]), ue(() => {
|
|
9795
|
-
if (
|
|
9799
|
+
if (U === "edit-map" || U === "wayfinding" || U === "map-responsiveness") {
|
|
9796
9800
|
df(n.mapId, {
|
|
9797
|
-
section:
|
|
9801
|
+
section: U,
|
|
9798
9802
|
levelId: ee,
|
|
9799
|
-
device:
|
|
9803
|
+
device: U === "map-responsiveness" ? Q : void 0
|
|
9800
9804
|
});
|
|
9801
9805
|
return;
|
|
9802
9806
|
}
|
|
9803
9807
|
uf(n.mapId);
|
|
9804
|
-
}, [ee, n.mapId, Q,
|
|
9808
|
+
}, [ee, n.mapId, Q, U]), ue(() => {
|
|
9805
9809
|
if (!n.levels.some((O) => O.id === ee)) {
|
|
9806
9810
|
Ae(
|
|
9807
|
-
|
|
9811
|
+
U === "wayfinding" ? ii(n.levels) : Or(U) ? si(n.levels) : fr(n.levels)
|
|
9808
9812
|
);
|
|
9809
9813
|
return;
|
|
9810
9814
|
}
|
|
9811
|
-
if (
|
|
9815
|
+
if (U === "edit-map") return;
|
|
9812
9816
|
const I = n.levels.find((O) => O.id === ee);
|
|
9813
9817
|
if ((I == null ? void 0 : I.kind) !== "outdoor") return;
|
|
9814
|
-
const m =
|
|
9818
|
+
const m = U === "wayfinding" ? ii(n.levels) : fr(n.levels);
|
|
9815
9819
|
m != null && m !== ee && Ae(m);
|
|
9816
|
-
}, [n.levels, ee,
|
|
9820
|
+
}, [n.levels, ee, U]);
|
|
9817
9821
|
const $ = xe(
|
|
9818
9822
|
() => Oh(n, We.current),
|
|
9819
9823
|
[n, be]
|
|
@@ -9842,7 +9846,7 @@ function Sf({
|
|
|
9842
9846
|
m.removeEventListener("beforeunload", y);
|
|
9843
9847
|
};
|
|
9844
9848
|
}, []);
|
|
9845
|
-
const Zn = !Ne && xn && (o || l && hn), pn =
|
|
9849
|
+
const Zn = !Ne && xn && (o || l && hn), pn = U === "map-responsiveness", lt = U === "surroundings" && On, on = $.levels.find((y) => y.id === ee) ?? null, Ke = Cs(U, on), _n = o && !Ke, Ye = $.levels.find((y) => y.kind === "outdoor") ?? null, jt = Ye && (on == null ? void 0 : on.kind) === "floor" ? $.shapes.filter((y) => y.levelId === Ye.id) : [], Jn = $.shapes.filter((y) => y.levelId === ee), Xt = xe(() => {
|
|
9846
9850
|
const y = $.levels.map((m) => ({
|
|
9847
9851
|
...m,
|
|
9848
9852
|
shapes: $.shapes.filter((O) => O.levelId === m.id)
|
|
@@ -9863,7 +9867,8 @@ function Sf({
|
|
|
9863
9867
|
connectors: $.connectors,
|
|
9864
9868
|
publishedAt: x == null ? void 0 : x.publishedAt,
|
|
9865
9869
|
retailers: A,
|
|
9866
|
-
responsiveOverrides: wn
|
|
9870
|
+
responsiveOverrides: wn,
|
|
9871
|
+
sourceDocument: x
|
|
9867
9872
|
}),
|
|
9868
9873
|
[$, x, A, wn]
|
|
9869
9874
|
), In = xe(
|
|
@@ -9896,7 +9901,7 @@ function Sf({
|
|
|
9896
9901
|
}
|
|
9897
9902
|
const I = qc(fe.current, at());
|
|
9898
9903
|
fe.current = I, E(I);
|
|
9899
|
-
},
|
|
9904
|
+
}, Ve = sn(
|
|
9900
9905
|
(y, I = "step") => {
|
|
9901
9906
|
Xe(I);
|
|
9902
9907
|
let m = y;
|
|
@@ -9951,8 +9956,8 @@ function Sf({
|
|
|
9951
9956
|
const y = ct(cn);
|
|
9952
9957
|
if (!y) return;
|
|
9953
9958
|
const I = Bt(n.georeference);
|
|
9954
|
-
!I && Qr(y) || I && ei(I, y) ||
|
|
9955
|
-
}, [cn, o, ct,
|
|
9959
|
+
!I && Qr(y) || I && ei(I, y) || Ve({ op: "update_georeference", georeference: y }, "none");
|
|
9960
|
+
}, [cn, o, ct, Ve, Mt]);
|
|
9956
9961
|
const fn = sn(() => {
|
|
9957
9962
|
Oe.current = !1;
|
|
9958
9963
|
}, []), dt = sn(() => {
|
|
@@ -9979,7 +9984,7 @@ function Sf({
|
|
|
9979
9984
|
let m = !y.length;
|
|
9980
9985
|
const O = I;
|
|
9981
9986
|
try {
|
|
9982
|
-
I.length && a && (await a(I), He({})), y.length &&
|
|
9987
|
+
I.length && a && (await a(I), He({})), y.length && d && (await d(y), m = !0), await (h == null ? void 0 : h()), Be(!1), Oe.current = !1, fe.current = mt(), E(mt());
|
|
9983
9988
|
} catch {
|
|
9984
9989
|
O.length && He(
|
|
9985
9990
|
(P) => Object.keys(P).length ? P : Object.fromEntries(
|
|
@@ -9999,7 +10004,7 @@ function Sf({
|
|
|
9999
10004
|
l,
|
|
10000
10005
|
n.georeference,
|
|
10001
10006
|
ze,
|
|
10002
|
-
|
|
10007
|
+
d,
|
|
10003
10008
|
h,
|
|
10004
10009
|
a,
|
|
10005
10010
|
Me,
|
|
@@ -10020,14 +10025,14 @@ function Sf({
|
|
|
10020
10025
|
}
|
|
10021
10026
|
}, [hn, o, xn, n.georeference, p, Ne]), bt = sn(
|
|
10022
10027
|
(y) => {
|
|
10023
|
-
an([]), ce(null), ie([]), X(null), Or(
|
|
10028
|
+
an([]), ce(null), ie([]), X(null), Or(U) && !Or(y) ? (Fe("select"), Oe.current = !1, fe.current = mt(), E(mt()), Ae(fr(n.levels))) : y === "edit-map" ? (Fe("select"), Ae(si(n.levels))) : y === "wayfinding" ? (Fe("select"), Ae(ii(n.levels))) : (y === "map-responsiveness" || y === "surroundings") && Ae(fr(n.levels)), ln(y);
|
|
10024
10029
|
},
|
|
10025
|
-
[n.levels,
|
|
10030
|
+
[n.levels, U]
|
|
10026
10031
|
), Qn = (y) => {
|
|
10027
10032
|
if (y === ee) return;
|
|
10028
10033
|
an([]), ie([]), Ae(y);
|
|
10029
10034
|
const I = $.levels.find((m) => m.id === y);
|
|
10030
|
-
Cs(
|
|
10035
|
+
Cs(U, I) && Fe("select");
|
|
10031
10036
|
};
|
|
10032
10037
|
ue(() => {
|
|
10033
10038
|
if (!Cn || !o) return;
|
|
@@ -10044,10 +10049,10 @@ function Sf({
|
|
|
10044
10049
|
}, [o, Cn, Et, dt]);
|
|
10045
10050
|
const ut = sn(
|
|
10046
10051
|
(y, I) => {
|
|
10047
|
-
const m = y == null ? null : $.shapes.find((P) => P.id === y), O = !!(I != null && I.additive) &&
|
|
10052
|
+
const m = y == null ? null : $.shapes.find((P) => P.id === y), O = !!(I != null && I.additive) && U !== "edit-map" && U !== "wayfinding" && (m == null || co(m.kind));
|
|
10048
10053
|
if (an((P) => sf(P, y, { additive: O })), y != null && ce(null), X(null), y != null) {
|
|
10049
10054
|
if (m && !O) {
|
|
10050
|
-
const P =
|
|
10055
|
+
const P = U === "edit-map" || U === "wayfinding" ? m.levelId : vc(
|
|
10051
10056
|
$.levels,
|
|
10052
10057
|
ee,
|
|
10053
10058
|
m.levelId
|
|
@@ -10067,22 +10072,22 @@ function Sf({
|
|
|
10067
10072
|
},
|
|
10068
10073
|
[
|
|
10069
10074
|
ee,
|
|
10070
|
-
|
|
10075
|
+
U,
|
|
10071
10076
|
$.anchors,
|
|
10072
10077
|
$.connectors,
|
|
10073
10078
|
$.levels,
|
|
10074
10079
|
$.shapes
|
|
10075
10080
|
]
|
|
10076
10081
|
), Dt = (y) => {
|
|
10077
|
-
const I =
|
|
10078
|
-
Fe(m), Gl(m,
|
|
10082
|
+
const I = U === "wayfinding" && !wl(y) ? "select" : y, m = Id(Ln, I);
|
|
10083
|
+
Fe(m), Gl(m, U === "wayfinding") || ie([]);
|
|
10079
10084
|
}, ht = (y) => {
|
|
10080
|
-
|
|
10085
|
+
U === "wayfinding" || !F || !o || tl(
|
|
10081
10086
|
$.shapes,
|
|
10082
10087
|
F.id,
|
|
10083
10088
|
F.levelId,
|
|
10084
10089
|
y
|
|
10085
|
-
) ||
|
|
10090
|
+
) || Ve({
|
|
10086
10091
|
op: "upsert_shape",
|
|
10087
10092
|
shape: {
|
|
10088
10093
|
id: F.id,
|
|
@@ -10136,11 +10141,11 @@ function Sf({
|
|
|
10136
10141
|
});
|
|
10137
10142
|
return I ? (vn(I.ops), an([I.shapeId]), Ae(y), null) : "Pick a different floor.";
|
|
10138
10143
|
}, D = () => {
|
|
10139
|
-
|
|
10144
|
+
U === "wayfinding" || !F || !o || (Ve({ op: "delete_shape", shapeId: F.id }), an([]));
|
|
10140
10145
|
}, ir = (y, I, m) => {
|
|
10141
|
-
if (
|
|
10146
|
+
if (U === "wayfinding" || !_n) return;
|
|
10142
10147
|
const O = $.shapes.find((P) => P.id === y);
|
|
10143
|
-
O &&
|
|
10148
|
+
O && Ve(
|
|
10144
10149
|
{
|
|
10145
10150
|
op: "upsert_shape",
|
|
10146
10151
|
shape: {
|
|
@@ -10167,7 +10172,7 @@ function Sf({
|
|
|
10167
10172
|
return;
|
|
10168
10173
|
}
|
|
10169
10174
|
const Pn = _u(F.geometry, ve);
|
|
10170
|
-
|
|
10175
|
+
Ve(
|
|
10171
10176
|
{
|
|
10172
10177
|
op: "upsert_shape",
|
|
10173
10178
|
shape: {
|
|
@@ -10196,7 +10201,7 @@ function Sf({
|
|
|
10196
10201
|
y.text ?? F.label.text ?? "",
|
|
10197
10202
|
m
|
|
10198
10203
|
);
|
|
10199
|
-
|
|
10204
|
+
Ve(
|
|
10200
10205
|
{
|
|
10201
10206
|
op: "upsert_shape",
|
|
10202
10207
|
shape: {
|
|
@@ -10216,7 +10221,7 @@ function Sf({
|
|
|
10216
10221
|
if (!F || !o) return;
|
|
10217
10222
|
const I = $.anchors, m = $.connectors;
|
|
10218
10223
|
if (aa(F, I, m) === y) return;
|
|
10219
|
-
const O =
|
|
10224
|
+
const O = Vh(y) ? y : null, P = O ? "connector" : y, de = { ...F.style };
|
|
10220
10225
|
O ? de.connectorKind = O : delete de.connectorKind;
|
|
10221
10226
|
const ve = [], Tn = lo(F.id, I, m);
|
|
10222
10227
|
if (F.kind === "connector" && !O && Tn)
|
|
@@ -10265,11 +10270,11 @@ function Sf({
|
|
|
10265
10270
|
}), P === "custom" ? ve.push({
|
|
10266
10271
|
op: "upsert_assignment",
|
|
10267
10272
|
assignment: io(F.id, "custom")
|
|
10268
|
-
}) : F.kind === "custom" && ve.push({ op: "delete_assignment", shapeId: F.id }), ve.forEach((Nn, An) =>
|
|
10273
|
+
}) : F.kind === "custom" && ve.push({ op: "delete_assignment", shapeId: F.id }), ve.forEach((Nn, An) => Ve(Nn, An === 0 ? "step" : "none"));
|
|
10269
10274
|
}, sr = (y) => {
|
|
10270
10275
|
if (!F || !o) return;
|
|
10271
10276
|
const I = A.find((O) => O.id === y.retailerId), m = ti(F, y, I);
|
|
10272
|
-
|
|
10277
|
+
Ve({ op: "upsert_assignment", assignment: y }), Ve(
|
|
10273
10278
|
{
|
|
10274
10279
|
op: "upsert_shape",
|
|
10275
10280
|
shape: {
|
|
@@ -10283,8 +10288,8 @@ function Sf({
|
|
|
10283
10288
|
},
|
|
10284
10289
|
"none"
|
|
10285
10290
|
);
|
|
10286
|
-
},
|
|
10287
|
-
!F || !o || (
|
|
10291
|
+
}, Ur = () => {
|
|
10292
|
+
!F || !o || (Ve({ op: "delete_assignment", shapeId: F.id }), Ve(
|
|
10288
10293
|
{
|
|
10289
10294
|
op: "upsert_shape",
|
|
10290
10295
|
shape: {
|
|
@@ -10386,7 +10391,7 @@ function Sf({
|
|
|
10386
10391
|
}
|
|
10387
10392
|
I.length && vn(I);
|
|
10388
10393
|
}, vn = (y) => {
|
|
10389
|
-
y.forEach((I, m) =>
|
|
10394
|
+
y.forEach((I, m) => Ve(I, m === 0 ? "step" : "none"));
|
|
10390
10395
|
}, fo = F ? nr(F, $.anchors, $.connectors) : null, Lo = fo === "escalator" || fo === "elevator" ? fo : null, lr = /* @__PURE__ */ v(je, { children: [
|
|
10391
10396
|
/* @__PURE__ */ s(
|
|
10392
10397
|
rf,
|
|
@@ -10400,8 +10405,8 @@ function Sf({
|
|
|
10400
10405
|
anchors: $.anchors,
|
|
10401
10406
|
connectors: $.connectors,
|
|
10402
10407
|
canEdit: o,
|
|
10403
|
-
showAssignment:
|
|
10404
|
-
emptyHint:
|
|
10408
|
+
showAssignment: U !== "edit-map",
|
|
10409
|
+
emptyHint: U === "stores" || U === "amenities" || U === "kiosks" || U === "custom" || U === "unassigned" || U === "escalators" || U === "elevators" ? "" : void 0,
|
|
10405
10410
|
selectedShapes: $.shapes.filter(
|
|
10406
10411
|
(y) => we.includes(y.id)
|
|
10407
10412
|
),
|
|
@@ -10410,11 +10415,11 @@ function Sf({
|
|
|
10410
10415
|
),
|
|
10411
10416
|
onRename: ht,
|
|
10412
10417
|
onChangeKind: Hr,
|
|
10413
|
-
onChangeLevel:
|
|
10414
|
-
onCopyToLevel:
|
|
10418
|
+
onChangeLevel: U === "edit-map" ? Kr : void 0,
|
|
10419
|
+
onCopyToLevel: U === "edit-map" ? Ao : void 0,
|
|
10415
10420
|
levels: Ns("edit-map", $.levels),
|
|
10416
10421
|
onDelete: D,
|
|
10417
|
-
onClearAssignment:
|
|
10422
|
+
onClearAssignment: Ur,
|
|
10418
10423
|
onUpdateLabel: Ro,
|
|
10419
10424
|
onSaveAssignment: sr,
|
|
10420
10425
|
onBulkAssign: Pt,
|
|
@@ -10424,7 +10429,7 @@ function Sf({
|
|
|
10424
10429
|
kioskIconColor: Te.KIOSK_ICON_COLOR
|
|
10425
10430
|
}
|
|
10426
10431
|
),
|
|
10427
|
-
|
|
10432
|
+
U !== "edit-map" && F && Lo ? /* @__PURE__ */ s(
|
|
10428
10433
|
Bh,
|
|
10429
10434
|
{
|
|
10430
10435
|
shape: F,
|
|
@@ -10461,9 +10466,9 @@ function Sf({
|
|
|
10461
10466
|
canEdit: o,
|
|
10462
10467
|
onAssign: (y) => Gt(Wn.id, y)
|
|
10463
10468
|
}
|
|
10464
|
-
) : null,
|
|
10469
|
+
) : null, Vr = sn(
|
|
10465
10470
|
(y) => {
|
|
10466
|
-
if (
|
|
10471
|
+
if (U !== "map-responsiveness" || ee == null) return;
|
|
10467
10472
|
const I = kc({
|
|
10468
10473
|
zoom: y.zoom,
|
|
10469
10474
|
position: y.position,
|
|
@@ -10479,18 +10484,18 @@ function Sf({
|
|
|
10479
10484
|
}
|
|
10480
10485
|
}));
|
|
10481
10486
|
},
|
|
10482
|
-
[ee, Q,
|
|
10487
|
+
[ee, Q, U]
|
|
10483
10488
|
), Kn = sn(() => {
|
|
10484
10489
|
ee != null && He((y) => ({
|
|
10485
10490
|
...y,
|
|
10486
10491
|
[ni(ee, Q)]: Ic(ee, Q)
|
|
10487
10492
|
}));
|
|
10488
|
-
}, [ee, Q]), To =
|
|
10493
|
+
}, [ee, Q]), To = U === "wayfinding" ? "route" : U === "edit-map" ? "map" : void 0;
|
|
10489
10494
|
return /* @__PURE__ */ v("div", { className: `eyeon-map-editor eyeon-map-editor--${e} ${G ?? ""}`, children: [
|
|
10490
10495
|
yn ? /* @__PURE__ */ s(
|
|
10491
10496
|
$p,
|
|
10492
10497
|
{
|
|
10493
|
-
section:
|
|
10498
|
+
section: U,
|
|
10494
10499
|
onSectionChange: bt,
|
|
10495
10500
|
draft: $,
|
|
10496
10501
|
activeLevelId: ee,
|
|
@@ -10518,7 +10523,7 @@ function Sf({
|
|
|
10518
10523
|
onSatellite: K,
|
|
10519
10524
|
onHeading: (y) => {
|
|
10520
10525
|
var m;
|
|
10521
|
-
const I =
|
|
10526
|
+
const I = Vc(y);
|
|
10522
10527
|
(m = _t.current) == null || m.setHeading(I), nn((O) => ({ ...O, heading: I }));
|
|
10523
10528
|
},
|
|
10524
10529
|
onZoom: (y) => {
|
|
@@ -10547,7 +10552,7 @@ function Sf({
|
|
|
10547
10552
|
onAutoroute: w,
|
|
10548
10553
|
theme: Te,
|
|
10549
10554
|
onThemeChange: (y) => {
|
|
10550
|
-
r &&
|
|
10555
|
+
r && Ve(
|
|
10551
10556
|
{ op: "update_theme", theme: { ...$.theme, ...y } },
|
|
10552
10557
|
"none"
|
|
10553
10558
|
);
|
|
@@ -10696,7 +10701,7 @@ function Sf({
|
|
|
10696
10701
|
const m = ct(It.current);
|
|
10697
10702
|
if (!m) return;
|
|
10698
10703
|
const O = Bt(ho.current);
|
|
10699
|
-
!O && Qr(m) || O && ei(O, m) ||
|
|
10704
|
+
!O && Qr(m) || O && ei(O, m) || Ve({ op: "update_georeference", georeference: m }, "none");
|
|
10700
10705
|
}
|
|
10701
10706
|
},
|
|
10702
10707
|
le
|
|
@@ -10719,7 +10724,7 @@ function Sf({
|
|
|
10719
10724
|
imageProxyUrl: B,
|
|
10720
10725
|
device: pn ? Q : void 0,
|
|
10721
10726
|
captureCamera: pn,
|
|
10722
|
-
onCameraChange: pn ?
|
|
10727
|
+
onCameraChange: pn ? Vr : void 0,
|
|
10723
10728
|
onCameraReset: pn ? Kn : void 0,
|
|
10724
10729
|
googleMapsApiKey: ne
|
|
10725
10730
|
},
|
|
@@ -10750,7 +10755,7 @@ function Sf({
|
|
|
10750
10755
|
interactiveOnly: (on == null ? void 0 : on.kind) === "outdoor",
|
|
10751
10756
|
showGrid: !0,
|
|
10752
10757
|
gridOpacity: St,
|
|
10753
|
-
routeMode:
|
|
10758
|
+
routeMode: U === "wayfinding",
|
|
10754
10759
|
readOnly: Ke,
|
|
10755
10760
|
onUndo: dt,
|
|
10756
10761
|
onRouteDraftActiveChange: J,
|
|
@@ -10794,7 +10799,7 @@ function Sf({
|
|
|
10794
10799
|
},
|
|
10795
10800
|
onCreateRoutePoint: (y, I) => {
|
|
10796
10801
|
if (!on || !_n) return null;
|
|
10797
|
-
const m =
|
|
10802
|
+
const m = Ve({
|
|
10798
10803
|
op: "upsert_anchor",
|
|
10799
10804
|
anchor: {
|
|
10800
10805
|
levelId: on.id,
|
|
@@ -10803,7 +10808,7 @@ function Sf({
|
|
|
10803
10808
|
kind: "junction"
|
|
10804
10809
|
}
|
|
10805
10810
|
});
|
|
10806
|
-
return m != null && I != null && !rr(rn, I, m) &&
|
|
10811
|
+
return m != null && I != null && !rr(rn, I, m) && Ve(
|
|
10807
10812
|
{
|
|
10808
10813
|
op: "upsert_edge",
|
|
10809
10814
|
edge: {
|
|
@@ -10825,7 +10830,7 @@ function Sf({
|
|
|
10825
10830
|
rn,
|
|
10826
10831
|
() => Le.current--
|
|
10827
10832
|
);
|
|
10828
|
-
m &&
|
|
10833
|
+
m && Ve(m);
|
|
10829
10834
|
},
|
|
10830
10835
|
onInsertRouteJunction: (y, I) => {
|
|
10831
10836
|
if (!_n || !on) return null;
|
|
@@ -10917,7 +10922,7 @@ function Sf({
|
|
|
10917
10922
|
const O = In.find((de) => de.id === y);
|
|
10918
10923
|
if (!O) return;
|
|
10919
10924
|
const P = { x: I - O.x, y: m - O.y };
|
|
10920
|
-
if (
|
|
10925
|
+
if (Ve(
|
|
10921
10926
|
{
|
|
10922
10927
|
op: "upsert_anchor",
|
|
10923
10928
|
anchor: { ...O, x: I, y: m }
|
|
@@ -10926,7 +10931,7 @@ function Sf({
|
|
|
10926
10931
|
), !(P.x === 0 && P.y === 0))
|
|
10927
10932
|
for (const de of $.edges) {
|
|
10928
10933
|
const ve = wc(de, y, P);
|
|
10929
|
-
ve &&
|
|
10934
|
+
ve && Ve(
|
|
10930
10935
|
{ op: "upsert_edge", edge: { ...de, curve: ve } },
|
|
10931
10936
|
"none"
|
|
10932
10937
|
);
|
|
@@ -10935,18 +10940,18 @@ function Sf({
|
|
|
10935
10940
|
onUpdateRouteCurve: (y, I, m) => {
|
|
10936
10941
|
if (!_n) return;
|
|
10937
10942
|
const O = $.edges.find((P) => P.id === y);
|
|
10938
|
-
O &&
|
|
10943
|
+
O && Ve(
|
|
10939
10944
|
{ op: "upsert_edge", edge: { ...O, curve: I } },
|
|
10940
10945
|
m != null && m.live ? "gesture" : "step"
|
|
10941
10946
|
);
|
|
10942
10947
|
},
|
|
10943
10948
|
onCreateShape: (y, I, m) => {
|
|
10944
|
-
if (
|
|
10949
|
+
if (U === "wayfinding" || !on || !_n)
|
|
10945
10950
|
return;
|
|
10946
10951
|
const O = Fi(
|
|
10947
10952
|
y,
|
|
10948
10953
|
$i($.shapes, on.id)
|
|
10949
|
-
), P =
|
|
10954
|
+
), P = Ve({
|
|
10950
10955
|
op: "upsert_shape",
|
|
10951
10956
|
shape: {
|
|
10952
10957
|
levelId: on.id,
|
|
@@ -10969,7 +10974,7 @@ function Sf({
|
|
|
10969
10974
|
},
|
|
10970
10975
|
onUpdateShapeGeometry: ir,
|
|
10971
10976
|
onBatchShapeEdits: (y) => {
|
|
10972
|
-
if (
|
|
10977
|
+
if (U === "wayfinding" || !on || !_n || y.length === 0)
|
|
10973
10978
|
return;
|
|
10974
10979
|
const I = [];
|
|
10975
10980
|
let m = !1;
|
|
@@ -11024,10 +11029,10 @@ function Sf({
|
|
|
11024
11029
|
}
|
|
11025
11030
|
),
|
|
11026
11031
|
/* @__PURE__ */ s(
|
|
11027
|
-
|
|
11032
|
+
Uc,
|
|
11028
11033
|
{
|
|
11029
11034
|
levels: $.levels,
|
|
11030
|
-
floorOptions: Ns(
|
|
11035
|
+
floorOptions: Ns(U, $.levels),
|
|
11031
11036
|
alwaysShowFloors: !0,
|
|
11032
11037
|
activeLevelId: ee,
|
|
11033
11038
|
onActiveLevelChange: Qn,
|
|
@@ -11071,7 +11076,7 @@ function Ef({
|
|
|
11071
11076
|
onApply: i,
|
|
11072
11077
|
onCancel: r
|
|
11073
11078
|
}) {
|
|
11074
|
-
const [l,
|
|
11079
|
+
const [l, d] = T({}), h = xe(() => {
|
|
11075
11080
|
const a = e.items.filter((_) => _.change === "added"), p = e.items.filter((_) => _.change === "removed"), f = e.items.filter(
|
|
11076
11081
|
(_) => _.geometryLocked && _.change !== "removed" && _.change !== "added"
|
|
11077
11082
|
), c = e.items.filter((_) => _.change === "moved");
|
|
@@ -11118,7 +11123,7 @@ function Ef({
|
|
|
11118
11123
|
label: p.sourceSvgId
|
|
11119
11124
|
}))
|
|
11120
11125
|
],
|
|
11121
|
-
onChange: (p) =>
|
|
11126
|
+
onChange: (p) => d((f) => ({
|
|
11122
11127
|
...f,
|
|
11123
11128
|
[a.existingShapeId]: p
|
|
11124
11129
|
}))
|