vue-wswg-editor 0.0.18 → 0.0.20

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.
@@ -1,4 +1,4 @@
1
- import { shallowRef as Rt, ref as j, markRaw as Jt, defineComponent as _, computed as Y, onMounted as Gt, onBeforeUnmount as rr, createElementBlock as X, openBlock as o, createElementVNode as i, toDisplayString as U, createVNode as h, unref as R, withDirectives as lt, vModelText as Zt, Fragment as tt, renderList as nt, createBlock as ut, mergeModels as Tt, useModel as rt, onBeforeMount as $t, normalizeClass as I, createCommentVNode as G, vModelSelect as ne, watch as Xt, withModifiers as Pt, createTextVNode as oe, resolveDynamicComponent as Yt, mergeProps as kt, vModelDynamic as _r, vModelCheckbox as Pr, vModelRadio as tf, renderSlot as mr, getCurrentScope as ef, onScopeDispose as rf, toValue as qt, useTemplateRef as ff, nextTick as It, withCtx as Lr, normalizeStyle as xr, createApp as nf, h as Dt } from "vue";
1
+ import { shallowRef as Rt, ref as O, markRaw as Jt, defineComponent as _, computed as Y, onMounted as Gt, onBeforeUnmount as rr, createElementBlock as X, openBlock as o, createElementVNode as i, toDisplayString as U, createVNode as h, unref as R, withDirectives as lt, vModelText as Zt, Fragment as tt, renderList as nt, createBlock as ut, mergeModels as Tt, useModel as rt, onBeforeMount as $t, normalizeClass as I, createCommentVNode as G, vModelSelect as ne, watch as Xt, withModifiers as Pt, createTextVNode as oe, resolveDynamicComponent as Yt, mergeProps as kt, vModelDynamic as _r, vModelCheckbox as Pr, vModelRadio as tf, renderSlot as Lr, getCurrentScope as ef, onScopeDispose as rf, toValue as qt, useTemplateRef as ff, nextTick as It, withCtx as xr, normalizeStyle as mr, createApp as nf, h as Dt } from "vue";
2
2
  const nv = {
3
3
  custom: (t = {}) => ({
4
4
  type: "custom",
@@ -109,7 +109,7 @@ function Nr(t) {
109
109
  const r = t.replace(/[_-]/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").split(/\s+/).filter(Boolean);
110
110
  return r.length === 0 ? "" : r.map((f) => f.charAt(0).toUpperCase() + f.slice(1).toLowerCase()).join(" ");
111
111
  }
112
- const ge = Rt({}), ve = Rt({}), Se = j({});
112
+ const ge = Rt({}), ve = Rt({}), Se = O({});
113
113
  let vf = null;
114
114
  function Ie(t) {
115
115
  if (!t || typeof t != "object") return t;
@@ -380,7 +380,7 @@ function Wf(t) {
380
380
  async function wf(t) {
381
381
  await Xf(), t && (await cf(), await Tf(), await Pf()), await Af();
382
382
  }
383
- async function xe(t, e = !0) {
383
+ async function me(t, e = !0) {
384
384
  try {
385
385
  await pf(), await of(t), await wf(e);
386
386
  } catch (r) {
@@ -514,15 +514,15 @@ const jf = /* @__PURE__ */ _({
514
514
  __name: "ResizeHandle",
515
515
  emits: ["sidebarWidth"],
516
516
  setup(t, { emit: e }) {
517
- const r = e, f = j(null), n = j(380), v = j(!1), l = j(0);
517
+ const r = e, f = O(null), n = O(380), v = O(!1), l = O(0);
518
518
  let a = null, u = null;
519
519
  function d(b) {
520
520
  v.value = !0, b.preventDefault();
521
521
  const p = b.clientX, c = n.value;
522
522
  function s(T) {
523
523
  if (!v.value) return;
524
- const W = T.clientX - p, y = Math.max(300, Math.min(800, c - W));
525
- n.value = y, r("sidebarWidth", y);
524
+ const W = T.clientX - p, w = Math.max(300, Math.min(800, c - W));
525
+ n.value = w, r("sidebarWidth", w);
526
526
  }
527
527
  function A() {
528
528
  v.value = !1, document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", A), document.body.style.cursor = "", document.body.style.userSelect = "";
@@ -560,7 +560,7 @@ const jf = /* @__PURE__ */ _({
560
560
  r[f] = n;
561
561
  return r;
562
562
  }, Of = /* @__PURE__ */ Wt(jf, [["__scopeId", "data-v-72eeade4"]]);
563
- function mf(t, e) {
563
+ function Lf(t, e) {
564
564
  return o(), X("svg", {
565
565
  xmlns: "http://www.w3.org/2000/svg",
566
566
  fill: "none",
@@ -577,7 +577,7 @@ function mf(t, e) {
577
577
  })
578
578
  ]);
579
579
  }
580
- function Lf(t, e) {
580
+ function xf(t, e) {
581
581
  return o(), X("svg", {
582
582
  xmlns: "http://www.w3.org/2000/svg",
583
583
  fill: "none",
@@ -594,7 +594,7 @@ function Lf(t, e) {
594
594
  })
595
595
  ]);
596
596
  }
597
- function xf(t, e) {
597
+ function mf(t, e) {
598
598
  return o(), X("svg", {
599
599
  xmlns: "http://www.w3.org/2000/svg",
600
600
  fill: "none",
@@ -877,7 +877,7 @@ const Ff = /* @__PURE__ */ _({
877
877
  block: {}
878
878
  },
879
879
  setup(t) {
880
- const e = t, r = j(!1), f = Y(() => Wf(e.block.path));
880
+ const e = t, r = O(!1), f = Y(() => Wf(e.block.path));
881
881
  function n(v, l) {
882
882
  if (!v.dataTransfer) return;
883
883
  const a = l.__name || l.type;
@@ -991,15 +991,15 @@ function jt(t) {
991
991
  if (typeof window < "u" && window.navigator)
992
992
  return !!/* @__PURE__ */ navigator.userAgent.match(t);
993
993
  }
994
- var mt = jt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Xe = jt(/Edge/i), cr = jt(/firefox/i), le = jt(/safari/i) && !jt(/chrome/i) && !jt(/android/i), ar = jt(/iP(ad|od|hone)/i), Jr = jt(/chrome/i) && jt(/android/i), Dr = {
994
+ var Lt = jt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Xe = jt(/Edge/i), cr = jt(/firefox/i), le = jt(/safari/i) && !jt(/chrome/i) && !jt(/android/i), ar = jt(/iP(ad|od|hone)/i), Jr = jt(/chrome/i) && jt(/android/i), Dr = {
995
995
  capture: !1,
996
996
  passive: !1
997
997
  };
998
998
  function D(t, e, r) {
999
- t.addEventListener(e, r, !mt && Dr);
999
+ t.addEventListener(e, r, !Lt && Dr);
1000
1000
  }
1001
1001
  function J(t, e, r) {
1002
- t.removeEventListener(e, r, !mt && Dr);
1002
+ t.removeEventListener(e, r, !Lt && Dr);
1003
1003
  }
1004
1004
  function Ve(t, e) {
1005
1005
  if (e) {
@@ -1041,7 +1041,7 @@ function pt(t, e, r) {
1041
1041
  t.className = (f + (r ? " " + e : "")).replace(sr, " ");
1042
1042
  }
1043
1043
  }
1044
- function x(t, e, r) {
1044
+ function m(t, e, r) {
1045
1045
  var f = t && t.style;
1046
1046
  if (f) {
1047
1047
  if (r === void 0)
@@ -1055,7 +1055,7 @@ function Et(t, e) {
1055
1055
  r = t;
1056
1056
  else
1057
1057
  do {
1058
- var f = x(t, "transform");
1058
+ var f = m(t, "transform");
1059
1059
  f && f !== "none" && (r = f + " " + r);
1060
1060
  } while (!e && (t = t.parentNode));
1061
1061
  var n = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
@@ -1078,11 +1078,11 @@ function wt() {
1078
1078
  function Q(t, e, r, f, n) {
1079
1079
  if (!(!t.getBoundingClientRect && t !== window)) {
1080
1080
  var v, l, a, u, d, P, b;
1081
- if (t !== window && t.parentNode && t !== wt() ? (v = t.getBoundingClientRect(), l = v.top, a = v.left, u = v.bottom, d = v.right, P = v.height, b = v.width) : (l = 0, a = 0, u = window.innerHeight, d = window.innerWidth, P = window.innerHeight, b = window.innerWidth), (e || r) && t !== window && (n = n || t.parentNode, !mt))
1081
+ if (t !== window && t.parentNode && t !== wt() ? (v = t.getBoundingClientRect(), l = v.top, a = v.left, u = v.bottom, d = v.right, P = v.height, b = v.width) : (l = 0, a = 0, u = window.innerHeight, d = window.innerWidth, P = window.innerHeight, b = window.innerWidth), (e || r) && t !== window && (n = n || t.parentNode, !Lt))
1082
1082
  do
1083
- if (n && n.getBoundingClientRect && (x(n, "transform") !== "none" || r && x(n, "position") !== "static")) {
1083
+ if (n && n.getBoundingClientRect && (m(n, "transform") !== "none" || r && m(n, "position") !== "static")) {
1084
1084
  var p = n.getBoundingClientRect();
1085
- l -= p.top + parseInt(x(n, "border-top-width")), a -= p.left + parseInt(x(n, "border-left-width")), u = l + v.height, d = a + v.width;
1085
+ l -= p.top + parseInt(m(n, "border-top-width")), a -= p.left + parseInt(m(n, "border-left-width")), u = l + v.height, d = a + v.width;
1086
1086
  break;
1087
1087
  }
1088
1088
  while (n = n.parentNode);
@@ -1111,7 +1111,7 @@ function Ar(t, e, r) {
1111
1111
  }
1112
1112
  function Qt(t, e, r, f) {
1113
1113
  for (var n = 0, v = 0, l = t.children; v < l.length; ) {
1114
- if (l[v].style.display !== "none" && l[v] !== m.ghost && (f || l[v] !== m.dragged) && At(l[v], r.draggable, t, !1)) {
1114
+ if (l[v].style.display !== "none" && l[v] !== L.ghost && (f || l[v] !== L.dragged) && At(l[v], r.draggable, t, !1)) {
1115
1115
  if (n === e)
1116
1116
  return l[v];
1117
1117
  n++;
@@ -1121,7 +1121,7 @@ function Qt(t, e, r, f) {
1121
1121
  return null;
1122
1122
  }
1123
1123
  function lr(t, e) {
1124
- for (var r = t.lastElementChild; r && (r === m.ghost || x(r, "display") === "none" || e && !Ve(r, e)); )
1124
+ for (var r = t.lastElementChild; r && (r === L.ghost || m(r, "display") === "none" || e && !Ve(r, e)); )
1125
1125
  r = r.previousElementSibling;
1126
1126
  return r || null;
1127
1127
  }
@@ -1130,7 +1130,7 @@ function ct(t, e) {
1130
1130
  if (!t || !t.parentNode)
1131
1131
  return -1;
1132
1132
  for (; t = t.previousElementSibling; )
1133
- t.nodeName.toUpperCase() !== "TEMPLATE" && t !== m.clone && (!e || Ve(t, e)) && r++;
1133
+ t.nodeName.toUpperCase() !== "TEMPLATE" && t !== L.clone && (!e || Ve(t, e)) && r++;
1134
1134
  return r;
1135
1135
  }
1136
1136
  function Tr(t) {
@@ -1155,7 +1155,7 @@ function Nt(t, e) {
1155
1155
  var r = t, f = !1;
1156
1156
  do
1157
1157
  if (r.clientWidth < r.scrollWidth || r.clientHeight < r.scrollHeight) {
1158
- var n = x(r);
1158
+ var n = m(r);
1159
1159
  if (r.clientWidth < r.scrollWidth && (n.overflowX == "auto" || n.overflowX == "scroll") || r.clientHeight < r.scrollHeight && (n.overflowY == "auto" || n.overflowY == "scroll")) {
1160
1160
  if (!r.getBoundingClientRect || r === document.body) return wt();
1161
1161
  if (f || e) return r;
@@ -1213,7 +1213,7 @@ function $f() {
1213
1213
  if (t = [], !!this.options.animation) {
1214
1214
  var f = [].slice.call(this.el.children);
1215
1215
  f.forEach(function(n) {
1216
- if (!(x(n, "display") === "none" || n === m.ghost)) {
1216
+ if (!(m(n, "display") === "none" || n === L.ghost)) {
1217
1217
  t.push({
1218
1218
  target: n,
1219
1219
  rect: Q(n)
@@ -1255,10 +1255,10 @@ function $f() {
1255
1255
  },
1256
1256
  animate: function(f, n, v, l) {
1257
1257
  if (l) {
1258
- x(f, "transition", ""), x(f, "transform", "");
1258
+ m(f, "transition", ""), m(f, "transform", "");
1259
1259
  var a = Et(this.el), u = a && a.a, d = a && a.d, P = (n.left - v.left) / (u || 1), b = (n.top - v.top) / (d || 1);
1260
- f.animatingX = !!P, f.animatingY = !!b, x(f, "transform", "translate3d(" + P + "px," + b + "px,0)"), this.forRepaintDummy = _f(f), x(f, "transition", "transform " + l + "ms" + (this.options.easing ? " " + this.options.easing : "")), x(f, "transform", "translate3d(0,0,0)"), typeof f.animated == "number" && clearTimeout(f.animated), f.animated = setTimeout(function() {
1261
- x(f, "transition", ""), x(f, "transform", ""), f.animated = !1, f.animatingX = !1, f.animatingY = !1;
1260
+ f.animatingX = !!P, f.animatingY = !!b, m(f, "transform", "translate3d(" + P + "px," + b + "px,0)"), this.forRepaintDummy = _f(f), m(f, "transition", "transform " + l + "ms" + (this.options.easing ? " " + this.options.easing : "")), m(f, "transform", "translate3d(0,0,0)"), typeof f.animated == "number" && clearTimeout(f.animated), f.animated = setTimeout(function() {
1261
+ m(f, "transition", ""), m(f, "transform", ""), f.animated = !1, f.animatingX = !1, f.animatingY = !1;
1262
1262
  }, l);
1263
1263
  }
1264
1264
  }
@@ -1326,42 +1326,42 @@ function en(t) {
1326
1326
  var e = t.sortable, r = t.rootEl, f = t.name, n = t.targetEl, v = t.cloneEl, l = t.toEl, a = t.fromEl, u = t.oldIndex, d = t.newIndex, P = t.oldDraggableIndex, b = t.newDraggableIndex, p = t.originalEvent, c = t.putSortable, s = t.extraEventProperties;
1327
1327
  if (e = e || r && r[bt], !!e) {
1328
1328
  var A, T = e.options, W = "on" + f.charAt(0).toUpperCase() + f.substr(1);
1329
- window.CustomEvent && !mt && !Xe ? A = new CustomEvent(f, {
1329
+ window.CustomEvent && !Lt && !Xe ? A = new CustomEvent(f, {
1330
1330
  bubbles: !0,
1331
1331
  cancelable: !0
1332
1332
  }) : (A = document.createEvent("Event"), A.initEvent(f, !0, !0)), A.to = l || r, A.from = a || r, A.item = n || r, A.clone = v, A.oldIndex = u, A.newIndex = d, A.oldDraggableIndex = P, A.newDraggableIndex = b, A.originalEvent = p, A.pullMode = c ? c.lastPutMode : void 0;
1333
- var y = St(St({}, s), ie.getEventProperties(f, e));
1334
- for (var O in y)
1335
- A[O] = y[O];
1333
+ var w = St(St({}, s), ie.getEventProperties(f, e));
1334
+ for (var j in w)
1335
+ A[j] = w[j];
1336
1336
  r && r.dispatchEvent(A), T[W] && T[W].call(e, A);
1337
1337
  }
1338
1338
  }
1339
1339
  var rn = ["evt"], dt = function(e, r) {
1340
1340
  var f = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = f.evt, v = Mf(f, rn);
1341
- ie.pluginEvent.bind(m)(e, r, St({
1342
- dragEl: S,
1341
+ ie.pluginEvent.bind(L)(e, r, St({
1342
+ dragEl: y,
1343
1343
  parentEl: M,
1344
1344
  ghostEl: N,
1345
1345
  rootEl: Z,
1346
1346
  nextEl: ht,
1347
1347
  lastDownEl: He,
1348
1348
  cloneEl: C,
1349
- cloneHidden: xt,
1349
+ cloneHidden: mt,
1350
1350
  dragStarted: te,
1351
1351
  putSortable: et,
1352
- activeSortable: m.active,
1352
+ activeSortable: L.active,
1353
1353
  originalEvent: n,
1354
1354
  oldIndex: Mt,
1355
1355
  oldDraggableIndex: de,
1356
1356
  newIndex: ot,
1357
- newDraggableIndex: Lt,
1357
+ newDraggableIndex: xt,
1358
1358
  hideGhostForTarget: Cr,
1359
1359
  unhideGhostForTarget: Mr,
1360
1360
  cloneNowHidden: function() {
1361
- xt = !0;
1361
+ mt = !0;
1362
1362
  },
1363
1363
  cloneNowShown: function() {
1364
- xt = !1;
1364
+ mt = !1;
1365
1365
  },
1366
1366
  dispatchSortableEvent: function(a) {
1367
1367
  at({
@@ -1376,23 +1376,23 @@ function at(t) {
1376
1376
  en(St({
1377
1377
  putSortable: et,
1378
1378
  cloneEl: C,
1379
- targetEl: S,
1379
+ targetEl: y,
1380
1380
  rootEl: Z,
1381
1381
  oldIndex: Mt,
1382
1382
  oldDraggableIndex: de,
1383
1383
  newIndex: ot,
1384
- newDraggableIndex: Lt
1384
+ newDraggableIndex: xt
1385
1385
  }, t));
1386
1386
  }
1387
- var S, M, N, Z, ht, He, C, xt, Mt, ot, de, Lt, se, et, Ct = !1, Ne = !1, ke = [], Kt, st, Re, Ge, Wr, wr, te, Ft, be, pe = !1, Ae = !1, je, ft, Be = [], $e = !1, qe = [], Ke = typeof document < "u", Te = ar, Sr = Xe || mt ? "cssFloat" : "float", fn = Ke && !Jr && !ar && "draggable" in document.createElement("div"), Br = function() {
1387
+ var y, M, N, Z, ht, He, C, mt, Mt, ot, de, xt, se, et, Ct = !1, Ne = !1, ke = [], Kt, st, Re, Ge, Wr, wr, te, Ft, be, pe = !1, Ae = !1, je, ft, Be = [], $e = !1, qe = [], Ke = typeof document < "u", Te = ar, Sr = Xe || Lt ? "cssFloat" : "float", fn = Ke && !Jr && !ar && "draggable" in document.createElement("div"), Br = function() {
1388
1388
  if (Ke) {
1389
- if (mt)
1389
+ if (Lt)
1390
1390
  return !1;
1391
1391
  var t = document.createElement("x");
1392
1392
  return t.style.cssText = "pointer-events:auto", t.style.pointerEvents === "auto";
1393
1393
  }
1394
1394
  }(), Fr = function(e, r) {
1395
- var f = x(e), n = parseInt(f.width) - parseInt(f.paddingLeft) - parseInt(f.paddingRight) - parseInt(f.borderLeftWidth) - parseInt(f.borderRightWidth), v = Qt(e, 0, r), l = Qt(e, 1, r), a = v && x(v), u = l && x(l), d = a && parseInt(a.marginLeft) + parseInt(a.marginRight) + Q(v).width, P = u && parseInt(u.marginLeft) + parseInt(u.marginRight) + Q(l).width;
1395
+ var f = m(e), n = parseInt(f.width) - parseInt(f.paddingLeft) - parseInt(f.paddingRight) - parseInt(f.borderLeftWidth) - parseInt(f.borderRightWidth), v = Qt(e, 0, r), l = Qt(e, 1, r), a = v && m(v), u = l && m(l), d = a && parseInt(a.marginLeft) + parseInt(a.marginRight) + Q(v).width, P = u && parseInt(u.marginLeft) + parseInt(u.marginRight) + Q(l).width;
1396
1396
  if (f.display === "flex")
1397
1397
  return f.flexDirection === "column" || f.flexDirection === "column-reverse" ? "vertical" : "horizontal";
1398
1398
  if (f.display === "grid")
@@ -1436,16 +1436,16 @@ var S, M, N, Z, ht, He, C, xt, Mt, ot, de, Lt, se, et, Ct = !1, Ne = !1, ke = []
1436
1436
  name: n
1437
1437
  }), f.name = n.name, f.checkPull = r(n.pull, !0), f.checkPut = r(n.put), f.revertClone = n.revertClone, e.group = f;
1438
1438
  }, Cr = function() {
1439
- !Br && N && x(N, "display", "none");
1439
+ !Br && N && m(N, "display", "none");
1440
1440
  }, Mr = function() {
1441
- !Br && N && x(N, "display", "");
1441
+ !Br && N && m(N, "display", "");
1442
1442
  };
1443
1443
  Ke && !Jr && document.addEventListener("click", function(t) {
1444
1444
  if (Ne)
1445
1445
  return t.preventDefault(), t.stopPropagation && t.stopPropagation(), t.stopImmediatePropagation && t.stopImmediatePropagation(), Ne = !1, !1;
1446
1446
  }, !0);
1447
1447
  var gt = function(e) {
1448
- if (S) {
1448
+ if (y) {
1449
1449
  e = e.touches ? e.touches[0] : e;
1450
1450
  var r = vn(e.clientX, e.clientY);
1451
1451
  if (r) {
@@ -1456,9 +1456,9 @@ var gt = function(e) {
1456
1456
  }
1457
1457
  }
1458
1458
  }, an = function(e) {
1459
- S && S.parentNode[bt]._isOutsideThisEl(e.target);
1459
+ y && y.parentNode[bt]._isOutsideThisEl(e.target);
1460
1460
  };
1461
- function m(t, e) {
1461
+ function L(t, e) {
1462
1462
  if (!(t && t.nodeType && t.nodeType === 1))
1463
1463
  throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));
1464
1464
  this.el = t, this.options = e = Ot({}, e), t[bt] = this;
@@ -1505,7 +1505,7 @@ function m(t, e) {
1505
1505
  y: 0
1506
1506
  },
1507
1507
  // Disabled on Safari: #1571; Enabled on Safari IOS: #2244
1508
- supportPointer: m.supportPointer !== !1 && "PointerEvent" in window && (!le || ar),
1508
+ supportPointer: L.supportPointer !== !1 && "PointerEvent" in window && (!le || ar),
1509
1509
  emptyInsertThreshold: 5
1510
1510
  };
1511
1511
  ie.initializePlugins(this, t, r);
@@ -1516,19 +1516,19 @@ function m(t, e) {
1516
1516
  n.charAt(0) === "_" && typeof this[n] == "function" && (this[n] = this[n].bind(this));
1517
1517
  this.nativeDraggable = e.forceFallback ? !1 : fn, this.nativeDraggable && (this.options.touchStartThreshold = 1), e.supportPointer ? D(t, "pointerdown", this._onTapStart) : (D(t, "mousedown", this._onTapStart), D(t, "touchstart", this._onTapStart)), this.nativeDraggable && (D(t, "dragover", this), D(t, "dragenter", this)), ke.push(this.el), e.store && e.store.get && this.sort(e.store.get(this) || []), Ot(this, $f());
1518
1518
  }
1519
- m.prototype = /** @lends Sortable.prototype */
1519
+ L.prototype = /** @lends Sortable.prototype */
1520
1520
  {
1521
- constructor: m,
1521
+ constructor: L,
1522
1522
  _isOutsideThisEl: function(e) {
1523
1523
  !this.el.contains(e) && e !== this.el && (Ft = null);
1524
1524
  },
1525
1525
  _getDirection: function(e, r) {
1526
- return typeof this.options.direction == "function" ? this.options.direction.call(this, e, r, S) : this.options.direction;
1526
+ return typeof this.options.direction == "function" ? this.options.direction.call(this, e, r, y) : this.options.direction;
1527
1527
  },
1528
1528
  _onTapStart: function(e) {
1529
1529
  if (e.cancelable) {
1530
1530
  var r = this, f = this.el, n = this.options, v = n.preventOnFilter, l = e.type, a = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, u = (a || e).target, d = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || u, P = n.filter;
1531
- if (Xn(f), !S && !(/mousedown|pointerdown/.test(l) && e.button !== 0 || n.disabled) && !d.isContentEditable && !(!this.nativeDraggable && le && u && u.tagName.toUpperCase() === "SELECT") && (u = At(u, n.draggable, f, !1), !(u && u.animated) && He !== u)) {
1531
+ if (Xn(f), !y && !(/mousedown|pointerdown/.test(l) && e.button !== 0 || n.disabled) && !d.isContentEditable && !(!this.nativeDraggable && le && u && u.tagName.toUpperCase() === "SELECT") && (u = At(u, n.draggable, f, !1), !(u && u.animated) && He !== u)) {
1532
1532
  if (Mt = ct(u), de = ct(u, n.draggable), typeof P == "function") {
1533
1533
  if (P.call(this, e, u, this)) {
1534
1534
  at({
@@ -1565,30 +1565,30 @@ m.prototype = /** @lends Sortable.prototype */
1565
1565
  },
1566
1566
  _prepareDragStart: function(e, r, f) {
1567
1567
  var n = this, v = n.el, l = n.options, a = v.ownerDocument, u;
1568
- if (f && !S && f.parentNode === v) {
1568
+ if (f && !y && f.parentNode === v) {
1569
1569
  var d = Q(f);
1570
- if (Z = v, S = f, M = S.parentNode, ht = S.nextSibling, He = f, se = l.group, m.dragged = S, Kt = {
1571
- target: S,
1570
+ if (Z = v, y = f, M = y.parentNode, ht = y.nextSibling, He = f, se = l.group, L.dragged = y, Kt = {
1571
+ target: y,
1572
1572
  clientX: (r || e).clientX,
1573
1573
  clientY: (r || e).clientY
1574
- }, Wr = Kt.clientX - d.left, wr = Kt.clientY - d.top, this._lastX = (r || e).clientX, this._lastY = (r || e).clientY, S.style["will-change"] = "all", u = function() {
1574
+ }, Wr = Kt.clientX - d.left, wr = Kt.clientY - d.top, this._lastX = (r || e).clientX, this._lastY = (r || e).clientY, y.style["will-change"] = "all", u = function() {
1575
1575
  if (dt("delayEnded", n, {
1576
1576
  evt: e
1577
- }), m.eventCanceled) {
1577
+ }), L.eventCanceled) {
1578
1578
  n._onDrop();
1579
1579
  return;
1580
1580
  }
1581
- n._disableDelayedDragEvents(), !cr && n.nativeDraggable && (S.draggable = !0), n._triggerDragStart(e, r), at({
1581
+ n._disableDelayedDragEvents(), !cr && n.nativeDraggable && (y.draggable = !0), n._triggerDragStart(e, r), at({
1582
1582
  sortable: n,
1583
1583
  name: "choose",
1584
1584
  originalEvent: e
1585
- }), pt(S, l.chosenClass, !0);
1585
+ }), pt(y, l.chosenClass, !0);
1586
1586
  }, l.ignore.split(",").forEach(function(P) {
1587
- gr(S, P.trim(), Fe);
1588
- }), D(a, "dragover", gt), D(a, "mousemove", gt), D(a, "touchmove", gt), l.supportPointer ? (D(a, "pointerup", n._onDrop), !this.nativeDraggable && D(a, "pointercancel", n._onDrop)) : (D(a, "mouseup", n._onDrop), D(a, "touchend", n._onDrop), D(a, "touchcancel", n._onDrop)), cr && this.nativeDraggable && (this.options.touchStartThreshold = 4, S.draggable = !0), dt("delayStart", this, {
1587
+ gr(y, P.trim(), Fe);
1588
+ }), D(a, "dragover", gt), D(a, "mousemove", gt), D(a, "touchmove", gt), l.supportPointer ? (D(a, "pointerup", n._onDrop), !this.nativeDraggable && D(a, "pointercancel", n._onDrop)) : (D(a, "mouseup", n._onDrop), D(a, "touchend", n._onDrop), D(a, "touchcancel", n._onDrop)), cr && this.nativeDraggable && (this.options.touchStartThreshold = 4, y.draggable = !0), dt("delayStart", this, {
1589
1589
  evt: e
1590
- }), l.delay && (!l.delayOnTouchOnly || r) && (!this.nativeDraggable || !(Xe || mt))) {
1591
- if (m.eventCanceled) {
1590
+ }), l.delay && (!l.delayOnTouchOnly || r) && (!this.nativeDraggable || !(Xe || Lt))) {
1591
+ if (L.eventCanceled) {
1592
1592
  this._onDrop();
1593
1593
  return;
1594
1594
  }
@@ -1602,14 +1602,14 @@ m.prototype = /** @lends Sortable.prototype */
1602
1602
  Math.max(Math.abs(r.clientX - this._lastX), Math.abs(r.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
1603
1603
  },
1604
1604
  _disableDelayedDrag: function() {
1605
- S && Fe(S), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
1605
+ y && Fe(y), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
1606
1606
  },
1607
1607
  _disableDelayedDragEvents: function() {
1608
1608
  var e = this.el.ownerDocument;
1609
1609
  J(e, "mouseup", this._disableDelayedDrag), J(e, "touchend", this._disableDelayedDrag), J(e, "touchcancel", this._disableDelayedDrag), J(e, "pointerup", this._disableDelayedDrag), J(e, "pointercancel", this._disableDelayedDrag), J(e, "mousemove", this._delayedDragTouchMoveHandler), J(e, "touchmove", this._delayedDragTouchMoveHandler), J(e, "pointermove", this._delayedDragTouchMoveHandler);
1610
1610
  },
1611
1611
  _triggerDragStart: function(e, r) {
1612
- r = r || e.pointerType == "touch" && e, !this.nativeDraggable || r ? this.options.supportPointer ? D(document, "pointermove", this._onTouchMove) : r ? D(document, "touchmove", this._onTouchMove) : D(document, "mousemove", this._onTouchMove) : (D(S, "dragend", this), D(Z, "dragstart", this._onDragStart));
1612
+ r = r || e.pointerType == "touch" && e, !this.nativeDraggable || r ? this.options.supportPointer ? D(document, "pointermove", this._onTouchMove) : r ? D(document, "touchmove", this._onTouchMove) : D(document, "mousemove", this._onTouchMove) : (D(y, "dragend", this), D(Z, "dragstart", this._onDragStart));
1613
1613
  try {
1614
1614
  document.selection ? Oe(function() {
1615
1615
  document.selection.empty();
@@ -1618,12 +1618,12 @@ m.prototype = /** @lends Sortable.prototype */
1618
1618
  }
1619
1619
  },
1620
1620
  _dragStarted: function(e, r) {
1621
- if (Ct = !1, Z && S) {
1621
+ if (Ct = !1, Z && y) {
1622
1622
  dt("dragStarted", this, {
1623
1623
  evt: r
1624
1624
  }), this.nativeDraggable && D(document, "dragover", an);
1625
1625
  var f = this.options;
1626
- !e && pt(S, f.dragClass, !1), pt(S, f.ghostClass, !0), m.active = this, e && this._appendGhost(), at({
1626
+ !e && pt(y, f.dragClass, !1), pt(y, f.ghostClass, !0), L.active = this, e && this._appendGhost(), at({
1627
1627
  sortable: this,
1628
1628
  name: "start",
1629
1629
  originalEvent: r
@@ -1636,7 +1636,7 @@ m.prototype = /** @lends Sortable.prototype */
1636
1636
  this._lastX = st.clientX, this._lastY = st.clientY, Cr();
1637
1637
  for (var e = document.elementFromPoint(st.clientX, st.clientY), r = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(st.clientX, st.clientY), e !== r); )
1638
1638
  r = e;
1639
- if (S.parentNode[bt]._isOutsideThisEl(e), r)
1639
+ if (y.parentNode[bt]._isOutsideThisEl(e), r)
1640
1640
  do {
1641
1641
  if (r[bt]) {
1642
1642
  var f = void 0;
@@ -1656,7 +1656,7 @@ m.prototype = /** @lends Sortable.prototype */
1656
1656
  _onTouchMove: function(e) {
1657
1657
  if (Kt) {
1658
1658
  var r = this.options, f = r.fallbackTolerance, n = r.fallbackOffset, v = e.touches ? e.touches[0] : e, l = N && Et(N, !0), a = N && l && l.a, u = N && l && l.d, d = Te && ft && Tr(ft), P = (v.clientX - Kt.clientX + n.x) / (a || 1) + (d ? d[0] - Be[0] : 0) / (a || 1), b = (v.clientY - Kt.clientY + n.y) / (u || 1) + (d ? d[1] - Be[1] : 0) / (u || 1);
1659
- if (!m.active && !Ct) {
1659
+ if (!L.active && !Ct) {
1660
1660
  if (f && Math.max(Math.abs(v.clientX - this._lastX), Math.abs(v.clientY - this._lastY)) < f)
1661
1661
  return;
1662
1662
  this._onDragStart(e, !0);
@@ -1671,40 +1671,40 @@ m.prototype = /** @lends Sortable.prototype */
1671
1671
  f: b
1672
1672
  };
1673
1673
  var p = "matrix(".concat(l.a, ",").concat(l.b, ",").concat(l.c, ",").concat(l.d, ",").concat(l.e, ",").concat(l.f, ")");
1674
- x(N, "webkitTransform", p), x(N, "mozTransform", p), x(N, "msTransform", p), x(N, "transform", p), Re = P, Ge = b, st = v;
1674
+ m(N, "webkitTransform", p), m(N, "mozTransform", p), m(N, "msTransform", p), m(N, "transform", p), Re = P, Ge = b, st = v;
1675
1675
  }
1676
1676
  e.cancelable && e.preventDefault();
1677
1677
  }
1678
1678
  },
1679
1679
  _appendGhost: function() {
1680
1680
  if (!N) {
1681
- var e = this.options.fallbackOnBody ? document.body : Z, r = Q(S, !0, Te, !0, e), f = this.options;
1681
+ var e = this.options.fallbackOnBody ? document.body : Z, r = Q(y, !0, Te, !0, e), f = this.options;
1682
1682
  if (Te) {
1683
- for (ft = e; x(ft, "position") === "static" && x(ft, "transform") === "none" && ft !== document; )
1683
+ for (ft = e; m(ft, "position") === "static" && m(ft, "transform") === "none" && ft !== document; )
1684
1684
  ft = ft.parentNode;
1685
1685
  ft !== document.body && ft !== document.documentElement ? (ft === document && (ft = wt()), r.top += ft.scrollTop, r.left += ft.scrollLeft) : ft = wt(), Be = Tr(ft);
1686
1686
  }
1687
- N = S.cloneNode(!0), pt(N, f.ghostClass, !1), pt(N, f.fallbackClass, !0), pt(N, f.dragClass, !0), x(N, "transition", ""), x(N, "transform", ""), x(N, "box-sizing", "border-box"), x(N, "margin", 0), x(N, "top", r.top), x(N, "left", r.left), x(N, "width", r.width), x(N, "height", r.height), x(N, "opacity", "0.8"), x(N, "position", Te ? "absolute" : "fixed"), x(N, "zIndex", "100000"), x(N, "pointerEvents", "none"), m.ghost = N, e.appendChild(N), x(N, "transform-origin", Wr / parseInt(N.style.width) * 100 + "% " + wr / parseInt(N.style.height) * 100 + "%");
1687
+ N = y.cloneNode(!0), pt(N, f.ghostClass, !1), pt(N, f.fallbackClass, !0), pt(N, f.dragClass, !0), m(N, "transition", ""), m(N, "transform", ""), m(N, "box-sizing", "border-box"), m(N, "margin", 0), m(N, "top", r.top), m(N, "left", r.left), m(N, "width", r.width), m(N, "height", r.height), m(N, "opacity", "0.8"), m(N, "position", Te ? "absolute" : "fixed"), m(N, "zIndex", "100000"), m(N, "pointerEvents", "none"), L.ghost = N, e.appendChild(N), m(N, "transform-origin", Wr / parseInt(N.style.width) * 100 + "% " + wr / parseInt(N.style.height) * 100 + "%");
1688
1688
  }
1689
1689
  },
1690
1690
  _onDragStart: function(e, r) {
1691
1691
  var f = this, n = e.dataTransfer, v = f.options;
1692
1692
  if (dt("dragStart", this, {
1693
1693
  evt: e
1694
- }), m.eventCanceled) {
1694
+ }), L.eventCanceled) {
1695
1695
  this._onDrop();
1696
1696
  return;
1697
1697
  }
1698
- dt("setupClone", this), m.eventCanceled || (C = Rr(S), C.removeAttribute("id"), C.draggable = !1, C.style["will-change"] = "", this._hideClone(), pt(C, this.options.chosenClass, !1), m.clone = C), f.cloneId = Oe(function() {
1699
- dt("clone", f), !m.eventCanceled && (f.options.removeCloneOnHide || Z.insertBefore(C, S), f._hideClone(), at({
1698
+ dt("setupClone", this), L.eventCanceled || (C = Rr(y), C.removeAttribute("id"), C.draggable = !1, C.style["will-change"] = "", this._hideClone(), pt(C, this.options.chosenClass, !1), L.clone = C), f.cloneId = Oe(function() {
1699
+ dt("clone", f), !L.eventCanceled && (f.options.removeCloneOnHide || Z.insertBefore(C, y), f._hideClone(), at({
1700
1700
  sortable: f,
1701
1701
  name: "clone"
1702
1702
  }));
1703
- }), !r && pt(S, v.dragClass, !0), r ? (Ne = !0, f._loopId = setInterval(f._emulateDragOver, 50)) : (J(document, "mouseup", f._onDrop), J(document, "touchend", f._onDrop), J(document, "touchcancel", f._onDrop), n && (n.effectAllowed = "move", v.setData && v.setData.call(f, n, S)), D(document, "drop", f), x(S, "transform", "translateZ(0)")), Ct = !0, f._dragStartId = Oe(f._dragStarted.bind(f, r, e)), D(document, "selectstart", f), te = !0, window.getSelection().removeAllRanges(), le && x(document.body, "user-select", "none");
1703
+ }), !r && pt(y, v.dragClass, !0), r ? (Ne = !0, f._loopId = setInterval(f._emulateDragOver, 50)) : (J(document, "mouseup", f._onDrop), J(document, "touchend", f._onDrop), J(document, "touchcancel", f._onDrop), n && (n.effectAllowed = "move", v.setData && v.setData.call(f, n, y)), D(document, "drop", f), m(y, "transform", "translateZ(0)")), Ct = !0, f._dragStartId = Oe(f._dragStarted.bind(f, r, e)), D(document, "selectstart", f), te = !0, window.getSelection().removeAllRanges(), le && m(document.body, "user-select", "none");
1704
1704
  },
1705
1705
  // Returns true - if no further action is needed (either inserted or another condition)
1706
1706
  _onDragOver: function(e) {
1707
- var r = this.el, f = e.target, n, v, l, a = this.options, u = a.group, d = m.active, P = se === u, b = a.sort, p = et || d, c, s = this, A = !1;
1707
+ var r = this.el, f = e.target, n, v, l, a = this.options, u = a.group, d = L.active, P = se === u, b = a.sort, p = et || d, c, s = this, A = !1;
1708
1708
  if ($e) return;
1709
1709
  function T(yt, _t) {
1710
1710
  dt(yt, s, St({
@@ -1717,74 +1717,74 @@ m.prototype = /** @lends Sortable.prototype */
1717
1717
  canSort: b,
1718
1718
  fromSortable: p,
1719
1719
  target: f,
1720
- completed: y,
1720
+ completed: w,
1721
1721
  onMove: function(or, $r) {
1722
- return We(Z, r, S, n, or, Q(or), e, $r);
1722
+ return We(Z, r, y, n, or, Q(or), e, $r);
1723
1723
  },
1724
- changed: O
1724
+ changed: j
1725
1725
  }, _t));
1726
1726
  }
1727
1727
  function W() {
1728
1728
  T("dragOverAnimationCapture"), s.captureAnimationState(), s !== p && p.captureAnimationState();
1729
1729
  }
1730
- function y(yt) {
1730
+ function w(yt) {
1731
1731
  return T("dragOverCompleted", {
1732
1732
  insertion: yt
1733
- }), yt && (P ? d._hideClone() : d._showClone(s), s !== p && (pt(S, et ? et.options.ghostClass : d.options.ghostClass, !1), pt(S, a.ghostClass, !0)), et !== s && s !== m.active ? et = s : s === m.active && et && (et = null), p === s && (s._ignoreWhileAnimating = f), s.animateAll(function() {
1733
+ }), yt && (P ? d._hideClone() : d._showClone(s), s !== p && (pt(y, et ? et.options.ghostClass : d.options.ghostClass, !1), pt(y, a.ghostClass, !0)), et !== s && s !== L.active ? et = s : s === L.active && et && (et = null), p === s && (s._ignoreWhileAnimating = f), s.animateAll(function() {
1734
1734
  T("dragOverAnimationComplete"), s._ignoreWhileAnimating = null;
1735
- }), s !== p && (p.animateAll(), p._ignoreWhileAnimating = null)), (f === S && !S.animated || f === r && !f.animated) && (Ft = null), !a.dragoverBubble && !e.rootEl && f !== document && (S.parentNode[bt]._isOutsideThisEl(e.target), !yt && gt(e)), !a.dragoverBubble && e.stopPropagation && e.stopPropagation(), A = !0;
1735
+ }), s !== p && (p.animateAll(), p._ignoreWhileAnimating = null)), (f === y && !y.animated || f === r && !f.animated) && (Ft = null), !a.dragoverBubble && !e.rootEl && f !== document && (y.parentNode[bt]._isOutsideThisEl(e.target), !yt && gt(e)), !a.dragoverBubble && e.stopPropagation && e.stopPropagation(), A = !0;
1736
1736
  }
1737
- function O() {
1738
- ot = ct(S), Lt = ct(S, a.draggable), at({
1737
+ function j() {
1738
+ ot = ct(y), xt = ct(y, a.draggable), at({
1739
1739
  sortable: s,
1740
1740
  name: "change",
1741
1741
  toEl: r,
1742
1742
  newIndex: ot,
1743
- newDraggableIndex: Lt,
1743
+ newDraggableIndex: xt,
1744
1744
  originalEvent: e
1745
1745
  });
1746
1746
  }
1747
- if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), f = At(f, a.draggable, r, !0), T("dragOver"), m.eventCanceled) return A;
1748
- if (S.contains(e.target) || f.animated && f.animatingX && f.animatingY || s._ignoreWhileAnimating === f)
1749
- return y(!1);
1750
- if (Ne = !1, d && !a.disabled && (P ? b || (l = M !== Z) : et === this || (this.lastPutMode = se.checkPull(this, d, S, e)) && u.checkPut(this, d, S, e))) {
1751
- if (c = this._getDirection(e, f) === "vertical", n = Q(S), T("dragOverValid"), m.eventCanceled) return A;
1747
+ if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), f = At(f, a.draggable, r, !0), T("dragOver"), L.eventCanceled) return A;
1748
+ if (y.contains(e.target) || f.animated && f.animatingX && f.animatingY || s._ignoreWhileAnimating === f)
1749
+ return w(!1);
1750
+ if (Ne = !1, d && !a.disabled && (P ? b || (l = M !== Z) : et === this || (this.lastPutMode = se.checkPull(this, d, y, e)) && u.checkPut(this, d, y, e))) {
1751
+ if (c = this._getDirection(e, f) === "vertical", n = Q(y), T("dragOverValid"), L.eventCanceled) return A;
1752
1752
  if (l)
1753
- return M = Z, W(), this._hideClone(), T("revert"), m.eventCanceled || (ht ? Z.insertBefore(S, ht) : Z.appendChild(S)), y(!0);
1753
+ return M = Z, W(), this._hideClone(), T("revert"), L.eventCanceled || (ht ? Z.insertBefore(y, ht) : Z.appendChild(y)), w(!0);
1754
1754
  var z = lr(r, a.draggable);
1755
1755
  if (!z || bn(e, c, this) && !z.animated) {
1756
- if (z === S)
1757
- return y(!1);
1758
- if (z && r === e.target && (f = z), f && (v = Q(f)), We(Z, r, S, n, f, v, e, !!f) !== !1)
1759
- return W(), z && z.nextSibling ? r.insertBefore(S, z.nextSibling) : r.appendChild(S), M = r, O(), y(!0);
1756
+ if (z === y)
1757
+ return w(!1);
1758
+ if (z && r === e.target && (f = z), f && (v = Q(f)), We(Z, r, y, n, f, v, e, !!f) !== !1)
1759
+ return W(), z && z.nextSibling ? r.insertBefore(y, z.nextSibling) : r.appendChild(y), M = r, j(), w(!0);
1760
1760
  } else if (z && dn(e, c, this)) {
1761
1761
  var k = Qt(r, 0, a, !0);
1762
- if (k === S)
1763
- return y(!1);
1764
- if (f = k, v = Q(f), We(Z, r, S, n, f, v, e, !1) !== !1)
1765
- return W(), r.insertBefore(S, k), M = r, O(), y(!0);
1762
+ if (k === y)
1763
+ return w(!1);
1764
+ if (f = k, v = Q(f), We(Z, r, y, n, f, v, e, !1) !== !1)
1765
+ return W(), r.insertBefore(y, k), M = r, j(), w(!0);
1766
1766
  } else if (f.parentNode === r) {
1767
1767
  v = Q(f);
1768
- var H = 0, L, w = S.parentNode !== r, V = !nn(S.animated && S.toRect || n, f.animated && f.toRect || v, c), q = c ? "top" : "left", K = Ar(f, "top", "top") || Ar(S, "top", "top"), B = K ? K.scrollTop : void 0;
1769
- Ft !== f && (L = v[q], pe = !1, Ae = !V && a.invertSwap || w), H = pn(e, f, v, c, V ? 1 : a.swapThreshold, a.invertedSwapThreshold == null ? a.swapThreshold : a.invertedSwapThreshold, Ae, Ft === f);
1768
+ var H = 0, x, S = y.parentNode !== r, V = !nn(y.animated && y.toRect || n, f.animated && f.toRect || v, c), q = c ? "top" : "left", K = Ar(f, "top", "top") || Ar(y, "top", "top"), B = K ? K.scrollTop : void 0;
1769
+ Ft !== f && (x = v[q], pe = !1, Ae = !V && a.invertSwap || S), H = pn(e, f, v, c, V ? 1 : a.swapThreshold, a.invertedSwapThreshold == null ? a.swapThreshold : a.invertedSwapThreshold, Ae, Ft === f);
1770
1770
  var F;
1771
1771
  if (H !== 0) {
1772
- var g = ct(S);
1772
+ var g = ct(y);
1773
1773
  do
1774
1774
  g -= H, F = M.children[g];
1775
- while (F && (x(F, "display") === "none" || F === N));
1775
+ while (F && (m(F, "display") === "none" || F === N));
1776
1776
  }
1777
1777
  if (H === 0 || F === f)
1778
- return y(!1);
1778
+ return w(!1);
1779
1779
  Ft = f, be = H;
1780
1780
  var vt = f.nextElementSibling, $ = !1;
1781
1781
  $ = H === 1;
1782
- var it = We(Z, r, S, n, f, v, e, $);
1782
+ var it = We(Z, r, y, n, f, v, e, $);
1783
1783
  if (it !== !1)
1784
- return (it === 1 || it === -1) && ($ = it === 1), $e = !0, setTimeout(un, 30), W(), $ && !vt ? r.appendChild(S) : f.parentNode.insertBefore(S, $ ? vt : f), K && Ur(K, 0, B - K.scrollTop), M = S.parentNode, L !== void 0 && !Ae && (je = Math.abs(L - Q(f)[q])), O(), y(!0);
1784
+ return (it === 1 || it === -1) && ($ = it === 1), $e = !0, setTimeout(un, 30), W(), $ && !vt ? r.appendChild(y) : f.parentNode.insertBefore(y, $ ? vt : f), K && Ur(K, 0, B - K.scrollTop), M = y.parentNode, x !== void 0 && !Ae && (je = Math.abs(x - Q(f)[q])), j(), w(!0);
1785
1785
  }
1786
- if (r.contains(S))
1787
- return y(!1);
1786
+ if (r.contains(y))
1787
+ return w(!1);
1788
1788
  }
1789
1789
  return !1;
1790
1790
  },
@@ -1798,13 +1798,13 @@ m.prototype = /** @lends Sortable.prototype */
1798
1798
  },
1799
1799
  _onDrop: function(e) {
1800
1800
  var r = this.el, f = this.options;
1801
- if (ot = ct(S), Lt = ct(S, f.draggable), dt("drop", this, {
1801
+ if (ot = ct(y), xt = ct(y, f.draggable), dt("drop", this, {
1802
1802
  evt: e
1803
- }), M = S && S.parentNode, ot = ct(S), Lt = ct(S, f.draggable), m.eventCanceled) {
1803
+ }), M = y && y.parentNode, ot = ct(y), xt = ct(y, f.draggable), L.eventCanceled) {
1804
1804
  this._nulling();
1805
1805
  return;
1806
1806
  }
1807
- Ct = !1, Ae = !1, pe = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), _e(this.cloneId), _e(this._dragStartId), this.nativeDraggable && (J(document, "drop", this), J(r, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), le && x(document.body, "user-select", ""), x(S, "transform", ""), e && (te && (e.cancelable && e.preventDefault(), !f.dropBubble && e.stopPropagation()), N && N.parentNode && N.parentNode.removeChild(N), (Z === M || et && et.lastPutMode !== "clone") && C && C.parentNode && C.parentNode.removeChild(C), S && (this.nativeDraggable && J(S, "dragend", this), Fe(S), S.style["will-change"] = "", te && !Ct && pt(S, et ? et.options.ghostClass : this.options.ghostClass, !1), pt(S, this.options.chosenClass, !1), at({
1807
+ Ct = !1, Ae = !1, pe = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), _e(this.cloneId), _e(this._dragStartId), this.nativeDraggable && (J(document, "drop", this), J(r, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), le && m(document.body, "user-select", ""), m(y, "transform", ""), e && (te && (e.cancelable && e.preventDefault(), !f.dropBubble && e.stopPropagation()), N && N.parentNode && N.parentNode.removeChild(N), (Z === M || et && et.lastPutMode !== "clone") && C && C.parentNode && C.parentNode.removeChild(C), y && (this.nativeDraggable && J(y, "dragend", this), Fe(y), y.style["will-change"] = "", te && !Ct && pt(y, et ? et.options.ghostClass : this.options.ghostClass, !1), pt(y, this.options.chosenClass, !1), at({
1808
1808
  sortable: this,
1809
1809
  name: "unchoose",
1810
1810
  toEl: M,
@@ -1843,7 +1843,7 @@ m.prototype = /** @lends Sortable.prototype */
1843
1843
  name: "sort",
1844
1844
  toEl: M,
1845
1845
  originalEvent: e
1846
- })), m.active && ((ot == null || ot === -1) && (ot = Mt, Lt = de), at({
1846
+ })), L.active && ((ot == null || ot === -1) && (ot = Mt, xt = de), at({
1847
1847
  sortable: this,
1848
1848
  name: "end",
1849
1849
  toEl: M,
@@ -1851,7 +1851,7 @@ m.prototype = /** @lends Sortable.prototype */
1851
1851
  }), this.save()))), this._nulling();
1852
1852
  },
1853
1853
  _nulling: function() {
1854
- dt("nulling", this), Z = S = M = N = ht = C = He = xt = Kt = st = te = ot = Lt = Mt = de = Ft = be = et = se = m.dragged = m.ghost = m.clone = m.active = null, qe.forEach(function(e) {
1854
+ dt("nulling", this), Z = y = M = N = ht = C = He = mt = Kt = st = te = ot = xt = Mt = de = Ft = be = et = se = L.dragged = L.ghost = L.clone = L.active = null, qe.forEach(function(e) {
1855
1855
  e.checked = !0;
1856
1856
  }), qe.length = Re = Ge = 0;
1857
1857
  },
@@ -1863,7 +1863,7 @@ m.prototype = /** @lends Sortable.prototype */
1863
1863
  break;
1864
1864
  case "dragenter":
1865
1865
  case "dragover":
1866
- S && (this._onDragOver(e), ln(e));
1866
+ y && (this._onDragOver(e), ln(e));
1867
1867
  break;
1868
1868
  case "selectstart":
1869
1869
  e.preventDefault();
@@ -1932,9 +1932,9 @@ m.prototype = /** @lends Sortable.prototype */
1932
1932
  }), this._onDrop(), this._disableDelayedDragEvents(), ke.splice(ke.indexOf(this.el), 1), this.el = e = null;
1933
1933
  },
1934
1934
  _hideClone: function() {
1935
- if (!xt) {
1936
- if (dt("hideClone", this), m.eventCanceled) return;
1937
- x(C, "display", "none"), this.options.removeCloneOnHide && C.parentNode && C.parentNode.removeChild(C), xt = !0;
1935
+ if (!mt) {
1936
+ if (dt("hideClone", this), L.eventCanceled) return;
1937
+ m(C, "display", "none"), this.options.removeCloneOnHide && C.parentNode && C.parentNode.removeChild(C), mt = !0;
1938
1938
  }
1939
1939
  },
1940
1940
  _showClone: function(e) {
@@ -1942,9 +1942,9 @@ m.prototype = /** @lends Sortable.prototype */
1942
1942
  this._hideClone();
1943
1943
  return;
1944
1944
  }
1945
- if (xt) {
1946
- if (dt("showClone", this), m.eventCanceled) return;
1947
- S.parentNode == Z && !this.options.group.revertClone ? Z.insertBefore(C, S) : ht ? Z.insertBefore(C, ht) : Z.appendChild(C), this.options.group.revertClone && this.animate(S, C), x(C, "display", ""), xt = !1;
1945
+ if (mt) {
1946
+ if (dt("showClone", this), L.eventCanceled) return;
1947
+ y.parentNode == Z && !this.options.group.revertClone ? Z.insertBefore(C, y) : ht ? Z.insertBefore(C, ht) : Z.appendChild(C), this.options.group.revertClone && this.animate(y, C), m(C, "display", ""), mt = !1;
1948
1948
  }
1949
1949
  }
1950
1950
  };
@@ -1953,7 +1953,7 @@ function ln(t) {
1953
1953
  }
1954
1954
  function We(t, e, r, f, n, v, l, a) {
1955
1955
  var u, d = t[bt], P = d.options.onMove, b;
1956
- return window.CustomEvent && !mt && !Xe ? u = new CustomEvent("move", {
1956
+ return window.CustomEvent && !Lt && !Xe ? u = new CustomEvent("move", {
1957
1957
  bubbles: !0,
1958
1958
  cancelable: !0
1959
1959
  }) : (u = document.createEvent("Event"), u.initEvent("move", !0, !0)), u.to = e, u.from = t, u.dragged = r, u.draggedRect = f, u.related = n || e, u.relatedRect = v || Q(e), u.willInsertAfter = a, u.originalEvent = l, t.dispatchEvent(u), P && (b = P.call(d, u, l)), b;
@@ -1986,7 +1986,7 @@ function pn(t, e, r, f, n, v, l, a) {
1986
1986
  return p = p || l, p && (u < P + d * v / 2 || u > b - d * v / 2) ? u > P + d / 2 ? 1 : -1 : 0;
1987
1987
  }
1988
1988
  function on(t) {
1989
- return ct(S) < ct(t) ? 1 : -1;
1989
+ return ct(y) < ct(t) ? 1 : -1;
1990
1990
  }
1991
1991
  function Pn(t) {
1992
1992
  for (var e = t.tagName + t.className + t.src + t.href + t.textContent, r = e.length, f = 0; r--; )
@@ -2007,12 +2007,12 @@ function _e(t) {
2007
2007
  return clearTimeout(t);
2008
2008
  }
2009
2009
  Ke && D(document, "touchmove", function(t) {
2010
- (m.active || Ct) && t.cancelable && t.preventDefault();
2010
+ (L.active || Ct) && t.cancelable && t.preventDefault();
2011
2011
  });
2012
- m.utils = {
2012
+ L.utils = {
2013
2013
  on: D,
2014
2014
  off: J,
2015
- css: x,
2015
+ css: m,
2016
2016
  find: gr,
2017
2017
  is: function(e, r) {
2018
2018
  return !!At(e, r, e, !1);
@@ -2029,22 +2029,22 @@ m.utils = {
2029
2029
  getChild: Qt,
2030
2030
  expando: bt
2031
2031
  };
2032
- m.get = function(t) {
2032
+ L.get = function(t) {
2033
2033
  return t[bt];
2034
2034
  };
2035
- m.mount = function() {
2035
+ L.mount = function() {
2036
2036
  for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++)
2037
2037
  e[r] = arguments[r];
2038
2038
  e[0].constructor === Array && (e = e[0]), e.forEach(function(f) {
2039
2039
  if (!f.prototype || !f.prototype.constructor)
2040
2040
  throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(f));
2041
- f.utils && (m.utils = St(St({}, m.utils), f.utils)), ie.mount(f);
2041
+ f.utils && (L.utils = St(St({}, L.utils), f.utils)), ie.mount(f);
2042
2042
  });
2043
2043
  };
2044
- m.create = function(t, e) {
2045
- return new m(t, e);
2044
+ L.create = function(t, e) {
2045
+ return new L(t, e);
2046
2046
  };
2047
- m.version = Yf;
2047
+ L.version = Yf;
2048
2048
  var E = [], ee, tr, er = !1, Ze, Ce, Je, re;
2049
2049
  function cn() {
2050
2050
  function t() {
@@ -2068,7 +2068,7 @@ function cn() {
2068
2068
  !this.options.dragOverBubble && !f.rootEl && this._handleAutoScroll(f);
2069
2069
  },
2070
2070
  drop: function() {
2071
- this.sortable.nativeDraggable ? J(document, "dragover", this._handleAutoScroll) : (J(document, "pointermove", this._handleFallbackAutoScroll), J(document, "touchmove", this._handleFallbackAutoScroll), J(document, "mousemove", this._handleFallbackAutoScroll)), yr(), me(), Qf();
2071
+ this.sortable.nativeDraggable ? J(document, "dragover", this._handleAutoScroll) : (J(document, "pointermove", this._handleFallbackAutoScroll), J(document, "touchmove", this._handleFallbackAutoScroll), J(document, "mousemove", this._handleFallbackAutoScroll)), yr(), Le(), Qf();
2072
2072
  },
2073
2073
  nulling: function() {
2074
2074
  Je = tr = ee = er = re = Ze = Ce = null, E.length = 0;
@@ -2078,16 +2078,16 @@ function cn() {
2078
2078
  },
2079
2079
  _handleAutoScroll: function(r, f) {
2080
2080
  var n = this, v = (r.touches ? r.touches[0] : r).clientX, l = (r.touches ? r.touches[0] : r).clientY, a = document.elementFromPoint(v, l);
2081
- if (Je = r, f || this.options.forceAutoScrollFallback || Xe || mt || le) {
2081
+ if (Je = r, f || this.options.forceAutoScrollFallback || Xe || Lt || le) {
2082
2082
  Me(r, this.options, a, f);
2083
2083
  var u = Nt(a, !0);
2084
2084
  er && (!re || v !== Ze || l !== Ce) && (re && yr(), re = setInterval(function() {
2085
2085
  var d = Nt(document.elementFromPoint(v, l), !0);
2086
- d !== u && (u = d, me()), Me(r, n.options, d, f);
2086
+ d !== u && (u = d, Le()), Me(r, n.options, d, f);
2087
2087
  }, 10), Ze = v, Ce = l);
2088
2088
  } else {
2089
2089
  if (!this.options.bubbleScroll || Nt(a, !0) === wt()) {
2090
- me();
2090
+ Le();
2091
2091
  return;
2092
2092
  }
2093
2093
  Me(r, this.options, Nt(a, !1), !1);
@@ -2098,7 +2098,7 @@ function cn() {
2098
2098
  initializeByDefault: !0
2099
2099
  });
2100
2100
  }
2101
- function me() {
2101
+ function Le() {
2102
2102
  E.forEach(function(t) {
2103
2103
  clearInterval(t.pid);
2104
2104
  }), E = [];
@@ -2109,19 +2109,19 @@ function yr() {
2109
2109
  var Me = hr(function(t, e, r, f) {
2110
2110
  if (e.scroll) {
2111
2111
  var n = (t.touches ? t.touches[0] : t).clientX, v = (t.touches ? t.touches[0] : t).clientY, l = e.scrollSensitivity, a = e.scrollSpeed, u = wt(), d = !1, P;
2112
- tr !== r && (tr = r, me(), ee = e.scroll, P = e.scrollFn, ee === !0 && (ee = Nt(r, !0)));
2112
+ tr !== r && (tr = r, Le(), ee = e.scroll, P = e.scrollFn, ee === !0 && (ee = Nt(r, !0)));
2113
2113
  var b = 0, p = ee;
2114
2114
  do {
2115
- var c = p, s = Q(c), A = s.top, T = s.bottom, W = s.left, y = s.right, O = s.width, z = s.height, k = void 0, H = void 0, L = c.scrollWidth, w = c.scrollHeight, V = x(c), q = c.scrollLeft, K = c.scrollTop;
2116
- c === u ? (k = O < L && (V.overflowX === "auto" || V.overflowX === "scroll" || V.overflowX === "visible"), H = z < w && (V.overflowY === "auto" || V.overflowY === "scroll" || V.overflowY === "visible")) : (k = O < L && (V.overflowX === "auto" || V.overflowX === "scroll"), H = z < w && (V.overflowY === "auto" || V.overflowY === "scroll"));
2117
- var B = k && (Math.abs(y - n) <= l && q + O < L) - (Math.abs(W - n) <= l && !!q), F = H && (Math.abs(T - v) <= l && K + z < w) - (Math.abs(A - v) <= l && !!K);
2115
+ var c = p, s = Q(c), A = s.top, T = s.bottom, W = s.left, w = s.right, j = s.width, z = s.height, k = void 0, H = void 0, x = c.scrollWidth, S = c.scrollHeight, V = m(c), q = c.scrollLeft, K = c.scrollTop;
2116
+ c === u ? (k = j < x && (V.overflowX === "auto" || V.overflowX === "scroll" || V.overflowX === "visible"), H = z < S && (V.overflowY === "auto" || V.overflowY === "scroll" || V.overflowY === "visible")) : (k = j < x && (V.overflowX === "auto" || V.overflowX === "scroll"), H = z < S && (V.overflowY === "auto" || V.overflowY === "scroll"));
2117
+ var B = k && (Math.abs(w - n) <= l && q + j < x) - (Math.abs(W - n) <= l && !!q), F = H && (Math.abs(T - v) <= l && K + z < S) - (Math.abs(A - v) <= l && !!K);
2118
2118
  if (!E[b])
2119
2119
  for (var g = 0; g <= b; g++)
2120
2120
  E[g] || (E[g] = {});
2121
2121
  (E[b].vx != B || E[b].vy != F || E[b].el !== c) && (E[b].el = c, E[b].vx = B, E[b].vy = F, clearInterval(E[b].pid), (B != 0 || F != 0) && (d = !0, E[b].pid = setInterval((function() {
2122
- f && this.layer === 0 && m.active._onTouchMove(Je);
2122
+ f && this.layer === 0 && L.active._onTouchMove(Je);
2123
2123
  var vt = E[this.layer].vy ? E[this.layer].vy * a : 0, $ = E[this.layer].vx ? E[this.layer].vx * a : 0;
2124
- typeof P == "function" && P.call(m.dragged.parentNode[bt], $, vt, t, Je, E[this.layer].el) !== "continue" || Ur(E[this.layer].el, $, vt);
2124
+ typeof P == "function" && P.call(L.dragged.parentNode[bt], $, vt, t, Je, E[this.layer].el) !== "continue" || Ur(E[this.layer].el, $, vt);
2125
2125
  }).bind({
2126
2126
  layer: b
2127
2127
  }), 24))), b++;
@@ -2171,18 +2171,18 @@ dr.prototype = {
2171
2171
  Ot(dr, {
2172
2172
  pluginName: "removeOnSpill"
2173
2173
  });
2174
- m.mount(new cn());
2175
- m.mount(dr, ur);
2174
+ L.mount(new cn());
2175
+ L.mount(dr, ur);
2176
2176
  const sn = /* @__PURE__ */ _({
2177
2177
  __name: "BlockBrowser",
2178
2178
  setup(t) {
2179
- const e = j(""), r = Y(() => Ht.value ? Object.values(Ht.value).filter((v) => {
2179
+ const e = O(""), r = Y(() => Ht.value ? Object.values(Ht.value).filter((v) => {
2180
2180
  var l, a;
2181
2181
  return ((l = v.type) == null ? void 0 : l.toLowerCase().includes(e.value.toLowerCase())) || ((a = v.label) == null ? void 0 : a.toLowerCase().includes(e.value.toLowerCase()));
2182
2182
  }) : []), f = Y(() => Ht.value ? Object.values(Ht.value).length : 0);
2183
2183
  function n() {
2184
2184
  const v = document.getElementById("available-blocks-list");
2185
- v && f.value && new m(v, {
2185
+ v && f.value && new L(v, {
2186
2186
  animation: 150,
2187
2187
  ghostClass: "sortable-ghost",
2188
2188
  chosenClass: "sortable-chosen",
@@ -2252,7 +2252,7 @@ const sn = /* @__PURE__ */ _({
2252
2252
  set: (b) => {
2253
2253
  r.value = b;
2254
2254
  }
2255
- }), n = j([]);
2255
+ }), n = O([]);
2256
2256
  $t(() => {
2257
2257
  var b;
2258
2258
  Array.isArray(f.value) || (f.value = []), f.value = ((b = f.value) == null ? void 0 : b.map((p) => ({
@@ -2404,7 +2404,7 @@ const sn = /* @__PURE__ */ _({
2404
2404
  }),
2405
2405
  emits: ["update:modelValue"],
2406
2406
  setup(t) {
2407
- const e = t, r = j(!1), f = j(e.fieldConfig.default), n = rt(t, "modelValue"), v = () => {
2407
+ const e = t, r = O(!1), f = O(e.fieldConfig.default), n = rt(t, "modelValue"), v = () => {
2408
2408
  var a, u;
2409
2409
  r.value = !r.value, r.value ? (f.value = ((a = n.value) == null ? void 0 : a.top) || ((u = n.value) == null ? void 0 : u.bottom) || e.fieldConfig.default || "", n.value = { top: f.value || "", bottom: f.value || "" }) : n.value = {
2410
2410
  top: f.value || e.fieldConfig.default || "",
@@ -2451,7 +2451,7 @@ const sn = /* @__PURE__ */ _({
2451
2451
  title: "Top Margin"
2452
2452
  }, [
2453
2453
  i("span", { class: "pointer-events-none absolute left-0 top-0 inline-flex h-full items-center justify-center border-r border-gray-300 px-3 text-xs" }, [
2454
- h(R(xf), { class: "size-3" })
2454
+ h(R(mf), { class: "size-3" })
2455
2455
  ]),
2456
2456
  lt(i("select", {
2457
2457
  "onUpdate:modelValue": u[1] || (u[1] = (d) => n.value.top = d),
@@ -2473,7 +2473,7 @@ const sn = /* @__PURE__ */ _({
2473
2473
  title: "Bottom Margin"
2474
2474
  }, [
2475
2475
  i("span", { class: "pointer-events-none absolute left-0 top-0 inline-flex h-full items-center justify-center border-r border-gray-300 px-3 text-xs" }, [
2476
- h(R(mf), { class: "size-3" })
2476
+ h(R(Lf), { class: "size-3" })
2477
2477
  ]),
2478
2478
  lt(i("select", {
2479
2479
  "onUpdate:modelValue": u[2] || (u[2] = (d) => n.value.bottom = d),
@@ -2521,7 +2521,7 @@ const sn = /* @__PURE__ */ _({
2521
2521
  },
2522
2522
  emits: ["update:modelValue"],
2523
2523
  setup(t, { emit: e }) {
2524
- const r = t, f = e, n = j(null), v = j(r.modelValue || null), l = j(!1), a = j(!1), u = j(null), d = j(null);
2524
+ const r = t, f = e, n = O(null), v = O(r.modelValue || null), l = O(!1), a = O(!1), u = O(null), d = O(null);
2525
2525
  Xt(
2526
2526
  () => r.modelValue,
2527
2527
  (z) => {
@@ -2535,8 +2535,8 @@ const sn = /* @__PURE__ */ _({
2535
2535
  !r.editable || l.value || (z = n.value) == null || z.click();
2536
2536
  }
2537
2537
  function b(z) {
2538
- var L;
2539
- const H = (L = z.target.files) == null ? void 0 : L[0];
2538
+ var x;
2539
+ const H = (x = z.target.files) == null ? void 0 : x[0];
2540
2540
  H && T(H);
2541
2541
  }
2542
2542
  function p(z) {
@@ -2571,34 +2571,34 @@ const sn = /* @__PURE__ */ _({
2571
2571
  }
2572
2572
  }
2573
2573
  async function W(z) {
2574
- return r.uploadUrl ? y(z, r.uploadUrl) : new Promise((k) => {
2574
+ return r.uploadUrl ? w(z, r.uploadUrl) : new Promise((k) => {
2575
2575
  const H = new FileReader();
2576
- H.onload = (L) => {
2576
+ H.onload = (x) => {
2577
2577
  var V;
2578
- const w = (V = L.target) == null ? void 0 : V.result;
2579
- k(w);
2578
+ const S = (V = x.target) == null ? void 0 : V.result;
2579
+ k(S);
2580
2580
  }, H.onerror = () => {
2581
2581
  k(null);
2582
2582
  }, H.readAsDataURL(z);
2583
2583
  });
2584
2584
  }
2585
- async function y(z, k) {
2585
+ async function w(z, k) {
2586
2586
  try {
2587
2587
  const H = new FormData();
2588
2588
  H.append("file", z);
2589
- const L = await fetch(k, {
2589
+ const x = await fetch(k, {
2590
2590
  method: "POST",
2591
2591
  body: H
2592
2592
  });
2593
- if (!L.ok)
2594
- throw new Error(`Upload failed: ${L.statusText}`);
2595
- const w = await L.json();
2596
- return w.url || w.imageUrl || w.path || null;
2593
+ if (!x.ok)
2594
+ throw new Error(`Upload failed: ${x.statusText}`);
2595
+ const S = await x.json();
2596
+ return S.url || S.imageUrl || S.path || null;
2597
2597
  } catch (H) {
2598
2598
  throw console.error("Custom upload error:", H), H;
2599
2599
  }
2600
2600
  }
2601
- function O() {
2601
+ function j() {
2602
2602
  !r.editable || l.value || (v.value && v.value.startsWith("blob:") && URL.revokeObjectURL(v.value), v.value = null, d.value = null, u.value = null, n.value && (n.value.value = ""));
2603
2603
  }
2604
2604
  return (z, k) => (o(), X("div", { class: "image-upload-field mb-2" }, [
@@ -2628,7 +2628,7 @@ const sn = /* @__PURE__ */ _({
2628
2628
  type: "button",
2629
2629
  class: "absolute -right-1 -top-1 rounded-full bg-red-500 p-0.5 text-white shadow-sm hover:bg-red-600",
2630
2630
  title: "Remove image",
2631
- onClick: Pt(O, ["stop"])
2631
+ onClick: Pt(j, ["stop"])
2632
2632
  }, [
2633
2633
  (o(), X("svg", {
2634
2634
  xmlns: "http://www.w3.org/2000/svg",
@@ -2802,7 +2802,7 @@ const sn = /* @__PURE__ */ _({
2802
2802
  }),
2803
2803
  emits: ["update:modelValue"],
2804
2804
  setup(t) {
2805
- const e = rt(t, "modelValue"), r = t, f = j(null), n = Y({
2805
+ const e = rt(t, "modelValue"), r = t, f = O(null), n = Y({
2806
2806
  get: () => Array.isArray(e.value) ? e.value : e.value !== null && e.value !== void 0 ? [e.value] : [],
2807
2807
  set: (P) => {
2808
2808
  e.value = P.length > 0 ? P : [];
@@ -3066,7 +3066,7 @@ const sn = /* @__PURE__ */ _({
3066
3066
  }),
3067
3067
  emits: ["update:modelValue"],
3068
3068
  setup(t) {
3069
- const e = rt(t, "modelValue"), r = j(""), f = Y(() => n.value.length ? t.fields && Object.keys(t.fields).length > 0 ? Object.fromEntries(Object.entries(t.fields).filter(([v, l]) => (l == null ? void 0 : l.group) === r.value)) : t.fields || {} : t.fields || {}), n = Y(() => !t.fields || Object.keys(t.fields).length === 0 ? [] : Object.keys(t.fields).some((v) => {
3069
+ const e = rt(t, "modelValue"), r = O(""), f = Y(() => n.value.length ? t.fields && Object.keys(t.fields).length > 0 ? Object.fromEntries(Object.entries(t.fields).filter(([v, l]) => (l == null ? void 0 : l.group) === r.value)) : t.fields || {} : t.fields || {}), n = Y(() => !t.fields || Object.keys(t.fields).length === 0 ? [] : Object.keys(t.fields).some((v) => {
3070
3070
  var l;
3071
3071
  return (l = t.fields[v]) == null ? void 0 : l.group;
3072
3072
  }) ? Object.keys(t.fields).reduce((v, l) => {
@@ -3133,7 +3133,7 @@ const sn = /* @__PURE__ */ _({
3133
3133
  }),
3134
3134
  emits: /* @__PURE__ */ Tt(["block-click"], ["update:modelValue", "update:hoveredBlockId"]),
3135
3135
  setup(t, { emit: e }) {
3136
- const r = e, f = rt(t, "modelValue"), n = rt(t, "hoveredBlockId"), v = j(!1), l = t, a = Y(() => {
3136
+ const r = e, f = rt(t, "modelValue"), n = rt(t, "hoveredBlockId"), v = O(!1), l = t, a = Y(() => {
3137
3137
  var P;
3138
3138
  return (P = f.value) != null && P[l.blocksKey] ? f.value[l.blocksKey].map((b) => {
3139
3139
  const p = Ut(b.type);
@@ -3152,7 +3152,7 @@ const sn = /* @__PURE__ */ _({
3152
3152
  }
3153
3153
  function d() {
3154
3154
  const P = document.getElementById("page-blocks-list");
3155
- P && new m(P, {
3155
+ P && new L(P, {
3156
3156
  animation: 150,
3157
3157
  ghostClass: "sortable-ghost",
3158
3158
  chosenClass: "sortable-chosen",
@@ -3165,8 +3165,8 @@ const sn = /* @__PURE__ */ _({
3165
3165
  v.value = !1;
3166
3166
  const { oldIndex: p, newIndex: c } = b;
3167
3167
  if (p !== c) {
3168
- const y = (A = (s = f.value) == null ? void 0 : s[l.blocksKey]) == null ? void 0 : A.splice(p, 1)[0];
3169
- (W = (T = f.value) == null ? void 0 : T[l.blocksKey]) == null || W.splice(c, 0, y);
3168
+ const w = (A = (s = f.value) == null ? void 0 : s[l.blocksKey]) == null ? void 0 : A.splice(p, 1)[0];
3169
+ (W = (T = f.value) == null ? void 0 : T[l.blocksKey]) == null || W.splice(c, 0, w);
3170
3170
  }
3171
3171
  }
3172
3172
  });
@@ -3210,7 +3210,7 @@ const sn = /* @__PURE__ */ _({
3210
3210
  }),
3211
3211
  emits: /* @__PURE__ */ Tt(["close"], ["update:modelValue"]),
3212
3212
  setup(t, { emit: e }) {
3213
- const r = e, f = rt(t, "modelValue"), n = j({}), v = t, l = Y(() => Object.values(zt.value) || []);
3213
+ const r = e, f = rt(t, "modelValue"), n = O({}), v = t, l = Y(() => Object.values(zt.value) || []);
3214
3214
  function a() {
3215
3215
  var d;
3216
3216
  const u = f.value[v.settingsKey].layout;
@@ -3264,7 +3264,7 @@ const sn = /* @__PURE__ */ _({
3264
3264
  ])
3265
3265
  ]));
3266
3266
  }
3267
- }), mn = /* @__PURE__ */ Wt(On, [["__scopeId", "data-v-ebf4fdcf"]]), Ln = /* @__PURE__ */ _({
3267
+ }), Ln = /* @__PURE__ */ Wt(On, [["__scopeId", "data-v-ebf4fdcf"]]), xn = /* @__PURE__ */ _({
3268
3268
  __name: "PageBuilderToolbar",
3269
3269
  props: /* @__PURE__ */ Tt({
3270
3270
  hasPageSettings: { type: Boolean }
@@ -3280,7 +3280,7 @@ const sn = /* @__PURE__ */ _({
3280
3280
  setup(t) {
3281
3281
  const e = rt(t, "editorViewport"), r = rt(t, "activeBlock"), f = rt(t, "showPageSettings");
3282
3282
  return (n, v) => (o(), X("div", { class: "flex divide-x divide-gray-300 border-b border-gray-300" }, [
3283
- mr(n.$slots, "default"),
3283
+ Lr(n.$slots, "default"),
3284
3284
  t.hasPageSettings ? (o(), X("div", {
3285
3285
  key: 0,
3286
3286
  class: "ml-auto inline-flex gap-2 px-5 py-2.5"
@@ -3322,7 +3322,7 @@ const sn = /* @__PURE__ */ _({
3322
3322
  ])
3323
3323
  ]));
3324
3324
  }
3325
- }), xn = /* @__PURE__ */ _({
3325
+ }), mn = /* @__PURE__ */ _({
3326
3326
  __name: "PageBuilderSidebar",
3327
3327
  props: /* @__PURE__ */ Tt({
3328
3328
  editable: { type: Boolean, default: !0 },
@@ -3356,10 +3356,10 @@ const sn = /* @__PURE__ */ _({
3356
3356
  const c = Ut(p);
3357
3357
  if (!c)
3358
3358
  return r.value;
3359
- const s = r.value.id, A = ((W = (T = e.value) == null ? void 0 : T[a.blocksKey]) == null ? void 0 : W.find((y) => y.id === s)) || r.value;
3359
+ const s = r.value.id, A = ((W = (T = e.value) == null ? void 0 : T[a.blocksKey]) == null ? void 0 : W.find((w) => w.id === s)) || r.value;
3360
3360
  return new Proxy({}, {
3361
- get(y, O) {
3362
- return O === "data" ? new Proxy(A, {
3361
+ get(w, j) {
3362
+ return j === "data" ? new Proxy(A, {
3363
3363
  get(z, k) {
3364
3364
  return z[k];
3365
3365
  },
@@ -3375,25 +3375,25 @@ const sn = /* @__PURE__ */ _({
3375
3375
  getOwnPropertyDescriptor(z, k) {
3376
3376
  return Object.getOwnPropertyDescriptor(z, k);
3377
3377
  }
3378
- }) : c[O];
3378
+ }) : c[j];
3379
3379
  },
3380
- set(y, O) {
3381
- return O in c;
3380
+ set(w, j) {
3381
+ return j in c;
3382
3382
  },
3383
- has(y, O) {
3384
- return O === "data" || O in c;
3383
+ has(w, j) {
3384
+ return j === "data" || j in c;
3385
3385
  },
3386
3386
  ownKeys() {
3387
3387
  return ["data", ...Object.keys(c)];
3388
3388
  },
3389
- getOwnPropertyDescriptor(y, O) {
3390
- if (O === "data")
3389
+ getOwnPropertyDescriptor(w, j) {
3390
+ if (j === "data")
3391
3391
  return {
3392
3392
  enumerable: !0,
3393
3393
  configurable: !0
3394
3394
  };
3395
- if (O in c)
3396
- return Object.getOwnPropertyDescriptor(c, O);
3395
+ if (j in c)
3396
+ return Object.getOwnPropertyDescriptor(c, j);
3397
3397
  }
3398
3398
  });
3399
3399
  });
@@ -3404,15 +3404,15 @@ const sn = /* @__PURE__ */ _({
3404
3404
  a.editable && (v.value = !0);
3405
3405
  }
3406
3406
  async function b() {
3407
- var W, y, O, z;
3407
+ var W, w, j, z;
3408
3408
  if (!a.editable) return;
3409
- const p = ((W = u.value) == null ? void 0 : W.label) || ((y = u.value) == null ? void 0 : y.type);
3409
+ const p = ((W = u.value) == null ? void 0 : W.label) || ((w = u.value) == null ? void 0 : w.type);
3410
3410
  if (!window.confirm(
3411
3411
  `Are you sure you want to delete this ${p} block?
3412
3412
 
3413
3413
  This action cannot be undone.`
3414
3414
  )) return;
3415
- const s = (O = r.value) == null ? void 0 : O.id;
3415
+ const s = (j = r.value) == null ? void 0 : j.id;
3416
3416
  if (!s || !((z = e.value) != null && z[a.blocksKey])) return;
3417
3417
  const A = e.value[a.blocksKey], T = A.findIndex((k) => k.id === s);
3418
3418
  T !== -1 && A.splice(T, 1), r.value = null, f.value = null, v.value = !1;
@@ -3420,7 +3420,7 @@ This action cannot be undone.`
3420
3420
  return (p, c) => {
3421
3421
  var s, A;
3422
3422
  return o(), X("div", { class: "page-builder-sidebar" }, [
3423
- h(Ln, {
3423
+ h(xn, {
3424
3424
  editorViewport: l.value,
3425
3425
  "onUpdate:editorViewport": c[0] || (c[0] = (T) => l.value = T),
3426
3426
  showPageSettings: n.value,
@@ -3430,7 +3430,7 @@ This action cannot be undone.`
3430
3430
  class: "z-12 sticky top-0 bg-white",
3431
3431
  hasPageSettings: t.hasPageSettings
3432
3432
  }, null, 8, ["editorViewport", "showPageSettings", "activeBlock", "hasPageSettings"]),
3433
- n.value ? (o(), ut(mn, {
3433
+ n.value ? (o(), ut(Ln, {
3434
3434
  key: 0,
3435
3435
  modelValue: e.value,
3436
3436
  "onUpdate:modelValue": c[3] || (c[3] = (T) => e.value = T),
@@ -3500,7 +3500,7 @@ This action cannot be undone.`
3500
3500
  ]);
3501
3501
  };
3502
3502
  }
3503
- }), Vn = /* @__PURE__ */ Wt(xn, [["__scopeId", "data-v-07ebdb36"]]), Nn = /* @__PURE__ */ _({
3503
+ }), Vn = /* @__PURE__ */ Wt(mn, [["__scopeId", "data-v-07ebdb36"]]), Nn = /* @__PURE__ */ _({
3504
3504
  __name: "BrowserNavigation",
3505
3505
  props: {
3506
3506
  url: {}
@@ -3516,7 +3516,7 @@ This action cannot be undone.`
3516
3516
  title: "Open in new tab",
3517
3517
  class: "inline-block rounded-md p-1.5 text-xs text-zinc-300 hover:bg-zinc-500 hover:text-white"
3518
3518
  }, [
3519
- h(R(Lf), { class: "size-4" })
3519
+ h(R(xf), { class: "size-4" })
3520
3520
  ], 8, ["href"])
3521
3521
  ])
3522
3522
  ])
@@ -3572,157 +3572,7 @@ function qn() {
3572
3572
  `);
3573
3573
  }
3574
3574
  function Jn(t) {
3575
- const e = qn(), r = kn(), f = "https://unpkg.com/vue@3/dist/vue.esm-browser.js", n = "https://unpkg.com/vue-router@4/dist/vue-router.esm-browser.js", v = typeof window < "u" ? window.location.origin : "", l = `<script>
3576
- // Define Vue feature flags to prevent warnings
3577
- // These must be defined before Vue or the library code is imported
3578
- // Using var to make them available globally (not just on window)
3579
- var __VUE_OPTIONS_API__ = true;
3580
- var __VUE_PROD_DEVTOOLS__ = false;
3581
- var __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;
3582
-
3583
- // Also set on window for compatibility
3584
- window.__VUE_OPTIONS_API__ = true;
3585
- window.__VUE_PROD_DEVTOOLS__ = false;
3586
- window.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;
3587
- <\/script>`, a = t ? `<script type="module">
3588
- console.info('[iframe] Script module starting...');
3589
- console.info('[iframe] Module URL:', '${t}');
3590
-
3591
- import { createApp } from 'vue';
3592
- console.info('[iframe] Vue imported successfully');
3593
-
3594
- import * as VueRouter from 'vue-router';
3595
- console.info('[iframe] VueRouter imported successfully');
3596
- // Make vue-router available globally so it can be accessed in the iframe app
3597
- window.VueRouter = VueRouter;
3598
-
3599
- // Use dynamic import with error handling - static imports fail if module doesn't exist
3600
- console.info('[iframe] Attempting to import createIframeApp from:', '${t}');
3601
- let appInitialized = false;
3602
-
3603
- try {
3604
- const module = await import('${t}');
3605
- console.info('[iframe] Module imported successfully:', module);
3606
-
3607
- if (module && module.createIframeApp) {
3608
- const appEl = document.getElementById('app');
3609
- console.info('[iframe] App element found:', appEl);
3610
- if (appEl) {
3611
- console.info('[iframe] Calling createIframeApp...');
3612
- appInitialized = true;
3613
- module.createIframeApp(appEl).then(() => {
3614
- console.info('[iframe] createIframeApp completed successfully');
3615
- }).catch(error => {
3616
- console.error('[iframe] Failed to create iframe app:', error);
3617
- console.error('[iframe] Error stack:', error.stack);
3618
- });
3619
- } else {
3620
- console.error('[iframe] App element (#app) not found!');
3621
- }
3622
- } else {
3623
- console.error('[iframe] Module imported but createIframeApp not found');
3624
- throw new Error('createIframeApp not found in module');
3625
- }
3626
- } catch (error) {
3627
- console.error('[iframe] Failed to import module, falling back to postMessage:', error);
3628
- console.error('[iframe] Error details:', error.message, error.stack);
3629
-
3630
- // Fallback to postMessage mechanism
3631
- window.addEventListener('message', async (event) => {
3632
- console.info('[iframe] Received message (fallback):', event.data);
3633
- if (event.data.type === 'INIT_IFRAME_APP' && event.data.moduleUrl && !appInitialized) {
3634
- appInitialized = true;
3635
- console.info('[iframe] Initializing app with module URL (fallback):', event.data.moduleUrl);
3636
- try {
3637
- const { createIframeApp } = await import(event.data.moduleUrl);
3638
- console.info('[iframe] createIframeApp imported successfully (fallback)');
3639
- const appEl = document.getElementById('app');
3640
- console.info('[iframe] App element found (fallback):', appEl);
3641
- if (appEl) {
3642
- console.info('[iframe] Calling createIframeApp (fallback)...');
3643
- createIframeApp(appEl).then(() => {
3644
- console.info('[iframe] createIframeApp completed successfully (fallback)');
3645
- }).catch(err => {
3646
- console.error('[iframe] createIframeApp failed (fallback):', err);
3647
- });
3648
- } else {
3649
- console.error('[iframe] App element not found (fallback)!');
3650
- }
3651
- } catch (err) {
3652
- console.error('[iframe] Failed to load iframe app module (fallback):', err);
3653
- // Fallback: create minimal Vue app
3654
- const appEl = document.getElementById('app');
3655
- if (appEl) {
3656
- console.info('[iframe] Creating fallback Vue app');
3657
- createApp({
3658
- template: '<div class="p-4">Loading preview...</div>'
3659
- }).mount(appEl);
3660
- }
3661
- }
3662
- }
3663
- });
3664
-
3665
- // Notify parent that we need the module URL via postMessage
3666
- if (window.parent) {
3667
- console.info('[iframe] Notifying parent that iframe needs module URL');
3668
- window.parent.postMessage({ type: 'IFRAME_NEEDS_MODULE_URL' }, '*');
3669
- }
3670
- }
3671
- <\/script>` : `<script type="module">
3672
- // Fallback: Wait for parent to send module URL via postMessage
3673
- console.info('[iframe] Fallback script module starting...');
3674
- import { createApp } from 'vue';
3675
- console.info('[iframe] Vue imported successfully (fallback)');
3676
- import * as VueRouter from 'vue-router';
3677
- console.info('[iframe] VueRouter imported successfully (fallback)');
3678
- // Make vue-router available globally so it can be imported in the iframe app
3679
- window.VueRouter = VueRouter;
3680
-
3681
- let appInitialized = false;
3682
-
3683
- window.addEventListener('message', async (event) => {
3684
- console.info('[iframe] Received message:', event.data);
3685
- if (event.data.type === 'INIT_IFRAME_APP' && event.data.moduleUrl && !appInitialized) {
3686
- appInitialized = true;
3687
- console.info('[iframe] Initializing app with module URL:', event.data.moduleUrl);
3688
- try {
3689
- const { createIframeApp } = await import(event.data.moduleUrl);
3690
- console.info('[iframe] createIframeApp imported successfully (fallback)');
3691
- const appEl = document.getElementById('app');
3692
- console.info('[iframe] App element found (fallback):', appEl);
3693
- if (appEl) {
3694
- console.info('[iframe] Calling createIframeApp (fallback)...');
3695
- createIframeApp(appEl).then(() => {
3696
- console.info('[iframe] createIframeApp completed successfully (fallback)');
3697
- }).catch(error => {
3698
- console.error('[iframe] createIframeApp failed (fallback):', error);
3699
- });
3700
- } else {
3701
- console.error('[iframe] App element not found (fallback)!');
3702
- }
3703
- } catch (error) {
3704
- console.error('[iframe] Failed to load iframe app module:', error);
3705
- console.error('[iframe] Error stack:', error.stack);
3706
- // Fallback: create minimal Vue app
3707
- const appEl = document.getElementById('app');
3708
- if (appEl) {
3709
- console.info('[iframe] Creating fallback Vue app');
3710
- createApp({
3711
- template: '<div class="p-4">Loading preview...</div>'
3712
- }).mount(appEl);
3713
- }
3714
- }
3715
- }
3716
- });
3717
-
3718
- // Notify parent that we're ready to receive module URL
3719
- if (window.parent) {
3720
- console.info('[iframe] Notifying parent that iframe is ready for app');
3721
- window.parent.postMessage({ type: 'IFRAME_READY_FOR_APP' }, '*');
3722
- } else {
3723
- console.warn('[iframe] window.parent is not available');
3724
- }
3725
- <\/script>`;
3575
+ const e = qn(), r = kn(), f = "https://unpkg.com/vue@3/dist/vue.esm-browser.js", n = "https://unpkg.com/vue-router@4/dist/vue-router.esm-browser.js", v = typeof window < "u" ? window.location.origin : "";
3726
3576
  return `<!DOCTYPE html>
3727
3577
  <html lang="en">
3728
3578
  <head>
@@ -3765,8 +3615,86 @@ function Jn(t) {
3765
3615
  </head>
3766
3616
  <body>
3767
3617
  <div id="app"></div>
3768
- ${l}
3769
- ${a}
3618
+ <script>
3619
+ // Define Vue feature flags to prevent warnings
3620
+ // These must be defined before Vue or the library code is imported
3621
+ // Using var to make them available globally (not just on window)
3622
+ var __VUE_OPTIONS_API__ = true;
3623
+ var __VUE_PROD_DEVTOOLS__ = false;
3624
+ var __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;
3625
+
3626
+ // Also set on window for compatibility
3627
+ window.__VUE_OPTIONS_API__ = true;
3628
+ window.__VUE_PROD_DEVTOOLS__ = false;
3629
+ window.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;
3630
+ <\/script>
3631
+ <script type="module">
3632
+ console.info('[iframe] Script module starting...');
3633
+
3634
+ import { createApp } from 'vue';
3635
+ console.info('[iframe] Vue imported successfully');
3636
+
3637
+ import * as VueRouter from 'vue-router';
3638
+ console.info('[iframe] VueRouter imported successfully');
3639
+ // Make vue-router available globally so it can be accessed in the iframe app
3640
+ window.VueRouter = VueRouter;
3641
+
3642
+ let appInitialized = false;
3643
+
3644
+ // Always use postMessage mechanism to get the module URL
3645
+ // This works whether the library is consumed as source or bundled
3646
+ window.addEventListener('message', async (event) => {
3647
+ console.info('[iframe] Received message:', event.data);
3648
+ if (event.data.type === 'INIT_IFRAME_APP' && event.data.moduleUrl && !appInitialized) {
3649
+ appInitialized = true;
3650
+ console.info('[iframe] Initializing app with module URL:', event.data.moduleUrl);
3651
+ try {
3652
+ const { createIframeApp } = await import(event.data.moduleUrl);
3653
+ console.info('[iframe] createIframeApp imported successfully');
3654
+ const appEl = document.getElementById('app');
3655
+ console.info('[iframe] App element found:', appEl);
3656
+ if (appEl) {
3657
+ console.info('[iframe] Calling createIframeApp...');
3658
+ createIframeApp(appEl).then(() => {
3659
+ console.info('[iframe] createIframeApp completed successfully');
3660
+ }).catch(error => {
3661
+ console.error('[iframe] createIframeApp failed:', error);
3662
+ console.error('[iframe] Error stack:', error.stack);
3663
+ // Fallback: create minimal Vue app
3664
+ const appEl = document.getElementById('app');
3665
+ if (appEl) {
3666
+ console.info('[iframe] Creating fallback Vue app after error');
3667
+ createApp({
3668
+ template: '<div class="p-4">iframe fallback app (error)</div>'
3669
+ }).mount(appEl);
3670
+ }
3671
+ });
3672
+ } else {
3673
+ console.error('[iframe] App element not found!');
3674
+ }
3675
+ } catch (error) {
3676
+ console.error('[iframe] Failed to load iframe app module:', error);
3677
+ console.error('[iframe] Error stack:', error.stack);
3678
+ // Fallback: create minimal Vue app
3679
+ const appEl = document.getElementById('app');
3680
+ if (appEl) {
3681
+ console.info('[iframe] Creating fallback Vue app');
3682
+ createApp({
3683
+ template: '<div class="p-4">iframe fallback app</div>'
3684
+ }).mount(appEl);
3685
+ }
3686
+ }
3687
+ }
3688
+ });
3689
+
3690
+ // Notify parent that we're ready to receive module URL
3691
+ if (window.parent) {
3692
+ console.info('[iframe] Notifying parent that iframe is ready for app');
3693
+ window.parent.postMessage({ type: 'IFRAME_READY_FOR_APP' }, '*');
3694
+ } else {
3695
+ console.warn('[iframe] window.parent is not available');
3696
+ }
3697
+ <\/script>
3770
3698
  </body>
3771
3699
  </html>`;
3772
3700
  }
@@ -3901,7 +3829,7 @@ function fe(t) {
3901
3829
  const r = qt(t);
3902
3830
  return (e = r == null ? void 0 : r.$el) !== null && e !== void 0 ? e : r;
3903
3831
  }
3904
- function Le(...t) {
3832
+ function xe(...t) {
3905
3833
  const e = [], r = () => {
3906
3834
  e.forEach((a) => a()), e.length = 0;
3907
3835
  }, f = (a, u, d, P) => (a.addEventListener(u, d, P), () => a.removeEventListener(u, d, P)), n = Y(() => {
@@ -3933,10 +3861,10 @@ function Mn(t, e, r = {}) {
3933
3861
  } : we;
3934
3862
  let u = !0;
3935
3863
  const d = (T) => qt(n).some((W) => {
3936
- if (typeof W == "string") return Array.from(f.document.querySelectorAll(W)).some((y) => y === T.target || T.composedPath().includes(y));
3864
+ if (typeof W == "string") return Array.from(f.document.querySelectorAll(W)).some((w) => w === T.target || T.composedPath().includes(w));
3937
3865
  {
3938
- const y = fe(W);
3939
- return y && (T.target === y || T.composedPath().includes(y));
3866
+ const w = fe(W);
3867
+ return w && (T.target === w || T.composedPath().includes(w));
3940
3868
  }
3941
3869
  });
3942
3870
  function P(T) {
@@ -3944,8 +3872,8 @@ function Mn(t, e, r = {}) {
3944
3872
  return W && W.$.subTree.shapeFlag === 16;
3945
3873
  }
3946
3874
  function b(T, W) {
3947
- const y = qt(T), O = y.$.subTree && y.$.subTree.children;
3948
- return O == null || !Array.isArray(O) ? !1 : O.some((z) => z.el === W.target || W.composedPath().includes(z.el));
3875
+ const w = qt(T), j = w.$.subTree && w.$.subTree.children;
3876
+ return j == null || !Array.isArray(j) ? !1 : j.some((z) => z.el === W.target || W.composedPath().includes(z.el));
3949
3877
  }
3950
3878
  const p = (T) => {
3951
3879
  const W = fe(t);
@@ -3959,7 +3887,7 @@ function Mn(t, e, r = {}) {
3959
3887
  };
3960
3888
  let c = !1;
3961
3889
  const s = [
3962
- Le(f, "click", (T) => {
3890
+ xe(f, "click", (T) => {
3963
3891
  c || (c = !0, setTimeout(() => {
3964
3892
  c = !1;
3965
3893
  }, 0), p(T));
@@ -3967,15 +3895,15 @@ function Mn(t, e, r = {}) {
3967
3895
  passive: !0,
3968
3896
  capture: v
3969
3897
  }),
3970
- Le(f, "pointerdown", (T) => {
3898
+ xe(f, "pointerdown", (T) => {
3971
3899
  const W = fe(t);
3972
3900
  u = !d(T) && !!(W && !T.composedPath().includes(W));
3973
3901
  }, { passive: !0 }),
3974
- l && Le(f, "blur", (T) => {
3902
+ l && xe(f, "blur", (T) => {
3975
3903
  setTimeout(() => {
3976
3904
  var W;
3977
- const y = fe(t);
3978
- ((W = f.document.activeElement) === null || W === void 0 ? void 0 : W.tagName) === "IFRAME" && !(y != null && y.contains(f.document.activeElement)) && e(T);
3905
+ const w = fe(t);
3906
+ ((W = f.document.activeElement) === null || W === void 0 ? void 0 : W.tagName) === "IFRAME" && !(w != null && w.contains(f.document.activeElement)) && e(T);
3979
3907
  }, 0);
3980
3908
  }, { passive: !0 })
3981
3909
  ].filter(Boolean), A = () => s.forEach((T) => T());
@@ -3996,7 +3924,7 @@ function Qr(...t) {
3996
3924
  let e, r, f = {};
3997
3925
  t.length === 3 ? (e = t[0], r = t[1], f = t[2]) : t.length === 2 ? typeof t[1] == "object" ? (e = !0, r = t[0], f = t[1]) : (e = t[0], r = t[1]) : (e = !0, r = t[0]);
3998
3926
  const { target: n = pr, eventName: v = "keydown", passive: l = !1, dedupe: a = !1 } = f, u = Yn(e);
3999
- return Le(n, v, (P) => {
3927
+ return xe(n, v, (P) => {
4000
3928
  P.repeat && qt(a) || u(P) && r(P);
4001
3929
  }, l);
4002
3930
  }
@@ -4067,7 +3995,7 @@ const In = /* @__PURE__ */ _({
4067
3995
  },
4068
3996
  emits: ["blockAdded"],
4069
3997
  setup(t, { emit: e }) {
4070
- const r = j(!1), f = e;
3998
+ const r = O(!1), f = e;
4071
3999
  function n(u) {
4072
4000
  u.dataTransfer && (u.dataTransfer.dropEffect = "move", r.value = !0);
4073
4001
  }
@@ -4135,39 +4063,39 @@ const In = /* @__PURE__ */ _({
4135
4063
  theme: { default: "default" }
4136
4064
  },
4137
4065
  setup(t) {
4138
- const e = t, r = j(!1), f = j(null), n = j(!1), v = j(null), l = j(!1), a = Y(() => {
4066
+ const e = t, r = O(!1), f = O(null), n = O(!1), v = O(null), l = O(!1), a = Y(() => {
4139
4067
  if (r.value)
4140
4068
  return kr(e.layout);
4141
4069
  });
4142
- function u(w) {
4070
+ function u(S) {
4143
4071
  p({
4144
4072
  type: "BLOCK_CLICK",
4145
- block: w
4073
+ block: S
4146
4074
  });
4147
4075
  }
4148
- function d(w) {
4076
+ function d(S) {
4149
4077
  p({
4150
4078
  type: "BLOCK_HOVER",
4151
- blockId: w
4079
+ blockId: S
4152
4080
  });
4153
4081
  }
4154
- function P(w) {
4082
+ function P(S) {
4155
4083
  p({
4156
4084
  type: "BLOCK_ADD",
4157
- blockType: w
4085
+ blockType: S
4158
4086
  });
4159
4087
  }
4160
- function b(w) {
4088
+ function b(S) {
4161
4089
  try {
4162
- return JSON.parse(JSON.stringify(w));
4090
+ return JSON.parse(JSON.stringify(S));
4163
4091
  } catch (V) {
4164
4092
  console.warn("[iframe] Failed to serialize data for postMessage:", V);
4165
4093
  return;
4166
4094
  }
4167
4095
  }
4168
- function p(w) {
4096
+ function p(S) {
4169
4097
  if (window.parent) {
4170
- const V = b(w);
4098
+ const V = b(S);
4171
4099
  if (!V) {
4172
4100
  console.error("[iframe] Failed to serialize message for postMessage");
4173
4101
  return;
@@ -4182,74 +4110,74 @@ const In = /* @__PURE__ */ _({
4182
4110
  console.error("[iframe] EditorPageRenderer: No editor reference found");
4183
4111
  return;
4184
4112
  }
4185
- c = (w) => {
4186
- const q = w.target.closest("[data-partial]");
4113
+ c = (S) => {
4114
+ const q = S.target.closest("[data-partial]");
4187
4115
  q && p({
4188
4116
  type: "CLICK_PARTIAL",
4189
4117
  partial: q.getAttribute("data-partial")
4190
4118
  });
4191
4119
  }, f.value.addEventListener("click", c);
4192
4120
  }
4193
- const A = j(null), T = j(!1), W = j(null), y = j(null);
4194
- function O(w) {
4121
+ const A = O(null), T = O(!1), W = O(null), w = O(null);
4122
+ function j(S) {
4195
4123
  var q;
4196
- n.value || document.querySelector(".sortable-drag, .sortable-ghost") || (q = w.dataTransfer) != null && q.types.includes("block-type") && (T.value = !0, w.preventDefault(), w.stopPropagation());
4124
+ n.value || document.querySelector(".sortable-drag, .sortable-ghost") || (q = S.dataTransfer) != null && q.types.includes("block-type") && (T.value = !0, S.preventDefault(), S.stopPropagation());
4197
4125
  }
4198
- function z(w) {
4126
+ function z(S) {
4199
4127
  if (n.value)
4200
4128
  return;
4201
- const V = w.relatedTarget, q = w.currentTarget;
4202
- q != null && q.contains(V) || (T.value = !1, W.value = null, y.value = null);
4129
+ const V = S.relatedTarget, q = S.currentTarget;
4130
+ q != null && q.contains(V) || (T.value = !1, W.value = null, w.value = null);
4203
4131
  }
4204
- function k(w) {
4132
+ function k(S) {
4205
4133
  var F;
4206
- if (n.value || document.querySelector(".sortable-drag, .sortable-ghost") || !((F = w.dataTransfer) != null && F.types.includes("block-type")))
4134
+ if (n.value || document.querySelector(".sortable-drag, .sortable-ghost") || !((F = S.dataTransfer) != null && F.types.includes("block-type")))
4207
4135
  return;
4208
- if (w.preventDefault(), w.stopPropagation(), w.dataTransfer && (w.dataTransfer.dropEffect = "move"), !e.blocks || e.blocks.length === 0) {
4209
- W.value = 0, y.value = 0;
4136
+ if (S.preventDefault(), S.stopPropagation(), S.dataTransfer && (S.dataTransfer.dropEffect = "move"), !e.blocks || e.blocks.length === 0) {
4137
+ W.value = 0, w.value = 0;
4210
4138
  return;
4211
4139
  }
4212
- const K = w.target.closest("[data-block-id]"), B = A.value;
4140
+ const K = S.target.closest("[data-block-id]"), B = A.value;
4213
4141
  if (B)
4214
4142
  if (K) {
4215
4143
  const g = K.getAttribute("data-block-id");
4216
4144
  if (g) {
4217
4145
  const vt = e.blocks.findIndex(($) => $.id === g);
4218
4146
  if (vt !== -1) {
4219
- const $ = K.getBoundingClientRect(), it = B.getBoundingClientRect(), yt = w.clientY, _t = $.top + $.height / 2;
4220
- yt < _t ? (W.value = vt, y.value = $.top - it.top - 2) : (W.value = vt + 1, y.value = $.bottom - it.top - 2);
4147
+ const $ = K.getBoundingClientRect(), it = B.getBoundingClientRect(), yt = S.clientY, _t = $.top + $.height / 2;
4148
+ yt < _t ? (W.value = vt, w.value = $.top - it.top - 2) : (W.value = vt + 1, w.value = $.bottom - it.top - 2);
4221
4149
  }
4222
4150
  }
4223
4151
  } else {
4224
4152
  W.value = e.blocks.length;
4225
4153
  const g = B.getBoundingClientRect();
4226
- y.value = g.height - 2;
4154
+ w.value = g.height - 2;
4227
4155
  }
4228
4156
  }
4229
- function H(w) {
4157
+ function H(S) {
4230
4158
  var B;
4231
- if (n.value || document.querySelector(".sortable-drag, .sortable-ghost") || !((B = w.dataTransfer) != null && B.types.includes("block-type")))
4159
+ if (n.value || document.querySelector(".sortable-drag, .sortable-ghost") || !((B = S.dataTransfer) != null && B.types.includes("block-type")))
4232
4160
  return;
4233
- if (w.preventDefault(), w.stopPropagation(), !w.dataTransfer) {
4234
- T.value = !1, W.value = null, y.value = null;
4161
+ if (S.preventDefault(), S.stopPropagation(), !S.dataTransfer) {
4162
+ T.value = !1, W.value = null, w.value = null;
4235
4163
  return;
4236
4164
  }
4237
- const q = w.dataTransfer.getData("block-type") || w.dataTransfer.getData("text/plain");
4165
+ const q = S.dataTransfer.getData("block-type") || S.dataTransfer.getData("text/plain");
4238
4166
  if (!q) {
4239
- T.value = !1, W.value = null, y.value = null;
4167
+ T.value = !1, W.value = null, w.value = null;
4240
4168
  return;
4241
4169
  }
4242
4170
  let K;
4243
4171
  if (!e.blocks || e.blocks.length === 0)
4244
4172
  K = 0;
4245
4173
  else {
4246
- const g = w.target.closest("[data-block-id]");
4174
+ const g = S.target.closest("[data-block-id]");
4247
4175
  if (g) {
4248
4176
  const vt = g.getAttribute("data-block-id");
4249
4177
  if (vt) {
4250
4178
  const $ = e.blocks.findIndex((it) => it.id === vt);
4251
4179
  if ($ !== -1) {
4252
- const it = g.getBoundingClientRect(), yt = w.clientY, _t = it.top + it.height / 2;
4180
+ const it = g.getBoundingClientRect(), yt = S.clientY, _t = it.top + it.height / 2;
4253
4181
  K = yt < _t ? $ : $ + 1;
4254
4182
  } else
4255
4183
  K = e.blocks.length;
@@ -4258,13 +4186,13 @@ const In = /* @__PURE__ */ _({
4258
4186
  } else
4259
4187
  K = e.blocks.length;
4260
4188
  }
4261
- T.value = !1, W.value = null, y.value = null, p({
4189
+ T.value = !1, W.value = null, w.value = null, p({
4262
4190
  type: "BLOCK_ADD",
4263
4191
  blockType: q,
4264
4192
  index: K
4265
4193
  });
4266
4194
  }
4267
- async function L() {
4195
+ async function x() {
4268
4196
  var q, K;
4269
4197
  if (n.value || l.value)
4270
4198
  return;
@@ -4272,8 +4200,8 @@ const In = /* @__PURE__ */ _({
4272
4200
  console.warn("Cannot initialize Sortable: layout component is not set");
4273
4201
  return;
4274
4202
  }
4275
- const w = (q = e.blocks) == null ? void 0 : q.length;
4276
- if (!w || w === 0) {
4203
+ const S = (q = e.blocks) == null ? void 0 : q.length;
4204
+ if (!S || S === 0) {
4277
4205
  console.warn("Cannot initialize Sortable: no blocks exist");
4278
4206
  return;
4279
4207
  }
@@ -4299,7 +4227,7 @@ const In = /* @__PURE__ */ _({
4299
4227
  }
4300
4228
  l.value = !0;
4301
4229
  try {
4302
- v.value = new m(V, {
4230
+ v.value = new L(V, {
4303
4231
  animation: 150,
4304
4232
  ghostClass: "sortable-ghost",
4305
4233
  chosenClass: "sortable-chosen",
@@ -4336,15 +4264,15 @@ const In = /* @__PURE__ */ _({
4336
4264
  }
4337
4265
  }
4338
4266
  return $t(async () => {
4339
- r.value = !1, await xe(e.theme, !1), r.value = !0, s();
4267
+ r.value = !1, await me(e.theme, !1), r.value = !0, s();
4340
4268
  }), Xt(
4341
4269
  [() => e.blocks, () => a.value, () => r.value],
4342
- async ([w, V, q]) => {
4343
- q && V && w && w.length > 0 && (await It(), await L());
4270
+ async ([S, V, q]) => {
4271
+ q && V && S && S.length > 0 && (await It(), await x());
4344
4272
  },
4345
4273
  { immediate: !0 }
4346
4274
  ), Gt(async () => {
4347
- e.blocks && e.blocks.length > 0 && a.value && r.value && (await It(), await L());
4275
+ e.blocks && e.blocks.length > 0 && a.value && r.value && (await It(), await x());
4348
4276
  }), rr(() => {
4349
4277
  if (c && f.value && (f.value.removeEventListener("click", c), c = null), v.value) {
4350
4278
  try {
@@ -4353,7 +4281,7 @@ const In = /* @__PURE__ */ _({
4353
4281
  }
4354
4282
  v.value = null;
4355
4283
  }
4356
- }), (w, V) => (o(), X("div", {
4284
+ }), (S, V) => (o(), X("div", {
4357
4285
  id: "page-viewport",
4358
4286
  ref_key: "editorRef",
4359
4287
  ref: f,
@@ -4361,7 +4289,7 @@ const In = /* @__PURE__ */ _({
4361
4289
  }, [
4362
4290
  r.value ? (o(), X(tt, { key: 0 }, [
4363
4291
  a.value ? (o(), ut(Yt(a.value), kt({ key: 0 }, t.settings, { blocks: t.blocks }), {
4364
- default: Lr(() => {
4292
+ default: xr(() => {
4365
4293
  var q;
4366
4294
  return [
4367
4295
  (q = t.blocks) != null && q.length ? (o(), X("div", {
@@ -4370,15 +4298,15 @@ const In = /* @__PURE__ */ _({
4370
4298
  ref_key: "pageBlocksWrapperRef",
4371
4299
  ref: A,
4372
4300
  class: I(["relative", { "drag-over": T.value }]),
4373
- onDragenter: O,
4301
+ onDragenter: j,
4374
4302
  onDragleave: z,
4375
4303
  onDragover: k,
4376
4304
  onDrop: H
4377
4305
  }, [
4378
- T.value && W.value !== null && y.value !== null ? (o(), X("div", {
4306
+ T.value && W.value !== null && w.value !== null ? (o(), X("div", {
4379
4307
  key: 0,
4380
4308
  class: "drop-indicator",
4381
- style: xr({ top: y.value + "px" })
4309
+ style: mr({ top: w.value + "px" })
4382
4310
  }, [
4383
4311
  i("div", { class: "drop-indicator-line" }),
4384
4312
  i("div", { class: "drop-indicator-label" }, "Drop here"),
@@ -4444,11 +4372,22 @@ const In = /* @__PURE__ */ _({
4444
4372
  }
4445
4373
  }), Or = /* @__PURE__ */ Wt($n, [["__scopeId", "data-v-d3e4c269"]]);
4446
4374
  function _n() {
4447
- return import.meta.url;
4375
+ const t = import.meta.url;
4376
+ try {
4377
+ const e = new URL(t);
4378
+ if (typeof window < "u" && window.location) {
4379
+ const { origin: r } = window.location, { pathname: f } = e;
4380
+ if (f.startsWith("/node_modules") || f.includes("vue-wswg-editor"))
4381
+ return `${r}${f}${e.search}`;
4382
+ }
4383
+ return t;
4384
+ } catch {
4385
+ return t;
4386
+ }
4448
4387
  }
4449
4388
  async function bv(t) {
4450
4389
  console.info("[iframe] createIframeApp called with container:", t), console.info("[iframe] Container element:", t.tagName, t.id, t.className);
4451
- const e = j(null), r = j(null), f = j(null), n = j(!1), v = j("blocks"), l = j("settings"), a = j("default");
4390
+ const e = O(null), r = O(null), f = O(null), n = O(!1), v = O("blocks"), l = O("settings"), a = O("default");
4452
4391
  console.info("[iframe] State initialized");
4453
4392
  function u(s) {
4454
4393
  try {
@@ -4499,7 +4438,7 @@ async function bv(t) {
4499
4438
  },
4500
4439
  setup() {
4501
4440
  console.info("[iframe] Vue app setup() called");
4502
- const s = j(!1);
4441
+ const s = O(!1);
4503
4442
  return console.info("[iframe] Setting up pageData watcher"), Xt(
4504
4443
  () => e.value,
4505
4444
  async (A) => {
@@ -4511,7 +4450,7 @@ async function bv(t) {
4511
4450
  },
4512
4451
  { immediate: !0 }
4513
4452
  ), () => {
4514
- var y;
4453
+ var w;
4515
4454
  const A = e.value, T = A && A[v.value], W = T && A ? A[v.value] : [];
4516
4455
  return console.info("[iframe] Render function called:", {
4517
4456
  isPageReady: s.value,
@@ -4520,7 +4459,7 @@ async function bv(t) {
4520
4459
  blocksCount: (W == null ? void 0 : W.length) || 0
4521
4460
  }), s.value && A ? (console.info("[iframe] Rendering EditorPageRenderer"), Dt(Or, {
4522
4461
  blocks: W,
4523
- layout: (y = A[l.value]) == null ? void 0 : y.layout,
4462
+ layout: (w = A[l.value]) == null ? void 0 : w.layout,
4524
4463
  settings: A[l.value],
4525
4464
  activeBlock: r.value,
4526
4465
  hoveredBlockId: f.value,
@@ -4597,16 +4536,16 @@ async function bv(t) {
4597
4536
  console.info("[iframe] Router created, setting up resolve override...");
4598
4537
  const A = s.resolve.bind(s);
4599
4538
  s.resolve = (W) => {
4600
- const y = A(W);
4601
- return y.route && (!y.route.matched || y.route.matched.length === 0) && (y.route.matched = [
4539
+ const w = A(W);
4540
+ return w.route && (!w.route.matched || w.route.matched.length === 0) && (w.route.matched = [
4602
4541
  {
4603
- path: y.route.path || "/",
4604
- name: y.route.name,
4605
- meta: y.route.meta || {},
4542
+ path: w.route.path || "/",
4543
+ name: w.route.name,
4544
+ meta: w.route.meta || {},
4606
4545
  components: {},
4607
4546
  children: []
4608
4547
  }
4609
- ]), y;
4548
+ ]), w;
4610
4549
  }, console.info("[iframe] Installing router on app..."), P.use(s), console.info("[iframe] Waiting for router to be ready..."), await s.isReady(), console.info("[iframe] Router is ready");
4611
4550
  const T = s.currentRoute.value;
4612
4551
  T && (!T.matched || T.matched.length === 0) && (console.info("[iframe] Navigating to / to ensure route has matched array"), await s.push("/")), c = !0, console.info("[iframe] Router installed successfully");
@@ -4632,23 +4571,36 @@ const tv = /* @__PURE__ */ _({
4632
4571
  },
4633
4572
  emits: ["click-block", "hover-block", "block-reorder", "block-add", "click-partial"],
4634
4573
  setup(t, { emit: e }) {
4635
- const r = _n(), f = t, n = e, v = j(null), l = j(null), a = j(!1), u = j(""), d = Y(() => f.blocksKey || "blocks"), P = Y(() => f.settingsKey || "settings");
4574
+ let r = _n();
4575
+ if (typeof document < "u") {
4576
+ const w = Array.from(document.querySelectorAll("script[src]")).find((j) => (j.getAttribute("src") || "").includes("vue-wswg-editor"));
4577
+ if (w) {
4578
+ const j = w.getAttribute("src");
4579
+ if (j)
4580
+ try {
4581
+ r = new URL(j, window.location.href).href, console.info("[parent] Using script URL as module URL:", r);
4582
+ } catch (z) {
4583
+ console.warn("[parent] Failed to construct module URL from script:", z);
4584
+ }
4585
+ }
4586
+ }
4587
+ const f = t, n = e, v = O(null), l = O(null), a = O(!1), u = O(""), d = Y(() => f.blocksKey || "blocks"), P = Y(() => f.settingsKey || "settings");
4636
4588
  function b() {
4637
- var W, y;
4638
- if (console.info("[parent] Iframe load event fired"), console.info("[parent] Iframe ref:", v.value), console.info("[parent] Iframe contentWindow:", (W = v.value) == null ? void 0 : W.contentWindow), (y = v.value) != null && y.contentWindow)
4589
+ var W, w;
4590
+ if (console.info("[parent] Iframe load event fired"), console.info("[parent] Iframe ref:", v.value), console.info("[parent] Iframe contentWindow:", (W = v.value) == null ? void 0 : W.contentWindow), (w = v.value) != null && w.contentWindow)
4639
4591
  try {
4640
4592
  console.info("[parent] Iframe document:", v.value.contentWindow.document), console.info("[parent] Iframe document body:", v.value.contentWindow.document.body), console.info(
4641
4593
  "[parent] Iframe document body innerHTML length:",
4642
4594
  v.value.contentWindow.document.body.innerHTML.length
4643
4595
  );
4644
- } catch (O) {
4645
- console.info("[parent] Cannot access iframe document (cross-origin?):", O);
4596
+ } catch (j) {
4597
+ console.info("[parent] Cannot access iframe document (cross-origin?):", j);
4646
4598
  }
4647
4599
  }
4648
4600
  function p() {
4649
4601
  console.info("[parent] Creating iframe src, module URL:", r);
4650
- const W = Jn(r), y = new Blob([W], { type: "text/html" }), O = URL.createObjectURL(y);
4651
- return console.info("[parent] Iframe blob URL created:", O), O;
4602
+ const W = Jn(), w = new Blob([W], { type: "text/html" }), j = URL.createObjectURL(w);
4603
+ return console.info("[parent] Iframe blob URL created:", j), j;
4652
4604
  }
4653
4605
  async function c() {
4654
4606
  if (console.info("[parent] updateIframeContent called", {
@@ -4669,34 +4621,34 @@ const tv = /* @__PURE__ */ _({
4669
4621
  let s = null;
4670
4622
  function A() {
4671
4623
  console.info("[parent] Setting up message listener"), s = (W) => {
4672
- var y;
4673
- if (W.source !== ((y = v.value) == null ? void 0 : y.contentWindow)) {
4624
+ var w;
4625
+ if (W.source !== ((w = v.value) == null ? void 0 : w.contentWindow)) {
4674
4626
  console.info("[parent] Ignoring message from different source");
4675
4627
  return;
4676
4628
  }
4677
- if (console.info("[parent] Received message from iframe:", W.data), W.data && W.data.type === "IFRAME_NEEDS_MODULE_URL") {
4678
- console.info("[parent] IFRAME_NEEDS_MODULE_URL received, sending module URL"), v.value && r ? Hr(v.value, r) : console.warn("[parent] Cannot send module URL - iframe ref or module URL not available");
4629
+ if (console.info("[parent] Received message from iframe:", W.data), W.data && W.data.type === "IFRAME_READY_FOR_APP") {
4630
+ console.info("[parent] IFRAME_READY_FOR_APP received, sending module URL"), v.value && r ? Hr(v.value, r) : console.warn("[parent] Cannot send module URL - iframe ref or module URL not available");
4679
4631
  return;
4680
4632
  }
4681
- if (W.data && W.data.type === "IFRAME_READY_FOR_APP") {
4682
- console.info("[parent] IFRAME_READY_FOR_APP received, sending module URL"), v.value && r && Hr(v.value, r);
4633
+ if (W.data && W.data.type === "IFRAME_NEEDS_MODULE_URL") {
4634
+ console.info("[parent] IFRAME_NEEDS_MODULE_URL received, sending module URL"), v.value && r ? Hr(v.value, r) : console.warn("[parent] Cannot send module URL - iframe ref or module URL not available");
4683
4635
  return;
4684
4636
  }
4685
4637
  Rn(W, {
4686
- onBlockClick: (O, z) => {
4638
+ onBlockClick: (j, z) => {
4687
4639
  n("click-block", z);
4688
4640
  },
4689
- onBlockHover: (O) => {
4690
- n("hover-block", O);
4641
+ onBlockHover: (j) => {
4642
+ n("hover-block", j);
4691
4643
  },
4692
- onBlockReorder: (O, z) => {
4693
- n("block-reorder", O, z);
4644
+ onBlockReorder: (j, z) => {
4645
+ n("block-reorder", j, z);
4694
4646
  },
4695
- onBlockAdd: (O, z) => {
4696
- n("block-add", O, z);
4647
+ onBlockAdd: (j, z) => {
4648
+ n("block-add", j, z);
4697
4649
  },
4698
- onPartialClick: (O) => {
4699
- n("click-partial", O);
4650
+ onPartialClick: (j) => {
4651
+ n("click-partial", j);
4700
4652
  },
4701
4653
  onIframeReady: () => {
4702
4654
  console.info("[parent] IFRAME_READY received, setting iframeReady to true"), a.value = !0, setTimeout(() => {
@@ -4734,7 +4686,7 @@ const tv = /* @__PURE__ */ _({
4734
4686
  console.info("[parent] IframePreview component mounted"), u.value = p(), console.info("[parent] Iframe src set:", u.value), A();
4735
4687
  }), rr(() => {
4736
4688
  T(), u.value.startsWith("blob:") && URL.revokeObjectURL(u.value);
4737
- }), (W, y) => (o(), X("div", {
4689
+ }), (W, w) => (o(), X("div", {
4738
4690
  ref_key: "containerRef",
4739
4691
  ref: l,
4740
4692
  class: "iframe-preview-container"
@@ -4750,7 +4702,7 @@ const tv = /* @__PURE__ */ _({
4750
4702
  }, null, 40, ["src"])
4751
4703
  ], 512));
4752
4704
  }
4753
- }), ev = /* @__PURE__ */ Wt(tv, [["__scopeId", "data-v-06550091"]]), pv = /* @__PURE__ */ _({
4705
+ }), ev = /* @__PURE__ */ Wt(tv, [["__scopeId", "data-v-3fccc4ad"]]), pv = /* @__PURE__ */ _({
4754
4706
  __name: "WswgPageBuilder",
4755
4707
  props: /* @__PURE__ */ Tt({
4756
4708
  editable: { type: Boolean, default: !1 },
@@ -4767,28 +4719,28 @@ const tv = /* @__PURE__ */ _({
4767
4719
  }),
4768
4720
  emits: ["update:modelValue"],
4769
4721
  setup(t) {
4770
- const e = t, r = j("desktop"), f = j(!1), n = j(!1), v = j(null), l = j(!1), a = j(null), u = j(void 0), d = j(380), P = j(null), b = j(!1), p = rt(t, "modelValue");
4722
+ const e = t, r = O("desktop"), f = O(!1), n = O(!1), v = O(null), l = O(!1), a = O(null), u = O(void 0), d = O(380), P = O(null), b = O(!1), p = rt(t, "modelValue");
4771
4723
  function c(H) {
4772
4724
  d.value = H;
4773
4725
  }
4774
4726
  const s = Y(() => {
4775
- var H, L;
4776
- return !!(Object.keys(zt).length > 1 || (H = p.value) != null && H[e.settingsKey] && Object.keys((L = p.value) == null ? void 0 : L[e.settingsKey]).length > 0);
4727
+ var H, x;
4728
+ return !!(Object.keys(zt).length > 1 || (H = p.value) != null && H[e.settingsKey] && Object.keys((x = p.value) == null ? void 0 : x[e.settingsKey]).length > 0);
4777
4729
  });
4778
4730
  function A(H) {
4779
4731
  v.value = H, f.value = !1, a.value = null, n.value = !1;
4780
4732
  }
4781
- async function T(H, L) {
4733
+ async function T(H, x) {
4782
4734
  if (!p.value) return;
4783
4735
  p.value[e.blocksKey] || (p.value[e.blocksKey] = []);
4784
- const w = {
4736
+ const S = {
4785
4737
  id: `block-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
4786
4738
  type: H,
4787
4739
  margin: e.defaultBlockMargin ? { top: e.defaultBlockMargin, bottom: e.defaultBlockMargin } : void 0
4788
4740
  }, V = Ut(H);
4789
4741
  return V != null && V.props && Object.entries(V.props).forEach(([q, K]) => {
4790
- K.default && (typeof K.default == "function" ? w[q] = K.default() : w[q] = K.default);
4791
- }), L !== void 0 ? p.value[e.blocksKey].splice(L, 0, w) : p.value[e.blocksKey].push(w), v.value = w, n.value = !1, w;
4742
+ K.default && (typeof K.default == "function" ? S[q] = K.default() : S[q] = K.default);
4743
+ }), x !== void 0 ? p.value[e.blocksKey].splice(x, 0, S) : p.value[e.blocksKey].push(S), v.value = S, n.value = !1, S;
4792
4744
  }
4793
4745
  function W(H) {
4794
4746
  l.value || (a.value = H);
@@ -4802,32 +4754,32 @@ const tv = /* @__PURE__ */ _({
4802
4754
  },
4803
4755
  { ignore: ["#page-builder-sidebar", "#page-builder-resize-handle"] }
4804
4756
  ), $t(async () => {
4805
- await xe(e.theme, !0), k();
4757
+ await me(e.theme, !0), k();
4806
4758
  }), Xt(
4807
4759
  () => e.theme,
4808
4760
  async (H) => {
4809
- b.value = !0, await xe(H, !0), k(), b.value = !1;
4761
+ b.value = !0, await me(H, !0), k(), b.value = !1;
4810
4762
  }
4811
4763
  );
4812
- function y(H, L) {
4764
+ function w(H, x) {
4813
4765
  var q;
4814
4766
  if (!((q = p.value) != null && q[e.blocksKey])) return;
4815
- const w = p.value[e.blocksKey];
4816
- if (H < 0 || H >= w.length || L < 0 || L >= w.length)
4767
+ const S = p.value[e.blocksKey];
4768
+ if (H < 0 || H >= S.length || x < 0 || x >= S.length)
4817
4769
  return;
4818
- const V = w[H];
4819
- w.splice(H, 1), w.splice(L, 0, V);
4770
+ const V = S[H];
4771
+ S.splice(H, 1), S.splice(x, 0, V);
4820
4772
  }
4821
- function O(H, L) {
4822
- T(H, L);
4773
+ function j(H, x) {
4774
+ T(H, x);
4823
4775
  }
4824
4776
  function z(H) {
4825
- const L = H !== null && H !== "";
4826
- f.value = !0, v.value = null, a.value = null, n.value = !1, L && H ? u.value = H : u.value = void 0;
4777
+ const x = H !== null && H !== "";
4778
+ f.value = !0, v.value = null, a.value = null, n.value = !1, x && H ? u.value = H : u.value = void 0;
4827
4779
  }
4828
4780
  function k() {
4829
- var H, L, w, V, q, K, B, F;
4830
- if (p.value || (p.value = {}), (H = p.value) != null && H[e.settingsKey] || p.value && (p.value[e.settingsKey] = {}), !((w = (L = p.value) == null ? void 0 : L[e.settingsKey]) != null && w.layout)) {
4781
+ var H, x, S, V, q, K, B, F;
4782
+ if (p.value || (p.value = {}), (H = p.value) != null && H[e.settingsKey] || p.value && (p.value[e.settingsKey] = {}), !((S = (x = p.value) == null ? void 0 : x[e.settingsKey]) != null && S.layout)) {
4831
4783
  const g = (V = p.value) == null ? void 0 : V[e.settingsKey];
4832
4784
  g && typeof g.layout != "string" && (g.layout = "default");
4833
4785
  }
@@ -4837,10 +4789,10 @@ const tv = /* @__PURE__ */ _({
4837
4789
  }
4838
4790
  (F = p.value) != null && F[e.blocksKey] || p.value && (p.value[e.blocksKey] = []);
4839
4791
  }
4840
- return (H, L) => (o(), X("div", {
4792
+ return (H, x) => (o(), X("div", {
4841
4793
  class: I(["wswg-page-builder", { "settings-open": f.value }])
4842
4794
  }, [
4843
- t.loading || b.value ? mr(H.$slots, "loading", { key: 0 }, () => [
4795
+ t.loading || b.value ? Lr(H.$slots, "loading", { key: 0 }, () => [
4844
4796
  i("div", { class: "wswg-page-builder-loading flex h-full flex-col items-center justify-center gap-4" }, [
4845
4797
  (o(), X("svg", {
4846
4798
  class: "mx-auto size-8 animate-spin text-blue-600",
@@ -4893,8 +4845,8 @@ const tv = /* @__PURE__ */ _({
4893
4845
  theme: t.theme,
4894
4846
  onHoverBlock: W,
4895
4847
  onClickBlock: A,
4896
- onBlockReorder: y,
4897
- onBlockAdd: O,
4848
+ onBlockReorder: w,
4849
+ onBlockAdd: j,
4898
4850
  onClickPartial: z
4899
4851
  }, null, 8, ["pageData", "activeBlock", "hoveredBlockId", "viewport", "editable", "blocksKey", "settingsKey", "settingsOpen", "theme"])
4900
4852
  ], 2)
@@ -4903,21 +4855,21 @@ const tv = /* @__PURE__ */ _({
4903
4855
  i("div", {
4904
4856
  id: "page-builder-sidebar",
4905
4857
  class: "page-builder-sidebar-wrapper bg-white",
4906
- style: xr({ width: d.value + "px" })
4858
+ style: mr({ width: d.value + "px" })
4907
4859
  }, [
4908
4860
  h(Vn, {
4909
4861
  modelValue: p.value,
4910
- "onUpdate:modelValue": L[0] || (L[0] = (w) => p.value = w),
4862
+ "onUpdate:modelValue": x[0] || (x[0] = (S) => p.value = S),
4911
4863
  activeBlock: v.value,
4912
- "onUpdate:activeBlock": L[1] || (L[1] = (w) => v.value = w),
4864
+ "onUpdate:activeBlock": x[1] || (x[1] = (S) => v.value = S),
4913
4865
  hoveredBlockId: a.value,
4914
- "onUpdate:hoveredBlockId": L[2] || (L[2] = (w) => a.value = w),
4866
+ "onUpdate:hoveredBlockId": x[2] || (x[2] = (S) => a.value = S),
4915
4867
  showPageSettings: f.value,
4916
- "onUpdate:showPageSettings": L[3] || (L[3] = (w) => f.value = w),
4868
+ "onUpdate:showPageSettings": x[3] || (x[3] = (S) => f.value = S),
4917
4869
  showAddBlockMenu: n.value,
4918
- "onUpdate:showAddBlockMenu": L[4] || (L[4] = (w) => n.value = w),
4870
+ "onUpdate:showAddBlockMenu": x[4] || (x[4] = (S) => n.value = S),
4919
4871
  editorViewport: r.value,
4920
- "onUpdate:editorViewport": L[5] || (L[5] = (w) => r.value = w),
4872
+ "onUpdate:editorViewport": x[5] || (x[5] = (S) => r.value = S),
4921
4873
  hasPageSettings: s.value,
4922
4874
  editable: t.editable,
4923
4875
  blocksKey: t.blocksKey,
@@ -4938,7 +4890,7 @@ const tv = /* @__PURE__ */ _({
4938
4890
  theme: { default: "default" }
4939
4891
  },
4940
4892
  setup(t) {
4941
- const e = t, r = j(!1), f = Y(() => {
4893
+ const e = t, r = O(!1), f = Y(() => {
4942
4894
  var v;
4943
4895
  return kr(e.layout || ((v = e.settings) == null ? void 0 : v.layout));
4944
4896
  });
@@ -4948,14 +4900,14 @@ const tv = /* @__PURE__ */ _({
4948
4900
  return [u(l, "top"), u(a, "bottom")].join(" ");
4949
4901
  }
4950
4902
  return $t(async () => {
4951
- r.value = !1, await xe(e.theme, !1), r.value = !0;
4903
+ r.value = !1, await me(e.theme, !1), r.value = !0;
4952
4904
  }), (v, l) => (o(), X("div", {
4953
4905
  id: "page-viewport",
4954
4906
  class: "page-renderer-wrapper relative"
4955
4907
  }, [
4956
4908
  r.value ? (o(), X(tt, { key: 0 }, [
4957
4909
  t.withLayout && f.value ? (o(), ut(Yt(f.value), kt({ key: 0 }, t.settings, { blocks: t.blocks }), {
4958
- default: Lr(() => [
4910
+ default: xr(() => [
4959
4911
  i("div", { id: "page-blocks-wrapper" }, [
4960
4912
  (o(!0), X(tt, null, nt(t.blocks, (a) => (o(), X("div", {
4961
4913
  key: a.id,