@eyeon/map 2.0.13 → 2.0.15

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