@stonecrop/stonecrop 0.6.3 → 0.7.0

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/stonecrop.js CHANGED
@@ -1,278 +1,278 @@
1
- import { hasInjectionContext as we, inject as te, getCurrentInstance as ke, toRaw as Fe, computed as B, isRef as re, isReactive as ye, toRef as se, ref as L, reactive as Ee, markRaw as ne, effectScope as Ke, nextTick as ue, getCurrentScope as Ze, onScopeDispose as qe, watch as H, toRefs as Pe, onMounted as Me, readonly as Le, customRef as Ge, toValue as J, shallowRef as xe, unref as Ye, provide as Ne } from "vue";
1
+ import { hasInjectionContext as we, inject as te, getCurrentInstance as Fe, toRaw as Le, computed as B, isRef as re, isReactive as ye, toRef as se, ref as M, reactive as Ee, markRaw as oe, effectScope as Je, nextTick as le, getCurrentScope as Ke, onScopeDispose as Ze, watch as H, toRefs as Pe, onMounted as Ve, readonly as Me, customRef as Ge, toValue as q, shallowRef as xe, unref as Ye, provide as _e } from "vue";
2
2
  const Q = typeof window < "u";
3
3
  let K;
4
- const ge = (o) => K = o;
4
+ const ge = (n) => K = n;
5
5
  process.env.NODE_ENV;
6
6
  const Oe = process.env.NODE_ENV !== "production" ? /* @__PURE__ */ Symbol("pinia") : (
7
7
  /* istanbul ignore next */
8
8
  /* @__PURE__ */ Symbol()
9
9
  );
