mce 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import { ref as V, computed as O, watch as pe, markRaw as fe, warn as Bt, shallowRef as Je, reactive as Ce, nextTick as Pe, inject as Se, provide as De, defineComponent as X, createVNode as H, mergeProps as Ne, createElementVNode as F, toValue as yn, getCurrentInstance as Ze, onScopeDispose as gn, createElementBlock as R, openBlock as I, Fragment as ne, renderList as _e, unref as S, normalizeStyle as q, normalizeClass as be, onBeforeUnmount as we, readonly as bn, toRef as Ee, onMounted as He, useId as Lt, onDeactivated as wn, onActivated as xn, useAttrs as Dt, createBlock as le, resolveDynamicComponent as Vt, useTemplateRef as ue, renderSlot as te, Teleport as _n, createCommentVNode as Q, mergeModels as Re, useModel as Ae, resolveComponent as kn, withCtx as re, createTextVNode as Cn, toDisplayString as K, createSlots as ht, normalizeProps as ft, guardReactiveProps as pt, withDirectives as ze, vShow as Xe, vModelText as En, withModifiers as We, onBeforeMount as vt, isRef as Tn } from "vue";
2
- import { useFileDialog as jt, useEventListener as Ut, isClient as An, useResizeObserver as Xt, useLocalStorage as Sn, onClickOutside as Mn, useMouse as zn, useDebounceFn as Ht } from "@vueuse/core";
3
- import { Timeline as On, Engine as $n, Camera2D as In, DrawboardEffect as Fn, Element2D as G, IN_BROWSER as yt, clamp as Pn, assets as Yt, TimelineNode as Nn, Transform2D as Rn, DEG_TO_RAD as Bn, Node as kt, render as Qe, Animation as Ln } from "modern-canvas";
4
- import { getObjectValueByPath as Dn, setObjectValueByPath as Vn, normalizeTextContent as jn, idGenerator as gt, normalizeElement as qt, Observable as Gt, Reactivable as Un, property as Ye } from "modern-idoc";
5
- import { saveAs as Wt } from "file-saver";
1
+ import { ref as V, computed as O, watch as pe, markRaw as fe, warn as Lt, shallowRef as Ze, reactive as Ee, nextTick as Re, inject as Se, provide as De, defineComponent as X, createVNode as H, mergeProps as Oe, createElementVNode as F, toValue as yn, getCurrentInstance as Qe, onScopeDispose as gn, createElementBlock as R, openBlock as $, Fragment as se, renderList as _e, unref as S, normalizeStyle as q, normalizeClass as be, onBeforeUnmount as we, readonly as bn, toRef as Te, onMounted as He, useId as Dt, onDeactivated as wn, onActivated as xn, useAttrs as Vt, createBlock as oe, resolveDynamicComponent as jt, useTemplateRef as ce, renderSlot as Q, Teleport as _n, createCommentVNode as ee, mergeModels as $e, useModel as ke, resolveComponent as kn, withCtx as ne, createTextVNode as Cn, toDisplayString as K, createSlots as pt, normalizeProps as vt, guardReactiveProps as yt, withDirectives as ze, vShow as Xe, vModelText as En, withModifiers as Ke, onBeforeMount as gt, isRef as Tn } from "vue";
2
+ import { useFileDialog as Ut, useEventListener as Xt, isClient as An, useResizeObserver as Ht, useLocalStorage as Sn, onClickOutside as Mn, useMouse as zn, useDebounceFn as Yt } from "@vueuse/core";
3
+ import { Timeline as On, Engine as $n, Camera2D as In, DrawboardEffect as Fn, Element2D as G, IN_BROWSER as bt, clamp as Pn, assets as qt, TimelineNode as Nn, Transform2D as Rn, DEG_TO_RAD as Bn, Node as Ct, render as et, Animation as Ln } from "modern-canvas";
4
+ import { getObjectValueByPath as Dn, setObjectValueByPath as Vn, normalizeTextContent as jn, idGenerator as wt, normalizeElement as Gt, Observable as Wt, Reactivable as Un, property as Ye } from "modern-idoc";
5
+ import { saveAs as Kt } from "file-saver";
6
6
  import { Fonts as Xn } from "modern-font";
7
- import { merge as Kt, throttle as Hn, cloneDeep as Yn } from "lodash-es";
8
- import { measureText as rt } from "modern-text";
7
+ import { merge as Jt, throttle as Hn, cloneDeep as Yn } from "lodash-es";
8
+ import { measureText as lt } from "modern-text";
9
9
  import { TextEditor as qn } from "modern-text/web-components";
10
- import * as ie from "yjs";
10
+ import * as le from "yjs";
11
11
  import { useFloating as Gn, offset as Wn, flip as Kn, shift as Jn, autoUpdate as Zn } from "@floating-ui/vue";
12
- import { vResizeObserver as Jt, vOnLongPress as Qn } from "@vueuse/components";
12
+ import { vResizeObserver as Zt, vOnLongPress as Qn } from "@vueuse/components";
13
13
  const eo = (o) => {
14
14
  const {
15
15
  emit: e
@@ -23,55 +23,55 @@ const eo = (o) => {
23
23
  t.value.delete(r);
24
24
  },
25
25
  exec: (r, ...i) => {
26
- const [l, c] = r.split(":");
27
- c !== void 0 && i.unshift(c);
28
- const u = t.value.get(l);
26
+ const [c, l] = r.split(":");
27
+ l !== void 0 && i.unshift(l);
28
+ const u = t.value.get(c);
29
29
  if (!u)
30
- throw new Error(`Command "${l}" not found`);
30
+ throw new Error(`Command "${c}" not found`);
31
31
  const d = u.handle(...i);
32
- return e(`command:${l}`, d), d;
32
+ return e(`command:${c}`, d), d;
33
33
  }
34
34
  });
