@eyeon/map 2.0.2 → 2.0.3

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