@airalogy/aimd-editor 1.14.1 → 1.16.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.
@@ -1,22 +1,23 @@
1
- import { defineComponent as pe, computed as B, openBlock as g, createElementBlock as h, createElementVNode as i, createTextVNode as U, toDisplayString as m, Fragment as R, renderList as Y, unref as G, createCommentVNode as N, ref as F, watch as ee, createBlock as me, Teleport as Oe, withModifiers as ae, normalizeStyle as Ue, normalizeClass as ye, withDirectives as D, vModelText as L, createVNode as oe, vModelSelect as be, vModelRadio as kt, vModelCheckbox as pt, nextTick as Re, inject as wt, h as tt, resolveDynamicComponent as it, withKeys as nt, shallowRef as Xe, vShow as at } from "vue";
1
+ import { defineComponent as pe, computed as q, openBlock as h, createElementBlock as b, createElementVNode as i, createTextVNode as L, toDisplayString as m, Fragment as U, renderList as J, unref as Y, createCommentVNode as B, ref as A, watch as Z, createBlock as me, Teleport as Oe, withModifiers as ne, normalizeStyle as Ue, normalizeClass as ye, withDirectives as D, vModelText as P, createVNode as ue, vModelSelect as be, vModelRadio as kt, vModelCheckbox as pt, nextTick as Re, inject as wt, h as tt, resolveDynamicComponent as it, withKeys as nt, shallowRef as Xe, vShow as at } from "vue";
2
2
  import { callCommand as Mt, insert as Ye, replaceAll as Le, getMarkdown as ot } from "@milkdown/kit/utils";
3
3
  import "@milkdown/theme-nord/style.css";
4
- import { j as ft, m as ze, k as _t, h as ut, o as Tt, p as xt, q as Ct, s as $t, t as It, u as Ft, v as At, i as zt, l as Vt, _ as St, n as Dt } from "./AimdWysiwygEditor.vue_vue_type_script_setup_true_lang-BiW39W8D.js";
5
- import { u as ve, g as lt, f as gt, i as De, s as Ve, h as Se, a as Ze, j as Ge, c as Et, b as rt, p as qt } from "./lexer-DKU2sEoR.js";
6
- import { a as _e, c as Te, A as ht, b as Bt, u as Nt, d as Pt } from "./fields-CC93ner-.js";
7
- import { _ as Lt } from "./AimdSourceEditor.vue_vue_type_script_setup_true_lang-ey9GBO3X.js";
4
+ import { j as ft, m as ze, k as _t, h as ut, q as xt, s as Tt, t as Ct, u as $t, v as It, w as Ft, x as At, i as zt, l as Vt, _ as Dt, n as St } from "./AimdWysiwygEditor.vue_vue_type_script_setup_true_lang-DuOq6WfS.js";
5
+ import { u as ve, g as lt, f as gt, i as Se, s as Ve, h as De, a as Ze, j as Ge, c as Et, b as rt, p as qt } from "./lexer-DKU2sEoR.js";
6
+ import { a as _e, c as xe, A as ht, b as Bt, u as Nt, d as Pt } from "./fields-CC93ner-.js";
7
+ import { _ as Lt } from "./AimdSourceEditor.vue_vue_type_script_setup_true_lang-DdjWUzYX.js";
8
8
  import { protectAimdInlineTemplates as Ut, restoreAimdInlineTemplates as Rt } from "@airalogy/aimd-core";
9
9
  import { parseAndExtract as Ot } from "@airalogy/aimd-renderer";
