hyperbook 0.113.1 → 0.113.3

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.
Files changed (55) hide show
  1. package/dist/asset-manifest.json +9 -9
  2. package/dist/assets/directive-bitflow/{EditorElement-zyz99U6n.js → EditorElement-BNwEKIvk.js} +258 -258
  3. package/dist/assets/directive-bitflow/{ReportElements-BnX14NtV.js → ReportElements-CAvHx5xm.js} +2 -2
  4. package/dist/assets/directive-bitflow/{bitLoaders-DIGwTcpd.js → bitLoaders-7qanePQL.js} +1138 -1073
  5. package/dist/assets/directive-bitflow/{dom-uYx_3K1r.js → dom-B6NPWBb1.js} +1558 -1551
  6. package/dist/assets/directive-bitflow/editor.js +3 -3
  7. package/dist/assets/directive-bitflow/flow.js +4 -4
  8. package/dist/assets/directive-bitflow/{index-BseSaQlX.js → index-4JaKZ7WT.js} +2 -2
  9. package/dist/assets/directive-bitflow/{index-e_8twLaN.js → index-6CQr_atd.js} +120 -120
  10. package/dist/assets/directive-bitflow/{index-COndsSPW.js → index-B9iG-a48.js} +9 -9
  11. package/dist/assets/directive-bitflow/{index-C5czXkRd.js → index-BFYoOtcY.js} +36 -36
  12. package/dist/assets/directive-bitflow/{index-YPMWh-1B.js → index-BI6aFdIS.js} +21 -21
  13. package/dist/assets/directive-bitflow/{index-D7m-hJZ9.js → index-Bf078mfo.js} +69 -69
  14. package/dist/assets/directive-bitflow/{index-Bf_FQRbK.js → index-BinE5Wvd.js} +19 -19
  15. package/dist/assets/directive-bitflow/{index-CFcRAa3F.js → index-BoX5-jkC.js} +31 -31
  16. package/dist/assets/directive-bitflow/{index-NyNuXp4C.js → index-BqRsXShM.js} +34 -34
  17. package/dist/assets/directive-bitflow/{index-Fr7yl4Vn.js → index-BxihQ8Oo.js} +21 -21
  18. package/dist/assets/directive-bitflow/{index-B3jMTk1o.js → index-C5YguHZU.js} +101 -101
  19. package/dist/assets/directive-bitflow/{index-XxGfBwJe.js → index-C8zwSmE6.js} +27 -27
  20. package/dist/assets/directive-bitflow/{index-BLcJNyog.js → index-C9JSBTNc.js} +91 -91
  21. package/dist/assets/directive-bitflow/{index-CjscG0z6.js → index-CCMI6UK4.js} +75 -75
  22. package/dist/assets/directive-bitflow/{index-CK1UMcfT.js → index-CGDt8H6s.js} +24 -24
  23. package/dist/assets/directive-bitflow/{index-xapm2BQE.js → index-Ca1v0pjV.js} +102 -92
  24. package/dist/assets/directive-bitflow/{index-IQHOi2fr.js → index-CaYn3Gmh.js} +31 -31
  25. package/dist/assets/directive-bitflow/{index-BpG316Ls.js → index-CbQue0If.js} +67 -67
  26. package/dist/assets/directive-bitflow/{index-CzdZQibq.js → index-CjH3h0OO.js} +79 -79
  27. package/dist/assets/directive-bitflow/{index-B7Z6Q-PQ.js → index-CkO3QfOS.js} +8 -8
  28. package/dist/assets/directive-bitflow/{index-BIJ7VfD2.js → index-Cz4i5rfe.js} +39 -39
  29. package/dist/assets/directive-bitflow/{index-8jTO-NJA.js → index-D0NtgeiX.js} +85 -85
  30. package/dist/assets/directive-bitflow/{index-DtsDy2By.js → index-D1C_1SPY.js} +14 -14
  31. package/dist/assets/directive-bitflow/{index-BdBBCZSy.js → index-D45u7EVR.js} +227 -194
  32. package/dist/assets/directive-bitflow/{index-cnRM_JDB.js → index-D9Ox4YpM.js} +33 -33
  33. package/dist/assets/directive-bitflow/{index-Bqf-kixT.js → index-DJ1w2Xcm.js} +46 -46
  34. package/dist/assets/directive-bitflow/{index-BQ5h4nDN.js → index-DUqW2fmV.js} +94 -94
  35. package/dist/assets/directive-bitflow/{index-ChgzyMHe.js → index-Deedj9EF.js} +25 -25
  36. package/dist/assets/directive-bitflow/{index-CZyaFdD2.js → index-Dg6nnY_v.js} +68 -68
  37. package/dist/assets/directive-bitflow/{index-kRpwcprB.js → index-DgxEzomz.js} +2 -2
  38. package/dist/assets/directive-bitflow/{index-D5yZNeIg.js → index-Dl0-ZAT5.js} +52 -52
  39. package/dist/assets/directive-bitflow/{index-DnVYIuen.js → index-Do6dmZyj.js} +42 -42
  40. package/dist/assets/directive-bitflow/{index-DjWNEPDL.js → index-DqnGC-DU.js} +31 -31
  41. package/dist/assets/directive-bitflow/{index-ivI25bnR.js → index-DwXXeSwk.js} +73 -73
  42. package/dist/assets/directive-bitflow/{index-Bf_NXJjq.js → index-b6qwcTj9.js} +15 -15
  43. package/dist/assets/directive-bitflow/{index-Fq7njn6_.js → index-d105UFQI.js} +58 -58
  44. package/dist/assets/directive-bitflow/{index-CW9iev-_.js → index-jijMWQB6.js} +8 -8
  45. package/dist/assets/directive-bitflow/{index-C_ZTSeqv.js → index-kxO5_U9Y.js} +24 -24
  46. package/dist/assets/directive-bitflow/{index-DoKlIgCD.js → index-p5AOgOal.js} +35 -35
  47. package/dist/assets/directive-bitflow/{index-CvCZVgKv.js → index-q2APknM6.js} +46 -46
  48. package/dist/assets/directive-bitflow/{index-eN2S_MLj.js → index-zVkWgm5I.js} +70 -70
  49. package/dist/assets/directive-bitflow/index.js +6 -6
  50. package/dist/assets/directive-bitflow/katex-DSLAjWZH-CHGN3Pr6.js +11314 -0
  51. package/dist/assets/directive-bitflow/katex-Dv-tcU2S-Dv-tcU2S.js +4 -0
  52. package/dist/assets/directive-bitflow/report.js +1 -1
  53. package/dist/assets/directive-bitflow/{shareableReport-ArQU1XjG.js → shareableReport-mdyEMdsJ.js} +6 -6
  54. package/dist/index.js +1 -1
  55. package/package.json +2 -2
