mudlet-map-renderer 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as e, C as t, D as n, E as r, M as i, N as a, O as o, S as s, T as c, _ as l, a as u, b as d, c as f, d as p, f as m, g as h, h as g, i as _, j as v, k as y, l as b, m as x, n as S, o as ee, p as te, r as C, s as w, u as ne, v as T, w as E, x as re, y as ie } from "./flushSceneShapes-Duhi0OQv.js";
1
+ import { A as e, C as t, D as n, E as r, M as i, N as a, O as o, S as s, T as c, _ as l, a as u, b as d, c as f, d as p, f as m, g as h, h as g, i as _, j as v, k as y, l as b, m as x, n as S, o as C, p as ee, r as w, s as te, u as ne, v as T, w as E, x as re, y as ie } from "./flushSceneShapes-Duhi0OQv.js";
2
2
  import { n as ae, r as oe, t as se } from "./MapReader-Brzg-X7T.js";
3
3
  import D from "konva";
4
4
  //#region \0rolldown/runtime.js
@@ -262,7 +262,7 @@ function Ce(e, t, n, r, i) {
262
262
  maxY: Math.max(a.y, o.y, s.y, c.y)
263
263
  };
264
264
  }
265
- function k(e, t, n, r) {
265
+ function we(e, t, n, r) {
266
266
  let i = xe(t, n, { inverseTransform: r?.inverse });
267
267
  if (!n.cullingEnabled) return {
268
268
  ...e.sceneShapes,
@@ -278,12 +278,12 @@ function k(e, t, n, r) {
278
278
  }
279
279
  //#endregion
280
280
  //#region src/rendering/SceneManager.ts
281
- var we = {
281
+ var Te = {
282
282
  grid: [],
283
283
  link: [],
284
284
  room: [],
285
285
  topLabel: []
286
- }, Te = class {
286
+ }, Ee = class {
287
287
  constructor(e, t, n) {
288
288
  this.camera = e, this.settings = t, this.standaloneExitShapeSet = /* @__PURE__ */ new Set(), this.pipeline = new g(n, t);
289
289
  }
@@ -327,14 +327,14 @@ var we = {
327
327
  }
328
328
  cull(e = c) {
329
329
  if (!this.lastBuildResult) return {
330
- shapes: we,
330
+ shapes: Te,
331
331
  stats: {
332
332
  visibleRooms: 0,
333
333
  totalRooms: 0,
334
334
  visibleExits: 0
335
335
  }
336
336
  };
337
- let t = this.camera.getCullingViewport(this.settings.cullingBounds), n = e === c ? void 0 : { forward: e }, r = k(this.lastBuildResult, t, this.settings, n);
337
+ let t = this.camera.getCullingViewport(this.settings.cullingBounds), n = e === c ? void 0 : { forward: e }, r = we(this.lastBuildResult, t, this.settings, n);
338
338
  return {
339
339
  shapes: r,
340
340
  stats: {
@@ -347,7 +347,7 @@ var we = {
347
347
  };
348
348
  //#endregion
349
349
  //#region src/render/canvasGradient.ts
350
- function A(e, t) {
350
+ function k(e, t) {
351
351
  if (typeof t == "string") return t;
352
352
  if (t.type === "linear") {
353
353
  let n = e.createLinearGradient(t.x0, t.y0, t.x1, t.y1);
@@ -360,13 +360,13 @@ function A(e, t) {
360
360
  }
361
361
  //#endregion
362
362
  //#region src/render/RecordingLayer.ts
363
- function Ee(e, t) {
363
+ function De(e, t) {
364
364
  switch (t.type) {
365
365
  case "rect":
366
- e.beginPath(), t.cr > 0 && typeof e.roundRect == "function" ? e.roundRect(t.x, t.y, t.w, t.h, t.cr) : e.rect(t.x, t.y, t.w, t.h), t.fill && (e.fillStyle = A(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, t.dash ? e.setLineDash(t.dash) : e.setLineDash([]), e.stroke());
366
+ e.beginPath(), t.cr > 0 && typeof e.roundRect == "function" ? e.roundRect(t.x, t.y, t.w, t.h, t.cr) : e.rect(t.x, t.y, t.w, t.h), t.fill && (e.fillStyle = k(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, t.dash ? e.setLineDash(t.dash) : e.setLineDash([]), e.stroke());
367
367
  break;
368
368
  case "circle":
369
- e.beginPath(), e.arc(t.cx, t.cy, t.r, 0, Math.PI * 2), t.fill && (e.fillStyle = A(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, t.dash ? e.setLineDash(t.dash) : e.setLineDash([]), e.stroke());
369
+ e.beginPath(), e.arc(t.cx, t.cy, t.r, 0, Math.PI * 2), t.fill && (e.fillStyle = k(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, t.dash ? e.setLineDash(t.dash) : e.setLineDash([]), e.stroke());
370
370
  break;
371
371
  case "line": {
372
372
  if (t.points.length < 4) break;
@@ -380,7 +380,7 @@ function Ee(e, t) {
380
380
  if (t.vertices.length < 4) break;
381
381
  e.beginPath(), e.moveTo(t.vertices[0], t.vertices[1]);
382
382
  for (let n = 2; n < t.vertices.length; n += 2) e.lineTo(t.vertices[n], t.vertices[n + 1]);
383
- e.closePath(), t.fill && (e.fillStyle = A(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash([]), e.stroke());
383
+ e.closePath(), t.fill && (e.fillStyle = k(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash([]), e.stroke());
384
384
  break;
385
385
  case "text": {
386
386
  let n = t.fontSize * 100, r = `${t.fontStyle} ${n}px ${t.fontFamily}`;
@@ -417,7 +417,7 @@ function Ee(e, t) {
417
417
  break;
418
418
  }
419
419
  }
420
- var De = class {
420
+ var Oe = class {
421
421
  constructor(e, t) {
422
422
  this._visible = !0, this.noScaling = !1, this.commands = [], this.x = e, this.y = t;
423
423
  }
@@ -458,11 +458,11 @@ var De = class {
458
458
  perfectDrawEnabled: !1,
459
459
  sceneFunc: (e) => {
460
460
  let n = e._context;
461
- for (let e of t) Ee(n, e);
461
+ for (let e of t) De(n, e);
462
462
  }
463
463
  })), this._konvaGroup = e, e;
464
464
  }
465
- }, Oe = class {
465
+ }, A = class {
466
466
  constructor(e) {
467
467
  this.entries = [], this.nodeToEntry = /* @__PURE__ */ new Map(), this.konvaLayer = e, e.destroyChildren();
468
468
  let t = this;
@@ -475,7 +475,7 @@ var De = class {
475
475
  if (!e.visible) continue;
476
476
  let t = i * e.x + o * e.y + r.e, c = a * e.x + s * e.y + r.f;
477
477
  e.noScaling ? n.setTransform(75, 0, 0, 75, t, c) : n.setTransform(i, a, o, s, t, c);
478
- for (let t of e.commands) Ee(n, t);
478
+ for (let t of e.commands) De(n, t);
479
479
  }
480
480
  n.setTransform(r);
481
481
  }
@@ -516,7 +516,7 @@ var De = class {
516
516
  if (!e._visible) continue;
517
517
  let t = i * e.x + o * e.y + r.e, c = a * e.x + s * e.y + r.f;
518
518
  e.noScaling ? n.setTransform(75, 0, 0, 75, t, c) : n.setTransform(i, a, o, s, t, c);
519
- for (let t of e.commands) Ee(n, t);
519
+ for (let t of e.commands) De(n, t);
520
520
  }
521
521
  n.setTransform(r);
522
522
  }
@@ -578,7 +578,7 @@ function M(e, t, n, r, i, a) {
578
578
  //#endregion
579
579
  //#region src/render/shapeToRecording.ts
580
580
  function Me(e) {
581
- let t = new De(e.x, e.y);
581
+ let t = new Oe(e.x, e.y);
582
582
  return e.noScale && (t.noScaling = !0), Ne(t, e.children, 0, 0), t;
583
583
  }
584
584
  function Ne(e, t, n, r) {
@@ -689,7 +689,7 @@ var N = "rgb(120, 72, 0)", Le = class {
689
689
  return this._coordinateTransform;
690
690
  }
691
691
  constructor(e, t) {
692
- this.gridCachedBounds = null, this.currentStyle = u, this.hitTester = new ee(), this.lastHitShapes = [], this.shapeToDrawEntry = /* @__PURE__ */ new Map(), this.shapeToGroup = /* @__PURE__ */ new Map(), this.highlightShapes = /* @__PURE__ */ new Map(), this.pathShapes = [], this.currentRoomOverlay = [], this.destroyed = !1, this._coordinateTransform = c, this.coordinateInverse = c, this.liveEffects = /* @__PURE__ */ new Map(), this.sceneOverlays = /* @__PURE__ */ new Map(), this.sceneOverlayNodes = /* @__PURE__ */ new Map(), this.viewportSubscribers = /* @__PURE__ */ new Set(), this.state = e, this.container = t, t ? (this.stage = new D.Stage({
692
+ this.gridCachedBounds = null, this.currentStyle = u, this.hitTester = new C(), this.lastHitShapes = [], this.shapeToDrawEntry = /* @__PURE__ */ new Map(), this.shapeToGroup = /* @__PURE__ */ new Map(), this.highlightShapes = /* @__PURE__ */ new Map(), this.pathShapes = [], this.currentRoomOverlay = [], this.destroyed = !1, this._coordinateTransform = c, this.coordinateInverse = c, this.liveEffects = /* @__PURE__ */ new Map(), this.sceneOverlays = /* @__PURE__ */ new Map(), this.sceneOverlayNodes = /* @__PURE__ */ new Map(), this.viewportSubscribers = /* @__PURE__ */ new Set(), this.state = e, this.container = t, t ? (this.stage = new D.Stage({
693
693
  container: t,
694
694
  width: t.clientWidth,
695
695
  height: t.clientHeight,
@@ -699,7 +699,7 @@ var N = "rgb(120, 72, 0)", Le = class {
699
699
  height: 1
700
700
  }), this.camera = new r(1, 1)), this.gridLayer = new D.Layer({ listening: !1 }), this.stage.add(this.gridLayer);
701
701
  let n = new D.Layer({ listening: !1 });
702
- if (this.linkLayer = n, this.roomLayer = n, this.stage.add(n), this.positionLayer = new D.Layer({ listening: !1 }), this.stage.add(this.positionLayer), this.overlayLayer = new D.Layer({ listening: !1 }), this.stage.add(this.overlayLayer), this.topLabelLayer = new D.Layer({ listening: !1 }), this.stage.add(this.topLabelLayer), this.positionLayerNode = new ke(this.positionLayer), this.overlayLayerNode = new ke(this.overlayLayer), this.sceneNode = new Oe(n), this.gridLayerNode = new j(this.gridLayer), this.topLabelLayerNode = new j(this.topLabelLayer), this.sceneManager = new Te(this.camera, e.settings, e.mapReader), this.events = new y(t), this.culling = new E(e.settings, () => this.applyClipping()), this.cameraChangeHandler = () => this.applyViewportToStage(), this.camera.on("change", this.cameraChangeHandler), t) {
702
+ if (this.linkLayer = n, this.roomLayer = n, this.stage.add(n), this.positionLayer = new D.Layer({ listening: !1 }), this.stage.add(this.positionLayer), this.overlayLayer = new D.Layer({ listening: !1 }), this.stage.add(this.overlayLayer), this.topLabelLayer = new D.Layer({ listening: !1 }), this.stage.add(this.topLabelLayer), this.positionLayerNode = new ke(this.positionLayer), this.overlayLayerNode = new ke(this.overlayLayer), this.sceneNode = new A(n), this.gridLayerNode = new j(this.gridLayer), this.topLabelLayerNode = new j(this.topLabelLayer), this.sceneManager = new Ee(this.camera, e.settings, e.mapReader), this.events = new y(t), this.culling = new E(e.settings, () => this.applyClipping()), this.cameraChangeHandler = () => this.applyViewportToStage(), this.camera.on("change", this.cameraChangeHandler), t) {
703
703
  this.origSetSize = this.camera.setSize.bind(this.camera);
704
704
  let n = this.origSetSize;
705
705
  this.camera.setSize = (e, t) => {
@@ -712,7 +712,7 @@ var N = "rgb(120, 72, 0)", Le = class {
712
712
  this.applyStyleTransforms(), this.subscribeToState(e);
713
713
  }
714
714
  setStyle(e) {
715
- this.currentStyle = e, this.sceneNode = new Oe(this.linkLayer), this.gridLayerNode = new j(this.gridLayer), this.topLabelLayerNode = new j(this.topLabelLayer), this.gridCachedBounds = null, this.sceneManager.resetPipeline(this.state.mapReader), this.shapeToDrawEntry = /* @__PURE__ */ new Map(), this.shapeToGroup.clear(), this.lastHitShapes = [], this.hitTester.clear(), this.applyStyleTransforms(), this.refresh();
715
+ this.currentStyle = e, this.sceneNode = new A(this.linkLayer), this.gridLayerNode = new j(this.gridLayer), this.topLabelLayerNode = new j(this.topLabelLayer), this.gridCachedBounds = null, this.sceneManager.resetPipeline(this.state.mapReader), this.shapeToDrawEntry = /* @__PURE__ */ new Map(), this.shapeToGroup.clear(), this.lastHitShapes = [], this.hitTester.clear(), this.applyStyleTransforms(), this.refresh();
716
716
  }
717
717
  applyStyleTransforms() {
718
718
  let e = this.currentStyle, t = e.worldToScene ? (t, n) => e.worldToScene(t, n) : c, n = e.sceneToWorld ? (t, n) => e.sceneToWorld(t, n) : c, r = this.coordinateInverse, i = e.sceneLayerOffset ? (t) => e.sceneLayerOffset(t) : void 0;
@@ -870,7 +870,7 @@ var N = "rgb(120, 72, 0)", Le = class {
870
870
  for (let e of r.sceneShapes.topLabel) this.addStyledShape(e, this.topLabelLayerNode);
871
871
  }
872
872
  addStyledShape(e, t, n = !1) {
873
- let r = n || this.currentStyle === u ? [e] : C([e], this.currentStyle, this.styleContext());
873
+ let r = n || this.currentStyle === u ? [e] : w([e], this.currentStyle, this.styleContext());
874
874
  if (r.length === 0) return;
875
875
  let i;
876
876
  i = r.length === 1 && r[0].type === "group" ? r[0] : {
@@ -989,7 +989,7 @@ var N = "rgb(120, 72, 0)", Le = class {
989
989
  if (n && (n.destroy(), this.highlightShapes.delete(e)), t !== void 0) {
990
990
  let n = this.state.mapReader.getRoom(e);
991
991
  if (n && n.area === this.state.currentArea && n.z === this.state.currentZIndex) {
992
- let r = ne(n, t, this.state.settings), i = this.addStyledShape(w(r), this.overlayLayerNode);
992
+ let r = ne(n, t, this.state.settings), i = this.addStyledShape(te(r), this.overlayLayerNode);
993
993
  i && this.highlightShapes.set(e, i);
994
994
  }
995
995
  }
@@ -1002,7 +1002,7 @@ var N = "rgb(120, 72, 0)", Le = class {
1002
1002
  if (t.area !== this.state.currentArea || t.z !== this.state.currentZIndex) continue;
1003
1003
  let n = this.state.mapReader.getRoom(e);
1004
1004
  if (!n) continue;
1005
- let r = ne(n, t.colors, this.state.settings), i = this.addStyledShape(w(r), this.overlayLayerNode);
1005
+ let r = ne(n, t.colors, this.state.settings), i = this.addStyledShape(te(r), this.overlayLayerNode);
1006
1006
  i && this.highlightShapes.set(e, i);
1007
1007
  }
1008
1008
  this.overlayLayerNode.batchDraw();
@@ -1183,14 +1183,14 @@ function pt(e, t, n) {
1183
1183
  a
1184
1184
  ];
1185
1185
  }
1186
- function mt(e, t, n, r = 1) {
1186
+ function R(e, t, n, r = 1) {
1187
1187
  e = (e % 360 + 360) % 360;
1188
1188
  let i = (1 - Math.abs(2 * n - 1)) * t, a = i * (1 - Math.abs(e / 60 % 2 - 1)), o = n - i / 2, s, c, l;
1189
1189
  e < 60 ? (s = i, c = a, l = 0) : e < 120 ? (s = a, c = i, l = 0) : e < 180 ? (s = 0, c = i, l = a) : e < 240 ? (s = 0, c = a, l = i) : e < 300 ? (s = a, c = 0, l = i) : (s = i, c = 0, l = a);
1190
1190
  let u = Math.round((s + o) * 255), d = Math.round((c + o) * 255), f = Math.round((l + o) * 255);
1191
1191
  return r < 1 ? `rgba(${u}, ${d}, ${f}, ${r})` : `rgb(${u}, ${d}, ${f})`;
1192
1192
  }
1193
- function ht(e) {
1193
+ function mt(e) {
1194
1194
  let t = F(e);
1195
1195
  if (!t) return {
1196
1196
  h: 150,
@@ -1202,49 +1202,49 @@ function ht(e) {
1202
1202
  a: t.a
1203
1203
  };
1204
1204
  }
1205
- function gt(e) {
1206
- let { h: t, a: n } = ht(e);
1207
- return mt(t, .95, .65, n);
1205
+ function ht(e) {
1206
+ let { h: t, a: n } = mt(e);
1207
+ return R(t, .95, .65, n);
1208
1208
  }
1209
- function _t(e) {
1209
+ function gt(e) {
1210
1210
  let t = F(e);
1211
1211
  if (!t) return "rgb(8, 12, 10)";
1212
1212
  let [n] = pt(t.r, t.g, t.b);
1213
- return mt(n, .4, .1, t.a);
1213
+ return R(n, .4, .1, t.a);
1214
1214
  }
1215
- function vt(e) {
1216
- let { h: t, a: n } = ht(e);
1217
- return mt(t, .95, .65, Math.min(n, dt));
1215
+ function _t(e) {
1216
+ let { h: t, a: n } = mt(e);
1217
+ return R(t, .95, .65, Math.min(n, dt));
1218
1218
  }
1219
- function yt(e) {
1219
+ function vt(e) {
1220
1220
  return {
1221
1221
  ...e,
1222
- fill: P(e.fill, _t),
1223
- stroke: e.stroke ? gt(e.stroke) : e.stroke
1222
+ fill: P(e.fill, gt),
1223
+ stroke: e.stroke ? ht(e.stroke) : e.stroke
1224
1224
  };
1225
1225
  }
1226
- function bt(e, t = !1) {
1226
+ function yt(e, t = !1) {
1227
1227
  if (!e.stroke) return e;
1228
1228
  let n = (e.strokeWidth ?? 1) * ft;
1229
1229
  return {
1230
- stroke: vt(e.stroke),
1230
+ stroke: _t(e.stroke),
1231
1231
  strokeWidth: n,
1232
1232
  dash: e.dash,
1233
1233
  dashEnabled: e.dashEnabled,
1234
1234
  alpha: t ? dt : e.alpha
1235
1235
  };
1236
1236
  }
1237
- var xt = { transform(e) {
1237
+ var bt = { transform(e) {
1238
1238
  switch (e.type) {
1239
1239
  case "rect": {
1240
1240
  let t = {
1241
1241
  ...e,
1242
- paint: yt(e.paint)
1242
+ paint: vt(e.paint)
1243
1243
  };
1244
1244
  return e.paint.stroke ? [{
1245
1245
  ...e,
1246
1246
  paint: {
1247
- ...bt(e.paint),
1247
+ ...yt(e.paint),
1248
1248
  fill: void 0
1249
1249
  }
1250
1250
  }, t] : t;
@@ -1252,12 +1252,12 @@ var xt = { transform(e) {
1252
1252
  case "circle": {
1253
1253
  let t = {
1254
1254
  ...e,
1255
- paint: yt(e.paint)
1255
+ paint: vt(e.paint)
1256
1256
  };
1257
1257
  return e.paint.stroke ? [{
1258
1258
  ...e,
1259
1259
  paint: {
1260
- ...bt(e.paint),
1260
+ ...yt(e.paint),
1261
1261
  fill: void 0
1262
1262
  }
1263
1263
  }, t] : t;
@@ -1267,17 +1267,17 @@ var xt = { transform(e) {
1267
1267
  ...e,
1268
1268
  paint: e.paint.stroke ? {
1269
1269
  ...e.paint,
1270
- stroke: gt(e.paint.stroke)
1270
+ stroke: ht(e.paint.stroke)
1271
1271
  } : e.paint
1272
1272
  };
1273
1273
  return e.paint.stroke ? [{
1274
1274
  ...e,
1275
- paint: bt(e.paint, !0)
1275
+ paint: yt(e.paint, !0)
1276
1276
  }, t] : t;
1277
1277
  }
1278
1278
  case "polygon": return {
1279
1279
  ...e,
1280
- paint: yt(e.paint)
1280
+ paint: vt(e.paint)
1281
1281
  };
1282
1282
  case "text": return {
1283
1283
  ...e,
@@ -1289,16 +1289,16 @@ var xt = { transform(e) {
1289
1289
  } };
1290
1290
  //#endregion
1291
1291
  //#region src/style/shape/wobble.ts
1292
- function R(e) {
1292
+ function z(e) {
1293
1293
  let t = e | 0 || 1;
1294
1294
  return () => (t = t * 1664525 + 1013904223 | 0, (t >>> 0) / 4294967296);
1295
1295
  }
1296
- function z(...e) {
1296
+ function B(...e) {
1297
1297
  let t = 2654435769;
1298
1298
  for (let n of e) t ^= (n * 1e3 | 0) + 2654435769 + (t << 6) + (t >> 2);
1299
1299
  return t;
1300
1300
  }
1301
- function St(e, t, n, r, i, a) {
1301
+ function xt(e, t, n, r, i, a) {
1302
1302
  let o = n - e, s = r - t, c = Math.sqrt(o * o + s * s);
1303
1303
  if (c < .001) return [
1304
1304
  e,
@@ -1313,17 +1313,17 @@ function St(e, t, n, r, i, a) {
1313
1313
  }
1314
1314
  return f.push(n + l * (a() - .5) * i * .3, r + u * (a() - .5) * i * .3), f;
1315
1315
  }
1316
- function Ct(e, t, n) {
1316
+ function St(e, t, n) {
1317
1317
  if (e.length < 4) return e;
1318
1318
  let r = [];
1319
1319
  for (let i = 0; i < e.length - 2; i += 2) {
1320
- let a = St(e[i], e[i + 1], e[i + 2], e[i + 3], t, n);
1320
+ let a = xt(e[i], e[i + 1], e[i + 2], e[i + 3], t, n);
1321
1321
  if (i === 0) r.push(...a);
1322
1322
  else for (let e = 2; e < a.length; e++) r.push(a[e]);
1323
1323
  }
1324
1324
  return r;
1325
1325
  }
1326
- function B(e, t, n, r, i, a) {
1326
+ function V(e, t, n, r, i, a) {
1327
1327
  let o = [
1328
1328
  e,
1329
1329
  t,
@@ -1335,12 +1335,12 @@ function B(e, t, n, r, i, a) {
1335
1335
  t + r
1336
1336
  ], s = [];
1337
1337
  for (let e = 0; e < 4; e++) {
1338
- let t = o[e * 2], n = o[e * 2 + 1], r = (e + 1) % 4, c = o[r * 2], l = o[r * 2 + 1], u = St(t, n, c, l, i, a);
1338
+ let t = o[e * 2], n = o[e * 2 + 1], r = (e + 1) % 4, c = o[r * 2], l = o[r * 2 + 1], u = xt(t, n, c, l, i, a);
1339
1339
  for (let e = 0; e < u.length - 2; e++) s.push(u[e]);
1340
1340
  }
1341
1341
  return s;
1342
1342
  }
1343
- function V(e, t, n, r, i) {
1343
+ function Ct(e, t, n, r, i) {
1344
1344
  let a = [];
1345
1345
  for (let o = 0; o < 24; o++) {
1346
1346
  let s = o / 24 * Math.PI * 2, c = n + (i() - .5) * 2 * r;
@@ -1353,7 +1353,7 @@ function H(e, t, n) {
1353
1353
  if (r < 2) return e;
1354
1354
  let i = [];
1355
1355
  for (let a = 0; a < r; a++) {
1356
- let o = e[a * 2], s = e[a * 2 + 1], c = (a + 1) % r, l = e[c * 2], u = e[c * 2 + 1], d = St(o, s, l, u, t, n);
1356
+ let o = e[a * 2], s = e[a * 2 + 1], c = (a + 1) % r, l = e[c * 2], u = e[c * 2 + 1], d = xt(o, s, l, u, t, n);
1357
1357
  for (let e = 0; e < d.length - 2; e++) i.push(d[e]);
1358
1358
  }
1359
1359
  return i;
@@ -1372,7 +1372,7 @@ function Tt(e) {
1372
1372
  return { transform(e) {
1373
1373
  switch (e.type) {
1374
1374
  case "rect": {
1375
- let r = R(z(e.x, e.y, e.width, e.height)), i = e.paint.fill ? "#ffffff" : void 0, a = e.paint.stroke ? n : void 0;
1375
+ let r = z(B(e.x, e.y, e.width, e.height)), i = e.paint.fill ? "#ffffff" : void 0, a = e.paint.stroke ? n : void 0;
1376
1376
  if (e.cornerRadius && e.cornerRadius > 0) {
1377
1377
  let n = [];
1378
1378
  if (i && n.push({
@@ -1385,7 +1385,7 @@ function Tt(e) {
1385
1385
  }), a && e.paint.strokeWidth) {
1386
1386
  let i = {
1387
1387
  type: "polygon",
1388
- vertices: B(e.x, e.y, e.width, e.height, t, r),
1388
+ vertices: V(e.x, e.y, e.width, e.height, t, r),
1389
1389
  paint: {
1390
1390
  stroke: a,
1391
1391
  strokeWidth: e.paint.strokeWidth
@@ -1400,7 +1400,7 @@ function Tt(e) {
1400
1400
  }
1401
1401
  return {
1402
1402
  type: "polygon",
1403
- vertices: B(e.x, e.y, e.width, e.height, t, r),
1403
+ vertices: V(e.x, e.y, e.width, e.height, t, r),
1404
1404
  paint: {
1405
1405
  fill: i,
1406
1406
  stroke: a,
@@ -1412,10 +1412,10 @@ function Tt(e) {
1412
1412
  };
1413
1413
  }
1414
1414
  case "circle": {
1415
- let r = R(z(e.cx, e.cy, e.radius));
1415
+ let r = z(B(e.cx, e.cy, e.radius));
1416
1416
  return {
1417
1417
  type: "polygon",
1418
- vertices: V(e.cx, e.cy, e.radius, t, r),
1418
+ vertices: Ct(e.cx, e.cy, e.radius, t, r),
1419
1419
  paint: {
1420
1420
  fill: e.paint.fill ? "#ffffff" : void 0,
1421
1421
  stroke: e.paint.stroke ? n : void 0,
@@ -1427,7 +1427,7 @@ function Tt(e) {
1427
1427
  };
1428
1428
  }
1429
1429
  case "line": {
1430
- let r = R(z(...e.points.slice(0, 4))), i = Ct(e.points, t, r), a = wt(n, e.paint.stroke), o = {
1430
+ let r = z(B(...e.points.slice(0, 4))), i = St(e.points, t, r), a = wt(n, e.paint.stroke), o = {
1431
1431
  ...e.paint,
1432
1432
  stroke: a
1433
1433
  };
@@ -1438,7 +1438,7 @@ function Tt(e) {
1438
1438
  };
1439
1439
  }
1440
1440
  case "polygon": {
1441
- let r = R(z(...e.vertices.slice(0, 4))), i = H(e.vertices, t, r);
1441
+ let r = z(B(...e.vertices.slice(0, 4))), i = H(e.vertices, t, r);
1442
1442
  return {
1443
1443
  ...e,
1444
1444
  vertices: i,
@@ -1902,12 +1902,12 @@ var Ut = { transform(e, t) {
1902
1902
  case "image":
1903
1903
  case "group": return e;
1904
1904
  }
1905
- } }, Wt = "#c8eeff", Gt = "#00c8ff", Kt = "#00ffaa", qt = .2, Jt = 5, Yt = 190;
1906
- function Xt(e, t, n) {
1905
+ } }, Wt = "#c8eeff", Gt = "#00c8ff", Kt = "#00ffaa", qt = .2, Jt = 5, q = 190;
1906
+ function Yt(e, t, n) {
1907
1907
  e /= 255, t /= 255, n /= 255;
1908
1908
  let r = Math.max(e, t, n), i = Math.min(e, t, n), a = (r + i) / 2;
1909
1909
  if (r === i) return [
1910
- Yt,
1910
+ q,
1911
1911
  0,
1912
1912
  a
1913
1913
  ];
@@ -1918,34 +1918,34 @@ function Xt(e, t, n) {
1918
1918
  a
1919
1919
  ];
1920
1920
  }
1921
- function Zt(e, t, n, r = 1) {
1921
+ function Xt(e, t, n, r = 1) {
1922
1922
  e = (e % 360 + 360) % 360;
1923
1923
  let i = (1 - Math.abs(2 * n - 1)) * t, a = i * (1 - Math.abs(e / 60 % 2 - 1)), o = n - i / 2, s, c, l;
1924
1924
  e < 60 ? (s = i, c = a, l = 0) : e < 120 ? (s = a, c = i, l = 0) : e < 180 ? (s = 0, c = i, l = a) : e < 240 ? (s = 0, c = a, l = i) : e < 300 ? (s = a, c = 0, l = i) : (s = i, c = 0, l = a);
1925
1925
  let u = Math.round((s + o) * 255), d = Math.round((c + o) * 255), f = Math.round((l + o) * 255);
1926
1926
  return r < 1 ? `rgba(${u},${d},${f},${r})` : `rgb(${u},${d},${f})`;
1927
1927
  }
1928
- function Qt(e) {
1928
+ function Zt(e) {
1929
1929
  let t = F(e);
1930
- if (!t) return Zt(Yt, .55, .18);
1931
- let [n, r] = Xt(t.r, t.g, t.b);
1932
- return Zt(r < .08 ? Yt : n, .55, .18, t.a);
1930
+ if (!t) return Xt(q, .55, .18);
1931
+ let [n, r] = Yt(t.r, t.g, t.b);
1932
+ return Xt(r < .08 ? q : n, .55, .18, t.a);
1933
1933
  }
1934
- function $t(e) {
1934
+ function Qt(e) {
1935
1935
  return {
1936
1936
  ...e,
1937
- fill: P(e.fill, Qt),
1937
+ fill: P(e.fill, Zt),
1938
1938
  stroke: e.stroke ? Gt : e.stroke
1939
1939
  };
1940
1940
  }
1941
- function en(e) {
1941
+ function $t(e) {
1942
1942
  return {
1943
1943
  stroke: Gt,
1944
1944
  strokeWidth: (e.strokeWidth ?? 1) * Jt,
1945
1945
  alpha: qt
1946
1946
  };
1947
1947
  }
1948
- function tn(e) {
1948
+ function en(e) {
1949
1949
  return {
1950
1950
  stroke: Kt,
1951
1951
  strokeWidth: (e.strokeWidth ?? 1) * Jt,
@@ -1954,18 +1954,18 @@ function tn(e) {
1954
1954
  dashEnabled: e.dashEnabled
1955
1955
  };
1956
1956
  }
1957
- var nn = { transform(e) {
1957
+ var tn = { transform(e) {
1958
1958
  switch (e.type) {
1959
1959
  case "rect": {
1960
1960
  let t = {
1961
1961
  ...e,
1962
- paint: $t(e.paint)
1962
+ paint: Qt(e.paint)
1963
1963
  };
1964
1964
  return e.paint.stroke ? [{
1965
1965
  ...e,
1966
1966
  hit: void 0,
1967
1967
  paint: {
1968
- ...en(e.paint),
1968
+ ...$t(e.paint),
1969
1969
  fill: void 0
1970
1970
  }
1971
1971
  }, t] : t;
@@ -1973,13 +1973,13 @@ var nn = { transform(e) {
1973
1973
  case "circle": {
1974
1974
  let t = {
1975
1975
  ...e,
1976
- paint: $t(e.paint)
1976
+ paint: Qt(e.paint)
1977
1977
  };
1978
1978
  return e.paint.stroke ? [{
1979
1979
  ...e,
1980
1980
  hit: void 0,
1981
1981
  paint: {
1982
- ...en(e.paint),
1982
+ ...$t(e.paint),
1983
1983
  fill: void 0
1984
1984
  }
1985
1985
  }, t] : t;
@@ -2002,7 +2002,7 @@ var nn = { transform(e) {
2002
2002
  return e.paint.stroke ? [{
2003
2003
  ...e,
2004
2004
  hit: void 0,
2005
- paint: tn(e.paint)
2005
+ paint: en(e.paint)
2006
2006
  }, t] : t;
2007
2007
  }
2008
2008
  case "polygon": return {
@@ -2020,12 +2020,12 @@ var nn = { transform(e) {
2020
2020
  case "image":
2021
2021
  case "group": return e;
2022
2022
  }
2023
- } }, rn = {
2023
+ } }, nn = {
2024
2024
  lighten: .35,
2025
2025
  darken: .25
2026
2026
  };
2027
- function an(e = {}) {
2028
- let t = e.lighten ?? rn.lighten, n = e.darken ?? rn.darken;
2027
+ function rn(e = {}) {
2028
+ let t = e.lighten ?? nn.lighten, n = e.darken ?? nn.darken;
2029
2029
  function r(e, r, i, o, s) {
2030
2030
  let c = e.fill;
2031
2031
  if (typeof c != "string") return e;
@@ -2076,124 +2076,124 @@ function an(e = {}) {
2076
2076
  }
2077
2077
  //#endregion
2078
2078
  //#region src/style/shape/StainedGlassStyle.ts
2079
- var on = "#0a0a0a", sn = "#f4f0e0", cn = .6, ln = .4, un = .62, dn = 2.2, fn = .06;
2080
- function pn(e) {
2079
+ var an = "#0a0a0a", on = "#f4f0e0", sn = .6, cn = .4, ln = .62, un = 2.2, dn = .06;
2080
+ function fn(e) {
2081
2081
  let t = F(e);
2082
2082
  if (!t) return e;
2083
2083
  let [n, r, i] = Re(t.r, t.g, t.b);
2084
- return ze(n, r < .08 ? r : Math.max(r, cn), Math.min(un, Math.max(ln, i)), t.a);
2084
+ return ze(n, r < .08 ? r : Math.max(r, sn), Math.min(ln, Math.max(cn, i)), t.a);
2085
2085
  }
2086
- function mn(e) {
2087
- return Math.max((e ?? .04) * dn, fn);
2086
+ function pn(e) {
2087
+ return Math.max((e ?? .04) * un, dn);
2088
2088
  }
2089
- function hn(e) {
2090
- let t = P(e.fill, pn), n = t !== void 0 || e.stroke !== void 0;
2089
+ function mn(e) {
2090
+ let t = P(e.fill, fn), n = t !== void 0 || e.stroke !== void 0;
2091
2091
  return {
2092
2092
  ...e,
2093
2093
  fill: t,
2094
- stroke: n ? on : void 0,
2095
- strokeWidth: n ? mn(e.strokeWidth) : e.strokeWidth,
2094
+ stroke: n ? an : void 0,
2095
+ strokeWidth: n ? pn(e.strokeWidth) : e.strokeWidth,
2096
2096
  dash: void 0,
2097
2097
  dashEnabled: void 0
2098
2098
  };
2099
2099
  }
2100
- var gn = { transform(e) {
2100
+ var hn = { transform(e) {
2101
2101
  switch (e.type) {
2102
2102
  case "rect":
2103
2103
  case "circle":
2104
2104
  case "polygon": return {
2105
2105
  ...e,
2106
- paint: hn(e.paint)
2106
+ paint: mn(e.paint)
2107
2107
  };
2108
2108
  case "line": return {
2109
2109
  ...e,
2110
2110
  paint: e.paint.stroke ? {
2111
2111
  ...e.paint,
2112
- stroke: on,
2113
- strokeWidth: mn(e.paint.strokeWidth)
2112
+ stroke: an,
2113
+ strokeWidth: pn(e.paint.strokeWidth)
2114
2114
  } : e.paint
2115
2115
  };
2116
2116
  case "text": return {
2117
2117
  ...e,
2118
- fill: sn
2118
+ fill: on
2119
2119
  };
2120
2120
  case "image":
2121
2121
  case "group": return e;
2122
2122
  }
2123
- } }, _n = "#1c3f6e", vn = 1.4, yn = .05, bn = 198, xn = 212, Sn = 230, Cn = 248, wn = 250, Tn = 255;
2124
- function En(e) {
2123
+ } }, gn = "#1c3f6e", _n = 1.4, vn = .05, yn = 198, bn = 212, xn = 230, Sn = 248, Cn = 250, wn = 255;
2124
+ function Tn(e) {
2125
2125
  let t = F(e);
2126
- if (!t) return I(Cn, wn, Tn);
2126
+ if (!t) return I(Sn, Cn, wn);
2127
2127
  let n = L(t);
2128
- return I(Math.round(bn + (Cn - bn) * n), Math.round(xn + (wn - xn) * n), Math.round(Sn + (Tn - Sn) * n), t.a);
2128
+ return I(Math.round(yn + (Sn - yn) * n), Math.round(bn + (Cn - bn) * n), Math.round(xn + (wn - xn) * n), t.a);
2129
2129
  }
2130
- function Dn(e) {
2130
+ function En(e) {
2131
2131
  let t = F(e);
2132
- if (!t || t.a >= 1) return _n;
2133
- let n = F(_n);
2132
+ if (!t || t.a >= 1) return gn;
2133
+ let n = F(gn);
2134
2134
  return I(n.r, n.g, n.b, t.a);
2135
2135
  }
2136
- function On(e) {
2137
- return Math.max((e ?? .04) * vn, yn);
2136
+ function Dn(e) {
2137
+ return Math.max((e ?? .04) * _n, vn);
2138
2138
  }
2139
- function kn(e) {
2139
+ function On(e) {
2140
2140
  return {
2141
2141
  ...e,
2142
- fill: P(e.fill, En),
2143
- stroke: e.stroke ? Dn(e.stroke) : e.stroke,
2144
- strokeWidth: e.stroke ? On(e.strokeWidth) : e.strokeWidth
2142
+ fill: P(e.fill, Tn),
2143
+ stroke: e.stroke ? En(e.stroke) : e.stroke,
2144
+ strokeWidth: e.stroke ? Dn(e.strokeWidth) : e.strokeWidth
2145
2145
  };
2146
2146
  }
2147
- var An = { transform(e) {
2147
+ var kn = { transform(e) {
2148
2148
  switch (e.type) {
2149
2149
  case "rect":
2150
2150
  case "circle":
2151
2151
  case "polygon": return {
2152
2152
  ...e,
2153
- paint: kn(e.paint)
2153
+ paint: On(e.paint)
2154
2154
  };
2155
2155
  case "line": return e.paint.stroke ? {
2156
2156
  ...e,
2157
2157
  paint: {
2158
2158
  ...e.paint,
2159
- stroke: Dn(e.paint.stroke),
2160
- strokeWidth: e.grid ? e.paint.strokeWidth : On(e.paint.strokeWidth)
2159
+ stroke: En(e.paint.stroke),
2160
+ strokeWidth: e.grid ? e.paint.strokeWidth : Dn(e.paint.strokeWidth)
2161
2161
  }
2162
2162
  } : e;
2163
2163
  case "text": return {
2164
2164
  ...e,
2165
- fill: _n
2165
+ fill: gn
2166
2166
  };
2167
2167
  case "image":
2168
2168
  case "group": return e;
2169
2169
  }
2170
- } }, jn = "#7a6a48", Mn = "#8a7a55", Nn = "#4a3f28", Pn = 78, Fn = 93, In = 52, Ln = 221, Rn = 207, zn = 166, Bn = 2, Vn = .26, Hn = .02;
2171
- function Un(e) {
2170
+ } }, An = "#7a6a48", jn = "#8a7a55", Mn = "#4a3f28", Nn = 78, Pn = 93, Fn = 52, In = 221, Ln = 207, Rn = 166, zn = 2, Bn = .26, Vn = .02;
2171
+ function Hn(e) {
2172
2172
  let t = F(e);
2173
- if (!t) return I(Ln, Rn, zn);
2173
+ if (!t) return I(In, Ln, Rn);
2174
2174
  let n = L(t);
2175
- return I(Math.round(Pn + (Ln - Pn) * n), Math.round(Fn + (Rn - Fn) * n), Math.round(In + (zn - In) * n), t.a);
2175
+ return I(Math.round(Nn + (In - Nn) * n), Math.round(Pn + (Ln - Pn) * n), Math.round(Fn + (Rn - Fn) * n), t.a);
2176
2176
  }
2177
- function Wn(e) {
2177
+ function Un(e) {
2178
2178
  return {
2179
2179
  ...e,
2180
- fill: P(e.fill, Un),
2181
- stroke: e.stroke ? jn : e.stroke
2180
+ fill: P(e.fill, Hn),
2181
+ stroke: e.stroke ? An : e.stroke
2182
2182
  };
2183
2183
  }
2184
- var Gn = {
2185
- stroke: jn,
2186
- strokeWidth: Hn
2187
- }, Kn = { transform(e) {
2184
+ var Wn = {
2185
+ stroke: An,
2186
+ strokeWidth: Vn
2187
+ }, Gn = { transform(e) {
2188
2188
  switch (e.type) {
2189
2189
  case "rect": {
2190
2190
  let t = {
2191
2191
  ...e,
2192
- paint: Wn(e.paint)
2192
+ paint: Un(e.paint)
2193
2193
  };
2194
2194
  if (!e.paint.fill) return t;
2195
- let n = [t], r = Math.min(e.width, e.height) / 2 * Vn, i = Math.min(e.width, e.height) * .12;
2196
- for (let t = 1; t <= Bn; t++) {
2195
+ let n = [t], r = Math.min(e.width, e.height) / 2 * Bn, i = Math.min(e.width, e.height) * .12;
2196
+ for (let t = 1; t <= zn; t++) {
2197
2197
  let a = r * t, o = e.width - a * 2, s = e.height - a * 2;
2198
2198
  if (o <= i || s <= i) break;
2199
2199
  n.push({
@@ -2203,7 +2203,7 @@ var Gn = {
2203
2203
  width: o,
2204
2204
  height: s,
2205
2205
  cornerRadius: e.cornerRadius,
2206
- paint: Gn,
2206
+ paint: Wn,
2207
2207
  layer: e.layer,
2208
2208
  noScale: e.noScale
2209
2209
  });
@@ -2213,11 +2213,11 @@ var Gn = {
2213
2213
  case "circle": {
2214
2214
  let t = {
2215
2215
  ...e,
2216
- paint: Wn(e.paint)
2216
+ paint: Un(e.paint)
2217
2217
  };
2218
2218
  if (!e.paint.fill) return t;
2219
- let n = [t], r = e.radius * Vn;
2220
- for (let t = 1; t <= Bn; t++) {
2219
+ let n = [t], r = e.radius * Bn;
2220
+ for (let t = 1; t <= zn; t++) {
2221
2221
  let i = e.radius - r * t;
2222
2222
  if (i <= e.radius * .12) break;
2223
2223
  n.push({
@@ -2225,7 +2225,7 @@ var Gn = {
2225
2225
  cx: e.cx,
2226
2226
  cy: e.cy,
2227
2227
  radius: i,
2228
- paint: Gn,
2228
+ paint: Wn,
2229
2229
  layer: e.layer,
2230
2230
  noScale: e.noScale
2231
2231
  });
@@ -2235,21 +2235,21 @@ var Gn = {
2235
2235
  case "polygon": {
2236
2236
  let t = {
2237
2237
  ...e,
2238
- paint: Wn(e.paint)
2238
+ paint: Un(e.paint)
2239
2239
  };
2240
2240
  if (!e.paint.fill) return t;
2241
2241
  let n = [t], r = e.vertices.length / 2, i = 0, a = 0;
2242
2242
  for (let t = 0; t < r; t++) i += e.vertices[t * 2], a += e.vertices[t * 2 + 1];
2243
2243
  i /= r, a /= r;
2244
- for (let t = 1; t <= Bn; t++) {
2245
- let o = 1 - Vn * t;
2244
+ for (let t = 1; t <= zn; t++) {
2245
+ let o = 1 - Bn * t;
2246
2246
  if (o <= .15) break;
2247
2247
  let s = [];
2248
2248
  for (let t = 0; t < r; t++) s.push(i + (e.vertices[t * 2] - i) * o, a + (e.vertices[t * 2 + 1] - a) * o);
2249
2249
  n.push({
2250
2250
  type: "polygon",
2251
2251
  vertices: s,
2252
- paint: Gn,
2252
+ paint: Wn,
2253
2253
  layer: e.layer,
2254
2254
  noScale: e.noScale
2255
2255
  });
@@ -2260,29 +2260,29 @@ var Gn = {
2260
2260
  ...e,
2261
2261
  paint: {
2262
2262
  ...e.paint,
2263
- stroke: Mn
2263
+ stroke: jn
2264
2264
  }
2265
2265
  } : e;
2266
2266
  case "text": return {
2267
2267
  ...e,
2268
- fill: Nn
2268
+ fill: Mn
2269
2269
  };
2270
2270
  case "image":
2271
2271
  case "group": return e;
2272
2272
  }
2273
- } }, qn = "#3a3a44";
2274
- function Jn(e, t) {
2273
+ } }, Kn = "#3a3a44";
2274
+ function qn(e, t) {
2275
2275
  return P(e, (e) => {
2276
2276
  let n = F(e);
2277
2277
  return n ? `rgba(${n.r}, ${n.g}, ${n.b}, ${(n.a * t).toFixed(3)})` : e;
2278
2278
  });
2279
2279
  }
2280
- function Yn(e = {}) {
2280
+ function Jn(e = {}) {
2281
2281
  let t = e.bleed ?? .05, n = Math.max(1, Math.min(4, e.layers ?? 2)), r = e.alpha ?? .4;
2282
2282
  function i(e, t, i, a, o, s) {
2283
- let c = Jn(t.fill, r), l = [];
2283
+ let c = qn(t.fill, r), l = [];
2284
2284
  for (let t = 0; t < n; t++) {
2285
- let n = R(i + t * 2654435769);
2285
+ let n = z(i + t * 2654435769);
2286
2286
  l.push({
2287
2287
  type: "polygon",
2288
2288
  vertices: e(n),
@@ -2301,10 +2301,10 @@ function Yn(e = {}) {
2301
2301
  switch (e.type) {
2302
2302
  case "rect":
2303
2303
  if (!e.paint.fill) {
2304
- let n = R(z(e.x, e.y, e.width, e.height));
2304
+ let n = z(B(e.x, e.y, e.width, e.height));
2305
2305
  return {
2306
2306
  type: "polygon",
2307
- vertices: B(e.x, e.y, e.width, e.height, t, n),
2307
+ vertices: V(e.x, e.y, e.width, e.height, t, n),
2308
2308
  paint: {
2309
2309
  stroke: e.paint.stroke,
2310
2310
  strokeWidth: e.paint.strokeWidth ?? 0,
@@ -2315,13 +2315,13 @@ function Yn(e = {}) {
2315
2315
  noScale: e.noScale
2316
2316
  };
2317
2317
  }
2318
- return i((n) => B(e.x, e.y, e.width, e.height, t, n), e.paint, z(e.x, e.y, e.width, e.height), e.layer, e.hit, e.noScale);
2318
+ return i((n) => V(e.x, e.y, e.width, e.height, t, n), e.paint, B(e.x, e.y, e.width, e.height), e.layer, e.hit, e.noScale);
2319
2319
  case "circle":
2320
2320
  if (!e.paint.fill) {
2321
- let n = R(z(e.cx, e.cy, e.radius));
2321
+ let n = z(B(e.cx, e.cy, e.radius));
2322
2322
  return {
2323
2323
  type: "polygon",
2324
- vertices: V(e.cx, e.cy, e.radius, t, n),
2324
+ vertices: Ct(e.cx, e.cy, e.radius, t, n),
2325
2325
  paint: {
2326
2326
  stroke: e.paint.stroke,
2327
2327
  strokeWidth: e.paint.strokeWidth ?? 0,
@@ -2332,10 +2332,10 @@ function Yn(e = {}) {
2332
2332
  noScale: e.noScale
2333
2333
  };
2334
2334
  }
2335
- return i((n) => V(e.cx, e.cy, e.radius, t, n), e.paint, z(e.cx, e.cy, e.radius), e.layer, e.hit, e.noScale);
2335
+ return i((n) => Ct(e.cx, e.cy, e.radius, t, n), e.paint, B(e.cx, e.cy, e.radius), e.layer, e.hit, e.noScale);
2336
2336
  case "polygon":
2337
2337
  if (!e.paint.fill) {
2338
- let n = R(z(...e.vertices.slice(0, 4)));
2338
+ let n = z(B(...e.vertices.slice(0, 4)));
2339
2339
  return {
2340
2340
  ...e,
2341
2341
  vertices: H(e.vertices, t, n),
@@ -2345,7 +2345,7 @@ function Yn(e = {}) {
2345
2345
  }
2346
2346
  };
2347
2347
  }
2348
- return i((n) => H(e.vertices, t, n), e.paint, z(...e.vertices.slice(0, 4)), e.layer, e.hit, e.noScale);
2348
+ return i((n) => H(e.vertices, t, n), e.paint, B(...e.vertices.slice(0, 4)), e.layer, e.hit, e.noScale);
2349
2349
  case "line": return {
2350
2350
  ...e,
2351
2351
  paint: {
@@ -2355,7 +2355,7 @@ function Yn(e = {}) {
2355
2355
  };
2356
2356
  case "text": return {
2357
2357
  ...e,
2358
- fill: qn
2358
+ fill: Kn
2359
2359
  };
2360
2360
  case "image":
2361
2361
  case "group": return e;
@@ -2364,32 +2364,32 @@ function Yn(e = {}) {
2364
2364
  }
2365
2365
  //#endregion
2366
2366
  //#region src/style/shape/DarkModernStyle.ts
2367
- var Xn = "rgba(255, 255, 255, 0.14)", Zn = "#5b6573", Qn = "#e6e8ec", $n = "rgba(0, 0, 0, 0.38)", er = .08, tr = .34;
2368
- function nr(e) {
2367
+ var Yn = "rgba(255, 255, 255, 0.14)", Xn = "#5b6573", Zn = "#e6e8ec", Qn = "rgba(0, 0, 0, 0.38)", $n = .08, er = .34;
2368
+ function tr(e) {
2369
2369
  let t = F(e);
2370
2370
  if (!t) return "rgb(38, 42, 48)";
2371
2371
  let [n, r, i] = Re(t.r, t.g, t.b);
2372
- return ze(n, Math.min(r, tr), .22 + i * .18, t.a);
2372
+ return ze(n, Math.min(r, er), .22 + i * .18, t.a);
2373
2373
  }
2374
- function rr(e) {
2374
+ function nr(e) {
2375
2375
  return {
2376
2376
  ...e,
2377
- fill: P(e.fill, nr),
2378
- stroke: e.stroke ? Xn : e.stroke
2377
+ fill: P(e.fill, tr),
2378
+ stroke: e.stroke ? Yn : e.stroke
2379
2379
  };
2380
2380
  }
2381
- function ir(e) {
2381
+ function rr(e) {
2382
2382
  return e.hit?.kind === "room" && e.paint.fill !== void 0;
2383
2383
  }
2384
- var ar = { transform(e, t) {
2384
+ var ir = { transform(e, t) {
2385
2385
  switch (e.type) {
2386
2386
  case "rect": {
2387
2387
  let n = {
2388
2388
  ...e,
2389
- paint: rr(e.paint)
2389
+ paint: nr(e.paint)
2390
2390
  };
2391
- if (!ir(e)) return n;
2392
- let r = t.roomSize * er;
2391
+ if (!rr(e)) return n;
2392
+ let r = t.roomSize * $n;
2393
2393
  return [{
2394
2394
  type: "rect",
2395
2395
  x: e.x + r,
@@ -2397,7 +2397,7 @@ var ar = { transform(e, t) {
2397
2397
  width: e.width,
2398
2398
  height: e.height,
2399
2399
  cornerRadius: e.cornerRadius,
2400
- paint: { fill: $n },
2400
+ paint: { fill: Qn },
2401
2401
  layer: e.layer,
2402
2402
  noScale: e.noScale
2403
2403
  }, n];
@@ -2405,49 +2405,49 @@ var ar = { transform(e, t) {
2405
2405
  case "circle": {
2406
2406
  let n = {
2407
2407
  ...e,
2408
- paint: rr(e.paint)
2408
+ paint: nr(e.paint)
2409
2409
  };
2410
- if (!ir(e)) return n;
2411
- let r = t.roomSize * er;
2410
+ if (!rr(e)) return n;
2411
+ let r = t.roomSize * $n;
2412
2412
  return [{
2413
2413
  type: "circle",
2414
2414
  cx: e.cx + r,
2415
2415
  cy: e.cy + r,
2416
2416
  radius: e.radius,
2417
- paint: { fill: $n },
2417
+ paint: { fill: Qn },
2418
2418
  layer: e.layer,
2419
2419
  noScale: e.noScale
2420
2420
  }, n];
2421
2421
  }
2422
2422
  case "polygon": return {
2423
2423
  ...e,
2424
- paint: rr(e.paint)
2424
+ paint: nr(e.paint)
2425
2425
  };
2426
2426
  case "line": return {
2427
2427
  ...e,
2428
2428
  paint: e.paint.stroke ? {
2429
2429
  ...e.paint,
2430
- stroke: Zn
2430
+ stroke: Xn
2431
2431
  } : e.paint
2432
2432
  };
2433
2433
  case "text": return {
2434
2434
  ...e,
2435
- fill: Qn
2435
+ fill: Zn
2436
2436
  };
2437
2437
  case "image":
2438
2438
  case "group": return e;
2439
2439
  }
2440
- } }, q = "#5a3a22", or = "#43301c", sr = 120, cr = 86, lr = 50, ur = 232, J = 205, dr = 158;
2440
+ } }, J = "#5a3a22", ar = "#43301c", or = 120, sr = 86, cr = 50, lr = 232, ur = 205, dr = 158;
2441
2441
  function fr(e) {
2442
2442
  let t = F(e);
2443
- if (!t) return I(ur, J, dr);
2443
+ if (!t) return I(lr, ur, dr);
2444
2444
  let n = L(t);
2445
- return I(Math.round(sr + (ur - sr) * n), Math.round(cr + (J - cr) * n), Math.round(lr + (dr - lr) * n), t.a);
2445
+ return I(Math.round(or + (lr - or) * n), Math.round(sr + (ur - sr) * n), Math.round(cr + (dr - cr) * n), t.a);
2446
2446
  }
2447
2447
  function pr(e) {
2448
2448
  let t = F(e);
2449
- if (!t || t.a >= 1) return q;
2450
- let n = F(q);
2449
+ if (!t || t.a >= 1) return J;
2450
+ let n = F(J);
2451
2451
  return I(n.r, n.g, n.b, t.a);
2452
2452
  }
2453
2453
  function mr(e) {
@@ -2474,7 +2474,7 @@ var hr = { transform(e) {
2474
2474
  };
2475
2475
  case "text": return {
2476
2476
  ...e,
2477
- fill: or
2477
+ fill: ar
2478
2478
  };
2479
2479
  case "image":
2480
2480
  case "group": return e;
@@ -2508,7 +2508,7 @@ function _r() {
2508
2508
  width: n - e * 2,
2509
2509
  height: r - e * 2,
2510
2510
  paint: {
2511
- stroke: q,
2511
+ stroke: J,
2512
2512
  strokeWidth: s
2513
2513
  },
2514
2514
  layer: "top"
@@ -2520,7 +2520,7 @@ function _r() {
2520
2520
  cy: d,
2521
2521
  radius: l * 1.25,
2522
2522
  paint: {
2523
- stroke: q,
2523
+ stroke: J,
2524
2524
  strokeWidth: s
2525
2525
  },
2526
2526
  layer: "top"
@@ -2528,8 +2528,8 @@ function _r() {
2528
2528
  type: "polygon",
2529
2529
  vertices: gr(u, d, l),
2530
2530
  paint: {
2531
- fill: I(ur, J, dr, .85),
2532
- stroke: q,
2531
+ fill: I(lr, ur, dr, .85),
2532
+ stroke: J,
2533
2533
  strokeWidth: s
2534
2534
  },
2535
2535
  layer: "top"
@@ -2538,7 +2538,7 @@ function _r() {
2538
2538
  cx: u,
2539
2539
  cy: d,
2540
2540
  radius: l * .16,
2541
- paint: { fill: q },
2541
+ paint: { fill: J },
2542
2542
  layer: "top"
2543
2543
  }), c.push({
2544
2544
  type: "text",
@@ -2547,7 +2547,7 @@ function _r() {
2547
2547
  text: "N",
2548
2548
  fontSize: l * .5,
2549
2549
  fontStyle: "bold",
2550
- fill: or,
2550
+ fill: ar,
2551
2551
  align: "center",
2552
2552
  verticalAlign: "middle",
2553
2553
  layer: "top"
@@ -2557,22 +2557,22 @@ function _r() {
2557
2557
  }
2558
2558
  //#endregion
2559
2559
  //#region src/style/index.ts
2560
- var vr = Ze, yr = lt, br = xt;
2560
+ var vr = Ze, yr = lt, br = bt;
2561
2561
  function xr(e) {
2562
2562
  return Tt(e);
2563
2563
  }
2564
2564
  function Sr(e = {}) {
2565
2565
  return At(e);
2566
2566
  }
2567
- var Cr = Ut, wr = nn;
2567
+ var Cr = Ut, wr = tn;
2568
2568
  function Tr(e = {}) {
2569
- return an(e);
2569
+ return rn(e);
2570
2570
  }
2571
- var Er = gn, Dr = An, Or = Kn;
2571
+ var Er = hn, Dr = kn, Or = Gn;
2572
2572
  function kr(e = {}) {
2573
- return Yn(e);
2573
+ return Jn(e);
2574
2574
  }
2575
- var Ar = ar, jr = hr, Mr = class {
2575
+ var Ar = ir, jr = hr, Mr = class {
2576
2576
  get settings() {
2577
2577
  return this.state.settings;
2578
2578
  }
@@ -3041,10 +3041,10 @@ function Yr(e, t, n) {
3041
3041
  function Xr(e, t, n) {
3042
3042
  switch (t.type) {
3043
3043
  case "rect":
3044
- e.beginPath(), t.cr > 0 && typeof e.roundRect == "function" ? e.roundRect(t.x, t.y, t.w, t.h, t.cr) : e.rect(t.x, t.y, t.w, t.h), t.fill && (e.fillStyle = A(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash(t.dash ?? []), e.stroke());
3044
+ e.beginPath(), t.cr > 0 && typeof e.roundRect == "function" ? e.roundRect(t.x, t.y, t.w, t.h, t.cr) : e.rect(t.x, t.y, t.w, t.h), t.fill && (e.fillStyle = k(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash(t.dash ?? []), e.stroke());
3045
3045
  break;
3046
3046
  case "circle":
3047
- e.beginPath(), e.arc(t.cx, t.cy, t.r, 0, Math.PI * 2), t.fill && (e.fillStyle = A(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash(t.dash ?? []), e.stroke());
3047
+ e.beginPath(), e.arc(t.cx, t.cy, t.r, 0, Math.PI * 2), t.fill && (e.fillStyle = k(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash(t.dash ?? []), e.stroke());
3048
3048
  break;
3049
3049
  case "line": {
3050
3050
  if (t.points.length < 4) break;
@@ -3058,7 +3058,7 @@ function Xr(e, t, n) {
3058
3058
  if (t.vertices.length < 4) break;
3059
3059
  e.beginPath(), e.moveTo(t.vertices[0], t.vertices[1]);
3060
3060
  for (let n = 2; n < t.vertices.length; n += 2) e.lineTo(t.vertices[n], t.vertices[n + 1]);
3061
- e.closePath(), t.fill && (e.fillStyle = A(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash([]), e.stroke());
3061
+ e.closePath(), t.fill && (e.fillStyle = k(e, t.fill), e.fill()), t.stroke && t.sw > 0 && (e.strokeStyle = t.stroke, e.lineWidth = t.sw, e.setLineDash([]), e.stroke());
3062
3062
  break;
3063
3063
  case "text": {
3064
3064
  let n = t.fontSize * 100, r = `${t.fontStyle} ${n}px ${t.fontFamily}`;
@@ -3134,13 +3134,13 @@ var ei = class {
3134
3134
  if (i === void 0 || a === void 0 || !o) return;
3135
3135
  let s = o, c = s.getPlane(a);
3136
3136
  if (!c) return;
3137
- let l = e.settings, d = this.options.padding ?? 3, f = e.computeExportBounds(s, c, this.options.roomId, d), p = r.forMapBounds(f.x, f.x + f.w, f.y, f.y + f.h).getViewportBounds(), m = k(new g(e.mapReader, l).buildScene(s, c, a, e.lens), p, l, {
3137
+ let l = e.settings, d = this.options.padding ?? 3, f = e.computeExportBounds(s, c, this.options.roomId, d), p = r.forMapBounds(f.x, f.x + f.w, f.y, f.y + f.h).getViewportBounds(), m = we(new g(e.mapReader, l).buildScene(s, c, a, e.lens), p, l, {
3138
3138
  forward: t.worldToScene ? (e, n) => t.worldToScene(e, n) : void 0,
3139
3139
  inverse: t.sceneToWorld ? (e, n) => t.sceneToWorld(e, n) : void 0
3140
3140
  }), h = {
3141
3141
  scale: 1,
3142
3142
  roomSize: l.roomSize
3143
- }, _ = (e) => t === u ? e : C(e, t, h), v = Zr(f, t, l.roomSize * .5), y = [];
3143
+ }, _ = (e) => t === u ? e : w(e, t, h), v = Zr(f, t, l.roomSize * .5), y = [];
3144
3144
  return y.push(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${v.x} ${v.y} ${v.w} ${v.h}">`), y.push(`<rect x="${v.x}" y="${v.y}" width="${v.w}" height="${v.h}" fill="${$r(l.backgroundColor)}"/>`), S(m, {
3145
3145
  state: e,
3146
3146
  viewportBounds: p,
@@ -3190,14 +3190,14 @@ var ii = class {
3190
3190
  if (i === void 0 || a === void 0 || !o) return;
3191
3191
  let s = o, c = s.getPlane(a);
3192
3192
  if (!c) return;
3193
- let l = e.settings, { width: d, height: f } = this.options, p = this.options.padding ?? 3, m = e.computeExportBounds(s, c, this.options.roomId, p), h = Zr(m, t, l.roomSize * .5), _ = Math.min(d / h.w, f / h.h), v = h.w * _, y = h.h * _, b = (d - v) / 2 - h.x * _, x = (f - y) / 2 - h.y * _, ee = {
3193
+ let l = e.settings, { width: d, height: f } = this.options, p = this.options.padding ?? 3, m = e.computeExportBounds(s, c, this.options.roomId, p), h = Zr(m, t, l.roomSize * .5), _ = Math.min(d / h.w, f / h.h), v = h.w * _, y = h.h * _, b = (d - v) / 2 - h.x * _, x = (f - y) / 2 - h.y * _, C = {
3194
3194
  scale: _,
3195
3195
  offsetX: b,
3196
3196
  offsetY: x
3197
- }, te = r.forRenderCamera(d, f, _, b, x), w = {
3197
+ }, ee = r.forRenderCamera(d, f, _, b, x), te = {
3198
3198
  forward: t.worldToScene ? (e, n) => t.worldToScene(e, n) : void 0,
3199
3199
  inverse: t.sceneToWorld ? (e, n) => t.sceneToWorld(e, n) : void 0
3200
- }, ne = k(new g(e.mapReader, l).buildScene(s, c, a, e.lens), te.getViewportBounds(), l, w), T = D.Util.createCanvasElement();
3200
+ }, ne = we(new g(e.mapReader, l).buildScene(s, c, a, e.lens), ee.getViewportBounds(), l, te), T = D.Util.createCanvasElement();
3201
3201
  T.width = d, T.height = f;
3202
3202
  let E = T.getContext("2d");
3203
3203
  if (!E) return;
@@ -3205,14 +3205,14 @@ var ii = class {
3205
3205
  let re = {
3206
3206
  scale: _,
3207
3207
  roomSize: l.roomSize
3208
- }, ie = (e) => t === u ? e : C(e, t, re);
3208
+ }, ie = (e) => t === u ? e : w(e, t, re);
3209
3209
  return S(ne, {
3210
3210
  state: e,
3211
3211
  viewportBounds: r.forMapBounds(m.x, m.x + m.w, m.y, m.y + m.h).getViewportBounds(),
3212
3212
  sceneOverlays: n,
3213
3213
  overlays: this.options.overlays
3214
3214
  }, (e, t) => {
3215
- e.length !== 0 && Jr(E, Pr(t ? e : ie(e), ee));
3215
+ e.length !== 0 && Jr(E, Pr(t ? e : ie(e), C));
3216
3216
  }), T;
3217
3217
  }
3218
3218
  }, ai = class {
@@ -3524,8 +3524,156 @@ function wi(e, t, n = {}) {
3524
3524
  return s;
3525
3525
  }
3526
3526
  //#endregion
3527
- //#region node_modules/node-dijkstra/libs/PriorityQueue.js
3528
- var Ti = /* @__PURE__ */ O(((e, t) => {
3527
+ //#region src/overlay/WaypointOverlay.ts
3528
+ var Ti = class {
3529
+ constructor() {
3530
+ this.waypoints = [], this.placed = [];
3531
+ }
3532
+ set(e) {
3533
+ this.waypoints = [...e], this.ctx?.invalidate();
3534
+ }
3535
+ add(e) {
3536
+ this.waypoints.push(e), this.ctx?.invalidate();
3537
+ }
3538
+ remove(e) {
3539
+ let t = this.waypoints.length;
3540
+ this.waypoints = this.waypoints.filter((t) => t.roomId !== e), this.waypoints.length !== t && this.ctx?.invalidate();
3541
+ }
3542
+ has(e) {
3543
+ return this.waypoints.some((t) => t.roomId === e);
3544
+ }
3545
+ hitTest(e, t) {
3546
+ for (let n = this.placed.length - 1; n >= 0; n--) {
3547
+ let r = this.placed[n];
3548
+ if (e >= r.x && e <= r.x + r.width && t >= r.y && t <= r.y + r.height) return r.wp;
3549
+ }
3550
+ }
3551
+ attach(e) {
3552
+ this.ctx = e;
3553
+ }
3554
+ detach() {
3555
+ this.ctx = void 0, this.placed = [];
3556
+ }
3557
+ render(e, t) {
3558
+ this.placed = [];
3559
+ let n = e.currentArea, r = e.currentZIndex;
3560
+ if (n === void 0 || r === void 0 || this.waypoints.length === 0) return [];
3561
+ let i = e.currentAreaInstance?.getPlane(r);
3562
+ if (!i) return [];
3563
+ let a = e.settings.roomSize, o = a * .6, s = o * .5, c = o * 1.2, l = i.getRooms(), u = l.map((e) => ({
3564
+ x: e.x - a / 2,
3565
+ y: e.y - a / 2,
3566
+ width: a,
3567
+ height: a,
3568
+ kind: "room"
3569
+ })), d = (e, t, n, r) => u.push({
3570
+ x: Math.min(e, n) - .03,
3571
+ y: Math.min(t, r) - .03,
3572
+ width: Math.abs(n - e) + .06,
3573
+ height: Math.abs(r - t) + .06,
3574
+ kind: "exit"
3575
+ });
3576
+ for (let t of l) for (let i of [...Object.values(t.exits), ...Object.values(t.specialExits)]) {
3577
+ let a = e.mapReader.getRoom(i);
3578
+ a && a.area === n && a.z === r && d(t.x, t.y, a.x, a.y);
3579
+ }
3580
+ let f = [], p = [];
3581
+ for (let t of this.waypoints) {
3582
+ let i = e.mapReader.getRoom(t.roomId);
3583
+ if (!i || i.area !== n || i.z !== r) continue;
3584
+ let a = Array.isArray(t.label) ? t.label : [t.label], l = a.reduce((e, t) => Math.max(e, t.length), 0) * o * .6 + s * 2, u = a.length * c + o * .4;
3585
+ f.push({
3586
+ x: i.x,
3587
+ y: i.y,
3588
+ width: l,
3589
+ height: u,
3590
+ id: f.length,
3591
+ preferred: t.preferred
3592
+ }), p.push({
3593
+ wp: t,
3594
+ rx: i.x,
3595
+ ry: i.y,
3596
+ lines: a
3597
+ });
3598
+ }
3599
+ if (f.length === 0) return [];
3600
+ let m = "rgba(20, 20, 24, 0.82)", h = wi(f, u, {
3601
+ offset: a * .7,
3602
+ extend: a * 4,
3603
+ clearCap: a * 1.5,
3604
+ minClearance: a * .7
3605
+ }), g = [];
3606
+ for (let t = 0; t < h.length; t++) {
3607
+ let n = h[t], { wp: r, rx: i, ry: s } = p[t], l = r.color ?? "#ffcc33", u = i - (n.x + n.width / 2), d = s - (n.y + n.height / 2), f = Math.hypot(u, d) || 1, _ = u / f, v = d / f, y = o * .7, b = o * .5, x = n.direction.length === 2, S;
3608
+ if (x) {
3609
+ let e = _ < 0 ? n.x : n.x + n.width, t = v < 0 ? n.y : n.y + n.height, r = o * .85;
3610
+ S = [
3611
+ e + (_ < 0 ? r : -r),
3612
+ t,
3613
+ e + _ * y,
3614
+ t + v * y,
3615
+ e,
3616
+ t + (v < 0 ? r : -r)
3617
+ ];
3618
+ } else {
3619
+ let e = Math.abs(u), t = Math.abs(d), r = (e > 1e-6 ? n.width / 2 / e : Infinity) <= (t > 1e-6 ? n.height / 2 / t : Infinity), i = r ? _ < 0 ? n.x : n.x + n.width : n.x + n.width / 2, a = r ? n.y + n.height / 2 : v < 0 ? n.y : n.y + n.height, o = +!r, s = +!!r;
3620
+ S = [
3621
+ i + o * b,
3622
+ a + s * b,
3623
+ i + _ * y,
3624
+ a + v * y,
3625
+ i - o * b,
3626
+ a - s * b
3627
+ ];
3628
+ }
3629
+ g.push({
3630
+ type: "polygon",
3631
+ vertices: S,
3632
+ paint: {
3633
+ fill: m,
3634
+ stroke: l,
3635
+ strokeWidth: a * .03
3636
+ },
3637
+ layer: "top"
3638
+ }), g.push({
3639
+ type: "rect",
3640
+ x: n.x,
3641
+ y: n.y,
3642
+ width: n.width,
3643
+ height: n.height,
3644
+ cornerRadius: o * .3,
3645
+ paint: {
3646
+ fill: m,
3647
+ stroke: l,
3648
+ strokeWidth: a * .03
3649
+ },
3650
+ layer: "top"
3651
+ }), this.placed.push({
3652
+ wp: r,
3653
+ x: n.x,
3654
+ y: n.y,
3655
+ width: n.width,
3656
+ height: n.height
3657
+ });
3658
+ let C = p[t].lines, ee = (n.height - C.length * c) / 2;
3659
+ for (let t = 0; t < C.length; t++) g.push({
3660
+ type: "text",
3661
+ x: n.x,
3662
+ y: n.y + ee + t * c,
3663
+ width: n.width,
3664
+ height: c,
3665
+ text: C[t],
3666
+ fontSize: o,
3667
+ fontFamily: e.settings.fontFamily,
3668
+ fill: "#f4f4f6",
3669
+ align: "center",
3670
+ verticalAlign: "middle",
3671
+ layer: "top"
3672
+ });
3673
+ }
3674
+ return g;
3675
+ }
3676
+ }, Ei = /* @__PURE__ */ O(((e, t) => {
3529
3677
  t.exports = class {
3530
3678
  constructor() {
3531
3679
  this.keys = /* @__PURE__ */ new Set(), this.queue = [];
@@ -3555,14 +3703,14 @@ var Ti = /* @__PURE__ */ O(((e, t) => {
3555
3703
  return this.queue.find((t) => t.key === e);
3556
3704
  }
3557
3705
  };
3558
- })), Ei = /* @__PURE__ */ O(((e, t) => {
3706
+ })), Di = /* @__PURE__ */ O(((e, t) => {
3559
3707
  function n(e, t) {
3560
3708
  let r = /* @__PURE__ */ new Map();
3561
3709
  for (let [i, a] of e) i !== t && a instanceof Map ? r.set(i, n(a, t)) : i !== t && r.set(i, a);
3562
3710
  return r;
3563
3711
  }
3564
3712
  t.exports = n;
3565
- })), Di = /* @__PURE__ */ O(((e, t) => {
3713
+ })), Oi = /* @__PURE__ */ O(((e, t) => {
3566
3714
  function n(e) {
3567
3715
  let t = Number(e);
3568
3716
  return !(isNaN(t) || t <= 0);
@@ -3577,7 +3725,7 @@ var Ti = /* @__PURE__ */ O(((e, t) => {
3577
3725
  }), t;
3578
3726
  }
3579
3727
  t.exports = r;
3580
- })), Oi = /* @__PURE__ */ O(((e, t) => {
3728
+ })), ki = /* @__PURE__ */ O(((e, t) => {
3581
3729
  function n(e) {
3582
3730
  if (!(e instanceof Map)) throw Error(`Invalid graph: Expected Map instead found ${typeof e}`);
3583
3731
  e.forEach((e, t) => {
@@ -3589,8 +3737,8 @@ var Ti = /* @__PURE__ */ O(((e, t) => {
3589
3737
  });
3590
3738
  }
3591
3739
  t.exports = n;
3592
- })), ki = /* @__PURE__ */ he((/* @__PURE__ */ O(((e, t) => {
3593
- var n = Ti(), r = Ei(), i = Di(), a = Oi();
3740
+ })), Ai = /* @__PURE__ */ he((/* @__PURE__ */ O(((e, t) => {
3741
+ var n = Ei(), r = Di(), i = Oi(), a = ki();
3594
3742
  t.exports = class {
3595
3743
  constructor(e) {
3596
3744
  e instanceof Map ? (a(e), this.graph = e) : e ? this.graph = i(e) : this.graph = /* @__PURE__ */ new Map();
@@ -3640,7 +3788,7 @@ var Ti = /* @__PURE__ */ O(((e, t) => {
3640
3788
  return this.path(...e);
3641
3789
  }
3642
3790
  };
3643
- })))(), 1), Ai = {
3791
+ })))(), 1), ji = {
3644
3792
  1: "north",
3645
3793
  2: "northeast",
3646
3794
  3: "northwest",
@@ -3653,7 +3801,7 @@ var Ti = /* @__PURE__ */ O(((e, t) => {
3653
3801
  10: "down",
3654
3802
  11: "in",
3655
3803
  12: "out"
3656
- }, ji = {
3804
+ }, Mi = {
3657
3805
  north: "n",
3658
3806
  northeast: "ne",
3659
3807
  northwest: "nw",
@@ -3666,7 +3814,7 @@ var Ti = /* @__PURE__ */ O(((e, t) => {
3666
3814
  down: "down",
3667
3815
  in: "in",
3668
3816
  out: "out"
3669
- }, Mi = class {
3817
+ }, Ni = class {
3670
3818
  constructor(e) {
3671
3819
  this.mapReader = e, this.data = this.buildGraph();
3672
3820
  }
@@ -3692,12 +3840,12 @@ var Ti = /* @__PURE__ */ O(((e, t) => {
3692
3840
  buildGraph() {
3693
3841
  let e = /* @__PURE__ */ new Map(), t = {}, n = 1, r = Infinity;
3694
3842
  return this.mapReader.getRooms().forEach((i) => {
3695
- let a = [], o = {}, s = new Set((i.exitLocks ?? []).map((e) => Ai[e]).filter((e) => !!e)), c = new Set(i.mSpecialExitLocks ?? []);
3843
+ let a = [], o = {}, s = new Set((i.exitLocks ?? []).map((e) => ji[e]).filter((e) => !!e)), c = new Set(i.mSpecialExitLocks ?? []);
3696
3844
  Object.entries(i.exits ?? {}).forEach(([e, t]) => {
3697
3845
  if (s.has(e)) return;
3698
3846
  let c = this.mapReader.getRoom(t);
3699
3847
  if (c) {
3700
- let s = ji[e] ?? e, l = this.resolveEdgeWeight(i, s, c);
3848
+ let s = Mi[e] ?? e, l = this.resolveEdgeWeight(i, s, c);
3701
3849
  a.push({
3702
3850
  id: t,
3703
3851
  weight: l
@@ -3728,7 +3876,7 @@ var Ti = /* @__PURE__ */ O(((e, t) => {
3728
3876
  };
3729
3877
  //#endregion
3730
3878
  //#region src/PathFinder.ts
3731
- function Ni(e, t) {
3879
+ function Pi(e, t) {
3732
3880
  e.push(t);
3733
3881
  let n = e.length - 1;
3734
3882
  for (; n > 0;) {
@@ -3737,7 +3885,7 @@ function Ni(e, t) {
3737
3885
  [e[t], e[n]] = [e[n], e[t]], n = t;
3738
3886
  }
3739
3887
  }
3740
- function Pi(e) {
3888
+ function Fi(e) {
3741
3889
  if (e.length === 0) return;
3742
3890
  let t = e[0], n = e.pop();
3743
3891
  if (e.length > 0) {
@@ -3751,16 +3899,16 @@ function Pi(e) {
3751
3899
  }
3752
3900
  return t;
3753
3901
  }
3754
- function Fi(e, t, n) {
3902
+ function Ii(e, t, n) {
3755
3903
  let r = [n], i = n;
3756
3904
  for (; i !== t;) i = e.get(i), r.push(i);
3757
3905
  return r.reverse(), r;
3758
3906
  }
3759
- function Ii(e, t, n) {
3907
+ function Li(e, t, n) {
3760
3908
  let r = e.path(t.toString(), n.toString()), i = Array.isArray(r) ? r : r?.path;
3761
3909
  return i ? i.map((e) => Number(e)) : null;
3762
3910
  }
3763
- function Li(e, t, n, r) {
3911
+ function Ri(e, t, n, r) {
3764
3912
  let i = r.getRoom(n);
3765
3913
  if (!i) return null;
3766
3914
  let a = i.x, o = i.y, s = i.z, c = r.getMaxEdgeDistance(), l = r.getMinEdgeWeight(), u = (e) => {
@@ -3769,16 +3917,16 @@ function Li(e, t, n, r) {
3769
3917
  let n = t.x - a, i = t.y - o, u = t.z - s;
3770
3918
  return Math.sqrt(n * n + i * i + u * u) / c * l;
3771
3919
  }, d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), p = [];
3772
- for (d.set(t, 0), Ni(p, {
3920
+ for (d.set(t, 0), Pi(p, {
3773
3921
  id: t,
3774
3922
  priority: u(t)
3775
3923
  }); p.length > 0;) {
3776
- let { id: r } = Pi(p);
3777
- if (r === n) return Fi(f, t, n);
3924
+ let { id: r } = Fi(p);
3925
+ if (r === n) return Ii(f, t, n);
3778
3926
  let i = d.get(r) ?? Infinity, a = e.get(r);
3779
3927
  if (a) for (let e of a) {
3780
3928
  let t = i + e.weight;
3781
- t < (d.get(e.id) ?? Infinity) && (d.set(e.id, t), f.set(e.id, r), Ni(p, {
3929
+ t < (d.get(e.id) ?? Infinity) && (d.set(e.id, t), f.set(e.id, r), Pi(p, {
3782
3930
  id: e.id,
3783
3931
  priority: t + u(e.id)
3784
3932
  }));
@@ -3786,9 +3934,9 @@ function Li(e, t, n, r) {
3786
3934
  }
3787
3935
  return null;
3788
3936
  }
3789
- var Ri = class {
3937
+ var zi = class {
3790
3938
  constructor(e, t = "dijkstra") {
3791
- this.cache = /* @__PURE__ */ new Map(), this._algorithm = t, this.mapGraph = new Mi(e), this.dijkstraGraph = new ki.default(this.mapGraph.getGraphDefinition());
3939
+ this.cache = /* @__PURE__ */ new Map(), this._algorithm = t, this.mapGraph = new Ni(e), this.dijkstraGraph = new Ai.default(this.mapGraph.getGraphDefinition());
3792
3940
  }
3793
3941
  get algorithm() {
3794
3942
  return this._algorithm;
@@ -3807,10 +3955,10 @@ var Ri = class {
3807
3955
  let r;
3808
3956
  switch (this._algorithm) {
3809
3957
  case "dijkstra":
3810
- r = Ii(this.dijkstraGraph, e, t);
3958
+ r = Li(this.dijkstraGraph, e, t);
3811
3959
  break;
3812
3960
  case "astar":
3813
- r = Li(this.mapGraph.getAdj(), e, t, this.mapGraph);
3961
+ r = Ri(this.mapGraph.getAdj(), e, t, this.mapGraph);
3814
3962
  break;
3815
3963
  }
3816
3964
  return this.cache.set(n, r), r;
@@ -3820,10 +3968,10 @@ var Ri = class {
3820
3968
  stub: 1,
3821
3969
  full: 0
3822
3970
  };
3823
- function zi(e, t, n) {
3971
+ function Bi(e, t, n) {
3824
3972
  return n === "first" ? e : n === "least-restrictive" ? $[e] < $[t] ? e : t : $[e] > $[t] ? e : t;
3825
3973
  }
3826
- function Bi(e, ...t) {
3974
+ function Vi(e, ...t) {
3827
3975
  let n = {}, r;
3828
3976
  e && typeof e.isVisible == "function" ? r = [e, ...t] : (n = e ?? {}, r = t);
3829
3977
  let i = n.exitStrategy ?? "most-restrictive", a = n.visibility ?? "and";
@@ -3839,7 +3987,7 @@ function Bi(e, ...t) {
3839
3987
  for (let s of r) {
3840
3988
  let r = s.getExitTreatment ? s.getExitTreatment(e, t, n) : o(s, e, t, n);
3841
3989
  if (a === void 0) a = r;
3842
- else if (a = zi(a, r, i), i === "first") break;
3990
+ else if (a = Bi(a, r, i), i === "first") break;
3843
3991
  }
3844
3992
  return a ?? "full";
3845
3993
  },
@@ -3852,7 +4000,7 @@ function Bi(e, ...t) {
3852
4000
  }
3853
4001
  //#endregion
3854
4002
  //#region src/lens/ExplorationLens.ts
3855
- var Vi = class {
4003
+ var Hi = class {
3856
4004
  constructor(e) {
3857
4005
  this.version = 0, this.visited = e instanceof Set ? new Set(e) : new Set(e ?? []);
3858
4006
  }
@@ -3887,7 +4035,7 @@ var Vi = class {
3887
4035
  clear() {
3888
4036
  this.visited.size !== 0 && (this.visited.clear(), this.version++);
3889
4037
  }
3890
- }, Hi = {
4038
+ }, Ui = {
3891
4039
  1: "north",
3892
4040
  2: "northeast",
3893
4041
  3: "northwest",
@@ -3901,7 +4049,7 @@ var Vi = class {
3901
4049
  11: "in",
3902
4050
  12: "out"
3903
4051
  };
3904
- function Ui() {
4052
+ function Wi() {
3905
4053
  return {
3906
4054
  areaWidth: 150,
3907
4055
  areaHeight: 80,
@@ -3915,9 +4063,9 @@ function Ui() {
3915
4063
  highlightColor: "#ff9900"
3916
4064
  };
3917
4065
  }
3918
- var Wi = class {
4066
+ var Gi = class {
3919
4067
  constructor(e, t, n) {
3920
- this.areaNodes = /* @__PURE__ */ new Map(), this.connectionGroups = [], this.currentZoom = 1, this.domainInfo = /* @__PURE__ */ new Map(), this.domainFilter = "all", this.dotsMode = !1, this.settings = n ?? Ui(), this.stage = new D.Stage({
4068
+ this.areaNodes = /* @__PURE__ */ new Map(), this.connectionGroups = [], this.currentZoom = 1, this.domainInfo = /* @__PURE__ */ new Map(), this.domainFilter = "all", this.dotsMode = !1, this.settings = n ?? Wi(), this.stage = new D.Stage({
3921
4069
  container: e,
3922
4070
  width: e.clientWidth,
3923
4071
  height: e.clientHeight,
@@ -4107,7 +4255,7 @@ var Wi = class {
4107
4255
  }
4108
4256
  }
4109
4257
  getLockedDirections(e) {
4110
- return new Set((e.exitLocks ?? []).map((e) => Hi[e]).filter((e) => !!e));
4258
+ return new Set((e.exitLocks ?? []).map((e) => Ui[e]).filter((e) => !!e));
4111
4259
  }
4112
4260
  createConnection(e, t, n) {
4113
4261
  let r = this.toPlanarDirection(n);
@@ -4719,6 +4867,6 @@ var Wi = class {
4719
4867
  }
4720
4868
  };
4721
4869
  //#endregion
4722
- export { n as ALL_VISIBLE, di as AmbientLightOverlay, ae as Area, Wi as AreaMapRenderer, yr as Blueprint, r as Camera, ii as CanvasExporter, Cr as Construction, E as CullingManager, Ar as DarkModern, Oe as DrawCommandLayerNode, Vi as ExplorationLens, Tr as GradientRooms, Dr as GraphPaper, ee as HitTester, c as IDENTITY_TRANSFORM, Sr as Isometric, Mi as MapGraph, se as MapReader, Mr as MapRenderer, be as MapState, ke as MaterializingLayerNode, br as Neon, vr as Parchment, Ri as PathFinder, oe as Plane, ni as PngBlobExporter, ai as PngBytesExporter, ti as PngExporter, De as RecordingGroupNode, j as RecordingLayerNode, hi as RippleEffect, wr as SciFi, xr as Sketchy, Er as StainedGlass, ei as SvgExporter, Or as Topographic, jr as TreasureMap, kr as Watercolor, C as applyStyleToShapes, Pr as buildDrawCommands, ri as canvasToBytes, e as colorLightness, _ as compose, Bi as composeLenses, te as computePathData, Ui as createAreaMapSettings, ye as createSettings, v as darkenColor, o as defaultExitTreatment, i as hexToRgba, u as identityStyle, Ae as isGradientFill, wi as placeLabels, Jr as renderToCanvas, Me as shapeToRecording, Wr as svgFromBatches, M as transformFill, _r as treasureMapDecorations };
4870
+ export { n as ALL_VISIBLE, di as AmbientLightOverlay, ae as Area, Gi as AreaMapRenderer, yr as Blueprint, r as Camera, ii as CanvasExporter, Cr as Construction, E as CullingManager, Ar as DarkModern, A as DrawCommandLayerNode, Hi as ExplorationLens, Tr as GradientRooms, Dr as GraphPaper, C as HitTester, c as IDENTITY_TRANSFORM, Sr as Isometric, Ni as MapGraph, se as MapReader, Mr as MapRenderer, be as MapState, ke as MaterializingLayerNode, br as Neon, vr as Parchment, zi as PathFinder, oe as Plane, ni as PngBlobExporter, ai as PngBytesExporter, ti as PngExporter, Oe as RecordingGroupNode, j as RecordingLayerNode, hi as RippleEffect, wr as SciFi, xr as Sketchy, Er as StainedGlass, ei as SvgExporter, Or as Topographic, jr as TreasureMap, kr as Watercolor, Ti as WaypointOverlay, w as applyStyleToShapes, Pr as buildDrawCommands, ri as canvasToBytes, e as colorLightness, _ as compose, Vi as composeLenses, ee as computePathData, Wi as createAreaMapSettings, ye as createSettings, v as darkenColor, o as defaultExitTreatment, i as hexToRgba, u as identityStyle, Ae as isGradientFill, wi as placeLabels, Jr as renderToCanvas, Me as shapeToRecording, Wr as svgFromBatches, M as transformFill, _r as treasureMapDecorations };
4723
4871
 
4724
4872
  //# sourceMappingURL=index.mjs.map