10
- import { insertTableCommand as Ht } from "@milkdown/kit/preset/gfm";
11
- var ke = 1e6, dt = 1e6, Ee = "[big.js] ", qe = Ee + "Invalid ", He = qe + "decimal places", jt = qe + "rounding mode", yt = Ee + "Division by zero", P = {}, ue = void 0;
10
+ import { editorViewCtx as Ht } from "@milkdown/kit/core";
11
+ import { insertTableCommand as jt } from "@milkdown/kit/preset/gfm";
12
+ var ke = 1e6, dt = 1e6, Ee = "[big.js] ", qe = Ee + "Invalid ", He = qe + "decimal places", Kt = qe + "rounding mode", yt = Ee + "Division by zero", N = {}, re = void 0;
12
13
  function we(e, n, t, a) {
13
14
  var o = e.c;
14
- if (t === ue && (t = e.constructor.RM), t !== 0 && t !== 1 && t !== 2 && t !== 3)
15
- throw Error(jt);
15
+ if (t === re && (t = e.constructor.RM), t !== 0 && t !== 1 && t !== 2 && t !== 3)
16
+ throw Error(Kt);
16
17
  if (n < 1)
17
- a = t === 3 && (a || !!o[0]) || n === 0 && (t === 1 && o[0] >= 5 || t === 2 && (o[0] > 5 || o[0] === 5 && (a || o[1] !== ue))), o.length = 1, a ? (e.e = e.e - n + 1, o[0] = 1) : o[0] = e.e = 0;
18
+ a = t === 3 && (a || !!o[0]) || n === 0 && (t === 1 && o[0] >= 5 || t === 2 && (o[0] > 5 || o[0] === 5 && (a || o[1] !== re))), o.length = 1, a ? (e.e = e.e - n + 1, o[0] = 1) : o[0] = e.e = 0;
18
19
  else if (n < o.length) {
19
- if (a = t === 1 && o[n] >= 5 || t === 2 && (o[n] > 5 || o[n] === 5 && (a || o[n + 1] !== ue || o[n - 1] & 1)) || t === 3 && (a || !!o[0]), o.length = n, a) {
20
+ if (a = t === 1 && o[n] >= 5 || t === 2 && (o[n] > 5 || o[n] === 5 && (a || o[n + 1] !== re || o[n - 1] & 1)) || t === 3 && (a || !!o[0]), o.length = n, a) {
20
21
  for (; ++o[--n] > 9; )
21
22
  if (o[n] = 0, n === 0) {
22
23
  ++e.e, o.unshift(1);
@@ -41,11 +42,11 @@ function Me(e, n, t) {
41
42
  else v > 1 && (o = o.charAt(0) + "." + o.slice(1));
42
43
  return e.s < 0 && t ? "-" + o : o;
43
44
  }
44
- P.abs = function() {
45
+ N.abs = function() {
45
46
  var e = new this.constructor(this);
46
47
  return e.s = 1, e;
47
48
  };
48
- P.cmp = function(e) {
49
+ N.cmp = function(e) {
49
50
  var n, t = this, a = t.c, o = (e = new t.constructor(e)).c, v = t.s, p = e.s, u = t.e, l = e.e;
50
51
  if (!a[0] || !o[0]) return a[0] ? v : o[0] ? -p : 0;
51
52
  if (v != p) return v;
@@ -54,7 +55,7 @@ P.cmp = function(e) {
54
55
  if (a[v] != o[v]) return a[v] > o[v] ^ n ? 1 : -1;
55
56
  return u == l ? 0 : u > l ^ n ? 1 : -1;
56
57
  };
57
- P.div = function(e) {
58
+ N.div = function(e) {
58
59
  var n = this, t = n.constructor, a = n.c, o = (e = new t(e)).c, v = n.s == e.s ? 1 : -1, p = t.DP;
59
60
  if (p !== ~~p || p < 0 || p > ke)
60
61
  throw Error(He);
@@ -62,58 +63,58 @@ P.div = function(e) {
62
63
  throw Error(yt);
63
64
  if (!a[0])
64
65
  return e.s = v, e.c = [e.e = 0], e;
65
- var u, l, c, _, d, k = o.slice(), S = u = o.length, V = a.length, y = a.slice(0, u), b = y.length, A = e, E = A.c = [], C = 0, I = p + (A.e = n.e - e.e) + 1;
66
- for (A.s = v, v = I < 0 ? 0 : I, k.unshift(0); b++ < u; ) y.push(0);
66
+ var u, l, c, T, d, M = o.slice(), V = u = o.length, z = a.length, k = a.slice(0, u), w = k.length, I = e, S = I.c = [], $ = 0, F = p + (I.e = n.e - e.e) + 1;
67
+ for (I.s = v, v = F < 0 ? 0 : F, M.unshift(0); w++ < u; ) k.push(0);
67
68
  do {
68
69
  for (c = 0; c < 10; c++) {
69
- if (u != (b = y.length))
70
- _ = u > b ? 1 : -1;
70
+ if (u != (w = k.length))
71
+ T = u > w ? 1 : -1;
71
72
  else
72
- for (d = -1, _ = 0; ++d < u; )
73
- if (o[d] != y[d]) {
74
- _ = o[d] > y[d] ? 1 : -1;
73
+ for (d = -1, T = 0; ++d < u; )
74
+ if (o[d] != k[d]) {
75
+ T = o[d] > k[d] ? 1 : -1;
75
76
  break;
76
77
  }
77
- if (_ < 0) {
78
- for (l = b == u ? o : k; b; ) {
79
- if (y[--b] < l[b]) {
80
- for (d = b; d && !y[--d]; ) y[d] = 9;
81
- --y[d], y[b] += 10;
78
+ if (T < 0) {
79
+ for (l = w == u ? o : M; w; ) {
80
+ if (k[--w] < l[w]) {
81
+ for (d = w; d && !k[--d]; ) k[d] = 9;
82
+ --k[d], k[w] += 10;
82
83
  }
83
- y[b] -= l[b];
84
+ k[w] -= l[w];
84
85
  }
85
- for (; !y[0]; ) y.shift();
86
+ for (; !k[0]; ) k.shift();
86
87
  } else
87
88
  break;
88
89
  }
89
- E[C++] = _ ? c : ++c, y[0] && _ ? y[b] = a[S] || 0 : y = [a[S]];
90
- } while ((S++ < V || y[0] !== ue) && v--);
91
- return !E[0] && C != 1 && (E.shift(), A.e--, I--), C > I && we(A, I, t.RM, y[0] !== ue), A;
90
+ S[$++] = T ? c : ++c, k[0] && T ? k[w] = a[V] || 0 : k = [a[V]];
91
+ } while ((V++ < z || k[0] !== re) && v--);
92
+ return !S[0] && $ != 1 && (S.shift(), I.e--, F--), $ > F && we(I, F, t.RM, k[0] !== re), I;
92
93
  };
93
- P.eq = function(e) {
94
+ N.eq = function(e) {
94
95
  return this.cmp(e) === 0;
95
96
  };
96
- P.gt = function(e) {
97
+ N.gt = function(e) {
97
98
  return this.cmp(e) > 0;
98
99
  };
99
- P.gte = function(e) {
100
+ N.gte = function(e) {
100
101
  return this.cmp(e) > -1;
101
102
  };
102
- P.lt = function(e) {
103
+ N.lt = function(e) {
103
104
  return this.cmp(e) < 0;
104
105
  };
105
- P.lte = function(e) {
106
+ N.lte = function(e) {
106
107
  return this.cmp(e) < 1;
107
108
  };
108
- P.minus = P.sub = function(e) {
109
+ N.minus = N.sub = function(e) {
109
110
  var n, t, a, o, v = this, p = v.constructor, u = v.s, l = (e = new p(e)).s;
110
111
  if (u != l)
111
112
  return e.s = -l, v.plus(e);
112
- var c = v.c.slice(), _ = v.e, d = e.c, k = e.e;
113
+ var c = v.c.slice(), T = v.e, d = e.c, M = e.e;
113
114
  if (!c[0] || !d[0])
114
115
  return d[0] ? e.s = -l : c[0] ? e = new p(v) : e.s = 1, e;
115
- if (u = _ - k) {
116
- for ((o = u < 0) ? (u = -u, a = c) : (k = _, a = d), a.reverse(), l = u; l--; ) a.push(0);
116
+ if (u = T - M) {
117
+ for ((o = u < 0) ? (u = -u, a = c) : (M = T, a = d), a.reverse(), l = u; l--; ) a.push(0);
117
118
  a.reverse();
118
119
  } else
119
120
  for (t = ((o = c.length < d.length) ? c : d).length, u = l = 0; l < t; l++)
@@ -131,20 +132,20 @@ P.minus = P.sub = function(e) {
131
132
  }
132
133
  for (; c[--l] === 0; ) c.pop();
133
134
  for (; c[0] === 0; )
134
- c.shift(), --k;
135
- return c[0] || (e.s = 1, c = [k = 0]), e.c = c, e.e = k, e;
135
+ c.shift(), --M;
136
+ return c[0] || (e.s = 1, c = [M = 0]), e.c = c, e.e = M, e;
136
137
  };
137
- P.mod = function(e) {
138
+ N.mod = function(e) {
138
139
  var n, t = this, a = t.constructor, o = t.s, v = (e = new a(e)).s;
139
140
  if (!e.c[0])
140
141
  throw Error(yt);
141
142
  return t.s = e.s = 1, n = e.cmp(t) == 1, t.s = o, e.s = v, n ? new a(t) : (o = a.DP, v = a.RM, a.DP = a.RM = 0, t = t.div(e), a.DP = o, a.RM = v, this.minus(t.times(e)));
142
143
  };
143
- P.neg = function() {
144
+ N.neg = function() {
144
145
  var e = new this.constructor(this);
145
146
  return e.s = -e.s, e;
146
147
  };
147
- P.plus = P.add = function(e) {
148
+ N.plus = N.add = function(e) {
148
149
  var n, t, a, o = this, v = o.constructor;
149
150
  if (e = new v(e), o.s != e.s)
150
151
  return e.s = -e.s, o.minus(e);
@@ -159,7 +160,7 @@ P.plus = P.add = function(e) {
159
160
  for (t && (u.unshift(t), ++l), n = u.length; u[--n] === 0; ) u.pop();
160
161
  return e.c = u, e.e = l, e;
161
162
  };
162
- P.pow = function(e) {
163
+ N.pow = function(e) {
163
164
  var n = this, t = new n.constructor("1"), a = t, o = e < 0;
164
165
  if (e !== ~~e || e < -dt || e > dt)
165
166
  throw Error(qe + "exponent");
@@ -167,18 +168,18 @@ P.pow = function(e) {
167
168
  n = n.times(n);
168
169
  return o ? t.div(a) : a;
169
170
  };
170
- P.prec = function(e, n) {
171
+ N.prec = function(e, n) {
171
172
  if (e !== ~~e || e < 1 || e > ke)
172
173
  throw Error(qe + "precision");
173
174
  return we(new this.constructor(this), e, n);
174
175
  };
175
- P.round = function(e, n) {
176
- if (e === ue) e = 0;
176
+ N.round = function(e, n) {
177
+ if (e === re) e = 0;
177
178
  else if (e !== ~~e || e < -ke || e > ke)
178
179
  throw Error(He);
179
180
  return we(new this.constructor(this), e + this.e + 1, n);
180
181
  };
181
- P.sqrt = function() {
182
+ N.sqrt = function() {
182
183
  var e, n, t, a = this, o = a.constructor, v = a.s, p = a.e, u = new o("0.5");
183
184
  if (!a.c[0]) return new o(a);
184
185
  if (v < 0)
@@ -189,7 +190,7 @@ P.sqrt = function() {
189
190
  while (t.c.slice(0, p).join("") !== e.c.slice(0, p).join(""));
190
191
  return we(e, (o.DP -= 4) + e.e + 1, o.RM);
191
192
  };
192
- P.times = P.mul = function(e) {
193
+ N.times = N.mul = function(e) {
193
194
  var n, t = this, a = t.constructor, o = t.c, v = (e = new a(e)).c, p = o.length, u = v.length, l = t.e, c = e.e;
194
195
  if (e.s = t.s == e.s ? 1 : -1, !o[0] || !v[0])
195
196
  return e.c = [e.e = 0], e;
@@ -202,50 +203,50 @@ P.times = P.mul = function(e) {
202
203
  for (u ? ++e.e : n.shift(), l = n.length; !n[--l]; ) n.pop();
203
204
  return e.c = n, e;
204
205
  };
205
- P.toExponential = function(e, n) {
206
+ N.toExponential = function(e, n) {
206
207
  var t = this, a = t.c[0];
207
- if (e !== ue) {
208
+ if (e !== re) {
208
209
  if (e !== ~~e || e < 0 || e > ke)
209
210
  throw Error(He);
210
211
  for (t = we(new t.constructor(t), ++e, n); t.c.length < e; ) t.c.push(0);
211
212
  }
212
213
  return Me(t, !0, !!a);
213
214
  };
214
- P.toFixed = function(e, n) {
215
+ N.toFixed = function(e, n) {
215
216
  var t = this, a = t.c[0];
216
- if (e !== ue) {
217
+ if (e !== re) {
217
218
  if (e !== ~~e || e < 0 || e > ke)
218
219
  throw Error(He);
219
220
  for (t = we(new t.constructor(t), e + t.e + 1, n), e = e + t.e + 1; t.c.length < e; ) t.c.push(0);
220
221
  }
221
222
  return Me(t, !1, !!a);
222
223
  };
223
- P[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = P.toJSON = P.toString = function() {
224
+ N[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = N.toJSON = N.toString = function() {
224
225
  var e = this, n = e.constructor;
225
226
  return Me(e, e.e <= n.NE || e.e >= n.PE, !!e.c[0]);
226
227
  };
227
- P.toNumber = function() {
228
+ N.toNumber = function() {
228
229
  var e = +Me(this, !0, !0);
229
230
  if (this.constructor.strict === !0 && !this.eq(e.toString()))
230
231
  throw Error(Ee + "Imprecise conversion");
231
232
  return e;
232
233
  };
233
- P.toPrecision = function(e, n) {
234
+ N.toPrecision = function(e, n) {
234
235
  var t = this, a = t.constructor, o = t.c[0];
235
- if (e !== ue) {
236
+ if (e !== re) {
236
237
  if (e !== ~~e || e < 1 || e > ke)
237
238
  throw Error(qe + "precision");
238
239
  for (t = we(new a(t), e, n); t.c.length < e; ) t.c.push(0);
239
240
  }
240
241
  return Me(t, e <= t.e || t.e <= a.NE || t.e >= a.PE, !!o);
241
242
  };
242
- P.valueOf = function() {
243
+ N.valueOf = function() {
243
244
  var e = this, n = e.constructor;
244
245
  if (n.strict === !0)
245
246
  throw Error(Ee + "valueOf disallowed");
246
247
  return Me(e, e.e <= n.NE || e.e >= n.PE, !0);
247
248
  };
248
- const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt = ["label"], Xt = ["value"], Yt = ["label"], Zt = ["value"], Gt = ["value", "placeholder"], el = /* @__PURE__ */ pe({
249
+ const Wt = { class: "aimd-type-picker" }, Qt = ["value"], Jt = { value: "" }, Xt = ["label"], Yt = ["value"], Zt = ["label"], Gt = ["value"], el = ["value", "placeholder"], tl = /* @__PURE__ */ pe({
249
250
  __name: "AimdTypePicker",
250
251
  props: {
251
252
  modelValue: {},
@@ -256,54 +257,54 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
256
257
  setup(e, { emit: n }) {
257
258
  const t = e, a = n, o = gt();
258
259
  function v(c) {
259
- const _ = lt(c)?.title;
260
- return _ && _ !== c ? `${_} (${c})` : c;
260
+ const T = lt(c)?.title;
261
+ return T && T !== c ? `${T} (${c})` : c;
261
262
  }
262
- const p = B(() => [...new Map((t.varTypePlugins ?? []).map((c) => [c.value, c])).values()].filter((c) => !o.includes(c.value))), u = B(() => {
263
+ const p = q(() => [...new Map((t.varTypePlugins ?? []).map((c) => [c.value, c])).values()].filter((c) => !o.includes(c.value))), u = q(() => {
263
264
  const c = ve(t.modelValue);
264
- return lt(c)?.type_name ?? (p.value.some((_) => _.value === c) ? c : "");
265
+ return lt(c)?.type_name ?? (p.value.some((T) => T.value === c) ? c : "");
265
266
  });
266
267
  function l(c) {
267
- const _ = c.target.value;
268
- _ && a("update:modelValue", _ + (De(t.modelValue) ? " | None" : ""));
268
+ const T = c.target.value;
269
+ T && a("update:modelValue", T + (Se(t.modelValue) ? " | None" : ""));
269
270
  }
270
- return (c, _) => (g(), h("div", Kt, [
271
+ return (c, T) => (h(), b("div", Wt, [
271
272
  i("label", null, [
272
- U(m(e.messages.inputField.knownTypes) + " ", 1),
273
+ L(m(e.messages.inputField.knownTypes) + " ", 1),
273
274
  i("select", {
274
275
  name: "knownType",
275
276
  value: u.value,
276
277
  onChange: l
277
278
  }, [
278
- i("option", Qt, m(e.messages.inputField.customExpression), 1),
279
+ i("option", Jt, m(e.messages.inputField.customExpression), 1),
279
280
  i("optgroup", {
280
281
  label: e.messages.inputField.builtInTypes
281
282
  }, [
282
- (g(!0), h(R, null, Y(G(o), (d) => (g(), h("option", {
283
+ (h(!0), b(U, null, J(Y(o), (d) => (h(), b("option", {
283
284
  key: d,
284
285
  value: d
285
- }, m(v(d)), 9, Xt))), 128))
286
- ], 8, Jt),
287
- p.value.length ? (g(), h("optgroup", {
286
+ }, m(v(d)), 9, Yt))), 128))
287
+ ], 8, Xt),
288
+ p.value.length ? (h(), b("optgroup", {
288
289
  key: 0,
289
290
  label: e.messages.inputField.pluginTypes
290
291
  }, [
291
- (g(!0), h(R, null, Y(p.value, (d) => (g(), h("option", {
292
+ (h(!0), b(U, null, J(p.value, (d) => (h(), b("option", {
292
293
  key: d.value,
293
294
  value: d.value
294
- }, m(d.label) + " (" + m(d.value) + ")", 9, Zt))), 128))
295
- ], 8, Yt)) : N("", !0)
296
- ], 40, Wt)
295
+ }, m(d.label) + " (" + m(d.value) + ")", 9, Gt))), 128))
296
+ ], 8, Zt)) : B("", !0)
297
+ ], 40, Qt)
297
298
  ]),
298
299
  i("label", null, [
299
- U(m(e.messages.dialog.customType), 1),
300
+ L(m(e.messages.dialog.customType), 1),
300
301
  i("input", {
301
302
  name: "type",
302
303
  value: e.modelValue,
303
304
  placeholder: e.messages.placeholders.type,
304
305
  spellcheck: "false",
305
- onInput: _[0] || (_[0] = (d) => a("update:modelValue", d.target.value))
306
- }, null, 40, Gt)
306
+ onInput: T[0] || (T[0] = (d) => a("update:modelValue", d.target.value))
307
+ }, null, 40, el)
307
308
  ])
308
309
  ]));
309
310
  }
@@ -312,28 +313,28 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
312
313
  for (const [a, o] of n)
313
314
  t[a] = o;
314
315
  return t;
315
- }, bt = /* @__PURE__ */ je(el, [["__scopeId", "data-v-be127780"]]), tl = { class: "aimd-dialog" }, ll = { class: "aimd-dialog-header" }, sl = { class: "aimd-dialog-title" }, il = ["innerHTML"], nl = { class: "aimd-dialog-type-tabs" }, al = ["onClick"], ol = ["innerHTML"], ul = { class: "aimd-dialog-body" }, rl = { class: "aimd-field-row" }, dl = { class: "aimd-field-label" }, cl = ["placeholder"], vl = { class: "aimd-field-row" }, ml = { class: "aimd-field-label" }, pl = { class: "aimd-field-hint" }, fl = { class: "aimd-var-type-grid" }, gl = ["onClick"], hl = { class: "aimd-var-type-card-title" }, yl = { class: "aimd-var-type-card-desc" }, bl = { class: "aimd-field-row" }, kl = { class: "aimd-field-label" }, wl = ["placeholder"], Ml = { class: "aimd-field-row" }, _l = { class: "aimd-field-label" }, Tl = ["placeholder"], xl = { class: "aimd-field-row" }, Cl = { class: "aimd-field-label" }, $l = ["placeholder"], Il = { class: "aimd-field-row" }, Fl = { class: "aimd-field-label" }, Al = ["placeholder"], zl = { class: "aimd-field-hint" }, Vl = { class: "aimd-field-row" }, Sl = { class: "aimd-field-label" }, Dl = { class: "aimd-field-row" }, El = { class: "aimd-field-label" }, ql = ["placeholder"], Bl = { class: "aimd-field-row" }, Nl = { class: "aimd-field-label" }, Pl = { value: "1" }, Ll = { value: "2" }, Ul = { value: "3" }, Rl = { class: "aimd-field-row" }, Ol = { class: "aimd-field-label" }, Hl = ["placeholder"], jl = { class: "aimd-field-row" }, Kl = { class: "aimd-field-label" }, Wl = { value: "choice" }, Ql = { value: "blank" }, Jl = { value: "open" }, Xl = { class: "aimd-field-row" }, Yl = { class: "aimd-field-label" }, Zl = ["placeholder"], Gl = { class: "aimd-field-row" }, es = { class: "aimd-field-label" }, ts = ["placeholder"], ls = {
316
+ }, bt = /* @__PURE__ */ je(tl, [["__scopeId", "data-v-be127780"]]), ll = { class: "aimd-dialog" }, sl = { class: "aimd-dialog-header" }, il = { class: "aimd-dialog-title" }, nl = ["innerHTML"], al = { class: "aimd-dialog-type-tabs" }, ol = ["onClick"], ul = ["innerHTML"], rl = { class: "aimd-dialog-body" }, dl = { class: "aimd-field-row" }, cl = { class: "aimd-field-label" }, vl = ["placeholder"], ml = { class: "aimd-field-row" }, pl = { class: "aimd-field-label" }, fl = { class: "aimd-field-hint" }, gl = { class: "aimd-var-type-grid" }, hl = ["onClick"], yl = { class: "aimd-var-type-card-title" }, bl = { class: "aimd-var-type-card-desc" }, kl = { class: "aimd-field-row" }, wl = { class: "aimd-field-label" }, Ml = ["placeholder"], _l = { class: "aimd-field-row" }, xl = { class: "aimd-field-label" }, Tl = ["placeholder"], Cl = { class: "aimd-field-row" }, $l = { class: "aimd-field-label" }, Il = ["placeholder"], Fl = { class: "aimd-field-row" }, Al = { class: "aimd-field-label" }, zl = ["placeholder"], Vl = { class: "aimd-field-hint" }, Dl = { class: "aimd-field-row" }, Sl = { class: "aimd-field-label" }, El = { class: "aimd-field-row" }, ql = { class: "aimd-field-label" }, Bl = ["placeholder"], Nl = { class: "aimd-field-row" }, Pl = { class: "aimd-field-label" }, Ll = { value: "1" }, Ul = { value: "2" }, Rl = { value: "3" }, Ol = { class: "aimd-field-row" }, Hl = { class: "aimd-field-label" }, jl = ["placeholder"], Kl = { class: "aimd-field-row" }, Wl = { class: "aimd-field-label" }, Ql = { value: "choice" }, Jl = { value: "blank" }, Xl = { value: "open" }, Yl = { class: "aimd-field-row" }, Zl = { class: "aimd-field-label" }, Gl = ["placeholder"], es = { class: "aimd-field-row" }, ts = { class: "aimd-field-label" }, ls = ["placeholder"], ss = {
316
317
  key: 0,
317
318
  class: "aimd-field-hint"
318
- }, ss = { class: "aimd-field-row" }, is = { class: "aimd-field-label" }, ns = { value: "single" }, as = { value: "multiple" }, os = { class: "aimd-field-row" }, us = { class: "aimd-field-label" }, rs = { class: "aimd-collection-editor" }, ds = ["onDragover", "onDrop"], cs = ["title", "onDragstart"], vs = ["onUpdate:modelValue", "placeholder"], ms = ["onUpdate:modelValue", "placeholder"], ps = { class: "aimd-option-answer-toggle" }, fs = ["value", "disabled"], gs = ["value", "disabled"], hs = ["disabled", "onClick"], ys = { class: "aimd-field-hint" }, bs = {
319
+ }, is = { class: "aimd-field-row" }, ns = { class: "aimd-field-label" }, as = { value: "single" }, os = { value: "multiple" }, us = { class: "aimd-field-row" }, rs = { class: "aimd-field-label" }, ds = { class: "aimd-collection-editor" }, cs = ["onDragover", "onDrop"], vs = ["title", "onDragstart"], ms = ["onUpdate:modelValue", "placeholder"], ps = ["onUpdate:modelValue", "placeholder"], fs = { class: "aimd-option-answer-toggle" }, gs = ["value", "disabled"], hs = ["value", "disabled"], ys = ["disabled", "onClick"], bs = { class: "aimd-field-hint" }, ks = {
319
320
  key: 1,
320
321
  class: "aimd-field-row"
321
- }, ks = { class: "aimd-field-label" }, ws = { class: "aimd-collection-editor" }, Ms = ["onUpdate:modelValue", "placeholder"], _s = ["onUpdate:modelValue", "placeholder"], Ts = ["disabled", "onClick"], xs = { class: "aimd-field-hint" }, Cs = {
322
+ }, ws = { class: "aimd-field-label" }, Ms = { class: "aimd-collection-editor" }, _s = ["onUpdate:modelValue", "placeholder"], xs = ["onUpdate:modelValue", "placeholder"], Ts = ["disabled", "onClick"], Cs = { class: "aimd-field-hint" }, $s = {
322
323
  key: 2,
323
324
  class: "aimd-field-row"
324
- }, $s = { class: "aimd-field-label" }, Is = ["placeholder"], Fs = { class: "aimd-field-row" }, As = { class: "aimd-field-label" }, zs = { class: "aimd-field-row" }, Vs = { class: "aimd-field-label" }, Ss = ["placeholder"], Ds = { class: "aimd-field-row" }, Es = { class: "aimd-field-label" }, qs = {
325
+ }, Is = { class: "aimd-field-label" }, Fs = ["placeholder"], As = { class: "aimd-field-row" }, zs = { class: "aimd-field-label" }, Vs = { class: "aimd-field-row" }, Ds = { class: "aimd-field-label" }, Ss = ["placeholder"], Es = { class: "aimd-field-row" }, qs = { class: "aimd-field-label" }, Bs = {
325
326
  key: 5,
326
327
  class: "aimd-field-row"
327
- }, Bs = { class: "aimd-field-label" }, Ns = ["placeholder"], Ps = { id: "aimd-ref-suggestions" }, Ls = ["value"], Us = {
328
+ }, Ns = { class: "aimd-field-label" }, Ps = ["placeholder"], Ls = { id: "aimd-ref-suggestions" }, Us = ["value"], Rs = {
328
329
  key: 0,
329
330
  class: "aimd-field-hint"
330
- }, Rs = {
331
+ }, Os = {
331
332
  key: 6,
332
333
  class: "aimd-field-row"
333
- }, Os = { class: "aimd-field-label" }, Hs = ["placeholder"], js = { class: "aimd-field-hint" }, Ks = { class: "aimd-dialog-preview" }, Ws = { class: "aimd-preview-header" }, Qs = { class: "aimd-preview-panel" }, Js = { class: "aimd-preview-code" }, Xs = {
334
+ }, Hs = { class: "aimd-field-label" }, js = ["placeholder"], Ks = { class: "aimd-field-hint" }, Ws = { class: "aimd-dialog-preview" }, Qs = { class: "aimd-preview-header" }, Js = { class: "aimd-preview-panel" }, Xs = { class: "aimd-preview-code" }, Ys = {
334
335
  key: 7,
335
336
  class: "aimd-dialog-error"
336
- }, Ys = { class: "aimd-dialog-footer" }, Zs = /* @__PURE__ */ pe({
337
+ }, Zs = { class: "aimd-dialog-footer" }, Gs = /* @__PURE__ */ pe({
337
338
  __name: "AimdFieldDialog",
338
339
  props: {
339
340
  visible: { type: Boolean },
@@ -346,481 +347,481 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
346
347
  },
347
348
  emits: ["update:visible", "insert"],
348
349
  setup(e, { emit: n }) {
349
- const t = e, a = n, o = B(() => {
350
- const f = ft(t.messages);
350
+ const t = e, a = n, o = q(() => {
351
+ const g = ft(t.messages);
351
352
  if (!t.allowedTypes || t.allowedTypes.length === 0)
352
- return f;
353
+ return g;
353
354
  const r = new Set(t.allowedTypes);
354
- return f.filter((s) => r.has(s.type));
355
+ return g.filter((s) => r.has(s.type));
355
356
  });
356
- function v(f) {
357
- return f && o.value.some((r) => r.type === f) ? f : o.value[0]?.type ?? f ?? "var";
357
+ function v(g) {
358
+ return g && o.value.some((r) => r.type === g) ? g : o.value[0]?.type ?? g ?? "var";
358
359
  }
359
- const p = B(() => new Set(t.existingQuizIds || [])), u = F(v(t.initialType)), l = F(ze(u.value, t.messages, p.value)), c = F([]), _ = F([]), d = F([]), k = F(null), S = F(null), V = F(""), y = B(
360
+ const p = q(() => new Set(t.existingQuizIds || [])), u = A(v(t.initialType)), l = A(ze(u.value, t.messages, p.value)), c = A([]), T = A([]), d = A([]), M = A(null), V = A(null), z = A(""), k = q(
360
361
  () => _t(t.messages, t.varTypePlugins ?? [])
361
362
  );
362
- function b(f) {
363
- return (f || "").trim().toLowerCase().replace(/[\s_-]/g, "");
363
+ function w(g) {
364
+ return (g || "").trim().toLowerCase().replace(/[\s_-]/g, "");
364
365
  }
365
- function A(f) {
366
- return b(l.value.type) === b(f);
366
+ function I(g) {
367
+ return w(l.value.type) === w(g);
367
368
  }
368
- function E(f) {
369
- l.value.type = f;
369
+ function S(g) {
370
+ l.value.type = g;
370
371
  }
371
- function C(f, r) {
372
- const s = `quiz_${f}`;
373
- let M = 1;
374
- for (; r.has(`${s}_${M}`); )
375
- M += 1;
376
- return `${s}_${M}`;
372
+ function $(g, r) {
373
+ const s = `quiz_${g}`;
374
+ let _ = 1;
375
+ for (; r.has(`${s}_${_}`); )
376
+ _ += 1;
377
+ return `${s}_${_}`;
377
378
  }
378
- function I(f) {
379
- const r = f.split(",").map((s) => s.trim()).filter(Boolean);
379
+ function F(g) {
380
+ const r = g.split(",").map((s) => s.trim()).filter(Boolean);
380
381
  return r.length === 0 ? [
381
382
  { key: "A", text: "" },
382
383
  { key: "B", text: "" }
383
- ] : r.map((s, M) => {
384
- const q = s.indexOf(":");
385
- if (q > 0) {
386
- const ge = s.slice(0, q).trim() || String.fromCharCode(65 + M), Be = s.slice(q + 1).trim() || t.messages.defaults.optionText(ge);
384
+ ] : r.map((s, _) => {
385
+ const E = s.indexOf(":");
386
+ if (E > 0) {
387
+ const ge = s.slice(0, E).trim() || String.fromCharCode(65 + _), Be = s.slice(E + 1).trim() || t.messages.defaults.optionText(ge);
387
388
  return { key: ge, text: Be };
388
389
  }
389
- return { key: String.fromCharCode(65 + M), text: s };
390
+ return { key: String.fromCharCode(65 + _), text: s };
390
391
  });
391
392
  }
392
- function W(f) {
393
- const r = f.map((s) => ({ key: s.key.trim(), text: s.text.trim() })).filter((s) => s.key && s.text);
393
+ function W(g) {
394
+ const r = g.map((s) => ({ key: s.key.trim(), text: s.text.trim() })).filter((s) => s.key && s.text);
394
395
  return r.length === 0 ? "A:, B:" : r.map((s) => `${s.key}:${s.text}`).join(", ");
395
396
  }
396
- function le(f) {
397
- const r = f.split(",").map((s) => s.trim()).filter(Boolean);
398
- return r.length === 0 ? [{ key: "b1", answer: "" }] : r.map((s, M) => {
399
- const q = s.indexOf(":");
400
- if (q > 0) {
401
- const Fe = s.slice(0, q).trim() || `b${M + 1}`, ge = s.slice(q + 1).trim() || "";
397
+ function G(g) {
398
+ const r = g.split(",").map((s) => s.trim()).filter(Boolean);
399
+ return r.length === 0 ? [{ key: "b1", answer: "" }] : r.map((s, _) => {
400
+ const E = s.indexOf(":");
401
+ if (E > 0) {
402
+ const Fe = s.slice(0, E).trim() || `b${_ + 1}`, ge = s.slice(E + 1).trim() || "";
402
403
  return { key: Fe, answer: ge };
403
404
  }
404
- return { key: `b${M + 1}`, answer: s };
405
+ return { key: `b${_ + 1}`, answer: s };
405
406
  });
406
407
  }
407
- function j(f) {
408
- const r = f.map((s) => ({ key: s.key.trim(), answer: s.answer.trim() })).filter((s) => s.key);
408
+ function ee(g) {
409
+ const r = g.map((s) => ({ key: s.key.trim(), answer: s.answer.trim() })).filter((s) => s.key);
409
410
  return r.length === 0 ? "b1:" : r.map((s) => `${s.key}:${s.answer}`).join(", ");
410
411
  }
411
- function O(f) {
412
- return f.split(",").map((r) => r.trim()).filter(Boolean);
412
+ function Q(g) {
413
+ return g.split(",").map((r) => r.trim()).filter(Boolean);
413
414
  }
414
- function K() {
415
- u.value === "quiz" && (l.value.quizType === "choice" ? (c.value = I(l.value.options || ""), d.value = O(l.value.answer || "")) : l.value.quizType === "blank" && (_.value = le(l.value.blanks || "")));
415
+ function j() {
416
+ u.value === "quiz" && (l.value.quizType === "choice" ? (c.value = F(l.value.options || ""), d.value = Q(l.value.answer || "")) : l.value.quizType === "blank" && (T.value = G(l.value.blanks || "")));
416
417
  }
417
- function X() {
418
+ function O() {
418
419
  if (u.value !== "quiz" || l.value.quizType !== "choice") return;
419
- const f = new Set(
420
+ const g = new Set(
420
421
  c.value.map((r) => r.key.trim()).filter(Boolean)
421
422
  );
422
423
  if (l.value.mode === "multiple") {
423
- const r = d.value.map((s) => s.trim()).filter((s) => s && f.has(s));
424
+ const r = d.value.map((s) => s.trim()).filter((s) => s && g.has(s));
424
425
  r.length !== d.value.length && (d.value = r);
425
426
  } else {
426
427
  const r = (l.value.answer || "").trim();
427
- r && !f.has(r) && (l.value.answer = "");
428
+ r && !g.has(r) && (l.value.answer = "");
428
429
  }
429
430
  }
430
- function se() {
431
- const f = new Set(
431
+ function K() {
432
+ const g = new Set(
432
433
  c.value.map((r) => r.key.trim().toUpperCase()).filter(Boolean)
433
434
  );
434
435
  for (let r = 0; r < 26; r++) {
435
436
  const s = String.fromCharCode(65 + r);
436
- if (!f.has(s)) return s;
437
+ if (!g.has(s)) return s;
437
438
  }
438
439
  return `K${c.value.length + 1}`;
439
440
  }
440
- function T() {
441
- const f = se();
442
- c.value.push({ key: f, text: "" });
441
+ function ae() {
442
+ const g = K();
443
+ c.value.push({ key: g, text: "" });
443
444
  }
444
- function z(f) {
445
- c.value.length <= 1 || c.value.splice(f, 1);
445
+ function le(g) {
446
+ c.value.length <= 1 || c.value.splice(g, 1);
446
447
  }
447
- function H(f) {
448
- k.value = f, S.value = f;
448
+ function se(g) {
449
+ M.value = g, V.value = g;
449
450
  }
450
- function J(f) {
451
- k.value !== null && (S.value = f);
451
+ function x(g) {
452
+ M.value !== null && (V.value = g);
452
453
  }
453
- function x(f) {
454
- const r = k.value;
455
- if (r === null || r === f) {
456
- k.value = null, S.value = null;
454
+ function f(g) {
455
+ const r = M.value;
456
+ if (r === null || r === g) {
457
+ M.value = null, V.value = null;
457
458
  return;
458
459
  }
459
460
  const s = c.value.splice(r, 1)[0];
460
- c.value.splice(f, 0, s), k.value = null, S.value = null;
461
+ c.value.splice(g, 0, s), M.value = null, V.value = null;
461
462
  }
462
- function w() {
463
- k.value = null, S.value = null;
463
+ function y() {
464
+ M.value = null, V.value = null;
464
465
  }
465
- function $() {
466
- const f = new Set(
467
- _.value.map((s) => s.key.trim().toLowerCase()).filter(Boolean)
466
+ function C() {
467
+ const g = new Set(
468
+ T.value.map((s) => s.key.trim().toLowerCase()).filter(Boolean)
468
469
  );
469
470
  let r = 1;
470
- for (; f.has(`b${r}`); )
471
+ for (; g.has(`b${r}`); )
471
472
  r += 1;
472
473
  return `b${r}`;
473
474
  }
474
- function Q() {
475
- _.value.push({ key: $(), answer: "" });
475
+ function R() {
476
+ T.value.push({ key: C(), answer: "" });
476
477
  }
477
- function Z(f) {
478
- _.value.length <= 1 || _.value.splice(f, 1);
478
+ function H(g) {
479
+ T.value.length <= 1 || T.value.splice(g, 1);
479
480
  }
480
- function te(f) {
481
+ function X(g) {
481
482
  const r = /* @__PURE__ */ new Set(), s = [];
482
- for (const M of f)
483
- r.has(M) && !s.includes(M) && s.push(M), r.add(M);
483
+ for (const _ of g)
484
+ r.has(_) && !s.includes(_) && s.push(_), r.add(_);
484
485
  return s;
485
486
  }
486
- function re(f) {
487
+ function oe(g) {
487
488
  const r = [], s = /\[\[([^\[\]\s]+)\]\]/g;
488
- for (const M of f.matchAll(s))
489
- r.push(M[1]);
489
+ for (const _ of g.matchAll(s))
490
+ r.push(_[1]);
490
491
  return r;
491
492
  }
492
- function ne() {
493
- const f = _.value.map((Ae) => Ae.key.trim()).filter(Boolean);
494
- if (f.length === 0)
493
+ function ie() {
494
+ const g = T.value.map((Ae) => Ae.key.trim()).filter(Boolean);
495
+ if (g.length === 0)
495
496
  return t.messages.errors.blankQuizRequiresBlankKey;
496
- const r = te(f);
497
+ const r = X(g);
497
498
  if (r.length > 0)
498
499
  return t.messages.errors.blankKeysMustBeUnique(r);
499
- const s = l.value.stem || "", M = re(s);
500
- if (M.length === 0)
500
+ const s = l.value.stem || "", _ = oe(s);
501
+ if (_.length === 0)
501
502
  return t.messages.errors.blankStemRequiresPlaceholders;
502
- const q = te(M);
503
- if (q.length > 0)
504
- return t.messages.errors.duplicatePlaceholders(q);
505
- const Fe = new Set(f), ge = new Set(M), Be = [...ge].filter((Ae) => !Fe.has(Ae));
503
+ const E = X(_);
504
+ if (E.length > 0)
505
+ return t.messages.errors.duplicatePlaceholders(E);
506
+ const Fe = new Set(g), ge = new Set(_), Be = [...ge].filter((Ae) => !Fe.has(Ae));
506
507
  if (Be.length > 0)
507
508
  return t.messages.errors.undefinedPlaceholders(Be);
508
509
  const st = [...Fe].filter((Ae) => !ge.has(Ae));
509
510
  return st.length > 0 ? t.messages.errors.missingPlaceholders(st) : null;
510
511
  }
511
512
  function fe() {
512
- return u.value !== "quiz" || l.value.quizType !== "blank" ? null : ne();
513
- }
514
- ee(() => t.initialType, (f) => {
515
- const r = v(f);
516
- u.value = r, l.value = ze(r, t.messages, p.value), K(), V.value = "";
517
- }), ee(o, () => {
518
- const f = v(u.value);
519
- f !== u.value && (u.value = f, l.value = ze(f, t.messages, p.value), K(), V.value = "");
520
- }), ee(() => t.visible, (f) => {
521
- f && (l.value = ze(u.value, t.messages, p.value), K(), V.value = "");
513
+ return u.value !== "quiz" || l.value.quizType !== "blank" ? null : ie();
514
+ }
515
+ Z(() => t.initialType, (g) => {
516
+ const r = v(g);
517
+ u.value = r, l.value = ze(r, t.messages, p.value), j(), z.value = "";
518
+ }), Z(o, () => {
519
+ const g = v(u.value);
520
+ g !== u.value && (u.value = g, l.value = ze(g, t.messages, p.value), j(), z.value = "");
521
+ }), Z(() => t.visible, (g) => {
522
+ g && (l.value = ze(u.value, t.messages, p.value), j(), z.value = "");
522
523
  });
523
- function de(f) {
524
- const r = v(f);
525
- u.value = r, l.value = ze(r, t.messages, p.value), K(), V.value = "";
526
- }
527
- const xe = B(() => ut(u.value, l.value, t.messages));
528
- function Ke(f) {
529
- return o.value.find((r) => r.type === f) || { type: f, label: f, icon: "?", svgIcon: "", desc: "", color: "#666" };
530
- }
531
- const Ce = B(() => Ke(u.value)), $e = B(() => t.refSuggestions ? t.refSuggestions : []), We = B(() => u.value === "ref_step" ? t.messages.dialog.referencedStepId : u.value === "ref_var" ? t.messages.dialog.referencedVariableId : t.messages.dialog.referencedFigureId), Qe = B(() => u.value === "ref_step" ? "step_id" : u.value === "ref_var" ? "var_id" : "fig_id");
532
- ee(() => [u.value, l.value.quizType], ([f, r], [s, M]) => {
533
- f === "quiz" && (f !== s || r !== M) && (r !== M && M && (l.value.id = C(r, p.value), r === "choice" ? (l.value.stem = t.messages.defaults.questionStem, l.value.mode = "single", l.value.options = "A:, B:", l.value.answer = "A", l.value.blanks = "", l.value.rubric = "") : r === "blank" ? (l.value.stem = t.messages.defaults.fillQuestionStem, l.value.blanks = "b1:", l.value.options = "", l.value.answer = "", l.value.mode = "", l.value.rubric = "", _.value = [{ key: "b1", answer: "" }]) : r === "open" && (l.value.stem = t.messages.defaults.fillQuestionStem, l.value.rubric = "", l.value.options = "", l.value.answer = "", l.value.blanks = "", l.value.mode = "")), K());
534
- }), ee(() => l.value.mode, () => {
535
- X();
536
- }), ee(c, (f) => {
537
- u.value === "quiz" && l.value.quizType === "choice" && (l.value.options = W(f), X());
538
- }, { deep: !0 }), ee(_, (f) => {
539
- u.value === "quiz" && l.value.quizType === "blank" && (l.value.blanks = j(f));
540
- }, { deep: !0 }), ee(d, (f) => {
541
- u.value === "quiz" && l.value.quizType === "choice" && l.value.mode === "multiple" && (l.value.answer = f.join(", "));
542
- }, { deep: !0 }), ee(l, () => {
543
- V.value && (V.value = "");
544
- }, { deep: !0 }), ee(_, () => {
545
- V.value && (V.value = "");
524
+ function de(g) {
525
+ const r = v(g);
526
+ u.value = r, l.value = ze(r, t.messages, p.value), j(), z.value = "";
527
+ }
528
+ const Te = q(() => ut(u.value, l.value, t.messages));
529
+ function Ke(g) {
530
+ return o.value.find((r) => r.type === g) || { type: g, label: g, icon: "?", svgIcon: "", desc: "", color: "#666" };
531
+ }
532
+ const Ce = q(() => Ke(u.value)), $e = q(() => t.refSuggestions ? t.refSuggestions : []), We = q(() => u.value === "ref_step" ? t.messages.dialog.referencedStepId : u.value === "ref_var" ? t.messages.dialog.referencedVariableId : t.messages.dialog.referencedFigureId), Qe = q(() => u.value === "ref_step" ? "step_id" : u.value === "ref_var" ? "var_id" : "fig_id");
533
+ Z(() => [u.value, l.value.quizType], ([g, r], [s, _]) => {
534
+ g === "quiz" && (g !== s || r !== _) && (r !== _ && _ && (l.value.id = $(r, p.value), r === "choice" ? (l.value.stem = t.messages.defaults.questionStem, l.value.mode = "single", l.value.options = "A:, B:", l.value.answer = "A", l.value.blanks = "", l.value.rubric = "") : r === "blank" ? (l.value.stem = t.messages.defaults.fillQuestionStem, l.value.blanks = "b1:", l.value.options = "", l.value.answer = "", l.value.mode = "", l.value.rubric = "", T.value = [{ key: "b1", answer: "" }]) : r === "open" && (l.value.stem = t.messages.defaults.fillQuestionStem, l.value.rubric = "", l.value.options = "", l.value.answer = "", l.value.blanks = "", l.value.mode = "")), j());
535
+ }), Z(() => l.value.mode, () => {
536
+ O();
537
+ }), Z(c, (g) => {
538
+ u.value === "quiz" && l.value.quizType === "choice" && (l.value.options = W(g), O());
539
+ }, { deep: !0 }), Z(T, (g) => {
540
+ u.value === "quiz" && l.value.quizType === "blank" && (l.value.blanks = ee(g));
541
+ }, { deep: !0 }), Z(d, (g) => {
542
+ u.value === "quiz" && l.value.quizType === "choice" && l.value.mode === "multiple" && (l.value.answer = g.join(", "));
543
+ }, { deep: !0 }), Z(l, () => {
544
+ z.value && (z.value = "");
545
+ }, { deep: !0 }), Z(T, () => {
546
+ z.value && (z.value = "");
546
547
  }, { deep: !0 });
547
548
  function Je() {
548
- const f = fe();
549
- if (f) {
550
- V.value = f;
549
+ const g = fe();
550
+ if (g) {
551
+ z.value = g;
551
552
  return;
552
553
  }
553
- V.value = "", a("insert", ut(u.value, l.value, t.messages)), a("update:visible", !1);
554
+ z.value = "", a("insert", ut(u.value, l.value, t.messages)), a("update:visible", !1);
554
555
  }
555
556
  function Ie() {
556
557
  a("update:visible", !1);
557
558
  }
558
- return (f, r) => (g(), me(Oe, { to: "body" }, [
559
- e.visible ? (g(), h("div", {
559
+ return (g, r) => (h(), me(Oe, { to: "body" }, [
560
+ e.visible ? (h(), b("div", {
560
561
  key: 0,
561
562
  class: "aimd-dialog-overlay",
562
- onClick: ae(Ie, ["self"])
563
+ onClick: ne(Ie, ["self"])
563
564
  }, [
564
- i("div", tl, [
565
- i("div", ll, [
566
- i("span", sl, [
565
+ i("div", ll, [
566
+ i("div", sl, [
567
+ i("span", il, [
567
568
  i("span", {
568
569
  class: "aimd-dialog-icon",
569
570
  style: Ue({ color: Ce.value.color }),
570
571
  innerHTML: Ce.value.svgIcon
571
- }, null, 12, il),
572
- U(" " + m(t.messages.dialog.title(Ce.value.label)), 1)
572
+ }, null, 12, nl),
573
+ L(" " + m(t.messages.dialog.title(Ce.value.label)), 1)
573
574
  ]),
574
575
  i("button", {
575
576
  class: "aimd-dialog-close",
576
577
  onClick: Ie
577
578
  }, "×")
578
579
  ]),
579
- i("div", nl, [
580
- (g(!0), h(R, null, Y(o.value, (s) => (g(), h("button", {
580
+ i("div", al, [
581
+ (h(!0), b(U, null, J(o.value, (s) => (h(), b("button", {
581
582
  key: s.type,
582
583
  class: ye(["aimd-type-tab", { active: u.value === s.type }]),
583
584
  style: Ue(u.value === s.type ? { borderColor: s.color, color: s.color, background: `${s.color}14` } : {}),
584
- onClick: (M) => de(s.type)
585
+ onClick: (_) => de(s.type)
585
586
  }, [
586
587
  i("span", {
587
588
  innerHTML: s.svgIcon,
588
589
  class: "aimd-type-tab-icon"
589
- }, null, 8, ol),
590
- U(" " + m(s.label), 1)
591
- ], 14, al))), 128))
590
+ }, null, 8, ul),
591
+ L(" " + m(s.label), 1)
592
+ ], 14, ol))), 128))
592
593
  ]),
593
- i("div", ul, [
594
- u.value === "var" ? (g(), h(R, { key: 0 }, [
595
- i("label", rl, [
596
- i("span", dl, [
597
- U(m(t.messages.dialog.variableId) + " ", 1),
594
+ i("div", rl, [
595
+ u.value === "var" ? (h(), b(U, { key: 0 }, [
596
+ i("label", dl, [
597
+ i("span", cl, [
598
+ L(m(t.messages.dialog.variableId) + " ", 1),
598
599
  r[22] || (r[22] = i("em", null, "*", -1))
599
600
  ]),
600
601
  D(i("input", {
601
602
  "onUpdate:modelValue": r[0] || (r[0] = (s) => l.value.name = s),
602
603
  placeholder: t.messages.placeholders.variableId,
603
604
  class: "aimd-field-input"
604
- }, null, 8, cl), [
605
- [L, l.value.name]
605
+ }, null, 8, vl), [
606
+ [P, l.value.name]
606
607
  ])
607
608
  ]),
608
- i("div", vl, [
609
- i("span", ml, m(t.messages.dialog.typePresetLabel), 1),
610
- i("span", pl, m(t.messages.dialog.typeHint), 1),
611
- i("div", fl, [
612
- (g(!0), h(R, null, Y(y.value, (s) => (g(), h("button", {
609
+ i("div", ml, [
610
+ i("span", pl, m(t.messages.dialog.typePresetLabel), 1),
611
+ i("span", fl, m(t.messages.dialog.typeHint), 1),
612
+ i("div", gl, [
613
+ (h(!0), b(U, null, J(k.value, (s) => (h(), b("button", {
613
614
  key: s.key,
614
615
  type: "button",
615
- class: ye(["aimd-var-type-card", { active: A(s.value) }]),
616
- onClick: (M) => E(s.value)
616
+ class: ye(["aimd-var-type-card", { active: I(s.value) }]),
617
+ onClick: (_) => S(s.value)
617
618
  }, [
618
- i("span", hl, m(s.label), 1),
619
- i("span", yl, m(s.desc), 1)
620
- ], 10, gl))), 128))
619
+ i("span", yl, m(s.label), 1),
620
+ i("span", bl, m(s.desc), 1)
621
+ ], 10, hl))), 128))
621
622
  ])
622
623
  ]),
623
- oe(bt, {
624
+ ue(bt, {
624
625
  modelValue: l.value.type,
625
626
  "onUpdate:modelValue": r[1] || (r[1] = (s) => l.value.type = s),
626
627
  messages: e.messages,
627
628
  "var-type-plugins": e.varTypePlugins
628
629
  }, null, 8, ["modelValue", "messages", "var-type-plugins"]),
629
- i("label", bl, [
630
- i("span", kl, m(t.messages.dialog.defaultValue), 1),
630
+ i("label", kl, [
631
+ i("span", wl, m(t.messages.dialog.defaultValue), 1),
631
632
  D(i("input", {
632
633
  "onUpdate:modelValue": r[2] || (r[2] = (s) => l.value.default = s),
633
634
  placeholder: t.messages.placeholders.defaultValue,
634
635
  class: "aimd-field-input"
635
- }, null, 8, wl), [
636
- [L, l.value.default]
636
+ }, null, 8, Ml), [
637
+ [P, l.value.default]
637
638
  ])
638
639
  ]),
639
- i("label", Ml, [
640
- i("span", _l, m(t.messages.dialog.titleLabel), 1),
640
+ i("label", _l, [
641
+ i("span", xl, m(t.messages.dialog.titleLabel), 1),
641
642
  D(i("input", {
642
643
  "onUpdate:modelValue": r[3] || (r[3] = (s) => l.value.title = s),
643
644
  placeholder: t.messages.placeholders.title,
644
645
  class: "aimd-field-input"
645
646
  }, null, 8, Tl), [
646
- [L, l.value.title]
647
+ [P, l.value.title]
647
648
  ])
648
649
  ])
649
- ], 64)) : N("", !0),
650
- u.value === "var_table" ? (g(), h(R, { key: 1 }, [
651
- i("label", xl, [
652
- i("span", Cl, [
653
- U(m(t.messages.dialog.tableId) + " ", 1),
650
+ ], 64)) : B("", !0),
651
+ u.value === "var_table" ? (h(), b(U, { key: 1 }, [
652
+ i("label", Cl, [
653
+ i("span", $l, [
654
+ L(m(t.messages.dialog.tableId) + " ", 1),
654
655
  r[23] || (r[23] = i("em", null, "*", -1))
655
656
  ]),
656
657
  D(i("input", {
657
658
  "onUpdate:modelValue": r[4] || (r[4] = (s) => l.value.name = s),
658
659
  placeholder: t.messages.placeholders.tableId,
659
660
  class: "aimd-field-input"
660
- }, null, 8, $l), [
661
- [L, l.value.name]
661
+ }, null, 8, Il), [
662
+ [P, l.value.name]
662
663
  ])
663
664
  ]),
664
- i("label", Il, [
665
- i("span", Fl, m(t.messages.dialog.subVariableColumns), 1),
665
+ i("label", Fl, [
666
+ i("span", Al, m(t.messages.dialog.subVariableColumns), 1),
666
667
  D(i("input", {
667
668
  "onUpdate:modelValue": r[5] || (r[5] = (s) => l.value.subvars = s),
668
669
  placeholder: t.messages.placeholders.subVariableColumns,
669
670
  class: "aimd-field-input"
670
- }, null, 8, Al), [
671
- [L, l.value.subvars]
671
+ }, null, 8, zl), [
672
+ [P, l.value.subvars]
672
673
  ]),
673
- i("span", zl, m(t.messages.dialog.subVariableColumnsHint), 1)
674
+ i("span", Vl, m(t.messages.dialog.subVariableColumnsHint), 1)
674
675
  ])
675
- ], 64)) : N("", !0),
676
- u.value === "step" ? (g(), h(R, { key: 2 }, [
677
- i("label", Vl, [
676
+ ], 64)) : B("", !0),
677
+ u.value === "step" ? (h(), b(U, { key: 2 }, [
678
+ i("label", Dl, [
678
679
  i("span", Sl, m(t.messages.stepField.name), 1),
679
680
  D(i("input", {
680
681
  "onUpdate:modelValue": r[6] || (r[6] = (s) => l.value.title = s),
681
682
  class: "aimd-field-input"
682
683
  }, null, 512), [
683
- [L, l.value.title]
684
+ [P, l.value.title]
684
685
  ])
685
686
  ]),
686
- i("label", Dl, [
687
- i("span", El, [
688
- U(m(t.messages.dialog.stepId) + " ", 1),
687
+ i("label", El, [
688
+ i("span", ql, [
689
+ L(m(t.messages.dialog.stepId) + " ", 1),
689
690
  r[24] || (r[24] = i("em", null, "*", -1))
690
691
  ]),
691
692
  D(i("input", {
692
693
  "onUpdate:modelValue": r[7] || (r[7] = (s) => l.value.name = s),
693
694
  placeholder: t.messages.placeholders.stepId,
694
695
  class: "aimd-field-input"
695
- }, null, 8, ql), [
696
- [L, l.value.name]
696
+ }, null, 8, Bl), [
697
+ [P, l.value.name]
697
698
  ])
698
699
  ]),
699
- i("label", Bl, [
700
- i("span", Nl, m(t.messages.dialog.level), 1),
700
+ i("label", Nl, [
701
+ i("span", Pl, m(t.messages.dialog.level), 1),
701
702
  D(i("select", {
702
703
  "onUpdate:modelValue": r[8] || (r[8] = (s) => l.value.level = s),
703
704
  class: "aimd-field-input"
704
705
  }, [
705
- i("option", Pl, m(t.messages.dialog.level1), 1),
706
- i("option", Ll, m(t.messages.dialog.level2), 1),
707
- i("option", Ul, m(t.messages.dialog.level3), 1)
706
+ i("option", Ll, m(t.messages.dialog.level1), 1),
707
+ i("option", Ul, m(t.messages.dialog.level2), 1),
708
+ i("option", Rl, m(t.messages.dialog.level3), 1)
708
709
  ], 512), [
709
710
  [be, l.value.level]
710
711
  ])
711
712
  ])
712
- ], 64)) : N("", !0),
713
- u.value === "quiz" ? (g(), h(R, { key: 3 }, [
714
- i("label", Rl, [
715
- i("span", Ol, [
716
- U(m(t.messages.dialog.quizId) + " ", 1),
713
+ ], 64)) : B("", !0),
714
+ u.value === "quiz" ? (h(), b(U, { key: 3 }, [
715
+ i("label", Ol, [
716
+ i("span", Hl, [
717
+ L(m(t.messages.dialog.quizId) + " ", 1),
717
718
  r[25] || (r[25] = i("em", null, "*", -1))
718
719
  ]),
719
720
  D(i("input", {
720
721
  "onUpdate:modelValue": r[9] || (r[9] = (s) => l.value.id = s),
721
722
  placeholder: t.messages.placeholders.quizId,
722
723
  class: "aimd-field-input"
723
- }, null, 8, Hl), [
724
- [L, l.value.id]
724
+ }, null, 8, jl), [
725
+ [P, l.value.id]
725
726
  ])
726
727
  ]),
727
- i("label", jl, [
728
- i("span", Kl, m(t.messages.dialog.questionType), 1),
728
+ i("label", Kl, [
729
+ i("span", Wl, m(t.messages.dialog.questionType), 1),
729
730
  D(i("select", {
730
731
  "onUpdate:modelValue": r[10] || (r[10] = (s) => l.value.quizType = s),
731
732
  class: "aimd-field-input"
732
733
  }, [
733
- i("option", Wl, m(t.messages.quiz.types.choice), 1),
734
- i("option", Ql, m(t.messages.quiz.types.blank), 1),
735
- i("option", Jl, m(t.messages.quiz.types.open), 1)
734
+ i("option", Ql, m(t.messages.quiz.types.choice), 1),
735
+ i("option", Jl, m(t.messages.quiz.types.blank), 1),
736
+ i("option", Xl, m(t.messages.quiz.types.open), 1)
736
737
  ], 512), [
737
738
  [be, l.value.quizType]
738
739
  ])
739
740
  ]),
740
- i("label", Xl, [
741
- i("span", Yl, m(t.messages.dialog.score), 1),
741
+ i("label", Yl, [
742
+ i("span", Zl, m(t.messages.dialog.score), 1),
742
743
  D(i("input", {
743
744
  "onUpdate:modelValue": r[11] || (r[11] = (s) => l.value.score = s),
744
745
  placeholder: t.messages.placeholders.score,
745
746
  class: "aimd-field-input"
746
- }, null, 8, Zl), [
747
- [L, l.value.score]
747
+ }, null, 8, Gl), [
748
+ [P, l.value.score]
748
749
  ])
749
750
  ]),
750
- i("label", Gl, [
751
- i("span", es, [
752
- U(m(t.messages.dialog.stem) + " ", 1),
751
+ i("label", es, [
752
+ i("span", ts, [
753
+ L(m(t.messages.dialog.stem) + " ", 1),
753
754
  r[26] || (r[26] = i("em", null, "*", -1))
754
755
  ]),
755
756
  D(i("textarea", {
756
757
  "onUpdate:modelValue": r[12] || (r[12] = (s) => l.value.stem = s),
757
758
  placeholder: t.messages.placeholders.stem,
758
759
  class: "aimd-field-input aimd-field-textarea"
759
- }, null, 8, ts), [
760
- [L, l.value.stem]
760
+ }, null, 8, ls), [
761
+ [P, l.value.stem]
761
762
  ]),
762
- l.value.quizType === "blank" ? (g(), h("span", ls, m(t.messages.dialog.blankStemHint), 1)) : N("", !0)
763
+ l.value.quizType === "blank" ? (h(), b("span", ss, m(t.messages.dialog.blankStemHint), 1)) : B("", !0)
763
764
  ]),
764
- l.value.quizType === "choice" ? (g(), h(R, { key: 0 }, [
765
- i("label", ss, [
766
- i("span", is, m(t.messages.dialog.mode), 1),
765
+ l.value.quizType === "choice" ? (h(), b(U, { key: 0 }, [
766
+ i("label", is, [
767
+ i("span", ns, m(t.messages.dialog.mode), 1),
767
768
  D(i("select", {
768
769
  "onUpdate:modelValue": r[13] || (r[13] = (s) => l.value.mode = s),
769
770
  class: "aimd-field-input"
770
771
  }, [
771
- i("option", ns, m(t.messages.quiz.modes.single), 1),
772
- i("option", as, m(t.messages.quiz.modes.multiple), 1)
772
+ i("option", as, m(t.messages.quiz.modes.single), 1),
773
+ i("option", os, m(t.messages.quiz.modes.multiple), 1)
773
774
  ], 512), [
774
775
  [be, l.value.mode]
775
776
  ])
776
777
  ]),
777
- i("div", os, [
778
- i("span", us, m(t.messages.dialog.options), 1),
779
- i("div", rs, [
780
- (g(!0), h(R, null, Y(c.value, (s, M) => (g(), h("div", {
781
- key: `choice-option-${M}`,
782
- class: ye(["aimd-collection-row aimd-option-row", { "aimd-option-row-dragover": S.value === M && k.value !== null && k.value !== M }]),
783
- onDragover: ae((q) => J(M), ["prevent"]),
784
- onDrop: ae((q) => x(M), ["prevent"])
778
+ i("div", us, [
779
+ i("span", rs, m(t.messages.dialog.options), 1),
780
+ i("div", ds, [
781
+ (h(!0), b(U, null, J(c.value, (s, _) => (h(), b("div", {
782
+ key: `choice-option-${_}`,
783
+ class: ye(["aimd-collection-row aimd-option-row", { "aimd-option-row-dragover": V.value === _ && M.value !== null && M.value !== _ }]),
784
+ onDragover: ne((E) => x(_), ["prevent"]),
785
+ onDrop: ne((E) => f(_), ["prevent"])
785
786
  }, [
786
787
  i("span", {
787
788
  class: "aimd-drag-handle",
788
789
  title: t.messages.dialog.dragToReorder,
789
790
  draggable: "true",
790
- onDragstart: (q) => H(M),
791
- onDragend: w
792
- }, " ⋮⋮ ", 40, cs),
791
+ onDragstart: (E) => se(_),
792
+ onDragend: y
793
+ }, " ⋮⋮ ", 40, vs),
793
794
  D(i("input", {
794
- "onUpdate:modelValue": (q) => s.key = q,
795
+ "onUpdate:modelValue": (E) => s.key = E,
795
796
  placeholder: t.messages.placeholders.optionKey,
796
797
  class: "aimd-field-input"
797
- }, null, 8, vs), [
798
- [L, s.key]
798
+ }, null, 8, ms), [
799
+ [P, s.key]
799
800
  ]),
800
801
  D(i("input", {
801
- "onUpdate:modelValue": (q) => s.text = q,
802
+ "onUpdate:modelValue": (E) => s.text = E,
802
803
  placeholder: t.messages.placeholders.optionText,
803
804
  class: "aimd-field-input"
804
- }, null, 8, ms), [
805
- [L, s.text]
805
+ }, null, 8, ps), [
806
+ [P, s.text]
806
807
  ]),
807
- i("label", ps, [
808
- l.value.mode === "single" ? D((g(), h("input", {
808
+ i("label", fs, [
809
+ l.value.mode === "single" ? D((h(), b("input", {
809
810
  key: 0,
810
- "onUpdate:modelValue": r[14] || (r[14] = (q) => l.value.answer = q),
811
+ "onUpdate:modelValue": r[14] || (r[14] = (E) => l.value.answer = E),
811
812
  type: "radio",
812
813
  name: "aimd-quiz-choice-answer",
813
814
  value: s.key.trim(),
814
815
  disabled: !s.key.trim()
815
- }, null, 8, fs)), [
816
+ }, null, 8, gs)), [
816
817
  [kt, l.value.answer]
817
- ]) : D((g(), h("input", {
818
+ ]) : D((h(), b("input", {
818
819
  key: 1,
819
- "onUpdate:modelValue": r[15] || (r[15] = (q) => d.value = q),
820
+ "onUpdate:modelValue": r[15] || (r[15] = (E) => d.value = E),
820
821
  type: "checkbox",
821
822
  value: s.key.trim(),
822
823
  disabled: !s.key.trim()
823
- }, null, 8, gs)), [
824
+ }, null, 8, hs)), [
824
825
  [pt, d.value]
825
826
  ]),
826
827
  i("span", null, m(t.messages.dialog.correctAnswer), 1)
@@ -829,76 +830,76 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
829
830
  type: "button",
830
831
  class: "aimd-mini-btn",
831
832
  disabled: c.value.length <= 1,
832
- onClick: (q) => z(M)
833
- }, m(t.messages.common.remove), 9, hs)
834
- ], 42, ds))), 128)),
833
+ onClick: (E) => le(_)
834
+ }, m(t.messages.common.remove), 9, ys)
835
+ ], 42, cs))), 128)),
835
836
  i("button", {
836
837
  type: "button",
837
838
  class: "aimd-mini-btn aimd-mini-btn-add",
838
- onClick: T
839
+ onClick: ae
839
840
  }, m(t.messages.actions.addOption), 1)
840
841
  ]),
841
- i("span", ys, m(t.messages.dialog.optionsHint), 1)
842
+ i("span", bs, m(t.messages.dialog.optionsHint), 1)
842
843
  ])
843
- ], 64)) : l.value.quizType === "blank" ? (g(), h("div", bs, [
844
- i("span", ks, m(t.messages.dialog.blanks), 1),
845
- i("div", ws, [
846
- (g(!0), h(R, null, Y(_.value, (s, M) => (g(), h("div", {
847
- key: `blank-item-${M}`,
844
+ ], 64)) : l.value.quizType === "blank" ? (h(), b("div", ks, [
845
+ i("span", ws, m(t.messages.dialog.blanks), 1),
846
+ i("div", Ms, [
847
+ (h(!0), b(U, null, J(T.value, (s, _) => (h(), b("div", {
848
+ key: `blank-item-${_}`,
848
849
  class: "aimd-collection-row"
849
850
  }, [
850
851
  D(i("input", {
851
- "onUpdate:modelValue": (q) => s.key = q,
852
+ "onUpdate:modelValue": (E) => s.key = E,
852
853
  placeholder: t.messages.placeholders.blankKey,
853
854
  class: "aimd-field-input"
854
- }, null, 8, Ms), [
855
- [L, s.key]
855
+ }, null, 8, _s), [
856
+ [P, s.key]
856
857
  ]),
857
858
  D(i("input", {
858
- "onUpdate:modelValue": (q) => s.answer = q,
859
+ "onUpdate:modelValue": (E) => s.answer = E,
859
860
  placeholder: t.messages.placeholders.blankAnswer,
860
861
  class: "aimd-field-input"
861
- }, null, 8, _s), [
862
- [L, s.answer]
862
+ }, null, 8, xs), [
863
+ [P, s.answer]
863
864
  ]),
864
865
  i("button", {
865
866
  type: "button",
866
867
  class: "aimd-mini-btn",
867
- disabled: _.value.length <= 1,
868
- onClick: (q) => Z(M)
868
+ disabled: T.value.length <= 1,
869
+ onClick: (E) => H(_)
869
870
  }, m(t.messages.common.remove), 9, Ts)
870
871
  ]))), 128)),
871
872
  i("button", {
872
873
  type: "button",
873
874
  class: "aimd-mini-btn aimd-mini-btn-add",
874
- onClick: Q
875
+ onClick: R
875
876
  }, m(t.messages.actions.addBlank), 1)
876
877
  ]),
877
- i("span", xs, m(t.messages.dialog.blanksHint), 1)
878
- ])) : (g(), h("label", Cs, [
879
- i("span", $s, m(t.messages.dialog.rubric), 1),
878
+ i("span", Cs, m(t.messages.dialog.blanksHint), 1)
879
+ ])) : (h(), b("label", $s, [
880
+ i("span", Is, m(t.messages.dialog.rubric), 1),
880
881
  D(i("textarea", {
881
882
  "onUpdate:modelValue": r[16] || (r[16] = (s) => l.value.rubric = s),
882
883
  placeholder: t.messages.placeholders.rubric,
883
884
  class: "aimd-field-input aimd-field-textarea"
884
- }, null, 8, Is), [
885
- [L, l.value.rubric]
885
+ }, null, 8, Fs), [
886
+ [P, l.value.rubric]
886
887
  ])
887
888
  ]))
888
- ], 64)) : N("", !0),
889
- u.value === "check" ? (g(), h(R, { key: 4 }, [
890
- i("label", Fs, [
891
- i("span", As, m(t.messages.checkField.name), 1),
889
+ ], 64)) : B("", !0),
890
+ u.value === "check" ? (h(), b(U, { key: 4 }, [
891
+ i("label", As, [
892
+ i("span", zs, m(t.messages.checkField.name), 1),
892
893
  D(i("input", {
893
894
  "onUpdate:modelValue": r[17] || (r[17] = (s) => l.value.title = s),
894
895
  class: "aimd-field-input"
895
896
  }, null, 512), [
896
- [L, l.value.title]
897
+ [P, l.value.title]
897
898
  ])
898
899
  ]),
899
- i("label", zs, [
900
- i("span", Vs, [
901
- U(m(t.messages.dialog.checkpointId) + " ", 1),
900
+ i("label", Vs, [
901
+ i("span", Ds, [
902
+ L(m(t.messages.dialog.checkpointId) + " ", 1),
902
903
  r[27] || (r[27] = i("em", null, "*", -1))
903
904
  ]),
904
905
  D(i("input", {
@@ -906,22 +907,22 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
906
907
  placeholder: t.messages.placeholders.checkpointId,
907
908
  class: "aimd-field-input"
908
909
  }, null, 8, Ss), [
909
- [L, l.value.name]
910
+ [P, l.value.name]
910
911
  ])
911
912
  ]),
912
- i("label", Ds, [
913
- i("span", Es, m(t.messages.checkField.checkedMessage), 1),
913
+ i("label", Es, [
914
+ i("span", qs, m(t.messages.checkField.checkedMessage), 1),
914
915
  D(i("input", {
915
916
  "onUpdate:modelValue": r[19] || (r[19] = (s) => l.value.checkedMessage = s),
916
917
  class: "aimd-field-input"
917
918
  }, null, 512), [
918
- [L, l.value.checkedMessage]
919
+ [P, l.value.checkedMessage]
919
920
  ])
920
921
  ])
921
- ], 64)) : N("", !0),
922
- ["ref_step", "ref_var", "ref_fig"].includes(u.value) ? (g(), h("label", qs, [
923
- i("span", Bs, [
924
- U(m(We.value) + " ", 1),
922
+ ], 64)) : B("", !0),
923
+ ["ref_step", "ref_var", "ref_fig"].includes(u.value) ? (h(), b("label", Bs, [
924
+ i("span", Ns, [
925
+ L(m(We.value) + " ", 1),
925
926
  r[28] || (r[28] = i("em", null, "*", -1))
926
927
  ]),
927
928
  D(i("input", {
@@ -929,40 +930,40 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
929
930
  placeholder: Qe.value,
930
931
  class: "aimd-field-input",
931
932
  list: "aimd-ref-suggestions"
932
- }, null, 8, Ns), [
933
- [L, l.value.name]
933
+ }, null, 8, Ps), [
934
+ [P, l.value.name]
934
935
  ]),
935
- i("datalist", Ps, [
936
- (g(!0), h(R, null, Y($e.value, (s) => (g(), h("option", {
936
+ i("datalist", Ls, [
937
+ (h(!0), b(U, null, J($e.value, (s) => (h(), b("option", {
937
938
  key: s,
938
939
  value: s
939
- }, null, 8, Ls))), 128))
940
+ }, null, 8, Us))), 128))
940
941
  ]),
941
- $e.value.length ? (g(), h("span", Us, m(t.messages.common.available) + ": " + m($e.value.join(", ")), 1)) : N("", !0)
942
- ])) : N("", !0),
943
- u.value === "cite" ? (g(), h("label", Rs, [
944
- i("span", Os, [
945
- U(m(t.messages.dialog.citationId) + " ", 1),
942
+ $e.value.length ? (h(), b("span", Rs, m(t.messages.common.available) + ": " + m($e.value.join(", ")), 1)) : B("", !0)
943
+ ])) : B("", !0),
944
+ u.value === "cite" ? (h(), b("label", Os, [
945
+ i("span", Hs, [
946
+ L(m(t.messages.dialog.citationId) + " ", 1),
946
947
  r[29] || (r[29] = i("em", null, "*", -1))
947
948
  ]),
948
949
  D(i("input", {
949
950
  "onUpdate:modelValue": r[21] || (r[21] = (s) => l.value.refs = s),
950
951
  placeholder: t.messages.placeholders.citationIds,
951
952
  class: "aimd-field-input"
952
- }, null, 8, Hs), [
953
- [L, l.value.refs]
953
+ }, null, 8, js), [
954
+ [P, l.value.refs]
954
955
  ]),
955
- i("span", js, m(t.messages.dialog.citationHint), 1)
956
- ])) : N("", !0),
957
- i("div", Ks, [
958
- i("div", Ws, m(t.messages.common.preview), 1),
959
- i("pre", Qs, [
960
- i("code", Js, m(xe.value), 1)
956
+ i("span", Ks, m(t.messages.dialog.citationHint), 1)
957
+ ])) : B("", !0),
958
+ i("div", Ws, [
959
+ i("div", Qs, m(t.messages.common.preview), 1),
960
+ i("pre", Js, [
961
+ i("code", Xs, m(Te.value), 1)
961
962
  ])
962
963
  ]),
963
- V.value ? (g(), h("div", Xs, m(V.value), 1)) : N("", !0)
964
+ z.value ? (h(), b("div", Ys, m(z.value), 1)) : B("", !0)
964
965
  ]),
965
- i("div", Ys, [
966
+ i("div", Zs, [
966
967
  i("button", {
967
968
  class: "aimd-btn aimd-btn-cancel",
968
969
  onClick: Ie
@@ -973,17 +974,17 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
973
974
  }, m(t.messages.common.insert), 1)
974
975
  ])
975
976
  ])
976
- ])) : N("", !0)
977
+ ])) : B("", !0)
977
978
  ]));
978
979
  }
979
- }), Gs = ["aria-label"], ei = ["value"], ti = { class: "aimd-input-dialog__required" }, li = ["checked"], si = { key: 0 }, ii = { key: 1 }, ni = ["value"], ai = ["value"], oi = ["size"], ui = ["value", "selected"], ri = { value: "" }, di = ["value"], ci = ["value", "type", "step", "placeholder"], vi = ["open"], mi = {
980
+ }), ei = ["aria-label"], ti = ["value"], li = { class: "aimd-input-dialog__required" }, si = ["checked"], ii = { key: 0 }, ni = { key: 1 }, ai = ["value"], oi = ["value"], ui = ["size"], ri = ["value", "selected"], di = { value: "" }, ci = ["value"], vi = ["value", "type", "step", "placeholder"], mi = ["open"], pi = {
980
981
  key: 3,
981
982
  class: "aimd-input-dialog__error",
982
983
  role: "alert"
983
- }, pi = {
984
+ }, fi = {
984
985
  type: "submit",
985
986
  class: "aimd-input-dialog__save"
986
- }, ce = "bool | None", Ne = "Literal[True, False]", fi = /* @__PURE__ */ pe({
987
+ }, ce = "bool | None", Ne = "Literal[True, False]", gi = /* @__PURE__ */ pe({
987
988
  __name: "AimdInputFieldDialog",
988
989
  props: {
989
990
  visible: { type: Boolean },
@@ -996,27 +997,27 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
996
997
  },
997
998
  emits: ["update:visible", "save"],
998
999
  setup(e, { emit: n }) {
999
- const t = e, a = n, o = F(), v = F(), p = F(""), u = F(""), l = F("str"), c = F(""), _ = F(""), d = F("str"), k = F(""), S = F(!1), V = F(), y = F(!1), b = B(() => V.value ?? !De(l.value)), A = B(() => _.value.split(/\r?\n/).map((x) => x.trim()).filter(Boolean)), E = B(() => /^(?:(?:typing|typing_extensions)\.)?Optional\[/.test(l.value.trim()) ? Ve(Ve(l.value, !1), !0) : ""), C = B(() => {
1000
- const x = Se(c.value);
1001
- return Array.isArray(x) ? x : [];
1000
+ const t = e, a = n, o = A(), v = A(), p = A(""), u = A(""), l = A("str"), c = A(""), T = A(""), d = A("str"), M = A(""), V = A(!1), z = A(), k = A(!1), w = q(() => z.value ?? !Se(l.value)), I = q(() => T.value.split(/\r?\n/).map((f) => f.trim()).filter(Boolean)), S = q(() => /^(?:(?:typing|typing_extensions)\.)?Optional\[/.test(l.value.trim()) ? Ve(Ve(l.value, !1), !0) : ""), $ = q(() => {
1001
+ const f = De(c.value);
1002
+ return Array.isArray(f) ? f : [];
1002
1003
  });
1003
- function I(x) {
1004
- const w = Array.from(x.target.selectedOptions, ($) => $.value);
1005
- c.value = w.length ? JSON.stringify(w) : b.value ? "" : "None";
1004
+ function F(f) {
1005
+ const y = Array.from(f.target.selectedOptions, (C) => C.value);
1006
+ c.value = y.length ? JSON.stringify(y) : w.value ? "" : "None";
1006
1007
  }
1007
- const W = B(() => d.value === ce || d.value === "bool" ? [["True", t.messages.inputField.yes], ["False", t.messages.inputField.no]] : d.value === "choice" ? A.value.map((x) => [JSON.stringify(x), x]) : []);
1008
- function le(x) {
1009
- const w = Se(x);
1010
- return W.value.find(([$]) => Object.is(Se($), w))?.[0];
1008
+ const W = q(() => d.value === ce || d.value === "bool" ? [["True", t.messages.inputField.yes], ["False", t.messages.inputField.no]] : d.value === "choice" ? I.value.map((f) => [JSON.stringify(f), f]) : []);
1009
+ function G(f) {
1010
+ const y = De(f);
1011
+ return W.value.find(([C]) => Object.is(De(C), y))?.[0];
1011
1012
  }
1012
- const j = B(() => ["str", "date", "time", "datetime"].includes(d.value)), O = B(() => d.value === "int" || d.value === "float" ? "number" : d.value === "date" || d.value === "time" ? d.value : "text"), K = B({
1013
+ const ee = q(() => ["str", "date", "time", "datetime"].includes(d.value)), Q = q(() => d.value === "int" || d.value === "float" ? "number" : d.value === "date" || d.value === "time" ? d.value : "text"), j = q({
1013
1014
  get() {
1014
- return c.value === "None" ? "" : j.value && /^(['"]).*\1$/s.test(c.value) ? String(Se(c.value)) : W.value.length && c.value ? le(c.value) ?? c.value : c.value;
1015
+ return c.value === "None" ? "" : ee.value && /^(['"]).*\1$/s.test(c.value) ? String(De(c.value)) : W.value.length && c.value ? G(c.value) ?? c.value : c.value;
1015
1016
  },
1016
- set(x) {
1017
- c.value = x === "" ? b.value ? "" : "None" : j.value ? JSON.stringify(x) : x;
1017
+ set(f) {
1018
+ c.value = f === "" ? w.value ? "" : "None" : ee.value ? JSON.stringify(f) : f;
1018
1019
  }
1019
- }), X = gt().filter((x) => lt(x)?.storage_kind === "file-id"), se = B(() => [
1020
+ }), O = gt().filter((f) => lt(f)?.storage_kind === "file-id"), K = q(() => [
1020
1021
  ["str", t.messages.inputField.text],
1021
1022
  ["int", t.messages.inputField.integer],
1022
1023
  ["float", t.messages.inputField.number],
@@ -1029,234 +1030,234 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
1029
1030
  ["datetime", t.messages.inputField.datetime],
1030
1031
  ["file", t.messages.inputField.file],
1031
1032
  ["list[str]", t.messages.inputField.list],
1032
- ...(t.varTypePlugins ?? []).map((x) => [x.value, x.label]),
1033
+ ...(t.varTypePlugins ?? []).map((f) => [f.value, f.label]),
1033
1034
  ["custom", t.messages.inputField.custom]
1034
1035
  ]);
1035
- ee(() => t.visible, async (x) => {
1036
- if (!x) {
1036
+ Z(() => t.visible, async (f) => {
1037
+ if (!f) {
1037
1038
  o.value?.close();
1038
1039
  return;
1039
1040
  }
1040
- const w = t.fieldContent ? Ze(t.fieldContent) : void 0;
1041
- p.value = w?.id ?? _e([...Te(t.content), ...t.reservedIds ?? []]), u.value = typeof w?.kwargs?.title == "string" ? w.kwargs.title : "", l.value = w?.type ?? (t.initialPreset === "file" ? "FileIdPDF" : ["choice", "multiple-choice", "custom"].includes(t.initialPreset ?? "") ? "str" : t.initialPreset ?? "str"), c.value = w?.defaultRaw ?? "", V.value = typeof w?.kwargs?.required == "boolean" ? w.kwargs.required : void 0, y.value = !1;
1042
- const $ = ve(l.value);
1043
- d.value = l.value === Ne || $ === "bool" && De(l.value) ? ce : se.value.some(([ne]) => ne === $) ? $ : "custom";
1044
- const Q = Ge(l.value), Z = Q.length ? Q : w?.enum, re = (Array.isArray(w?.kwargs?.enum) || /^(?:(?:typing|typing_extensions)\.)?(?:(?:list|List)\s*\[\s*(?:(?:typing|typing_extensions)\.)?)?Literal\s*\[/.test(ve(l.value))) && Array.isArray(Z) && Z.every((ne) => typeof ne == "string" && !ne.includes(`
1041
+ const y = t.fieldContent ? Ze(t.fieldContent) : void 0;
1042
+ p.value = y?.id ?? _e([...xe(t.content), ...t.reservedIds ?? []]), u.value = typeof y?.kwargs?.title == "string" ? y.kwargs.title : "", l.value = y?.type ?? (t.initialPreset === "file" ? "FileIdPDF" : ["choice", "multiple-choice", "custom"].includes(t.initialPreset ?? "") ? "str" : t.initialPreset ?? "str"), c.value = y?.defaultRaw ?? "", z.value = typeof y?.kwargs?.required == "boolean" ? y.kwargs.required : void 0, k.value = !1;
1043
+ const C = ve(l.value);
1044
+ d.value = l.value === Ne || C === "bool" && Se(l.value) ? ce : K.value.some(([ie]) => ie === C) ? C : "custom";
1045
+ const R = Ge(l.value), H = R.length ? R : y?.enum, oe = (Array.isArray(y?.kwargs?.enum) || /^(?:(?:typing|typing_extensions)\.)?(?:(?:list|List)\s*\[\s*(?:(?:typing|typing_extensions)\.)?)?Literal\s*\[/.test(ve(l.value))) && Array.isArray(H) && H.every((ie) => typeof ie == "string" && !ie.includes(`
1045
1046
  `));
1046
- re && (d.value = Q.length ? "multiple-choice" : "choice"), X.includes(ve(l.value)) && (d.value = "file"), !w && t.initialPreset && (d.value = t.initialPreset), !w && d.value === ce && (l.value = Ne), _.value = re ? Z.join(`
1047
- `) : "", S.value = d.value === "custom", k.value = "", await Re(), o.value?.showModal(), v.value?.focus();
1047
+ oe && (d.value = R.length ? "multiple-choice" : "choice"), O.includes(ve(l.value)) && (d.value = "file"), !y && t.initialPreset && (d.value = t.initialPreset), !y && d.value === ce && (l.value = Ne), T.value = oe ? H.join(`
1048
+ `) : "", V.value = d.value === "custom", M.value = "", await Re(), o.value?.showModal(), v.value?.focus();
1048
1049
  }, { immediate: !0 });
1049
- function T() {
1050
- const x = !b.value;
1051
- d.value === ce ? l.value = x ? ce : Ne : ["custom", "choice", "multiple-choice", "file"].includes(d.value) || (l.value = Ve(d.value, x)), d.value === "file" && !X.includes(ve(l.value)) && (l.value = Ve("FileIdPDF", x)), d.value === "custom" && (S.value = !0);
1050
+ function ae() {
1051
+ const f = !w.value;
1052
+ d.value === ce ? l.value = f ? ce : Ne : ["custom", "choice", "multiple-choice", "file"].includes(d.value) || (l.value = Ve(d.value, f)), d.value === "file" && !O.includes(ve(l.value)) && (l.value = Ve("FileIdPDF", f)), d.value === "custom" && (V.value = !0);
1052
1053
  }
1053
- function z(x) {
1054
- y.value = !0, V.value = void 0, d.value === ce ? l.value = x ? Ne : ce : l.value = Ve(l.value, !x), d.value === "bool" && !x && (d.value = ce), x && c.value === "None" && (c.value = ""), !x && !c.value.trim() && (c.value = "None");
1054
+ function le(f) {
1055
+ k.value = !0, z.value = void 0, d.value === ce ? l.value = f ? Ne : ce : l.value = Ve(l.value, !f), d.value === "bool" && !f && (d.value = ce), f && c.value === "None" && (c.value = ""), !f && !c.value.trim() && (c.value = "None");
1055
1056
  }
1056
- function H(x) {
1057
- l.value = x.target.value + (De(l.value) ? " | None" : "");
1057
+ function se(f) {
1058
+ l.value = f.target.value + (Se(l.value) ? " | None" : "");
1058
1059
  }
1059
- function J() {
1060
- const x = /* @__PURE__ */ new Set([...Te(t.content), ...t.reservedIds ?? []]), w = t.fieldContent ? Ze(t.fieldContent) : void 0, $ = w?.id, Q = p.value.trim() || _e(x);
1061
- if (!ht.test(Q)) {
1062
- k.value = t.messages.inputField.invalidId, S.value = !0;
1060
+ function x() {
1061
+ const f = /* @__PURE__ */ new Set([...xe(t.content), ...t.reservedIds ?? []]), y = t.fieldContent ? Ze(t.fieldContent) : void 0, C = y?.id, R = p.value.trim() || _e(f);
1062
+ if (!ht.test(R)) {
1063
+ M.value = t.messages.inputField.invalidId, V.value = !0;
1063
1064
  return;
1064
1065
  }
1065
- if (Q !== $ && x.has(Q)) {
1066
- k.value = t.messages.inputField.duplicateId, S.value = !0;
1066
+ if (R !== C && f.has(R)) {
1067
+ M.value = t.messages.inputField.duplicateId, V.value = !0;
1067
1068
  return;
1068
1069
  }
1069
- let Z = l.value;
1070
+ let H = l.value;
1070
1071
  if (d.value === "choice" || d.value === "multiple-choice") {
1071
- if (!A.value.length || new Set(A.value).size !== A.value.length) {
1072
- k.value = t.messages.inputField.invalidOptions;
1072
+ if (!I.value.length || new Set(I.value).size !== I.value.length) {
1073
+ M.value = t.messages.inputField.invalidOptions;
1073
1074
  return;
1074
1075
  }
1075
- Z = `Literal[${A.value.map((xe) => JSON.stringify(xe)).join(", ")}]`, d.value === "multiple-choice" && (Z = `list[${Z}]`), De(l.value) && (Z += " | None");
1076
- const de = d.value === "multiple-choice" ? Ge(w?.type) : w?.enum;
1077
- w?.type === l.value && !w?.kwargs?.enum && JSON.stringify(A.value) === JSON.stringify(de) && Ge(w.type).length > 0 == (d.value === "multiple-choice") && (Z = l.value);
1076
+ H = `Literal[${I.value.map((Te) => JSON.stringify(Te)).join(", ")}]`, d.value === "multiple-choice" && (H = `list[${H}]`), Se(l.value) && (H += " | None");
1077
+ const de = d.value === "multiple-choice" ? Ge(y?.type) : y?.enum;
1078
+ y?.type === l.value && !y?.kwargs?.enum && JSON.stringify(I.value) === JSON.stringify(de) && Ge(y.type).length > 0 == (d.value === "multiple-choice") && (H = l.value);
1078
1079
  }
1079
- const te = c.value.trim(), re = d.value === "multiple-choice" && te && te !== "None" && (!Array.isArray(Se(te)) || C.value.some((de) => !A.value.includes(de)));
1080
- if (b.value && te === "None" || W.value.length && te && te !== "None" && !le(te) || re) {
1081
- k.value = t.messages.inputField.invalidDefault;
1080
+ const X = c.value.trim(), oe = d.value === "multiple-choice" && X && X !== "None" && (!Array.isArray(De(X)) || $.value.some((de) => !I.value.includes(de)));
1081
+ if (w.value && X === "None" || W.value.length && X && X !== "None" && !G(X) || oe) {
1082
+ M.value = t.messages.inputField.invalidDefault;
1082
1083
  return;
1083
1084
  }
1084
- const ne = Bt(t.fieldContent, {
1085
- id: Q,
1086
- type: Z,
1085
+ const ie = Bt(t.fieldContent, {
1086
+ id: R,
1087
+ type: H,
1087
1088
  title: u.value,
1088
- defaultRaw: te,
1089
- clearRequiredOverride: y.value,
1090
- clearEnum: d.value === "choice" || d.value === "multiple-choice" || ve(Z) !== ve(w?.type)
1091
- }), fe = Et(Ze(ne));
1089
+ defaultRaw: X,
1090
+ clearRequiredOverride: k.value,
1091
+ clearEnum: d.value === "choice" || d.value === "multiple-choice" || ve(H) !== ve(y?.type)
1092
+ }), fe = Et(Ze(ie));
1092
1093
  if (fe.length) {
1093
- k.value = fe.join(" "), S.value = !0;
1094
+ M.value = fe.join(" "), V.value = !0;
1094
1095
  return;
1095
1096
  }
1096
- a("save", ne), a("update:visible", !1);
1097
+ a("save", ie), a("update:visible", !1);
1097
1098
  }
1098
- return (x, w) => (g(), me(Oe, { to: "body" }, [
1099
+ return (f, y) => (h(), me(Oe, { to: "body" }, [
1099
1100
  i("dialog", {
1100
1101
  ref_key: "dialog",
1101
1102
  ref: o,
1102
1103
  class: "aimd-input-dialog",
1103
1104
  "aria-label": e.fieldContent ? e.messages.inputField.edit : e.messages.inputField.insert,
1104
- onClose: w[12] || (w[12] = ($) => a("update:visible", !1)),
1105
- onCancel: w[13] || (w[13] = ($) => a("update:visible", !1))
1105
+ onClose: y[12] || (y[12] = (C) => a("update:visible", !1)),
1106
+ onCancel: y[13] || (y[13] = (C) => a("update:visible", !1))
1106
1107
  }, [
1107
1108
  i("form", {
1108
- onSubmit: ae(J, ["prevent"])
1109
+ onSubmit: ne(x, ["prevent"])
1109
1110
  }, [
1110
1111
  i("h2", null, m(e.fieldContent ? e.messages.inputField.edit : e.messages.inputField.insert), 1),
1111
1112
  i("label", null, [
1112
- U(m(e.messages.inputField.name), 1),
1113
+ L(m(e.messages.inputField.name), 1),
1113
1114
  D(i("input", {
1114
1115
  ref_key: "nameInput",
1115
1116
  ref: v,
1116
- "onUpdate:modelValue": w[0] || (w[0] = ($) => u.value = $),
1117
+ "onUpdate:modelValue": y[0] || (y[0] = (C) => u.value = C),
1117
1118
  name: "title",
1118
1119
  autocomplete: "off"
1119
1120
  }, null, 512), [
1120
- [L, u.value]
1121
+ [P, u.value]
1121
1122
  ])
1122
1123
  ]),
1123
1124
  i("label", null, [
1124
- U(m(e.messages.dialog.type) + " ", 1),
1125
+ L(m(e.messages.dialog.type) + " ", 1),
1125
1126
  D(i("select", {
1126
- "onUpdate:modelValue": w[1] || (w[1] = ($) => d.value = $),
1127
+ "onUpdate:modelValue": y[1] || (y[1] = (C) => d.value = C),
1127
1128
  name: "preset",
1128
- onChange: T
1129
+ onChange: ae
1129
1130
  }, [
1130
- (g(!0), h(R, null, Y(se.value, ([$, Q]) => (g(), h("option", {
1131
- key: $,
1132
- value: $
1133
- }, m(Q), 9, ei))), 128))
1131
+ (h(!0), b(U, null, J(K.value, ([C, R]) => (h(), b("option", {
1132
+ key: C,
1133
+ value: C
1134
+ }, m(R), 9, ti))), 128))
1134
1135
  ], 544), [
1135
1136
  [be, d.value]
1136
1137
  ])
1137
1138
  ]),
1138
- i("label", ti, [
1139
- U(m(e.messages.inputField.required) + " ", 1),
1139
+ i("label", li, [
1140
+ L(m(e.messages.inputField.required) + " ", 1),
1140
1141
  i("input", {
1141
1142
  name: "required",
1142
1143
  type: "checkbox",
1143
1144
  role: "switch",
1144
- checked: b.value,
1145
- onChange: w[2] || (w[2] = ($) => z($.target.checked))
1146
- }, null, 40, li)
1145
+ checked: w.value,
1146
+ onChange: y[2] || (y[2] = (C) => le(C.target.checked))
1147
+ }, null, 40, si)
1147
1148
  ]),
1148
- d.value === "choice" || d.value === "multiple-choice" ? (g(), h("label", si, [
1149
- U(m(e.messages.inputField.options), 1),
1149
+ d.value === "choice" || d.value === "multiple-choice" ? (h(), b("label", ii, [
1150
+ L(m(e.messages.inputField.options), 1),
1150
1151
  D(i("textarea", {
1151
- "onUpdate:modelValue": w[3] || (w[3] = ($) => _.value = $),
1152
+ "onUpdate:modelValue": y[3] || (y[3] = (C) => T.value = C),
1152
1153
  name: "options",
1153
1154
  rows: "4"
1154
1155
  }, null, 512), [
1155
- [L, _.value]
1156
+ [P, T.value]
1156
1157
  ])
1157
- ])) : N("", !0),
1158
- d.value === "file" ? (g(), h("label", ii, [
1159
- U(m(e.messages.inputField.fileFormat), 1),
1158
+ ])) : B("", !0),
1159
+ d.value === "file" ? (h(), b("label", ni, [
1160
+ L(m(e.messages.inputField.fileFormat), 1),
1160
1161
  i("select", {
1161
1162
  name: "fileType",
1162
- value: G(ve)(l.value),
1163
- onChange: H
1163
+ value: Y(ve)(l.value),
1164
+ onChange: se
1164
1165
  }, [
1165
- (g(!0), h(R, null, Y(G(X), ($) => (g(), h("option", {
1166
- key: $,
1167
- value: $
1168
- }, m($.replace(/^FileId/, "")), 9, ai))), 128))
1169
- ], 40, ni)
1170
- ])) : N("", !0),
1166
+ (h(!0), b(U, null, J(Y(O), (C) => (h(), b("option", {
1167
+ key: C,
1168
+ value: C
1169
+ }, m(C.replace(/^FileId/, "")), 9, oi))), 128))
1170
+ ], 40, ai)
1171
+ ])) : B("", !0),
1171
1172
  i("label", null, [
1172
- U(m(e.messages.dialog.defaultValue) + " ", 1),
1173
- d.value === "multiple-choice" ? (g(), h("select", {
1173
+ L(m(e.messages.dialog.defaultValue) + " ", 1),
1174
+ d.value === "multiple-choice" ? (h(), b("select", {
1174
1175
  key: 0,
1175
1176
  name: "default",
1176
1177
  multiple: "",
1177
- size: Math.min(4, Math.max(2, A.value.length)),
1178
- onChange: I
1178
+ size: Math.min(4, Math.max(2, I.value.length)),
1179
+ onChange: F
1179
1180
  }, [
1180
- (g(!0), h(R, null, Y(A.value, ($) => (g(), h("option", {
1181
- key: $,
1182
- value: $,
1183
- selected: C.value.includes($)
1184
- }, m($), 9, ui))), 128))
1185
- ], 40, oi)) : W.value.length || d.value === "choice" ? D((g(), h("select", {
1181
+ (h(!0), b(U, null, J(I.value, (C) => (h(), b("option", {
1182
+ key: C,
1183
+ value: C,
1184
+ selected: $.value.includes(C)
1185
+ }, m(C), 9, ri))), 128))
1186
+ ], 40, ui)) : W.value.length || d.value === "choice" ? D((h(), b("select", {
1186
1187
  key: 1,
1187
- "onUpdate:modelValue": w[4] || (w[4] = ($) => K.value = $),
1188
+ "onUpdate:modelValue": y[4] || (y[4] = (C) => j.value = C),
1188
1189
  name: "default"
1189
1190
  }, [
1190
- i("option", ri, m(e.messages.inputField.noDefault), 1),
1191
- (g(!0), h(R, null, Y(W.value, ([$, Q]) => (g(), h("option", {
1192
- key: $,
1193
- value: $
1194
- }, m(Q), 9, di))), 128))
1191
+ i("option", di, m(e.messages.inputField.noDefault), 1),
1192
+ (h(!0), b(U, null, J(W.value, ([C, R]) => (h(), b("option", {
1193
+ key: C,
1194
+ value: C
1195
+ }, m(R), 9, ci))), 128))
1195
1196
  ], 512)), [
1196
- [be, K.value]
1197
- ]) : (g(), h("input", {
1197
+ [be, j.value]
1198
+ ]) : (h(), b("input", {
1198
1199
  key: 2,
1199
- value: K.value,
1200
+ value: j.value,
1200
1201
  name: "default",
1201
- type: O.value,
1202
+ type: Q.value,
1202
1203
  step: d.value === "float" ? "any" : void 0,
1203
1204
  placeholder: e.messages.inputField.noDefault,
1204
- onInput: w[5] || (w[5] = ($) => K.value = $.target.value)
1205
- }, null, 40, ci))
1205
+ onInput: y[5] || (y[5] = (C) => j.value = C.target.value)
1206
+ }, null, 40, vi))
1206
1207
  ]),
1207
- E.value ? (g(), h("button", {
1208
+ S.value ? (h(), b("button", {
1208
1209
  key: 2,
1209
1210
  type: "button",
1210
- onClick: w[6] || (w[6] = ($) => l.value = E.value)
1211
- }, m(e.messages.inputField.useType(E.value)), 1)) : N("", !0),
1211
+ onClick: y[6] || (y[6] = (C) => l.value = S.value)
1212
+ }, m(e.messages.inputField.useType(S.value)), 1)) : B("", !0),
1212
1213
  i("details", {
1213
- open: S.value,
1214
- onToggle: w[10] || (w[10] = ($) => S.value = $.target.open)
1214
+ open: V.value,
1215
+ onToggle: y[10] || (y[10] = (C) => V.value = C.target.open)
1215
1216
  }, [
1216
1217
  i("summary", null, m(e.messages.inputField.advanced), 1),
1217
1218
  i("label", null, [
1218
- U(m(e.messages.inputField.id), 1),
1219
+ L(m(e.messages.inputField.id), 1),
1219
1220
  D(i("input", {
1220
- "onUpdate:modelValue": w[7] || (w[7] = ($) => p.value = $),
1221
+ "onUpdate:modelValue": y[7] || (y[7] = (C) => p.value = C),
1221
1222
  name: "id",
1222
1223
  autocomplete: "off",
1223
1224
  spellcheck: "false"
1224
1225
  }, null, 512), [
1225
- [L, p.value]
1226
+ [P, p.value]
1226
1227
  ])
1227
1228
  ]),
1228
- oe(bt, {
1229
+ ue(bt, {
1229
1230
  modelValue: l.value,
1230
1231
  "onUpdate:modelValue": [
1231
- w[8] || (w[8] = ($) => l.value = $),
1232
- w[9] || (w[9] = ($) => d.value = "custom")
1232
+ y[8] || (y[8] = (C) => l.value = C),
1233
+ y[9] || (y[9] = (C) => d.value = "custom")
1233
1234
  ],
1234
1235
  messages: e.messages,
1235
1236
  "var-type-plugins": e.varTypePlugins
1236
1237
  }, null, 8, ["modelValue", "messages", "var-type-plugins"])
1237
- ], 40, vi),
1238
- k.value ? (g(), h("p", mi, m(k.value), 1)) : N("", !0),
1238
+ ], 40, mi),
1239
+ M.value ? (h(), b("p", pi, m(M.value), 1)) : B("", !0),
1239
1240
  i("footer", null, [
1240
1241
  i("button", {
1241
1242
  type: "button",
1242
- onClick: w[11] || (w[11] = ($) => a("update:visible", !1))
1243
+ onClick: y[11] || (y[11] = (C) => a("update:visible", !1))
1243
1244
  }, m(e.messages.common.cancel), 1),
1244
- i("button", pi, m(e.fieldContent ? e.messages.inputField.save : e.messages.common.insert), 1)
1245
+ i("button", fi, m(e.fieldContent ? e.messages.inputField.save : e.messages.common.insert), 1)
1245
1246
  ])
1246
1247
  ], 32)
1247
- ], 40, Gs)
1248
+ ], 40, ei)
1248
1249
  ]));
1249
1250
  }
1250
- }), gi = /* @__PURE__ */ je(fi, [["__scopeId", "data-v-e4307a72"]]), hi = ["aria-label"], yi = {
1251
+ }), hi = /* @__PURE__ */ je(gi, [["__scopeId", "data-v-e4307a72"]]), yi = ["aria-label"], bi = {
1251
1252
  key: 0,
1252
1253
  class: "aimd-step-dialog__check"
1253
- }, bi = ["open"], ki = ["readonly"], wi = { key: 0 }, Mi = ["value"], _i = { value: "elapsed" }, Ti = { value: "countdown" }, xi = { value: "both" }, Ci = {
1254
+ }, ki = ["open"], wi = ["readonly"], Mi = { key: 0 }, _i = ["value"], xi = { value: "elapsed" }, Ti = { value: "countdown" }, Ci = { value: "both" }, $i = {
1254
1255
  key: 1,
1255
1256
  role: "alert"
1256
- }, $i = {
1257
+ }, Ii = {
1257
1258
  type: "submit",
1258
1259
  class: "aimd-step-dialog__save"
1259
- }, Ii = /* @__PURE__ */ pe({
1260
+ }, Fi = /* @__PURE__ */ pe({
1260
1261
  __name: "AimdStepFieldDialog",
1261
1262
  props: {
1262
1263
  visible: { type: Boolean },
@@ -1268,149 +1269,149 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
1268
1269
  },
1269
1270
  emits: ["update:visible", "save"],
1270
1271
  setup(e, { emit: n }) {
1271
- const t = e, a = n, o = F(), v = F(), p = F(""), u = F(""), l = F(1), c = F(!0), _ = F(""), d = F("elapsed"), k = F(""), S = F(!1), V = F(""), y = B(() => t.fieldType === "check"), b = B(() => y.value ? t.messages.checkField : t.messages.stepField);
1272
- ee(() => t.visible, async (E) => {
1273
- if (!E) {
1272
+ const t = e, a = n, o = A(), v = A(), p = A(""), u = A(""), l = A(1), c = A(!0), T = A(""), d = A("elapsed"), M = A(""), V = A(!1), z = A(""), k = q(() => t.fieldType === "check"), w = q(() => k.value ? t.messages.checkField : t.messages.stepField);
1273
+ Z(() => t.visible, async (S) => {
1274
+ if (!S) {
1274
1275
  o.value?.close();
1275
1276
  return;
1276
1277
  }
1277
- const C = t.fieldContent && !y.value ? rt(t.fieldContent) : void 0, I = t.fieldContent && y.value ? qt(t.fieldContent) : void 0;
1278
- p.value = (I ?? C)?.id ?? _e([...Te(t.content), ...t.reservedIds ?? []], y.value ? "check" : "step"), u.value = (I ?? C)?.title ?? "", V.value = I?.checked_message ?? "", l.value = C?.level ?? 1, c.value = C?.check ?? !0, _.value = String(C?.props.duration ?? ""), d.value = C?.timer_mode ?? "elapsed", k.value = "", S.value = !1, await Re(), o.value?.showModal(), v.value?.focus();
1278
+ const $ = t.fieldContent && !k.value ? rt(t.fieldContent) : void 0, F = t.fieldContent && k.value ? qt(t.fieldContent) : void 0;
1279
+ p.value = (F ?? $)?.id ?? _e([...xe(t.content), ...t.reservedIds ?? []], k.value ? "check" : "step"), u.value = (F ?? $)?.title ?? "", z.value = F?.checked_message ?? "", l.value = $?.level ?? 1, c.value = $?.check ?? !0, T.value = String($?.props.duration ?? ""), d.value = $?.timer_mode ?? "elapsed", M.value = "", V.value = !1, await Re(), o.value?.showModal(), v.value?.focus();
1279
1280
  }, { immediate: !0 });
1280
- function A() {
1281
- const E = /* @__PURE__ */ new Set([...Te(t.content), ...t.reservedIds ?? []]), C = p.value.trim() || _e(E, y.value ? "check" : "step");
1282
- if (!ht.test(C)) {
1283
- k.value = t.messages.inputField.invalidId, S.value = !0;
1281
+ function I() {
1282
+ const S = /* @__PURE__ */ new Set([...xe(t.content), ...t.reservedIds ?? []]), $ = p.value.trim() || _e(S, k.value ? "check" : "step");
1283
+ if (!ht.test($)) {
1284
+ M.value = t.messages.inputField.invalidId, V.value = !0;
1284
1285
  return;
1285
1286
  }
1286
- if (!t.fieldContent && E.has(C)) {
1287
- k.value = t.messages.inputField.duplicateId, S.value = !0;
1287
+ if (!t.fieldContent && S.has($)) {
1288
+ M.value = t.messages.inputField.duplicateId, V.value = !0;
1288
1289
  return;
1289
1290
  }
1290
- if (y.value) {
1291
- a("save", Nt(t.fieldContent, { id: C, title: u.value, checkedMessage: V.value })), a("update:visible", !1);
1291
+ if (k.value) {
1292
+ a("save", Nt(t.fieldContent, { id: $, title: u.value, checkedMessage: z.value })), a("update:visible", !1);
1292
1293
  return;
1293
1294
  }
1294
- const I = Pt(t.fieldContent, { id: C, title: u.value, level: l.value, check: c.value, duration: _.value, timer: d.value }), W = rt(I);
1295
- if (_.value.trim() && W.estimated_duration_ms === void 0 || d.value !== "elapsed" && !W.estimated_duration_ms) {
1296
- k.value = t.messages.stepField.invalidDuration, S.value = !0;
1295
+ const F = Pt(t.fieldContent, { id: $, title: u.value, level: l.value, check: c.value, duration: T.value, timer: d.value }), W = rt(F);
1296
+ if (T.value.trim() && W.estimated_duration_ms === void 0 || d.value !== "elapsed" && !W.estimated_duration_ms) {
1297
+ M.value = t.messages.stepField.invalidDuration, V.value = !0;
1297
1298
  return;
1298
1299
  }
1299
- a("save", I), a("update:visible", !1);
1300
+ a("save", F), a("update:visible", !1);
1300
1301
  }
1301
- return (E, C) => (g(), me(Oe, { to: "body" }, [
1302
+ return (S, $) => (h(), me(Oe, { to: "body" }, [
1302
1303
  i("dialog", {
1303
1304
  ref_key: "dialog",
1304
1305
  ref: o,
1305
1306
  class: "aimd-step-dialog",
1306
- "aria-label": e.fieldContent ? b.value.edit : b.value.insert,
1307
- onClose: C[9] || (C[9] = (I) => a("update:visible", !1)),
1308
- onCancel: C[10] || (C[10] = (I) => a("update:visible", !1))
1307
+ "aria-label": e.fieldContent ? w.value.edit : w.value.insert,
1308
+ onClose: $[9] || ($[9] = (F) => a("update:visible", !1)),
1309
+ onCancel: $[10] || ($[10] = (F) => a("update:visible", !1))
1309
1310
  }, [
1310
1311
  i("form", {
1311
- onSubmit: ae(A, ["prevent"])
1312
+ onSubmit: ne(I, ["prevent"])
1312
1313
  }, [
1313
- i("h2", null, m(e.fieldContent ? b.value.edit : b.value.insert), 1),
1314
+ i("h2", null, m(e.fieldContent ? w.value.edit : w.value.insert), 1),
1314
1315
  i("label", null, [
1315
- U(m(b.value.name), 1),
1316
+ L(m(w.value.name), 1),
1316
1317
  D(i("input", {
1317
1318
  ref_key: "nameInput",
1318
1319
  ref: v,
1319
- "onUpdate:modelValue": C[0] || (C[0] = (I) => u.value = I),
1320
+ "onUpdate:modelValue": $[0] || ($[0] = (F) => u.value = F),
1320
1321
  name: "title",
1321
1322
  autocomplete: "off"
1322
1323
  }, null, 512), [
1323
- [L, u.value]
1324
+ [P, u.value]
1324
1325
  ])
1325
1326
  ]),
1326
- y.value ? N("", !0) : (g(), h("label", yi, [
1327
+ k.value ? B("", !0) : (h(), b("label", bi, [
1327
1328
  D(i("input", {
1328
- "onUpdate:modelValue": C[1] || (C[1] = (I) => c.value = I),
1329
+ "onUpdate:modelValue": $[1] || ($[1] = (F) => c.value = F),
1329
1330
  name: "check",
1330
1331
  type: "checkbox"
1331
1332
  }, null, 512), [
1332
1333
  [pt, c.value]
1333
1334
  ]),
1334
- U(m(e.messages.stepField.check), 1)
1335
+ L(m(e.messages.stepField.check), 1)
1335
1336
  ])),
1336
1337
  i("details", {
1337
- open: S.value,
1338
- onToggle: C[7] || (C[7] = (I) => S.value = I.target.open)
1338
+ open: V.value,
1339
+ onToggle: $[7] || ($[7] = (F) => V.value = F.target.open)
1339
1340
  }, [
1340
1341
  i("summary", null, m(e.messages.inputField.advanced), 1),
1341
1342
  i("label", null, [
1342
- U(m(b.value.id), 1),
1343
+ L(m(w.value.id), 1),
1343
1344
  D(i("input", {
1344
- "onUpdate:modelValue": C[2] || (C[2] = (I) => p.value = I),
1345
+ "onUpdate:modelValue": $[2] || ($[2] = (F) => p.value = F),
1345
1346
  name: "id",
1346
1347
  readonly: !!e.fieldContent,
1347
1348
  autocomplete: "off",
1348
1349
  spellcheck: "false"
1349
- }, null, 8, ki), [
1350
- [L, p.value]
1350
+ }, null, 8, wi), [
1351
+ [P, p.value]
1351
1352
  ])
1352
1353
  ]),
1353
- y.value ? (g(), h("label", wi, [
1354
- U(m(e.messages.checkField.checkedMessage), 1),
1354
+ k.value ? (h(), b("label", Mi, [
1355
+ L(m(e.messages.checkField.checkedMessage), 1),
1355
1356
  D(i("input", {
1356
- "onUpdate:modelValue": C[3] || (C[3] = (I) => V.value = I),
1357
+ "onUpdate:modelValue": $[3] || ($[3] = (F) => z.value = F),
1357
1358
  name: "checkedMessage"
1358
1359
  }, null, 512), [
1359
- [L, V.value]
1360
+ [P, z.value]
1360
1361
  ])
1361
- ])) : (g(), h(R, { key: 1 }, [
1362
+ ])) : (h(), b(U, { key: 1 }, [
1362
1363
  i("label", null, [
1363
- U(m(e.messages.dialog.level), 1),
1364
+ L(m(e.messages.dialog.level), 1),
1364
1365
  D(i("select", {
1365
- "onUpdate:modelValue": C[4] || (C[4] = (I) => l.value = I),
1366
+ "onUpdate:modelValue": $[4] || ($[4] = (F) => l.value = F),
1366
1367
  name: "level"
1367
1368
  }, [
1368
- (g(), h(R, null, Y(3, (I) => i("option", {
1369
- key: I,
1370
- value: I
1371
- }, m(I), 9, Mi)), 64))
1369
+ (h(), b(U, null, J(3, (F) => i("option", {
1370
+ key: F,
1371
+ value: F
1372
+ }, m(F), 9, _i)), 64))
1372
1373
  ], 512), [
1373
1374
  [be, l.value]
1374
1375
  ])
1375
1376
  ]),
1376
1377
  i("label", null, [
1377
- U(m(e.messages.stepField.duration), 1),
1378
+ L(m(e.messages.stepField.duration), 1),
1378
1379
  D(i("input", {
1379
- "onUpdate:modelValue": C[5] || (C[5] = (I) => _.value = I),
1380
+ "onUpdate:modelValue": $[5] || ($[5] = (F) => T.value = F),
1380
1381
  name: "duration",
1381
1382
  placeholder: "2m"
1382
1383
  }, null, 512), [
1383
- [L, _.value]
1384
+ [P, T.value]
1384
1385
  ])
1385
1386
  ]),
1386
1387
  i("label", null, [
1387
- U(m(e.messages.stepField.timer), 1),
1388
+ L(m(e.messages.stepField.timer), 1),
1388
1389
  D(i("select", {
1389
- "onUpdate:modelValue": C[6] || (C[6] = (I) => d.value = I),
1390
+ "onUpdate:modelValue": $[6] || ($[6] = (F) => d.value = F),
1390
1391
  name: "timer"
1391
1392
  }, [
1392
- i("option", _i, m(e.messages.stepField.elapsed), 1),
1393
+ i("option", xi, m(e.messages.stepField.elapsed), 1),
1393
1394
  i("option", Ti, m(e.messages.stepField.countdown), 1),
1394
- i("option", xi, m(e.messages.stepField.both), 1)
1395
+ i("option", Ci, m(e.messages.stepField.both), 1)
1395
1396
  ], 512), [
1396
1397
  [be, d.value]
1397
1398
  ])
1398
1399
  ])
1399
1400
  ], 64))
1400
- ], 40, bi),
1401
- k.value ? (g(), h("p", Ci, m(k.value), 1)) : N("", !0),
1401
+ ], 40, ki),
1402
+ M.value ? (h(), b("p", $i, m(M.value), 1)) : B("", !0),
1402
1403
  i("footer", null, [
1403
1404
  i("button", {
1404
1405
  type: "button",
1405
- onClick: C[8] || (C[8] = (I) => a("update:visible", !1))
1406
+ onClick: $[8] || ($[8] = (F) => a("update:visible", !1))
1406
1407
  }, m(e.messages.common.cancel), 1),
1407
- i("button", $i, m(e.fieldContent ? e.messages.inputField.save : e.messages.common.insert), 1)
1408
+ i("button", Ii, m(e.fieldContent ? e.messages.inputField.save : e.messages.common.insert), 1)
1408
1409
  ])
1409
1410
  ], 32)
1410
- ], 40, hi)
1411
+ ], 40, yi)
1411
1412
  ]));
1412
1413
  }
1413
- }), Fi = /* @__PURE__ */ je(Ii, [["__scopeId", "data-v-fc5a778d"]]);
1414
+ }), Ai = /* @__PURE__ */ je(Fi, [["__scopeId", "data-v-fc5a778d"]]);
1414
1415
  const he = {
1415
1416
  xmlns: "http://www.w3.org/2000/svg",
1416
1417
  width: 24,
@@ -1426,12 +1427,12 @@ const ct = (...e) => e.filter((n, t, a) => !!n && n.trim() !== "" && a.indexOf(n
1426
1427
  function et(e) {
1427
1428
  return e != null;
1428
1429
  }
1429
- function Ai(e, n = {}) {
1430
- const t = n.attributeNames ?? {}, a = (k) => t[k] ?? k, o = e.size ?? e.width ?? he.width, v = e.size ?? e.height ?? he.height, p = e.aliases?.filter((k) => typeof k == "string" && k.trim() !== "").map((k) => `lucide-${k}`) ?? [], u = [...e.name ? [`lucide-${e.name}`] : [], ...p], l = n.className?.split(" ").filter(Boolean) ?? [], c = n.includeDefaultClasses === !1 ? ct(...l) : ct("lucide", ...u, ...l), _ = n.absoluteStrokeWidth ? Number(n.strokeWidth ?? he["stroke-width"]) * Number(e.size ?? e.width ?? he.width) / Number(n.size ?? n.width ?? he.width) : n.strokeWidth ?? he["stroke-width"];
1430
+ function zi(e, n = {}) {
1431
+ const t = n.attributeNames ?? {}, a = (M) => t[M] ?? M, o = e.size ?? e.width ?? he.width, v = e.size ?? e.height ?? he.height, p = e.aliases?.filter((M) => typeof M == "string" && M.trim() !== "").map((M) => `lucide-${M}`) ?? [], u = [...e.name ? [`lucide-${e.name}`] : [], ...p], l = n.className?.split(" ").filter(Boolean) ?? [], c = n.includeDefaultClasses === !1 ? ct(...l) : ct("lucide", ...u, ...l), T = n.absoluteStrokeWidth ? Number(n.strokeWidth ?? he["stroke-width"]) * Number(e.size ?? e.width ?? he.width) / Number(n.size ?? n.width ?? he.width) : n.strokeWidth ?? he["stroke-width"];
1431
1432
  return [
1432
1433
  "svg",
1433
1434
  {
1434
- ...Object.entries(he).reduce((k, [S, V]) => (k[a(S)] = V, k), {}),
1435
+ ...Object.entries(he).reduce((M, [V, z]) => (M[a(V)] = z, M), {}),
1435
1436
  ..."color" in n && n.color && {
1436
1437
  [a("stroke")]: n.color
1437
1438
  },
@@ -1445,7 +1446,7 @@ function Ai(e, n = {}) {
1445
1446
  ..."height" in n && et(n.height) && {
1446
1447
  [a("height")]: n.height
1447
1448
  },
1448
- [a("stroke-width")]: _,
1449
+ [a("stroke-width")]: T,
1449
1450
  ...c && {
1450
1451
  [a("class")]: c
1451
1452
  },
@@ -1455,30 +1456,30 @@ function Ai(e, n = {}) {
1455
1456
  } : {},
1456
1457
  ..."attributes" in n && n.attributes
1457
1458
  },
1458
- e.node.map((k) => {
1459
- const [S, V, y] = k, b = n.nonScalingStroke ? { [a("vector-effect")]: "non-scaling-stroke", ...V } : V;
1460
- return y ? [S, b, y] : [S, b];
1459
+ e.node.map((M) => {
1460
+ const [V, z, k] = M, w = n.nonScalingStroke ? { [a("vector-effect")]: "non-scaling-stroke", ...z } : z;
1461
+ return k ? [V, w, k] : [V, w];
1461
1462
  })
1462
1463
  ];
1463
1464
  }
1464
- const zi = (e) => {
1465
+ const Vi = (e) => {
1465
1466
  for (const n in e)
1466
1467
  if (n.startsWith("aria-") || n === "role" || n === "title")
1467
1468
  return !0;
1468
1469
  return !1;
1469
1470
  };
1470
1471
  const Pe = (e) => e === "";
1471
- const Vi = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
1472
+ const Di = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
1472
1473
  const Si = /* @__PURE__ */ Symbol("lucide-icons");
1473
- function Di() {
1474
+ function Ei() {
1474
1475
  return wt(Si, {});
1475
1476
  }
1476
- const Ei = ({
1477
+ const qi = ({
1477
1478
  name: e,
1478
1479
  iconNode: n,
1479
1480
  "icon-node": t,
1480
1481
  icon: a = {
1481
- name: e && Vi(e),
1482
+ name: e && Di(e),
1482
1483
  node: n ?? t ?? [],
1483
1484
  size: 24,
1484
1485
  aliases: []
@@ -1489,44 +1490,44 @@ const Ei = ({
1489
1490
  "non-scaling-stroke": u,
1490
1491
  strokeWidth: l,
1491
1492
  "stroke-width": c,
1492
- size: _,
1493
- width: d = _,
1494
- height: k = _,
1495
- color: S,
1496
- ...V
1497
- }, { slots: y }) => {
1493
+ size: T,
1494
+ width: d = T,
1495
+ height: M = T,
1496
+ color: V,
1497
+ ...z
1498
+ }, { slots: k }) => {
1498
1499
  const {
1499
- size: b,
1500
- color: A,
1501
- strokeWidth: E = 2,
1502
- absoluteStrokeWidth: C = !1,
1503
- nonScalingStroke: I = !1,
1500
+ size: w,
1501
+ color: I,
1502
+ strokeWidth: S = 2,
1503
+ absoluteStrokeWidth: $ = !1,
1504
+ nonScalingStroke: F = !1,
1504
1505
  class: W = ""
1505
- } = Di(), le = Pe(o) || Pe(v) || o === !0 || v === !0 || C === !0, j = Pe(p) || Pe(u) || p === !0 || u === !0 || I === !0;
1506
- delete V.class;
1507
- const O = y.default?.(), [, K, X = []] = Ai(a, {
1508
- color: S ?? A,
1509
- width: d ?? _ ?? b,
1510
- height: k ?? _ ?? b,
1511
- strokeWidth: l ?? c ?? E,
1512
- absoluteStrokeWidth: le,
1513
- nonScalingStroke: j,
1506
+ } = Ei(), G = Pe(o) || Pe(v) || o === !0 || v === !0 || $ === !0, ee = Pe(p) || Pe(u) || p === !0 || u === !0 || F === !0;
1507
+ delete z.class;
1508
+ const Q = k.default?.(), [, j, O = []] = zi(a, {
1509
+ color: V ?? I,
1510
+ width: d ?? T ?? w,
1511
+ height: M ?? T ?? w,
1512
+ strokeWidth: l ?? c ?? S,
1513
+ absoluteStrokeWidth: G,
1514
+ nonScalingStroke: ee,
1514
1515
  className: W,
1515
- hasA11yProp: O != null && O.length > 0 || zi(V),
1516
- attributes: V
1516
+ hasA11yProp: Q != null && Q.length > 0 || Vi(z),
1517
+ attributes: z
1517
1518
  });
1518
- return tt("svg", K, [
1519
- ...X.map(([se, T]) => tt(se, T)),
1520
- ...O ?? []
1519
+ return tt("svg", j, [
1520
+ ...O.map(([K, ae]) => tt(K, ae)),
1521
+ ...Q ?? []
1521
1522
  ]);
1522
1523
  };
1523
- function ie(e, n = []) {
1524
+ function te(e, n = []) {
1524
1525
  const t = typeof e == "string" ? {
1525
1526
  name: e,
1526
1527
  node: n
1527
1528
  } : e;
1528
1529
  return (a, { slots: o }) => tt(
1529
- Ei,
1530
+ qi,
1530
1531
  {
1531
1532
  ...a,
1532
1533
  icon: t
@@ -1534,7 +1535,7 @@ function ie(e, n = []) {
1534
1535
  o.default ? { default: o.default } : void 0
1535
1536
  );
1536
1537
  }
1537
- const qi = {
1538
+ const Bi = {
1538
1539
  name: "calendar-days",
1539
1540
  size: 24,
1540
1541
  node: [
@@ -1549,29 +1550,29 @@ const qi = {
1549
1550
  ["path", { d: "M12 17h.01", key: "p32p05" }],
1550
1551
  ["path", { d: "M16 17h.01", key: "ql8jdd" }]
1551
1552
  ]
1552
- }, vt = ie(qi);
1553
- const Bi = {
1553
+ }, vt = te(Bi);
1554
+ const Ni = {
1554
1555
  name: "chevron-down",
1555
1556
  size: 24,
1556
1557
  node: [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]]
1557
- }, Ni = ie(Bi);
1558
- const Pi = {
1558
+ }, Pi = te(Ni);
1559
+ const Li = {
1559
1560
  name: "circle-dot",
1560
1561
  size: 24,
1561
1562
  node: [
1562
1563
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
1563
1564
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
1564
1565
  ]
1565
- }, Li = ie(Pi);
1566
- const Ui = {
1566
+ }, Ui = te(Li);
1567
+ const Ri = {
1567
1568
  name: "clock",
1568
1569
  size: 24,
1569
1570
  node: [
1570
1571
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
1571
1572
  ["path", { d: "M12 6v6l4 2", key: "mmk7yg" }]
1572
1573
  ]
1573
- }, Ri = ie(Ui);
1574
- const Oi = {
1574
+ }, Oi = te(Ri);
1575
+ const Hi = {
1575
1576
  name: "hash",
1576
1577
  size: 24,
1577
1578
  node: [
@@ -1580,8 +1581,8 @@ const Oi = {
1580
1581
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
1581
1582
  ["line", { x1: "16", x2: "14", y1: "3", y2: "21", key: "weycgp" }]
1582
1583
  ]
1583
- }, mt = ie(Oi);
1584
- const Hi = {
1584
+ }, mt = te(Hi);
1585
+ const ji = {
1585
1586
  name: "list-checks",
1586
1587
  size: 24,
1587
1588
  node: [
@@ -1591,8 +1592,8 @@ const Hi = {
1591
1592
  ["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
1592
1593
  ["path", { d: "m3 7 2 2 4-4", key: "1obspn" }]
1593
1594
  ]
1594
- }, ji = ie(Hi);
1595
- const Ki = {
1595
+ }, Ki = te(ji);
1596
+ const Wi = {
1596
1597
  name: "list-ordered",
1597
1598
  size: 24,
1598
1599
  node: [
@@ -1603,8 +1604,8 @@ const Ki = {
1603
1604
  ["path", { d: "M4 9h2", key: "r1h2o0" }],
1604
1605
  ["path", { d: "M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02", key: "xtkcd5" }]
1605
1606
  ]
1606
- }, Wi = ie(Ki);
1607
- const Qi = {
1607
+ }, Qi = te(Wi);
1608
+ const Ji = {
1608
1609
  name: "paperclip",
1609
1610
  size: 24,
1610
1611
  node: [
@@ -1616,8 +1617,8 @@ const Qi = {
1616
1617
  }
1617
1618
  ]
1618
1619
  ]
1619
- }, Ji = ie(Qi);
1620
- const Xi = {
1620
+ }, Xi = te(Ji);
1621
+ const Yi = {
1621
1622
  name: "settings-2",
1622
1623
  size: 24,
1623
1624
  node: [
@@ -1626,8 +1627,8 @@ const Xi = {
1626
1627
  ["circle", { cx: "17", cy: "17", r: "3", key: "18b49y" }],
1627
1628
  ["circle", { cx: "7", cy: "7", r: "3", key: "dfmy0x" }]
1628
1629
  ]
1629
- }, Yi = ie(Xi);
1630
- const Zi = {
1630
+ }, Zi = te(Yi);
1631
+ const Gi = {
1631
1632
  name: "square-check",
1632
1633
  size: 24,
1633
1634
  node: [
@@ -1635,8 +1636,8 @@ const Zi = {
1635
1636
  ["path", { d: "m16 9-5.5 5.5L8 12", key: "xofnsj" }]
1636
1637
  ],
1637
1638
  aliases: ["check-square-2"]
1638
- }, Gi = ie(Zi);
1639
- const en = {
1639
+ }, en = te(Gi);
1640
+ const tn = {
1640
1641
  name: "text-cursor-input",
1641
1642
  size: 24,
1642
1643
  node: [
@@ -1646,118 +1647,118 @@ const en = {
1646
1647
  ["path", { d: "M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1", key: "1mj8rg" }],
1647
1648
  ["path", { d: "M9 6v12", key: "velyjx" }]
1648
1649
  ]
1649
- }, tn = ie(en);
1650
- const ln = {
1650
+ }, ln = te(tn);
1651
+ const sn = {
1651
1652
  name: "toggle-left",
1652
1653
  size: 24,
1653
1654
  node: [
1654
1655
  ["circle", { cx: "9", cy: "12", r: "3", key: "u3jwor" }],
1655
1656
  ["rect", { width: "20", height: "14", x: "2", y: "5", rx: "7", key: "g7kal2" }]
1656
1657
  ]
1657
- }, sn = ie(ln), nn = ["aria-label"], an = ["title", "aria-label", "onClick"], on = ["aria-expanded"], un = ["aria-label"], rn = ["title", "onClick"], dn = /* @__PURE__ */ pe({
1658
+ }, nn = te(sn), an = ["aria-label"], on = ["title", "aria-label", "onClick"], un = ["aria-expanded"], rn = ["aria-label"], dn = ["title", "onClick"], cn = /* @__PURE__ */ pe({
1658
1659
  __name: "AimdInputToolbar",
1659
1660
  props: {
1660
1661
  messages: {}
1661
1662
  },
1662
1663
  emits: ["insert"],
1663
1664
  setup(e, { emit: n }) {
1664
- const t = e, a = n, o = F(), v = F(), p = F(!1), u = F();
1665
+ const t = e, a = n, o = A(), v = A(), p = A(!1), u = A();
1665
1666
  let l = 0;
1666
- const c = B(() => [
1667
- { preset: "str", label: t.messages.inputField.text, icon: tn },
1667
+ const c = q(() => [
1668
+ { preset: "str", label: t.messages.inputField.text, icon: ln },
1668
1669
  { preset: "int", label: t.messages.inputField.integer, icon: mt },
1669
1670
  { preset: "float", label: t.messages.inputField.number, icon: mt },
1670
- { preset: "choice", label: t.messages.inputField.choice, icon: Li },
1671
- { preset: "multiple-choice", label: t.messages.inputField.multipleChoice, icon: Gi },
1672
- { preset: "bool | None", label: t.messages.inputField.boolean, icon: sn }
1673
- ]), _ = B(() => [
1671
+ { preset: "choice", label: t.messages.inputField.choice, icon: Ui },
1672
+ { preset: "multiple-choice", label: t.messages.inputField.multipleChoice, icon: en },
1673
+ { preset: "bool | None", label: t.messages.inputField.boolean, icon: nn }
1674
+ ]), T = q(() => [
1674
1675
  { preset: "date", label: t.messages.inputField.date, icon: vt },
1675
- { preset: "time", label: t.messages.inputField.time, icon: Ri },
1676
+ { preset: "time", label: t.messages.inputField.time, icon: Oi },
1676
1677
  { preset: "datetime", label: t.messages.inputField.datetime, icon: vt },
1677
- { preset: "list[str]", label: t.messages.inputField.list, icon: Wi },
1678
- { preset: "file", label: t.messages.inputField.file, icon: Ji },
1679
- { preset: "custom", label: t.messages.inputField.custom, icon: Yi }
1678
+ { preset: "list[str]", label: t.messages.inputField.list, icon: Qi },
1679
+ { preset: "file", label: t.messages.inputField.file, icon: Xi },
1680
+ { preset: "custom", label: t.messages.inputField.custom, icon: Zi }
1680
1681
  ]);
1681
- function d(y = !1) {
1682
- o.value && (l = y ? _.value.length - 1 : 0, u.value = o.value.closest('dialog[open], [popover], [role="dialog"]') ?? o.value.ownerDocument.body, p.value = !0);
1682
+ function d(k = !1) {
1683
+ o.value && (l = k ? T.value.length - 1 : 0, u.value = o.value.closest('dialog[open], [popover], [role="dialog"]') ?? o.value.ownerDocument.body, p.value = !0);
1683
1684
  }
1684
- function k(y = !1) {
1685
- p.value = !1, y && o.value?.focus({ preventScroll: !0 });
1685
+ function M(k = !1) {
1686
+ p.value = !1, k && o.value?.focus({ preventScroll: !0 });
1686
1687
  }
1687
- function S(y) {
1688
- p.value && k(!0), a("insert", y);
1688
+ function V(k) {
1689
+ p.value && M(!0), a("insert", k);
1689
1690
  }
1690
- function V(y) {
1691
- if (y.key === "Tab" || y.key === "Escape") {
1692
- y.key === "Escape" && (y.preventDefault(), y.stopPropagation()), k(!0);
1691
+ function z(k) {
1692
+ if (k.key === "Tab" || k.key === "Escape") {
1693
+ k.key === "Escape" && (k.preventDefault(), k.stopPropagation()), M(!0);
1693
1694
  return;
1694
1695
  }
1695
- const b = Array.from(v.value?.querySelectorAll("button") ?? []), A = b.indexOf(y.target);
1696
- let E;
1697
- switch (y.key) {
1696
+ const w = Array.from(v.value?.querySelectorAll("button") ?? []), I = w.indexOf(k.target);
1697
+ let S;
1698
+ switch (k.key) {
1698
1699
  case "Home":
1699
- E = 0;
1700
+ S = 0;
1700
1701
  break;
1701
1702
  case "End":
1702
- E = b.length - 1;
1703
+ S = w.length - 1;
1703
1704
  break;
1704
1705
  case "ArrowDown":
1705
- E = (A + 1) % b.length;
1706
+ S = (I + 1) % w.length;
1706
1707
  break;
1707
1708
  case "ArrowUp":
1708
- E = (A - 1 + b.length) % b.length;
1709
+ S = (I - 1 + w.length) % w.length;
1709
1710
  break;
1710
1711
  default:
1711
1712
  return;
1712
1713
  }
1713
- y.preventDefault(), b[E]?.focus();
1714
+ k.preventDefault(), w[S]?.focus();
1714
1715
  }
1715
- return ee(v, (y, b, A) => {
1716
- const E = o.value;
1717
- if (!y || !E) return;
1718
- const C = E.ownerDocument, I = (O) => {
1719
- O.target instanceof Node && !y.contains(O.target) && !E.contains(O.target) && k();
1716
+ return Z(v, (k, w, I) => {
1717
+ const S = o.value;
1718
+ if (!k || !S) return;
1719
+ const $ = S.ownerDocument, F = (Q) => {
1720
+ Q.target instanceof Node && !k.contains(Q.target) && !S.contains(Q.target) && M();
1720
1721
  };
1721
- C.addEventListener("pointerdown", I, !0), C.addEventListener("focusin", I);
1722
- let W = !0, le = !1;
1723
- const j = Tt(E, y, async () => {
1724
- const { x: O, y: K } = await xt(E, y, {
1722
+ $.addEventListener("pointerdown", F, !0), $.addEventListener("focusin", F);
1723
+ let W = !0, G = !1;
1724
+ const ee = xt(S, k, async () => {
1725
+ const { x: Q, y: j } = await Tt(S, k, {
1725
1726
  strategy: "fixed",
1726
1727
  placement: "bottom-start",
1727
1728
  middleware: [
1728
1729
  Ct(4),
1729
1730
  $t({ padding: 8 }),
1730
1731
  It({ padding: 8 }),
1731
- Ft({ padding: 8, apply({ availableHeight: X }) {
1732
- y.style.maxHeight = `${Math.max(0, X)}px`;
1732
+ Ft({ padding: 8, apply({ availableHeight: O }) {
1733
+ k.style.maxHeight = `${Math.max(0, O)}px`;
1733
1734
  } })
1734
1735
  ]
1735
1736
  });
1736
- W && (y.style.left = `${O}px`, y.style.top = `${K}px`, le || (le = !0, y.style.visibility = "visible", y.querySelectorAll("button")[l]?.focus({ preventScroll: !0 })));
1737
+ W && (k.style.left = `${Q}px`, k.style.top = `${j}px`, G || (G = !0, k.style.visibility = "visible", k.querySelectorAll("button")[l]?.focus({ preventScroll: !0 })));
1737
1738
  });
1738
- A(() => {
1739
- W = !1, j(), C.removeEventListener("pointerdown", I, !0), C.removeEventListener("focusin", I);
1739
+ I(() => {
1740
+ W = !1, ee(), $.removeEventListener("pointerdown", F, !0), $.removeEventListener("focusin", F);
1740
1741
  });
1741
- }, { flush: "post" }), (y, b) => (g(), h("div", {
1742
+ }, { flush: "post" }), (k, w) => (h(), b("div", {
1742
1743
  class: "aimd-input-tools",
1743
1744
  role: "group",
1744
1745
  "aria-label": e.messages.inputField.insert
1745
1746
  }, [
1746
- (g(!0), h(R, null, Y(c.value, (A) => (g(), h("button", {
1747
- key: A.preset,
1747
+ (h(!0), b(U, null, J(c.value, (I) => (h(), b("button", {
1748
+ key: I.preset,
1748
1749
  type: "button",
1749
- title: e.messages.inputField.insertType(A.label),
1750
- "aria-label": e.messages.inputField.insertType(A.label),
1751
- onMousedown: b[0] || (b[0] = ae(() => {
1750
+ title: e.messages.inputField.insertType(I.label),
1751
+ "aria-label": e.messages.inputField.insertType(I.label),
1752
+ onMousedown: w[0] || (w[0] = ne(() => {
1752
1753
  }, ["prevent"])),
1753
- onClick: (E) => S(A.preset)
1754
+ onClick: (S) => V(I.preset)
1754
1755
  }, [
1755
- (g(), me(it(A.icon), {
1756
+ (h(), me(it(I.icon), {
1756
1757
  size: 16,
1757
1758
  "aria-hidden": "true"
1758
1759
  })),
1759
- i("span", null, m(A.label), 1)
1760
- ], 40, an))), 128)),
1760
+ i("span", null, m(I.label), 1)
1761
+ ], 40, on))), 128)),
1761
1762
  i("button", {
1762
1763
  ref_key: "trigger",
1763
1764
  ref: o,
@@ -1765,25 +1766,25 @@ const ln = {
1765
1766
  class: "aimd-input-tools__more",
1766
1767
  "aria-haspopup": "menu",
1767
1768
  "aria-expanded": p.value,
1768
- onMousedown: b[1] || (b[1] = ae(() => {
1769
+ onMousedown: w[1] || (w[1] = ne(() => {
1769
1770
  }, ["prevent"])),
1770
- onClick: b[2] || (b[2] = (A) => p.value ? k(!0) : d()),
1771
+ onClick: w[2] || (w[2] = (I) => p.value ? M(!0) : d()),
1771
1772
  onKeydown: [
1772
- b[3] || (b[3] = nt(ae((A) => d(), ["prevent"]), ["down"])),
1773
- b[4] || (b[4] = nt(ae((A) => d(!0), ["prevent"]), ["up"]))
1773
+ w[3] || (w[3] = nt(ne((I) => d(), ["prevent"]), ["down"])),
1774
+ w[4] || (w[4] = nt(ne((I) => d(!0), ["prevent"]), ["up"]))
1774
1775
  ]
1775
1776
  }, [
1776
- oe(G(ji), {
1777
+ ue(Y(Ki), {
1777
1778
  size: 16,
1778
1779
  "aria-hidden": "true"
1779
1780
  }),
1780
1781
  i("span", null, m(e.messages.inputField.more), 1),
1781
- oe(G(Ni), {
1782
+ ue(Y(Pi), {
1782
1783
  size: 14,
1783
1784
  "aria-hidden": "true"
1784
1785
  })
1785
- ], 40, on),
1786
- p.value && u.value ? (g(), me(Oe, {
1786
+ ], 40, un),
1787
+ p.value && u.value ? (h(), me(Oe, {
1787
1788
  key: 0,
1788
1789
  to: u.value
1789
1790
  }, [
@@ -1793,41 +1794,41 @@ const ln = {
1793
1794
  class: "aimd-input-tools__menu",
1794
1795
  role: "menu",
1795
1796
  "aria-label": e.messages.inputField.more,
1796
- onKeydown: V
1797
+ onKeydown: z
1797
1798
  }, [
1798
- (g(!0), h(R, null, Y(_.value, (A) => (g(), h("button", {
1799
- key: A.preset,
1799
+ (h(!0), b(U, null, J(T.value, (I) => (h(), b("button", {
1800
+ key: I.preset,
1800
1801
  type: "button",
1801
1802
  role: "menuitem",
1802
1803
  tabindex: "-1",
1803
- title: e.messages.inputField.insertType(A.label),
1804
- onMousedown: b[5] || (b[5] = ae(() => {
1804
+ title: e.messages.inputField.insertType(I.label),
1805
+ onMousedown: w[5] || (w[5] = ne(() => {
1805
1806
  }, ["prevent"])),
1806
- onClick: (E) => S(A.preset)
1807
+ onClick: (S) => V(I.preset)
1807
1808
  }, [
1808
- (g(), me(it(A.icon), {
1809
+ (h(), me(it(I.icon), {
1809
1810
  size: 16,
1810
1811
  "aria-hidden": "true"
1811
1812
  })),
1812
- i("span", null, m(A.label), 1)
1813
- ], 40, rn))), 128))
1814
- ], 40, un)
1815
- ], 8, ["to"])) : N("", !0)
1816
- ], 8, nn));
1813
+ i("span", null, m(I.label), 1)
1814
+ ], 40, dn))), 128))
1815
+ ], 40, rn)
1816
+ ], 8, ["to"])) : B("", !0)
1817
+ ], 8, an));
1817
1818
  }
1818
- }), cn = /* @__PURE__ */ je(dn, [["__scopeId", "data-v-4f8b17e2"]]), vn = { class: "aimd-editor-toolbar" }, mn = {
1819
+ }), vn = /* @__PURE__ */ je(cn, [["__scopeId", "data-v-4f8b17e2"]]), mn = { class: "aimd-editor-toolbar" }, pn = {
1819
1820
  key: 0,
1820
1821
  class: "aimd-editor-mode-switch"
1821
- }, pn = ["title"], fn = ["title"], gn = {
1822
+ }, fn = ["title"], gn = ["title"], hn = {
1822
1823
  key: 1,
1823
1824
  class: "aimd-editor-toolbar-sep"
1824
- }, hn = {
1825
+ }, yn = {
1825
1826
  key: 0,
1826
1827
  class: "aimd-editor-toolbar-sep"
1827
- }, yn = ["title", "onClick", "innerHTML"], bn = {
1828
+ }, bn = ["title", "onClick", "innerHTML"], kn = {
1828
1829
  key: 3,
1829
1830
  class: "aimd-editor-toolbar-divider"
1830
- }, kn = ["title", "onClick", "onMouseup"], wn = ["innerHTML"], Mn = { class: "aimd-editor-aimd-btn-label" }, _n = /* @__PURE__ */ pe({
1831
+ }, wn = ["title", "onClick", "onMouseup"], Mn = ["innerHTML"], _n = { class: "aimd-editor-aimd-btn-label" }, xn = /* @__PURE__ */ pe({
1831
1832
  __name: "AimdEditorToolbar",
1832
1833
  props: {
1833
1834
  showTopBar: { type: Boolean },
@@ -1841,8 +1842,8 @@ const ln = {
1841
1842
  emits: ["switch-mode", "md-action", "open-aimd-dialog", "quick-insert-aimd", "insert-input"],
1842
1843
  setup(e, { emit: n }) {
1843
1844
  const t = n;
1844
- return (a, o) => (g(), h("div", vn, [
1845
- e.showTopBar ? (g(), h("div", mn, [
1845
+ return (a, o) => (h(), b("div", mn, [
1846
+ e.showTopBar ? (h(), b("div", pn, [
1846
1847
  i("button", {
1847
1848
  type: "button",
1848
1849
  class: ye(["aimd-editor-mode-btn", { active: e.editorMode === "source" }]),
@@ -1854,7 +1855,7 @@ const ln = {
1854
1855
  innerHTML: '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>'
1855
1856
  }, null, -1)),
1856
1857
  i("span", null, m(e.resolvedMessages.mode.source), 1)
1857
- ], 10, pn),
1858
+ ], 10, fn),
1858
1859
  i("button", {
1859
1860
  type: "button",
1860
1861
  class: ye(["aimd-editor-mode-btn", { active: e.editorMode === "wysiwyg" }]),
@@ -1866,220 +1867,227 @@ const ln = {
1866
1867
  innerHTML: '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>'
1867
1868
  }, null, -1)),
1868
1869
  i("span", null, m(e.resolvedMessages.mode.wysiwyg), 1)
1869
- ], 10, fn)
1870
- ])) : N("", !0),
1871
- e.showTopBar && e.showMdToolbar ? (g(), h("div", gn)) : N("", !0),
1872
- e.showMdToolbar ? (g(!0), h(R, { key: 2 }, Y(e.localizedMdToolbarItems, (v) => (g(), h(R, {
1870
+ ], 10, gn)
1871
+ ])) : B("", !0),
1872
+ e.showTopBar && e.showMdToolbar ? (h(), b("div", hn)) : B("", !0),
1873
+ e.showMdToolbar ? (h(!0), b(U, { key: 2 }, J(e.localizedMdToolbarItems, (v) => (h(), b(U, {
1873
1874
  key: v.action
1874
1875
  }, [
1875
- v.action.startsWith("sep") ? (g(), h("div", hn)) : (g(), h("button", {
1876
+ v.action.startsWith("sep") ? (h(), b("div", yn)) : (h(), b("button", {
1876
1877
  key: 1,
1877
1878
  type: "button",
1878
1879
  class: "aimd-editor-fmt-btn",
1879
1880
  title: v.title,
1880
1881
  onClick: (p) => t("md-action", v.action, p),
1881
1882
  innerHTML: v.svgIcon
1882
- }, null, 8, yn))
1883
- ], 64))), 128)) : N("", !0),
1884
- e.showMdToolbar && e.showAimdToolbar ? (g(), h("div", bn)) : N("", !0),
1885
- e.showAimdToolbar ? (g(), h(R, { key: 4 }, [
1886
- (g(!0), h(R, null, Y(e.localizedFieldTypes.filter((v) => v.type !== "var"), (v) => (g(), h("button", {
1883
+ }, null, 8, bn))
1884
+ ], 64))), 128)) : B("", !0),
1885
+ e.showMdToolbar && e.showAimdToolbar ? (h(), b("div", kn)) : B("", !0),
1886
+ e.showAimdToolbar ? (h(), b(U, { key: 4 }, [
1887
+ (h(!0), b(U, null, J(e.localizedFieldTypes.filter((v) => v.type !== "var"), (v) => (h(), b("button", {
1887
1888
  key: v.type,
1888
1889
  type: "button",
1889
1890
  class: "aimd-editor-fmt-btn aimd-editor-aimd-btn",
1890
1891
  title: v.desc,
1891
1892
  style: Ue({ "--aimd-color": v.color }),
1892
1893
  onClick: (p) => t("open-aimd-dialog", v.type),
1893
- onMouseup: ae((p) => t("quick-insert-aimd", v.type), ["middle", "prevent"])
1894
+ onMouseup: ne((p) => t("quick-insert-aimd", v.type), ["middle", "prevent"])
1894
1895
  }, [
1895
1896
  i("span", {
1896
1897
  class: "aimd-editor-aimd-btn-icon",
1897
1898
  innerHTML: v.svgIcon
1898
- }, null, 8, wn),
1899
- i("span", Mn, m(v.label), 1)
1900
- ], 44, kn))), 128)),
1901
- e.localizedFieldTypes.some((v) => v.type === "var") ? (g(), me(cn, {
1899
+ }, null, 8, Mn),
1900
+ i("span", _n, m(v.label), 1)
1901
+ ], 44, wn))), 128)),
1902
+ e.localizedFieldTypes.some((v) => v.type === "var") ? (h(), me(vn, {
1902
1903
  key: 0,
1903
1904
  messages: e.resolvedMessages,
1904
1905
  onInsert: o[2] || (o[2] = (v) => t("insert-input", v))
1905
- }, null, 8, ["messages"])) : N("", !0)
1906
- ], 64)) : N("", !0)
1906
+ }, null, 8, ["messages"])) : B("", !0)
1907
+ ], 64)) : B("", !0)
1907
1908
  ]));
1908
1909
  }
1909
1910
  });
1910
1911
  function Tn(e) {
1911
- const { initialContent: n, initialMode: t, resolvedMessages: a, emitModelValue: o, emitMode: v } = e, p = F(t), u = F(n), l = Xe(null), c = Xe(null), _ = F(!0), d = Xe(null);
1912
- let k = !1;
1913
- function S(T) {
1914
- T !== u.value && (u.value = T, o(T));
1912
+ const { initialContent: n, initialMode: t, resolvedMessages: a, emitModelValue: o, emitMode: v } = e, p = A(t), u = A(n), l = Xe(null), c = Xe(null), T = A(!0), d = Xe(null);
1913
+ let M = !1, V, z = n;
1914
+ function k(x) {
1915
+ return x.action((f) => f.get(Ht).state.doc);
1916
+ }
1917
+ function w(x) {
1918
+ x !== u.value && (u.value = x, o(x));
1915
1919
  }
1916
- function V(T) {
1917
- return Ut(T).content;
1920
+ function I(x) {
1921
+ return Ut(x).content;
1918
1922
  }
1919
- function y(T) {
1920
- return /class="ProseMirror milkdown-editor-content editor"/.test(T) || /<div class="milkdown">/.test(T) || /<\/?[a-z][^>]*>/i.test(T) && /AIMDINLINETEMPLATE[0-9a-f]+TOKEN/.test(T);
1923
+ function S(x) {
1924
+ return /class="ProseMirror milkdown-editor-content editor"/.test(x) || /<div class="milkdown">/.test(x) || /<\/?[a-z][^>]*>/i.test(x) && /AIMDINLINETEMPLATE[0-9a-f]+TOKEN/.test(x);
1921
1925
  }
1922
- function b(T, z) {
1923
- const H = At(Rt(T));
1924
- return y(H) ? z : H;
1926
+ function $(x, f) {
1927
+ const y = At(Rt(x));
1928
+ return S(y) ? f : y;
1925
1929
  }
1926
- function A(T) {
1927
- return /\{\{(?:var_table|var|quiz|step|check|ref_step|ref_var|ref_fig|cite|fig)\|/.test(T) || /```(?:quiz|fig|assigner|connectors)\b/.test(T);
1930
+ function F(x) {
1931
+ return /\{\{(?:var_table|var|quiz|step|check|task|ref_step|ref_var|ref_fig|cite|fig)\|/.test(x) || /```(?:quiz|fig|assigner|connectors)\b/.test(x);
1928
1932
  }
1929
- function E() {
1933
+ function W() {
1930
1934
  if (d.value)
1931
1935
  try {
1932
- const T = d.value.action(ot());
1933
- if (typeof T != "string")
1936
+ const x = d.value.action(ot());
1937
+ if (typeof x != "string")
1934
1938
  return;
1935
- const z = b(T, u.value);
1936
- d.value.action(Le(V(z)));
1939
+ const f = $(x, u.value);
1940
+ d.value.action(Le(I(f)));
1937
1941
  } catch {
1938
1942
  }
1939
1943
  }
1940
- const C = B(() => {
1944
+ const G = q(() => {
1941
1945
  try {
1942
1946
  return Ot(u.value);
1943
1947
  } catch {
1944
1948
  return null;
1945
1949
  }
1946
1950
  });
1947
- async function I(T) {
1948
- if (T !== p.value) {
1951
+ async function ee(x) {
1952
+ if (x !== p.value) {
1949
1953
  if (p.value === "source" && l.value && (u.value = l.value.getValue()), p.value === "wysiwyg" && d.value)
1950
1954
  try {
1951
- const z = d.value.action(ot());
1952
- typeof z == "string" && (u.value = b(z, u.value));
1955
+ if (V?.eq(k(d.value)))
1956
+ w(z);
1957
+ else {
1958
+ const f = d.value.action(ot());
1959
+ typeof f == "string" && w($(f, u.value));
1960
+ }
1953
1961
  } catch {
1954
1962
  }
1955
- if (p.value = T, v(T), T === "source")
1956
- await Re(), l.value && (k = !0, l.value.setValue(u.value), k = !1);
1957
- else if (T === "wysiwyg" && (await Re(), d.value))
1963
+ if (p.value = x, v(x), x === "source")
1964
+ await Re(), l.value && (M = !0, l.value.setValue(u.value), M = !1);
1965
+ else if (x === "wysiwyg" && (await Re(), d.value))
1958
1966
  try {
1959
- k = !0, d.value.action(Le(V(u.value))), k = !1;
1967
+ M = !0, d.value.action(Le(I(u.value))), V = k(d.value), z = u.value, M = !1;
1960
1968
  } catch {
1961
- k = !1;
1969
+ M = !1;
1962
1970
  }
1963
1971
  }
1964
1972
  }
1965
- function W(T) {
1966
- if (T !== u.value) {
1967
- if (k = !0, u.value = T, p.value === "source" && l.value)
1968
- l.value.setValue(T);
1973
+ function Q(x) {
1974
+ if (x !== u.value) {
1975
+ if (M = !0, u.value = x, p.value === "source" && l.value)
1976
+ l.value.setValue(x);
1969
1977
  else if (p.value === "wysiwyg" && d.value)
1970
1978
  try {
1971
- d.value.action(Le(V(T)));
1979
+ d.value.action(Le(I(x))), V = k(d.value), z = x;
1972
1980
  } catch {
1973
1981
  }
1974
- k = !1;
1982
+ M = !1;
1975
1983
  }
1976
1984
  }
1977
- function le(T) {
1985
+ function j(x) {
1978
1986
  if (p.value === "source" && l.value) {
1979
- const z = l.value.getSelection(), H = l.value.getModel(), J = l.value.getPosition(), Q = H.getLineContent(J.lineNumber).substring(0, J.column - 1).trim() !== "" && !T.startsWith(`
1987
+ const f = l.value.getSelection(), y = l.value.getModel(), C = l.value.getPosition(), oe = y.getLineContent(C.lineNumber).substring(0, C.column - 1).trim() !== "" && !x.startsWith(`
1980
1988
  `) ? `
1981
- ` + T : T;
1989
+ ` + x : x;
1982
1990
  l.value.executeEdits("toolbar", [{
1983
- range: z,
1984
- text: Q,
1991
+ range: f,
1992
+ text: oe,
1985
1993
  forceMoveMarkers: !0
1986
1994
  }]), l.value.focus();
1987
1995
  } else if (p.value === "wysiwyg" && d.value)
1988
1996
  try {
1989
- d.value.action(Ye(T)), A(T) && E();
1997
+ d.value.action(Ye(x)), F(x) && W();
1990
1998
  } catch {
1991
1999
  }
1992
2000
  }
1993
- function j(T, z = "", H = "") {
2001
+ function O(x, f = "", y = "") {
1994
2002
  if (p.value === "source" && l.value) {
1995
- const J = l.value.getSelection(), x = l.value.getModel().getValueInRange(J) || H, w = T + x + z;
2003
+ const C = l.value.getSelection(), R = l.value.getModel().getValueInRange(C) || y, H = x + R + f;
1996
2004
  l.value.executeEdits("toolbar", [{
1997
- range: J,
1998
- text: w,
2005
+ range: C,
2006
+ text: H,
1999
2007
  forceMoveMarkers: !0
2000
2008
  }]), l.value.focus();
2001
2009
  } else if (p.value === "wysiwyg" && d.value)
2002
2010
  try {
2003
- d.value.action(Ye(T + H + z));
2011
+ d.value.action(Ye(x + y + f));
2004
2012
  } catch {
2005
2013
  }
2006
2014
  }
2007
- function O(T, z = "") {
2015
+ function K(x, f = "") {
2008
2016
  if (p.value === "source" && l.value) {
2009
- const H = l.value.getPosition(), x = l.value.getModel().getLineContent(H.lineNumber);
2010
- if (x.trim() === "") {
2011
- const w = { startLineNumber: H.lineNumber, startColumn: 1, endLineNumber: H.lineNumber, endColumn: x.length + 1 };
2012
- l.value.executeEdits("toolbar", [{ range: w, text: T + z, forceMoveMarkers: !0 }]);
2017
+ const y = l.value.getPosition(), R = l.value.getModel().getLineContent(y.lineNumber);
2018
+ if (R.trim() === "") {
2019
+ const H = { startLineNumber: y.lineNumber, startColumn: 1, endLineNumber: y.lineNumber, endColumn: R.length + 1 };
2020
+ l.value.executeEdits("toolbar", [{ range: H, text: x + f, forceMoveMarkers: !0 }]);
2013
2021
  } else {
2014
- const w = { startLineNumber: H.lineNumber, startColumn: x.length + 1, endLineNumber: H.lineNumber, endColumn: x.length + 1 };
2015
- l.value.executeEdits("toolbar", [{ range: w, text: `
2016
- ` + T + z, forceMoveMarkers: !0 }]);
2022
+ const H = { startLineNumber: y.lineNumber, startColumn: R.length + 1, endLineNumber: y.lineNumber, endColumn: R.length + 1 };
2023
+ l.value.executeEdits("toolbar", [{ range: H, text: `
2024
+ ` + x + f, forceMoveMarkers: !0 }]);
2017
2025
  }
2018
2026
  l.value.focus();
2019
2027
  } else if (p.value === "wysiwyg" && d.value)
2020
2028
  try {
2021
2029
  d.value.action(Ye(`
2022
- ` + T + z));
2030
+ ` + x + f));
2023
2031
  } catch {
2024
2032
  }
2025
2033
  }
2026
- function K(T) {
2027
- const z = a.value.snippets;
2028
- switch (T) {
2034
+ function ae(x) {
2035
+ const f = a.value.snippets;
2036
+ switch (x) {
2029
2037
  case "h1":
2030
- O("# ", z.heading);
2038
+ K("# ", f.heading);
2031
2039
  break;
2032
2040
  case "h2":
2033
- O("## ", z.heading);
2041
+ K("## ", f.heading);
2034
2042
  break;
2035
2043
  case "h3":
2036
- O("### ", z.heading);
2044
+ K("### ", f.heading);
2037
2045
  break;
2038
2046
  case "bold":
2039
- j("**", "**", z.boldText);
2047
+ O("**", "**", f.boldText);
2040
2048
  break;
2041
2049
  case "italic":
2042
- j("*", "*", z.italicText);
2050
+ O("*", "*", f.italicText);
2043
2051
  break;
2044
2052
  case "strikethrough":
2045
- j("~~", "~~", z.strikethrough);
2053
+ O("~~", "~~", f.strikethrough);
2046
2054
  break;
2047
2055
  case "ul":
2048
- O("- ", z.listItem);
2056
+ K("- ", f.listItem);
2049
2057
  break;
2050
2058
  case "ol":
2051
- O("1. ", z.listItem);
2059
+ K("1. ", f.listItem);
2052
2060
  break;
2053
2061
  case "blockquote":
2054
- O("> ", z.quote);
2062
+ K("> ", f.quote);
2055
2063
  break;
2056
2064
  case "code":
2057
- j("`", "`", z.code);
2065
+ O("`", "`", f.code);
2058
2066
  break;
2059
2067
  case "codeblock":
2060
- j("```\n", "\n```", z.codeBlock);
2068
+ O("```\n", "\n```", f.codeBlock);
2061
2069
  break;
2062
2070
  case "link":
2063
- j("[", "](url)", z.linkText);
2071
+ O("[", "](url)", f.linkText);
2064
2072
  break;
2065
2073
  case "image":
2066
- j("![", "](url)", z.altText);
2074
+ O("![", "](url)", f.altText);
2067
2075
  break;
2068
2076
  case "hr":
2069
- O("---");
2077
+ K("---");
2070
2078
  break;
2071
2079
  case "math":
2072
- j("$", "$", z.mathFormula);
2080
+ O("$", "$", f.mathFormula);
2073
2081
  break;
2074
2082
  case "table":
2075
2083
  if (p.value === "wysiwyg" && d.value)
2076
2084
  try {
2077
- d.value.action(Mt(Ht.key, { row: 3, col: 3 }));
2085
+ d.value.action(Mt(jt.key, { row: 3, col: 3 }));
2078
2086
  } catch {
2079
2087
  }
2080
2088
  else
2081
- O(
2082
- `| ${z.tableColumnA} | ${z.tableColumnB} | ${z.tableColumnC} |
2089
+ K(
2090
+ `| ${f.tableColumnA} | ${f.tableColumnB} | ${f.tableColumnC} |
2083
2091
  |-------|-------|-------|
2084
2092
  | `,
2085
2093
  " | | |"
@@ -2087,37 +2095,37 @@ function Tn(e) {
2087
2095
  break;
2088
2096
  }
2089
2097
  }
2090
- function X(T, z, H) {
2091
- k || S(b(z, u.value));
2098
+ function le(x, f, y) {
2099
+ M || w($(f, u.value));
2092
2100
  }
2093
- function se(T) {
2094
- d.value = T;
2101
+ function se(x) {
2102
+ d.value = x, V = k(x), z = u.value;
2095
2103
  }
2096
2104
  return {
2097
2105
  editorMode: p,
2098
2106
  content: u,
2099
- commitUserContent: S,
2107
+ commitUserContent: w,
2100
2108
  monacoEditor: l,
2101
2109
  monacoInstance: c,
2102
- monacoLoading: _,
2110
+ monacoLoading: T,
2103
2111
  milkdownEditorRef: d,
2104
- extractedFields: C,
2105
- toMilkdownMarkdown: V,
2106
- switchMode: I,
2107
- syncFromProp: W,
2108
- insertTextIntoActiveEditor: le,
2109
- handleMdAction: K,
2110
- onMilkdownMarkdownUpdated: X,
2112
+ extractedFields: G,
2113
+ toMilkdownMarkdown: I,
2114
+ switchMode: ee,
2115
+ syncFromProp: Q,
2116
+ insertTextIntoActiveEditor: j,
2117
+ handleMdAction: ae,
2118
+ onMilkdownMarkdownUpdated: le,
2111
2119
  onMilkdownReady: se
2112
2120
  };
2113
2121
  }
2114
- const xn = { class: "aimd-editor" }, Cn = {
2122
+ const Cn = { class: "aimd-editor" }, $n = {
2115
2123
  key: 0,
2116
2124
  class: "aimd-editor-mode-host"
2117
- }, $n = {
2125
+ }, In = {
2118
2126
  key: 1,
2119
2127
  class: "aimd-editor-mode-host"
2120
- }, On = /* @__PURE__ */ pe({
2128
+ }, jn = /* @__PURE__ */ pe({
2121
2129
  __name: "AimdEditor",
2122
2130
  props: {
2123
2131
  modelValue: { default: "" },
@@ -2141,21 +2149,21 @@ const xn = { class: "aimd-editor" }, Cn = {
2141
2149
  },
2142
2150
  emits: ["update:modelValue", "update:mode", "ready", "request-image"],
2143
2151
  setup(e, { expose: n, emit: t }) {
2144
- const a = e, o = t, v = B(() => zt(a.locale, a.messages)), {
2152
+ const a = e, o = t, v = q(() => zt(a.locale, a.messages)), {
2145
2153
  editorMode: p,
2146
2154
  content: u,
2147
2155
  commitUserContent: l,
2148
2156
  monacoEditor: c,
2149
- monacoInstance: _,
2157
+ monacoInstance: T,
2150
2158
  milkdownEditorRef: d,
2151
- extractedFields: k,
2152
- toMilkdownMarkdown: S,
2153
- switchMode: V,
2154
- syncFromProp: y,
2155
- insertTextIntoActiveEditor: b,
2156
- handleMdAction: A,
2157
- onMilkdownMarkdownUpdated: E,
2158
- onMilkdownReady: C
2159
+ extractedFields: M,
2160
+ toMilkdownMarkdown: V,
2161
+ switchMode: z,
2162
+ syncFromProp: k,
2163
+ insertTextIntoActiveEditor: w,
2164
+ handleMdAction: I,
2165
+ onMilkdownMarkdownUpdated: S,
2166
+ onMilkdownReady: $
2159
2167
  } = Tn({
2160
2168
  initialContent: a.modelValue,
2161
2169
  initialMode: a.mode,
@@ -2163,102 +2171,102 @@ const xn = { class: "aimd-editor" }, Cn = {
2163
2171
  emitModelValue: (s) => o("update:modelValue", s),
2164
2172
  emitMode: (s) => o("update:mode", s)
2165
2173
  });
2166
- ee(() => a.modelValue, (s) => y(s)), ee(() => a.mode, (s) => {
2167
- s !== p.value && V(s);
2174
+ Z(() => a.modelValue, (s) => k(s)), Z(() => a.mode, (s) => {
2175
+ s !== p.value && z(s);
2168
2176
  });
2169
- const I = F(a.theme), W = B(() => a.keepInactiveEditorsMounted || p.value === "source"), le = B(() => a.keepInactiveEditorsMounted || p.value === "wysiwyg"), j = B(() => ft(v.value)), O = B(() => Vt(v.value)), K = F(!1), X = F("var"), se = F(!1), T = F("str"), z = F(), H = F(!1), J = F("step"), x = F();
2170
- function w(s) {
2171
- a.readonly || (J.value = "step", x.value = s, H.value = !0);
2177
+ const F = A(a.theme), W = q(() => a.keepInactiveEditorsMounted || p.value === "source"), G = q(() => a.keepInactiveEditorsMounted || p.value === "wysiwyg"), ee = q(() => ft(v.value)), Q = q(() => Vt(v.value)), j = A(!1), O = A("var"), K = A(!1), ae = A("str"), le = A(), se = A(!1), x = A("step"), f = A();
2178
+ function y(s) {
2179
+ a.readonly || (x.value = "step", f.value = s, se.value = !0);
2172
2180
  }
2173
- function $(s) {
2174
- a.readonly || (J.value = "check", x.value = s, H.value = !0);
2181
+ function C(s) {
2182
+ a.readonly || (x.value = "check", f.value = s, se.value = !0);
2175
2183
  }
2176
- function Q(s) {
2177
- a.readonly || (x.value ? x.value.apply(s) : b(`{{${J.value}|${s}}}${J.value === "step" ? `
2184
+ function R(s) {
2185
+ a.readonly || (f.value ? f.value.apply(s) : w(`{{${x.value}|${s}}}${x.value === "step" ? `
2178
2186
 
2179
2187
  ` : " "}`));
2180
2188
  }
2181
- function Z(s) {
2182
- a.readonly || (z.value = s, se.value = !0);
2189
+ function H(s) {
2190
+ a.readonly || (le.value = s, K.value = !0);
2183
2191
  }
2184
- function te(s) {
2185
- a.readonly || (z.value ? z.value.apply(s) : b(`{{var|${s}}}`));
2192
+ function X(s) {
2193
+ a.readonly || (le.value ? le.value.apply(s) : w(`{{var|${s}}}`));
2186
2194
  }
2187
- const re = B(() => {
2188
- const s = k.value;
2195
+ const oe = q(() => {
2196
+ const s = M.value;
2189
2197
  if (!s) return [];
2190
- const M = X.value;
2191
- return M === "ref_step" ? s.step || [] : M === "ref_var" ? s.var || [] : M === "ref_fig" ? s.ref_fig || [] : [];
2192
- }), ne = B(() => {
2193
- const s = k.value;
2194
- return s?.quiz ? s.quiz.map((M) => M.id) : [];
2198
+ const _ = O.value;
2199
+ return _ === "ref_step" ? s.step || [] : _ === "ref_var" ? s.var || [] : _ === "ref_fig" ? s.ref_fig || [] : [];
2200
+ }), ie = q(() => {
2201
+ const s = M.value;
2202
+ return s?.quiz ? s.quiz.map((_) => _.id) : [];
2195
2203
  });
2196
2204
  function fe(s) {
2197
2205
  if (!a.readonly) {
2198
2206
  if (s === "step" || s === "check") {
2199
- J.value = s, x.value = void 0, H.value = !0;
2207
+ x.value = s, f.value = void 0, se.value = !0;
2200
2208
  return;
2201
2209
  }
2202
2210
  if (s === "var") {
2203
2211
  de("str");
2204
2212
  return;
2205
2213
  }
2206
- X.value = s, K.value = !0;
2214
+ O.value = s, j.value = !0;
2207
2215
  }
2208
2216
  }
2209
2217
  function de(s) {
2210
- a.readonly || (z.value = void 0, T.value = s, se.value = !0);
2218
+ a.readonly || (le.value = void 0, ae.value = s, K.value = !0);
2211
2219
  }
2212
- function xe(s) {
2220
+ function Te(s) {
2213
2221
  if (!a.readonly) {
2214
2222
  if (s === "step") {
2215
- b(`{{step|${_e(Te(u.value), "step")}, check=True}}
2223
+ w(`{{step|${_e(xe(u.value), "step")}, check=True}}
2216
2224
 
2217
2225
  `);
2218
2226
  return;
2219
2227
  }
2220
2228
  if (s === "var") {
2221
- const M = _e(Te(u.value));
2222
- b(`{{var|${M}: str}}`);
2229
+ const _ = _e(xe(u.value));
2230
+ w(`{{var|${_}: str}}`);
2223
2231
  return;
2224
2232
  }
2225
- b(Dt(s, v.value));
2233
+ w(St(s, v.value));
2226
2234
  }
2227
2235
  }
2228
2236
  function Ke(s) {
2229
- b(s);
2237
+ w(s);
2230
2238
  }
2231
2239
  function Ce(s) {
2232
2240
  if (!(s instanceof HTMLElement)) return;
2233
- const M = s.getBoundingClientRect();
2241
+ const _ = s.getBoundingClientRect();
2234
2242
  return {
2235
- top: M.top,
2236
- right: M.right,
2237
- bottom: M.bottom,
2238
- left: M.left,
2239
- width: M.width,
2240
- height: M.height
2243
+ top: _.top,
2244
+ right: _.right,
2245
+ bottom: _.bottom,
2246
+ left: _.left,
2247
+ width: _.width,
2248
+ height: _.height
2241
2249
  };
2242
2250
  }
2243
- function $e(s, M) {
2251
+ function $e(s, _) {
2244
2252
  if (s === "image" && a.imageToolbarAction === "custom") {
2245
- o("request-image", { buttonRect: Ce(M.currentTarget) });
2253
+ o("request-image", { buttonRect: Ce(_.currentTarget) });
2246
2254
  return;
2247
2255
  }
2248
- A(s);
2256
+ I(s);
2249
2257
  }
2250
- const We = F(null), Qe = F(null);
2258
+ const We = A(null), Qe = A(null);
2251
2259
  function Je(s) {
2252
2260
  l(s);
2253
2261
  }
2254
2262
  function Ie(s) {
2255
2263
  o("ready", { monaco: s });
2256
2264
  }
2257
- function f(s, M) {
2258
- _.value = s, c.value = M;
2265
+ function g(s, _) {
2266
+ T.value = s, c.value = _;
2259
2267
  }
2260
2268
  function r(s) {
2261
- C(s), o("ready", { milkdown: s });
2269
+ $(s), o("ready", { milkdown: s });
2262
2270
  }
2263
2271
  return n({
2264
2272
  getContent: () => u.value,
@@ -2267,108 +2275,108 @@ const xn = { class: "aimd-editor" }, Cn = {
2267
2275
  c.value.setValue(s);
2268
2276
  else if (d.value)
2269
2277
  try {
2270
- d.value.action(Le(S(s)));
2278
+ d.value.action(Le(V(s)));
2271
2279
  } catch {
2272
2280
  }
2273
2281
  },
2274
2282
  getMode: () => p.value,
2275
- setMode: (s) => V(s),
2283
+ setMode: (s) => z(s),
2276
2284
  getMonacoEditor: () => c.value,
2277
2285
  getMilkdownEditor: () => d.value,
2278
- insertText: b
2279
- }), (s, M) => (g(), h("div", xn, [
2280
- e.showToolbar ? (g(), me(_n, {
2286
+ insertText: w
2287
+ }), (s, _) => (h(), b("div", Cn, [
2288
+ e.showToolbar ? (h(), me(xn, {
2281
2289
  key: 0,
2282
2290
  "show-top-bar": e.showTopBar,
2283
2291
  "show-md-toolbar": e.showMdToolbar,
2284
2292
  "show-aimd-toolbar": e.showAimdToolbar,
2285
- "editor-mode": G(p),
2293
+ "editor-mode": Y(p),
2286
2294
  "resolved-messages": v.value,
2287
- "localized-field-types": j.value,
2288
- "localized-md-toolbar-items": O.value,
2289
- onSwitchMode: G(V),
2295
+ "localized-field-types": ee.value,
2296
+ "localized-md-toolbar-items": Q.value,
2297
+ onSwitchMode: Y(z),
2290
2298
  onMdAction: $e,
2291
2299
  onOpenAimdDialog: fe,
2292
- onQuickInsertAimd: xe,
2300
+ onQuickInsertAimd: Te,
2293
2301
  onInsertInput: de
2294
- }, null, 8, ["show-top-bar", "show-md-toolbar", "show-aimd-toolbar", "editor-mode", "resolved-messages", "localized-field-types", "localized-md-toolbar-items", "onSwitchMode"])) : N("", !0),
2302
+ }, null, 8, ["show-top-bar", "show-md-toolbar", "show-aimd-toolbar", "editor-mode", "resolved-messages", "localized-field-types", "localized-md-toolbar-items", "onSwitchMode"])) : B("", !0),
2295
2303
  i("div", {
2296
2304
  class: "aimd-editor-panel",
2297
2305
  style: Ue({ minHeight: e.minHeight + "px" })
2298
2306
  }, [
2299
- W.value ? D((g(), h("div", Cn, [
2300
- oe(Lt, {
2307
+ W.value ? D((h(), b("div", $n, [
2308
+ ue(Lt, {
2301
2309
  ref_key: "sourceEditorRef",
2302
2310
  ref: We,
2303
- content: G(u),
2304
- theme: I.value,
2311
+ content: Y(u),
2312
+ theme: F.value,
2305
2313
  "min-height": e.minHeight,
2306
2314
  readonly: e.readonly,
2307
2315
  "monaco-options": e.monacoOptions,
2308
2316
  "resolved-messages": v.value,
2309
2317
  onContentChange: Je,
2310
2318
  onReady: Ie,
2311
- onMonacoLoaded: f
2319
+ onMonacoLoaded: g
2312
2320
  }, null, 8, ["content", "theme", "min-height", "readonly", "monaco-options", "resolved-messages"])
2313
2321
  ], 512)), [
2314
- [at, G(p) === "source"]
2315
- ]) : N("", !0),
2316
- le.value ? D((g(), h("div", $n, [
2317
- oe(St, {
2322
+ [at, Y(p) === "source"]
2323
+ ]) : B("", !0),
2324
+ G.value ? D((h(), b("div", In, [
2325
+ ue(Dt, {
2318
2326
  ref_key: "wysiwygEditorRef",
2319
2327
  ref: Qe,
2320
- content: G(u),
2328
+ content: Y(u),
2321
2329
  "min-height": e.minHeight,
2322
2330
  "enable-block-handle": e.enableBlockHandle,
2323
- active: G(p) === "wysiwyg",
2331
+ active: Y(p) === "wysiwyg",
2324
2332
  "resolved-messages": v.value,
2325
- "localized-field-types": j.value,
2333
+ "localized-field-types": ee.value,
2326
2334
  "field-display": e.fieldDisplay,
2327
2335
  "edit-input-fields": !0,
2328
2336
  readonly: e.readonly,
2329
- onMarkdownUpdated: G(E),
2337
+ onMarkdownUpdated: Y(S),
2330
2338
  onReady: r,
2331
2339
  onOpenAimdDialog: fe,
2332
- onEditInput: Z,
2333
- onEditStep: w,
2334
- onEditCheck: $
2340
+ onEditInput: H,
2341
+ onEditStep: y,
2342
+ onEditCheck: C
2335
2343
  }, null, 8, ["content", "min-height", "enable-block-handle", "active", "resolved-messages", "localized-field-types", "field-display", "readonly", "onMarkdownUpdated"])
2336
2344
  ], 512)), [
2337
- [at, G(p) === "wysiwyg"]
2338
- ]) : N("", !0)
2345
+ [at, Y(p) === "wysiwyg"]
2346
+ ]) : B("", !0)
2339
2347
  ], 4),
2340
- oe(Fi, {
2341
- visible: H.value,
2342
- "onUpdate:visible": M[0] || (M[0] = (q) => H.value = q),
2343
- "field-type": J.value,
2344
- content: G(u),
2345
- "field-content": x.value?.content,
2348
+ ue(Ai, {
2349
+ visible: se.value,
2350
+ "onUpdate:visible": _[0] || (_[0] = (E) => se.value = E),
2351
+ "field-type": x.value,
2352
+ content: Y(u),
2353
+ "field-content": f.value?.content,
2346
2354
  messages: v.value,
2347
- onSave: Q
2355
+ onSave: R
2348
2356
  }, null, 8, ["visible", "field-type", "content", "field-content", "messages"]),
2349
- oe(gi, {
2350
- visible: se.value,
2351
- "onUpdate:visible": M[1] || (M[1] = (q) => se.value = q),
2352
- content: G(u),
2353
- "field-content": z.value?.content,
2354
- "initial-preset": T.value,
2357
+ ue(hi, {
2358
+ visible: K.value,
2359
+ "onUpdate:visible": _[1] || (_[1] = (E) => K.value = E),
2360
+ content: Y(u),
2361
+ "field-content": le.value?.content,
2362
+ "initial-preset": ae.value,
2355
2363
  "var-type-plugins": e.varTypePlugins,
2356
2364
  messages: v.value,
2357
- onSave: te
2365
+ onSave: X
2358
2366
  }, null, 8, ["visible", "content", "field-content", "initial-preset", "var-type-plugins", "messages"]),
2359
- oe(Zs, {
2360
- visible: K.value,
2361
- "initial-type": X.value,
2367
+ ue(Gs, {
2368
+ visible: j.value,
2369
+ "initial-type": O.value,
2362
2370
  messages: v.value,
2363
- "ref-suggestions": re.value,
2371
+ "ref-suggestions": oe.value,
2364
2372
  "var-type-plugins": e.varTypePlugins,
2365
- "existing-quiz-ids": ne.value,
2366
- "onUpdate:visible": M[2] || (M[2] = (q) => K.value = q),
2373
+ "existing-quiz-ids": ie.value,
2374
+ "onUpdate:visible": _[2] || (_[2] = (E) => j.value = E),
2367
2375
  onInsert: Ke
2368
2376
  }, null, 8, ["visible", "initial-type", "messages", "ref-suggestions", "var-type-plugins", "existing-quiz-ids"])
2369
2377
  ]));
2370
2378
  }
2371
- }), In = { class: "aimd-editor-mode-switch" }, Fn = ["title"], An = ["innerHTML"], zn = ["title"], Vn = ["innerHTML"], Hn = /* @__PURE__ */ pe({
2379
+ }), Fn = { class: "aimd-editor-mode-switch" }, An = ["title"], zn = ["innerHTML"], Vn = ["title"], Dn = ["innerHTML"], Kn = /* @__PURE__ */ pe({
2372
2380
  __name: "AimdEditorTopBar",
2373
2381
  props: {
2374
2382
  editorMode: {},
@@ -2380,7 +2388,7 @@ const xn = { class: "aimd-editor" }, Cn = {
2380
2388
  source: '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>',
2381
2389
  wysiwyg: '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>'
2382
2390
  };
2383
- return (o, v) => (g(), h("div", In, [
2391
+ return (o, v) => (h(), b("div", Fn, [
2384
2392
  i("button", {
2385
2393
  class: ye(["aimd-editor-mode-btn", { active: e.editorMode === "source" }]),
2386
2394
  onClick: v[0] || (v[0] = (p) => t("switch-mode", "source")),
@@ -2389,9 +2397,9 @@ const xn = { class: "aimd-editor" }, Cn = {
2389
2397
  i("span", {
2390
2398
  class: "aimd-editor-mode-icon",
2391
2399
  innerHTML: a.source
2392
- }, null, 8, An),
2400
+ }, null, 8, zn),
2393
2401
  i("span", null, m(e.resolvedMessages.mode.source), 1)
2394
- ], 10, Fn),
2402
+ ], 10, An),
2395
2403
  i("button", {
2396
2404
  class: ye(["aimd-editor-mode-btn", { active: e.editorMode === "wysiwyg" }]),
2397
2405
  onClick: v[1] || (v[1] = (p) => t("switch-mode", "wysiwyg")),
@@ -2400,18 +2408,18 @@ const xn = { class: "aimd-editor" }, Cn = {
2400
2408
  i("span", {
2401
2409
  class: "aimd-editor-mode-icon",
2402
2410
  innerHTML: a.wysiwyg
2403
- }, null, 8, Vn),
2411
+ }, null, 8, Dn),
2404
2412
  i("span", null, m(e.resolvedMessages.mode.wysiwyg), 1)
2405
- ], 10, zn)
2413
+ ], 10, Vn)
2406
2414
  ]));
2407
2415
  }
2408
2416
  });
2409
2417
  export {
2410
- gi as A,
2411
- On as _,
2412
- _n as a,
2413
- Hn as b,
2414
- Zs as c,
2415
- Fi as d,
2418
+ hi as A,
2419
+ jn as _,
2420
+ xn as a,
2421
+ Kn as b,
2422
+ Gs as c,
2423
+ Ai as d,
2416
2424
  Tn as u
2417
2425
  };