@stonecrop/desktop 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/desktop.js CHANGED
@@ -1,39 +1,39 @@
1
- import { defineComponent as Ee, ref as A, onMounted as Pe, openBlock as M, createElementBlock as F, normalizeClass as Ce, createElementVNode as T, Fragment as fe, renderList as be, toDisplayString as Y, createCommentVNode as de, withDirectives as Re, vShow as Ge, useTemplateRef as ht, computed as x, watch as H, nextTick as se, createBlock as Ye, Teleport as xt, createVNode as ae, Transition as Tt, withCtx as we, withModifiers as gt, vModelText as mt, renderSlot as Me, createTextVNode as Ae, toRaw as yt, isRef as ve, isReactive as Ve, toRef as re, hasInjectionContext as Je, inject as Se, getCurrentInstance as bt, reactive as wt, markRaw as ge, effectScope as Pt, getCurrentScope as et, onScopeDispose as tt, toRefs as at, provide as qe, shallowRef as _e, toValue as Q, readonly as je, customRef as ot, unref as De, useModel as Vt, watchEffect as $e, resolveComponent as St, resolveDynamicComponent as jt, mergeProps as Mt, mergeModels as rt, withKeys as he, normalizeStyle as Fe } from "vue";
2
- const Ft = { class: "action-menu-icon" }, Lt = ["disabled", "onClick"], Bt = { key: 1 }, Ht = ["onClick"], Wt = { class: "dropdown-container" }, Ut = { class: "dropdown" }, zt = ["onClick"], Kt = ["href"], Gt = { class: "dropdown-item" }, Jt = /* @__PURE__ */ Ee({
1
+ import { defineComponent as Ee, ref as A, onMounted as Te, openBlock as j, createElementBlock as F, normalizeClass as De, createElementVNode as T, Fragment as pe, renderList as be, toDisplayString as Y, createCommentVNode as de, withDirectives as Ce, vShow as Je, useTemplateRef as ht, computed as x, watch as H, nextTick as se, createBlock as Xe, Teleport as xt, createVNode as ae, Transition as Tt, withCtx as we, withModifiers as gt, vModelText as mt, renderSlot as Me, createTextVNode as Re, toRaw as yt, isRef as fe, isReactive as Pe, toRef as re, hasInjectionContext as Ke, inject as Se, getCurrentInstance as bt, reactive as wt, markRaw as ge, effectScope as Pt, getCurrentScope as Ye, onScopeDispose as et, toRefs as nt, provide as Ge, shallowRef as _e, toValue as Q, readonly as Ve, customRef as tt, unref as Oe, useModel as Vt, watchEffect as at, resolveComponent as St, resolveDynamicComponent as Mt, mergeProps as jt, mergeModels as rt, withKeys as he, normalizeStyle as je } from "vue";
2
+ const Ft = { class: "action-menu-icon" }, Lt = ["disabled", "onClick"], Bt = { key: 1 }, Ht = ["onClick"], Wt = { class: "dropdown-container" }, Ut = { class: "dropdown" }, zt = ["onClick"], Jt = ["href"], Kt = { class: "dropdown-item" }, Gt = /* @__PURE__ */ Ee({
3
3
  __name: "ActionSet",
4
4
  props: {
5
5
  elements: { default: () => [] }
6
6
  },
7
7
  emits: ["actionClick"],
8
8
  setup(t, { emit: e }) {
9
- const o = e, n = A({}), a = A(!1), i = A(-1), r = A(!1), c = A(!1);
10
- Pe(() => {
11
- s();
9
+ const o = e, n = A({}), a = A(!1), s = A(-1), r = A(!1), u = A(!1);
10
+ Te(() => {
11
+ i();
12
12
  });
13
- const s = () => {
13
+ const i = () => {
14
14
  n.value = {};
15
- }, u = () => {
16
- r.value = !0, i.value = setTimeout(() => {
15
+ }, c = () => {
16
+ r.value = !0, s.value = setTimeout(() => {
17
17
  r.value && (a.value = !0);
18
18
  }, 500);
19
- }, f = () => {
20
- r.value = !1, c.value = !1, clearTimeout(i.value), a.value = !1;
21
- }, h = (O) => {
22
- const $ = !n.value[O];
23
- s(), $ && (n.value[O] = !0);
24
- }, b = (O, $) => {
25
- o("actionClick", $, O);
19
+ }, p = () => {
20
+ r.value = !1, u.value = !1, clearTimeout(s.value), a.value = !1;
21
+ }, y = (O) => {
22
+ const _ = !n.value[O];
23
+ i(), _ && (n.value[O] = !0);
24
+ }, h = (O, _) => {
25
+ o("actionClick", _, O);
26
26
  };
27
- return (O, $) => (M(), F("div", {
28
- class: Ce([{ "open-set": a.value, "hovered-and-closed": c.value }, "action-set collapse"]),
29
- onMouseover: u,
30
- onMouseleave: f
27
+ return (O, _) => (j(), F("div", {
28
+ class: De([{ "open-set": a.value, "hovered-and-closed": u.value }, "action-set collapse"]),
29
+ onMouseover: c,
30
+ onMouseleave: p
31
31
  }, [
32
32
  T("div", Ft, [
33
33
  T("div", {
34
34
  id: "chevron",
35
- onClick: $[0] || ($[0] = (D) => c.value = !c.value)
36
- }, [...$[1] || ($[1] = [
35
+ onClick: _[0] || (_[0] = (D) => u.value = !u.value)
36
+ }, [..._[1] || (_[1] = [
37
37
  T("svg", {
38
38
  id: "Layer_1",
39
39
  class: "leftBar",
@@ -66,41 +66,41 @@ const Ft = { class: "action-menu-icon" }, Lt = ["disabled", "onClick"], Bt = { k
66
66
  ], -1)
67
67
  ])])
68
68
  ]),
69
- $[2] || ($[2] = T("div", { style: { "margin-right": "30px" } }, null, -1)),
70
- (M(!0), F(fe, null, be(t.elements, (D, V) => (M(), F("div", {
69
+ _[2] || (_[2] = T("div", { style: { "margin-right": "30px" } }, null, -1)),
70
+ (j(!0), F(pe, null, be(t.elements, (D, V) => (j(), F("div", {
71
71
  key: D.label,
72
72
  class: "action-element"
73
73
  }, [
74
- D.type == "button" ? (M(), F("button", {
74
+ D.type == "button" ? (j(), F("button", {
75
75
  key: 0,
76
76
  disabled: D.disabled,
77
77
  class: "button-default",
78
- onClick: (j) => b(D.action, D.label)
78
+ onClick: (M) => h(D.action, D.label)
79
79
  }, Y(D.label), 9, Lt)) : de("", !0),
80
- D.type == "dropdown" ? (M(), F("div", Bt, [
80
+ D.type == "dropdown" ? (j(), F("div", Bt, [
81
81
  T("button", {
82
82
  class: "button-default",
83
- onClick: (j) => h(V)
83
+ onClick: (M) => y(V)
84
84
  }, Y(D.label), 9, Ht),
85
- Re(T("div", Wt, [
85
+ Ce(T("div", Wt, [
86
86
  T("div", Ut, [
87
- (M(!0), F(fe, null, be(D.actions, (j, P) => (M(), F("div", {
88
- key: j.label
87
+ (j(!0), F(pe, null, be(D.actions, (M, P) => (j(), F("div", {
88
+ key: M.label
89
89
  }, [
90
- j.action != null ? (M(), F("button", {
90
+ M.action != null ? (j(), F("button", {
91
91
  key: 0,
92
92
  class: "dropdown-item",
93
- onClick: (U) => b(j.action, j.label)
94
- }, Y(j.label), 9, zt)) : j.link != null ? (M(), F("a", {
93
+ onClick: (U) => h(M.action, M.label)
94
+ }, Y(M.label), 9, zt)) : M.link != null ? (j(), F("a", {
95
95
  key: 1,
96
- href: j.link
96
+ href: M.link
97
97
  }, [
98
- T("button", Gt, Y(j.label), 1)
99
- ], 8, Kt)) : de("", !0)
98
+ T("button", Kt, Y(M.label), 1)
99
+ ], 8, Jt)) : de("", !0)
100
100
  ]))), 128))
101
101
  ])
102
102
  ], 512), [
103
- [Ge, n.value[V]]
103
+ [Je, n.value[V]]
104
104
  ])
105
105
  ])) : de("", !0)
106
106
  ]))), 128))
@@ -111,7 +111,7 @@ const Ft = { class: "action-menu-icon" }, Lt = ["disabled", "onClick"], Bt = { k
111
111
  for (const [n, a] of e)
112
112
  o[n] = a;
113
113
  return o;
114
- }, _t = /* @__PURE__ */ Et(Jt, [["__scopeId", "data-v-eb01c863"]]), qt = { class: "command-palette-header" }, Zt = ["placeholder"], Qt = {
114
+ }, _t = /* @__PURE__ */ Et(Gt, [["__scopeId", "data-v-eb01c863"]]), qt = { class: "command-palette-header" }, Zt = ["placeholder"], Qt = {
115
115
  key: 0,
116
116
  class: "command-palette-results"
117
117
  }, Xt = ["onClick", "onMouseover"], Yt = { class: "result-title" }, eo = { class: "result-content" }, to = {
@@ -127,78 +127,78 @@ const Ft = { class: "action-menu-icon" }, Lt = ["disabled", "onClick"], Bt = { k
127
127
  },
128
128
  emits: ["select", "close"],
129
129
  setup(t, { emit: e }) {
130
- const o = e, n = A(""), a = A(0), i = ht("input"), r = x(() => n.value ? t.search(n.value).slice(0, t.maxResults) : []);
130
+ const o = e, n = A(""), a = A(0), s = ht("input"), r = x(() => n.value ? t.search(n.value).slice(0, t.maxResults) : []);
131
131
  H(
132
132
  () => t.isOpen,
133
- async (f) => {
134
- f && (n.value = "", a.value = 0, await se(), i.value?.focus());
133
+ async (p) => {
134
+ p && (n.value = "", a.value = 0, await se(), s.value?.focus());
135
135
  }
136
136
  ), H(r, () => {
137
137
  a.value = 0;
138
138
  });
139
- const c = () => {
139
+ const u = () => {
140
140
  o("close");
141
- }, s = (f) => {
142
- switch (f.key) {
141
+ }, i = (p) => {
142
+ switch (p.key) {
143
143
  case "Escape":
144
- c();
144
+ u();
145
145
  break;
146
146
  case "ArrowDown":
147
- f.preventDefault(), r.value.length && (a.value = (a.value + 1) % r.value.length);
147
+ p.preventDefault(), r.value.length && (a.value = (a.value + 1) % r.value.length);
148
148
  break;
149
149
  case "ArrowUp":
150
- f.preventDefault(), r.value.length && (a.value = (a.value - 1 + r.value.length) % r.value.length);
150
+ p.preventDefault(), r.value.length && (a.value = (a.value - 1 + r.value.length) % r.value.length);
151
151
  break;
152
152
  case "Enter":
153
- r.value.length && a.value >= 0 && u(r.value[a.value]);
153
+ r.value.length && a.value >= 0 && c(r.value[a.value]);
154
154
  break;
155
155
  }
156
- }, u = (f) => {
157
- o("select", f), c();
156
+ }, c = (p) => {
157
+ o("select", p), u();
158
158
  };
159
- return (f, h) => (M(), Ye(xt, { to: "body" }, [
159
+ return (p, y) => (j(), Xe(xt, { to: "body" }, [
160
160
  ae(Tt, { name: "fade" }, {
161
161
  default: we(() => [
162
- t.isOpen ? (M(), F("div", {
162
+ t.isOpen ? (j(), F("div", {
163
163
  key: 0,
164
164
  class: "command-palette-overlay",
165
- onClick: c
165
+ onClick: u
166
166
  }, [
167
167
  T("div", {
168
168
  class: "command-palette",
169
- onClick: h[1] || (h[1] = gt(() => {
169
+ onClick: y[1] || (y[1] = gt(() => {
170
170
  }, ["stop"]))
171
171
  }, [
172
172
  T("div", qt, [
173
- Re(T("input", {
173
+ Ce(T("input", {
174
174
  ref: "input",
175
- "onUpdate:modelValue": h[0] || (h[0] = (b) => n.value = b),
175
+ "onUpdate:modelValue": y[0] || (y[0] = (h) => n.value = h),
176
176
  type: "text",
177
177
  class: "command-palette-input",
178
178
  placeholder: t.placeholder,
179
179
  autofocus: "",
180
- onKeydown: s
180
+ onKeydown: i
181
181
  }, null, 40, Zt), [
182
182
  [mt, n.value]
183
183
  ])
184
184
  ]),
185
- r.value.length ? (M(), F("div", Qt, [
186
- (M(!0), F(fe, null, be(r.value, (b, O) => (M(), F("div", {
185
+ r.value.length ? (j(), F("div", Qt, [
186
+ (j(!0), F(pe, null, be(r.value, (h, O) => (j(), F("div", {
187
187
  key: O,
188
- class: Ce(["command-palette-result", { selected: O === a.value }]),
189
- onClick: ($) => u(b),
190
- onMouseover: ($) => a.value = O
188
+ class: De(["command-palette-result", { selected: O === a.value }]),
189
+ onClick: (_) => c(h),
190
+ onMouseover: (_) => a.value = O
191
191
  }, [
192
192
  T("div", Yt, [
193
- Me(f.$slots, "title", { result: b })
193
+ Me(p.$slots, "title", { result: h })
194
194
  ]),
195
195
  T("div", eo, [
196
- Me(f.$slots, "content", { result: b })
196
+ Me(p.$slots, "content", { result: h })
197
197
  ])
198
198
  ], 42, Xt))), 128))
199
- ])) : n.value && !r.value.length ? (M(), F("div", to, [
200
- Me(f.$slots, "empty", {}, () => [
201
- Ae(' No results found for "' + Y(n.value) + '" ', 1)
199
+ ])) : n.value && !r.value.length ? (j(), F("div", to, [
200
+ Me(p.$slots, "empty", {}, () => [
201
+ Re(' No results found for "' + Y(n.value) + '" ', 1)
202
202
  ])
203
203
  ])) : de("", !0)
204
204
  ])
@@ -211,9 +211,9 @@ const Ft = { class: "action-menu-icon" }, Lt = ["disabled", "onClick"], Bt = { k
211
211
  });
212
212
  const ce = typeof window < "u";
213
213
  let ne;
214
- const Ie = (t) => ne = t;
214
+ const Ae = (t) => ne = t;
215
215
  process.env.NODE_ENV;
216
- const Ze = process.env.NODE_ENV !== "production" ? /* @__PURE__ */ Symbol("pinia") : (
216
+ const qe = process.env.NODE_ENV !== "production" ? /* @__PURE__ */ Symbol("pinia") : (
217
217
  /* istanbul ignore next */
218
218
  /* @__PURE__ */ Symbol()
219
219
  );
@@ -230,7 +230,7 @@ function kt(t, e) {
230
230
  if (!(o in t))
231
231
  continue;
232
232
  const a = t[o];
233
- ie(a) && ie(n) && !ve(n) && !Ve(n) ? t[o] = kt(a, n) : t[o] = n;
233
+ ie(a) && ie(n) && !fe(n) && !Pe(n) ? t[o] = kt(a, n) : t[o] = n;
234
234
  }
235
235
  return t;
236
236
  }
@@ -241,21 +241,21 @@ function st(t, e, o, n = Nt) {
241
241
  const a = () => {
242
242
  t.delete(e) && n();
243
243
  };
244
- return !o && et() && tt(a), a;
244
+ return !o && Ye() && et(a), a;
245
245
  }
246
246
  function le(t, ...e) {
247
247
  t.forEach((o) => {
248
248
  o(...e);
249
249
  });
250
250
  }
251
- const oo = (t) => t(), it = /* @__PURE__ */ Symbol(), Le = /* @__PURE__ */ Symbol();
252
- function Qe(t, e) {
251
+ const oo = (t) => t(), it = /* @__PURE__ */ Symbol(), Fe = /* @__PURE__ */ Symbol();
252
+ function Ze(t, e) {
253
253
  t instanceof Map && e instanceof Map ? e.forEach((o, n) => t.set(n, o)) : t instanceof Set && e instanceof Set && e.forEach(t.add, t);
254
254
  for (const o in e) {
255
255
  if (!e.hasOwnProperty(o))
256
256
  continue;
257
257
  const n = e[o], a = t[o];
258
- ie(a) && ie(n) && t.hasOwnProperty(o) && !ve(n) && !Ve(n) ? t[o] = Qe(a, n) : t[o] = n;
258
+ ie(a) && ie(n) && t.hasOwnProperty(o) && !fe(n) && !Pe(n) ? t[o] = Ze(a, n) : t[o] = n;
259
259
  }
260
260
  return t;
261
261
  }
@@ -268,46 +268,46 @@ function ao(t) {
268
268
  }
269
269
  const { assign: Z } = Object;
270
270
  function lt(t) {
271
- return !!(ve(t) && t.effect);
271
+ return !!(fe(t) && t.effect);
272
272
  }
273
273
  function ct(t, e, o, n) {
274
- const { state: a, actions: i, getters: r } = e, c = o.state.value[t];
275
- let s;
276
- function u() {
277
- !c && (process.env.NODE_ENV === "production" || !n) && (o.state.value[t] = a ? a() : {});
278
- const f = process.env.NODE_ENV !== "production" && n ? (
274
+ const { state: a, actions: s, getters: r } = e, u = o.state.value[t];
275
+ let i;
276
+ function c() {
277
+ !u && (process.env.NODE_ENV === "production" || !n) && (o.state.value[t] = a ? a() : {});
278
+ const p = process.env.NODE_ENV !== "production" && n ? (
279
279
  // use ref() to unwrap refs inside state TODO: check if this is still necessary
280
- at(A(a ? a() : {}).value)
281
- ) : at(o.state.value[t]);
282
- return Z(f, i, Object.keys(r || {}).reduce((h, b) => (process.env.NODE_ENV !== "production" && b in f && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${b}" in store "${t}".`), h[b] = ge(x(() => {
283
- Ie(o);
280
+ nt(A(a ? a() : {}).value)
281
+ ) : nt(o.state.value[t]);
282
+ return Z(p, s, Object.keys(r || {}).reduce((y, h) => (process.env.NODE_ENV !== "production" && h in p && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${h}" in store "${t}".`), y[h] = ge(x(() => {
283
+ Ae(o);
284
284
  const O = o._s.get(t);
285
- return r[b].call(O, O);
286
- })), h), {}));
285
+ return r[h].call(O, O);
286
+ })), y), {}));
287
287
  }
288
- return s = Xe(t, u, e, o, n, !0), s;
288
+ return i = Qe(t, c, e, o, n, !0), i;
289
289
  }
290
- function Xe(t, e, o = {}, n, a, i) {
290
+ function Qe(t, e, o = {}, n, a, s) {
291
291
  let r;
292
- const c = Z({ actions: {} }, o);
292
+ const u = Z({ actions: {} }, o);
293
293
  if (process.env.NODE_ENV !== "production" && !n._e.active)
294
294
  throw new Error("Pinia destroyed");
295
- const s = { deep: !0 };
296
- process.env.NODE_ENV !== "production" && (s.onTrigger = (g) => {
297
- u ? O = g : u == !1 && !_._hotUpdating && (Array.isArray(O) ? O.push(g) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
295
+ const i = { deep: !0 };
296
+ process.env.NODE_ENV !== "production" && (i.onTrigger = (g) => {
297
+ c ? O = g : c == !1 && !$._hotUpdating && (Array.isArray(O) ? O.push(g) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
298
298
  });
299
- let u, f, h = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Set(), O;
300
- const $ = n.state.value[t];
301
- !i && !$ && (process.env.NODE_ENV === "production" || !a) && (n.state.value[t] = {});
299
+ let c, p, y = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), O;
300
+ const _ = n.state.value[t];
301
+ !s && !_ && (process.env.NODE_ENV === "production" || !a) && (n.state.value[t] = {});
302
302
  const D = A({});
303
303
  let V;
304
- function j(g) {
304
+ function M(g) {
305
305
  let m;
306
- u = f = !1, process.env.NODE_ENV !== "production" && (O = []), typeof g == "function" ? (g(n.state.value[t]), m = {
306
+ c = p = !1, process.env.NODE_ENV !== "production" && (O = []), typeof g == "function" ? (g(n.state.value[t]), m = {
307
307
  type: me.patchFunction,
308
308
  storeId: t,
309
309
  events: O
310
- }) : (Qe(n.state.value[t], g), m = {
310
+ }) : (Ze(n.state.value[t], g), m = {
311
311
  type: me.patchObject,
312
312
  payload: g,
313
313
  storeId: t,
@@ -315,10 +315,10 @@ function Xe(t, e, o = {}, n, a, i) {
315
315
  });
316
316
  const C = V = /* @__PURE__ */ Symbol();
317
317
  se().then(() => {
318
- V === C && (u = !0);
319
- }), f = !0, le(h, m, n.state.value[t]);
318
+ V === C && (c = !0);
319
+ }), p = !0, le(y, m, n.state.value[t]);
320
320
  }
321
- const P = i ? function() {
321
+ const P = s ? function() {
322
322
  const { state: m } = o, C = m ? m() : {};
323
323
  this.$patch((B) => {
324
324
  Z(B, C);
@@ -330,13 +330,13 @@ function Xe(t, e, o = {}, n, a, i) {
330
330
  } : Nt
331
331
  );
332
332
  function U() {
333
- r.stop(), h.clear(), b.clear(), n._s.delete(t);
333
+ r.stop(), y.clear(), h.clear(), n._s.delete(t);
334
334
  }
335
335
  const q = (g, m = "") => {
336
336
  if (it in g)
337
- return g[Le] = m, g;
337
+ return g[Fe] = m, g;
338
338
  const C = function() {
339
- Ie(n);
339
+ Ae(n);
340
340
  const B = Array.from(arguments), k = /* @__PURE__ */ new Set(), I = /* @__PURE__ */ new Set();
341
341
  function L(S) {
342
342
  k.add(S);
@@ -344,23 +344,23 @@ function Xe(t, e, o = {}, n, a, i) {
344
344
  function E(S) {
345
345
  I.add(S);
346
346
  }
347
- le(b, {
347
+ le(h, {
348
348
  args: B,
349
- name: C[Le],
350
- store: _,
349
+ name: C[Fe],
350
+ store: $,
351
351
  after: L,
352
352
  onError: E
353
353
  });
354
354
  let N;
355
355
  try {
356
- N = g.apply(this && this.$id === t ? this : _, B);
356
+ N = g.apply(this && this.$id === t ? this : $, B);
357
357
  } catch (S) {
358
358
  throw le(I, S), S;
359
359
  }
360
360
  return N instanceof Promise ? N.then((S) => (le(k, S), S)).catch((S) => (le(I, S), Promise.reject(S))) : (le(k, N), N);
361
361
  };
362
- return C[it] = !0, C[Le] = m, C;
363
- }, G = /* @__PURE__ */ ge({
362
+ return C[it] = !0, C[Fe] = m, C;
363
+ }, K = /* @__PURE__ */ ge({
364
364
  actions: {},
365
365
  getters: {},
366
366
  state: [],
@@ -369,23 +369,23 @@ function Xe(t, e, o = {}, n, a, i) {
369
369
  _p: n,
370
370
  // _s: scope,
371
371
  $id: t,
372
- $onAction: st.bind(null, b),
373
- $patch: j,
372
+ $onAction: st.bind(null, h),
373
+ $patch: M,
374
374
  $reset: P,
375
375
  $subscribe(g, m = {}) {
376
- const C = st(h, g, m.detached, () => B()), B = r.run(() => H(() => n.state.value[t], (k) => {
377
- (m.flush === "sync" ? f : u) && g({
376
+ const C = st(y, g, m.detached, () => B()), B = r.run(() => H(() => n.state.value[t], (k) => {
377
+ (m.flush === "sync" ? p : c) && g({
378
378
  storeId: t,
379
379
  type: me.direct,
380
380
  events: O
381
381
  }, k);
382
- }, Z({}, s, m)));
382
+ }, Z({}, i, m)));
383
383
  return C;
384
384
  },
385
385
  $dispose: U
386
- }, _ = wt(process.env.NODE_ENV !== "production" || process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && ce ? Z(
386
+ }, $ = wt(process.env.NODE_ENV !== "production" || process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && ce ? Z(
387
387
  {
388
- _hmrPayload: G,
388
+ _hmrPayload: K,
389
389
  _customProperties: ge(/* @__PURE__ */ new Set())
390
390
  // devtools custom properties
391
391
  },
@@ -393,60 +393,60 @@ function Xe(t, e, o = {}, n, a, i) {
393
393
  // must be added later
394
394
  // setupStore
395
395
  ) : z);
396
- n._s.set(t, _);
396
+ n._s.set(t, $);
397
397
  const W = (n._a && n._a.runWithContext || oo)(() => n._e.run(() => (r = Pt()).run(() => e({ action: q }))));
398
398
  for (const g in W) {
399
399
  const m = W[g];
400
- if (ve(m) && !lt(m) || Ve(m))
401
- process.env.NODE_ENV !== "production" && a ? D.value[g] = re(W, g) : i || ($ && ao(m) && (ve(m) ? m.value = $[g] : Qe(m, $[g])), n.state.value[t][g] = m), process.env.NODE_ENV !== "production" && G.state.push(g);
400
+ if (fe(m) && !lt(m) || Pe(m))
401
+ process.env.NODE_ENV !== "production" && a ? D.value[g] = re(W, g) : s || (_ && ao(m) && (fe(m) ? m.value = _[g] : Ze(m, _[g])), n.state.value[t][g] = m), process.env.NODE_ENV !== "production" && K.state.push(g);
402
402
  else if (typeof m == "function") {
403
403
  const C = process.env.NODE_ENV !== "production" && a ? m : q(m, g);
404
- W[g] = C, process.env.NODE_ENV !== "production" && (G.actions[g] = m), c.actions[g] = m;
405
- } else process.env.NODE_ENV !== "production" && lt(m) && (G.getters[g] = i ? (
404
+ W[g] = C, process.env.NODE_ENV !== "production" && (K.actions[g] = m), u.actions[g] = m;
405
+ } else process.env.NODE_ENV !== "production" && lt(m) && (K.getters[g] = s ? (
406
406
  // @ts-expect-error
407
407
  o.getters[g]
408
408
  ) : m, ce && (W._getters || // @ts-expect-error: same
409
409
  (W._getters = ge([]))).push(g));
410
410
  }
411
- if (Z(_, W), Z(yt(_), W), Object.defineProperty(_, "$state", {
411
+ if (Z($, W), Z(yt($), W), Object.defineProperty($, "$state", {
412
412
  get: () => process.env.NODE_ENV !== "production" && a ? D.value : n.state.value[t],
413
413
  set: (g) => {
414
414
  if (process.env.NODE_ENV !== "production" && a)
415
415
  throw new Error("cannot set hotState");
416
- j((m) => {
416
+ M((m) => {
417
417
  Z(m, g);
418
418
  });
419
419
  }
420
- }), process.env.NODE_ENV !== "production" && (_._hotUpdate = ge((g) => {
421
- _._hotUpdating = !0, g._hmrPayload.state.forEach((m) => {
422
- if (m in _.$state) {
423
- const C = g.$state[m], B = _.$state[m];
420
+ }), process.env.NODE_ENV !== "production" && ($._hotUpdate = ge((g) => {
421
+ $._hotUpdating = !0, g._hmrPayload.state.forEach((m) => {
422
+ if (m in $.$state) {
423
+ const C = g.$state[m], B = $.$state[m];
424
424
  typeof C == "object" && ie(C) && ie(B) ? kt(C, B) : g.$state[m] = B;
425
425
  }
426
- _[m] = re(g.$state, m);
427
- }), Object.keys(_.$state).forEach((m) => {
428
- m in g.$state || delete _[m];
429
- }), u = !1, f = !1, n.state.value[t] = re(g._hmrPayload, "hotState"), f = !0, se().then(() => {
430
- u = !0;
426
+ $[m] = re(g.$state, m);
427
+ }), Object.keys($.$state).forEach((m) => {
428
+ m in g.$state || delete $[m];
429
+ }), c = !1, p = !1, n.state.value[t] = re(g._hmrPayload, "hotState"), p = !0, se().then(() => {
430
+ c = !0;
431
431
  });
432
432
  for (const m in g._hmrPayload.actions) {
433
433
  const C = g[m];
434
- _[m] = //
434
+ $[m] = //
435
435
  q(C, m);
436
436
  }
437
437
  for (const m in g._hmrPayload.getters) {
438
- const C = g._hmrPayload.getters[m], B = i ? (
438
+ const C = g._hmrPayload.getters[m], B = s ? (
439
439
  // special handling of options api
440
- x(() => (Ie(n), C.call(_, _)))
440
+ x(() => (Ae(n), C.call($, $)))
441
441
  ) : C;
442
- _[m] = //
442
+ $[m] = //
443
443
  B;
444
444
  }
445
- Object.keys(_._hmrPayload.getters).forEach((m) => {
446
- m in g._hmrPayload.getters || delete _[m];
447
- }), Object.keys(_._hmrPayload.actions).forEach((m) => {
448
- m in g._hmrPayload.actions || delete _[m];
449
- }), _._hmrPayload = g._hmrPayload, _._getters = g._getters, _._hotUpdating = !1;
445
+ Object.keys($._hmrPayload.getters).forEach((m) => {
446
+ m in g._hmrPayload.getters || delete $[m];
447
+ }), Object.keys($._hmrPayload.actions).forEach((m) => {
448
+ m in g._hmrPayload.actions || delete $[m];
449
+ }), $._hmrPayload = g._hmrPayload, $._getters = g._getters, $._hotUpdating = !1;
450
450
  })), process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && ce) {
451
451
  const g = {
452
452
  writable: !0,
@@ -455,59 +455,59 @@ function Xe(t, e, o = {}, n, a, i) {
455
455
  enumerable: !1
456
456
  };
457
457
  ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((m) => {
458
- Object.defineProperty(_, m, Z({ value: _[m] }, g));
458
+ Object.defineProperty($, m, Z({ value: $[m] }, g));
459
459
  });
460
460
  }
461
461
  return n._p.forEach((g) => {
462
462
  if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && ce) {
463
463
  const m = r.run(() => g({
464
- store: _,
464
+ store: $,
465
465
  app: n._a,
466
466
  pinia: n,
467
- options: c
467
+ options: u
468
468
  }));
469
- Object.keys(m || {}).forEach((C) => _._customProperties.add(C)), Z(_, m);
469
+ Object.keys(m || {}).forEach((C) => $._customProperties.add(C)), Z($, m);
470
470
  } else
471
- Z(_, r.run(() => g({
472
- store: _,
471
+ Z($, r.run(() => g({
472
+ store: $,
473
473
  app: n._a,
474
474
  pinia: n,
475
- options: c
475
+ options: u
476
476
  })));
477
- }), process.env.NODE_ENV !== "production" && _.$state && typeof _.$state == "object" && typeof _.$state.constructor == "function" && !_.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
477
+ }), process.env.NODE_ENV !== "production" && $.$state && typeof $.$state == "object" && typeof $.$state.constructor == "function" && !$.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
478
478
  state: () => new MyClass()
479
- Found in store "${_.$id}".`), $ && i && o.hydrate && o.hydrate(_.$state, $), u = !0, f = !0, _;
479
+ Found in store "${$.$id}".`), _ && s && o.hydrate && o.hydrate($.$state, _), c = !0, p = !0, $;
480
480
  }
481
481
  // @__NO_SIDE_EFFECTS__
482
482
  function ro(t, e, o) {
483
483
  let n;
484
484
  const a = typeof e == "function";
485
485
  n = a ? o : e;
486
- function i(r, c) {
487
- const s = Je();
486
+ function s(r, u) {
487
+ const i = Ke();
488
488
  if (r = // in test mode, ignore the argument provided as we can always retrieve a
489
489
  // pinia instance with getActivePinia()
490
- (process.env.NODE_ENV === "test" && ne && ne._testing ? null : r) || (s ? Se(Ze, null) : null), r && Ie(r), process.env.NODE_ENV !== "production" && !ne)
490
+ (process.env.NODE_ENV === "test" && ne && ne._testing ? null : r) || (i ? Se(qe, null) : null), r && Ae(r), process.env.NODE_ENV !== "production" && !ne)
491
491
  throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
492
492
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
493
493
  This will fail in production.`);
494
- r = ne, r._s.has(t) || (a ? Xe(t, e, n, r) : ct(t, n, r), process.env.NODE_ENV !== "production" && (i._pinia = r));
495
- const u = r._s.get(t);
496
- if (process.env.NODE_ENV !== "production" && c) {
497
- const f = "__hot:" + t, h = a ? Xe(f, e, n, r, !0) : ct(f, Z({}, n), r, !0);
498
- c._hotUpdate(h), delete r.state.value[f], r._s.delete(f);
494
+ r = ne, r._s.has(t) || (a ? Qe(t, e, n, r) : ct(t, n, r), process.env.NODE_ENV !== "production" && (s._pinia = r));
495
+ const c = r._s.get(t);
496
+ if (process.env.NODE_ENV !== "production" && u) {
497
+ const p = "__hot:" + t, y = a ? Qe(p, e, n, r, !0) : ct(p, Z({}, n), r, !0);
498
+ u._hotUpdate(y), delete r.state.value[p], r._s.delete(p);
499
499
  }
500
500
  if (process.env.NODE_ENV !== "production" && ce) {
501
- const f = bt();
502
- if (f && f.proxy && // avoid adding stores that are just built for hot module replacement
503
- !c) {
504
- const h = f.proxy, b = "_pStores" in h ? h._pStores : h._pStores = {};
505
- b[t] = u;
501
+ const p = bt();
502
+ if (p && p.proxy && // avoid adding stores that are just built for hot module replacement
503
+ !u) {
504
+ const y = p.proxy, h = "_pStores" in y ? y._pStores : y._pStores = {};
505
+ h[t] = c;
506
506
  }
507
507
  }
508
- return u;
508
+ return c;
509
509
  }
510
- return i.$id = t, i;
510
+ return s.$id = t, s;
511
511
  }
512
512
  function so(t) {
513
513
  const e = yt(t), o = {};
@@ -516,10 +516,10 @@ function so(t) {
516
516
  a.effect ? o[n] = // ...
517
517
  x({
518
518
  get: () => t[n],
519
- set(i) {
520
- t[n] = i;
519
+ set(s) {
520
+ t[n] = s;
521
521
  }
522
- }) : (ve(a) || Ve(a)) && (o[n] = // ---
522
+ }) : (fe(a) || Pe(a)) && (o[n] = // ---
523
523
  re(t, n));
524
524
  }
525
525
  return o;
@@ -528,46 +528,46 @@ const io = typeof window < "u" && typeof document < "u";
528
528
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
529
529
  const lo = Object.prototype.toString, co = (t) => lo.call(t) === "[object Object]", uo = () => {
530
530
  };
531
- function fo(...t) {
531
+ function po(...t) {
532
532
  if (t.length !== 1) return re(...t);
533
533
  const e = t[0];
534
- return typeof e == "function" ? je(ot(() => ({
534
+ return typeof e == "function" ? Ve(tt(() => ({
535
535
  get: e,
536
536
  set: uo
537
537
  }))) : A(e);
538
538
  }
539
- function vo(t, e) {
539
+ function fo(t, e) {
540
540
  function o(...n) {
541
- return new Promise((a, i) => {
541
+ return new Promise((a, s) => {
542
542
  Promise.resolve(t(() => e.apply(this, n), {
543
543
  fn: e,
544
544
  thisArg: this,
545
545
  args: n
546
- })).then(a).catch(i);
546
+ })).then(a).catch(s);
547
547
  });
548
548
  }
549
549
  return o;
550
550
  }
551
551
  const Ot = (t) => t();
552
- function po(t = Ot, e = {}) {
553
- const { initialState: o = "active" } = e, n = fo(o === "active");
552
+ function vo(t = Ot, e = {}) {
553
+ const { initialState: o = "active" } = e, n = po(o === "active");
554
554
  function a() {
555
555
  n.value = !1;
556
556
  }
557
- function i() {
557
+ function s() {
558
558
  n.value = !0;
559
559
  }
560
- const r = (...c) => {
561
- n.value && t(...c);
560
+ const r = (...u) => {
561
+ n.value && t(...u);
562
562
  };
563
563
  return {
564
- isActive: je(n),
564
+ isActive: Ve(n),
565
565
  pause: a,
566
- resume: i,
566
+ resume: s,
567
567
  eventFilter: r
568
568
  };
569
569
  }
570
- function Be(t) {
570
+ function Le(t) {
571
571
  return Array.isArray(t) ? t : [t];
572
572
  }
573
573
  function ho(t) {
@@ -575,22 +575,22 @@ function ho(t) {
575
575
  }
576
576
  function go(t, e, o = {}) {
577
577
  const { eventFilter: n = Ot, ...a } = o;
578
- return H(t, vo(n, e), a);
578
+ return H(t, fo(n, e), a);
579
579
  }
580
580
  function mo(t, e, o = {}) {
581
- const { eventFilter: n, initialState: a = "active", ...i } = o, { eventFilter: r, pause: c, resume: s, isActive: u } = po(n, { initialState: a });
581
+ const { eventFilter: n, initialState: a = "active", ...s } = o, { eventFilter: r, pause: u, resume: i, isActive: c } = vo(n, { initialState: a });
582
582
  return {
583
583
  stop: go(t, e, {
584
- ...i,
584
+ ...s,
585
585
  eventFilter: r
586
586
  }),
587
- pause: c,
588
- resume: s,
589
- isActive: u
587
+ pause: u,
588
+ resume: i,
589
+ isActive: c
590
590
  };
591
591
  }
592
592
  function yo(t, e = !0, o) {
593
- ho() ? Pe(t, o) : e ? t() : se(t);
593
+ ho() ? Te(t, o) : e ? t() : se(t);
594
594
  }
595
595
  function bo(t, e, o) {
596
596
  return H(t, e, {
@@ -598,36 +598,36 @@ function bo(t, e, o) {
598
598
  immediate: !0
599
599
  });
600
600
  }
601
- const xe = io ? window : void 0;
601
+ const Ie = io ? window : void 0;
602
602
  function wo(t) {
603
603
  var e;
604
604
  const o = Q(t);
605
605
  return (e = o?.$el) !== null && e !== void 0 ? e : o;
606
606
  }
607
607
  function ut(...t) {
608
- const e = (n, a, i, r) => (n.addEventListener(a, i, r), () => n.removeEventListener(a, i, r)), o = x(() => {
609
- const n = Be(Q(t[0])).filter((a) => a != null);
608
+ const e = (n, a, s, r) => (n.addEventListener(a, s, r), () => n.removeEventListener(a, s, r)), o = x(() => {
609
+ const n = Le(Q(t[0])).filter((a) => a != null);
610
610
  return n.every((a) => typeof a != "string") ? n : void 0;
611
611
  });
612
612
  return bo(() => {
613
613
  var n, a;
614
614
  return [
615
- (n = (a = o.value) === null || a === void 0 ? void 0 : a.map((i) => wo(i))) !== null && n !== void 0 ? n : [xe].filter((i) => i != null),
616
- Be(Q(o.value ? t[1] : t[0])),
617
- Be(De(o.value ? t[2] : t[1])),
615
+ (n = (a = o.value) === null || a === void 0 ? void 0 : a.map((s) => wo(s))) !== null && n !== void 0 ? n : [Ie].filter((s) => s != null),
616
+ Le(Q(o.value ? t[1] : t[0])),
617
+ Le(Oe(o.value ? t[2] : t[1])),
618
618
  Q(o.value ? t[3] : t[2])
619
619
  ];
620
- }, ([n, a, i, r], c, s) => {
621
- if (!n?.length || !a?.length || !i?.length) return;
622
- const u = co(r) ? { ...r } : r, f = n.flatMap((h) => a.flatMap((b) => i.map((O) => e(h, b, O, u))));
623
- s(() => {
624
- f.forEach((h) => h());
620
+ }, ([n, a, s, r], u, i) => {
621
+ if (!n?.length || !a?.length || !s?.length) return;
622
+ const c = co(r) ? { ...r } : r, p = n.flatMap((y) => a.flatMap((h) => s.map((O) => e(y, h, O, c))));
623
+ i(() => {
624
+ p.forEach((y) => y());
625
625
  });
626
626
  }, { flush: "post" });
627
627
  }
628
- const ke = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Ne = "__vueuse_ssr_handlers__", So = /* @__PURE__ */ Eo();
628
+ const $e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, ke = "__vueuse_ssr_handlers__", So = /* @__PURE__ */ Eo();
629
629
  function Eo() {
630
- return Ne in ke || (ke[Ne] = ke[Ne] || {}), ke[Ne];
630
+ return ke in $e || ($e[ke] = $e[ke] || {}), $e[ke];
631
631
  }
632
632
  function _o(t, e) {
633
633
  return So[t] || e;
@@ -671,39 +671,39 @@ const ko = {
671
671
  }, dt = "vueuse-storage";
672
672
  function No(t, e, o, n = {}) {
673
673
  var a;
674
- const { flush: i = "pre", deep: r = !0, listenToStorageChanges: c = !0, writeDefaults: s = !0, mergeDefaults: u = !1, shallow: f, window: h = xe, eventFilter: b, onError: O = (k) => {
674
+ const { flush: s = "pre", deep: r = !0, listenToStorageChanges: u = !0, writeDefaults: i = !0, mergeDefaults: c = !1, shallow: p, window: y = Ie, eventFilter: h, onError: O = (k) => {
675
675
  console.error(k);
676
- }, initOnMounted: $ } = n, D = (f ? _e : A)(e), V = x(() => Q(t));
676
+ }, initOnMounted: _ } = n, D = (p ? _e : A)(e), V = x(() => Q(t));
677
677
  if (!o) try {
678
- o = _o("getDefaultStorage", () => xe?.localStorage)();
678
+ o = _o("getDefaultStorage", () => Ie?.localStorage)();
679
679
  } catch (k) {
680
680
  O(k);
681
681
  }
682
682
  if (!o) return D;
683
- const j = Q(e), P = $o(j), U = (a = n.serializer) !== null && a !== void 0 ? a : ko[P], { pause: q, resume: G } = mo(D, (k) => g(k), {
684
- flush: i,
683
+ const M = Q(e), P = $o(M), U = (a = n.serializer) !== null && a !== void 0 ? a : ko[P], { pause: q, resume: K } = mo(D, (k) => g(k), {
684
+ flush: s,
685
685
  deep: r,
686
- eventFilter: b
686
+ eventFilter: h
687
687
  });
688
- H(V, () => C(), { flush: i });
688
+ H(V, () => C(), { flush: s });
689
689
  let z = !1;
690
- const _ = (k) => {
691
- $ && !z || C(k);
690
+ const $ = (k) => {
691
+ _ && !z || C(k);
692
692
  }, te = (k) => {
693
- $ && !z || B(k);
693
+ _ && !z || B(k);
694
694
  };
695
- h && c && (o instanceof Storage ? ut(h, "storage", _, { passive: !0 }) : ut(h, dt, te)), $ ? yo(() => {
695
+ y && u && (o instanceof Storage ? ut(y, "storage", $, { passive: !0 }) : ut(y, dt, te)), _ ? yo(() => {
696
696
  z = !0, C();
697
697
  }) : C();
698
698
  function W(k, I) {
699
- if (h) {
699
+ if (y) {
700
700
  const L = {
701
701
  key: V.value,
702
702
  oldValue: k,
703
703
  newValue: I,
704
704
  storageArea: o
705
705
  };
706
- h.dispatchEvent(o instanceof Storage ? new StorageEvent("storage", L) : new CustomEvent(dt, { detail: L }));
706
+ y.dispatchEvent(o instanceof Storage ? new StorageEvent("storage", L) : new CustomEvent(dt, { detail: L }));
707
707
  }
708
708
  }
709
709
  function g(k) {
@@ -722,11 +722,11 @@ function No(t, e, o, n = {}) {
722
722
  function m(k) {
723
723
  const I = k ? k.newValue : o.getItem(V.value);
724
724
  if (I == null)
725
- return s && j != null && o.setItem(V.value, U.write(j)), j;
726
- if (!k && u) {
725
+ return i && M != null && o.setItem(V.value, U.write(M)), M;
726
+ if (!k && c) {
727
727
  const L = U.read(I);
728
- return typeof u == "function" ? u(L, j) : P === "object" && !Array.isArray(L) ? {
729
- ...j,
728
+ return typeof c == "function" ? c(L, M) : P === "object" && !Array.isArray(L) ? {
729
+ ...M,
730
730
  ...L
731
731
  } : L;
732
732
  } else return typeof I != "string" ? I : U.read(I);
@@ -734,7 +734,7 @@ function No(t, e, o, n = {}) {
734
734
  function C(k) {
735
735
  if (!(k && k.storageArea !== o)) {
736
736
  if (k && k.key == null) {
737
- D.value = j;
737
+ D.value = M;
738
738
  return;
739
739
  }
740
740
  if (!(k && k.key !== V.value)) {
@@ -745,7 +745,7 @@ function No(t, e, o, n = {}) {
745
745
  } catch (I) {
746
746
  O(I);
747
747
  } finally {
748
- k ? se(G) : G();
748
+ k ? se(K) : K();
749
749
  }
750
750
  }
751
751
  }
@@ -756,13 +756,13 @@ function No(t, e, o, n = {}) {
756
756
  return D;
757
757
  }
758
758
  function Oo(t, e, o = {}) {
759
- const { window: n = xe } = o;
759
+ const { window: n = Ie } = o;
760
760
  return No(t, e, n?.localStorage, o);
761
761
  }
762
- function He() {
762
+ function Be() {
763
763
  return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
764
764
  }
765
- function Oe(t) {
765
+ function Ne(t) {
766
766
  const e = {
767
767
  type: t.type,
768
768
  clientId: t.clientId,
@@ -797,145 +797,145 @@ const Dt = /* @__PURE__ */ ro("hst-operation-log", () => {
797
797
  autoSyncInterval: 3e4,
798
798
  enablePersistence: !1,
799
799
  persistenceKeyPrefix: "stonecrop-ops"
800
- }), e = A([]), o = A(-1), n = A(He()), a = A(!1), i = A([]), r = A(null), c = x(() => o.value < 0 ? !1 : e.value[o.value]?.reversible ?? !1), s = x(() => o.value < e.value.length - 1), u = x(() => {
801
- let v = 0;
802
- for (let p = o.value; p >= 0 && e.value[p]?.reversible; p--)
803
- v++;
804
- return v;
805
- }), f = x(() => e.value.length - 1 - o.value), h = x(() => ({
806
- canUndo: c.value,
807
- canRedo: s.value,
808
- undoCount: u.value,
809
- redoCount: f.value,
800
+ }), e = A([]), o = A(-1), n = A(Be()), a = A(!1), s = A([]), r = A(null), u = x(() => o.value < 0 ? !1 : e.value[o.value]?.reversible ?? !1), i = x(() => o.value < e.value.length - 1), c = x(() => {
801
+ let f = 0;
802
+ for (let v = o.value; v >= 0 && e.value[v]?.reversible; v--)
803
+ f++;
804
+ return f;
805
+ }), p = x(() => e.value.length - 1 - o.value), y = x(() => ({
806
+ canUndo: u.value,
807
+ canRedo: i.value,
808
+ undoCount: c.value,
809
+ redoCount: p.value,
810
810
  currentIndex: o.value
811
811
  }));
812
- function b(v) {
813
- t.value = { ...t.value, ...v }, t.value.enablePersistence && (E(), S()), t.value.enableCrossTabSync && m();
812
+ function h(f) {
813
+ t.value = { ...t.value, ...f }, t.value.enablePersistence && (E(), S()), t.value.enableCrossTabSync && m();
814
814
  }
815
- function O(v, p = "user") {
816
- const y = {
817
- ...v,
818
- id: He(),
815
+ function O(f, v = "user") {
816
+ const b = {
817
+ ...f,
818
+ id: Be(),
819
819
  timestamp: /* @__PURE__ */ new Date(),
820
- source: p,
820
+ source: v,
821
821
  userId: t.value.userId
822
822
  };
823
- if (t.value.operationFilter && !t.value.operationFilter(y))
824
- return y.id;
823
+ if (t.value.operationFilter && !t.value.operationFilter(b))
824
+ return b.id;
825
825
  if (a.value)
826
- return i.value.push(y), y.id;
827
- if (o.value < e.value.length - 1 && (e.value = e.value.slice(0, o.value + 1)), e.value.push(y), o.value++, t.value.maxOperations && e.value.length > t.value.maxOperations) {
826
+ return s.value.push(b), b.id;
827
+ if (o.value < e.value.length - 1 && (e.value = e.value.slice(0, o.value + 1)), e.value.push(b), o.value++, t.value.maxOperations && e.value.length > t.value.maxOperations) {
828
828
  const l = e.value.length - t.value.maxOperations;
829
829
  e.value = e.value.slice(l), o.value -= l;
830
830
  }
831
- return t.value.enableCrossTabSync && C(y), y.id;
831
+ return t.value.enableCrossTabSync && C(b), b.id;
832
832
  }
833
- function $() {
834
- a.value = !0, i.value = [], r.value = He();
833
+ function _() {
834
+ a.value = !0, s.value = [], r.value = Be();
835
835
  }
836
- function D(v) {
837
- if (!a.value || i.value.length === 0)
838
- return a.value = !1, i.value = [], r.value = null, null;
839
- const p = r.value, y = i.value.every((w) => w.reversible), l = {
840
- id: p,
836
+ function D(f) {
837
+ if (!a.value || s.value.length === 0)
838
+ return a.value = !1, s.value = [], r.value = null, null;
839
+ const v = r.value, b = s.value.every((w) => w.reversible), l = {
840
+ id: v,
841
841
  type: "batch",
842
842
  path: "",
843
843
  // Batch doesn't have a single path
844
844
  fieldname: "",
845
845
  beforeValue: null,
846
846
  afterValue: null,
847
- doctype: i.value[0]?.doctype || "",
847
+ doctype: s.value[0]?.doctype || "",
848
848
  timestamp: /* @__PURE__ */ new Date(),
849
849
  source: "user",
850
- reversible: y,
851
- irreversibleReason: y ? void 0 : "Contains irreversible operations",
852
- childOperationIds: i.value.map((w) => w.id),
853
- metadata: { description: v }
850
+ reversible: b,
851
+ irreversibleReason: b ? void 0 : "Contains irreversible operations",
852
+ childOperationIds: s.value.map((w) => w.id),
853
+ metadata: { description: f }
854
854
  };
855
- i.value.forEach((w) => {
856
- w.parentOperationId = p;
857
- }), e.value.push(...i.value, l), o.value = e.value.length - 1, t.value.enableCrossTabSync && B(i.value, l);
858
- const d = p;
859
- return a.value = !1, i.value = [], r.value = null, d;
855
+ s.value.forEach((w) => {
856
+ w.parentOperationId = v;
857
+ }), e.value.push(...s.value, l), o.value = e.value.length - 1, t.value.enableCrossTabSync && B(s.value, l);
858
+ const d = v;
859
+ return a.value = !1, s.value = [], r.value = null, d;
860
860
  }
861
861
  function V() {
862
- a.value = !1, i.value = [], r.value = null;
862
+ a.value = !1, s.value = [], r.value = null;
863
863
  }
864
- function j(v) {
865
- if (!c.value) return !1;
866
- const p = e.value[o.value];
867
- if (!p.reversible)
868
- return typeof console < "u" && p.irreversibleReason && console.warn("Cannot undo irreversible operation:", p.irreversibleReason), !1;
864
+ function M(f) {
865
+ if (!u.value) return !1;
866
+ const v = e.value[o.value];
867
+ if (!v.reversible)
868
+ return typeof console < "u" && v.irreversibleReason && console.warn("Cannot undo irreversible operation:", v.irreversibleReason), !1;
869
869
  try {
870
- if (p.type === "batch" && p.childOperationIds)
871
- for (let y = p.childOperationIds.length - 1; y >= 0; y--) {
872
- const l = p.childOperationIds[y], d = e.value.find((w) => w.id === l);
873
- d && U(d, v);
870
+ if (v.type === "batch" && v.childOperationIds)
871
+ for (let b = v.childOperationIds.length - 1; b >= 0; b--) {
872
+ const l = v.childOperationIds[b], d = e.value.find((w) => w.id === l);
873
+ d && U(d, f);
874
874
  }
875
875
  else
876
- U(p, v);
877
- return o.value--, t.value.enableCrossTabSync && k(p), !0;
878
- } catch (y) {
879
- return typeof console < "u" && console.error("Undo failed:", y), !1;
876
+ U(v, f);
877
+ return o.value--, t.value.enableCrossTabSync && k(v), !0;
878
+ } catch (b) {
879
+ return typeof console < "u" && console.error("Undo failed:", b), !1;
880
880
  }
881
881
  }
882
- function P(v) {
883
- if (!s.value) return !1;
884
- const p = e.value[o.value + 1];
882
+ function P(f) {
883
+ if (!i.value) return !1;
884
+ const v = e.value[o.value + 1];
885
885
  try {
886
- if (p.type === "batch" && p.childOperationIds)
887
- for (const y of p.childOperationIds) {
888
- const l = e.value.find((d) => d.id === y);
889
- l && q(l, v);
886
+ if (v.type === "batch" && v.childOperationIds)
887
+ for (const b of v.childOperationIds) {
888
+ const l = e.value.find((d) => d.id === b);
889
+ l && q(l, f);
890
890
  }
891
891
  else
892
- q(p, v);
893
- return o.value++, t.value.enableCrossTabSync && I(p), !0;
894
- } catch (y) {
895
- return typeof console < "u" && console.error("Redo failed:", y), !1;
892
+ q(v, f);
893
+ return o.value++, t.value.enableCrossTabSync && I(v), !0;
894
+ } catch (b) {
895
+ return typeof console < "u" && console.error("Redo failed:", b), !1;
896
896
  }
897
897
  }
898
- function U(v, p) {
899
- (v.type === "set" || v.type === "delete") && p && typeof p.set == "function" && p.set(v.path, v.beforeValue, "undo");
898
+ function U(f, v) {
899
+ (f.type === "set" || f.type === "delete") && v && typeof v.set == "function" && v.set(f.path, f.beforeValue, "undo");
900
900
  }
901
- function q(v, p) {
902
- (v.type === "set" || v.type === "delete") && p && typeof p.set == "function" && p.set(v.path, v.afterValue, "redo");
901
+ function q(f, v) {
902
+ (f.type === "set" || f.type === "delete") && v && typeof v.set == "function" && v.set(f.path, f.afterValue, "redo");
903
903
  }
904
- function G() {
905
- const v = e.value.filter((y) => y.reversible).length, p = e.value.map((y) => y.timestamp);
904
+ function K() {
905
+ const f = e.value.filter((b) => b.reversible).length, v = e.value.map((b) => b.timestamp);
906
906
  return {
907
907
  operations: [...e.value],
908
908
  currentIndex: o.value,
909
909
  totalOperations: e.value.length,
910
- reversibleOperations: v,
911
- irreversibleOperations: e.value.length - v,
912
- oldestOperation: p.length > 0 ? new Date(Math.min(...p.map((y) => y.getTime()))) : void 0,
913
- newestOperation: p.length > 0 ? new Date(Math.max(...p.map((y) => y.getTime()))) : void 0
910
+ reversibleOperations: f,
911
+ irreversibleOperations: e.value.length - f,
912
+ oldestOperation: v.length > 0 ? new Date(Math.min(...v.map((b) => b.getTime()))) : void 0,
913
+ newestOperation: v.length > 0 ? new Date(Math.max(...v.map((b) => b.getTime()))) : void 0
914
914
  };
915
915
  }
916
916
  function z() {
917
917
  e.value = [], o.value = -1;
918
918
  }
919
- function _(v, p) {
920
- return e.value.filter((y) => y.doctype === v && (p === void 0 || y.recordId === p));
919
+ function $(f, v) {
920
+ return e.value.filter((b) => b.doctype === f && (v === void 0 || b.recordId === v));
921
921
  }
922
- function te(v, p) {
923
- const y = e.value.find((l) => l.id === v);
924
- y && (y.reversible = !1, y.irreversibleReason = p);
922
+ function te(f, v) {
923
+ const b = e.value.find((l) => l.id === f);
924
+ b && (b.reversible = !1, b.irreversibleReason = v);
925
925
  }
926
- function W(v, p, y, l = "success", d) {
926
+ function W(f, v, b, l = "success", d) {
927
927
  const w = {
928
928
  type: "action",
929
- path: y && y.length > 0 ? `${v}.${y[0]}` : v,
929
+ path: b && b.length > 0 ? `${f}.${b[0]}` : f,
930
930
  fieldname: "",
931
931
  beforeValue: null,
932
932
  afterValue: null,
933
- doctype: v,
934
- recordId: y && y.length > 0 ? y[0] : void 0,
933
+ doctype: f,
934
+ recordId: b && b.length > 0 ? b[0] : void 0,
935
935
  reversible: !1,
936
936
  // Actions are typically not reversible
937
- actionName: p,
938
- actionRecordIds: y,
937
+ actionName: v,
938
+ actionRecordIds: b,
939
939
  actionResult: l,
940
940
  actionError: d
941
941
  };
@@ -943,89 +943,89 @@ const Dt = /* @__PURE__ */ ro("hst-operation-log", () => {
943
943
  }
944
944
  let g = null;
945
945
  function m() {
946
- typeof window > "u" || !window.BroadcastChannel || (g = new BroadcastChannel("stonecrop-operation-log"), g.addEventListener("message", (v) => {
947
- const p = v.data;
948
- if (!p || typeof p != "object") return;
949
- const y = Do(p);
950
- y.clientId !== n.value && (y.type === "operation" && y.operation ? (e.value.push({ ...y.operation, source: "sync" }), o.value = e.value.length - 1) : y.type === "operation" && y.operations && (e.value.push(...y.operations.map((l) => ({ ...l, source: "sync" }))), o.value = e.value.length - 1));
946
+ typeof window > "u" || !window.BroadcastChannel || (g = new BroadcastChannel("stonecrop-operation-log"), g.addEventListener("message", (f) => {
947
+ const v = f.data;
948
+ if (!v || typeof v != "object") return;
949
+ const b = Do(v);
950
+ b.clientId !== n.value && (b.type === "operation" && b.operation ? (e.value.push({ ...b.operation, source: "sync" }), o.value = e.value.length - 1) : b.type === "operation" && b.operations && (e.value.push(...b.operations.map((l) => ({ ...l, source: "sync" }))), o.value = e.value.length - 1));
951
951
  }));
952
952
  }
953
- function C(v) {
953
+ function C(f) {
954
954
  if (!g) return;
955
- const p = {
955
+ const v = {
956
956
  type: "operation",
957
- operation: v,
957
+ operation: f,
958
958
  clientId: n.value,
959
959
  timestamp: /* @__PURE__ */ new Date()
960
960
  };
961
- g.postMessage(Oe(p));
961
+ g.postMessage(Ne(v));
962
962
  }
963
- function B(v, p) {
963
+ function B(f, v) {
964
964
  if (!g) return;
965
- const y = {
965
+ const b = {
966
966
  type: "operation",
967
- operations: [...v, p],
967
+ operations: [...f, v],
968
968
  clientId: n.value,
969
969
  timestamp: /* @__PURE__ */ new Date()
970
970
  };
971
- g.postMessage(Oe(y));
971
+ g.postMessage(Ne(b));
972
972
  }
973
- function k(v) {
973
+ function k(f) {
974
974
  if (!g) return;
975
- const p = {
975
+ const v = {
976
976
  type: "undo",
977
- operation: v,
977
+ operation: f,
978
978
  clientId: n.value,
979
979
  timestamp: /* @__PURE__ */ new Date()
980
980
  };
981
- g.postMessage(Oe(p));
981
+ g.postMessage(Ne(v));
982
982
  }
983
- function I(v) {
983
+ function I(f) {
984
984
  if (!g) return;
985
- const p = {
985
+ const v = {
986
986
  type: "redo",
987
- operation: v,
987
+ operation: f,
988
988
  clientId: n.value,
989
989
  timestamp: /* @__PURE__ */ new Date()
990
990
  };
991
- g.postMessage(Oe(p));
991
+ g.postMessage(Ne(v));
992
992
  }
993
993
  const L = Oo("stonecrop-ops-operations", null, {
994
994
  serializer: {
995
- read: (v) => {
995
+ read: (f) => {
996
996
  try {
997
- return JSON.parse(v);
997
+ return JSON.parse(f);
998
998
  } catch {
999
999
  return null;
1000
1000
  }
1001
1001
  },
1002
- write: (v) => v ? JSON.stringify(v) : ""
1002
+ write: (f) => f ? JSON.stringify(f) : ""
1003
1003
  }
1004
1004
  });
1005
1005
  function E() {
1006
1006
  if (!(typeof window > "u"))
1007
1007
  try {
1008
- const v = L.value;
1009
- v && Array.isArray(v.operations) && (e.value = v.operations.map((p) => ({
1010
- ...p,
1011
- timestamp: new Date(p.timestamp)
1012
- })), o.value = v.currentIndex ?? -1);
1013
- } catch (v) {
1014
- typeof console < "u" && console.error("Failed to load operations from persistence:", v);
1008
+ const f = L.value;
1009
+ f && Array.isArray(f.operations) && (e.value = f.operations.map((v) => ({
1010
+ ...v,
1011
+ timestamp: new Date(v.timestamp)
1012
+ })), o.value = f.currentIndex ?? -1);
1013
+ } catch (f) {
1014
+ typeof console < "u" && console.error("Failed to load operations from persistence:", f);
1015
1015
  }
1016
1016
  }
1017
1017
  function N() {
1018
1018
  if (!(typeof window > "u"))
1019
1019
  try {
1020
1020
  L.value = {
1021
- operations: e.value.map((v) => ({
1022
- ...v,
1023
- timestamp: v.timestamp.toISOString()
1021
+ operations: e.value.map((f) => ({
1022
+ ...f,
1023
+ timestamp: f.timestamp.toISOString()
1024
1024
  })),
1025
1025
  currentIndex: o.value
1026
1026
  };
1027
- } catch (v) {
1028
- typeof console < "u" && console.error("Failed to save operations to persistence:", v);
1027
+ } catch (f) {
1028
+ typeof console < "u" && console.error("Failed to save operations to persistence:", f);
1029
1029
  }
1030
1030
  }
1031
1031
  function S() {
@@ -1043,23 +1043,23 @@ const Dt = /* @__PURE__ */ ro("hst-operation-log", () => {
1043
1043
  currentIndex: o,
1044
1044
  config: t,
1045
1045
  clientId: n,
1046
- undoRedoState: h,
1046
+ undoRedoState: y,
1047
1047
  // Computed
1048
- canUndo: c,
1049
- canRedo: s,
1050
- undoCount: u,
1051
- redoCount: f,
1048
+ canUndo: u,
1049
+ canRedo: i,
1050
+ undoCount: c,
1051
+ redoCount: p,
1052
1052
  // Methods
1053
- configure: b,
1053
+ configure: h,
1054
1054
  addOperation: O,
1055
- startBatch: $,
1055
+ startBatch: _,
1056
1056
  commitBatch: D,
1057
1057
  cancelBatch: V,
1058
- undo: j,
1058
+ undo: M,
1059
1059
  redo: P,
1060
1060
  clear: z,
1061
- getOperationsFor: _,
1062
- getSnapshot: G,
1061
+ getOperationsFor: $,
1062
+ getSnapshot: K,
1063
1063
  markIrreversible: te,
1064
1064
  logAction: W
1065
1065
  };
@@ -1135,14 +1135,14 @@ class ye {
1135
1135
  if (!o) return;
1136
1136
  const n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
1137
1137
  if (typeof o.entrySeq == "function")
1138
- o.entrySeq().forEach(([i, r]) => {
1139
- this.categorizeAction(i, r, n, a);
1138
+ o.entrySeq().forEach(([s, r]) => {
1139
+ this.categorizeAction(s, r, n, a);
1140
1140
  });
1141
1141
  else if (o instanceof Map)
1142
- for (const [i, r] of o)
1143
- this.categorizeAction(i, r, n, a);
1144
- else o && typeof o == "object" && Object.entries(o).forEach(([i, r]) => {
1145
- this.categorizeAction(i, r, n, a);
1142
+ for (const [s, r] of o)
1143
+ this.categorizeAction(s, r, n, a);
1144
+ else o && typeof o == "object" && Object.entries(o).forEach(([s, r]) => {
1145
+ this.categorizeAction(s, r, n, a);
1146
1146
  });
1147
1147
  this.doctypeActions.set(e, n), this.doctypeTransitions.set(e, a);
1148
1148
  }
@@ -1166,8 +1166,8 @@ class ye {
1166
1166
  * @param options - Execution options (timeout and enableRollback)
1167
1167
  */
1168
1168
  async executeFieldTriggers(e, o = {}) {
1169
- const { doctype: n, fieldname: a } = e, i = this.findFieldTriggers(n, a);
1170
- if (i.length === 0)
1169
+ const { doctype: n, fieldname: a } = e, s = this.findFieldTriggers(n, a);
1170
+ if (s.length === 0)
1171
1171
  return {
1172
1172
  path: e.path,
1173
1173
  actionResults: [],
@@ -1176,36 +1176,36 @@ class ye {
1176
1176
  stoppedOnError: !1,
1177
1177
  rolledBack: !1
1178
1178
  };
1179
- const r = performance.now(), c = [];
1180
- let s = !1, u = !1, f;
1181
- const h = this.getFieldRollback(n, a), b = o.enableRollback ?? h ?? this.options.enableRollback;
1182
- b && e.store && (f = this.captureSnapshot(e));
1183
- for (const D of i)
1179
+ const r = performance.now(), u = [];
1180
+ let i = !1, c = !1, p;
1181
+ const y = this.getFieldRollback(n, a), h = o.enableRollback ?? y ?? this.options.enableRollback;
1182
+ h && e.store && (p = this.captureSnapshot(e));
1183
+ for (const D of s)
1184
1184
  try {
1185
1185
  const V = await this.executeAction(D, e, o.timeout);
1186
- if (c.push(V), !V.success) {
1187
- s = !0;
1186
+ if (u.push(V), !V.success) {
1187
+ i = !0;
1188
1188
  break;
1189
1189
  }
1190
1190
  } catch (V) {
1191
- const j = {
1191
+ const M = {
1192
1192
  success: !1,
1193
1193
  error: V instanceof Error ? V : new Error(String(V)),
1194
1194
  executionTime: 0,
1195
1195
  action: D
1196
1196
  };
1197
- c.push(j), s = !0;
1197
+ u.push(M), i = !0;
1198
1198
  break;
1199
1199
  }
1200
- if (b && s && f && e.store)
1200
+ if (h && i && p && e.store)
1201
1201
  try {
1202
- this.restoreSnapshot(e, f), u = !0;
1202
+ this.restoreSnapshot(e, p), c = !0;
1203
1203
  } catch (D) {
1204
1204
  console.error("[FieldTriggers] Rollback failed:", D);
1205
1205
  }
1206
- const O = performance.now() - r, $ = c.filter((D) => !D.success);
1207
- if ($.length > 0 && this.options.errorHandler)
1208
- for (const D of $)
1206
+ const O = performance.now() - r, _ = u.filter((D) => !D.success);
1207
+ if (_.length > 0 && this.options.errorHandler)
1208
+ for (const D of _)
1209
1209
  try {
1210
1210
  this.options.errorHandler(D.error, e, D.action);
1211
1211
  } catch (V) {
@@ -1213,12 +1213,12 @@ class ye {
1213
1213
  }
1214
1214
  return {
1215
1215
  path: e.path,
1216
- actionResults: c,
1216
+ actionResults: u,
1217
1217
  totalExecutionTime: O,
1218
- allSucceeded: c.every((D) => D.success),
1219
- stoppedOnError: s,
1220
- rolledBack: u,
1221
- snapshot: this.options.debug && b ? f : void 0
1218
+ allSucceeded: u.every((D) => D.success),
1219
+ stoppedOnError: i,
1220
+ rolledBack: c,
1221
+ snapshot: this.options.debug && h ? p : void 0
1222
1222
  // Only include snapshot in debug mode if rollback is enabled
1223
1223
  };
1224
1224
  }
@@ -1229,33 +1229,33 @@ class ye {
1229
1229
  * @param options - Execution options (timeout)
1230
1230
  */
1231
1231
  async executeTransitionActions(e, o = {}) {
1232
- const { doctype: n, transition: a } = e, i = this.findTransitionActions(n, a);
1233
- if (i.length === 0)
1232
+ const { doctype: n, transition: a } = e, s = this.findTransitionActions(n, a);
1233
+ if (s.length === 0)
1234
1234
  return [];
1235
1235
  const r = [];
1236
- for (const s of i)
1236
+ for (const i of s)
1237
1237
  try {
1238
- const u = await this.executeTransitionAction(s, e, o.timeout);
1239
- if (r.push(u), !u.success)
1238
+ const c = await this.executeTransitionAction(i, e, o.timeout);
1239
+ if (r.push(c), !c.success)
1240
1240
  break;
1241
- } catch (u) {
1242
- const f = {
1241
+ } catch (c) {
1242
+ const p = {
1243
1243
  success: !1,
1244
- error: u instanceof Error ? u : new Error(String(u)),
1244
+ error: c instanceof Error ? c : new Error(String(c)),
1245
1245
  executionTime: 0,
1246
- action: s,
1246
+ action: i,
1247
1247
  transition: a
1248
1248
  };
1249
- r.push(f);
1249
+ r.push(p);
1250
1250
  break;
1251
1251
  }
1252
- const c = r.filter((s) => !s.success);
1253
- if (c.length > 0 && this.options.errorHandler)
1254
- for (const s of c)
1252
+ const u = r.filter((i) => !i.success);
1253
+ if (u.length > 0 && this.options.errorHandler)
1254
+ for (const i of u)
1255
1255
  try {
1256
- this.options.errorHandler(s.error, e, s.action);
1257
- } catch (u) {
1258
- console.error("[FieldTriggers] Error in global error handler:", u);
1256
+ this.options.errorHandler(i.error, e, i.action);
1257
+ } catch (c) {
1258
+ console.error("[FieldTriggers] Error in global error handler:", c);
1259
1259
  }
1260
1260
  return r;
1261
1261
  }
@@ -1270,27 +1270,27 @@ class ye {
1270
1270
  * Execute a single transition action by name
1271
1271
  */
1272
1272
  async executeTransitionAction(e, o, n) {
1273
- const a = performance.now(), i = n ?? this.options.defaultTimeout;
1273
+ const a = performance.now(), s = n ?? this.options.defaultTimeout;
1274
1274
  try {
1275
1275
  let r = this.globalTransitionActions.get(e);
1276
1276
  if (!r) {
1277
- const c = this.globalActions.get(e);
1278
- c && (r = c);
1277
+ const u = this.globalActions.get(e);
1278
+ u && (r = u);
1279
1279
  }
1280
1280
  if (!r)
1281
1281
  throw new Error(`Transition action "${e}" not found in registry`);
1282
- return await this.executeWithTimeout(r, o, i), {
1282
+ return await this.executeWithTimeout(r, o, s), {
1283
1283
  success: !0,
1284
1284
  executionTime: performance.now() - a,
1285
1285
  action: e,
1286
1286
  transition: o.transition
1287
1287
  };
1288
1288
  } catch (r) {
1289
- const c = performance.now() - a;
1289
+ const u = performance.now() - a;
1290
1290
  return {
1291
1291
  success: !1,
1292
1292
  error: r instanceof Error ? r : new Error(String(r)),
1293
- executionTime: c,
1293
+ executionTime: u,
1294
1294
  action: e,
1295
1295
  transition: o.transition
1296
1296
  };
@@ -1304,8 +1304,8 @@ class ye {
1304
1304
  const n = this.doctypeActions.get(e);
1305
1305
  if (!n) return [];
1306
1306
  const a = [];
1307
- for (const [i, r] of n)
1308
- this.isFieldTriggerKey(i, o) && a.push(...r);
1307
+ for (const [s, r] of n)
1308
+ this.isFieldTriggerKey(s, o) && a.push(...r);
1309
1309
  return a;
1310
1310
  }
1311
1311
  /**
@@ -1326,9 +1326,9 @@ class ye {
1326
1326
  const n = e.split("."), a = o.split(".");
1327
1327
  if (n.length !== a.length)
1328
1328
  return !1;
1329
- for (let i = 0; i < n.length; i++) {
1330
- const r = n[i], c = a[i];
1331
- if (r !== "*" && r !== c)
1329
+ for (let s = 0; s < n.length; s++) {
1330
+ const r = n[s], u = a[s];
1331
+ if (r !== "*" && r !== u)
1332
1332
  return !1;
1333
1333
  }
1334
1334
  return !0;
@@ -1337,22 +1337,22 @@ class ye {
1337
1337
  * Execute a single action by name
1338
1338
  */
1339
1339
  async executeAction(e, o, n) {
1340
- const a = performance.now(), i = n ?? this.options.defaultTimeout;
1340
+ const a = performance.now(), s = n ?? this.options.defaultTimeout;
1341
1341
  try {
1342
1342
  const r = this.globalActions.get(e);
1343
1343
  if (!r)
1344
1344
  throw new Error(`Action "${e}" not found in registry`);
1345
- return await this.executeWithTimeout(r, o, i), {
1345
+ return await this.executeWithTimeout(r, o, s), {
1346
1346
  success: !0,
1347
1347
  executionTime: performance.now() - a,
1348
1348
  action: e
1349
1349
  };
1350
1350
  } catch (r) {
1351
- const c = performance.now() - a;
1351
+ const u = performance.now() - a;
1352
1352
  return {
1353
1353
  success: !1,
1354
1354
  error: r instanceof Error ? r : new Error(String(r)),
1355
- executionTime: c,
1355
+ executionTime: u,
1356
1356
  action: e
1357
1357
  };
1358
1358
  }
@@ -1361,14 +1361,14 @@ class ye {
1361
1361
  * Execute a function with timeout
1362
1362
  */
1363
1363
  async executeWithTimeout(e, o, n) {
1364
- return new Promise((a, i) => {
1364
+ return new Promise((a, s) => {
1365
1365
  const r = setTimeout(() => {
1366
- i(new Error(`Action timeout after ${n}ms`));
1366
+ s(new Error(`Action timeout after ${n}ms`));
1367
1367
  }, n);
1368
- Promise.resolve(e(o)).then((c) => {
1369
- clearTimeout(r), a(c);
1370
- }).catch((c) => {
1371
- clearTimeout(r), i(c);
1368
+ Promise.resolve(e(o)).then((u) => {
1369
+ clearTimeout(r), a(u);
1370
+ }).catch((u) => {
1371
+ clearTimeout(r), s(u);
1372
1372
  });
1373
1373
  });
1374
1374
  }
@@ -1400,10 +1400,10 @@ class ye {
1400
1400
  }
1401
1401
  }
1402
1402
  }
1403
- function ft(t) {
1403
+ function pt(t) {
1404
1404
  return new ye(t);
1405
1405
  }
1406
- function vt() {
1406
+ function ft() {
1407
1407
  try {
1408
1408
  return Dt();
1409
1409
  } catch {
@@ -1451,23 +1451,23 @@ class ue {
1451
1451
  return o.registry[e];
1452
1452
  }
1453
1453
  }
1454
- class Te {
1454
+ class xe {
1455
1455
  target;
1456
1456
  parentPath;
1457
1457
  rootNode;
1458
1458
  doctype;
1459
1459
  parentDoctype;
1460
1460
  hst;
1461
- constructor(e, o, n = "", a = null, i) {
1462
- return this.target = e, this.parentPath = n, this.rootNode = a || this, this.doctype = o, this.parentDoctype = i, this.hst = ue.getInstance(), new Proxy(this, {
1463
- get(r, c) {
1464
- if (c in r) return r[c];
1465
- const s = String(c);
1466
- return r.getNode(s);
1461
+ constructor(e, o, n = "", a = null, s) {
1462
+ return this.target = e, this.parentPath = n, this.rootNode = a || this, this.doctype = o, this.parentDoctype = s, this.hst = ue.getInstance(), new Proxy(this, {
1463
+ get(r, u) {
1464
+ if (u in r) return r[u];
1465
+ const i = String(u);
1466
+ return r.getNode(i);
1467
1467
  },
1468
- set(r, c, s) {
1469
- const u = String(c);
1470
- return r.set(u, s), !0;
1468
+ set(r, u, i) {
1469
+ const c = String(u);
1470
+ return r.set(c, i), !0;
1471
1471
  }
1472
1472
  });
1473
1473
  }
@@ -1477,24 +1477,24 @@ class Te {
1477
1477
  // Method to get a tree-wrapped node for navigation
1478
1478
  getNode(e) {
1479
1479
  const o = this.resolvePath(e), n = this.resolveValue(e), a = o.split(".");
1480
- let i = this.doctype;
1481
- return this.doctype === "StonecropStore" && a.length >= 1 && (i = a[0]), typeof n == "object" && n !== null && !this.isPrimitive(n) ? new Te(n, i, o, this.rootNode, this.parentDoctype) : new Te(n, i, o, this.rootNode, this.parentDoctype);
1480
+ let s = this.doctype;
1481
+ return this.doctype === "StonecropStore" && a.length >= 1 && (s = a[0]), typeof n == "object" && n !== null && !this.isPrimitive(n) ? new xe(n, s, o, this.rootNode, this.parentDoctype) : new xe(n, s, o, this.rootNode, this.parentDoctype);
1482
1482
  }
1483
1483
  set(e, o, n = "user") {
1484
- const a = this.resolvePath(e), i = this.has(e) ? this.get(e) : void 0;
1484
+ const a = this.resolvePath(e), s = this.has(e) ? this.get(e) : void 0;
1485
1485
  if (n !== "undo" && n !== "redo") {
1486
- const r = vt();
1486
+ const r = ft();
1487
1487
  if (r && typeof r.addOperation == "function") {
1488
- const c = a.split("."), s = this.doctype === "StonecropStore" && c.length >= 1 ? c[0] : this.doctype, u = c.length >= 2 ? c[1] : void 0, f = c.slice(2).join(".") || c[c.length - 1], h = o === void 0 && i !== void 0 ? "delete" : "set";
1488
+ const u = a.split("."), i = this.doctype === "StonecropStore" && u.length >= 1 ? u[0] : this.doctype, c = u.length >= 2 ? u[1] : void 0, p = u.slice(2).join(".") || u[u.length - 1], y = o === void 0 && s !== void 0 ? "delete" : "set";
1489
1489
  r.addOperation(
1490
1490
  {
1491
- type: h,
1491
+ type: y,
1492
1492
  path: a,
1493
- fieldname: f,
1494
- beforeValue: i,
1493
+ fieldname: p,
1494
+ beforeValue: s,
1495
1495
  afterValue: o,
1496
- doctype: s,
1497
- recordId: u,
1496
+ doctype: i,
1497
+ recordId: c,
1498
1498
  reversible: !0
1499
1499
  // Default to reversible, can be changed by field triggers
1500
1500
  },
@@ -1502,7 +1502,7 @@ class Te {
1502
1502
  );
1503
1503
  }
1504
1504
  }
1505
- this.updateValue(e, o), this.triggerFieldActions(a, i, o);
1505
+ this.updateValue(e, o), this.triggerFieldActions(a, s, o);
1506
1506
  }
1507
1507
  has(e) {
1508
1508
  try {
@@ -1511,12 +1511,12 @@ class Te {
1511
1511
  const o = this.parsePath(e);
1512
1512
  let n = this.target;
1513
1513
  for (let a = 0; a < o.length; a++) {
1514
- const i = o[a];
1514
+ const s = o[a];
1515
1515
  if (n == null)
1516
1516
  return !1;
1517
1517
  if (a === o.length - 1)
1518
- return this.isImmutable(n) ? n.has(i) : this.isPiniaStore(n) && n.$state && i in n.$state || i in n;
1519
- n = this.getProperty(n, i);
1518
+ return this.isImmutable(n) ? n.has(s) : this.isPiniaStore(n) && n.$state && s in n.$state || s in n;
1519
+ n = this.getProperty(n, s);
1520
1520
  }
1521
1521
  return !1;
1522
1522
  } catch {
@@ -1545,17 +1545,17 @@ class Te {
1545
1545
  * Trigger an XState transition with optional context data
1546
1546
  */
1547
1547
  async triggerTransition(e, o) {
1548
- const n = ft(), a = this.parentPath.split(".");
1549
- let i = this.doctype, r;
1550
- this.doctype === "StonecropStore" && a.length >= 1 && (i = a[0]), a.length >= 2 && (r = a[1]);
1551
- const c = {
1548
+ const n = pt(), a = this.parentPath.split(".");
1549
+ let s = this.doctype, r;
1550
+ this.doctype === "StonecropStore" && a.length >= 1 && (s = a[0]), a.length >= 2 && (r = a[1]);
1551
+ const u = {
1552
1552
  path: this.parentPath,
1553
1553
  fieldname: "",
1554
1554
  // No specific field for transitions
1555
1555
  beforeValue: void 0,
1556
1556
  afterValue: void 0,
1557
1557
  operation: "set",
1558
- doctype: i,
1558
+ doctype: s,
1559
1559
  recordId: r,
1560
1560
  timestamp: /* @__PURE__ */ new Date(),
1561
1561
  store: this.rootNode || void 0,
@@ -1563,15 +1563,15 @@ class Te {
1563
1563
  currentState: o?.currentState,
1564
1564
  targetState: o?.targetState,
1565
1565
  fsmContext: o?.fsmContext
1566
- }, s = vt();
1567
- return s && typeof s.addOperation == "function" && s.addOperation(
1566
+ }, i = ft();
1567
+ return i && typeof i.addOperation == "function" && i.addOperation(
1568
1568
  {
1569
1569
  type: "transition",
1570
1570
  path: this.parentPath,
1571
1571
  fieldname: e,
1572
1572
  beforeValue: o?.currentState,
1573
1573
  afterValue: o?.targetState,
1574
- doctype: i,
1574
+ doctype: s,
1575
1575
  recordId: r,
1576
1576
  reversible: !1,
1577
1577
  // FSM transitions are generally not reversible
@@ -1583,7 +1583,7 @@ class Te {
1583
1583
  }
1584
1584
  },
1585
1585
  "user"
1586
- ), await n.executeTransitionActions(c);
1586
+ ), await n.executeTransitionActions(u);
1587
1587
  }
1588
1588
  // Private helper methods
1589
1589
  resolvePath(e) {
@@ -1605,11 +1605,11 @@ class Te {
1605
1605
  if (e === "")
1606
1606
  throw new Error("Cannot set value on empty path");
1607
1607
  const n = this.parsePath(e), a = n.pop();
1608
- let i = this.target;
1608
+ let s = this.target;
1609
1609
  for (const r of n)
1610
- if (i = this.getProperty(i, r), i == null)
1610
+ if (s = this.getProperty(s, r), s == null)
1611
1611
  throw new Error(`Cannot set property on null/undefined path: ${e}`);
1612
- this.setProperty(i, a, o);
1612
+ this.setProperty(s, a, o);
1613
1613
  }
1614
1614
  getProperty(e, o) {
1615
1615
  return this.isImmutable(e) ? e.get(o) : this.isVueReactive(e) ? e[o] : this.isPiniaStore(e) ? e.$state?.[o] ?? e[o] : e[o];
@@ -1630,24 +1630,24 @@ class Te {
1630
1630
  const a = e.split(".");
1631
1631
  if (a.length < 3)
1632
1632
  return;
1633
- const i = ft(), r = a.slice(2).join(".") || a[a.length - 1];
1634
- let c = this.doctype;
1635
- this.doctype === "StonecropStore" && a.length >= 1 && (c = a[0]);
1636
- let s;
1637
- a.length >= 2 && (s = a[1]);
1638
- const u = {
1633
+ const s = pt(), r = a.slice(2).join(".") || a[a.length - 1];
1634
+ let u = this.doctype;
1635
+ this.doctype === "StonecropStore" && a.length >= 1 && (u = a[0]);
1636
+ let i;
1637
+ a.length >= 2 && (i = a[1]);
1638
+ const c = {
1639
1639
  path: e,
1640
1640
  fieldname: r,
1641
1641
  beforeValue: o,
1642
1642
  afterValue: n,
1643
1643
  operation: "set",
1644
- doctype: c,
1645
- recordId: s,
1644
+ doctype: u,
1645
+ recordId: i,
1646
1646
  timestamp: /* @__PURE__ */ new Date(),
1647
1647
  store: this.rootNode || void 0
1648
1648
  // Pass the root store for snapshot/rollback capabilities
1649
1649
  };
1650
- await i.executeFieldTriggers(u);
1650
+ await s.executeFieldTriggers(c);
1651
1651
  } catch (a) {
1652
1652
  a instanceof Error && console.warn("Field trigger error:", a.message);
1653
1653
  }
@@ -1661,19 +1661,19 @@ class Te {
1661
1661
  isImmutable(e) {
1662
1662
  if (!e || typeof e != "object")
1663
1663
  return !1;
1664
- const o = "get" in e && typeof e.get == "function", n = "set" in e && typeof e.set == "function", a = "has" in e && typeof e.has == "function", i = "__ownerID" in e || "_map" in e || "_list" in e || "_origin" in e || "_capacity" in e || "_defaultValues" in e || "_tail" in e || "_root" in e || "size" in e && o && n;
1664
+ const o = "get" in e && typeof e.get == "function", n = "set" in e && typeof e.set == "function", a = "has" in e && typeof e.has == "function", s = "__ownerID" in e || "_map" in e || "_list" in e || "_origin" in e || "_capacity" in e || "_defaultValues" in e || "_tail" in e || "_root" in e || "size" in e && o && n;
1665
1665
  let r;
1666
1666
  try {
1667
- const s = e;
1668
- if ("constructor" in s && s.constructor && typeof s.constructor == "object" && "name" in s.constructor) {
1669
- const u = s.constructor.name;
1670
- r = typeof u == "string" ? u : void 0;
1667
+ const i = e;
1668
+ if ("constructor" in i && i.constructor && typeof i.constructor == "object" && "name" in i.constructor) {
1669
+ const c = i.constructor.name;
1670
+ r = typeof c == "string" ? c : void 0;
1671
1671
  }
1672
1672
  } catch {
1673
1673
  r = void 0;
1674
1674
  }
1675
- const c = r && (r.includes("Map") || r.includes("List") || r.includes("Set") || r.includes("Stack") || r.includes("Seq")) && (o || n);
1676
- return !!(o && n && a && i || o && n && c);
1675
+ const u = r && (r.includes("Map") || r.includes("List") || r.includes("Set") || r.includes("Stack") || r.includes("Seq")) && (o || n);
1676
+ return !!(o && n && a && s || o && n && u);
1677
1677
  }
1678
1678
  isPrimitive(e) {
1679
1679
  return e == null || typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "function" || typeof e == "symbol" || typeof e == "bigint";
@@ -1688,7 +1688,7 @@ class Te {
1688
1688
  }
1689
1689
  }
1690
1690
  function Co(t, e, o) {
1691
- return new Te(t, e, "", null, o);
1691
+ return new xe(t, e, "", null, o);
1692
1692
  }
1693
1693
  class Ro {
1694
1694
  hstStore;
@@ -1804,19 +1804,19 @@ class Ro {
1804
1804
  * @param args - Action arguments (typically record IDs)
1805
1805
  */
1806
1806
  runAction(e, o, n) {
1807
- const a = this.registry.registry[e.slug]?.actions?.get(o), i = Array.isArray(n) ? n.filter((u) => typeof u == "string") : void 0, r = this.getOperationLogStore();
1808
- let c = "success", s;
1807
+ const a = this.registry.registry[e.slug]?.actions?.get(o), s = Array.isArray(n) ? n.filter((c) => typeof c == "string") : void 0, r = this.getOperationLogStore();
1808
+ let u = "success", i;
1809
1809
  try {
1810
- a && a.length > 0 && a.forEach((u) => {
1810
+ a && a.length > 0 && a.forEach((c) => {
1811
1811
  try {
1812
- new Function("args", u)(n);
1813
- } catch (f) {
1814
- throw c = "failure", s = f instanceof Error ? f.message : "Unknown error", f;
1812
+ new Function("args", c)(n);
1813
+ } catch (p) {
1814
+ throw u = "failure", i = p instanceof Error ? p.message : "Unknown error", p;
1815
1815
  }
1816
1816
  });
1817
1817
  } catch {
1818
1818
  } finally {
1819
- r.logAction(e.doctype, o, i, c, s);
1819
+ r.logAction(e.doctype, o, s, u, i);
1820
1820
  }
1821
1821
  }
1822
1822
  /**
@@ -1864,12 +1864,12 @@ class Ro {
1864
1864
  }
1865
1865
  function Ao(t) {
1866
1866
  t || (t = {});
1867
- const e = t.registry || Se("$registry"), o = Se("$stonecrop"), n = A(), a = A(), i = A({}), r = A(), c = A(), s = A([]);
1867
+ const e = t.registry || Se("$registry"), o = Se("$stonecrop"), n = A(), a = A(), s = A({}), r = A(), u = A(), i = A([]);
1868
1868
  if (t.doctype && e) {
1869
1869
  const E = t.doctype.schema ? Array.isArray(t.doctype.schema) ? t.doctype.schema : Array.from(t.doctype.schema) : [];
1870
- s.value = e.resolveSchema(E);
1870
+ i.value = e.resolveSchema(E);
1871
1871
  }
1872
- const u = A([]), f = A(-1), h = x(() => n.value?.getOperationLogStore().canUndo ?? !1), b = x(() => n.value?.getOperationLogStore().canRedo ?? !1), O = x(() => n.value?.getOperationLogStore().undoCount ?? 0), $ = x(() => n.value?.getOperationLogStore().redoCount ?? 0), D = x(
1872
+ const c = A([]), p = A(-1), y = x(() => n.value?.getOperationLogStore().canUndo ?? !1), h = x(() => n.value?.getOperationLogStore().canRedo ?? !1), O = x(() => n.value?.getOperationLogStore().undoCount ?? 0), _ = x(() => n.value?.getOperationLogStore().redoCount ?? 0), D = x(
1873
1873
  () => n.value?.getOperationLogStore().undoRedoState ?? {
1874
1874
  canUndo: !1,
1875
1875
  canRedo: !1,
@@ -1877,13 +1877,13 @@ function Ao(t) {
1877
1877
  redoCount: 0,
1878
1878
  currentIndex: -1
1879
1879
  }
1880
- ), V = (E) => n.value?.getOperationLogStore().undo(E) ?? !1, j = (E) => n.value?.getOperationLogStore().redo(E) ?? !1, P = () => {
1880
+ ), V = (E) => n.value?.getOperationLogStore().undo(E) ?? !1, M = (E) => n.value?.getOperationLogStore().redo(E) ?? !1, P = () => {
1881
1881
  n.value?.getOperationLogStore().startBatch();
1882
1882
  }, U = (E) => n.value?.getOperationLogStore().commitBatch(E) ?? null, q = () => {
1883
1883
  n.value?.getOperationLogStore().cancelBatch();
1884
- }, G = () => {
1884
+ }, K = () => {
1885
1885
  n.value?.getOperationLogStore().clear();
1886
- }, z = (E, N) => n.value?.getOperationLogStore().getOperationsFor(E, N) ?? [], _ = () => n.value?.getOperationLogStore().getSnapshot() ?? {
1886
+ }, z = (E, N) => n.value?.getOperationLogStore().getOperationsFor(E, N) ?? [], $ = () => n.value?.getOperationLogStore().getSnapshot() ?? {
1887
1887
  operations: [],
1888
1888
  currentIndex: -1,
1889
1889
  totalOperations: 0,
@@ -1891,23 +1891,23 @@ function Ao(t) {
1891
1891
  irreversibleOperations: 0
1892
1892
  }, te = (E, N) => {
1893
1893
  n.value?.getOperationLogStore().markIrreversible(E, N);
1894
- }, W = (E, N, S, v = "success", p) => n.value?.getOperationLogStore().logAction(E, N, S, v, p) ?? "", g = (E) => {
1894
+ }, W = (E, N, S, f = "success", v) => n.value?.getOperationLogStore().logAction(E, N, S, f, v) ?? "", g = (E) => {
1895
1895
  n.value?.getOperationLogStore().configure(E);
1896
1896
  };
1897
- Pe(async () => {
1897
+ Te(async () => {
1898
1898
  if (e) {
1899
1899
  n.value = o || new Ro(e);
1900
1900
  try {
1901
1901
  const E = n.value.getOperationLogStore(), N = so(E);
1902
- u.value = N.operations.value, f.value = N.currentIndex.value, H(
1902
+ c.value = N.operations.value, p.value = N.currentIndex.value, H(
1903
1903
  () => N.operations.value,
1904
1904
  (S) => {
1905
- u.value = S;
1905
+ c.value = S;
1906
1906
  }
1907
1907
  ), H(
1908
1908
  () => N.currentIndex.value,
1909
1909
  (S) => {
1910
- f.value = S;
1910
+ p.value = S;
1911
1911
  }
1912
1912
  );
1913
1913
  } catch {
@@ -1915,32 +1915,32 @@ function Ao(t) {
1915
1915
  if (!t.doctype && e.router) {
1916
1916
  const E = e.router.currentRoute.value;
1917
1917
  if (!E.path) return;
1918
- const N = E.path.split("/").filter((v) => v.length > 0), S = N[1]?.toLowerCase();
1918
+ const N = E.path.split("/").filter((f) => f.length > 0), S = N[1]?.toLowerCase();
1919
1919
  if (N.length > 0) {
1920
- const v = {
1920
+ const f = {
1921
1921
  path: E.path,
1922
1922
  segments: N
1923
- }, p = await e.getMeta?.(v);
1924
- if (p) {
1925
- if (e.addDoctype(p), n.value.setup(p), r.value = p, c.value = S, a.value = n.value.getStore(), e) {
1926
- const y = p.schema ? Array.isArray(p.schema) ? p.schema : Array.from(p.schema) : [];
1927
- s.value = e.resolveSchema(y);
1923
+ }, v = await e.getMeta?.(f);
1924
+ if (v) {
1925
+ if (e.addDoctype(v), n.value.setup(v), r.value = v, u.value = S, a.value = n.value.getStore(), e) {
1926
+ const b = v.schema ? Array.isArray(v.schema) ? v.schema : Array.from(v.schema) : [];
1927
+ i.value = e.resolveSchema(b);
1928
1928
  }
1929
1929
  if (S && S !== "new") {
1930
- const y = n.value.getRecordById(p, S);
1931
- if (y)
1932
- i.value = y.get("") || {};
1930
+ const b = n.value.getRecordById(v, S);
1931
+ if (b)
1932
+ s.value = b.get("") || {};
1933
1933
  else
1934
1934
  try {
1935
- await n.value.getRecord(p, S);
1936
- const l = n.value.getRecordById(p, S);
1937
- l && (i.value = l.get("") || {});
1935
+ await n.value.getRecord(v, S);
1936
+ const l = n.value.getRecordById(v, S);
1937
+ l && (s.value = l.get("") || {});
1938
1938
  } catch {
1939
- i.value = oe(p);
1939
+ s.value = oe(v);
1940
1940
  }
1941
1941
  } else
1942
- i.value = oe(p);
1943
- a.value && pt(p, S || "new", i, a.value), n.value.runAction(p, "load", S ? [S] : void 0);
1942
+ s.value = oe(v);
1943
+ a.value && vt(v, S || "new", s, a.value), n.value.runAction(v, "load", S ? [S] : void 0);
1944
1944
  }
1945
1945
  }
1946
1946
  }
@@ -1950,57 +1950,57 @@ function Ao(t) {
1950
1950
  if (N && N !== "new") {
1951
1951
  const S = n.value.getRecordById(E, N);
1952
1952
  if (S)
1953
- i.value = S.get("") || {};
1953
+ s.value = S.get("") || {};
1954
1954
  else
1955
1955
  try {
1956
1956
  await n.value.getRecord(E, N);
1957
- const v = n.value.getRecordById(E, N);
1958
- v && (i.value = v.get("") || {});
1957
+ const f = n.value.getRecordById(E, N);
1958
+ f && (s.value = f.get("") || {});
1959
1959
  } catch {
1960
- i.value = oe(E);
1960
+ s.value = oe(E);
1961
1961
  }
1962
1962
  } else
1963
- i.value = oe(E);
1964
- a.value && pt(E, N || "new", i, a.value);
1963
+ s.value = oe(E);
1964
+ a.value && vt(E, N || "new", s, a.value);
1965
1965
  }
1966
1966
  }
1967
1967
  });
1968
1968
  const m = (E, N) => {
1969
1969
  const S = t.doctype || r.value;
1970
1970
  if (!S) return "";
1971
- const v = N || t.recordId || c.value || "new";
1972
- return `${S.slug}.${v}.${E}`;
1971
+ const f = N || t.recordId || u.value || "new";
1972
+ return `${S.slug}.${f}.${E}`;
1973
1973
  }, C = (E) => {
1974
1974
  const N = t.doctype || r.value;
1975
1975
  if (!(!a.value || !n.value || !N))
1976
1976
  try {
1977
1977
  const S = E.path.split(".");
1978
1978
  if (S.length >= 2) {
1979
- const y = S[0], l = S[1];
1980
- if (a.value.has(`${y}.${l}`) || n.value.addRecord(N, l, { ...i.value }), S.length > 3) {
1981
- const d = `${y}.${l}`, w = S.slice(2);
1979
+ const b = S[0], l = S[1];
1980
+ if (a.value.has(`${b}.${l}`) || n.value.addRecord(N, l, { ...s.value }), S.length > 3) {
1981
+ const d = `${b}.${l}`, w = S.slice(2);
1982
1982
  let R = d;
1983
- for (let K = 0; K < w.length - 1; K++)
1984
- if (R += `.${w[K]}`, !a.value.has(R)) {
1985
- const ee = w[K + 1], J = !isNaN(Number(ee));
1986
- a.value.set(R, J ? [] : {});
1983
+ for (let J = 0; J < w.length - 1; J++)
1984
+ if (R += `.${w[J]}`, !a.value.has(R)) {
1985
+ const ee = w[J + 1], G = !isNaN(Number(ee));
1986
+ a.value.set(R, G ? [] : {});
1987
1987
  }
1988
1988
  }
1989
1989
  }
1990
1990
  a.value.set(E.path, E.value);
1991
- const v = E.fieldname.split("."), p = { ...i.value };
1992
- v.length === 1 ? p[v[0]] = E.value : Io(p, v, E.value), i.value = p;
1991
+ const f = E.fieldname.split("."), v = { ...s.value };
1992
+ f.length === 1 ? v[f[0]] = E.value : Io(v, f, E.value), s.value = v;
1993
1993
  } catch {
1994
1994
  }
1995
1995
  };
1996
- (t.doctype || e?.router) && (qe("hstPathProvider", m), qe("hstChangeHandler", C));
1996
+ (t.doctype || e?.router) && (Ge("hstPathProvider", m), Ge("hstChangeHandler", C));
1997
1997
  const B = (E, N, S) => {
1998
1998
  if (!n.value)
1999
1999
  return oe(N);
2000
2000
  if (S)
2001
2001
  try {
2002
- const v = a.value?.get(E);
2003
- return v && typeof v == "object" ? v : oe(N);
2002
+ const f = a.value?.get(E);
2003
+ return f && typeof f == "object" ? f : oe(N);
2004
2004
  } catch {
2005
2005
  return oe(N);
2006
2006
  }
@@ -2008,39 +2008,39 @@ function Ao(t) {
2008
2008
  }, k = async (E, N) => {
2009
2009
  if (!a.value || !n.value)
2010
2010
  throw new Error("HST store not initialized");
2011
- const S = `${E.slug}.${N}`, v = { ...a.value.get(S) || {} }, p = E.schema ? Array.isArray(E.schema) ? E.schema : Array.from(E.schema) : [], y = (e ? e.resolveSchema(p) : p).filter(
2011
+ const S = `${E.slug}.${N}`, f = { ...a.value.get(S) || {} }, v = E.schema ? Array.isArray(E.schema) ? E.schema : Array.from(E.schema) : [], b = (e ? e.resolveSchema(v) : v).filter(
2012
2012
  (l) => "fieldtype" in l && l.fieldtype === "Doctype" && "schema" in l && Array.isArray(l.schema)
2013
2013
  );
2014
- for (const l of y) {
2014
+ for (const l of b) {
2015
2015
  const d = l, w = `${S}.${d.fieldname}`, R = Ct(d.schema, w, a.value);
2016
- v[d.fieldname] = R;
2016
+ f[d.fieldname] = R;
2017
2017
  }
2018
- return v;
2018
+ return f;
2019
2019
  }, I = (E, N) => ({
2020
2020
  provideHSTPath: (S) => `${E}.${S}`,
2021
2021
  handleHSTChange: (S) => {
2022
- const v = S.path.startsWith(E) ? S.path : `${E}.${S.fieldname}`;
2022
+ const f = S.path.startsWith(E) ? S.path : `${E}.${S.fieldname}`;
2023
2023
  C({
2024
2024
  ...S,
2025
- path: v
2025
+ path: f
2026
2026
  });
2027
2027
  }
2028
2028
  }), L = {
2029
- operations: u,
2030
- currentIndex: f,
2029
+ operations: c,
2030
+ currentIndex: p,
2031
2031
  undoRedoState: D,
2032
- canUndo: h,
2033
- canRedo: b,
2032
+ canUndo: y,
2033
+ canRedo: h,
2034
2034
  undoCount: O,
2035
- redoCount: $,
2035
+ redoCount: _,
2036
2036
  undo: V,
2037
- redo: j,
2037
+ redo: M,
2038
2038
  startBatch: P,
2039
2039
  commitBatch: U,
2040
2040
  cancelBatch: q,
2041
- clear: G,
2041
+ clear: K,
2042
2042
  getOperationsFor: z,
2043
- getSnapshot: _,
2043
+ getSnapshot: $,
2044
2044
  markIrreversible: te,
2045
2045
  logAction: W,
2046
2046
  configure: g
@@ -2051,8 +2051,8 @@ function Ao(t) {
2051
2051
  provideHSTPath: m,
2052
2052
  handleHSTChange: C,
2053
2053
  hstStore: a,
2054
- formData: i,
2055
- resolvedSchema: s,
2054
+ formData: s,
2055
+ resolvedSchema: i,
2056
2056
  loadNestedData: B,
2057
2057
  saveRecursive: k,
2058
2058
  createNestedContext: I
@@ -2062,8 +2062,8 @@ function Ao(t) {
2062
2062
  provideHSTPath: m,
2063
2063
  handleHSTChange: C,
2064
2064
  hstStore: a,
2065
- formData: i,
2066
- resolvedSchema: s,
2065
+ formData: s,
2066
+ resolvedSchema: i,
2067
2067
  loadNestedData: B,
2068
2068
  saveRecursive: k,
2069
2069
  createNestedContext: I
@@ -2098,15 +2098,15 @@ function oe(t) {
2098
2098
  }
2099
2099
  }), e;
2100
2100
  }
2101
- function pt(t, e, o, n) {
2101
+ function vt(t, e, o, n) {
2102
2102
  H(
2103
2103
  o,
2104
2104
  (a) => {
2105
- const i = `${t.slug}.${e}`;
2105
+ const s = `${t.slug}.${e}`;
2106
2106
  Object.keys(a).forEach((r) => {
2107
- const c = `${i}.${r}`;
2107
+ const u = `${s}.${r}`;
2108
2108
  try {
2109
- n.set(c, a[r]);
2109
+ n.set(u, a[r]);
2110
2110
  } catch {
2111
2111
  }
2112
2112
  });
@@ -2116,26 +2116,26 @@ function pt(t, e, o, n) {
2116
2116
  }
2117
2117
  function Io(t, e, o) {
2118
2118
  let n = t;
2119
- for (let i = 0; i < e.length - 1; i++) {
2120
- const r = e[i];
2121
- (!(r in n) || typeof n[r] != "object") && (n[r] = isNaN(Number(e[i + 1])) ? {} : []), n = n[r];
2119
+ for (let s = 0; s < e.length - 1; s++) {
2120
+ const r = e[s];
2121
+ (!(r in n) || typeof n[r] != "object") && (n[r] = isNaN(Number(e[s + 1])) ? {} : []), n = n[r];
2122
2122
  }
2123
2123
  const a = e[e.length - 1];
2124
2124
  n[a] = o;
2125
2125
  }
2126
2126
  function Ct(t, e, o) {
2127
2127
  const n = { ...o.get(e) || {} }, a = t.filter(
2128
- (i) => "fieldtype" in i && i.fieldtype === "Doctype" && "schema" in i && Array.isArray(i.schema)
2128
+ (s) => "fieldtype" in s && s.fieldtype === "Doctype" && "schema" in s && Array.isArray(s.schema)
2129
2129
  );
2130
- for (const i of a) {
2131
- const r = i, c = `${e}.${r.fieldname}`, s = Ct(r.schema, c, o);
2132
- n[r.fieldname] = s;
2130
+ for (const s of a) {
2131
+ const r = s, u = `${e}.${r.fieldname}`, i = Ct(r.schema, u, o);
2132
+ n[r.fieldname] = i;
2133
2133
  }
2134
2134
  return n;
2135
2135
  }
2136
2136
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
2137
2137
  function xo(t, e) {
2138
- return et() ? (tt(t, e), !0) : !1;
2138
+ return Ye() ? (et(t, e), !0) : !1;
2139
2139
  }
2140
2140
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
2141
2141
  const To = () => {
@@ -2143,61 +2143,61 @@ const To = () => {
2143
2143
  function Po(...t) {
2144
2144
  if (t.length !== 1) return re(...t);
2145
2145
  const e = t[0];
2146
- return typeof e == "function" ? je(ot(() => ({
2146
+ return typeof e == "function" ? Ve(tt(() => ({
2147
2147
  get: e,
2148
2148
  set: To
2149
2149
  }))) : A(e);
2150
2150
  }
2151
- function We(t) {
2151
+ function He(t) {
2152
2152
  return typeof Window < "u" && t instanceof Window ? t.document.documentElement : typeof Document < "u" && t instanceof Document ? t.documentElement : t;
2153
2153
  }
2154
- const Ue = /* @__PURE__ */ new WeakMap();
2154
+ const We = /* @__PURE__ */ new WeakMap();
2155
2155
  function Vo(t, e = !1) {
2156
2156
  const o = _e(e);
2157
2157
  let n = "";
2158
2158
  H(Po(t), (r) => {
2159
- const c = We(Q(r));
2160
- if (c) {
2161
- const s = c;
2162
- if (Ue.get(s) || Ue.set(s, s.style.overflow), s.style.overflow !== "hidden" && (n = s.style.overflow), s.style.overflow === "hidden") return o.value = !0;
2163
- if (o.value) return s.style.overflow = "hidden";
2159
+ const u = He(Q(r));
2160
+ if (u) {
2161
+ const i = u;
2162
+ if (We.get(i) || We.set(i, i.style.overflow), i.style.overflow !== "hidden" && (n = i.style.overflow), i.style.overflow === "hidden") return o.value = !0;
2163
+ if (o.value) return i.style.overflow = "hidden";
2164
2164
  }
2165
2165
  }, { immediate: !0 });
2166
2166
  const a = () => {
2167
- const r = We(Q(t));
2167
+ const r = He(Q(t));
2168
2168
  !r || o.value || (r.style.overflow = "hidden", o.value = !0);
2169
- }, i = () => {
2170
- const r = We(Q(t));
2171
- !r || !o.value || (r.style.overflow = n, Ue.delete(r), o.value = !1);
2169
+ }, s = () => {
2170
+ const r = He(Q(t));
2171
+ !r || !o.value || (r.style.overflow = n, We.delete(r), o.value = !1);
2172
2172
  };
2173
- return xo(i), x({
2173
+ return xo(s), x({
2174
2174
  get() {
2175
2175
  return o.value;
2176
2176
  },
2177
2177
  set(r) {
2178
- r ? a() : i();
2178
+ r ? a() : s();
2179
2179
  }
2180
2180
  });
2181
2181
  }
2182
- function jo() {
2182
+ function Mo() {
2183
2183
  let t = !1;
2184
2184
  const e = _e(!1);
2185
2185
  return (o, n) => {
2186
2186
  if (e.value = n.value, t) return;
2187
2187
  t = !0;
2188
2188
  const a = Vo(o, n.value);
2189
- H(e, (i) => a.value = i);
2189
+ H(e, (s) => a.value = s);
2190
2190
  };
2191
2191
  }
2192
- jo();
2193
- const Mo = (t, e) => {
2192
+ Mo();
2193
+ const jo = (t, e) => {
2194
2194
  const o = t.__vccOpts || t;
2195
2195
  for (const [n, a] of e)
2196
2196
  o[n] = a;
2197
2197
  return o;
2198
2198
  };
2199
2199
  function Fo(t, e) {
2200
- return et() ? (tt(t, e), !0) : !1;
2200
+ return Ye() ? (et(t, e), !0) : !1;
2201
2201
  }
2202
2202
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
2203
2203
  const Lo = () => {
@@ -2205,39 +2205,39 @@ const Lo = () => {
2205
2205
  function Bo(...t) {
2206
2206
  if (t.length !== 1) return re(...t);
2207
2207
  const e = t[0];
2208
- return typeof e == "function" ? je(ot(() => ({
2208
+ return typeof e == "function" ? Ve(tt(() => ({
2209
2209
  get: e,
2210
2210
  set: Lo
2211
2211
  }))) : A(e);
2212
2212
  }
2213
- function ze(t) {
2213
+ function Ue(t) {
2214
2214
  return typeof Window < "u" && t instanceof Window ? t.document.documentElement : typeof Document < "u" && t instanceof Document ? t.documentElement : t;
2215
2215
  }
2216
- const Ke = /* @__PURE__ */ new WeakMap();
2216
+ const ze = /* @__PURE__ */ new WeakMap();
2217
2217
  function Ho(t, e = !1) {
2218
2218
  const o = _e(e);
2219
2219
  let n = "";
2220
2220
  H(Bo(t), (r) => {
2221
- const c = ze(Q(r));
2222
- if (c) {
2223
- const s = c;
2224
- if (Ke.get(s) || Ke.set(s, s.style.overflow), s.style.overflow !== "hidden" && (n = s.style.overflow), s.style.overflow === "hidden") return o.value = !0;
2225
- if (o.value) return s.style.overflow = "hidden";
2221
+ const u = Ue(Q(r));
2222
+ if (u) {
2223
+ const i = u;
2224
+ if (ze.get(i) || ze.set(i, i.style.overflow), i.style.overflow !== "hidden" && (n = i.style.overflow), i.style.overflow === "hidden") return o.value = !0;
2225
+ if (o.value) return i.style.overflow = "hidden";
2226
2226
  }
2227
2227
  }, { immediate: !0 });
2228
2228
  const a = () => {
2229
- const r = ze(Q(t));
2229
+ const r = Ue(Q(t));
2230
2230
  !r || o.value || (r.style.overflow = "hidden", o.value = !0);
2231
- }, i = () => {
2232
- const r = ze(Q(t));
2233
- !r || !o.value || (r.style.overflow = n, Ke.delete(r), o.value = !1);
2231
+ }, s = () => {
2232
+ const r = Ue(Q(t));
2233
+ !r || !o.value || (r.style.overflow = n, ze.delete(r), o.value = !1);
2234
2234
  };
2235
- return Fo(i), x({
2235
+ return Fo(s), x({
2236
2236
  get() {
2237
2237
  return o.value;
2238
2238
  },
2239
2239
  set(r) {
2240
- r ? a() : i();
2240
+ r ? a() : s();
2241
2241
  }
2242
2242
  });
2243
2243
  }
@@ -2248,7 +2248,7 @@ function Wo() {
2248
2248
  if (e.value = n.value, t) return;
2249
2249
  t = !0;
2250
2250
  const a = Ho(o, n.value);
2251
- H(e, (i) => a.value = i);
2251
+ H(e, (s) => a.value = s);
2252
2252
  };
2253
2253
  }
2254
2254
  Wo();
@@ -2256,10 +2256,10 @@ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
2256
2256
  const Uo = { class: "aform" }, zo = {
2257
2257
  key: 0,
2258
2258
  class: "aform-nested-section"
2259
- }, Ko = {
2259
+ }, Jo = {
2260
2260
  key: 0,
2261
2261
  class: "aform-nested-label"
2262
- }, Go = /* @__PURE__ */ Ee({
2262
+ }, Ko = /* @__PURE__ */ Ee({
2263
2263
  __name: "AForm",
2264
2264
  props: /* @__PURE__ */ rt({
2265
2265
  schema: {},
@@ -2271,82 +2271,86 @@ const Uo = { class: "aform" }, zo = {
2271
2271
  emits: /* @__PURE__ */ rt(["update:schema", "update:data"], ["update:data"]),
2272
2272
  setup(t, { emit: e }) {
2273
2273
  const o = e, n = Vt(t, "data"), a = A({});
2274
- $e(() => {
2275
- !t.schema || !n.value || t.schema.forEach((s) => {
2276
- "schema" in s && Array.isArray(s.schema) && s.schema.length > 0 && (!a.value[s.fieldname] && n.value[s.fieldname] ? a.value[s.fieldname] = n.value[s.fieldname] : a.value[s.fieldname] || (a.value[s.fieldname] = {}));
2277
- });
2278
- }), $e(() => {
2279
- Object.keys(a.value).forEach((s) => {
2280
- n.value && a.value[s] !== n.value[s] && (n.value[s] = a.value[s], o("update:data", n.value));
2281
- });
2282
- }), $e(() => {
2283
- n.value && t.schema && t.schema.forEach((s) => {
2284
- s.fieldname && n.value[s.fieldname] !== void 0 && (s.value = n.value[s.fieldname]);
2274
+ H(
2275
+ () => n.value,
2276
+ (c) => {
2277
+ !t.schema || !c || t.schema.forEach((p) => {
2278
+ "schema" in p && Array.isArray(p.schema) && p.schema.length > 0 && (a.value[p.fieldname] = c[p.fieldname] ?? {});
2279
+ });
2280
+ },
2281
+ { immediate: !0 }
2282
+ );
2283
+ const s = (c, p) => {
2284
+ a.value[c] = p, n.value && (n.value[c] = p, o("update:data", n.value));
2285
+ };
2286
+ at(() => {
2287
+ n.value && t.schema && t.schema.forEach((c) => {
2288
+ c.fieldname && n.value[c.fieldname] !== void 0 && (c.value = n.value[c.fieldname]);
2285
2289
  });
2286
2290
  });
2287
- const i = (s) => {
2288
- const u = {};
2289
- for (const [f, h] of Object.entries(s))
2290
- ["component", "fieldtype"].includes(f) || (u[f] = h), f === "rows" && (!h || Array.isArray(h) && h.length === 0) && (u.rows = n.value[s.fieldname] || []);
2291
- return u;
2292
- }, r = A([]);
2293
- $e(() => {
2294
- t.schema && r.value.length !== t.schema.length && (r.value = t.schema.map((s, u) => x({
2291
+ const r = (c) => {
2292
+ const p = {};
2293
+ for (const [y, h] of Object.entries(c))
2294
+ ["component", "fieldtype"].includes(y) || (p[y] = h), y === "rows" && (!h || Array.isArray(h) && h.length === 0) && (p.rows = n.value[c.fieldname] || []);
2295
+ return p;
2296
+ }, u = A([]);
2297
+ at(() => {
2298
+ t.schema && u.value.length !== t.schema.length && (u.value = t.schema.map((c, p) => x({
2295
2299
  get() {
2296
- return s.value;
2300
+ return c.value;
2297
2301
  },
2298
- set: (f) => {
2299
- const h = t.schema[u].fieldname;
2300
- t.schema[u].value = f, h && n.value && (n.value[h] = f, o("update:data", n.value)), o("update:schema", t.schema);
2302
+ set: (y) => {
2303
+ const h = t.schema[p].fieldname;
2304
+ t.schema[p].value = y, h && n.value && (n.value[h] = y, o("update:data", n.value)), o("update:schema", t.schema);
2301
2305
  }
2302
2306
  })));
2303
2307
  });
2304
- const c = x(() => r.value);
2305
- return (s, u) => {
2306
- const f = St("AForm", !0);
2307
- return M(), F("form", Uo, [
2308
- (M(!0), F(fe, null, be(t.schema, (h, b) => (M(), F(fe, { key: b }, [
2309
- "schema" in h && Array.isArray(h.schema) && h.schema.length > 0 ? (M(), F("div", zo, [
2310
- h.label ? (M(), F("h4", Ko, Y(h.label), 1)) : de("", !0),
2311
- ae(f, {
2308
+ const i = x(() => u.value);
2309
+ return (c, p) => {
2310
+ const y = St("AForm", !0);
2311
+ return j(), F("form", Uo, [
2312
+ (j(!0), F(pe, null, be(t.schema, (h, O) => (j(), F(pe, { key: O }, [
2313
+ "schema" in h && Array.isArray(h.schema) && h.schema.length > 0 ? (j(), F("div", zo, [
2314
+ h.label ? (j(), F("h4", Jo, Y(h.label), 1)) : de("", !0),
2315
+ ae(y, {
2312
2316
  data: a.value[h.fieldname],
2313
- "onUpdate:data": (O) => a.value[h.fieldname] = O,
2317
+ "onUpdate:data": (_) => s(h.fieldname, _),
2314
2318
  schema: h.schema,
2315
2319
  "read-only": t.readOnly || h.readOnly
2316
2320
  }, null, 8, ["data", "onUpdate:data", "schema", "read-only"])
2317
- ])) : (M(), Ye(jt(h.component), Mt({
2321
+ ])) : (j(), Xe(Mt(h.component), jt({
2318
2322
  key: 1,
2319
- modelValue: c.value[b].value,
2320
- "onUpdate:modelValue": (O) => c.value[b].value = O,
2323
+ modelValue: i.value[O].value,
2324
+ "onUpdate:modelValue": (_) => i.value[O].value = _,
2321
2325
  schema: h,
2322
2326
  data: n.value[h.fieldname],
2323
2327
  "read-only": t.readOnly
2324
- }, { ref_for: !0 }, i(h)), null, 16, ["modelValue", "onUpdate:modelValue", "schema", "data", "read-only"]))
2328
+ }, { ref_for: !0 }, r(h)), null, 16, ["modelValue", "onUpdate:modelValue", "schema", "data", "read-only"]))
2325
2329
  ], 64))), 128))
2326
2330
  ]);
2327
2331
  };
2328
2332
  }
2329
- }), Jo = /* @__PURE__ */ Mo(Go, [["__scopeId", "data-v-06e17c5b"]]), qo = { class: "tabs" }, Zo = { tabindex: "0" }, Qo = { tabindex: "0" }, Xo = /* @__PURE__ */ Ee({
2333
+ }), Go = /* @__PURE__ */ jo(Ko, [["__scopeId", "data-v-a3cba83d"]]), qo = { class: "tabs" }, Zo = { tabindex: "0" }, Qo = { tabindex: "0" }, Xo = /* @__PURE__ */ Ee({
2330
2334
  __name: "SheetNav",
2331
2335
  props: {
2332
2336
  breadcrumbs: { default: () => [] }
2333
2337
  },
2334
2338
  setup(t) {
2335
- const e = A(!0), o = A(!1), n = A(""), a = ht("searchinput"), i = x(() => e.value ? "unrotated" : "rotated"), r = () => {
2339
+ const e = A(!0), o = A(!1), n = A(""), a = ht("searchinput"), s = x(() => e.value ? "unrotated" : "rotated"), r = () => {
2336
2340
  e.value = !e.value;
2337
- }, c = async () => {
2341
+ }, u = async () => {
2338
2342
  o.value = !o.value, await se(() => {
2339
2343
  a.value?.focus();
2340
2344
  });
2341
- }, s = (h) => {
2342
- h.preventDefault(), h.stopPropagation();
2343
- }, u = async (h) => {
2344
- h.preventDefault(), h.stopPropagation(), await c();
2345
- }, f = () => {
2345
+ }, i = (y) => {
2346
+ y.preventDefault(), y.stopPropagation();
2347
+ }, c = async (y) => {
2348
+ y.preventDefault(), y.stopPropagation(), await u();
2349
+ }, p = () => {
2346
2350
  };
2347
- return (h, b) => {
2351
+ return (y, h) => {
2348
2352
  const O = St("router-link");
2349
- return M(), F("footer", null, [
2353
+ return j(), F("footer", null, [
2350
2354
  T("ul", qo, [
2351
2355
  T("li", {
2352
2356
  class: "hidebreadcrumbs",
@@ -2355,21 +2359,21 @@ const Uo = { class: "aform" }, zo = {
2355
2359
  }, [
2356
2360
  T("a", Zo, [
2357
2361
  T("div", {
2358
- class: Ce(i.value)
2362
+ class: De(s.value)
2359
2363
  }, "×", 2)
2360
2364
  ])
2361
2365
  ], 32),
2362
2366
  T("li", {
2363
2367
  class: "hometab",
2364
- style: Fe({ display: e.value ? "block" : "none" }),
2365
- onClick: f,
2366
- onKeydown: he(f, ["enter"])
2368
+ style: je({ display: e.value ? "block" : "none" }),
2369
+ onClick: p,
2370
+ onKeydown: he(p, ["enter"])
2367
2371
  }, [
2368
2372
  ae(O, {
2369
2373
  to: "/",
2370
2374
  tabindex: "0"
2371
2375
  }, {
2372
- default: we(() => [...b[5] || (b[5] = [
2376
+ default: we(() => [...h[5] || (h[5] = [
2373
2377
  T("svg", {
2374
2378
  class: "icon",
2375
2379
  "aria-label": "Home",
@@ -2386,11 +2390,11 @@ const Uo = { class: "aform" }, zo = {
2386
2390
  })
2387
2391
  ], 36),
2388
2392
  T("li", {
2389
- class: Ce(["searchtab", { "search-active": o.value }]),
2390
- style: Fe({ display: e.value ? "block" : "none" })
2393
+ class: De(["searchtab", { "search-active": o.value }]),
2394
+ style: je({ display: e.value ? "block" : "none" })
2391
2395
  }, [
2392
2396
  T("a", Qo, [
2393
- Re((M(), F("svg", {
2397
+ Ce((j(), F("svg", {
2394
2398
  class: "icon search-icon",
2395
2399
  role: "button",
2396
2400
  "aria-label": "Search",
@@ -2398,9 +2402,9 @@ const Uo = { class: "aform" }, zo = {
2398
2402
  fill: "none",
2399
2403
  stroke: "currentColor",
2400
2404
  "stroke-width": "2",
2401
- onClick: c,
2402
- onKeydown: he(c, ["enter"])
2403
- }, [...b[6] || (b[6] = [
2405
+ onClick: u,
2406
+ onKeydown: he(u, ["enter"])
2407
+ }, [...h[6] || (h[6] = [
2404
2408
  T("circle", {
2405
2409
  cx: "11",
2406
2410
  cy: "11",
@@ -2408,37 +2412,37 @@ const Uo = { class: "aform" }, zo = {
2408
2412
  }, null, -1),
2409
2413
  T("path", { d: "M21 21l-4.35-4.35" }, null, -1)
2410
2414
  ])], 544)), [
2411
- [Ge, !o.value]
2415
+ [Je, !o.value]
2412
2416
  ]),
2413
- Re(T("input", {
2417
+ Ce(T("input", {
2414
2418
  ref: "searchinput",
2415
- "onUpdate:modelValue": b[0] || (b[0] = ($) => n.value = $),
2419
+ "onUpdate:modelValue": h[0] || (h[0] = (_) => n.value = _),
2416
2420
  type: "text",
2417
2421
  placeholder: "Search...",
2418
- onClick: b[1] || (b[1] = gt(() => {
2422
+ onClick: h[1] || (h[1] = gt(() => {
2419
2423
  }, ["stop"])),
2420
- onInput: b[2] || (b[2] = ($) => s($)),
2421
- onBlur: b[3] || (b[3] = ($) => u($)),
2424
+ onInput: h[2] || (h[2] = (_) => i(_)),
2425
+ onBlur: h[3] || (h[3] = (_) => c(_)),
2422
2426
  onKeydown: [
2423
- b[4] || (b[4] = he(($) => u($), ["enter"])),
2424
- he(c, ["escape"])
2427
+ h[4] || (h[4] = he((_) => c(_), ["enter"])),
2428
+ he(u, ["escape"])
2425
2429
  ]
2426
2430
  }, null, 544), [
2427
- [Ge, o.value],
2431
+ [Je, o.value],
2428
2432
  [mt, n.value]
2429
2433
  ])
2430
2434
  ])
2431
2435
  ], 6),
2432
- (M(!0), F(fe, null, be(t.breadcrumbs, ($) => (M(), F("li", {
2433
- key: $.title,
2434
- style: Fe({ display: e.value ? "block" : "none" })
2436
+ (j(!0), F(pe, null, be(t.breadcrumbs, (_) => (j(), F("li", {
2437
+ key: _.title,
2438
+ style: je({ display: e.value ? "block" : "none" })
2435
2439
  }, [
2436
2440
  ae(O, {
2437
2441
  tabindex: "0",
2438
- to: $.to
2442
+ to: _.to
2439
2443
  }, {
2440
2444
  default: we(() => [
2441
- Ae(Y($.title), 1)
2445
+ Re(Y(_.title), 1)
2442
2446
  ]),
2443
2447
  _: 2
2444
2448
  }, 1032, ["to"])
@@ -2459,29 +2463,29 @@ const Uo = { class: "aform" }, zo = {
2459
2463
  availableDoctypes: { default: () => [] }
2460
2464
  },
2461
2465
  setup(t) {
2462
- const { stonecrop: e } = Ao(), o = A(!1), n = A(!1), a = A(!1), i = x({
2466
+ const { stonecrop: e } = Ao(), o = A(!1), n = A(!1), a = A(!1), s = x({
2463
2467
  get() {
2464
- if (!e.value || !s.value || !f.value)
2468
+ if (!e.value || !i.value || !p.value)
2465
2469
  return {};
2466
2470
  try {
2467
- return e.value.getRecordById(s.value, f.value)?.get("") || {};
2471
+ return e.value.getRecordById(i.value, p.value)?.get("") || {};
2468
2472
  } catch {
2469
2473
  return {};
2470
2474
  }
2471
2475
  },
2472
2476
  set(l) {
2473
- if (!(!e.value || !s.value || !f.value))
2477
+ if (!(!e.value || !i.value || !p.value))
2474
2478
  try {
2475
2479
  const d = e.value.getStore();
2476
2480
  for (const [w, R] of Object.entries(l)) {
2477
- const K = `${s.value}.${f.value}.${w}`;
2478
- d.set(K, R);
2481
+ const J = `${i.value}.${p.value}.${w}`;
2482
+ d.set(J, R);
2479
2483
  }
2480
2484
  } catch (d) {
2481
2485
  console.warn("HST update failed:", d);
2482
2486
  }
2483
2487
  }
2484
- }), r = x(() => De(e.value?.registry.router?.currentRoute)), c = x(() => e.value?.registry.router), s = x(() => {
2488
+ }), r = x(() => Oe(e.value?.registry.router?.currentRoute)), u = x(() => e.value?.registry.router), i = x(() => {
2485
2489
  if (!r.value) return "";
2486
2490
  if (r.value.meta?.actualDoctype)
2487
2491
  return r.value.meta.actualDoctype;
@@ -2489,7 +2493,7 @@ const Uo = { class: "aform" }, zo = {
2489
2493
  return r.value.params.doctype;
2490
2494
  const l = r.value.params.pathMatch;
2491
2495
  return l && l.length > 0 ? l[0] : "";
2492
- }), u = x(() => {
2496
+ }), c = x(() => {
2493
2497
  if (!r.value) return "";
2494
2498
  if (r.value.meta?.doctype)
2495
2499
  return r.value.meta.doctype;
@@ -2497,13 +2501,13 @@ const Uo = { class: "aform" }, zo = {
2497
2501
  return r.value.params.doctype;
2498
2502
  const l = r.value.params.pathMatch;
2499
2503
  return l && l.length > 0 ? l[0] : "";
2500
- }), f = x(() => {
2504
+ }), p = x(() => {
2501
2505
  if (!r.value) return "";
2502
2506
  if (r.value.params.recordId)
2503
2507
  return r.value.params.recordId;
2504
2508
  const l = r.value.params.pathMatch;
2505
2509
  return l && l.length > 1 ? l[1] : "";
2506
- }), h = x(() => f.value?.startsWith("new-")), b = x(() => {
2510
+ }), y = x(() => p.value?.startsWith("new-")), h = x(() => {
2507
2511
  if (!r.value || r.value.name === "home" || r.value.path === "/")
2508
2512
  return "doctypes";
2509
2513
  if (r.value.name && r.value.name !== "catch-all") {
@@ -2516,19 +2520,19 @@ const Uo = { class: "aform" }, zo = {
2516
2520
  const l = r.value.params.pathMatch;
2517
2521
  return l && l.length > 0 ? l.length === 1 ? "records" : "record" : "doctypes";
2518
2522
  }), O = () => {
2519
- if (!e.value || !s.value || !f.value)
2523
+ if (!e.value || !i.value || !p.value)
2520
2524
  return [];
2521
2525
  try {
2522
- const d = e.value.registry.registry[s.value];
2526
+ const d = e.value.registry.registry[i.value];
2523
2527
  if (!d?.workflow?.states)
2524
2528
  return [];
2525
- const w = h.value ? "creating" : "editing", R = d.workflow.states[w];
2526
- return R?.on ? Object.keys(R.on).map((J) => {
2527
- const pe = R.on?.[J], X = typeof pe == "string" ? pe : "unknown", At = async () => {
2528
- const nt = e.value?.getRecordById(s.value, f.value);
2529
- if (nt) {
2530
- const It = i.value || {};
2531
- await nt.triggerTransition(J, {
2529
+ const w = y.value ? "creating" : "editing", R = d.workflow.states[w];
2530
+ return R?.on ? Object.keys(R.on).map((G) => {
2531
+ const ve = R.on?.[G], X = typeof ve == "string" ? ve : "unknown", At = async () => {
2532
+ const ot = e.value?.getRecordById(i.value, p.value);
2533
+ if (ot) {
2534
+ const It = s.value || {};
2535
+ await ot.triggerTransition(G, {
2532
2536
  currentState: w,
2533
2537
  targetState: X,
2534
2538
  fsmContext: It
@@ -2536,16 +2540,16 @@ const Uo = { class: "aform" }, zo = {
2536
2540
  }
2537
2541
  };
2538
2542
  return {
2539
- label: `${J} (→ ${X})`,
2543
+ label: `${G} (→ ${X})`,
2540
2544
  action: At
2541
2545
  };
2542
2546
  }) : [];
2543
2547
  } catch (l) {
2544
2548
  return console.warn("Error getting available transitions:", l), [];
2545
2549
  }
2546
- }, $ = x(() => {
2550
+ }, _ = x(() => {
2547
2551
  const l = [];
2548
- switch (b.value) {
2552
+ switch (h.value) {
2549
2553
  case "doctypes":
2550
2554
  l.push({
2551
2555
  type: "button",
@@ -2586,13 +2590,13 @@ const Uo = { class: "aform" }, zo = {
2586
2590
  return l;
2587
2591
  }), D = x(() => {
2588
2592
  const l = [];
2589
- return b.value === "records" && u.value ? l.push(
2593
+ return h.value === "records" && c.value ? l.push(
2590
2594
  { title: "Home", to: "/" },
2591
- { title: P(u.value), to: `/${u.value}` }
2592
- ) : b.value === "record" && u.value && l.push(
2595
+ { title: P(c.value), to: `/${c.value}` }
2596
+ ) : h.value === "record" && c.value && l.push(
2593
2597
  { title: "Home", to: "/" },
2594
- { title: P(u.value), to: `/${u.value}` },
2595
- { title: h.value ? "New Record" : "Edit Record", to: r.value?.fullPath || "" }
2598
+ { title: P(c.value), to: `/${c.value}` },
2599
+ { title: y.value ? "New Record" : "Edit Record", to: r.value?.fullPath || "" }
2596
2600
  ), l;
2597
2601
  }), V = (l) => {
2598
2602
  const d = [
@@ -2600,7 +2604,7 @@ const Uo = { class: "aform" }, zo = {
2600
2604
  title: "Go Home",
2601
2605
  description: "Navigate to the home page",
2602
2606
  action: () => {
2603
- c.value?.push("/");
2607
+ u.value?.push("/");
2604
2608
  }
2605
2609
  },
2606
2610
  {
@@ -2609,15 +2613,15 @@ const Uo = { class: "aform" }, zo = {
2609
2613
  action: () => a.value = !a.value
2610
2614
  }
2611
2615
  ];
2612
- return u.value && (d.push({
2613
- title: `View ${P(u.value)} Records`,
2614
- description: `Navigate to ${u.value} list`,
2616
+ return c.value && (d.push({
2617
+ title: `View ${P(c.value)} Records`,
2618
+ description: `Navigate to ${c.value} list`,
2615
2619
  action: () => {
2616
- c.value?.push(`/${u.value}`);
2620
+ u.value?.push(`/${c.value}`);
2617
2621
  }
2618
2622
  }), d.push({
2619
- title: `Create New ${P(u.value)}`,
2620
- description: `Create a new ${u.value} record`,
2623
+ title: `Create New ${P(c.value)}`,
2624
+ description: `Create a new ${c.value} record`,
2621
2625
  action: () => {
2622
2626
  z();
2623
2627
  }
@@ -2626,22 +2630,22 @@ const Uo = { class: "aform" }, zo = {
2626
2630
  title: `View ${P(w)}`,
2627
2631
  description: `Navigate to ${w} list`,
2628
2632
  action: () => {
2629
- c.value?.push(`/${w}`);
2633
+ u.value?.push(`/${w}`);
2630
2634
  }
2631
2635
  });
2632
2636
  }), l ? d.filter(
2633
2637
  (w) => w.title.toLowerCase().includes(l.toLowerCase()) || w.description.toLowerCase().includes(l.toLowerCase())
2634
2638
  ) : d;
2635
- }, j = (l) => {
2639
+ }, M = (l) => {
2636
2640
  l.action(), a.value = !1;
2637
2641
  }, P = (l) => l.split("-").map((d) => d.charAt(0).toUpperCase() + d.slice(1)).join(" "), U = (l) => e.value ? e.value.getRecordIds(l).length : 0, q = async (l) => {
2638
- await c.value?.push(`/${l}`);
2639
- }, G = async (l) => {
2640
- await c.value?.push(`/${u.value}/${l}`);
2642
+ await u.value?.push(`/${l}`);
2643
+ }, K = async (l) => {
2644
+ await u.value?.push(`/${c.value}/${l}`);
2641
2645
  }, z = async () => {
2642
2646
  const l = `new-${Date.now()}`;
2643
- await c.value?.push(`/${u.value}/${l}`);
2644
- }, _ = (l) => {
2647
+ await u.value?.push(`/${c.value}/${l}`);
2648
+ }, $ = (l) => {
2645
2649
  if (e.value)
2646
2650
  try {
2647
2651
  e.value.records(l);
@@ -2711,7 +2715,7 @@ const Uo = { class: "aform" }, zo = {
2711
2715
  }
2712
2716
  ];
2713
2717
  }, W = () => {
2714
- if (!s.value) return [];
2718
+ if (!i.value) return [];
2715
2719
  if (!e.value) return [];
2716
2720
  const l = m(), d = C();
2717
2721
  if (d.length === 0)
@@ -2724,9 +2728,9 @@ const Uo = { class: "aform" }, zo = {
2724
2728
  <nav class="breadcrumbs">
2725
2729
  <a href="/">Home</a>
2726
2730
  <span class="separator">/</span>
2727
- <span class="current">${P(u.value || s.value)}</span>
2731
+ <span class="current">${P(c.value || i.value)}</span>
2728
2732
  </nav>
2729
- <h1>${P(u.value || s.value)} Records</h1>
2733
+ <h1>${P(c.value || i.value)} Records</h1>
2730
2734
  </div>
2731
2735
  `
2732
2736
  },
@@ -2735,7 +2739,7 @@ const Uo = { class: "aform" }, zo = {
2735
2739
  component: "div",
2736
2740
  value: `
2737
2741
  <div class="loading-state">
2738
- <p>Loading ${P(u.value || s.value)} schema...</p>
2742
+ <p>Loading ${P(c.value || i.value)} schema...</p>
2739
2743
  </div>
2740
2744
  `
2741
2745
  }
@@ -2755,9 +2759,9 @@ const Uo = { class: "aform" }, zo = {
2755
2759
  <nav class="breadcrumbs">
2756
2760
  <a href="/">Home</a>
2757
2761
  <span class="separator">/</span>
2758
- <span class="current">${P(u.value || s.value)}</span>
2762
+ <span class="current">${P(c.value || i.value)}</span>
2759
2763
  </nav>
2760
- <h1>${P(u.value || s.value)} Records</h1>
2764
+ <h1>${P(c.value || i.value)} Records</h1>
2761
2765
  </div>
2762
2766
  `
2763
2767
  },
@@ -2767,7 +2771,7 @@ const Uo = { class: "aform" }, zo = {
2767
2771
  value: `
2768
2772
  <div class="view-actions">
2769
2773
  <button class="btn-primary" data-action="create">
2770
- New ${P(u.value || s.value)}
2774
+ New ${P(c.value || i.value)}
2771
2775
  </button>
2772
2776
  </div>
2773
2777
  `
@@ -2778,7 +2782,7 @@ const Uo = { class: "aform" }, zo = {
2778
2782
  component: "div",
2779
2783
  value: `
2780
2784
  <div class="empty-state">
2781
- <p>No ${u.value || s.value} records found.</p>
2785
+ <p>No ${c.value || i.value} records found.</p>
2782
2786
  <button class="btn-primary" data-action="create">
2783
2787
  Create First Record
2784
2788
  </button>
@@ -2816,10 +2820,10 @@ const Uo = { class: "aform" }, zo = {
2816
2820
  ]
2817
2821
  ];
2818
2822
  }, g = () => {
2819
- if (!s.value) return [];
2823
+ if (!i.value) return [];
2820
2824
  if (!e.value) return [];
2821
2825
  try {
2822
- const d = e.value?.registry?.registry[s.value];
2826
+ const d = e.value?.registry?.registry[i.value];
2823
2827
  if (!d?.schema)
2824
2828
  return [
2825
2829
  {
@@ -2830,13 +2834,13 @@ const Uo = { class: "aform" }, zo = {
2830
2834
  <nav class="breadcrumbs">
2831
2835
  <a href="/">Home</a>
2832
2836
  <span class="separator">/</span>
2833
- <a href="/${u.value || s.value}">${P(
2834
- u.value || s.value
2837
+ <a href="/${c.value || i.value}">${P(
2838
+ c.value || i.value
2835
2839
  )}</a>
2836
2840
  <span class="separator">/</span>
2837
- <span class="current">${h.value ? "New Record" : f.value}</span>
2841
+ <span class="current">${y.value ? "New Record" : p.value}</span>
2838
2842
  </nav>
2839
- <h1>${h.value ? `New ${P(u.value || s.value)}` : `Edit ${P(u.value || s.value)}`}</h1>
2843
+ <h1>${y.value ? `New ${P(c.value || i.value)}` : `Edit ${P(c.value || i.value)}`}</h1>
2840
2844
  </div>
2841
2845
  `
2842
2846
  },
@@ -2845,7 +2849,7 @@ const Uo = { class: "aform" }, zo = {
2845
2849
  component: "div",
2846
2850
  value: `
2847
2851
  <div class="loading-state">
2848
- <p>Loading ${P(u.value || s.value)} form...</p>
2852
+ <p>Loading ${P(c.value || i.value)} form...</p>
2849
2853
  </div>
2850
2854
  `
2851
2855
  }
@@ -2860,14 +2864,14 @@ const Uo = { class: "aform" }, zo = {
2860
2864
  <nav class="breadcrumbs">
2861
2865
  <a href="/">Home</a>
2862
2866
  <span class="separator">/</span>
2863
- <a href="/${u.value || s.value}">${P(
2864
- u.value || s.value
2867
+ <a href="/${c.value || i.value}">${P(
2868
+ c.value || i.value
2865
2869
  )}</a>
2866
2870
  <span class="separator">/</span>
2867
- <span class="current">${h.value ? "New Record" : f.value}</span>
2871
+ <span class="current">${y.value ? "New Record" : p.value}</span>
2868
2872
  </nav>
2869
2873
  <h1>
2870
- ${h.value ? `New ${P(u.value || s.value)}` : `Edit ${P(u.value || s.value)}`}
2874
+ ${y.value ? `New ${P(c.value || i.value)}` : `Edit ${P(c.value || i.value)}`}
2871
2875
  </h1>
2872
2876
  </div>
2873
2877
  `
@@ -2881,14 +2885,14 @@ const Uo = { class: "aform" }, zo = {
2881
2885
  ${n.value ? "Saving..." : "Save"}
2882
2886
  </button>
2883
2887
  <button class="btn-secondary" data-action="cancel">Cancel</button>
2884
- ${h.value ? "" : '<button class="btn-danger" data-action="delete">Delete</button>'}
2888
+ ${y.value ? "" : '<button class="btn-danger" data-action="delete">Delete</button>'}
2885
2889
  </div>
2886
2890
  `
2887
2891
  },
2888
- ...w.map((K) => ({
2889
- ...K,
2892
+ ...w.map((J) => ({
2893
+ ...J,
2890
2894
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
2891
- value: R[K.fieldname] || ""
2895
+ value: R[J.fieldname] || ""
2892
2896
  }))
2893
2897
  ];
2894
2898
  } catch {
@@ -2898,21 +2902,21 @@ const Uo = { class: "aform" }, zo = {
2898
2902
  component: "div",
2899
2903
  value: `
2900
2904
  <div class="error-state">
2901
- <p>Unable to load form schema for ${P(u.value || s.value)}</p>
2905
+ <p>Unable to load form schema for ${P(c.value || i.value)}</p>
2902
2906
  </div>
2903
2907
  `
2904
2908
  }
2905
2909
  ];
2906
2910
  }
2907
2911
  }, m = () => {
2908
- if (!e.value || !s.value)
2912
+ if (!e.value || !i.value)
2909
2913
  return [];
2910
- const d = e.value.records(s.value)?.get("");
2914
+ const d = e.value.records(i.value)?.get("");
2911
2915
  return d && typeof d == "object" && !Array.isArray(d) ? Object.values(d) : [];
2912
2916
  }, C = () => {
2913
- if (!e.value || !s.value) return [];
2917
+ if (!e.value || !i.value) return [];
2914
2918
  try {
2915
- const d = e.value.registry.registry[s.value];
2919
+ const d = e.value.registry.registry[i.value];
2916
2920
  if (d?.schema)
2917
2921
  return ("toArray" in d.schema ? d.schema.toArray() : d.schema).map((R) => ({
2918
2922
  fieldname: R.fieldname,
@@ -2922,8 +2926,8 @@ const Uo = { class: "aform" }, zo = {
2922
2926
  } catch {
2923
2927
  }
2924
2928
  return [];
2925
- }, B = () => !e.value || !s.value || h.value ? {} : e.value.getRecordById(s.value, f.value)?.get("") || {}, k = x(() => {
2926
- switch (b.value) {
2929
+ }, B = () => !e.value || !i.value || y.value ? {} : e.value.getRecordById(i.value, p.value)?.get("") || {}, k = x(() => {
2930
+ switch (h.value) {
2927
2931
  case "doctypes":
2928
2932
  return te();
2929
2933
  case "records":
@@ -2943,12 +2947,12 @@ const Uo = { class: "aform" }, zo = {
2943
2947
  ), H(
2944
2948
  I,
2945
2949
  (l) => {
2946
- if (!(!e.value || !s.value || !f.value || h.value))
2950
+ if (!(!e.value || !i.value || !p.value || y.value))
2947
2951
  try {
2948
2952
  const d = e.value.getStore();
2949
2953
  l.forEach((w) => {
2950
2954
  if (w.fieldname && "value" in w && !["header", "actions", "loading", "error"].includes(w.fieldname)) {
2951
- const R = `${s.value}.${f.value}.${w.fieldname}`;
2955
+ const R = `${i.value}.${p.value}.${w.fieldname}`;
2952
2956
  (d.has(R) ? d.get(R) : void 0) !== w.value && d.set(R, w.value);
2953
2957
  }
2954
2958
  });
@@ -2962,20 +2966,20 @@ const Uo = { class: "aform" }, zo = {
2962
2966
  if (e.value) {
2963
2967
  n.value = !0;
2964
2968
  try {
2965
- const l = i.value || {};
2966
- if (h.value) {
2969
+ const l = s.value || {};
2970
+ if (y.value) {
2967
2971
  const d = `record-${Date.now()}`, w = { id: d, ...l };
2968
- e.value.addRecord(s.value, d, w);
2969
- const R = e.value.getRecordById(s.value, d);
2972
+ e.value.addRecord(i.value, d, w);
2973
+ const R = e.value.getRecordById(i.value, d);
2970
2974
  R && await R.triggerTransition("SAVE", {
2971
2975
  currentState: "creating",
2972
2976
  targetState: "saved",
2973
2977
  fsmContext: w
2974
- }), await c.value?.replace(`/${u.value}/${d}`);
2978
+ }), await u.value?.replace(`/${c.value}/${d}`);
2975
2979
  } else {
2976
- const d = { id: f.value, ...l };
2977
- e.value.addRecord(s.value, f.value, d);
2978
- const w = e.value.getRecordById(s.value, f.value);
2980
+ const d = { id: p.value, ...l };
2981
+ e.value.addRecord(i.value, p.value, d);
2982
+ const w = e.value.getRecordById(i.value, p.value);
2979
2983
  w && await w.triggerTransition("SAVE", {
2980
2984
  currentState: "editing",
2981
2985
  targetState: "saved",
@@ -2988,31 +2992,31 @@ const Uo = { class: "aform" }, zo = {
2988
2992
  }
2989
2993
  }
2990
2994
  }, E = async () => {
2991
- if (h.value)
2992
- await c.value?.push(`/${u.value}`);
2995
+ if (y.value)
2996
+ await u.value?.push(`/${c.value}`);
2993
2997
  else {
2994
2998
  if (e.value) {
2995
- const l = e.value.getRecordById(s.value, f.value);
2999
+ const l = e.value.getRecordById(i.value, p.value);
2996
3000
  l && await l.triggerTransition("CANCEL", {
2997
3001
  currentState: "editing",
2998
3002
  targetState: "cancelled"
2999
3003
  });
3000
3004
  }
3001
- p();
3005
+ v();
3002
3006
  }
3003
3007
  }, N = (l, d) => {
3004
3008
  d && d();
3005
3009
  }, S = async (l) => {
3006
3010
  if (!e.value) return;
3007
- const d = l || f.value;
3011
+ const d = l || p.value;
3008
3012
  if (d && confirm("Are you sure you want to delete this record?")) {
3009
- const w = e.value.getRecordById(s.value, d);
3013
+ const w = e.value.getRecordById(i.value, d);
3010
3014
  w && await w.triggerTransition("DELETE", {
3011
3015
  currentState: "editing",
3012
3016
  targetState: "deleted"
3013
- }), e.value.removeRecord(s.value, d), b.value === "record" && await c.value?.push(`/${u.value}`);
3017
+ }), e.value.removeRecord(i.value, d), h.value === "record" && await u.value?.push(`/${c.value}`);
3014
3018
  }
3015
- }, v = async (l) => {
3019
+ }, f = async (l) => {
3016
3020
  const d = l.target, w = d.getAttribute("data-action");
3017
3021
  if (w)
3018
3022
  switch (w) {
@@ -3031,32 +3035,32 @@ const Uo = { class: "aform" }, zo = {
3031
3035
  }
3032
3036
  const R = d.closest("td, th");
3033
3037
  if (R) {
3034
- const K = R.textContent?.trim(), ee = R.closest("tr");
3035
- if (K === "View Records" && ee) {
3036
- const J = ee.querySelectorAll("td");
3037
- if (J.length > 0) {
3038
- const X = J[1].textContent?.trim();
3038
+ const J = R.textContent?.trim(), ee = R.closest("tr");
3039
+ if (J === "View Records" && ee) {
3040
+ const G = ee.querySelectorAll("td");
3041
+ if (G.length > 0) {
3042
+ const X = G[1].textContent?.trim();
3039
3043
  X && await q(X);
3040
3044
  }
3041
- } else if (K?.includes("Edit") && ee) {
3042
- const J = ee.querySelectorAll("td");
3043
- if (J.length > 0) {
3044
- const X = J[0].textContent?.trim();
3045
- X && await G(X);
3045
+ } else if (J?.includes("Edit") && ee) {
3046
+ const G = ee.querySelectorAll("td");
3047
+ if (G.length > 0) {
3048
+ const X = G[0].textContent?.trim();
3049
+ X && await K(X);
3046
3050
  }
3047
- } else if (K?.includes("Delete") && ee) {
3048
- const J = ee.querySelectorAll("td");
3049
- if (J.length > 0) {
3050
- const X = J[0].textContent?.trim();
3051
+ } else if (J?.includes("Delete") && ee) {
3052
+ const G = ee.querySelectorAll("td");
3053
+ if (G.length > 0) {
3054
+ const X = G[0].textContent?.trim();
3051
3055
  X && await S(X);
3052
3056
  }
3053
3057
  }
3054
3058
  }
3055
3059
  };
3056
3060
  H(
3057
- [b, s, f],
3061
+ [h, i, p],
3058
3062
  () => {
3059
- b.value === "record" && p();
3063
+ h.value === "record" && v();
3060
3064
  },
3061
3065
  { immediate: !0 }
3062
3066
  ), H(
@@ -3065,17 +3069,17 @@ const Uo = { class: "aform" }, zo = {
3065
3069
  },
3066
3070
  { immediate: !0 }
3067
3071
  ), H(
3068
- [b, s, e],
3072
+ [h, i, e],
3069
3073
  ([l, d, w]) => {
3070
- l === "records" && d && w && _(d);
3074
+ l === "records" && d && w && $(d);
3071
3075
  },
3072
3076
  { immediate: !0 }
3073
3077
  );
3074
- const p = () => {
3075
- if (!(!e.value || !s.value)) {
3078
+ const v = () => {
3079
+ if (!(!e.value || !i.value)) {
3076
3080
  o.value = !0;
3077
3081
  try {
3078
- h.value || e.value.getRecordById(s.value, f.value);
3082
+ y.value || e.value.getRecordById(i.value, p.value);
3079
3083
  } catch (l) {
3080
3084
  console.warn("Error loading record data:", l);
3081
3085
  } finally {
@@ -3083,16 +3087,16 @@ const Uo = { class: "aform" }, zo = {
3083
3087
  }
3084
3088
  }
3085
3089
  };
3086
- return qe("desktopMethods", {
3090
+ return Ge("desktopMethods", {
3087
3091
  navigateToDoctype: q,
3088
- openRecord: G,
3092
+ openRecord: K,
3089
3093
  createNewRecord: z,
3090
3094
  handleSave: L,
3091
3095
  handleCancel: E,
3092
3096
  handleDelete: S
3093
- }), Pe(() => {
3097
+ }), Te(() => {
3094
3098
  se(() => {
3095
- b.value === "records" && s.value && e.value && _(s.value);
3099
+ h.value === "records" && i.value && e.value && $(i.value);
3096
3100
  });
3097
3101
  const l = (d) => {
3098
3102
  (d.ctrlKey || d.metaKey) && d.key === "k" && (d.preventDefault(), a.value = !0), d.key === "Escape" && a.value && (a.value = !1);
@@ -3100,22 +3104,22 @@ const Uo = { class: "aform" }, zo = {
3100
3104
  return document.addEventListener("keydown", l), () => {
3101
3105
  document.removeEventListener("keydown", l);
3102
3106
  };
3103
- }), (l, d) => (M(), F("div", {
3107
+ }), (l, d) => (j(), F("div", {
3104
3108
  class: "desktop",
3105
- onClick: v
3109
+ onClick: f
3106
3110
  }, [
3107
3111
  ae(_t, {
3108
- elements: $.value,
3112
+ elements: _.value,
3109
3113
  onActionClick: N
3110
3114
  }, null, 8, ["elements"]),
3111
- I.value.length > 0 ? (M(), Ye(De(Jo), {
3115
+ I.value.length > 0 ? (j(), Xe(Oe(Go), {
3112
3116
  key: 0,
3113
3117
  modelValue: I.value,
3114
3118
  "onUpdate:modelValue": d[0] || (d[0] = (w) => I.value = w),
3115
- data: i.value
3116
- }, null, 8, ["modelValue", "data"])) : De(e) ? (M(), F("div", en, [
3117
- T("p", null, "Loading " + Y(b.value) + " data...", 1)
3118
- ])) : (M(), F("div", Yo, [...d[2] || (d[2] = [
3119
+ data: s.value
3120
+ }, null, 8, ["modelValue", "data"])) : Oe(e) ? (j(), F("div", en, [
3121
+ T("p", null, "Loading " + Y(h.value) + " data...", 1)
3122
+ ])) : (j(), F("div", Yo, [...d[2] || (d[2] = [
3119
3123
  T("p", null, "Initializing Stonecrop...", -1)
3120
3124
  ])])),
3121
3125
  ae(Rt, { breadcrumbs: D.value }, null, 8, ["breadcrumbs"]),
@@ -3123,14 +3127,14 @@ const Uo = { class: "aform" }, zo = {
3123
3127
  "is-open": a.value,
3124
3128
  search: V,
3125
3129
  placeholder: "Type a command or search...",
3126
- onSelect: j,
3130
+ onSelect: M,
3127
3131
  onClose: d[1] || (d[1] = (w) => a.value = !1)
3128
3132
  }, {
3129
3133
  title: we(({ result: w }) => [
3130
- Ae(Y(w.title), 1)
3134
+ Re(Y(w.title), 1)
3131
3135
  ]),
3132
3136
  content: we(({ result: w }) => [
3133
- Ae(Y(w.description), 1)
3137
+ Re(Y(w.description), 1)
3134
3138
  ]),
3135
3139
  _: 1
3136
3140
  }, 8, ["is-open"])