mce 0.2.3 → 0.2.5

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 $, 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 $e, createElementVNode as F, toValue as yn, getCurrentInstance as Qe, onScopeDispose as gn, createElementBlock as R, openBlock as O, 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 Oe, 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 $n, Engine as On, 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
@@ -43,7 +43,7 @@ const eo = (o) => {
43
43
  Vn(e.value, c, u);
44
44
  }
45
45
  function s(c) {
46
- return O({
46
+ return $({
47
47
  get: () => t(c),
48
48
  set: (u) => n(c, u)
49
49
  });
@@ -54,7 +54,7 @@ const eo = (o) => {
54
54
  }
55
55
  function r() {
56
56
  return new Promise((c) => {
57
- const { onChange: u, open: d } = jt({
57
+ const { onChange: u, open: d } = Ut({
58
58
  accept: ".json",
59
59
  reset: !0,
60
60
  multiple: !1
@@ -69,7 +69,7 @@ const eo = (o) => {
69
69
  return new Blob([JSON.stringify(e.value)], { type: "application/json" });
70
70
  }
71
71
  function l(c = "settings.json") {
72
- Wt(
72
+ Kt(
73
73
  i(),
74
74
  c
75
75
  );
@@ -114,7 +114,7 @@ const eo = (o) => {
114
114
  }, oo = (o) => {
115
115
  const {
116
116
  emit: e
117
- } = o, t = fe(new Xn()), n = V(new On({ startTime: 0, endTime: 0, loop: !0, paused: !0 })), s = new $n({
117
+ } = o, t = fe(new Xn()), n = V(new $n({ startTime: 0, endTime: 0, loop: !0, paused: !0 })), s = new On({
118
118
  pixelRatio: 2,
119
119
  fonts: t,
120
120
  timeline: n.value,
@@ -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 l = V(), c = V({ left: 0, top: 0, width: 0, height: 0 }), u = V(), d = V(), g = $(() => 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
144
  x: z - c.value.left,
145
- y: $ - c.value.top
145
+ y: I - c.value.top
146
146
  }, { x: 0, y: 0 });
147
147
  }
148
148
  Object.assign(o, {
@@ -231,7 +231,6 @@ const eo = (o) => {
231
231
  file: "File",
232
232
  new: "New",
233
233
  open: "Open",
234
- preferences: "Preferences",
235
234
  import: "Import",
236
235
  export: "Export",
237
236
  "saveAs:png": "Save as PNG",
@@ -289,16 +288,17 @@ const eo = (o) => {
289
288
  alignRight: "Align right",
290
289
  alignTop: "Align top",
291
290
  alignVerticalCenter: "Align vertical center",
292
- alignBottom: "Align bottom"
291
+ alignBottom: "Align bottom",
292
+ exporting: "Exporting"
293
293
  }, ro = (o, e) => {
294
294
  const {
295
295
  locale: t
296
- } = e, n = O(() => {
296
+ } = e, n = $(() => {
297
297
  const {
298
298
  locale: a,
299
299
  fallback: r,
300
300
  messages: i = {}
301
- } = Kt({
301
+ } = Jt({
302
302
  locale: "en",
303
303
  fallback: "en",
304
304
  messages: {
@@ -322,7 +322,7 @@ const eo = (o) => {
322
322
  const {
323
323
  root: e,
324
324
  getAncestor: t
325
- } = o, n = O(() => e.value?.children.filter(l) ?? []), s = V(-1), a = O(() => n.value[s.value]), r = O(() => {
325
+ } = o, n = $(() => e.value?.children.filter(l) ?? []), s = V(-1), a = $(() => n.value[s.value]), r = $(() => {
326
326
  const { left: u = 0, top: d = 0, width: g = 0, height: h = 0 } = a.value?.style ?? {};
327
327
  return { left: u, top: d, width: g, height: h };
328
328
  }), i = V([]);
@@ -359,7 +359,7 @@ function Me(o) {
359
359
  };
360
360
  return o.rotate && (e.transform = `rotate(${o.rotate}deg)`), e;
361
361
  }
362
- function Ct(o, e) {
362
+ function Et(o, e) {
363
363
  const t = e.left + e.width, n = e.top + e.height;
364
364
  return o.x >= e.left && o.x <= t && o.y >= e.top && o.y <= n;
365
365
  }
@@ -394,7 +394,7 @@ function co(o, e) {
394
394
  return !0;
395
395
  }
396
396
  }
397
- function Qi(o) {
397
+ function Zi(o) {
398
398
  if (o.length < 2)
399
399
  return {
400
400
  left: o[0]?.left ?? 0,
@@ -414,12 +414,12 @@ function Qi(o) {
414
414
  return { left: e.x1, top: e.y1, width: e.x2 - e.x1, height: e.y2 - e.y1 };
415
415
  }
416
416
  function uo(o) {
417
- Bt(`mce: ${o}`);
417
+ Lt(`mce: ${o}`);
418
418
  }
419
- function er(o) {
420
- Bt(`mce error: ${o}`);
419
+ function Qi(o) {
420
+ Lt(`mce error: ${o}`);
421
421
  }
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);
422
+ 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
423
  function ho(o, e = {}) {
424
424
  const { useCrossOrigin: t = !1, timeout: n } = e;
425
425
  return new Promise((s, a) => {
@@ -452,11 +452,11 @@ const fo = {
452
452
  "image/heif": [".heif"],
453
453
  "image/heic": [".heic"],
454
454
  "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;
455
+ }, en = Object.values(fo).flat(), ct = new RegExp(`\\.(?:${en.map((o) => o.substring(1)).join("|")})`, "i");
456
+ function ut(o, e) {
457
+ const t = lt({ style: e, content: o }).boundingBox;
458
458
  return {
459
- id: gt(),
459
+ id: wt(),
460
460
  style: {
461
461
  ...e,
462
462
  width: t.width,
@@ -466,9 +466,9 @@ function lt(o, e) {
466
466
  meta: { inPptIs: "Shape" }
467
467
  };
468
468
  }
469
- async function ct(o) {
469
+ async function dt(o) {
470
470
  return {
471
- id: gt(),
471
+ id: wt(),
472
472
  style: {
473
473
  ...await ho(o)
474
474
  },
@@ -487,14 +487,14 @@ function vo(o) {
487
487
  }
488
488
  return o;
489
489
  }
490
- function qe(o, e = "px") {
490
+ function Ge(o, e = "px") {
491
491
  if (o == null || o === "")
492
492
  return;
493
493
  const t = Number(o);
494
494
  return Number.isNaN(t) ? String(o) : Number.isFinite(t) ? `${t}${e}` : void 0;
495
495
  }
496
496
  function yo() {
497
- const o = Je(), e = (t) => {
497
+ const o = Ze(), e = (t) => {
498
498
  o.value = t;
499
499
  };
500
500
  return Object.defineProperty(e, "value", {
@@ -533,7 +533,7 @@ function tn(o, e) {
533
533
  }, {});
534
534
  }
535
535
  const go = crypto.getRandomValues.bind(crypto), bo = () => go(new Uint32Array(1))[0], wo = "10000000-1000-4000-8000" + -1e11;
536
- function tr() {
536
+ function er() {
537
537
  return wo.replace(/[018]/g, (o) => (o ^ bo() & 15 >> o / 4).toString(16));
538
538
  }
539
539
  const xo = [
@@ -602,18 +602,18 @@ const ko = (o) => {
602
602
  return u ? c = Array.isArray(u.key) ? u.key : [u.key] : c = [l], c[0].split("+").map((d) => {
603
603
  switch (d) {
604
604
  case "Control":
605
- return $e ? "⌃" : "Ctrl";
605
+ return Fe ? "⌃" : "Ctrl";
606
606
  case "Ctrl":
607
- return $e ? "⌃" : "Ctrl";
607
+ return Fe ? "⌃" : "Ctrl";
608
608
  case "Command":
609
- return $e ? "⌘" : mo ? "Win" : "Super";
609
+ return Fe ? "⌘" : mo ? "Win" : "Super";
610
610
  case "Alt":
611
- return $e ? "⌥" : "Alt";
611
+ return Fe ? "⌥" : "Alt";
612
612
  case "Shift":
613
- return $e ? "⇧" : "Shift";
613
+ return Fe ? "⇧" : "Shift";
614
614
  case "CommandOrControl":
615
615
  case "CmdOrCtrl":
616
- return $e ? "⌘" : "Ctrl";
616
+ return Fe ? "⌘" : "Ctrl";
617
617
  default:
618
618
  return r[d] ?? d.charAt(0).toUpperCase() + d.slice(1);
619
619
  }
@@ -629,7 +629,7 @@ const ko = (o) => {
629
629
  const {
630
630
  exec: l
631
631
  } = o;
632
- Ut(
632
+ Xt(
633
633
  An ? window : void 0,
634
634
  "keydown",
635
635
  (c) => {
@@ -666,13 +666,13 @@ const ko = (o) => {
666
666
  root: e,
667
667
  timeline: t,
668
668
  renderEngine: n
669
- } = o, s = V(10), a = O({
669
+ } = o, s = V(10), a = $({
670
670
  get: () => t.value.currentTime,
671
671
  set: (c) => {
672
672
  const { startTime: u, endTime: d } = t.value;
673
673
  t.value.currentTime = Pn(c, u, d);
674
674
  }
675
- }), r = O(() => t.value.startTime), i = O(() => t.value.endTime), l = (c) => {
675
+ }), r = $(() => t.value.startTime), i = $(() => t.value.endTime), l = (c) => {
676
676
  const u = { startTime: 0, endTime: 0 };
677
677
  function d(h) {
678
678
  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;
@@ -692,14 +692,14 @@ const ko = (o) => {
692
692
  async function u() {
693
693
  await n.value.nextTick(), t.value.endTime = e.value ? l(e.value).endTime : 0;
694
694
  }
695
- Yt.on("loaded", u), c("setDoc", u);
695
+ qt.on("loaded", u), c("setDoc", u);
696
696
  };
697
697
  }, Eo = (o, e) => {
698
698
  Object.assign(o, {
699
699
  upload: async (n) => e.upload ? await e.upload(n) : URL.createObjectURL(n)
700
700
  });
701
701
  };
702
- function Tt(...o) {
702
+ function At(...o) {
703
703
  }
704
704
  const To = (o) => {
705
705
  const {
@@ -733,9 +733,9 @@ const To = (o) => {
733
733
  }), 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
734
  if (_ instanceof G) {
735
735
  _.updateGlobalTransform();
736
- const $ = p[z], E = _.toLocal({
737
- x: $.left + $.width / 2,
738
- y: $.top + $.height / 2
736
+ const I = p[z], E = _.toLocal({
737
+ x: I.left + I.width / 2,
738
+ y: I.top + I.height / 2
739
739
  }), C = _.pivot, m = _.style, b = [
740
740
  E.x - C.x,
741
741
  E.y - C.y
@@ -751,7 +751,7 @@ const To = (o) => {
751
751
  h.length === 1 ? y = r(h[0]) : y = { ...l(h), rotate: 0 };
752
752
  else if (h instanceof G) {
753
753
  const f = h.style;
754
- Tt([f.left, f.top, f.width, f.height, f.rotate]);
754
+ At([f.left, f.top, f.width, f.height, f.rotate]);
755
755
  const { rect: p, rotation: _ } = h.getGlobalObb();
756
756
  y = {
757
757
  left: p.left,
@@ -803,7 +803,7 @@ const To = (o) => {
803
803
  }
804
804
  else if (h instanceof G) {
805
805
  const f = h.style;
806
- Tt([f.left, f.top, f.width, f.height, f.rotate]);
806
+ At([f.left, f.top, f.width, f.height, f.rotate]);
807
807
  const p = h.getGlobalAabb();
808
808
  y = {
809
809
  left: p.left,
@@ -831,7 +831,7 @@ const To = (o) => {
831
831
  const v = { ...h }, y = e.value.zoom, f = e.value.position;
832
832
  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
833
  }
834
- const d = O(() => l(t.value?.children ?? [])), g = O(() => l(n.value));
834
+ const d = $(() => l(t.value?.children ?? [])), g = $(() => l(n.value));
835
835
  Object.assign(o, {
836
836
  obbToFit: a,
837
837
  getObb: r,
@@ -940,7 +940,7 @@ const To = (o) => {
940
940
  const u = [];
941
941
  for (const v of t.value.values())
942
942
  v.accept && u.push(v.accept);
943
- const d = u.join(","), { onChange: g, open: h } = jt({
943
+ const d = u.join(","), { onChange: g, open: h } = Ut({
944
944
  accept: d,
945
945
  reset: !0,
946
946
  multiple: l
@@ -962,13 +962,13 @@ const To = (o) => {
962
962
  return "version" in s && "elements" in s && console.log(s), s;
963
963
  }
964
964
  });
965
- }, Oo = (o) => {
965
+ }, $o = (o) => {
966
966
  const {
967
967
  renderEngine: e,
968
968
  rootAabb: t,
969
969
  currentFrameAabb: n,
970
970
  config: s
971
- } = o, a = O(() => s.value.viewMode === "frame" ? n.value : t.value);
971
+ } = o, a = $(() => s.value.viewMode === "frame" ? n.value : t.value);
972
972
  function r(i, l) {
973
973
  function c() {
974
974
  const g = e.value.view;
@@ -1009,7 +1009,7 @@ const To = (o) => {
1009
1009
  }
1010
1010
  pe(() => s.value.viewMode, d), c("setCurrentFrame", d), c("setDoc", d);
1011
1011
  };
1012
- }, $o = (o) => {
1012
+ }, Oo = (o) => {
1013
1013
  const {
1014
1014
  config: e
1015
1015
  } = o;
@@ -1025,7 +1025,7 @@ const To = (o) => {
1025
1025
  u,
1026
1026
  { ...f.parent.style },
1027
1027
  { ...f.parent.parent.style }
1028
- ), f.content)).join(""), { boundingBox: g } = rt({
1028
+ ), f.content)).join(""), { boundingBox: g } = lt({
1029
1029
  style: {
1030
1030
  ...r.style.toJSON(),
1031
1031
  width: "auto"
@@ -1069,7 +1069,7 @@ const To = (o) => {
1069
1069
  c.height = "auto";
1070
1070
  break;
1071
1071
  }
1072
- const { boundingBox: u } = rt({
1072
+ const { boundingBox: u } = lt({
1073
1073
  style: c,
1074
1074
  content: l.text.content
1075
1075
  });
@@ -1140,20 +1140,20 @@ const To = (o) => {
1140
1140
  const W = (j ? b : [b]).map((he) => {
1141
1141
  const Y = e.value.addElement(he, { parentId: x?.id, regenId: A });
1142
1142
  if (x) {
1143
- const { width: xe, height: oe } = x.style, ve = xe / 2, ye = oe / 2;
1143
+ const { width: xe, height: ae } = x.style, ve = xe / 2, ye = ae / 2;
1144
1144
  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;
1145
+ const J = Y.style.width / Y.style.height, me = J > 1 ? ve : ye * J, ue = J > 1 ? ve / J : ye;
1146
1146
  E(
1147
1147
  Y,
1148
1148
  me / Y.style.width,
1149
- ce / Y.style.height,
1149
+ ue / Y.style.height,
1150
1150
  {
1151
1151
  deep: !0,
1152
1152
  textFontSizeToFit: !0
1153
1153
  }
1154
1154
  );
1155
1155
  }
1156
- w && (Y.style.left = Math.round(xe - Y.style.width) / 2, Y.style.top = Math.round(oe - Y.style.height) / 2);
1156
+ w && (Y.style.left = Math.round(xe - Y.style.width) / 2, Y.style.top = Math.round(ae - Y.style.height) / 2);
1157
1157
  } else
1158
1158
  w && (Y.style.top = Math.round(N), Y.style.left = Math.round(L), N += Y.style.height + g.value.frameGap);
1159
1159
  return Y;
@@ -1175,9 +1175,9 @@ const To = (o) => {
1175
1175
  b === f.value[0]?.id && (f.value = []), e.value?.deleteElement(b);
1176
1176
  }
1177
1177
  function z(b, k) {
1178
- $(b)?.setProperties(k);
1178
+ I(b)?.setProperties(k);
1179
1179
  }
1180
- function $(b) {
1180
+ function I(b) {
1181
1181
  return e.value?.nodeMap?.get(b);
1182
1182
  }
1183
1183
  function E(b, k, x, w = {}) {
@@ -1209,7 +1209,7 @@ const To = (o) => {
1209
1209
  addElement: p,
1210
1210
  deleteElement: _,
1211
1211
  updateElement: z,
1212
- getElement: $,
1212
+ getElement: I,
1213
1213
  resizeElement: E,
1214
1214
  pointerActivateElement: C,
1215
1215
  selectArea: m
@@ -1227,7 +1227,7 @@ const To = (o) => {
1227
1227
  config: c
1228
1228
  } = o;
1229
1229
  function u(y = {}, f) {
1230
- const p = qt({
1230
+ const p = Gt({
1231
1231
  ...y,
1232
1232
  id: void 0,
1233
1233
  name: "Frame",
@@ -1274,7 +1274,7 @@ const To = (o) => {
1274
1274
  setCurrentFrame: v
1275
1275
  });
1276
1276
  };
1277
- function Oe(o) {
1277
+ function Ie(o) {
1278
1278
  return new Promise((e, t) => {
1279
1279
  o.onerror = (n) => t(new Error(n.target.error)), o.onsuccess = (n) => e(n.target.result);
1280
1280
  });
@@ -1291,7 +1291,7 @@ function No(o, e) {
1291
1291
  });
1292
1292
  }
1293
1293
  function Ro(o) {
1294
- return Oe(indexedDB.deleteDatabase(o));
1294
+ return Ie(indexedDB.deleteDatabase(o));
1295
1295
  }
1296
1296
  function Bo(o, e) {
1297
1297
  return e.forEach((t) => o.createObjectStore.apply(o, t));
@@ -1301,22 +1301,22 @@ function Ue(o, e, t = "readwrite") {
1301
1301
  return e.map((s) => Yo(n, s));
1302
1302
  }
1303
1303
  function nn(o, e) {
1304
- return Oe(o.count(e));
1304
+ return Ie(o.count(e));
1305
1305
  }
1306
1306
  function Lo(o, e) {
1307
- return Oe(o.get(e));
1307
+ return Ie(o.get(e));
1308
1308
  }
1309
1309
  function on(o, e) {
1310
- return Oe(o.delete(e));
1310
+ return Ie(o.delete(e));
1311
1311
  }
1312
1312
  function Do(o, e, t) {
1313
- return Oe(o.put(e, t));
1313
+ return Ie(o.put(e, t));
1314
1314
  }
1315
- function ut(o, e) {
1316
- return Oe(o.add(e));
1315
+ function mt(o, e) {
1316
+ return Ie(o.add(e));
1317
1317
  }
1318
1318
  function Vo(o, e, t) {
1319
- return Oe(o.getAll(e, t));
1319
+ return Ie(o.getAll(e, t));
1320
1320
  }
1321
1321
  function jo(o, e, t) {
1322
1322
  let n = null;
@@ -1355,15 +1355,15 @@ function qo(o, e) {
1355
1355
  function Go(o, e) {
1356
1356
  return IDBKeyRange.lowerBound(o, e);
1357
1357
  }
1358
- const st = "custom", sn = "updates", an = 500;
1358
+ const at = "custom", sn = "updates", an = 500;
1359
1359
  function rn(o, e, t) {
1360
1360
  const [n] = Ue(
1361
1361
  o.db,
1362
1362
  [sn]
1363
1363
  ), s = Go(o._dbref, !1);
1364
1364
  return Vo(n, s).then((a) => {
1365
- o._destroyed || (e?.(n), ie.transact(o.doc, () => {
1366
- a.forEach((r) => ie.applyUpdate(o.doc, r));
1365
+ o._destroyed || (e?.(n), le.transact(o.doc, () => {
1366
+ a.forEach((r) => le.applyUpdate(o.doc, r));
1367
1367
  }, o, !1), t?.(n));
1368
1368
  }).then(() => Uo(n).then((a) => {
1369
1369
  o._dbref = a + 1;
@@ -1373,7 +1373,7 @@ function rn(o, e, t) {
1373
1373
  }
1374
1374
  function Wo(o, e = !0) {
1375
1375
  return rn(o).then((t) => {
1376
- (e || o._dbsize >= an) && ut(t, ie.encodeStateAsUpdate(o.doc)).then(() => on(
1376
+ (e || o._dbsize >= an) && mt(t, le.encodeStateAsUpdate(o.doc)).then(() => on(
1377
1377
  t,
1378
1378
  qo(o._dbref, !0)
1379
1379
  )).then(() => nn(t).then((n) => {
@@ -1381,7 +1381,7 @@ function Wo(o, e = !0) {
1381
1381
  }));
1382
1382
  });
1383
1383
  }
1384
- class Ko extends Gt {
1384
+ class Ko extends Wt {
1385
1385
  constructor(e, t) {
1386
1386
  super(), this.name = e, this.doc = t, this._db = No(e, (n) => {
1387
1387
  Bo(n, [
@@ -1391,7 +1391,7 @@ class Ko extends Gt {
1391
1391
  }), this.whenSynced = new Promise((n) => this.on("synced", () => n(this))), this._db.then((n) => {
1392
1392
  this.db = n, rn(
1393
1393
  this,
1394
- (s) => ut(s, ie.encodeStateAsUpdate(t)),
1394
+ (s) => mt(s, le.encodeStateAsUpdate(t)),
1395
1395
  () => {
1396
1396
  this._destroyed || (this.synced = !0, this.emit("synced", this));
1397
1397
  }
@@ -1399,7 +1399,7 @@ class Ko extends Gt {
1399
1399
  }), this._storeUpdate = (n, s) => {
1400
1400
  if (this.db && s !== this) {
1401
1401
  const [a] = Ue(this.db, [sn]);
1402
- ut(a, n), ++this._dbsize >= an && (this._storeTimeoutId !== null && clearTimeout(this._storeTimeoutId), this._storeTimeoutId = setTimeout(() => {
1402
+ mt(a, n), ++this._dbsize >= an && (this._storeTimeoutId !== null && clearTimeout(this._storeTimeoutId), this._storeTimeoutId = setTimeout(() => {
1403
1403
  Wo(this, !1), this._storeTimeoutId = null;
1404
1404
  }, this._storeTimeout));
1405
1405
  }
@@ -1427,26 +1427,26 @@ class Ko extends Gt {
1427
1427
  }
1428
1428
  get(e) {
1429
1429
  return this._db.then((t) => {
1430
- const [n] = Ue(t, [st], "readonly");
1430
+ const [n] = Ue(t, [at], "readonly");
1431
1431
  return Lo(n, e);
1432
1432
  });
1433
1433
  }
1434
1434
  set(e, t) {
1435
1435
  return this._db.then((n) => {
1436
- const [s] = Ue(n, [st]);
1436
+ const [s] = Ue(n, [at]);
1437
1437
  return Do(s, t, e);
1438
1438
  });
1439
1439
  }
1440
1440
  del(e) {
1441
1441
  return this._db.then((t) => {
1442
- const [n] = Ue(t, [st]);
1442
+ const [n] = Ue(t, [at]);
1443
1443
  return on(n, e);
1444
1444
  });
1445
1445
  }
1446
1446
  }
1447
1447
  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 = {
1448
+ constructor(e = wt()) {
1449
+ 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
1450
  getProperty: (t) => this._yProps.doc ? this._yProps.get(t) : void 0,
1451
1451
  setProperty: (t, n) => {
1452
1452
  this.transact(() => this._yProps.set(t, n));
@@ -1459,7 +1459,7 @@ class ln extends Un {
1459
1459
  indexeddb;
1460
1460
  _ready = !1;
1461
1461
  _setupUndoManager(e = []) {
1462
- const t = fe(new ie.UndoManager([
1462
+ const t = fe(new le.UndoManager([
1463
1463
  this._yProps,
1464
1464
  ...e
1465
1465
  ], {
@@ -1521,23 +1521,23 @@ var Jo = Object.defineProperty, Zo = (o, e, t, n) => {
1521
1521
  return s && Jo(e, t, s), s;
1522
1522
  };
1523
1523
  function Qo(o, e = {}, t, n = !1) {
1524
- const s = qt({
1524
+ const s = Gt({
1525
1525
  ...e,
1526
1526
  id: n ? void 0 : e.id,
1527
1527
  meta: {
1528
1528
  inCanvasIs: "Element2D",
1529
1529
  ...e?.meta ?? {}
1530
1530
  }
1531
- }), a = s.id, r = new ie.Array();
1531
+ }), a = s.id, r = new le.Array();
1532
1532
  for (const i in s)
1533
1533
  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 ?? {})))), {
1534
+ 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
1535
  normalized: s,
1536
1536
  yChildrenIds: r
1537
1537
  };
1538
1538
  }
1539
1539
  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;
1540
+ const n = [], s = new le.Map(), { normalized: a, yChildrenIds: r } = Qo(s, o, e, t), i = a.id;
1541
1541
  return n.push({ id: i, element: s }), a.children?.forEach((l) => {
1542
1542
  const c = cn(l, i, t);
1543
1543
  r.push([c[0].id]), n.push(...c);
@@ -1546,7 +1546,7 @@ function cn(o, e, t = !1) {
1546
1546
  class un extends ln {
1547
1547
  _yChildren;
1548
1548
  _yChildrenIds;
1549
- root = Ce(new kt());
1549
+ root = Ee(new Ct());
1550
1550
  nodeMap = /* @__PURE__ */ new Map();
1551
1551
  get meta() {
1552
1552
  return this.root.meta;
@@ -1572,7 +1572,7 @@ class un extends ln {
1572
1572
  }
1573
1573
  async load(e) {
1574
1574
  return super.load(async () => {
1575
- await e?.(), this._yChildren.size || (this.init(), await Pe()), this._proxyProps(this.root, this._yProps);
1575
+ await e?.(), this._yChildren.size || (this.init(), await Re()), this._proxyProps(this.root, this._yProps);
1576
1576
  const t = this._yProps.get("meta");
1577
1577
  t && this._proxyProps(this.root.meta, t, !0), this._proxyChildren(this.root, this._yChildrenIds), this._yChildrenIds.forEach((n) => {
1578
1578
  const s = this._yChildren.get(n);
@@ -1583,9 +1583,12 @@ class un extends ln {
1583
1583
  _isSelfTransaction(e) {
1584
1584
  return !e.origin || e.origin === this._yDoc.clientID;
1585
1585
  }
1586
+ _debug(...e) {
1587
+ }
1586
1588
  _onChildrenChange(e, t) {
1587
1589
  if (this._isSelfTransaction(t))
1588
1590
  return;
1591
+ this._debug("_onChildrenChange", e);
1589
1592
  const { keysChanged: n, changes: s } = e;
1590
1593
  n.forEach((a) => {
1591
1594
  const r = s.keys.get(a), i = this._yChildren.get(a);
@@ -1633,7 +1636,7 @@ class un extends ln {
1633
1636
  }
1634
1637
  set(e) {
1635
1638
  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;
1639
+ return this.reset(), this.addElements(t), this.setProperties(s), this._yProps.set("meta", new le.Map(Object.entries(n))), this;
1637
1640
  }
1638
1641
  _deleteElement(e) {
1639
1642
  const t = this.nodeMap.get(e), n = this._yChildren.get(e);
@@ -1678,7 +1681,7 @@ class un extends ln {
1678
1681
  }
1679
1682
  e.setPropertyAccessor(s);
1680
1683
  const a = (r, i) => {
1681
- this._isSelfTransaction(i) || this.transact(() => {
1684
+ this._isSelfTransaction(i) || (this._debug("_proxyProps", r, e), this.transact(() => {
1682
1685
  const { keysChanged: l, changes: c } = r;
1683
1686
  l.forEach((u) => {
1684
1687
  const d = c.keys.get(u), g = d?.oldValue;
@@ -1688,11 +1691,11 @@ class un extends ln {
1688
1691
  this.undoManager.stopCapturing(), e[u] = t.get(u), e.requestUpdate(u, t.get(u), g);
1689
1692
  break;
1690
1693
  case "delete":
1691
- this.undoManager.stopCapturing(), e[u] = void 0, e.requestUpdate(u, void 0, g);
1694
+ this.undoManager.stopCapturing(), e[u] = void 0, e.requestUpdate(u, e[u], g);
1692
1695
  break;
1693
1696
  }
1694
1697
  });
1695
- }, !1);
1698
+ }, !1));
1696
1699
  };
1697
1700
  e._yMap = fe(t), e._yMapObserveFn && t.unobserve(e._yMapObserveFn), e._yMapObserveFn = fe(a), t.observe(a);
1698
1701
  }
@@ -1704,6 +1707,7 @@ class un extends ln {
1704
1707
  const n = (s, a) => {
1705
1708
  if (this._isSelfTransaction(a))
1706
1709
  return;
1710
+ this._debug("_proxyChildren", s, e);
1707
1711
  const r = e.children;
1708
1712
  let i = 0;
1709
1713
  s.changes.delta.forEach((l) => {
@@ -1746,8 +1750,8 @@ class un extends ln {
1746
1750
  _getOrCreateNode(e) {
1747
1751
  const t = e.get("id");
1748
1752
  let n = this.nodeMap.get(t);
1749
- return n || (this.undoManager.addToScope(e), n = Ce(
1750
- kt.parse({
1753
+ return n || (this.undoManager.addToScope(e), n = Ee(
1754
+ Ct.parse({
1751
1755
  meta: {
1752
1756
  inCanvasIs: e.get("meta")?.get("inCanvasIs")
1753
1757
  }
@@ -1764,12 +1768,12 @@ class un extends ln {
1764
1768
  Zo([
1765
1769
  Ye({ default: "doc" })
1766
1770
  ], un.prototype, "name");
1767
- var es = Object.defineProperty, et = (o, e, t, n) => {
1771
+ var es = Object.defineProperty, tt = (o, e, t, n) => {
1768
1772
  for (var s = void 0, a = o.length - 1, r; a >= 0; a--)
1769
1773
  (r = o[a]) && (s = r(e, t, s) || s);
1770
1774
  return s && es(e, t, s), s;
1771
1775
  };
1772
- class tt extends ln {
1776
+ class nt extends ln {
1773
1777
  docs = /* @__PURE__ */ new Map();
1774
1778
  set(e = {}) {
1775
1779
  return super.reset(), this.setProperties(e), this;
@@ -1780,18 +1784,18 @@ class tt extends ln {
1780
1784
  return this.docs.set(e.id, e), e;
1781
1785
  }
1782
1786
  }
1783
- et([
1787
+ tt([
1784
1788
  Ye()
1785
- ], tt.prototype, "name");
1786
- et([
1789
+ ], nt.prototype, "name");
1790
+ tt([
1787
1791
  Ye()
1788
- ], tt.prototype, "type");
1789
- et([
1792
+ ], nt.prototype, "type");
1793
+ tt([
1790
1794
  Ye()
1791
- ], tt.prototype, "createdAt");
1792
- et([
1795
+ ], nt.prototype, "createdAt");
1796
+ tt([
1793
1797
  Ye()
1794
- ], tt.prototype, "updatedAt");
1798
+ ], nt.prototype, "updatedAt");
1795
1799
  const ts = (o, e) => {
1796
1800
  const {
1797
1801
  workspace: t,
@@ -1819,7 +1823,7 @@ const ts = (o, e) => {
1819
1823
  console.error(z);
1820
1824
  }
1821
1825
  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", _);
1826
+ }), _.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
1827
  } finally {
1824
1828
  l.value = void 0;
1825
1829
  }
@@ -1859,7 +1863,7 @@ const ts = (o, e) => {
1859
1863
  async function u(h) {
1860
1864
  await o.waitUntilFontLoad();
1861
1865
  let v;
1862
- return h instanceof G ? v = h.toJSON() : v = { ...h }, v.style ??= {}, v.style.top = 0, v.style.left = 0, await Qe({
1866
+ return h instanceof G ? v = h.toJSON() : v = { ...h }, v.style ??= {}, v.style.top = 0, v.style.left = 0, await et({
1863
1867
  width: v.style.width,
1864
1868
  height: v.style.height,
1865
1869
  fonts: i,
@@ -1887,12 +1891,12 @@ const ts = (o, e) => {
1887
1891
  p.fillStyle = "rgba(0, 0, 0, 0)", p.clearRect(0, 0, h.width, h.height);
1888
1892
  const { zoom: _, position: z } = s.value;
1889
1893
  h.width = y.width, h.height = y.height;
1890
- const $ = y.width * _.x, E = y.height * _.y;
1894
+ const I = y.width * _.x, E = y.height * _.y;
1891
1895
  p.drawImage(
1892
1896
  v,
1893
1897
  (y.left * _.x + z.x) * f,
1894
1898
  (y.top * _.x + z.y) * f,
1895
- $ * f,
1899
+ I * f,
1896
1900
  E * f,
1897
1901
  0,
1898
1902
  0,
@@ -1944,8 +1948,8 @@ const ts = (o, e) => {
1944
1948
  So,
1945
1949
  Mo,
1946
1950
  zo,
1947
- Oo,
1948
1951
  $o,
1952
+ Oo,
1949
1953
  Io,
1950
1954
  Fo,
1951
1955
  Po,
@@ -1955,13 +1959,13 @@ const ts = (o, e) => {
1955
1959
  function ss(o, e) {
1956
1960
  return o < e ? -1 : o === e ? 0 : 1;
1957
1961
  }
1958
- function at(o, e) {
1962
+ function it(o, e) {
1959
1963
  return o === e;
1960
1964
  }
1961
- function Fe(o) {
1965
+ function Ne(o) {
1962
1966
  return typeof o > "u";
1963
1967
  }
1964
- class bt {
1968
+ class xt {
1965
1969
  /**
1966
1970
  * First node in the list
1967
1971
  * @type {Object}
@@ -1997,7 +2001,7 @@ class bt {
1997
2001
  * or if the element is undefined.
1998
2002
  */
1999
2003
  add(e, t) {
2000
- if (Fe(t) && (t = this.nElements), t < 0 || t > this.nElements || Fe(e))
2004
+ if (Ne(t) && (t = this.nElements), t < 0 || t > this.nElements || Ne(e))
2001
2005
  return !1;
2002
2006
  const n = this.createNode(e);
2003
2007
  if (this.nElements === 0 || this.lastNode === null)
@@ -2064,8 +2068,8 @@ class bt {
2064
2068
  * element.
2065
2069
  */
2066
2070
  indexOf(e, t) {
2067
- const n = t || at;
2068
- if (Fe(e))
2071
+ const n = t || it;
2072
+ if (Ne(e))
2069
2073
  return -1;
2070
2074
  let s = this.firstNode, a = 0;
2071
2075
  for (; s !== null; ) {
@@ -2112,8 +2116,8 @@ class bt {
2112
2116
  * @return {boolean} true if the list contained the specified element.
2113
2117
  */
2114
2118
  remove(e, t) {
2115
- const n = t || at;
2116
- if (this.nElements < 1 || Fe(e))
2119
+ const n = t || it;
2120
+ if (this.nElements < 1 || Ne(e))
2117
2121
  return !1;
2118
2122
  let s = null, a = this.firstNode;
2119
2123
  for (; a !== null; ) {
@@ -2140,8 +2144,8 @@ class bt {
2140
2144
  * @return {boolean} true if this list is equal to the given list.
2141
2145
  */
2142
2146
  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);
2147
+ const n = t || it;
2148
+ return !(e instanceof xt) || this.size() !== e.size() ? !1 : this.equalsAux(this.firstNode, e.firstNode, n);
2145
2149
  }
2146
2150
  /**
2147
2151
  * @private
@@ -2260,7 +2264,7 @@ class as {
2260
2264
  * @constructor
2261
2265
  */
2262
2266
  constructor() {
2263
- this.list = new bt();
2267
+ this.list = new xt();
2264
2268
  }
2265
2269
  /**
2266
2270
  * Inserts the specified element into the end of this queue.
@@ -2397,7 +2401,7 @@ class is {
2397
2401
  * @return {boolean} true if this tree did not already contain the specified element.
2398
2402
  */
2399
2403
  add(e) {
2400
- return Fe(e) ? !1 : this.insertNode(this.createNode(e)) !== null ? (this.nElements++, !0) : !1;
2404
+ return Ne(e) ? !1 : this.insertNode(this.createNode(e)) !== null ? (this.nElements++, !0) : !1;
2401
2405
  }
2402
2406
  /**
2403
2407
  * Removes all of the elements from this tree.
@@ -2426,7 +2430,7 @@ class is {
2426
2430
  * false otherwise.
2427
2431
  */
2428
2432
  contains(e) {
2429
- return Fe(e) ? !1 : this.searchNode(this.root, e) !== null;
2433
+ return Ne(e) ? !1 : this.searchNode(this.root, e) !== null;
2430
2434
  }
2431
2435
  /**
2432
2436
  * 搜索元素
@@ -2663,12 +2667,12 @@ class is {
2663
2667
  };
2664
2668
  }
2665
2669
  }
2666
- class At extends is {
2670
+ class St extends is {
2667
2671
  }
2668
- function Ie(o, e, t) {
2672
+ function Pe(o, e, t) {
2669
2673
  return { pos: o, type: e, box: t };
2670
2674
  }
2671
- function Ge(o) {
2675
+ function We(o) {
2672
2676
  const e = "box" in o ? o.box : o;
2673
2677
  return {
2674
2678
  left: e.hl.pos,
@@ -2677,10 +2681,10 @@ function Ge(o) {
2677
2681
  height: e.vb.pos - e.vt.pos
2678
2682
  };
2679
2683
  }
2680
- function St(o) {
2684
+ function Mt(o) {
2681
2685
  return o === "vt" ? "vb" : o === "vb" ? "vt" : o === "hl" ? "hr" : o === "hr" ? "hl" : o;
2682
2686
  }
2683
- function it(o) {
2687
+ function rt(o) {
2684
2688
  return ["vt", "hl"].includes(o.type);
2685
2689
  }
2686
2690
  const rs = (o) => {
@@ -2696,38 +2700,38 @@ const rs = (o) => {
2696
2700
  return;
2697
2701
  const C = {};
2698
2702
  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;
2703
+ 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
2704
  }
2701
- const i = O(() => 4), l = O(() => new Set(
2705
+ const i = $(() => 4), l = $(() => new Set(
2702
2706
  [
2703
2707
  t.value[0]?.instanceId
2704
2708
  ].filter(Boolean)
2705
- )), c = O(() => {
2709
+ )), c = $(() => {
2706
2710
  if (t.value[0])
2707
2711
  return r(t.value[0]);
2708
- }), u = O(() => {
2712
+ }), u = $(() => {
2709
2713
  const E = t.value[0].parent;
2710
2714
  return E instanceof G ? E : void 0;
2711
- }), d = O(() => r(
2715
+ }), d = $(() => r(
2712
2716
  u.value ?? { left: 0, top: 0, width: 0, height: 0 }
2713
- )), g = O(() => {
2717
+ )), g = $(() => {
2714
2718
  const E = [
2715
2719
  ...u.value?.children ?? a.value?.children ?? []
2716
2720
  ];
2717
2721
  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
- }), h = O(() => g.value.reduce(
2722
+ }), h = $(() => g.value.reduce(
2719
2723
  (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
2724
  {
2721
- vLines: new At((E, C) => E.pos - C.pos),
2722
- hLines: new At((E, C) => E.pos - C.pos)
2725
+ vLines: new St((E, C) => E.pos - C.pos),
2726
+ hLines: new St((E, C) => E.pos - C.pos)
2723
2727
  }
2724
2728
  ));
2725
2729
  function v(E) {
2726
2730
  return E.box?.id === -1;
2727
2731
  }
2728
2732
  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);
2733
+ const m = ["vt", "vb"].includes(C.type) ? "vertical" : "horizontal", b = m === "vertical" ? "horizontal" : "vertical", k = rt(C);
2734
+ let x = Mt(C.type);
2731
2735
  if (k) {
2732
2736
  if (C.pos > d.value[x].pos)
2733
2737
  return [];
@@ -2744,14 +2748,14 @@ const rs = (o) => {
2744
2748
  } else if (C.pos > P.pos)
2745
2749
  return;
2746
2750
  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)));
2751
+ 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
2752
  };
2749
2753
  return k ? E.outorderTraversal(M) : E.inorderTraversal(M), w;
2750
2754
  }
2751
2755
  function f(E, C) {
2752
2756
  if (!E.length)
2753
2757
  return [];
2754
- const m = it(C), b = E[0].pos;
2758
+ const m = rt(C), b = E[0].pos;
2755
2759
  let k = Math.abs(C.pos - b);
2756
2760
  const x = [];
2757
2761
  E = [C].concat(E);
@@ -2773,7 +2777,7 @@ const rs = (o) => {
2773
2777
  pos: m ? b + k : b - k
2774
2778
  }, x);
2775
2779
  }
2776
- const p = O(() => {
2780
+ const p = $(() => {
2777
2781
  if (!c.value)
2778
2782
  return [];
2779
2783
  const { vLines: E, hLines: C } = h.value, m = c.value, b = { vt: [], vb: [], hl: [], hr: [] }, k = [];
@@ -2802,7 +2806,7 @@ const rs = (o) => {
2802
2806
  if (T && P && (!v(T) || !v(P))) {
2803
2807
  const A = Math.abs(M.pos - T.pos), N = Math.abs(B.pos - P.pos);
2804
2808
  if (Math.abs(A - N) < i.value) {
2805
- const L = it(M);
2809
+ const L = rt(M);
2806
2810
  k.push({
2807
2811
  target: T,
2808
2812
  source: M,
@@ -2829,7 +2833,7 @@ const rs = (o) => {
2829
2833
  }
2830
2834
  }
2831
2835
  }), k;
2832
- }), _ = (E) => E, z = O(() => {
2836
+ }), _ = (E) => E, z = $(() => {
2833
2837
  if (n.value !== "transforming")
2834
2838
  return [];
2835
2839
  const E = { left: 0, top: 0 };
@@ -2880,7 +2884,7 @@ const rs = (o) => {
2880
2884
  return M;
2881
2885
  });
2882
2886
  });
2883
- function $(E = !1) {
2887
+ function I(E = !1) {
2884
2888
  const C = [], m = [];
2885
2889
  for (const b of p.value) {
2886
2890
  const { target: k, source: x, type: w } = b, T = k.box, M = x.box;
@@ -2901,7 +2905,7 @@ const rs = (o) => {
2901
2905
  }
2902
2906
  return Object.assign(o, {
2903
2907
  auxiliaryLines: z,
2904
- getAdsorptionPoints: $
2908
+ getAdsorptionPoints: I
2905
2909
  }), {
2906
2910
  name: "mce:auxiliary"
2907
2911
  };
@@ -2914,7 +2918,7 @@ const rs = (o) => {
2914
2918
  } = o, a = V();
2915
2919
  async function r() {
2916
2920
  const u = e.value.length === 1 ? [e.value[0].toJSON()] : e.value.map((d) => d.toJSON());
2917
- if (Et) {
2921
+ if (Tt) {
2918
2922
  const d = "text/html";
2919
2923
  await navigator.clipboard.write([
2920
2924
  new ClipboardItem({
@@ -2930,7 +2934,7 @@ const rs = (o) => {
2930
2934
  await r(), t("delete");
2931
2935
  }
2932
2936
  async function l() {
2933
- if (Et) {
2937
+ if (Tt) {
2934
2938
  const u = await navigator.clipboard.read(), d = [];
2935
2939
  for (const g of u)
2936
2940
  for (const h of g.types) {
@@ -2940,7 +2944,7 @@ const rs = (o) => {
2940
2944
  else
2941
2945
  switch (v.type) {
2942
2946
  case "text/plain":
2943
- d.push(lt(await v.text()));
2947
+ d.push(ut(await v.text()));
2944
2948
  break;
2945
2949
  case "text/html": {
2946
2950
  const y = new DOMParser().parseFromString(await v.text(), "text/html"), f = y.querySelector("mce-clipboard");
@@ -2955,7 +2959,7 @@ const rs = (o) => {
2955
2959
  new Uint8Array(
2956
2960
  atob(
2957
2961
  p.getAttribute("data-clipboard")?.replace(/\s+/g, "") ?? ""
2958
- ).split("").map(($) => $.charCodeAt(0))
2962
+ ).split("").map((I) => I.charCodeAt(0))
2959
2963
  )
2960
2964
  )
2961
2965
  ), z = new Blob([_], {
@@ -3114,14 +3118,14 @@ const rs = (o) => {
3114
3118
  fonts: t,
3115
3119
  to: n
3116
3120
  } = o, s = e.gifWorkerUrl;
3117
- return Yt.gifWorkerUrl = s, {
3121
+ return qt.gifWorkerUrl = s, {
3118
3122
  name: "mce:gif",
3119
3123
  exporters: [
3120
3124
  {
3121
3125
  name: "gif",
3122
3126
  handle: async (a) => {
3123
3127
  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({
3128
+ return await et({
3125
3129
  data: c,
3126
3130
  width: g,
3127
3131
  height: h,
@@ -3233,7 +3237,7 @@ const rs = (o) => {
3233
3237
  to: s,
3234
3238
  fonts: a,
3235
3239
  upload: r
3236
- } = o, i = async (u, d) => n(await ct(u), {
3240
+ } = o, i = async (u, d) => n(await dt(u), {
3237
3241
  sizeToFit: !0,
3238
3242
  positionToFit: !0,
3239
3243
  ...d
@@ -3249,7 +3253,7 @@ const rs = (o) => {
3249
3253
  return {
3250
3254
  name: u,
3251
3255
  handle: async (d) => {
3252
- const g = await s("json", d), h = await Qe({
3256
+ const g = await s("json", d), h = await et({
3253
3257
  data: g,
3254
3258
  fonts: a,
3255
3259
  width: g.style.width,
@@ -3278,9 +3282,9 @@ const rs = (o) => {
3278
3282
  loaders: [
3279
3283
  {
3280
3284
  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))
3285
+ accept: en.join(","),
3286
+ test: (u) => !!(u instanceof Blob && u.type.startsWith("image/") || u instanceof File && ct.test(u.name)),
3287
+ load: async (u) => await dt(await r(u))
3284
3288
  }
3285
3289
  ]
3286
3290
  };
@@ -3444,7 +3448,7 @@ const rs = (o) => {
3444
3448
  selection: s,
3445
3449
  textSelection: a,
3446
3450
  config: r
3447
- } = o, i = O(() => s.value.length > 0), l = O(() => ({
3451
+ } = o, i = $(() => s.value.length > 0), l = $(() => ({
3448
3452
  key: "export",
3449
3453
  children: [
3450
3454
  { key: "saveAs:png" },
@@ -3457,27 +3461,25 @@ const rs = (o) => {
3457
3461
  { key: "saveAs:pptx" },
3458
3462
  { key: "saveAs:json" }
3459
3463
  ]
3460
- })), c = O(() => ({
3464
+ })), c = $(() => ({
3461
3465
  key: "file",
3462
3466
  children: [
3463
3467
  { key: "new" },
3464
3468
  { key: "open" },
3465
3469
  { type: "divider" },
3466
3470
  { key: "import" },
3467
- l.value,
3468
- { type: "divider" },
3469
- { key: "preferences" }
3471
+ l.value
3470
3472
  ]
3471
- })), u = O(() => [
3473
+ })), u = $(() => [
3472
3474
  { key: "undo", disabled: !e.value },
3473
3475
  { key: "redo", disabled: !t.value }
3474
- ]), d = O(() => [
3476
+ ]), d = $(() => [
3475
3477
  { key: "copy", disabled: !i.value },
3476
3478
  { key: "cut", disabled: !i.value },
3477
3479
  { key: "paste", disabled: !n.value },
3478
3480
  { key: "duplicate", disabled: !i.value },
3479
3481
  { key: "delete", disabled: !i.value }
3480
- ]), g = O(() => ({
3482
+ ]), g = $(() => ({
3481
3483
  key: "select",
3482
3484
  children: [
3483
3485
  { key: "selectAll" },
@@ -3486,7 +3488,7 @@ const rs = (o) => {
3486
3488
  { key: "previousSelection", disabled: !i.value },
3487
3489
  { key: "nextSelection", disabled: !i.value }
3488
3490
  ]
3489
- })), h = O(() => ({
3491
+ })), h = $(() => ({
3490
3492
  key: "edit",
3491
3493
  children: [
3492
3494
  ...u.value,
@@ -3495,7 +3497,7 @@ const rs = (o) => {
3495
3497
  { type: "divider" },
3496
3498
  ...g.value.children
3497
3499
  ]
3498
- })), v = O(() => ({
3500
+ })), v = $(() => ({
3499
3501
  key: "zoom",
3500
3502
  children: [
3501
3503
  { key: "zoomIn" },
@@ -3504,7 +3506,7 @@ const rs = (o) => {
3504
3506
  { key: "zoomToFit" },
3505
3507
  { key: "zoomToSelection", disabled: !i.value }
3506
3508
  ]
3507
- })), y = O(() => ({
3509
+ })), y = $(() => ({
3508
3510
  key: "view",
3509
3511
  children: [
3510
3512
  { key: "view:checkerboard", checked: r.value.checkerboard },
@@ -3517,10 +3519,10 @@ const rs = (o) => {
3517
3519
  { type: "divider" },
3518
3520
  ...v.value.children
3519
3521
  ]
3520
- })), f = O(() => [
3522
+ })), f = $(() => [
3521
3523
  { key: "group/ungroup", disabled: !i.value },
3522
3524
  { key: "frame/unframe", disabled: !i.value }
3523
- ]), p = O(() => ({
3525
+ ]), p = $(() => ({
3524
3526
  key: "layerOrder",
3525
3527
  children: [
3526
3528
  { key: "bringToFront", disabled: !i.value },
@@ -3528,16 +3530,16 @@ const rs = (o) => {
3528
3530
  { key: "sendBackward", disabled: !i.value },
3529
3531
  { key: "sendToBack", disabled: !i.value }
3530
3532
  ]
3531
- })), _ = O(() => ({
3533
+ })), _ = $(() => ({
3532
3534
  key: "flip",
3533
3535
  children: [
3534
3536
  { key: "flipHorizontal", disabled: !i.value },
3535
3537
  { key: "flipVertical", disabled: !i.value }
3536
3538
  ]
3537
- })), z = O(() => [
3539
+ })), z = $(() => [
3538
3540
  { key: "hide/show", disabled: !i.value },
3539
3541
  { key: "lock/unlock", disabled: !i.value }
3540
- ]), $ = O(() => ({
3542
+ ]), I = $(() => ({
3541
3543
  key: "object",
3542
3544
  children: [
3543
3545
  ...f.value,
@@ -3548,25 +3550,25 @@ const rs = (o) => {
3548
3550
  { type: "divider" },
3549
3551
  ...z.value
3550
3552
  ]
3551
- })), E = O(() => [
3553
+ })), E = $(() => [
3552
3554
  { key: "alignLeft", disabled: !i.value },
3553
3555
  { key: "alignHorizontalCenter", disabled: !i.value },
3554
3556
  { key: "alignRight", disabled: !i.value },
3555
3557
  { key: "alignTop", disabled: !i.value },
3556
3558
  { key: "alignVerticalCenter", disabled: !i.value },
3557
3559
  { key: "alignBottom", disabled: !i.value }
3558
- ]), C = O(() => ({
3560
+ ]), C = $(() => ({
3559
3561
  key: "layerPosition",
3560
3562
  children: [
3561
3563
  ...E.value
3562
3564
  ]
3563
- })), m = O(() => [
3565
+ })), m = $(() => [
3564
3566
  c.value,
3565
3567
  h.value,
3566
3568
  y.value,
3567
- $.value,
3569
+ I.value,
3568
3570
  C.value
3569
- ]), b = O(() => s.value.length > 0 ? a.value ? [
3571
+ ]), b = $(() => s.value.length > 0 ? a.value ? [
3570
3572
  ...d.value
3571
3573
  ] : [
3572
3574
  ...d.value,
@@ -3663,20 +3665,20 @@ const rs = (o) => {
3663
3665
  throw new Error("Failed to parse encoding configuration");
3664
3666
  const _ = new s(h);
3665
3667
  let z = 1;
3666
- return await Qe({
3668
+ return await et({
3667
3669
  data: i,
3668
3670
  width: u,
3669
3671
  height: d,
3670
3672
  fonts: e,
3671
- onFrame: async ($, { duration: E, progress: C }) => {
3672
- const m = await createImageBitmap(new ImageData($, u, d));
3673
+ onFrame: async (I, { duration: E, progress: C }) => {
3674
+ const m = await createImageBitmap(new ImageData(I, u, d));
3673
3675
  await _.encode({
3674
3676
  data: m,
3675
3677
  timestamp: z,
3676
3678
  duration: E
3677
3679
  }), m.close(), z += E, a?.(C);
3678
3680
  },
3679
- keyframes: Array.from({ length: ~~((c - l) / v) }, ($, E) => l + E * v)
3681
+ keyframes: Array.from({ length: ~~((c - l) / v) }, (I, E) => l + E * v)
3680
3682
  }), await _.flush();
3681
3683
  }
3682
3684
  }
@@ -3792,11 +3794,11 @@ const rs = (o) => {
3792
3794
  presetShapeDefinitions: c,
3793
3795
  upload: async (d, g) => {
3794
3796
  const h = g.image;
3795
- let v = zt(g.image);
3797
+ let v = $t(g.image);
3796
3798
  const y = As(d);
3797
3799
  if (!v) {
3798
3800
  const f = Ss(y);
3799
- f && (v = zt(f));
3801
+ f && (v = $t(f));
3800
3802
  }
3801
3803
  return await t(
3802
3804
  new File([y], h, {
@@ -3815,7 +3817,7 @@ const rs = (o) => {
3815
3817
  }
3816
3818
  ]
3817
3819
  };
3818
- }, Mt = {
3820
+ }, zt = {
3819
3821
  jpeg: "image/jpeg",
3820
3822
  jpg: "image/jpeg",
3821
3823
  png: "image/png",
@@ -3826,9 +3828,9 @@ const rs = (o) => {
3826
3828
  emf: "image/emf",
3827
3829
  wmf: "image/wmf"
3828
3830
  };
3829
- function zt(o) {
3831
+ function $t(o) {
3830
3832
  const e = o.split("."), t = e[e.length - 1].toLowerCase();
3831
- return t in Mt ? Mt[t] : null;
3833
+ return t in zt ? zt[t] : null;
3832
3834
  }
3833
3835
  function As(o) {
3834
3836
  const e = atob(o), t = e.length, n = new ArrayBuffer(t), s = new Uint8Array(n);
@@ -3867,42 +3869,27 @@ function Ss(o) {
3867
3869
  }
3868
3870
  }
3869
3871
  const Ms = (o) => {
3870
- const e = V(!1);
3871
- function t() {
3872
- e.value = !e.value;
3873
- }
3874
- return Object.assign(o, {
3875
- preferencesVisible: e
3876
- }), {
3877
- name: "mce:preferences",
3878
- commands: [
3879
- { command: "preferences", handle: t }
3880
- ],
3881
- hotkeys: [
3882
- { command: "preferences", key: "CmdOrCtrl+,", editable: !1, system: !0 }
3883
- ]
3884
- };
3885
- }, zs = (o) => {
3886
3872
  const {
3887
- to: e
3873
+ to: e,
3874
+ root: t
3888
3875
  } = o;
3889
3876
  return {
3890
3877
  name: "mce:saveAs",
3891
3878
  commands: [
3892
- { command: "saveAs", handle: async (n, s = {}) => {
3879
+ { command: "saveAs", handle: async (s, a = {}) => {
3893
3880
  const {
3894
- filename: a = "download",
3895
- ...r
3896
- } = s;
3897
- let i = await e(n, {
3881
+ filename: r = t.value?.meta.name ?? "download",
3882
+ ...i
3883
+ } = a;
3884
+ let l = await e(s, {
3898
3885
  selected: !0,
3899
- ...r
3886
+ ...i
3900
3887
  });
3901
- i instanceof Blob || (i = new Blob([JSON.stringify(i)], { type: "application/json" })), Wt(i, `${a}.${n}`);
3888
+ l instanceof Blob || (l = new Blob([JSON.stringify(l)], { type: "application/json" })), Kt(l, `${r}.${s}`);
3902
3889
  } }
3903
3890
  ]
3904
3891
  };
3905
- }, Os = (o) => {
3892
+ }, zs = (o) => {
3906
3893
  const {
3907
3894
  selection: e,
3908
3895
  root: t
@@ -3956,7 +3943,7 @@ const Ms = (o) => {
3956
3943
  addElement: s
3957
3944
  } = o, a = (l = t("clickEditText"), c = {}) => {
3958
3945
  const { style: u, ...d } = c;
3959
- return s(lt(l, u), {
3946
+ return s(ut(l, u), {
3960
3947
  sizeToFit: !0,
3961
3948
  positionToFit: !0,
3962
3949
  ...d
@@ -3980,11 +3967,11 @@ const Ms = (o) => {
3980
3967
  name: "txt",
3981
3968
  accept: ".txt",
3982
3969
  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())
3970
+ load: async (l) => ut(await l.text())
3984
3971
  }
3985
3972
  ]
3986
3973
  };
3987
- }, Is = (o) => {
3974
+ }, Os = (o) => {
3988
3975
  const {
3989
3976
  selection: e,
3990
3977
  getAabbInDrawboard: t,
@@ -4000,7 +3987,7 @@ const Ms = (o) => {
4000
3987
  );
4001
3988
  }
4002
3989
  };
4003
- }, Fs = () => {
3990
+ }, Is = () => {
4004
3991
  async function o(e) {
4005
3992
  try {
4006
3993
  const n = (await fetch(e, { method: "HEAD" })).headers.get("Content-Type");
@@ -4014,16 +4001,16 @@ const Ms = (o) => {
4014
4001
  loaders: [
4015
4002
  {
4016
4003
  name: "url",
4017
- test: (e) => typeof e == "string" && e.startsWith("http"),
4004
+ test: (e) => typeof e == "string" && (e.startsWith("http") || ct.test(e)),
4018
4005
  load: async (e) => {
4019
- if (en.test(e) || await o(e))
4020
- return await ct(e);
4006
+ if (ct.test(e) || await o(e))
4007
+ return await dt(e);
4021
4008
  throw new Error(`Failed to load url, ${e}`);
4022
4009
  }
4023
4010
  }
4024
4011
  ]
4025
4012
  };
4026
- }, Ps = (o) => {
4013
+ }, Fs = (o) => {
4027
4014
  const {
4028
4015
  config: e
4029
4016
  } = o;
@@ -4037,7 +4024,7 @@ const Ms = (o) => {
4037
4024
  { command: "view:ruler", key: "Shift+R" }
4038
4025
  ]
4039
4026
  };
4040
- }, Ns = (o) => {
4027
+ }, Ps = (o) => {
4041
4028
  const {
4042
4029
  selection: e
4043
4030
  } = o;
@@ -4067,7 +4054,7 @@ const Ms = (o) => {
4067
4054
  { command: "hide/show", key: "Shift+CmdOrCtrl+h" }
4068
4055
  ]
4069
4056
  };
4070
- }, Ot = { left: 0, top: 0, bottom: 0, right: 0 }, Rs = (o) => {
4057
+ }, Ot = { left: 0, top: 0, bottom: 0, right: 0 }, Ns = (o) => {
4071
4058
  const {
4072
4059
  camera: e,
4073
4060
  drawboardAabb: t,
@@ -4093,15 +4080,15 @@ const Ms = (o) => {
4093
4080
  ...s.value.zoomToFitOffset
4094
4081
  };
4095
4082
  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;
4083
+ 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
4084
  if (m && b) {
4098
- const k = z / m, x = $ / b;
4085
+ const k = z / m, x = I / b;
4099
4086
  e.value.setZoom(
4100
4087
  y === "contain" ? Math.min(k, x) : Math.max(k, x)
4101
4088
  );
4102
4089
  const w = e.value.zoom.x;
4103
4090
  let T = _.left, M = _.top;
4104
- k < x ? M += ($ - b * w) / 2 : T += (z - m * w) / 2, e.value.position.set(
4091
+ k < x ? M += (I - b * w) / 2 : T += (z - m * w) / 2, e.value.position.set(
4105
4092
  -E * w + T,
4106
4093
  -C * w + M
4107
4094
  );
@@ -4144,13 +4131,13 @@ const Ms = (o) => {
4144
4131
  drawboardDom: y,
4145
4132
  config: f
4146
4133
  } = 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();
4134
+ pe(() => f.value.viewMode, g), Ht(y, (p) => {
4135
+ const { left: _, top: z, width: I, height: E } = p[0].contentRect, { left: C = _, top: m = z } = y.value?.getBoundingClientRect() ?? {};
4136
+ t.value = { left: C, top: m, width: I, height: E }, g();
4150
4137
  });
4151
4138
  }
4152
4139
  };
4153
- }, Bs = [
4140
+ }, Rs = [
4154
4141
  rs,
4155
4142
  ls,
4156
4143
  cs,
@@ -4173,15 +4160,14 @@ const Ms = (o) => {
4173
4160
  Ts,
4174
4161
  Ms,
4175
4162
  zs,
4176
- Os,
4177
4163
  $s,
4164
+ Os,
4178
4165
  Is,
4179
4166
  Fs,
4180
4167
  Ps,
4181
- Ns,
4182
- Rs
4168
+ Ns
4183
4169
  ];
4184
- class Le extends Gt {
4170
+ class Le extends Wt {
4185
4171
  static injectionKey = Symbol.for("EditorKey");
4186
4172
  debug = V(!1);
4187
4173
  onEmit;
@@ -4207,7 +4193,7 @@ class Le extends Gt {
4207
4193
  os,
4208
4194
  e
4209
4195
  ), this.use([
4210
- ...Bs,
4196
+ ...Rs,
4211
4197
  ...n
4212
4198
  ], e);
4213
4199
  }
@@ -4272,19 +4258,19 @@ class Le extends Gt {
4272
4258
  e.provide(Le.injectionKey, this);
4273
4259
  };
4274
4260
  }
4275
- function nr(o) {
4261
+ function tr(o) {
4276
4262
  return o;
4277
4263
  }
4278
- function or(o) {
4264
+ function nr(o) {
4279
4265
  return o;
4280
4266
  }
4281
4267
  function de() {
4282
4268
  return Se(Le.injectionKey);
4283
4269
  }
4284
- function Ls(o = new Le()) {
4270
+ function Bs(o = new Le()) {
4285
4271
  return De(Le.injectionKey, o), o;
4286
4272
  }
4287
- function wt() {
4273
+ function _t() {
4288
4274
  return {
4289
4275
  icon: {
4290
4276
  type: [String, Function, Object, Array]
@@ -4298,9 +4284,9 @@ function wt() {
4298
4284
  const dn = X({
4299
4285
  name: "MceSvgIcon",
4300
4286
  inheritAttrs: !1,
4301
- props: wt(),
4287
+ props: _t(),
4302
4288
  setup(o, { attrs: e }) {
4303
- return () => H(o.tag, Ne(e, { style: null }), {
4289
+ return () => H(o.tag, $e(e, { style: null }), {
4304
4290
  default: () => [
4305
4291
  F("svg", {
4306
4292
  class: "mce-icon__svg",
@@ -4321,9 +4307,9 @@ const dn = X({
4321
4307
  ]
4322
4308
  });
4323
4309
  }
4324
- }), $t = X({
4310
+ }), It = X({
4325
4311
  name: "MceComponentIcon",
4326
- props: wt(),
4312
+ props: _t(),
4327
4313
  setup(o, { slots: e }) {
4328
4314
  return () => H(o.tag, null, {
4329
4315
  default: () => [
@@ -4332,16 +4318,16 @@ const dn = X({
4332
4318
  });
4333
4319
  }
4334
4320
  });
4335
- function Ds(o) {
4321
+ function Ls(o) {
4336
4322
  const e = Se(mn);
4337
4323
  if (!e)
4338
4324
  throw new Error("Missing Mce Icons provide!");
4339
4325
  return {
4340
- iconData: O(() => {
4326
+ iconData: $(() => {
4341
4327
  const n = yn(o);
4342
4328
  if (!n)
4343
4329
  return {
4344
- component: $t
4330
+ component: It
4345
4331
  };
4346
4332
  let s = n;
4347
4333
  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,7 +4337,7 @@ function Ds(o) {
4351
4337
  };
4352
4338
  if (typeof s != "string")
4353
4339
  return {
4354
- component: $t,
4340
+ component: It,
4355
4341
  icon: s
4356
4342
  };
4357
4343
  const a = Object.keys(e.sets).find((l) => typeof s == "string" && s.startsWith(`${l}:`)), r = a ? s.slice(a.length + 1) : s;
@@ -4362,7 +4348,7 @@ function Ds(o) {
4362
4348
  })
4363
4349
  };
4364
4350
  }
4365
- const Vs = {
4351
+ const Ds = {
4366
4352
  play: "M8 5.14v14l11-7z",
4367
4353
  pause: "M14 19h4V5h-4M6 19h4V5H6z",
4368
4354
  gps: "M12 8a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m-8.95 5H1v-2h2.05C3.5 6.83 6.83 3.5 11 3.05V1h2v2.05c4.17.45 7.5 3.78 7.95 7.95H23v2h-2.05c-.45 4.17-3.78 7.5-7.95 7.95V23h-2v-2.05C6.83 20.5 3.5 17.17 3.05 13M12 5a7 7 0 0 0-7 7a7 7 0 0 0 7 7a7 7 0 0 0 7-7a7 7 0 0 0-7-7",
@@ -4370,19 +4356,19 @@ const Vs = {
4370
4356
  mouseLeftClick: "M13 9V1.07A8.01 8.01 0 0 1 19.75 7c.16.64.25 1.31.25 2zm4.66-2c-.48-1.35-1.43-2.5-2.66-3.19V7zM6 15v-2h12v2c0 1.59-.63 3.12-1.76 4.24A5.97 5.97 0 0 1 12 21a5.97 5.97 0 0 1-4.24-1.76A5.97 5.97 0 0 1 6 15m-2 0c0 2.12.84 4.16 2.34 5.66S9.88 23 12 23s4.16-.84 5.66-2.34S20 17.12 20 15v-4H4zm7-6V1.07C7.06 1.56 4 4.92 4 9z",
4371
4357
  mouseRightClick: "M13 9V1.07c3.94.49 7 3.85 7 7.93zm-2 0V1.07A8.01 8.01 0 0 0 4.25 7C4.09 7.64 4 8.31 4 9zM6.34 7C6.82 5.65 7.78 4.5 9 3.81V7zM6 15v-2h12v2c0 1.59-.63 3.12-1.76 4.24A5.97 5.97 0 0 1 12 21a5.97 5.97 0 0 1-4.24-1.76A5.97 5.97 0 0 1 6 15m-2 0c0 2.12.84 4.16 2.34 5.66S9.88 23 12 23s4.16-.84 5.66-2.34S20 17.12 20 15v-4H4z",
4372
4358
  check: "M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59z"
4373
- }, js = {
4359
+ }, Vs = {
4374
4360
  component: dn
4375
4361
  }, mn = Symbol.for("mce:icons");
4376
- function Us(o = {}) {
4377
- return Kt({
4362
+ function js(o = {}) {
4363
+ return Jt({
4378
4364
  defaultSet: "svg",
4379
- aliases: Vs,
4365
+ aliases: Ds,
4380
4366
  sets: {
4381
- svg: js
4367
+ svg: Vs
4382
4368
  }
4383
4369
  }, o);
4384
4370
  }
4385
- const dt = Symbol.for("MceOverlaySymbol"), nt = tn({
4371
+ const ht = Symbol.for("MceOverlaySymbol"), qe = tn({
4386
4372
  location: String,
4387
4373
  offset: Number,
4388
4374
  target: Object,
@@ -4391,9 +4377,9 @@ const dt = Symbol.for("MceOverlaySymbol"), nt = tn({
4391
4377
  default: void 0
4392
4378
  }
4393
4379
  }, "makeMceOverlayProps");
4394
- let Xs;
4395
- function Hs() {
4396
- return Xs ??= hn();
4380
+ let Us;
4381
+ function Xs() {
4382
+ return Us ??= hn();
4397
4383
  }
4398
4384
  function hn(o = {}) {
4399
4385
  const e = V([]);
@@ -4401,19 +4387,19 @@ function hn(o = {}) {
4401
4387
  register: (t) => {
4402
4388
  const n = e.value.push(t);
4403
4389
  return {
4404
- index: O(() => n),
4390
+ index: $(() => n),
4405
4391
  attach: o.attach
4406
4392
  };
4407
4393
  },
4408
4394
  unregister: (t) => e.value.splice(e.value.indexOf(t), 1)
4409
4395
  };
4410
4396
  }
4411
- function Ys(o = {}) {
4412
- let e = Se(dt, null);
4413
- return e || (e = hn(o), De(dt, e)), e;
4397
+ function Hs(o = {}) {
4398
+ let e = Se(ht, null);
4399
+ return e || (e = hn(o), De(ht, e)), e;
4414
4400
  }
4415
- function qs() {
4416
- const o = Se(dt, Hs()), e = Ze();
4401
+ function Ys() {
4402
+ const o = Se(ht, Xs()), e = Qe();
4417
4403
  if (!e)
4418
4404
  throw new Error("Failed to useOverlayRoot, vm is null");
4419
4405
  const t = o.register(e.uid);
@@ -4421,36 +4407,36 @@ function qs() {
4421
4407
  o.unregister(e.uid);
4422
4408
  }), t;
4423
4409
  }
4424
- const Gs = tn({
4410
+ const qs = tn({
4425
4411
  resizeStrategy: Function,
4426
4412
  activeStrategy: Function,
4427
4413
  hoverStrategy: Function
4428
- }, "makeMceStrategyProps"), Ws = (o) => {
4414
+ }, "makeMceStrategyProps"), Gs = (o) => {
4429
4415
  switch (o.meta?.inPptIs) {
4430
4416
  case "Picture":
4431
4417
  return "diagonalAspectRatio";
4432
4418
  }
4433
4419
  return o.foreground.isValid() ? "diagonalAspectRatio" : "free";
4434
- }, Ks = (o) => {
4420
+ }, Ws = (o) => {
4435
4421
  const { element: e, oldElement: t, isExcluded: n } = o;
4436
4422
  if (e && !n(e))
4437
4423
  return e.equal(t) && e.text.isValid() ? {
4438
4424
  element: e,
4439
4425
  state: "typing"
4440
4426
  } : e;
4441
- }, Js = (o) => {
4427
+ }, Ks = (o) => {
4442
4428
  const { element: e, isExcluded: t, oldElement: n } = o;
4443
4429
  if (e && !t(e))
4444
4430
  return e.equal(n) ? {
4445
4431
  element: e,
4446
4432
  cursor: "move"
4447
4433
  } : e;
4448
- }, Zs = { class: "mce-auxiliary" }, Qs = /* @__PURE__ */ X({
4434
+ }, Js = { class: "mce-auxiliary" }, Zs = /* @__PURE__ */ X({
4449
4435
  __name: "Auxiliary",
4450
4436
  setup(o) {
4451
4437
  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", {
4438
+ return (t, n) => (O(), R("div", Js, [
4439
+ (O(!0), R(se, null, _e(S(e), (s, a) => (O(), R("div", {
4454
4440
  key: a,
4455
4441
  class: be(s.class),
4456
4442
  style: q({
@@ -4463,9 +4449,9 @@ const Gs = tn({
4463
4449
  ]));
4464
4450
  }
4465
4451
  });
4466
- function ea(o, e = "content") {
4452
+ function Qs(o, e = "content") {
4467
4453
  const t = yo(), n = V();
4468
- if (yt) {
4454
+ if (bt) {
4469
4455
  const s = new ResizeObserver((a) => {
4470
4456
  o?.(a, s), a.length && (e === "content" ? n.value = a[0].contentRect : n.value = a[0].target.getBoundingClientRect());
4471
4457
  });
@@ -4482,8 +4468,8 @@ function ea(o, e = "content") {
4482
4468
  contentRect: bn(n)
4483
4469
  };
4484
4470
  }
4485
- const Ke = Symbol.for("mce:layout"), fn = Symbol.for("mce:layout-item"), It = 1e3;
4486
- function ta() {
4471
+ const Je = Symbol.for("mce:layout"), fn = Symbol.for("mce:layout-item"), Ft = 1e3;
4472
+ function ea() {
4487
4473
  return {
4488
4474
  overlaps: {
4489
4475
  type: Array,
@@ -4492,7 +4478,7 @@ function ta() {
4492
4478
  fullHeight: Boolean
4493
4479
  };
4494
4480
  }
4495
- function na() {
4481
+ function ta() {
4496
4482
  return {
4497
4483
  name: {
4498
4484
  type: String
@@ -4504,8 +4490,8 @@ function na() {
4504
4490
  absolute: Boolean
4505
4491
  };
4506
4492
  }
4507
- function oa() {
4508
- const o = Se(Ke);
4493
+ function na() {
4494
+ const o = Se(Je);
4509
4495
  if (!o)
4510
4496
  throw new Error("[mce] Could not find injected layout");
4511
4497
  return {
@@ -4514,25 +4500,25 @@ function oa() {
4514
4500
  mainStyles: o.mainStyles
4515
4501
  };
4516
4502
  }
4517
- function sa(o) {
4518
- const e = Se(Ke);
4503
+ function oa(o) {
4504
+ const e = Se(Je);
4519
4505
  if (!e)
4520
4506
  throw new Error("[mce] Could not find injected layout");
4521
- const t = o.id ?? `layout-item-${Lt()}`, n = Ze();
4507
+ const t = o.id ?? `layout-item-${Dt()}`, n = Qe();
4522
4508
  De(fn, { id: t });
4523
- const s = Je(!1);
4509
+ const s = Ze(!1);
4524
4510
  wn(() => s.value = !0), xn(() => s.value = !1);
4525
4511
  const {
4526
4512
  layoutItemStyles: a,
4527
4513
  layoutItemScrimStyles: r
4528
4514
  } = e.register(n, {
4529
4515
  ...o,
4530
- active: O(() => s.value ? !1 : o.active.value),
4516
+ active: $(() => s.value ? !1 : o.active.value),
4531
4517
  id: t
4532
4518
  });
4533
4519
  return we(() => e.unregister(t)), { layoutItemStyles: a, layoutRect: e.layoutRect, layoutItemScrimStyles: r };
4534
4520
  }
4535
- function aa(o, e, t, n) {
4521
+ function sa(o, e, t, n) {
4536
4522
  let s = { top: 0, left: 0, right: 0, bottom: 0 };
4537
4523
  const a = [{ id: "", layer: { ...s } }];
4538
4524
  for (const r of o) {
@@ -4550,8 +4536,8 @@ function aa(o, e, t, n) {
4550
4536
  }
4551
4537
  return a;
4552
4538
  }
4553
- 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(() => {
4539
+ function aa(o) {
4540
+ const e = Se(Je, null), t = $(() => 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()), l = Ee(/* @__PURE__ */ new Map()), { resizeRef: c, contentRect: u } = Qs(), d = $(() => {
4555
4541
  const C = /* @__PURE__ */ new Map(), m = o.overlaps ?? [];
4556
4542
  for (const b of m.filter((k) => k.includes(":"))) {
4557
4543
  const [k, x] = b.split(":");
@@ -4561,20 +4547,20 @@ function ia(o) {
4561
4547
  !w || !T || !M || !P || (C.set(x, { position: w.value, amount: Number.parseInt(String(M.value), 10) }), C.set(k, { position: T.value, amount: -Number.parseInt(String(P.value), 10) }));
4562
4548
  }
4563
4549
  return C;
4564
- }), g = O(() => {
4550
+ }), g = $(() => {
4565
4551
  const C = [...new Set([...r.values()].map((b) => b.value))].sort((b, k) => b - k), m = [];
4566
4552
  for (const b of C) {
4567
4553
  const k = n.value.filter((x) => r.get(x)?.value === b);
4568
4554
  m.push(...k);
4569
4555
  }
4570
- 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),
4556
+ return sa(m, s, a, i);
4557
+ }), h = $(() => !Array.from(l.values()).some((C) => C.value)), v = $(() => g.value[g.value.length - 1].layer), y = Te(() => ({
4558
+ "--mce-layout-left": Ge(v.value.left),
4559
+ "--mce-layout-right": Ge(v.value.right),
4560
+ "--mce-layout-top": Ge(v.value.top),
4561
+ "--mce-layout-bottom": Ge(v.value.bottom),
4576
4562
  ...h.value ? void 0 : { transition: "none" }
4577
- })), f = O(() => g.value.slice(1).map(({ id: C }, m) => {
4563
+ })), f = $(() => g.value.slice(1).map(({ id: C }, m) => {
4578
4564
  const { layer: b } = g.value[m], k = a.get(C), x = s.get(C);
4579
4565
  return {
4580
4566
  id: C,
@@ -4582,10 +4568,10 @@ function ia(o) {
4582
4568
  size: Number(k.value),
4583
4569
  position: x.value
4584
4570
  };
4585
- })), p = (C) => f.value.find((m) => m.id === C), _ = Ze(), z = Je(!1);
4571
+ })), p = (C) => f.value.find((m) => m.id === C), _ = Qe(), z = Ze(!1);
4586
4572
  He(() => {
4587
4573
  z.value = !0;
4588
- }), De(Ke, {
4574
+ }), De(Je, {
4589
4575
  register: (C, {
4590
4576
  id: m,
4591
4577
  order: b,
@@ -4599,29 +4585,29 @@ function ia(o) {
4599
4585
  r.set(m, b), s.set(m, k), a.set(m, x), i.set(m, T), M && l.set(m, M);
4600
4586
  const A = je(fn, _?.vnode).indexOf(C);
4601
4587
  A > -1 ? n.value.splice(A, 0, m) : n.value.push(m);
4602
- const N = O(() => f.value.findIndex((U) => U.id === m)), L = O(() => t.value + g.value.length * 2 - N.value * 2), j = O(() => {
4588
+ const N = $(() => f.value.findIndex((U) => U.id === m)), L = $(() => t.value + g.value.length * 2 - N.value * 2), j = $(() => {
4603
4589
  const U = k.value === "left" || k.value === "right", W = k.value === "right", Z = k.value === "bottom", he = w.value ?? x.value, Y = he === 0 ? "%" : "px", xe = {
4604
4590
  [k.value]: 0,
4605
4591
  zIndex: L.value,
4606
4592
  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",
4593
+ position: P.value || t.value !== Ft ? "absolute" : "fixed",
4608
4594
  ...h.value ? void 0 : { transition: "none" }
4609
4595
  };
4610
4596
  if (!z.value)
4611
4597
  return xe;
4612
- const oe = f.value[N.value];
4613
- oe || uo(`[mce] Could not find layout item "${m}"`);
4598
+ const ae = f.value[N.value];
4599
+ ae || uo(`[mce] Could not find layout item "${m}"`);
4614
4600
  const ve = d.value.get(m);
4615
- return ve && (oe[ve.position] += ve.amount), {
4601
+ return ve && (ae[ve.position] += ve.amount), {
4616
4602
  ...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)`
4603
+ height: U ? `calc(100% - ${ae.top}px - ${ae.bottom}px)` : w.value ? `${w.value}px` : void 0,
4604
+ left: W ? void 0 : `${ae.left}px`,
4605
+ right: W ? `${ae.right}px` : void 0,
4606
+ top: k.value !== "bottom" ? `${ae.top}px` : void 0,
4607
+ bottom: k.value !== "top" ? `${ae.bottom}px` : void 0,
4608
+ width: U ? w.value ? `${w.value}px` : void 0 : `calc(100% - ${ae.left}px - ${ae.right}px)`
4623
4609
  };
4624
- }), D = O(() => ({
4610
+ }), D = $(() => ({
4625
4611
  zIndex: L.value - 1
4626
4612
  }));
4627
4613
  return { layoutItemStyles: j, layoutItemScrimStyles: D, zIndex: L };
@@ -4636,16 +4622,16 @@ function ia(o) {
4636
4622
  layoutRect: u,
4637
4623
  rootZIndex: t
4638
4624
  });
4639
- const $ = Ee(() => [
4625
+ const I = Te(() => [
4640
4626
  "mce-layout",
4641
4627
  { "mce-layout--full-height": o.fullHeight }
4642
- ]), E = Ee(() => ({
4628
+ ]), E = Te(() => ({
4643
4629
  zIndex: e ? t.value : void 0,
4644
4630
  position: e ? "relative" : void 0,
4645
4631
  overflow: e ? "hidden" : void 0
4646
4632
  }));
4647
4633
  return {
4648
- layoutClasses: $,
4634
+ layoutClasses: I,
4649
4635
  layoutStyles: E,
4650
4636
  getLayoutItem: p,
4651
4637
  items: f,
@@ -4653,15 +4639,15 @@ function ia(o) {
4653
4639
  layoutRef: c
4654
4640
  };
4655
4641
  }
4656
- const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4642
+ const Pt = Symbol.for("MceMenuSymbol"), Ae = /* @__PURE__ */ X({
4657
4643
  __name: "Icon",
4658
4644
  props: {
4659
4645
  disabled: Boolean,
4660
- ...wt()
4646
+ ..._t()
4661
4647
  },
4662
4648
  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), {
4649
+ const e = o, t = Vt(), { iconData: n } = Ls($(() => e.icon)), s = !!(t.onClick || t.onClickOnce);
4650
+ return (a, r) => (O(), oe(jt(S(n).component), {
4665
4651
  icon: S(n).icon,
4666
4652
  tag: e.tag,
4667
4653
  class: be(["mce-icon", {
@@ -4672,7 +4658,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4672
4658
  tabindex: s ? e.disabled ? -1 : 0 : void 0
4673
4659
  }, null, 8, ["icon", "tag", "class", "role", "aria-hidden", "tabindex"]));
4674
4660
  }
4675
- }), xt = /* @__PURE__ */ X({
4661
+ }), ot = /* @__PURE__ */ X({
4676
4662
  inheritAttrs: !1,
4677
4663
  __name: "Overlay",
4678
4664
  props: {
@@ -4680,11 +4666,11 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4680
4666
  type: Boolean,
4681
4667
  default: !1
4682
4668
  },
4683
- ...nt()
4669
+ ...qe()
4684
4670
  },
4685
4671
  emits: ["click:outside", "update:modelValue"],
4686
4672
  setup(o, { expose: e, emit: t }) {
4687
- const n = o, s = t, a = qs(), r = O({
4673
+ const n = o, s = t, a = Ys(), r = $({
4688
4674
  get: () => n.modelValue,
4689
4675
  set: (p) => s("update:modelValue", p)
4690
4676
  }), i = V(), l = {
@@ -4701,18 +4687,18 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4701
4687
  height: 0
4702
4688
  };
4703
4689
  }
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
- placement: O(() => n.location),
4690
+ }, c = $(() => typeof n.target == "object" && !(n.target instanceof Element) && "x" in n.target && "y" in n.target ? l : n.target ?? i.value), u = ce("contentElTpl"), d = $(() => n.attach ?? a.attach?.value ?? "body"), { floatingStyles: g, update: h } = Gn(c, u, {
4691
+ placement: $(() => n.location),
4706
4692
  whileElementsMounted: Zn,
4707
4693
  middleware: [
4708
4694
  Wn(() => n.offset ?? 0),
4709
4695
  Kn(),
4710
4696
  Jn({ padding: 20 })
4711
4697
  ]
4712
- }), v = O(() => ({
4698
+ }), v = $(() => ({
4713
4699
  ...g.value,
4714
4700
  zIndex: 2e3 + a.index.value
4715
- })), y = O(() => ({
4701
+ })), y = $(() => ({
4716
4702
  ref: (p) => i.value = p
4717
4703
  }));
4718
4704
  let f = [];
@@ -4726,41 +4712,41 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4726
4712
  );
4727
4713
  f = [
4728
4714
  _,
4729
- Ut("pointerdown", p, { passive: !0, capture: !0 })
4715
+ Xt("pointerdown", p, { passive: !0, capture: !0 })
4730
4716
  ];
4731
4717
  }), we(() => f.forEach((p) => p())), e({
4732
4718
  activatorEl: i,
4733
4719
  target: c,
4734
4720
  contentEl: u,
4735
4721
  updateLocation: h
4736
- }), (p, _) => (I(), R(ne, null, [
4737
- te(p.$slots, "activator", {
4722
+ }), (p, _) => (O(), R(se, null, [
4723
+ Q(p.$slots, "activator", {
4738
4724
  props: y.value,
4739
4725
  isActive: r.value
4740
4726
  }),
4741
- (I(), le(_n, {
4727
+ (O(), oe(_n, {
4742
4728
  disabled: d.value === !1,
4743
4729
  to: typeof d.value == "boolean" ? void 0 : d.value
4744
4730
  }, [
4745
- r.value ? (I(), R("div", Ne({
4731
+ r.value ? (O(), R("div", $e({
4746
4732
  key: 0,
4747
4733
  ref: "contentElTpl",
4748
4734
  class: "mce-overlay",
4749
4735
  style: v.value
4750
4736
  }, p.$attrs), [
4751
- te(p.$slots, "default")
4752
- ], 16)) : Q("", !0)
4737
+ Q(p.$slots, "default")
4738
+ ], 16)) : ee("", !0)
4753
4739
  ], 8, ["disabled", "to"]))
4754
4740
  ], 64));
4755
4741
  }
4756
- }), ra = ["onMouseenter"], la = ["onClick"], ca = { class: "mce-list-item__prepend" }, ua = { class: "mce-list-item__title" }, da = {
4742
+ }), ia = ["onMouseenter"], ra = ["onClick"], la = { class: "mce-list-item__prepend" }, ca = { class: "mce-list-item__title" }, ua = {
4757
4743
  key: 0,
4758
4744
  class: "mce-list-item__append"
4759
- }, ma = /* @__PURE__ */ X({
4745
+ }, da = /* @__PURE__ */ X({
4760
4746
  name: "MceMenu",
4761
4747
  __name: "Menu",
4762
- props: /* @__PURE__ */ Re({
4763
- ...nt(),
4748
+ props: /* @__PURE__ */ Oe({
4749
+ ...qe(),
4764
4750
  items: Object,
4765
4751
  openOnHover: Boolean,
4766
4752
  persistent: Boolean
@@ -4768,10 +4754,10 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4768
4754
  modelValue: { type: Boolean },
4769
4755
  modelModifiers: {}
4770
4756
  }),
4771
- emits: /* @__PURE__ */ Re(["click:item"], ["update:modelValue"]),
4757
+ emits: /* @__PURE__ */ Oe(["click:item"], ["update:modelValue"]),
4772
4758
  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, {
4759
+ const n = o, s = t, a = ke(o, "modelValue"), r = V(-1), i = ce("overlayTpl"), l = ce("menuItemTplRefs"), c = Dt(), u = Se(Pt, null), d = Ze(/* @__PURE__ */ new Set());
4760
+ De(Pt, {
4775
4761
  register: () => d.value.add(c),
4776
4762
  unregister: () => d.value.delete(c),
4777
4763
  closeParents(p) {
@@ -4780,7 +4766,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4780
4766
  }), we(() => {
4781
4767
  u?.unregister();
4782
4768
  });
4783
- const g = O(() => {
4769
+ const g = $(() => {
4784
4770
  const p = {};
4785
4771
  return n.openOnHover && (p.onMouseenter = () => a.value = !0), p;
4786
4772
  });
@@ -4801,10 +4787,10 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4801
4787
  updateLocation: v
4802
4788
  }), (p, _) => {
4803
4789
  const z = kn("MceMenu");
4804
- return I(), le(xt, {
4790
+ return O(), oe(ot, {
4805
4791
  ref: "overlayTpl",
4806
4792
  modelValue: a.value,
4807
- "onUpdate:modelValue": _[2] || (_[2] = ($) => a.value = $),
4793
+ "onUpdate:modelValue": _[2] || (_[2] = (I) => a.value = I),
4808
4794
  location: n.location,
4809
4795
  offset: n.offset,
4810
4796
  target: n.target,
@@ -4812,55 +4798,55 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4812
4798
  class: "mce-menu",
4813
4799
  "onClick:outside": h
4814
4800
  }, {
4815
- activator: re(($) => [
4816
- te(p.$slots, "activator", Ne($, {
4817
- props: { ...$.props, ...g.value }
4801
+ activator: ne((I) => [
4802
+ Q(p.$slots, "activator", $e(I, {
4803
+ props: { ...I.props, ...g.value }
4818
4804
  }))
4819
4805
  ]),
4820
- default: re(() => [
4821
- o.items?.length ? (I(), R("div", {
4806
+ default: ne(() => [
4807
+ o.items?.length ? (O(), R("div", {
4822
4808
  key: 0,
4823
4809
  class: "mce-list",
4824
4810
  onMouseleave: f
4825
4811
  }, [
4826
- (I(!0), R(ne, null, _e(o.items, ($, E) => (I(), R(ne, { key: E }, [
4827
- $.type === "divider" ? (I(), R("div", {
4812
+ (O(!0), R(se, null, _e(o.items, (I, E) => (O(), R(se, { key: E }, [
4813
+ I.type === "divider" ? (O(), R("div", {
4828
4814
  key: 0,
4829
4815
  ref_for: !0,
4830
4816
  ref: "menuItemTplRefs",
4831
4817
  class: "mce-list__divider"
4832
- }, null, 512)) : (I(), R("div", {
4818
+ }, null, 512)) : (O(), R("div", {
4833
4819
  key: 1,
4834
4820
  ref_for: !0,
4835
4821
  ref: "menuItemTplRefs",
4836
4822
  class: "mce-list__item",
4837
- onMouseenter: (C) => $.disabled ? r.value = -1 : r.value = E
4823
+ onMouseenter: (C) => I.disabled ? r.value = -1 : r.value = E
4838
4824
  }, [
4839
4825
  F("div", {
4840
4826
  class: be(["mce-list-item", [
4841
- $.disabled && "mce-list-item--disabled",
4827
+ I.disabled && "mce-list-item--disabled",
4842
4828
  r.value === E && "mce-list-item--opened"
4843
4829
  ]]),
4844
- onClick: (C) => y($, E, C)
4830
+ onClick: (C) => y(I, E, C)
4845
4831
  }, [
4846
- F("div", ca, [
4847
- $.checked ? (I(), le(Te, {
4832
+ F("div", la, [
4833
+ I.checked ? (O(), oe(Ae, {
4848
4834
  key: 0,
4849
4835
  icon: "$check"
4850
- })) : Q("", !0)
4836
+ })) : ee("", !0)
4851
4837
  ]),
4852
- F("div", ua, [
4853
- te(p.$slots, "title", { item: $ }, () => [
4854
- Cn(K($.key), 1)
4838
+ F("div", ca, [
4839
+ Q(p.$slots, "title", { item: I }, () => [
4840
+ Cn(K(I.key), 1)
4855
4841
  ])
4856
4842
  ]),
4857
- $.children?.length ? (I(), R("div", da, [
4858
- H(Te, { icon: "$menuRight" })
4859
- ])) : Q("", !0)
4860
- ], 10, la)
4861
- ], 40, ra))
4843
+ I.children?.length ? (O(), R("div", ua, [
4844
+ H(Ae, { icon: "$menuRight" })
4845
+ ])) : ee("", !0)
4846
+ ], 10, ra)
4847
+ ], 40, ia))
4862
4848
  ], 64))), 128)),
4863
- r.value > -1 && o.items?.[r.value]?.children?.length ? (I(), le(z, {
4849
+ r.value > -1 && o.items?.[r.value]?.children?.length ? (O(), oe(z, {
4864
4850
  key: 0,
4865
4851
  "open-on-hover": "",
4866
4852
  items: o.items?.[r.value]?.children,
@@ -4869,27 +4855,27 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4869
4855
  target: l.value?.[r.value],
4870
4856
  attach: !1,
4871
4857
  offset: 16,
4872
- "onUpdate:modelValue": _[0] || (_[0] = ($) => r.value = -1),
4873
- "onClick:item": _[1] || (_[1] = ($, E) => s("click:item", $, E))
4874
- }, ht({ _: 2 }, [
4858
+ "onUpdate:modelValue": _[0] || (_[0] = (I) => r.value = -1),
4859
+ "onClick:item": _[1] || (_[1] = (I, E) => s("click:item", I, E))
4860
+ }, pt({ _: 2 }, [
4875
4861
  p.$slots.title ? {
4876
4862
  name: "title",
4877
- fn: re(($) => [
4878
- te(p.$slots, "title", ft(pt($)))
4863
+ fn: ne((I) => [
4864
+ Q(p.$slots, "title", vt(yt(I)))
4879
4865
  ]),
4880
4866
  key: "0"
4881
4867
  } : void 0
4882
- ]), 1032, ["items", "model-value", "target"])) : Q("", !0)
4883
- ], 32)) : Q("", !0)
4868
+ ]), 1032, ["items", "model-value", "target"])) : ee("", !0)
4869
+ ], 32)) : ee("", !0)
4884
4870
  ]),
4885
4871
  _: 3
4886
4872
  }, 8, ["modelValue", "location", "offset", "target", "attach"]);
4887
4873
  };
4888
4874
  }
4889
- }), ha = { class: "mce-context-menu__title" }, fa = {
4875
+ }), ma = { class: "mce-context-menu__title" }, ha = {
4890
4876
  key: 0,
4891
4877
  class: "mce-context-menu__kbd"
4892
- }, pa = /* @__PURE__ */ X({
4878
+ }, fa = /* @__PURE__ */ X({
4893
4879
  __name: "ContextMenu",
4894
4880
  props: {
4895
4881
  modelValue: { type: Boolean },
@@ -4909,7 +4895,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4909
4895
  getKbd: r,
4910
4896
  t: i,
4911
4897
  hotkeys: l
4912
- } = de(), c = Ae(o, "modelValue"), u = Ae(o, "position"), d = ue("menuTplRef");
4898
+ } = de(), c = ke(o, "modelValue"), u = ke(o, "position"), d = ce("menuTplRef");
4913
4899
  function g() {
4914
4900
  d.value?.updateLocation();
4915
4901
  }
@@ -4929,7 +4915,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4929
4915
  }
4930
4916
  return e({
4931
4917
  updateLocation: g
4932
- }), (y, f) => (I(), le(ma, {
4918
+ }), (y, f) => (O(), oe(da, {
4933
4919
  ref: "menuTplRef",
4934
4920
  modelValue: c.value,
4935
4921
  "onUpdate:modelValue": f[0] || (f[0] = (p) => c.value = p),
@@ -4943,17 +4929,17 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4943
4929
  }),
4944
4930
  "onClick:item": v
4945
4931
  }, {
4946
- title: re(({ item: p }) => [
4947
- 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)
4932
+ title: ne(({ item: p }) => [
4933
+ F("span", ma, K(S(i)(p.key)), 1),
4934
+ S(l).has(p.key) ? (O(), R("span", ha, K(S(r)(p.key)), 1)) : ee("", !0)
4949
4935
  ]),
4950
4936
  _: 1
4951
4937
  }, 8, ["modelValue", "target", "items", "style"]));
4952
4938
  }
4953
- }), va = {
4939
+ }), pa = {
4954
4940
  key: 0,
4955
4941
  class: "mce-drawing__content"
4956
- }, ya = /* @__PURE__ */ X({
4942
+ }, va = /* @__PURE__ */ X({
4957
4943
  __name: "Drawing",
4958
4944
  setup(o) {
4959
4945
  const {
@@ -4971,7 +4957,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4971
4957
  });
4972
4958
  t.value?.callback?.(d), r(void 0);
4973
4959
  }
4974
- return (u, d) => S(e) === "drawing" ? (I(), R("div", {
4960
+ return (u, d) => S(e) === "drawing" ? (O(), R("div", {
4975
4961
  key: 0,
4976
4962
  class: "mce-drawing",
4977
4963
  style: q({
@@ -4980,13 +4966,13 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4980
4966
  }),
4981
4967
  onMousedown: c
4982
4968
  }, [
4983
- S(t)?.content ? (I(), R("div", va, K(S(n)(S(t).content)), 1)) : Q("", !0)
4984
- ], 36)) : Q("", !0);
4969
+ S(t)?.content ? (O(), R("div", pa, K(S(n)(S(t).content)), 1)) : ee("", !0)
4970
+ ], 36)) : ee("", !0);
4985
4971
  }
4986
- }), ga = /* @__PURE__ */ X({
4972
+ }), ya = /* @__PURE__ */ X({
4987
4973
  __name: "Floatbar",
4988
4974
  props: {
4989
- ...nt({
4975
+ ...qe({
4990
4976
  location: "top-start",
4991
4977
  offset: 8
4992
4978
  })
@@ -4996,7 +4982,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
4996
4982
  getAabbInDrawboard: n,
4997
4983
  selection: s,
4998
4984
  isFrame: a
4999
- } = de(), r = ue("overlayTpl");
4985
+ } = de(), r = ce("overlayTpl");
5000
4986
  function i() {
5001
4987
  r.value?.updateLocation();
5002
4988
  }
@@ -5004,7 +4990,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5004
4990
  deep: !0
5005
4991
  }), e({
5006
4992
  updateLocation: i
5007
- }), (l, c) => (I(), le(xt, {
4993
+ }), (l, c) => (O(), oe(ot, {
5008
4994
  ref: "overlayTpl",
5009
4995
  class: "mce-floatbar",
5010
4996
  location: t.location,
@@ -5013,13 +4999,13 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5013
4999
  attach: !1,
5014
5000
  "model-value": !0
5015
5001
  }, {
5016
- default: re(() => [
5017
- S(s).length > 0 ? te(l.$slots, "default", { key: 0 }) : Q("", !0)
5002
+ default: ne(() => [
5003
+ S(s).length > 0 ? Q(l.$slots, "default", { key: 0 }) : ee("", !0)
5018
5004
  ]),
5019
5005
  _: 3
5020
5006
  }, 8, ["location", "offset", "target"]));
5021
5007
  }
5022
- }), ba = /* @__PURE__ */ X({
5008
+ }), ga = /* @__PURE__ */ X({
5023
5009
  __name: "Frame",
5024
5010
  props: {
5025
5011
  modelValue: { required: !0 },
@@ -5027,7 +5013,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5027
5013
  },
5028
5014
  emits: ["update:modelValue"],
5029
5015
  setup(o) {
5030
- const e = Ae(o, "modelValue"), t = ue("inputTpl"), {
5016
+ const e = ke(o, "modelValue"), t = ce("inputTpl"), {
5031
5017
  getObbInDrawboard: n,
5032
5018
  hoverElement: s,
5033
5019
  selection: a,
@@ -5036,12 +5022,12 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5036
5022
  exec: l
5037
5023
  } = de(), c = V(!1);
5038
5024
  async function u() {
5039
- c.value = !0, await Pe(), t.value && (t.value.focus(), t.value.select());
5025
+ c.value = !0, await Re(), t.value && (t.value.focus(), t.value.select());
5040
5026
  }
5041
5027
  async function d(g) {
5042
- c.value || (a.value = [e.value], await Pe(), l("startTransform", g));
5028
+ c.value || (a.value = [e.value], await Re(), l("startTransform", g));
5043
5029
  }
5044
- return (g, h) => ze((I(), R("div", {
5030
+ return (g, h) => ze((O(), R("div", {
5045
5031
  style: q(S(Me)(S(n)(e.value))),
5046
5032
  class: be(["mce-frame", [
5047
5033
  S(i).frameOutline && "mce-frame--outline"
@@ -5070,18 +5056,18 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5070
5056
  [Xe, e.value.visible]
5071
5057
  ]);
5072
5058
  }
5073
- }), wa = /* @__PURE__ */ X({
5059
+ }), ba = /* @__PURE__ */ X({
5074
5060
  __name: "Frames",
5075
5061
  setup(o) {
5076
5062
  const {
5077
5063
  frames: e
5078
5064
  } = de();
5079
- return (t, n) => (I(!0), R(ne, null, _e(S(e), (s, a) => (I(), le(ba, {
5065
+ return (t, n) => (O(!0), R(se, null, _e(S(e), (s, a) => (O(), oe(ga, {
5080
5066
  key: a,
5081
5067
  "model-value": s
5082
5068
  }, null, 8, ["model-value"]))), 128));
5083
5069
  }
5084
- }), xa = /* @__PURE__ */ X({
5070
+ }), wa = /* @__PURE__ */ X({
5085
5071
  __name: "GoBackSelectedArea",
5086
5072
  setup(o) {
5087
5073
  const {
@@ -5090,28 +5076,28 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5090
5076
  aabbToDrawboardAabb: n,
5091
5077
  exec: s,
5092
5078
  t: a
5093
- } = de(), r = O(() => e.value.width && e.value.height && !Be(
5079
+ } = de(), r = $(() => e.value.width && e.value.height && !Be(
5094
5080
  t.value,
5095
5081
  n(e.value)
5096
5082
  ));
5097
- return (i, l) => r.value ? (I(), R("div", {
5083
+ return (i, l) => r.value ? (O(), R("div", {
5098
5084
  key: 0,
5099
5085
  class: "mce-back-selected-aera",
5100
- onClick: l[0] || (l[0] = We((c) => S(s)("zoomToSelection"), ["prevent"]))
5086
+ onClick: l[0] || (l[0] = Ke((c) => S(s)("zoomToSelection"), ["prevent"]))
5101
5087
  }, [
5102
- H(Te, { icon: "$gps" }),
5088
+ H(Ae, { icon: "$gps" }),
5103
5089
  F("span", null, K(S(a)("goBackSelectedArea")), 1)
5104
- ])) : Q("", !0);
5090
+ ])) : ee("", !0);
5105
5091
  }
5106
- }), _a = ["data-name"], ka = /* @__PURE__ */ X({
5092
+ }), xa = ["data-name"], _a = /* @__PURE__ */ X({
5107
5093
  __name: "Hover",
5108
5094
  setup(o) {
5109
5095
  const {
5110
5096
  selection: e,
5111
5097
  hoverElement: t,
5112
5098
  getObbInDrawboard: n
5113
- } = de(), s = O(() => n(t.value));
5114
- return (a, r) => S(t) && !S(t).equal(S(e)[0]) ? (I(), R("div", {
5099
+ } = de(), s = $(() => n(t.value));
5100
+ return (a, r) => S(t) && !S(t).equal(S(e)[0]) ? (O(), R("div", {
5115
5101
  key: 0,
5116
5102
  class: "mce-hover",
5117
5103
  "data-name": S(t).name,
@@ -5119,12 +5105,12 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5119
5105
  borderColor: "currentcolor",
5120
5106
  ...S(Me)(s.value)
5121
5107
  })
5122
- }, null, 12, _a)) : Q("", !0);
5108
+ }, null, 12, xa)) : ee("", !0);
5123
5109
  }
5124
- }), Ca = /* @__PURE__ */ X({
5110
+ }), ka = /* @__PURE__ */ X({
5125
5111
  __name: "Tooltip",
5126
- props: /* @__PURE__ */ Re({
5127
- ...nt({
5112
+ props: /* @__PURE__ */ Oe({
5113
+ ...qe({
5128
5114
  location: "right",
5129
5115
  offset: 8
5130
5116
  })
@@ -5134,13 +5120,13 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5134
5120
  }),
5135
5121
  emits: ["update:modelValue"],
5136
5122
  setup(o, { expose: e }) {
5137
- const t = o, n = Ae(o, "modelValue"), s = ue("overlayTpl");
5123
+ const t = o, n = ke(o, "modelValue"), s = ce("overlayTpl");
5138
5124
  function a() {
5139
5125
  s.value?.updateLocation();
5140
5126
  }
5141
5127
  return e({
5142
5128
  updateLocation: a
5143
- }), (r, i) => (I(), le(xt, {
5129
+ }), (r, i) => (O(), oe(ot, {
5144
5130
  ref: "overlayTpl",
5145
5131
  modelValue: n.value,
5146
5132
  "onUpdate:modelValue": i[0] || (i[0] = (l) => n.value = l),
@@ -5149,22 +5135,22 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5149
5135
  offset: t.offset,
5150
5136
  target: t.target,
5151
5137
  attach: t.attach
5152
- }, ht({
5153
- default: re(() => [
5154
- n.value ? te(r.$slots, "default", { key: 0 }) : Q("", !0)
5138
+ }, pt({
5139
+ default: ne(() => [
5140
+ n.value ? Q(r.$slots, "default", { key: 0 }) : ee("", !0)
5155
5141
  ]),
5156
5142
  _: 2
5157
5143
  }, [
5158
5144
  r.$slots.activator ? {
5159
5145
  name: "activator",
5160
- fn: re((l) => [
5161
- te(r.$slots, "activator", ft(pt(l)))
5146
+ fn: ne((l) => [
5147
+ Q(r.$slots, "activator", vt(yt(l)))
5162
5148
  ]),
5163
5149
  key: "0"
5164
5150
  } : void 0
5165
5151
  ]), 1032, ["modelValue", "location", "offset", "target", "attach"]));
5166
5152
  }
5167
- }), Ea = ["width", "height"], Ta = ["onDblclick", "onMousedown", "onMousemove"], Aa = { style: { "font-size": "12px", "text-wrap": "nowrap" } }, mt = /* @__PURE__ */ X({
5153
+ }), Ca = ["width", "height"], Ea = ["onDblclick", "onMousedown", "onMousemove"], Ta = { style: { "font-size": "12px", "text-wrap": "nowrap" } }, ft = /* @__PURE__ */ X({
5168
5154
  inheritAttrs: !1,
5169
5155
  __name: "Ruler",
5170
5156
  props: {
@@ -5181,7 +5167,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5181
5167
  labelFormat: { type: Function, default: (o) => String(o) }
5182
5168
  },
5183
5169
  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({
5170
+ const t = o, n = Vt(), s = $(() => t.pixelRatio), a = V(), r = V({ x: 0, y: 0 }), i = ce("canvasTpl"), l = "OffscreenCanvas" in window ? new OffscreenCanvas(t.size, t.size) : document.createElement("canvas"), c = l.getContext("2d"), u = V(), d = Ee({
5185
5171
  text: "#000",
5186
5172
  border: "#000"
5187
5173
  });
@@ -5204,7 +5190,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5204
5190
  const D = N, U = t.size - L;
5205
5191
  c.save(), t.vertical && (c.translate(0, t.size), c.scale(1, -1)), c.fillText(A, D, U), c.restore();
5206
5192
  }
5207
- const f = O(() => {
5193
+ const f = $(() => {
5208
5194
  const A = Math.max(t.unit / t.zoom, 1), N = t.unitFractions, L = Math.floor(Math.log10(A)), j = A / 10 ** L;
5209
5195
  let D = N[N.length - 1];
5210
5196
  for (const U of N)
@@ -5213,17 +5199,17 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5213
5199
  break;
5214
5200
  }
5215
5201
  return D * 10 ** L;
5216
- }), p = O(() => {
5202
+ }), p = $(() => {
5217
5203
  const A = -t.position / t.zoom;
5218
5204
  return Math.floor(A / f.value) * f.value;
5219
- }), _ = O(() => {
5205
+ }), _ = $(() => {
5220
5206
  const N = ((t.vertical ? u.value?.height : u.value?.width) ?? 0) / t.zoom;
5221
5207
  return p.value + Math.ceil(N / f.value) * f.value;
5222
5208
  });
5223
5209
  function z(A) {
5224
5210
  return Math.round(A * t.zoom + t.position);
5225
5211
  }
5226
- function $(A) {
5212
+ function I(A) {
5227
5213
  return Math.round((A - t.position) / t.zoom);
5228
5214
  }
5229
5215
  function E() {
@@ -5260,7 +5246,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5260
5246
  },
5261
5247
  { immediate: !0, deep: !0 }
5262
5248
  );
5263
- const C = Ht(() => {
5249
+ const C = Yt(() => {
5264
5250
  if (!i.value)
5265
5251
  return;
5266
5252
  const A = i.value.parentElement.getBoundingClientRect();
@@ -5276,12 +5262,12 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5276
5262
  }), we(() => {
5277
5263
  l.width = 0, l.height = 0;
5278
5264
  });
5279
- const m = V([]), b = V(), k = O(() => {
5265
+ const m = V([]), b = V(), k = $(() => {
5280
5266
  const A = [...m.value];
5281
5267
  return typeof b.value == "number" && A.unshift(b.value), A;
5282
5268
  });
5283
5269
  function x(A) {
5284
- return $(
5270
+ return I(
5285
5271
  t.vertical ? A.clientY - u.value.top : A.clientX - u.value.left
5286
5272
  );
5287
5273
  }
@@ -5310,8 +5296,8 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5310
5296
  }
5311
5297
  return e({
5312
5298
  box: u
5313
- }), (A, N) => (I(), R(ne, null, [
5314
- ze((I(), R("div", Ne({
5299
+ }), (A, N) => (O(), R(se, null, [
5300
+ ze((O(), R("div", $e({
5315
5301
  class: ["mce-ruler", [
5316
5302
  `mce-ruler--${t.vertical ? "vertical" : "horizontal"}`
5317
5303
  ]],
@@ -5326,11 +5312,11 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5326
5312
  class: "mce-ruler__canvas",
5327
5313
  width: t.size,
5328
5314
  height: t.size
5329
- }, null, 8, Ea)
5315
+ }, null, 8, Ca)
5330
5316
  ], 16)), [
5331
- [S(Jt), S(C)]
5317
+ [S(Zt), S(C)]
5332
5318
  ]),
5333
- (I(!0), R(ne, null, _e(k.value, (L, j) => (I(), R("div", {
5319
+ (O(!0), R(se, null, _e(k.value, (L, j) => (O(), R("div", {
5334
5320
  key: j,
5335
5321
  class: be(["mce-ruler-refline", {
5336
5322
  "mce-ruler-refline--vertical": t.vertical,
@@ -5347,20 +5333,20 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5347
5333
  onMousedown: (D) => B(D, j),
5348
5334
  onMousemove: () => a.value = `${L}`,
5349
5335
  onMouseleave: M
5350
- }, null, 46, Ta))), 128)),
5351
- H(Ca, {
5336
+ }, null, 46, Ea))), 128)),
5337
+ H(ka, {
5352
5338
  "model-value": !!a.value,
5353
5339
  target: r.value,
5354
5340
  offset: 24
5355
5341
  }, {
5356
- default: re(() => [
5357
- F("div", Aa, K(a.value), 1)
5342
+ default: ne(() => [
5343
+ F("div", Ta, K(a.value), 1)
5358
5344
  ]),
5359
5345
  _: 1
5360
5346
  }, 8, ["model-value", "target"])
5361
5347
  ], 64));
5362
5348
  }
5363
- }), Sa = { class: "mce-rulers" }, Ma = /* @__PURE__ */ X({
5349
+ }), Aa = { class: "mce-rulers" }, Sa = /* @__PURE__ */ X({
5364
5350
  inheritAttrs: !1,
5365
5351
  __name: "Rulers",
5366
5352
  setup(o) {
@@ -5368,9 +5354,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5368
5354
  camera: e,
5369
5355
  getAabbInDrawboard: t,
5370
5356
  selection: n
5371
- } = de(), s = O(() => t(n.value));
5372
- return (a, r) => (I(), R("div", Sa, [
5373
- H(mt, {
5357
+ } = de(), s = $(() => t(n.value));
5358
+ return (a, r) => (O(), R("div", Aa, [
5359
+ H(ft, {
5374
5360
  refline: "",
5375
5361
  zoom: S(e).zoom.x,
5376
5362
  position: S(e).position.x,
@@ -5378,7 +5364,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5378
5364
  axis: "",
5379
5365
  size: 16
5380
5366
  }, null, 8, ["zoom", "position", "selected"]),
5381
- H(mt, {
5367
+ H(ft, {
5382
5368
  refline: "",
5383
5369
  zoom: S(e).zoom.y,
5384
5370
  position: S(e).position.y,
@@ -5390,12 +5376,12 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5390
5376
  r[0] || (r[0] = F("div", { class: "mce-rulers__left-top" }, null, -1))
5391
5377
  ]));
5392
5378
  }
5393
- }), za = {
5379
+ }), Ma = {
5394
5380
  ref: "trackTplRef",
5395
5381
  class: "mce-scrollbar__track"
5396
- }, Oa = 50, Pt = 50, Nt = /* @__PURE__ */ X({
5382
+ }, za = 50, Nt = 50, Rt = /* @__PURE__ */ X({
5397
5383
  __name: "Scrollbar",
5398
- props: /* @__PURE__ */ Re({
5384
+ props: /* @__PURE__ */ Oe({
5399
5385
  zoom: {},
5400
5386
  length: {},
5401
5387
  vertical: { type: Boolean },
@@ -5406,16 +5392,16 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5406
5392
  modelValue: { required: !0 },
5407
5393
  modelModifiers: {}
5408
5394
  }),
5409
- emits: /* @__PURE__ */ Re(["scroll"], ["update:modelValue"]),
5395
+ emits: /* @__PURE__ */ Oe(["scroll"], ["update:modelValue"]),
5410
5396
  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(
5397
+ 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"), l = ce("thumbTplRef"), c = V(0), u = $(
5412
5398
  () => 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)
5413
- ), d = O(
5399
+ ), d = $(
5414
5400
  () => 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(() => {
5401
+ ), g = $(() => Math.max(0.05, Math.min(1, c.value / u.value))), h = $(() => d.value / (u.value - c.value) * (1 - g.value)), v = Yt(() => {
5416
5402
  const w = i.value?.getBoundingClientRect() ?? { width: 0, height: 0 };
5417
5403
  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}%`);
5404
+ }, 50), y = $(() => t.infinite ? a(g.value, h.value) : h.value), f = $(() => 1 - y.value - g.value), p = $(() => t.vertical ? `${y.value * 100}%` : "0%"), _ = $(() => t.vertical ? `${f.value * 100}%` : "50%"), z = $(() => t.vertical ? "0%" : `${y.value * 100}%`), I = $(() => t.vertical ? "50%" : `${f.value * 100}%`);
5419
5405
  function E(w) {
5420
5406
  n("scroll", w - r.value), r.value = w;
5421
5407
  }
@@ -5441,14 +5427,14 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5441
5427
  return;
5442
5428
  }
5443
5429
  }
5444
- C(Oa * M), b = setTimeout(() => k(w), Pt);
5430
+ C(za * M), b = setTimeout(() => k(w), Nt);
5445
5431
  }
5446
5432
  function x() {
5447
5433
  clearTimeout(b);
5448
5434
  }
5449
5435
  return we(() => {
5450
5436
  x();
5451
- }), (w, T) => ze((I(), R("div", {
5437
+ }), (w, T) => ze((O(), R("div", {
5452
5438
  class: be(["mce-scrollbar", {
5453
5439
  "mce-scrollbar--vertical": t.vertical,
5454
5440
  "mce-scrollbar--horizontal": !t.vertical
@@ -5459,7 +5445,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5459
5445
  [t.vertical ? "top" : "left"]: `${t.offset}px`
5460
5446
  })
5461
5447
  }, [
5462
- F("div", za, [
5448
+ F("div", Ma, [
5463
5449
  ze(F("div", {
5464
5450
  ref: "thumbTplRef",
5465
5451
  class: be(["mce-scrollbar__thumb", {
@@ -5469,15 +5455,15 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5469
5455
  top: p.value,
5470
5456
  bottom: _.value,
5471
5457
  left: z.value,
5472
- right: $.value
5458
+ right: I.value
5473
5459
  })
5474
5460
  }, null, 6), [
5475
5461
  [Xe, t.infinite || g.value < 1]
5476
5462
  ])
5477
5463
  ], 512)
5478
5464
  ], 6)), [
5479
- [S(Jt), S(v)],
5480
- [S(Qn), [k, { delay: Pt, onMouseUp: x }]]
5465
+ [S(Zt), S(v)],
5466
+ [S(Qn), [k, { delay: Nt, onMouseUp: x }]]
5481
5467
  ]);
5482
5468
  }
5483
5469
  }), $a = /* @__PURE__ */ X({
@@ -5493,15 +5479,15 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5493
5479
  camera: t,
5494
5480
  viewAabb: n
5495
5481
  } = de();
5496
- return (s, a) => (I(), R(ne, null, [
5497
- H(Nt, Ne(e, {
5482
+ return (s, a) => (O(), R(se, null, [
5483
+ H(Rt, $e(e, {
5498
5484
  modelValue: S(t).position.y,
5499
5485
  "onUpdate:modelValue": a[0] || (a[0] = (r) => S(t).position.y = r),
5500
5486
  zoom: S(t).zoom.y,
5501
5487
  vertical: "",
5502
5488
  length: S(n).height
5503
5489
  }), null, 16, ["modelValue", "zoom", "length"]),
5504
- H(Nt, Ne(e, {
5490
+ H(Rt, $e(e, {
5505
5491
  modelValue: S(t).position.x,
5506
5492
  "onUpdate:modelValue": a[1] || (a[1] = (r) => S(t).position.x = r),
5507
5493
  zoom: S(t).zoom.x,
@@ -5509,10 +5495,10 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5509
5495
  }), null, 16, ["modelValue", "zoom", "length"])
5510
5496
  ], 64));
5511
5497
  }
5512
- }), Ia = { class: "mce-transformable__svg" }, Fa = { "pointer-events": "all" }, Pa = ["x", "y", "width", "height", "aria-label", "fill"], Na = ["cx", "cy", "r", "aria-label", "fill"], Ra = ["x", "y", "width", "height", "aria-label", "cursor", "onPointerdown"], Ba = {
5498
+ }), Oa = { class: "mce-transformable__svg" }, Ia = { "pointer-events": "all" }, Fa = ["x", "y", "width", "height", "aria-label", "fill"], Pa = ["cx", "cy", "r", "aria-label", "fill"], Na = ["x", "y", "width", "height", "aria-label", "cursor", "onPointerdown"], Ra = {
5513
5499
  key: 0,
5514
5500
  class: "mce-transformable__tip"
5515
- }, La = /* @__PURE__ */ X({
5501
+ }, Ba = /* @__PURE__ */ X({
5516
5502
  __name: "Transformable",
5517
5503
  props: {
5518
5504
  tag: { default: "div" },
@@ -5561,13 +5547,13 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5561
5547
  "resize-top-right": (m) => _("resizeBevel", 180 + m),
5562
5548
  "resize-bottom-right": (m) => _("resizeBevel", 90 + m),
5563
5549
  "resize-bottom-left": (m) => _("resizeBevel", 180 + m)
5564
- }, r = Ae(n, "modelValue"), i = O({
5550
+ }, r = ke(n, "modelValue"), i = $({
5565
5551
  get: () => {
5566
5552
  let { left: m = 0, top: b = 0, width: k = 0, height: x = 0, rotate: w = 0 } = r.value ?? {};
5567
5553
  return Number.isNaN(Number(k)) && (k = 0), Number.isNaN(Number(x)) && (x = 0), { left: m, top: b, width: k, height: x, rotate: w };
5568
5554
  },
5569
5555
  set: (m) => r.value = m
5570
- }), l = V(!1), c = V(), u = O(() => {
5556
+ }), l = V(!1), c = V(), u = $(() => {
5571
5557
  const { width: m = 0, height: b = 0 } = i.value, k = 6, x = k / 2, w = 8, T = w / 2, M = 12;
5572
5558
  let P;
5573
5559
  return n.handleStrategy === "point" ? P = [
@@ -5607,19 +5593,19 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5607
5593
  { type: "rotate-bottom-left", x: -M - T, y: b + T, width: M, height: M },
5608
5594
  { type: "rotate-bottom-right", x: m + T, y: b + T, width: M, height: M }
5609
5595
  ], P.filter((B) => n.handles.includes(B.type)).map((B) => (B.width = Math.max(B.width, 0), B.height = Math.max(B.height, 0), B));
5610
- }), d = V(), g = O(() => {
5596
+ }), d = V(), g = $(() => {
5611
5597
  const { width: m = 0, height: b = 0 } = i.value;
5612
5598
  return {
5613
5599
  width: n.initialSize && !m ? void 0 : `${m}px`,
5614
5600
  height: n.initialSize && !b ? void 0 : `${b}px`
5615
5601
  };
5616
- }), h = O(() => {
5602
+ }), h = $(() => {
5617
5603
  const { left: m = 0, top: b = 0, rotate: k = 0 } = i.value, x = k * Math.PI / 180, w = Math.cos(x), T = Math.sin(x);
5618
5604
  return {
5619
5605
  ...g.value,
5620
5606
  transform: `matrix(${w}, ${T}, ${-T}, ${w}, ${m}, ${b})`
5621
5607
  };
5622
- }), v = O(() => n.visibility === "auto" && l.value), y = O(() => n.tipFormat?.("size"));
5608
+ }), v = $(() => n.visibility === "auto" && l.value), y = $(() => n.tipFormat?.("size"));
5623
5609
  function f(m, b) {
5624
5610
  if (m && m.button !== void 0 && m.button !== 0)
5625
5611
  return !1;
@@ -5634,7 +5620,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5634
5620
  y: x
5635
5621
  };
5636
5622
  A || (U.x += B.x + B.width / 2, U.y += B.y + B.height / 2);
5637
- const W = $(
5623
+ const W = I(
5638
5624
  U,
5639
5625
  D,
5640
5626
  A ? 0 : M
@@ -5650,7 +5636,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5650
5636
  l.value = !0, s("start", i.value);
5651
5637
  }
5652
5638
  !n.threshold && !l.value && xe();
5653
- function oe(ye) {
5639
+ function ae(ye) {
5654
5640
  const J = {};
5655
5641
  Y || (Y = { x: ye.clientX, y: ye.clientY });
5656
5642
  const me = {
@@ -5662,56 +5648,56 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5662
5648
  return;
5663
5649
  xe();
5664
5650
  }
5665
- const ce = {
5651
+ const ue = {
5666
5652
  x: W.x + me.x,
5667
5653
  y: W.y + me.y
5668
5654
  };
5669
5655
  if (A) {
5670
5656
  if (!n.moveable)
5671
5657
  return;
5672
- J.left = ce.x, J.top = ce.y;
5658
+ J.left = ue.x, J.top = ue.y;
5673
5659
  } else if (N) {
5674
5660
  const ge = Math.atan2(
5675
- ce.y - D.y,
5676
- ce.x - D.x
5661
+ ue.y - D.y,
5662
+ ue.x - D.x
5677
5663
  ) / (Math.PI / 180);
5678
5664
  J.rotate = (M + ge - he + 360) % 360;
5679
5665
  } else if (j) {
5680
- const ge = $(ce, W, -M), ae = $(
5666
+ const ge = I(ue, W, -M), re = I(
5681
5667
  L ? { x: ge.x, y: W.y } : { x: W.x, y: ge.y },
5682
5668
  W,
5683
5669
  M
5684
5670
  ), 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;
5671
+ x: re.x - (re.x - Z.x) / 2,
5672
+ y: re.y + (Z.y - re.y) / 2
5673
+ }, Ce = C(re, Z);
5674
+ 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
5675
  } else {
5690
5676
  if (P && (n.resizeStrategy === "aspectRatio" || n.resizeStrategy === "diagonalAspectRatio")) {
5691
- let ot = 1;
5677
+ let st = 1;
5692
5678
  switch (B.type) {
5693
5679
  case "resize-top-right":
5694
5680
  case "resize-bottom-left":
5695
- ot = -1;
5681
+ st = -1;
5696
5682
  break;
5697
5683
  }
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);
5684
+ 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
5685
  }
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;
5686
+ const ge = E(ue, Z), re = [
5687
+ I(ue, ge, -M),
5688
+ I(Z, ge, -M)
5689
+ ], [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];
5690
+ J.width = Ce - Ve, J.height = vn - kt, J.left = Ve, J.top = kt;
5705
5691
  }
5706
5692
  if ("width" in J && J.width <= 0 || "height" in J && J.height <= 0)
5707
5693
  return;
5708
- const ee = { ...i.value }, se = { ...i.value, ...J };
5709
- i.value = se, s("move", se, ee);
5694
+ const te = { ...i.value }, ie = { ...i.value, ...J };
5695
+ i.value = ie, s("move", ie, te);
5710
5696
  }
5711
5697
  function ve() {
5712
- window.removeEventListener("pointermove", oe), window.removeEventListener("pointerup", ve, !0), l.value = !1, s("end", i.value);
5698
+ window.removeEventListener("pointermove", ae), window.removeEventListener("pointerup", ve, !0), l.value = !1, s("end", i.value);
5713
5699
  }
5714
- return window.addEventListener("pointermove", oe), window.addEventListener("pointerup", ve, !0), !0;
5700
+ return window.addEventListener("pointermove", ae), window.addEventListener("pointerup", ve, !0), !0;
5715
5701
  }
5716
5702
  const p = {
5717
5703
  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 +5711,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5725
5711
  function z(m) {
5726
5712
  return m === "move" ? "move" : `url("data:image/svg+xml,${a[m](i.value.rotate ?? 0)}") 16 16, pointer`;
5727
5713
  }
5728
- function $(m, b, k) {
5714
+ function I(m, b, k) {
5729
5715
  const x = k * Math.PI / 180, w = Math.cos(x), T = Math.sin(x);
5730
5716
  return {
5731
5717
  x: (m.x - b.x) * w - (m.y - b.y) * T + b.x,
@@ -5742,9 +5728,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5742
5728
  return Math.sqrt((m.x - b.x) ** 2 + (m.y - b.y) ** 2);
5743
5729
  }
5744
5730
  return He(async () => {
5745
- const b = Ze()?.proxy?.$el;
5731
+ const b = Qe()?.proxy?.$el;
5746
5732
  if (b && n.initialSize) {
5747
- await Pe();
5733
+ await Re();
5748
5734
  let k, x;
5749
5735
  const w = getComputedStyle(b);
5750
5736
  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)
@@ -5764,12 +5750,12 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5764
5750
  start: f,
5765
5751
  activeHandle: c,
5766
5752
  transforming: l
5767
- }), (m, b) => (I(), le(Vt(o.tag), {
5753
+ }), (m, b) => (O(), oe(jt(o.tag), {
5768
5754
  class: "mce-transformable",
5769
5755
  style: q(h.value)
5770
5756
  }, {
5771
- default: re(() => [
5772
- te(m.$slots, "default", {
5757
+ default: ne(() => [
5758
+ Q(m.$slots, "default", {
5773
5759
  value: S(r),
5774
5760
  moveProps: {
5775
5761
  onPointerdown: f,
@@ -5777,7 +5763,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5777
5763
  },
5778
5764
  start: f
5779
5765
  }),
5780
- (I(), R("svg", Ia, [
5766
+ (O(), R("svg", Oa, [
5781
5767
  F("rect", {
5782
5768
  width: "100%",
5783
5769
  height: "100%",
@@ -5789,10 +5775,10 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5789
5775
  strokeWidth: v.value ? "0.5px" : void 0
5790
5776
  })
5791
5777
  }, null, 4),
5792
- 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", {
5778
+ F("g", Ia, [
5779
+ (O(!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) => (O(), R(se, { key: x }, [
5780
+ (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") ? (O(), R(se, { key: 0 }, [
5781
+ n.handleShape === "rect" ? (O(), R("rect", {
5796
5782
  key: 0,
5797
5783
  x: k.x,
5798
5784
  y: k.y,
@@ -5804,7 +5790,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5804
5790
  style: q({
5805
5791
  opacity: o.visibility === "none" || l.value && o.visibility !== "visible" ? 0 : void 0
5806
5792
  })
5807
- }, null, 12, Pa)) : (I(), R("circle", {
5793
+ }, null, 12, Fa)) : (O(), R("circle", {
5808
5794
  key: 1,
5809
5795
  cx: k.x + k.width / 2,
5810
5796
  cy: k.y + k.width / 2,
@@ -5815,8 +5801,8 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5815
5801
  style: q({
5816
5802
  opacity: o.visibility === "none" || l.value && o.visibility !== "visible" ? 0 : void 0
5817
5803
  })
5818
- }, null, 12, Na))
5819
- ], 64)) : Q("", !0),
5804
+ }, null, 12, Pa))
5805
+ ], 64)) : ee("", !0),
5820
5806
  F("rect", {
5821
5807
  ref_for: !0,
5822
5808
  ref_key: "handlesRef",
@@ -5832,22 +5818,22 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5832
5818
  }),
5833
5819
  cursor: l.value ? "auto" : z(k.type),
5834
5820
  onPointerdown: (w) => f(w, x)
5835
- }, null, 44, Ra)
5821
+ }, null, 44, Na)
5836
5822
  ], 64))), 128))
5837
5823
  ]),
5838
5824
  F("g", {
5839
5825
  "pointer-events": "all",
5840
5826
  style: q(v.value ? { opacity: ".4", strokeWidth: "0.5px" } : void 0)
5841
5827
  }, [
5842
- te(m.$slots, "svg", { box: i.value })
5828
+ Q(m.$slots, "svg", { box: i.value })
5843
5829
  ], 4)
5844
5830
  ])),
5845
- y.value ? (I(), R("div", Ba, K(y.value), 1)) : Q("", !0)
5831
+ y.value ? (O(), R("div", Ra, K(y.value), 1)) : ee("", !0)
5846
5832
  ]),
5847
5833
  _: 3
5848
5834
  }, 8, ["style"]));
5849
5835
  }
5850
- }), Da = /* @__PURE__ */ X({
5836
+ }), La = /* @__PURE__ */ X({
5851
5837
  inheritAttrs: !1,
5852
5838
  __name: "Selector",
5853
5839
  props: {
@@ -5868,21 +5854,21 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5868
5854
  isFrame: g,
5869
5855
  isLock: h,
5870
5856
  config: v
5871
- } = de(), y = ue("transformableRef");
5872
- vt(() => {
5857
+ } = de(), y = ce("transformableRef");
5858
+ gt(() => {
5873
5859
  u({ command: "startTransform", handle: (E) => !!y.value?.start(E) });
5874
5860
  }), we(() => {
5875
5861
  d("startTransform");
5876
5862
  });
5877
- const f = O(() => {
5863
+ const f = $(() => {
5878
5864
  if (a.value.length !== 1)
5879
5865
  return [];
5880
5866
  const E = [];
5881
5867
  return a.value[0]?.findAncestor((C) => (C instanceof G && E.push(l(C)), !1)), E;
5882
- }), p = O(() => n.value !== "selecting" && a.value.length === 1 ? [] : a.value.map((E) => ({
5868
+ }), p = $(() => n.value !== "selecting" && a.value.length === 1 ? [] : a.value.map((E) => ({
5883
5869
  name: E.name,
5884
5870
  box: l(E)
5885
- }))), _ = O(() => l(a.value)), z = O({
5871
+ }))), _ = $(() => l(a.value)), z = $({
5886
5872
  get: () => _.value,
5887
5873
  set: (E) => {
5888
5874
  const C = r.value.zoom, m = _.value, b = {
@@ -5909,14 +5895,14 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5909
5895
  });
5910
5896
  }
5911
5897
  });
5912
- function $() {
5898
+ function I() {
5913
5899
  const E = a.value.length === 1 ? a.value[0].style : c(a.value);
5914
5900
  return `${Number(E.width.toFixed(2))} × ${Number(E.height.toFixed(2))}`;
5915
5901
  }
5916
5902
  return e({
5917
5903
  transformable: y
5918
- }), (E, C) => (I(), R(ne, null, [
5919
- (I(!0), R(ne, null, _e(f.value, (m, b) => (I(), R("div", {
5904
+ }), (E, C) => (O(), R(se, null, [
5905
+ (O(!0), R(se, null, _e(f.value, (m, b) => (O(), R("div", {
5920
5906
  key: b,
5921
5907
  class: "mce-parent-element-obb",
5922
5908
  style: q({
@@ -5924,15 +5910,15 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5924
5910
  ...S(Me)(m)
5925
5911
  })
5926
5912
  }, null, 4))), 128)),
5927
- S(n) === "selecting" ? (I(), R("div", {
5913
+ S(n) === "selecting" ? (O(), R("div", {
5928
5914
  key: 0,
5929
5915
  class: "mce-selected-area",
5930
5916
  style: q({
5931
5917
  borderColor: "currentcolor",
5932
5918
  ...S(Me)(t.selectedArea)
5933
5919
  })
5934
- }, null, 4)) : Q("", !0),
5935
- (I(!0), R(ne, null, _e(p.value, (m, b) => (I(), R("div", {
5920
+ }, null, 4)) : ee("", !0),
5921
+ (O(!0), R(se, null, _e(p.value, (m, b) => (O(), R("div", {
5936
5922
  key: b,
5937
5923
  class: "mce-element-obb",
5938
5924
  style: q({
@@ -5940,7 +5926,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5940
5926
  ...S(Me)(m.box)
5941
5927
  })
5942
5928
  }, null, 4))), 128)),
5943
- z.value.width && z.value.height ? (I(), le(La, {
5929
+ z.value.width && z.value.height ? (O(), oe(Ba, {
5944
5930
  key: 1,
5945
5931
  ref: "transformableRef",
5946
5932
  modelValue: z.value,
@@ -5951,35 +5937,35 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5951
5937
  "handle-shape": S(v).handleShape,
5952
5938
  class: "mce-selection-obb",
5953
5939
  "border-style": S(a).length > 1 ? "dashed" : "solid",
5954
- "tip-format": $,
5940
+ "tip-format": I,
5955
5941
  onMove: C[1] || (C[1] = () => !S(n) && (n.value = "transforming")),
5956
5942
  onEnd: C[2] || (C[2] = () => S(n) === "transforming" && (n.value = void 0))
5957
- }, ht({ _: 2 }, [
5943
+ }, pt({ _: 2 }, [
5958
5944
  E.$slots.transformable ? {
5959
5945
  name: "svg",
5960
- fn: re((m) => [
5961
- te(E.$slots, "transformable", ft(pt(m)))
5946
+ fn: ne((m) => [
5947
+ Q(E.$slots, "transformable", vt(yt(m)))
5962
5948
  ]),
5963
5949
  key: "0"
5964
5950
  } : 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", {
5951
+ ]), 1032, ["modelValue", "visibility", "moveable", "resize-strategy", "handle-shape", "border-style"])) : ee("", !0),
5952
+ z.value.width && z.value.height && E.$slots.default ? (O(), R("div", {
5967
5953
  key: 2,
5968
5954
  style: q([{ position: "absolute" }, S(Me)(z.value)])
5969
5955
  }, [
5970
- te(E.$slots, "default", { box: z.value })
5971
- ], 4)) : Q("", !0)
5956
+ Q(E.$slots, "default", { box: z.value })
5957
+ ], 4)) : ee("", !0)
5972
5958
  ], 64));
5973
5959
  }
5974
- }), Va = /* @__PURE__ */ X({
5960
+ }), Da = /* @__PURE__ */ X({
5975
5961
  __name: "Setup",
5976
5962
  setup(o) {
5977
5963
  return de().setup(), (e, t) => null;
5978
5964
  }
5979
- }), ja = /* @__PURE__ */ X({
5965
+ }), Va = /* @__PURE__ */ X({
5980
5966
  __name: "Layout",
5981
5967
  props: {
5982
- ...ta()
5968
+ ...ea()
5983
5969
  },
5984
5970
  setup(o, { expose: e }) {
5985
5971
  const t = o, {
@@ -5988,19 +5974,19 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
5988
5974
  items: a,
5989
5975
  getLayoutItem: r,
5990
5976
  layoutRef: i
5991
- } = ia(t);
5977
+ } = aa(t);
5992
5978
  return e({
5993
5979
  items: a,
5994
5980
  getLayoutItem: r
5995
- }), (l, c) => (I(), R("div", {
5981
+ }), (l, c) => (O(), R("div", {
5996
5982
  ref: S(i),
5997
5983
  class: be([S(n)]),
5998
5984
  style: q([S(s)])
5999
5985
  }, [
6000
- te(l.$slots, "default")
5986
+ Q(l.$slots, "default")
6001
5987
  ], 6));
6002
5988
  }
6003
- }), Rt = /* @__PURE__ */ X({
5989
+ }), Bt = /* @__PURE__ */ X({
6004
5990
  __name: "LayoutItem",
6005
5991
  props: {
6006
5992
  position: {
@@ -6012,57 +5998,57 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6012
5998
  default: 300
6013
5999
  },
6014
6000
  modelValue: Boolean,
6015
- ...na()
6001
+ ...ta()
6016
6002
  },
6017
6003
  setup(o) {
6018
- const e = o, { layoutItemStyles: t } = sa({
6004
+ const e = o, { layoutItemStyles: t } = oa({
6019
6005
  id: e.name,
6020
- 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)
6006
+ order: $(() => Number.parseInt(String(e.order), 10)),
6007
+ position: Te(() => e.position),
6008
+ elementSize: Te(() => e.size),
6009
+ layoutSize: Te(() => e.size),
6010
+ active: Te(() => e.modelValue),
6011
+ absolute: Te(() => e.absolute)
6026
6012
  });
6027
- return (n, s) => (I(), R("div", {
6013
+ return (n, s) => (O(), R("div", {
6028
6014
  class: be(["mce-layout-item", [
6029
6015
  `mce-layout-item--${e.position}`
6030
6016
  ]]),
6031
6017
  style: q([S(t)])
6032
6018
  }, [
6033
- te(n.$slots, "default")
6019
+ Q(n.$slots, "default")
6034
6020
  ], 6));
6035
6021
  }
6036
- }), Ua = {
6022
+ }), ja = {
6037
6023
  key: 0,
6038
6024
  class: "mce-main__scroller"
6039
- }, Xa = /* @__PURE__ */ X({
6025
+ }, Ua = /* @__PURE__ */ X({
6040
6026
  __name: "Main",
6041
6027
  props: {
6042
6028
  scrollable: Boolean
6043
6029
  },
6044
6030
  setup(o) {
6045
- const e = o, { mainStyles: t } = oa();
6046
- return (n, s) => (I(), R("main", {
6031
+ const e = o, { mainStyles: t } = na();
6032
+ return (n, s) => (O(), R("main", {
6047
6033
  class: be(["mce-main", [
6048
6034
  { "mce-main--scrollable": e.scrollable }
6049
6035
  ]]),
6050
6036
  style: q([S(t)])
6051
6037
  }, [
6052
- e.scrollable ? (I(), R("div", Ua, [
6053
- te(n.$slots, "default")
6054
- ])) : te(n.$slots, "default", { key: 1 })
6038
+ e.scrollable ? (O(), R("div", ja, [
6039
+ Q(n.$slots, "default")
6040
+ ])) : Q(n.$slots, "default", { key: 1 })
6055
6041
  ], 6));
6056
6042
  }
6057
- }), Ha = { class: "progress-indicator" }, Ya = {
6043
+ }), Xa = { class: "progress-indicator" }, Ha = {
6058
6044
  key: 0,
6059
6045
  class: "progress-indicator__status"
6060
- }, qa = { class: "progress-indicator__bar" }, Ga = {
6046
+ }, Ya = { class: "progress-indicator__bar" }, qa = {
6061
6047
  key: 1,
6062
6048
  class: "progress-indicator__bar-indeterminate"
6063
- }, Wa = /* @__PURE__ */ X({
6049
+ }, Ga = /* @__PURE__ */ X({
6064
6050
  __name: "ProgressIndicator",
6065
- props: /* @__PURE__ */ Re({
6051
+ props: /* @__PURE__ */ Oe({
6066
6052
  label: {},
6067
6053
  indeterminate: { type: Boolean }
6068
6054
  }, {
@@ -6071,11 +6057,11 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6071
6057
  }),
6072
6058
  emits: ["update:modelValue"],
6073
6059
  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),
6077
- F("div", qa, [
6078
- o.indeterminate ? (I(), R("div", Ga)) : (I(), R("div", {
6060
+ const e = ke(o, "modelValue");
6061
+ return (t, n) => (O(), R("div", Xa, [
6062
+ o.label ? (O(), R("span", Ha, K(o.label), 1)) : ee("", !0),
6063
+ F("div", Ya, [
6064
+ o.indeterminate ? (O(), R("div", qa)) : (O(), R("div", {
6079
6065
  key: 0,
6080
6066
  class: "progress-indicator__bar-fill",
6081
6067
  style: q({ width: `${e.value * 100}%` })
@@ -6088,7 +6074,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6088
6074
  for (const [n, s] of e)
6089
6075
  t[n] = s;
6090
6076
  return t;
6091
- }, Ka = /* @__PURE__ */ pn(Wa, [["__scopeId", "data-v-c4234331"]]), Ja = { class: "mce-statusbar" }, Za = { class: "mce-statusbar__main" }, Qa = { class: "mce-statusbar__item" }, ei = { class: "mce-statusbar__kbd" }, ti = { class: "mce-statusbar__kbd" }, ni = { class: "mce-statusbar__item" }, oi = { class: "mce-statusbar__kbd" }, si = { class: "mce-statusbar__item" }, ai = { class: "mce-statusbar__item" }, ii = { class: "mce-statusbar__kbd" }, ri = { class: "mce-statusbar__item" }, li = { class: "mce-statusbar__kbd" }, ci = { key: 2 }, ui = { class: "mce-statusbar__item" }, di = { class: "mce-statusbar__item" }, mi = { class: "mce-statusbar__kbd" }, hi = { class: "mce-statusbar__item" }, fi = { class: "mce-statusbar__item" }, pi = { class: "mce-statusbar__kbd" }, vi = { class: "mce-statusbar__item" }, yi = { class: "mce-statusbar__progress" }, gi = /* @__PURE__ */ X({
6077
+ }, Wa = /* @__PURE__ */ pn(Ga, [["__scopeId", "data-v-c4234331"]]), Ka = { class: "mce-statusbar" }, Ja = { class: "mce-statusbar__main" }, Za = { class: "mce-statusbar__item" }, Qa = { class: "mce-statusbar__kbd" }, ei = { class: "mce-statusbar__kbd" }, ti = { class: "mce-statusbar__item" }, ni = { class: "mce-statusbar__kbd" }, oi = { class: "mce-statusbar__item" }, si = { class: "mce-statusbar__item" }, ai = { class: "mce-statusbar__kbd" }, ii = { class: "mce-statusbar__item" }, ri = { class: "mce-statusbar__kbd" }, li = { key: 2 }, ci = { class: "mce-statusbar__item" }, ui = { class: "mce-statusbar__item" }, di = { class: "mce-statusbar__kbd" }, mi = { class: "mce-statusbar__item" }, hi = { class: "mce-statusbar__item" }, fi = { class: "mce-statusbar__kbd" }, pi = { class: "mce-statusbar__item" }, vi = { class: "mce-statusbar__progress" }, yi = /* @__PURE__ */ X({
6092
6078
  __name: "Statusbar",
6093
6079
  setup(o) {
6094
6080
  const {
@@ -6098,70 +6084,70 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6098
6084
  exporting: s,
6099
6085
  exportProgress: a
6100
6086
  } = de();
6101
- return (r, i) => (I(), R("div", Ja, [
6102
- F("div", Za, [
6103
- S(e) === "typing" ? (I(), R(ne, { key: 0 }, [
6104
- F("div", Qa, [
6105
- F("span", ei, K(S(n)("Command")), 1),
6106
- F("span", ti, K(S(n)("Enter")), 1)
6087
+ return (r, i) => (O(), R("div", Ka, [
6088
+ F("div", Ja, [
6089
+ S(e) === "typing" ? (O(), R(se, { key: 0 }, [
6090
+ F("div", Za, [
6091
+ F("span", Qa, K(S(n)("Command")), 1),
6092
+ F("span", ei, K(S(n)("Enter")), 1)
6107
6093
  ]),
6108
6094
  i[1] || (i[1] = F("span", null, "/", -1)),
6109
- F("div", ni, [
6110
- F("span", oi, K(S(n)("Escape")), 1),
6095
+ F("div", ti, [
6096
+ F("span", ni, K(S(n)("Escape")), 1),
6111
6097
  F("span", null, K(S(t)("commitChanges")), 1)
6112
6098
  ])
6113
- ], 64)) : S(e) === "transforming" ? (I(), R(ne, { key: 1 }, [
6114
- F("div", si, [
6115
- H(Te, { icon: "$mouseRightClick" })
6099
+ ], 64)) : S(e) === "transforming" ? (O(), R(se, { key: 1 }, [
6100
+ F("div", oi, [
6101
+ H(Ae, { icon: "$mouseRightClick" })
6116
6102
  ]),
6117
6103
  i[2] || (i[2] = F("span", null, " / ", -1)),
6118
- F("div", ai, [
6119
- F("span", ii, K(S(n)("Escape")), 1),
6104
+ F("div", si, [
6105
+ F("span", ai, K(S(n)("Escape")), 1),
6120
6106
  F("span", null, K(S(t)("cancel")), 1)
6121
6107
  ]),
6122
6108
  i[3] || (i[3] = F("div", { class: "mce-statusbar__divider" }, null, -1)),
6123
- F("div", ri, [
6124
- F("span", li, K(S(n)("Shift")), 1),
6109
+ F("div", ii, [
6110
+ F("span", ri, K(S(n)("Shift")), 1),
6125
6111
  F("span", null, K(S(t)("constrainToAxis")), 1)
6126
6112
  ])
6127
- ], 64)) : S(e) ? (I(), R("span", ci, K(S(t)(S(e))), 1)) : (I(), R(ne, { key: 3 }, [
6128
- F("div", ui, [
6129
- H(Te, { icon: "$mouseLeftClick" }),
6113
+ ], 64)) : S(e) ? (O(), R("span", li, K(S(t)(S(e))), 1)) : (O(), R(se, { key: 3 }, [
6114
+ F("div", ci, [
6115
+ H(Ae, { icon: "$mouseLeftClick" }),
6130
6116
  F("span", null, K(S(t)("selectObject")), 1)
6131
6117
  ]),
6132
6118
  i[4] || (i[4] = F("span", null, " + ", -1)),
6133
- F("div", di, [
6134
- F("span", mi, K(S(n)("Shift")), 1),
6119
+ F("div", ui, [
6120
+ F("span", di, K(S(n)("Shift")), 1),
6135
6121
  F("span", null, K(S(t)("extend")), 1)
6136
6122
  ]),
6137
6123
  i[5] || (i[5] = F("div", { class: "mce-statusbar__divider" }, null, -1)),
6138
- F("div", hi, [
6139
- H(Te, { icon: "$mouseLeftClick" }),
6124
+ F("div", mi, [
6125
+ H(Ae, { icon: "$mouseLeftClick" }),
6140
6126
  F("span", null, K(S(t)("selectArea")), 1)
6141
6127
  ]),
6142
6128
  i[6] || (i[6] = F("span", null, " + ", -1)),
6143
- F("div", fi, [
6144
- F("span", pi, K(S(n)("Shift")), 1),
6129
+ F("div", hi, [
6130
+ F("span", fi, K(S(n)("Shift")), 1),
6145
6131
  F("span", null, K(S(t)("extend")), 1)
6146
6132
  ]),
6147
6133
  i[7] || (i[7] = F("div", { class: "mce-statusbar__divider" }, null, -1)),
6148
- F("div", vi, [
6149
- H(Te, { icon: "$mouseLeftClick" }),
6134
+ F("div", pi, [
6135
+ H(Ae, { icon: "$mouseLeftClick" }),
6150
6136
  F("span", null, K(S(t)("dragSelected")), 1)
6151
6137
  ])
6152
6138
  ], 64))
6153
6139
  ]),
6154
- F("div", yi, [
6155
- S(s) ? (I(), le(Ka, {
6140
+ F("div", vi, [
6141
+ S(s) ? (O(), oe(Wa, {
6156
6142
  key: 0,
6157
6143
  modelValue: S(a),
6158
6144
  "onUpdate:modelValue": i[0] || (i[0] = (l) => Tn(a) ? a.value = l : null),
6159
6145
  label: S(t)("exporting")
6160
- }, null, 8, ["modelValue", "label"])) : Q("", !0)
6146
+ }, null, 8, ["modelValue", "label"])) : ee("", !0)
6161
6147
  ])
6162
6148
  ]));
6163
6149
  }
6164
- }), bi = /* @__PURE__ */ pn(gi, [["__scopeId", "data-v-36c89bd7"]]), wi = /* @__PURE__ */ X({
6150
+ }), gi = /* @__PURE__ */ pn(yi, [["__scopeId", "data-v-36c89bd7"]]), bi = /* @__PURE__ */ X({
6165
6151
  __name: "TextEditor",
6166
6152
  setup(o, { expose: e }) {
6167
6153
  const {
@@ -6173,13 +6159,13 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6173
6159
  registerCommand: i,
6174
6160
  unregisterCommand: l,
6175
6161
  camera: c
6176
- } = de(), u = V(), d = O(() => {
6162
+ } = de(), u = V(), d = $(() => {
6177
6163
  const { zoom: f, position: p } = c.value;
6178
6164
  return {
6179
6165
  transformOrigin: "left top",
6180
6166
  transform: `translate(${p.x}px, ${p.y}px) scale(${f.x}, ${f.y})`
6181
6167
  };
6182
- }), g = O(() => {
6168
+ }), g = $(() => {
6183
6169
  const f = t.value[0], p = r(f), _ = f?.text.base?.boundingBox;
6184
6170
  return _ && (p.left += _.left, p.top += _.top), {
6185
6171
  ...Me(p)
@@ -6198,11 +6184,11 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6198
6184
  return !1;
6199
6185
  p.text.isValid() || p.text.setContent(" "), p.text.update(), n.value = "typing";
6200
6186
  const _ = u.value;
6201
- return _.set(p.text.base), await Pe(), _.pointerdown(f);
6187
+ return _.set(p.text.base), await Re(), _.pointerdown(f);
6202
6188
  }
6203
- return vt(() => i({ command: "startTyping", handle: y })), we(() => l("startTyping")), e({
6189
+ return gt(() => i({ command: "startTyping", handle: y })), we(() => l("startTyping")), e({
6204
6190
  textEditor: u
6205
- }), (f, p) => ze((I(), R("div", {
6191
+ }), (f, p) => ze((O(), R("div", {
6206
6192
  class: "mce-text-editor",
6207
6193
  style: q({
6208
6194
  ...d.value
@@ -6230,24 +6216,24 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6230
6216
  [Xe, S(t)[0] && S(n) === "typing"]
6231
6217
  ]);
6232
6218
  }
6233
- }), xi = { class: "mce-payhead" }, _i = /* @__PURE__ */ X({
6219
+ }), wi = { class: "mce-payhead" }, xi = /* @__PURE__ */ X({
6234
6220
  __name: "Playhead",
6235
6221
  setup(o) {
6236
- return (e, t) => (I(), R("div", xi, [...t[0] || (t[0] = [
6222
+ return (e, t) => (O(), R("div", wi, [...t[0] || (t[0] = [
6237
6223
  F("header", { class: "mce-payhead__header" }, null, -1),
6238
6224
  F("main", { class: "mce-payhead__main" }, null, -1)
6239
6225
  ])]));
6240
6226
  }
6241
- }), ki = {
6227
+ }), _i = {
6242
6228
  key: 0,
6243
6229
  class: "mce-segment__edge mce-segment__edge--front"
6244
- }, Ci = {
6230
+ }, ki = {
6245
6231
  class: "mce-segment__node",
6246
6232
  style: { overflow: "hidden" }
6247
- }, Ei = {
6233
+ }, Ci = {
6248
6234
  key: 1,
6249
6235
  class: "mce-segment__edge mce-segment__edge--end"
6250
- }, Ti = /* @__PURE__ */ X({
6236
+ }, Ei = /* @__PURE__ */ X({
6251
6237
  __name: "Segment",
6252
6238
  props: {
6253
6239
  node: {},
@@ -6255,46 +6241,46 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6255
6241
  active: { type: Boolean }
6256
6242
  },
6257
6243
  setup(o) {
6258
- const e = o, t = O(() => {
6244
+ const e = o, t = $(() => {
6259
6245
  const n = { left: 0, top: 0, width: 0 };
6260
6246
  return n.left = e.node.delay / e.msPerPx, n.width = e.node.duration / e.msPerPx, n.width ? n.width = `${n.width}px` : n.width = "100%", {
6261
6247
  width: n.width,
6262
6248
  transform: `matrix(1, 0, 0, 1, ${n.left}, ${n.top})`
6263
6249
  };
6264
6250
  });
6265
- return (n, s) => (I(), R("div", {
6251
+ return (n, s) => (O(), R("div", {
6266
6252
  class: be(["mce-segment", [
6267
6253
  `mce-segment--${o.node.meta.inEditorIs}`,
6268
6254
  o.active && "mce-segment--active"
6269
6255
  ]]),
6270
6256
  style: q(t.value)
6271
6257
  }, [
6272
- o.active ? (I(), R("div", ki)) : Q("", !0),
6273
- F("span", Ci, K(e.node.name), 1),
6274
- o.active ? (I(), R("div", Ei)) : Q("", !0)
6258
+ o.active ? (O(), R("div", _i)) : ee("", !0),
6259
+ F("span", ki, K(e.node.name), 1),
6260
+ o.active ? (O(), R("div", Ci)) : ee("", !0)
6275
6261
  ], 6));
6276
6262
  }
6277
- }), Ai = { class: "mce-track" }, Si = /* @__PURE__ */ X({
6263
+ }), Ti = { class: "mce-track" }, Ai = /* @__PURE__ */ X({
6278
6264
  __name: "Track",
6279
6265
  setup(o) {
6280
- return (e, t) => (I(), R("div", Ai, [
6281
- te(e.$slots, "default")
6266
+ return (e, t) => (O(), R("div", Ti, [
6267
+ Q(e.$slots, "default")
6282
6268
  ]));
6283
6269
  }
6284
- }), Mi = /* @__PURE__ */ X({
6270
+ }), Si = /* @__PURE__ */ X({
6285
6271
  __name: "Trackhead",
6286
6272
  props: {
6287
6273
  node: {}
6288
6274
  },
6289
6275
  setup(o) {
6290
- return (e, t) => (I(), R("div", {
6276
+ return (e, t) => (O(), R("div", {
6291
6277
  class: "mce-trackhead",
6292
6278
  style: q({
6293
6279
  height: `var(--timeline-track-height__${o.node.meta.inEditorIs}, 22px)`
6294
6280
  })
6295
6281
  }, K(o.node.meta.inEditorIs), 5));
6296
6282
  }
6297
- }), zi = { class: "mce-timeline__toolbar" }, Oi = { class: "mce-timeline__main" }, $i = { class: "mce-timeline__left" }, Ii = { class: "mce-timeline__left-wrapper" }, Fi = { class: "mce-timeline__right-wrapper" }, Pi = { class: "mce-timeline__ruler" }, Ni = { class: "mce-timeline__track" }, Ri = 0.02, Bi = /* @__PURE__ */ X({
6283
+ }), Mi = { class: "mce-timeline__toolbar" }, zi = { class: "mce-timeline__main" }, $i = { class: "mce-timeline__left" }, Oi = { class: "mce-timeline__left-wrapper" }, Ii = { class: "mce-timeline__right-wrapper" }, Fi = { class: "mce-timeline__ruler" }, Pi = { class: "mce-timeline__track" }, Ni = 0.02, Ri = /* @__PURE__ */ X({
6298
6284
  __name: "Timeline",
6299
6285
  setup(o) {
6300
6286
  const {
@@ -6304,12 +6290,12 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6304
6290
  timeline: s,
6305
6291
  endTime: a,
6306
6292
  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))) ?? []);
6293
+ } = de(), i = V(1e3 / 30), l = ce("rulerTpl"), c = V(!0), u = V([0, 0]), d = $(() => e.value?.findAll((z) => !!(z instanceof G && z.children.some((I) => I instanceof Ln))) ?? []);
6308
6294
  function g(z) {
6309
6295
  if (z.ctrlKey) {
6310
6296
  if (!(z.wheelDeltaY ? Math.abs(Math.abs(z.wheelDeltaY) - Math.abs(3 * z.deltaY)) < 3 : z.deltaMode === 0)) {
6311
6297
  z.preventDefault();
6312
- const E = t.value, C = Math.log(E), m = -z.deltaY * Ri, b = C + m;
6298
+ const E = t.value, C = Math.log(E), m = -z.deltaY * Ni, b = C + m;
6313
6299
  t.value = Math.exp(b);
6314
6300
  }
6315
6301
  } else
@@ -6319,11 +6305,11 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6319
6305
  ];
6320
6306
  }
6321
6307
  function h(z) {
6322
- const $ = l.value?.box;
6323
- if ($) {
6324
- n.value = (z.clientX - $.left + u.value[0]) * t.value;
6308
+ const I = l.value?.box;
6309
+ if (I) {
6310
+ n.value = (z.clientX - I.left + u.value[0]) * t.value;
6325
6311
  const E = (m) => {
6326
- n.value = (m.clientX - $.left + u.value[0]) * t.value;
6312
+ n.value = (m.clientX - I.left + u.value[0]) * t.value;
6327
6313
  }, C = () => {
6328
6314
  window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", C);
6329
6315
  };
@@ -6332,7 +6318,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6332
6318
  }
6333
6319
  function v(z) {
6334
6320
  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");
6321
+ 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
6322
  return `${C}:${m}`;
6337
6323
  }
6338
6324
  return `${Math.floor(z % 30)}f`;
@@ -6341,10 +6327,10 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6341
6327
  function f() {
6342
6328
  c.value = !1;
6343
6329
  let z;
6344
- function $(E) {
6345
- z !== void 0 && E !== void 0 && s.value.addTime(E - z), z = E, y = requestAnimationFrame($);
6330
+ function I(E) {
6331
+ z !== void 0 && E !== void 0 && s.value.addTime(E - z), z = E, y = requestAnimationFrame(I);
6346
6332
  }
6347
- $();
6333
+ I();
6348
6334
  }
6349
6335
  function p() {
6350
6336
  c.value = !0, y !== void 0 && (cancelAnimationFrame(y), y = void 0);
@@ -6352,30 +6338,30 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6352
6338
  function _() {
6353
6339
  c.value ? f() : p();
6354
6340
  }
6355
- return we(p), (z, $) => (I(), R("div", {
6341
+ return we(p), (z, I) => (O(), R("div", {
6356
6342
  class: "mce-timeline",
6357
- onWheel: $[0] || ($[0] = We(() => {
6343
+ onWheel: I[0] || (I[0] = Ke(() => {
6358
6344
  }, ["prevent"]))
6359
6345
  }, [
6360
- F("div", zi, [
6346
+ F("div", Mi, [
6361
6347
  F("div", {
6362
6348
  class: "mce-timeline__play",
6363
6349
  onClick: _
6364
6350
  }, [
6365
- H(Te, {
6351
+ H(Ae, {
6366
6352
  icon: c.value ? "$play" : "$pause"
6367
6353
  }, null, 8, ["icon"])
6368
6354
  ])
6369
6355
  ]),
6370
- F("div", Oi, [
6356
+ F("div", zi, [
6371
6357
  F("div", $i, [
6372
- F("div", Ii, [
6358
+ F("div", Oi, [
6373
6359
  F("div", {
6374
6360
  style: q({
6375
6361
  transform: `translateY(${u.value[1]}px)`
6376
6362
  })
6377
6363
  }, [
6378
- (I(!0), R(ne, null, _e(d.value, (E, C) => (I(), le(Mi, {
6364
+ (O(!0), R(se, null, _e(d.value, (E, C) => (O(), oe(Si, {
6379
6365
  key: C,
6380
6366
  node: E
6381
6367
  }, null, 8, ["node"]))), 128))
@@ -6387,9 +6373,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6387
6373
  onWheel: g,
6388
6374
  onMousedown: h
6389
6375
  }, [
6390
- F("div", Fi, [
6391
- F("div", Pi, [
6392
- H(mt, {
6376
+ F("div", Ii, [
6377
+ F("div", Fi, [
6378
+ H(ft, {
6393
6379
  ref: "rulerTpl",
6394
6380
  zoom: 1 / S(t) * i.value,
6395
6381
  unit: 100,
@@ -6399,27 +6385,27 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6399
6385
  "label-format": v
6400
6386
  }, null, 8, ["zoom", "position"])
6401
6387
  ]),
6402
- F("div", Ni, [
6388
+ F("div", Pi, [
6403
6389
  F("div", {
6404
6390
  style: q({
6405
6391
  width: `${S(a) / S(t)}px`,
6406
6392
  transform: `translate(${u.value[0]}px, ${u.value[1]}px)`
6407
6393
  })
6408
6394
  }, [
6409
- (I(!0), R(ne, null, _e(d.value, (E, C) => (I(), le(Si, { key: C }, {
6410
- default: re(() => [
6411
- H(Ti, {
6395
+ (O(!0), R(se, null, _e(d.value, (E, C) => (O(), oe(Ai, { key: C }, {
6396
+ default: ne(() => [
6397
+ H(Ei, {
6412
6398
  node: E,
6413
6399
  "ms-per-px": S(t),
6414
6400
  active: S(r).some((m) => m.equal(E)),
6415
- onMousedown: We((m) => r.value = [E], ["stop"])
6401
+ onMousedown: Ke((m) => r.value = [E], ["stop"])
6416
6402
  }, null, 8, ["node", "ms-per-px", "active", "onMousedown"])
6417
6403
  ]),
6418
6404
  _: 2
6419
6405
  }, 1024))), 128))
6420
6406
  ], 4)
6421
6407
  ]),
6422
- H(_i, {
6408
+ H(xi, {
6423
6409
  style: q({
6424
6410
  transform: `translate(${u.value[0] + Math.ceil(S(n) / S(t))}px, 0px)`
6425
6411
  })
@@ -6429,19 +6415,19 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6429
6415
  ])
6430
6416
  ], 32));
6431
6417
  }
6432
- }), Li = ["data-pixel-ratio"], Di = {
6418
+ }), Bi = ["data-pixel-ratio"], Li = {
6433
6419
  ref: "canvasTpl",
6434
6420
  class: "mce-editor__canvas"
6435
- }, Vi = {
6421
+ }, Di = {
6436
6422
  ref: "overlayContainerTpl",
6437
6423
  class: "mce-editor__overlay-container"
6438
- }, sr = /* @__PURE__ */ X({
6424
+ }, or = /* @__PURE__ */ X({
6439
6425
  __name: "EditorLayout",
6440
6426
  props: {
6441
- ...Gs({
6442
- resizeStrategy: Ws,
6443
- activeStrategy: Ks,
6444
- hoverStrategy: Js
6427
+ ...qs({
6428
+ resizeStrategy: Gs,
6429
+ activeStrategy: Ws,
6430
+ hoverStrategy: Ks
6445
6431
  }),
6446
6432
  editor: Le
6447
6433
  },
@@ -6449,7 +6435,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6449
6435
  setup(o, { emit: e }) {
6450
6436
  const t = o, n = e;
6451
6437
  let s;
6452
- t.editor ? s = Ls(t.editor) : s = de(), De(mn, Us());
6438
+ t.editor ? s = Bs(t.editor) : s = de(), De(mn, js());
6453
6439
  const {
6454
6440
  config: a,
6455
6441
  drawboardDom: r,
@@ -6466,14 +6452,14 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6466
6452
  selection: p,
6467
6453
  getAabbInDrawboard: _,
6468
6454
  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 });
6471
- Ys({
6472
- attach: O(() => E.value)
6473
- }), Xt(C, (A) => {
6455
+ drawboardPointer: I
6456
+ } = s, E = ce("overlayContainerTpl"), C = ce("canvasTpl"), m = ce("selectorTpl"), b = ce("textEditorTpl"), k = V({ left: 0, top: 0, width: 0, height: 0 });
6457
+ Hs({
6458
+ attach: $(() => E.value)
6459
+ }), Ht(C, (A) => {
6474
6460
  const { width: N, height: L } = A[0].contentRect;
6475
6461
  i.value.resize(N, L);
6476
- }), vt(() => {
6462
+ }), gt(() => {
6477
6463
  i.value.on("pointerdown", T), i.value.on("pointermove", M), i.value.on("pointerover", P);
6478
6464
  }), He(() => {
6479
6465
  c(C.value, r.value);
@@ -6485,7 +6471,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6485
6471
  }
6486
6472
  function w(A) {
6487
6473
  let N, L;
6488
- if (Ct(
6474
+ if (Et(
6489
6475
  { x: A.clientX, y: A.clientY },
6490
6476
  _(p.value)
6491
6477
  ))
@@ -6506,32 +6492,32 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6506
6492
  return;
6507
6493
  const N = p.value[0], L = A.target, j = { x: A.clientX, y: A.clientY };
6508
6494
  let D = { ...j }, U = !1, W = !1, Z = [], he;
6509
- const Y = Ct({
6495
+ const Y = Et({
6510
6496
  x: j.x + -z.value.left,
6511
6497
  y: j.y + -z.value.top
6512
6498
  }, _(p.value));
6513
6499
  if (A.button === 2) {
6514
6500
  if (!Y) {
6515
- const ee = t.activeStrategy({
6501
+ const te = t.activeStrategy({
6516
6502
  element: L,
6517
6503
  oldElement: N,
6518
6504
  event: A,
6519
6505
  isExcluded: x
6520
6506
  });
6521
- ee && !(ee instanceof G) ? Z = ee.element ? [ee.element] : [] : Z = ee ? [ee] : [], p.value = Z;
6507
+ te && !(te instanceof G) ? Z = te.element ? [te.element] : [] : Z = te ? [te] : [], p.value = Z;
6522
6508
  }
6523
6509
  return;
6524
6510
  }
6525
- function xe(ee) {
6526
- const se = t.activeStrategy({
6511
+ function xe(te) {
6512
+ const ie = t.activeStrategy({
6527
6513
  element: L,
6528
6514
  oldElement: N,
6529
- event: ee,
6515
+ event: te,
6530
6516
  isExcluded: x
6531
6517
  });
6532
- se && !(se instanceof G) ? Z = se.element ? [se.element] : [] : Z = se ? [se] : [], p.value = Z;
6518
+ ie && !(ie instanceof G) ? Z = ie.element ? [ie.element] : [] : Z = ie ? [ie] : [], p.value = Z;
6533
6519
  }
6534
- function oe() {
6520
+ function ae() {
6535
6521
  d.value !== "selecting" && (d.value = "selecting"), k.value = {
6536
6522
  left: Math.min(j.x, D.x) - z.value.left,
6537
6523
  top: Math.min(j.y, D.y) - z.value.top,
@@ -6540,55 +6526,55 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6540
6526
  }, Z = v(k.value);
6541
6527
  }
6542
6528
  function ve() {
6543
- const ee = t.activeStrategy({
6529
+ const te = t.activeStrategy({
6544
6530
  element: L,
6545
6531
  oldElement: N,
6546
6532
  event: A,
6547
6533
  isExcluded: () => !1
6548
6534
  });
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] : [];
6535
+ let ie;
6536
+ 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
6537
  }
6552
6538
  function ye() {
6553
6539
  return !U && (Math.abs(D.x - j.x) >= 3 || Math.abs(D.y - j.y) >= 3);
6554
6540
  }
6555
- function J(ee) {
6556
- Y ? ye() && (U = !0, y("startTransform")) : L && !h(L) && ye() && (U = !0, xe(ee), Pe(() => {
6541
+ function J(te) {
6542
+ Y ? ye() && (U = !0, y("startTransform")) : L && !h(L) && ye() && (U = !0, xe(te), Re(() => {
6557
6543
  W || y("startTransform");
6558
6544
  }));
6559
6545
  }
6560
- function me(ee) {
6561
- D = { x: ee.clientX, y: ee.clientY }, Y || (!L || h(L)) && oe();
6546
+ function me(te) {
6547
+ D = { x: te.clientX, y: te.clientY }, Y || (!L || h(L)) && ae();
6562
6548
  }
6563
- async function ce(ee) {
6549
+ async function ue(te) {
6564
6550
  if (d.value && (d.value = void 0), !U) {
6565
6551
  if (L && ve(), p.value = Z, he && Z[0] && !f(Z[0]))
6566
6552
  switch (he) {
6567
6553
  case "typing": {
6568
- await y("startTyping", ee);
6554
+ await y("startTyping", te);
6569
6555
  break;
6570
6556
  }
6571
6557
  }
6572
6558
  w(A);
6573
6559
  }
6574
- i.value.off("pointermove", J), document.removeEventListener("pointermove", me), document.removeEventListener("pointerup", ce), W = !0;
6560
+ i.value.off("pointermove", J), document.removeEventListener("pointermove", me), document.removeEventListener("pointerup", ue), W = !0;
6575
6561
  }
6576
- i.value.on("pointermove", J), document.addEventListener("pointermove", me), document.addEventListener("pointerup", ce);
6562
+ i.value.on("pointermove", J), document.addEventListener("pointermove", me), document.addEventListener("pointerup", ue);
6577
6563
  }
6578
6564
  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));
6565
+ A.srcElement === r.value && (I.value = { x: A.clientX, y: A.clientY }, !(l.value.grabbing || A.button === 1 || d.value && d.value !== "typing") && w(A));
6580
6566
  }
6581
6567
  function P() {
6582
- $.value = void 0, u.value = void 0, g(void 0);
6568
+ I.value = void 0, u.value = void 0, g(void 0);
6583
6569
  }
6584
6570
  function B() {
6585
6571
  r.value && (r.value.scrollLeft && (r.value.scrollLeft = 0), r.value.scrollTop && (r.value.scrollTop = 0));
6586
6572
  }
6587
- return (A, N) => (I(), le(ja, { class: "mce-editor" }, {
6588
- default: re(() => [
6589
- H(Va),
6590
- H(Xa, null, {
6591
- default: re(() => [
6573
+ return (A, N) => (O(), oe(Va, { class: "mce-editor" }, {
6574
+ default: ne(() => [
6575
+ H(Da),
6576
+ H(Ua, null, {
6577
+ default: ne(() => [
6592
6578
  F("div", {
6593
6579
  ref_key: "drawboardDom",
6594
6580
  ref: r,
@@ -6596,137 +6582,181 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
6596
6582
  "data-pixel-ratio": S(i).pixelRatio,
6597
6583
  onDblclick: N[0] || (N[0] = (L) => n("dblclick:drawboard", L)),
6598
6584
  onScroll: B,
6599
- onWheel: N[1] || (N[1] = We(() => {
6585
+ onWheel: N[1] || (N[1] = Ke(() => {
6600
6586
  }, ["prevent"]))
6601
6587
  }, [
6602
- F("canvas", Di, null, 512),
6603
- H(wi, { ref: "textEditorTpl" }, null, 512),
6604
- H(Qs),
6605
- H(ka),
6606
- H(wa),
6607
- H(ya),
6608
- H(Da, {
6588
+ F("canvas", Li, null, 512),
6589
+ H(bi, { ref: "textEditorTpl" }, null, 512),
6590
+ H(Zs),
6591
+ H(_a),
6592
+ H(ba),
6593
+ H(va),
6594
+ H(La, {
6609
6595
  ref: "selectorTpl",
6610
6596
  "selected-area": k.value,
6611
6597
  "resize-strategy": S(p)[0] ? t.resizeStrategy(S(p)[0]) : void 0
6612
6598
  }, {
6613
- transformable: re(({ box: L }) => [
6614
- te(A.$slots, "transformer", { box: L })
6599
+ transformable: ne(({ box: L }) => [
6600
+ Q(A.$slots, "transformer", { box: L })
6615
6601
  ]),
6616
- default: re(({ box: L }) => [
6617
- te(A.$slots, "selector", { box: L })
6602
+ default: ne(({ box: L }) => [
6603
+ Q(A.$slots, "selector", { box: L })
6618
6604
  ]),
6619
6605
  _: 3
6620
6606
  }, 8, ["selected-area", "resize-strategy"]),
6621
- S(a).scrollbar ? (I(), le($a, { key: 0 })) : Q("", !0),
6622
- A.$slots.floatbar ? (I(), le(ga, {
6607
+ S(a).scrollbar ? (O(), oe($a, { key: 0 })) : ee("", !0),
6608
+ A.$slots.floatbar ? (O(), oe(ya, {
6623
6609
  key: 1,
6624
6610
  target: S(d) === "typing" ? b.value?.textEditor : m.value?.transformable?.$el
6625
6611
  }, {
6626
- default: re(() => [
6627
- te(A.$slots, "floatbar")
6612
+ default: ne(() => [
6613
+ Q(A.$slots, "floatbar")
6628
6614
  ]),
6629
6615
  _: 3
6630
- }, 8, ["target"])) : Q("", !0),
6631
- H(pa),
6632
- H(xa),
6633
- S(a).ruler ? (I(), le(Ma, { key: 2 })) : Q("", !0),
6634
- te(A.$slots, "drawboard")
6635
- ], 40, Li)
6616
+ }, 8, ["target"])) : ee("", !0),
6617
+ H(fa),
6618
+ H(wa),
6619
+ S(a).ruler ? (O(), oe(Sa, { key: 2 })) : ee("", !0),
6620
+ Q(A.$slots, "drawboard")
6621
+ ], 40, Bi)
6636
6622
  ]),
6637
6623
  _: 3
6638
6624
  }),
6639
- te(A.$slots, "default"),
6640
- H(Rt, {
6625
+ Q(A.$slots, "default"),
6626
+ H(Bt, {
6641
6627
  modelValue: S(a).statusbar,
6642
6628
  "onUpdate:modelValue": N[2] || (N[2] = (L) => S(a).statusbar = L),
6643
6629
  position: "bottom",
6644
6630
  size: 24
6645
6631
  }, {
6646
- default: re(() => [
6647
- H(bi)
6632
+ default: ne(() => [
6633
+ H(gi)
6648
6634
  ]),
6649
6635
  _: 1
6650
6636
  }, 8, ["modelValue"]),
6651
- H(Rt, {
6637
+ H(Bt, {
6652
6638
  modelValue: S(a).timeline,
6653
6639
  "onUpdate:modelValue": N[3] || (N[3] = (L) => S(a).timeline = L),
6654
6640
  position: "bottom",
6655
6641
  size: 160
6656
6642
  }, {
6657
- default: re(() => [
6658
- H(Bi)
6643
+ default: ne(() => [
6644
+ H(Ri)
6659
6645
  ]),
6660
6646
  _: 1
6661
6647
  }, 8, ["modelValue"]),
6662
- F("div", Vi, null, 512)
6648
+ F("div", Di, null, 512)
6663
6649
  ]),
6664
6650
  _: 3
6665
6651
  }));
6666
6652
  }
6653
+ }), sr = /* @__PURE__ */ X({
6654
+ __name: "Dialog",
6655
+ props: /* @__PURE__ */ Oe({
6656
+ ...qe()
6657
+ }, {
6658
+ modelValue: { type: Boolean },
6659
+ modelModifiers: {}
6660
+ }),
6661
+ emits: ["update:modelValue"],
6662
+ setup(o, { expose: e }) {
6663
+ const t = o, n = ke(o, "modelValue"), s = ce("overlayTpl"), a = $(() => ({
6664
+ onClick: () => n.value = !0
6665
+ }));
6666
+ function r() {
6667
+ s.value?.updateLocation();
6668
+ }
6669
+ return e({
6670
+ isActive: n,
6671
+ updateLocation: r
6672
+ }), (i, l) => (O(), oe(ot, {
6673
+ ref: "overlayTpl",
6674
+ modelValue: n.value,
6675
+ "onUpdate:modelValue": l[0] || (l[0] = (c) => n.value = c),
6676
+ location: t.location,
6677
+ offset: t.offset,
6678
+ target: t.target,
6679
+ attach: t.attach,
6680
+ class: "mce-dialog"
6681
+ }, {
6682
+ activator: ne((c) => [
6683
+ Q(i.$slots, "activator", $e(c, {
6684
+ props: { ...c.props, ...a.value }
6685
+ }))
6686
+ ]),
6687
+ default: ne(() => [
6688
+ Q(i.$slots, "default")
6689
+ ]),
6690
+ _: 3
6691
+ }, 8, ["modelValue", "location", "offset", "target", "attach"]));
6692
+ }
6667
6693
  });
6668
6694
  export {
6695
+ sr as Dialog,
6669
6696
  un as Doc,
6670
6697
  Le as Editor,
6671
- sr as EditorLayout,
6672
- Rt as EditorLayoutItem,
6698
+ or as EditorLayout,
6699
+ Bt as EditorLayoutItem,
6673
6700
  mn as IconsSymbol,
6674
- $t as MceComponentIcon,
6701
+ It as MceComponentIcon,
6675
6702
  fn as MceLayoutItemKey,
6676
- Ke as MceLayoutKey,
6677
- Ft as MceMenuSymbol,
6678
- dt as MceOverlaySymbol,
6703
+ Je as MceLayoutKey,
6704
+ Pt as MceMenuSymbol,
6705
+ ht as MceOverlaySymbol,
6679
6706
  dn as MceSvgIcon,
6707
+ da as Menu,
6680
6708
  ln as Model,
6681
- Et as SUPPORTS_CLIPBOARD,
6682
- La as Transformable,
6683
- Zt as USER_AGENT,
6684
- tt as Workspace,
6709
+ ft as Ruler,
6710
+ Tt as SUPPORTS_CLIPBOARD,
6711
+ Rt as Scrollbar,
6712
+ Ba as Transformable,
6713
+ Qt as USER_AGENT,
6714
+ nt as Workspace,
6685
6715
  Me as boundingBoxToStyle,
6686
- er as consoleError,
6716
+ Qi as consoleError,
6687
6717
  uo as consoleWarn,
6688
- qe as convertToUnit,
6689
- Us as createIcons,
6690
- ct as createImageElement,
6691
- ia as createLayout,
6692
- lt as createTextElement,
6693
- Ks as defaultActiveStrategy,
6694
- Js as defaultHoverStrategy,
6695
- Ws as defaultResizeStrategy,
6696
- or as defineMixin,
6697
- nr as definePlugin,
6718
+ Ge as convertToUnit,
6719
+ js as createIcons,
6720
+ dt as createImageElement,
6721
+ aa as createLayout,
6722
+ ut as createTextElement,
6723
+ Ws as defaultActiveStrategy,
6724
+ Ks as defaultHoverStrategy,
6725
+ Gs as defaultResizeStrategy,
6726
+ nr as defineMixin,
6727
+ tr as definePlugin,
6698
6728
  je as findChildrenWithProvide,
6699
6729
  ho as getImageSizeFromUrl,
6700
6730
  go as getRandomValues,
6701
6731
  cn as iElementToYElements,
6702
- en as imageExtRe,
6703
- Qt as imageExts,
6732
+ ct as imageExtRe,
6733
+ en as imageExts,
6704
6734
  fo as imageMimeTypeExtMap,
6705
6735
  po as isClickInsideElement,
6706
- $e as isMac,
6736
+ Fe as isMac,
6707
6737
  Be as isOverlappingAabb,
6708
6738
  co as isOverlappingObb,
6709
- Ct as isPointInsideAabb,
6739
+ Et as isPointInsideAabb,
6710
6740
  mo as isWindows,
6711
- wt as makeIconProps,
6712
- na as makeLayoutItemProps,
6713
- ta as makeLayoutProps,
6714
- nt as makeMceOverlayProps,
6715
- Gs as makeMceStrategyProps,
6716
- Qi as minBoundingBox,
6741
+ _t as makeIconProps,
6742
+ ta as makeLayoutItemProps,
6743
+ ea as makeLayoutProps,
6744
+ qe as makeMceOverlayProps,
6745
+ qs as makeMceStrategyProps,
6746
+ Zi as minBoundingBox,
6717
6747
  os as mixins,
6718
- Bs as plugins,
6748
+ Rs as plugins,
6719
6749
  tn as propsFactory,
6720
- Ls as provideEditor,
6721
- Ys as provideOverlay,
6750
+ Bs as provideEditor,
6751
+ Hs as provideOverlay,
6722
6752
  vo as refElement,
6723
6753
  yo as templateRef,
6724
6754
  bo as uint32,
6725
6755
  de as useEditor,
6726
- Ds as useIcon,
6727
- oa as useLayout,
6728
- sa as useLayoutItem,
6729
- qs as useOverlay,
6730
- ea as useResizeObserver,
6731
- tr as uuidv4
6756
+ Ls as useIcon,
6757
+ na as useLayout,
6758
+ oa as useLayoutItem,
6759
+ Ys as useOverlay,
6760
+ Qs as useResizeObserver,
6761
+ er as uuidv4
6732
6762
  };