@airalogy/aimd-renderer 2.5.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,37 +1,38 @@
1
- import { e as V, c as C, p as I, q as K, s as j, t as x, u as D } from "./processor-B2mByErv.js";
2
- import { D as ie, f as re, g as ne, h as le, a as ce, i as de, b as oe, j as me, k as pe, l as ue, m as fe, n as _e, r as ye, d as ge, o as he } from "./processor-B2mByErv.js";
1
+ import { e as F, c as M, p as I, s as B, u as H, v as z, w as V, t as j, x as O, y as K, z as N, A as Q } from "./processor-BOCQYqXE.js";
2
+ import { D as pe, f as ue, g as fe, h as _e, a as ye, i as ge, b as ve, j as he, k as be, l as Re, m as Ae, n as we, o as xe, r as Te, d as ke, q as qe } from "./processor-BOCQYqXE.js";
3
3
  import { h as e } from "vue";
4
- const W = /* @__PURE__ */ Symbol("symbol-field-event-key"), J = /* @__PURE__ */ Symbol("symbol-protocol-key"), G = /* @__PURE__ */ Symbol("draft-event-key"), X = /* @__PURE__ */ Symbol("symbol-report-event-key"), Y = /* @__PURE__ */ Symbol("symbol-bubble-menu-event-key");
5
- function B(t) {
6
- return t === "var_table" ? "table" : t;
4
+ import { A as $e, c as ze, a as Ee, b as Pe, n as Le, r as Ce } from "./readonly-record-renderer-CkzY7UvT.js";
5
+ const te = /* @__PURE__ */ Symbol("symbol-field-event-key"), ie = /* @__PURE__ */ Symbol("symbol-protocol-key"), se = /* @__PURE__ */ Symbol("draft-event-key"), re = /* @__PURE__ */ Symbol("symbol-report-event-key"), ne = /* @__PURE__ */ Symbol("symbol-bubble-menu-event-key");
6
+ function U(a) {
7
+ return a === "var_table" ? "table" : a;
7
8
  }
8
- const H = /\[\[([^\[\]\s]+)\]\]/g;
9
- function z(t, i) {
10
- if (t !== "blank")
9
+ const W = /\[\[([^\[\]\s]+)\]\]/g;
10
+ function E(a, i) {
11
+ if (a !== "blank")
11
12
  return [e("span", i)];
12
- const n = [];
13
+ const r = [];
13
14
  let l = 0;
14
- for (const r of i.matchAll(H)) {
15
- const o = r.index ?? 0, h = r[0], p = r[1];
16
- o > l && n.push(e("span", i.slice(l, o))), n.push(
15
+ for (const n of i.matchAll(W)) {
16
+ const d = n.index ?? 0, g = n[0], p = n[1];
17
+ d > l && r.push(e("span", i.slice(l, d))), r.push(
17
18
  e("span", {
18
19
  class: "aimd-quiz__blank-placeholder",
19
20
  "data-blank-key": p
20
21
  }, p)
21
- ), l = o + h.length;
22
+ ), l = d + g.length;
22
23
  }
23
- return l < i.length && n.push(e("span", i.slice(l))), n.length === 0 && n.push(e("span", i)), n;
24
+ return l < i.length && r.push(e("span", i.slice(l))), r.length === 0 && r.push(e("span", i)), r;
24
25
  }
25
- function P(t) {
26
- return typeof t.points == "number" && Number.isFinite(t.points) ? `${t.text} (${t.points})` : t.text;
26
+ function P(a) {
27
+ return typeof a.points == "number" && Number.isFinite(a.points) ? `${a.text} (${a.points})` : a.text;
27
28
  }
28
- function E(t) {
29
- return !Array.isArray(t.items) || t.items.length === 0 || !Array.isArray(t.options) || t.options.length === 0 ? [e("div", { class: "aimd-scale__empty" }, "Scale definition is incomplete.")] : t.display === "list" ? [
30
- e("div", { class: "aimd-scale__list" }, t.items.map(
29
+ function L(a) {
30
+ return !Array.isArray(a.items) || a.items.length === 0 || !Array.isArray(a.options) || a.options.length === 0 ? [e("div", { class: "aimd-scale__empty" }, "Scale definition is incomplete.")] : a.display === "list" ? [
31
+ e("div", { class: "aimd-scale__list" }, a.items.map(
31
32
  (i) => e("div", { class: "aimd-scale__list-item" }, [
32
33
  e("div", { class: "aimd-scale__item-stem" }, i.stem),
33
- e("ul", { class: "aimd-scale__item-options" }, t.options.map(
34
- (n) => e("li", P(n))
34
+ e("ul", { class: "aimd-scale__item-options" }, a.options.map(
35
+ (r) => e("li", P(r))
35
36
  ))
36
37
  ])
37
38
  ))
@@ -40,39 +41,83 @@ function E(t) {
40
41
  e("thead", [
41
42
  e("tr", [
42
43
  e("th", { class: "aimd-scale__item-header" }, "Item"),
43
- ...t.options.map((i) => e("th", P(i)))
44
+ ...a.options.map((i) => e("th", P(i)))
44
45
  ])
45
46
  ]),
46
- e("tbody", t.items.map(
47
+ e("tbody", a.items.map(
47
48
  (i) => e("tr", [
48
49
  e("th", { class: "aimd-scale__item-stem", scope: "row" }, i.stem),
49
- ...t.options.map(() => e("td", { class: "aimd-scale__cell" }, "○"))
50
+ ...a.options.map(() => e("td", { class: "aimd-scale__cell" }, "○"))
50
51
  ])
51
52
  ))
52
53
  ])
53
54
  ];
54
55
  }
55
- function L(t) {
56
- const i = Array.isArray(t.grading?.bands) ? t.grading.bands : [];
56
+ function C(a) {
57
+ const i = Array.isArray(a.grading?.bands) ? a.grading.bands : [];
57
58
  return i.length === 0 ? [] : [
58
59
  e("ul", { class: "aimd-scale__bands" }, i.map(
59
- (n) => e("li", `${n.min}-${n.max}: ${n.label}${n.interpretation ? ` · ${n.interpretation}` : ""}`)
60
+ (r) => e("li", `${r.min}-${r.max}: ${r.label}${r.interpretation ? ` · ${r.interpretation}` : ""}`)
60
61
  ))
61
62
  ];
62
63
  }
63
- function T(t, i, n, l) {
64
- const r = B(t), o = x(t, n);
65
- if (t === "var_table") {
66
- const p = [
64
+ function J(a) {
65
+ const i = K(a), r = N(a).map(Q).map((d) => d.trim()).filter(Boolean), l = r.length > 0 ? `e.g. ${r.join(", ")}` : void 0;
66
+ return {
67
+ tooltip: [i, l].filter((d) => !!d).join(`
68
+ `),
69
+ description: i,
70
+ examples: r
71
+ };
72
+ }
73
+ function G(a) {
74
+ if (!a.description && a.examples.length === 0)
75
+ return null;
76
+ const i = [];
77
+ return a.description && i.push(e("span", {
78
+ class: "aimd-field__metadata-popover-line"
79
+ }, a.description)), a.examples.length > 0 && i.push(e("span", { class: "aimd-field__metadata-examples" }, [
80
+ e("span", { class: "aimd-field__metadata-examples-label" }, "e.g."),
81
+ ...a.examples.map((r, l) => e("span", {
82
+ key: `${l}-${r}`,
83
+ class: "aimd-field__metadata-example"
84
+ }, r))
85
+ ])), e("span", {
86
+ class: "aimd-field__metadata-popover",
87
+ role: "tooltip"
88
+ }, i);
89
+ }
90
+ function $(a, i) {
91
+ const r = j(a, i), l = O(i) !== void 0 && r !== a, n = J(i), d = !!n.description || n.examples.length > 0;
92
+ return e("span", {
93
+ class: [
94
+ "aimd-field__name",
95
+ l || d ? "aimd-field__name--with-metadata" : void 0,
96
+ d ? "aimd-field__metadata-host" : void 0
97
+ ],
98
+ tabindex: d ? 0 : void 0,
99
+ "aria-label": n.tooltip || void 0
100
+ }, [
101
+ e("span", { class: "aimd-field__title" }, r),
102
+ l ? e("span", { class: "aimd-field__key" }, a) : null,
103
+ G(n)
104
+ ]);
105
+ }
106
+ function k(a, i, r, l, n) {
107
+ const d = U(a), g = z(a, r);
108
+ if (a === "var_table") {
109
+ const u = [
67
110
  e("div", { class: "aimd-field__header" }, [
68
- e("span", { class: "aimd-field__scope" }, n.scope.table),
69
- e("span", { class: "aimd-field__name" }, i)
111
+ e("span", { class: "aimd-field__scope" }, r.scope.table),
112
+ $(i, n)
70
113
  ])
71
114
  ];
72
- return l && l.length > 0 && p.push(
115
+ return l && l.length > 0 && u.push(
73
116
  e("table", { class: "aimd-field__table-preview" }, [
74
117
  e("thead", [
75
- e("tr", l.map((u) => e("th", u)))
118
+ e("tr", l.map((b) => e("th", {
119
+ "data-column-id": b
120
+ }, [$(b, n?.subvars?.[b])])))
76
121
  ]),
77
122
  e("tbody", [
78
123
  e("tr", l.map(() => e("td", "...")))
@@ -82,107 +127,107 @@ function T(t, i, n, l) {
82
127
  class: "aimd-field aimd-field--var-table",
83
128
  "data-aimd-type": "var_table",
84
129
  "data-aimd-id": i
85
- }, p);
130
+ }, u);
86
131
  }
87
132
  return e("span", {
88
- class: `aimd-field aimd-field--${r === "table" ? "var-table" : r}`,
89
- "data-aimd-type": r,
133
+ class: `aimd-field aimd-field--${d === "table" ? "var-table" : d}`,
134
+ "data-aimd-type": d,
90
135
  "data-aimd-id": i
91
136
  }, [
92
- e("span", { class: "aimd-field__scope" }, o),
93
- e("span", { class: "aimd-field__name" }, i)
137
+ e("span", { class: "aimd-field__scope" }, g),
138
+ $(i, n)
94
139
  ]);
95
140
  }
96
- function O(t) {
97
- const { getTokenProps: i, mode: n, components: l = {} } = t, r = C(t.locale, t.messages), {
98
- AIMDItem: o,
99
- AIMDTag: h,
141
+ function X(a) {
142
+ const { getTokenProps: i, mode: r, components: l = {} } = a, n = M(a.locale, a.messages), {
143
+ AIMDItem: d,
144
+ AIMDTag: g,
100
145
  AIMDStepRef: p,
101
146
  StepRenderer: u,
102
- CheckRenderer: q,
147
+ CheckRenderer: b,
103
148
  PreviewRenderer: _
104
- } = l, b = () => typeof n == "function" ? n() : n, v = () => b() === "preview", w = () => D(b(), t.quizPreview);
149
+ } = l, A = () => typeof r == "function" ? r() : r, R = () => A() === "preview", w = () => V(A(), a.quizPreview);
105
150
  return {
106
- var: async (d, y, f) => {
107
- const a = d, { id: s, scope: c } = a;
108
- if (v())
151
+ var: async (o, y, f) => {
152
+ const t = o, { id: s, scope: c } = t, m = t.definition;
153
+ if (R())
109
154
  return _ ? e(_, { type: "var" }, {
110
155
  default: () => f,
111
156
  name: () => s
112
- }) : T(c, s, r);
113
- if (i && o) {
114
- const m = await i({ meta: { node: { id: s, scope: c } } });
115
- if (m)
157
+ }) : k(c, s, n, void 0, m);
158
+ if (i && d) {
159
+ const v = await i({ meta: { node: { id: s, scope: c } } });
160
+ if (v)
116
161
  return e("span", {
117
162
  class: "aimd-field-wrapper aimd-field-wrapper--inline",
118
163
  id: `${c}-${s}`,
119
164
  "data-has-variable": "true"
120
- }, [e(o, m)]);
165
+ }, [e(d, v)]);
121
166
  }
122
- return T(c, s, r);
167
+ return k(c, s, n, void 0, m);
123
168
  },
124
- var_table: async (d, y, f) => {
125
- const a = d, { id: s, scope: c, columns: m } = a;
126
- if (v())
169
+ var_table: async (o, y, f) => {
170
+ const t = o, { id: s, scope: c, columns: m } = t, v = t.definition;
171
+ if (R())
127
172
  return _ ? e(_, { type: "var_table" }, {
128
173
  default: () => f,
129
174
  name: () => s
130
- }) : T(c, s, r, m);
131
- if (i && h) {
132
- const A = await i({ meta: { node: { id: s, scope: c } } });
133
- return e(h, { ...A, props: m });
175
+ }) : k(c, s, n, m, v);
176
+ if (i && g) {
177
+ const x = await i({ meta: { node: { id: s, scope: c } } });
178
+ return e(g, { ...x, props: m });
134
179
  }
135
- return T(c, s, r, m);
180
+ return k(c, s, n, m, v);
136
181
  },
137
- quiz: async (d, y, f) => {
138
- const a = d, { id: s, scope: c, quizType: m, stem: A, score: k } = a, S = j(m, a.mode, r);
139
- if (v()) {
182
+ quiz: async (o, y, f) => {
183
+ const t = o, { id: s, scope: c, quizType: m, stem: v, score: x } = t, q = H(m, t.mode, n);
184
+ if (R()) {
140
185
  if (_)
141
186
  return e(_, { type: "quiz" }, {
142
187
  default: () => f,
143
188
  name: () => s
144
189
  });
145
- const g = [
190
+ const h = [
146
191
  e("div", { class: "aimd-quiz__meta" }, [
147
- e("span", { class: "aimd-field__scope" }, x(c, r)),
192
+ e("span", { class: "aimd-field__scope" }, z(c, n)),
148
193
  e("span", { class: "aimd-field__name" }, s),
149
- e("span", { class: "aimd-field__type" }, `(${S})`),
150
- k !== void 0 ? e("span", { class: "aimd-quiz__score" }, r.quiz.score(k)) : null
194
+ e("span", { class: "aimd-field__type" }, `(${q})`),
195
+ x !== void 0 ? e("span", { class: "aimd-quiz__score" }, n.quiz.score(x)) : null
151
196
  ]),
152
- e("div", { class: "aimd-quiz__stem" }, z(m, A || s))
197
+ e("div", { class: "aimd-quiz__stem" }, E(m, v || s))
153
198
  ];
154
- typeof a.title == "string" && a.title.trim() && g.splice(1, 0, e("div", { class: "aimd-quiz__title" }, a.title)), typeof a.description == "string" && a.description.trim() && g.push(e("div", { class: "aimd-quiz__description" }, a.description)), (m === "choice" || m === "true_false") && Array.isArray(a.options) && a.options.length > 0 && g.push(
155
- e("ul", { class: "aimd-quiz__options" }, a.options.map(
156
- (R) => e("li", `${R.key}. ${R.text}`)
199
+ typeof t.title == "string" && t.title.trim() && h.splice(1, 0, e("div", { class: "aimd-quiz__title" }, t.title)), typeof t.description == "string" && t.description.trim() && h.push(e("div", { class: "aimd-quiz__description" }, t.description)), (m === "choice" || m === "true_false") && Array.isArray(t.options) && t.options.length > 0 && h.push(
200
+ e("ul", { class: "aimd-quiz__options" }, t.options.map(
201
+ (T) => e("li", `${T.key}. ${T.text}`)
157
202
  ))
158
- ), m === "scale" && (g.push(...E(a)), g.push(...L(a)));
159
- const $ = w();
160
- if ($.showAnswers && (m === "choice" || m === "true_false") && a.answer !== void 0) {
161
- const R = Array.isArray(a.answer) ? a.answer.join(", ") : String(a.answer);
162
- R.trim() && g.push(
163
- e("div", { class: "aimd-quiz__answer" }, r.quiz.answer(R))
203
+ ), m === "scale" && (h.push(...L(t)), h.push(...C(t)));
204
+ const S = w();
205
+ if (S.showAnswers && (m === "choice" || m === "true_false") && t.answer !== void 0) {
206
+ const T = Array.isArray(t.answer) ? t.answer.join(", ") : String(t.answer);
207
+ T.trim() && h.push(
208
+ e("div", { class: "aimd-quiz__answer" }, n.quiz.answer(T))
164
209
  );
165
210
  }
166
- return $.showAnswers && m === "blank" && Array.isArray(a.blanks) && a.blanks.length > 0 && g.push(
167
- e("ul", { class: "aimd-quiz__blanks" }, a.blanks.map(
168
- (R) => e("li", `${R.key}: ${R.answer}`)
211
+ return S.showAnswers && m === "blank" && Array.isArray(t.blanks) && t.blanks.length > 0 && h.push(
212
+ e("ul", { class: "aimd-quiz__blanks" }, t.blanks.map(
213
+ (T) => e("li", `${T.key}: ${T.answer}`)
169
214
  ))
170
- ), $.showRubric && m === "open" && typeof a.rubric == "string" && a.rubric.trim() && g.push(
171
- e("div", { class: "aimd-quiz__rubric" }, r.quiz.rubric(a.rubric))
215
+ ), S.showRubric && m === "open" && typeof t.rubric == "string" && t.rubric.trim() && h.push(
216
+ e("div", { class: "aimd-quiz__rubric" }, n.quiz.rubric(t.rubric))
172
217
  ), e("div", {
173
218
  class: "aimd-field aimd-field--quiz",
174
219
  "data-aimd-type": "quiz",
175
220
  "data-aimd-id": s
176
- }, g);
221
+ }, h);
177
222
  }
178
- if (i && o) {
179
- const g = await i({ meta: { node: { id: s, scope: c } } });
180
- if (g)
223
+ if (i && d) {
224
+ const h = await i({ meta: { node: { id: s, scope: c } } });
225
+ if (h)
181
226
  return e("span", {
182
227
  class: "aimd-field-wrapper aimd-field-wrapper--inline",
183
228
  id: `${c}-${s}`,
184
229
  "data-has-variable": "true"
185
- }, [e(o, g)]);
230
+ }, [e(d, h)]);
186
231
  }
187
232
  return e("div", {
188
233
  class: "aimd-field aimd-field--quiz",
@@ -190,63 +235,63 @@ function O(t) {
190
235
  "data-aimd-id": s
191
236
  }, [
192
237
  e("div", { class: "aimd-quiz__meta" }, [
193
- e("span", { class: "aimd-field__scope" }, x(c, r)),
238
+ e("span", { class: "aimd-field__scope" }, z(c, n)),
194
239
  e("span", { class: "aimd-field__name" }, s),
195
- e("span", { class: "aimd-field__type" }, `(${S})`)
240
+ e("span", { class: "aimd-field__type" }, `(${q})`)
196
241
  ]),
197
- ...typeof a.title == "string" && a.title.trim() ? [e("div", { class: "aimd-quiz__title" }, a.title)] : [],
198
- e("div", { class: "aimd-quiz__stem" }, z(m, A || s)),
199
- ...typeof a.description == "string" && a.description.trim() ? [e("div", { class: "aimd-quiz__description" }, a.description)] : [],
200
- ...m === "scale" ? [...E(a), ...L(a)] : []
242
+ ...typeof t.title == "string" && t.title.trim() ? [e("div", { class: "aimd-quiz__title" }, t.title)] : [],
243
+ e("div", { class: "aimd-quiz__stem" }, E(m, v || s)),
244
+ ...typeof t.description == "string" && t.description.trim() ? [e("div", { class: "aimd-quiz__description" }, t.description)] : [],
245
+ ...m === "scale" ? [...L(t), ...C(t)] : []
201
246
  ]);
202
247
  },
203
- step: async (d, y, f) => {
204
- const a = d, { id: s, scope: c, step: m, check: A } = a;
205
- if (v())
248
+ step: async (o, y, f) => {
249
+ const t = o, { id: s, scope: c, step: m, check: v } = t;
250
+ if (R())
206
251
  return _ ? e(_, { type: "step" }, {
207
252
  default: () => f,
208
253
  name: () => s
209
- }) : e("span", { class: "research-step__sequence" }, r.step.sequence(m));
254
+ }) : e("span", { class: "research-step__sequence" }, n.step.sequence(m));
210
255
  if (i && u) {
211
- const k = await i({ meta: { node: { id: s, scope: c } } }), S = await i({ meta: { node: { id: s, scope: c, type: "step-annotation" } } });
256
+ const x = await i({ meta: { node: { id: s, scope: c } } }), q = await i({ meta: { node: { id: s, scope: c, type: "step-annotation" } } });
212
257
  return e(u, {
213
- item: k,
214
- annotationItem: S,
258
+ item: x,
259
+ annotationItem: q,
215
260
  name: s,
216
261
  step: String(m),
217
- check: A
262
+ check: v
218
263
  }, {
219
264
  default: () => f
220
265
  });
221
266
  }
222
- return e("span", { class: "research-step__sequence" }, r.step.sequence(m));
267
+ return e("span", { class: "research-step__sequence" }, n.step.sequence(m));
223
268
  },
224
- check: async (d, y, f) => {
225
- const a = d, { id: s, scope: c, label: m } = a;
226
- if (v())
269
+ check: async (o, y, f) => {
270
+ const t = o, { id: s, scope: c, label: m } = t;
271
+ if (R())
227
272
  return _ ? e(_, { type: "check" }, {
228
273
  default: () => f,
229
274
  name: () => s
230
- }) : T(c, s, r);
231
- if (i && q) {
232
- const A = await i({ meta: { node: { id: s, scope: c } } }), k = await i({ meta: { node: { id: s, scope: c, type: "check-annotation" } } });
233
- return e(q, {
234
- item: A,
235
- annotationItem: k,
275
+ }) : k(c, s, n);
276
+ if (i && b) {
277
+ const v = await i({ meta: { node: { id: s, scope: c } } }), x = await i({ meta: { node: { id: s, scope: c, type: "check-annotation" } } });
278
+ return e(b, {
279
+ item: v,
280
+ annotationItem: x,
236
281
  name: s
237
282
  }, {
238
283
  default: () => f
239
284
  });
240
285
  }
241
- return T(c, s, r);
286
+ return k(c, s, n);
242
287
  },
243
- ref_step: (d, y) => {
244
- const { id: f } = d, a = "refTarget" in d ? d.refTarget : f, s = "stepSequence" in d && typeof d.stepSequence == "string" ? d.stepSequence : void 0, c = s ? r.step.reference(s) : a;
245
- return p ? e(p, { name: a, type: "step", stepSequence: s }) : e("a", {
288
+ ref_step: (o, y) => {
289
+ const { id: f } = o, t = "refTarget" in o ? o.refTarget : f, s = "stepSequence" in o && typeof o.stepSequence == "string" ? o.stepSequence : void 0, c = s ? n.step.reference(s) : t;
290
+ return p ? e(p, { name: t, type: "step", stepSequence: s }) : e("a", {
246
291
  class: "aimd-ref aimd-ref--step",
247
- href: `#step-${a}`,
292
+ href: `#step-${t}`,
248
293
  "data-aimd-step-sequence": s,
249
- title: a
294
+ title: t
250
295
  }, [
251
296
  e("span", { class: "aimd-ref__content" }, [
252
297
  e("span", { class: "aimd-field aimd-field--step aimd-field--readonly" }, [
@@ -255,51 +300,51 @@ function O(t) {
255
300
  ])
256
301
  ]);
257
302
  },
258
- ref_var: (d, y) => {
259
- const { id: f } = d, a = "refTarget" in d ? d.refTarget : f, s = y.mode === "edit" ? F(y.value, a) : null;
303
+ ref_var: (o, y) => {
304
+ const { id: f } = o, t = "refTarget" in o ? o.refTarget : f, s = y.mode === "edit" ? Y(y.value, t) : null;
260
305
  return p ? e(p, {
261
- name: a,
306
+ name: t,
262
307
  type: "var",
263
308
  contextValue: y.value,
264
309
  displayValue: s ?? void 0
265
310
  }) : y.mode !== "edit" ? e("a", {
266
311
  class: "aimd-ref aimd-ref--var",
267
- href: `#var-${a}`,
268
- title: a
312
+ href: `#var-${t}`,
313
+ title: t
269
314
  }, [
270
315
  e("span", { class: "aimd-ref__icon" }, "📌"),
271
- e("span", { class: "aimd-ref__name" }, a)
316
+ e("span", { class: "aimd-ref__name" }, t)
272
317
  ]) : e("span", {
273
318
  class: "aimd-ref aimd-ref--var",
274
- "data-aimd-ref": a,
275
- title: a
319
+ "data-aimd-ref": t,
320
+ title: t
276
321
  }, [
277
322
  e("span", { class: "aimd-ref__content" }, [
278
323
  s !== null ? e("span", {
279
324
  class: "aimd-field aimd-field--var aimd-field--readonly",
280
- "data-aimd-id": a,
325
+ "data-aimd-id": t,
281
326
  "data-aimd-scope": "var"
282
327
  }, [
283
328
  e("span", { class: "aimd-field__value" }, s)
284
329
  ]) : e("span", { class: "aimd-field aimd-field--var" }, [
285
- e("span", { class: "aimd-field__scope" }, r.scope.var),
286
- e("span", { class: "aimd-field__name" }, a)
330
+ e("span", { class: "aimd-field__scope" }, n.scope.var),
331
+ e("span", { class: "aimd-field__name" }, t)
287
332
  ])
288
333
  ])
289
334
  ]);
290
335
  }
291
336
  };
292
337
  }
293
- function M(t) {
294
- return typeof t == "object" && t !== null && !Array.isArray(t);
338
+ function D(a) {
339
+ return typeof a == "object" && a !== null && !Array.isArray(a);
295
340
  }
296
- function F(t, i) {
297
- const n = t?.var?.[i], l = M(n) && "value" in n ? n.value : n;
341
+ function Y(a, i) {
342
+ const r = a?.var?.[i], l = D(r) && "value" in r ? r.value : r;
298
343
  if (l == null || l === "")
299
344
  return null;
300
345
  if (Array.isArray(l))
301
- return l.map((r) => String(r)).join(", ");
302
- if (M(l))
346
+ return l.map((n) => String(n)).join(", ");
347
+ if (D(l))
303
348
  try {
304
349
  return JSON.stringify(l);
305
350
  } catch {
@@ -307,34 +352,34 @@ function F(t, i) {
307
352
  }
308
353
  return String(l);
309
354
  }
310
- function N(t) {
311
- const { getStaticResearchAssets: i, highlighter: n, components: l = {} } = t, { AssetRenderer: r, EmbeddedRenderer: o, MermaidBlock: h } = l, p = {};
312
- return (r || i) && (p.img = (u, q, _) => {
313
- const { src: b, alt: v } = u.properties || {};
314
- return r ? e(r, {
315
- src: b,
316
- alt: v,
355
+ function Z(a) {
356
+ const { getStaticResearchAssets: i, highlighter: r, components: l = {} } = a, { AssetRenderer: n, EmbeddedRenderer: d, MermaidBlock: g } = l, p = {};
357
+ return (n || i) && (p.img = (u, b, _) => {
358
+ const { src: A, alt: R } = u.properties || {};
359
+ return n ? e(n, {
360
+ src: A,
361
+ alt: R,
317
362
  getStaticResearchAssets: i
318
- }) : e("img", { src: b, alt: v, class: "aimd-image", loading: "lazy" });
319
- }), p.pre = (u, q, _) => {
320
- const b = u.children.find(
363
+ }) : e("img", { src: A, alt: R, class: "aimd-image", loading: "lazy" });
364
+ }), p.pre = (u, b, _) => {
365
+ const A = u.children.find(
321
366
  (s) => s.type === "element" && s.tagName === "code"
322
367
  );
323
- if (!b)
324
- return e("pre", {}, q);
325
- const v = b.properties?.className;
368
+ if (!A)
369
+ return e("pre", {}, b);
370
+ const R = A.properties?.className;
326
371
  let w = "text";
327
- if (Array.isArray(v)) {
328
- const s = v.find((c) => typeof c == "string" && c.startsWith("language-"));
372
+ if (Array.isArray(R)) {
373
+ const s = R.find((c) => typeof c == "string" && c.startsWith("language-"));
329
374
  s && typeof s == "string" && (w = s.replace("language-", ""));
330
375
  }
331
- const d = b.children.map((s) => s.type === "text" ? s.value : "").join(""), y = d.split(/\n/)[0].trim();
332
- if ((w === "mermaid" || y === "gantt" || y === "sequenceDiagram" || /^graph (?:TB|BT|RL|LR|TD);?$/.test(y)) && h)
333
- return e(h, { code: d });
334
- const a = typeof n == "function" ? n() : n;
335
- if (a)
376
+ const o = A.children.map((s) => s.type === "text" ? s.value : "").join(""), y = o.split(/\n/)[0].trim();
377
+ if ((w === "mermaid" || y === "gantt" || y === "sequenceDiagram" || /^graph (?:TB|BT|RL|LR|TD);?$/.test(y)) && g)
378
+ return e(g, { code: o });
379
+ const t = typeof r == "function" ? r() : r;
380
+ if (t)
336
381
  try {
337
- const s = a.codeToHtml(d, {
382
+ const s = t.codeToHtml(o, {
338
383
  lang: w,
339
384
  theme: "github-dark"
340
385
  });
@@ -349,37 +394,37 @@ function N(t) {
349
394
  return e(
350
395
  "pre",
351
396
  { class: `language-${w}` },
352
- e("code", { class: `language-${w}` }, d)
397
+ e("code", { class: `language-${w}` }, o)
353
398
  );
354
- }, o && (p.iframe = (u, q, _) => e(o, {
399
+ }, d && (p.iframe = (u, b, _) => e(d, {
355
400
  contentProps: { ...u.properties, credentialless: !0 },
356
401
  component: "iframe"
357
- }), p.video = (u, q, _) => e(o, {
402
+ }), p.video = (u, b, _) => e(d, {
358
403
  contentProps: u.properties,
359
404
  component: "video"
360
405
  })), p;
361
406
  }
362
- function Z(t) {
363
- const i = () => typeof t.mode == "function" ? t.mode() : t.mode, n = () => D(i(), t.quizPreview), l = V(t.locale), r = C(l, t.messages), o = O(t), h = N(t), p = {
407
+ function le(a) {
408
+ const i = () => typeof a.mode == "function" ? a.mode() : a.mode, r = () => V(i(), a.quizPreview), l = F(a.locale), n = M(l, a.messages), d = X(a), g = Z(a), p = {
364
409
  locale: l,
365
- messages: r,
410
+ messages: n,
366
411
  context: {
367
412
  mode: i() === "timeline" ? "preview" : i(),
368
413
  readonly: i() === "preview",
369
- quizPreview: n(),
414
+ quizPreview: r(),
370
415
  locale: l,
371
- messages: r
416
+ messages: n
372
417
  },
373
- aimdRenderers: o,
374
- elementRenderers: h
418
+ aimdRenderers: d,
419
+ elementRenderers: g
375
420
  };
376
421
  return {
377
422
  async render(u) {
378
- return K(u, {
423
+ return B(u, {
379
424
  gfm: !0,
380
425
  math: !0,
381
426
  breaks: !0,
382
- assignerVisibility: t.assignerVisibility,
427
+ assignerVisibility: a.assignerVisibility,
383
428
  ...p
384
429
  });
385
430
  },
@@ -389,51 +434,58 @@ function Z(t) {
389
434
  vueOptions: p
390
435
  };
391
436
  }
392
- function ee(t) {
393
- const { parent: i, sequence: n, level: l } = t;
394
- let r = String(n + 1);
437
+ function de(a) {
438
+ const { parent: i, sequence: r, level: l } = a;
439
+ let n = String(r + 1);
395
440
  if (l === 1)
396
- return r;
397
- let o = i;
398
- for (; o; )
399
- r = `${o.sequence + 1}.${r}`, o = o.parent;
400
- return r;
441
+ return n;
442
+ let d = i;
443
+ for (; d; )
444
+ n = `${d.sequence + 1}.${n}`, d = d.parent;
445
+ return n;
401
446
  }
402
- function te(t) {
403
- if (t.startsWith("var_table")) {
404
- const [o, h, p, ...u] = t.split(/(\\)?\|/g);
405
- return [{ type: o, name: `${p}|${u.filter(Boolean).join(",")}` }];
447
+ function ce(a) {
448
+ if (a.startsWith("var_table")) {
449
+ const [d, g, p, ...u] = a.split(/(\\)?\|/g);
450
+ return [{ type: d, name: `${p}|${u.filter(Boolean).join(",")}` }];
406
451
  }
407
- const [n, l, r] = t.split(/(\\)?\|/);
408
- return [{ type: n, name: r }];
452
+ const [r, l, n] = a.split(/(\\)?\|/);
453
+ return [{ type: r, name: n }];
409
454
  }
410
455
  export {
411
- ie as DEFAULT_AIMD_RENDERER_LOCALE,
412
- Y as bubbleMenuEventKey,
413
- C as createAimdRendererMessages,
414
- re as createAssetRenderer,
415
- ne as createCodeBlockRenderer,
416
- le as createComponentRenderer,
417
- ce as createCustomElementAimdRenderer,
418
- de as createEmbeddedRenderer,
419
- oe as createHtmlProcessor,
420
- me as createMermaidRenderer,
421
- pe as createRenderer,
422
- ue as createStepCardRenderer,
423
- Z as createUnifiedTokenRenderer,
424
- fe as defaultRenderer,
425
- G as draftEventKey,
426
- W as fieldEventKey,
427
- j as getAimdRendererQuizTypeLabel,
428
- ee as getFinalIndent,
429
- _e as hastToVue,
456
+ $e as AIMD_RECORD_RENDER_SCOPES,
457
+ pe as DEFAULT_AIMD_RENDERER_LOCALE,
458
+ ne as bubbleMenuEventKey,
459
+ M as createAimdRendererMessages,
460
+ ue as createAssetRenderer,
461
+ fe as createCodeBlockRenderer,
462
+ _e as createComponentRenderer,
463
+ ye as createCustomElementAimdRenderer,
464
+ ge as createEmbeddedRenderer,
465
+ ve as createHtmlProcessor,
466
+ he as createMermaidRenderer,
467
+ ze as createReadonlyRecordAimdRenderers,
468
+ Ee as createReadonlyRecordElementRenderers,
469
+ Pe as createReadonlyRecordRenderContext,
470
+ be as createRenderer,
471
+ Re as createStepCardRenderer,
472
+ le as createUnifiedTokenRenderer,
473
+ Ae as defaultRenderer,
474
+ se as draftEventKey,
475
+ te as fieldEventKey,
476
+ H as getAimdRendererQuizTypeLabel,
477
+ de as getFinalIndent,
478
+ we as hastToVue,
479
+ xe as loadShikiHighlighter,
480
+ Le as normalizeRecordRenderValue,
430
481
  I as parseAndExtract,
431
- te as parseFieldTag,
432
- J as protocolKey,
433
- ye as renderToHtml,
434
- ge as renderToHtmlSync,
435
- he as renderToVNodes,
436
- K as renderToVue,
437
- X as reportEventKey,
438
- V as resolveAimdRendererLocale
482
+ ce as parseFieldTag,
483
+ ie as protocolKey,
484
+ Ce as renderReadonlyRecordToVue,
485
+ Te as renderToHtml,
486
+ ke as renderToHtmlSync,
487
+ qe as renderToVNodes,
488
+ B as renderToVue,
489
+ re as reportEventKey,
490
+ F as resolveAimdRendererLocale
439
491
  };