10
- function q(o) {
11
- return o && typeof o == "object" && Object.prototype.toString.call(o) === "[object Object]" && typeof o.toJSON != "function";
10
+ function G(n) {
11
+ return n && typeof n == "object" && Object.prototype.toString.call(n) === "[object Object]" && typeof n.toJSON != "function";
12
12
  }
13
13
  var ie;
14
- (function(o) {
15
- o.direct = "direct", o.patchObject = "patch object", o.patchFunction = "patch function";
14
+ (function(n) {
15
+ n.direct = "direct", n.patchObject = "patch object", n.patchFunction = "patch function";
16
16
  })(ie || (ie = {}));
17
- function Be(o, e) {
17
+ function Be(n, e) {
18
18
  for (const t in e) {
19
19
  const r = e[t];
20
- if (!(t in o))
20
+ if (!(t in n))
21
21
  continue;
22
- const n = o[t];
23
- q(n) && q(r) && !re(r) && !ye(r) ? o[t] = Be(n, r) : o[t] = r;
22
+ const o = n[t];
23
+ G(o) && G(r) && !re(r) && !ye(r) ? n[t] = Be(o, r) : n[t] = r;
24
24
  }
25
- return o;
25
+ return n;
26
26
  }
27
27
  const je = () => {
28
28
  };
29
- function Ie(o, e, t, r = je) {
30
- o.add(e);
31
- const n = () => {
32
- o.delete(e) && r();
29
+ function Ae(n, e, t, r = je) {
30
+ n.add(e);
31
+ const o = () => {
32
+ n.delete(e) && r();
33
33
  };
34
- return !t && Ze() && qe(n), n;
34
+ return !t && Ke() && Ze(o), o;
35
35
  }
36
- function Y(o, ...e) {
37
- o.forEach((t) => {
36
+ function Y(n, ...e) {
37
+ n.forEach((t) => {
38
38
  t(...e);
39
39
  });
40
40
  }
41
- const Qe = (o) => o(), De = /* @__PURE__ */ Symbol(), me = /* @__PURE__ */ Symbol();
42
- function Re(o, e) {
43
- o instanceof Map && e instanceof Map ? e.forEach((t, r) => o.set(r, t)) : o instanceof Set && e instanceof Set && e.forEach(o.add, o);
41
+ const Qe = (n) => n(), $e = /* @__PURE__ */ Symbol(), me = /* @__PURE__ */ Symbol();
42
+ function Re(n, e) {
43
+ n instanceof Map && e instanceof Map ? e.forEach((t, r) => n.set(r, t)) : n instanceof Set && e instanceof Set && e.forEach(n.add, n);
44
44
  for (const t in e) {
45
45
  if (!e.hasOwnProperty(t))
46
46
  continue;
47
- const r = e[t], n = o[t];
48
- q(n) && q(r) && o.hasOwnProperty(t) && !re(r) && !ye(r) ? o[t] = Re(n, r) : o[t] = r;
47
+ const r = e[t], o = n[t];
48
+ G(o) && G(r) && n.hasOwnProperty(t) && !re(r) && !ye(r) ? n[t] = Re(o, r) : n[t] = r;
49
49
  }
50
- return o;
50
+ return n;
51
51
  }
52
52
  const Xe = process.env.NODE_ENV !== "production" ? /* @__PURE__ */ Symbol("pinia:skipHydration") : (
53
53
  /* istanbul ignore next */
54
54
  /* @__PURE__ */ Symbol()
55
55
  );
56
- function et(o) {
57
- return !q(o) || !Object.prototype.hasOwnProperty.call(o, Xe);
56
+ function et(n) {
57
+ return !G(n) || !Object.prototype.hasOwnProperty.call(n, Xe);
58
58
  }
59
- const { assign: U } = Object;
60
- function $e(o) {
61
- return !!(re(o) && o.effect);
59
+ const { assign: W } = Object;
60
+ function Ie(n) {
61
+ return !!(re(n) && n.effect);
62
62
  }
63
- function Te(o, e, t, r) {
64
- const { state: n, actions: s, getters: i } = e, a = t.state.value[o];
63
+ function De(n, e, t, r) {
64
+ const { state: o, actions: s, getters: i } = e, a = t.state.value[n];
65
65
  let c;
66
66
  function h() {
67
- !a && (process.env.NODE_ENV === "production" || !r) && (t.state.value[o] = n ? n() : {});
68
- const b = process.env.NODE_ENV !== "production" && r ? (
67
+ !a && (process.env.NODE_ENV === "production" || !r) && (t.state.value[n] = o ? o() : {});
68
+ const g = process.env.NODE_ENV !== "production" && r ? (
69
69
  // use ref() to unwrap refs inside state TODO: check if this is still necessary
70
- Pe(L(n ? n() : {}).value)
71
- ) : Pe(t.state.value[o]);
72
- return U(b, s, Object.keys(i || {}).reduce((w, P) => (process.env.NODE_ENV !== "production" && P in b && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${P}" in store "${o}".`), w[P] = ne(B(() => {
70
+ Pe(M(o ? o() : {}).value)
71
+ ) : Pe(t.state.value[n]);
72
+ return W(g, s, Object.keys(i || {}).reduce((w, R) => (process.env.NODE_ENV !== "production" && R in g && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${R}" in store "${n}".`), w[R] = oe(B(() => {
73
73
  ge(t);
74
- const D = t._s.get(o);
75
- return i[P].call(D, D);
74
+ const $ = t._s.get(n);
75
+ return i[R].call($, $);
76
76
  })), w), {}));
77
77
  }
78
- return c = _e(o, h, e, t, r, !0), c;
78
+ return c = Ne(n, h, e, t, r, !0), c;
79
79
  }
80
- function _e(o, e, t = {}, r, n, s) {
80
+ function Ne(n, e, t = {}, r, o, s) {
81
81
  let i;
82
- const a = U({ actions: {} }, t);
82
+ const a = W({ actions: {} }, t);
83
83
  if (process.env.NODE_ENV !== "production" && !r._e.active)
84
84
  throw new Error("Pinia destroyed");
85
85
  const c = { deep: !0 };
86
- process.env.NODE_ENV !== "production" && (c.onTrigger = (u) => {
87
- h ? D = u : h == !1 && !g._hotUpdating && (Array.isArray(D) ? D.push(u) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
86
+ process.env.NODE_ENV !== "production" && (c.onTrigger = (l) => {
87
+ h ? $ = l : h == !1 && !v._hotUpdating && (Array.isArray($) ? $.push(l) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
88
88
  });
89
- let h, b, w = /* @__PURE__ */ new Set(), P = /* @__PURE__ */ new Set(), D;
90
- const C = r.state.value[o];
91
- !s && !C && (process.env.NODE_ENV === "production" || !n) && (r.state.value[o] = {});
92
- const F = L({});
93
- let _;
94
- function $(u) {
95
- let l;
96
- h = b = !1, process.env.NODE_ENV !== "production" && (D = []), typeof u == "function" ? (u(r.state.value[o]), l = {
89
+ let h, g, w = /* @__PURE__ */ new Set(), R = /* @__PURE__ */ new Set(), $;
90
+ const T = r.state.value[n];
91
+ !s && !T && (process.env.NODE_ENV === "production" || !o) && (r.state.value[n] = {});
92
+ const L = M({});
93
+ let P;
94
+ function I(l) {
95
+ let u;
96
+ h = g = !1, process.env.NODE_ENV !== "production" && ($ = []), typeof l == "function" ? (l(r.state.value[n]), u = {
97
97
  type: ie.patchFunction,
98
- storeId: o,
99
- events: D
100
- }) : (Re(r.state.value[o], u), l = {
98
+ storeId: n,
99
+ events: $
100
+ }) : (Re(r.state.value[n], l), u = {
101
101
  type: ie.patchObject,
102
- payload: u,
103
- storeId: o,
104
- events: D
102
+ payload: l,
103
+ storeId: n,
104
+ events: $
105
105
  });
106
- const O = _ = /* @__PURE__ */ Symbol();
107
- ue().then(() => {
108
- _ === O && (h = !0);
109
- }), b = !0, Y(w, l, r.state.value[o]);
110
- }
111
- const R = s ? function() {
112
- const { state: l } = t, O = l ? l() : {};
113
- this.$patch((y) => {
114
- U(y, O);
106
+ const O = P = /* @__PURE__ */ Symbol();
107
+ le().then(() => {
108
+ P === O && (h = !0);
109
+ }), g = !0, Y(w, u, r.state.value[n]);
110
+ }
111
+ const N = s ? function() {
112
+ const { state: u } = t, O = u ? u() : {};
113
+ this.$patch((m) => {
114
+ W(m, O);
115
115
  });
116
116
  } : (
117
117
  /* istanbul ignore next */
118
118
  process.env.NODE_ENV !== "production" ? () => {
119
- throw new Error(`🍍: Store "${o}" is built using the setup syntax and does not implement $reset().`);
119
+ throw new Error(`🍍: Store "${n}" is built using the setup syntax and does not implement $reset().`);
120
120
  } : je
121
121
  );
122
122
  function S() {
123
- i.stop(), w.clear(), P.clear(), r._s.delete(o);
123
+ i.stop(), w.clear(), R.clear(), r._s.delete(n);
124
124
  }
125
- const T = (u, l = "") => {
126
- if (De in u)
127
- return u[me] = l, u;
125
+ const D = (l, u = "") => {
126
+ if ($e in l)
127
+ return l[me] = u, l;
128
128
  const O = function() {
129
129
  ge(r);
130
- const y = Array.from(arguments), f = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set();
131
- function I(V) {
132
- f.add(V);
130
+ const m = Array.from(arguments), f = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Set();
131
+ function A(k) {
132
+ f.add(k);
133
133
  }
134
- function A(V) {
135
- m.add(V);
134
+ function C(k) {
135
+ b.add(k);
136
136
  }
137
- Y(P, {
138
- args: y,
137
+ Y(R, {
138
+ args: m,
139
139
  name: O[me],
140
- store: g,
141
- after: I,
142
- onError: A
140
+ store: v,
141
+ after: A,
142
+ onError: C
143
143
  });
144
144
  let j;
145
145
  try {
146
- j = u.apply(this && this.$id === o ? this : g, y);
147
- } catch (V) {
148
- throw Y(m, V), V;
146
+ j = l.apply(this && this.$id === n ? this : v, m);
147
+ } catch (k) {
148
+ throw Y(b, k), k;
149
149
  }
150
- return j instanceof Promise ? j.then((V) => (Y(f, V), V)).catch((V) => (Y(m, V), Promise.reject(V))) : (Y(f, j), j);
150
+ return j instanceof Promise ? j.then((k) => (Y(f, k), k)).catch((k) => (Y(b, k), Promise.reject(k))) : (Y(f, j), j);
151
151
  };
152
- return O[De] = !0, O[me] = l, O;
153
- }, E = /* @__PURE__ */ ne({
152
+ return O[$e] = !0, O[me] = u, O;
153
+ }, E = /* @__PURE__ */ oe({
154
154
  actions: {},
155
155
  getters: {},
156
156
  state: [],
157
- hotState: F
158
- }), N = {
157
+ hotState: L
158
+ }), _ = {
159
159
  _p: r,
160
160
  // _s: scope,
161
- $id: o,
162
- $onAction: Ie.bind(null, P),
163
- $patch: $,
164
- $reset: R,
165
- $subscribe(u, l = {}) {
166
- const O = Ie(w, u, l.detached, () => y()), y = i.run(() => H(() => r.state.value[o], (f) => {
167
- (l.flush === "sync" ? b : h) && u({
168
- storeId: o,
161
+ $id: n,
162
+ $onAction: Ae.bind(null, R),
163
+ $patch: I,
164
+ $reset: N,
165
+ $subscribe(l, u = {}) {
166
+ const O = Ae(w, l, u.detached, () => m()), m = i.run(() => H(() => r.state.value[n], (f) => {
167
+ (u.flush === "sync" ? g : h) && l({
168
+ storeId: n,
169
169
  type: ie.direct,
170
- events: D
170
+ events: $
171
171
  }, f);
172
- }, U({}, c, l)));
172
+ }, W({}, c, u)));
173
173
  return O;
174
174
  },
175
175
  $dispose: S
176
- }, g = Ee(process.env.NODE_ENV !== "production" || process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && Q ? U(
176
+ }, v = Ee(process.env.NODE_ENV !== "production" || process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && Q ? W(
177
177
  {
178
178
  _hmrPayload: E,
179
- _customProperties: ne(/* @__PURE__ */ new Set())
179
+ _customProperties: oe(/* @__PURE__ */ new Set())
180
180
  // devtools custom properties
181
181
  },
182
- N
182
+ _
183
183
  // must be added later
184
184
  // setupStore
185
- ) : N);
186
- r._s.set(o, g);
187
- const M = (r._a && r._a.runWithContext || Qe)(() => r._e.run(() => (i = Ke()).run(() => e({ action: T }))));
188
- for (const u in M) {
189
- const l = M[u];
190
- if (re(l) && !$e(l) || ye(l))
191
- process.env.NODE_ENV !== "production" && n ? F.value[u] = se(M, u) : s || (C && et(l) && (re(l) ? l.value = C[u] : Re(l, C[u])), r.state.value[o][u] = l), process.env.NODE_ENV !== "production" && E.state.push(u);
192
- else if (typeof l == "function") {
193
- const O = process.env.NODE_ENV !== "production" && n ? l : T(l, u);
194
- M[u] = O, process.env.NODE_ENV !== "production" && (E.actions[u] = l), a.actions[u] = l;
195
- } else process.env.NODE_ENV !== "production" && $e(l) && (E.getters[u] = s ? (
185
+ ) : _);
186
+ r._s.set(n, v);
187
+ const V = (r._a && r._a.runWithContext || Qe)(() => r._e.run(() => (i = Je()).run(() => e({ action: D }))));
188
+ for (const l in V) {
189
+ const u = V[l];
190
+ if (re(u) && !Ie(u) || ye(u))
191
+ process.env.NODE_ENV !== "production" && o ? L.value[l] = se(V, l) : s || (T && et(u) && (re(u) ? u.value = T[l] : Re(u, T[l])), r.state.value[n][l] = u), process.env.NODE_ENV !== "production" && E.state.push(l);
192
+ else if (typeof u == "function") {
193
+ const O = process.env.NODE_ENV !== "production" && o ? u : D(u, l);
194
+ V[l] = O, process.env.NODE_ENV !== "production" && (E.actions[l] = u), a.actions[l] = u;
195
+ } else process.env.NODE_ENV !== "production" && Ie(u) && (E.getters[l] = s ? (
196
196
  // @ts-expect-error
197
- t.getters[u]
198
- ) : l, Q && (M._getters || // @ts-expect-error: same
199
- (M._getters = ne([]))).push(u));
200
- }
201
- if (U(g, M), U(Fe(g), M), Object.defineProperty(g, "$state", {
202
- get: () => process.env.NODE_ENV !== "production" && n ? F.value : r.state.value[o],
203
- set: (u) => {
204
- if (process.env.NODE_ENV !== "production" && n)
197
+ t.getters[l]
198
+ ) : u, Q && (V._getters || // @ts-expect-error: same
199
+ (V._getters = oe([]))).push(l));
200
+ }
201
+ if (W(v, V), W(Le(v), V), Object.defineProperty(v, "$state", {
202
+ get: () => process.env.NODE_ENV !== "production" && o ? L.value : r.state.value[n],
203
+ set: (l) => {
204
+ if (process.env.NODE_ENV !== "production" && o)
205
205
  throw new Error("cannot set hotState");
206
- $((l) => {
207
- U(l, u);
206
+ I((u) => {
207
+ W(u, l);
208
208
  });
209
209
  }
210
- }), process.env.NODE_ENV !== "production" && (g._hotUpdate = ne((u) => {
211
- g._hotUpdating = !0, u._hmrPayload.state.forEach((l) => {
212
- if (l in g.$state) {
213
- const O = u.$state[l], y = g.$state[l];
214
- typeof O == "object" && q(O) && q(y) ? Be(O, y) : u.$state[l] = y;
210
+ }), process.env.NODE_ENV !== "production" && (v._hotUpdate = oe((l) => {
211
+ v._hotUpdating = !0, l._hmrPayload.state.forEach((u) => {
212
+ if (u in v.$state) {
213
+ const O = l.$state[u], m = v.$state[u];
214
+ typeof O == "object" && G(O) && G(m) ? Be(O, m) : l.$state[u] = m;
215
215
  }
216
- g[l] = se(u.$state, l);
217
- }), Object.keys(g.$state).forEach((l) => {
218
- l in u.$state || delete g[l];
219
- }), h = !1, b = !1, r.state.value[o] = se(u._hmrPayload, "hotState"), b = !0, ue().then(() => {
216
+ v[u] = se(l.$state, u);
217
+ }), Object.keys(v.$state).forEach((u) => {
218
+ u in l.$state || delete v[u];
219
+ }), h = !1, g = !1, r.state.value[n] = se(l._hmrPayload, "hotState"), g = !0, le().then(() => {
220
220
  h = !0;
221
221
  });
222
- for (const l in u._hmrPayload.actions) {
223
- const O = u[l];
224
- g[l] = //
225
- T(O, l);
222
+ for (const u in l._hmrPayload.actions) {
223
+ const O = l[u];
224
+ v[u] = //
225
+ D(O, u);
226
226
  }
227
- for (const l in u._hmrPayload.getters) {
228
- const O = u._hmrPayload.getters[l], y = s ? (
227
+ for (const u in l._hmrPayload.getters) {
228
+ const O = l._hmrPayload.getters[u], m = s ? (
229
229
  // special handling of options api
230
- B(() => (ge(r), O.call(g, g)))
230
+ B(() => (ge(r), O.call(v, v)))
231
231
  ) : O;
232
- g[l] = //
233
- y;
232
+ v[u] = //
233
+ m;
234
234
  }
235
- Object.keys(g._hmrPayload.getters).forEach((l) => {
236
- l in u._hmrPayload.getters || delete g[l];
237
- }), Object.keys(g._hmrPayload.actions).forEach((l) => {
238
- l in u._hmrPayload.actions || delete g[l];
239
- }), g._hmrPayload = u._hmrPayload, g._getters = u._getters, g._hotUpdating = !1;
235
+ Object.keys(v._hmrPayload.getters).forEach((u) => {
236
+ u in l._hmrPayload.getters || delete v[u];
237
+ }), Object.keys(v._hmrPayload.actions).forEach((u) => {
238
+ u in l._hmrPayload.actions || delete v[u];
239
+ }), v._hmrPayload = l._hmrPayload, v._getters = l._getters, v._hotUpdating = !1;
240
240
  })), process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && Q) {
241
- const u = {
241
+ const l = {
242
242
  writable: !0,
243
243
  configurable: !0,
244
244
  // avoid warning on devtools trying to display this property
245
245
  enumerable: !1
246
246
  };
247
- ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((l) => {
248
- Object.defineProperty(g, l, U({ value: g[l] }, u));
247
+ ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((u) => {
248
+ Object.defineProperty(v, u, W({ value: v[u] }, l));
249
249
  });
250
250
  }
251
- return r._p.forEach((u) => {
251
+ return r._p.forEach((l) => {
252
252
  if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && Q) {
253
- const l = i.run(() => u({
254
- store: g,
253
+ const u = i.run(() => l({
254
+ store: v,
255
255
  app: r._a,
256
256
  pinia: r,
257
257
  options: a
258
258
  }));
259
- Object.keys(l || {}).forEach((O) => g._customProperties.add(O)), U(g, l);
259
+ Object.keys(u || {}).forEach((O) => v._customProperties.add(O)), W(v, u);
260
260
  } else
261
- U(g, i.run(() => u({
262
- store: g,
261
+ W(v, i.run(() => l({
262
+ store: v,
263
263
  app: r._a,
264
264
  pinia: r,
265
265
  options: a
266
266
  })));
267
- }), process.env.NODE_ENV !== "production" && g.$state && typeof g.$state == "object" && typeof g.$state.constructor == "function" && !g.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
267
+ }), process.env.NODE_ENV !== "production" && v.$state && typeof v.$state == "object" && typeof v.$state.constructor == "function" && !v.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
268
268
  state: () => new MyClass()
269
- Found in store "${g.$id}".`), C && s && t.hydrate && t.hydrate(g.$state, C), h = !0, b = !0, g;
269
+ Found in store "${v.$id}".`), T && s && t.hydrate && t.hydrate(v.$state, T), h = !0, g = !0, v;
270
270
  }
271
271
  // @__NO_SIDE_EFFECTS__
272
- function tt(o, e, t) {
272
+ function tt(n, e, t) {
273
273
  let r;
274
- const n = typeof e == "function";
275
- r = n ? t : e;
274
+ const o = typeof e == "function";
275
+ r = o ? t : e;
276
276
  function s(i, a) {
277
277
  const c = we();
278
278
  if (i = // in test mode, ignore the argument provided as we can always retrieve a
@@ -281,96 +281,96 @@ function tt(o, e, t) {
281
281
  throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
282
282
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
283
283
  This will fail in production.`);
284
- i = K, i._s.has(o) || (n ? _e(o, e, r, i) : Te(o, r, i), process.env.NODE_ENV !== "production" && (s._pinia = i));
285
- const h = i._s.get(o);
284
+ i = K, i._s.has(n) || (o ? Ne(n, e, r, i) : De(n, r, i), process.env.NODE_ENV !== "production" && (s._pinia = i));
285
+ const h = i._s.get(n);
286
286
  if (process.env.NODE_ENV !== "production" && a) {
287
- const b = "__hot:" + o, w = n ? _e(b, e, r, i, !0) : Te(b, U({}, r), i, !0);
288
- a._hotUpdate(w), delete i.state.value[b], i._s.delete(b);
287
+ const g = "__hot:" + n, w = o ? Ne(g, e, r, i, !0) : De(g, W({}, r), i, !0);
288
+ a._hotUpdate(w), delete i.state.value[g], i._s.delete(g);
289
289
  }
290
290
  if (process.env.NODE_ENV !== "production" && Q) {
291
- const b = ke();
292
- if (b && b.proxy && // avoid adding stores that are just built for hot module replacement
291
+ const g = Fe();
292
+ if (g && g.proxy && // avoid adding stores that are just built for hot module replacement
293
293
  !a) {
294
- const w = b.proxy, P = "_pStores" in w ? w._pStores : w._pStores = {};
295
- P[o] = h;
294
+ const w = g.proxy, R = "_pStores" in w ? w._pStores : w._pStores = {};
295
+ R[n] = h;
296
296
  }
297
297
  }
298
298
  return h;
299
299
  }
300
- return s.$id = o, s;
300
+ return s.$id = n, s;
301
301
  }
302
- function Ue(o) {
303
- const e = Fe(o), t = {};
302
+ function We(n) {
303
+ const e = Le(n), t = {};
304
304
  for (const r in e) {
305
- const n = e[r];
306
- n.effect ? t[r] = // ...
305
+ const o = e[r];
306
+ o.effect ? t[r] = // ...
307
307
  B({
308
- get: () => o[r],
308
+ get: () => n[r],
309
309
  set(s) {
310
- o[r] = s;
310
+ n[r] = s;
311
311
  }
312
- }) : (re(n) || ye(n)) && (t[r] = // ---
313
- se(o, r));
312
+ }) : (re(o) || ye(o)) && (t[r] = // ---
313
+ se(n, r));
314
314
  }
315
315
  return t;
316
316
  }
317
317
  const rt = typeof window < "u" && typeof document < "u";
318
318
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
319
- const ot = Object.prototype.toString, nt = (o) => ot.call(o) === "[object Object]", We = () => {
319
+ const nt = Object.prototype.toString, ot = (n) => nt.call(n) === "[object Object]", Ue = () => {
320
320
  };
321
- function st(...o) {
322
- if (o.length !== 1) return se(...o);
323
- const e = o[0];
324
- return typeof e == "function" ? Le(Ge(() => ({
321
+ function st(...n) {
322
+ if (n.length !== 1) return se(...n);
323
+ const e = n[0];
324
+ return typeof e == "function" ? Me(Ge(() => ({
325
325
  get: e,
326
- set: We
327
- }))) : L(e);
326
+ set: Ue
327
+ }))) : M(e);
328
328
  }
329
- function it(o, e) {
329
+ function it(n, e) {
330
330
  function t(...r) {
331
- return new Promise((n, s) => {
332
- Promise.resolve(o(() => e.apply(this, r), {
331
+ return new Promise((o, s) => {
332
+ Promise.resolve(n(() => e.apply(this, r), {
333
333
  fn: e,
334
334
  thisArg: this,
335
335
  args: r
336
- })).then(n).catch(s);
336
+ })).then(o).catch(s);
337
337
  });
338
338
  }
339
339
  return t;
340
340
  }
341
- const ze = (o) => o();
342
- function at(o = ze, e = {}) {
341
+ const ze = (n) => n();
342
+ function at(n = ze, e = {}) {
343
343
  const { initialState: t = "active" } = e, r = st(t === "active");
344
- function n() {
344
+ function o() {
345
345
  r.value = !1;
346
346
  }
347
347
  function s() {
348
348
  r.value = !0;
349
349
  }
350
350
  const i = (...a) => {
351
- r.value && o(...a);
351
+ r.value && n(...a);
352
352
  };
353
353
  return {
354
- isActive: Le(r),
355
- pause: n,
354
+ isActive: Me(r),
355
+ pause: o,
356
356
  resume: s,
357
357
  eventFilter: i
358
358
  };
359
359
  }
360
- function Se(o) {
361
- return Array.isArray(o) ? o : [o];
360
+ function be(n) {
361
+ return Array.isArray(n) ? n : [n];
362
362
  }
363
- function ct(o) {
364
- return ke();
363
+ function ct(n) {
364
+ return Fe();
365
365
  }
366
- function ut(o, e, t = {}) {
367
- const { eventFilter: r = ze, ...n } = t;
368
- return H(o, it(r, e), n);
366
+ function lt(n, e, t = {}) {
367
+ const { eventFilter: r = ze, ...o } = t;
368
+ return H(n, it(r, e), o);
369
369
  }
370
- function lt(o, e, t = {}) {
371
- const { eventFilter: r, initialState: n = "active", ...s } = t, { eventFilter: i, pause: a, resume: c, isActive: h } = at(r, { initialState: n });
370
+ function ut(n, e, t = {}) {
371
+ const { eventFilter: r, initialState: o = "active", ...s } = t, { eventFilter: i, pause: a, resume: c, isActive: h } = at(r, { initialState: o });
372
372
  return {
373
- stop: ut(o, e, {
373
+ stop: lt(n, e, {
374
374
  ...s,
375
375
  eventFilter: i
376
376
  }),
@@ -379,48 +379,48 @@ function lt(o, e, t = {}) {
379
379
  isActive: h
380
380
  };
381
381
  }
382
- const ft = lt;
383
- function dt(o, e = !0, t) {
384
- ct() ? Me(o, t) : e ? o() : ue(o);
382
+ const ft = ut;
383
+ function dt(n, e = !0, t) {
384
+ ct() ? Ve(n, t) : e ? n() : le(n);
385
385
  }
386
- function pt(o, e, t) {
387
- return H(o, e, {
386
+ function pt(n, e, t) {
387
+ return H(n, e, {
388
388
  ...t,
389
389
  immediate: !0
390
390
  });
391
391
  }
392
- function oe(o, e, t) {
393
- return H(o, (n, s, i) => {
394
- n && e(n, s, i);
392
+ function ne(n, e, t) {
393
+ return H(n, (o, s, i) => {
394
+ o && e(o, s, i);
395
395
  }, {
396
396
  ...t,
397
397
  once: !1
398
398
  });
399
399
  }
400
400
  const Z = rt ? window : void 0;
401
- function ht(o) {
401
+ function ht(n) {
402
402
  var e;
403
- const t = J(o);
403
+ const t = q(n);
404
404
  return (e = t?.$el) !== null && e !== void 0 ? e : t;
405
405
  }
406
- function X(...o) {
407
- const e = (r, n, s, i) => (r.addEventListener(n, s, i), () => r.removeEventListener(n, s, i)), t = B(() => {
408
- const r = Se(J(o[0])).filter((n) => n != null);
409
- return r.every((n) => typeof n != "string") ? r : void 0;
406
+ function X(...n) {
407
+ const e = (r, o, s, i) => (r.addEventListener(o, s, i), () => r.removeEventListener(o, s, i)), t = B(() => {
408
+ const r = be(q(n[0])).filter((o) => o != null);
409
+ return r.every((o) => typeof o != "string") ? r : void 0;
410
410
  });
411
411
  return pt(() => {
412
- var r, n;
412
+ var r, o;
413
413
  return [
414
- (r = (n = t.value) === null || n === void 0 ? void 0 : n.map((s) => ht(s))) !== null && r !== void 0 ? r : [Z].filter((s) => s != null),
415
- Se(J(t.value ? o[1] : o[0])),
416
- Se(Ye(t.value ? o[2] : o[1])),
417
- J(t.value ? o[3] : o[2])
414
+ (r = (o = t.value) === null || o === void 0 ? void 0 : o.map((s) => ht(s))) !== null && r !== void 0 ? r : [Z].filter((s) => s != null),
415
+ be(q(t.value ? n[1] : n[0])),
416
+ be(Ye(t.value ? n[2] : n[1])),
417
+ q(t.value ? n[3] : n[2])
418
418
  ];
419
- }, ([r, n, s, i], a, c) => {
420
- if (!r?.length || !n?.length || !s?.length) return;
421
- const h = nt(i) ? { ...i } : i, b = r.flatMap((w) => n.flatMap((P) => s.map((D) => e(w, P, D, h))));
419
+ }, ([r, o, s, i], a, c) => {
420
+ if (!r?.length || !o?.length || !s?.length) return;
421
+ const h = ot(i) ? { ...i } : i, g = r.flatMap((w) => o.flatMap((R) => s.map(($) => e(w, R, $, h))));
422
422
  c(() => {
423
- b.forEach((w) => w());
423
+ g.forEach((w) => w());
424
424
  });
425
425
  }, { flush: "post" });
426
426
  }
@@ -428,135 +428,135 @@ const fe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window :
428
428
  function vt() {
429
429
  return de in fe || (fe[de] = fe[de] || {}), fe[de];
430
430
  }
431
- function yt(o, e) {
432
- return gt[o] || e;
431
+ function yt(n, e) {
432
+ return gt[n] || e;
433
433
  }
434
- function mt(o) {
435
- return o == null ? "any" : o instanceof Set ? "set" : o instanceof Map ? "map" : o instanceof Date ? "date" : typeof o == "boolean" ? "boolean" : typeof o == "string" ? "string" : typeof o == "object" ? "object" : Number.isNaN(o) ? "any" : "number";
434
+ function mt(n) {
435
+ return n == null ? "any" : n instanceof Set ? "set" : n instanceof Map ? "map" : n instanceof Date ? "date" : typeof n == "boolean" ? "boolean" : typeof n == "string" ? "string" : typeof n == "object" ? "object" : Number.isNaN(n) ? "any" : "number";
436
436
  }
437
- const St = {
437
+ const bt = {
438
438
  boolean: {
439
- read: (o) => o === "true",
440
- write: (o) => String(o)
439
+ read: (n) => n === "true",
440
+ write: (n) => String(n)
441
441
  },
442
442
  object: {
443
- read: (o) => JSON.parse(o),
444
- write: (o) => JSON.stringify(o)
443
+ read: (n) => JSON.parse(n),
444
+ write: (n) => JSON.stringify(n)
445
445
  },
446
446
  number: {
447
- read: (o) => Number.parseFloat(o),
448
- write: (o) => String(o)
447
+ read: (n) => Number.parseFloat(n),
448
+ write: (n) => String(n)
449
449
  },
450
450
  any: {
451
- read: (o) => o,
452
- write: (o) => String(o)
451
+ read: (n) => n,
452
+ write: (n) => String(n)
453
453
  },
454
454
  string: {
455
- read: (o) => o,
456
- write: (o) => String(o)
455
+ read: (n) => n,
456
+ write: (n) => String(n)
457
457
  },
458
458
  map: {
459
- read: (o) => new Map(JSON.parse(o)),
460
- write: (o) => JSON.stringify(Array.from(o.entries()))
459
+ read: (n) => new Map(JSON.parse(n)),
460
+ write: (n) => JSON.stringify(Array.from(n.entries()))
461
461
  },
462
462
  set: {
463
- read: (o) => new Set(JSON.parse(o)),
464
- write: (o) => JSON.stringify(Array.from(o))
463
+ read: (n) => new Set(JSON.parse(n)),
464
+ write: (n) => JSON.stringify(Array.from(n))
465
465
  },
466
466
  date: {
467
- read: (o) => new Date(o),
468
- write: (o) => o.toISOString()
467
+ read: (n) => new Date(n),
468
+ write: (n) => n.toISOString()
469
469
  }
470
- }, Ce = "vueuse-storage";
471
- function bt(o, e, t, r = {}) {
472
- var n;
473
- const { flush: s = "pre", deep: i = !0, listenToStorageChanges: a = !0, writeDefaults: c = !0, mergeDefaults: h = !1, shallow: b, window: w = Z, eventFilter: P, onError: D = (f) => {
470
+ }, Te = "vueuse-storage";
471
+ function St(n, e, t, r = {}) {
472
+ var o;
473
+ const { flush: s = "pre", deep: i = !0, listenToStorageChanges: a = !0, writeDefaults: c = !0, mergeDefaults: h = !1, shallow: g, window: w = Z, eventFilter: R, onError: $ = (f) => {
474
474
  console.error(f);
475
- }, initOnMounted: C } = r, F = (b ? xe : L)(e), _ = B(() => J(o));
475
+ }, initOnMounted: T } = r, L = (g ? xe : M)(e), P = B(() => q(n));
476
476
  if (!t) try {
477
477
  t = yt("getDefaultStorage", () => Z?.localStorage)();
478
478
  } catch (f) {
479
- D(f);
479
+ $(f);
480
480
  }
481
- if (!t) return F;
482
- const $ = J(e), R = mt($), S = (n = r.serializer) !== null && n !== void 0 ? n : St[R], { pause: T, resume: E } = ft(F, (f) => u(f), {
481
+ if (!t) return L;
482
+ const I = q(e), N = mt(I), S = (o = r.serializer) !== null && o !== void 0 ? o : bt[N], { pause: D, resume: E } = ft(L, (f) => l(f), {
483
483
  flush: s,
484
484
  deep: i,
485
- eventFilter: P
485
+ eventFilter: R
486
486
  });
487
- H(_, () => O(), { flush: s });
488
- let N = !1;
489
- const g = (f) => {
490
- C && !N || O(f);
487
+ H(P, () => O(), { flush: s });
488
+ let _ = !1;
489
+ const v = (f) => {
490
+ T && !_ || O(f);
491
491
  }, x = (f) => {
492
- C && !N || y(f);
492
+ T && !_ || m(f);
493
493
  };
494
- w && a && (t instanceof Storage ? X(w, "storage", g, { passive: !0 }) : X(w, Ce, x)), C ? dt(() => {
495
- N = !0, O();
494
+ w && a && (t instanceof Storage ? X(w, "storage", v, { passive: !0 }) : X(w, Te, x)), T ? dt(() => {
495
+ _ = !0, O();
496
496
  }) : O();
497
- function M(f, m) {
497
+ function V(f, b) {
498
498
  if (w) {
499
- const I = {
500
- key: _.value,
499
+ const A = {
500
+ key: P.value,
501
501
  oldValue: f,
502
- newValue: m,
502
+ newValue: b,
503
503
  storageArea: t
504
504
  };
505
- w.dispatchEvent(t instanceof Storage ? new StorageEvent("storage", I) : new CustomEvent(Ce, { detail: I }));
505
+ w.dispatchEvent(t instanceof Storage ? new StorageEvent("storage", A) : new CustomEvent(Te, { detail: A }));
506
506
  }
507
507
  }
508
- function u(f) {
508
+ function l(f) {
509
509
  try {
510
- const m = t.getItem(_.value);
510
+ const b = t.getItem(P.value);
511
511
  if (f == null)
512
- M(m, null), t.removeItem(_.value);
512
+ V(b, null), t.removeItem(P.value);
513
513
  else {
514
- const I = S.write(f);
515
- m !== I && (t.setItem(_.value, I), M(m, I));
514
+ const A = S.write(f);
515
+ b !== A && (t.setItem(P.value, A), V(b, A));
516
516
  }
517
- } catch (m) {
518
- D(m);
517
+ } catch (b) {
518
+ $(b);
519
519
  }
520
520
  }
521
- function l(f) {
522
- const m = f ? f.newValue : t.getItem(_.value);
523
- if (m == null)
524
- return c && $ != null && t.setItem(_.value, S.write($)), $;
521
+ function u(f) {
522
+ const b = f ? f.newValue : t.getItem(P.value);
523
+ if (b == null)
524
+ return c && I != null && t.setItem(P.value, S.write(I)), I;
525
525
  if (!f && h) {
526
- const I = S.read(m);
527
- return typeof h == "function" ? h(I, $) : R === "object" && !Array.isArray(I) ? {
528
- ...$,
529
- ...I
530
- } : I;
531
- } else return typeof m != "string" ? m : S.read(m);
526
+ const A = S.read(b);
527
+ return typeof h == "function" ? h(A, I) : N === "object" && !Array.isArray(A) ? {
528
+ ...I,
529
+ ...A
530
+ } : A;
531
+ } else return typeof b != "string" ? b : S.read(b);
532
532
  }
533
533
  function O(f) {
534
534
  if (!(f && f.storageArea !== t)) {
535
535
  if (f && f.key == null) {
536
- F.value = $;
536
+ L.value = I;
537
537
  return;
538
538
  }
539
- if (!(f && f.key !== _.value)) {
540
- T();
539
+ if (!(f && f.key !== P.value)) {
540
+ D();
541
541
  try {
542
- const m = S.write(F.value);
543
- (f === void 0 || f?.newValue !== m) && (F.value = l(f));
544
- } catch (m) {
545
- D(m);
542
+ const b = S.write(L.value);
543
+ (f === void 0 || f?.newValue !== b) && (L.value = u(f));
544
+ } catch (b) {
545
+ $(b);
546
546
  } finally {
547
- f ? ue(E) : E();
547
+ f ? le(E) : E();
548
548
  }
549
549
  }
550
550
  }
551
551
  }
552
- function y(f) {
552
+ function m(f) {
553
553
  O(f.detail);
554
554
  }
555
- return F;
555
+ return L;
556
556
  }
557
- function wt(o, e, t = {}) {
557
+ function wt(n, e, t = {}) {
558
558
  const { window: r = Z } = t;
559
- return bt(o, e, r?.localStorage, t);
559
+ return St(n, e, r?.localStorage, t);
560
560
  }
561
561
  const Et = {
562
562
  ctrl: "control",
@@ -568,143 +568,143 @@ const Et = {
568
568
  left: "arrowleft",
569
569
  right: "arrowright"
570
570
  };
571
- function Ot(o = {}) {
572
- const { reactive: e = !1, target: t = Z, aliasMap: r = Et, passive: n = !0, onEventFired: s = We } = o, i = Ee(/* @__PURE__ */ new Set()), a = {
571
+ function Ot(n = {}) {
572
+ const { reactive: e = !1, target: t = Z, aliasMap: r = Et, passive: o = !0, onEventFired: s = Ue } = n, i = Ee(/* @__PURE__ */ new Set()), a = {
573
573
  toJSON() {
574
574
  return {};
575
575
  },
576
576
  current: i
577
- }, c = e ? Ee(a) : a, h = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Map([
577
+ }, c = e ? Ee(a) : a, h = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Map([
578
578
  ["Meta", h],
579
579
  ["Shift", /* @__PURE__ */ new Set()],
580
580
  ["Alt", /* @__PURE__ */ new Set()]
581
581
  ]), w = /* @__PURE__ */ new Set();
582
- function P(R, S) {
583
- R in c && (e ? c[R] = S : c[R].value = S);
582
+ function R(N, S) {
583
+ N in c && (e ? c[N] = S : c[N].value = S);
584
584
  }
585
- function D() {
585
+ function $() {
586
586
  i.clear();
587
- for (const R of w) P(R, !1);
587
+ for (const N of w) R(N, !1);
588
588
  }
589
- function C(R, S, T) {
590
- if (!(!R || typeof S.getModifierState != "function")) {
591
- for (const [E, N] of b) if (S.getModifierState(E)) {
592
- T.forEach((g) => N.add(g));
589
+ function T(N, S, D) {
590
+ if (!(!N || typeof S.getModifierState != "function")) {
591
+ for (const [E, _] of g) if (S.getModifierState(E)) {
592
+ D.forEach((v) => _.add(v));
593
593
  break;
594
594
  }
595
595
  }
596
596
  }
597
- function F(R, S) {
598
- if (R) return;
599
- const T = `${S[0].toUpperCase()}${S.slice(1)}`, E = b.get(T);
597
+ function L(N, S) {
598
+ if (N) return;
599
+ const D = `${S[0].toUpperCase()}${S.slice(1)}`, E = g.get(D);
600
600
  if (!["shift", "alt"].includes(S) || !E) return;
601
- const N = Array.from(E), g = N.indexOf(S);
602
- N.forEach((x, M) => {
603
- M >= g && (i.delete(x), P(x, !1));
601
+ const _ = Array.from(E), v = _.indexOf(S);
602
+ _.forEach((x, V) => {
603
+ V >= v && (i.delete(x), R(x, !1));
604
604
  }), E.clear();
605
605
  }
606
- function _(R, S) {
607
- var T, E;
608
- const N = (T = R.key) === null || T === void 0 ? void 0 : T.toLowerCase(), g = [(E = R.code) === null || E === void 0 ? void 0 : E.toLowerCase(), N].filter(Boolean);
609
- if (N !== "") {
610
- N && (S ? i.add(N) : i.delete(N));
611
- for (const x of g)
612
- w.add(x), P(x, S);
613
- C(S, R, [...i, ...g]), F(S, N), N === "meta" && !S && (h.forEach((x) => {
614
- i.delete(x), P(x, !1);
606
+ function P(N, S) {
607
+ var D, E;
608
+ const _ = (D = N.key) === null || D === void 0 ? void 0 : D.toLowerCase(), v = [(E = N.code) === null || E === void 0 ? void 0 : E.toLowerCase(), _].filter(Boolean);
609
+ if (_ !== "") {
610
+ _ && (S ? i.add(_) : i.delete(_));
611
+ for (const x of v)
612
+ w.add(x), R(x, S);
613
+ T(S, N, [...i, ...v]), L(S, _), _ === "meta" && !S && (h.forEach((x) => {
614
+ i.delete(x), R(x, !1);
615
615
  }), h.clear());
616
616
  }
617
617
  }
618
- X(t, "keydown", (R) => (_(R, !0), s(R)), { passive: n }), X(t, "keyup", (R) => (_(R, !1), s(R)), { passive: n }), X("blur", D, { passive: n }), X("focus", D, { passive: n });
619
- const $ = new Proxy(c, { get(R, S, T) {
620
- if (typeof S != "string") return Reflect.get(R, S, T);
618
+ X(t, "keydown", (N) => (P(N, !0), s(N)), { passive: o }), X(t, "keyup", (N) => (P(N, !1), s(N)), { passive: o }), X("blur", $, { passive: o }), X("focus", $, { passive: o });
619
+ const I = new Proxy(c, { get(N, S, D) {
620
+ if (typeof S != "string") return Reflect.get(N, S, D);
621
621
  if (S = S.toLowerCase(), S in r && (S = r[S]), !(S in c)) if (/[+_-]/.test(S)) {
622
- const N = S.split(/[+_-]/g).map((g) => g.trim());
623
- c[S] = B(() => N.map((g) => J($[g])).every(Boolean));
622
+ const _ = S.split(/[+_-]/g).map((v) => v.trim());
623
+ c[S] = B(() => _.map((v) => q(I[v])).every(Boolean));
624
624
  } else c[S] = xe(!1);
625
- const E = Reflect.get(R, S, T);
626
- return e ? J(E) : E;
625
+ const E = Reflect.get(N, S, D);
626
+ return e ? q(E) : E;
627
627
  } });
628
- return $;
628
+ return I;
629
629
  }
630
- function be() {
630
+ function Se() {
631
631
  return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
632
632
  }
633
- function pe(o) {
633
+ function pe(n) {
634
634
  const e = {
635
- type: o.type,
636
- clientId: o.clientId,
637
- timestamp: o.timestamp.toISOString()
635
+ type: n.type,
636
+ clientId: n.clientId,
637
+ timestamp: n.timestamp.toISOString()
638
638
  };
639
- return o.operation && (e.operation = {
640
- ...o.operation,
641
- timestamp: o.operation.timestamp.toISOString()
642
- }), o.operations && (e.operations = o.operations.map((t) => ({
639
+ return n.operation && (e.operation = {
640
+ ...n.operation,
641
+ timestamp: n.operation.timestamp.toISOString()
642
+ }), n.operations && (e.operations = n.operations.map((t) => ({
643
643
  ...t,
644
644
  timestamp: t.timestamp.toISOString()
645
645
  }))), e;
646
646
  }
647
- function Rt(o) {
647
+ function Rt(n) {
648
648
  const e = {
649
- type: o.type,
650
- clientId: o.clientId,
651
- timestamp: new Date(o.timestamp)
649
+ type: n.type,
650
+ clientId: n.clientId,
651
+ timestamp: new Date(n.timestamp)
652
652
  };
653
- return o.operation && (e.operation = {
654
- ...o.operation,
655
- timestamp: new Date(o.operation.timestamp)
656
- }), o.operations && (e.operations = o.operations.map((t) => ({
653
+ return n.operation && (e.operation = {
654
+ ...n.operation,
655
+ timestamp: new Date(n.operation.timestamp)
656
+ }), n.operations && (e.operations = n.operations.map((t) => ({
657
657
  ...t,
658
658
  timestamp: new Date(t.timestamp)
659
659
  }))), e;
660
660
  }
661
- const le = /* @__PURE__ */ tt("hst-operation-log", () => {
662
- const o = L({
661
+ const ue = /* @__PURE__ */ tt("hst-operation-log", () => {
662
+ const n = M({
663
663
  maxOperations: 100,
664
664
  enableCrossTabSync: !0,
665
665
  autoSyncInterval: 3e4,
666
666
  enablePersistence: !1,
667
667
  persistenceKeyPrefix: "stonecrop-ops"
668
- }), e = L([]), t = L(-1), r = L(be()), n = L(!1), s = L([]), i = L(null), a = B(() => t.value < 0 ? !1 : e.value[t.value]?.reversible ?? !1), c = B(() => t.value < e.value.length - 1), h = B(() => {
668
+ }), e = M([]), t = M(-1), r = M(Se()), o = M(!1), s = M([]), i = M(null), a = B(() => t.value < 0 ? !1 : e.value[t.value]?.reversible ?? !1), c = B(() => t.value < e.value.length - 1), h = B(() => {
669
669
  let d = 0;
670
670
  for (let p = t.value; p >= 0 && e.value[p]?.reversible; p--)
671
671
  d++;
672
672
  return d;
673
- }), b = B(() => e.value.length - 1 - t.value), w = B(() => ({
673
+ }), g = B(() => e.value.length - 1 - t.value), w = B(() => ({
674
674
  canUndo: a.value,
675
675
  canRedo: c.value,
676
676
  undoCount: h.value,
677
- redoCount: b.value,
677
+ redoCount: g.value,
678
678
  currentIndex: t.value
679
679
  }));
680
- function P(d) {
681
- o.value = { ...o.value, ...d }, o.value.enablePersistence && (A(), V()), o.value.enableCrossTabSync && l();
680
+ function R(d) {
681
+ n.value = { ...n.value, ...d }, n.value.enablePersistence && (C(), k()), n.value.enableCrossTabSync && u();
682
682
  }
683
- function D(d, p = "user") {
684
- const v = {
683
+ function $(d, p = "user") {
684
+ const y = {
685
685
  ...d,
686
- id: be(),
686
+ id: Se(),
687
687
  timestamp: /* @__PURE__ */ new Date(),
688
688
  source: p,
689
- userId: o.value.userId
689
+ userId: n.value.userId
690
690
  };
691
- if (o.value.operationFilter && !o.value.operationFilter(v))
692
- return v.id;
693
- if (n.value)
694
- return s.value.push(v), v.id;
695
- if (t.value < e.value.length - 1 && (e.value = e.value.slice(0, t.value + 1)), e.value.push(v), t.value++, o.value.maxOperations && e.value.length > o.value.maxOperations) {
696
- const k = e.value.length - o.value.maxOperations;
697
- e.value = e.value.slice(k), t.value -= k;
691
+ if (n.value.operationFilter && !n.value.operationFilter(y))
692
+ return y.id;
693
+ if (o.value)
694
+ return s.value.push(y), y.id;
695
+ if (t.value < e.value.length - 1 && (e.value = e.value.slice(0, t.value + 1)), e.value.push(y), t.value++, n.value.maxOperations && e.value.length > n.value.maxOperations) {
696
+ const F = e.value.length - n.value.maxOperations;
697
+ e.value = e.value.slice(F), t.value -= F;
698
698
  }
699
- return o.value.enableCrossTabSync && O(v), v.id;
699
+ return n.value.enableCrossTabSync && O(y), y.id;
700
700
  }
701
- function C() {
702
- n.value = !0, s.value = [], i.value = be();
701
+ function T() {
702
+ o.value = !0, s.value = [], i.value = Se();
703
703
  }
704
- function F(d) {
705
- if (!n.value || s.value.length === 0)
706
- return n.value = !1, s.value = [], i.value = null, null;
707
- const p = i.value, v = s.value.every((W) => W.reversible), k = {
704
+ function L(d) {
705
+ if (!o.value || s.value.length === 0)
706
+ return o.value = !1, s.value = [], i.value = null, null;
707
+ const p = i.value, y = s.value.every((U) => U.reversible), F = {
708
708
  id: p,
709
709
  type: "batch",
710
710
  path: "",
@@ -715,150 +715,150 @@ const le = /* @__PURE__ */ tt("hst-operation-log", () => {
715
715
  doctype: s.value[0]?.doctype || "",
716
716
  timestamp: /* @__PURE__ */ new Date(),
717
717
  source: "user",
718
- reversible: v,
719
- irreversibleReason: v ? void 0 : "Contains irreversible operations",
720
- childOperationIds: s.value.map((W) => W.id),
718
+ reversible: y,
719
+ irreversibleReason: y ? void 0 : "Contains irreversible operations",
720
+ childOperationIds: s.value.map((U) => U.id),
721
721
  metadata: { description: d }
722
722
  };
723
- s.value.forEach((W) => {
724
- W.parentOperationId = p;
725
- }), e.value.push(...s.value, k), t.value = e.value.length - 1, o.value.enableCrossTabSync && y(s.value, k);
723
+ s.value.forEach((U) => {
724
+ U.parentOperationId = p;
725
+ }), e.value.push(...s.value, F), t.value = e.value.length - 1, n.value.enableCrossTabSync && m(s.value, F);
726
726
  const z = p;
727
- return n.value = !1, s.value = [], i.value = null, z;
727
+ return o.value = !1, s.value = [], i.value = null, z;
728
728
  }
729
- function _() {
730
- n.value = !1, s.value = [], i.value = null;
729
+ function P() {
730
+ o.value = !1, s.value = [], i.value = null;
731
731
  }
732
- function $(d) {
732
+ function I(d) {
733
733
  if (!a.value) return !1;
734
734
  const p = e.value[t.value];
735
735
  if (!p.reversible)
736
736
  return typeof console < "u" && p.irreversibleReason && console.warn("Cannot undo irreversible operation:", p.irreversibleReason), !1;
737
737
  try {
738
738
  if (p.type === "batch" && p.childOperationIds)
739
- for (let v = p.childOperationIds.length - 1; v >= 0; v--) {
740
- const k = p.childOperationIds[v], z = e.value.find((W) => W.id === k);
739
+ for (let y = p.childOperationIds.length - 1; y >= 0; y--) {
740
+ const F = p.childOperationIds[y], z = e.value.find((U) => U.id === F);
741
741
  z && S(z, d);
742
742
  }
743
743
  else
744
744
  S(p, d);
745
- return t.value--, o.value.enableCrossTabSync && f(p), !0;
746
- } catch (v) {
747
- return typeof console < "u" && console.error("Undo failed:", v), !1;
745
+ return t.value--, n.value.enableCrossTabSync && f(p), !0;
746
+ } catch (y) {
747
+ return typeof console < "u" && console.error("Undo failed:", y), !1;
748
748
  }
749
749
  }
750
- function R(d) {
750
+ function N(d) {
751
751
  if (!c.value) return !1;
752
752
  const p = e.value[t.value + 1];
753
753
  try {
754
754
  if (p.type === "batch" && p.childOperationIds)
755
- for (const v of p.childOperationIds) {
756
- const k = e.value.find((z) => z.id === v);
757
- k && T(k, d);
755
+ for (const y of p.childOperationIds) {
756
+ const F = e.value.find((z) => z.id === y);
757
+ F && D(F, d);
758
758
  }
759
759
  else
760
- T(p, d);
761
- return t.value++, o.value.enableCrossTabSync && m(p), !0;
762
- } catch (v) {
763
- return typeof console < "u" && console.error("Redo failed:", v), !1;
760
+ D(p, d);
761
+ return t.value++, n.value.enableCrossTabSync && b(p), !0;
762
+ } catch (y) {
763
+ return typeof console < "u" && console.error("Redo failed:", y), !1;
764
764
  }
765
765
  }
766
766
  function S(d, p) {
767
767
  (d.type === "set" || d.type === "delete") && p && typeof p.set == "function" && p.set(d.path, d.beforeValue, "undo");
768
768
  }
769
- function T(d, p) {
769
+ function D(d, p) {
770
770
  (d.type === "set" || d.type === "delete") && p && typeof p.set == "function" && p.set(d.path, d.afterValue, "redo");
771
771
  }
772
772
  function E() {
773
- const d = e.value.filter((v) => v.reversible).length, p = e.value.map((v) => v.timestamp);
773
+ const d = e.value.filter((y) => y.reversible).length, p = e.value.map((y) => y.timestamp);
774
774
  return {
775
775
  operations: [...e.value],
776
776
  currentIndex: t.value,
777
777
  totalOperations: e.value.length,
778
778
  reversibleOperations: d,
779
779
  irreversibleOperations: e.value.length - d,
780
- oldestOperation: p.length > 0 ? new Date(Math.min(...p.map((v) => v.getTime()))) : void 0,
781
- newestOperation: p.length > 0 ? new Date(Math.max(...p.map((v) => v.getTime()))) : void 0
780
+ oldestOperation: p.length > 0 ? new Date(Math.min(...p.map((y) => y.getTime()))) : void 0,
781
+ newestOperation: p.length > 0 ? new Date(Math.max(...p.map((y) => y.getTime()))) : void 0
782
782
  };
783
783
  }
784
- function N() {
784
+ function _() {
785
785
  e.value = [], t.value = -1;
786
786
  }
787
- function g(d, p) {
788
- return e.value.filter((v) => v.doctype === d && (p === void 0 || v.recordId === p));
787
+ function v(d, p) {
788
+ return e.value.filter((y) => y.doctype === d && (p === void 0 || y.recordId === p));
789
789
  }
790
790
  function x(d, p) {
791
- const v = e.value.find((k) => k.id === d);
792
- v && (v.reversible = !1, v.irreversibleReason = p);
791
+ const y = e.value.find((F) => F.id === d);
792
+ y && (y.reversible = !1, y.irreversibleReason = p);
793
793
  }
794
- function M(d, p, v, k = "success", z) {
795
- const W = {
794
+ function V(d, p, y, F = "success", z) {
795
+ const U = {
796
796
  type: "action",
797
- path: v && v.length > 0 ? `${d}.${v[0]}` : d,
797
+ path: y && y.length > 0 ? `${d}.${y[0]}` : d,
798
798
  fieldname: "",
799
799
  beforeValue: null,
800
800
  afterValue: null,
801
801
  doctype: d,
802
- recordId: v && v.length > 0 ? v[0] : void 0,
802
+ recordId: y && y.length > 0 ? y[0] : void 0,
803
803
  reversible: !1,
804
804
  // Actions are typically not reversible
805
805
  actionName: p,
806
- actionRecordIds: v,
807
- actionResult: k,
806
+ actionRecordIds: y,
807
+ actionResult: F,
808
808
  actionError: z
809
809
  };
810
- return D(W);
810
+ return $(U);
811
811
  }
812
- let u = null;
813
- function l() {
814
- typeof window > "u" || !window.BroadcastChannel || (u = new BroadcastChannel("stonecrop-operation-log"), u.addEventListener("message", (d) => {
812
+ let l = null;
813
+ function u() {
814
+ typeof window > "u" || !window.BroadcastChannel || (l = new BroadcastChannel("stonecrop-operation-log"), l.addEventListener("message", (d) => {
815
815
  const p = d.data;
816
816
  if (!p || typeof p != "object") return;
817
- const v = Rt(p);
818
- v.clientId !== r.value && (v.type === "operation" && v.operation ? (e.value.push({ ...v.operation, source: "sync" }), t.value = e.value.length - 1) : v.type === "operation" && v.operations && (e.value.push(...v.operations.map((k) => ({ ...k, source: "sync" }))), t.value = e.value.length - 1));
817
+ const y = Rt(p);
818
+ y.clientId !== r.value && (y.type === "operation" && y.operation ? (e.value.push({ ...y.operation, source: "sync" }), t.value = e.value.length - 1) : y.type === "operation" && y.operations && (e.value.push(...y.operations.map((F) => ({ ...F, source: "sync" }))), t.value = e.value.length - 1));
819
819
  }));
820
820
  }
821
821
  function O(d) {
822
- if (!u) return;
822
+ if (!l) return;
823
823
  const p = {
824
824
  type: "operation",
825
825
  operation: d,
826
826
  clientId: r.value,
827
827
  timestamp: /* @__PURE__ */ new Date()
828
828
  };
829
- u.postMessage(pe(p));
829
+ l.postMessage(pe(p));
830
830
  }
831
- function y(d, p) {
832
- if (!u) return;
833
- const v = {
831
+ function m(d, p) {
832
+ if (!l) return;
833
+ const y = {
834
834
  type: "operation",
835
835
  operations: [...d, p],
836
836
  clientId: r.value,
837
837
  timestamp: /* @__PURE__ */ new Date()
838
838
  };
839
- u.postMessage(pe(v));
839
+ l.postMessage(pe(y));
840
840
  }
841
841
  function f(d) {
842
- if (!u) return;
842
+ if (!l) return;
843
843
  const p = {
844
844
  type: "undo",
845
845
  operation: d,
846
846
  clientId: r.value,
847
847
  timestamp: /* @__PURE__ */ new Date()
848
848
  };
849
- u.postMessage(pe(p));
849
+ l.postMessage(pe(p));
850
850
  }
851
- function m(d) {
852
- if (!u) return;
851
+ function b(d) {
852
+ if (!l) return;
853
853
  const p = {
854
854
  type: "redo",
855
855
  operation: d,
856
856
  clientId: r.value,
857
857
  timestamp: /* @__PURE__ */ new Date()
858
858
  };
859
- u.postMessage(pe(p));
859
+ l.postMessage(pe(p));
860
860
  }
861
- const I = wt("stonecrop-ops-operations", null, {
861
+ const A = wt("stonecrop-ops-operations", null, {
862
862
  serializer: {
863
863
  read: (d) => {
864
864
  try {
@@ -870,10 +870,10 @@ const le = /* @__PURE__ */ tt("hst-operation-log", () => {
870
870
  write: (d) => d ? JSON.stringify(d) : ""
871
871
  }
872
872
  });
873
- function A() {
873
+ function C() {
874
874
  if (!(typeof window > "u"))
875
875
  try {
876
- const d = I.value;
876
+ const d = A.value;
877
877
  d && Array.isArray(d.operations) && (e.value = d.operations.map((p) => ({
878
878
  ...p,
879
879
  timestamp: new Date(p.timestamp)
@@ -885,7 +885,7 @@ const le = /* @__PURE__ */ tt("hst-operation-log", () => {
885
885
  function j() {
886
886
  if (!(typeof window > "u"))
887
887
  try {
888
- I.value = {
888
+ A.value = {
889
889
  operations: e.value.map((d) => ({
890
890
  ...d,
891
891
  timestamp: d.timestamp.toISOString()
@@ -896,11 +896,11 @@ const le = /* @__PURE__ */ tt("hst-operation-log", () => {
896
896
  typeof console < "u" && console.error("Failed to save operations to persistence:", d);
897
897
  }
898
898
  }
899
- function V() {
899
+ function k() {
900
900
  H(
901
901
  [e, t],
902
902
  () => {
903
- o.value.enablePersistence && j();
903
+ n.value.enablePersistence && j();
904
904
  },
905
905
  { deep: !0 }
906
906
  );
@@ -909,27 +909,27 @@ const le = /* @__PURE__ */ tt("hst-operation-log", () => {
909
909
  // State
910
910
  operations: e,
911
911
  currentIndex: t,
912
- config: o,
912
+ config: n,
913
913
  clientId: r,
914
914
  undoRedoState: w,
915
915
  // Computed
916
916
  canUndo: a,
917
917
  canRedo: c,
918
918
  undoCount: h,
919
- redoCount: b,
919
+ redoCount: g,
920
920
  // Methods
921
- configure: P,
922
- addOperation: D,
923
- startBatch: C,
924
- commitBatch: F,
925
- cancelBatch: _,
926
- undo: $,
927
- redo: R,
928
- clear: N,
929
- getOperationsFor: g,
921
+ configure: R,
922
+ addOperation: $,
923
+ startBatch: T,
924
+ commitBatch: L,
925
+ cancelBatch: P,
926
+ undo: I,
927
+ redo: N,
928
+ clear: _,
929
+ getOperationsFor: v,
930
930
  getSnapshot: E,
931
931
  markIrreversible: x,
932
- logAction: M
932
+ logAction: V
933
933
  };
934
934
  });
935
935
  class ae {
@@ -1001,25 +1001,25 @@ class ae {
1001
1001
  */
1002
1002
  registerDoctypeActions(e, t) {
1003
1003
  if (!t) return;
1004
- const r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
1004
+ const r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
1005
1005
  if (typeof t.entrySeq == "function")
1006
1006
  t.entrySeq().forEach(([s, i]) => {
1007
- this.categorizeAction(s, i, r, n);
1007
+ this.categorizeAction(s, i, r, o);
1008
1008
  });
1009
1009
  else if (t instanceof Map)
1010
1010
  for (const [s, i] of t)
1011
- this.categorizeAction(s, i, r, n);
1011
+ this.categorizeAction(s, i, r, o);
1012
1012
  else t && typeof t == "object" && Object.entries(t).forEach(([s, i]) => {
1013
- this.categorizeAction(s, i, r, n);
1013
+ this.categorizeAction(s, i, r, o);
1014
1014
  });
1015
- this.doctypeActions.set(e, r), this.doctypeTransitions.set(e, n);
1015
+ this.doctypeActions.set(e, r), this.doctypeTransitions.set(e, o);
1016
1016
  }
1017
1017
  /**
1018
1018
  * Categorize an action as either a field trigger or XState transition
1019
1019
  * Uses uppercase convention: UPPERCASE = transition, lowercase/mixed = field trigger
1020
1020
  */
1021
- categorizeAction(e, t, r, n) {
1022
- this.isTransitionKey(e) ? n.set(e, t) : r.set(e, t);
1021
+ categorizeAction(e, t, r, o) {
1022
+ this.isTransitionKey(e) ? o.set(e, t) : r.set(e, t);
1023
1023
  }
1024
1024
  /**
1025
1025
  * Determine if a key represents an XState transition
@@ -1034,7 +1034,7 @@ class ae {
1034
1034
  * @param options - Execution options (timeout and enableRollback)
1035
1035
  */
1036
1036
  async executeFieldTriggers(e, t = {}) {
1037
- const { doctype: r, fieldname: n } = e, s = this.findFieldTriggers(r, n);
1037
+ const { doctype: r, fieldname: o } = e, s = this.findFieldTriggers(r, o);
1038
1038
  if (s.length === 0)
1039
1039
  return {
1040
1040
  path: e.path,
@@ -1045,48 +1045,48 @@ class ae {
1045
1045
  rolledBack: !1
1046
1046
  };
1047
1047
  const i = performance.now(), a = [];
1048
- let c = !1, h = !1, b;
1049
- const w = this.getFieldRollback(r, n), P = t.enableRollback ?? w ?? this.options.enableRollback;
1050
- P && e.store && (b = this.captureSnapshot(e));
1051
- for (const _ of s)
1048
+ let c = !1, h = !1, g;
1049
+ const w = this.getFieldRollback(r, o), R = t.enableRollback ?? w ?? this.options.enableRollback;
1050
+ R && e.store && (g = this.captureSnapshot(e));
1051
+ for (const P of s)
1052
1052
  try {
1053
- const $ = await this.executeAction(_, e, t.timeout);
1054
- if (a.push($), !$.success) {
1053
+ const I = await this.executeAction(P, e, t.timeout);
1054
+ if (a.push(I), !I.success) {
1055
1055
  c = !0;
1056
1056
  break;
1057
1057
  }
1058
- } catch ($) {
1058
+ } catch (I) {
1059
1059
  const S = {
1060
1060
  success: !1,
1061
- error: $ instanceof Error ? $ : new Error(String($)),
1061
+ error: I instanceof Error ? I : new Error(String(I)),
1062
1062
  executionTime: 0,
1063
- action: _
1063
+ action: P
1064
1064
  };
1065
1065
  a.push(S), c = !0;
1066
1066
  break;
1067
1067
  }
1068
- if (P && c && b && e.store)
1068
+ if (R && c && g && e.store)
1069
1069
  try {
1070
- this.restoreSnapshot(e, b), h = !0;
1071
- } catch (_) {
1072
- console.error("[FieldTriggers] Rollback failed:", _);
1070
+ this.restoreSnapshot(e, g), h = !0;
1071
+ } catch (P) {
1072
+ console.error("[FieldTriggers] Rollback failed:", P);
1073
1073
  }
1074
- const D = performance.now() - i, C = a.filter((_) => !_.success);
1075
- if (C.length > 0 && this.options.errorHandler)
1076
- for (const _ of C)
1074
+ const $ = performance.now() - i, T = a.filter((P) => !P.success);
1075
+ if (T.length > 0 && this.options.errorHandler)
1076
+ for (const P of T)
1077
1077
  try {
1078
- this.options.errorHandler(_.error, e, _.action);
1079
- } catch ($) {
1080
- console.error("[FieldTriggers] Error in global error handler:", $);
1078
+ this.options.errorHandler(P.error, e, P.action);
1079
+ } catch (I) {
1080
+ console.error("[FieldTriggers] Error in global error handler:", I);
1081
1081
  }
1082
1082
  return {
1083
1083
  path: e.path,
1084
1084
  actionResults: a,
1085
- totalExecutionTime: D,
1086
- allSucceeded: a.every((_) => _.success),
1085
+ totalExecutionTime: $,
1086
+ allSucceeded: a.every((P) => P.success),
1087
1087
  stoppedOnError: c,
1088
1088
  rolledBack: h,
1089
- snapshot: this.options.debug && P ? b : void 0
1089
+ snapshot: this.options.debug && R ? g : void 0
1090
1090
  // Only include snapshot in debug mode if rollback is enabled
1091
1091
  };
1092
1092
  }
@@ -1097,7 +1097,7 @@ class ae {
1097
1097
  * @param options - Execution options (timeout)
1098
1098
  */
1099
1099
  async executeTransitionActions(e, t = {}) {
1100
- const { doctype: r, transition: n } = e, s = this.findTransitionActions(r, n);
1100
+ const { doctype: r, transition: o } = e, s = this.findTransitionActions(r, o);
1101
1101
  if (s.length === 0)
1102
1102
  return [];
1103
1103
  const i = [];
@@ -1112,7 +1112,7 @@ class ae {
1112
1112
  error: h instanceof Error ? h : new Error(String(h)),
1113
1113
  executionTime: 0,
1114
1114
  action: c,
1115
- transition: n
1115
+ transition: o
1116
1116
  };
1117
1117
  i.push(w);
1118
1118
  break;
@@ -1138,7 +1138,7 @@ class ae {
1138
1138
  * Execute a single transition action by name
1139
1139
  */
1140
1140
  async executeTransitionAction(e, t, r) {
1141
- const n = performance.now(), s = r ?? this.options.defaultTimeout;
1141
+ const o = performance.now(), s = r ?? this.options.defaultTimeout;
1142
1142
  try {
1143
1143
  let i = this.globalTransitionActions.get(e);
1144
1144
  if (!i) {
@@ -1149,12 +1149,12 @@ class ae {
1149
1149
  throw new Error(`Transition action "${e}" not found in registry`);
1150
1150
  return await this.executeWithTimeout(i, t, s), {
1151
1151
  success: !0,
1152
- executionTime: performance.now() - n,
1152
+ executionTime: performance.now() - o,
1153
1153
  action: e,
1154
1154
  transition: t.transition
1155
1155
  };
1156
1156
  } catch (i) {
1157
- const a = performance.now() - n;
1157
+ const a = performance.now() - o;
1158
1158
  return {
1159
1159
  success: !1,
1160
1160
  error: i instanceof Error ? i : new Error(String(i)),
@@ -1171,10 +1171,10 @@ class ae {
1171
1171
  findFieldTriggers(e, t) {
1172
1172
  const r = this.doctypeActions.get(e);
1173
1173
  if (!r) return [];
1174
- const n = [];
1174
+ const o = [];
1175
1175
  for (const [s, i] of r)
1176
- this.isFieldTriggerKey(s, t) && n.push(...i);
1177
- return n;
1176
+ this.isFieldTriggerKey(s, t) && o.push(...i);
1177
+ return o;
1178
1178
  }
1179
1179
  /**
1180
1180
  * Determine if an action key represents a field trigger
@@ -1191,11 +1191,11 @@ class ae {
1191
1191
  * Supports wildcards (*) for dynamic segments
1192
1192
  */
1193
1193
  matchFieldPattern(e, t) {
1194
- const r = e.split("."), n = t.split(".");
1195
- if (r.length !== n.length)
1194
+ const r = e.split("."), o = t.split(".");
1195
+ if (r.length !== o.length)
1196
1196
  return !1;
1197
1197
  for (let s = 0; s < r.length; s++) {
1198
- const i = r[s], a = n[s];
1198
+ const i = r[s], a = o[s];
1199
1199
  if (i !== "*" && i !== a)
1200
1200
  return !1;
1201
1201
  }
@@ -1205,18 +1205,18 @@ class ae {
1205
1205
  * Execute a single action by name
1206
1206
  */
1207
1207
  async executeAction(e, t, r) {
1208
- const n = performance.now(), s = r ?? this.options.defaultTimeout;
1208
+ const o = performance.now(), s = r ?? this.options.defaultTimeout;
1209
1209
  try {
1210
1210
  const i = this.globalActions.get(e);
1211
1211
  if (!i)
1212
1212
  throw new Error(`Action "${e}" not found in registry`);
1213
1213
  return await this.executeWithTimeout(i, t, s), {
1214
1214
  success: !0,
1215
- executionTime: performance.now() - n,
1215
+ executionTime: performance.now() - o,
1216
1216
  action: e
1217
1217
  };
1218
1218
  } catch (i) {
1219
- const a = performance.now() - n;
1219
+ const a = performance.now() - o;
1220
1220
  return {
1221
1221
  success: !1,
1222
1222
  error: i instanceof Error ? i : new Error(String(i)),
@@ -1229,12 +1229,12 @@ class ae {
1229
1229
  * Execute a function with timeout
1230
1230
  */
1231
1231
  async executeWithTimeout(e, t, r) {
1232
- return new Promise((n, s) => {
1232
+ return new Promise((o, s) => {
1233
1233
  const i = setTimeout(() => {
1234
1234
  s(new Error(`Action timeout after ${r}ms`));
1235
1235
  }, r);
1236
1236
  Promise.resolve(e(t)).then((a) => {
1237
- clearTimeout(i), n(a);
1237
+ clearTimeout(i), o(a);
1238
1238
  }).catch((a) => {
1239
1239
  clearTimeout(i), s(a);
1240
1240
  });
@@ -1268,26 +1268,26 @@ class ae {
1268
1268
  }
1269
1269
  }
1270
1270
  }
1271
- function G(o) {
1272
- return new ae(o);
1271
+ function J(n) {
1272
+ return new ae(n);
1273
1273
  }
1274
- function Dt(o, e) {
1275
- G().registerAction(o, e);
1274
+ function Tt(n, e) {
1275
+ J().registerAction(n, e);
1276
1276
  }
1277
- function $t(o, e) {
1278
- G().registerTransitionAction(o, e);
1277
+ function Ct(n, e) {
1278
+ J().registerTransitionAction(n, e);
1279
1279
  }
1280
- function Tt(o, e, t) {
1281
- G().setFieldRollback(o, e, t);
1280
+ function kt(n, e, t) {
1281
+ J().setFieldRollback(n, e, t);
1282
1282
  }
1283
- async function Ct(o, e, t) {
1284
- const r = G(), n = {
1285
- path: t?.path || (t?.recordId ? `${o}.${t.recordId}` : o),
1283
+ async function Ft(n, e, t) {
1284
+ const r = J(), o = {
1285
+ path: t?.path || (t?.recordId ? `${n}.${t.recordId}` : n),
1286
1286
  fieldname: "",
1287
1287
  beforeValue: void 0,
1288
1288
  afterValue: void 0,
1289
1289
  operation: "set",
1290
- doctype: o,
1290
+ doctype: n,
1291
1291
  recordId: t?.recordId,
1292
1292
  timestamp: /* @__PURE__ */ new Date(),
1293
1293
  transition: e,
@@ -1295,18 +1295,18 @@ async function Ct(o, e, t) {
1295
1295
  targetState: t?.targetState,
1296
1296
  fsmContext: t?.fsmContext
1297
1297
  };
1298
- return await r.executeTransitionActions(n);
1298
+ return await r.executeTransitionActions(o);
1299
1299
  }
1300
- function At(o, e) {
1301
- if (o)
1300
+ function Lt(n, e) {
1301
+ if (n)
1302
1302
  try {
1303
- le().markIrreversible(o, e);
1303
+ ue().markIrreversible(n, e);
1304
1304
  } catch {
1305
1305
  }
1306
1306
  }
1307
- function Ae() {
1307
+ function Ce() {
1308
1308
  try {
1309
- return le();
1309
+ return ue();
1310
1310
  } catch {
1311
1311
  return null;
1312
1312
  }
@@ -1359,8 +1359,8 @@ class ve {
1359
1359
  doctype;
1360
1360
  parentDoctype;
1361
1361
  hst;
1362
- constructor(e, t, r = "", n = null, s) {
1363
- return this.target = e, this.parentPath = r, this.rootNode = n || this, this.doctype = t, this.parentDoctype = s, this.hst = ee.getInstance(), new Proxy(this, {
1362
+ constructor(e, t, r = "", o = null, s) {
1363
+ return this.target = e, this.parentPath = r, this.rootNode = o || this, this.doctype = t, this.parentDoctype = s, this.hst = ee.getInstance(), new Proxy(this, {
1364
1364
  get(i, a) {
1365
1365
  if (a in i) return i[a];
1366
1366
  const c = String(a);
@@ -1377,21 +1377,21 @@ class ve {
1377
1377
  }
1378
1378
  // Method to get a tree-wrapped node for navigation
1379
1379
  getNode(e) {
1380
- const t = this.resolvePath(e), r = this.resolveValue(e), n = t.split(".");
1380
+ const t = this.resolvePath(e), r = this.resolveValue(e), o = t.split(".");
1381
1381
  let s = this.doctype;
1382
- return this.doctype === "StonecropStore" && n.length >= 1 && (s = n[0]), typeof r == "object" && r !== null && !this.isPrimitive(r) ? new ve(r, s, t, this.rootNode, this.parentDoctype) : new ve(r, s, t, this.rootNode, this.parentDoctype);
1382
+ return this.doctype === "StonecropStore" && o.length >= 1 && (s = o[0]), typeof r == "object" && r !== null && !this.isPrimitive(r) ? new ve(r, s, t, this.rootNode, this.parentDoctype) : new ve(r, s, t, this.rootNode, this.parentDoctype);
1383
1383
  }
1384
1384
  set(e, t, r = "user") {
1385
- const n = this.resolvePath(e), s = this.has(e) ? this.get(e) : void 0;
1385
+ const o = this.resolvePath(e), s = this.has(e) ? this.get(e) : void 0;
1386
1386
  if (r !== "undo" && r !== "redo") {
1387
- const i = Ae();
1387
+ const i = Ce();
1388
1388
  if (i && typeof i.addOperation == "function") {
1389
- const a = n.split("."), c = this.doctype === "StonecropStore" && a.length >= 1 ? a[0] : this.doctype, h = a.length >= 2 ? a[1] : void 0, b = a.slice(2).join(".") || a[a.length - 1], P = t === void 0 && s !== void 0 ? "delete" : "set";
1389
+ const a = o.split("."), c = this.doctype === "StonecropStore" && a.length >= 1 ? a[0] : this.doctype, h = a.length >= 2 ? a[1] : void 0, g = a.slice(2).join(".") || a[a.length - 1], R = t === void 0 && s !== void 0 ? "delete" : "set";
1390
1390
  i.addOperation(
1391
1391
  {
1392
- type: P,
1393
- path: n,
1394
- fieldname: b,
1392
+ type: R,
1393
+ path: o,
1394
+ fieldname: g,
1395
1395
  beforeValue: s,
1396
1396
  afterValue: t,
1397
1397
  doctype: c,
@@ -1403,7 +1403,7 @@ class ve {
1403
1403
  );
1404
1404
  }
1405
1405
  }
1406
- this.updateValue(e, t), this.triggerFieldActions(n, s, t);
1406
+ this.updateValue(e, t), this.triggerFieldActions(o, s, t);
1407
1407
  }
1408
1408
  has(e) {
1409
1409
  try {
@@ -1411,11 +1411,11 @@ class ve {
1411
1411
  return !0;
1412
1412
  const t = this.parsePath(e);
1413
1413
  let r = this.target;
1414
- for (let n = 0; n < t.length; n++) {
1415
- const s = t[n];
1414
+ for (let o = 0; o < t.length; o++) {
1415
+ const s = t[o];
1416
1416
  if (r == null)
1417
1417
  return !1;
1418
- if (n === t.length - 1)
1418
+ if (o === t.length - 1)
1419
1419
  return this.isImmutable(r) ? r.has(s) : this.isPiniaStore(r) && r.$state && s in r.$state || s in r;
1420
1420
  r = this.getProperty(r, s);
1421
1421
  }
@@ -1446,9 +1446,9 @@ class ve {
1446
1446
  * Trigger an XState transition with optional context data
1447
1447
  */
1448
1448
  async triggerTransition(e, t) {
1449
- const r = G(), n = this.parentPath.split(".");
1449
+ const r = J(), o = this.parentPath.split(".");
1450
1450
  let s = this.doctype, i;
1451
- this.doctype === "StonecropStore" && n.length >= 1 && (s = n[0]), n.length >= 2 && (i = n[1]);
1451
+ this.doctype === "StonecropStore" && o.length >= 1 && (s = o[0]), o.length >= 2 && (i = o[1]);
1452
1452
  const a = {
1453
1453
  path: this.parentPath,
1454
1454
  fieldname: "",
@@ -1464,7 +1464,7 @@ class ve {
1464
1464
  currentState: t?.currentState,
1465
1465
  targetState: t?.targetState,
1466
1466
  fsmContext: t?.fsmContext
1467
- }, c = Ae();
1467
+ }, c = Ce();
1468
1468
  return c && typeof c.addOperation == "function" && c.addOperation(
1469
1469
  {
1470
1470
  type: "transition",
@@ -1495,22 +1495,22 @@ class ve {
1495
1495
  return this.target;
1496
1496
  const t = this.parsePath(e);
1497
1497
  let r = this.target;
1498
- for (const n of t) {
1498
+ for (const o of t) {
1499
1499
  if (r == null)
1500
1500
  return;
1501
- r = this.getProperty(r, n);
1501
+ r = this.getProperty(r, o);
1502
1502
  }
1503
1503
  return r;
1504
1504
  }
1505
1505
  updateValue(e, t) {
1506
1506
  if (e === "")
1507
1507
  throw new Error("Cannot set value on empty path");
1508
- const r = this.parsePath(e), n = r.pop();
1508
+ const r = this.parsePath(e), o = r.pop();
1509
1509
  let s = this.target;
1510
1510
  for (const i of r)
1511
1511
  if (s = this.getProperty(s, i), s == null)
1512
1512
  throw new Error(`Cannot set property on null/undefined path: ${e}`);
1513
- this.setProperty(s, n, t);
1513
+ this.setProperty(s, o, t);
1514
1514
  }
1515
1515
  getProperty(e, t) {
1516
1516
  return this.isImmutable(e) ? e.get(t) : this.isVueReactive(e) ? e[t] : this.isPiniaStore(e) ? e.$state?.[t] ?? e[t] : e[t];
@@ -1528,14 +1528,14 @@ class ve {
1528
1528
  try {
1529
1529
  if (!e || typeof e != "string")
1530
1530
  return;
1531
- const n = e.split(".");
1532
- if (n.length < 3)
1531
+ const o = e.split(".");
1532
+ if (o.length < 3)
1533
1533
  return;
1534
- const s = G(), i = n.slice(2).join(".") || n[n.length - 1];
1534
+ const s = J(), i = o.slice(2).join(".") || o[o.length - 1];
1535
1535
  let a = this.doctype;
1536
- this.doctype === "StonecropStore" && n.length >= 1 && (a = n[0]);
1536
+ this.doctype === "StonecropStore" && o.length >= 1 && (a = o[0]);
1537
1537
  let c;
1538
- n.length >= 2 && (c = n[1]);
1538
+ o.length >= 2 && (c = o[1]);
1539
1539
  const h = {
1540
1540
  path: e,
1541
1541
  fieldname: i,
@@ -1549,8 +1549,8 @@ class ve {
1549
1549
  // Pass the root store for snapshot/rollback capabilities
1550
1550
  };
1551
1551
  await s.executeFieldTriggers(h);
1552
- } catch (n) {
1553
- n instanceof Error && console.warn("Field trigger error:", n.message);
1552
+ } catch (o) {
1553
+ o instanceof Error && console.warn("Field trigger error:", o.message);
1554
1554
  }
1555
1555
  }
1556
1556
  isVueReactive(e) {
@@ -1562,7 +1562,7 @@ class ve {
1562
1562
  isImmutable(e) {
1563
1563
  if (!e || typeof e != "object")
1564
1564
  return !1;
1565
- const t = "get" in e && typeof e.get == "function", r = "set" in e && typeof e.set == "function", n = "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 && t && r;
1565
+ const t = "get" in e && typeof e.get == "function", r = "set" in e && typeof e.set == "function", o = "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 && t && r;
1566
1566
  let i;
1567
1567
  try {
1568
1568
  const c = e;
@@ -1574,7 +1574,7 @@ class ve {
1574
1574
  i = void 0;
1575
1575
  }
1576
1576
  const a = i && (i.includes("Map") || i.includes("List") || i.includes("Set") || i.includes("Stack") || i.includes("Seq")) && (t || r);
1577
- return !!(t && r && n && s || t && r && a);
1577
+ return !!(t && r && o && s || t && r && a);
1578
1578
  }
1579
1579
  isPrimitive(e) {
1580
1580
  return e == null || typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "function" || typeof e == "symbol" || typeof e == "bigint";
@@ -1583,8 +1583,8 @@ class ve {
1583
1583
  return e ? e.split(".").filter((t) => t.length > 0) : [];
1584
1584
  }
1585
1585
  }
1586
- function _t(o, e, t) {
1587
- return new ve(o, e, "", null, t);
1586
+ function Nt(n, e, t) {
1587
+ return new ve(n, e, "", null, t);
1588
1588
  }
1589
1589
  class He {
1590
1590
  hstStore;
@@ -1605,7 +1605,7 @@ class He {
1605
1605
  * @internal
1606
1606
  */
1607
1607
  getOperationLogStore() {
1608
- return this._operationLogStore || (this._operationLogStore = le(), this._operationLogConfig && this._operationLogStore.configure(this._operationLogConfig)), this._operationLogStore;
1608
+ return this._operationLogStore || (this._operationLogStore = ue(), this._operationLogConfig && this._operationLogStore.configure(this._operationLogConfig)), this._operationLogStore;
1609
1609
  }
1610
1610
  /**
1611
1611
  * Initialize the HST store structure
@@ -1614,7 +1614,7 @@ class He {
1614
1614
  const e = {};
1615
1615
  Object.keys(this.registry.registry).forEach((t) => {
1616
1616
  e[t] = {};
1617
- }), this.hstStore = _t(e, "StonecropStore");
1617
+ }), this.hstStore = Nt(e, "StonecropStore");
1618
1618
  }
1619
1619
  /**
1620
1620
  * Setup automatic sync with Registry when doctypes are added
@@ -1641,8 +1641,8 @@ class He {
1641
1641
  * @param recordData - The record data
1642
1642
  */
1643
1643
  addRecord(e, t, r) {
1644
- const n = typeof e == "string" ? e : e.slug;
1645
- this.ensureDoctypeExists(n), this.hstStore.set(`${n}.${t}`, r);
1644
+ const o = typeof e == "string" ? e : e.slug;
1645
+ this.ensureDoctypeExists(o), this.hstStore.set(`${o}.${t}`, r);
1646
1646
  }
1647
1647
  /**
1648
1648
  * Get a specific record
@@ -1673,7 +1673,7 @@ class He {
1673
1673
  const t = typeof e == "string" ? e : e.slug;
1674
1674
  this.ensureDoctypeExists(t);
1675
1675
  const r = this.hstStore.get(t);
1676
- return !r || typeof r != "object" ? [] : Object.keys(r).filter((n) => r[n] !== void 0);
1676
+ return !r || typeof r != "object" ? [] : Object.keys(r).filter((o) => r[o] !== void 0);
1677
1677
  }
1678
1678
  /**
1679
1679
  * Clear all records for a doctype
@@ -1681,8 +1681,8 @@ class He {
1681
1681
  */
1682
1682
  clearRecords(e) {
1683
1683
  const t = typeof e == "string" ? e : e.slug;
1684
- this.ensureDoctypeExists(t), this.getRecordIds(t).forEach((n) => {
1685
- this.hstStore.set(`${t}.${n}`, void 0);
1684
+ this.ensureDoctypeExists(t), this.getRecordIds(t).forEach((o) => {
1685
+ this.hstStore.set(`${t}.${o}`, void 0);
1686
1686
  });
1687
1687
  }
1688
1688
  /**
@@ -1700,12 +1700,12 @@ class He {
1700
1700
  * @param args - Action arguments (typically record IDs)
1701
1701
  */
1702
1702
  runAction(e, t, r) {
1703
- const s = this.registry.registry[e.slug]?.actions?.get(t), i = Array.isArray(r) ? r.filter((b) => typeof b == "string") : void 0, a = this.getOperationLogStore();
1703
+ const s = this.registry.registry[e.slug]?.actions?.get(t), i = Array.isArray(r) ? r.filter((g) => typeof g == "string") : void 0, a = this.getOperationLogStore();
1704
1704
  let c = "success", h;
1705
1705
  try {
1706
- s && s.length > 0 && s.forEach((b) => {
1706
+ s && s.length > 0 && s.forEach((g) => {
1707
1707
  try {
1708
- new Function("args", b)(r);
1708
+ new Function("args", g)(r);
1709
1709
  } catch (w) {
1710
1710
  throw c = "failure", h = w instanceof Error ? w.message : "Unknown error", w;
1711
1711
  }
@@ -1720,8 +1720,8 @@ class He {
1720
1720
  * @param doctype - The doctype
1721
1721
  */
1722
1722
  async getRecords(e) {
1723
- (await (await fetch(`/${e.slug}`)).json()).forEach((n) => {
1724
- n.id && this.addRecord(e, n.id, n);
1723
+ (await (await fetch(`/${e.slug}`)).json()).forEach((o) => {
1724
+ o.id && this.addRecord(e, o.id, o);
1725
1725
  });
1726
1726
  }
1727
1727
  /**
@@ -1730,8 +1730,8 @@ class He {
1730
1730
  * @param recordId - The record ID
1731
1731
  */
1732
1732
  async getRecord(e, t) {
1733
- const n = await (await fetch(`/${e.slug}/${t}`)).json();
1734
- this.addRecord(e, t, n);
1733
+ const o = await (await fetch(`/${e.slug}/${t}`)).json();
1734
+ this.addRecord(e, t, o);
1735
1735
  }
1736
1736
  /**
1737
1737
  * Ensure doctype section exists in HST store
@@ -1758,9 +1758,9 @@ class He {
1758
1758
  return this.hstStore;
1759
1759
  }
1760
1760
  }
1761
- function Vt(o) {
1762
- o || (o = {});
1763
- const e = o.registry || te("$registry"), t = te("$stonecrop"), r = L(), n = L(), s = L({}), i = L(), a = L(), c = L([]), h = L(-1), b = B(() => r.value?.getOperationLogStore().canUndo ?? !1), w = B(() => r.value?.getOperationLogStore().canRedo ?? !1), P = B(() => r.value?.getOperationLogStore().undoCount ?? 0), D = B(() => r.value?.getOperationLogStore().redoCount ?? 0), C = B(
1761
+ function Vt(n) {
1762
+ n || (n = {});
1763
+ const e = n.registry || te("$registry"), t = te("$stonecrop"), r = M(), o = M(), s = M({}), i = M(), a = M(), c = M([]), h = M(-1), g = B(() => r.value?.getOperationLogStore().canUndo ?? !1), w = B(() => r.value?.getOperationLogStore().canRedo ?? !1), R = B(() => r.value?.getOperationLogStore().undoCount ?? 0), $ = B(() => r.value?.getOperationLogStore().redoCount ?? 0), T = B(
1764
1764
  () => r.value?.getOperationLogStore().undoRedoState ?? {
1765
1765
  canUndo: !1,
1766
1766
  canRedo: !1,
@@ -1768,161 +1768,161 @@ function Vt(o) {
1768
1768
  redoCount: 0,
1769
1769
  currentIndex: -1
1770
1770
  }
1771
- ), F = (y) => r.value?.getOperationLogStore().undo(y) ?? !1, _ = (y) => r.value?.getOperationLogStore().redo(y) ?? !1, $ = () => {
1771
+ ), L = (m) => r.value?.getOperationLogStore().undo(m) ?? !1, P = (m) => r.value?.getOperationLogStore().redo(m) ?? !1, I = () => {
1772
1772
  r.value?.getOperationLogStore().startBatch();
1773
- }, R = (y) => r.value?.getOperationLogStore().commitBatch(y) ?? null, S = () => {
1773
+ }, N = (m) => r.value?.getOperationLogStore().commitBatch(m) ?? null, S = () => {
1774
1774
  r.value?.getOperationLogStore().cancelBatch();
1775
- }, T = () => {
1775
+ }, D = () => {
1776
1776
  r.value?.getOperationLogStore().clear();
1777
- }, E = (y, f) => r.value?.getOperationLogStore().getOperationsFor(y, f) ?? [], N = () => r.value?.getOperationLogStore().getSnapshot() ?? {
1777
+ }, E = (m, f) => r.value?.getOperationLogStore().getOperationsFor(m, f) ?? [], _ = () => r.value?.getOperationLogStore().getSnapshot() ?? {
1778
1778
  operations: [],
1779
1779
  currentIndex: -1,
1780
1780
  totalOperations: 0,
1781
1781
  reversibleOperations: 0,
1782
1782
  irreversibleOperations: 0
1783
- }, g = (y, f) => {
1784
- r.value?.getOperationLogStore().markIrreversible(y, f);
1785
- }, x = (y, f, m, I = "success", A) => r.value?.getOperationLogStore().logAction(y, f, m, I, A) ?? "", M = (y) => {
1786
- r.value?.getOperationLogStore().configure(y);
1783
+ }, v = (m, f) => {
1784
+ r.value?.getOperationLogStore().markIrreversible(m, f);
1785
+ }, x = (m, f, b, A = "success", C) => r.value?.getOperationLogStore().logAction(m, f, b, A, C) ?? "", V = (m) => {
1786
+ r.value?.getOperationLogStore().configure(m);
1787
1787
  };
1788
- Me(async () => {
1788
+ Ve(async () => {
1789
1789
  if (e) {
1790
1790
  r.value = t || new He(e);
1791
1791
  try {
1792
- const y = r.value.getOperationLogStore(), f = Ue(y);
1792
+ const m = r.value.getOperationLogStore(), f = We(m);
1793
1793
  c.value = f.operations.value, h.value = f.currentIndex.value, H(
1794
1794
  () => f.operations.value,
1795
- (m) => {
1796
- c.value = m;
1795
+ (b) => {
1796
+ c.value = b;
1797
1797
  }
1798
1798
  ), H(
1799
1799
  () => f.currentIndex.value,
1800
- (m) => {
1801
- h.value = m;
1800
+ (b) => {
1801
+ h.value = b;
1802
1802
  }
1803
1803
  );
1804
1804
  } catch {
1805
1805
  }
1806
- if (!o.doctype && e.router) {
1807
- const y = e.router.currentRoute.value;
1808
- if (!y.path) return;
1809
- const f = y.path.split("/").filter((I) => I.length > 0), m = f[1]?.toLowerCase();
1806
+ if (!n.doctype && e.router) {
1807
+ const m = e.router.currentRoute.value;
1808
+ if (!m.path) return;
1809
+ const f = m.path.split("/").filter((A) => A.length > 0), b = f[1]?.toLowerCase();
1810
1810
  if (f.length > 0) {
1811
- const I = {
1812
- path: y.path,
1811
+ const A = {
1812
+ path: m.path,
1813
1813
  segments: f
1814
- }, A = await e.getMeta?.(I);
1815
- if (A) {
1816
- if (e.addDoctype(A), r.value.setup(A), i.value = A, a.value = m, n.value = r.value.getStore(), m && m !== "new") {
1817
- const j = r.value.getRecordById(A, m);
1814
+ }, C = await e.getMeta?.(A);
1815
+ if (C) {
1816
+ if (e.addDoctype(C), r.value.setup(C), i.value = C, a.value = b, o.value = r.value.getStore(), b && b !== "new") {
1817
+ const j = r.value.getRecordById(C, b);
1818
1818
  if (j)
1819
1819
  s.value = j.get("") || {};
1820
1820
  else
1821
1821
  try {
1822
- await r.value.getRecord(A, m);
1823
- const V = r.value.getRecordById(A, m);
1824
- V && (s.value = V.get("") || {});
1822
+ await r.value.getRecord(C, b);
1823
+ const k = r.value.getRecordById(C, b);
1824
+ k && (s.value = k.get("") || {});
1825
1825
  } catch {
1826
- s.value = he(A);
1826
+ s.value = he(C);
1827
1827
  }
1828
1828
  } else
1829
- s.value = he(A);
1830
- n.value && Ve(A, m || "new", s, n.value), r.value.runAction(A, "load", m ? [m] : void 0);
1829
+ s.value = he(C);
1830
+ o.value && ke(C, b || "new", s, o.value), r.value.runAction(C, "load", b ? [b] : void 0);
1831
1831
  }
1832
1832
  }
1833
1833
  }
1834
- if (o.doctype) {
1835
- n.value = r.value.getStore();
1836
- const y = o.doctype, f = o.recordId;
1834
+ if (n.doctype) {
1835
+ o.value = r.value.getStore();
1836
+ const m = n.doctype, f = n.recordId;
1837
1837
  if (f && f !== "new") {
1838
- const m = r.value.getRecordById(y, f);
1839
- if (m)
1840
- s.value = m.get("") || {};
1838
+ const b = r.value.getRecordById(m, f);
1839
+ if (b)
1840
+ s.value = b.get("") || {};
1841
1841
  else
1842
1842
  try {
1843
- await r.value.getRecord(y, f);
1844
- const I = r.value.getRecordById(y, f);
1845
- I && (s.value = I.get("") || {});
1843
+ await r.value.getRecord(m, f);
1844
+ const A = r.value.getRecordById(m, f);
1845
+ A && (s.value = A.get("") || {});
1846
1846
  } catch {
1847
- s.value = he(y);
1847
+ s.value = he(m);
1848
1848
  }
1849
1849
  } else
1850
- s.value = he(y);
1851
- n.value && Ve(y, f || "new", s, n.value);
1850
+ s.value = he(m);
1851
+ o.value && ke(m, f || "new", s, o.value);
1852
1852
  }
1853
1853
  }
1854
1854
  });
1855
- const u = (y, f) => {
1856
- const m = o.doctype || i.value;
1857
- if (!m) return "";
1858
- const I = f || o.recordId || a.value || "new";
1859
- return `${m.slug}.${I}.${y}`;
1860
- }, l = (y) => {
1861
- const f = o.doctype || i.value;
1862
- if (!(!n.value || !r.value || !f))
1855
+ const l = (m, f) => {
1856
+ const b = n.doctype || i.value;
1857
+ if (!b) return "";
1858
+ const A = f || n.recordId || a.value || "new";
1859
+ return `${b.slug}.${A}.${m}`;
1860
+ }, u = (m) => {
1861
+ const f = n.doctype || i.value;
1862
+ if (!(!o.value || !r.value || !f))
1863
1863
  try {
1864
- const m = y.path.split(".");
1865
- if (m.length >= 2) {
1866
- const j = m[0], V = m[1];
1867
- if (n.value.has(`${j}.${V}`) || r.value.addRecord(f, V, { ...s.value }), m.length > 3) {
1868
- const d = `${j}.${V}`, p = m.slice(2);
1869
- let v = d;
1870
- for (let k = 0; k < p.length - 1; k++)
1871
- if (v += `.${p[k]}`, !n.value.has(v)) {
1872
- const z = p[k + 1], W = !isNaN(Number(z));
1873
- n.value.set(v, W ? [] : {});
1864
+ const b = m.path.split(".");
1865
+ if (b.length >= 2) {
1866
+ const j = b[0], k = b[1];
1867
+ if (o.value.has(`${j}.${k}`) || r.value.addRecord(f, k, { ...s.value }), b.length > 3) {
1868
+ const d = `${j}.${k}`, p = b.slice(2);
1869
+ let y = d;
1870
+ for (let F = 0; F < p.length - 1; F++)
1871
+ if (y += `.${p[F]}`, !o.value.has(y)) {
1872
+ const z = p[F + 1], U = !isNaN(Number(z));
1873
+ o.value.set(y, U ? [] : {});
1874
1874
  }
1875
1875
  }
1876
1876
  }
1877
- n.value.set(y.path, y.value);
1878
- const I = y.fieldname.split("."), A = { ...s.value };
1879
- I.length === 1 ? A[I[0]] = y.value : Pt(A, I, y.value), s.value = A;
1877
+ o.value.set(m.path, m.value);
1878
+ const A = m.fieldname.split("."), C = { ...s.value };
1879
+ A.length === 1 ? C[A[0]] = m.value : Pt(C, A, m.value), s.value = C;
1880
1880
  } catch {
1881
1881
  }
1882
1882
  };
1883
- (o.doctype || e?.router) && (Ne("hstPathProvider", u), Ne("hstChangeHandler", l));
1883
+ (n.doctype || e?.router) && (_e("hstPathProvider", l), _e("hstChangeHandler", u));
1884
1884
  const O = {
1885
1885
  operations: c,
1886
1886
  currentIndex: h,
1887
- undoRedoState: C,
1888
- canUndo: b,
1887
+ undoRedoState: T,
1888
+ canUndo: g,
1889
1889
  canRedo: w,
1890
- undoCount: P,
1891
- redoCount: D,
1892
- undo: F,
1893
- redo: _,
1894
- startBatch: $,
1895
- commitBatch: R,
1890
+ undoCount: R,
1891
+ redoCount: $,
1892
+ undo: L,
1893
+ redo: P,
1894
+ startBatch: I,
1895
+ commitBatch: N,
1896
1896
  cancelBatch: S,
1897
- clear: T,
1897
+ clear: D,
1898
1898
  getOperationsFor: E,
1899
- getSnapshot: N,
1900
- markIrreversible: g,
1899
+ getSnapshot: _,
1900
+ markIrreversible: v,
1901
1901
  logAction: x,
1902
- configure: M
1902
+ configure: V
1903
1903
  };
1904
- return o.doctype ? {
1904
+ return n.doctype ? {
1905
1905
  stonecrop: r,
1906
1906
  operationLog: O,
1907
- provideHSTPath: u,
1908
- handleHSTChange: l,
1909
- hstStore: n,
1907
+ provideHSTPath: l,
1908
+ handleHSTChange: u,
1909
+ hstStore: o,
1910
1910
  formData: s
1911
- } : !o.doctype && e?.router ? {
1911
+ } : !n.doctype && e?.router ? {
1912
1912
  stonecrop: r,
1913
1913
  operationLog: O,
1914
- provideHSTPath: u,
1915
- handleHSTChange: l,
1916
- hstStore: n,
1914
+ provideHSTPath: l,
1915
+ handleHSTChange: u,
1916
+ hstStore: o,
1917
1917
  formData: s
1918
1918
  } : {
1919
1919
  stonecrop: r,
1920
1920
  operationLog: O
1921
1921
  };
1922
1922
  }
1923
- function he(o) {
1923
+ function he(n) {
1924
1924
  const e = {};
1925
- return o.schema && o.schema.forEach((t) => {
1925
+ return n.schema && n.schema.forEach((t) => {
1926
1926
  switch ("fieldtype" in t ? t.fieldtype : "Data") {
1927
1927
  case "Data":
1928
1928
  case "Text":
@@ -1946,15 +1946,15 @@ function he(o) {
1946
1946
  }
1947
1947
  }), e;
1948
1948
  }
1949
- function Ve(o, e, t, r) {
1949
+ function ke(n, e, t, r) {
1950
1950
  H(
1951
1951
  t,
1952
- (n) => {
1953
- const s = `${o.slug}.${e}`;
1954
- Object.keys(n).forEach((i) => {
1952
+ (o) => {
1953
+ const s = `${n.slug}.${e}`;
1954
+ Object.keys(o).forEach((i) => {
1955
1955
  const a = `${s}.${i}`;
1956
1956
  try {
1957
- r.set(a, n[i]);
1957
+ r.set(a, o[i]);
1958
1958
  } catch {
1959
1959
  }
1960
1960
  });
@@ -1962,100 +1962,100 @@ function Ve(o, e, t, r) {
1962
1962
  { deep: !0 }
1963
1963
  );
1964
1964
  }
1965
- function Pt(o, e, t) {
1966
- let r = o;
1965
+ function Pt(n, e, t) {
1966
+ let r = n;
1967
1967
  for (let s = 0; s < e.length - 1; s++) {
1968
1968
  const i = e[s];
1969
1969
  (!(i in r) || typeof r[i] != "object") && (r[i] = isNaN(Number(e[s + 1])) ? {} : []), r = r[i];
1970
1970
  }
1971
- const n = e[e.length - 1];
1972
- r[n] = t;
1971
+ const o = e[e.length - 1];
1972
+ r[o] = t;
1973
1973
  }
1974
- function Je(o) {
1975
- const t = te("$operationLogStore", void 0) || le();
1976
- o && t.configure(o);
1977
- const { operations: r, currentIndex: n, undoRedoState: s, canUndo: i, canRedo: a, undoCount: c, redoCount: h } = Ue(t);
1978
- function b(E) {
1974
+ function qe(n) {
1975
+ const t = te("$operationLogStore", void 0) || ue();
1976
+ n && t.configure(n);
1977
+ const { operations: r, currentIndex: o, undoRedoState: s, canUndo: i, canRedo: a, undoCount: c, redoCount: h } = We(t);
1978
+ function g(E) {
1979
1979
  return t.undo(E);
1980
1980
  }
1981
1981
  function w(E) {
1982
1982
  return t.redo(E);
1983
1983
  }
1984
- function P() {
1984
+ function R() {
1985
1985
  t.startBatch();
1986
1986
  }
1987
- function D(E) {
1987
+ function $(E) {
1988
1988
  return t.commitBatch(E);
1989
1989
  }
1990
- function C() {
1990
+ function T() {
1991
1991
  t.cancelBatch();
1992
1992
  }
1993
- function F() {
1993
+ function L() {
1994
1994
  t.clear();
1995
1995
  }
1996
- function _(E, N) {
1997
- return t.getOperationsFor(E, N);
1996
+ function P(E, _) {
1997
+ return t.getOperationsFor(E, _);
1998
1998
  }
1999
- function $() {
1999
+ function I() {
2000
2000
  return t.getSnapshot();
2001
2001
  }
2002
- function R(E, N) {
2003
- t.markIrreversible(E, N);
2002
+ function N(E, _) {
2003
+ t.markIrreversible(E, _);
2004
2004
  }
2005
- function S(E, N, g, x = "success", M) {
2006
- return t.logAction(E, N, g, x, M);
2005
+ function S(E, _, v, x = "success", V) {
2006
+ return t.logAction(E, _, v, x, V);
2007
2007
  }
2008
- function T(E) {
2008
+ function D(E) {
2009
2009
  t.configure(E);
2010
2010
  }
2011
2011
  return {
2012
2012
  // State
2013
2013
  operations: r,
2014
- currentIndex: n,
2014
+ currentIndex: o,
2015
2015
  undoRedoState: s,
2016
2016
  canUndo: i,
2017
2017
  canRedo: a,
2018
2018
  undoCount: c,
2019
2019
  redoCount: h,
2020
2020
  // Methods
2021
- undo: b,
2021
+ undo: g,
2022
2022
  redo: w,
2023
- startBatch: P,
2024
- commitBatch: D,
2025
- cancelBatch: C,
2026
- clear: F,
2027
- getOperationsFor: _,
2028
- getSnapshot: $,
2029
- markIrreversible: R,
2023
+ startBatch: R,
2024
+ commitBatch: $,
2025
+ cancelBatch: T,
2026
+ clear: L,
2027
+ getOperationsFor: P,
2028
+ getSnapshot: I,
2029
+ markIrreversible: N,
2030
2030
  logAction: S,
2031
- configure: T
2031
+ configure: D
2032
2032
  };
2033
2033
  }
2034
- function kt(o, e = !0) {
2034
+ function Mt(n, e = !0) {
2035
2035
  if (!e) return;
2036
- const { undo: t, redo: r, canUndo: n, canRedo: s } = Je(), i = Ot();
2037
- oe(i["Ctrl+Z"], () => {
2038
- n.value && t(o);
2039
- }), oe(i["Meta+Z"], () => {
2040
- n.value && t(o);
2041
- }), oe(i["Ctrl+Shift+Z"], () => {
2042
- s.value && r(o);
2043
- }), oe(i["Meta+Shift+Z"], () => {
2044
- s.value && r(o);
2045
- }), oe(i["Ctrl+Y"], () => {
2046
- s.value && r(o);
2036
+ const { undo: t, redo: r, canUndo: o, canRedo: s } = qe(), i = Ot();
2037
+ ne(i["Ctrl+Z"], () => {
2038
+ o.value && t(n);
2039
+ }), ne(i["Meta+Z"], () => {
2040
+ o.value && t(n);
2041
+ }), ne(i["Ctrl+Shift+Z"], () => {
2042
+ s.value && r(n);
2043
+ }), ne(i["Meta+Shift+Z"], () => {
2044
+ s.value && r(n);
2045
+ }), ne(i["Ctrl+Y"], () => {
2046
+ s.value && r(n);
2047
2047
  });
2048
2048
  }
2049
- async function Ft(o, e) {
2050
- const { startBatch: t, commitBatch: r, cancelBatch: n } = Je();
2049
+ async function xt(n, e) {
2050
+ const { startBatch: t, commitBatch: r, cancelBatch: o } = qe();
2051
2051
  t();
2052
2052
  try {
2053
- return await o(), r(e);
2053
+ return await n(), r(e);
2054
2054
  } catch (s) {
2055
- throw n(), s;
2055
+ throw o(), s;
2056
2056
  }
2057
2057
  }
2058
- class Mt {
2058
+ class Bt {
2059
2059
  /**
2060
2060
  * The doctype name
2061
2061
  * @public
@@ -2094,8 +2094,8 @@ class Mt {
2094
2094
  * @param actions - The doctype actions and field triggers
2095
2095
  * @param component - Optional Vue component for rendering the doctype
2096
2096
  */
2097
- constructor(e, t, r, n, s) {
2098
- this.doctype = e, this.schema = t, this.workflow = r, this.actions = n, this.component = s;
2097
+ constructor(e, t, r, o, s) {
2098
+ this.doctype = e, this.schema = t, this.workflow = r, this.actions = o, this.component = s;
2099
2099
  }
2100
2100
  /**
2101
2101
  * Converts the registered doctype string to a slug (kebab-case). The following conversions are made:
@@ -2161,7 +2161,7 @@ class ce {
2161
2161
  */
2162
2162
  addDoctype(e) {
2163
2163
  e.doctype in Object.keys(this.registry) || (this.registry[e.slug] = e);
2164
- const t = G();
2164
+ const t = J();
2165
2165
  t.registerDoctypeActions(e.doctype, e.actions), e.slug !== e.doctype && t.registerDoctypeActions(e.slug, e.actions), e.component && this.router && !this.router.hasRoute(e.doctype) && this.router.addRoute({
2166
2166
  path: `/${e.slug}`,
2167
2167
  name: e.slug,
@@ -2181,53 +2181,272 @@ class ce {
2181
2181
  // }
2182
2182
  // }
2183
2183
  }
2184
- async function Nt(o, e, t) {
2185
- await ue();
2184
+ async function _t(n, e, t) {
2185
+ await le();
2186
2186
  try {
2187
- await t(o, e);
2187
+ await t(n, e);
2188
2188
  } catch {
2189
2189
  }
2190
2190
  }
2191
- const Lt = {
2192
- install: (o, e) => {
2193
- const t = o.config.globalProperties.$router, r = e?.router, n = t || r;
2194
- !t && r && o.use(r);
2195
- const s = new ce(n, e?.getMeta);
2196
- o.provide("$registry", s), o.config.globalProperties.$registry = s;
2191
+ const jt = {
2192
+ install: (n, e) => {
2193
+ const t = n.config.globalProperties.$router, r = e?.router, o = t || r;
2194
+ !t && r && n.use(r);
2195
+ const s = new ce(o, e?.getMeta);
2196
+ n.provide("$registry", s), n.config.globalProperties.$registry = s;
2197
2197
  const i = new He(s);
2198
- o.provide("$stonecrop", i), o.config.globalProperties.$stonecrop = i;
2198
+ n.provide("$stonecrop", i), n.config.globalProperties.$stonecrop = i;
2199
2199
  try {
2200
- const a = o.config.globalProperties.$pinia;
2200
+ const a = n.config.globalProperties.$pinia;
2201
2201
  if (a) {
2202
- const c = le(a);
2203
- o.provide("$operationLogStore", c), o.config.globalProperties.$operationLogStore = c;
2202
+ const c = ue(a);
2203
+ n.provide("$operationLogStore", c), n.config.globalProperties.$operationLogStore = c;
2204
2204
  }
2205
2205
  } catch (a) {
2206
2206
  console.warn("Pinia not available - operation log features will be disabled:", a);
2207
2207
  }
2208
2208
  if (e?.components)
2209
2209
  for (const [a, c] of Object.entries(e.components))
2210
- o.component(a, c);
2211
- e?.autoInitializeRouter && e.onRouterInitialized && Nt(s, i, e.onRouterInitialized);
2210
+ n.component(a, c);
2211
+ e?.autoInitializeRouter && e.onRouterInitialized && _t(s, i, e.onRouterInitialized);
2212
2212
  }
2213
2213
  };
2214
+ var At = /* @__PURE__ */ ((n) => (n.ERROR = "error", n.WARNING = "warning", n.INFO = "info", n))(At || {});
2215
+ class $t {
2216
+ options;
2217
+ /**
2218
+ * Creates a new SchemaValidator instance
2219
+ * @param options - Validator configuration options
2220
+ */
2221
+ constructor(e = {}) {
2222
+ this.options = {
2223
+ registry: e.registry || null,
2224
+ validateLinkTargets: e.validateLinkTargets ?? !0,
2225
+ validateActions: e.validateActions ?? !0,
2226
+ validateWorkflows: e.validateWorkflows ?? !0,
2227
+ validateRequiredProperties: e.validateRequiredProperties ?? !0
2228
+ };
2229
+ }
2230
+ /**
2231
+ * Validates a complete doctype schema
2232
+ * @param doctype - Doctype name
2233
+ * @param schema - Schema fields (List or Array)
2234
+ * @param workflow - Optional workflow configuration
2235
+ * @param actions - Optional actions map
2236
+ * @returns Validation result
2237
+ */
2238
+ validate(e, t, r, o) {
2239
+ const s = [], i = t ? Array.isArray(t) ? t : t.toArray() : [];
2240
+ if (this.options.validateRequiredProperties && s.push(...this.validateRequiredProperties(e, i)), this.options.validateLinkTargets && this.options.registry && s.push(...this.validateLinkFields(e, i, this.options.registry)), this.options.validateWorkflows && r && s.push(...this.validateWorkflow(e, r)), this.options.validateActions && o) {
2241
+ const g = o instanceof Map ? o : o.toObject();
2242
+ s.push(...this.validateActionRegistration(e, g));
2243
+ }
2244
+ const a = s.filter(
2245
+ (g) => g.severity === "error"
2246
+ /* ERROR */
2247
+ ).length, c = s.filter(
2248
+ (g) => g.severity === "warning"
2249
+ /* WARNING */
2250
+ ).length, h = s.filter(
2251
+ (g) => g.severity === "info"
2252
+ /* INFO */
2253
+ ).length;
2254
+ return {
2255
+ valid: a === 0,
2256
+ issues: s,
2257
+ errorCount: a,
2258
+ warningCount: c,
2259
+ infoCount: h
2260
+ };
2261
+ }
2262
+ /**
2263
+ * Validates that required schema properties are present
2264
+ * @internal
2265
+ */
2266
+ validateRequiredProperties(e, t) {
2267
+ const r = [];
2268
+ for (const o of t) {
2269
+ if (!o.fieldname) {
2270
+ r.push({
2271
+ severity: "error",
2272
+ rule: "required-fieldname",
2273
+ message: "Field is missing required property: fieldname",
2274
+ doctype: e,
2275
+ context: { field: o }
2276
+ });
2277
+ continue;
2278
+ }
2279
+ if (!o.component && !("fieldtype" in o) && r.push({
2280
+ severity: "error",
2281
+ rule: "required-component-or-fieldtype",
2282
+ message: `Field "${o.fieldname}" must have either component or fieldtype property`,
2283
+ doctype: e,
2284
+ fieldname: o.fieldname
2285
+ }), "schema" in o) {
2286
+ const s = o.schema, i = Array.isArray(s) ? s : s.toArray?.() || [];
2287
+ r.push(...this.validateRequiredProperties(e, i));
2288
+ }
2289
+ }
2290
+ return r;
2291
+ }
2292
+ /**
2293
+ * Validates Link field targets exist in registry
2294
+ * @internal
2295
+ */
2296
+ validateLinkFields(e, t, r) {
2297
+ const o = [];
2298
+ for (const s of t) {
2299
+ if (("fieldtype" in s ? s.fieldtype : void 0) === "Link") {
2300
+ const a = "options" in s ? s.options : void 0;
2301
+ if (!a) {
2302
+ o.push({
2303
+ severity: "error",
2304
+ rule: "link-missing-options",
2305
+ message: `Link field "${s.fieldname}" is missing options property (target doctype)`,
2306
+ doctype: e,
2307
+ fieldname: s.fieldname
2308
+ });
2309
+ continue;
2310
+ }
2311
+ const c = typeof a == "string" ? a : "";
2312
+ if (!c) {
2313
+ o.push({
2314
+ severity: "error",
2315
+ rule: "link-invalid-options",
2316
+ message: `Link field "${s.fieldname}" has invalid options format (expected string doctype name)`,
2317
+ doctype: e,
2318
+ fieldname: s.fieldname
2319
+ });
2320
+ continue;
2321
+ }
2322
+ r.registry[c] || r.registry[c.toLowerCase()] || o.push({
2323
+ severity: "error",
2324
+ rule: "link-invalid-target",
2325
+ message: `Link field "${s.fieldname}" references non-existent doctype: "${c}"`,
2326
+ doctype: e,
2327
+ fieldname: s.fieldname,
2328
+ context: { targetDoctype: c }
2329
+ });
2330
+ }
2331
+ if ("schema" in s) {
2332
+ const a = s.schema, c = Array.isArray(a) ? a : a.toArray?.() || [];
2333
+ o.push(...this.validateLinkFields(e, c, r));
2334
+ }
2335
+ }
2336
+ return o;
2337
+ }
2338
+ /**
2339
+ * Validates workflow state machine configuration
2340
+ * @internal
2341
+ */
2342
+ validateWorkflow(e, t) {
2343
+ const r = [];
2344
+ if (!t.initial && !t.type && r.push({
2345
+ severity: "warning",
2346
+ rule: "workflow-missing-initial",
2347
+ message: "Workflow is missing initial state property",
2348
+ doctype: e
2349
+ }), !t.states || Object.keys(t.states).length === 0)
2350
+ return r.push({
2351
+ severity: "warning",
2352
+ rule: "workflow-no-states",
2353
+ message: "Workflow has no states defined",
2354
+ doctype: e
2355
+ }), r;
2356
+ t.initial && typeof t.initial == "string" && !t.states[t.initial] && r.push({
2357
+ severity: "error",
2358
+ rule: "workflow-invalid-initial",
2359
+ message: `Workflow initial state "${t.initial}" does not exist in states`,
2360
+ doctype: e,
2361
+ context: { initialState: t.initial }
2362
+ });
2363
+ const o = Object.keys(t.states), s = /* @__PURE__ */ new Set();
2364
+ t.initial && typeof t.initial == "string" && s.add(t.initial);
2365
+ for (const [i, a] of Object.entries(t.states)) {
2366
+ const c = a;
2367
+ if (c.on) {
2368
+ for (const [h, g] of Object.entries(c.on))
2369
+ if (typeof g == "string")
2370
+ s.add(g);
2371
+ else if (g && typeof g == "object") {
2372
+ const w = "target" in g ? g.target : void 0;
2373
+ typeof w == "string" ? s.add(w) : Array.isArray(w) && w.forEach((R) => {
2374
+ typeof R == "string" && s.add(R);
2375
+ });
2376
+ }
2377
+ }
2378
+ }
2379
+ for (const i of o)
2380
+ s.has(i) || r.push({
2381
+ severity: "warning",
2382
+ rule: "workflow-unreachable-state",
2383
+ message: `Workflow state "${i}" may not be reachable`,
2384
+ doctype: e,
2385
+ context: { stateName: i }
2386
+ });
2387
+ return r;
2388
+ }
2389
+ /**
2390
+ * Validates that actions are registered in the FieldTriggerEngine
2391
+ * @internal
2392
+ */
2393
+ validateActionRegistration(e, t) {
2394
+ const r = [], o = J();
2395
+ for (const [s, i] of Object.entries(t)) {
2396
+ if (!Array.isArray(i)) {
2397
+ r.push({
2398
+ severity: "error",
2399
+ rule: "action-invalid-format",
2400
+ message: `Action configuration for "${s}" must be an array`,
2401
+ doctype: e,
2402
+ context: { triggerName: s, actionNames: i }
2403
+ });
2404
+ continue;
2405
+ }
2406
+ for (const a of i) {
2407
+ const c = o;
2408
+ c.globalActions?.has(a) || c.globalTransitionActions?.has(a) || r.push({
2409
+ severity: "warning",
2410
+ rule: "action-not-registered",
2411
+ message: `Action "${a}" referenced in "${s}" is not registered in FieldTriggerEngine`,
2412
+ doctype: e,
2413
+ context: { triggerName: s, actionName: a }
2414
+ });
2415
+ }
2416
+ }
2417
+ return r;
2418
+ }
2419
+ }
2420
+ function It(n, e) {
2421
+ return new $t({
2422
+ registry: n,
2423
+ ...e
2424
+ });
2425
+ }
2426
+ function Wt(n, e, t, r, o) {
2427
+ return It(t).validate(n, e, r, o);
2428
+ }
2214
2429
  export {
2215
- Mt as DoctypeMeta,
2430
+ Bt as DoctypeMeta,
2216
2431
  ee as HST,
2217
2432
  ce as Registry,
2433
+ $t as SchemaValidator,
2218
2434
  He as Stonecrop,
2219
- _t as createHST,
2220
- Lt as default,
2221
- G as getGlobalTriggerEngine,
2222
- At as markOperationIrreversible,
2223
- Dt as registerGlobalAction,
2224
- $t as registerTransitionAction,
2225
- Tt as setFieldRollback,
2226
- Ct as triggerTransition,
2227
- Je as useOperationLog,
2228
- le as useOperationLogStore,
2435
+ At as ValidationSeverity,
2436
+ Nt as createHST,
2437
+ It as createValidator,
2438
+ jt as default,
2439
+ J as getGlobalTriggerEngine,
2440
+ Lt as markOperationIrreversible,
2441
+ Tt as registerGlobalAction,
2442
+ Ct as registerTransitionAction,
2443
+ kt as setFieldRollback,
2444
+ Ft as triggerTransition,
2445
+ qe as useOperationLog,
2446
+ ue as useOperationLogStore,
2229
2447
  Vt as useStonecrop,
2230
- kt as useUndoRedoShortcuts,
2231
- Ft as withBatch
2448
+ Mt as useUndoRedoShortcuts,
2449
+ Wt as validateSchema,
2450
+ xt as withBatch
2232
2451
  };
2233
2452
  //# sourceMappingURL=stonecrop.js.map