@eyeon/map 2.0.3 → 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.
Files changed (149) hide show
  1. package/dist/assets/MapViewer.css +1 -1
  2. package/dist/assets/index.css +1 -1
  3. package/dist/chunks/MapViewer.js +2557 -1432
  4. package/dist/chunks/MapViewer.js.map +1 -1
  5. package/dist/chunks/stacking.js +1263 -745
  6. package/dist/chunks/stacking.js.map +1 -1
  7. package/dist/chunks/wheelZoom.js +259 -0
  8. package/dist/chunks/wheelZoom.js.map +1 -0
  9. package/dist/core/assignment.d.ts +97 -0
  10. package/dist/core/assignment.d.ts.map +1 -0
  11. package/dist/core/color.d.ts +5 -0
  12. package/dist/core/color.d.ts.map +1 -0
  13. package/dist/core/entranceIcon.d.ts +12 -0
  14. package/dist/core/entranceIcon.d.ts.map +1 -0
  15. package/dist/core/hostChrome.d.ts +2 -4
  16. package/dist/core/hostChrome.d.ts.map +1 -1
  17. package/dist/core/index.d.ts +6 -0
  18. package/dist/core/index.d.ts.map +1 -1
  19. package/dist/core/index.js +161 -89
  20. package/dist/core/labelAlign.d.ts +7 -0
  21. package/dist/core/labelAlign.d.ts.map +1 -0
  22. package/dist/core/layerStyles.d.ts +40 -7
  23. package/dist/core/layerStyles.d.ts.map +1 -1
  24. package/dist/core/outdoorDecoration.d.ts +1 -1
  25. package/dist/core/outdoorDecoration.d.ts.map +1 -1
  26. package/dist/core/publish/index.d.ts +6 -4
  27. package/dist/core/publish/index.d.ts.map +1 -1
  28. package/dist/core/stacking.d.ts +50 -3
  29. package/dist/core/stacking.d.ts.map +1 -1
  30. package/dist/core/types.d.ts +29 -1
  31. package/dist/core/types.d.ts.map +1 -1
  32. package/dist/core/voids.d.ts +41 -0
  33. package/dist/core/voids.d.ts.map +1 -0
  34. package/dist/core/wheelZoom.d.ts +30 -0
  35. package/dist/core/wheelZoom.d.ts.map +1 -0
  36. package/dist/editor/FieldResetButton.d.ts +7 -0
  37. package/dist/editor/FieldResetButton.d.ts.map +1 -0
  38. package/dist/editor/MapEditor.d.ts +12 -2
  39. package/dist/editor/MapEditor.d.ts.map +1 -1
  40. package/dist/editor/canvas/EditorCanvas.d.ts +6 -2
  41. package/dist/editor/canvas/EditorCanvas.d.ts.map +1 -1
  42. package/dist/editor/canvas/OutdoorSvgUnderlay.d.ts +2 -1
  43. package/dist/editor/canvas/OutdoorSvgUnderlay.d.ts.map +1 -1
  44. package/dist/editor/canvas/coords.d.ts +26 -3
  45. package/dist/editor/canvas/coords.d.ts.map +1 -1
  46. package/dist/editor/canvas/editorFill.d.ts +3 -1
  47. package/dist/editor/canvas/editorFill.d.ts.map +1 -1
  48. package/dist/editor/canvas/editorHover.d.ts +4 -0
  49. package/dist/editor/canvas/editorHover.d.ts.map +1 -1
  50. package/dist/editor/canvas/underlayHint.d.ts +8 -0
  51. package/dist/editor/canvas/underlayHint.d.ts.map +1 -1
  52. package/dist/editor/connectorAssignments.d.ts +61 -0
  53. package/dist/editor/connectorAssignments.d.ts.map +1 -1
  54. package/dist/editor/draftOps.d.ts +8 -0
  55. package/dist/editor/draftOps.d.ts.map +1 -1
  56. package/dist/editor/editorSectionReturn.d.ts.map +1 -1
  57. package/dist/editor/ellipseDraw.d.ts +12 -0
  58. package/dist/editor/ellipseDraw.d.ts.map +1 -0
  59. package/dist/editor/entranceIcon.d.ts +15 -0
  60. package/dist/editor/entranceIcon.d.ts.map +1 -0
  61. package/dist/editor/hexColor.d.ts +2 -0
  62. package/dist/editor/hexColor.d.ts.map +1 -1
  63. package/dist/editor/index.css +824 -72
  64. package/dist/editor/index.d.ts +2 -0
  65. package/dist/editor/index.d.ts.map +1 -1
  66. package/dist/editor/index.js +6700 -4160
  67. package/dist/editor/index.js.map +1 -1
  68. package/dist/editor/labelText.d.ts +12 -2
  69. package/dist/editor/labelText.d.ts.map +1 -1
  70. package/dist/editor/labels.d.ts +8 -0
  71. package/dist/editor/labels.d.ts.map +1 -1
  72. package/dist/editor/panels/AssignForm.d.ts +17 -0
  73. package/dist/editor/panels/AssignForm.d.ts.map +1 -0
  74. package/dist/editor/panels/AssignmentStyleFields.d.ts +14 -0
  75. package/dist/editor/panels/AssignmentStyleFields.d.ts.map +1 -0
  76. package/dist/editor/panels/BulkAssignForm.d.ts +11 -0
  77. package/dist/editor/panels/BulkAssignForm.d.ts.map +1 -0
  78. package/dist/editor/panels/CatalogKioskForm.d.ts +18 -0
  79. package/dist/editor/panels/CatalogKioskForm.d.ts.map +1 -0
  80. package/dist/editor/panels/ConnectorAssign.d.ts +6 -2
  81. package/dist/editor/panels/ConnectorAssign.d.ts.map +1 -1
  82. package/dist/editor/panels/CopyToLevelButton.d.ts +10 -0
  83. package/dist/editor/panels/CopyToLevelButton.d.ts.map +1 -0
  84. package/dist/editor/panels/EntranceIconForm.d.ts +11 -0
  85. package/dist/editor/panels/EntranceIconForm.d.ts.map +1 -0
  86. package/dist/editor/panels/Inspector.d.ts +24 -3
  87. package/dist/editor/panels/Inspector.d.ts.map +1 -1
  88. package/dist/editor/panels/LeftRail.d.ts +17 -6
  89. package/dist/editor/panels/LeftRail.d.ts.map +1 -1
  90. package/dist/editor/panels/PreviewOverlay.d.ts +9 -3
  91. package/dist/editor/panels/PreviewOverlay.d.ts.map +1 -1
  92. package/dist/editor/panels/TextLabelForm.d.ts +11 -0
  93. package/dist/editor/panels/TextLabelForm.d.ts.map +1 -0
  94. package/dist/editor/panels/formRows.d.ts +41 -0
  95. package/dist/editor/panels/formRows.d.ts.map +1 -0
  96. package/dist/editor/portalSurface.d.ts +10 -2
  97. package/dist/editor/portalSurface.d.ts.map +1 -1
  98. package/dist/editor/previewDocument.d.ts +2 -1
  99. package/dist/editor/previewDocument.d.ts.map +1 -1
  100. package/dist/editor/railAssignments.d.ts +9 -2
  101. package/dist/editor/railAssignments.d.ts.map +1 -1
  102. package/dist/editor/railKiosks.d.ts +27 -0
  103. package/dist/editor/railKiosks.d.ts.map +1 -0
  104. package/dist/editor/railListCopy.d.ts +31 -0
  105. package/dist/editor/railListCopy.d.ts.map +1 -0
  106. package/dist/editor/routeStubs.d.ts +1 -1
  107. package/dist/editor/routeStubs.d.ts.map +1 -1
  108. package/dist/editor/shapeCopy.d.ts +40 -0
  109. package/dist/editor/shapeCopy.d.ts.map +1 -0
  110. package/dist/editor/shapeSelection.d.ts +6 -0
  111. package/dist/editor/shapeSelection.d.ts.map +1 -0
  112. package/dist/editor/tools.d.ts +12 -2
  113. package/dist/editor/tools.d.ts.map +1 -1
  114. package/dist/fonts/assets.d.ts +4 -0
  115. package/dist/fonts/mapFont.d.ts +5 -0
  116. package/dist/fonts/mapFont.d.ts.map +1 -0
  117. package/dist/fonts/mapFontUrl.d.ts +8 -0
  118. package/dist/fonts/mapFontUrl.d.ts.map +1 -0
  119. package/dist/specialIcons.d.ts +39 -0
  120. package/dist/specialIcons.d.ts.map +1 -0
  121. package/dist/ui/ModernSelect.d.ts.map +1 -1
  122. package/dist/ui/selectSearch.d.ts +3 -0
  123. package/dist/ui/selectSearch.d.ts.map +1 -1
  124. package/dist/viewer/MapViewer.d.ts +14 -1
  125. package/dist/viewer/MapViewer.d.ts.map +1 -1
  126. package/dist/viewer/camera.d.ts +82 -1
  127. package/dist/viewer/camera.d.ts.map +1 -1
  128. package/dist/viewer/components/CameraRig.d.ts +18 -1
  129. package/dist/viewer/components/CameraRig.d.ts.map +1 -1
  130. package/dist/viewer/components/LevelMeshes.d.ts +15 -4
  131. package/dist/viewer/components/LevelMeshes.d.ts.map +1 -1
  132. package/dist/viewer/components/MapScene.d.ts +10 -4
  133. package/dist/viewer/components/MapScene.d.ts.map +1 -1
  134. package/dist/viewer/components/OpeningWell.d.ts +7 -0
  135. package/dist/viewer/components/OpeningWell.d.ts.map +1 -0
  136. package/dist/viewer/components/RouteLine.d.ts.map +1 -1
  137. package/dist/viewer/components/SvgVectorLayer.d.ts +3 -1
  138. package/dist/viewer/components/SvgVectorLayer.d.ts.map +1 -1
  139. package/dist/viewer/components/openingGeometry.d.ts +7 -0
  140. package/dist/viewer/components/openingGeometry.d.ts.map +1 -0
  141. package/dist/viewer/index.css +151 -19
  142. package/dist/viewer/index.js +3 -3
  143. package/dist/viewer/pointer.d.ts +26 -0
  144. package/dist/viewer/pointer.d.ts.map +1 -0
  145. package/dist/viewer/ui/MapControls.d.ts.map +1 -1
  146. package/dist/viewer/ui/RuntimeChrome.d.ts.map +1 -1
  147. package/package.json +4 -2
  148. package/dist/chunks/graph-tools.js +0 -246
  149. package/dist/chunks/graph-tools.js.map +0 -1