35
35
  }, to = (o) => {
36
36
  const {
37
37
  config: e
38
38
  } = o;
39
- function t(c, u) {
40
- return Dn(e.value, c) ?? u;
39
+ function t(l, u) {
40
+ return Dn(e.value, l) ?? u;
41
41
  }
42
- function n(c, u) {
43
- Vn(e.value, c, u);
42
+ function n(l, u) {
43
+ Vn(e.value, l, u);
44
44
  }
45
- function s(c) {
45
+ function s(l) {
46
46
  return O({
47
- get: () => t(c),
48
- set: (u) => n(c, u)
47
+ get: () => t(l),
48
+ set: (u) => n(l, u)
49
49
  });
50
50
  }
51
- function a(c, u) {
52
- const d = s(c);
51
+ function a(l, u) {
52
+ const d = s(l);
53
53
  return d.value === void 0 && (d.value = u), d;
54
54
  }
55
55
  function r() {
56
- return new Promise((c) => {
57
- const { onChange: u, open: d } = jt({
56
+ return new Promise((l) => {
57
+ const { onChange: u, open: d } = Ut({
58
58
  accept: ".json",
59
59
  reset: !0,
60
60
  multiple: !1
61
61
  });
62
62
  u(async (g) => {
63
63
  const h = g?.[0];
64
- h && (e.value = JSON.parse(await h.text()), c(e.value));
64
+ h && (e.value = JSON.parse(await h.text()), l(e.value));
65
65
  }), d();
66
66
  });
67
67
  }
68
68
  function i() {
69
69
  return new Blob([JSON.stringify(e.value)], { type: "application/json" });
70
70
  }
71
- function l(c = "settings.json") {
72
- Wt(
71
+ function c(l = "settings.json") {
72
+ Kt(
73
73
  i(),
74
- c
74
+ l
75
75
  );
76
76
  }
77
77
  Object.assign(o, {
@@ -81,7 +81,7 @@ const eo = (o) => {
81
81
  registerConfig: a,
82
82
  importConfig: r,
83
83
  exportConfig: i,
84
- saveAsConfig: l
84
+ saveAsConfig: c
85
85
  });
86
86
  }, no = (o, e) => {
87
87
  const {
@@ -126,9 +126,9 @@ const eo = (o) => {
126
126
  s.root.append(a.value), s.root.append(r.value);
127
127
  const i = V(s);
128
128
  i.value.start();
129
- const l = V(), c = V({ left: 0, top: 0, width: 0, height: 0 }), u = V(), d = V(), g = O(() => d.value?.root), h = V(), v = V(), y = V();
130
- function f(z, $) {
131
- switch (v.value = z, y.value = $, z) {
129
+ const c = V(), l = V({ left: 0, top: 0, width: 0, height: 0 }), u = V(), d = V(), g = O(() => d.value?.root), h = V(), v = V(), y = V();
130
+ function f(z, I) {
131
+ switch (v.value = z, y.value = I, z) {
132
132
  case "drawing":
133
133
  p("crosshair");
134
134
  break;
@@ -139,10 +139,10 @@ const eo = (o) => {
139
139
  i.value.input.setCursor(z);
140
140
  }
141
141
  function _() {
142
- const { x: z = 0, y: $ = 0 } = h.value ?? {};
142
+ const { x: z = 0, y: I = 0 } = h.value ?? {};
143
143
  return a.value.toGlobal({
144
- x: z - c.value.left,
145
- y: $ - c.value.top
144
+ x: z - l.value.left,
145
+ y: I - l.value.top
146
146
  }, { x: 0, y: 0 });
147
147
  }
148
148
  Object.assign(o, {
@@ -152,8 +152,8 @@ const eo = (o) => {
152
152
  camera: a,
153
153
  drawboardEffect: r,
154
154
  root: g,
155
- drawboardDom: l,
156
- drawboardAabb: c,
155
+ drawboardDom: c,
156
+ drawboardAabb: l,
157
157
  workspace: u,
158
158
  doc: d,
159
159
  state: v,
@@ -189,21 +189,21 @@ const eo = (o) => {
189
189
  emit: t,
190
190
  fonts: n
191
191
  } = o, s = V(!1);
192
- async function a(l, c) {
193
- const u = await n.load(l, c);
192
+ async function a(c, l) {
193
+ const u = await n.load(c, l);
194
194
  return console.log("loadFont", u), t("loadFont", u), u;
195
195
  }
196
- async function r(l, c) {
196
+ async function r(c, l) {
197
197
  s.value = !0;
198
198
  try {
199
- n.fallbackFont = await a(l, c);
199
+ n.fallbackFont = await a(c, l);
200
200
  } finally {
201
201
  s.value = !1;
202
202
  }
203
203
  }
204
204
  async function i() {
205
205
  for (; s.value; )
206
- await new Promise((l) => setTimeout(l, 100));
206
+ await new Promise((c) => setTimeout(c, 100));
207
207
  return await n.waitUntilLoad();
208
208
  }
209
209
  return Object.assign(o, {
@@ -213,9 +213,9 @@ const eo = (o) => {
213
213
  waitUntilFontLoad: i
214
214
  }), () => {
215
215
  const {
216
- defaultFont: l
216
+ defaultFont: c
217
217
  } = e;
218
- l && r(l);
218
+ c && r(c);
219
219
  };
220
220
  }, io = {
221
221
  cancel: "Cancel",
@@ -289,7 +289,8 @@ const eo = (o) => {
289
289
  alignRight: "Align right",
290
290
  alignTop: "Align top",
291
291
  alignVerticalCenter: "Align vertical center",
292
- alignBottom: "Align bottom"
292
+ alignBottom: "Align bottom",
293
+ exporting: "Exporting"
293
294
  }, ro = (o, e) => {
294
295
  const {
295
296
  locale: t
@@ -298,7 +299,7 @@ const eo = (o) => {
298
299
  locale: a,
299
300
  fallback: r,
300
301
  messages: i = {}
301
- } = Kt({
302
+ } = Jt({
302
303
  locale: "en",
303
304
  fallback: "en",
304
305
  messages: {
@@ -312,7 +313,7 @@ const eo = (o) => {
312
313
  };
313
314
  });
314
315
  function s(a, r) {
315
- const { locale: i, localeMessages: l, fallbackMessages: c } = n.value, u = e.t?.(a, r) ?? l?.[a ?? -1] ?? c?.[a ?? -1] ?? l?.[r ?? -1] ?? c?.[r ?? -1];
316
+ const { locale: i, localeMessages: c, fallbackMessages: l } = n.value, u = e.t?.(a, r) ?? c?.[a ?? -1] ?? l?.[a ?? -1] ?? c?.[r ?? -1] ?? l?.[r ?? -1];
316
317
  return u === void 0 && console.warn(`[mce] Not found '${a}' key in '${i}' locale messages.`), u ?? a ?? r;
317
318
  }
318
319
  Object.assign(o, {
@@ -322,16 +323,16 @@ const eo = (o) => {
322
323
  const {
323
324
  root: e,
324
325
  getAncestor: t
325
- } = o, n = O(() => e.value?.children.filter(l) ?? []), s = V(-1), a = O(() => n.value[s.value]), r = O(() => {
326
+ } = o, n = O(() => e.value?.children.filter(c) ?? []), s = V(-1), a = O(() => n.value[s.value]), r = O(() => {
326
327
  const { left: u = 0, top: d = 0, width: g = 0, height: h = 0 } = a.value?.style ?? {};
327
328
  return { left: u, top: d, width: g, height: h };
328
329
  }), i = V([]);
329
- function l(u) {
330
+ function c(u) {
330
331
  return u instanceof G && u.meta?.inEditorIs === "Frame";
331
332
  }
332
- function c(u) {
333
+ function l(u) {
333
334
  const d = t(u);
334
- return d && l(d) ? d : void 0;
335
+ return d && c(d) ? d : void 0;
335
336
  }
336
337
  return Object.assign(o, {
337
338
  frames: n,
@@ -339,14 +340,14 @@ const eo = (o) => {
339
340
  currentFrameIndex: s,
340
341
  currentFrame: a,
341
342
  currentFrameAabb: r,
342
- isFrame: l,
343
- getAncestorFrame: c
343
+ isFrame: c,
344
+ getAncestorFrame: l
344
345
  }), () => {
345
346
  const {
346
347
  selection: u
347
348
  } = o;
348
349
  pe(() => u.value.length === 1 && u.value[0], (d) => {
349
- d && l(d) && (s.value = n.value.findIndex((g) => g.equal(d)));
350
+ d && c(d) && (s.value = n.value.findIndex((g) => g.equal(d)));
350
351
  });
351
352
  };
352
353
  };
@@ -359,7 +360,7 @@ function Me(o) {
359
360
  };
360
361
  return o.rotate && (e.transform = `rotate(${o.rotate}deg)`), e;
361
362
  }
362
- function Ct(o, e) {
363
+ function Et(o, e) {
363
364
  const t = e.left + e.width, n = e.top + e.height;
364
365
  return o.x >= e.left && o.x <= t && o.y >= e.top && o.y <= n;
365
366
  }
@@ -377,12 +378,12 @@ function co(o, e) {
377
378
  if (!o.rotate && !e.rotate)
378
379
  return Be(o, e);
379
380
  {
380
- const t = ([i, l], [c, u]) => Math.abs(i * c + l * u), n = ({ width: i, height: l, rotate: c = 0 }) => {
381
- c = -c % 180;
382
- const u = c / 180 * Math.PI, d = [Math.cos(u), -Math.sin(u)], g = [Math.sin(u), Math.cos(u)];
381
+ const t = ([i, c], [l, u]) => Math.abs(i * l + c * u), n = ({ width: i, height: c, rotate: l = 0 }) => {
382
+ l = -l % 180;
383
+ const u = l / 180 * Math.PI, d = [Math.cos(u), -Math.sin(u)], g = [Math.sin(u), Math.cos(u)];
383
384
  return {
384
385
  axis: [d, g],
385
- projectionRadius: (h) => i / 2 * t(h, d) + l / 2 * t(h, g)
386
+ projectionRadius: (h) => i / 2 * t(h, d) + c / 2 * t(h, g)
386
387
  };
387
388
  }, s = n(o), a = n(e), r = [
388
389
  o.left + o.width / 2 - (e.left + e.width / 2),
@@ -414,12 +415,12 @@ function Qi(o) {
414
415
  return { left: e.x1, top: e.y1, width: e.x2 - e.x1, height: e.y2 - e.y1 };
415
416
  }
416
417
  function uo(o) {
417
- Bt(`mce: ${o}`);
418
+ Lt(`mce: ${o}`);
418
419
  }
419
420
  function er(o) {
420
- Bt(`mce error: ${o}`);
421
+ Lt(`mce error: ${o}`);
421
422
  }
422
- const Et = yt && window.navigator && "clipboard" in navigator, Zt = yt ? window.navigator?.userAgent : "", $e = /Macintosh|Mac OS X/i.test(Zt), mo = /Windows/i.test(Zt);
423
+ const Tt = bt && window.navigator && "clipboard" in navigator, Qt = bt ? window.navigator?.userAgent : "", Fe = /Macintosh|Mac OS X/i.test(Qt), mo = /Windows/i.test(Qt);
423
424
  function ho(o, e = {}) {
424
425
  const { useCrossOrigin: t = !1, timeout: n } = e;
425
426
  return new Promise((s, a) => {
@@ -432,8 +433,8 @@ function ho(o, e = {}) {
432
433
  r.onload = null, r.onerror = null, a(new Error(`image load timeout (${n} ms)`));
433
434
  }, n)), r.onload = function() {
434
435
  i && clearTimeout(i);
435
- const l = this.naturalWidth, c = this.naturalHeight;
436
- !l || !c ? a(new Error("failed to read natural size")) : s({ width: l, height: c });
436
+ const c = this.naturalWidth, l = this.naturalHeight;
437
+ !c || !l ? a(new Error("failed to read natural size")) : s({ width: c, height: l });
437
438
  }, r.onerror = function() {
438
439
  i && clearTimeout(i), a(new Error(`failed to load image: ${o}`));
439
440
  }, r.src = o;
@@ -452,11 +453,11 @@ const fo = {
452
453
  "image/heif": [".heif"],
453
454
  "image/heic": [".heic"],
454
455
  "image/avif": [".avif"]
455
- }, Qt = Object.values(fo).flat(), en = new RegExp(`\\.(?:${Qt.map((o) => o.substring(1)).join("|")})`, "i");
456
- function lt(o, e) {
457
- const t = rt({ style: e, content: o }).boundingBox;
456
+ }, en = Object.values(fo).flat(), ct = new RegExp(`\\.(?:${en.map((o) => o.substring(1)).join("|")})`, "i");
457
+ function ut(o, e) {
458
+ const t = lt({ style: e, content: o }).boundingBox;
458
459
  return {
459
- id: gt(),
460
+ id: wt(),
460
461
  style: {
461
462
  ...e,
462
463
  width: t.width,
@@ -466,9 +467,9 @@ function lt(o, e) {
466
467
  meta: { inPptIs: "Shape" }
467
468
  };
468
469
  }
469
- async function ct(o) {
470
+ async function dt(o) {
470
471
  return {
471
- id: gt(),
472
+ id: wt(),
472
473
  style: {
473
474
  ...await ho(o)
474
475
  },
@@ -477,8 +478,8 @@ async function ct(o) {
477
478
  };
478
479
  }
479
480
  function po(o, e) {
480
- const t = o.clientX, n = o.clientY, s = e.getBoundingClientRect(), a = s.left, r = s.top, i = s.right, l = s.bottom;
481
- return t >= a && t <= i && n >= r && n <= l;
481
+ const t = o.clientX, n = o.clientY, s = e.getBoundingClientRect(), a = s.left, r = s.top, i = s.right, c = s.bottom;
482
+ return t >= a && t <= i && n >= r && n <= c;
482
483
  }
483
484
  function vo(o) {
484
485
  if (o && "$el" in o) {
@@ -487,14 +488,14 @@ function vo(o) {
487
488
  }
488
489
  return o;
489
490
  }
490
- function qe(o, e = "px") {
491
+ function Ge(o, e = "px") {
491
492
  if (o == null || o === "")
492
493
  return;
493
494
  const t = Number(o);
494
495
  return Number.isNaN(t) ? String(o) : Number.isFinite(t) ? `${t}${e}` : void 0;
495
496
  }
496
497
  function yo() {
497
- const o = Je(), e = (t) => {
498
+ const o = Ze(), e = (t) => {
498
499
  o.value = t;
499
500
  };
500
501
  return Object.defineProperty(e, "value", {
@@ -551,25 +552,25 @@ const ko = (o) => {
551
552
  const {
552
553
  registerConfig: e
553
554
  } = o, t = e("hotkeys", xo), n = V(/* @__PURE__ */ new Map());
554
- function s(l) {
555
- if (Array.isArray(l))
556
- l.forEach((c) => s(c));
555
+ function s(c) {
556
+ if (Array.isArray(c))
557
+ c.forEach((l) => s(l));
557
558
  else {
558
559
  const {
559
- when: c,
560
+ when: l,
560
561
  handle: u,
561
562
  ...d
562
- } = l, {
563
+ } = c, {
563
564
  command: g
564
565
  } = d;
565
566
  t.value = [
566
567
  ...t.value.filter((h) => h.command !== g),
567
568
  d
568
- ], n.value.set(g, l);
569
+ ], n.value.set(g, c);
569
570
  }
570
571
  }
571
- function a(l) {
572
- t.value = t.value.filter((c) => c.command !== l);
572
+ function a(c) {
573
+ t.value = t.value.filter((l) => l.command !== c);
573
574
  }
574
575
  const r = {
575
576
  ArrowUp: "↑",
@@ -594,26 +595,26 @@ const ko = (o) => {
594
595
  "™": "2",
595
596
  Dead: "N"
596
597
  };
597
- function i(l) {
598
- if (!l)
598
+ function i(c) {
599
+ if (!c)
599
600
  return "";
600
- let c;
601
- const u = t.value.find((d) => d.command === l);
602
- return u ? c = Array.isArray(u.key) ? u.key : [u.key] : c = [l], c[0].split("+").map((d) => {
601
+ let l;
602
+ const u = t.value.find((d) => d.command === c);
603
+ return u ? l = Array.isArray(u.key) ? u.key : [u.key] : l = [c], l[0].split("+").map((d) => {
603
604
  switch (d) {
604
605
  case "Control":
605
- return $e ? "⌃" : "Ctrl";
606
+ return Fe ? "⌃" : "Ctrl";
606
607
  case "Ctrl":
607
- return $e ? "⌃" : "Ctrl";
608
+ return Fe ? "⌃" : "Ctrl";
608
609
  case "Command":
609
- return $e ? "⌘" : mo ? "Win" : "Super";
610
+ return Fe ? "⌘" : mo ? "Win" : "Super";
610
611
  case "Alt":
611
- return $e ? "⌥" : "Alt";
612
+ return Fe ? "⌥" : "Alt";
612
613
  case "Shift":
613
- return $e ? "⇧" : "Shift";
614
+ return Fe ? "⇧" : "Shift";
614
615
  case "CommandOrControl":
615
616
  case "CmdOrCtrl":
616
- return $e ? "⌘" : "Ctrl";
617
+ return Fe ? "⌘" : "Ctrl";
617
618
  default:
618
619
  return r[d] ?? d.charAt(0).toUpperCase() + d.slice(1);
619
620
  }
@@ -627,19 +628,19 @@ const ko = (o) => {
627
628
  getKbd: i
628
629
  }), () => {
629
630
  const {
630
- exec: l
631
+ exec: c
631
632
  } = o;
632
- Ut(
633
+ Xt(
633
634
  An ? window : void 0,
634
635
  "keydown",
635
- (c) => {
636
- if (_o(c))
636
+ (l) => {
637
+ if (_o(l))
637
638
  return;
638
639
  const u = [
639
- (c.metaKey || c.ctrlKey) && "CmdOrCtrl",
640
- c.altKey && "Alt",
641
- c.shiftKey && "Shift",
642
- !["Meta", "Control", "Alt", "Shift"].includes(c.key) && c.key
640
+ (l.metaKey || l.ctrlKey) && "CmdOrCtrl",
641
+ l.altKey && "Alt",
642
+ l.shiftKey && "Shift",
643
+ !["Meta", "Control", "Alt", "Shift"].includes(l.key) && l.key
643
644
  ].filter(Boolean).map((d) => d.toLowerCase()).sort().join("+");
644
645
  t.value.forEach((d) => {
645
646
  const g = d.command, h = n.value.get(g);
@@ -654,7 +655,7 @@ const ko = (o) => {
654
655
  return p;
655
656
  }
656
657
  }).filter(Boolean).map((p) => p.toLowerCase()).sort().join("+");
657
- u === f && (!h?.when || h.when(c)) && (c.preventDefault(), h?.handle ? h.handle(c) : l(g), o.emit(`hotkey:${g}`, c));
658
+ u === f && (!h?.when || h.when(l)) && (l.preventDefault(), h?.handle ? h.handle(l) : c(g), o.emit(`hotkey:${g}`, l));
658
659
  });
659
660
  });
660
661
  },
@@ -668,38 +669,38 @@ const ko = (o) => {
668
669
  renderEngine: n
669
670
  } = o, s = V(10), a = O({
670
671
  get: () => t.value.currentTime,
671
- set: (c) => {
672
+ set: (l) => {
672
673
  const { startTime: u, endTime: d } = t.value;
673
- t.value.currentTime = Pn(c, u, d);
674
+ t.value.currentTime = Pn(l, u, d);
674
675
  }
675
- }), r = O(() => t.value.startTime), i = O(() => t.value.endTime), l = (c) => {
676
+ }), r = O(() => t.value.startTime), i = O(() => t.value.endTime), c = (l) => {
676
677
  const u = { startTime: 0, endTime: 0 };
677
678
  function d(h) {
678
679
  return h instanceof Nn && (u.startTime = Math.min(u.startTime, h.globalStartTime), u.endTime = Math.max(u.endTime, h.globalEndTime)), h instanceof G && (h.background.animatedTexture && (u.endTime = Math.max(u.endTime, h.globalStartTime + h.background.animatedTexture.duration)), h.foreground.animatedTexture && (u.endTime = Math.max(u.endTime, h.globalStartTime + h.foreground.animatedTexture.duration)), h.fill.animatedTexture && (u.endTime = Math.max(u.endTime, h.globalStartTime + h.fill.animatedTexture.duration)), h.outline.animatedTexture && (u.endTime = Math.max(u.endTime, h.globalStartTime + h.outline.animatedTexture.duration))), !1;
679
680
  }
680
- return (Array.isArray(c) ? c : [c]).forEach((h) => h.findOne(d)), u;
681
+ return (Array.isArray(l) ? l : [l]).forEach((h) => h.findOne(d)), u;
681
682
  };
682
683
  return Object.assign(o, {
683
684
  msPerPx: s,
684
685
  currentTime: a,
685
686
  startTime: r,
686
687
  endTime: i,
687
- getTimeRange: l
688
+ getTimeRange: c
688
689
  }), () => {
689
690
  const {
690
- on: c
691
+ on: l
691
692
  } = o;
692
693
  async function u() {
693
- await n.value.nextTick(), t.value.endTime = e.value ? l(e.value).endTime : 0;
694
+ await n.value.nextTick(), t.value.endTime = e.value ? c(e.value).endTime : 0;
694
695
  }
695
- Yt.on("loaded", u), c("setDoc", u);
696
+ qt.on("loaded", u), l("setDoc", u);
696
697
  };
697
698
  }, Eo = (o, e) => {
698
699
  Object.assign(o, {
699
700
  upload: async (n) => e.upload ? await e.upload(n) : URL.createObjectURL(n)
700
701
  });
701
702
  };
702
- function Tt(...o) {
703
+ function At(...o) {
703
704
  }
704
705
  const To = (o) => {
705
706
  const {
@@ -733,9 +734,9 @@ const To = (o) => {
733
734
  }), h.style.left += f.left, h.style.top += f.top, h.style.width = f.width, h.style.height = f.height, h.updateGlobalTransform(), h.children.forEach((_, z) => {
734
735
  if (_ instanceof G) {
735
736
  _.updateGlobalTransform();
736
- const $ = p[z], E = _.toLocal({
737
- x: $.left + $.width / 2,
738
- y: $.top + $.height / 2
737
+ const I = p[z], E = _.toLocal({
738
+ x: I.left + I.width / 2,
739
+ y: I.top + I.height / 2
739
740
  }), C = _.pivot, m = _.style, b = [
740
741
  E.x - C.x,
741
742
  E.y - C.y
@@ -748,10 +749,10 @@ const To = (o) => {
748
749
  function r(h, v) {
749
750
  let y;
750
751
  if (Array.isArray(h) && h.length > 0)
751
- h.length === 1 ? y = r(h[0]) : y = { ...l(h), rotate: 0 };
752
+ h.length === 1 ? y = r(h[0]) : y = { ...c(h), rotate: 0 };
752
753
  else if (h instanceof G) {
753
754
  const f = h.style;
754
- Tt([f.left, f.top, f.width, f.height, f.rotate]);
755
+ At([f.left, f.top, f.width, f.height, f.rotate]);
755
756
  const { rect: p, rotation: _ } = h.getGlobalObb();
756
757
  y = {
757
758
  left: p.left,
@@ -777,11 +778,11 @@ const To = (o) => {
777
778
  function i(h) {
778
779
  return r(h, "drawboard");
779
780
  }
780
- function l(h, v) {
781
+ function c(h, v) {
781
782
  let y;
782
783
  if (Array.isArray(h) && h.length > 0)
783
784
  if (h.length === 1)
784
- y = l(h[0]);
785
+ y = c(h[0]);
785
786
  else {
786
787
  const f = {
787
788
  minX: Number.MAX_SAFE_INTEGER,
@@ -791,7 +792,7 @@ const To = (o) => {
791
792
  };
792
793
  h.forEach((p) => {
793
794
  if (p instanceof G) {
794
- const _ = l(p);
795
+ const _ = c(p);
795
796
  f.minX = Math.min(f.minX, _.left), f.minY = Math.min(f.minY, _.top), f.maxX = Math.max(f.maxX, _.left + _.width), f.maxY = Math.max(f.maxY, _.top + _.height);
796
797
  }
797
798
  }), y = {
@@ -803,7 +804,7 @@ const To = (o) => {
803
804
  }
804
805
  else if (h instanceof G) {
805
806
  const f = h.style;
806
- Tt([f.left, f.top, f.width, f.height, f.rotate]);
807
+ At([f.left, f.top, f.width, f.height, f.rotate]);
807
808
  const p = h.getGlobalAabb();
808
809
  y = {
809
810
  left: p.left,
@@ -824,39 +825,39 @@ const To = (o) => {
824
825
  }
825
826
  return y;
826
827
  }
827
- function c(h) {
828
- return l(h, "drawboard");
828
+ function l(h) {
829
+ return c(h, "drawboard");
829
830
  }
830
831
  function u(h) {
831
832
  const v = { ...h }, y = e.value.zoom, f = e.value.position;
832
833
  return v.left *= y.x, v.top *= y.y, v.width *= y.x, v.height *= y.y, v.left += f.x, v.top += f.y, v;
833
834
  }
834
- const d = O(() => l(t.value?.children ?? [])), g = O(() => l(n.value));
835
+ const d = O(() => c(t.value?.children ?? [])), g = O(() => c(n.value));
835
836
  Object.assign(o, {
836
837
  obbToFit: a,
837
838
  getObb: r,
838
839
  getObbInDrawboard: i,
839
- getAabb: l,
840
- getAabbInDrawboard: c,
840
+ getAabb: c,
841
+ getAabbInDrawboard: l,
841
842
  aabbToDrawboardAabb: u,
842
843
  rootAabb: d,
843
844
  currentAabb: g
844
845
  });
845
846
  }, Ao = (o) => {
846
847
  const e = V(/* @__PURE__ */ new Map()), t = V(!1), n = V(0), s = (i) => {
847
- Array.isArray(i) ? i.forEach((l) => s(l)) : e.value.set(i.name, i);
848
+ Array.isArray(i) ? i.forEach((c) => s(c)) : e.value.set(i.name, i);
848
849
  }, a = (i) => {
849
850
  e.value.delete(i);
850
- }, r = (i, l = {}) => {
851
- const c = e.value.get(i)?.handle({
852
- ...l,
851
+ }, r = (i, c = {}) => {
852
+ const l = e.value.get(i)?.handle({
853
+ ...c,
853
854
  onProgress: (u) => {
854
- n.value = u, l.onProgress?.(u);
855
+ n.value = u, c.onProgress?.(u);
855
856
  }
856
857
  });
857
- return c instanceof Promise ? (n.value = 0, t.value = !0, c.finally(() => {
858
+ return l instanceof Promise ? (n.value = 0, t.value = !0, l.finally(() => {
858
859
  t.value = !1;
859
- })) : c;
860
+ })) : l;
860
861
  };
861
862
  Object.assign(o, {
862
863
  exporters: e,
@@ -880,26 +881,26 @@ const To = (o) => {
880
881
  handle: (r) => {
881
882
  const {
882
883
  selected: i = !1,
883
- scale: l
884
+ scale: c
884
885
  } = r;
885
- let c = [];
886
- Array.isArray(i) ? c = i : (i === !0 && (c = n.value), c.length === 0 && (c = s.value?.children ?? []));
887
- const u = t(c, "frame");
886
+ let l = [];
887
+ Array.isArray(i) ? l = i : (i === !0 && (l = n.value), l.length === 0 && (l = s.value?.children ?? []));
888
+ const u = t(l, "frame");
888
889
  return {
889
890
  style: {
890
891
  width: u.width,
891
892
  height: u.height,
892
- scaleX: l,
893
- scaleY: l
893
+ scaleX: c,
894
+ scaleY: c
894
895
  },
895
- children: c.map((d) => {
896
+ children: l.map((d) => {
896
897
  const g = d.toJSON();
897
898
  return u.left && (g.style.left = (g.style.left ?? 0) - u.left), u.top && (g.style.top = (g.style.top ?? 0) - u.top), g.meta ??= {}, g.meta.inPptIs = "Slide", g;
898
899
  }),
899
900
  meta: {
900
901
  inPptIs: "Pptx",
901
902
  inCanvasIs: "Node2D",
902
- ...a(c)
903
+ ...a(l)
903
904
  }
904
905
  };
905
906
  }
@@ -908,7 +909,7 @@ const To = (o) => {
908
909
  const {
909
910
  state: e
910
911
  } = o, t = V(/* @__PURE__ */ new Map()), n = (i) => {
911
- Array.isArray(i) ? i.forEach((l) => n(l)) : t.value.set(i.name, i);
912
+ Array.isArray(i) ? i.forEach((c) => n(c)) : t.value.set(i.name, i);
912
913
  };
913
914
  Object.assign(o, {
914
915
  loaders: t,
@@ -918,34 +919,34 @@ const To = (o) => {
918
919
  },
919
920
  load: async (i) => {
920
921
  e.value = "loading";
921
- let l;
922
+ let c;
922
923
  try {
923
- for (const c of t.value.values())
924
- if (await c.test(i)) {
925
- l = await c.load(i);
924
+ for (const l of t.value.values())
925
+ if (await l.test(i)) {
926
+ c = await l.load(i);
926
927
  break;
927
928
  }
928
929
  } finally {
929
930
  e.value = void 0;
930
931
  }
931
- if (l === void 0)
932
+ if (c === void 0)
932
933
  throw new Error(`Failed to load source "${i}"`);
933
- return l;
934
+ return c;
934
935
  },
935
936
  openFileDialog: (i = {}) => {
936
937
  const {
937
- multiple: l = !1
938
+ multiple: c = !1
938
939
  } = i;
939
- return new Promise((c) => {
940
+ return new Promise((l) => {
940
941
  const u = [];
941
942
  for (const v of t.value.values())
942
943
  v.accept && u.push(v.accept);
943
- const d = u.join(","), { onChange: g, open: h } = jt({
944
+ const d = u.join(","), { onChange: g, open: h } = Ut({
944
945
  accept: d,
945
946
  reset: !0,
946
- multiple: l
947
+ multiple: c
947
948
  });
948
- g((v) => c(v ? Array.from(v) : [])), h();
949
+ g((v) => l(v ? Array.from(v) : [])), h();
949
950
  });
950
951
  }
951
952
  });
@@ -969,8 +970,8 @@ const To = (o) => {
969
970
  currentFrameAabb: n,
970
971
  config: s
971
972
  } = o, a = O(() => s.value.viewMode === "frame" ? n.value : t.value);
972
- function r(i, l) {
973
- function c() {
973
+ function r(i, c) {
974
+ function l() {
974
975
  const g = e.value.view;
975
976
  !g.width || !g.height || (i.width = g.width, i.height = g.height, i.dataset.pixelRatio = g.dataset.pixelRatio, i.getContext("2d")?.drawImage(g, 0, 0, g.width, g.height));
976
977
  }
@@ -978,7 +979,7 @@ const To = (o) => {
978
979
  i._onRendered && e.value.off("rendered", i._onRendered), e.value.input.setTarget(e.value.view);
979
980
  }
980
981
  function d() {
981
- u(), i._onRendered = c, e.value.on("rendered", c), l && e.value.input.setTarget(l);
982
+ u(), i._onRendered = l, e.value.on("rendered", l), c && e.value.input.setTarget(c);
982
983
  }
983
984
  return d(), u;
984
985
  }
@@ -988,15 +989,15 @@ const To = (o) => {
988
989
  }), () => {
989
990
  const {
990
991
  root: i,
991
- currentFrame: l,
992
- on: c,
992
+ currentFrame: c,
993
+ on: l,
993
994
  exec: u
994
995
  } = o;
995
996
  function d() {
996
997
  switch (s.value.viewMode) {
997
998
  case "frame":
998
999
  i.value?.children.forEach((g) => {
999
- g instanceof G && (g.visible = g.equal(l.value));
1000
+ g instanceof G && (g.visible = g.equal(c.value));
1000
1001
  });
1001
1002
  break;
1002
1003
  case "edgeless":
@@ -1007,7 +1008,7 @@ const To = (o) => {
1007
1008
  }
1008
1009
  u("zoomToFit");
1009
1010
  }
1010
- pe(() => s.value.viewMode, d), c("setCurrentFrame", d), c("setDoc", d);
1011
+ pe(() => s.value.viewMode, d), l("setCurrentFrame", d), l("setDoc", d);
1011
1012
  };
1012
1013
  }, $o = (o) => {
1013
1014
  const {
@@ -1016,16 +1017,16 @@ const To = (o) => {
1016
1017
  function t(s) {
1017
1018
  function a(r) {
1018
1019
  const i = r.text.base.characters;
1019
- let l = 0, c;
1020
+ let c = 0, l;
1020
1021
  i.forEach((f) => {
1021
1022
  const p = f.lineBox.left + f.lineBox.width;
1022
- p > l && (c = f, l = p);
1023
+ p > c && (l = f, c = p);
1023
1024
  });
1024
- const u = {}, d = i.filter((f) => f.lineBox.top === c?.lineBox.top).map((f) => (Object.assign(
1025
+ const u = {}, d = i.filter((f) => f.lineBox.top === l?.lineBox.top).map((f) => (Object.assign(
1025
1026
  u,
1026
1027
  { ...f.parent.style },
1027
1028
  { ...f.parent.parent.style }
1028
- ), f.content)).join(""), { boundingBox: g } = rt({
1029
+ ), f.content)).join(""), { boundingBox: g } = lt({
1029
1030
  style: {
1030
1031
  ...r.style.toJSON(),
1031
1032
  width: "auto"
@@ -1057,25 +1058,25 @@ const To = (o) => {
1057
1058
  t(s);
1058
1059
  return;
1059
1060
  }
1060
- function i(l) {
1061
- if (!l.text?.isValid?.() || typeof l.text?.content != "object")
1061
+ function i(c) {
1062
+ if (!c.text?.isValid?.() || typeof c.text?.content != "object")
1062
1063
  return;
1063
- const c = l.style.toJSON();
1064
+ const l = c.style.toJSON();
1064
1065
  switch (r) {
1065
1066
  case "autoWidth":
1066
- c.width = "auto";
1067
+ l.width = "auto";
1067
1068
  break;
1068
1069
  case "autoHeight":
1069
- c.height = "auto";
1070
+ l.height = "auto";
1070
1071
  break;
1071
1072
  }
1072
- const { boundingBox: u } = rt({
1073
- style: c,
1074
- content: l.text.content
1073
+ const { boundingBox: u } = lt({
1074
+ style: l,
1075
+ content: c.text.content
1075
1076
  });
1076
- (l.style.width !== u.width || l.style.height !== u.height) && (l.style.width = u.width, l.style.height = u.height, l.requestRedraw());
1077
+ (c.style.width !== u.width || c.style.height !== u.height) && (c.style.width = u.width, c.style.height = u.height, c.requestRedraw());
1077
1078
  }
1078
- i(s), s.findOne((l) => (l instanceof G && i(l), !1));
1079
+ i(s), s.findOne((c) => (c instanceof G && i(c), !1));
1079
1080
  }
1080
1081
  return Object.assign(o, {
1081
1082
  textFontSizeToFit: t,
@@ -1107,8 +1108,8 @@ const To = (o) => {
1107
1108
  textFontSizeToFit: a,
1108
1109
  textToFit: r,
1109
1110
  log: i,
1110
- root: l,
1111
- isFrame: c,
1111
+ root: c,
1112
+ isFrame: l,
1112
1113
  isLock: u,
1113
1114
  getObbInDrawboard: d,
1114
1115
  config: g,
@@ -1133,27 +1134,27 @@ const To = (o) => {
1133
1134
  x = n.value;
1134
1135
  else {
1135
1136
  const U = f.value[0];
1136
- U && (c(U) ? x = U : x = h(U));
1137
+ U && (l(U) ? x = U : x = h(U));
1137
1138
  }
1138
1139
  let N = t.value.top;
1139
1140
  const L = t.value.left + t.value.width + g.value.frameGap, j = Array.isArray(b), D = e.value.transact(() => {
1140
1141
  const W = (j ? b : [b]).map((he) => {
1141
1142
  const Y = e.value.addElement(he, { parentId: x?.id, regenId: A });
1142
1143
  if (x) {
1143
- const { width: xe, height: oe } = x.style, ve = xe / 2, ye = oe / 2;
1144
+ const { width: xe, height: ae } = x.style, ve = xe / 2, ye = ae / 2;
1144
1145
  if (Y.style.width || (Y.style.width = ve), Y.style.height || (Y.style.height = ye), T) {
1145
- const J = Y.style.width / Y.style.height, me = J > 1 ? ve : ye * J, ce = J > 1 ? ve / J : ye;
1146
+ const J = Y.style.width / Y.style.height, me = J > 1 ? ve : ye * J, ue = J > 1 ? ve / J : ye;
1146
1147
  E(
1147
1148
  Y,
1148
1149
  me / Y.style.width,
1149
- ce / Y.style.height,
1150
+ ue / Y.style.height,
1150
1151
  {
1151
1152
  deep: !0,
1152
1153
  textFontSizeToFit: !0
1153
1154
  }
1154
1155
  );
1155
1156
  }
1156
- w && (Y.style.left = Math.round(xe - Y.style.width) / 2, Y.style.top = Math.round(oe - Y.style.height) / 2);
1157
+ w && (Y.style.left = Math.round(xe - Y.style.width) / 2, Y.style.top = Math.round(ae - Y.style.height) / 2);
1157
1158
  } else
1158
1159
  w && (Y.style.top = Math.round(N), Y.style.left = Math.round(L), N += Y.style.height + g.value.frameGap);
1159
1160
  return Y;
@@ -1175,9 +1176,9 @@ const To = (o) => {
1175
1176
  b === f.value[0]?.id && (f.value = []), e.value?.deleteElement(b);
1176
1177
  }
1177
1178
  function z(b, k) {
1178
- $(b)?.setProperties(k);
1179
+ I(b)?.setProperties(k);
1179
1180
  }
1180
- function $(b) {
1181
+ function I(b) {
1181
1182
  return e.value?.nodeMap?.get(b);
1182
1183
  }
1183
1184
  function E(b, k, x, w = {}) {
@@ -1202,14 +1203,14 @@ const To = (o) => {
1202
1203
  f.value = b ? [b] : [];
1203
1204
  }
1204
1205
  function m(b) {
1205
- const k = l.value?.children.flatMap((x) => c(x) ? x.children : [x]).filter((x) => "isVisibleInTree" in x && x.isVisibleInTree() && co(b, d(x)) && !u(x)) ?? [];
1206
+ const k = c.value?.children.flatMap((x) => l(x) ? x.children : [x]).filter((x) => "isVisibleInTree" in x && x.isVisibleInTree() && co(b, d(x)) && !u(x)) ?? [];
1206
1207
  return f.value = k, k;
1207
1208
  }
1208
1209
  Object.assign(o, {
1209
1210
  addElement: p,
1210
1211
  deleteElement: _,
1211
1212
  updateElement: z,
1212
- getElement: $,
1213
+ getElement: I,
1213
1214
  resizeElement: E,
1214
1215
  pointerActivateElement: C,
1215
1216
  selectArea: m
@@ -1223,11 +1224,11 @@ const To = (o) => {
1223
1224
  frameThumbs: a,
1224
1225
  emit: r,
1225
1226
  selection: i,
1226
- frames: l,
1227
- config: c
1227
+ frames: c,
1228
+ config: l
1228
1229
  } = o;
1229
1230
  function u(y = {}, f) {
1230
- const p = qt({
1231
+ const p = Gt({
1231
1232
  ...y,
1232
1233
  id: void 0,
1233
1234
  name: "Frame",
@@ -1236,8 +1237,8 @@ const To = (o) => {
1236
1237
  inEditorIs: "Frame"
1237
1238
  }
1238
1239
  });
1239
- p.style ??= {}, p.style.left = n.value.left + n.value.width + c.value.frameGap, p.style.width ||= n.value.width, p.style.height ||= n.value.height;
1240
- const _ = f ?? (s.value > -1 ? s.value + 1 : l.value.length - 1);
1240
+ p.style ??= {}, p.style.left = n.value.left + n.value.width + l.value.frameGap, p.style.width ||= n.value.width, p.style.height ||= n.value.height;
1241
+ const _ = f ?? (s.value > -1 ? s.value + 1 : c.value.length - 1);
1241
1242
  e.value?.addElement(p, { index: _ }), v(_), r("addFrame", _);
1242
1243
  }
1243
1244
  function d(y = s.value) {
@@ -1262,9 +1263,9 @@ const To = (o) => {
1262
1263
  f && (e.value?.deleteElement(f), a.value.splice(y, 1), v(y), r("deleteFrame", y));
1263
1264
  }
1264
1265
  function v(y = s.value) {
1265
- y = Math.max(0, Math.min(l.value.length - 1, y));
1266
+ y = Math.max(0, Math.min(c.value.length - 1, y));
1266
1267
  const f = s.value;
1267
- s.value = y, c.value.viewMode === "edgeless" ? i.value = [l.value[y]] : i.value = [], r("setCurrentFrame", y, f);
1268
+ s.value = y, l.value.viewMode === "edgeless" ? i.value = [c.value[y]] : i.value = [], r("setCurrentFrame", y, f);
1268
1269
  }
1269
1270
  Object.assign(o, {
1270
1271
  addFrame: u,
@@ -1274,7 +1275,7 @@ const To = (o) => {
1274
1275
  setCurrentFrame: v
1275
1276
  });
1276
1277
  };
1277
- function Oe(o) {
1278
+ function Ie(o) {
1278
1279
  return new Promise((e, t) => {
1279
1280
  o.onerror = (n) => t(new Error(n.target.error)), o.onsuccess = (n) => e(n.target.result);
1280
1281
  });
@@ -1291,7 +1292,7 @@ function No(o, e) {
1291
1292
  });
1292
1293
  }
1293
1294
  function Ro(o) {
1294
- return Oe(indexedDB.deleteDatabase(o));
1295
+ return Ie(indexedDB.deleteDatabase(o));
1295
1296
  }
1296
1297
  function Bo(o, e) {
1297
1298
  return e.forEach((t) => o.createObjectStore.apply(o, t));
@@ -1301,22 +1302,22 @@ function Ue(o, e, t = "readwrite") {
1301
1302
  return e.map((s) => Yo(n, s));
1302
1303
  }
1303
1304
  function nn(o, e) {
1304
- return Oe(o.count(e));
1305
+ return Ie(o.count(e));
1305
1306
  }
1306
1307
  function Lo(o, e) {
1307
- return Oe(o.get(e));
1308
+ return Ie(o.get(e));
1308
1309
  }
1309
1310
  function on(o, e) {
1310
- return Oe(o.delete(e));
1311
+ return Ie(o.delete(e));
1311
1312
  }
1312
1313
  function Do(o, e, t) {
1313
- return Oe(o.put(e, t));
1314
+ return Ie(o.put(e, t));
1314
1315
  }
1315
- function ut(o, e) {
1316
- return Oe(o.add(e));
1316
+ function mt(o, e) {
1317
+ return Ie(o.add(e));
1317
1318
  }
1318
1319
  function Vo(o, e, t) {
1319
- return Oe(o.getAll(e, t));
1320
+ return Ie(o.getAll(e, t));
1320
1321
  }
1321
1322
  function jo(o, e, t) {
1322
1323
  let n = null;
@@ -1355,15 +1356,15 @@ function qo(o, e) {
1355
1356
  function Go(o, e) {
1356
1357
  return IDBKeyRange.lowerBound(o, e);
1357
1358
  }
1358
- const st = "custom", sn = "updates", an = 500;
1359
+ const at = "custom", sn = "updates", an = 500;
1359
1360
  function rn(o, e, t) {
1360
1361
  const [n] = Ue(
1361
1362
  o.db,
1362
1363
  [sn]
1363
1364
  ), s = Go(o._dbref, !1);
1364
1365
  return Vo(n, s).then((a) => {
1365
- o._destroyed || (e?.(n), ie.transact(o.doc, () => {
1366
- a.forEach((r) => ie.applyUpdate(o.doc, r));
1366
+ o._destroyed || (e?.(n), le.transact(o.doc, () => {
1367
+ a.forEach((r) => le.applyUpdate(o.doc, r));
1367
1368
  }, o, !1), t?.(n));
1368
1369
  }).then(() => Uo(n).then((a) => {
1369
1370
  o._dbref = a + 1;
@@ -1373,7 +1374,7 @@ function rn(o, e, t) {
1373
1374
  }
1374
1375
  function Wo(o, e = !0) {
1375
1376
  return rn(o).then((t) => {
1376
- (e || o._dbsize >= an) && ut(t, ie.encodeStateAsUpdate(o.doc)).then(() => on(
1377
+ (e || o._dbsize >= an) && mt(t, le.encodeStateAsUpdate(o.doc)).then(() => on(
1377
1378
  t,
1378
1379
  qo(o._dbref, !0)
1379
1380
  )).then(() => nn(t).then((n) => {
@@ -1381,7 +1382,7 @@ function Wo(o, e = !0) {
1381
1382
  }));
1382
1383
  });
1383
1384
  }
1384
- class Ko extends Gt {
1385
+ class Ko extends Wt {
1385
1386
  constructor(e, t) {
1386
1387
  super(), this.name = e, this.doc = t, this._db = No(e, (n) => {
1387
1388
  Bo(n, [
@@ -1391,7 +1392,7 @@ class Ko extends Gt {
1391
1392
  }), this.whenSynced = new Promise((n) => this.on("synced", () => n(this))), this._db.then((n) => {
1392
1393
  this.db = n, rn(
1393
1394
  this,
1394
- (s) => ut(s, ie.encodeStateAsUpdate(t)),
1395
+ (s) => mt(s, le.encodeStateAsUpdate(t)),
1395
1396
  () => {
1396
1397
  this._destroyed || (this.synced = !0, this.emit("synced", this));
1397
1398
  }
@@ -1399,7 +1400,7 @@ class Ko extends Gt {
1399
1400
  }), this._storeUpdate = (n, s) => {
1400
1401
  if (this.db && s !== this) {
1401
1402
  const [a] = Ue(this.db, [sn]);
1402
- ut(a, n), ++this._dbsize >= an && (this._storeTimeoutId !== null && clearTimeout(this._storeTimeoutId), this._storeTimeoutId = setTimeout(() => {
1403
+ mt(a, n), ++this._dbsize >= an && (this._storeTimeoutId !== null && clearTimeout(this._storeTimeoutId), this._storeTimeoutId = setTimeout(() => {
1403
1404
  Wo(this, !1), this._storeTimeoutId = null;
1404
1405
  }, this._storeTimeout));
1405
1406
  }
@@ -1427,26 +1428,26 @@ class Ko extends Gt {
1427
1428
  }
1428
1429
  get(e) {
1429
1430
  return this._db.then((t) => {
1430
- const [n] = Ue(t, [st], "readonly");
1431
+ const [n] = Ue(t, [at], "readonly");
1431
1432
  return Lo(n, e);
1432
1433
  });
1433
1434
  }
1434
1435
  set(e, t) {
1435
1436
  return this._db.then((n) => {
1436
- const [s] = Ue(n, [st]);
1437
+ const [s] = Ue(n, [at]);
1437
1438
  return Do(s, t, e);
1438
1439
  });
1439
1440
  }
1440
1441
  del(e) {
1441
1442
  return this._db.then((t) => {
1442
- const [n] = Ue(t, [st]);
1443
+ const [n] = Ue(t, [at]);
1443
1444
  return on(n, e);
1444
1445
  });
1445
1446
  }
1446
1447
  }
1447
1448
  class ln extends Un {
1448
- constructor(e = gt()) {
1449
- super(), this.id = e, this._yDoc = fe(new ie.Doc({ guid: this.id })), this._yDoc.on("update", (...t) => this.emit("update", ...t)), this._yProps = fe(this._yDoc.getMap("props")), this._propertyAccessor = {
1449
+ constructor(e = wt()) {
1450
+ super(), this.id = e, this._yDoc = fe(new le.Doc({ guid: this.id })), this._yDoc.on("update", (...t) => this.emit("update", ...t)), this._yProps = fe(this._yDoc.getMap("props")), this._propertyAccessor = {
1450
1451
  getProperty: (t) => this._yProps.doc ? this._yProps.get(t) : void 0,
1451
1452
  setProperty: (t, n) => {
1452
1453
  this.transact(() => this._yProps.set(t, n));
@@ -1459,7 +1460,7 @@ class ln extends Un {
1459
1460
  indexeddb;
1460
1461
  _ready = !1;
1461
1462
  _setupUndoManager(e = []) {
1462
- const t = fe(new ie.UndoManager([
1463
+ const t = fe(new le.UndoManager([
1463
1464
  this._yProps,
1464
1465
  ...e
1465
1466
  ], {
@@ -1521,32 +1522,32 @@ var Jo = Object.defineProperty, Zo = (o, e, t, n) => {
1521
1522
  return s && Jo(e, t, s), s;
1522
1523
  };
1523
1524
  function Qo(o, e = {}, t, n = !1) {
1524
- const s = qt({
1525
+ const s = Gt({
1525
1526
  ...e,
1526
1527
  id: n ? void 0 : e.id,
1527
1528
  meta: {
1528
1529
  inCanvasIs: "Element2D",
1529
1530
  ...e?.meta ?? {}
1530
1531
  }
1531
- }), a = s.id, r = new ie.Array();
1532
+ }), a = s.id, r = new le.Array();
1532
1533
  for (const i in s)
1533
1534
  o.set(i, s[i]);
1534
- return o.set("id", a), o.set("parentId", t), o.set("name", s.name ?? a), o.set("childrenIds", r), o.set("meta", new ie.Map(Object.entries(s.meta ?? {}))), s?.meta?.inCanvasIs === "Element2D" && (o.set("style", new ie.Map(Object.entries(s.style ?? {}))), o.set("background", new ie.Map(Object.entries(s.background ?? {}))), o.set("shape", new ie.Map(Object.entries(s.shape ?? {}))), o.set("fill", new ie.Map(Object.entries(s.fill ?? {}))), o.set("outline", new ie.Map(Object.entries(s.outline ?? {}))), o.set("text", new ie.Map(Object.entries(s.text ?? {}))), o.set("foreground", new ie.Map(Object.entries(s.foreground ?? {}))), o.set("shadow", new ie.Map(Object.entries(s.shadow ?? {})))), {
1535
+ return o.set("id", a), o.set("parentId", t), o.set("name", s.name ?? a), o.set("childrenIds", r), o.set("meta", new le.Map(Object.entries(s.meta ?? {}))), s?.meta?.inCanvasIs === "Element2D" && (o.set("style", new le.Map(Object.entries(s.style ?? {}))), o.set("background", new le.Map(Object.entries(s.background ?? {}))), o.set("shape", new le.Map(Object.entries(s.shape ?? {}))), o.set("fill", new le.Map(Object.entries(s.fill ?? {}))), o.set("outline", new le.Map(Object.entries(s.outline ?? {}))), o.set("text", new le.Map(Object.entries(s.text ?? {}))), o.set("foreground", new le.Map(Object.entries(s.foreground ?? {}))), o.set("shadow", new le.Map(Object.entries(s.shadow ?? {})))), {
1535
1536
  normalized: s,
1536
1537
  yChildrenIds: r
1537
1538
  };
1538
1539
  }
1539
1540
  function cn(o, e, t = !1) {
1540
- const n = [], s = new ie.Map(), { normalized: a, yChildrenIds: r } = Qo(s, o, e, t), i = a.id;
1541
- return n.push({ id: i, element: s }), a.children?.forEach((l) => {
1542
- const c = cn(l, i, t);
1543
- r.push([c[0].id]), n.push(...c);
1541
+ const n = [], s = new le.Map(), { normalized: a, yChildrenIds: r } = Qo(s, o, e, t), i = a.id;
1542
+ return n.push({ id: i, element: s }), a.children?.forEach((c) => {
1543
+ const l = cn(c, i, t);
1544
+ r.push([l[0].id]), n.push(...l);
1544
1545
  }), n;
1545
1546
  }
1546
1547
  class un extends ln {
1547
1548
  _yChildren;
1548
1549
  _yChildrenIds;
1549
- root = Ce(new kt());
1550
+ root = Ee(new Ct());
1550
1551
  nodeMap = /* @__PURE__ */ new Map();
1551
1552
  get meta() {
1552
1553
  return this.root.meta;
@@ -1572,7 +1573,7 @@ class un extends ln {
1572
1573
  }
1573
1574
  async load(e) {
1574
1575
  return super.load(async () => {
1575
- await e?.(), this._yChildren.size || (this.init(), await Pe()), this._proxyProps(this.root, this._yProps);
1576
+ await e?.(), this._yChildren.size || (this.init(), await Re()), this._proxyProps(this.root, this._yProps);
1576
1577
  const t = this._yProps.get("meta");
1577
1578
  t && this._proxyProps(this.root.meta, t, !0), this._proxyChildren(this.root, this._yChildrenIds), this._yChildrenIds.forEach((n) => {
1578
1579
  const s = this._yChildren.get(n);
@@ -1621,9 +1622,9 @@ class un extends ln {
1621
1622
  _addElement(e, t = {}) {
1622
1623
  const { parentId: n, index: s, regenId: a } = t, r = cn(e, n, a);
1623
1624
  r.forEach((d) => this._yChildren.set(d.id, d.element));
1624
- const l = r.map((d) => this._getOrCreateNode(d.element))[0];
1625
- let c, u;
1626
- return n ? (c = this.nodeMap.get(n), u = this._yChildren.get(n)?.get("childrenIds")) : (c = this.root, u = this._yChildrenIds), c && u && (s === void 0 ? (u.push([l.id]), c.appendChild(l)) : (u.insert(s, [l.id]), c.moveChild(l, s))), l;
1625
+ const c = r.map((d) => this._getOrCreateNode(d.element))[0];
1626
+ let l, u;
1627
+ return n ? (l = this.nodeMap.get(n), u = this._yChildren.get(n)?.get("childrenIds")) : (l = this.root, u = this._yChildrenIds), l && u && (s === void 0 ? (u.push([c.id]), l.appendChild(c)) : (u.insert(s, [c.id]), l.moveChild(c, s))), c;
1627
1628
  }
1628
1629
  addElement(e, t) {
1629
1630
  return this.transact(() => this._addElement(e, t));
@@ -1633,7 +1634,7 @@ class un extends ln {
1633
1634
  }
1634
1635
  set(e) {
1635
1636
  const { children: t = [], meta: n = {}, ...s } = e;
1636
- return this.reset(), this.addElements(t), this.setProperties(s), this._yProps.set("meta", new ie.Map(Object.entries(n))), this;
1637
+ return this.reset(), this.addElements(t), this.setProperties(s), this._yProps.set("meta", new le.Map(Object.entries(n))), this;
1637
1638
  }
1638
1639
  _deleteElement(e) {
1639
1640
  const t = this.nodeMap.get(e), n = this._yChildren.get(e);
@@ -1669,19 +1670,19 @@ class un extends ln {
1669
1670
  if (n) {
1670
1671
  e._propertyAccessor = void 0;
1671
1672
  const r = {};
1672
- t.forEach((i, l) => {
1673
- r[l] = e.getProperty(l);
1674
- }), e._propertyAccessor = fe(s), t.forEach((i, l) => {
1675
- const c = e.getProperty(l), u = r[l];
1676
- c !== void 0 && !Object.is(c, u) && (e.setProperty(l, c), e.requestUpdate(l, c, u));
1673
+ t.forEach((i, c) => {
1674
+ r[c] = e.getProperty(c);
1675
+ }), e._propertyAccessor = fe(s), t.forEach((i, c) => {
1676
+ const l = e.getProperty(c), u = r[c];
1677
+ l !== void 0 && !Object.is(l, u) && (e.setProperty(c, l), e.requestUpdate(c, l, u));
1677
1678
  });
1678
1679
  }
1679
1680
  e.setPropertyAccessor(s);
1680
1681
  const a = (r, i) => {
1681
1682
  this._isSelfTransaction(i) || this.transact(() => {
1682
- const { keysChanged: l, changes: c } = r;
1683
- l.forEach((u) => {
1684
- const d = c.keys.get(u), g = d?.oldValue;
1683
+ const { keysChanged: c, changes: l } = r;
1684
+ c.forEach((u) => {
1685
+ const d = l.keys.get(u), g = d?.oldValue;
1685
1686
  switch (d?.action) {
1686
1687
  case "add":
1687
1688
  case "update":
@@ -1706,13 +1707,13 @@ class un extends ln {
1706
1707
  return;
1707
1708
  const r = e.children;
1708
1709
  let i = 0;
1709
- s.changes.delta.forEach((l) => {
1710
- if (l.retain !== void 0 && (i += l.retain), l.delete)
1711
- for (let c = i; c < i + l.delete; c++)
1712
- r[c]?.remove();
1713
- if (l.insert) {
1714
- const c = Array.isArray(l.insert) ? l.insert : [l.insert];
1715
- c.forEach((u, d) => {
1710
+ s.changes.delta.forEach((c) => {
1711
+ if (c.retain !== void 0 && (i += c.retain), c.delete)
1712
+ for (let l = i; l < i + c.delete; l++)
1713
+ r[l]?.remove();
1714
+ if (c.insert) {
1715
+ const l = Array.isArray(c.insert) ? c.insert : [c.insert];
1716
+ l.forEach((u, d) => {
1716
1717
  let g = this.nodeMap.get(u);
1717
1718
  const h = (v) => {
1718
1719
  e.moveChild(v, i + d);
@@ -1720,7 +1721,7 @@ class un extends ln {
1720
1721
  g ? h(g) : setTimeout(() => {
1721
1722
  g = this.nodeMap.get(u), g && h(g);
1722
1723
  }, 0);
1723
- }), i += c.length;
1724
+ }), i += l.length;
1724
1725
  }
1725
1726
  });
1726
1727
  };
@@ -1746,8 +1747,8 @@ class un extends ln {
1746
1747
  _getOrCreateNode(e) {
1747
1748
  const t = e.get("id");
1748
1749
  let n = this.nodeMap.get(t);
1749
- return n || (this.undoManager.addToScope(e), n = Ce(
1750
- kt.parse({
1750
+ return n || (this.undoManager.addToScope(e), n = Ee(
1751
+ Ct.parse({
1751
1752
  meta: {
1752
1753
  inCanvasIs: e.get("meta")?.get("inCanvasIs")
1753
1754
  }
@@ -1764,12 +1765,12 @@ class un extends ln {
1764
1765
  Zo([
1765
1766
  Ye({ default: "doc" })
1766
1767
  ], un.prototype, "name");
1767
- var es = Object.defineProperty, et = (o, e, t, n) => {
1768
+ var es = Object.defineProperty, tt = (o, e, t, n) => {
1768
1769
  for (var s = void 0, a = o.length - 1, r; a >= 0; a--)
1769
1770
  (r = o[a]) && (s = r(e, t, s) || s);
1770
1771
  return s && es(e, t, s), s;
1771
1772
  };
1772
- class tt extends ln {
1773
+ class nt extends ln {
1773
1774
  docs = /* @__PURE__ */ new Map();
1774
1775
  set(e = {}) {
1775
1776
  return super.reset(), this.setProperties(e), this;
@@ -1780,18 +1781,18 @@ class tt extends ln {
1780
1781
  return this.docs.set(e.id, e), e;
1781
1782
  }
1782
1783
  }
1783
- et([
1784
+ tt([
1784
1785
  Ye()
1785
- ], tt.prototype, "name");
1786
- et([
1786
+ ], nt.prototype, "name");
1787
+ tt([
1787
1788
  Ye()
1788
- ], tt.prototype, "type");
1789
- et([
1789
+ ], nt.prototype, "type");
1790
+ tt([
1790
1791
  Ye()
1791
- ], tt.prototype, "createdAt");
1792
- et([
1792
+ ], nt.prototype, "createdAt");
1793
+ tt([
1793
1794
  Ye()
1794
- ], tt.prototype, "updatedAt");
1795
+ ], nt.prototype, "updatedAt");
1795
1796
  const ts = (o, e) => {
1796
1797
  const {
1797
1798
  workspace: t,
@@ -1800,15 +1801,15 @@ const ts = (o, e) => {
1800
1801
  emit: a,
1801
1802
  selection: r,
1802
1803
  setCurrentFrame: i,
1803
- state: l,
1804
- to: c,
1804
+ state: c,
1805
+ to: l,
1805
1806
  waitUntilFontLoad: u,
1806
1807
  config: d,
1807
1808
  load: g
1808
1809
  } = o, h = () => {
1809
1810
  s.value.root.removeChildren(), s.value.root.children.length = 0, n.value = void 0, r.value = [], a("clearDoc");
1810
- }, v = () => c("json"), y = async (p) => {
1811
- l.value = "loading";
1811
+ }, v = () => l("json"), y = async (p) => {
1812
+ c.value = "loading";
1812
1813
  const _ = new un(typeof p == "string" ? p : p.id);
1813
1814
  try {
1814
1815
  await u(), h(), await _.load(async () => {
@@ -1819,9 +1820,9 @@ const ts = (o, e) => {
1819
1820
  console.error(z);
1820
1821
  }
1821
1822
  typeof p != "string" && _.set(p);
1822
- }), _.on("update", Hn((z, $) => a("updateDoc", z, $), 200)), t.value?.addDoc(_), n.value?.destroy(), n.value = _, s.value.root.appendChild(_.root), i(0), a("setDoc", _);
1823
+ }), _.on("update", Hn((z, I) => a("updateDoc", z, I), 200)), t.value?.addDoc(_), n.value?.destroy(), n.value = _, s.value.root.appendChild(_.root), i(0), a("setDoc", _);
1823
1824
  } finally {
1824
- l.value = void 0;
1825
+ c.value = void 0;
1825
1826
  }
1826
1827
  return _;
1827
1828
  };
@@ -1848,10 +1849,10 @@ const ts = (o, e) => {
1848
1849
  frameThumbs: a,
1849
1850
  log: r,
1850
1851
  fonts: i,
1851
- registerConfig: l
1852
+ registerConfig: c
1852
1853
  } = o;
1853
- l("frameScreenshot", !1);
1854
- async function c() {
1854
+ c("frameScreenshot", !1);
1855
+ async function l() {
1855
1856
  a.value.length = t.value.length;
1856
1857
  for (let h = 0; h < t.value.length; h++)
1857
1858
  await d(h);
@@ -1859,7 +1860,7 @@ const ts = (o, e) => {
1859
1860
  async function u(h) {
1860
1861
  await o.waitUntilFontLoad();
1861
1862
  let v;
1862
- return h instanceof G ? v = h.toJSON() : v = { ...h }, v.style ??= {}, v.style.top = 0, v.style.left = 0, await Qe({
1863
+ return h instanceof G ? v = h.toJSON() : v = { ...h }, v.style ??= {}, v.style.top = 0, v.style.left = 0, await et({
1863
1864
  width: v.style.width,
1864
1865
  height: v.style.height,
1865
1866
  fonts: i,
@@ -1887,12 +1888,12 @@ const ts = (o, e) => {
1887
1888
  p.fillStyle = "rgba(0, 0, 0, 0)", p.clearRect(0, 0, h.width, h.height);
1888
1889
  const { zoom: _, position: z } = s.value;
1889
1890
  h.width = y.width, h.height = y.height;
1890
- const $ = y.width * _.x, E = y.height * _.y;
1891
+ const I = y.width * _.x, E = y.height * _.y;
1891
1892
  p.drawImage(
1892
1893
  v,
1893
1894
  (y.left * _.x + z.x) * f,
1894
1895
  (y.top * _.x + z.y) * f,
1895
- $ * f,
1896
+ I * f,
1896
1897
  E * f,
1897
1898
  0,
1898
1899
  0,
@@ -1901,7 +1902,7 @@ const ts = (o, e) => {
1901
1902
  );
1902
1903
  }
1903
1904
  return Object.assign(o, {
1904
- snapshot: c,
1905
+ snapshot: l,
1905
1906
  captureElementScreenshot: u,
1906
1907
  captureFrameScreenshot: d,
1907
1908
  renderFrameThumb: g
@@ -1911,7 +1912,7 @@ const ts = (o, e) => {
1911
1912
  config: v
1912
1913
  } = o;
1913
1914
  h("setDoc", (y) => {
1914
- v.value.frameScreenshot && c();
1915
+ v.value.frameScreenshot && l();
1915
1916
  function f(p) {
1916
1917
  if (v.value.frameScreenshot) {
1917
1918
  const _ = p.getIndex();
@@ -1955,13 +1956,13 @@ const ts = (o, e) => {
1955
1956
  function ss(o, e) {
1956
1957
  return o < e ? -1 : o === e ? 0 : 1;
1957
1958
  }
1958
- function at(o, e) {
1959
+ function it(o, e) {
1959
1960
  return o === e;
1960
1961
  }
1961
- function Fe(o) {
1962
+ function Ne(o) {
1962
1963
  return typeof o > "u";
1963
1964
  }
1964
- class bt {
1965
+ class xt {
1965
1966
  /**
1966
1967
  * First node in the list
1967
1968
  * @type {Object}
@@ -1997,7 +1998,7 @@ class bt {
1997
1998
  * or if the element is undefined.
1998
1999
  */
1999
2000
  add(e, t) {
2000
- if (Fe(t) && (t = this.nElements), t < 0 || t > this.nElements || Fe(e))
2001
+ if (Ne(t) && (t = this.nElements), t < 0 || t > this.nElements || Ne(e))
2001
2002
  return !1;
2002
2003
  const n = this.createNode(e);
2003
2004
  if (this.nElements === 0 || this.lastNode === null)
@@ -2064,8 +2065,8 @@ class bt {
2064
2065
  * element.
2065
2066
  */
2066
2067
  indexOf(e, t) {
2067
- const n = t || at;
2068
- if (Fe(e))
2068
+ const n = t || it;
2069
+ if (Ne(e))
2069
2070
  return -1;
2070
2071
  let s = this.firstNode, a = 0;
2071
2072
  for (; s !== null; ) {
@@ -2112,8 +2113,8 @@ class bt {
2112
2113
  * @return {boolean} true if the list contained the specified element.
2113
2114
  */
2114
2115
  remove(e, t) {
2115
- const n = t || at;
2116
- if (this.nElements < 1 || Fe(e))
2116
+ const n = t || it;
2117
+ if (this.nElements < 1 || Ne(e))
2117
2118
  return !1;
2118
2119
  let s = null, a = this.firstNode;
2119
2120
  for (; a !== null; ) {
@@ -2140,8 +2141,8 @@ class bt {
2140
2141
  * @return {boolean} true if this list is equal to the given list.
2141
2142
  */
2142
2143
  equals(e, t) {
2143
- const n = t || at;
2144
- return !(e instanceof bt) || this.size() !== e.size() ? !1 : this.equalsAux(this.firstNode, e.firstNode, n);
2144
+ const n = t || it;
2145
+ return !(e instanceof xt) || this.size() !== e.size() ? !1 : this.equalsAux(this.firstNode, e.firstNode, n);
2145
2146
  }
2146
2147
  /**
2147
2148
  * @private
@@ -2260,7 +2261,7 @@ class as {
2260
2261
  * @constructor
2261
2262
  */
2262
2263
  constructor() {
2263
- this.list = new bt();
2264
+ this.list = new xt();
2264
2265
  }
2265
2266
  /**
2266
2267
  * Inserts the specified element into the end of this queue.
@@ -2397,7 +2398,7 @@ class is {
2397
2398
  * @return {boolean} true if this tree did not already contain the specified element.
2398
2399
  */
2399
2400
  add(e) {
2400
- return Fe(e) ? !1 : this.insertNode(this.createNode(e)) !== null ? (this.nElements++, !0) : !1;
2401
+ return Ne(e) ? !1 : this.insertNode(this.createNode(e)) !== null ? (this.nElements++, !0) : !1;
2401
2402
  }
2402
2403
  /**
2403
2404
  * Removes all of the elements from this tree.
@@ -2426,7 +2427,7 @@ class is {
2426
2427
  * false otherwise.
2427
2428
  */
2428
2429
  contains(e) {
2429
- return Fe(e) ? !1 : this.searchNode(this.root, e) !== null;
2430
+ return Ne(e) ? !1 : this.searchNode(this.root, e) !== null;
2430
2431
  }
2431
2432
  /**
2432
2433
  * 搜索元素
@@ -2663,12 +2664,12 @@ class is {
2663
2664
  };
2664
2665
  }
2665
2666
  }
2666
- class At extends is {
2667
+ class St extends is {
2667
2668
  }
2668
- function Ie(o, e, t) {
2669
+ function Pe(o, e, t) {
2669
2670
  return { pos: o, type: e, box: t };
2670
2671
  }
2671
- function Ge(o) {
2672
+ function We(o) {
2672
2673
  const e = "box" in o ? o.box : o;
2673
2674
  return {
2674
2675
  left: e.hl.pos,
@@ -2677,10 +2678,10 @@ function Ge(o) {
2677
2678
  height: e.vb.pos - e.vt.pos
2678
2679
  };
2679
2680
  }
2680
- function St(o) {
2681
+ function Mt(o) {
2681
2682
  return o === "vt" ? "vb" : o === "vb" ? "vt" : o === "hl" ? "hr" : o === "hr" ? "hl" : o;
2682
2683
  }
2683
- function it(o) {
2684
+ function rt(o) {
2684
2685
  return ["vt", "hl"].includes(o.type);
2685
2686
  }
2686
2687
  const rs = (o) => {
@@ -2696,13 +2697,13 @@ const rs = (o) => {
2696
2697
  return;
2697
2698
  const C = {};
2698
2699
  let m, b, k, x;
2699
- return E.instanceId ? (C.id = E.instanceId, { top: m, left: b, height: k, width: x } = s(E)) : (C.id = Math.random(), { top: m, left: b, height: k, width: x } = E), C.vt = Ie(m, "vt", C), C.vm = Ie(m + k / 2, "vm", C), C.vb = Ie(m + k, "vb", C), C.hl = Ie(b, "hl", C), C.hm = Ie(b + x / 2, "hm", C), C.hr = Ie(b + x, "hr", C), C;
2700
+ return E.instanceId ? (C.id = E.instanceId, { top: m, left: b, height: k, width: x } = s(E)) : (C.id = Math.random(), { top: m, left: b, height: k, width: x } = E), C.vt = Pe(m, "vt", C), C.vm = Pe(m + k / 2, "vm", C), C.vb = Pe(m + k, "vb", C), C.hl = Pe(b, "hl", C), C.hm = Pe(b + x / 2, "hm", C), C.hr = Pe(b + x, "hr", C), C;
2700
2701
  }
2701
- const i = O(() => 4), l = O(() => new Set(
2702
+ const i = O(() => 4), c = O(() => new Set(
2702
2703
  [
2703
2704
  t.value[0]?.instanceId
2704
2705
  ].filter(Boolean)
2705
- )), c = O(() => {
2706
+ )), l = O(() => {
2706
2707
  if (t.value[0])
2707
2708
  return r(t.value[0]);
2708
2709
  }), u = O(() => {
@@ -2714,20 +2715,20 @@ const rs = (o) => {
2714
2715
  const E = [
2715
2716
  ...u.value?.children ?? a.value?.children ?? []
2716
2717
  ];
2717
- return e.value && u.value?.equal(e.value) && E.push(u.value), E.filter((C) => !l.value.has(C.instanceId)).map((C) => r(C)).filter(Boolean);
2718
+ return e.value && u.value?.equal(e.value) && E.push(u.value), E.filter((C) => !c.value.has(C.instanceId)).map((C) => r(C)).filter(Boolean);
2718
2719
  }), h = O(() => g.value.reduce(
2719
2720
  (E, C) => ([C.vt, C.vm, C.vb].forEach((m) => E.vLines.add(m)), [C.hl, C.hm, C.hr].forEach((m) => E.hLines.add(m)), E),
2720
2721
  {
2721
- vLines: new At((E, C) => E.pos - C.pos),
2722
- hLines: new At((E, C) => E.pos - C.pos)
2722
+ vLines: new St((E, C) => E.pos - C.pos),
2723
+ hLines: new St((E, C) => E.pos - C.pos)
2723
2724
  }
2724
2725
  ));
2725
2726
  function v(E) {
2726
2727
  return E.box?.id === -1;
2727
2728
  }
2728
2729
  function y(E, C) {
2729
- const m = ["vt", "vb"].includes(C.type) ? "vertical" : "horizontal", b = m === "vertical" ? "horizontal" : "vertical", k = it(C);
2730
- let x = St(C.type);
2730
+ const m = ["vt", "vb"].includes(C.type) ? "vertical" : "horizontal", b = m === "vertical" ? "horizontal" : "vertical", k = rt(C);
2731
+ let x = Mt(C.type);
2731
2732
  if (k) {
2732
2733
  if (C.pos > d.value[x].pos)
2733
2734
  return [];
@@ -2744,14 +2745,14 @@ const rs = (o) => {
2744
2745
  } else if (C.pos > P.pos)
2745
2746
  return;
2746
2747
  const B = v(P);
2747
- x !== P.type && !B || Be(Ge(C), Ge(P), b) && (!B && T && T.box.id !== P.box.id && Be(Ge(T), Ge(P), m) || (T = P, w.push(P), x = St(x)));
2748
+ x !== P.type && !B || Be(We(C), We(P), b) && (!B && T && T.box.id !== P.box.id && Be(We(T), We(P), m) || (T = P, w.push(P), x = Mt(x)));
2748
2749
  };
2749
2750
  return k ? E.outorderTraversal(M) : E.inorderTraversal(M), w;
2750
2751
  }
2751
2752
  function f(E, C) {
2752
2753
  if (!E.length)
2753
2754
  return [];
2754
- const m = it(C), b = E[0].pos;
2755
+ const m = rt(C), b = E[0].pos;
2755
2756
  let k = Math.abs(C.pos - b);
2756
2757
  const x = [];
2757
2758
  E = [C].concat(E);
@@ -2774,9 +2775,9 @@ const rs = (o) => {
2774
2775
  }, x);
2775
2776
  }
2776
2777
  const p = O(() => {
2777
- if (!c.value)
2778
+ if (!l.value)
2778
2779
  return [];
2779
- const { vLines: E, hLines: C } = h.value, m = c.value, b = { vt: [], vb: [], hl: [], hr: [] }, k = [];
2780
+ const { vLines: E, hLines: C } = h.value, m = l.value, b = { vt: [], vb: [], hl: [], hr: [] }, k = [];
2780
2781
  return [
2781
2782
  { sources: [m.vt, m.vm, m.vb], targets: E },
2782
2783
  { sources: [m.hl, m.hm, m.hr], targets: C }
@@ -2802,7 +2803,7 @@ const rs = (o) => {
2802
2803
  if (T && P && (!v(T) || !v(P))) {
2803
2804
  const A = Math.abs(M.pos - T.pos), N = Math.abs(B.pos - P.pos);
2804
2805
  if (Math.abs(A - N) < i.value) {
2805
- const L = it(M);
2806
+ const L = rt(M);
2806
2807
  k.push({
2807
2808
  target: T,
2808
2809
  source: M,
@@ -2880,7 +2881,7 @@ const rs = (o) => {
2880
2881
  return M;
2881
2882
  });
2882
2883
  });
2883
- function $(E = !1) {
2884
+ function I(E = !1) {
2884
2885
  const C = [], m = [];
2885
2886
  for (const b of p.value) {
2886
2887
  const { target: k, source: x, type: w } = b, T = k.box, M = x.box;
@@ -2901,7 +2902,7 @@ const rs = (o) => {
2901
2902
  }
2902
2903
  return Object.assign(o, {
2903
2904
  auxiliaryLines: z,
2904
- getAdsorptionPoints: $
2905
+ getAdsorptionPoints: I
2905
2906
  }), {
2906
2907
  name: "mce:auxiliary"
2907
2908
  };
@@ -2914,7 +2915,7 @@ const rs = (o) => {
2914
2915
  } = o, a = V();
2915
2916
  async function r() {
2916
2917
  const u = e.value.length === 1 ? [e.value[0].toJSON()] : e.value.map((d) => d.toJSON());
2917
- if (Et) {
2918
+ if (Tt) {
2918
2919
  const d = "text/html";
2919
2920
  await navigator.clipboard.write([
2920
2921
  new ClipboardItem({
@@ -2929,8 +2930,8 @@ const rs = (o) => {
2929
2930
  async function i() {
2930
2931
  await r(), t("delete");
2931
2932
  }
2932
- async function l() {
2933
- if (Et) {
2933
+ async function c() {
2934
+ if (Tt) {
2934
2935
  const u = await navigator.clipboard.read(), d = [];
2935
2936
  for (const g of u)
2936
2937
  for (const h of g.types) {
@@ -2940,7 +2941,7 @@ const rs = (o) => {
2940
2941
  else
2941
2942
  switch (v.type) {
2942
2943
  case "text/plain":
2943
- d.push(lt(await v.text()));
2944
+ d.push(ut(await v.text()));
2944
2945
  break;
2945
2946
  case "text/html": {
2946
2947
  const y = new DOMParser().parseFromString(await v.text(), "text/html"), f = y.querySelector("mce-clipboard");
@@ -2955,7 +2956,7 @@ const rs = (o) => {
2955
2956
  new Uint8Array(
2956
2957
  atob(
2957
2958
  p.getAttribute("data-clipboard")?.replace(/\s+/g, "") ?? ""
2958
- ).split("").map(($) => $.charCodeAt(0))
2959
+ ).split("").map((I) => I.charCodeAt(0))
2959
2960
  )
2960
2961
  )
2961
2962
  ), z = new Blob([_], {
@@ -2984,8 +2985,8 @@ const rs = (o) => {
2984
2985
  regenId: !0
2985
2986
  });
2986
2987
  }
2987
- async function c() {
2988
- await r(), await l();
2988
+ async function l() {
2989
+ await r(), await c();
2989
2990
  }
2990
2991
  return Object.assign(o, {
2991
2992
  copiedData: a
@@ -2994,8 +2995,8 @@ const rs = (o) => {
2994
2995
  commands: [
2995
2996
  { command: "copy", handle: r },
2996
2997
  { command: "cut", handle: i },
2997
- { command: "paste", handle: l },
2998
- { command: "duplicate", handle: c }
2998
+ { command: "paste", handle: c },
2999
+ { command: "duplicate", handle: l }
2999
3000
  ],
3000
3001
  hotkeys: [
3001
3002
  { command: "copy", key: "CmdOrCtrl+c", editable: !1 },
@@ -3059,7 +3060,7 @@ const rs = (o) => {
3059
3060
  isFrame: r,
3060
3061
  doc: i
3061
3062
  } = o;
3062
- function l() {
3063
+ function c() {
3063
3064
  const d = s.value;
3064
3065
  if (d.length === 0)
3065
3066
  return;
@@ -3080,7 +3081,7 @@ const rs = (o) => {
3080
3081
  }), d.forEach((v) => e(v.id));
3081
3082
  });
3082
3083
  }
3083
- function c() {
3084
+ function l() {
3084
3085
  const d = s.value[0];
3085
3086
  if (!d)
3086
3087
  return;
@@ -3096,13 +3097,13 @@ const rs = (o) => {
3096
3097
  });
3097
3098
  }
3098
3099
  function u() {
3099
- s.value.length === 1 ? r(s.value[0]) && c() : s.value.length > 1 && l();
3100
+ s.value.length === 1 ? r(s.value[0]) && l() : s.value.length > 1 && c();
3100
3101
  }
3101
3102
  return {
3102
3103
  name: "mce:frame",
3103
3104
  commands: [
3104
- { command: "frame", handle: l },
3105
- { command: "unframe", handle: c },
3105
+ { command: "frame", handle: c },
3106
+ { command: "unframe", handle: l },
3106
3107
  { command: "frame/unframe", handle: u }
3107
3108
  ],
3108
3109
  hotkeys: [
@@ -3114,15 +3115,15 @@ const rs = (o) => {
3114
3115
  fonts: t,
3115
3116
  to: n
3116
3117
  } = o, s = e.gifWorkerUrl;
3117
- return Yt.gifWorkerUrl = s, {
3118
+ return qt.gifWorkerUrl = s, {
3118
3119
  name: "mce:gif",
3119
3120
  exporters: [
3120
3121
  {
3121
3122
  name: "gif",
3122
3123
  handle: async (a) => {
3123
- const { Encoder: r } = await import("modern-gif"), { onProgress: i, ...l } = a, c = n("json", l), { startTime: u, endTime: d } = c.meta, g = Math.floor(c.style.width), h = Math.floor(c.style.height), v = new r({ width: g, height: h, workerUrl: s });
3124
- return await Qe({
3125
- data: c,
3124
+ const { Encoder: r } = await import("modern-gif"), { onProgress: i, ...c } = a, l = n("json", c), { startTime: u, endTime: d } = l.meta, g = Math.floor(l.style.width), h = Math.floor(l.style.height), v = new r({ width: g, height: h, workerUrl: s });
3125
+ return await et({
3126
+ data: l,
3126
3127
  width: g,
3127
3128
  height: h,
3128
3129
  fonts: t,
@@ -3165,7 +3166,7 @@ const rs = (o) => {
3165
3166
  }), u.forEach((h) => a(h.id));
3166
3167
  });
3167
3168
  }
3168
- function l() {
3169
+ function c() {
3169
3170
  const u = n.value[0];
3170
3171
  if (!u)
3171
3172
  return;
@@ -3180,15 +3181,15 @@ const rs = (o) => {
3180
3181
  }), a(u.id);
3181
3182
  });
3182
3183
  }
3183
- function c() {
3184
- n.value.length === 1 ? l() : n.value.length > 1 && i();
3184
+ function l() {
3185
+ n.value.length === 1 ? c() : n.value.length > 1 && i();
3185
3186
  }
3186
3187
  return {
3187
3188
  name: "mce:group",
3188
3189
  commands: [
3189
3190
  { command: "group", handle: i },
3190
- { command: "ungroup", handle: l },
3191
- { command: "group/ungroup", handle: c }
3191
+ { command: "ungroup", handle: c },
3192
+ { command: "group/ungroup", handle: l }
3192
3193
  ],
3193
3194
  hotkeys: [
3194
3195
  { command: "group/ungroup", key: "CmdOrCtrl+g" }
@@ -3206,8 +3207,8 @@ const rs = (o) => {
3206
3207
  e.value?.undo();
3207
3208
  }
3208
3209
  return t("setDoc", (i) => {
3209
- i.on("history", (l) => {
3210
- n.value = l.canUndo(), s.value = l.canRedo();
3210
+ i.on("history", (c) => {
3211
+ n.value = c.canUndo(), s.value = c.canRedo();
3211
3212
  });
3212
3213
  }), Object.assign(o, {
3213
3214
  canUndo: n,
@@ -3233,11 +3234,11 @@ const rs = (o) => {
3233
3234
  to: s,
3234
3235
  fonts: a,
3235
3236
  upload: r
3236
- } = o, i = async (u, d) => n(await ct(u), {
3237
+ } = o, i = async (u, d) => n(await dt(u), {
3237
3238
  sizeToFit: !0,
3238
3239
  positionToFit: !0,
3239
3240
  ...d
3240
- }), l = () => {
3241
+ }), c = () => {
3241
3242
  e("drawing", {
3242
3243
  content: "image",
3243
3244
  callback: (u) => {
@@ -3245,11 +3246,11 @@ const rs = (o) => {
3245
3246
  }
3246
3247
  });
3247
3248
  };
3248
- function c(u) {
3249
+ function l(u) {
3249
3250
  return {
3250
3251
  name: u,
3251
3252
  handle: async (d) => {
3252
- const g = await s("json", d), h = await Qe({
3253
+ const g = await s("json", d), h = await et({
3253
3254
  data: g,
3254
3255
  fonts: a,
3255
3256
  width: g.style.width,
@@ -3268,19 +3269,19 @@ const rs = (o) => {
3268
3269
  name: "mce:image",
3269
3270
  commands: [
3270
3271
  { command: "insertImage", handle: i },
3271
- { command: "drawImage", handle: l }
3272
+ { command: "drawImage", handle: c }
3272
3273
  ],
3273
3274
  exporters: [
3274
- c("jpeg"),
3275
- c("png"),
3276
- c("webp")
3275
+ l("jpeg"),
3276
+ l("png"),
3277
+ l("webp")
3277
3278
  ],
3278
3279
  loaders: [
3279
3280
  {
3280
3281
  name: "image",
3281
- accept: Qt.join(","),
3282
- test: (u) => !!(u instanceof Blob && u.type.startsWith("image/") || u instanceof File && en.test(u.name)),
3283
- load: async (u) => await ct(await r(u))
3282
+ accept: en.join(","),
3283
+ test: (u) => !!(u instanceof Blob && u.type.startsWith("image/") || u instanceof File && ct.test(u.name)),
3284
+ load: async (u) => await dt(await r(u))
3284
3285
  }
3285
3286
  ]
3286
3287
  };
@@ -3297,9 +3298,9 @@ const rs = (o) => {
3297
3298
  const r = await t({ multiple: !0 });
3298
3299
  return n((await Promise.all(
3299
3300
  r.map(async (i) => {
3300
- const l = await e(i);
3301
- let c;
3302
- return l.meta?.inEditorIs === "Doc" ? c = l.children ?? [] : c = [l], c;
3301
+ const c = await e(i);
3302
+ let l;
3303
+ return c.meta?.inEditorIs === "Doc" ? l = c.children ?? [] : l = [c], l;
3303
3304
  })
3304
3305
  )).flat(), {
3305
3306
  ...a,
@@ -3316,14 +3317,14 @@ const rs = (o) => {
3316
3317
  const {
3317
3318
  selection: e
3318
3319
  } = o;
3319
- function t(i, l) {
3320
+ function t(i, c) {
3320
3321
  (Array.isArray(i) ? i : [i]).forEach((u) => {
3321
3322
  const d = u.getParent();
3322
3323
  if (!d)
3323
3324
  return;
3324
3325
  let g = u.getIndex();
3325
3326
  const h = d.children.length - 1, v = 0;
3326
- switch (l) {
3327
+ switch (c) {
3327
3328
  case "bringForward":
3328
3329
  g = Math.min(d.children.length - 1, g + 1);
3329
3330
  break;
@@ -3444,7 +3445,7 @@ const rs = (o) => {
3444
3445
  selection: s,
3445
3446
  textSelection: a,
3446
3447
  config: r
3447
- } = o, i = O(() => s.value.length > 0), l = O(() => ({
3448
+ } = o, i = O(() => s.value.length > 0), c = O(() => ({
3448
3449
  key: "export",
3449
3450
  children: [
3450
3451
  { key: "saveAs:png" },
@@ -3457,14 +3458,14 @@ const rs = (o) => {
3457
3458
  { key: "saveAs:pptx" },
3458
3459
  { key: "saveAs:json" }
3459
3460
  ]
3460
- })), c = O(() => ({
3461
+ })), l = O(() => ({
3461
3462
  key: "file",
3462
3463
  children: [
3463
3464
  { key: "new" },
3464
3465
  { key: "open" },
3465
3466
  { type: "divider" },
3466
3467
  { key: "import" },
3467
- l.value,
3468
+ c.value,
3468
3469
  { type: "divider" },
3469
3470
  { key: "preferences" }
3470
3471
  ]
@@ -3537,7 +3538,7 @@ const rs = (o) => {
3537
3538
  })), z = O(() => [
3538
3539
  { key: "hide/show", disabled: !i.value },
3539
3540
  { key: "lock/unlock", disabled: !i.value }
3540
- ]), $ = O(() => ({
3541
+ ]), I = O(() => ({
3541
3542
  key: "object",
3542
3543
  children: [
3543
3544
  ...f.value,
@@ -3561,10 +3562,10 @@ const rs = (o) => {
3561
3562
  ...E.value
3562
3563
  ]
3563
3564
  })), m = O(() => [
3564
- c.value,
3565
+ l.value,
3565
3566
  h.value,
3566
3567
  y.value,
3567
- $.value,
3568
+ I.value,
3568
3569
  C.value
3569
3570
  ]), b = O(() => s.value.length > 0 ? a.value ? [
3570
3571
  ...d.value
@@ -3578,13 +3579,13 @@ const rs = (o) => {
3578
3579
  C.value,
3579
3580
  _.value,
3580
3581
  { type: "divider" },
3581
- l.value
3582
+ c.value
3582
3583
  ] : [
3583
3584
  d.value[2],
3584
3585
  { type: "divider" },
3585
3586
  ...m.value,
3586
3587
  { type: "divider" },
3587
- l.value
3588
+ c.value
3588
3589
  ]);
3589
3590
  return Object.assign(o, {
3590
3591
  mainMenu: m,
@@ -3644,7 +3645,7 @@ const rs = (o) => {
3644
3645
  {
3645
3646
  name: "mp4",
3646
3647
  handle: async (n) => {
3647
- const { MP4Encoder: s } = await import("modern-mp4"), { onProgress: a, ...r } = n, i = t("json", r), { startTime: l, endTime: c } = i.meta, u = Math.floor(i.style.width / 2) * 2, d = Math.floor(i.style.height / 2) * 2, g = 30, h = {
3648
+ const { MP4Encoder: s } = await import("modern-mp4"), { onProgress: a, ...r } = n, i = t("json", r), { startTime: c, endTime: l } = i.meta, u = Math.floor(i.style.width / 2) * 2, d = Math.floor(i.style.height / 2) * 2, g = 30, h = {
3648
3649
  width: u,
3649
3650
  height: d,
3650
3651
  framerate: g,
@@ -3663,20 +3664,20 @@ const rs = (o) => {
3663
3664
  throw new Error("Failed to parse encoding configuration");
3664
3665
  const _ = new s(h);
3665
3666
  let z = 1;
3666
- return await Qe({
3667
+ return await et({
3667
3668
  data: i,
3668
3669
  width: u,
3669
3670
  height: d,
3670
3671
  fonts: e,
3671
- onFrame: async ($, { duration: E, progress: C }) => {
3672
- const m = await createImageBitmap(new ImageData($, u, d));
3672
+ onFrame: async (I, { duration: E, progress: C }) => {
3673
+ const m = await createImageBitmap(new ImageData(I, u, d));
3673
3674
  await _.encode({
3674
3675
  data: m,
3675
3676
  timestamp: z,
3676
3677
  duration: E
3677
3678
  }), m.close(), z += E, a?.(C);
3678
3679
  },
3679
- keyframes: Array.from({ length: ~~((c - l) / v) }, ($, E) => l + E * v)
3680
+ keyframes: Array.from({ length: ~~((l - c) / v) }, (I, E) => c + E * v)
3680
3681
  }), await _.flush();
3681
3682
  }
3682
3683
  }
@@ -3770,10 +3771,10 @@ const rs = (o) => {
3770
3771
  {
3771
3772
  name: "pptx",
3772
3773
  handle: async (i) => {
3773
- const { idocToPptx: l } = await import("modern-openxml"), c = await s("json", i);
3774
+ const { idocToPptx: c } = await import("modern-openxml"), l = await s("json", i);
3774
3775
  return new Blob([
3775
- await l({
3776
- ...c,
3776
+ await c({
3777
+ ...l,
3777
3778
  fonts: a
3778
3779
  })
3779
3780
  ], {
@@ -3788,15 +3789,15 @@ const rs = (o) => {
3788
3789
  accept: ".pptx",
3789
3790
  test: (i) => !!(i instanceof Blob && i.type.startsWith("application/vnd.openxmlformats-officedocument.presentationml.presentation") || i instanceof File && r.test(i.name)),
3790
3791
  load: async (i) => {
3791
- const { pptxToIdoc: l } = await import("modern-openxml"), c = await import("modern-openxml/presetShapeDefinitions").then((d) => d.default), u = await l(await i.arrayBuffer(), {
3792
- presetShapeDefinitions: c,
3792
+ const { pptxToIdoc: c } = await import("modern-openxml"), l = await import("modern-openxml/presetShapeDefinitions").then((d) => d.default), u = await c(await i.arrayBuffer(), {
3793
+ presetShapeDefinitions: l,
3793
3794
  upload: async (d, g) => {
3794
3795
  const h = g.image;
3795
- let v = zt(g.image);
3796
+ let v = Ot(g.image);
3796
3797
  const y = As(d);
3797
3798
  if (!v) {
3798
3799
  const f = Ss(y);
3799
- f && (v = zt(f));
3800
+ f && (v = Ot(f));
3800
3801
  }
3801
3802
  return await t(
3802
3803
  new File([y], h, {
@@ -3815,7 +3816,7 @@ const rs = (o) => {
3815
3816
  }
3816
3817
  ]
3817
3818
  };
3818
- }, Mt = {
3819
+ }, zt = {
3819
3820
  jpeg: "image/jpeg",
3820
3821
  jpg: "image/jpeg",
3821
3822
  png: "image/png",
@@ -3826,9 +3827,9 @@ const rs = (o) => {
3826
3827
  emf: "image/emf",
3827
3828
  wmf: "image/wmf"
3828
3829
  };
3829
- function zt(o) {
3830
+ function Ot(o) {
3830
3831
  const e = o.split("."), t = e[e.length - 1].toLowerCase();
3831
- return t in Mt ? Mt[t] : null;
3832
+ return t in zt ? zt[t] : null;
3832
3833
  }
3833
3834
  function As(o) {
3834
3835
  const e = atob(o), t = e.length, n = new ArrayBuffer(t), s = new Uint8Array(n);
@@ -3898,7 +3899,7 @@ const Ms = (o) => {
3898
3899
  selected: !0,
3899
3900
  ...r
3900
3901
  });
3901
- i instanceof Blob || (i = new Blob([JSON.stringify(i)], { type: "application/json" })), Wt(i, `${a}.${n}`);
3902
+ i instanceof Blob || (i = new Blob([JSON.stringify(i)], { type: "application/json" })), Kt(i, `${a}.${n}`);
3902
3903
  } }
3903
3904
  ]
3904
3905
  };
@@ -3914,22 +3915,22 @@ const Ms = (o) => {
3914
3915
  e.value = [];
3915
3916
  }
3916
3917
  function a() {
3917
- const l = e.value[0]?.parent;
3918
- l instanceof G && (e.value = [l]);
3918
+ const c = e.value[0]?.parent;
3919
+ c instanceof G && (e.value = [c]);
3919
3920
  }
3920
3921
  function r() {
3921
- const l = e.value[0];
3922
- if (!l)
3922
+ const c = e.value[0];
3923
+ if (!c)
3923
3924
  return;
3924
- const c = l.previousSibling;
3925
- c instanceof G && !l.equal(c) && (e.value = [c]);
3925
+ const l = c.previousSibling;
3926
+ l instanceof G && !c.equal(l) && (e.value = [l]);
3926
3927
  }
3927
3928
  function i() {
3928
- const l = e.value[0];
3929
- if (!l)
3929
+ const c = e.value[0];
3930
+ if (!c)
3930
3931
  return;
3931
- const c = l.nextSibling;
3932
- c instanceof G && !l.equal(c) && (e.value = [c]);
3932
+ const l = c.nextSibling;
3933
+ l instanceof G && !c.equal(l) && (e.value = [l]);
3933
3934
  }
3934
3935
  return {
3935
3936
  name: "mce:select",
@@ -3954,18 +3955,18 @@ const Ms = (o) => {
3954
3955
  t,
3955
3956
  exec: n,
3956
3957
  addElement: s
3957
- } = o, a = (l = t("clickEditText"), c = {}) => {
3958
- const { style: u, ...d } = c;
3959
- return s(lt(l, u), {
3958
+ } = o, a = (c = t("clickEditText"), l = {}) => {
3959
+ const { style: u, ...d } = l;
3960
+ return s(ut(c, u), {
3960
3961
  sizeToFit: !0,
3961
3962
  positionToFit: !0,
3962
3963
  ...d
3963
3964
  });
3964
- }, r = (l, c) => {
3965
+ }, r = (c, l) => {
3965
3966
  e("drawing", {
3966
3967
  content: "text",
3967
3968
  callback: (u) => {
3968
- n("insertText", l, { ...c, position: u });
3969
+ n("insertText", c, { ...l, position: u });
3969
3970
  }
3970
3971
  });
3971
3972
  }, i = /\.txt$/i;
@@ -3979,8 +3980,8 @@ const Ms = (o) => {
3979
3980
  {
3980
3981
  name: "txt",
3981
3982
  accept: ".txt",
3982
- test: (l) => !!(l instanceof Blob && l.type.startsWith("text/plain") || l instanceof File && i.test(l.name)),
3983
- load: async (l) => lt(await l.text())
3983
+ test: (c) => !!(c instanceof Blob && c.type.startsWith("text/plain") || c instanceof File && i.test(c.name)),
3984
+ load: async (c) => ut(await c.text())
3984
3985
  }
3985
3986
  ]
3986
3987
  };
@@ -4014,10 +4015,10 @@ const Ms = (o) => {
4014
4015
  loaders: [
4015
4016
  {
4016
4017
  name: "url",
4017
- test: (e) => typeof e == "string" && e.startsWith("http"),
4018
+ test: (e) => typeof e == "string" && (e.startsWith("http") || ct.test(e)),
4018
4019
  load: async (e) => {
4019
- if (en.test(e) || await o(e))
4020
- return await ct(e);
4020
+ if (ct.test(e) || await o(e))
4021
+ return await dt(e);
4021
4022
  throw new Error(`Failed to load url, ${e}`);
4022
4023
  }
4023
4024
  }
@@ -4067,7 +4068,7 @@ const Ms = (o) => {
4067
4068
  { command: "hide/show", key: "Shift+CmdOrCtrl+h" }
4068
4069
  ]
4069
4070
  };
4070
- }, Ot = { left: 0, top: 0, bottom: 0, right: 0 }, Rs = (o) => {
4071
+ }, $t = { left: 0, top: 0, bottom: 0, right: 0 }, Rs = (o) => {
4071
4072
  const {
4072
4073
  camera: e,
4073
4074
  drawboardAabb: t,
@@ -4077,11 +4078,11 @@ const Ms = (o) => {
4077
4078
  registerConfig: r,
4078
4079
  selection: i
4079
4080
  } = o;
4080
- r("zoomToFitOffset", { ...Ot });
4081
- function l() {
4081
+ r("zoomToFitOffset", { ...$t });
4082
+ function c() {
4082
4083
  e.value.addZoom(0.25);
4083
4084
  }
4084
- function c() {
4085
+ function l() {
4085
4086
  e.value.addZoom(-0.25);
4086
4087
  }
4087
4088
  function u() {
@@ -4089,19 +4090,19 @@ const Ms = (o) => {
4089
4090
  }
4090
4091
  function d(y, f = !1) {
4091
4092
  const p = f ? a.value : n.value, _ = {
4092
- ...Ot,
4093
+ ...$t,
4093
4094
  ...s.value.zoomToFitOffset
4094
4095
  };
4095
4096
  s.value.scrollbar && (_.right += 8, _.bottom += 8), s.value.ruler && (_.left += 16, _.top += 16);
4096
- const z = t.value.width - (_.left + _.right), $ = t.value.height - (_.top + _.bottom), E = p.left, C = p.top, m = p.width, b = p.height;
4097
+ const z = t.value.width - (_.left + _.right), I = t.value.height - (_.top + _.bottom), E = p.left, C = p.top, m = p.width, b = p.height;
4097
4098
  if (m && b) {
4098
- const k = z / m, x = $ / b;
4099
+ const k = z / m, x = I / b;
4099
4100
  e.value.setZoom(
4100
4101
  y === "contain" ? Math.min(k, x) : Math.max(k, x)
4101
4102
  );
4102
4103
  const w = e.value.zoom.x;
4103
4104
  let T = _.left, M = _.top;
4104
- k < x ? M += ($ - b * w) / 2 : T += (z - m * w) / 2, e.value.position.set(
4105
+ k < x ? M += (I - b * w) / 2 : T += (z - m * w) / 2, e.value.position.set(
4105
4106
  -E * w + T,
4106
4107
  -C * w + M
4107
4108
  );
@@ -4119,8 +4120,8 @@ const Ms = (o) => {
4119
4120
  return {
4120
4121
  name: "mce:zoom",
4121
4122
  commands: [
4122
- { command: "zoomIn", handle: l },
4123
- { command: "zoomOut", handle: c },
4123
+ { command: "zoomIn", handle: c },
4124
+ { command: "zoomOut", handle: l },
4124
4125
  { command: "zoomTo100", handle: u },
4125
4126
  { command: "zoomToFit", handle: g },
4126
4127
  { command: "zoomToCover", handle: h },
@@ -4144,9 +4145,9 @@ const Ms = (o) => {
4144
4145
  drawboardDom: y,
4145
4146
  config: f
4146
4147
  } = o;
4147
- pe(() => f.value.viewMode, g), Xt(y, (p) => {
4148
- const { left: _, top: z, width: $, height: E } = p[0].contentRect, { left: C = _, top: m = z } = y.value?.getBoundingClientRect() ?? {};
4149
- t.value = { left: C, top: m, width: $, height: E }, g();
4148
+ pe(() => f.value.viewMode, g), Ht(y, (p) => {
4149
+ const { left: _, top: z, width: I, height: E } = p[0].contentRect, { left: C = _, top: m = z } = y.value?.getBoundingClientRect() ?? {};
4150
+ t.value = { left: C, top: m, width: I, height: E }, g();
4150
4151
  });
4151
4152
  }
4152
4153
  };
@@ -4181,7 +4182,7 @@ const Ms = (o) => {
4181
4182
  Ns,
4182
4183
  Rs
4183
4184
  ];
4184
- class Le extends Gt {
4185
+ class Le extends Wt {
4185
4186
  static injectionKey = Symbol.for("EditorKey");
4186
4187
  debug = V(!1);
4187
4188
  onEmit;
@@ -4233,11 +4234,11 @@ class Le extends Gt {
4233
4234
  const {
4234
4235
  commands: r = [],
4235
4236
  hotkeys: i = [],
4236
- loaders: l = [],
4237
- exporters: c = [],
4237
+ loaders: c = [],
4238
+ exporters: l = [],
4238
4239
  events: u
4239
4240
  } = a;
4240
- if (this.registerCommand(r), this.registerHotkey(i), this.registerLoader(l), this.registerExporter(c), u)
4241
+ if (this.registerCommand(r), this.registerHotkey(i), this.registerLoader(c), this.registerExporter(l), u)
4241
4242
  for (const d in u)
4242
4243
  this.on(d, u[d]);
4243
4244
  };
@@ -4284,7 +4285,7 @@ function de() {
4284
4285
  function Ls(o = new Le()) {
4285
4286
  return De(Le.injectionKey, o), o;
4286
4287
  }
4287
- function wt() {
4288
+ function _t() {
4288
4289
  return {
4289
4290
  icon: {
4290
4291
  type: [String, Function, Object, Array]
@@ -4298,9 +4299,9 @@ function wt() {
4298
4299
  const dn = X({
4299
4300
  name: "MceSvgIcon",
4300
4301
  inheritAttrs: !1,
4301
- props: wt(),
4302
+ props: _t(),
4302
4303
  setup(o, { attrs: e }) {
4303
- return () => H(o.tag, Ne(e, { style: null }), {
4304
+ return () => H(o.tag, Oe(e, { style: null }), {
4304
4305
  default: () => [
4305
4306
  F("svg", {
4306
4307
  class: "mce-icon__svg",
@@ -4321,9 +4322,9 @@ const dn = X({
4321
4322
  ]
4322
4323
  });
4323
4324
  }
4324
- }), $t = X({
4325
+ }), It = X({
4325
4326
  name: "MceComponentIcon",
4326
- props: wt(),
4327
+ props: _t(),
4327
4328
  setup(o, { slots: e }) {
4328
4329
  return () => H(o.tag, null, {
4329
4330
  default: () => [
@@ -4341,7 +4342,7 @@ function Ds(o) {
4341
4342
  const n = yn(o);
4342
4343
  if (!n)
4343
4344
  return {
4344
- component: $t
4345
+ component: It
4345
4346
  };
4346
4347
  let s = n;
4347
4348
  if (typeof s == "string" && (s = s.trim(), s.startsWith("$") && (s = e.aliases?.[s.slice(1)])), s || console.warn(`Could not find aliased icon "${n}"`), Array.isArray(s))
@@ -4351,10 +4352,10 @@ function Ds(o) {
4351
4352
  };
4352
4353
  if (typeof s != "string")
4353
4354
  return {
4354
- component: $t,
4355
+ component: It,
4355
4356
  icon: s
4356
4357
  };
4357
- const a = Object.keys(e.sets).find((l) => typeof s == "string" && s.startsWith(`${l}:`)), r = a ? s.slice(a.length + 1) : s;
4358
+ const a = Object.keys(e.sets).find((c) => typeof s == "string" && s.startsWith(`${c}:`)), r = a ? s.slice(a.length + 1) : s;
4358
4359
  return {
4359
4360
  component: e.sets[a ?? e.defaultSet].component,
4360
4361
  icon: r
@@ -4374,7 +4375,7 @@ const Vs = {
4374
4375
  component: dn
4375
4376
  }, mn = Symbol.for("mce:icons");
4376
4377
  function Us(o = {}) {
4377
- return Kt({
4378
+ return Jt({
4378
4379
  defaultSet: "svg",
4379
4380
  aliases: Vs,
4380
4381
  sets: {
@@ -4382,7 +4383,7 @@ function Us(o = {}) {
4382
4383
  }
4383
4384
  }, o);
4384
4385
  }
4385
- const dt = Symbol.for("MceOverlaySymbol"), nt = tn({
4386
+ const ht = Symbol.for("MceOverlaySymbol"), qe = tn({
4386
4387
  location: String,
4387
4388
  offset: Number,
4388
4389
  target: Object,
@@ -4409,11 +4410,11 @@ function hn(o = {}) {
4409
4410
  };
4410
4411
  }
4411
4412
  function Ys(o = {}) {
4412
- let e = Se(dt, null);
4413
- return e || (e = hn(o), De(dt, e)), e;
4413
+ let e = Se(ht, null);
4414
+ return e || (e = hn(o), De(ht, e)), e;
4414
4415
  }
4415
4416
  function qs() {
4416
- const o = Se(dt, Hs()), e = Ze();
4417
+ const o = Se(ht, Hs()), e = Qe();
4417
4418
  if (!e)
4418
4419
  throw new Error("Failed to useOverlayRoot, vm is null");
4419
4420
  const t = o.register(e.uid);
@@ -4449,8 +4450,8 @@ const Gs = tn({
4449
4450
  __name: "Auxiliary",
4450
4451
  setup(o) {
4451
4452
  const { auxiliaryLines: e } = de();
4452
- return (t, n) => (I(), R("div", Zs, [
4453
- (I(!0), R(ne, null, _e(S(e), (s, a) => (I(), R("div", {
4453
+ return (t, n) => ($(), R("div", Zs, [
4454
+ ($(!0), R(se, null, _e(S(e), (s, a) => ($(), R("div", {
4454
4455
  key: a,
4455
4456
  class: be(s.class),
4456
4457
  style: q({
@@ -4465,7 +4466,7 @@ const Gs = tn({
4465
4466
  });
4466
4467
  function ea(o, e = "content") {
4467
4468
  const t = yo(), n = V();
4468
- if (yt) {
4469
+ if (bt) {
4469
4470
  const s = new ResizeObserver((a) => {
4470
4471
  o?.(a, s), a.length && (e === "content" ? n.value = a[0].contentRect : n.value = a[0].target.getBoundingClientRect());
4471
4472
  });
@@ -4482,7 +4483,7 @@ function ea(o, e = "content") {
4482
4483
  contentRect: bn(n)
4483
4484
  };
4484
4485
  }
4485
- const Ke = Symbol.for("mce:layout"), fn = Symbol.for("mce:layout-item"), It = 1e3;
4486
+ const Je = Symbol.for("mce:layout"), fn = Symbol.for("mce:layout-item"), Ft = 1e3;
4486
4487
  function ta() {
4487
4488
  return {
4488
4489
  overlaps: {
@@ -4505,7 +4506,7 @@ function na() {
4505
4506
  };
4506
4507
  }
4507
4508
  function oa() {
4508
- const o = Se(Ke);
4509
+ const o = Se(Je);
4509
4510
  if (!o)
4510
4511
  throw new Error("[mce] Could not find injected layout");
4511
4512
  return {
@@ -4515,12 +4516,12 @@ function oa() {
4515
4516
  };
4516
4517
  }
4517
4518
  function sa(o) {
4518
- const e = Se(Ke);
4519
+ const e = Se(Je);
4519
4520
  if (!e)
4520
4521
  throw new Error("[mce] Could not find injected layout");
4521
- const t = o.id ?? `layout-item-${Lt()}`, n = Ze();
4522
+ const t = o.id ?? `layout-item-${Dt()}`, n = Qe();
4522
4523
  De(fn, { id: t });
4523
- const s = Je(!1);
4524
+ const s = Ze(!1);
4524
4525
  wn(() => s.value = !0), xn(() => s.value = !1);
4525
4526
  const {
4526
4527
  layoutItemStyles: a,
@@ -4536,12 +4537,12 @@ function aa(o, e, t, n) {
4536
4537
  let s = { top: 0, left: 0, right: 0, bottom: 0 };
4537
4538
  const a = [{ id: "", layer: { ...s } }];
4538
4539
  for (const r of o) {
4539
- const i = e.get(r), l = t.get(r), c = n.get(r);
4540
- if (!i || !l || !c)
4540
+ const i = e.get(r), c = t.get(r), l = n.get(r);
4541
+ if (!i || !c || !l)
4541
4542
  continue;
4542
4543
  const u = {
4543
4544
  ...s,
4544
- [i.value]: Number.parseInt(String(s[i.value]), 10) + (c.value ? Number.parseInt(String(l.value), 10) : 0)
4545
+ [i.value]: Number.parseInt(String(s[i.value]), 10) + (l.value ? Number.parseInt(String(c.value), 10) : 0)
4545
4546
  };
4546
4547
  a.push({
4547
4548
  id: r,
@@ -4551,7 +4552,7 @@ function aa(o, e, t, n) {
4551
4552
  return a;
4552
4553
  }
4553
4554
  function ia(o) {
4554
- const e = Se(Ke, null), t = O(() => e ? e.rootZIndex.value - 100 : It), n = V([]), s = Ce(/* @__PURE__ */ new Map()), a = Ce(/* @__PURE__ */ new Map()), r = Ce(/* @__PURE__ */ new Map()), i = Ce(/* @__PURE__ */ new Map()), l = Ce(/* @__PURE__ */ new Map()), { resizeRef: c, contentRect: u } = ea(), d = O(() => {
4555
+ const e = Se(Je, null), t = O(() => e ? e.rootZIndex.value - 100 : Ft), n = V([]), s = Ee(/* @__PURE__ */ new Map()), a = Ee(/* @__PURE__ */ new Map()), r = Ee(/* @__PURE__ */ new Map()), i = Ee(/* @__PURE__ */ new Map()), c = Ee(/* @__PURE__ */ new Map()), { resizeRef: l, contentRect: u } = ea(), d = O(() => {
4555
4556
  const C = /* @__PURE__ */ new Map(), m = o.overlaps ?? [];
4556
4557
  for (const b of m.filter((k) => k.includes(":"))) {
4557
4558
  const [k, x] = b.split(":");
@@ -4568,11 +4569,11 @@ function ia(o) {
4568
4569
  m.push(...k);
4569
4570
  }
4570
4571
  return aa(m, s, a, i);
4571
- }), h = O(() => !Array.from(l.values()).some((C) => C.value)), v = O(() => g.value[g.value.length - 1].layer), y = Ee(() => ({
4572
- "--mce-layout-left": qe(v.value.left),
4573
- "--mce-layout-right": qe(v.value.right),
4574
- "--mce-layout-top": qe(v.value.top),
4575
- "--mce-layout-bottom": qe(v.value.bottom),
4572
+ }), h = O(() => !Array.from(c.values()).some((C) => C.value)), v = O(() => g.value[g.value.length - 1].layer), y = Te(() => ({
4573
+ "--mce-layout-left": Ge(v.value.left),
4574
+ "--mce-layout-right": Ge(v.value.right),
4575
+ "--mce-layout-top": Ge(v.value.top),
4576
+ "--mce-layout-bottom": Ge(v.value.bottom),
4576
4577
  ...h.value ? void 0 : { transition: "none" }
4577
4578
  })), f = O(() => g.value.slice(1).map(({ id: C }, m) => {
4578
4579
  const { layer: b } = g.value[m], k = a.get(C), x = s.get(C);
@@ -4582,10 +4583,10 @@ function ia(o) {
4582
4583
  size: Number(k.value),
4583
4584
  position: x.value
4584
4585
  };
4585
- })), p = (C) => f.value.find((m) => m.id === C), _ = Ze(), z = Je(!1);
4586
+ })), p = (C) => f.value.find((m) => m.id === C), _ = Qe(), z = Ze(!1);
4586
4587
  He(() => {
4587
4588
  z.value = !0;
4588
- }), De(Ke, {
4589
+ }), De(Je, {
4589
4590
  register: (C, {
4590
4591
  id: m,
4591
4592
  order: b,
@@ -4596,7 +4597,7 @@ function ia(o) {
4596
4597
  disableTransitions: M,
4597
4598
  absolute: P
4598
4599
  }) => {
4599
- r.set(m, b), s.set(m, k), a.set(m, x), i.set(m, T), M && l.set(m, M);
4600
+ r.set(m, b), s.set(m, k), a.set(m, x), i.set(m, T), M && c.set(m, M);
4600
4601
  const A = je(fn, _?.vnode).indexOf(C);
4601
4602
  A > -1 ? n.value.splice(A, 0, m) : n.value.push(m);
4602
4603
  const N = O(() => f.value.findIndex((U) => U.id === m)), L = O(() => t.value + g.value.length * 2 - N.value * 2), j = O(() => {
@@ -4604,22 +4605,22 @@ function ia(o) {
4604
4605
  [k.value]: 0,
4605
4606
  zIndex: L.value,
4606
4607
  transform: `translate${U ? "X" : "Y"}(${(T.value ? 0 : -(he === 0 ? 100 : he)) * (W || Z ? -1 : 1)}${Y})`,
4607
- position: P.value || t.value !== It ? "absolute" : "fixed",
4608
+ position: P.value || t.value !== Ft ? "absolute" : "fixed",
4608
4609
  ...h.value ? void 0 : { transition: "none" }
4609
4610
  };
4610
4611
  if (!z.value)
4611
4612
  return xe;
4612
- const oe = f.value[N.value];
4613
- oe || uo(`[mce] Could not find layout item "${m}"`);
4613
+ const ae = f.value[N.value];
4614
+ ae || uo(`[mce] Could not find layout item "${m}"`);
4614
4615
  const ve = d.value.get(m);
4615
- return ve && (oe[ve.position] += ve.amount), {
4616
+ return ve && (ae[ve.position] += ve.amount), {
4616
4617
  ...xe,
4617
- height: U ? `calc(100% - ${oe.top}px - ${oe.bottom}px)` : w.value ? `${w.value}px` : void 0,
4618
- left: W ? void 0 : `${oe.left}px`,
4619
- right: W ? `${oe.right}px` : void 0,
4620
- top: k.value !== "bottom" ? `${oe.top}px` : void 0,
4621
- bottom: k.value !== "top" ? `${oe.bottom}px` : void 0,
4622
- width: U ? w.value ? `${w.value}px` : void 0 : `calc(100% - ${oe.left}px - ${oe.right}px)`
4618
+ height: U ? `calc(100% - ${ae.top}px - ${ae.bottom}px)` : w.value ? `${w.value}px` : void 0,
4619
+ left: W ? void 0 : `${ae.left}px`,
4620
+ right: W ? `${ae.right}px` : void 0,
4621
+ top: k.value !== "bottom" ? `${ae.top}px` : void 0,
4622
+ bottom: k.value !== "top" ? `${ae.bottom}px` : void 0,
4623
+ width: U ? w.value ? `${w.value}px` : void 0 : `calc(100% - ${ae.left}px - ${ae.right}px)`
4623
4624
  };
4624
4625
  }), D = O(() => ({
4625
4626
  zIndex: L.value - 1
@@ -4627,7 +4628,7 @@ function ia(o) {
4627
4628
  return { layoutItemStyles: j, layoutItemScrimStyles: D, zIndex: L };
4628
4629
  },
4629
4630
  unregister: (C) => {
4630
- r.delete(C), s.delete(C), a.delete(C), i.delete(C), l.delete(C), n.value = n.value.filter((m) => m !== C);
4631
+ r.delete(C), s.delete(C), a.delete(C), i.delete(C), c.delete(C), n.value = n.value.filter((m) => m !== C);
4631
4632
  },
4632
4633
  mainRect: v,
4633
4634
  mainStyles: y,
@@ -4636,32 +4637,32 @@ function ia(o) {
4636
4637
  layoutRect: u,
4637
4638
  rootZIndex: t
4638
4639
  });
4639
- const $ = Ee(() => [
4640
+ const I = Te(() => [
4640
4641
  "mce-layout",
4641
4642
  { "mce-layout--full-height": o.fullHeight }
4642
- ]), E = Ee(() => ({
4643
+ ]), E = Te(() => ({
4643
4644
  zIndex: e ? t.value : void 0,
4644
4645
  position: e ? "relative" : void 0,
4645
4646
  overflow: e ? "hidden" : void 0
4646
4647
  }));
4647
4648
  return {
4648
- layoutClasses: $,
4649
+ layoutClasses: I,
4649
4650
  layoutStyles: E,
4650
4651
  getLayoutItem: p,
4651
4652
  items: f,
4652
4653
  layoutRect: u,
4653
- layoutRef: c
4654
+ layoutRef: l
4654
4655
  };
4655
4656
  }
4656
- const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4657
+ const Pt = Symbol.for("MceMenuSymbol"), Ae = /* @__PURE__ */ X({
4657
4658
  __name: "Icon",
4658
4659
  props: {
4659
4660
  disabled: Boolean,
4660
- ...wt()
4661
+ ..._t()
4661
4662
  },
4662
4663
  setup(o) {
4663
- const e = o, t = Dt(), { iconData: n } = Ds(O(() => e.icon)), s = !!(t.onClick || t.onClickOnce);
4664
- return (a, r) => (I(), le(Vt(S(n).component), {
4664
+ const e = o, t = Vt(), { iconData: n } = Ds(O(() => e.icon)), s = !!(t.onClick || t.onClickOnce);
4665
+ return (a, r) => ($(), oe(jt(S(n).component), {
4665
4666
  icon: S(n).icon,
4666
4667
  tag: e.tag,
4667
4668
  class: be(["mce-icon", {
@@ -4672,7 +4673,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4672
4673
  tabindex: s ? e.disabled ? -1 : 0 : void 0
4673
4674
  }, null, 8, ["icon", "tag", "class", "role", "aria-hidden", "tabindex"]));
4674
4675
  }
4675
- }), xt = /* @__PURE__ */ X({
4676
+ }), ot = /* @__PURE__ */ X({
4676
4677
  inheritAttrs: !1,
4677
4678
  __name: "Overlay",
4678
4679
  props: {
@@ -4680,14 +4681,14 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4680
4681
  type: Boolean,
4681
4682
  default: !1
4682
4683
  },
4683
- ...nt()
4684
+ ...qe()
4684
4685
  },
4685
4686
  emits: ["click:outside", "update:modelValue"],
4686
4687
  setup(o, { expose: e, emit: t }) {
4687
4688
  const n = o, s = t, a = qs(), r = O({
4688
4689
  get: () => n.modelValue,
4689
4690
  set: (p) => s("update:modelValue", p)
4690
- }), i = V(), l = {
4691
+ }), i = V(), c = {
4691
4692
  getBoundingClientRect() {
4692
4693
  const { x: p = 0, y: _ = 0 } = n.target;
4693
4694
  return {
@@ -4701,7 +4702,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4701
4702
  height: 0
4702
4703
  };
4703
4704
  }
4704
- }, c = O(() => typeof n.target == "object" && !(n.target instanceof Element) && "x" in n.target && "y" in n.target ? l : n.target ?? i.value), u = ue("contentElTpl"), d = O(() => n.attach ?? a.attach?.value ?? "body"), { floatingStyles: g, update: h } = Gn(c, u, {
4705
+ }, l = O(() => typeof n.target == "object" && !(n.target instanceof Element) && "x" in n.target && "y" in n.target ? c : n.target ?? i.value), u = ce("contentElTpl"), d = O(() => n.attach ?? a.attach?.value ?? "body"), { floatingStyles: g, update: h } = Gn(l, u, {
4705
4706
  placement: O(() => n.location),
4706
4707
  whileElementsMounted: Zn,
4707
4708
  middleware: [
@@ -4726,30 +4727,30 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4726
4727
  );
4727
4728
  f = [
4728
4729
  _,
4729
- Ut("pointerdown", p, { passive: !0, capture: !0 })
4730
+ Xt("pointerdown", p, { passive: !0, capture: !0 })
4730
4731
  ];
4731
4732
  }), we(() => f.forEach((p) => p())), e({
4732
4733
  activatorEl: i,
4733
- target: c,
4734
+ target: l,
4734
4735
  contentEl: u,
4735
4736
  updateLocation: h
4736
- }), (p, _) => (I(), R(ne, null, [
4737
- te(p.$slots, "activator", {
4737
+ }), (p, _) => ($(), R(se, null, [
4738
+ Q(p.$slots, "activator", {
4738
4739
  props: y.value,
4739
4740
  isActive: r.value
4740
4741
  }),
4741
- (I(), le(_n, {
4742
+ ($(), oe(_n, {
4742
4743
  disabled: d.value === !1,
4743
4744
  to: typeof d.value == "boolean" ? void 0 : d.value
4744
4745
  }, [
4745
- r.value ? (I(), R("div", Ne({
4746
+ r.value ? ($(), R("div", Oe({
4746
4747
  key: 0,
4747
4748
  ref: "contentElTpl",
4748
4749
  class: "mce-overlay",
4749
4750
  style: v.value
4750
4751
  }, p.$attrs), [
4751
- te(p.$slots, "default")
4752
- ], 16)) : Q("", !0)
4752
+ Q(p.$slots, "default")
4753
+ ], 16)) : ee("", !0)
4753
4754
  ], 8, ["disabled", "to"]))
4754
4755
  ], 64));
4755
4756
  }
@@ -4759,8 +4760,8 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4759
4760
  }, ma = /* @__PURE__ */ X({
4760
4761
  name: "MceMenu",
4761
4762
  __name: "Menu",
4762
- props: /* @__PURE__ */ Re({
4763
- ...nt(),
4763
+ props: /* @__PURE__ */ $e({
4764
+ ...qe(),
4764
4765
  items: Object,
4765
4766
  openOnHover: Boolean,
4766
4767
  persistent: Boolean
@@ -4768,12 +4769,12 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4768
4769
  modelValue: { type: Boolean },
4769
4770
  modelModifiers: {}
4770
4771
  }),
4771
- emits: /* @__PURE__ */ Re(["click:item"], ["update:modelValue"]),
4772
+ emits: /* @__PURE__ */ $e(["click:item"], ["update:modelValue"]),
4772
4773
  setup(o, { expose: e, emit: t }) {
4773
- const n = o, s = t, a = Ae(o, "modelValue"), r = V(-1), i = ue("overlayTpl"), l = ue("menuItemTplRefs"), c = Lt(), u = Se(Ft, null), d = Je(/* @__PURE__ */ new Set());
4774
- De(Ft, {
4775
- register: () => d.value.add(c),
4776
- unregister: () => d.value.delete(c),
4774
+ const n = o, s = t, a = ke(o, "modelValue"), r = V(-1), i = ce("overlayTpl"), c = ce("menuItemTplRefs"), l = Dt(), u = Se(Pt, null), d = Ze(/* @__PURE__ */ new Set());
4775
+ De(Pt, {
4776
+ register: () => d.value.add(l),
4777
+ unregister: () => d.value.delete(l),
4777
4778
  closeParents(p) {
4778
4779
  !d.value.size && !n.persistent && (p == null || i.value?.contentEl && !po(p, i.value.contentEl)) && (a.value = !1, u?.closeParents());
4779
4780
  }
@@ -4801,10 +4802,10 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4801
4802
  updateLocation: v
4802
4803
  }), (p, _) => {
4803
4804
  const z = kn("MceMenu");
4804
- return I(), le(xt, {
4805
+ return $(), oe(ot, {
4805
4806
  ref: "overlayTpl",
4806
4807
  modelValue: a.value,
4807
- "onUpdate:modelValue": _[2] || (_[2] = ($) => a.value = $),
4808
+ "onUpdate:modelValue": _[2] || (_[2] = (I) => a.value = I),
4808
4809
  location: n.location,
4809
4810
  offset: n.offset,
4810
4811
  target: n.target,
@@ -4812,75 +4813,75 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4812
4813
  class: "mce-menu",
4813
4814
  "onClick:outside": h
4814
4815
  }, {
4815
- activator: re(($) => [
4816
- te(p.$slots, "activator", Ne($, {
4817
- props: { ...$.props, ...g.value }
4816
+ activator: ne((I) => [
4817
+ Q(p.$slots, "activator", Oe(I, {
4818
+ props: { ...I.props, ...g.value }
4818
4819
  }))
4819
4820
  ]),
4820
- default: re(() => [
4821
- o.items?.length ? (I(), R("div", {
4821
+ default: ne(() => [
4822
+ o.items?.length ? ($(), R("div", {
4822
4823
  key: 0,
4823
4824
  class: "mce-list",
4824
4825
  onMouseleave: f
4825
4826
  }, [
4826
- (I(!0), R(ne, null, _e(o.items, ($, E) => (I(), R(ne, { key: E }, [
4827
- $.type === "divider" ? (I(), R("div", {
4827
+ ($(!0), R(se, null, _e(o.items, (I, E) => ($(), R(se, { key: E }, [
4828
+ I.type === "divider" ? ($(), R("div", {
4828
4829
  key: 0,
4829
4830
  ref_for: !0,
4830
4831
  ref: "menuItemTplRefs",
4831
4832
  class: "mce-list__divider"
4832
- }, null, 512)) : (I(), R("div", {
4833
+ }, null, 512)) : ($(), R("div", {
4833
4834
  key: 1,
4834
4835
  ref_for: !0,
4835
4836
  ref: "menuItemTplRefs",
4836
4837
  class: "mce-list__item",
4837
- onMouseenter: (C) => $.disabled ? r.value = -1 : r.value = E
4838
+ onMouseenter: (C) => I.disabled ? r.value = -1 : r.value = E
4838
4839
  }, [
4839
4840
  F("div", {
4840
4841
  class: be(["mce-list-item", [
4841
- $.disabled && "mce-list-item--disabled",
4842
+ I.disabled && "mce-list-item--disabled",
4842
4843
  r.value === E && "mce-list-item--opened"
4843
4844
  ]]),
4844
- onClick: (C) => y($, E, C)
4845
+ onClick: (C) => y(I, E, C)
4845
4846
  }, [
4846
4847
  F("div", ca, [
4847
- $.checked ? (I(), le(Te, {
4848
+ I.checked ? ($(), oe(Ae, {
4848
4849
  key: 0,
4849
4850
  icon: "$check"
4850
- })) : Q("", !0)
4851
+ })) : ee("", !0)
4851
4852
  ]),
4852
4853
  F("div", ua, [
4853
- te(p.$slots, "title", { item: $ }, () => [
4854
- Cn(K($.key), 1)
4854
+ Q(p.$slots, "title", { item: I }, () => [
4855
+ Cn(K(I.key), 1)
4855
4856
  ])
4856
4857
  ]),
4857
- $.children?.length ? (I(), R("div", da, [
4858
- H(Te, { icon: "$menuRight" })
4859
- ])) : Q("", !0)
4858
+ I.children?.length ? ($(), R("div", da, [
4859
+ H(Ae, { icon: "$menuRight" })
4860
+ ])) : ee("", !0)
4860
4861
  ], 10, la)
4861
4862
  ], 40, ra))
4862
4863
  ], 64))), 128)),
4863
- r.value > -1 && o.items?.[r.value]?.children?.length ? (I(), le(z, {
4864
+ r.value > -1 && o.items?.[r.value]?.children?.length ? ($(), oe(z, {
4864
4865
  key: 0,
4865
4866
  "open-on-hover": "",
4866
4867
  items: o.items?.[r.value]?.children,
4867
4868
  location: "right",
4868
4869
  "model-value": r.value > -1,
4869
- target: l.value?.[r.value],
4870
+ target: c.value?.[r.value],
4870
4871
  attach: !1,
4871
4872
  offset: 16,
4872
- "onUpdate:modelValue": _[0] || (_[0] = ($) => r.value = -1),
4873
- "onClick:item": _[1] || (_[1] = ($, E) => s("click:item", $, E))
4874
- }, ht({ _: 2 }, [
4873
+ "onUpdate:modelValue": _[0] || (_[0] = (I) => r.value = -1),
4874
+ "onClick:item": _[1] || (_[1] = (I, E) => s("click:item", I, E))
4875
+ }, pt({ _: 2 }, [
4875
4876
  p.$slots.title ? {
4876
4877
  name: "title",
4877
- fn: re(($) => [
4878
- te(p.$slots, "title", ft(pt($)))
4878
+ fn: ne((I) => [
4879
+ Q(p.$slots, "title", vt(yt(I)))
4879
4880
  ]),
4880
4881
  key: "0"
4881
4882
  } : void 0
4882
- ]), 1032, ["items", "model-value", "target"])) : Q("", !0)
4883
- ], 32)) : Q("", !0)
4883
+ ]), 1032, ["items", "model-value", "target"])) : ee("", !0)
4884
+ ], 32)) : ee("", !0)
4884
4885
  ]),
4885
4886
  _: 3
4886
4887
  }, 8, ["modelValue", "location", "offset", "target", "attach"]);
@@ -4908,13 +4909,13 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4908
4909
  exec: a,
4909
4910
  getKbd: r,
4910
4911
  t: i,
4911
- hotkeys: l
4912
- } = de(), c = Ae(o, "modelValue"), u = Ae(o, "position"), d = ue("menuTplRef");
4912
+ hotkeys: c
4913
+ } = de(), l = ke(o, "modelValue"), u = ke(o, "position"), d = ce("menuTplRef");
4913
4914
  function g() {
4914
4915
  d.value?.updateLocation();
4915
4916
  }
4916
4917
  function h(y) {
4917
- y.preventDefault(), c.value = !0, u.value = {
4918
+ y.preventDefault(), l.value = !0, u.value = {
4918
4919
  x: y.clientX,
4919
4920
  y: y.clientY
4920
4921
  }, g();
@@ -4929,10 +4930,10 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4929
4930
  }
4930
4931
  return e({
4931
4932
  updateLocation: g
4932
- }), (y, f) => (I(), le(ma, {
4933
+ }), (y, f) => ($(), oe(ma, {
4933
4934
  ref: "menuTplRef",
4934
- modelValue: c.value,
4935
- "onUpdate:modelValue": f[0] || (f[0] = (p) => c.value = p),
4935
+ modelValue: l.value,
4936
+ "onUpdate:modelValue": f[0] || (f[0] = (p) => l.value = p),
4936
4937
  offset: 10,
4937
4938
  class: "mce-context-menu",
4938
4939
  target: u.value,
@@ -4943,9 +4944,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4943
4944
  }),
4944
4945
  "onClick:item": v
4945
4946
  }, {
4946
- title: re(({ item: p }) => [
4947
+ title: ne(({ item: p }) => [
4947
4948
  F("span", ha, K(S(i)(p.key)), 1),
4948
- S(l).has(p.key) ? (I(), R("span", fa, K(S(r)(p.key)), 1)) : Q("", !0)
4949
+ S(c).has(p.key) ? ($(), R("span", fa, K(S(r)(p.key)), 1)) : ee("", !0)
4949
4950
  ]),
4950
4951
  _: 1
4951
4952
  }, 8, ["modelValue", "target", "items", "style"]));
@@ -4963,30 +4964,30 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4963
4964
  camera: s,
4964
4965
  drawboardAabb: a,
4965
4966
  setCursor: r
4966
- } = de(), { x: i, y: l } = zn();
4967
- function c(u) {
4967
+ } = de(), { x: i, y: c } = zn();
4968
+ function l(u) {
4968
4969
  const d = s.value.toGlobal({
4969
4970
  x: u.clientX - a.value.left,
4970
4971
  y: u.clientY - a.value.top
4971
4972
  });
4972
4973
  t.value?.callback?.(d), r(void 0);
4973
4974
  }
4974
- return (u, d) => S(e) === "drawing" ? (I(), R("div", {
4975
+ return (u, d) => S(e) === "drawing" ? ($(), R("div", {
4975
4976
  key: 0,
4976
4977
  class: "mce-drawing",
4977
4978
  style: q({
4978
4979
  left: `${S(i)}px`,
4979
- top: `${S(l)}px`
4980
+ top: `${S(c)}px`
4980
4981
  }),
4981
- onMousedown: c
4982
+ onMousedown: l
4982
4983
  }, [
4983
- S(t)?.content ? (I(), R("div", va, K(S(n)(S(t).content)), 1)) : Q("", !0)
4984
- ], 36)) : Q("", !0);
4984
+ S(t)?.content ? ($(), R("div", va, K(S(n)(S(t).content)), 1)) : ee("", !0)
4985
+ ], 36)) : ee("", !0);
4985
4986
  }
4986
4987
  }), ga = /* @__PURE__ */ X({
4987
4988
  __name: "Floatbar",
4988
4989
  props: {
4989
- ...nt({
4990
+ ...qe({
4990
4991
  location: "top-start",
4991
4992
  offset: 8
4992
4993
  })
@@ -4996,7 +4997,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4996
4997
  getAabbInDrawboard: n,
4997
4998
  selection: s,
4998
4999
  isFrame: a
4999
- } = de(), r = ue("overlayTpl");
5000
+ } = de(), r = ce("overlayTpl");
5000
5001
  function i() {
5001
5002
  r.value?.updateLocation();
5002
5003
  }
@@ -5004,7 +5005,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5004
5005
  deep: !0
5005
5006
  }), e({
5006
5007
  updateLocation: i
5007
- }), (l, c) => (I(), le(xt, {
5008
+ }), (c, l) => ($(), oe(ot, {
5008
5009
  ref: "overlayTpl",
5009
5010
  class: "mce-floatbar",
5010
5011
  location: t.location,
@@ -5013,8 +5014,8 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5013
5014
  attach: !1,
5014
5015
  "model-value": !0
5015
5016
  }, {
5016
- default: re(() => [
5017
- S(s).length > 0 ? te(l.$slots, "default", { key: 0 }) : Q("", !0)
5017
+ default: ne(() => [
5018
+ S(s).length > 0 ? Q(c.$slots, "default", { key: 0 }) : ee("", !0)
5018
5019
  ]),
5019
5020
  _: 3
5020
5021
  }, 8, ["location", "offset", "target"]));
@@ -5027,21 +5028,21 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5027
5028
  },
5028
5029
  emits: ["update:modelValue"],
5029
5030
  setup(o) {
5030
- const e = Ae(o, "modelValue"), t = ue("inputTpl"), {
5031
+ const e = ke(o, "modelValue"), t = ce("inputTpl"), {
5031
5032
  getObbInDrawboard: n,
5032
5033
  hoverElement: s,
5033
5034
  selection: a,
5034
5035
  state: r,
5035
5036
  config: i,
5036
- exec: l
5037
- } = de(), c = V(!1);
5037
+ exec: c
5038
+ } = de(), l = V(!1);
5038
5039
  async function u() {
5039
- c.value = !0, await Pe(), t.value && (t.value.focus(), t.value.select());
5040
+ l.value = !0, await Re(), t.value && (t.value.focus(), t.value.select());
5040
5041
  }
5041
5042
  async function d(g) {
5042
- c.value || (a.value = [e.value], await Pe(), l("startTransform", g));
5043
+ l.value || (a.value = [e.value], await Re(), c("startTransform", g));
5043
5044
  }
5044
- return (g, h) => ze((I(), R("div", {
5045
+ return (g, h) => ze(($(), R("div", {
5045
5046
  style: q(S(Me)(S(n)(e.value))),
5046
5047
  class: be(["mce-frame", [
5047
5048
  S(i).frameOutline && "mce-frame--outline"
@@ -5058,9 +5059,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5058
5059
  ze(F("input", {
5059
5060
  ref: "inputTpl",
5060
5061
  "onUpdate:modelValue": h[0] || (h[0] = (v) => e.value.name = v),
5061
- onBlur: h[1] || (h[1] = (v) => c.value = !1)
5062
+ onBlur: h[1] || (h[1] = (v) => l.value = !1)
5062
5063
  }, null, 544), [
5063
- [Xe, c.value],
5064
+ [Xe, l.value],
5064
5065
  [En, e.value.name]
5065
5066
  ])
5066
5067
  ], 544), [
@@ -5076,7 +5077,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5076
5077
  const {
5077
5078
  frames: e
5078
5079
  } = de();
5079
- return (t, n) => (I(!0), R(ne, null, _e(S(e), (s, a) => (I(), le(ba, {
5080
+ return (t, n) => ($(!0), R(se, null, _e(S(e), (s, a) => ($(), oe(ba, {
5080
5081
  key: a,
5081
5082
  "model-value": s
5082
5083
  }, null, 8, ["model-value"]))), 128));
@@ -5094,14 +5095,14 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5094
5095
  t.value,
5095
5096
  n(e.value)
5096
5097
  ));
5097
- return (i, l) => r.value ? (I(), R("div", {
5098
+ return (i, c) => r.value ? ($(), R("div", {
5098
5099
  key: 0,
5099
5100
  class: "mce-back-selected-aera",
5100
- onClick: l[0] || (l[0] = We((c) => S(s)("zoomToSelection"), ["prevent"]))
5101
+ onClick: c[0] || (c[0] = Ke((l) => S(s)("zoomToSelection"), ["prevent"]))
5101
5102
  }, [
5102
- H(Te, { icon: "$gps" }),
5103
+ H(Ae, { icon: "$gps" }),
5103
5104
  F("span", null, K(S(a)("goBackSelectedArea")), 1)
5104
- ])) : Q("", !0);
5105
+ ])) : ee("", !0);
5105
5106
  }
5106
5107
  }), _a = ["data-name"], ka = /* @__PURE__ */ X({
5107
5108
  __name: "Hover",
@@ -5111,7 +5112,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5111
5112
  hoverElement: t,
5112
5113
  getObbInDrawboard: n
5113
5114
  } = de(), s = O(() => n(t.value));
5114
- return (a, r) => S(t) && !S(t).equal(S(e)[0]) ? (I(), R("div", {
5115
+ return (a, r) => S(t) && !S(t).equal(S(e)[0]) ? ($(), R("div", {
5115
5116
  key: 0,
5116
5117
  class: "mce-hover",
5117
5118
  "data-name": S(t).name,
@@ -5119,12 +5120,12 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5119
5120
  borderColor: "currentcolor",
5120
5121
  ...S(Me)(s.value)
5121
5122
  })
5122
- }, null, 12, _a)) : Q("", !0);
5123
+ }, null, 12, _a)) : ee("", !0);
5123
5124
  }
5124
5125
  }), Ca = /* @__PURE__ */ X({
5125
5126
  __name: "Tooltip",
5126
- props: /* @__PURE__ */ Re({
5127
- ...nt({
5127
+ props: /* @__PURE__ */ $e({
5128
+ ...qe({
5128
5129
  location: "right",
5129
5130
  offset: 8
5130
5131
  })
@@ -5134,37 +5135,37 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5134
5135
  }),
5135
5136
  emits: ["update:modelValue"],
5136
5137
  setup(o, { expose: e }) {
5137
- const t = o, n = Ae(o, "modelValue"), s = ue("overlayTpl");
5138
+ const t = o, n = ke(o, "modelValue"), s = ce("overlayTpl");
5138
5139
  function a() {
5139
5140
  s.value?.updateLocation();
5140
5141
  }
5141
5142
  return e({
5142
5143
  updateLocation: a
5143
- }), (r, i) => (I(), le(xt, {
5144
+ }), (r, i) => ($(), oe(ot, {
5144
5145
  ref: "overlayTpl",
5145
5146
  modelValue: n.value,
5146
- "onUpdate:modelValue": i[0] || (i[0] = (l) => n.value = l),
5147
+ "onUpdate:modelValue": i[0] || (i[0] = (c) => n.value = c),
5147
5148
  class: "mce-tooltip",
5148
5149
  location: t.location,
5149
5150
  offset: t.offset,
5150
5151
  target: t.target,
5151
5152
  attach: t.attach
5152
- }, ht({
5153
- default: re(() => [
5154
- n.value ? te(r.$slots, "default", { key: 0 }) : Q("", !0)
5153
+ }, pt({
5154
+ default: ne(() => [
5155
+ n.value ? Q(r.$slots, "default", { key: 0 }) : ee("", !0)
5155
5156
  ]),
5156
5157
  _: 2
5157
5158
  }, [
5158
5159
  r.$slots.activator ? {
5159
5160
  name: "activator",
5160
- fn: re((l) => [
5161
- te(r.$slots, "activator", ft(pt(l)))
5161
+ fn: ne((c) => [
5162
+ Q(r.$slots, "activator", vt(yt(c)))
5162
5163
  ]),
5163
5164
  key: "0"
5164
5165
  } : void 0
5165
5166
  ]), 1032, ["modelValue", "location", "offset", "target", "attach"]));
5166
5167
  }
5167
- }), Ea = ["width", "height"], Ta = ["onDblclick", "onMousedown", "onMousemove"], Aa = { style: { "font-size": "12px", "text-wrap": "nowrap" } }, mt = /* @__PURE__ */ X({
5168
+ }), Ea = ["width", "height"], Ta = ["onDblclick", "onMousedown", "onMousemove"], Aa = { style: { "font-size": "12px", "text-wrap": "nowrap" } }, ft = /* @__PURE__ */ X({
5168
5169
  inheritAttrs: !1,
5169
5170
  __name: "Ruler",
5170
5171
  props: {
@@ -5181,28 +5182,28 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5181
5182
  labelFormat: { type: Function, default: (o) => String(o) }
5182
5183
  },
5183
5184
  setup(o, { expose: e }) {
5184
- const t = o, n = Dt(), s = O(() => t.pixelRatio), a = V(), r = V({ x: 0, y: 0 }), i = ue("canvasTpl"), l = "OffscreenCanvas" in window ? new OffscreenCanvas(t.size, t.size) : document.createElement("canvas"), c = l.getContext("2d"), u = V(), d = Ce({
5185
+ const t = o, n = Vt(), s = O(() => t.pixelRatio), a = V(), r = V({ x: 0, y: 0 }), i = ce("canvasTpl"), c = "OffscreenCanvas" in window ? new OffscreenCanvas(t.size, t.size) : document.createElement("canvas"), l = c.getContext("2d"), u = V(), d = Ee({
5185
5186
  text: "#000",
5186
5187
  border: "#000"
5187
5188
  });
5188
5189
  function g() {
5189
5190
  if (!t.selected?.width || !t.selected?.height)
5190
5191
  return;
5191
- c.fillStyle = "#6165FD20";
5192
+ l.fillStyle = "#6165FD20";
5192
5193
  const A = t.vertical ? t.selected.top : t.selected.left, N = t.vertical ? t.selected.height : t.selected.width;
5193
- c.fillRect(A, 0, N, t.size);
5194
+ l.fillRect(A, 0, N, t.size);
5194
5195
  }
5195
5196
  function h(A, N, L, j) {
5196
- c.lineWidth = L, c.strokeStyle = j, c.beginPath(), c.moveTo(A[0], A[1]), c.lineTo(N[0], N[1]), c.stroke();
5197
+ l.lineWidth = L, l.strokeStyle = j, l.beginPath(), l.moveTo(A[0], A[1]), l.lineTo(N[0], N[1]), l.stroke();
5197
5198
  }
5198
5199
  function v(A, N, L = 1) {
5199
5200
  const j = A, D = t.size, U = A, W = t.size - N * L;
5200
- c.moveTo(j, D), c.lineTo(U, W);
5201
+ l.moveTo(j, D), l.lineTo(U, W);
5201
5202
  }
5202
5203
  function y(A, N, L, j) {
5203
- c.font = `${j}px sans-serif`, c.textAlign = "left", c.textBaseline = "bottom";
5204
+ l.font = `${j}px sans-serif`, l.textAlign = "left", l.textBaseline = "bottom";
5204
5205
  const D = N, U = t.size - L;
5205
- c.save(), t.vertical && (c.translate(0, t.size), c.scale(1, -1)), c.fillText(A, D, U), c.restore();
5206
+ l.save(), t.vertical && (l.translate(0, t.size), l.scale(1, -1)), l.fillText(A, D, U), l.restore();
5206
5207
  }
5207
5208
  const f = O(() => {
5208
5209
  const A = Math.max(t.unit / t.zoom, 1), N = t.unitFractions, L = Math.floor(Math.log10(A)), j = A / 10 ** L;
@@ -5223,14 +5224,14 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5223
5224
  function z(A) {
5224
5225
  return Math.round(A * t.zoom + t.position);
5225
5226
  }
5226
- function $(A) {
5227
+ function I(A) {
5227
5228
  return Math.round((A - t.position) / t.zoom);
5228
5229
  }
5229
5230
  function E() {
5230
5231
  const A = i.value;
5231
- if (!A || !l.width || !l.height)
5232
+ if (!A || !c.width || !c.height)
5232
5233
  return;
5233
- c.clearRect(0, 0, l.width, l.height), c.save(), c.scale(s.value, s.value), t.vertical && (c.scale(1, -1), c.translate(0, 0), c.rotate(-Math.PI / 2)), g(), t.axis && h(
5234
+ l.clearRect(0, 0, c.width, c.height), l.save(), l.scale(s.value, s.value), t.vertical && (l.scale(1, -1), l.translate(0, 0), l.rotate(-Math.PI / 2)), g(), t.axis && h(
5234
5235
  [0, t.size],
5235
5236
  [t.vertical ? A.height : A.width, t.size],
5236
5237
  2,
@@ -5240,17 +5241,17 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5240
5241
  v(D, 10), y(U, D + 2, 4, 8);
5241
5242
  }, L = (D) => v(D, 4);
5242
5243
  let j = f.value / 10;
5243
- j = (j > 0 ? 1 : -1) * Math.max(1, Math.abs(j)), c.beginPath(), c.lineWidth = 1, c.strokeStyle = d.text, c.fillStyle = d.text;
5244
+ j = (j > 0 ? 1 : -1) * Math.max(1, Math.abs(j)), l.beginPath(), l.lineWidth = 1, l.strokeStyle = d.text, l.fillStyle = d.text;
5244
5245
  for (let D = p.value; D <= _.value; D += j)
5245
5246
  D % f.value === 0 && N(z(D), t.labelFormat(D));
5246
- c.stroke(), c.beginPath(), c.lineWidth = 1, c.strokeStyle = d.border;
5247
+ l.stroke(), l.beginPath(), l.lineWidth = 1, l.strokeStyle = d.border;
5247
5248
  for (let D = p.value; D <= _.value; D += j)
5248
5249
  D % f.value === 0 || D % j === 0 && L(z(D));
5249
- if (c.stroke(), c.restore(), "transferToImageBitmap" in l)
5250
- A.getContext("bitmaprenderer").transferFromImageBitmap(l.transferToImageBitmap());
5250
+ if (l.stroke(), l.restore(), "transferToImageBitmap" in c)
5251
+ A.getContext("bitmaprenderer").transferFromImageBitmap(c.transferToImageBitmap());
5251
5252
  else {
5252
5253
  const D = A.getContext("2d");
5253
- D && (D.clearRect(0, 0, A.width, A.height), D.drawImage(l, 0, 0));
5254
+ D && (D.clearRect(0, 0, A.width, A.height), D.drawImage(c, 0, 0));
5254
5255
  }
5255
5256
  }
5256
5257
  pe(
@@ -5260,11 +5261,11 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5260
5261
  },
5261
5262
  { immediate: !0, deep: !0 }
5262
5263
  );
5263
- const C = Ht(() => {
5264
+ const C = Yt(() => {
5264
5265
  if (!i.value)
5265
5266
  return;
5266
5267
  const A = i.value.parentElement.getBoundingClientRect();
5267
- l.width = i.value.width = A.width * s.value, l.height = i.value.height = A.height * s.value, i.value.style.width = `${A.width}px`, i.value.style.height = `${A.height}px`, u.value = A, E();
5268
+ c.width = i.value.width = A.width * s.value, c.height = i.value.height = A.height * s.value, i.value.style.width = `${A.width}px`, i.value.style.height = `${A.height}px`, u.value = A, E();
5268
5269
  }, 50);
5269
5270
  He(() => {
5270
5271
  C();
@@ -5274,14 +5275,14 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5274
5275
  d.text = N.getPropertyValue("--text-color").trim(), d.border = N.getPropertyValue("--border-color").trim();
5275
5276
  }
5276
5277
  }), we(() => {
5277
- l.width = 0, l.height = 0;
5278
+ c.width = 0, c.height = 0;
5278
5279
  });
5279
5280
  const m = V([]), b = V(), k = O(() => {
5280
5281
  const A = [...m.value];
5281
5282
  return typeof b.value == "number" && A.unshift(b.value), A;
5282
5283
  });
5283
5284
  function x(A) {
5284
- return $(
5285
+ return I(
5285
5286
  t.vertical ? A.clientY - u.value.top : A.clientX - u.value.left
5286
5287
  );
5287
5288
  }
@@ -5310,8 +5311,8 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5310
5311
  }
5311
5312
  return e({
5312
5313
  box: u
5313
- }), (A, N) => (I(), R(ne, null, [
5314
- ze((I(), R("div", Ne({
5314
+ }), (A, N) => ($(), R(se, null, [
5315
+ ze(($(), R("div", Oe({
5315
5316
  class: ["mce-ruler", [
5316
5317
  `mce-ruler--${t.vertical ? "vertical" : "horizontal"}`
5317
5318
  ]],
@@ -5328,9 +5329,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5328
5329
  height: t.size
5329
5330
  }, null, 8, Ea)
5330
5331
  ], 16)), [
5331
- [S(Jt), S(C)]
5332
+ [S(Zt), S(C)]
5332
5333
  ]),
5333
- (I(!0), R(ne, null, _e(k.value, (L, j) => (I(), R("div", {
5334
+ ($(!0), R(se, null, _e(k.value, (L, j) => ($(), R("div", {
5334
5335
  key: j,
5335
5336
  class: be(["mce-ruler-refline", {
5336
5337
  "mce-ruler-refline--vertical": t.vertical,
@@ -5353,7 +5354,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5353
5354
  target: r.value,
5354
5355
  offset: 24
5355
5356
  }, {
5356
- default: re(() => [
5357
+ default: ne(() => [
5357
5358
  F("div", Aa, K(a.value), 1)
5358
5359
  ]),
5359
5360
  _: 1
@@ -5369,8 +5370,8 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5369
5370
  getAabbInDrawboard: t,
5370
5371
  selection: n
5371
5372
  } = de(), s = O(() => t(n.value));
5372
- return (a, r) => (I(), R("div", Sa, [
5373
- H(mt, {
5373
+ return (a, r) => ($(), R("div", Sa, [
5374
+ H(ft, {
5374
5375
  refline: "",
5375
5376
  zoom: S(e).zoom.x,
5376
5377
  position: S(e).position.x,
@@ -5378,7 +5379,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5378
5379
  axis: "",
5379
5380
  size: 16
5380
5381
  }, null, 8, ["zoom", "position", "selected"]),
5381
- H(mt, {
5382
+ H(ft, {
5382
5383
  refline: "",
5383
5384
  zoom: S(e).zoom.y,
5384
5385
  position: S(e).position.y,
@@ -5393,9 +5394,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5393
5394
  }), za = {
5394
5395
  ref: "trackTplRef",
5395
5396
  class: "mce-scrollbar__track"
5396
- }, Oa = 50, Pt = 50, Nt = /* @__PURE__ */ X({
5397
+ }, Oa = 50, Nt = 50, Rt = /* @__PURE__ */ X({
5397
5398
  __name: "Scrollbar",
5398
- props: /* @__PURE__ */ Re({
5399
+ props: /* @__PURE__ */ $e({
5399
5400
  zoom: {},
5400
5401
  length: {},
5401
5402
  vertical: { type: Boolean },
@@ -5406,16 +5407,16 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5406
5407
  modelValue: { required: !0 },
5407
5408
  modelModifiers: {}
5408
5409
  }),
5409
- emits: /* @__PURE__ */ Re(["scroll"], ["update:modelValue"]),
5410
+ emits: /* @__PURE__ */ $e(["scroll"], ["update:modelValue"]),
5410
5411
  setup(o, { emit: e }) {
5411
- const t = o, n = e, s = (w, T, M) => w * (1 - M) + T * M, a = (w, T) => s(w / 2, 1 - w / 2, T), r = Ae(o, "modelValue"), i = ue("trackTplRef"), l = ue("thumbTplRef"), c = V(0), u = O(
5412
- () => t.infinite ? t.length * t.zoom + c.value + Math.abs(r.value) * 2 : r.value > 0 ? r.value + t.length * t.zoom : Math.max(c.value - r.value, t.length * t.zoom)
5412
+ const t = o, n = e, s = (w, T, M) => w * (1 - M) + T * M, a = (w, T) => s(w / 2, 1 - w / 2, T), r = ke(o, "modelValue"), i = ce("trackTplRef"), c = ce("thumbTplRef"), l = V(0), u = O(
5413
+ () => t.infinite ? t.length * t.zoom + l.value + Math.abs(r.value) * 2 : r.value > 0 ? r.value + t.length * t.zoom : Math.max(l.value - r.value, t.length * t.zoom)
5413
5414
  ), d = O(
5414
5415
  () => t.infinite ? Math.abs(r.value) - r.value : r.value > 0 ? 0 : -r.value
5415
- ), g = O(() => Math.max(0.05, Math.min(1, c.value / u.value))), h = O(() => d.value / (u.value - c.value) * (1 - g.value)), v = Ht(() => {
5416
+ ), g = O(() => Math.max(0.05, Math.min(1, l.value / u.value))), h = O(() => d.value / (u.value - l.value) * (1 - g.value)), v = Yt(() => {
5416
5417
  const w = i.value?.getBoundingClientRect() ?? { width: 0, height: 0 };
5417
- c.value = t.vertical ? w.height : w.width;
5418
- }, 50), y = O(() => t.infinite ? a(g.value, h.value) : h.value), f = O(() => 1 - y.value - g.value), p = O(() => t.vertical ? `${y.value * 100}%` : "0%"), _ = O(() => t.vertical ? `${f.value * 100}%` : "50%"), z = O(() => t.vertical ? "0%" : `${y.value * 100}%`), $ = O(() => t.vertical ? "50%" : `${f.value * 100}%`);
5418
+ l.value = t.vertical ? w.height : w.width;
5419
+ }, 50), y = O(() => t.infinite ? a(g.value, h.value) : h.value), f = O(() => 1 - y.value - g.value), p = O(() => t.vertical ? `${y.value * 100}%` : "0%"), _ = O(() => t.vertical ? `${f.value * 100}%` : "50%"), z = O(() => t.vertical ? "0%" : `${y.value * 100}%`), I = O(() => t.vertical ? "50%" : `${f.value * 100}%`);
5419
5420
  function E(w) {
5420
5421
  n("scroll", w - r.value), r.value = w;
5421
5422
  }
@@ -5427,11 +5428,11 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5427
5428
  function k(w) {
5428
5429
  const T = w.target;
5429
5430
  let M = 0;
5430
- if (l.value?.contains(T)) {
5431
+ if (c.value?.contains(T)) {
5431
5432
  x();
5432
5433
  return;
5433
5434
  } else if (i.value?.contains(T)) {
5434
- const P = (t.vertical ? w.offsetY : w.offsetX) / c.value;
5435
+ const P = (t.vertical ? w.offsetY : w.offsetX) / l.value;
5435
5436
  if (P < y.value)
5436
5437
  M = 1;
5437
5438
  else if (P > 1 - f.value)
@@ -5441,14 +5442,14 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5441
5442
  return;
5442
5443
  }
5443
5444
  }
5444
- C(Oa * M), b = setTimeout(() => k(w), Pt);
5445
+ C(Oa * M), b = setTimeout(() => k(w), Nt);
5445
5446
  }
5446
5447
  function x() {
5447
5448
  clearTimeout(b);
5448
5449
  }
5449
5450
  return we(() => {
5450
5451
  x();
5451
- }), (w, T) => ze((I(), R("div", {
5452
+ }), (w, T) => ze(($(), R("div", {
5452
5453
  class: be(["mce-scrollbar", {
5453
5454
  "mce-scrollbar--vertical": t.vertical,
5454
5455
  "mce-scrollbar--horizontal": !t.vertical
@@ -5469,15 +5470,15 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5469
5470
  top: p.value,
5470
5471
  bottom: _.value,
5471
5472
  left: z.value,
5472
- right: $.value
5473
+ right: I.value
5473
5474
  })
5474
5475
  }, null, 6), [
5475
5476
  [Xe, t.infinite || g.value < 1]
5476
5477
  ])
5477
5478
  ], 512)
5478
5479
  ], 6)), [
5479
- [S(Jt), S(v)],
5480
- [S(Qn), [k, { delay: Pt, onMouseUp: x }]]
5480
+ [S(Zt), S(v)],
5481
+ [S(Qn), [k, { delay: Nt, onMouseUp: x }]]
5481
5482
  ]);
5482
5483
  }
5483
5484
  }), $a = /* @__PURE__ */ X({
@@ -5493,15 +5494,15 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5493
5494
  camera: t,
5494
5495
  viewAabb: n
5495
5496
  } = de();
5496
- return (s, a) => (I(), R(ne, null, [
5497
- H(Nt, Ne(e, {
5497
+ return (s, a) => ($(), R(se, null, [
5498
+ H(Rt, Oe(e, {
5498
5499
  modelValue: S(t).position.y,
5499
5500
  "onUpdate:modelValue": a[0] || (a[0] = (r) => S(t).position.y = r),
5500
5501
  zoom: S(t).zoom.y,
5501
5502
  vertical: "",
5502
5503
  length: S(n).height
5503
5504
  }), null, 16, ["modelValue", "zoom", "length"]),
5504
- H(Nt, Ne(e, {
5505
+ H(Rt, Oe(e, {
5505
5506
  modelValue: S(t).position.x,
5506
5507
  "onUpdate:modelValue": a[1] || (a[1] = (r) => S(t).position.x = r),
5507
5508
  zoom: S(t).zoom.x,
@@ -5561,13 +5562,13 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5561
5562
  "resize-top-right": (m) => _("resizeBevel", 180 + m),
5562
5563
  "resize-bottom-right": (m) => _("resizeBevel", 90 + m),
5563
5564
  "resize-bottom-left": (m) => _("resizeBevel", 180 + m)
5564
- }, r = Ae(n, "modelValue"), i = O({
5565
+ }, r = ke(n, "modelValue"), i = O({
5565
5566
  get: () => {
5566
5567
  let { left: m = 0, top: b = 0, width: k = 0, height: x = 0, rotate: w = 0 } = r.value ?? {};
5567
5568
  return Number.isNaN(Number(k)) && (k = 0), Number.isNaN(Number(x)) && (x = 0), { left: m, top: b, width: k, height: x, rotate: w };
5568
5569
  },
5569
5570
  set: (m) => r.value = m
5570
- }), l = V(!1), c = V(), u = O(() => {
5571
+ }), c = V(!1), l = V(), u = O(() => {
5571
5572
  const { width: m = 0, height: b = 0 } = i.value, k = 6, x = k / 2, w = 8, T = w / 2, M = 12;
5572
5573
  let P;
5573
5574
  return n.handleStrategy === "point" ? P = [
@@ -5619,13 +5620,13 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5619
5620
  ...g.value,
5620
5621
  transform: `matrix(${w}, ${T}, ${-T}, ${w}, ${m}, ${b})`
5621
5622
  };
5622
- }), v = O(() => n.visibility === "auto" && l.value), y = O(() => n.tipFormat?.("size"));
5623
+ }), v = O(() => n.visibility === "auto" && c.value), y = O(() => n.tipFormat?.("size"));
5623
5624
  function f(m, b) {
5624
5625
  if (m && m.button !== void 0 && m.button !== 0)
5625
5626
  return !1;
5626
5627
  m?.preventDefault(), m?.stopPropagation();
5627
5628
  const { left: k = 0, top: x = 0, width: w = 0, height: T = 0, rotate: M = 0 } = i.value, P = w && T ? w / T : 0, B = b === void 0 ? { type: "move", x: 0, y: 0, width: 0, height: 0 } : u.value[b];
5628
- c.value = B.type;
5629
+ l.value = B.type;
5629
5630
  const A = B.type === "move", N = B.type.startsWith("rotate"), L = B.type === "resize-left" || B.type === "resize-right", j = B.type.split("-").length === 2, D = {
5630
5631
  x: k + w / 2,
5631
5632
  y: x + T / 2
@@ -5634,7 +5635,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5634
5635
  y: x
5635
5636
  };
5636
5637
  A || (U.x += B.x + B.width / 2, U.y += B.y + B.height / 2);
5637
- const W = $(
5638
+ const W = I(
5638
5639
  U,
5639
5640
  D,
5640
5641
  A ? 0 : M
@@ -5647,71 +5648,71 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5647
5648
  ) / (Math.PI / 180);
5648
5649
  let Y = m ? { x: m.clientX, y: m.clientY } : void 0;
5649
5650
  function xe() {
5650
- l.value = !0, s("start", i.value);
5651
+ c.value = !0, s("start", i.value);
5651
5652
  }
5652
- !n.threshold && !l.value && xe();
5653
- function oe(ye) {
5653
+ !n.threshold && !c.value && xe();
5654
+ function ae(ye) {
5654
5655
  const J = {};
5655
5656
  Y || (Y = { x: ye.clientX, y: ye.clientY });
5656
5657
  const me = {
5657
5658
  x: ye.clientX - Y.x,
5658
5659
  y: ye.clientY - Y.y
5659
5660
  };
5660
- if (!l.value) {
5661
+ if (!c.value) {
5661
5662
  if (Math.abs(me.x) < n.threshold && Math.abs(me.y) < n.threshold)
5662
5663
  return;
5663
5664
  xe();
5664
5665
  }
5665
- const ce = {
5666
+ const ue = {
5666
5667
  x: W.x + me.x,
5667
5668
  y: W.y + me.y
5668
5669
  };
5669
5670
  if (A) {
5670
5671
  if (!n.moveable)
5671
5672
  return;
5672
- J.left = ce.x, J.top = ce.y;
5673
+ J.left = ue.x, J.top = ue.y;
5673
5674
  } else if (N) {
5674
5675
  const ge = Math.atan2(
5675
- ce.y - D.y,
5676
- ce.x - D.x
5676
+ ue.y - D.y,
5677
+ ue.x - D.x
5677
5678
  ) / (Math.PI / 180);
5678
5679
  J.rotate = (M + ge - he + 360) % 360;
5679
5680
  } else if (j) {
5680
- const ge = $(ce, W, -M), ae = $(
5681
+ const ge = I(ue, W, -M), re = I(
5681
5682
  L ? { x: ge.x, y: W.y } : { x: W.x, y: ge.y },
5682
5683
  W,
5683
5684
  M
5684
5685
  ), Ve = {
5685
- x: ae.x - (ae.x - Z.x) / 2,
5686
- y: ae.y + (Z.y - ae.y) / 2
5687
- }, ke = C(ae, Z);
5688
- L ? (J.width = ke, P && n.resizeStrategy === "aspectRatio" && (J.height = ke / P)) : (J.height = ke, P && n.resizeStrategy === "aspectRatio" && (J.width = ke * P)), J.left = Ve.x - (L ? ke : w) / 2, J.top = Ve.y - (L ? T : ke) / 2;
5686
+ x: re.x - (re.x - Z.x) / 2,
5687
+ y: re.y + (Z.y - re.y) / 2
5688
+ }, Ce = C(re, Z);
5689
+ L ? (J.width = Ce, P && n.resizeStrategy === "aspectRatio" && (J.height = Ce / P)) : (J.height = Ce, P && n.resizeStrategy === "aspectRatio" && (J.width = Ce * P)), J.left = Ve.x - (L ? Ce : w) / 2, J.top = Ve.y - (L ? T : Ce) / 2;
5689
5690
  } else {
5690
5691
  if (P && (n.resizeStrategy === "aspectRatio" || n.resizeStrategy === "diagonalAspectRatio")) {
5691
- let ot = 1;
5692
+ let st = 1;
5692
5693
  switch (B.type) {
5693
5694
  case "resize-top-right":
5694
5695
  case "resize-bottom-left":
5695
- ot = -1;
5696
+ st = -1;
5696
5697
  break;
5697
5698
  }
5698
- me.x > me.y ? (ce.x = W.x + me.x, ce.y = W.y + ot * me.x / P) : (ce.x = W.x + ot * me.y * P, ce.y = W.y + me.y);
5699
+ me.x > me.y ? (ue.x = W.x + me.x, ue.y = W.y + st * me.x / P) : (ue.x = W.x + st * me.y * P, ue.y = W.y + me.y);
5699
5700
  }
5700
- const ge = E(ce, Z), ae = [
5701
- $(ce, ge, -M),
5702
- $(Z, ge, -M)
5703
- ], [Ve, ke] = ae[0].x > ae[1].x ? [ae[1].x, ae[0].x] : [ae[0].x, ae[1].x], [_t, vn] = ae[0].y > ae[1].y ? [ae[1].y, ae[0].y] : [ae[0].y, ae[1].y];
5704
- J.width = ke - Ve, J.height = vn - _t, J.left = Ve, J.top = _t;
5701
+ const ge = E(ue, Z), re = [
5702
+ I(ue, ge, -M),
5703
+ I(Z, ge, -M)
5704
+ ], [Ve, Ce] = re[0].x > re[1].x ? [re[1].x, re[0].x] : [re[0].x, re[1].x], [kt, vn] = re[0].y > re[1].y ? [re[1].y, re[0].y] : [re[0].y, re[1].y];
5705
+ J.width = Ce - Ve, J.height = vn - kt, J.left = Ve, J.top = kt;
5705
5706
  }
5706
5707
  if ("width" in J && J.width <= 0 || "height" in J && J.height <= 0)
5707
5708
  return;
5708
- const ee = { ...i.value }, se = { ...i.value, ...J };
5709
- i.value = se, s("move", se, ee);
5709
+ const te = { ...i.value }, ie = { ...i.value, ...J };
5710
+ i.value = ie, s("move", ie, te);
5710
5711
  }
5711
5712
  function ve() {
5712
- window.removeEventListener("pointermove", oe), window.removeEventListener("pointerup", ve, !0), l.value = !1, s("end", i.value);
5713
+ window.removeEventListener("pointermove", ae), window.removeEventListener("pointerup", ve, !0), c.value = !1, s("end", i.value);
5713
5714
  }
5714
- return window.addEventListener("pointermove", oe), window.addEventListener("pointerup", ve, !0), !0;
5715
+ return window.addEventListener("pointermove", ae), window.addEventListener("pointerup", ve, !0), !0;
5715
5716
  }
5716
5717
  const p = {
5717
5718
  rotate: '<path d="M22.4789 9.45728L25.9935 12.9942L22.4789 16.5283V14.1032C18.126 14.1502 14.6071 17.6737 14.5675 22.0283H17.05L13.513 25.543L9.97889 22.0283H12.5674C12.6071 16.5691 17.0214 12.1503 22.4789 12.1031L22.4789 9.45728Z" fill="black"/><path fill-rule="evenodd" clip-rule="evenodd" d="M21.4789 7.03223L27.4035 12.9945L21.4789 18.9521V15.1868C18.4798 15.6549 16.1113 18.0273 15.649 21.0284H19.475L13.5128 26.953L7.55519 21.0284H11.6189C12.1243 15.8155 16.2679 11.6677 21.4789 11.1559L21.4789 7.03223ZM22.4789 12.1031C17.0214 12.1503 12.6071 16.5691 12.5674 22.0284H9.97889L13.513 25.543L17.05 22.0284H14.5675C14.5705 21.6896 14.5947 21.3558 14.6386 21.0284C15.1157 17.4741 17.9266 14.6592 21.4789 14.1761C21.8063 14.1316 22.1401 14.1069 22.4789 14.1032V16.5284L25.9935 12.9942L22.4789 9.45729L22.4789 12.1031Z" fill="white"/>',
@@ -5725,7 +5726,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5725
5726
  function z(m) {
5726
5727
  return m === "move" ? "move" : `url("data:image/svg+xml,${a[m](i.value.rotate ?? 0)}") 16 16, pointer`;
5727
5728
  }
5728
- function $(m, b, k) {
5729
+ function I(m, b, k) {
5729
5730
  const x = k * Math.PI / 180, w = Math.cos(x), T = Math.sin(x);
5730
5731
  return {
5731
5732
  x: (m.x - b.x) * w - (m.y - b.y) * T + b.x,
@@ -5742,9 +5743,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5742
5743
  return Math.sqrt((m.x - b.x) ** 2 + (m.y - b.y) ** 2);
5743
5744
  }
5744
5745
  return He(async () => {
5745
- const b = Ze()?.proxy?.$el;
5746
+ const b = Qe()?.proxy?.$el;
5746
5747
  if (b && n.initialSize) {
5747
- await Pe();
5748
+ await Re();
5748
5749
  let k, x;
5749
5750
  const w = getComputedStyle(b);
5750
5751
  if (w.width.endsWith("px") && w.height.endsWith("px") ? (k = Number(w.width.replace("px", "")), x = Number(w.height.replace("px", ""))) : { width: k, height: x } = b.getBoundingClientRect(), k && x)
@@ -5762,14 +5763,14 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5762
5763
  }
5763
5764
  }), e({
5764
5765
  start: f,
5765
- activeHandle: c,
5766
- transforming: l
5767
- }), (m, b) => (I(), le(Vt(o.tag), {
5766
+ activeHandle: l,
5767
+ transforming: c
5768
+ }), (m, b) => ($(), oe(jt(o.tag), {
5768
5769
  class: "mce-transformable",
5769
5770
  style: q(h.value)
5770
5771
  }, {
5771
- default: re(() => [
5772
- te(m.$slots, "default", {
5772
+ default: ne(() => [
5773
+ Q(m.$slots, "default", {
5773
5774
  value: S(r),
5774
5775
  moveProps: {
5775
5776
  onPointerdown: f,
@@ -5777,7 +5778,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5777
5778
  },
5778
5779
  start: f
5779
5780
  }),
5780
- (I(), R("svg", Ia, [
5781
+ ($(), R("svg", Ia, [
5781
5782
  F("rect", {
5782
5783
  width: "100%",
5783
5784
  height: "100%",
@@ -5790,9 +5791,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5790
5791
  })
5791
5792
  }, null, 4),
5792
5793
  F("g", Fa, [
5793
- (I(!0), R(ne, null, _e(u.value.filter((k) => !(!o.resizable && k.type.startsWith("resize") || !o.rotatable && k.type.startsWith("rotate") || !o.moveable && k.type === "move")), (k, x) => (I(), R(ne, { key: x }, [
5794
- (o.handleStrategy === "point" ? k.type.startsWith("resize") : k.type === "resize-top-left" || k.type === "resize-top-right" || k.type === "resize-bottom-left" || k.type === "resize-bottom-right") ? (I(), R(ne, { key: 0 }, [
5795
- n.handleShape === "rect" ? (I(), R("rect", {
5794
+ ($(!0), R(se, null, _e(u.value.filter((k) => !(!o.resizable && k.type.startsWith("resize") || !o.rotatable && k.type.startsWith("rotate") || !o.moveable && k.type === "move")), (k, x) => ($(), R(se, { key: x }, [
5795
+ (o.handleStrategy === "point" ? k.type.startsWith("resize") : k.type === "resize-top-left" || k.type === "resize-top-right" || k.type === "resize-bottom-left" || k.type === "resize-bottom-right") ? ($(), R(se, { key: 0 }, [
5796
+ n.handleShape === "rect" ? ($(), R("rect", {
5796
5797
  key: 0,
5797
5798
  x: k.x,
5798
5799
  y: k.y,
@@ -5802,9 +5803,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5802
5803
  fill: o.handleColor,
5803
5804
  class: "mce-transformable__handle",
5804
5805
  style: q({
5805
- opacity: o.visibility === "none" || l.value && o.visibility !== "visible" ? 0 : void 0
5806
+ opacity: o.visibility === "none" || c.value && o.visibility !== "visible" ? 0 : void 0
5806
5807
  })
5807
- }, null, 12, Pa)) : (I(), R("circle", {
5808
+ }, null, 12, Pa)) : ($(), R("circle", {
5808
5809
  key: 1,
5809
5810
  cx: k.x + k.width / 2,
5810
5811
  cy: k.y + k.width / 2,
@@ -5813,10 +5814,10 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5813
5814
  fill: o.handleColor,
5814
5815
  class: "mce-transformable__handle",
5815
5816
  style: q({
5816
- opacity: o.visibility === "none" || l.value && o.visibility !== "visible" ? 0 : void 0
5817
+ opacity: o.visibility === "none" || c.value && o.visibility !== "visible" ? 0 : void 0
5817
5818
  })
5818
5819
  }, null, 12, Na))
5819
- ], 64)) : Q("", !0),
5820
+ ], 64)) : ee("", !0),
5820
5821
  F("rect", {
5821
5822
  ref_for: !0,
5822
5823
  ref_key: "handlesRef",
@@ -5828,9 +5829,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5828
5829
  "aria-label": k.type,
5829
5830
  class: "mce-transformable__handle-box",
5830
5831
  style: q({
5831
- opacity: o.visibility === "none" || l.value && o.visibility !== "visible" ? 0 : void 0
5832
+ opacity: o.visibility === "none" || c.value && o.visibility !== "visible" ? 0 : void 0
5832
5833
  }),
5833
- cursor: l.value ? "auto" : z(k.type),
5834
+ cursor: c.value ? "auto" : z(k.type),
5834
5835
  onPointerdown: (w) => f(w, x)
5835
5836
  }, null, 44, Ra)
5836
5837
  ], 64))), 128))
@@ -5839,10 +5840,10 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5839
5840
  "pointer-events": "all",
5840
5841
  style: q(v.value ? { opacity: ".4", strokeWidth: "0.5px" } : void 0)
5841
5842
  }, [
5842
- te(m.$slots, "svg", { box: i.value })
5843
+ Q(m.$slots, "svg", { box: i.value })
5843
5844
  ], 4)
5844
5845
  ])),
5845
- y.value ? (I(), R("div", Ba, K(y.value), 1)) : Q("", !0)
5846
+ y.value ? ($(), R("div", Ba, K(y.value), 1)) : ee("", !0)
5846
5847
  ]),
5847
5848
  _: 3
5848
5849
  }, 8, ["style"]));
@@ -5861,15 +5862,15 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5861
5862
  selection: a,
5862
5863
  camera: r,
5863
5864
  obbToFit: i,
5864
- getObbInDrawboard: l,
5865
- getObb: c,
5865
+ getObbInDrawboard: c,
5866
+ getObb: l,
5866
5867
  registerCommand: u,
5867
5868
  unregisterCommand: d,
5868
5869
  isFrame: g,
5869
5870
  isLock: h,
5870
5871
  config: v
5871
- } = de(), y = ue("transformableRef");
5872
- vt(() => {
5872
+ } = de(), y = ce("transformableRef");
5873
+ gt(() => {
5873
5874
  u({ command: "startTransform", handle: (E) => !!y.value?.start(E) });
5874
5875
  }), we(() => {
5875
5876
  d("startTransform");
@@ -5878,11 +5879,11 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5878
5879
  if (a.value.length !== 1)
5879
5880
  return [];
5880
5881
  const E = [];
5881
- return a.value[0]?.findAncestor((C) => (C instanceof G && E.push(l(C)), !1)), E;
5882
+ return a.value[0]?.findAncestor((C) => (C instanceof G && E.push(c(C)), !1)), E;
5882
5883
  }), p = O(() => n.value !== "selecting" && a.value.length === 1 ? [] : a.value.map((E) => ({
5883
5884
  name: E.name,
5884
- box: l(E)
5885
- }))), _ = O(() => l(a.value)), z = O({
5885
+ box: c(E)
5886
+ }))), _ = O(() => c(a.value)), z = O({
5886
5887
  get: () => _.value,
5887
5888
  set: (E) => {
5888
5889
  const C = r.value.zoom, m = _.value, b = {
@@ -5909,14 +5910,14 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5909
5910
  });
5910
5911
  }
5911
5912
  });
5912
- function $() {
5913
- const E = a.value.length === 1 ? a.value[0].style : c(a.value);
5913
+ function I() {
5914
+ const E = a.value.length === 1 ? a.value[0].style : l(a.value);
5914
5915
  return `${Number(E.width.toFixed(2))} × ${Number(E.height.toFixed(2))}`;
5915
5916
  }
5916
5917
  return e({
5917
5918
  transformable: y
5918
- }), (E, C) => (I(), R(ne, null, [
5919
- (I(!0), R(ne, null, _e(f.value, (m, b) => (I(), R("div", {
5919
+ }), (E, C) => ($(), R(se, null, [
5920
+ ($(!0), R(se, null, _e(f.value, (m, b) => ($(), R("div", {
5920
5921
  key: b,
5921
5922
  class: "mce-parent-element-obb",
5922
5923
  style: q({
@@ -5924,15 +5925,15 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5924
5925
  ...S(Me)(m)
5925
5926
  })
5926
5927
  }, null, 4))), 128)),
5927
- S(n) === "selecting" ? (I(), R("div", {
5928
+ S(n) === "selecting" ? ($(), R("div", {
5928
5929
  key: 0,
5929
5930
  class: "mce-selected-area",
5930
5931
  style: q({
5931
5932
  borderColor: "currentcolor",
5932
5933
  ...S(Me)(t.selectedArea)
5933
5934
  })
5934
- }, null, 4)) : Q("", !0),
5935
- (I(!0), R(ne, null, _e(p.value, (m, b) => (I(), R("div", {
5935
+ }, null, 4)) : ee("", !0),
5936
+ ($(!0), R(se, null, _e(p.value, (m, b) => ($(), R("div", {
5936
5937
  key: b,
5937
5938
  class: "mce-element-obb",
5938
5939
  style: q({
@@ -5940,7 +5941,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5940
5941
  ...S(Me)(m.box)
5941
5942
  })
5942
5943
  }, null, 4))), 128)),
5943
- z.value.width && z.value.height ? (I(), le(La, {
5944
+ z.value.width && z.value.height ? ($(), oe(La, {
5944
5945
  key: 1,
5945
5946
  ref: "transformableRef",
5946
5947
  modelValue: z.value,
@@ -5951,24 +5952,24 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5951
5952
  "handle-shape": S(v).handleShape,
5952
5953
  class: "mce-selection-obb",
5953
5954
  "border-style": S(a).length > 1 ? "dashed" : "solid",
5954
- "tip-format": $,
5955
+ "tip-format": I,
5955
5956
  onMove: C[1] || (C[1] = () => !S(n) && (n.value = "transforming")),
5956
5957
  onEnd: C[2] || (C[2] = () => S(n) === "transforming" && (n.value = void 0))
5957
- }, ht({ _: 2 }, [
5958
+ }, pt({ _: 2 }, [
5958
5959
  E.$slots.transformable ? {
5959
5960
  name: "svg",
5960
- fn: re((m) => [
5961
- te(E.$slots, "transformable", ft(pt(m)))
5961
+ fn: ne((m) => [
5962
+ Q(E.$slots, "transformable", vt(yt(m)))
5962
5963
  ]),
5963
5964
  key: "0"
5964
5965
  } : void 0
5965
- ]), 1032, ["modelValue", "visibility", "moveable", "resize-strategy", "handle-shape", "border-style"])) : Q("", !0),
5966
- z.value.width && z.value.height && E.$slots.default ? (I(), R("div", {
5966
+ ]), 1032, ["modelValue", "visibility", "moveable", "resize-strategy", "handle-shape", "border-style"])) : ee("", !0),
5967
+ z.value.width && z.value.height && E.$slots.default ? ($(), R("div", {
5967
5968
  key: 2,
5968
5969
  style: q([{ position: "absolute" }, S(Me)(z.value)])
5969
5970
  }, [
5970
- te(E.$slots, "default", { box: z.value })
5971
- ], 4)) : Q("", !0)
5971
+ Q(E.$slots, "default", { box: z.value })
5972
+ ], 4)) : ee("", !0)
5972
5973
  ], 64));
5973
5974
  }
5974
5975
  }), Va = /* @__PURE__ */ X({
@@ -5992,15 +5993,15 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5992
5993
  return e({
5993
5994
  items: a,
5994
5995
  getLayoutItem: r
5995
- }), (l, c) => (I(), R("div", {
5996
+ }), (c, l) => ($(), R("div", {
5996
5997
  ref: S(i),
5997
5998
  class: be([S(n)]),
5998
5999
  style: q([S(s)])
5999
6000
  }, [
6000
- te(l.$slots, "default")
6001
+ Q(c.$slots, "default")
6001
6002
  ], 6));
6002
6003
  }
6003
- }), Rt = /* @__PURE__ */ X({
6004
+ }), Bt = /* @__PURE__ */ X({
6004
6005
  __name: "LayoutItem",
6005
6006
  props: {
6006
6007
  position: {
@@ -6018,19 +6019,19 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6018
6019
  const e = o, { layoutItemStyles: t } = sa({
6019
6020
  id: e.name,
6020
6021
  order: O(() => Number.parseInt(String(e.order), 10)),
6021
- position: Ee(() => e.position),
6022
- elementSize: Ee(() => e.size),
6023
- layoutSize: Ee(() => e.size),
6024
- active: Ee(() => e.modelValue),
6025
- absolute: Ee(() => e.absolute)
6022
+ position: Te(() => e.position),
6023
+ elementSize: Te(() => e.size),
6024
+ layoutSize: Te(() => e.size),
6025
+ active: Te(() => e.modelValue),
6026
+ absolute: Te(() => e.absolute)
6026
6027
  });
6027
- return (n, s) => (I(), R("div", {
6028
+ return (n, s) => ($(), R("div", {
6028
6029
  class: be(["mce-layout-item", [
6029
6030
  `mce-layout-item--${e.position}`
6030
6031
  ]]),
6031
6032
  style: q([S(t)])
6032
6033
  }, [
6033
- te(n.$slots, "default")
6034
+ Q(n.$slots, "default")
6034
6035
  ], 6));
6035
6036
  }
6036
6037
  }), Ua = {
@@ -6043,15 +6044,15 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6043
6044
  },
6044
6045
  setup(o) {
6045
6046
  const e = o, { mainStyles: t } = oa();
6046
- return (n, s) => (I(), R("main", {
6047
+ return (n, s) => ($(), R("main", {
6047
6048
  class: be(["mce-main", [
6048
6049
  { "mce-main--scrollable": e.scrollable }
6049
6050
  ]]),
6050
6051
  style: q([S(t)])
6051
6052
  }, [
6052
- e.scrollable ? (I(), R("div", Ua, [
6053
- te(n.$slots, "default")
6054
- ])) : te(n.$slots, "default", { key: 1 })
6053
+ e.scrollable ? ($(), R("div", Ua, [
6054
+ Q(n.$slots, "default")
6055
+ ])) : Q(n.$slots, "default", { key: 1 })
6055
6056
  ], 6));
6056
6057
  }
6057
6058
  }), Ha = { class: "progress-indicator" }, Ya = {
@@ -6062,7 +6063,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6062
6063
  class: "progress-indicator__bar-indeterminate"
6063
6064
  }, Wa = /* @__PURE__ */ X({
6064
6065
  __name: "ProgressIndicator",
6065
- props: /* @__PURE__ */ Re({
6066
+ props: /* @__PURE__ */ $e({
6066
6067
  label: {},
6067
6068
  indeterminate: { type: Boolean }
6068
6069
  }, {
@@ -6071,11 +6072,11 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6071
6072
  }),
6072
6073
  emits: ["update:modelValue"],
6073
6074
  setup(o) {
6074
- const e = Ae(o, "modelValue");
6075
- return (t, n) => (I(), R("div", Ha, [
6076
- o.label ? (I(), R("span", Ya, K(o.label), 1)) : Q("", !0),
6075
+ const e = ke(o, "modelValue");
6076
+ return (t, n) => ($(), R("div", Ha, [
6077
+ o.label ? ($(), R("span", Ya, K(o.label), 1)) : ee("", !0),
6077
6078
  F("div", qa, [
6078
- o.indeterminate ? (I(), R("div", Ga)) : (I(), R("div", {
6079
+ o.indeterminate ? ($(), R("div", Ga)) : ($(), R("div", {
6079
6080
  key: 0,
6080
6081
  class: "progress-indicator__bar-fill",
6081
6082
  style: q({ width: `${e.value * 100}%` })
@@ -6098,9 +6099,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6098
6099
  exporting: s,
6099
6100
  exportProgress: a
6100
6101
  } = de();
6101
- return (r, i) => (I(), R("div", Ja, [
6102
+ return (r, i) => ($(), R("div", Ja, [
6102
6103
  F("div", Za, [
6103
- S(e) === "typing" ? (I(), R(ne, { key: 0 }, [
6104
+ S(e) === "typing" ? ($(), R(se, { key: 0 }, [
6104
6105
  F("div", Qa, [
6105
6106
  F("span", ei, K(S(n)("Command")), 1),
6106
6107
  F("span", ti, K(S(n)("Enter")), 1)
@@ -6110,9 +6111,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6110
6111
  F("span", oi, K(S(n)("Escape")), 1),
6111
6112
  F("span", null, K(S(t)("commitChanges")), 1)
6112
6113
  ])
6113
- ], 64)) : S(e) === "transforming" ? (I(), R(ne, { key: 1 }, [
6114
+ ], 64)) : S(e) === "transforming" ? ($(), R(se, { key: 1 }, [
6114
6115
  F("div", si, [
6115
- H(Te, { icon: "$mouseRightClick" })
6116
+ H(Ae, { icon: "$mouseRightClick" })
6116
6117
  ]),
6117
6118
  i[2] || (i[2] = F("span", null, " / ", -1)),
6118
6119
  F("div", ai, [
@@ -6124,9 +6125,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6124
6125
  F("span", li, K(S(n)("Shift")), 1),
6125
6126
  F("span", null, K(S(t)("constrainToAxis")), 1)
6126
6127
  ])
6127
- ], 64)) : S(e) ? (I(), R("span", ci, K(S(t)(S(e))), 1)) : (I(), R(ne, { key: 3 }, [
6128
+ ], 64)) : S(e) ? ($(), R("span", ci, K(S(t)(S(e))), 1)) : ($(), R(se, { key: 3 }, [
6128
6129
  F("div", ui, [
6129
- H(Te, { icon: "$mouseLeftClick" }),
6130
+ H(Ae, { icon: "$mouseLeftClick" }),
6130
6131
  F("span", null, K(S(t)("selectObject")), 1)
6131
6132
  ]),
6132
6133
  i[4] || (i[4] = F("span", null, " + ", -1)),
@@ -6136,7 +6137,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6136
6137
  ]),
6137
6138
  i[5] || (i[5] = F("div", { class: "mce-statusbar__divider" }, null, -1)),
6138
6139
  F("div", hi, [
6139
- H(Te, { icon: "$mouseLeftClick" }),
6140
+ H(Ae, { icon: "$mouseLeftClick" }),
6140
6141
  F("span", null, K(S(t)("selectArea")), 1)
6141
6142
  ]),
6142
6143
  i[6] || (i[6] = F("span", null, " + ", -1)),
@@ -6146,18 +6147,18 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6146
6147
  ]),
6147
6148
  i[7] || (i[7] = F("div", { class: "mce-statusbar__divider" }, null, -1)),
6148
6149
  F("div", vi, [
6149
- H(Te, { icon: "$mouseLeftClick" }),
6150
+ H(Ae, { icon: "$mouseLeftClick" }),
6150
6151
  F("span", null, K(S(t)("dragSelected")), 1)
6151
6152
  ])
6152
6153
  ], 64))
6153
6154
  ]),
6154
6155
  F("div", yi, [
6155
- S(s) ? (I(), le(Ka, {
6156
+ S(s) ? ($(), oe(Ka, {
6156
6157
  key: 0,
6157
6158
  modelValue: S(a),
6158
- "onUpdate:modelValue": i[0] || (i[0] = (l) => Tn(a) ? a.value = l : null),
6159
+ "onUpdate:modelValue": i[0] || (i[0] = (c) => Tn(a) ? a.value = c : null),
6159
6160
  label: S(t)("exporting")
6160
- }, null, 8, ["modelValue", "label"])) : Q("", !0)
6161
+ }, null, 8, ["modelValue", "label"])) : ee("", !0)
6161
6162
  ])
6162
6163
  ]));
6163
6164
  }
@@ -6171,10 +6172,10 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6171
6172
  textToFit: a,
6172
6173
  getObb: r,
6173
6174
  registerCommand: i,
6174
- unregisterCommand: l,
6175
- camera: c
6175
+ unregisterCommand: c,
6176
+ camera: l
6176
6177
  } = de(), u = V(), d = O(() => {
6177
- const { zoom: f, position: p } = c.value;
6178
+ const { zoom: f, position: p } = l.value;
6178
6179
  return {
6179
6180
  transformOrigin: "left top",
6180
6181
  transform: `translate(${p.x}px, ${p.y}px) scale(${f.x}, ${f.y})`
@@ -6198,11 +6199,11 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6198
6199
  return !1;
6199
6200
  p.text.isValid() || p.text.setContent(" "), p.text.update(), n.value = "typing";
6200
6201
  const _ = u.value;
6201
- return _.set(p.text.base), await Pe(), _.pointerdown(f);
6202
+ return _.set(p.text.base), await Re(), _.pointerdown(f);
6202
6203
  }
6203
- return vt(() => i({ command: "startTyping", handle: y })), we(() => l("startTyping")), e({
6204
+ return gt(() => i({ command: "startTyping", handle: y })), we(() => c("startTyping")), e({
6204
6205
  textEditor: u
6205
- }), (f, p) => ze((I(), R("div", {
6206
+ }), (f, p) => ze(($(), R("div", {
6206
6207
  class: "mce-text-editor",
6207
6208
  style: q({
6208
6209
  ...d.value
@@ -6233,7 +6234,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6233
6234
  }), xi = { class: "mce-payhead" }, _i = /* @__PURE__ */ X({
6234
6235
  __name: "Playhead",
6235
6236
  setup(o) {
6236
- return (e, t) => (I(), R("div", xi, [...t[0] || (t[0] = [
6237
+ return (e, t) => ($(), R("div", xi, [...t[0] || (t[0] = [
6237
6238
  F("header", { class: "mce-payhead__header" }, null, -1),
6238
6239
  F("main", { class: "mce-payhead__main" }, null, -1)
6239
6240
  ])]));
@@ -6262,23 +6263,23 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6262
6263
  transform: `matrix(1, 0, 0, 1, ${n.left}, ${n.top})`
6263
6264
  };
6264
6265
  });
6265
- return (n, s) => (I(), R("div", {
6266
+ return (n, s) => ($(), R("div", {
6266
6267
  class: be(["mce-segment", [
6267
6268
  `mce-segment--${o.node.meta.inEditorIs}`,
6268
6269
  o.active && "mce-segment--active"
6269
6270
  ]]),
6270
6271
  style: q(t.value)
6271
6272
  }, [
6272
- o.active ? (I(), R("div", ki)) : Q("", !0),
6273
+ o.active ? ($(), R("div", ki)) : ee("", !0),
6273
6274
  F("span", Ci, K(e.node.name), 1),
6274
- o.active ? (I(), R("div", Ei)) : Q("", !0)
6275
+ o.active ? ($(), R("div", Ei)) : ee("", !0)
6275
6276
  ], 6));
6276
6277
  }
6277
6278
  }), Ai = { class: "mce-track" }, Si = /* @__PURE__ */ X({
6278
6279
  __name: "Track",
6279
6280
  setup(o) {
6280
- return (e, t) => (I(), R("div", Ai, [
6281
- te(e.$slots, "default")
6281
+ return (e, t) => ($(), R("div", Ai, [
6282
+ Q(e.$slots, "default")
6282
6283
  ]));
6283
6284
  }
6284
6285
  }), Mi = /* @__PURE__ */ X({
@@ -6287,7 +6288,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6287
6288
  node: {}
6288
6289
  },
6289
6290
  setup(o) {
6290
- return (e, t) => (I(), R("div", {
6291
+ return (e, t) => ($(), R("div", {
6291
6292
  class: "mce-trackhead",
6292
6293
  style: q({
6293
6294
  height: `var(--timeline-track-height__${o.node.meta.inEditorIs}, 22px)`
@@ -6304,7 +6305,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6304
6305
  timeline: s,
6305
6306
  endTime: a,
6306
6307
  selection: r
6307
- } = de(), i = V(1e3 / 30), l = ue("rulerTpl"), c = V(!0), u = V([0, 0]), d = O(() => e.value?.findAll((z) => !!(z instanceof G && z.children.some(($) => $ instanceof Ln))) ?? []);
6308
+ } = de(), i = V(1e3 / 30), c = ce("rulerTpl"), l = V(!0), u = V([0, 0]), d = O(() => e.value?.findAll((z) => !!(z instanceof G && z.children.some((I) => I instanceof Ln))) ?? []);
6308
6309
  function g(z) {
6309
6310
  if (z.ctrlKey) {
6310
6311
  if (!(z.wheelDeltaY ? Math.abs(Math.abs(z.wheelDeltaY) - Math.abs(3 * z.deltaY)) < 3 : z.deltaMode === 0)) {
@@ -6319,11 +6320,11 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6319
6320
  ];
6320
6321
  }
6321
6322
  function h(z) {
6322
- const $ = l.value?.box;
6323
- if ($) {
6324
- n.value = (z.clientX - $.left + u.value[0]) * t.value;
6323
+ const I = c.value?.box;
6324
+ if (I) {
6325
+ n.value = (z.clientX - I.left + u.value[0]) * t.value;
6325
6326
  const E = (m) => {
6326
- n.value = (m.clientX - $.left + u.value[0]) * t.value;
6327
+ n.value = (m.clientX - I.left + u.value[0]) * t.value;
6327
6328
  }, C = () => {
6328
6329
  window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", C);
6329
6330
  };
@@ -6332,29 +6333,29 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6332
6333
  }
6333
6334
  function v(z) {
6334
6335
  if (z % 30 === 0) {
6335
- const $ = Math.floor(z / 30 / 60), E = Math.floor(z / 30) % 60, C = String($).padStart(2, "0"), m = String(E).padStart(2, "0");
6336
+ const I = Math.floor(z / 30 / 60), E = Math.floor(z / 30) % 60, C = String(I).padStart(2, "0"), m = String(E).padStart(2, "0");
6336
6337
  return `${C}:${m}`;
6337
6338
  }
6338
6339
  return `${Math.floor(z % 30)}f`;
6339
6340
  }
6340
6341
  let y;
6341
6342
  function f() {
6342
- c.value = !1;
6343
+ l.value = !1;
6343
6344
  let z;
6344
- function $(E) {
6345
- z !== void 0 && E !== void 0 && s.value.addTime(E - z), z = E, y = requestAnimationFrame($);
6345
+ function I(E) {
6346
+ z !== void 0 && E !== void 0 && s.value.addTime(E - z), z = E, y = requestAnimationFrame(I);
6346
6347
  }
6347
- $();
6348
+ I();
6348
6349
  }
6349
6350
  function p() {
6350
- c.value = !0, y !== void 0 && (cancelAnimationFrame(y), y = void 0);
6351
+ l.value = !0, y !== void 0 && (cancelAnimationFrame(y), y = void 0);
6351
6352
  }
6352
6353
  function _() {
6353
- c.value ? f() : p();
6354
+ l.value ? f() : p();
6354
6355
  }
6355
- return we(p), (z, $) => (I(), R("div", {
6356
+ return we(p), (z, I) => ($(), R("div", {
6356
6357
  class: "mce-timeline",
6357
- onWheel: $[0] || ($[0] = We(() => {
6358
+ onWheel: I[0] || (I[0] = Ke(() => {
6358
6359
  }, ["prevent"]))
6359
6360
  }, [
6360
6361
  F("div", zi, [
@@ -6362,8 +6363,8 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6362
6363
  class: "mce-timeline__play",
6363
6364
  onClick: _
6364
6365
  }, [
6365
- H(Te, {
6366
- icon: c.value ? "$play" : "$pause"
6366
+ H(Ae, {
6367
+ icon: l.value ? "$play" : "$pause"
6367
6368
  }, null, 8, ["icon"])
6368
6369
  ])
6369
6370
  ]),
@@ -6375,7 +6376,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6375
6376
  transform: `translateY(${u.value[1]}px)`
6376
6377
  })
6377
6378
  }, [
6378
- (I(!0), R(ne, null, _e(d.value, (E, C) => (I(), le(Mi, {
6379
+ ($(!0), R(se, null, _e(d.value, (E, C) => ($(), oe(Mi, {
6379
6380
  key: C,
6380
6381
  node: E
6381
6382
  }, null, 8, ["node"]))), 128))
@@ -6389,7 +6390,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6389
6390
  }, [
6390
6391
  F("div", Fi, [
6391
6392
  F("div", Pi, [
6392
- H(mt, {
6393
+ H(ft, {
6393
6394
  ref: "rulerTpl",
6394
6395
  zoom: 1 / S(t) * i.value,
6395
6396
  unit: 100,
@@ -6406,13 +6407,13 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6406
6407
  transform: `translate(${u.value[0]}px, ${u.value[1]}px)`
6407
6408
  })
6408
6409
  }, [
6409
- (I(!0), R(ne, null, _e(d.value, (E, C) => (I(), le(Si, { key: C }, {
6410
- default: re(() => [
6410
+ ($(!0), R(se, null, _e(d.value, (E, C) => ($(), oe(Si, { key: C }, {
6411
+ default: ne(() => [
6411
6412
  H(Ti, {
6412
6413
  node: E,
6413
6414
  "ms-per-px": S(t),
6414
6415
  active: S(r).some((m) => m.equal(E)),
6415
- onMousedown: We((m) => r.value = [E], ["stop"])
6416
+ onMousedown: Ke((m) => r.value = [E], ["stop"])
6416
6417
  }, null, 8, ["node", "ms-per-px", "active", "onMousedown"])
6417
6418
  ]),
6418
6419
  _: 2
@@ -6454,8 +6455,8 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6454
6455
  config: a,
6455
6456
  drawboardDom: r,
6456
6457
  renderEngine: i,
6457
- camera: l,
6458
- bindRenderCanvas: c,
6458
+ camera: c,
6459
+ bindRenderCanvas: l,
6459
6460
  hoverElement: u,
6460
6461
  state: d,
6461
6462
  setCursor: g,
@@ -6466,17 +6467,17 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6466
6467
  selection: p,
6467
6468
  getAabbInDrawboard: _,
6468
6469
  drawboardAabb: z,
6469
- drawboardPointer: $
6470
- } = s, E = ue("overlayContainerTpl"), C = ue("canvasTpl"), m = ue("selectorTpl"), b = ue("textEditorTpl"), k = V({ left: 0, top: 0, width: 0, height: 0 });
6470
+ drawboardPointer: I
6471
+ } = s, E = ce("overlayContainerTpl"), C = ce("canvasTpl"), m = ce("selectorTpl"), b = ce("textEditorTpl"), k = V({ left: 0, top: 0, width: 0, height: 0 });
6471
6472
  Ys({
6472
6473
  attach: O(() => E.value)
6473
- }), Xt(C, (A) => {
6474
+ }), Ht(C, (A) => {
6474
6475
  const { width: N, height: L } = A[0].contentRect;
6475
6476
  i.value.resize(N, L);
6476
- }), vt(() => {
6477
+ }), gt(() => {
6477
6478
  i.value.on("pointerdown", T), i.value.on("pointermove", M), i.value.on("pointerover", P);
6478
6479
  }), He(() => {
6479
- c(C.value, r.value);
6480
+ l(C.value, r.value);
6480
6481
  }), we(() => {
6481
6482
  i.value.off("pointerdown", T), i.value.off("pointermove", M), i.value.off("pointerover", P);
6482
6483
  });
@@ -6485,7 +6486,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6485
6486
  }
6486
6487
  function w(A) {
6487
6488
  let N, L;
6488
- if (Ct(
6489
+ if (Et(
6489
6490
  { x: A.clientX, y: A.clientY },
6490
6491
  _(p.value)
6491
6492
  ))
@@ -6502,36 +6503,36 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6502
6503
  u.value = L, g(N);
6503
6504
  }
6504
6505
  function T(A) {
6505
- if (A.srcElement !== r.value && A.srcElement.dataset?.pointerdown_to_drawboard === void 0 || l.value.spaceKey || ![0, 2].includes(A.button))
6506
+ if (A.srcElement !== r.value && A.srcElement.dataset?.pointerdown_to_drawboard === void 0 || c.value.spaceKey || ![0, 2].includes(A.button))
6506
6507
  return;
6507
6508
  const N = p.value[0], L = A.target, j = { x: A.clientX, y: A.clientY };
6508
6509
  let D = { ...j }, U = !1, W = !1, Z = [], he;
6509
- const Y = Ct({
6510
+ const Y = Et({
6510
6511
  x: j.x + -z.value.left,
6511
6512
  y: j.y + -z.value.top
6512
6513
  }, _(p.value));
6513
6514
  if (A.button === 2) {
6514
6515
  if (!Y) {
6515
- const ee = t.activeStrategy({
6516
+ const te = t.activeStrategy({
6516
6517
  element: L,
6517
6518
  oldElement: N,
6518
6519
  event: A,
6519
6520
  isExcluded: x
6520
6521
  });
6521
- ee && !(ee instanceof G) ? Z = ee.element ? [ee.element] : [] : Z = ee ? [ee] : [], p.value = Z;
6522
+ te && !(te instanceof G) ? Z = te.element ? [te.element] : [] : Z = te ? [te] : [], p.value = Z;
6522
6523
  }
6523
6524
  return;
6524
6525
  }
6525
- function xe(ee) {
6526
- const se = t.activeStrategy({
6526
+ function xe(te) {
6527
+ const ie = t.activeStrategy({
6527
6528
  element: L,
6528
6529
  oldElement: N,
6529
- event: ee,
6530
+ event: te,
6530
6531
  isExcluded: x
6531
6532
  });
6532
- se && !(se instanceof G) ? Z = se.element ? [se.element] : [] : Z = se ? [se] : [], p.value = Z;
6533
+ ie && !(ie instanceof G) ? Z = ie.element ? [ie.element] : [] : Z = ie ? [ie] : [], p.value = Z;
6533
6534
  }
6534
- function oe() {
6535
+ function ae() {
6535
6536
  d.value !== "selecting" && (d.value = "selecting"), k.value = {
6536
6537
  left: Math.min(j.x, D.x) - z.value.left,
6537
6538
  top: Math.min(j.y, D.y) - z.value.top,
@@ -6540,55 +6541,55 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6540
6541
  }, Z = v(k.value);
6541
6542
  }
6542
6543
  function ve() {
6543
- const ee = t.activeStrategy({
6544
+ const te = t.activeStrategy({
6544
6545
  element: L,
6545
6546
  oldElement: N,
6546
6547
  event: A,
6547
6548
  isExcluded: () => !1
6548
6549
  });
6549
- let se;
6550
- ee && !(ee instanceof G) ? (se = ee.element, he = ee.state) : se = ee, se && (A?.ctrlKey || A?.shiftKey || A?.metaKey) ? p.value.findIndex((ge) => ge.equal(se)) > -1 ? Z = p.value.filter((ge) => !ge.equal(se)) : Z = [...p.value, se] : Z = se ? [se] : [];
6550
+ let ie;
6551
+ te && !(te instanceof G) ? (ie = te.element, he = te.state) : ie = te, ie && (A?.ctrlKey || A?.shiftKey || A?.metaKey) ? p.value.findIndex((ge) => ge.equal(ie)) > -1 ? Z = p.value.filter((ge) => !ge.equal(ie)) : Z = [...p.value, ie] : Z = ie ? [ie] : [];
6551
6552
  }
6552
6553
  function ye() {
6553
6554
  return !U && (Math.abs(D.x - j.x) >= 3 || Math.abs(D.y - j.y) >= 3);
6554
6555
  }
6555
- function J(ee) {
6556
- Y ? ye() && (U = !0, y("startTransform")) : L && !h(L) && ye() && (U = !0, xe(ee), Pe(() => {
6556
+ function J(te) {
6557
+ Y ? ye() && (U = !0, y("startTransform")) : L && !h(L) && ye() && (U = !0, xe(te), Re(() => {
6557
6558
  W || y("startTransform");
6558
6559
  }));
6559
6560
  }
6560
- function me(ee) {
6561
- D = { x: ee.clientX, y: ee.clientY }, Y || (!L || h(L)) && oe();
6561
+ function me(te) {
6562
+ D = { x: te.clientX, y: te.clientY }, Y || (!L || h(L)) && ae();
6562
6563
  }
6563
- async function ce(ee) {
6564
+ async function ue(te) {
6564
6565
  if (d.value && (d.value = void 0), !U) {
6565
6566
  if (L && ve(), p.value = Z, he && Z[0] && !f(Z[0]))
6566
6567
  switch (he) {
6567
6568
  case "typing": {
6568
- await y("startTyping", ee);
6569
+ await y("startTyping", te);
6569
6570
  break;
6570
6571
  }
6571
6572
  }
6572
6573
  w(A);
6573
6574
  }
6574
- i.value.off("pointermove", J), document.removeEventListener("pointermove", me), document.removeEventListener("pointerup", ce), W = !0;
6575
+ i.value.off("pointermove", J), document.removeEventListener("pointermove", me), document.removeEventListener("pointerup", ue), W = !0;
6575
6576
  }
6576
- i.value.on("pointermove", J), document.addEventListener("pointermove", me), document.addEventListener("pointerup", ce);
6577
+ i.value.on("pointermove", J), document.addEventListener("pointermove", me), document.addEventListener("pointerup", ue);
6577
6578
  }
6578
6579
  function M(A) {
6579
- A.srcElement === r.value && ($.value = { x: A.clientX, y: A.clientY }, !(l.value.grabbing || A.button === 1 || d.value && d.value !== "typing") && w(A));
6580
+ A.srcElement === r.value && (I.value = { x: A.clientX, y: A.clientY }, !(c.value.grabbing || A.button === 1 || d.value && d.value !== "typing") && w(A));
6580
6581
  }
6581
6582
  function P() {
6582
- $.value = void 0, u.value = void 0, g(void 0);
6583
+ I.value = void 0, u.value = void 0, g(void 0);
6583
6584
  }
6584
6585
  function B() {
6585
6586
  r.value && (r.value.scrollLeft && (r.value.scrollLeft = 0), r.value.scrollTop && (r.value.scrollTop = 0));
6586
6587
  }
6587
- return (A, N) => (I(), le(ja, { class: "mce-editor" }, {
6588
- default: re(() => [
6588
+ return (A, N) => ($(), oe(ja, { class: "mce-editor" }, {
6589
+ default: ne(() => [
6589
6590
  H(Va),
6590
6591
  H(Xa, null, {
6591
- default: re(() => [
6592
+ default: ne(() => [
6592
6593
  F("div", {
6593
6594
  ref_key: "drawboardDom",
6594
6595
  ref: r,
@@ -6596,7 +6597,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6596
6597
  "data-pixel-ratio": S(i).pixelRatio,
6597
6598
  onDblclick: N[0] || (N[0] = (L) => n("dblclick:drawboard", L)),
6598
6599
  onScroll: B,
6599
- onWheel: N[1] || (N[1] = We(() => {
6600
+ onWheel: N[1] || (N[1] = Ke(() => {
6600
6601
  }, ["prevent"]))
6601
6602
  }, [
6602
6603
  F("canvas", Di, null, 512),
@@ -6610,51 +6611,51 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6610
6611
  "selected-area": k.value,
6611
6612
  "resize-strategy": S(p)[0] ? t.resizeStrategy(S(p)[0]) : void 0
6612
6613
  }, {
6613
- transformable: re(({ box: L }) => [
6614
- te(A.$slots, "transformer", { box: L })
6614
+ transformable: ne(({ box: L }) => [
6615
+ Q(A.$slots, "transformer", { box: L })
6615
6616
  ]),
6616
- default: re(({ box: L }) => [
6617
- te(A.$slots, "selector", { box: L })
6617
+ default: ne(({ box: L }) => [
6618
+ Q(A.$slots, "selector", { box: L })
6618
6619
  ]),
6619
6620
  _: 3
6620
6621
  }, 8, ["selected-area", "resize-strategy"]),
6621
- S(a).scrollbar ? (I(), le($a, { key: 0 })) : Q("", !0),
6622
- A.$slots.floatbar ? (I(), le(ga, {
6622
+ S(a).scrollbar ? ($(), oe($a, { key: 0 })) : ee("", !0),
6623
+ A.$slots.floatbar ? ($(), oe(ga, {
6623
6624
  key: 1,
6624
6625
  target: S(d) === "typing" ? b.value?.textEditor : m.value?.transformable?.$el
6625
6626
  }, {
6626
- default: re(() => [
6627
- te(A.$slots, "floatbar")
6627
+ default: ne(() => [
6628
+ Q(A.$slots, "floatbar")
6628
6629
  ]),
6629
6630
  _: 3
6630
- }, 8, ["target"])) : Q("", !0),
6631
+ }, 8, ["target"])) : ee("", !0),
6631
6632
  H(pa),
6632
6633
  H(xa),
6633
- S(a).ruler ? (I(), le(Ma, { key: 2 })) : Q("", !0),
6634
- te(A.$slots, "drawboard")
6634
+ S(a).ruler ? ($(), oe(Ma, { key: 2 })) : ee("", !0),
6635
+ Q(A.$slots, "drawboard")
6635
6636
  ], 40, Li)
6636
6637
  ]),
6637
6638
  _: 3
6638
6639
  }),
6639
- te(A.$slots, "default"),
6640
- H(Rt, {
6640
+ Q(A.$slots, "default"),
6641
+ H(Bt, {
6641
6642
  modelValue: S(a).statusbar,
6642
6643
  "onUpdate:modelValue": N[2] || (N[2] = (L) => S(a).statusbar = L),
6643
6644
  position: "bottom",
6644
6645
  size: 24
6645
6646
  }, {
6646
- default: re(() => [
6647
+ default: ne(() => [
6647
6648
  H(bi)
6648
6649
  ]),
6649
6650
  _: 1
6650
6651
  }, 8, ["modelValue"]),
6651
- H(Rt, {
6652
+ H(Bt, {
6652
6653
  modelValue: S(a).timeline,
6653
6654
  "onUpdate:modelValue": N[3] || (N[3] = (L) => S(a).timeline = L),
6654
6655
  position: "bottom",
6655
6656
  size: 160
6656
6657
  }, {
6657
- default: re(() => [
6658
+ default: ne(() => [
6658
6659
  H(Bi)
6659
6660
  ]),
6660
6661
  _: 1
@@ -6664,32 +6665,76 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6664
6665
  _: 3
6665
6666
  }));
6666
6667
  }
6668
+ }), ar = /* @__PURE__ */ X({
6669
+ __name: "Dialog",
6670
+ props: /* @__PURE__ */ $e({
6671
+ ...qe()
6672
+ }, {
6673
+ modelValue: { type: Boolean },
6674
+ modelModifiers: {}
6675
+ }),
6676
+ emits: ["update:modelValue"],
6677
+ setup(o, { expose: e }) {
6678
+ const t = o, n = ke(o, "modelValue"), s = ce("overlayTpl"), a = O(() => ({
6679
+ onClick: () => n.value = !0
6680
+ }));
6681
+ function r() {
6682
+ s.value?.updateLocation();
6683
+ }
6684
+ return e({
6685
+ isActive: n,
6686
+ updateLocation: r
6687
+ }), (i, c) => ($(), oe(ot, {
6688
+ ref: "overlayTpl",
6689
+ modelValue: n.value,
6690
+ "onUpdate:modelValue": c[0] || (c[0] = (l) => n.value = l),
6691
+ location: t.location,
6692
+ offset: t.offset,
6693
+ target: t.target,
6694
+ attach: t.attach,
6695
+ class: "mce-dialog"
6696
+ }, {
6697
+ activator: ne((l) => [
6698
+ Q(i.$slots, "activator", Oe(l, {
6699
+ props: { ...l.props, ...a.value }
6700
+ }))
6701
+ ]),
6702
+ default: ne(() => [
6703
+ Q(i.$slots, "default")
6704
+ ]),
6705
+ _: 3
6706
+ }, 8, ["modelValue", "location", "offset", "target", "attach"]));
6707
+ }
6667
6708
  });
6668
6709
  export {
6710
+ ar as Dialog,
6669
6711
  un as Doc,
6670
6712
  Le as Editor,
6671
6713
  sr as EditorLayout,
6672
- Rt as EditorLayoutItem,
6714
+ Bt as EditorLayoutItem,
6673
6715
  mn as IconsSymbol,
6674
- $t as MceComponentIcon,
6716
+ It as MceComponentIcon,
6675
6717
  fn as MceLayoutItemKey,
6676
- Ke as MceLayoutKey,
6677
- Ft as MceMenuSymbol,
6678
- dt as MceOverlaySymbol,
6718
+ Je as MceLayoutKey,
6719
+ Pt as MceMenuSymbol,
6720
+ ht as MceOverlaySymbol,
6679
6721
  dn as MceSvgIcon,
6722
+ ma as Menu,
6680
6723
  ln as Model,
6681
- Et as SUPPORTS_CLIPBOARD,
6724
+ ft as Ruler,
6725
+ Tt as SUPPORTS_CLIPBOARD,
6726
+ Rt as Scrollbar,
6682
6727
  La as Transformable,
6683
- Zt as USER_AGENT,
6684
- tt as Workspace,
6728
+ Qt as USER_AGENT,
6729
+ nt as Workspace,
6685
6730
  Me as boundingBoxToStyle,
6686
6731
  er as consoleError,
6687
6732
  uo as consoleWarn,
6688
- qe as convertToUnit,
6733
+ Ge as convertToUnit,
6689
6734
  Us as createIcons,
6690
- ct as createImageElement,
6735
+ dt as createImageElement,
6691
6736
  ia as createLayout,
6692
- lt as createTextElement,
6737
+ ut as createTextElement,
6693
6738
  Ks as defaultActiveStrategy,
6694
6739
  Js as defaultHoverStrategy,
6695
6740
  Ws as defaultResizeStrategy,
@@ -6699,19 +6744,19 @@ export {
6699
6744
  ho as getImageSizeFromUrl,
6700
6745
  go as getRandomValues,
6701
6746
  cn as iElementToYElements,
6702
- en as imageExtRe,
6703
- Qt as imageExts,
6747
+ ct as imageExtRe,
6748
+ en as imageExts,
6704
6749
  fo as imageMimeTypeExtMap,
6705
6750
  po as isClickInsideElement,
6706
- $e as isMac,
6751
+ Fe as isMac,
6707
6752
  Be as isOverlappingAabb,
6708
6753
  co as isOverlappingObb,
6709
- Ct as isPointInsideAabb,
6754
+ Et as isPointInsideAabb,
6710
6755
  mo as isWindows,
6711
- wt as makeIconProps,
6756
+ _t as makeIconProps,
6712
6757
  na as makeLayoutItemProps,
6713
6758
  ta as makeLayoutProps,
6714
- nt as makeMceOverlayProps,
6759
+ qe as makeMceOverlayProps,
6715
6760
  Gs as makeMceStrategyProps,
6716
6761
  Qi as minBoundingBox,
6717
6762
  os as mixins,