@eyeon/map 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/MapViewer.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/chunks/MapViewer.js +2656 -1290
- package/dist/chunks/MapViewer.js.map +1 -1
- package/dist/chunks/stacking.js +1496 -873
- package/dist/chunks/stacking.js.map +1 -1
- package/dist/chunks/wheelZoom.js +259 -0
- package/dist/chunks/wheelZoom.js.map +1 -0
- package/dist/core/assignment.d.ts +97 -0
- package/dist/core/assignment.d.ts.map +1 -0
- package/dist/core/color.d.ts +5 -0
- package/dist/core/color.d.ts.map +1 -0
- package/dist/core/entranceIcon.d.ts +12 -0
- package/dist/core/entranceIcon.d.ts.map +1 -0
- package/dist/core/filletPolygon.d.ts +10 -0
- package/dist/core/filletPolygon.d.ts.map +1 -0
- package/dist/core/hostChrome.d.ts +2 -4
- package/dist/core/hostChrome.d.ts.map +1 -1
- package/dist/core/import/index.d.ts +4 -0
- package/dist/core/import/index.d.ts.map +1 -1
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +160 -219
- package/dist/core/index.js.map +1 -1
- package/dist/core/labelAlign.d.ts +7 -0
- package/dist/core/labelAlign.d.ts.map +1 -0
- package/dist/core/layerStyles.d.ts +54 -5
- package/dist/core/layerStyles.d.ts.map +1 -1
- package/dist/core/mediaUrl.d.ts +3 -0
- package/dist/core/mediaUrl.d.ts.map +1 -0
- package/dist/core/outdoorDecoration.d.ts +16 -0
- package/dist/core/outdoorDecoration.d.ts.map +1 -0
- package/dist/core/publish/index.d.ts +6 -4
- package/dist/core/publish/index.d.ts.map +1 -1
- package/dist/core/routing/graph-tools.d.ts +23 -1
- package/dist/core/routing/graph-tools.d.ts.map +1 -1
- package/dist/core/routing/pathfinding.d.ts.map +1 -1
- package/dist/core/stacking.d.ts +50 -3
- package/dist/core/stacking.d.ts.map +1 -1
- package/dist/core/types.d.ts +34 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/voids.d.ts +41 -0
- package/dist/core/voids.d.ts.map +1 -0
- package/dist/core/wheelZoom.d.ts +30 -0
- package/dist/core/wheelZoom.d.ts.map +1 -0
- package/dist/editor/FieldResetButton.d.ts +7 -0
- package/dist/editor/FieldResetButton.d.ts.map +1 -0
- package/dist/editor/MapEditor.d.ts +13 -3
- package/dist/editor/MapEditor.d.ts.map +1 -1
- package/dist/editor/canvas/EditorCanvas.d.ts +49 -7
- package/dist/editor/canvas/EditorCanvas.d.ts.map +1 -1
- package/dist/editor/canvas/OutdoorSvgUnderlay.d.ts +8 -0
- package/dist/editor/canvas/OutdoorSvgUnderlay.d.ts.map +1 -0
- package/dist/editor/canvas/coords.d.ts +56 -3
- package/dist/editor/canvas/coords.d.ts.map +1 -1
- package/dist/editor/canvas/editorFill.d.ts +12 -0
- package/dist/editor/canvas/editorFill.d.ts.map +1 -0
- package/dist/editor/canvas/editorHover.d.ts +18 -0
- package/dist/editor/canvas/editorHover.d.ts.map +1 -0
- package/dist/editor/canvas/underlayHint.d.ts +13 -0
- package/dist/editor/canvas/underlayHint.d.ts.map +1 -0
- package/dist/editor/connectorAssignments.d.ts +125 -0
- package/dist/editor/connectorAssignments.d.ts.map +1 -0
- package/dist/editor/draftOps.d.ts +12 -1
- package/dist/editor/draftOps.d.ts.map +1 -1
- package/dist/editor/editorSectionReturn.d.ts +12 -0
- package/dist/editor/editorSectionReturn.d.ts.map +1 -0
- package/dist/editor/ellipseDraw.d.ts +12 -0
- package/dist/editor/ellipseDraw.d.ts.map +1 -0
- package/dist/editor/entranceIcon.d.ts +15 -0
- package/dist/editor/entranceIcon.d.ts.map +1 -0
- package/dist/editor/floorsListReturn.d.ts +5 -0
- package/dist/editor/floorsListReturn.d.ts.map +1 -0
- package/dist/editor/geometryEdit.d.ts +23 -3
- package/dist/editor/geometryEdit.d.ts.map +1 -1
- package/dist/editor/hexColor.d.ts +6 -0
- package/dist/editor/hexColor.d.ts.map +1 -0
- package/dist/editor/history.d.ts +31 -0
- package/dist/editor/history.d.ts.map +1 -0
- package/dist/editor/index.css +1038 -68
- package/dist/editor/index.d.ts +6 -4
- package/dist/editor/index.d.ts.map +1 -1
- package/dist/editor/index.js +8744 -2136
- package/dist/editor/index.js.map +1 -1
- package/dist/editor/labelText.d.ts +25 -0
- package/dist/editor/labelText.d.ts.map +1 -0
- package/dist/editor/labels.d.ts +8 -0
- package/dist/editor/labels.d.ts.map +1 -1
- package/dist/editor/panels/AssignForm.d.ts +17 -0
- package/dist/editor/panels/AssignForm.d.ts.map +1 -0
- package/dist/editor/panels/AssignmentStyleFields.d.ts +14 -0
- package/dist/editor/panels/AssignmentStyleFields.d.ts.map +1 -0
- package/dist/editor/panels/BulkAssignForm.d.ts +11 -0
- package/dist/editor/panels/BulkAssignForm.d.ts.map +1 -0
- package/dist/editor/panels/CatalogKioskForm.d.ts +18 -0
- package/dist/editor/panels/CatalogKioskForm.d.ts.map +1 -0
- package/dist/editor/panels/ConnectorAssign.d.ts +16 -0
- package/dist/editor/panels/ConnectorAssign.d.ts.map +1 -0
- package/dist/editor/panels/CopyToLevelButton.d.ts +10 -0
- package/dist/editor/panels/CopyToLevelButton.d.ts.map +1 -0
- package/dist/editor/panels/EntranceIconForm.d.ts +11 -0
- package/dist/editor/panels/EntranceIconForm.d.ts.map +1 -0
- package/dist/editor/panels/FloorsPanel.d.ts +4 -0
- package/dist/editor/panels/FloorsPanel.d.ts.map +1 -1
- package/dist/editor/panels/ImportReviewPanel.d.ts.map +1 -1
- package/dist/editor/panels/Inspector.d.ts +24 -2
- package/dist/editor/panels/Inspector.d.ts.map +1 -1
- package/dist/editor/panels/LeftRail.d.ts +24 -11
- package/dist/editor/panels/LeftRail.d.ts.map +1 -1
- package/dist/editor/panels/PreviewOverlay.d.ts +9 -3
- package/dist/editor/panels/PreviewOverlay.d.ts.map +1 -1
- package/dist/editor/panels/TextLabelForm.d.ts +11 -0
- package/dist/editor/panels/TextLabelForm.d.ts.map +1 -0
- package/dist/editor/panels/formRows.d.ts +41 -0
- package/dist/editor/panels/formRows.d.ts.map +1 -0
- package/dist/editor/pathRings.d.ts +79 -0
- package/dist/editor/pathRings.d.ts.map +1 -0
- package/dist/editor/portalSurface.d.ts +37 -3
- package/dist/editor/portalSurface.d.ts.map +1 -1
- package/dist/editor/previewDocument.d.ts +2 -1
- package/dist/editor/previewDocument.d.ts.map +1 -1
- package/dist/editor/railAssignments.d.ts +29 -0
- package/dist/editor/railAssignments.d.ts.map +1 -0
- package/dist/editor/railKiosks.d.ts +27 -0
- package/dist/editor/railKiosks.d.ts.map +1 -0
- package/dist/editor/railListCopy.d.ts +31 -0
- package/dist/editor/railListCopy.d.ts.map +1 -0
- package/dist/editor/routeStubs.d.ts +103 -0
- package/dist/editor/routeStubs.d.ts.map +1 -0
- package/dist/editor/shapeCopy.d.ts +40 -0
- package/dist/editor/shapeCopy.d.ts.map +1 -0
- package/dist/editor/shapeSelection.d.ts +6 -0
- package/dist/editor/shapeSelection.d.ts.map +1 -0
- package/dist/editor/snapPoint.d.ts +5 -0
- package/dist/editor/snapPoint.d.ts.map +1 -0
- package/dist/editor/splitJoin.d.ts +78 -0
- package/dist/editor/splitJoin.d.ts.map +1 -0
- package/dist/editor/tools.d.ts +46 -7
- package/dist/editor/tools.d.ts.map +1 -1
- package/dist/fonts/assets.d.ts +4 -0
- package/dist/fonts/mapFont.d.ts +5 -0
- package/dist/fonts/mapFont.d.ts.map +1 -0
- package/dist/fonts/mapFontUrl.d.ts +8 -0
- package/dist/fonts/mapFontUrl.d.ts.map +1 -0
- package/dist/specialIcons.d.ts +39 -0
- package/dist/specialIcons.d.ts.map +1 -0
- package/dist/test-maps/shops-at-south-town/BASE - Shops At South Town.ai +6326 -6407
- package/dist/test-maps/shops-at-south-town/LF - Shops At South Town.ai +458 -484
- package/dist/test-maps/shops-at-south-town/SVG/BASE - Shops At South Town.svg +6 -6
- package/dist/test-maps/shops-at-south-town/SVG/LF - Shops At South Town.svg +52 -52
- package/dist/test-maps/shops-at-south-town/SVG/UF - Shops At South Town.svg +74 -74
- package/dist/test-maps/shops-at-south-town/UF - Shops At South Town.ai +341 -436
- package/dist/ui/ModernSelect.d.ts +14 -0
- package/dist/ui/ModernSelect.d.ts.map +1 -0
- package/dist/ui/selectSearch.d.ts +12 -0
- package/dist/ui/selectSearch.d.ts.map +1 -0
- package/dist/viewer/MapViewer.d.ts +14 -1
- package/dist/viewer/MapViewer.d.ts.map +1 -1
- package/dist/viewer/camera.d.ts +85 -1
- package/dist/viewer/camera.d.ts.map +1 -1
- package/dist/viewer/components/CameraRig.d.ts +18 -1
- package/dist/viewer/components/CameraRig.d.ts.map +1 -1
- package/dist/viewer/components/LevelMeshes.d.ts +15 -4
- package/dist/viewer/components/LevelMeshes.d.ts.map +1 -1
- package/dist/viewer/components/MapScene.d.ts +10 -4
- package/dist/viewer/components/MapScene.d.ts.map +1 -1
- package/dist/viewer/components/OpeningWell.d.ts +7 -0
- package/dist/viewer/components/OpeningWell.d.ts.map +1 -0
- package/dist/viewer/components/RouteLine.d.ts.map +1 -1
- package/dist/viewer/components/SvgVectorLayer.d.ts +5 -3
- package/dist/viewer/components/SvgVectorLayer.d.ts.map +1 -1
- package/dist/viewer/components/openingGeometry.d.ts +7 -0
- package/dist/viewer/components/openingGeometry.d.ts.map +1 -0
- package/dist/viewer/index.css +251 -9
- package/dist/viewer/index.d.ts +1 -1
- package/dist/viewer/index.d.ts.map +1 -1
- package/dist/viewer/index.js +5 -5
- package/dist/viewer/pointer.d.ts +26 -0
- package/dist/viewer/pointer.d.ts.map +1 -0
- package/dist/viewer/ui/MapControls.d.ts +11 -3
- package/dist/viewer/ui/MapControls.d.ts.map +1 -1
- package/dist/viewer/ui/RuntimeChrome.d.ts.map +1 -1
- package/package.json +4 -2
package/dist/chunks/stacking.js
CHANGED
|
@@ -1,12 +1,117 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import Ut from "ngraph.graph";
|
|
2
|
+
import Ht from "ngraph.path";
|
|
3
|
+
const Vt = "transparent";
|
|
4
|
+
function ht(t) {
|
|
5
|
+
const e = (t ?? "").trim().toLowerCase();
|
|
6
|
+
return e === Vt || e === "none";
|
|
7
|
+
}
|
|
8
|
+
const vt = "#E9F7FC", Zt = [
|
|
9
|
+
"green-area",
|
|
10
|
+
"water-area",
|
|
11
|
+
"parking-lane",
|
|
12
|
+
"parking-line",
|
|
13
|
+
"parking-icon",
|
|
14
|
+
"walking-path"
|
|
15
|
+
], jt = {
|
|
16
|
+
"green-area": "GREEN_AREA_COLOR",
|
|
17
|
+
"water-area": "WATER_COLOR",
|
|
18
|
+
"parking-lane": "PARKING_LANE_COLOR",
|
|
19
|
+
"parking-icon": "PARKING_ICON_COLOR",
|
|
20
|
+
"walking-path": "WALKABLE_COLOR"
|
|
21
|
+
}, Nt = {
|
|
22
|
+
"green-area": {
|
|
23
|
+
fill: "#C4DDAB",
|
|
24
|
+
renderOrder: 2,
|
|
25
|
+
extrudeHeight: 1
|
|
26
|
+
},
|
|
27
|
+
"water-area": {
|
|
28
|
+
fill: "#5cc0f9",
|
|
29
|
+
renderOrder: 2,
|
|
30
|
+
extrudeHeight: 1
|
|
31
|
+
},
|
|
32
|
+
"parking-lane": {
|
|
33
|
+
fill: "#F6F6F6",
|
|
34
|
+
renderOrder: 2,
|
|
35
|
+
extrudeHeight: 1
|
|
36
|
+
},
|
|
37
|
+
"parking-line": {
|
|
38
|
+
stroke: "#DDDDDD",
|
|
39
|
+
strokeWidth: 0.6,
|
|
40
|
+
renderOrder: 6,
|
|
41
|
+
extrudeHeight: 0.5
|
|
42
|
+
},
|
|
43
|
+
"parking-icon": {
|
|
44
|
+
fill: "#CCCCCC",
|
|
45
|
+
renderOrder: 7,
|
|
46
|
+
extrudeHeight: 1
|
|
47
|
+
},
|
|
48
|
+
"walking-path": {
|
|
49
|
+
fill: vt,
|
|
50
|
+
renderOrder: 2,
|
|
51
|
+
extrudeHeight: 1
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
function z(t) {
|
|
55
|
+
const e = Nt[t];
|
|
56
|
+
return e.fill ?? e.stroke ?? "";
|
|
57
|
+
}
|
|
58
|
+
function qt() {
|
|
59
|
+
return {
|
|
60
|
+
GREEN_AREA_COLOR: z("green-area"),
|
|
61
|
+
WATER_COLOR: z("water-area"),
|
|
62
|
+
PARKING_LANE_COLOR: z("parking-lane"),
|
|
63
|
+
PARKING_ICON_COLOR: z("parking-icon"),
|
|
64
|
+
WALKABLE_COLOR: z("walking-path")
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function Tt(t) {
|
|
68
|
+
return t.toLowerCase().replace(/[-_]+/g, " ").replace(/\s+/g, " ").trim();
|
|
69
|
+
}
|
|
70
|
+
function Qt(t, e) {
|
|
71
|
+
const n = Tt(e);
|
|
72
|
+
return !!(t === n || t.startsWith(`${n} `) || t === `${n}s` || t.startsWith(`${n}s `));
|
|
73
|
+
}
|
|
74
|
+
function Jt(t) {
|
|
75
|
+
if (!t) return null;
|
|
76
|
+
const e = Tt(t);
|
|
77
|
+
if (!e) return null;
|
|
78
|
+
const n = [...Zt].sort((o, r) => r.length - o.length);
|
|
79
|
+
for (const o of n)
|
|
80
|
+
if (Qt(e, o)) return o;
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
function te(t, e, n) {
|
|
84
|
+
const o = jt[e];
|
|
85
|
+
if (!o) return t;
|
|
86
|
+
const r = n == null ? void 0 : n[o];
|
|
87
|
+
return typeof r != "string" ? t : ht(r) ? t.fill ? { ...t, fill: "transparent" } : t.stroke ? { ...t, stroke: "transparent" } : t : r.trim() ? t.fill ? { ...t, fill: r } : t.stroke ? { ...t, stroke: r } : t : t;
|
|
88
|
+
}
|
|
89
|
+
function yt(t, e) {
|
|
90
|
+
const n = Jt(t);
|
|
91
|
+
return n ? te(Nt[n], n, e) : null;
|
|
92
|
+
}
|
|
93
|
+
function ee(t, e) {
|
|
94
|
+
const n = (e == null ? void 0 : e.omitStaticLayers) === !0, o = /* @__PURE__ */ new Set();
|
|
95
|
+
for (const r of t) {
|
|
96
|
+
const s = r.sourceSvgId;
|
|
97
|
+
s && (n && yt(s) || o.add(s));
|
|
98
|
+
}
|
|
99
|
+
return o;
|
|
100
|
+
}
|
|
101
|
+
function Rn(t) {
|
|
102
|
+
return ee(
|
|
103
|
+
t.flatMap((e) => [...e.shapes]),
|
|
104
|
+
{ omitStaticLayers: !0 }
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
const W = {
|
|
4
108
|
MAP_STYLE: "2D",
|
|
5
109
|
MAP_BACKGROUND_COLOR: "#FFFFFF",
|
|
6
110
|
ACCENT_COLOR: "#2563eb",
|
|
7
|
-
STORE_DEFAULT_COLOR: "#
|
|
111
|
+
STORE_DEFAULT_COLOR: "#b6babe",
|
|
8
112
|
STORE_TEXT_COLOR: "#1e293b",
|
|
9
113
|
STORE_HEIGHT: 4,
|
|
114
|
+
STORE_RADIUS: 0,
|
|
10
115
|
WALL_COLOR: "#64748b",
|
|
11
116
|
WALL_THICKNESS: 0.4,
|
|
12
117
|
BOUNDARY_COLOR: "#334155",
|
|
@@ -15,415 +120,656 @@ const J = {
|
|
|
15
120
|
OVERLAY_COLOR: "#000000",
|
|
16
121
|
OVERLAY_OPACITY: 0.15,
|
|
17
122
|
PARKING_ZONE_COLOR: "#cbd5e1",
|
|
18
|
-
|
|
19
|
-
WATER_COLOR: "#7dd3fc",
|
|
20
|
-
WALKABLE_COLOR: "#f8fafc",
|
|
123
|
+
...qt(),
|
|
21
124
|
KIOSK_SIZE: 12,
|
|
22
125
|
ZOOM_STEP: 0.5,
|
|
23
126
|
CAMERA_MAX_DISTANCE: 2e3,
|
|
24
127
|
CAMERA_MIN_DISTANCE: 50
|
|
25
|
-
},
|
|
26
|
-
function
|
|
27
|
-
const
|
|
28
|
-
return
|
|
128
|
+
}, ne = "#f5f5f5", oe = /* @__PURE__ */ new Set(["#f8fafc", "#f1efea"]), re = "#86efac", ie = "#7dd3fc", se = "#e2e8f0", ce = 500;
|
|
129
|
+
function wt(t) {
|
|
130
|
+
const e = typeof t == "number" ? t : Number(t);
|
|
131
|
+
return !Number.isFinite(e) || e <= 0 ? 0 : Math.min(e, ce);
|
|
132
|
+
}
|
|
133
|
+
function ae(...t) {
|
|
134
|
+
const e = Object.assign({}, W, ...t.filter(Boolean));
|
|
135
|
+
return e.MAP_BACKGROUND_COLOR.toLowerCase() === ne && (e.MAP_BACKGROUND_COLOR = W.MAP_BACKGROUND_COLOR), oe.has(e.WALKABLE_COLOR.toLowerCase()) && (e.WALKABLE_COLOR = vt), e.GREEN_AREA_COLOR.toLowerCase() === re && (e.GREEN_AREA_COLOR = W.GREEN_AREA_COLOR), e.WATER_COLOR.toLowerCase() === ie && (e.WATER_COLOR = W.WATER_COLOR), e.STORE_DEFAULT_COLOR.toLowerCase() === se && (e.STORE_DEFAULT_COLOR = W.STORE_DEFAULT_COLOR), e.STORE_RADIUS = wt(e.STORE_RADIUS), e;
|
|
29
136
|
}
|
|
30
|
-
const
|
|
137
|
+
const le = [
|
|
31
138
|
"unit",
|
|
32
139
|
"amenity",
|
|
33
140
|
"kiosk_screen",
|
|
34
141
|
"connector",
|
|
35
142
|
"entrance",
|
|
36
143
|
"parking_zone"
|
|
37
|
-
],
|
|
38
|
-
function
|
|
39
|
-
|
|
144
|
+
], ut = 1e4, vn = 2.5, ue = "entrance", Nn = 36, fe = 8;
|
|
145
|
+
function Tn(t) {
|
|
146
|
+
var e;
|
|
147
|
+
return t.kind === "entrance" && ((e = t.label) == null ? void 0 : e.imageKey) === ue;
|
|
40
148
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
149
|
+
function wn(t) {
|
|
150
|
+
return Math.max(fe, t);
|
|
151
|
+
}
|
|
152
|
+
const Pn = ["left", "center", "right"], de = "center";
|
|
153
|
+
function Fn(t) {
|
|
154
|
+
return t === "left" || t === "right" ? t : de;
|
|
155
|
+
}
|
|
156
|
+
function Yn(t, e) {
|
|
157
|
+
return e === "left" ? t.minX : e === "right" ? t.maxX : (t.minX + t.maxX) / 2;
|
|
158
|
+
}
|
|
159
|
+
function Dn(t) {
|
|
160
|
+
return t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
161
|
+
}
|
|
162
|
+
const J = 12, he = J, ye = 4, xe = [
|
|
163
|
+
"retail_name",
|
|
164
|
+
"retail_logo",
|
|
165
|
+
"retail_text",
|
|
166
|
+
"kiosk",
|
|
167
|
+
"amenity",
|
|
168
|
+
"connector",
|
|
169
|
+
"custom_text",
|
|
170
|
+
"custom_image"
|
|
171
|
+
], pe = new Set(xe);
|
|
172
|
+
function U(t, e) {
|
|
173
|
+
const n = typeof t == "number" ? t : Number(t);
|
|
174
|
+
return Number.isFinite(n) ? n : e;
|
|
175
|
+
}
|
|
176
|
+
const me = /^(?:|[+\-]|[+\-]?\.(?:0*)?)$/;
|
|
177
|
+
function ge(t) {
|
|
178
|
+
const e = t.trim();
|
|
179
|
+
if (me.test(e))
|
|
180
|
+
return { render: 0, complete: !1 };
|
|
181
|
+
const n = Number(e);
|
|
182
|
+
return Number.isFinite(n) ? { render: n, complete: !0 } : { render: 0, complete: !1 };
|
|
183
|
+
}
|
|
184
|
+
function Bn(t) {
|
|
185
|
+
const e = ge(t);
|
|
186
|
+
return e.complete ? { display: String(e.render), render: e.render } : { display: "0", render: 0 };
|
|
187
|
+
}
|
|
188
|
+
function B(t) {
|
|
189
|
+
if (t == null) return null;
|
|
190
|
+
const e = String(t).trim();
|
|
191
|
+
return e || null;
|
|
192
|
+
}
|
|
193
|
+
function be(t) {
|
|
194
|
+
if (t == null) return null;
|
|
195
|
+
const e = String(t);
|
|
196
|
+
return e === "" ? null : e;
|
|
197
|
+
}
|
|
198
|
+
function nt(t) {
|
|
199
|
+
if (t == null || t === "") return null;
|
|
200
|
+
const e = Number(t);
|
|
201
|
+
return Number.isFinite(e) ? e : null;
|
|
202
|
+
}
|
|
203
|
+
function ke(t) {
|
|
204
|
+
return typeof t == "string" && pe.has(t);
|
|
205
|
+
}
|
|
206
|
+
function Pt(t) {
|
|
207
|
+
return t === "amenity" ? "amenity" : t === "kiosk_screen" ? "kiosk" : t === "connector" ? "connector" : "retail_name";
|
|
208
|
+
}
|
|
209
|
+
function Xn(t) {
|
|
210
|
+
return t === "amenity" ? "amenity" : t === "kiosk_screen" ? "kiosk" : t === "unit" || t === "parking_zone" ? "retailer" : "none";
|
|
211
|
+
}
|
|
212
|
+
function Gn(t, e) {
|
|
213
|
+
return {
|
|
214
|
+
shapeId: t,
|
|
215
|
+
targetType: "none",
|
|
216
|
+
retailerId: null,
|
|
217
|
+
amenityId: null,
|
|
218
|
+
kioskId: null,
|
|
219
|
+
unitStatus: "vacant",
|
|
220
|
+
unitNumber: null,
|
|
221
|
+
customLabel: null,
|
|
222
|
+
customImageKey: null,
|
|
223
|
+
layerType: Pt(e),
|
|
224
|
+
size: J,
|
|
225
|
+
rotate: 0,
|
|
226
|
+
offsetX: 0,
|
|
227
|
+
offsetY: 0,
|
|
228
|
+
bgColor: null,
|
|
229
|
+
textColor: null
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
function Kn(t, e = "unit") {
|
|
233
|
+
const n = t.layerType ?? t.layer_type, o = t.unitStatus ?? t.unit_status ?? "vacant";
|
|
234
|
+
return {
|
|
235
|
+
shapeId: U(
|
|
236
|
+
t.shapeId ?? t.shape_id,
|
|
237
|
+
0
|
|
238
|
+
),
|
|
239
|
+
targetType: t.targetType ?? t.target_type ?? "none",
|
|
240
|
+
retailerId: nt(
|
|
241
|
+
t.retailerId ?? t.retailer_id
|
|
242
|
+
),
|
|
243
|
+
amenityId: nt(
|
|
244
|
+
t.amenityId ?? t.amenity_id
|
|
245
|
+
),
|
|
246
|
+
kioskId: nt(
|
|
247
|
+
t.kioskId ?? t.kiosk_id
|
|
248
|
+
),
|
|
249
|
+
unitStatus: o || "vacant",
|
|
250
|
+
unitNumber: B(
|
|
251
|
+
t.unitNumber ?? t.unit_number
|
|
252
|
+
),
|
|
253
|
+
customLabel: be(
|
|
254
|
+
t.customLabel ?? t.custom_label
|
|
255
|
+
),
|
|
256
|
+
customImageKey: B(
|
|
257
|
+
t.customImageKey ?? t.custom_image_key
|
|
258
|
+
),
|
|
259
|
+
layerType: ke(n) ? n : Pt(e),
|
|
260
|
+
size: U(t.size, J),
|
|
261
|
+
rotate: U(t.rotate, 0),
|
|
262
|
+
offsetX: U(
|
|
263
|
+
t.offsetX ?? t.offset_x,
|
|
264
|
+
0
|
|
265
|
+
),
|
|
266
|
+
offsetY: U(
|
|
267
|
+
t.offsetY ?? t.offset_y,
|
|
268
|
+
0
|
|
269
|
+
),
|
|
270
|
+
bgColor: B(
|
|
271
|
+
t.bgColor ?? t.bg_color
|
|
272
|
+
),
|
|
273
|
+
textColor: B(
|
|
274
|
+
t.textColor ?? t.text_color
|
|
275
|
+
),
|
|
276
|
+
align: Ie(t.align)
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
function Ie(t) {
|
|
280
|
+
if (t === "left" || t === "right" || t === "center") return t;
|
|
281
|
+
}
|
|
282
|
+
function $n(t, e) {
|
|
283
|
+
const n = (t.location ?? "").trim();
|
|
284
|
+
return e && n && n !== "-" ? `${t.name} (${n})` : t.name;
|
|
285
|
+
}
|
|
286
|
+
function zn(t, e) {
|
|
287
|
+
var o;
|
|
288
|
+
const n = (o = t == null ? void 0 : t.bgColor) == null ? void 0 : o.trim();
|
|
289
|
+
return ht(n) ? "transparent" : n || e;
|
|
290
|
+
}
|
|
291
|
+
function Wn(t, e) {
|
|
292
|
+
var o;
|
|
293
|
+
const n = (o = t == null ? void 0 : t.textColor) == null ? void 0 : o.trim();
|
|
294
|
+
return ht(n) ? "transparent" : n || e;
|
|
295
|
+
}
|
|
296
|
+
function Un(t) {
|
|
297
|
+
const e = t.trim();
|
|
298
|
+
if (!e || !/^\d+$/.test(e)) return null;
|
|
299
|
+
const n = Number(e);
|
|
300
|
+
return Number.isSafeInteger(n) && n > 0 ? n : null;
|
|
301
|
+
}
|
|
302
|
+
function Hn(t, e) {
|
|
303
|
+
var r;
|
|
304
|
+
const n = e == null ? void 0 : e.trim();
|
|
305
|
+
if (n) return n;
|
|
306
|
+
const o = (r = t == null ? void 0 : t.customLabel) == null ? void 0 : r.trim();
|
|
307
|
+
return o || ((t == null ? void 0 : t.amenityId) != null ? `Amenity ${t.amenityId}` : null);
|
|
308
|
+
}
|
|
309
|
+
function Vn(t, e) {
|
|
310
|
+
var r;
|
|
311
|
+
const n = (r = t == null ? void 0 : t.customLabel) == null ? void 0 : r.trim();
|
|
312
|
+
if (n) return n;
|
|
313
|
+
const o = e == null ? void 0 : e.trim();
|
|
314
|
+
return o || ((t == null ? void 0 : t.kioskId) != null ? `Kiosk ${t.kioskId}` : null);
|
|
315
|
+
}
|
|
316
|
+
function X(t) {
|
|
317
|
+
var e, n;
|
|
318
|
+
return t ? t.targetType === "retailer" ? t.retailerId != null : t.targetType === "amenity" ? t.amenityId != null || !!((e = t.customLabel) != null && e.trim()) : t.targetType === "kiosk" ? t.kioskId != null || !!((n = t.customLabel) != null && n.trim()) : !1 : !1;
|
|
319
|
+
}
|
|
320
|
+
const _e = /* @__PURE__ */ new Set([
|
|
321
|
+
"unit",
|
|
322
|
+
"parking_zone",
|
|
323
|
+
"amenity",
|
|
324
|
+
"kiosk_screen"
|
|
325
|
+
]);
|
|
326
|
+
function Ft(t, e, n) {
|
|
327
|
+
var o, r;
|
|
328
|
+
return t.kind === "label" || t.kind === "entrance" ? t.label : t.kind === "connector" || (e == null ? void 0 : e.layerType) === "connector" ? e ? gt(
|
|
329
|
+
{ style: t.style ?? {}, label: t.label },
|
|
330
|
+
e,
|
|
331
|
+
n
|
|
332
|
+
).label : t.label : _e.has(t.kind) ? X(e) ? gt(
|
|
333
|
+
{ style: t.style ?? {}, label: t.label },
|
|
334
|
+
e,
|
|
335
|
+
n
|
|
336
|
+
).label : !((o = t.label) != null && o.text) && !((r = t.label) != null && r.imageKey) ? t.label : {
|
|
337
|
+
...t.label,
|
|
338
|
+
text: void 0,
|
|
339
|
+
imageKey: void 0
|
|
340
|
+
} : t.label;
|
|
341
|
+
}
|
|
342
|
+
function Ce(t, e) {
|
|
343
|
+
if (X(t)) {
|
|
344
|
+
if (t.layerType === "retail_text" || t.layerType === "custom_text")
|
|
345
|
+
return t.customLabel ?? void 0;
|
|
346
|
+
if (t.layerType === "retail_name")
|
|
347
|
+
return (e == null ? void 0 : e.name) ?? t.customLabel ?? void 0;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
function Yt(t, e, n) {
|
|
351
|
+
if (!(!X(t) || !t) && !(t.layerType !== "retail_logo" && t.layerType !== "custom_image"))
|
|
352
|
+
return Se(t, e) ?? B(n == null ? void 0 : n.imageKey) ?? void 0;
|
|
353
|
+
}
|
|
354
|
+
function Zn(t, e) {
|
|
355
|
+
var n, o;
|
|
356
|
+
if (!(!X(t) || !t)) {
|
|
357
|
+
if (t.layerType === "kiosk") return "kiosk";
|
|
358
|
+
if (t.layerType === "amenity")
|
|
359
|
+
return ((n = e == null ? void 0 : e.find((r) => r.id === t.amenityId)) == null ? void 0 : n.code) ?? ((o = t.customLabel) == null ? void 0 : o.trim()) ?? void 0;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
function Ae(t, e) {
|
|
363
|
+
const n = Number.isFinite(t) && t > 0 ? t : J;
|
|
364
|
+
return (e == null ? void 0 : e.layerType) === "retail_logo" ? n * ye : n;
|
|
365
|
+
}
|
|
366
|
+
function jn(t) {
|
|
367
|
+
const e = t.assignment, n = t.label;
|
|
368
|
+
return {
|
|
369
|
+
size: Ae(
|
|
370
|
+
(e == null ? void 0 : e.size) ?? (n == null ? void 0 : n.size) ?? he,
|
|
371
|
+
e
|
|
372
|
+
),
|
|
373
|
+
rotate: (e == null ? void 0 : e.rotate) ?? (n == null ? void 0 : n.rotate) ?? 0,
|
|
374
|
+
offsetX: (e == null ? void 0 : e.offsetX) ?? (n == null ? void 0 : n.offsetX) ?? 0,
|
|
375
|
+
offsetY: (e == null ? void 0 : e.offsetY) ?? (n == null ? void 0 : n.offsetY) ?? 0,
|
|
376
|
+
iconColor: (e == null ? void 0 : e.textColor) ?? (n == null ? void 0 : n.color) ?? null
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
function qn(t, e) {
|
|
380
|
+
var n;
|
|
381
|
+
return X(t) ? (t == null ? void 0 : t.layerType) === "kiosk" || (t == null ? void 0 : t.layerType) === "amenity" || Yt(t, null, e) ? !0 : !!((n = e == null ? void 0 : e.text) != null && n.trim()) : !1;
|
|
382
|
+
}
|
|
383
|
+
function Se(t, e) {
|
|
384
|
+
if (X(t)) {
|
|
385
|
+
if (t.layerType === "retail_logo")
|
|
386
|
+
return B(e == null ? void 0 : e.logoUrl) ?? B(t.customImageKey) ?? void 0;
|
|
387
|
+
if (t.layerType === "custom_image")
|
|
388
|
+
return B(t.customImageKey) ?? void 0;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
function ot(t) {
|
|
392
|
+
if (t.length === 0) return "";
|
|
393
|
+
const e = t[0];
|
|
394
|
+
return t.every((n) => n === e) ? e : "";
|
|
395
|
+
}
|
|
396
|
+
function mt(t) {
|
|
397
|
+
if (t.length === 0) return !1;
|
|
398
|
+
const e = t[0];
|
|
399
|
+
return t.some((n) => n !== e);
|
|
400
|
+
}
|
|
401
|
+
function Qn(t) {
|
|
402
|
+
const e = t.map((o) => o.bgColor ?? ""), n = t.map((o) => o.textColor ?? "");
|
|
403
|
+
return {
|
|
404
|
+
size: ot(t.map((o) => o.size)),
|
|
405
|
+
bgColor: ot(e),
|
|
406
|
+
textColor: ot(n),
|
|
407
|
+
bgColorMixed: mt(e),
|
|
408
|
+
textColorMixed: mt(n)
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
function Jn(t, e) {
|
|
412
|
+
return {
|
|
413
|
+
...t,
|
|
414
|
+
...e.size != null ? { size: e.size } : {},
|
|
415
|
+
...e.bgColor !== void 0 ? { bgColor: e.bgColor } : {},
|
|
416
|
+
...e.textColor !== void 0 ? { textColor: e.textColor } : {}
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
function gt(t, e, n) {
|
|
420
|
+
const o = Yt(e, n, t.label), r = X(e) ? o ? void 0 : Ce(e, n) ?? t.label.text : void 0;
|
|
421
|
+
return {
|
|
422
|
+
style: {
|
|
423
|
+
...t.style,
|
|
424
|
+
fill: e.bgColor ?? void 0
|
|
425
|
+
},
|
|
426
|
+
label: {
|
|
427
|
+
...t.label,
|
|
428
|
+
text: r,
|
|
429
|
+
imageKey: o,
|
|
430
|
+
size: Number.isFinite(e.size) ? e.size : 0,
|
|
431
|
+
rotate: Number.isFinite(e.rotate) ? e.rotate : 0,
|
|
432
|
+
offsetX: Number.isFinite(e.offsetX) ? e.offsetX : 0,
|
|
433
|
+
offsetY: Number.isFinite(e.offsetY) ? e.offsetY : 0,
|
|
434
|
+
color: e.textColor ?? void 0,
|
|
435
|
+
...e.align ? { align: e.align } : {}
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
function to(t) {
|
|
440
|
+
return t === "PORTAL" ? "editor" : "viewer";
|
|
441
|
+
}
|
|
442
|
+
const rt = {
|
|
443
|
+
search: !1,
|
|
444
|
+
amenities: !1,
|
|
44
445
|
floors: !0,
|
|
45
446
|
zoomReset: !0,
|
|
46
447
|
kioskOrigin: !1,
|
|
47
448
|
fetchDraft: !1
|
|
48
|
-
},
|
|
49
|
-
WEBSITE
|
|
449
|
+
}, Le = {
|
|
450
|
+
/** v1 WP_SITE / MapBox HOST WEBSITE. */
|
|
451
|
+
WEBSITE: rt,
|
|
50
452
|
/** Assign mode: click shapes, no public directory chrome. */
|
|
51
|
-
PORTAL_ASSIGN:
|
|
52
|
-
search: !1,
|
|
53
|
-
amenities: !1,
|
|
54
|
-
floors: !0,
|
|
55
|
-
zoomReset: !0,
|
|
56
|
-
kioskOrigin: !1,
|
|
57
|
-
fetchDraft: !1
|
|
58
|
-
},
|
|
453
|
+
PORTAL_ASSIGN: rt,
|
|
59
454
|
DISPLAY_APP: {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
floors: !0,
|
|
63
|
-
zoomReset: !0,
|
|
64
|
-
kioskOrigin: !0,
|
|
65
|
-
fetchDraft: !1
|
|
455
|
+
...rt,
|
|
456
|
+
kioskOrigin: !0
|
|
66
457
|
}
|
|
67
458
|
};
|
|
68
|
-
function
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
function gt(e) {
|
|
72
|
-
return e !== "PORTAL";
|
|
459
|
+
function eo(t) {
|
|
460
|
+
return Le[t];
|
|
73
461
|
}
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
fill: "#C4DDAB",
|
|
77
|
-
renderOrder: 2,
|
|
78
|
-
extrudeHeight: 1
|
|
79
|
-
},
|
|
80
|
-
"water-area": {
|
|
81
|
-
fill: "#5cc0f9",
|
|
82
|
-
renderOrder: 2,
|
|
83
|
-
extrudeHeight: 1
|
|
84
|
-
},
|
|
85
|
-
"parking-lane": {
|
|
86
|
-
fill: "#F6F6F6",
|
|
87
|
-
renderOrder: 2,
|
|
88
|
-
extrudeHeight: 1
|
|
89
|
-
},
|
|
90
|
-
"parking-line": {
|
|
91
|
-
stroke: "#DDDDDD",
|
|
92
|
-
strokeWidth: 0.6,
|
|
93
|
-
renderOrder: 6,
|
|
94
|
-
extrudeHeight: 0.5
|
|
95
|
-
},
|
|
96
|
-
"parking-icon": {
|
|
97
|
-
fill: "#CCCCCC",
|
|
98
|
-
renderOrder: 7,
|
|
99
|
-
extrudeHeight: 1
|
|
100
|
-
},
|
|
101
|
-
/** v1 kept SVG fill; house default for maps that omit a fill. */
|
|
102
|
-
"walking-path": {
|
|
103
|
-
fill: "#F1EFEA",
|
|
104
|
-
renderOrder: 2,
|
|
105
|
-
extrudeHeight: 1
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
function ee(e) {
|
|
109
|
-
return e.toLowerCase().replace(/[-_]+/g, " ").replace(/\s+/g, " ").trim();
|
|
462
|
+
function no(t) {
|
|
463
|
+
return t !== "PORTAL";
|
|
110
464
|
}
|
|
111
|
-
function
|
|
112
|
-
|
|
113
|
-
const t = ee(e);
|
|
114
|
-
if (!t) return null;
|
|
115
|
-
const n = Object.keys(F).sort((s, i) => i.length - s.length);
|
|
116
|
-
for (const s of n) {
|
|
117
|
-
const i = ee(s);
|
|
118
|
-
if (t === i || t.startsWith(`${i} `) || t === `${i}s` || t.startsWith(`${i}s `)) return F[s];
|
|
119
|
-
}
|
|
120
|
-
return null;
|
|
465
|
+
function oo(t, e) {
|
|
466
|
+
return e ? e + encodeURIComponent(t) : t;
|
|
121
467
|
}
|
|
122
|
-
function
|
|
123
|
-
return
|
|
468
|
+
function ro(t, e) {
|
|
469
|
+
return t.map((n) => ({ x: n.x, y: e - n.y }));
|
|
124
470
|
}
|
|
125
|
-
function
|
|
126
|
-
const n =
|
|
127
|
-
return Math.hypot(n,
|
|
471
|
+
function w(t, e) {
|
|
472
|
+
const n = t.x - e.x, o = t.y - e.y;
|
|
473
|
+
return Math.hypot(n, o);
|
|
128
474
|
}
|
|
129
|
-
function
|
|
130
|
-
if (
|
|
475
|
+
function Oe(t) {
|
|
476
|
+
if (t.length === 0)
|
|
131
477
|
return { minX: 0, minY: 0, maxX: 0, maxY: 0 };
|
|
132
|
-
let
|
|
133
|
-
for (let
|
|
134
|
-
const
|
|
135
|
-
|
|
478
|
+
let e = t[0].x, n = t[0].y, o = t[0].x, r = t[0].y;
|
|
479
|
+
for (let s = 1; s < t.length; s++) {
|
|
480
|
+
const u = t[s];
|
|
481
|
+
u.x < e && (e = u.x), u.y < n && (n = u.y), u.x > o && (o = u.x), u.y > r && (r = u.y);
|
|
136
482
|
}
|
|
137
|
-
return { minX:
|
|
483
|
+
return { minX: e, minY: n, maxX: o, maxY: r };
|
|
138
484
|
}
|
|
139
|
-
function
|
|
485
|
+
function io(t, e) {
|
|
140
486
|
return {
|
|
141
|
-
minX: Math.min(
|
|
142
|
-
minY: Math.min(
|
|
143
|
-
maxX: Math.max(
|
|
144
|
-
maxY: Math.max(
|
|
487
|
+
minX: Math.min(t.minX, e.minX),
|
|
488
|
+
minY: Math.min(t.minY, e.minY),
|
|
489
|
+
maxX: Math.max(t.maxX, e.maxX),
|
|
490
|
+
maxY: Math.max(t.maxY, e.maxY)
|
|
145
491
|
};
|
|
146
492
|
}
|
|
147
|
-
function
|
|
148
|
-
if (
|
|
149
|
-
let
|
|
150
|
-
for (const
|
|
151
|
-
|
|
152
|
-
return { x:
|
|
493
|
+
function Me(t) {
|
|
494
|
+
if (t.length === 0) return { x: 0, y: 0 };
|
|
495
|
+
let e = 0, n = 0;
|
|
496
|
+
for (const o of t)
|
|
497
|
+
e += o.x, n += o.y;
|
|
498
|
+
return { x: e / t.length, y: n / t.length };
|
|
153
499
|
}
|
|
154
|
-
function
|
|
500
|
+
function Ee(t, e) {
|
|
155
501
|
let n = !1;
|
|
156
|
-
for (let
|
|
157
|
-
const
|
|
158
|
-
|
|
502
|
+
for (let o = 0, r = e.length - 1; o < e.length; r = o++) {
|
|
503
|
+
const s = e[o].x, u = e[o].y, a = e[r].x, i = e[r].y;
|
|
504
|
+
u > t.y != i > t.y && t.x < (a - s) * (t.y - u) / (i - u + Number.EPSILON) + s && (n = !n);
|
|
159
505
|
}
|
|
160
506
|
return n;
|
|
161
507
|
}
|
|
162
|
-
function
|
|
163
|
-
return
|
|
508
|
+
function so(t, e) {
|
|
509
|
+
return e.some((n) => Ee(t, n));
|
|
164
510
|
}
|
|
165
|
-
function
|
|
166
|
-
const
|
|
167
|
-
if (
|
|
168
|
-
return { point: { ...
|
|
169
|
-
let
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
return { point:
|
|
511
|
+
function Re(t, e, n) {
|
|
512
|
+
const o = n.x - e.x, r = n.y - e.y, s = o * o + r * r;
|
|
513
|
+
if (s === 0)
|
|
514
|
+
return { point: { ...e }, t: 0, distance: w(t, e) };
|
|
515
|
+
let u = ((t.x - e.x) * o + (t.y - e.y) * r) / s;
|
|
516
|
+
u = Math.max(0, Math.min(1, u));
|
|
517
|
+
const a = { x: e.x + u * o, y: e.y + u * r };
|
|
518
|
+
return { point: a, t: u, distance: w(t, a) };
|
|
173
519
|
}
|
|
174
|
-
function
|
|
175
|
-
if (
|
|
520
|
+
function co(t, e) {
|
|
521
|
+
if (e.length < 2) return null;
|
|
176
522
|
let n = null;
|
|
177
|
-
for (let
|
|
178
|
-
const
|
|
179
|
-
(!n ||
|
|
523
|
+
for (let o = 0; o < e.length - 1; o++) {
|
|
524
|
+
const r = Re(t, e[o], e[o + 1]);
|
|
525
|
+
(!n || r.distance < n.distance) && (n = { point: r.point, segmentIndex: o, distance: r.distance });
|
|
180
526
|
}
|
|
181
527
|
return n;
|
|
182
528
|
}
|
|
183
|
-
function
|
|
529
|
+
function bt(t, e, n, o, r = 8) {
|
|
530
|
+
const s = [];
|
|
531
|
+
for (let u = 0; u <= r; u++) {
|
|
532
|
+
const a = u / r, i = 1 - a;
|
|
533
|
+
s.push({
|
|
534
|
+
x: i * i * i * t.x + 3 * i * i * a * e.x + 3 * i * a * a * n.x + a * a * a * o.x,
|
|
535
|
+
y: i * i * i * t.y + 3 * i * i * a * e.y + 3 * i * a * a * n.y + a * a * a * o.y
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
return s;
|
|
539
|
+
}
|
|
540
|
+
function kt(t, e, n, o = 6) {
|
|
184
541
|
const r = [];
|
|
185
|
-
for (let
|
|
186
|
-
const
|
|
542
|
+
for (let s = 0; s <= o; s++) {
|
|
543
|
+
const u = s / o, a = 1 - u;
|
|
187
544
|
r.push({
|
|
188
|
-
x:
|
|
189
|
-
y:
|
|
545
|
+
x: a * a * t.x + 2 * a * u * e.x + u * u * n.x,
|
|
546
|
+
y: a * a * t.y + 2 * a * u * e.y + u * u * n.y
|
|
190
547
|
});
|
|
191
548
|
}
|
|
192
549
|
return r;
|
|
193
550
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
return i;
|
|
204
|
-
}
|
|
205
|
-
const Oe = 8;
|
|
206
|
-
function Ne(e, t, n, s, i, r, l) {
|
|
207
|
-
if (e.x === l.x && e.y === l.y) return [{ ...e }];
|
|
208
|
-
let c = Math.abs(t), o = Math.abs(n);
|
|
209
|
-
if (c === 0 || o === 0 || !Number.isFinite(c) || !Number.isFinite(o))
|
|
210
|
-
return [{ ...e }, { ...l }];
|
|
211
|
-
const m = s % 360 * Math.PI / 180, p = Math.cos(m), a = Math.sin(m), k = (e.x - l.x) / 2, u = (e.y - l.y) / 2, d = p * k + a * u, f = -a * k + p * u, h = d * d / (c * c) + f * f / (o * o);
|
|
551
|
+
const ve = 8;
|
|
552
|
+
function Ne(t, e, n, o, r, s, u) {
|
|
553
|
+
if (t.x === u.x && t.y === u.y) return [{ ...t }];
|
|
554
|
+
let a = Math.abs(e), i = Math.abs(n);
|
|
555
|
+
if (a === 0 || i === 0 || !Number.isFinite(a) || !Number.isFinite(i))
|
|
556
|
+
return [{ ...t }, { ...u }];
|
|
557
|
+
const y = o % 360 * Math.PI / 180, p = Math.cos(y), l = Math.sin(y), k = (t.x - u.x) / 2, c = (t.y - u.y) / 2, d = p * k + l * c, f = -l * k + p * c, h = d * d / (a * a) + f * f / (i * i);
|
|
212
558
|
if (h > 1) {
|
|
213
|
-
const
|
|
214
|
-
|
|
559
|
+
const N = Math.sqrt(h);
|
|
560
|
+
a *= N, i *= N;
|
|
215
561
|
}
|
|
216
|
-
const
|
|
217
|
-
let
|
|
218
|
-
!
|
|
219
|
-
const
|
|
220
|
-
for (let
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
x:
|
|
224
|
-
y:
|
|
562
|
+
const m = a * a, b = i * i, x = m * b - m * f * f - b * d * d, g = m * f * f + b * d * d, I = Math.sqrt(Math.max(0, x / g)) * (r === s ? -1 : 1), C = I * a * f / i, _ = -I * i * d / a, A = p * C - l * _ + (t.x + u.x) / 2, M = l * C + p * _ + (t.y + u.y) / 2, L = (d - C) / a, P = (f - _) / i, R = (-d - C) / a, F = (-f - _) / i, G = Math.atan2(P, L);
|
|
563
|
+
let S = Math.atan2(L * F - P * R, L * R + P * F);
|
|
564
|
+
!s && S > 0 ? S -= 2 * Math.PI : s && S < 0 && (S += 2 * Math.PI);
|
|
565
|
+
const O = Math.abs(S) / (Math.PI / 2) * ve, Y = Math.max(1, Math.round(O)), v = [{ ...t }];
|
|
566
|
+
for (let N = 1; N <= Y; N++) {
|
|
567
|
+
const $ = G + S * N / Y, V = Math.cos($), Z = Math.sin($);
|
|
568
|
+
v.push({
|
|
569
|
+
x: A + a * p * V - i * l * Z,
|
|
570
|
+
y: M + a * l * V + i * p * Z
|
|
225
571
|
});
|
|
226
572
|
}
|
|
227
|
-
return
|
|
228
|
-
}
|
|
229
|
-
const
|
|
230
|
-
function
|
|
231
|
-
const
|
|
232
|
-
let n = 0,
|
|
233
|
-
for (; n <
|
|
234
|
-
const
|
|
235
|
-
if (
|
|
573
|
+
return v[v.length - 1] = { ...u }, v;
|
|
574
|
+
}
|
|
575
|
+
const Te = /[\s,]/;
|
|
576
|
+
function Dt(t) {
|
|
577
|
+
const e = [];
|
|
578
|
+
let n = 0, o = "", r = 0;
|
|
579
|
+
for (; n < t.length; ) {
|
|
580
|
+
const s = t[n];
|
|
581
|
+
if (Te.test(s)) {
|
|
236
582
|
n++;
|
|
237
583
|
continue;
|
|
238
584
|
}
|
|
239
|
-
if (
|
|
240
|
-
|
|
585
|
+
if (s >= "a" && s <= "z" || s >= "A" && s <= "Z") {
|
|
586
|
+
o = s, r = 0, e.push(s), n++;
|
|
241
587
|
continue;
|
|
242
588
|
}
|
|
243
|
-
const
|
|
244
|
-
if ((
|
|
245
|
-
|
|
589
|
+
const u = o === "A" || o === "a" ? r % 7 : -1;
|
|
590
|
+
if ((u === 3 || u === 4) && (s === "0" || s === "1")) {
|
|
591
|
+
e.push(s), n++, r++;
|
|
246
592
|
continue;
|
|
247
593
|
}
|
|
248
|
-
const
|
|
249
|
-
let
|
|
250
|
-
for ((
|
|
251
|
-
n++,
|
|
252
|
-
if (
|
|
253
|
-
for (n++; n <
|
|
254
|
-
n++,
|
|
255
|
-
if (
|
|
256
|
-
const
|
|
257
|
-
if (n++, (
|
|
258
|
-
for (; n <
|
|
594
|
+
const a = n;
|
|
595
|
+
let i = 0;
|
|
596
|
+
for ((s === "+" || s === "-") && n++; n < t.length && t[n] >= "0" && t[n] <= "9"; )
|
|
597
|
+
n++, i++;
|
|
598
|
+
if (t[n] === ".")
|
|
599
|
+
for (n++; n < t.length && t[n] >= "0" && t[n] <= "9"; )
|
|
600
|
+
n++, i++;
|
|
601
|
+
if (i > 0 && (t[n] === "e" || t[n] === "E")) {
|
|
602
|
+
const y = n;
|
|
603
|
+
if (n++, (t[n] === "+" || t[n] === "-") && n++, n < t.length && t[n] >= "0" && t[n] <= "9")
|
|
604
|
+
for (; n < t.length && t[n] >= "0" && t[n] <= "9"; ) n++;
|
|
259
605
|
else
|
|
260
|
-
n =
|
|
606
|
+
n = y;
|
|
261
607
|
}
|
|
262
|
-
if (
|
|
263
|
-
n =
|
|
608
|
+
if (i === 0) {
|
|
609
|
+
n = a + 1;
|
|
264
610
|
continue;
|
|
265
611
|
}
|
|
266
|
-
|
|
612
|
+
e.push(t.slice(a, n)), r++;
|
|
267
613
|
}
|
|
268
|
-
return
|
|
269
|
-
}
|
|
270
|
-
function
|
|
271
|
-
const
|
|
272
|
-
let
|
|
273
|
-
const
|
|
274
|
-
for (;
|
|
275
|
-
const k =
|
|
276
|
-
switch (/[a-zA-Z]/.test(k) && (p = k,
|
|
614
|
+
return e;
|
|
615
|
+
}
|
|
616
|
+
function Bt(t) {
|
|
617
|
+
const e = Dt(t), n = [];
|
|
618
|
+
let o = [], r = 0, s = 0, u = 0, a = 0, i = null, y = 0, p = "";
|
|
619
|
+
const l = () => Number(e[y++]);
|
|
620
|
+
for (; y < e.length; ) {
|
|
621
|
+
const k = e[y];
|
|
622
|
+
switch (/[a-zA-Z]/.test(k) && (p = k, y++), p) {
|
|
277
623
|
case "M":
|
|
278
624
|
case "m": {
|
|
279
|
-
const
|
|
280
|
-
|
|
625
|
+
const c = p === "m", d = l(), f = l();
|
|
626
|
+
r = c ? r + d : d, s = c ? s + f : f, o.length > 0 && n.push(o), o = [{ x: r, y: s }], u = r, a = s, i = null, p = c ? "l" : "L";
|
|
281
627
|
break;
|
|
282
628
|
}
|
|
283
629
|
case "L":
|
|
284
630
|
case "l": {
|
|
285
|
-
const
|
|
286
|
-
|
|
631
|
+
const c = p === "l", d = l(), f = l();
|
|
632
|
+
r = c ? r + d : d, s = c ? s + f : f, o.push({ x: r, y: s }), i = null;
|
|
287
633
|
break;
|
|
288
634
|
}
|
|
289
635
|
case "H":
|
|
290
636
|
case "h": {
|
|
291
|
-
const
|
|
292
|
-
|
|
637
|
+
const c = p === "h", d = l();
|
|
638
|
+
r = c ? r + d : d, o.push({ x: r, y: s }), i = null;
|
|
293
639
|
break;
|
|
294
640
|
}
|
|
295
641
|
case "V":
|
|
296
642
|
case "v": {
|
|
297
|
-
const
|
|
298
|
-
|
|
643
|
+
const c = p === "v", d = l();
|
|
644
|
+
s = c ? s + d : d, o.push({ x: r, y: s }), i = null;
|
|
299
645
|
break;
|
|
300
646
|
}
|
|
301
647
|
case "C":
|
|
302
648
|
case "c": {
|
|
303
|
-
const
|
|
304
|
-
{ x:
|
|
649
|
+
const c = p === "c", d = c ? r + l() : l(), f = c ? s + l() : l(), h = c ? r + l() : l(), m = c ? s + l() : l(), b = c ? r + l() : l(), x = c ? s + l() : l(), g = bt(
|
|
650
|
+
{ x: r, y: s },
|
|
305
651
|
{ x: d, y: f },
|
|
306
|
-
{ x: h, y:
|
|
307
|
-
{ x, y }
|
|
652
|
+
{ x: h, y: m },
|
|
653
|
+
{ x: b, y: x }
|
|
308
654
|
);
|
|
309
|
-
|
|
655
|
+
o.push(...g.slice(1)), i = { x: h, y: m }, r = b, s = x;
|
|
310
656
|
break;
|
|
311
657
|
}
|
|
312
658
|
case "Q":
|
|
313
659
|
case "q": {
|
|
314
|
-
const
|
|
315
|
-
{ x:
|
|
660
|
+
const c = p === "q", d = c ? r + l() : l(), f = c ? s + l() : l(), h = c ? r + l() : l(), m = c ? s + l() : l(), b = kt(
|
|
661
|
+
{ x: r, y: s },
|
|
316
662
|
{ x: d, y: f },
|
|
317
|
-
{ x: h, y:
|
|
663
|
+
{ x: h, y: m }
|
|
318
664
|
);
|
|
319
|
-
|
|
665
|
+
o.push(...b.slice(1)), i = { x: d, y: f }, r = h, s = m;
|
|
320
666
|
break;
|
|
321
667
|
}
|
|
322
668
|
case "S":
|
|
323
669
|
case "s": {
|
|
324
|
-
const
|
|
325
|
-
{ x:
|
|
670
|
+
const c = p === "s", d = i ? 2 * r - i.x : r, f = i ? 2 * s - i.y : s, h = c ? r + l() : l(), m = c ? s + l() : l(), b = c ? r + l() : l(), x = c ? s + l() : l(), g = bt(
|
|
671
|
+
{ x: r, y: s },
|
|
326
672
|
{ x: d, y: f },
|
|
327
|
-
{ x: h, y:
|
|
328
|
-
{ x, y }
|
|
673
|
+
{ x: h, y: m },
|
|
674
|
+
{ x: b, y: x }
|
|
329
675
|
);
|
|
330
|
-
|
|
676
|
+
o.push(...g.slice(1)), i = { x: h, y: m }, r = b, s = x;
|
|
331
677
|
break;
|
|
332
678
|
}
|
|
333
679
|
case "T":
|
|
334
680
|
case "t": {
|
|
335
|
-
const
|
|
336
|
-
{ x:
|
|
681
|
+
const c = p === "t", d = i ? 2 * r - i.x : r, f = i ? 2 * s - i.y : s, h = c ? r + l() : l(), m = c ? s + l() : l(), b = kt(
|
|
682
|
+
{ x: r, y: s },
|
|
337
683
|
{ x: d, y: f },
|
|
338
|
-
{ x: h, y:
|
|
684
|
+
{ x: h, y: m }
|
|
339
685
|
);
|
|
340
|
-
|
|
686
|
+
o.push(...b.slice(1)), i = { x: d, y: f }, r = h, s = m;
|
|
341
687
|
break;
|
|
342
688
|
}
|
|
343
689
|
case "A":
|
|
344
690
|
case "a": {
|
|
345
|
-
const
|
|
346
|
-
{ x:
|
|
691
|
+
const c = p === "a", d = l(), f = l(), h = l(), m = l() !== 0, b = l() !== 0, x = c ? r + l() : l(), g = c ? s + l() : l(), I = Ne(
|
|
692
|
+
{ x: r, y: s },
|
|
347
693
|
d,
|
|
348
694
|
f,
|
|
349
695
|
h,
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
{ x
|
|
696
|
+
m,
|
|
697
|
+
b,
|
|
698
|
+
{ x, y: g }
|
|
353
699
|
);
|
|
354
|
-
|
|
700
|
+
o.push(...I.slice(1)), i = null, r = x, s = g;
|
|
355
701
|
break;
|
|
356
702
|
}
|
|
357
703
|
case "Z":
|
|
358
704
|
case "z": {
|
|
359
|
-
|
|
705
|
+
o.push({ x: u, y: a }), n.push(o), o = [], r = u, s = a, i = null;
|
|
360
706
|
break;
|
|
361
707
|
}
|
|
362
708
|
default:
|
|
363
|
-
|
|
709
|
+
y++;
|
|
364
710
|
break;
|
|
365
711
|
}
|
|
366
712
|
}
|
|
367
|
-
return
|
|
713
|
+
return o.length > 0 && n.push(o), n;
|
|
368
714
|
}
|
|
369
|
-
function
|
|
370
|
-
const
|
|
715
|
+
function we(t) {
|
|
716
|
+
const e = t.match(
|
|
371
717
|
/^\s*M\s*(-?\d*\.?\d+(?:e[-+]?\d+)?)[\s,]+(-?\d*\.?\d+(?:e[-+]?\d+)?)/i
|
|
372
718
|
);
|
|
373
|
-
if (!
|
|
374
|
-
const n = Number(
|
|
375
|
-
return Number.isFinite(n) && Number.isFinite(
|
|
376
|
-
}
|
|
377
|
-
function
|
|
378
|
-
var
|
|
379
|
-
const
|
|
380
|
-
if (!
|
|
381
|
-
const n =
|
|
382
|
-
return !n || !
|
|
383
|
-
}
|
|
384
|
-
function
|
|
385
|
-
if (!
|
|
386
|
-
const
|
|
387
|
-
return
|
|
388
|
-
}
|
|
389
|
-
function
|
|
390
|
-
const
|
|
391
|
-
d:
|
|
392
|
-
closed: /z/i.test(
|
|
393
|
-
})), n =
|
|
394
|
-
return { paths:
|
|
395
|
-
}
|
|
396
|
-
function
|
|
397
|
-
const
|
|
398
|
-
return
|
|
399
|
-
}
|
|
400
|
-
function
|
|
401
|
-
return
|
|
402
|
-
}
|
|
403
|
-
function
|
|
404
|
-
const
|
|
405
|
-
if (
|
|
406
|
-
const
|
|
407
|
-
let
|
|
408
|
-
for (const k of
|
|
409
|
-
const
|
|
410
|
-
d < p && (p = d,
|
|
719
|
+
if (!e) return null;
|
|
720
|
+
const n = Number(e[1]), o = Number(e[2]);
|
|
721
|
+
return Number.isFinite(n) && Number.isFinite(o) ? { x: n, y: o } : null;
|
|
722
|
+
}
|
|
723
|
+
function Pe(t) {
|
|
724
|
+
var r, s;
|
|
725
|
+
const e = (r = t.paths[0]) == null ? void 0 : r.d;
|
|
726
|
+
if (!e || t.polygons.length === 0) return !1;
|
|
727
|
+
const n = we(e), o = (s = t.polygons[0]) == null ? void 0 : s[0];
|
|
728
|
+
return !n || !o ? !1 : Math.abs(n.x - o.x) > 0.01 || Math.abs(n.y - o.y) > 0.01;
|
|
729
|
+
}
|
|
730
|
+
function Xt(t) {
|
|
731
|
+
if (!Pe(t)) return t;
|
|
732
|
+
const e = t.paths.flatMap((n) => Bt(n.d));
|
|
733
|
+
return e.length === 0 ? t : { paths: t.paths, polygons: e };
|
|
734
|
+
}
|
|
735
|
+
function Fe(t) {
|
|
736
|
+
const e = t.map((o) => ({
|
|
737
|
+
d: o,
|
|
738
|
+
closed: /z/i.test(o)
|
|
739
|
+
})), n = t.flatMap((o) => Bt(o));
|
|
740
|
+
return { paths: e, polygons: n };
|
|
741
|
+
}
|
|
742
|
+
function xt(t) {
|
|
743
|
+
const e = t.polygons.flat();
|
|
744
|
+
return Oe(e);
|
|
745
|
+
}
|
|
746
|
+
function Ye(t) {
|
|
747
|
+
return Me(t.polygons.flat());
|
|
748
|
+
}
|
|
749
|
+
function ao(t, e, n = 0, o = [15, 45, 90]) {
|
|
750
|
+
const r = e.x - t.x, s = e.y - t.y, u = Math.hypot(r, s);
|
|
751
|
+
if (u === 0) return { ...e };
|
|
752
|
+
const i = Math.atan2(s, r) * 180 / Math.PI - n;
|
|
753
|
+
let y = i, p = 1 / 0;
|
|
754
|
+
for (const k of o) {
|
|
755
|
+
const c = Math.round(i / k) * k, d = Math.abs(i - c);
|
|
756
|
+
d < p && (p = d, y = c);
|
|
411
757
|
}
|
|
412
|
-
const
|
|
758
|
+
const l = (y + n) * Math.PI / 180;
|
|
413
759
|
return {
|
|
414
|
-
x:
|
|
415
|
-
y:
|
|
760
|
+
x: t.x + Math.cos(l) * u,
|
|
761
|
+
y: t.y + Math.sin(l) * u
|
|
416
762
|
};
|
|
417
763
|
}
|
|
418
|
-
function
|
|
419
|
-
return Math.atan2(
|
|
764
|
+
function lo(t, e) {
|
|
765
|
+
return Math.atan2(e.y - t.y, e.x - t.x) * 180 / Math.PI;
|
|
420
766
|
}
|
|
421
|
-
function De(
|
|
422
|
-
if (!
|
|
423
|
-
const
|
|
424
|
-
return
|
|
767
|
+
function De(t) {
|
|
768
|
+
if (!t) return null;
|
|
769
|
+
const e = t.trim().split(/[\s,]+/).map(Number);
|
|
770
|
+
return e.length !== 4 || e.some((n) => Number.isNaN(n)) ? null : { x: e[0], y: e[1], width: e[2], height: e[3] };
|
|
425
771
|
}
|
|
426
|
-
const
|
|
772
|
+
const Be = {
|
|
427
773
|
fill: "fill",
|
|
428
774
|
"fill-opacity": "fill-opacity",
|
|
429
775
|
stroke: "stroke",
|
|
@@ -431,239 +777,239 @@ const Fe = {
|
|
|
431
777
|
"stroke-opacity": "stroke-opacity",
|
|
432
778
|
opacity: "opacity"
|
|
433
779
|
};
|
|
434
|
-
function
|
|
435
|
-
const
|
|
436
|
-
for (const n of
|
|
437
|
-
const
|
|
438
|
-
if (
|
|
439
|
-
const
|
|
440
|
-
|
|
780
|
+
function Xe(t) {
|
|
781
|
+
const e = {};
|
|
782
|
+
for (const n of t.split(";")) {
|
|
783
|
+
const o = n.indexOf(":");
|
|
784
|
+
if (o === -1) continue;
|
|
785
|
+
const r = n.slice(0, o).trim().toLowerCase(), s = n.slice(o + 1).trim();
|
|
786
|
+
r && s && (e[r] = s);
|
|
441
787
|
}
|
|
442
|
-
return
|
|
443
|
-
}
|
|
444
|
-
function
|
|
445
|
-
const
|
|
446
|
-
for (const
|
|
447
|
-
const
|
|
448
|
-
for (const
|
|
449
|
-
const
|
|
450
|
-
if (!
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
...
|
|
454
|
-
...
|
|
788
|
+
return e;
|
|
789
|
+
}
|
|
790
|
+
function Ge(t) {
|
|
791
|
+
const e = /* @__PURE__ */ new Map(), n = t.replace(/\/\*[\s\S]*?\*\//g, "");
|
|
792
|
+
for (const o of n.matchAll(/([^{]+)\{([^}]*)\}/g)) {
|
|
793
|
+
const r = o[1].split(",").map((u) => u.trim()), s = Xe(o[2]);
|
|
794
|
+
for (const u of r) {
|
|
795
|
+
const a = u.match(/^\.([a-zA-Z0-9_-]+)$/);
|
|
796
|
+
if (!a) continue;
|
|
797
|
+
const i = a[1];
|
|
798
|
+
e.set(i, {
|
|
799
|
+
...e.get(i) || {},
|
|
800
|
+
...s
|
|
455
801
|
});
|
|
456
802
|
}
|
|
457
803
|
}
|
|
458
|
-
return
|
|
804
|
+
return e;
|
|
459
805
|
}
|
|
460
|
-
function
|
|
806
|
+
function Ke(t, e) {
|
|
461
807
|
const n = {};
|
|
462
|
-
for (const
|
|
463
|
-
Object.assign(n,
|
|
808
|
+
for (const o of t.split(/\s+/).map((r) => r.trim()).filter(Boolean))
|
|
809
|
+
Object.assign(n, e.get(o) || {});
|
|
464
810
|
return n;
|
|
465
811
|
}
|
|
466
|
-
function
|
|
467
|
-
const
|
|
468
|
-
for (const
|
|
469
|
-
|
|
470
|
-
if (
|
|
471
|
-
const
|
|
472
|
-
for (const
|
|
473
|
-
for (const [
|
|
474
|
-
|
|
475
|
-
return
|
|
812
|
+
function $e(t) {
|
|
813
|
+
const e = [], n = t.replace(/<!--[\s\S]*?-->/g, "");
|
|
814
|
+
for (const r of n.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi))
|
|
815
|
+
e.push(r[1]);
|
|
816
|
+
if (e.length === 0) return t;
|
|
817
|
+
const o = /* @__PURE__ */ new Map();
|
|
818
|
+
for (const r of e)
|
|
819
|
+
for (const [s, u] of Ge(r))
|
|
820
|
+
o.set(s, { ...o.get(s) || {}, ...u });
|
|
821
|
+
return o.size === 0 ? t : t.replace(
|
|
476
822
|
/<(path|polygon|polyline|line|rect|g|circle|ellipse)\b([^>]*)>/gi,
|
|
477
|
-
(
|
|
478
|
-
const
|
|
479
|
-
if (!
|
|
480
|
-
const p =
|
|
481
|
-
let
|
|
482
|
-
for (const [k,
|
|
483
|
-
const d =
|
|
484
|
-
d && (new RegExp(`\\b${d}\\s*=`, "i").test(
|
|
823
|
+
(r, s, u) => {
|
|
824
|
+
const a = /\/\s*$/.test(u), i = u.replace(/\/\s*$/, ""), y = i.match(/\bclass\s*=\s*["']([^"']*)["']/i);
|
|
825
|
+
if (!y) return r;
|
|
826
|
+
const p = Ke(y[1], o);
|
|
827
|
+
let l = i;
|
|
828
|
+
for (const [k, c] of Object.entries(p)) {
|
|
829
|
+
const d = Be[k];
|
|
830
|
+
d && (new RegExp(`\\b${d}\\s*=`, "i").test(l) || (l += ` ${d}="${c}"`));
|
|
485
831
|
}
|
|
486
|
-
return `<${
|
|
832
|
+
return `<${s}${l}${a ? " /" : ""}>`;
|
|
487
833
|
}
|
|
488
834
|
);
|
|
489
835
|
}
|
|
490
|
-
function
|
|
491
|
-
var
|
|
492
|
-
const
|
|
493
|
-
return n && n.toLowerCase() !== "none" && (
|
|
836
|
+
function It(t) {
|
|
837
|
+
var a, i, y, p, l;
|
|
838
|
+
const e = {}, n = (a = t.match(/\bfill\s*=\s*["']([^"']*)["']/i)) == null ? void 0 : a[1], o = (i = t.match(/\bstroke\s*=\s*["']([^"']*)["']/i)) == null ? void 0 : i[1], r = (y = t.match(/\bstroke-width\s*=\s*["']?(-?[\d.]+)/i)) == null ? void 0 : y[1], s = (p = t.match(/\bopacity\s*=\s*["']?(-?[\d.]+)/i)) == null ? void 0 : p[1], u = (l = t.match(/\bfill-opacity\s*=\s*["']?(-?[\d.]+)/i)) == null ? void 0 : l[1];
|
|
839
|
+
return n && n.toLowerCase() !== "none" && (e.fill = n), o && o.toLowerCase() !== "none" && (e.stroke = o), r != null && !Number.isNaN(Number(r)) && (e.strokeWidth = Number(r)), s != null && !Number.isNaN(Number(s)) ? e.opacity = Number(s) : u != null && !Number.isNaN(Number(u)) && (e.opacity = Number(u)), e;
|
|
494
840
|
}
|
|
495
|
-
function
|
|
841
|
+
function it(t, e) {
|
|
496
842
|
return {
|
|
497
|
-
fill:
|
|
498
|
-
stroke:
|
|
499
|
-
strokeWidth:
|
|
500
|
-
opacity:
|
|
843
|
+
fill: e.fill ?? t.fill,
|
|
844
|
+
stroke: e.stroke ?? t.stroke,
|
|
845
|
+
strokeWidth: e.strokeWidth ?? t.strokeWidth,
|
|
846
|
+
opacity: e.opacity ?? t.opacity
|
|
501
847
|
};
|
|
502
848
|
}
|
|
503
|
-
const
|
|
504
|
-
function
|
|
849
|
+
const ft = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 };
|
|
850
|
+
function H(t, e) {
|
|
505
851
|
return {
|
|
506
|
-
a:
|
|
507
|
-
b:
|
|
508
|
-
c:
|
|
509
|
-
d:
|
|
510
|
-
e:
|
|
511
|
-
f:
|
|
852
|
+
a: t.a * e.a + t.c * e.b,
|
|
853
|
+
b: t.b * e.a + t.d * e.b,
|
|
854
|
+
c: t.a * e.c + t.c * e.d,
|
|
855
|
+
d: t.b * e.c + t.d * e.d,
|
|
856
|
+
e: t.a * e.e + t.c * e.f + t.e,
|
|
857
|
+
f: t.b * e.e + t.d * e.f + t.f
|
|
512
858
|
};
|
|
513
859
|
}
|
|
514
|
-
function ze(
|
|
860
|
+
function ze(t, e) {
|
|
515
861
|
return {
|
|
516
|
-
x:
|
|
517
|
-
y:
|
|
862
|
+
x: t.a * e.x + t.c * e.y + t.e,
|
|
863
|
+
y: t.b * e.x + t.d * e.y + t.f
|
|
518
864
|
};
|
|
519
865
|
}
|
|
520
|
-
function We(
|
|
521
|
-
return Math.abs(
|
|
866
|
+
function We(t, e = 1e-9) {
|
|
867
|
+
return Math.abs(t.a - 1) < e && Math.abs(t.b) < e && Math.abs(t.c) < e && Math.abs(t.d - 1) < e && Math.abs(t.e) < e && Math.abs(t.f) < e;
|
|
522
868
|
}
|
|
523
|
-
function
|
|
524
|
-
return { a: 1, b: 0, c: 0, d: 1, e, f:
|
|
869
|
+
function st(t, e) {
|
|
870
|
+
return { a: 1, b: 0, c: 0, d: 1, e: t, f: e };
|
|
525
871
|
}
|
|
526
|
-
function
|
|
527
|
-
const
|
|
528
|
-
return { a: n, b:
|
|
872
|
+
function Ue(t) {
|
|
873
|
+
const e = t * Math.PI / 180, n = Math.cos(e), o = Math.sin(e);
|
|
874
|
+
return { a: n, b: o, c: -o, d: n, e: 0, f: 0 };
|
|
529
875
|
}
|
|
530
|
-
function He(
|
|
531
|
-
switch (
|
|
876
|
+
function He(t, e) {
|
|
877
|
+
switch (t) {
|
|
532
878
|
case "matrix":
|
|
533
|
-
return
|
|
879
|
+
return e.length < 6 ? null : { a: e[0], b: e[1], c: e[2], d: e[3], e: e[4], f: e[5] };
|
|
534
880
|
case "translate":
|
|
535
|
-
return
|
|
881
|
+
return e.length < 1 ? null : st(e[0], e[1] ?? 0);
|
|
536
882
|
case "scale": {
|
|
537
|
-
if (
|
|
538
|
-
const n =
|
|
539
|
-
return { a: n, b: 0, c: 0, d:
|
|
883
|
+
if (e.length < 1) return null;
|
|
884
|
+
const n = e[0], o = e[1] ?? n;
|
|
885
|
+
return { a: n, b: 0, c: 0, d: o, e: 0, f: 0 };
|
|
540
886
|
}
|
|
541
887
|
case "rotate": {
|
|
542
|
-
if (
|
|
543
|
-
const n =
|
|
544
|
-
if (
|
|
545
|
-
const
|
|
546
|
-
return
|
|
547
|
-
|
|
548
|
-
|
|
888
|
+
if (e.length < 1) return null;
|
|
889
|
+
const n = Ue(e[0]);
|
|
890
|
+
if (e.length < 3) return n;
|
|
891
|
+
const o = e[1], r = e[2];
|
|
892
|
+
return H(
|
|
893
|
+
H(st(o, r), n),
|
|
894
|
+
st(-o, -r)
|
|
549
895
|
);
|
|
550
896
|
}
|
|
551
897
|
case "skewx":
|
|
552
|
-
return
|
|
898
|
+
return e.length < 1 ? null : { a: 1, b: 0, c: Math.tan(e[0] * Math.PI / 180), d: 1, e: 0, f: 0 };
|
|
553
899
|
case "skewy":
|
|
554
|
-
return
|
|
900
|
+
return e.length < 1 ? null : { a: 1, b: Math.tan(e[0] * Math.PI / 180), c: 0, d: 1, e: 0, f: 0 };
|
|
555
901
|
default:
|
|
556
902
|
return null;
|
|
557
903
|
}
|
|
558
904
|
}
|
|
559
|
-
const
|
|
560
|
-
function
|
|
561
|
-
if (!
|
|
562
|
-
let
|
|
563
|
-
|
|
905
|
+
const _t = /([a-zA-Z]+)\s*\(([^)]*)\)/g;
|
|
906
|
+
function Ct(t) {
|
|
907
|
+
if (!t) return ft;
|
|
908
|
+
let e = ft;
|
|
909
|
+
_t.lastIndex = 0;
|
|
564
910
|
let n;
|
|
565
|
-
for (; (n =
|
|
566
|
-
const
|
|
567
|
-
if (
|
|
568
|
-
const
|
|
569
|
-
|
|
911
|
+
for (; (n = _t.exec(t)) !== null; ) {
|
|
912
|
+
const o = n[1].toLowerCase(), r = n[2].trim().split(/[\s,]+/).filter(Boolean).map(Number);
|
|
913
|
+
if (r.some((u) => Number.isNaN(u))) continue;
|
|
914
|
+
const s = He(o, r);
|
|
915
|
+
s && (e = H(e, s));
|
|
570
916
|
}
|
|
571
|
-
return
|
|
572
|
-
}
|
|
573
|
-
function
|
|
574
|
-
if (!Number.isFinite(
|
|
575
|
-
const
|
|
576
|
-
return Object.is(
|
|
577
|
-
}
|
|
578
|
-
function
|
|
579
|
-
const
|
|
580
|
-
return { rx: I, ry:
|
|
581
|
-
}
|
|
582
|
-
function
|
|
583
|
-
if (!
|
|
584
|
-
const n =
|
|
585
|
-
let
|
|
586
|
-
const
|
|
587
|
-
const d = Number(n[
|
|
917
|
+
return e;
|
|
918
|
+
}
|
|
919
|
+
function K(t) {
|
|
920
|
+
if (!Number.isFinite(t)) return "0";
|
|
921
|
+
const e = Math.round(t * 1e4) / 1e4;
|
|
922
|
+
return Object.is(e, -0) ? "0" : String(e);
|
|
923
|
+
}
|
|
924
|
+
function Ve(t, e, n, o) {
|
|
925
|
+
const r = o * Math.PI / 180, s = Math.cos(r), u = Math.sin(r), a = s * e, i = u * e, y = -u * n, p = s * n, l = t.a * a + t.c * i, k = t.b * a + t.d * i, c = t.a * y + t.c * p, d = t.b * y + t.d * p, f = (l + d) / 2, h = (l - d) / 2, m = (k + c) / 2, b = (k - c) / 2, x = Math.hypot(f, b), g = Math.hypot(h, m), I = Math.abs(x + g), C = Math.abs(x - g), _ = Math.atan2(m, h), M = (Math.atan2(b, f) + _) / 2 * (180 / Math.PI);
|
|
926
|
+
return { rx: I, ry: C, phiDeg: M };
|
|
927
|
+
}
|
|
928
|
+
function Ze(t, e) {
|
|
929
|
+
if (!t || We(e)) return t;
|
|
930
|
+
const n = Dt(t), o = [], r = e.a * e.d - e.b * e.c < 0;
|
|
931
|
+
let s = 0, u = "", a = 0, i = 0, y = 0, p = 0;
|
|
932
|
+
const l = () => {
|
|
933
|
+
const d = Number(n[s++]);
|
|
588
934
|
return Number.isNaN(d) ? 0 : d;
|
|
589
935
|
}, k = (d, ...f) => {
|
|
590
|
-
|
|
591
|
-
},
|
|
592
|
-
const h = ze(
|
|
936
|
+
o.push(d + (f.length ? " " + f.map(K).join(" ") : ""));
|
|
937
|
+
}, c = (d, f) => {
|
|
938
|
+
const h = ze(e, { x: d, y: f });
|
|
593
939
|
return [h.x, h.y];
|
|
594
940
|
};
|
|
595
|
-
for (;
|
|
596
|
-
const d = n[
|
|
597
|
-
switch (/[a-zA-Z]/.test(d) && (
|
|
941
|
+
for (; s < n.length; ) {
|
|
942
|
+
const d = n[s];
|
|
943
|
+
switch (/[a-zA-Z]/.test(d) && (u = d, s++), u) {
|
|
598
944
|
case "M":
|
|
599
945
|
case "m": {
|
|
600
|
-
const f =
|
|
601
|
-
|
|
946
|
+
const f = u === "m", h = l(), m = l();
|
|
947
|
+
a = f ? a + h : h, i = f ? i + m : m, y = a, p = i, k("M", ...c(a, i)), u = f ? "l" : "L";
|
|
602
948
|
break;
|
|
603
949
|
}
|
|
604
950
|
case "L":
|
|
605
951
|
case "l": {
|
|
606
|
-
const f =
|
|
607
|
-
|
|
952
|
+
const f = u === "l", h = l(), m = l();
|
|
953
|
+
a = f ? a + h : h, i = f ? i + m : m, k("L", ...c(a, i));
|
|
608
954
|
break;
|
|
609
955
|
}
|
|
610
956
|
case "H":
|
|
611
957
|
case "h": {
|
|
612
|
-
const f =
|
|
613
|
-
|
|
958
|
+
const f = u === "h", h = l();
|
|
959
|
+
a = f ? a + h : h, k("L", ...c(a, i));
|
|
614
960
|
break;
|
|
615
961
|
}
|
|
616
962
|
case "V":
|
|
617
963
|
case "v": {
|
|
618
|
-
const f =
|
|
619
|
-
|
|
964
|
+
const f = u === "v", h = l();
|
|
965
|
+
i = f ? i + h : h, k("L", ...c(a, i));
|
|
620
966
|
break;
|
|
621
967
|
}
|
|
622
968
|
case "C":
|
|
623
969
|
case "c": {
|
|
624
|
-
const f =
|
|
625
|
-
k("C", ...
|
|
970
|
+
const f = u === "c", h = f ? a + l() : l(), m = f ? i + l() : l(), b = f ? a + l() : l(), x = f ? i + l() : l(), g = f ? a + l() : l(), I = f ? i + l() : l();
|
|
971
|
+
k("C", ...c(h, m), ...c(b, x), ...c(g, I)), a = g, i = I;
|
|
626
972
|
break;
|
|
627
973
|
}
|
|
628
974
|
case "S":
|
|
629
975
|
case "s": {
|
|
630
|
-
const f =
|
|
631
|
-
k("S", ...
|
|
976
|
+
const f = u === "s", h = f ? a + l() : l(), m = f ? i + l() : l(), b = f ? a + l() : l(), x = f ? i + l() : l();
|
|
977
|
+
k("S", ...c(h, m), ...c(b, x)), a = b, i = x;
|
|
632
978
|
break;
|
|
633
979
|
}
|
|
634
980
|
case "Q":
|
|
635
981
|
case "q": {
|
|
636
|
-
const f =
|
|
637
|
-
k("Q", ...
|
|
982
|
+
const f = u === "q", h = f ? a + l() : l(), m = f ? i + l() : l(), b = f ? a + l() : l(), x = f ? i + l() : l();
|
|
983
|
+
k("Q", ...c(h, m), ...c(b, x)), a = b, i = x;
|
|
638
984
|
break;
|
|
639
985
|
}
|
|
640
986
|
case "T":
|
|
641
987
|
case "t": {
|
|
642
|
-
const f =
|
|
643
|
-
k("T", ...
|
|
988
|
+
const f = u === "t", h = f ? a + l() : l(), m = f ? i + l() : l();
|
|
989
|
+
k("T", ...c(h, m)), a = h, i = m;
|
|
644
990
|
break;
|
|
645
991
|
}
|
|
646
992
|
case "A":
|
|
647
993
|
case "a": {
|
|
648
|
-
const f =
|
|
649
|
-
|
|
650
|
-
`A ${
|
|
651
|
-
),
|
|
994
|
+
const f = u === "a", h = l(), m = l(), b = l(), x = l(), g = l(), I = f ? a + l() : l(), C = f ? i + l() : l(), _ = Ve(e, h, m, b), [A, M] = c(I, C);
|
|
995
|
+
o.push(
|
|
996
|
+
`A ${K(_.rx)} ${K(_.ry)} ${K(_.phiDeg)} ${x ? 1 : 0} ${(g ? 1 : 0) ^ (r ? 1 : 0)} ${K(A)} ${K(M)}`
|
|
997
|
+
), a = I, i = C;
|
|
652
998
|
break;
|
|
653
999
|
}
|
|
654
1000
|
case "Z":
|
|
655
1001
|
case "z": {
|
|
656
|
-
|
|
1002
|
+
o.push("Z"), a = y, i = p;
|
|
657
1003
|
break;
|
|
658
1004
|
}
|
|
659
1005
|
default:
|
|
660
|
-
|
|
1006
|
+
s++;
|
|
661
1007
|
break;
|
|
662
1008
|
}
|
|
663
1009
|
}
|
|
664
|
-
return
|
|
1010
|
+
return o.join(" ");
|
|
665
1011
|
}
|
|
666
|
-
const
|
|
1012
|
+
const je = [
|
|
667
1013
|
{ prefix: "walkable", kind: "walkable" },
|
|
668
1014
|
{ prefix: "void", kind: "void" },
|
|
669
1015
|
{ prefix: "unit", kind: "unit" },
|
|
@@ -691,7 +1037,7 @@ const Ue = [
|
|
|
691
1037
|
{ prefix: "parking-icon", kind: "parking_icon" },
|
|
692
1038
|
{ prefix: "walking-path", kind: "walkable" },
|
|
693
1039
|
{ prefix: "water", kind: "water" }
|
|
694
|
-
],
|
|
1040
|
+
], qe = [
|
|
695
1041
|
{ prefix: "parking-zone", kind: "parking_zone" },
|
|
696
1042
|
{ prefix: "parking-lane", kind: "parking_zone" },
|
|
697
1043
|
{ prefix: "parking-line", kind: "decor" },
|
|
@@ -712,610 +1058,887 @@ const Ue = [
|
|
|
712
1058
|
{ prefix: "escalator-", kind: "connector" },
|
|
713
1059
|
{ prefix: "elevator-", kind: "connector" },
|
|
714
1060
|
{ prefix: "stairs-", kind: "connector" }
|
|
715
|
-
]
|
|
716
|
-
|
|
1061
|
+
];
|
|
1062
|
+
function dt(t) {
|
|
1063
|
+
const e = tt(t);
|
|
1064
|
+
return e === "route path" || e.startsWith("route path ");
|
|
1065
|
+
}
|
|
1066
|
+
function Gt(t) {
|
|
1067
|
+
const e = tt(t);
|
|
1068
|
+
return e === "routes" || e === "route" || e === "wayfinding" || e === "wayfinding routes" || dt(t);
|
|
1069
|
+
}
|
|
1070
|
+
const Qe = [
|
|
1071
|
+
...le,
|
|
717
1072
|
"walkable",
|
|
718
1073
|
"void"
|
|
719
|
-
],
|
|
720
|
-
function
|
|
721
|
-
if (
|
|
1074
|
+
], Je = 8;
|
|
1075
|
+
function tn(t, e = "floor") {
|
|
1076
|
+
if (zt(t))
|
|
722
1077
|
return { kind: null, guessed: !1 };
|
|
723
|
-
const n =
|
|
724
|
-
for (const { prefix:
|
|
725
|
-
if (n ===
|
|
726
|
-
return { kind:
|
|
1078
|
+
const n = t.toLowerCase(), o = e === "base" ? qe : je;
|
|
1079
|
+
for (const { prefix: r, kind: s } of o)
|
|
1080
|
+
if (n === r || n.startsWith(r))
|
|
1081
|
+
return { kind: s, guessed: !1 };
|
|
727
1082
|
return n.startsWith("interactive") ? { kind: "unit", guessed: !0 } : { kind: null, guessed: !1 };
|
|
728
1083
|
}
|
|
729
|
-
function
|
|
730
|
-
return
|
|
1084
|
+
function tt(t) {
|
|
1085
|
+
return t.toLowerCase().replace(/[-_]+/g, " ").replace(/\s+/g, " ").trim();
|
|
731
1086
|
}
|
|
732
|
-
function
|
|
733
|
-
return /non[-_ ]?interactive/i.test(
|
|
1087
|
+
function pt(t) {
|
|
1088
|
+
return /non[-_ ]?interactive/i.test(t);
|
|
734
1089
|
}
|
|
735
|
-
function
|
|
736
|
-
return
|
|
1090
|
+
function Kt(t) {
|
|
1091
|
+
return pt(t) ? !1 : /^interactive( items)?( \d+)?$/.test(tt(t));
|
|
737
1092
|
}
|
|
738
|
-
function
|
|
739
|
-
const
|
|
740
|
-
return
|
|
1093
|
+
function $t(t) {
|
|
1094
|
+
const e = tt(t);
|
|
1095
|
+
return e === "stores" || e === "store layer" || e === "units" || e === "unit layer";
|
|
741
1096
|
}
|
|
742
|
-
function
|
|
743
|
-
return
|
|
1097
|
+
function zt(t) {
|
|
1098
|
+
return Kt(t) || pt(t) || $t(t) || Gt(t);
|
|
744
1099
|
}
|
|
745
|
-
function
|
|
746
|
-
return
|
|
1100
|
+
function ct(t) {
|
|
1101
|
+
return t.interactiveContainer || t.nonInteractiveContainer || t.storeFolder;
|
|
747
1102
|
}
|
|
748
|
-
function
|
|
749
|
-
const n =
|
|
1103
|
+
function T(t, e) {
|
|
1104
|
+
const n = t.match(new RegExp(`\\b${e}\\s*=\\s*["']([^"']*)["']`, "i"));
|
|
750
1105
|
return n ? n[1] : null;
|
|
751
1106
|
}
|
|
752
|
-
function
|
|
753
|
-
const n =
|
|
1107
|
+
function D(t, e) {
|
|
1108
|
+
const n = t.match(new RegExp(`\\b${e}\\s*=\\s*["']?(-?[\\d.]+)`, "i"));
|
|
754
1109
|
return n ? Number(n[1]) : 0;
|
|
755
1110
|
}
|
|
756
|
-
function
|
|
757
|
-
return /\bdata-interactive\s*=\s*["']?(true|1|yes)/i.test(
|
|
1111
|
+
function At(t) {
|
|
1112
|
+
return /\bdata-interactive\s*=\s*["']?(true|1|yes)/i.test(t);
|
|
758
1113
|
}
|
|
759
|
-
function
|
|
760
|
-
return [
|
|
761
|
-
(
|
|
1114
|
+
function en(t) {
|
|
1115
|
+
return [T(t, "id"), T(t, "data-name")].filter(
|
|
1116
|
+
(e) => !!e
|
|
762
1117
|
);
|
|
763
1118
|
}
|
|
764
|
-
function
|
|
765
|
-
return
|
|
1119
|
+
function nn(t) {
|
|
1120
|
+
return t.some(pt) ? { interactiveContainer: !1, nonInteractiveContainer: !0, storeFolder: !1 } : t.some(Kt) ? { interactiveContainer: !0, nonInteractiveContainer: !1, storeFolder: !1 } : t.some($t) ? { interactiveContainer: !1, nonInteractiveContainer: !1, storeFolder: !0 } : { interactiveContainer: !1, nonInteractiveContainer: !1, storeFolder: !1 };
|
|
766
1121
|
}
|
|
767
|
-
function
|
|
768
|
-
const
|
|
769
|
-
if (
|
|
770
|
-
let n = `M ${
|
|
771
|
-
for (let
|
|
772
|
-
n += ` L ${
|
|
1122
|
+
function on(t) {
|
|
1123
|
+
const e = t.trim().split(/[\s,]+/).map(Number);
|
|
1124
|
+
if (e.length < 4) return "";
|
|
1125
|
+
let n = `M ${e[0]} ${e[1]}`;
|
|
1126
|
+
for (let o = 2; o < e.length; o += 2)
|
|
1127
|
+
n += ` L ${e[o]} ${e[o + 1]}`;
|
|
773
1128
|
return n += " Z", n;
|
|
774
1129
|
}
|
|
775
|
-
function
|
|
776
|
-
return `M ${
|
|
1130
|
+
function rn(t, e, n, o) {
|
|
1131
|
+
return `M ${t} ${e} L ${n} ${o}`;
|
|
777
1132
|
}
|
|
778
|
-
function
|
|
779
|
-
if (
|
|
780
|
-
return
|
|
781
|
-
if (
|
|
782
|
-
const n =
|
|
783
|
-
return n ?
|
|
1133
|
+
function sn(t, e) {
|
|
1134
|
+
if (t === "path")
|
|
1135
|
+
return T(e, "d") ?? void 0;
|
|
1136
|
+
if (t === "polygon" || t === "polyline") {
|
|
1137
|
+
const n = T(e, "points");
|
|
1138
|
+
return n ? on(n) : void 0;
|
|
784
1139
|
}
|
|
785
|
-
if (
|
|
786
|
-
return
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
1140
|
+
if (t === "line")
|
|
1141
|
+
return rn(
|
|
1142
|
+
D(e, "x1"),
|
|
1143
|
+
D(e, "y1"),
|
|
1144
|
+
D(e, "x2"),
|
|
1145
|
+
D(e, "y2")
|
|
791
1146
|
);
|
|
792
|
-
if (
|
|
793
|
-
const n =
|
|
794
|
-
return `M ${n} ${
|
|
1147
|
+
if (t === "rect") {
|
|
1148
|
+
const n = D(e, "x"), o = D(e, "y"), r = D(e, "width"), s = D(e, "height");
|
|
1149
|
+
return `M ${n} ${o} L ${n + r} ${o} L ${n + r} ${o + s} L ${n} ${o + s} Z`;
|
|
795
1150
|
}
|
|
796
1151
|
}
|
|
797
|
-
function
|
|
798
|
-
const
|
|
799
|
-
let
|
|
800
|
-
const
|
|
801
|
-
for (let
|
|
802
|
-
const
|
|
803
|
-
if (
|
|
1152
|
+
function cn(t) {
|
|
1153
|
+
const e = $e(t).replace(/<!--[\s\S]*?-->/g, ""), n = e.match(/viewBox\s*=\s*["']([^"']+)["']/i), o = De(n == null ? void 0 : n[1]), r = [], s = [], u = [], a = [];
|
|
1154
|
+
let i = 0;
|
|
1155
|
+
const y = () => a.some((x) => x.routeContainer), p = () => {
|
|
1156
|
+
for (let g = a.length - 1; g >= 0; g--) {
|
|
1157
|
+
const I = a[g].style;
|
|
1158
|
+
if (I.fill || I.stroke || I.strokeWidth != null || I.opacity != null)
|
|
804
1159
|
break;
|
|
805
1160
|
}
|
|
806
1161
|
let x = {};
|
|
807
|
-
for (const
|
|
808
|
-
x =
|
|
1162
|
+
for (const g of a)
|
|
1163
|
+
x = it(x, g.style);
|
|
809
1164
|
return x;
|
|
810
|
-
},
|
|
811
|
-
for (let x =
|
|
812
|
-
if (
|
|
813
|
-
if (
|
|
1165
|
+
}, l = () => {
|
|
1166
|
+
for (let x = a.length - 1; x >= 0; x--) {
|
|
1167
|
+
if (a[x].nonInteractiveContainer) return !1;
|
|
1168
|
+
if (a[x].interactiveContainer || a[x].storeFolder) return !0;
|
|
814
1169
|
}
|
|
815
1170
|
return !1;
|
|
816
|
-
},
|
|
817
|
-
for (let x =
|
|
818
|
-
const
|
|
819
|
-
if (!
|
|
820
|
-
|
|
1171
|
+
}, k = () => a.length > 0 ? a[a.length - 1].matrix : ft, c = () => {
|
|
1172
|
+
for (let x = a.length - 1; x >= 0; x--) {
|
|
1173
|
+
const g = a[x];
|
|
1174
|
+
if (!ct(g) && g.id) {
|
|
1175
|
+
g.hasNamedChild = !0;
|
|
821
1176
|
return;
|
|
822
1177
|
}
|
|
823
1178
|
}
|
|
824
|
-
},
|
|
825
|
-
for (let x =
|
|
826
|
-
const
|
|
827
|
-
if (!
|
|
828
|
-
return
|
|
1179
|
+
}, d = () => {
|
|
1180
|
+
for (let x = a.length - 1; x >= 0; x--) {
|
|
1181
|
+
const g = a[x];
|
|
1182
|
+
if (!ct(g) && g.id)
|
|
1183
|
+
return g;
|
|
829
1184
|
}
|
|
830
1185
|
return null;
|
|
831
|
-
},
|
|
832
|
-
|
|
1186
|
+
}, f = (x) => {
|
|
1187
|
+
if (x.routeContainer) {
|
|
1188
|
+
for (const g of x.collectedPaths) h("path", g);
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1191
|
+
ct(x) || !x.id || x.collectedPaths.length === 0 || (x.hasNamedChild && u.push(
|
|
833
1192
|
`Group ${x.id} mixes named children with ${x.collectedPaths.length} unnamed path(s); the unnamed paths were merged into a single shape "${x.id}" — give them ids if they are separate shapes`
|
|
834
|
-
),
|
|
1193
|
+
), r.push({
|
|
835
1194
|
id: x.id,
|
|
836
1195
|
tag: "g",
|
|
837
1196
|
d: x.collectedPaths.join(" "),
|
|
838
1197
|
interactive: x.inInteractive,
|
|
839
|
-
style:
|
|
1198
|
+
style: it(p(), x.style)
|
|
840
1199
|
}));
|
|
841
|
-
},
|
|
842
|
-
if (
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
}, h = /<(\/?)(path|polygon|polyline|line|rect|g)\b([^>]*)(\/?)>/gi;
|
|
850
|
-
let g;
|
|
851
|
-
for (; (g = h.exec(t)) !== null; ) {
|
|
852
|
-
const x = g[1] === "/", y = g[2].toLowerCase(), b = g[3] ?? "", I = g[4] === "/" || /\/\s*$/.test(b);
|
|
1200
|
+
}, h = (x, g) => {
|
|
1201
|
+
if (!g) return;
|
|
1202
|
+
const I = x === "polyline" || x === "polygon" || x === "path" ? g.replace(/\s*Z\s*$/i, "") : g;
|
|
1203
|
+
s.includes(I) || s.push(I);
|
|
1204
|
+
}, m = /<(\/?)(path|polygon|polyline|line|rect|g)\b([^>]*)(\/?)>/gi;
|
|
1205
|
+
let b;
|
|
1206
|
+
for (; (b = m.exec(e)) !== null; ) {
|
|
1207
|
+
const x = b[1] === "/", g = b[2].toLowerCase(), I = b[3] ?? "", C = b[4] === "/" || /\/\s*$/.test(I);
|
|
853
1208
|
if (x) {
|
|
854
|
-
if (
|
|
855
|
-
const
|
|
856
|
-
|
|
1209
|
+
if (g === "g") {
|
|
1210
|
+
const O = a.pop();
|
|
1211
|
+
O && f(O);
|
|
857
1212
|
}
|
|
858
1213
|
continue;
|
|
859
1214
|
}
|
|
860
|
-
if (
|
|
861
|
-
const
|
|
862
|
-
|
|
863
|
-
const
|
|
864
|
-
id:
|
|
865
|
-
interactiveContainer:
|
|
866
|
-
nonInteractiveContainer:
|
|
867
|
-
storeFolder:
|
|
868
|
-
inInteractive:
|
|
1215
|
+
if (g === "g") {
|
|
1216
|
+
const O = T(I, "id"), Y = en(I), { interactiveContainer: v, nonInteractiveContainer: N, storeFolder: $ } = nn(Y), V = l();
|
|
1217
|
+
O && c();
|
|
1218
|
+
const Z = {
|
|
1219
|
+
id: O,
|
|
1220
|
+
interactiveContainer: v,
|
|
1221
|
+
nonInteractiveContainer: N,
|
|
1222
|
+
storeFolder: $,
|
|
1223
|
+
inInteractive: v || $ || At(I) || V && !N,
|
|
869
1224
|
collectedPaths: [],
|
|
870
|
-
style:
|
|
871
|
-
matrix:
|
|
872
|
-
hasNamedChild: !1
|
|
1225
|
+
style: It(I),
|
|
1226
|
+
matrix: H(k(), Ct(T(I, "transform"))),
|
|
1227
|
+
hasNamedChild: !1,
|
|
1228
|
+
routeContainer: Y.some(Gt) || y()
|
|
873
1229
|
};
|
|
874
|
-
|
|
1230
|
+
C || a.push(Z);
|
|
875
1231
|
continue;
|
|
876
1232
|
}
|
|
877
|
-
const
|
|
878
|
-
if (
|
|
879
|
-
|
|
1233
|
+
const _ = T(I, "id"), A = sn(g, I), M = H(k(), Ct(T(I, "transform"))), L = A && Ze(A, M), P = At(I) || l(), R = it(p(), It(I)), F = T(I, "data-name");
|
|
1234
|
+
if (_ != null && dt(_) || F != null && dt(F) || !_ && y()) {
|
|
1235
|
+
h(g, L);
|
|
880
1236
|
continue;
|
|
881
1237
|
}
|
|
882
|
-
if (
|
|
883
|
-
|
|
1238
|
+
if (_) {
|
|
1239
|
+
c(), L && r.push({ id: _, tag: g, d: L, interactive: P, style: R });
|
|
884
1240
|
continue;
|
|
885
1241
|
}
|
|
886
|
-
if (!
|
|
887
|
-
const
|
|
888
|
-
|
|
889
|
-
id: `interactive-anon-${
|
|
890
|
-
tag:
|
|
891
|
-
d:
|
|
1242
|
+
if (!L) continue;
|
|
1243
|
+
const S = d();
|
|
1244
|
+
S ? (S.collectedPaths.push(L), !S.style.fill && R.fill && (S.style = R)) : P && (i += 1, r.push({
|
|
1245
|
+
id: `interactive-anon-${i}`,
|
|
1246
|
+
tag: g,
|
|
1247
|
+
d: L,
|
|
892
1248
|
interactive: !0,
|
|
893
|
-
style:
|
|
1249
|
+
style: R
|
|
894
1250
|
}));
|
|
895
1251
|
}
|
|
896
|
-
for (;
|
|
897
|
-
|
|
898
|
-
return { viewbox:
|
|
899
|
-
}
|
|
900
|
-
function
|
|
901
|
-
return
|
|
902
|
-
}
|
|
903
|
-
function
|
|
904
|
-
var
|
|
905
|
-
const n =
|
|
906
|
-
return n != null && n.fill ?
|
|
907
|
-
}
|
|
908
|
-
function
|
|
909
|
-
return
|
|
910
|
-
}
|
|
911
|
-
function
|
|
912
|
-
const
|
|
913
|
-
let
|
|
914
|
-
const k = n.previousViewbox != null &&
|
|
915
|
-
k &&
|
|
1252
|
+
for (; a.length > 0; )
|
|
1253
|
+
f(a.pop());
|
|
1254
|
+
return { viewbox: o, elements: r, routePathDs: s, warnings: u };
|
|
1255
|
+
}
|
|
1256
|
+
function an(t) {
|
|
1257
|
+
return t.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 80);
|
|
1258
|
+
}
|
|
1259
|
+
function ln(t, e) {
|
|
1260
|
+
var r, s, u, a;
|
|
1261
|
+
const n = yt(e), o = {};
|
|
1262
|
+
return n != null && n.fill ? o.fill = n.fill : (r = t.style) != null && r.fill && (o.fill = t.style.fill), n != null && n.stroke ? o.stroke = n.stroke : (s = t.style) != null && s.stroke && (o.stroke = t.style.stroke), (n == null ? void 0 : n.strokeWidth) != null ? o.strokeWidth = n.strokeWidth : ((u = t.style) == null ? void 0 : u.strokeWidth) != null && (o.strokeWidth = t.style.strokeWidth), ((a = t.style) == null ? void 0 : a.opacity) != null && (o.opacity = t.style.opacity), (n == null ? void 0 : n.extrudeHeight) != null && (o.extrudeHeight = n.extrudeHeight), o;
|
|
1263
|
+
}
|
|
1264
|
+
function un(t, e) {
|
|
1265
|
+
return t == null && e == null ? !0 : t == null || e == null ? !1 : Math.abs(t.x - e.x) < 0.01 && Math.abs(t.y - e.y) < 0.01 && Math.abs(t.width - e.width) < 0.01 && Math.abs(t.height - e.height) < 0.01;
|
|
1266
|
+
}
|
|
1267
|
+
function uo(t, e = "floor", n = {}) {
|
|
1268
|
+
const o = cn(t), r = [], s = [], u = [], a = [...o.warnings], i = [];
|
|
1269
|
+
let y = 0, p = 0, l = 0;
|
|
1270
|
+
const k = n.previousViewbox != null && o.viewbox != null && !un(n.previousViewbox, o.viewbox);
|
|
1271
|
+
k && a.push(
|
|
916
1272
|
"SVG viewBox differs from the stored artboard — re-upload blocked until the designer restores the original viewBox"
|
|
917
1273
|
);
|
|
918
|
-
for (const
|
|
919
|
-
if (
|
|
920
|
-
let { kind: d, guessed: f } =
|
|
921
|
-
|
|
1274
|
+
for (const c of o.elements) {
|
|
1275
|
+
if (zt(c.id)) continue;
|
|
1276
|
+
let { kind: d, guessed: f } = tn(c.id, e);
|
|
1277
|
+
c.interactive && !d && (d = "unit", f = !0);
|
|
922
1278
|
const h = {
|
|
923
|
-
sourceSvgId:
|
|
1279
|
+
sourceSvgId: c.id,
|
|
924
1280
|
kind: d,
|
|
925
1281
|
guessed: f
|
|
926
1282
|
};
|
|
927
1283
|
if (!d)
|
|
928
|
-
if (
|
|
1284
|
+
if (s.push(c.id), e === "floor")
|
|
929
1285
|
d = "decor", h.kind = "decor", h.message = "No matching prefix; imported as decor (floor mode)";
|
|
930
1286
|
else {
|
|
931
|
-
h.message = "No matching prefix; skipped (outdoor decor stays in SVG)",
|
|
1287
|
+
h.message = "No matching prefix; skipped (outdoor decor stays in SVG)", r.push(h);
|
|
932
1288
|
continue;
|
|
933
1289
|
}
|
|
934
|
-
if (!
|
|
935
|
-
|
|
1290
|
+
if (!c.d) {
|
|
1291
|
+
a.push(`Element ${c.id} has no drawable geometry`);
|
|
936
1292
|
continue;
|
|
937
1293
|
}
|
|
938
|
-
if (
|
|
939
|
-
const
|
|
940
|
-
if (!(!
|
|
941
|
-
|
|
1294
|
+
if (e === "base") {
|
|
1295
|
+
const x = yt(c.id) != null;
|
|
1296
|
+
if (!(!x && (Qe.includes(d) || !!c.interactive))) {
|
|
1297
|
+
r.push({
|
|
942
1298
|
...h,
|
|
943
|
-
message:
|
|
1299
|
+
message: x ? "Static decoration — rendered from outdoor SVG" : "Decoration — not persisted; rendered from outdoor SVG"
|
|
944
1300
|
});
|
|
945
1301
|
continue;
|
|
946
1302
|
}
|
|
947
1303
|
}
|
|
948
|
-
f && (
|
|
949
|
-
const
|
|
950
|
-
|
|
951
|
-
key:
|
|
1304
|
+
f && (u.push(h), h.message = h.message ?? "Guessed kind from interactive/fallback rule"), r.push(h), d === "walkable" && y++, d === "void" && p++, d === "unit" && l++;
|
|
1305
|
+
const m = Fe([c.d]), b = xt(m);
|
|
1306
|
+
i.push({
|
|
1307
|
+
key: an(c.id),
|
|
952
1308
|
kind: d,
|
|
953
|
-
geometry:
|
|
954
|
-
bbox:
|
|
955
|
-
sourceSvgId:
|
|
956
|
-
style:
|
|
1309
|
+
geometry: m,
|
|
1310
|
+
bbox: b,
|
|
1311
|
+
sourceSvgId: c.id,
|
|
1312
|
+
style: ln(c, c.id)
|
|
957
1313
|
});
|
|
958
1314
|
}
|
|
959
|
-
return
|
|
1315
|
+
return e === "floor" && y === 0 && a.push(
|
|
960
1316
|
"No walkable layer found — auto-skeleton will be unavailable for this level"
|
|
961
1317
|
), {
|
|
962
1318
|
report: {
|
|
963
|
-
classified:
|
|
964
|
-
unrecognized:
|
|
965
|
-
guessed:
|
|
966
|
-
walkableCount:
|
|
1319
|
+
classified: r,
|
|
1320
|
+
unrecognized: s,
|
|
1321
|
+
guessed: u,
|
|
1322
|
+
walkableCount: y,
|
|
967
1323
|
voidCount: p,
|
|
968
|
-
unitCount:
|
|
969
|
-
warnings:
|
|
1324
|
+
unitCount: l,
|
|
1325
|
+
warnings: a
|
|
970
1326
|
},
|
|
971
|
-
shapes:
|
|
972
|
-
viewbox:
|
|
973
|
-
routePathDs:
|
|
1327
|
+
shapes: i,
|
|
1328
|
+
viewbox: o.viewbox,
|
|
1329
|
+
routePathDs: o.routePathDs,
|
|
974
1330
|
viewBoxChanged: k
|
|
975
1331
|
};
|
|
976
1332
|
}
|
|
977
|
-
function
|
|
978
|
-
const
|
|
979
|
-
|
|
980
|
-
),
|
|
981
|
-
for (const
|
|
982
|
-
const
|
|
983
|
-
if (
|
|
984
|
-
|
|
985
|
-
sourceSvgId:
|
|
1333
|
+
function fo(t, e, n, o = {}) {
|
|
1334
|
+
const r = o.driftThreshold ?? Je, s = new Map(
|
|
1335
|
+
e.filter((i) => i.sourceSvgId).map((i) => [i.sourceSvgId, i])
|
|
1336
|
+
), u = /* @__PURE__ */ new Set(), a = [];
|
|
1337
|
+
for (const i of t) {
|
|
1338
|
+
const y = s.get(i.sourceSvgId);
|
|
1339
|
+
if (u.add(i.sourceSvgId), !y)
|
|
1340
|
+
a.push({
|
|
1341
|
+
sourceSvgId: i.sourceSvgId,
|
|
986
1342
|
change: "added",
|
|
987
|
-
newKind:
|
|
1343
|
+
newKind: i.kind
|
|
988
1344
|
});
|
|
989
|
-
else if (
|
|
990
|
-
|
|
991
|
-
sourceSvgId:
|
|
1345
|
+
else if (y.kind !== i.kind)
|
|
1346
|
+
a.push({
|
|
1347
|
+
sourceSvgId: i.sourceSvgId,
|
|
992
1348
|
change: "kind_changed",
|
|
993
|
-
existingShapeId:
|
|
994
|
-
existingKind:
|
|
995
|
-
newKind:
|
|
996
|
-
preserve: { key:
|
|
997
|
-
geometryLocked:
|
|
1349
|
+
existingShapeId: y.id,
|
|
1350
|
+
existingKind: y.kind,
|
|
1351
|
+
newKind: i.kind,
|
|
1352
|
+
preserve: { key: y.key, assignment: !0, anchors: !0 },
|
|
1353
|
+
geometryLocked: y.geometryLocked
|
|
998
1354
|
});
|
|
999
1355
|
else {
|
|
1000
1356
|
let p = "unchanged";
|
|
1001
|
-
if (
|
|
1002
|
-
const
|
|
1003
|
-
Math.hypot(
|
|
1357
|
+
if (y.bbox) {
|
|
1358
|
+
const l = (y.bbox.minX + y.bbox.maxX) / 2, k = (y.bbox.minY + y.bbox.maxY) / 2, c = Ye(i.geometry);
|
|
1359
|
+
Math.hypot(c.x - l, c.y - k) > r && (p = "moved");
|
|
1004
1360
|
}
|
|
1005
|
-
|
|
1006
|
-
sourceSvgId:
|
|
1361
|
+
a.push({
|
|
1362
|
+
sourceSvgId: i.sourceSvgId,
|
|
1007
1363
|
change: p,
|
|
1008
|
-
existingShapeId:
|
|
1009
|
-
existingKind:
|
|
1010
|
-
newKind:
|
|
1011
|
-
preserve: { key:
|
|
1012
|
-
geometryLocked:
|
|
1364
|
+
existingShapeId: y.id,
|
|
1365
|
+
existingKind: y.kind,
|
|
1366
|
+
newKind: i.kind,
|
|
1367
|
+
preserve: { key: y.key, assignment: !0, anchors: !0 },
|
|
1368
|
+
geometryLocked: y.geometryLocked
|
|
1013
1369
|
});
|
|
1014
1370
|
}
|
|
1015
1371
|
}
|
|
1016
|
-
for (const
|
|
1017
|
-
|
|
1018
|
-
sourceSvgId:
|
|
1372
|
+
for (const i of e)
|
|
1373
|
+
i.sourceSvgId && !u.has(i.sourceSvgId) && a.push({
|
|
1374
|
+
sourceSvgId: i.sourceSvgId,
|
|
1019
1375
|
change: "removed",
|
|
1020
|
-
existingShapeId:
|
|
1021
|
-
existingKind:
|
|
1022
|
-
geometryLocked:
|
|
1376
|
+
existingShapeId: i.id,
|
|
1377
|
+
existingKind: i.kind,
|
|
1378
|
+
geometryLocked: i.geometryLocked
|
|
1023
1379
|
});
|
|
1024
1380
|
return {
|
|
1025
|
-
items:
|
|
1026
|
-
shapes:
|
|
1381
|
+
items: a,
|
|
1382
|
+
shapes: t,
|
|
1027
1383
|
viewbox: n
|
|
1028
1384
|
};
|
|
1029
1385
|
}
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1386
|
+
const E = 1e-6, fn = 15 * Math.PI / 180, dn = 1e-3, j = Math.PI * 2;
|
|
1387
|
+
function St(t, e) {
|
|
1388
|
+
return Math.abs(t.x - e.x) < E && Math.abs(t.y - e.y) < E;
|
|
1389
|
+
}
|
|
1390
|
+
function at(t, e) {
|
|
1391
|
+
return { x: t.x + e.x, y: t.y + e.y };
|
|
1392
|
+
}
|
|
1393
|
+
function Lt(t, e) {
|
|
1394
|
+
return { x: t.x - e.x, y: t.y - e.y };
|
|
1395
|
+
}
|
|
1396
|
+
function q(t, e) {
|
|
1397
|
+
return { x: t.x * e, y: t.y * e };
|
|
1398
|
+
}
|
|
1399
|
+
function lt(t, e, n) {
|
|
1400
|
+
return {
|
|
1401
|
+
x: t.x + Math.cos(n) * e,
|
|
1402
|
+
y: t.y + Math.sin(n) * e
|
|
1403
|
+
};
|
|
1404
|
+
}
|
|
1405
|
+
function hn(t) {
|
|
1406
|
+
const e = [];
|
|
1407
|
+
for (const n of t) {
|
|
1408
|
+
const o = e[e.length - 1];
|
|
1409
|
+
o && St(o, n) || e.push(n);
|
|
1410
|
+
}
|
|
1411
|
+
return e.length >= 2 && St(e[0], e[e.length - 1]) && e.pop(), e;
|
|
1412
|
+
}
|
|
1413
|
+
function ho(t, e) {
|
|
1414
|
+
const n = wt(e), o = hn(t);
|
|
1415
|
+
if (o.length < 3 || n <= 0) return t;
|
|
1416
|
+
const r = o.length, s = new Array(r), u = new Array(r), a = new Array(r), i = new Array(r), y = new Array(r).fill(0), p = new Array(r).fill(0), l = new Array(r).fill(!1);
|
|
1417
|
+
for (let c = 0; c < r; c++) {
|
|
1418
|
+
const d = o[(c - 1 + r) % r], f = o[c], h = o[(c + 1) % r], m = w(d, f), b = w(f, h);
|
|
1419
|
+
if (a[c] = b, m < E || b < E) {
|
|
1420
|
+
s[c] = { x: 1, y: 0 }, u[c] = { x: 1, y: 0 }, i[c] = 0;
|
|
1421
|
+
continue;
|
|
1422
|
+
}
|
|
1423
|
+
s[c] = q(Lt(f, d), 1 / m), u[c] = q(Lt(h, f), 1 / b);
|
|
1424
|
+
const x = s[c].x * u[c].y - s[c].y * u[c].x, g = s[c].x * u[c].x + s[c].y * u[c].y;
|
|
1425
|
+
i[c] = Math.atan2(x, g);
|
|
1426
|
+
const I = Math.abs(i[c]);
|
|
1427
|
+
if (I < fn) continue;
|
|
1428
|
+
const C = Math.PI - I, _ = Math.tan(C / 2);
|
|
1429
|
+
if (_ < E || C <= E || C >= Math.PI - E) continue;
|
|
1430
|
+
const A = n / _;
|
|
1431
|
+
y[c] = A, p[c] = A, l[c] = !0;
|
|
1432
|
+
}
|
|
1433
|
+
for (let c = 0; c < r; c++) {
|
|
1434
|
+
const d = (c + 1) % r, f = p[c] + y[d], h = Math.max(0, a[c] - dn);
|
|
1435
|
+
if (f <= h || f <= E) continue;
|
|
1436
|
+
const m = h / f;
|
|
1437
|
+
p[c] *= m, y[d] *= m;
|
|
1438
|
+
}
|
|
1439
|
+
const k = [];
|
|
1440
|
+
for (let c = 0; c < r; c++) {
|
|
1441
|
+
const d = o[c], f = Math.min(y[c], p[c]), h = Math.abs(i[c]), m = Math.PI - h, b = f * Math.tan(m / 2);
|
|
1442
|
+
if (!l[c] || b < E || f < E) {
|
|
1443
|
+
k.push({ ...d });
|
|
1444
|
+
continue;
|
|
1445
|
+
}
|
|
1446
|
+
const x = at(d, q(s[c], -f)), g = at(d, q(u[c], f)), I = i[c] > 0 ? 1 : -1, C = at(x, {
|
|
1447
|
+
x: -s[c].y * I * b,
|
|
1448
|
+
y: s[c].x * I * b
|
|
1449
|
+
}), _ = Math.atan2(x.y - C.y, x.x - C.x), A = Math.atan2(g.y - C.y, g.x - C.x), M = (A - _ + j) % j, L = (_ - A + j) % j, P = lt(C, b, _ + M / 2), R = lt(C, b, _ - L / 2), F = w(P, d) <= w(R, d), G = F ? M : L, S = Math.max(8, Math.min(28, Math.ceil(G * b / 2)));
|
|
1450
|
+
for (let O = 0; O <= S; O++) {
|
|
1451
|
+
const Y = O / S, v = F ? _ + G * Y : _ - G * Y;
|
|
1452
|
+
k.push(lt(C, b, v));
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
return k;
|
|
1456
|
+
}
|
|
1457
|
+
function yn(t, e, n = []) {
|
|
1458
|
+
const o = Ut(), r = new Map(t.map((i) => [i.id, i])), s = new Map(n.map((i) => [i.id, i])), u = t.map((i) => ({
|
|
1459
|
+
id: i.id,
|
|
1460
|
+
levelId: i.levelId,
|
|
1461
|
+
x: i.x,
|
|
1462
|
+
y: i.y,
|
|
1463
|
+
kind: i.kind,
|
|
1464
|
+
shapeId: i.shapeId,
|
|
1465
|
+
connectorId: i.connectorId
|
|
1039
1466
|
}));
|
|
1040
|
-
for (const
|
|
1041
|
-
|
|
1042
|
-
const
|
|
1043
|
-
for (const
|
|
1044
|
-
const
|
|
1045
|
-
if (!
|
|
1046
|
-
let
|
|
1047
|
-
|
|
1048
|
-
let k =
|
|
1049
|
-
if (
|
|
1050
|
-
const d =
|
|
1467
|
+
for (const i of u)
|
|
1468
|
+
o.addNode(i.id, i);
|
|
1469
|
+
const a = [];
|
|
1470
|
+
for (const i of e) {
|
|
1471
|
+
const y = r.get(i.fromAnchorId), p = r.get(i.toAnchorId);
|
|
1472
|
+
if (!y || !p) continue;
|
|
1473
|
+
let l = i.weight;
|
|
1474
|
+
l == null && (l = w(y, p), y.levelId !== p.levelId && (l += ut));
|
|
1475
|
+
let k = i.accessible;
|
|
1476
|
+
if (i.kind === "connector" && y.connectorId != null) {
|
|
1477
|
+
const d = s.get(y.connectorId);
|
|
1051
1478
|
d && (k = d.accessible);
|
|
1052
1479
|
}
|
|
1053
|
-
const
|
|
1054
|
-
id:
|
|
1055
|
-
from:
|
|
1056
|
-
to:
|
|
1057
|
-
weight:
|
|
1058
|
-
directed:
|
|
1480
|
+
const c = {
|
|
1481
|
+
id: i.id,
|
|
1482
|
+
from: i.fromAnchorId,
|
|
1483
|
+
to: i.toAnchorId,
|
|
1484
|
+
weight: l,
|
|
1485
|
+
directed: i.directed,
|
|
1059
1486
|
accessible: k,
|
|
1060
|
-
kind:
|
|
1487
|
+
kind: i.kind
|
|
1061
1488
|
};
|
|
1062
|
-
|
|
1489
|
+
a.push(c), o.addLink(i.fromAnchorId, i.toAnchorId, c), i.directed || o.addLink(i.toAnchorId, i.fromAnchorId, c);
|
|
1063
1490
|
}
|
|
1064
|
-
return { graph:
|
|
1491
|
+
return { graph: o, nodes: u, edges: a, anchorById: r };
|
|
1065
1492
|
}
|
|
1066
|
-
function
|
|
1067
|
-
const { graph:
|
|
1068
|
-
if (!
|
|
1493
|
+
function xn(t, e, n, o = {}) {
|
|
1494
|
+
const { graph: r, anchorById: s } = t;
|
|
1495
|
+
if (!s.has(e) || !s.has(n))
|
|
1069
1496
|
return null;
|
|
1070
|
-
const
|
|
1071
|
-
|
|
1497
|
+
const a = Ht.nba(r, {
|
|
1498
|
+
oriented: !0,
|
|
1499
|
+
distance(c, d, f) {
|
|
1072
1500
|
const h = f.data;
|
|
1073
|
-
return
|
|
1501
|
+
return o.accessibleOnly && h && !h.accessible ? Number.POSITIVE_INFINITY : (h == null ? void 0 : h.weight) ?? 1;
|
|
1074
1502
|
},
|
|
1075
|
-
heuristic(
|
|
1076
|
-
const f =
|
|
1503
|
+
heuristic(c, d) {
|
|
1504
|
+
const f = s.get(c.id), h = s.get(d.id);
|
|
1077
1505
|
if (!f || !h) return 0;
|
|
1078
|
-
let
|
|
1079
|
-
return f.levelId !== h.levelId && (
|
|
1506
|
+
let m = w(f, h);
|
|
1507
|
+
return f.levelId !== h.levelId && (m += ut), m;
|
|
1080
1508
|
}
|
|
1081
|
-
}).find(
|
|
1082
|
-
if (!
|
|
1083
|
-
const
|
|
1509
|
+
}).find(e, n);
|
|
1510
|
+
if (!a || a.length === 0) return null;
|
|
1511
|
+
const y = a.reverse().map((c) => c.id), p = [], l = [];
|
|
1084
1512
|
let k = 0;
|
|
1085
|
-
for (let
|
|
1086
|
-
const d =
|
|
1087
|
-
if (p.push({ x: d.x, y: d.y, levelId: d.levelId }),
|
|
1088
|
-
const f =
|
|
1089
|
-
k +=
|
|
1513
|
+
for (let c = 0; c < y.length; c++) {
|
|
1514
|
+
const d = s.get(y[c]);
|
|
1515
|
+
if (p.push({ x: d.x, y: d.y, levelId: d.levelId }), c > 0) {
|
|
1516
|
+
const f = s.get(y[c - 1]);
|
|
1517
|
+
k += w(f, d), f.levelId !== d.levelId && (k += ut, l.push({
|
|
1090
1518
|
fromLevelId: f.levelId,
|
|
1091
1519
|
toLevelId: d.levelId,
|
|
1092
1520
|
connectorId: d.connectorId ?? f.connectorId
|
|
1093
1521
|
}));
|
|
1094
1522
|
}
|
|
1095
1523
|
}
|
|
1096
|
-
return { anchorIds:
|
|
1524
|
+
return { anchorIds: y, points: p, totalWeight: k, levelChanges: l };
|
|
1097
1525
|
}
|
|
1098
|
-
function
|
|
1099
|
-
let
|
|
1100
|
-
for (const
|
|
1101
|
-
const
|
|
1102
|
-
|
|
1526
|
+
function yo(t, e, n, o = {}) {
|
|
1527
|
+
let r = null;
|
|
1528
|
+
for (const s of n) {
|
|
1529
|
+
const u = xn(t, e, s, o);
|
|
1530
|
+
u && (!r || u.totalWeight < r.totalWeight) && (r = u);
|
|
1103
1531
|
}
|
|
1104
|
-
return
|
|
1105
|
-
}
|
|
1106
|
-
function
|
|
1107
|
-
const
|
|
1108
|
-
|
|
1109
|
-
),
|
|
1110
|
-
|
|
1111
|
-
|
|
1532
|
+
return r;
|
|
1533
|
+
}
|
|
1534
|
+
function xo(t) {
|
|
1535
|
+
const e = ae(t.theme), n = new Map(
|
|
1536
|
+
t.assignments.map((i) => [i.shapeId, i])
|
|
1537
|
+
), o = new Map(
|
|
1538
|
+
(t.retailers ?? []).map((i) => [i.id, i])
|
|
1539
|
+
), r = t.resolveSvgUrl ?? ((i) => i), s = t.levels.filter((i) => i.isActive).sort((i, y) => i.ordering - y.ordering).map((i) => {
|
|
1540
|
+
const y = t.shapes.filter((l) => l.levelId === i.id).map((l) => {
|
|
1541
|
+
const k = Xt(l.geometry), c = n.get(l.id) ?? null, d = (c == null ? void 0 : c.retailerId) != null ? o.get(c.retailerId) ?? null : null;
|
|
1112
1542
|
return {
|
|
1113
|
-
...
|
|
1114
|
-
geometry:
|
|
1115
|
-
bbox:
|
|
1116
|
-
assignment:
|
|
1543
|
+
...l,
|
|
1544
|
+
geometry: k,
|
|
1545
|
+
bbox: k === l.geometry ? l.bbox : xt(k),
|
|
1546
|
+
assignment: c,
|
|
1547
|
+
label: Ft(l, c, d)
|
|
1117
1548
|
};
|
|
1118
|
-
}),
|
|
1549
|
+
}), p = t.anchors.filter((l) => l.levelId === i.id);
|
|
1119
1550
|
return {
|
|
1120
|
-
id:
|
|
1121
|
-
buildingId:
|
|
1122
|
-
kind:
|
|
1123
|
-
name:
|
|
1124
|
-
levelIndex:
|
|
1125
|
-
ordering:
|
|
1126
|
-
sourceSvgUrl:
|
|
1127
|
-
viewbox:
|
|
1128
|
-
transform:
|
|
1129
|
-
shapes:
|
|
1130
|
-
anchors:
|
|
1551
|
+
id: i.id,
|
|
1552
|
+
buildingId: i.buildingId,
|
|
1553
|
+
kind: i.kind,
|
|
1554
|
+
name: i.name,
|
|
1555
|
+
levelIndex: i.levelIndex,
|
|
1556
|
+
ordering: i.ordering,
|
|
1557
|
+
sourceSvgUrl: r(i.sourceSvgKey) ?? i.sourceSvgUrl ?? null,
|
|
1558
|
+
viewbox: i.sourceViewbox,
|
|
1559
|
+
transform: i.transform,
|
|
1560
|
+
shapes: y,
|
|
1561
|
+
anchors: p
|
|
1131
1562
|
};
|
|
1132
|
-
}), { nodes:
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1563
|
+
}), { nodes: u, edges: a } = yn(
|
|
1564
|
+
t.anchors,
|
|
1565
|
+
t.edges,
|
|
1566
|
+
t.connectors
|
|
1136
1567
|
);
|
|
1137
1568
|
return {
|
|
1138
1569
|
version: 2,
|
|
1139
|
-
revisionId:
|
|
1140
|
-
revisionNumber:
|
|
1141
|
-
centerId:
|
|
1142
|
-
mapId:
|
|
1143
|
-
theme:
|
|
1144
|
-
baseSvgUrl:
|
|
1145
|
-
baseViewbox:
|
|
1146
|
-
buildings:
|
|
1147
|
-
levels:
|
|
1148
|
-
connectors:
|
|
1149
|
-
amenities:
|
|
1150
|
-
graph: { nodes:
|
|
1151
|
-
responsiveOverrides:
|
|
1152
|
-
publishedAt:
|
|
1570
|
+
revisionId: t.revisionId,
|
|
1571
|
+
revisionNumber: t.revisionNumber,
|
|
1572
|
+
centerId: t.centerId,
|
|
1573
|
+
mapId: t.mapId,
|
|
1574
|
+
theme: e,
|
|
1575
|
+
baseSvgUrl: t.baseSvgUrl,
|
|
1576
|
+
baseViewbox: t.baseViewbox,
|
|
1577
|
+
buildings: t.buildings,
|
|
1578
|
+
levels: s,
|
|
1579
|
+
connectors: t.connectors,
|
|
1580
|
+
amenities: t.amenities.filter((i) => i.isActive),
|
|
1581
|
+
graph: { nodes: u, edges: a },
|
|
1582
|
+
responsiveOverrides: t.responsiveOverrides,
|
|
1583
|
+
publishedAt: t.publishedAt ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
1153
1584
|
};
|
|
1154
1585
|
}
|
|
1155
|
-
function
|
|
1156
|
-
let
|
|
1157
|
-
const n =
|
|
1158
|
-
let
|
|
1159
|
-
const
|
|
1160
|
-
const
|
|
1161
|
-
return
|
|
1162
|
-
...
|
|
1163
|
-
geometry:
|
|
1164
|
-
bbox:
|
|
1586
|
+
function po(t) {
|
|
1587
|
+
let e = !1;
|
|
1588
|
+
const n = t.levels.map((o) => {
|
|
1589
|
+
let r = !1;
|
|
1590
|
+
const s = o.shapes.map((u) => {
|
|
1591
|
+
const a = Xt(u.geometry), i = Ft(u, u.assignment), y = a !== u.geometry, p = i !== u.label;
|
|
1592
|
+
return !y && !p ? u : (r = !0, {
|
|
1593
|
+
...u,
|
|
1594
|
+
geometry: a,
|
|
1595
|
+
bbox: y ? xt(a) : u.bbox,
|
|
1596
|
+
label: i
|
|
1165
1597
|
});
|
|
1166
1598
|
});
|
|
1167
|
-
return
|
|
1599
|
+
return r ? (e = !0, { ...o, shapes: s }) : o;
|
|
1168
1600
|
});
|
|
1169
|
-
return
|
|
1601
|
+
return e ? { ...t, levels: n } : t;
|
|
1602
|
+
}
|
|
1603
|
+
const pn = [
|
|
1604
|
+
"floorplate",
|
|
1605
|
+
"walkable",
|
|
1606
|
+
"decor",
|
|
1607
|
+
"zone",
|
|
1608
|
+
"green_area",
|
|
1609
|
+
"water",
|
|
1610
|
+
"parking_zone"
|
|
1611
|
+
];
|
|
1612
|
+
function mn(t) {
|
|
1613
|
+
return t === "void";
|
|
1614
|
+
}
|
|
1615
|
+
function mo(t) {
|
|
1616
|
+
return pn.includes(t);
|
|
1617
|
+
}
|
|
1618
|
+
function Wt(t) {
|
|
1619
|
+
return mn(t.kind) && !t.orphanedAt;
|
|
1620
|
+
}
|
|
1621
|
+
function gn(t) {
|
|
1622
|
+
return (t.shapes ?? []).some(Wt);
|
|
1623
|
+
}
|
|
1624
|
+
function go(t) {
|
|
1625
|
+
var n;
|
|
1626
|
+
const e = [];
|
|
1627
|
+
for (const o of t.shapes ?? [])
|
|
1628
|
+
if (Wt(o))
|
|
1629
|
+
for (const r of ((n = o.geometry) == null ? void 0 : n.polygons) ?? [])
|
|
1630
|
+
r.length >= 3 && e.push(r);
|
|
1631
|
+
return e;
|
|
1632
|
+
}
|
|
1633
|
+
function Ot(t) {
|
|
1634
|
+
let e = 0;
|
|
1635
|
+
for (let n = 0, o = t.length - 1; n < t.length; o = n++)
|
|
1636
|
+
e += t[o].x * t[n].y - t[n].x * t[o].y;
|
|
1637
|
+
return e / 2;
|
|
1638
|
+
}
|
|
1639
|
+
function bn(t) {
|
|
1640
|
+
return t.slice().reverse();
|
|
1641
|
+
}
|
|
1642
|
+
function kn(t, e) {
|
|
1643
|
+
const n = Ot(t), o = Ot(e);
|
|
1644
|
+
return n === 0 || o === 0 ? e : Math.sign(n) === Math.sign(o) ? bn(e) : e;
|
|
1645
|
+
}
|
|
1646
|
+
function Mt(t) {
|
|
1647
|
+
let e = 1 / 0, n = 1 / 0, o = -1 / 0, r = -1 / 0;
|
|
1648
|
+
for (const s of t)
|
|
1649
|
+
s.x < e && (e = s.x), s.y < n && (n = s.y), s.x > o && (o = s.x), s.y > r && (r = s.y);
|
|
1650
|
+
return { minX: e, minY: n, maxX: o, maxY: r };
|
|
1651
|
+
}
|
|
1652
|
+
function In(t, e) {
|
|
1653
|
+
const n = Mt(t), o = Mt(e);
|
|
1654
|
+
return n.minX <= o.maxX && n.maxX >= o.minX && n.minY <= o.maxY && n.maxY >= o.minY;
|
|
1655
|
+
}
|
|
1656
|
+
function bo(t, e) {
|
|
1657
|
+
return e.filter((n) => n.length >= 3 && In(t, n)).map((n) => kn(t, n));
|
|
1658
|
+
}
|
|
1659
|
+
const ko = "#e8eef4", Io = "#64748b", _o = "#475569";
|
|
1660
|
+
function _n(t, e) {
|
|
1661
|
+
return t.ordering - e.ordering || t.levelIndex - e.levelIndex;
|
|
1662
|
+
}
|
|
1663
|
+
function Q(t) {
|
|
1664
|
+
return t.kind === "outdoor";
|
|
1665
|
+
}
|
|
1666
|
+
function Cn(t, e) {
|
|
1667
|
+
const n = t.filter(Q), o = e == null ? null : t.find((r) => r.id === e) ?? null;
|
|
1668
|
+
return !o || Q(o) || n.some((r) => r.id === o.id) ? n : [...n, o];
|
|
1669
|
+
}
|
|
1670
|
+
function An(t, e) {
|
|
1671
|
+
if (e == null) return [];
|
|
1672
|
+
const n = et(t), o = n.findIndex((u) => u.id === e);
|
|
1673
|
+
if (o < 0) return [];
|
|
1674
|
+
const r = [];
|
|
1675
|
+
let s = n[o];
|
|
1676
|
+
for (let u = o; u < n.length - 1 && gn(s); u++) {
|
|
1677
|
+
const a = n[u + 1];
|
|
1678
|
+
if (!a) break;
|
|
1679
|
+
r.unshift(a), s = a;
|
|
1680
|
+
}
|
|
1681
|
+
return r;
|
|
1682
|
+
}
|
|
1683
|
+
function Co(t, e) {
|
|
1684
|
+
return An(t, e).at(-1) ?? null;
|
|
1170
1685
|
}
|
|
1171
|
-
function
|
|
1172
|
-
|
|
1686
|
+
function Ao(t, e, n) {
|
|
1687
|
+
const o = t.find((s) => s.id === n);
|
|
1688
|
+
if (!o || !Q(o)) return n;
|
|
1689
|
+
const r = e == null ? null : t.find((s) => s.id === e) ?? null;
|
|
1690
|
+
return r && !Q(r) ? r.id : Sn(t) ?? n;
|
|
1173
1691
|
}
|
|
1174
|
-
function
|
|
1175
|
-
return e.kind === "
|
|
1692
|
+
function et(t) {
|
|
1693
|
+
return t.filter((e) => e.kind === "floor").slice().sort(_n);
|
|
1176
1694
|
}
|
|
1177
|
-
function
|
|
1178
|
-
|
|
1179
|
-
return !s || ce(s) || n.some((i) => i.id === s.id) ? n : [...n, s];
|
|
1695
|
+
function So(t) {
|
|
1696
|
+
return et(t);
|
|
1180
1697
|
}
|
|
1181
|
-
function
|
|
1182
|
-
return
|
|
1698
|
+
function Lo(t) {
|
|
1699
|
+
return et(t).length > 1;
|
|
1183
1700
|
}
|
|
1184
|
-
function
|
|
1185
|
-
return
|
|
1701
|
+
function Oo(t) {
|
|
1702
|
+
return t.some((e) => e.kind === "floor");
|
|
1186
1703
|
}
|
|
1187
|
-
|
|
1188
|
-
|
|
1704
|
+
const Mo = "This map doesn’t have any floors yet.";
|
|
1705
|
+
function Sn(t) {
|
|
1706
|
+
var e, n;
|
|
1707
|
+
return ((e = et(t).at(-1)) == null ? void 0 : e.id) ?? ((n = t[0]) == null ? void 0 : n.id) ?? null;
|
|
1189
1708
|
}
|
|
1190
|
-
function
|
|
1191
|
-
|
|
1192
|
-
|
|
1709
|
+
function Et(t) {
|
|
1710
|
+
return {
|
|
1711
|
+
minX: t.x,
|
|
1712
|
+
minY: t.y,
|
|
1713
|
+
maxX: t.x + t.width,
|
|
1714
|
+
maxY: t.y + t.height,
|
|
1715
|
+
cx: t.x + t.width / 2,
|
|
1716
|
+
cy: t.y + t.height / 2,
|
|
1717
|
+
size: Math.max(t.width, t.height, 100)
|
|
1718
|
+
};
|
|
1193
1719
|
}
|
|
1194
|
-
function
|
|
1720
|
+
function Ln(t, e) {
|
|
1721
|
+
const n = e.scale || 1, o = (e.rotate || 0) * Math.PI / 180, r = Math.cos(o), s = Math.sin(o), u = t.x * n, a = t.y * n;
|
|
1195
1722
|
return {
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
maxX: e.x + e.width,
|
|
1199
|
-
maxY: e.y + e.height,
|
|
1200
|
-
cx: e.x + e.width / 2,
|
|
1201
|
-
cy: e.y + e.height / 2,
|
|
1202
|
-
size: Math.max(e.width, e.height, 100)
|
|
1723
|
+
x: u * r - a * s + (e.translateX || 0),
|
|
1724
|
+
y: u * s + a * r + (e.translateY || 0)
|
|
1203
1725
|
};
|
|
1204
1726
|
}
|
|
1205
|
-
function
|
|
1206
|
-
const n =
|
|
1727
|
+
function On(t, e) {
|
|
1728
|
+
const n = [
|
|
1729
|
+
{ x: t.minX, y: t.minY },
|
|
1730
|
+
{ x: t.maxX, y: t.minY },
|
|
1731
|
+
{ x: t.minX, y: t.maxY },
|
|
1732
|
+
{ x: t.maxX, y: t.maxY }
|
|
1733
|
+
].map((a) => e ? Ln(a, e) : a), o = Math.min(
|
|
1734
|
+
n[0].x,
|
|
1735
|
+
n[1].x,
|
|
1736
|
+
n[2].x,
|
|
1737
|
+
n[3].x
|
|
1738
|
+
), r = Math.min(
|
|
1739
|
+
n[0].y,
|
|
1740
|
+
n[1].y,
|
|
1741
|
+
n[2].y,
|
|
1742
|
+
n[3].y
|
|
1743
|
+
), s = Math.max(
|
|
1744
|
+
n[0].x,
|
|
1745
|
+
n[1].x,
|
|
1746
|
+
n[2].x,
|
|
1747
|
+
n[3].x
|
|
1748
|
+
), u = Math.max(
|
|
1749
|
+
n[0].y,
|
|
1750
|
+
n[1].y,
|
|
1751
|
+
n[2].y,
|
|
1752
|
+
n[3].y
|
|
1753
|
+
);
|
|
1754
|
+
return {
|
|
1755
|
+
minX: o,
|
|
1756
|
+
minY: r,
|
|
1757
|
+
maxX: s,
|
|
1758
|
+
maxY: u,
|
|
1759
|
+
cx: (o + s) / 2,
|
|
1760
|
+
cy: (r + u) / 2,
|
|
1761
|
+
size: Math.max(s - o, u - r, 100)
|
|
1762
|
+
};
|
|
1763
|
+
}
|
|
1764
|
+
function Rt(t, e) {
|
|
1765
|
+
const n = Math.min(t.minX, e.minX), o = Math.min(t.minY, e.minY), r = Math.max(t.maxX, e.maxX), s = Math.max(t.maxY, e.maxY);
|
|
1207
1766
|
return {
|
|
1208
1767
|
minX: n,
|
|
1209
|
-
minY:
|
|
1210
|
-
maxX:
|
|
1211
|
-
maxY:
|
|
1212
|
-
cx: (n +
|
|
1213
|
-
cy: (
|
|
1214
|
-
size: Math.max(
|
|
1768
|
+
minY: o,
|
|
1769
|
+
maxX: r,
|
|
1770
|
+
maxY: s,
|
|
1771
|
+
cx: (n + r) / 2,
|
|
1772
|
+
cy: (o + s) / 2,
|
|
1773
|
+
size: Math.max(r - n, s - o, 100)
|
|
1215
1774
|
};
|
|
1216
1775
|
}
|
|
1217
|
-
function
|
|
1218
|
-
let
|
|
1219
|
-
for (const
|
|
1220
|
-
if (
|
|
1221
|
-
const
|
|
1222
|
-
|
|
1776
|
+
function Eo(t, e, n) {
|
|
1777
|
+
let o = n ? Et(n) : null;
|
|
1778
|
+
for (const r of Cn(t, e)) {
|
|
1779
|
+
if (r.viewbox) {
|
|
1780
|
+
const s = Et(r.viewbox);
|
|
1781
|
+
o = o ? Rt(o, s) : s;
|
|
1223
1782
|
}
|
|
1224
|
-
for (const
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1227
|
-
minY: r.bbox.minY,
|
|
1228
|
-
maxX: r.bbox.maxX,
|
|
1229
|
-
maxY: r.bbox.maxY,
|
|
1230
|
-
cx: (r.bbox.minX + r.bbox.maxX) / 2,
|
|
1231
|
-
cy: (r.bbox.minY + r.bbox.maxY) / 2,
|
|
1232
|
-
size: Math.max(
|
|
1233
|
-
r.bbox.maxX - r.bbox.minX,
|
|
1234
|
-
r.bbox.maxY - r.bbox.minY,
|
|
1235
|
-
100
|
|
1236
|
-
)
|
|
1237
|
-
};
|
|
1238
|
-
s = s ? le(s, l) : l;
|
|
1783
|
+
for (const s of r.shapes) {
|
|
1784
|
+
const u = On(s.bbox);
|
|
1785
|
+
o = o ? Rt(o, u) : u;
|
|
1239
1786
|
}
|
|
1240
1787
|
}
|
|
1241
|
-
return
|
|
1788
|
+
return o ?? { minX: 0, minY: 0, maxX: 500, maxY: 500, cx: 250, cy: 250, size: 500 };
|
|
1242
1789
|
}
|
|
1243
|
-
function
|
|
1244
|
-
if (!
|
|
1245
|
-
if (!e) return t;
|
|
1790
|
+
function Ro(t, e) {
|
|
1791
|
+
if (!t && !e) return { x: 0, y: 0, width: 1e3, height: 800 };
|
|
1246
1792
|
if (!t) return e;
|
|
1247
|
-
|
|
1248
|
-
|
|
1793
|
+
if (!e) return t;
|
|
1794
|
+
const n = Math.min(t.x, e.x), o = Math.min(t.y, e.y), r = Math.max(t.x + t.width, e.x + e.width), s = Math.max(t.y + t.height, e.y + e.height);
|
|
1795
|
+
return { x: n, y: o, width: r - n, height: s - o };
|
|
1249
1796
|
}
|
|
1250
1797
|
export {
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1798
|
+
xo as $,
|
|
1799
|
+
xe as A,
|
|
1800
|
+
qn as B,
|
|
1801
|
+
he as C,
|
|
1802
|
+
J as D,
|
|
1803
|
+
ue as E,
|
|
1804
|
+
ut as F,
|
|
1805
|
+
Zn as G,
|
|
1806
|
+
gt as H,
|
|
1807
|
+
ft as I,
|
|
1808
|
+
Oe as J,
|
|
1809
|
+
io as K,
|
|
1810
|
+
Pn as L,
|
|
1811
|
+
Mo as M,
|
|
1812
|
+
Eo as N,
|
|
1813
|
+
ko as O,
|
|
1814
|
+
Fe as P,
|
|
1815
|
+
Qn as Q,
|
|
1269
1816
|
ye as R,
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
Ot as
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1817
|
+
pn as S,
|
|
1818
|
+
Vt as T,
|
|
1819
|
+
Me as U,
|
|
1820
|
+
wn as V,
|
|
1821
|
+
vt as W,
|
|
1822
|
+
wt as X,
|
|
1823
|
+
tn as Y,
|
|
1824
|
+
Bn as Z,
|
|
1825
|
+
_n as _,
|
|
1826
|
+
Nn as a,
|
|
1827
|
+
Ot as a$,
|
|
1828
|
+
yn as a0,
|
|
1829
|
+
jn as a1,
|
|
1830
|
+
Pt as a2,
|
|
1831
|
+
Xn as a3,
|
|
1832
|
+
Sn as a4,
|
|
1833
|
+
fo as a5,
|
|
1834
|
+
w as a6,
|
|
1835
|
+
Gn as a7,
|
|
1836
|
+
Rt as a8,
|
|
1837
|
+
ho as a9,
|
|
1838
|
+
ht as aA,
|
|
1839
|
+
mn as aB,
|
|
1840
|
+
Vn as aC,
|
|
1841
|
+
Yn as aD,
|
|
1842
|
+
Dn as aE,
|
|
1843
|
+
gn as aF,
|
|
1844
|
+
to as aG,
|
|
1845
|
+
it as aH,
|
|
1846
|
+
ae as aI,
|
|
1847
|
+
H as aJ,
|
|
1848
|
+
co as aK,
|
|
1849
|
+
Co as aL,
|
|
1850
|
+
Xt as aM,
|
|
1851
|
+
Fn as aN,
|
|
1852
|
+
tt as aO,
|
|
1853
|
+
Tt as aP,
|
|
1854
|
+
po as aQ,
|
|
1855
|
+
Rn as aR,
|
|
1856
|
+
Un as aS,
|
|
1857
|
+
Kn as aT,
|
|
1858
|
+
cn as aU,
|
|
1859
|
+
Ct as aV,
|
|
1860
|
+
De as aW,
|
|
1861
|
+
Bt as aX,
|
|
1862
|
+
Ee as aY,
|
|
1863
|
+
so as aZ,
|
|
1864
|
+
Mt as a_,
|
|
1865
|
+
yo as aa,
|
|
1866
|
+
xn as ab,
|
|
1867
|
+
ro as ac,
|
|
1868
|
+
So as ad,
|
|
1869
|
+
et as ae,
|
|
1870
|
+
xt as af,
|
|
1871
|
+
Ye as ag,
|
|
1872
|
+
Oo as ah,
|
|
1873
|
+
kn as ai,
|
|
1874
|
+
bo as aj,
|
|
1875
|
+
uo as ak,
|
|
1876
|
+
$e as al,
|
|
1877
|
+
Wt as am,
|
|
1878
|
+
ke as an,
|
|
1879
|
+
Tn as ao,
|
|
1880
|
+
Pe as ap,
|
|
1881
|
+
We as aq,
|
|
1882
|
+
Kt as ar,
|
|
1883
|
+
zt as as,
|
|
1884
|
+
no as at,
|
|
1885
|
+
pt as au,
|
|
1886
|
+
Q as av,
|
|
1887
|
+
Gt as aw,
|
|
1888
|
+
dt as ax,
|
|
1889
|
+
mo as ay,
|
|
1890
|
+
$t as az,
|
|
1891
|
+
de as b,
|
|
1892
|
+
In as b0,
|
|
1893
|
+
Re as b1,
|
|
1894
|
+
Ft as b2,
|
|
1895
|
+
It as b3,
|
|
1896
|
+
oo as b4,
|
|
1897
|
+
yt as b5,
|
|
1898
|
+
Jt as b6,
|
|
1899
|
+
zn as b7,
|
|
1900
|
+
Wn as b8,
|
|
1901
|
+
$n as b9,
|
|
1902
|
+
An as ba,
|
|
1903
|
+
bn as bb,
|
|
1904
|
+
On as bc,
|
|
1905
|
+
Lo as bd,
|
|
1906
|
+
ao as be,
|
|
1907
|
+
z as bf,
|
|
1908
|
+
qt as bg,
|
|
1909
|
+
ee as bh,
|
|
1910
|
+
Dt as bi,
|
|
1911
|
+
Ze as bj,
|
|
1912
|
+
Ro as bk,
|
|
1913
|
+
hn as bl,
|
|
1914
|
+
Et as bm,
|
|
1915
|
+
eo as bn,
|
|
1916
|
+
Ao as bo,
|
|
1917
|
+
Cn as bp,
|
|
1918
|
+
go as bq,
|
|
1919
|
+
W as c,
|
|
1920
|
+
vn as d,
|
|
1921
|
+
Je as e,
|
|
1922
|
+
Qe as f,
|
|
1923
|
+
le as g,
|
|
1924
|
+
fe as h,
|
|
1925
|
+
_o as i,
|
|
1926
|
+
Io as j,
|
|
1927
|
+
Zt as k,
|
|
1928
|
+
Nt as l,
|
|
1929
|
+
jt as m,
|
|
1930
|
+
Hn as n,
|
|
1931
|
+
lo as o,
|
|
1932
|
+
Jn as p,
|
|
1933
|
+
Ln as q,
|
|
1934
|
+
ze as r,
|
|
1935
|
+
Ne as s,
|
|
1936
|
+
bt as t,
|
|
1937
|
+
kt as u,
|
|
1938
|
+
ge as v,
|
|
1939
|
+
Ce as w,
|
|
1940
|
+
X as x,
|
|
1941
|
+
Yt as y,
|
|
1942
|
+
Ae as z
|
|
1320
1943
|
};
|
|
1321
1944
|
//# sourceMappingURL=stacking.js.map
|