@@ -1,15 +1,16 @@
1
- import { L as F, ak as P, a2 as x, a4 as $, a5 as K, ac as I, ad as q, ab as X, a9 as z, P as _, j as o, a as w, s as B, b as y, aa as Z } from "./dom-uYx_3K1r.js";
2
- import { v as H, A, y as Y, P as G, t as J, e as U, M as R, E as Q, L as ee, R as ae } from "./bitLoaders-DIGwTcpd.js";
1
+ import { P as A, ak as R, a2 as x, a4 as B, a5 as I, ac as K, ad as $, ab as X, a9 as z, Y as _, j as o, a as w, s as q, b as y, aa as Y } from "./dom-B6NPWBb1.js";
2
+ import { e as H, g as F, C as Z, M as U, r as G, P as J, F as P, B as Q, U as ee, H as ae } from "./bitLoaders-7qanePQL.js";
3
3
  let C;
4
- const te = async () => (C ??= import("./compute-engine.min.esm-B8GYsYEC-Bk85Berc.js").then(
5
- (e) => new e.ComputeEngine()
6
- ), C), je = () => {
4
+ const te = async () => (C ??= import("./compute-engine.min.esm-B8GYsYEC-Bk85Berc.js").then((e) => {
5
+ const a = new e.ComputeEngine();
6
+ return a.latexOptions = { ...a.latexOptions, decimalSeparator: "{,}" }, a;
7
+ }), C), Ne = () => {
7
8
  C = void 0;
8
9
  }, ne = (e, a) => {
9
10
  if (e === a) return !0;
10
11
  const r = Math.max(Math.abs(e), Math.abs(a));
11
12
  return Math.abs(e - a) <= 1e-9 * Math.max(1, r);
12
- }, D = async (e, a, r) => {
13
+ }, O = async (e, a, r) => {
13
14
  if (e.trim() === "" || a.trim() === "") return !1;
14
15
  const n = await te();
15
16
  let t, s;
@@ -24,11 +25,11 @@ const te = async () => (C ??= import("./compute-engine.min.esm-B8GYsYEC-Bk85Berc
24
25
  case "equivalent":
25
26
  return t.isEqual(s) === !0;
26
27
  case "value": {
27
- const d = t.N().re, b = s.N().re;
28
- if (typeof d != "number" || typeof b != "number" || !Number.isFinite(d) || !Number.isFinite(b))
28
+ const d = t.N().re, m = s.N().re;
29
+ if (typeof d != "number" || typeof m != "number" || !Number.isFinite(d) || !Number.isFinite(m))
29
30
  return !1;
30
31
  const c = r.tolerance ?? 0;
31
- return c > 0 ? Math.abs(d - b) <= c + Number.EPSILON : ne(d, b);
32
+ return c > 0 ? Math.abs(d - m) <= c + Number.EPSILON : ne(d, m);
32
33
  }
33
34
  default:
34
35
  return t.isSame(s);
@@ -38,9 +39,9 @@ const te = async () => (C ??= import("./compute-engine.min.esm-B8GYsYEC-Bk85Berc
38
39
  }
39
40
  }, le = async (e, a, r) => {
40
41
  for (const n of a)
41
- if (await D(e, n, r)) return !0;
42
+ if (await O(e, n, r)) return !0;
42
43
  return !1;
43
- }, g = "answer", re = K([
44
+ }, g = "answer", re = I([
44
45
  /**
45
46
  * The same expression, however it is written. `2x`, `x\cdot 2` and `2\times x`
46
47
  * match, and so do `\frac{2}{4}` and `\frac{1}{2}`; `2x^2+x-1` and
@@ -69,15 +70,15 @@ const te = async () => (C ??= import("./compute-engine.min.esm-B8GYsYEC-Bk85Berc
69
70
  }, E = (e) => {
70
71
  const a = M(e);
71
72
  return a.length > 0 ? a : [g];
72
- }, se = F({
73
+ }, se = A({
73
74
  /** What this blank should come to, as LaTeX. */
74
75
  expected: x().default(""),
75
76
  /**
76
77
  * Other answers that also count, for the times the comparison cannot be
77
78
  * asked to know. `\frac{1}{2}` and `0.5` need this under `symbolic`.
78
79
  */
79
- accepted: $(x()).default([])
80
- }), ie = F({
80
+ accepted: B(x()).default([])
81
+ }), ie = A({
81
82
  instruction: x().default(""),
82
83
  /**
83
84
  * The formula, as LaTeX. Empty, or without a `\placeholder`, gives one
@@ -85,7 +86,7 @@ const te = async () => (C ??= import("./compute-engine.min.esm-B8GYsYEC-Bk85Berc
85
86
  */
86
87
  latex: x().default(""),
87
88
  /** Name → what it should come to. Keyed by blank, or by `answer`. */
88
- blanks: P(x(), se).default({}),
89
+ blanks: R(x(), se).default({}),
89
90
  compare: re.default("symbolic"),
90
91
  /**
91
92
  * How close counts, when comparing values. Nothing means exactly, up to
@@ -101,14 +102,14 @@ const te = async () => (C ??= import("./compute-engine.min.esm-B8GYsYEC-Bk85Berc
101
102
  */
102
103
  virtualKeyboard: z().default(!0),
103
104
  /** Feedback attached to particular wrong answers, per blank. */
104
- blankFeedback: $(
105
- F({
105
+ blankFeedback: B(
106
+ A({
106
107
  blank: x().default(g),
107
108
  latex: x().default(""),
108
109
  feedback: X
109
110
  })
110
111
  ).default([]),
111
- evaluation: I.default(q)
112
+ evaluation: K.default($)
112
113
  }).check((e) => {
113
114
  const a = e.value;
114
115
  if (a.evaluation.mode !== "auto") return;
@@ -142,7 +143,7 @@ const te = async () => (C ??= import("./compute-engine.min.esm-B8GYsYEC-Bk85Berc
142
143
  path: ["tolerance"],
143
144
  message: "A tolerance only means something when answers are compared by value. Compare by value, or set the tolerance to nothing."
144
145
  });
145
- }), Ee = F({
146
+ }), He = A({
146
147
  /**
147
148
  * Blank name → the LaTeX the learner wrote in it.
148
149
  *
@@ -150,7 +151,7 @@ const te = async () => (C ??= import("./compute-engine.min.esm-B8GYsYEC-Bk85Berc
150
151
  * it can be given back to resume with. The MathJSON it parses to is derived
151
152
  * at marking time, and derived is where it stays.
152
153
  */
153
- prompts: P(x(), x()).default({})
154
+ prompts: R(x(), x()).default({})
154
155
  }), ce = (e, a) => {
155
156
  const r = e.blanks[a];
156
157
  return r ? [r.expected, ...r.accepted].map((n) => n.trim()).filter((n) => n !== "") : [];
@@ -162,28 +163,28 @@ const te = async () => (C ??= import("./compute-engine.min.esm-B8GYsYEC-Bk85Berc
162
163
  return { state: "unknown", allowRetry: !1 };
163
164
  const r = E(e.latex), n = a?.prompts ?? {}, t = [];
164
165
  for (const u of r) {
165
- const m = n[u] ?? "", h = ce(e, u);
166
+ const b = n[u] ?? "", h = ce(e, u);
166
167
  t.push({
167
168
  name: u,
168
- given: m,
169
- correct: h.length > 0 && await le(m, h, {
169
+ given: b,
170
+ correct: h.length > 0 && await le(b, h, {
170
171
  mode: e.compare,
171
172
  tolerance: e.tolerance
172
173
  })
173
174
  });
174
175
  }
175
- const s = t.filter((u) => u.correct).length, d = r.length > 0 && s === r.length, b = e.partialCredit && r.length > 0 ? { earned: s / r.length, possible: 1 } : { earned: d ? 1 : 0, possible: 1 }, c = [];
176
+ const s = t.filter((u) => u.correct).length, d = r.length > 0 && s === r.length, m = e.partialCredit && r.length > 0 ? { earned: s / r.length, possible: 1 } : { earned: d ? 1 : 0, possible: 1 }, c = [];
176
177
  if (e.evaluation.showFeedback)
177
178
  for (const u of e.blankFeedback) {
178
- const m = n[u.blank] ?? "";
179
- m.trim() !== "" && await D(m, u.latex, {
179
+ const b = n[u.blank] ?? "";
180
+ b.trim() !== "" && await O(b, u.latex, {
180
181
  mode: e.compare,
181
182
  tolerance: e.tolerance
182
183
  }) && c.push(u.feedback);
183
184
  }
184
185
  return {
185
186
  state: d ? "correct" : "wrong",
186
- score: b,
187
+ score: m,
187
188
  allowRetry: e.evaluation.enableRetry,
188
189
  feedback: c.length > 0 ? c : void 0,
189
190
  // Per blank, so the field can mark each one where it stands and a reviewer
@@ -219,7 +220,7 @@ const te = async () => (C ??= import("./compute-engine.min.esm-B8GYsYEC-Bk85Berc
219
220
  scoreLine: "{right} von {total} richtig.",
220
221
  keyboardHint: "Tippe wie gewohnt oder öffne mit der Tastaturschaltfläche die Symbole. / erzeugt einen Bruch, ^ eine Potenz."
221
222
  }
222
- }, be = ".bitflow-math{display:flex;flex-direction:column;gap:var(--bitflow-space-xsmall)}.bitflow-math-host{min-height:var(--bitflow-math-height, 3rem)}.bitflow-math-field{display:block;width:100%;padding:var(--bitflow-space-xsmall);font-size:var(--bitflow-font-size-large);color:var(--bitflow-color-text);background:var(--bitflow-color-surface);border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard)}.bitflow-math-field:focus-within{outline:none;box-shadow:var(--bitflow-shadow-outline)}.bitflow-math-field{--correct-color: var(--bitflow-color-correct);--incorrect-color: var(--bitflow-color-wrong);--caret-color: var(--bitflow-color-primary);--selection-background-color: var(--bitflow-color-primary-light);--placeholder-color: var(--bitflow-color-text-muted)}.bitflow-math-status{margin:0;font-size:var(--bitflow-font-size-small);color:var(--bitflow-color-text-muted)}.bitflow-math-outcomes{margin:0;font-size:var(--bitflow-font-size-small);color:var(--bitflow-color-text)}", me = {
223
+ }, me = ".bitflow-math{display:flex;flex-direction:column;gap:var(--bitflow-space-xsmall)}.bitflow-math-host{min-height:var(--bitflow-math-height, 3rem)}.bitflow-math-field{display:block;width:100%;padding:var(--bitflow-space-xsmall);font-size:var(--bitflow-font-size-large);color:var(--bitflow-color-text);background:var(--bitflow-color-surface);border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard)}.bitflow-math-field:focus-within{outline:none;box-shadow:var(--bitflow-shadow-outline)}.bitflow-math-field{--correct-color: var(--bitflow-color-correct);--incorrect-color: var(--bitflow-color-wrong);--caret-color: var(--bitflow-color-primary);--selection-background-color: var(--bitflow-color-primary-light);--placeholder-color: var(--bitflow-color-text-muted)}.bitflow-math-status{margin:0;font-size:var(--bitflow-font-size-small);color:var(--bitflow-color-text-muted)}.bitflow-math-outcomes{margin:0;font-size:var(--bitflow-font-size-small);color:var(--bitflow-color-text)}", be = {
223
224
  en: {
224
225
  instructionLabel: "Question",
225
226
  instructionHint: "Shown above the field. Markdown is allowed.",
@@ -284,24 +285,32 @@ const te = async () => (C ??= import("./compute-engine.min.esm-B8GYsYEC-Bk85Berc
284
285
  noBlanks: "Keine Lücken: die Lernenden bekommen ein Antwortfeld.",
285
286
  blanksFound: "{count} Lücke(n): {names}."
286
287
  }
288
+ }, he = (e) => {
289
+ try {
290
+ return new Intl.NumberFormat(e).formatToParts(1.5).find((a) => a.type === "decimal")?.value === "," ? "," : ".";
291
+ } catch {
292
+ return ".";
293
+ }
294
+ }, fe = (e, a) => {
295
+ e.MathfieldElement.decimalSeparator = he(a);
287
296
  };
288
297
  let S;
289
- const he = async () => (S ??= (async () => {
298
+ const pe = async () => (S ??= (async () => {
290
299
  if (!(typeof window > "u" || typeof customElements > "u") && !(typeof ResizeObserver > "u"))
291
300
  try {
292
301
  const e = await import("./mathlive.min-CJgy9wA_-zbEajnyR.js");
293
302
  if (!e?.MathfieldElement) return;
294
303
  e.MathfieldElement.fontsDirectory = null, e.MathfieldElement.soundsDirectory = null;
295
304
  const { default: a } = await import("./fonts-Bx4lzvdD-Bx4lzvdD.js");
296
- return B("bitflow-styles-mathlive-fonts", a), e;
305
+ return q("bitflow-styles-mathlive-fonts", a), e;
297
306
  } catch {
298
307
  return;
299
308
  }
300
- })(), S), Ne = () => {
309
+ })(), S), Fe = () => {
301
310
  S = void 0, j = void 0;
302
311
  };
303
312
  let j;
304
- const fe = (e) => {
313
+ const we = (e) => {
305
314
  const a = e.shadowRoot;
306
315
  if (!(!a || !("adoptedStyleSheets" in a)))
307
316
  try {
@@ -310,7 +319,7 @@ const fe = (e) => {
310
319
  )), a.adoptedStyleSheets = [...a.adoptedStyleSheets, j];
311
320
  } catch {
312
321
  }
313
- }, O = ({
322
+ }, D = ({
314
323
  data: e,
315
324
  answer: a,
316
325
  outcomes: r,
@@ -318,16 +327,16 @@ const fe = (e) => {
318
327
  readonly: t,
319
328
  onChange: s
320
329
  }) => {
321
- const d = (h, l) => y(L, h, n, l), [b, c] = w.useState(), [u, m] = w.useState("loading");
330
+ const d = (h, l) => y(L, h, n, l), [m, c] = w.useState(), [u, b] = w.useState("loading");
322
331
  return w.useEffect(() => {
323
332
  let h = !0;
324
- return he().then((l) => {
325
- h && (c(l), m(l ? "ready" : "unavailable"));
333
+ return pe().then((l) => {
334
+ h && (c(l), b(l ? "ready" : "unavailable"));
326
335
  }), () => {
327
336
  h = !1;
328
337
  };
329
- }, []), u === "loading" ? /* @__PURE__ */ o.jsx("p", { className: "bitflow-math-status", role: "status", children: d("loading") }) : u === "unavailable" || !b ? /* @__PURE__ */ o.jsx(
330
- we,
338
+ }, []), u === "loading" ? /* @__PURE__ */ o.jsx("p", { className: "bitflow-math-status", role: "status", children: d("loading") }) : u === "unavailable" || !m ? /* @__PURE__ */ o.jsx(
339
+ ge,
331
340
  {
332
341
  data: e,
333
342
  answer: a,
@@ -336,9 +345,9 @@ const fe = (e) => {
336
345
  onChange: s
337
346
  }
338
347
  ) : /* @__PURE__ */ o.jsx(
339
- pe,
348
+ ke,
340
349
  {
341
- module: b,
350
+ module: m,
342
351
  data: e,
343
352
  answer: a,
344
353
  outcomes: r,
@@ -347,7 +356,7 @@ const fe = (e) => {
347
356
  onChange: s
348
357
  }
349
358
  );
350
- }, pe = ({
359
+ }, ke = ({
351
360
  module: e,
352
361
  data: a,
353
362
  answer: r,
@@ -356,13 +365,14 @@ const fe = (e) => {
356
365
  readonly: s,
357
366
  onChange: d
358
367
  }) => {
359
- const b = (i, k) => y(L, i, t, k), c = w.useRef(null), u = w.useRef(null), m = de(a), h = E(a.latex), l = w.useId(), p = w.useRef(""), v = w.useRef({ onChange: d, blanks: m, names: h });
368
+ const m = (i, k) => y(L, i, t, k), c = w.useRef(null), u = w.useRef(null), b = de(a), h = E(a.latex), l = w.useId(), p = w.useRef(""), v = w.useRef({ onChange: d, blanks: b, names: h });
360
369
  w.useEffect(() => {
361
- v.current = { onChange: d, blanks: m, names: h };
370
+ v.current = { onChange: d, blanks: b, names: h };
362
371
  }), w.useEffect(() => {
363
372
  if (!c.current || u.current) return;
373
+ fe(e, t);
364
374
  const i = new e.MathfieldElement();
365
- if (i.mathVirtualKeyboardPolicy = a.virtualKeyboard ? "auto" : "manual", i.className = "bitflow-math-field", i.setAttribute("aria-label", b("answerLabel")), m) {
375
+ if (i.mathVirtualKeyboardPolicy = a.virtualKeyboard ? "auto" : "manual", i.className = "bitflow-math-field", i.setAttribute("aria-label", m("answerLabel")), b) {
366
376
  i.readOnly = !0, i.value = a.latex;
367
377
  for (const f of h)
368
378
  i.setPromptValue(f, r.prompts[f] ?? "");
@@ -374,7 +384,7 @@ const fe = (e) => {
374
384
  ) : { [g]: i.value };
375
385
  p.current = JSON.stringify(N), f.onChange({ prompts: N });
376
386
  };
377
- return i.addEventListener("input", k), c.current.append(i), fe(i), u.current = i, () => {
387
+ return i.addEventListener("input", k), c.current.append(i), we(i), u.current = i, () => {
378
388
  i.removeEventListener("input", k), i.remove(), u.current = null;
379
389
  };
380
390
  }, [e, a.latex]), w.useEffect(() => {
@@ -384,14 +394,14 @@ const fe = (e) => {
384
394
  Object.fromEntries(h.map((f) => [f, r.prompts[f] ?? ""]))
385
395
  );
386
396
  if (k !== p.current)
387
- if (p.current = k, m)
397
+ if (p.current = k, b)
388
398
  for (const f of h) i.setPromptValue(f, r.prompts[f] ?? "");
389
399
  else
390
400
  i.value = r.prompts[g] ?? "";
391
- }, [r, m, h]), w.useEffect(() => {
401
+ }, [r, b, h]), w.useEffect(() => {
392
402
  const i = u.current;
393
403
  if (i)
394
- if (m)
404
+ if (b)
395
405
  for (const k of h) {
396
406
  const f = n?.find((N) => N.name === k);
397
407
  i.setPromptState(
@@ -402,33 +412,33 @@ const fe = (e) => {
402
412
  }
403
413
  else
404
414
  i.readOnly = s === !0;
405
- }, [s, n, m, h]);
415
+ }, [s, n, b, h]);
406
416
  const W = n?.filter((i) => i.correct).length;
407
417
  return /* @__PURE__ */ o.jsxs("div", { className: "bitflow-math", children: [
408
- !m && /* @__PURE__ */ o.jsx("label", { className: "bitflow-label", htmlFor: l, children: b("answerLabel") }),
418
+ !b && /* @__PURE__ */ o.jsx("label", { className: "bitflow-label", htmlFor: l, children: m("answerLabel") }),
409
419
  /* @__PURE__ */ o.jsx("div", { className: "bitflow-math-host", ref: c, id: l }),
410
- !s && /* @__PURE__ */ o.jsx("p", { className: "bitflow-hint", children: b("keyboardHint") }),
420
+ !s && /* @__PURE__ */ o.jsx("p", { className: "bitflow-hint", children: m("keyboardHint") }),
411
421
  n && /* @__PURE__ */ o.jsxs("p", { className: "bitflow-math-outcomes", role: "status", children: [
412
- b("scoreLine", { right: W ?? 0, total: n.length }),
413
- m && /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
422
+ m("scoreLine", { right: W ?? 0, total: n.length }),
423
+ b && /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
414
424
  " ",
415
425
  n.map(
416
- (i) => `${b("blankLabel", { name: i.name })}: ${i.correct ? b("blankRight") : b("blankWrong")}`
426
+ (i) => `${m("blankLabel", { name: i.name })}: ${i.correct ? m("blankRight") : m("blankWrong")}`
417
427
  ).join(". ")
418
428
  ] })
419
429
  ] })
420
430
  ] });
421
- }, we = ({
431
+ }, ge = ({
422
432
  data: e,
423
433
  answer: a,
424
434
  locale: r,
425
435
  readonly: n,
426
436
  onChange: t
427
437
  }) => {
428
- const s = (c) => y(L, c, r), d = w.useId(), b = E(e.latex);
438
+ const s = (c) => y(L, c, r), d = w.useId(), m = E(e.latex);
429
439
  return /* @__PURE__ */ o.jsxs("div", { className: "bitflow-math", children: [
430
440
  /* @__PURE__ */ o.jsx("p", { className: "bitflow-math-status", role: "status", children: s("unavailable") }),
431
- b.map((c) => /* @__PURE__ */ o.jsxs("div", { className: "bitflow-field", children: [
441
+ m.map((c) => /* @__PURE__ */ o.jsxs("div", { className: "bitflow-field", children: [
432
442
  /* @__PURE__ */ o.jsx("label", { className: "bitflow-label", htmlFor: `${d}-${c}`, children: c === g ? s("latexLabel") : y(L, "blankLabel", r, { name: c }) }),
433
443
  /* @__PURE__ */ o.jsx(
434
444
  "input",
@@ -448,7 +458,7 @@ const fe = (e) => {
448
458
  /* @__PURE__ */ o.jsx("span", { className: "bitflow-hint", children: s("latexHint") })
449
459
  ] }, c))
450
460
  ] });
451
- }, ke = ({
461
+ }, xe = ({
452
462
  data: e,
453
463
  answer: a,
454
464
  result: r,
@@ -458,7 +468,7 @@ const fe = (e) => {
458
468
  }) => /* @__PURE__ */ o.jsxs("div", { className: "bitflow-stack", children: [
459
469
  /* @__PURE__ */ o.jsx(ee, { markdown: e.instruction }),
460
470
  /* @__PURE__ */ o.jsx(
461
- O,
471
+ D,
462
472
  {
463
473
  data: e,
464
474
  answer: { prompts: a?.prompts ?? {} },
@@ -468,8 +478,8 @@ const fe = (e) => {
468
478
  onChange: s
469
479
  }
470
480
  )
471
- ] }), ge = (e) => e.map((a) => `${a.blank}: ${a.latex}: ${a.feedback.message}`).join(`
472
- `), xe = (e) => e.split(`
481
+ ] }), ve = (e) => e.map((a) => `${a.blank}: ${a.latex}: ${a.feedback.message}`).join(`
482
+ `), ye = (e) => e.split(`
473
483
  `).filter((a) => a.trim() !== "").map((a) => {
474
484
  const [r, n, ...t] = a.split(":");
475
485
  return {
@@ -481,20 +491,20 @@ const fe = (e) => {
481
491
  severity: "info"
482
492
  }
483
493
  };
484
- }), ve = ({
494
+ }), Le = ({
485
495
  data: e,
486
496
  locale: a,
487
497
  onChange: r,
488
498
  errors: n
489
499
  }) => {
490
- const t = (l, p) => y(me, l, a, p), s = (l) => r({ ...e, ...l }), d = M(e.latex), b = E(e.latex), c = (l, p) => {
500
+ const t = (l, p) => y(be, l, a, p), s = (l) => r({ ...e, ...l }), d = M(e.latex), m = E(e.latex), c = (l, p) => {
491
501
  const v = e.blanks[l] ?? { expected: "", accepted: [] };
492
502
  s({ blanks: { ...e.blanks, [l]: { ...v, ...p } } });
493
503
  }, u = () => {
494
504
  let l = d.length + 1;
495
505
  for (; d.includes(`b${l}`); ) l += 1;
496
506
  s({ latex: `${e.latex}\\placeholder[b${l}]{}` });
497
- }, m = [
507
+ }, b = [
498
508
  { value: "symbolic", label: t("compareSymbolic") },
499
509
  { value: "equivalent", label: t("compareEquivalent") },
500
510
  { value: "value", label: t("compareValue") }
@@ -517,7 +527,7 @@ const fe = (e) => {
517
527
  hint: t("latexHint"),
518
528
  rows: 3,
519
529
  value: e.latex,
520
- error: A(n, "latex"),
530
+ error: F(n, "latex"),
521
531
  onChange: (l) => s({ latex: l })
522
532
  }
523
533
  ),
@@ -527,13 +537,13 @@ const fe = (e) => {
527
537
  ] }),
528
538
  /* @__PURE__ */ o.jsxs("fieldset", { className: "bitflow-field", children: [
529
539
  /* @__PURE__ */ o.jsx("legend", { className: "bitflow-label", children: d.length > 0 ? t("blanksHeading") : t("singleHeading") }),
530
- b.map((l) => /* @__PURE__ */ o.jsxs("div", { className: "bitflow-stack-small", children: [
540
+ m.map((l) => /* @__PURE__ */ o.jsxs("div", { className: "bitflow-stack-small bitflow-stack", children: [
531
541
  /* @__PURE__ */ o.jsx(
532
- Y,
542
+ Z,
533
543
  {
534
544
  label: l === g ? t("expectedLabel") : t("expectedFor", { name: l }),
535
545
  value: e.blanks[l]?.expected ?? "",
536
- error: A(n, `blanks.${l}`),
546
+ error: F(n, `blanks.${l}`),
537
547
  onChange: (p) => c(l, { expected: p })
538
548
  }
539
549
  ),
@@ -554,16 +564,16 @@ const fe = (e) => {
554
564
  ] }, l))
555
565
  ] }),
556
566
  /* @__PURE__ */ o.jsx(
557
- G,
567
+ U,
558
568
  {
559
569
  label: t("compareLabel"),
560
570
  hint: h,
561
571
  value: e.compare,
562
- options: m,
572
+ options: b,
563
573
  onChange: (l) => s({ compare: l, tolerance: l === "value" ? e.tolerance : 0 })
564
574
  }
565
575
  ),
566
- e.compare === "value" && /* @__PURE__ */ o.jsx(J, { label: t("toleranceLabel"), error: A(n, "tolerance"), children: (l) => /* @__PURE__ */ o.jsx(
576
+ e.compare === "value" && /* @__PURE__ */ o.jsx(G, { label: t("toleranceLabel"), error: F(n, "tolerance"), children: (l) => /* @__PURE__ */ o.jsx(
567
577
  "input",
568
578
  {
569
579
  ...l,
@@ -578,7 +588,7 @@ const fe = (e) => {
578
588
  /* @__PURE__ */ o.jsxs("div", { className: "bitflow-field", children: [
579
589
  /* @__PURE__ */ o.jsx("span", { className: "bitflow-label", children: t("previewLabel") }),
580
590
  /* @__PURE__ */ o.jsx(
581
- O,
591
+ D,
582
592
  {
583
593
  data: e,
584
594
  answer: { prompts: {} },
@@ -590,9 +600,9 @@ const fe = (e) => {
590
600
  e.latex
591
601
  )
592
602
  ] }),
593
- /* @__PURE__ */ o.jsxs(U, { summary: t("advanced"), children: [
603
+ /* @__PURE__ */ o.jsxs(J, { summary: t("advanced"), children: [
594
604
  /* @__PURE__ */ o.jsx(
595
- R,
605
+ P,
596
606
  {
597
607
  label: t("partialLabel"),
598
608
  hint: t("partialHint"),
@@ -601,7 +611,7 @@ const fe = (e) => {
601
611
  }
602
612
  ),
603
613
  /* @__PURE__ */ o.jsx(
604
- R,
614
+ P,
605
615
  {
606
616
  label: t("keyboardLabel"),
607
617
  hint: t("keyboardHint"),
@@ -615,9 +625,9 @@ const fe = (e) => {
615
625
  label: t("feedbackLabel"),
616
626
  hint: t("feedbackHint"),
617
627
  rows: 3,
618
- value: ge(e.blankFeedback),
619
- error: A(n, "blankFeedback"),
620
- onChange: (l) => s({ blankFeedback: xe(l) })
628
+ value: ve(e.blankFeedback),
629
+ error: F(n, "blankFeedback"),
630
+ onChange: (l) => s({ blankFeedback: ye(l) })
621
631
  }
622
632
  ),
623
633
  /* @__PURE__ */ o.jsx(
@@ -631,15 +641,15 @@ const fe = (e) => {
631
641
  ] })
632
642
  ] });
633
643
  };
634
- B("bitflow-styles-task-math", be);
644
+ q("bitflow-styles-task-math", me);
635
645
  const V = "task-math";
636
- Z({
646
+ Y({
637
647
  type: V,
638
648
  kind: "task",
639
649
  schema: ie,
640
650
  evaluate: ue,
641
- Task: ke,
642
- Form: ve,
651
+ Task: xe,
652
+ Form: Le,
643
653
  info: (e) => ({
644
654
  name: y(L, "name", e),
645
655
  description: y(L, "description", e)
@@ -653,32 +663,32 @@ Z({
653
663
  partialCredit: !0,
654
664
  virtualKeyboard: !0,
655
665
  blankFeedback: [],
656
- evaluation: q()
666
+ evaluation: $()
657
667
  })
658
668
  });
659
669
  ae(V);
660
670
  export {
661
- Ee as AnswerSchema,
671
+ He as AnswerSchema,
662
672
  oe as BLANK_PATTERN,
663
673
  se as BlankSchema,
664
674
  re as CompareModeSchema,
665
675
  ie as DataSchema,
666
- ve as Form,
667
- O as MathAnswer,
676
+ Le as Form,
677
+ D as MathAnswer,
668
678
  g as SINGLE_BLANK,
669
679
  V as TYPE,
670
- ke as Task,
680
+ xe as Task,
671
681
  ce as acceptedFor,
672
682
  E as answerNamesIn,
673
683
  M as blankNamesIn,
674
684
  te as computeEngine,
675
685
  ue as evaluate,
676
- me as formMessages,
686
+ be as formMessages,
677
687
  de as hasBlanks,
678
- he as loadMathfield,
688
+ pe as loadMathfield,
679
689
  le as matchesAny,
680
690
  L as messages,
681
- je as resetComputeEngine,
682
- Ne as resetMathfield,
683
- D as sameMath
691
+ Ne as resetComputeEngine,
692
+ Fe as resetMathfield,
693
+ O as sameMath
684
694
  };