@@ -1,6 +1,24 @@
1
- import Ot from "ngraph.graph";
2
- import Rt from "ngraph.path";
3
- const st = "#E9F7FC", X = {
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 = {
4
22
  "green-area": {
5
23
  fill: "#C4DDAB",
6
24
  renderOrder: 2,
@@ -28,38 +46,69 @@ const st = "#E9F7FC", X = {
28
46
  extrudeHeight: 1
29
47
  },
30
48
  "walking-path": {
31
- fill: st,
49
+ fill: vt,
32
50
  renderOrder: 2,
33
51
  extrudeHeight: 1
34
52
  }
35
53
  };
36
- function at(t) {
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) {
37
68
  return t.toLowerCase().replace(/[-_]+/g, " ").replace(/\s+/g, " ").trim();
38
69
  }
39
- function ot(t) {
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) {
40
75
  if (!t) return null;
41
- const e = at(t);
76
+ const e = Tt(t);
42
77
  if (!e) return null;
43
- const n = Object.keys(X).sort((s, o) => o.length - s.length);
44
- for (const s of n) {
45
- const o = at(s);
46
- if (e === o || e.startsWith(`${o} `) || e === `${o}s` || e.startsWith(`${o}s `)) return X[s];
47
- }
78
+ const n = [...Zt].sort((o, r) => r.length - o.length);
79
+ for (const o of n)
80
+ if (Qt(e, o)) return o;
48
81
  return null;
49
82
  }
50
- function Re(t, e) {
51
- const n = (e == null ? void 0 : e.omitStaticLayers) === !0, s = /* @__PURE__ */ new Set();
52
- for (const o of t) {
53
- const i = o.sourceSvgId;
54
- i && (n && ot(i) || s.add(i));
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));
55
98
  }
56
- return s;
99
+ return o;
57
100
  }
58
- const lt = {
101
+ function Rn(t) {
102
+ return ee(
103
+ t.flatMap((e) => [...e.shapes]),
104
+ { omitStaticLayers: !0 }
105
+ );
106
+ }
107
+ const W = {
59
108
  MAP_STYLE: "2D",
60
109
  MAP_BACKGROUND_COLOR: "#FFFFFF",
61
110
  ACCENT_COLOR: "#2563eb",
62
- STORE_DEFAULT_COLOR: "#e2e8f0",
111
+ STORE_DEFAULT_COLOR: "#b6babe",
63
112
  STORE_TEXT_COLOR: "#1e293b",
64
113
  STORE_HEIGHT: 4,
65
114
  STORE_RADIUS: 0,
@@ -71,87 +120,369 @@ const lt = {
71
120
  OVERLAY_COLOR: "#000000",
72
121
  OVERLAY_OPACITY: 0.15,
73
122
  PARKING_ZONE_COLOR: "#cbd5e1",
74
- GREEN_AREA_COLOR: "#86efac",
75
- WATER_COLOR: "#7dd3fc",
76
- WALKABLE_COLOR: st,
123
+ ...qt(),
77
124
  KIOSK_SIZE: 12,
78
125
  ZOOM_STEP: 0.5,
79
126
  CAMERA_MAX_DISTANCE: 2e3,
80
127
  CAMERA_MIN_DISTANCE: 50
81
- }, Nt = "#f5f5f5", _t = /* @__PURE__ */ new Set(["#f8fafc", "#f1efea"]), Et = 500;
82
- function It(t) {
128
+ }, ne = "#f5f5f5", oe = /* @__PURE__ */ new Set(["#f8fafc", "#f1efea"]), re = "#86efac", ie = "#7dd3fc", se = "#e2e8f0", ce = 500;
129
+ function wt(t) {
83
130
  const e = typeof t == "number" ? t : Number(t);
84
- return !Number.isFinite(e) || e <= 0 ? 0 : Math.min(e, Et);
131
+ return !Number.isFinite(e) || e <= 0 ? 0 : Math.min(e, ce);
85
132
  }
86
- function Pt(...t) {
87
- const e = Object.assign({}, lt, ...t.filter(Boolean));
88
- return e.MAP_BACKGROUND_COLOR.toLowerCase() === Nt && (e.MAP_BACKGROUND_COLOR = lt.MAP_BACKGROUND_COLOR), _t.has(e.WALKABLE_COLOR.toLowerCase()) && (e.WALKABLE_COLOR = st), e.STORE_RADIUS = It(e.STORE_RADIUS), e;
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;
89
136
  }
90
- const Tt = [
137
+ const le = [
91
138
  "unit",
92
139
  "amenity",
93
140
  "kiosk_screen",
94
141
  "connector",
95
142
  "entrance",
96
143
  "parking_zone"
97
- ], tt = 1e4, Ne = 2.5;
98
- function _e(t) {
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;
148
+ }
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) {
99
440
  return t === "PORTAL" ? "editor" : "viewer";
100
441
  }
101
- const Dt = {
102
- search: !0,
103
- amenities: !0,
442
+ const rt = {
443
+ search: !1,
444
+ amenities: !1,
104
445
  floors: !0,
105
446
  zoomReset: !0,
106
447
  kioskOrigin: !1,
107
448
  fetchDraft: !1
108
- }, Ft = {
109
- WEBSITE: Dt,
449
+ }, Le = {
450
+ /** v1 WP_SITE / MapBox HOST WEBSITE. */
451
+ WEBSITE: rt,
110
452
  /** Assign mode: click shapes, no public directory chrome. */
111
- PORTAL_ASSIGN: {
112
- search: !1,
113
- amenities: !1,
114
- floors: !0,
115
- zoomReset: !0,
116
- kioskOrigin: !1,
117
- fetchDraft: !1
118
- },
453
+ PORTAL_ASSIGN: rt,
119
454
  DISPLAY_APP: {
120
- search: !1,
121
- amenities: !1,
122
- floors: !0,
123
- zoomReset: !0,
124
- kioskOrigin: !0,
125
- fetchDraft: !1
455
+ ...rt,
456
+ kioskOrigin: !0
126
457
  }
127
458
  };
128
- function Ee(t) {
129
- return Ft[t];
459
+ function eo(t) {
460
+ return Le[t];
130
461
  }
131
- function Pe(t) {
462
+ function no(t) {
132
463
  return t !== "PORTAL";
133
464
  }
134
- function Te(t, e) {
465
+ function oo(t, e) {
135
466
  return e ? e + encodeURIComponent(t) : t;
136
467
  }
137
- function De(t, e) {
468
+ function ro(t, e) {
138
469
  return t.map((n) => ({ x: n.x, y: e - n.y }));
139
470
  }
140
- function P(t, e) {
141
- const n = t.x - e.x, s = t.y - e.y;
142
- return Math.hypot(n, s);
471
+ function w(t, e) {
472
+ const n = t.x - e.x, o = t.y - e.y;
473
+ return Math.hypot(n, o);
143
474
  }
144
- function Yt(t) {
475
+ function Oe(t) {
145
476
  if (t.length === 0)
146
477
  return { minX: 0, minY: 0, maxX: 0, maxY: 0 };
147
- let e = t[0].x, n = t[0].y, s = t[0].x, o = t[0].y;
148
- for (let i = 1; i < t.length; i++) {
149
- const u = t[i];
150
- u.x < e && (e = u.x), u.y < n && (n = u.y), u.x > s && (s = u.x), u.y > o && (o = u.y);
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);
151
482
  }
152
- return { minX: e, minY: n, maxX: s, maxY: o };
483
+ return { minX: e, minY: n, maxX: o, maxY: r };
153
484
  }
154
- function Fe(t, e) {
485
+ function io(t, e) {
155
486
  return {
156
487
  minX: Math.min(t.minX, e.minX),
157
488
  minY: Math.min(t.minY, e.minY),
@@ -159,286 +490,286 @@ function Fe(t, e) {
159
490
  maxY: Math.max(t.maxY, e.maxY)
160
491
  };
161
492
  }
162
- function $t(t) {
493
+ function Me(t) {
163
494
  if (t.length === 0) return { x: 0, y: 0 };
164
495
  let e = 0, n = 0;
165
- for (const s of t)
166
- e += s.x, n += s.y;
496
+ for (const o of t)
497
+ e += o.x, n += o.y;
167
498
  return { x: e / t.length, y: n / t.length };
168
499
  }
169
- function Bt(t, e) {
500
+ function Ee(t, e) {
170
501
  let n = !1;
171
- for (let s = 0, o = e.length - 1; s < e.length; o = s++) {
172
- const i = e[s].x, u = e[s].y, c = e[o].x, r = e[o].y;
173
- u > t.y != r > t.y && t.x < (c - i) * (t.y - u) / (r - u + Number.EPSILON) + i && (n = !n);
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);
174
505
  }
175
506
  return n;
176
507
  }
177
- function Ye(t, e) {
178
- return e.some((n) => Bt(t, n));
508
+ function so(t, e) {
509
+ return e.some((n) => Ee(t, n));
179
510
  }
180
- function Wt(t, e, n) {
181
- const s = n.x - e.x, o = n.y - e.y, i = s * s + o * o;
182
- if (i === 0)
183
- return { point: { ...e }, t: 0, distance: P(t, e) };
184
- let u = ((t.x - e.x) * s + (t.y - e.y) * o) / i;
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;
185
516
  u = Math.max(0, Math.min(1, u));
186
- const c = { x: e.x + u * s, y: e.y + u * o };
187
- return { point: c, t: u, distance: P(t, c) };
517
+ const a = { x: e.x + u * o, y: e.y + u * r };
518
+ return { point: a, t: u, distance: w(t, a) };
188
519
  }
189
- function $e(t, e) {
520
+ function co(t, e) {
190
521
  if (e.length < 2) return null;
191
522
  let n = null;
192
- for (let s = 0; s < e.length - 1; s++) {
193
- const o = Wt(t, e[s], e[s + 1]);
194
- (!n || o.distance < n.distance) && (n = { point: o.point, segmentIndex: s, distance: o.distance });
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 });
195
526
  }
196
527
  return n;
197
528
  }
198
- function ut(t, e, n, s, o = 8) {
199
- const i = [];
200
- for (let u = 0; u <= o; u++) {
201
- const c = u / o, r = 1 - c;
202
- i.push({
203
- x: r * r * r * t.x + 3 * r * r * c * e.x + 3 * r * c * c * n.x + c * c * c * s.x,
204
- y: r * r * r * t.y + 3 * r * r * c * e.y + 3 * r * c * c * n.y + c * c * c * s.y
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
205
536
  });
206
537
  }
207
- return i;
208
- }
209
- function ft(t, e, n, s = 6) {
210
- const o = [];
211
- for (let i = 0; i <= s; i++) {
212
- const u = i / s, c = 1 - u;
213
- o.push({
214
- x: c * c * t.x + 2 * c * u * e.x + u * u * n.x,
215
- y: c * c * t.y + 2 * c * u * e.y + u * u * n.y
538
+ return s;
539
+ }
540
+ function kt(t, e, n, o = 6) {
541
+ const r = [];
542
+ for (let s = 0; s <= o; s++) {
543
+ const u = s / o, a = 1 - u;
544
+ r.push({
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
216
547
  });
217
548
  }
218
- return o;
549
+ return r;
219
550
  }
220
- const Xt = 8;
221
- function Gt(t, e, n, s, o, i, u) {
551
+ const ve = 8;
552
+ function Ne(t, e, n, o, r, s, u) {
222
553
  if (t.x === u.x && t.y === u.y) return [{ ...t }];
223
- let c = Math.abs(e), r = Math.abs(n);
224
- if (c === 0 || r === 0 || !Number.isFinite(c) || !Number.isFinite(r))
554
+ let a = Math.abs(e), i = Math.abs(n);
555
+ if (a === 0 || i === 0 || !Number.isFinite(a) || !Number.isFinite(i))
225
556
  return [{ ...t }, { ...u }];
226
- const m = s % 360 * Math.PI / 180, y = Math.cos(m), l = Math.sin(m), k = (t.x - u.x) / 2, a = (t.y - u.y) / 2, d = y * k + l * a, f = -l * k + y * a, h = d * d / (c * c) + f * f / (r * r);
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);
227
558
  if (h > 1) {
228
- const _ = Math.sqrt(h);
229
- c *= _, r *= _;
559
+ const N = Math.sqrt(h);
560
+ a *= N, i *= N;
230
561
  }
231
- const p = c * c, b = r * r, x = p * b - p * f * f - b * d * d, g = p * f * f + b * d * d, I = Math.sqrt(Math.max(0, x / g)) * (o === i ? -1 : 1), v = I * c * f / r, M = -I * r * d / c, S = y * v - l * M + (t.x + u.x) / 2, L = l * v + y * M + (t.y + u.y) / 2, C = (d - v) / c, T = (f - M) / r, R = (-d - v) / c, D = (-f - M) / r, $ = Math.atan2(T, C);
232
- let w = Math.atan2(C * D - T * R, C * R + T * D);
233
- !i && w > 0 ? w -= 2 * Math.PI : i && w < 0 && (w += 2 * Math.PI);
234
- const A = Math.abs(w) / (Math.PI / 2) * Xt, F = Math.max(1, Math.round(A)), N = [{ ...t }];
235
- for (let _ = 1; _ <= F; _++) {
236
- const W = $ + w * _ / F, z = Math.cos(W), H = Math.sin(W);
237
- N.push({
238
- x: S + c * y * z - r * l * H,
239
- y: L + c * l * z + r * y * H
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
240
571
  });
241
572
  }
242
- return N[N.length - 1] = { ...u }, N;
573
+ return v[v.length - 1] = { ...u }, v;
243
574
  }
244
- const zt = /[\s,]/;
245
- function Mt(t) {
575
+ const Te = /[\s,]/;
576
+ function Dt(t) {
246
577
  const e = [];
247
- let n = 0, s = "", o = 0;
578
+ let n = 0, o = "", r = 0;
248
579
  for (; n < t.length; ) {
249
- const i = t[n];
250
- if (zt.test(i)) {
580
+ const s = t[n];
581
+ if (Te.test(s)) {
251
582
  n++;
252
583
  continue;
253
584
  }
254
- if (i >= "a" && i <= "z" || i >= "A" && i <= "Z") {
255
- s = i, o = 0, e.push(i), n++;
585
+ if (s >= "a" && s <= "z" || s >= "A" && s <= "Z") {
586
+ o = s, r = 0, e.push(s), n++;
256
587
  continue;
257
588
  }
258
- const u = s === "A" || s === "a" ? o % 7 : -1;
259
- if ((u === 3 || u === 4) && (i === "0" || i === "1")) {
260
- e.push(i), n++, o++;
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++;
261
592
  continue;
262
593
  }
263
- const c = n;
264
- let r = 0;
265
- for ((i === "+" || i === "-") && n++; n < t.length && t[n] >= "0" && t[n] <= "9"; )
266
- n++, r++;
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++;
267
598
  if (t[n] === ".")
268
599
  for (n++; n < t.length && t[n] >= "0" && t[n] <= "9"; )
269
- n++, r++;
270
- if (r > 0 && (t[n] === "e" || t[n] === "E")) {
271
- const m = n;
600
+ n++, i++;
601
+ if (i > 0 && (t[n] === "e" || t[n] === "E")) {
602
+ const y = n;
272
603
  if (n++, (t[n] === "+" || t[n] === "-") && n++, n < t.length && t[n] >= "0" && t[n] <= "9")
273
604
  for (; n < t.length && t[n] >= "0" && t[n] <= "9"; ) n++;
274
605
  else
275
- n = m;
606
+ n = y;
276
607
  }
277
- if (r === 0) {
278
- n = c + 1;
608
+ if (i === 0) {
609
+ n = a + 1;
279
610
  continue;
280
611
  }
281
- e.push(t.slice(c, n)), o++;
612
+ e.push(t.slice(a, n)), r++;
282
613
  }
283
614
  return e;
284
615
  }
285
- function vt(t) {
286
- const e = Mt(t), n = [];
287
- let s = [], o = 0, i = 0, u = 0, c = 0, r = null, m = 0, y = "";
288
- const l = () => Number(e[m++]);
289
- for (; m < e.length; ) {
290
- const k = e[m];
291
- switch (/[a-zA-Z]/.test(k) && (y = k, m++), y) {
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) {
292
623
  case "M":
293
624
  case "m": {
294
- const a = y === "m", d = l(), f = l();
295
- o = a ? o + d : d, i = a ? i + f : f, s.length > 0 && n.push(s), s = [{ x: o, y: i }], u = o, c = i, r = null, y = a ? "l" : "L";
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";
296
627
  break;
297
628
  }
298
629
  case "L":
299
630
  case "l": {
300
- const a = y === "l", d = l(), f = l();
301
- o = a ? o + d : d, i = a ? i + f : f, s.push({ x: o, y: i }), r = null;
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;
302
633
  break;
303
634
  }
304
635
  case "H":
305
636
  case "h": {
306
- const a = y === "h", d = l();
307
- o = a ? o + d : d, s.push({ x: o, y: i }), r = null;
637
+ const c = p === "h", d = l();
638
+ r = c ? r + d : d, o.push({ x: r, y: s }), i = null;
308
639
  break;
309
640
  }
310
641
  case "V":
311
642
  case "v": {
312
- const a = y === "v", d = l();
313
- i = a ? i + d : d, s.push({ x: o, y: i }), r = null;
643
+ const c = p === "v", d = l();
644
+ s = c ? s + d : d, o.push({ x: r, y: s }), i = null;
314
645
  break;
315
646
  }
316
647
  case "C":
317
648
  case "c": {
318
- const a = y === "c", d = a ? o + l() : l(), f = a ? i + l() : l(), h = a ? o + l() : l(), p = a ? i + l() : l(), b = a ? o + l() : l(), x = a ? i + l() : l(), g = ut(
319
- { x: o, y: i },
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 },
320
651
  { x: d, y: f },
321
- { x: h, y: p },
652
+ { x: h, y: m },
322
653
  { x: b, y: x }
323
654
  );
324
- s.push(...g.slice(1)), r = { x: h, y: p }, o = b, i = x;
655
+ o.push(...g.slice(1)), i = { x: h, y: m }, r = b, s = x;
325
656
  break;
326
657
  }
327
658
  case "Q":
328
659
  case "q": {
329
- const a = y === "q", d = a ? o + l() : l(), f = a ? i + l() : l(), h = a ? o + l() : l(), p = a ? i + l() : l(), b = ft(
330
- { x: o, y: i },
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 },
331
662
  { x: d, y: f },
332
- { x: h, y: p }
663
+ { x: h, y: m }
333
664
  );
334
- s.push(...b.slice(1)), r = { x: d, y: f }, o = h, i = p;
665
+ o.push(...b.slice(1)), i = { x: d, y: f }, r = h, s = m;
335
666
  break;
336
667
  }
337
668
  case "S":
338
669
  case "s": {
339
- const a = y === "s", d = r ? 2 * o - r.x : o, f = r ? 2 * i - r.y : i, h = a ? o + l() : l(), p = a ? i + l() : l(), b = a ? o + l() : l(), x = a ? i + l() : l(), g = ut(
340
- { x: o, y: i },
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 },
341
672
  { x: d, y: f },
342
- { x: h, y: p },
673
+ { x: h, y: m },
343
674
  { x: b, y: x }
344
675
  );
345
- s.push(...g.slice(1)), r = { x: h, y: p }, o = b, i = x;
676
+ o.push(...g.slice(1)), i = { x: h, y: m }, r = b, s = x;
346
677
  break;
347
678
  }
348
679
  case "T":
349
680
  case "t": {
350
- const a = y === "t", d = r ? 2 * o - r.x : o, f = r ? 2 * i - r.y : i, h = a ? o + l() : l(), p = a ? i + l() : l(), b = ft(
351
- { x: o, y: i },
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 },
352
683
  { x: d, y: f },
353
- { x: h, y: p }
684
+ { x: h, y: m }
354
685
  );
355
- s.push(...b.slice(1)), r = { x: d, y: f }, o = h, i = p;
686
+ o.push(...b.slice(1)), i = { x: d, y: f }, r = h, s = m;
356
687
  break;
357
688
  }
358
689
  case "A":
359
690
  case "a": {
360
- const a = y === "a", d = l(), f = l(), h = l(), p = l() !== 0, b = l() !== 0, x = a ? o + l() : l(), g = a ? i + l() : l(), I = Gt(
361
- { x: o, y: i },
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 },
362
693
  d,
363
694
  f,
364
695
  h,
365
- p,
696
+ m,
366
697
  b,
367
698
  { x, y: g }
368
699
  );
369
- s.push(...I.slice(1)), r = null, o = x, i = g;
700
+ o.push(...I.slice(1)), i = null, r = x, s = g;
370
701
  break;
371
702
  }
372
703
  case "Z":
373
704
  case "z": {
374
- s.push({ x: u, y: c }), n.push(s), s = [], o = u, i = c, r = null;
705
+ o.push({ x: u, y: a }), n.push(o), o = [], r = u, s = a, i = null;
375
706
  break;
376
707
  }
377
708
  default:
378
- m++;
709
+ y++;
379
710
  break;
380
711
  }
381
712
  }
382
- return s.length > 0 && n.push(s), n;
713
+ return o.length > 0 && n.push(o), n;
383
714
  }
384
- function Ht(t) {
715
+ function we(t) {
385
716
  const e = t.match(
386
717
  /^\s*M\s*(-?\d*\.?\d+(?:e[-+]?\d+)?)[\s,]+(-?\d*\.?\d+(?:e[-+]?\d+)?)/i
387
718
  );
388
719
  if (!e) return null;
389
- const n = Number(e[1]), s = Number(e[2]);
390
- return Number.isFinite(n) && Number.isFinite(s) ? { x: n, y: s } : null;
720
+ const n = Number(e[1]), o = Number(e[2]);
721
+ return Number.isFinite(n) && Number.isFinite(o) ? { x: n, y: o } : null;
391
722
  }
392
- function Kt(t) {
393
- var o, i;
394
- const e = (o = t.paths[0]) == null ? void 0 : o.d;
723
+ function Pe(t) {
724
+ var r, s;
725
+ const e = (r = t.paths[0]) == null ? void 0 : r.d;
395
726
  if (!e || t.polygons.length === 0) return !1;
396
- const n = Ht(e), s = (i = t.polygons[0]) == null ? void 0 : i[0];
397
- return !n || !s ? !1 : Math.abs(n.x - s.x) > 0.01 || Math.abs(n.y - s.y) > 0.01;
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;
398
729
  }
399
- function St(t) {
400
- if (!Kt(t)) return t;
401
- const e = t.paths.flatMap((n) => vt(n.d));
730
+ function Xt(t) {
731
+ if (!Pe(t)) return t;
732
+ const e = t.paths.flatMap((n) => Bt(n.d));
402
733
  return e.length === 0 ? t : { paths: t.paths, polygons: e };
403
734
  }
404
- function Ut(t) {
405
- const e = t.map((s) => ({
406
- d: s,
407
- closed: /z/i.test(s)
408
- })), n = t.flatMap((s) => vt(s));
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));
409
740
  return { paths: e, polygons: n };
410
741
  }
411
- function it(t) {
742
+ function xt(t) {
412
743
  const e = t.polygons.flat();
413
- return Yt(e);
744
+ return Oe(e);
414
745
  }
415
- function Vt(t) {
416
- return $t(t.polygons.flat());
746
+ function Ye(t) {
747
+ return Me(t.polygons.flat());
417
748
  }
418
- function Be(t, e, n = 0, s = [15, 45, 90]) {
419
- const o = e.x - t.x, i = e.y - t.y, u = Math.hypot(o, i);
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);
420
751
  if (u === 0) return { ...e };
421
- const r = Math.atan2(i, o) * 180 / Math.PI - n;
422
- let m = r, y = 1 / 0;
423
- for (const k of s) {
424
- const a = Math.round(r / k) * k, d = Math.abs(r - a);
425
- d < y && (y = d, m = a);
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);
426
757
  }
427
- const l = (m + n) * Math.PI / 180;
758
+ const l = (y + n) * Math.PI / 180;
428
759
  return {
429
760
  x: t.x + Math.cos(l) * u,
430
761
  y: t.y + Math.sin(l) * u
431
762
  };
432
763
  }
433
- function We(t, e) {
764
+ function lo(t, e) {
434
765
  return Math.atan2(e.y - t.y, e.x - t.x) * 180 / Math.PI;
435
766
  }
436
- function jt(t) {
767
+ function De(t) {
437
768
  if (!t) return null;
438
769
  const e = t.trim().split(/[\s,]+/).map(Number);
439
770
  return e.length !== 4 || e.some((n) => Number.isNaN(n)) ? null : { x: e[0], y: e[1], width: e[2], height: e[3] };
440
771
  }
441
- const Zt = {
772
+ const Be = {
442
773
  fill: "fill",
443
774
  "fill-opacity": "fill-opacity",
444
775
  stroke: "stroke",
@@ -446,68 +777,68 @@ const Zt = {
446
777
  "stroke-opacity": "stroke-opacity",
447
778
  opacity: "opacity"
448
779
  };
449
- function qt(t) {
780
+ function Xe(t) {
450
781
  const e = {};
451
782
  for (const n of t.split(";")) {
452
- const s = n.indexOf(":");
453
- if (s === -1) continue;
454
- const o = n.slice(0, s).trim().toLowerCase(), i = n.slice(s + 1).trim();
455
- o && i && (e[o] = i);
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);
456
787
  }
457
788
  return e;
458
789
  }
459
- function Qt(t) {
790
+ function Ge(t) {
460
791
  const e = /* @__PURE__ */ new Map(), n = t.replace(/\/\*[\s\S]*?\*\//g, "");
461
- for (const s of n.matchAll(/([^{]+)\{([^}]*)\}/g)) {
462
- const o = s[1].split(",").map((u) => u.trim()), i = qt(s[2]);
463
- for (const u of o) {
464
- const c = u.match(/^\.([a-zA-Z0-9_-]+)$/);
465
- if (!c) continue;
466
- const r = c[1];
467
- e.set(r, {
468
- ...e.get(r) || {},
469
- ...i
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
470
801
  });
471
802
  }
472
803
  }
473
804
  return e;
474
805
  }
475
- function Jt(t, e) {
806
+ function Ke(t, e) {
476
807
  const n = {};
477
- for (const s of t.split(/\s+/).map((o) => o.trim()).filter(Boolean))
478
- Object.assign(n, e.get(s) || {});
808
+ for (const o of t.split(/\s+/).map((r) => r.trim()).filter(Boolean))
809
+ Object.assign(n, e.get(o) || {});
479
810
  return n;
480
811
  }
481
- function te(t) {
812
+ function $e(t) {
482
813
  const e = [], n = t.replace(/<!--[\s\S]*?-->/g, "");
483
- for (const o of n.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi))
484
- e.push(o[1]);
814
+ for (const r of n.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi))
815
+ e.push(r[1]);
485
816
  if (e.length === 0) return t;
486
- const s = /* @__PURE__ */ new Map();
487
- for (const o of e)
488
- for (const [i, u] of Qt(o))
489
- s.set(i, { ...s.get(i) || {}, ...u });
490
- return s.size === 0 ? t : t.replace(
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(
491
822
  /<(path|polygon|polyline|line|rect|g|circle|ellipse)\b([^>]*)>/gi,
492
- (o, i, u) => {
493
- const c = /\/\s*$/.test(u), r = u.replace(/\/\s*$/, ""), m = r.match(/\bclass\s*=\s*["']([^"']*)["']/i);
494
- if (!m) return o;
495
- const y = Jt(m[1], s);
496
- let l = r;
497
- for (const [k, a] of Object.entries(y)) {
498
- const d = Zt[k];
499
- d && (new RegExp(`\\b${d}\\s*=`, "i").test(l) || (l += ` ${d}="${a}"`));
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}"`));
500
831
  }
501
- return `<${i}${l}${c ? " /" : ""}>`;
832
+ return `<${s}${l}${a ? " /" : ""}>`;
502
833
  }
503
834
  );
504
835
  }
505
- function dt(t) {
506
- var c, r, m, y, l;
507
- const e = {}, n = (c = t.match(/\bfill\s*=\s*["']([^"']*)["']/i)) == null ? void 0 : c[1], s = (r = t.match(/\bstroke\s*=\s*["']([^"']*)["']/i)) == null ? void 0 : r[1], o = (m = t.match(/\bstroke-width\s*=\s*["']?(-?[\d.]+)/i)) == null ? void 0 : m[1], i = (y = t.match(/\bopacity\s*=\s*["']?(-?[\d.]+)/i)) == null ? void 0 : y[1], u = (l = t.match(/\bfill-opacity\s*=\s*["']?(-?[\d.]+)/i)) == null ? void 0 : l[1];
508
- return n && n.toLowerCase() !== "none" && (e.fill = n), s && s.toLowerCase() !== "none" && (e.stroke = s), o != null && !Number.isNaN(Number(o)) && (e.strokeWidth = Number(o)), i != null && !Number.isNaN(Number(i)) ? e.opacity = Number(i) : u != null && !Number.isNaN(Number(u)) && (e.opacity = Number(u)), e;
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;
509
840
  }
510
- function j(t, e) {
841
+ function it(t, e) {
511
842
  return {
512
843
  fill: e.fill ?? t.fill,
513
844
  stroke: e.stroke ?? t.stroke,
@@ -515,8 +846,8 @@ function j(t, e) {
515
846
  opacity: e.opacity ?? t.opacity
516
847
  };
517
848
  }
518
- const et = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 };
519
- function G(t, e) {
849
+ const ft = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 };
850
+ function H(t, e) {
520
851
  return {
521
852
  a: t.a * e.a + t.c * e.b,
522
853
  b: t.b * e.a + t.d * e.b,
@@ -526,41 +857,41 @@ function G(t, e) {
526
857
  f: t.b * e.e + t.d * e.f + t.f
527
858
  };
528
859
  }
529
- function ee(t, e) {
860
+ function ze(t, e) {
530
861
  return {
531
862
  x: t.a * e.x + t.c * e.y + t.e,
532
863
  y: t.b * e.x + t.d * e.y + t.f
533
864
  };
534
865
  }
535
- function ne(t, e = 1e-9) {
866
+ function We(t, e = 1e-9) {
536
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;
537
868
  }
538
- function Z(t, e) {
869
+ function st(t, e) {
539
870
  return { a: 1, b: 0, c: 0, d: 1, e: t, f: e };
540
871
  }
541
- function se(t) {
542
- const e = t * Math.PI / 180, n = Math.cos(e), s = Math.sin(e);
543
- return { a: n, b: s, c: -s, d: n, e: 0, f: 0 };
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 };
544
875
  }
545
- function oe(t, e) {
876
+ function He(t, e) {
546
877
  switch (t) {
547
878
  case "matrix":
548
879
  return e.length < 6 ? null : { a: e[0], b: e[1], c: e[2], d: e[3], e: e[4], f: e[5] };
549
880
  case "translate":
550
- return e.length < 1 ? null : Z(e[0], e[1] ?? 0);
881
+ return e.length < 1 ? null : st(e[0], e[1] ?? 0);
551
882
  case "scale": {
552
883
  if (e.length < 1) return null;
553
- const n = e[0], s = e[1] ?? n;
554
- return { a: n, b: 0, c: 0, d: s, e: 0, f: 0 };
884
+ const n = e[0], o = e[1] ?? n;
885
+ return { a: n, b: 0, c: 0, d: o, e: 0, f: 0 };
555
886
  }
556
887
  case "rotate": {
557
888
  if (e.length < 1) return null;
558
- const n = se(e[0]);
889
+ const n = Ue(e[0]);
559
890
  if (e.length < 3) return n;
560
- const s = e[1], o = e[2];
561
- return G(
562
- G(Z(s, o), n),
563
- Z(-s, -o)
891
+ const o = e[1], r = e[2];
892
+ return H(
893
+ H(st(o, r), n),
894
+ st(-o, -r)
564
895
  );
565
896
  }
566
897
  case "skewx":
@@ -571,114 +902,114 @@ function oe(t, e) {
571
902
  return null;
572
903
  }
573
904
  }
574
- const ht = /([a-zA-Z]+)\s*\(([^)]*)\)/g;
575
- function xt(t) {
576
- if (!t) return et;
577
- let e = et;
578
- ht.lastIndex = 0;
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;
579
910
  let n;
580
- for (; (n = ht.exec(t)) !== null; ) {
581
- const s = n[1].toLowerCase(), o = n[2].trim().split(/[\s,]+/).filter(Boolean).map(Number);
582
- if (o.some((u) => Number.isNaN(u))) continue;
583
- const i = oe(s, o);
584
- i && (e = G(e, i));
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));
585
916
  }
586
917
  return e;
587
918
  }
588
- function B(t) {
919
+ function K(t) {
589
920
  if (!Number.isFinite(t)) return "0";
590
921
  const e = Math.round(t * 1e4) / 1e4;
591
922
  return Object.is(e, -0) ? "0" : String(e);
592
923
  }
593
- function ie(t, e, n, s) {
594
- const o = s * Math.PI / 180, i = Math.cos(o), u = Math.sin(o), c = i * e, r = u * e, m = -u * n, y = i * n, l = t.a * c + t.c * r, k = t.b * c + t.d * r, a = t.a * m + t.c * y, d = t.b * m + t.d * y, f = (l + d) / 2, h = (l - d) / 2, p = (k + a) / 2, b = (k - a) / 2, x = Math.hypot(f, b), g = Math.hypot(h, p), I = Math.abs(x + g), v = Math.abs(x - g), M = Math.atan2(p, h), L = (Math.atan2(b, f) + M) / 2 * (180 / Math.PI);
595
- return { rx: I, ry: v, phiDeg: L };
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 };
596
927
  }
597
- function re(t, e) {
598
- if (!t || ne(e)) return t;
599
- const n = Mt(t), s = [], o = e.a * e.d - e.b * e.c < 0;
600
- let i = 0, u = "", c = 0, r = 0, m = 0, y = 0;
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;
601
932
  const l = () => {
602
- const d = Number(n[i++]);
933
+ const d = Number(n[s++]);
603
934
  return Number.isNaN(d) ? 0 : d;
604
935
  }, k = (d, ...f) => {
605
- s.push(d + (f.length ? " " + f.map(B).join(" ") : ""));
606
- }, a = (d, f) => {
607
- const h = ee(e, { x: d, y: f });
936
+ o.push(d + (f.length ? " " + f.map(K).join(" ") : ""));
937
+ }, c = (d, f) => {
938
+ const h = ze(e, { x: d, y: f });
608
939
  return [h.x, h.y];
609
940
  };
610
- for (; i < n.length; ) {
611
- const d = n[i];
612
- switch (/[a-zA-Z]/.test(d) && (u = d, i++), u) {
941
+ for (; s < n.length; ) {
942
+ const d = n[s];
943
+ switch (/[a-zA-Z]/.test(d) && (u = d, s++), u) {
613
944
  case "M":
614
945
  case "m": {
615
- const f = u === "m", h = l(), p = l();
616
- c = f ? c + h : h, r = f ? r + p : p, m = c, y = r, k("M", ...a(c, r)), u = f ? "l" : "L";
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";
617
948
  break;
618
949
  }
619
950
  case "L":
620
951
  case "l": {
621
- const f = u === "l", h = l(), p = l();
622
- c = f ? c + h : h, r = f ? r + p : p, k("L", ...a(c, r));
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));
623
954
  break;
624
955
  }
625
956
  case "H":
626
957
  case "h": {
627
958
  const f = u === "h", h = l();
628
- c = f ? c + h : h, k("L", ...a(c, r));
959
+ a = f ? a + h : h, k("L", ...c(a, i));
629
960
  break;
630
961
  }
631
962
  case "V":
632
963
  case "v": {
633
964
  const f = u === "v", h = l();
634
- r = f ? r + h : h, k("L", ...a(c, r));
965
+ i = f ? i + h : h, k("L", ...c(a, i));
635
966
  break;
636
967
  }
637
968
  case "C":
638
969
  case "c": {
639
- const f = u === "c", h = f ? c + l() : l(), p = f ? r + l() : l(), b = f ? c + l() : l(), x = f ? r + l() : l(), g = f ? c + l() : l(), I = f ? r + l() : l();
640
- k("C", ...a(h, p), ...a(b, x), ...a(g, I)), c = g, r = I;
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;
641
972
  break;
642
973
  }
643
974
  case "S":
644
975
  case "s": {
645
- const f = u === "s", h = f ? c + l() : l(), p = f ? r + l() : l(), b = f ? c + l() : l(), x = f ? r + l() : l();
646
- k("S", ...a(h, p), ...a(b, x)), c = b, r = x;
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;
647
978
  break;
648
979
  }
649
980
  case "Q":
650
981
  case "q": {
651
- const f = u === "q", h = f ? c + l() : l(), p = f ? r + l() : l(), b = f ? c + l() : l(), x = f ? r + l() : l();
652
- k("Q", ...a(h, p), ...a(b, x)), c = b, r = x;
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;
653
984
  break;
654
985
  }
655
986
  case "T":
656
987
  case "t": {
657
- const f = u === "t", h = f ? c + l() : l(), p = f ? r + l() : l();
658
- k("T", ...a(h, p)), c = h, r = p;
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;
659
990
  break;
660
991
  }
661
992
  case "A":
662
993
  case "a": {
663
- const f = u === "a", h = l(), p = l(), b = l(), x = l(), g = l(), I = f ? c + l() : l(), v = f ? r + l() : l(), M = ie(e, h, p, b), [S, L] = a(I, v);
664
- s.push(
665
- `A ${B(M.rx)} ${B(M.ry)} ${B(M.phiDeg)} ${x ? 1 : 0} ${(g ? 1 : 0) ^ (o ? 1 : 0)} ${B(S)} ${B(L)}`
666
- ), c = I, r = v;
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;
667
998
  break;
668
999
  }
669
1000
  case "Z":
670
1001
  case "z": {
671
- s.push("Z"), c = m, r = y;
1002
+ o.push("Z"), a = y, i = p;
672
1003
  break;
673
1004
  }
674
1005
  default:
675
- i++;
1006
+ s++;
676
1007
  break;
677
1008
  }
678
1009
  }
679
- return s.join(" ");
1010
+ return o.join(" ");
680
1011
  }
681
- const ce = [
1012
+ const je = [
682
1013
  { prefix: "walkable", kind: "walkable" },
683
1014
  { prefix: "void", kind: "void" },
684
1015
  { prefix: "unit", kind: "unit" },
@@ -706,7 +1037,7 @@ const ce = [
706
1037
  { prefix: "parking-icon", kind: "parking_icon" },
707
1038
  { prefix: "walking-path", kind: "walkable" },
708
1039
  { prefix: "water", kind: "water" }
709
- ], ae = [
1040
+ ], qe = [
710
1041
  { prefix: "parking-zone", kind: "parking_zone" },
711
1042
  { prefix: "parking-lane", kind: "parking_zone" },
712
1043
  { prefix: "parking-line", kind: "decor" },
@@ -728,127 +1059,127 @@ const ce = [
728
1059
  { prefix: "elevator-", kind: "connector" },
729
1060
  { prefix: "stairs-", kind: "connector" }
730
1061
  ];
731
- function nt(t) {
732
- const e = V(t);
1062
+ function dt(t) {
1063
+ const e = tt(t);
733
1064
  return e === "route path" || e.startsWith("route path ");
734
1065
  }
735
- function wt(t) {
736
- const e = V(t);
737
- return e === "routes" || e === "route" || e === "wayfinding" || e === "wayfinding routes" || nt(t);
1066
+ function Gt(t) {
1067
+ const e = tt(t);
1068
+ return e === "routes" || e === "route" || e === "wayfinding" || e === "wayfinding routes" || dt(t);
738
1069
  }
739
- const le = [
740
- ...Tt,
1070
+ const Qe = [
1071
+ ...le,
741
1072
  "walkable",
742
1073
  "void"
743
- ], ue = 8;
744
- function fe(t, e = "floor") {
745
- if (Lt(t))
1074
+ ], Je = 8;
1075
+ function tn(t, e = "floor") {
1076
+ if (zt(t))
746
1077
  return { kind: null, guessed: !1 };
747
- const n = t.toLowerCase(), s = e === "base" ? ae : ce;
748
- for (const { prefix: o, kind: i } of s)
749
- if (n === o || n.startsWith(o))
750
- return { kind: i, guessed: !1 };
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 };
751
1082
  return n.startsWith("interactive") ? { kind: "unit", guessed: !0 } : { kind: null, guessed: !1 };
752
1083
  }
753
- function V(t) {
1084
+ function tt(t) {
754
1085
  return t.toLowerCase().replace(/[-_]+/g, " ").replace(/\s+/g, " ").trim();
755
1086
  }
756
- function rt(t) {
1087
+ function pt(t) {
757
1088
  return /non[-_ ]?interactive/i.test(t);
758
1089
  }
759
- function Ct(t) {
760
- return rt(t) ? !1 : /^interactive( items)?( \d+)?$/.test(V(t));
1090
+ function Kt(t) {
1091
+ return pt(t) ? !1 : /^interactive( items)?( \d+)?$/.test(tt(t));
761
1092
  }
762
- function At(t) {
763
- const e = V(t);
1093
+ function $t(t) {
1094
+ const e = tt(t);
764
1095
  return e === "stores" || e === "store layer" || e === "units" || e === "unit layer";
765
1096
  }
766
- function Lt(t) {
767
- return Ct(t) || rt(t) || At(t) || wt(t);
1097
+ function zt(t) {
1098
+ return Kt(t) || pt(t) || $t(t) || Gt(t);
768
1099
  }
769
- function q(t) {
1100
+ function ct(t) {
770
1101
  return t.interactiveContainer || t.nonInteractiveContainer || t.storeFolder;
771
1102
  }
772
- function E(t, e) {
1103
+ function T(t, e) {
773
1104
  const n = t.match(new RegExp(`\\b${e}\\s*=\\s*["']([^"']*)["']`, "i"));
774
1105
  return n ? n[1] : null;
775
1106
  }
776
- function Y(t, e) {
1107
+ function D(t, e) {
777
1108
  const n = t.match(new RegExp(`\\b${e}\\s*=\\s*["']?(-?[\\d.]+)`, "i"));
778
1109
  return n ? Number(n[1]) : 0;
779
1110
  }
780
- function mt(t) {
1111
+ function At(t) {
781
1112
  return /\bdata-interactive\s*=\s*["']?(true|1|yes)/i.test(t);
782
1113
  }
783
- function de(t) {
784
- return [E(t, "id"), E(t, "data-name")].filter(
1114
+ function en(t) {
1115
+ return [T(t, "id"), T(t, "data-name")].filter(
785
1116
  (e) => !!e
786
1117
  );
787
1118
  }
788
- function he(t) {
789
- return t.some(rt) ? { interactiveContainer: !1, nonInteractiveContainer: !0, storeFolder: !1 } : t.some(Ct) ? { interactiveContainer: !0, nonInteractiveContainer: !1, storeFolder: !1 } : t.some(At) ? { interactiveContainer: !1, nonInteractiveContainer: !1, storeFolder: !0 } : { interactiveContainer: !1, nonInteractiveContainer: !1, storeFolder: !1 };
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 };
790
1121
  }
791
- function xe(t) {
1122
+ function on(t) {
792
1123
  const e = t.trim().split(/[\s,]+/).map(Number);
793
1124
  if (e.length < 4) return "";
794
1125
  let n = `M ${e[0]} ${e[1]}`;
795
- for (let s = 2; s < e.length; s += 2)
796
- n += ` L ${e[s]} ${e[s + 1]}`;
1126
+ for (let o = 2; o < e.length; o += 2)
1127
+ n += ` L ${e[o]} ${e[o + 1]}`;
797
1128
  return n += " Z", n;
798
1129
  }
799
- function me(t, e, n, s) {
800
- return `M ${t} ${e} L ${n} ${s}`;
1130
+ function rn(t, e, n, o) {
1131
+ return `M ${t} ${e} L ${n} ${o}`;
801
1132
  }
802
- function ye(t, e) {
1133
+ function sn(t, e) {
803
1134
  if (t === "path")
804
- return E(e, "d") ?? void 0;
1135
+ return T(e, "d") ?? void 0;
805
1136
  if (t === "polygon" || t === "polyline") {
806
- const n = E(e, "points");
807
- return n ? xe(n) : void 0;
1137
+ const n = T(e, "points");
1138
+ return n ? on(n) : void 0;
808
1139
  }
809
1140
  if (t === "line")
810
- return me(
811
- Y(e, "x1"),
812
- Y(e, "y1"),
813
- Y(e, "x2"),
814
- Y(e, "y2")
1141
+ return rn(
1142
+ D(e, "x1"),
1143
+ D(e, "y1"),
1144
+ D(e, "x2"),
1145
+ D(e, "y2")
815
1146
  );
816
1147
  if (t === "rect") {
817
- const n = Y(e, "x"), s = Y(e, "y"), o = Y(e, "width"), i = Y(e, "height");
818
- return `M ${n} ${s} L ${n + o} ${s} L ${n + o} ${s + i} L ${n} ${s + i} Z`;
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`;
819
1150
  }
820
1151
  }
821
- function pe(t) {
822
- const e = te(t).replace(/<!--[\s\S]*?-->/g, ""), n = e.match(/viewBox\s*=\s*["']([^"']+)["']/i), s = jt(n == null ? void 0 : n[1]), o = [], i = [], u = [], c = [];
823
- let r = 0;
824
- const m = () => c.some((x) => x.routeContainer), y = () => {
825
- for (let g = c.length - 1; g >= 0; g--) {
826
- const I = c[g].style;
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;
827
1158
  if (I.fill || I.stroke || I.strokeWidth != null || I.opacity != null)
828
1159
  break;
829
1160
  }
830
1161
  let x = {};
831
- for (const g of c)
832
- x = j(x, g.style);
1162
+ for (const g of a)
1163
+ x = it(x, g.style);
833
1164
  return x;
834
1165
  }, l = () => {
835
- for (let x = c.length - 1; x >= 0; x--) {
836
- if (c[x].nonInteractiveContainer) return !1;
837
- if (c[x].interactiveContainer || c[x].storeFolder) return !0;
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;
838
1169
  }
839
1170
  return !1;
840
- }, k = () => c.length > 0 ? c[c.length - 1].matrix : et, a = () => {
841
- for (let x = c.length - 1; x >= 0; x--) {
842
- const g = c[x];
843
- if (!q(g) && g.id) {
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) {
844
1175
  g.hasNamedChild = !0;
845
1176
  return;
846
1177
  }
847
1178
  }
848
1179
  }, d = () => {
849
- for (let x = c.length - 1; x >= 0; x--) {
850
- const g = c[x];
851
- if (!q(g) && g.id)
1180
+ for (let x = a.length - 1; x >= 0; x--) {
1181
+ const g = a[x];
1182
+ if (!ct(g) && g.id)
852
1183
  return g;
853
1184
  }
854
1185
  return null;
@@ -857,376 +1188,379 @@ function pe(t) {
857
1188
  for (const g of x.collectedPaths) h("path", g);
858
1189
  return;
859
1190
  }
860
- q(x) || !x.id || x.collectedPaths.length === 0 || (x.hasNamedChild && u.push(
1191
+ ct(x) || !x.id || x.collectedPaths.length === 0 || (x.hasNamedChild && u.push(
861
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`
862
- ), o.push({
1193
+ ), r.push({
863
1194
  id: x.id,
864
1195
  tag: "g",
865
1196
  d: x.collectedPaths.join(" "),
866
1197
  interactive: x.inInteractive,
867
- style: j(y(), x.style)
1198
+ style: it(p(), x.style)
868
1199
  }));
869
1200
  }, h = (x, g) => {
870
1201
  if (!g) return;
871
1202
  const I = x === "polyline" || x === "polygon" || x === "path" ? g.replace(/\s*Z\s*$/i, "") : g;
872
- i.includes(I) || i.push(I);
873
- }, p = /<(\/?)(path|polygon|polyline|line|rect|g)\b([^>]*)(\/?)>/gi;
1203
+ s.includes(I) || s.push(I);
1204
+ }, m = /<(\/?)(path|polygon|polyline|line|rect|g)\b([^>]*)(\/?)>/gi;
874
1205
  let b;
875
- for (; (b = p.exec(e)) !== null; ) {
876
- const x = b[1] === "/", g = b[2].toLowerCase(), I = b[3] ?? "", v = b[4] === "/" || /\/\s*$/.test(I);
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);
877
1208
  if (x) {
878
1209
  if (g === "g") {
879
- const A = c.pop();
880
- A && f(A);
1210
+ const O = a.pop();
1211
+ O && f(O);
881
1212
  }
882
1213
  continue;
883
1214
  }
884
1215
  if (g === "g") {
885
- const A = E(I, "id"), F = de(I), { interactiveContainer: N, nonInteractiveContainer: _, storeFolder: W } = he(F), z = l();
886
- A && a();
887
- const H = {
888
- id: A,
889
- interactiveContainer: N,
890
- nonInteractiveContainer: _,
891
- storeFolder: W,
892
- inInteractive: N || W || mt(I) || z && !_,
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,
893
1224
  collectedPaths: [],
894
- style: dt(I),
895
- matrix: G(k(), xt(E(I, "transform"))),
1225
+ style: It(I),
1226
+ matrix: H(k(), Ct(T(I, "transform"))),
896
1227
  hasNamedChild: !1,
897
- routeContainer: F.some(wt) || m()
1228
+ routeContainer: Y.some(Gt) || y()
898
1229
  };
899
- v || c.push(H);
1230
+ C || a.push(Z);
900
1231
  continue;
901
1232
  }
902
- const M = E(I, "id"), S = ye(g, I), L = G(k(), xt(E(I, "transform"))), C = S && re(S, L), T = mt(I) || l(), R = j(y(), dt(I)), D = E(I, "data-name");
903
- if (M != null && nt(M) || D != null && nt(D) || !M && m()) {
904
- h(g, C);
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);
905
1236
  continue;
906
1237
  }
907
- if (M) {
908
- a(), C && o.push({ id: M, tag: g, d: C, interactive: T, style: R });
1238
+ if (_) {
1239
+ c(), L && r.push({ id: _, tag: g, d: L, interactive: P, style: R });
909
1240
  continue;
910
1241
  }
911
- if (!C) continue;
912
- const w = d();
913
- w ? (w.collectedPaths.push(C), !w.style.fill && R.fill && (w.style = R)) : T && (r += 1, o.push({
914
- id: `interactive-anon-${r}`,
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}`,
915
1246
  tag: g,
916
- d: C,
1247
+ d: L,
917
1248
  interactive: !0,
918
1249
  style: R
919
1250
  }));
920
1251
  }
921
- for (; c.length > 0; )
922
- f(c.pop());
923
- return { viewbox: s, elements: o, routePathDs: i, warnings: u };
1252
+ for (; a.length > 0; )
1253
+ f(a.pop());
1254
+ return { viewbox: o, elements: r, routePathDs: s, warnings: u };
924
1255
  }
925
- function ge(t) {
1256
+ function an(t) {
926
1257
  return t.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 80);
927
1258
  }
928
- function be(t, e) {
929
- var o, i, u, c;
930
- const n = ot(e), s = {};
931
- return n != null && n.fill ? s.fill = n.fill : (o = t.style) != null && o.fill && (s.fill = t.style.fill), n != null && n.stroke ? s.stroke = n.stroke : (i = t.style) != null && i.stroke && (s.stroke = t.style.stroke), (n == null ? void 0 : n.strokeWidth) != null ? s.strokeWidth = n.strokeWidth : ((u = t.style) == null ? void 0 : u.strokeWidth) != null && (s.strokeWidth = t.style.strokeWidth), ((c = t.style) == null ? void 0 : c.opacity) != null && (s.opacity = t.style.opacity), (n == null ? void 0 : n.extrudeHeight) != null && (s.extrudeHeight = n.extrudeHeight), s;
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;
932
1263
  }
933
- function ke(t, e) {
1264
+ function un(t, e) {
934
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;
935
1266
  }
936
- function Xe(t, e = "floor", n = {}) {
937
- const s = pe(t), o = [], i = [], u = [], c = [...s.warnings], r = [];
938
- let m = 0, y = 0, l = 0;
939
- const k = n.previousViewbox != null && s.viewbox != null && !ke(n.previousViewbox, s.viewbox);
940
- k && c.push(
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(
941
1272
  "SVG viewBox differs from the stored artboard — re-upload blocked until the designer restores the original viewBox"
942
1273
  );
943
- for (const a of s.elements) {
944
- if (Lt(a.id)) continue;
945
- let { kind: d, guessed: f } = fe(a.id, e);
946
- a.interactive && !d && (d = "unit", f = !0);
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);
947
1278
  const h = {
948
- sourceSvgId: a.id,
1279
+ sourceSvgId: c.id,
949
1280
  kind: d,
950
1281
  guessed: f
951
1282
  };
952
1283
  if (!d)
953
- if (i.push(a.id), e === "floor")
1284
+ if (s.push(c.id), e === "floor")
954
1285
  d = "decor", h.kind = "decor", h.message = "No matching prefix; imported as decor (floor mode)";
955
1286
  else {
956
- h.message = "No matching prefix; skipped (outdoor decor stays in SVG)", o.push(h);
1287
+ h.message = "No matching prefix; skipped (outdoor decor stays in SVG)", r.push(h);
957
1288
  continue;
958
1289
  }
959
- if (!a.d) {
960
- c.push(`Element ${a.id} has no drawable geometry`);
1290
+ if (!c.d) {
1291
+ a.push(`Element ${c.id} has no drawable geometry`);
961
1292
  continue;
962
1293
  }
963
1294
  if (e === "base") {
964
- const x = ot(a.id) != null;
965
- if (!(!x && (le.includes(d) || !!a.interactive))) {
966
- o.push({
1295
+ const x = yt(c.id) != null;
1296
+ if (!(!x && (Qe.includes(d) || !!c.interactive))) {
1297
+ r.push({
967
1298
  ...h,
968
1299
  message: x ? "Static decoration — rendered from outdoor SVG" : "Decoration — not persisted; rendered from outdoor SVG"
969
1300
  });
970
1301
  continue;
971
1302
  }
972
1303
  }
973
- f && (u.push(h), h.message = h.message ?? "Guessed kind from interactive/fallback rule"), o.push(h), d === "walkable" && m++, d === "void" && y++, d === "unit" && l++;
974
- const p = Ut([a.d]), b = it(p);
975
- r.push({
976
- key: ge(a.id),
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),
977
1308
  kind: d,
978
- geometry: p,
1309
+ geometry: m,
979
1310
  bbox: b,
980
- sourceSvgId: a.id,
981
- style: be(a, a.id)
1311
+ sourceSvgId: c.id,
1312
+ style: ln(c, c.id)
982
1313
  });
983
1314
  }
984
- return e === "floor" && m === 0 && c.push(
1315
+ return e === "floor" && y === 0 && a.push(
985
1316
  "No walkable layer found — auto-skeleton will be unavailable for this level"
986
1317
  ), {
987
1318
  report: {
988
- classified: o,
989
- unrecognized: i,
1319
+ classified: r,
1320
+ unrecognized: s,
990
1321
  guessed: u,
991
- walkableCount: m,
992
- voidCount: y,
1322
+ walkableCount: y,
1323
+ voidCount: p,
993
1324
  unitCount: l,
994
- warnings: c
1325
+ warnings: a
995
1326
  },
996
- shapes: r,
997
- viewbox: s.viewbox,
998
- routePathDs: s.routePathDs,
1327
+ shapes: i,
1328
+ viewbox: o.viewbox,
1329
+ routePathDs: o.routePathDs,
999
1330
  viewBoxChanged: k
1000
1331
  };
1001
1332
  }
1002
- function Ge(t, e, n, s = {}) {
1003
- const o = s.driftThreshold ?? ue, i = new Map(
1004
- e.filter((r) => r.sourceSvgId).map((r) => [r.sourceSvgId, r])
1005
- ), u = /* @__PURE__ */ new Set(), c = [];
1006
- for (const r of t) {
1007
- const m = i.get(r.sourceSvgId);
1008
- if (u.add(r.sourceSvgId), !m)
1009
- c.push({
1010
- sourceSvgId: r.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,
1011
1342
  change: "added",
1012
- newKind: r.kind
1343
+ newKind: i.kind
1013
1344
  });
1014
- else if (m.kind !== r.kind)
1015
- c.push({
1016
- sourceSvgId: r.sourceSvgId,
1345
+ else if (y.kind !== i.kind)
1346
+ a.push({
1347
+ sourceSvgId: i.sourceSvgId,
1017
1348
  change: "kind_changed",
1018
- existingShapeId: m.id,
1019
- existingKind: m.kind,
1020
- newKind: r.kind,
1021
- preserve: { key: m.key, assignment: !0, anchors: !0 },
1022
- geometryLocked: m.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
1023
1354
  });
1024
1355
  else {
1025
- let y = "unchanged";
1026
- if (m.bbox) {
1027
- const l = (m.bbox.minX + m.bbox.maxX) / 2, k = (m.bbox.minY + m.bbox.maxY) / 2, a = Vt(r.geometry);
1028
- Math.hypot(a.x - l, a.y - k) > o && (y = "moved");
1356
+ let p = "unchanged";
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");
1029
1360
  }
1030
- c.push({
1031
- sourceSvgId: r.sourceSvgId,
1032
- change: y,
1033
- existingShapeId: m.id,
1034
- existingKind: m.kind,
1035
- newKind: r.kind,
1036
- preserve: { key: m.key, assignment: !0, anchors: !0 },
1037
- geometryLocked: m.geometryLocked
1361
+ a.push({
1362
+ sourceSvgId: i.sourceSvgId,
1363
+ change: p,
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
1038
1369
  });
1039
1370
  }
1040
1371
  }
1041
- for (const r of e)
1042
- r.sourceSvgId && !u.has(r.sourceSvgId) && c.push({
1043
- sourceSvgId: r.sourceSvgId,
1372
+ for (const i of e)
1373
+ i.sourceSvgId && !u.has(i.sourceSvgId) && a.push({
1374
+ sourceSvgId: i.sourceSvgId,
1044
1375
  change: "removed",
1045
- existingShapeId: r.id,
1046
- existingKind: r.kind,
1047
- geometryLocked: r.geometryLocked
1376
+ existingShapeId: i.id,
1377
+ existingKind: i.kind,
1378
+ geometryLocked: i.geometryLocked
1048
1379
  });
1049
1380
  return {
1050
- items: c,
1381
+ items: a,
1051
1382
  shapes: t,
1052
1383
  viewbox: n
1053
1384
  };
1054
1385
  }
1055
- const O = 1e-6, Ie = 15 * Math.PI / 180, Me = 1e-3, K = Math.PI * 2;
1056
- function yt(t, e) {
1057
- return Math.abs(t.x - e.x) < O && Math.abs(t.y - e.y) < O;
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;
1058
1389
  }
1059
- function Q(t, e) {
1390
+ function at(t, e) {
1060
1391
  return { x: t.x + e.x, y: t.y + e.y };
1061
1392
  }
1062
- function pt(t, e) {
1393
+ function Lt(t, e) {
1063
1394
  return { x: t.x - e.x, y: t.y - e.y };
1064
1395
  }
1065
- function U(t, e) {
1396
+ function q(t, e) {
1066
1397
  return { x: t.x * e, y: t.y * e };
1067
1398
  }
1068
- function J(t, e, n) {
1399
+ function lt(t, e, n) {
1069
1400
  return {
1070
1401
  x: t.x + Math.cos(n) * e,
1071
1402
  y: t.y + Math.sin(n) * e
1072
1403
  };
1073
1404
  }
1074
- function ve(t) {
1405
+ function hn(t) {
1075
1406
  const e = [];
1076
1407
  for (const n of t) {
1077
- const s = e[e.length - 1];
1078
- s && yt(s, n) || e.push(n);
1408
+ const o = e[e.length - 1];
1409
+ o && St(o, n) || e.push(n);
1079
1410
  }
1080
- return e.length >= 2 && yt(e[0], e[e.length - 1]) && e.pop(), e;
1081
- }
1082
- function ze(t, e) {
1083
- const n = It(e), s = ve(t);
1084
- if (s.length < 3 || n <= 0) return t;
1085
- const o = s.length, i = new Array(o), u = new Array(o), c = new Array(o), r = new Array(o), m = new Array(o).fill(0), y = new Array(o).fill(0), l = new Array(o).fill(!1);
1086
- for (let a = 0; a < o; a++) {
1087
- const d = s[(a - 1 + o) % o], f = s[a], h = s[(a + 1) % o], p = P(d, f), b = P(f, h);
1088
- if (c[a] = b, p < O || b < O) {
1089
- i[a] = { x: 1, y: 0 }, u[a] = { x: 1, y: 0 }, r[a] = 0;
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;
1090
1421
  continue;
1091
1422
  }
1092
- i[a] = U(pt(f, d), 1 / p), u[a] = U(pt(h, f), 1 / b);
1093
- const x = i[a].x * u[a].y - i[a].y * u[a].x, g = i[a].x * u[a].x + i[a].y * u[a].y;
1094
- r[a] = Math.atan2(x, g);
1095
- const I = Math.abs(r[a]);
1096
- if (I < Ie) continue;
1097
- const v = Math.PI - I, M = Math.tan(v / 2);
1098
- if (M < O || v <= O || v >= Math.PI - O) continue;
1099
- const S = n / M;
1100
- m[a] = S, y[a] = S, l[a] = !0;
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;
1101
1432
  }
1102
- for (let a = 0; a < o; a++) {
1103
- const d = (a + 1) % o, f = y[a] + m[d], h = Math.max(0, c[a] - Me);
1104
- if (f <= h || f <= O) continue;
1105
- const p = h / f;
1106
- y[a] *= p, m[d] *= p;
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;
1107
1438
  }
1108
1439
  const k = [];
1109
- for (let a = 0; a < o; a++) {
1110
- const d = s[a], f = Math.min(m[a], y[a]), h = Math.abs(r[a]), p = Math.PI - h, b = f * Math.tan(p / 2);
1111
- if (!l[a] || b < O || f < O) {
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) {
1112
1443
  k.push({ ...d });
1113
1444
  continue;
1114
1445
  }
1115
- const x = Q(d, U(i[a], -f)), g = Q(d, U(u[a], f)), I = r[a] > 0 ? 1 : -1, v = Q(x, {
1116
- x: -i[a].y * I * b,
1117
- y: i[a].x * I * b
1118
- }), M = Math.atan2(x.y - v.y, x.x - v.x), S = Math.atan2(g.y - v.y, g.x - v.x), L = (S - M + K) % K, C = (M - S + K) % K, T = J(v, b, M + L / 2), R = J(v, b, M - C / 2), D = P(T, d) <= P(R, d), $ = D ? L : C, w = Math.max(8, Math.min(28, Math.ceil($ * b / 2)));
1119
- for (let A = 0; A <= w; A++) {
1120
- const F = A / w, N = D ? M + $ * F : M - $ * F;
1121
- k.push(J(v, b, N));
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));
1122
1453
  }
1123
1454
  }
1124
1455
  return k;
1125
1456
  }
1126
- function Se(t, e, n = []) {
1127
- const s = Ot(), o = new Map(t.map((r) => [r.id, r])), i = new Map(n.map((r) => [r.id, r])), u = t.map((r) => ({
1128
- id: r.id,
1129
- levelId: r.levelId,
1130
- x: r.x,
1131
- y: r.y,
1132
- kind: r.kind,
1133
- shapeId: r.shapeId,
1134
- connectorId: r.connectorId
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
1135
1466
  }));
1136
- for (const r of u)
1137
- s.addNode(r.id, r);
1138
- const c = [];
1139
- for (const r of e) {
1140
- const m = o.get(r.fromAnchorId), y = o.get(r.toAnchorId);
1141
- if (!m || !y) continue;
1142
- let l = r.weight;
1143
- l == null && (l = P(m, y), m.levelId !== y.levelId && (l += tt));
1144
- let k = r.accessible;
1145
- if (r.kind === "connector" && m.connectorId != null) {
1146
- const d = i.get(m.connectorId);
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);
1147
1478
  d && (k = d.accessible);
1148
1479
  }
1149
- const a = {
1150
- id: r.id,
1151
- from: r.fromAnchorId,
1152
- to: r.toAnchorId,
1480
+ const c = {
1481
+ id: i.id,
1482
+ from: i.fromAnchorId,
1483
+ to: i.toAnchorId,
1153
1484
  weight: l,
1154
- directed: r.directed,
1485
+ directed: i.directed,
1155
1486
  accessible: k,
1156
- kind: r.kind
1487
+ kind: i.kind
1157
1488
  };
1158
- c.push(a), s.addLink(r.fromAnchorId, r.toAnchorId, a), r.directed || s.addLink(r.toAnchorId, r.fromAnchorId, a);
1489
+ a.push(c), o.addLink(i.fromAnchorId, i.toAnchorId, c), i.directed || o.addLink(i.toAnchorId, i.fromAnchorId, c);
1159
1490
  }
1160
- return { graph: s, nodes: u, edges: c, anchorById: o };
1491
+ return { graph: o, nodes: u, edges: a, anchorById: r };
1161
1492
  }
1162
- function we(t, e, n, s = {}) {
1163
- const { graph: o, anchorById: i } = t;
1164
- if (!i.has(e) || !i.has(n))
1493
+ function xn(t, e, n, o = {}) {
1494
+ const { graph: r, anchorById: s } = t;
1495
+ if (!s.has(e) || !s.has(n))
1165
1496
  return null;
1166
- const c = Rt.nba(o, {
1497
+ const a = Ht.nba(r, {
1167
1498
  oriented: !0,
1168
- distance(a, d, f) {
1499
+ distance(c, d, f) {
1169
1500
  const h = f.data;
1170
- return s.accessibleOnly && h && !h.accessible ? Number.POSITIVE_INFINITY : (h == null ? void 0 : h.weight) ?? 1;
1501
+ return o.accessibleOnly && h && !h.accessible ? Number.POSITIVE_INFINITY : (h == null ? void 0 : h.weight) ?? 1;
1171
1502
  },
1172
- heuristic(a, d) {
1173
- const f = i.get(a.id), h = i.get(d.id);
1503
+ heuristic(c, d) {
1504
+ const f = s.get(c.id), h = s.get(d.id);
1174
1505
  if (!f || !h) return 0;
1175
- let p = P(f, h);
1176
- return f.levelId !== h.levelId && (p += tt), p;
1506
+ let m = w(f, h);
1507
+ return f.levelId !== h.levelId && (m += ut), m;
1177
1508
  }
1178
1509
  }).find(e, n);
1179
- if (!c || c.length === 0) return null;
1180
- const m = c.reverse().map((a) => a.id), y = [], l = [];
1510
+ if (!a || a.length === 0) return null;
1511
+ const y = a.reverse().map((c) => c.id), p = [], l = [];
1181
1512
  let k = 0;
1182
- for (let a = 0; a < m.length; a++) {
1183
- const d = i.get(m[a]);
1184
- if (y.push({ x: d.x, y: d.y, levelId: d.levelId }), a > 0) {
1185
- const f = i.get(m[a - 1]);
1186
- k += P(f, d), f.levelId !== d.levelId && (k += tt, l.push({
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({
1187
1518
  fromLevelId: f.levelId,
1188
1519
  toLevelId: d.levelId,
1189
1520
  connectorId: d.connectorId ?? f.connectorId
1190
1521
  }));
1191
1522
  }
1192
1523
  }
1193
- return { anchorIds: m, points: y, totalWeight: k, levelChanges: l };
1524
+ return { anchorIds: y, points: p, totalWeight: k, levelChanges: l };
1194
1525
  }
1195
- function He(t, e, n, s = {}) {
1196
- let o = null;
1197
- for (const i of n) {
1198
- const u = we(t, e, i, s);
1199
- u && (!o || u.totalWeight < o.totalWeight) && (o = u);
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);
1200
1531
  }
1201
- return o;
1202
- }
1203
- function Ke(t) {
1204
- const e = Pt(t.theme), n = new Map(
1205
- t.assignments.map((c) => [c.shapeId, c])
1206
- ), s = t.resolveSvgUrl ?? ((c) => c), o = t.levels.filter((c) => c.isActive).sort((c, r) => c.ordering - r.ordering).map((c) => {
1207
- const r = t.shapes.filter((y) => y.levelId === c.id).map((y) => {
1208
- const l = St(y.geometry);
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;
1209
1542
  return {
1210
- ...y,
1211
- geometry: l,
1212
- bbox: l === y.geometry ? y.bbox : it(l),
1213
- assignment: n.get(y.id) ?? null
1543
+ ...l,
1544
+ geometry: k,
1545
+ bbox: k === l.geometry ? l.bbox : xt(k),
1546
+ assignment: c,
1547
+ label: Ft(l, c, d)
1214
1548
  };
1215
- }), m = t.anchors.filter((y) => y.levelId === c.id);
1549
+ }), p = t.anchors.filter((l) => l.levelId === i.id);
1216
1550
  return {
1217
- id: c.id,
1218
- buildingId: c.buildingId,
1219
- kind: c.kind,
1220
- name: c.name,
1221
- levelIndex: c.levelIndex,
1222
- ordering: c.ordering,
1223
- sourceSvgUrl: s(c.sourceSvgKey) ?? c.sourceSvgUrl ?? null,
1224
- viewbox: c.sourceViewbox,
1225
- transform: c.transform,
1226
- shapes: r,
1227
- anchors: m
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
1228
1562
  };
1229
- }), { nodes: i, edges: u } = Se(
1563
+ }), { nodes: u, edges: a } = yn(
1230
1564
  t.anchors,
1231
1565
  t.edges,
1232
1566
  t.connectors
@@ -1241,54 +1575,138 @@ function Ke(t) {
1241
1575
  baseSvgUrl: t.baseSvgUrl,
1242
1576
  baseViewbox: t.baseViewbox,
1243
1577
  buildings: t.buildings,
1244
- levels: o,
1578
+ levels: s,
1245
1579
  connectors: t.connectors,
1246
- amenities: t.amenities.filter((c) => c.isActive),
1247
- graph: { nodes: i, edges: u },
1580
+ amenities: t.amenities.filter((i) => i.isActive),
1581
+ graph: { nodes: u, edges: a },
1248
1582
  responsiveOverrides: t.responsiveOverrides,
1249
1583
  publishedAt: t.publishedAt ?? (/* @__PURE__ */ new Date()).toISOString()
1250
1584
  };
1251
1585
  }
1252
- function Ue(t) {
1586
+ function po(t) {
1253
1587
  let e = !1;
1254
- const n = t.levels.map((s) => {
1255
- let o = !1;
1256
- const i = s.shapes.map((u) => {
1257
- const c = St(u.geometry);
1258
- return c === u.geometry ? u : (o = !0, {
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, {
1259
1593
  ...u,
1260
- geometry: c,
1261
- bbox: it(c)
1594
+ geometry: a,
1595
+ bbox: y ? xt(a) : u.bbox,
1596
+ label: i
1262
1597
  });
1263
1598
  });
1264
- return o ? (e = !0, { ...s, shapes: i }) : s;
1599
+ return r ? (e = !0, { ...o, shapes: s }) : o;
1265
1600
  });
1266
1601
  return e ? { ...t, levels: n } : t;
1267
1602
  }
1268
- function Ce(t, e) {
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) {
1269
1661
  return t.ordering - e.ordering || t.levelIndex - e.levelIndex;
1270
1662
  }
1271
- function gt(t) {
1663
+ function Q(t) {
1272
1664
  return t.kind === "outdoor";
1273
1665
  }
1274
- function Ae(t, e) {
1275
- const n = t.filter(gt), s = e == null ? null : t.find((o) => o.id === e) ?? null;
1276
- return !s || gt(s) || n.some((o) => o.id === s.id) ? n : [...n, s];
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;
1277
1682
  }
1278
- function ct(t) {
1279
- return t.filter((e) => e.kind === "floor").slice().sort(Ce);
1683
+ function Co(t, e) {
1684
+ return An(t, e).at(-1) ?? null;
1685
+ }
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;
1691
+ }
1692
+ function et(t) {
1693
+ return t.filter((e) => e.kind === "floor").slice().sort(_n);
1280
1694
  }
1281
- function Ve(t) {
1282
- return ct(t);
1695
+ function So(t) {
1696
+ return et(t);
1283
1697
  }
1284
- function je(t) {
1285
- return ct(t).length > 1;
1698
+ function Lo(t) {
1699
+ return et(t).length > 1;
1286
1700
  }
1287
- function Ze(t) {
1701
+ function Oo(t) {
1702
+ return t.some((e) => e.kind === "floor");
1703
+ }
1704
+ const Mo = "This map doesn’t have any floors yet.";
1705
+ function Sn(t) {
1288
1706
  var e, n;
1289
- return ((e = ct(t).at(-1)) == null ? void 0 : e.id) ?? ((n = t[0]) == null ? void 0 : n.id) ?? null;
1707
+ return ((e = et(t).at(-1)) == null ? void 0 : e.id) ?? ((n = t[0]) == null ? void 0 : n.id) ?? null;
1290
1708
  }
1291
- function bt(t) {
1709
+ function Et(t) {
1292
1710
  return {
1293
1711
  minX: t.x,
1294
1712
  minY: t.y,
@@ -1299,128 +1717,228 @@ function bt(t) {
1299
1717
  size: Math.max(t.width, t.height, 100)
1300
1718
  };
1301
1719
  }
1302
- function kt(t, e) {
1303
- const n = Math.min(t.minX, e.minX), s = Math.min(t.minY, e.minY), o = Math.max(t.maxX, e.maxX), i = Math.max(t.maxY, e.maxY);
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;
1722
+ return {
1723
+ x: u * r - a * s + (e.translateX || 0),
1724
+ y: u * s + a * r + (e.translateY || 0)
1725
+ };
1726
+ }
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);
1304
1766
  return {
1305
1767
  minX: n,
1306
- minY: s,
1307
- maxX: o,
1308
- maxY: i,
1309
- cx: (n + o) / 2,
1310
- cy: (s + i) / 2,
1311
- size: Math.max(o - n, i - s, 100)
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)
1312
1774
  };
1313
1775
  }
1314
- function qe(t, e, n) {
1315
- let s = n ? bt(n) : null;
1316
- for (const o of Ae(t, e)) {
1317
- if (o.viewbox) {
1318
- const i = bt(o.viewbox);
1319
- s = s ? kt(s, i) : i;
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;
1320
1782
  }
1321
- for (const i of o.shapes) {
1322
- const u = {
1323
- minX: i.bbox.minX,
1324
- minY: i.bbox.minY,
1325
- maxX: i.bbox.maxX,
1326
- maxY: i.bbox.maxY,
1327
- cx: (i.bbox.minX + i.bbox.maxX) / 2,
1328
- cy: (i.bbox.minY + i.bbox.maxY) / 2,
1329
- size: Math.max(
1330
- i.bbox.maxX - i.bbox.minX,
1331
- i.bbox.maxY - i.bbox.minY,
1332
- 100
1333
- )
1334
- };
1335
- s = s ? kt(s, u) : u;
1783
+ for (const s of r.shapes) {
1784
+ const u = On(s.bbox);
1785
+ o = o ? Rt(o, u) : u;
1336
1786
  }
1337
1787
  }
1338
- return s ?? { minX: 0, minY: 0, maxX: 500, maxY: 500, cx: 250, cy: 250, size: 500 };
1788
+ return o ?? { minX: 0, minY: 0, maxX: 500, maxY: 500, cx: 250, cy: 250, size: 500 };
1339
1789
  }
1340
- function Qe(t, e) {
1790
+ function Ro(t, e) {
1341
1791
  if (!t && !e) return { x: 0, y: 0, width: 1e3, height: 800 };
1342
1792
  if (!t) return e;
1343
1793
  if (!e) return t;
1344
- const n = Math.min(t.x, e.x), s = Math.min(t.y, e.y), o = Math.max(t.x + t.width, e.x + e.width), i = Math.max(t.y + t.height, e.y + e.height);
1345
- return { x: n, y: s, width: o - n, height: i - s };
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 };
1346
1796
  }
1347
1797
  export {
1348
- St as $,
1349
- De as A,
1350
- Ve as B,
1351
- ct as C,
1352
- lt as D,
1353
- it as E,
1354
- tt as F,
1355
- Vt as G,
1356
- Xe as H,
1357
- et as I,
1358
- te as J,
1359
- Kt as K,
1360
- ne as L,
1361
- Ct as M,
1362
- Lt as N,
1363
- Pe as O,
1364
- rt as P,
1365
- gt as Q,
1366
- wt as R,
1367
- X as S,
1368
- nt as T,
1369
- At as U,
1370
- _e as V,
1371
- st as W,
1372
- j as X,
1373
- Pt as Y,
1374
- G as Z,
1375
- $e as _,
1376
- Ne as a,
1377
- V as a0,
1378
- at as a1,
1379
- Ue as a2,
1380
- pe as a3,
1381
- xt as a4,
1382
- jt as a5,
1383
- vt as a6,
1384
- Bt as a7,
1385
- Ye as a8,
1386
- Wt as a9,
1387
- dt as aa,
1388
- Te as ab,
1389
- ot as ac,
1390
- je as ad,
1391
- Be as ae,
1392
- Re as af,
1393
- Mt as ag,
1394
- re as ah,
1395
- Qe as ai,
1396
- ve as aj,
1397
- bt as ak,
1398
- Ee as al,
1399
- Ae as am,
1400
- ue as b,
1401
- le as c,
1402
- Tt as d,
1403
- We as e,
1404
- ee as f,
1405
- Gt as g,
1406
- ut as h,
1407
- ft as i,
1408
- Yt as j,
1409
- Fe as k,
1410
- qe as l,
1411
- Ut as m,
1412
- $t as n,
1413
- It as o,
1414
- fe as p,
1415
- Ce as q,
1416
- Ke as r,
1417
- Se as s,
1418
- Ze as t,
1419
- Ge as u,
1420
- P as v,
1421
- kt as w,
1422
- ze as x,
1423
- He as y,
1424
- we as z
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,
1816
+ ye as R,
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
1425
1943
  };
1426
1944
  //# sourceMappingURL=stacking.js.map