@pie-element/math-inline 12.1.1-next.21 → 12.1.1-next.22

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,27 +1,27 @@
1
1
  import { ResponseTypes as e } from "./utils.js";
2
2
  import { SimpleQuestionBlock as t } from "./simple-question-block.js";
3
3
  import n from "react";
4
- import { isEmpty as r, isEqual as i } from "@pie-element/shared-lodash";
5
- import a from "prop-types";
6
- import o from "@pie-lib/correct-answer-toggle";
7
- import { HorizontalKeypad as s, applyStaticMath as c, mq as l, registerEmbed as u, updateSpans as d } from "@pie-lib/math-input";
8
- import * as f from "@pie-lib/render-ui";
9
- import { Collapsible as p, Feedback as m, PreviewPrompt as h, Readable as g, UiLayout as _, color as v, hasMedia as y, hasText as b } from "@pie-lib/render-ui";
10
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
11
- import { renderMath as C } from "@pie-element/shared-math-rendering-mathjax";
12
- import { styled as w } from "@mui/material/styles";
13
- import T from "@mui/material/Tooltip";
14
- import E from "@pie-lib/translator";
15
- import D from "react-dom";
4
+ import r from "prop-types";
5
+ import i from "@pie-lib/correct-answer-toggle";
6
+ import { HorizontalKeypad as a, applyStaticMath as o, mq as s, registerEmbed as c, updateSpans as l } from "@pie-lib/math-input";
7
+ import * as u from "@pie-lib/render-ui";
8
+ import { Collapsible as d, Feedback as f, PreviewPrompt as p, Readable as m, UiLayout as h, color as g, hasMedia as _, hasText as v } from "@pie-lib/render-ui";
9
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
10
+ import { renderMath as x } from "@pie-element/shared-math-rendering-mathjax";
11
+ import { styled as S } from "@mui/material/styles";
12
+ import C from "@mui/material/Tooltip";
13
+ import { isEmpty as ee, isEqual as w } from "@pie-element/shared-lodash";
14
+ import T from "@pie-lib/translator";
15
+ import E from "react-dom";
16
16
  //#region src/delivery/main.tsx
17
- function O(e) {
17
+ function D(e) {
18
18
  return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
19
19
  }
20
- function k(e, t) {
21
- return !e || O(e) ? e : O(e.default) ? e.default : t && O(e[t]) ? e[t] : t && O(e[t]?.default) ? e[t].default : e;
20
+ function O(e, t) {
21
+ return !e || D(e) ? e : D(e.default) ? e.default : t && D(e[t]) ? e[t] : t && D(e[t]?.default) ? e[t].default : e;
22
22
  }
23
- var A = k(_, "UiLayout") || k(F.UiLayout, "UiLayout"), j = k(h, "PreviewPrompt") || k(F.PreviewPrompt, "PreviewPrompt"), ee = k(g, "Readable") || k(F.Readable, "Readable"), M = k(p, "Collapsible") || k(F.Collapsible, "Collapsible"), te = k(m, "Feedback") || k(F.Feedback, "Feedback"), N = f, P = N.default, F = P && typeof P == "object" ? P : N, { translator: I } = E, L = !1, R = /\\newline/g, z = /{{response}}/gm, ne = 6, B = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
24
- function re(e = []) {
23
+ var k = O(h, "UiLayout") || O(P.UiLayout, "UiLayout"), A = O(p, "PreviewPrompt") || O(P.PreviewPrompt, "PreviewPrompt"), te = O(m, "Readable") || O(P.Readable, "Readable"), j = O(d, "Collapsible") || O(P.Collapsible, "Collapsible"), ne = O(f, "Feedback") || O(P.Feedback, "Feedback"), M = u, N = M.default, P = N && typeof N == "object" ? N : M, { translator: F } = T, I = !1, L = /\\newline/g, R = /{{response}}/gm, re = 6, z = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
24
+ function ie(e = []) {
25
25
  return e.map((e) => ({
26
26
  name: e,
27
27
  latex: e,
@@ -29,7 +29,7 @@ function re(e = []) {
29
29
  label: e
30
30
  }));
31
31
  }
32
- function V(e, t) {
32
+ function B(e, t) {
33
33
  let n = e;
34
34
  for (; n !== null;) {
35
35
  if (t && n === t) return !0;
@@ -37,44 +37,44 @@ function V(e, t) {
37
37
  }
38
38
  return !1;
39
39
  }
40
- function ie(e = [], t) {
40
+ function ae(e = [], t) {
41
41
  return Math.floor(e.length / 5) * 30 + (t === "miscellaneous" ? 600 : 500);
42
42
  }
43
- function ae(e, t) {
43
+ function oe(e, t) {
44
44
  let { config: n, disabled: r } = e || {}, { expression: i, responses: a, printMode: o, alwaysShowCorrect: s } = n || {};
45
45
  if (n && i) {
46
46
  let e = i;
47
47
  if (t.showCorrect) return a && a.length && a[0].answer;
48
48
  let n = 1;
49
- return (e || "").replace(z, function() {
49
+ return (e || "").replace(R, function() {
50
50
  let e = t.session.answers[`r${n}`];
51
51
  if (o && !s) {
52
52
  let e = "\\ \\ ".repeat(30) + "\\newline ";
53
53
  return `\\MathQuillMathField[r${n++}]{${e.repeat(3)}}`;
54
54
  }
55
55
  return r ? `\\embed{answerBlock}[r${n++}]` : `\\MathQuillMathField[r${n++}]{${e && e.value || ""}}`;
56
- }).replace(R, "\\embed{newLine}[]");
56
+ }).replace(L, "\\embed{newLine}[]");
57
57
  }
58
58
  }
59
- function H(e, t) {
59
+ function V(e, t) {
60
60
  let n = {};
61
61
  if (t.config && t.config.expression) {
62
62
  let r = 1;
63
- (t.config.expression || "").replace(z, () => {
63
+ (t.config.expression || "").replace(R, () => {
64
64
  n[`r${r}`] = { value: e && e.answers && e.answers[`r${r}`] && e.answers[`r${r}`].value || "" }, r += 1;
65
65
  });
66
66
  }
67
67
  return n;
68
68
  }
69
- var U = class extends n.Component {
69
+ var H = class extends n.Component {
70
70
  static propTypes = {
71
- session: a.object.isRequired,
72
- onSessionChange: a.func,
73
- model: a.object.isRequired
71
+ session: r.object.isRequired,
72
+ onSessionChange: r.func,
73
+ model: r.object.isRequired
74
74
  };
75
75
  constructor(e) {
76
76
  super(e);
77
- let { model: t, session: r } = e, i = H(r, t);
77
+ let { model: t, session: r } = e, i = V(r, t);
78
78
  this.state = {
79
79
  session: {
80
80
  ...e.session,
@@ -86,8 +86,8 @@ var U = class extends n.Component {
86
86
  };
87
87
  }
88
88
  UNSAFE_componentWillMount() {
89
- typeof window < "u" && (L ||= (u("answerBlock", (e) => {
90
- let t = W();
89
+ typeof window < "u" && (I ||= (c("answerBlock", (e) => {
90
+ let t = U();
91
91
  return {
92
92
  htmlString: `<div class="${t.blockContainer}">
93
93
  <div class="${t.blockResponse}" id="${e}Index">R</div>
@@ -106,25 +106,25 @@ var U = class extends n.Component {
106
106
  let n = this.root.querySelector(`#${t}`), i = this.root.querySelector(`#${t}Index`);
107
107
  if (n) {
108
108
  let a = r[t];
109
- c(n, a && a.value || ""), e.view && (n.parentElement.parentElement.classList.remove("correct"), n.parentElement.parentElement.classList.remove("incorrect")), i.textContent = "R";
109
+ o(n, a && a.value || ""), e.view && (n.parentElement.parentElement.classList.remove("correct"), n.parentElement.parentElement.classList.remove("incorrect")), i.textContent = "R";
110
110
  }
111
- }), C(this.root);
111
+ }), x(this.root);
112
112
  };
113
113
  countResponseOccurrences(e) {
114
114
  let t = e?.match(/\{\{response\}\}/g);
115
115
  return t ? t.length : 0;
116
116
  }
117
117
  UNSAFE_componentWillReceiveProps(e) {
118
- let { config: t } = this.props.model, { config: n = {} } = e.model || {}, { session: r } = this.props, { session: a = {} } = e || {};
119
- if (r && a && !i(r.answers, a.answers) && this.setState({ session: {
120
- ...a,
121
- answers: H(a, this.props.model)
122
- } }), t.note && t.language && t.language !== n.language && t.note === I.t("mathInline.primaryCorrectWithAlternates", { lng: t.language }) && (t.note = I.t("mathInline.primaryCorrectWithAlternates", { lng: n.language })), (t.env && t.env.mode !== "evaluate" || n.env && n.env.mode !== "evaluate") && this.setState({
118
+ let { config: t } = this.props.model, { config: n = {} } = e.model || {}, { session: r } = this.props, { session: i = {} } = e || {};
119
+ if (r && i && !w(r.answers, i.answers) && this.setState({ session: {
120
+ ...i,
121
+ answers: V(i, this.props.model)
122
+ } }), t.note && t.language && t.language !== n.language && t.note === F.t("mathInline.primaryCorrectWithAlternates", { lng: t.language }) && (t.note = F.t("mathInline.primaryCorrectWithAlternates", { lng: n.language })), (t.env && t.env.mode !== "evaluate" || n.env && n.env.mode !== "evaluate") && this.setState({
123
123
  ...this.state.session,
124
124
  showCorrect: !1
125
125
  }), n.alwaysShowCorrect && this.setState({ showCorrect: !0 }), this.countResponseOccurrences(t.expression) < this.countResponseOccurrences(n.expression) && setTimeout(() => this.updateAria(), 100), t && t.responses && t.responses.length !== n.responses.length || !t && n && n.responses || t && n && t.expression !== n.expression) {
126
126
  let e = {}, t = this.state.session.answers, r = 1;
127
- (n.expression || "").replace(z, () => {
127
+ (n.expression || "").replace(R, () => {
128
128
  e[`r${r}`] = { value: t && t[`r${r}`] && t[`r${r}`].value || "" }, r++;
129
129
  }), this.setState((t) => ({ session: {
130
130
  ...t.session,
@@ -134,11 +134,11 @@ var U = class extends n.Component {
134
134
  }
135
135
  }
136
136
  shouldComponentUpdate(e, t) {
137
- let n = i(this.props.model, e.model), r = i(this.state, t);
137
+ let n = w(this.props.model, e.model), r = w(this.state, t);
138
138
  return !n || !r;
139
139
  }
140
140
  componentDidMount() {
141
- this.handleAnswerBlockDomUpdate(), this.updateAria(), setTimeout(() => C(this.root), 100);
141
+ this.handleAnswerBlockDomUpdate(), this.updateAria(), setTimeout(() => x(this.root), 100);
142
142
  }
143
143
  componentDidUpdate(e, t) {
144
144
  this.handleAnswerBlockDomUpdate(), e.model?.config?.responseType !== this.props.model?.config?.responseType && this.updateAria();
@@ -163,7 +163,7 @@ var U = class extends n.Component {
163
163
  }, 0);
164
164
  };
165
165
  handleKeyDown = (e, t) => {
166
- let n = V(e.target, this.root), r = this.mqStatic && this.mqStatic.inputRef?.current ? this.mqStatic.inputRef?.current.contains(document.activeElement) : document.activeElement?.getAttribute("aria-label") === "Enter answer.", { key: i, type: a } = e;
166
+ let n = B(e.target, this.root), r = this.mqStatic && this.mqStatic.inputRef?.current ? this.mqStatic.inputRef?.current.contains(document.activeElement) : document.activeElement?.getAttribute("aria-label") === "Enter answer.", { key: i, type: a } = e;
167
167
  r && (i === "ArrowDown" || a === "click" || a === "touchstart") ? this.state.activeAnswerBlock !== t && n && (this.cleanupKeyDownListener(), this.setState({ activeAnswerBlock: t }, () => {
168
168
  this.onSubFieldFocus(t), i === "ArrowDown" && this.focusFirstKeypadElement();
169
169
  })) : e.key === "Escape" && this.setState({ activeAnswerBlock: "" });
@@ -216,7 +216,7 @@ var U = class extends n.Component {
216
216
  this.setState({ showCorrect: e }, this.handleAnswerBlockDomUpdate);
217
217
  };
218
218
  subFieldChanged = (e, t) => {
219
- if (d(), e) {
219
+ if (l(), e) {
220
220
  let n = window.scrollX, r = window.scrollY;
221
221
  this.setState((n) => ({ session: {
222
222
  ...n.session,
@@ -256,60 +256,60 @@ var U = class extends n.Component {
256
256
  };
257
257
  setTooltipRef(e) {
258
258
  setTimeout(() => {
259
- if (e && B) {
259
+ if (e && z) {
260
260
  let e = document.querySelector("[role='tooltip']");
261
261
  e && e.firstChild.setAttribute("tabindex", "-1");
262
262
  }
263
263
  }, 1);
264
264
  }
265
265
  render() {
266
- let { model: n } = this.props, { activeAnswerBlock: i, showCorrect: a, session: o, tooltipContainerRef: c } = this.state, { config: u, correctness: d, disabled: f, extraCSSRules: p, view: m, teacherInstructions: h, rationale: g, feedback: _, animationsDisabled: C, printMode: w, alwaysShowCorrect: E, language: O } = n || {};
267
- if (!u) return null;
268
- let { showNote: k, note: A, prompt: N, responses: P, responseType: F, equationEditor: L, customKeys: R, id: z, env: { mode: B, role: V } = {} } = u || {}, H = (a || B === "view" && V === "instructor") && k && A, U = r(P), W = !U && d && d.correctness !== "correct", he = f && d, J = re(R), Y = d && d.correct, X = ae(n, this.state) || "", Z = f && !d, ge = w && !E, Q = g && (b(g) || y(g)), $ = h && (b(h) || y(h)), _e = /* @__PURE__ */ x(fe, { children: /* @__PURE__ */ x(l.Static, {
266
+ let { model: n } = this.props, { activeAnswerBlock: r, showCorrect: i, session: o, tooltipContainerRef: c } = this.state, { config: l, correctness: u, disabled: d, extraCSSRules: f, view: p, teacherInstructions: m, rationale: h, feedback: x, animationsDisabled: S, printMode: w, alwaysShowCorrect: T, language: D } = n || {};
267
+ if (!l) return null;
268
+ let { showNote: O, note: k, prompt: M, responses: N, responseType: P, equationEditor: I, customKeys: L, id: R, env: { mode: z, role: B } = {} } = l || {}, V = (i || z === "view" && B === "instructor") && O && k, H = ee(N), U = !H && u && u.correctness !== "correct", ge = d && u, q = ie(L), J = u && u.correct, Y = oe(n, this.state) || "", X = d && !u, _e = w && !T, Z = h && (v(h) || _(h)), Q = m && (v(m) || _(m)), ve = /* @__PURE__ */ y(pe, { children: /* @__PURE__ */ y(s.Static, {
269
269
  className: "static-math",
270
270
  ref: (e) => {
271
271
  e && (this.mqStatic = e);
272
272
  },
273
- latex: X,
273
+ latex: Y,
274
274
  onSubFieldChange: this.subFieldChanged,
275
275
  getFieldName: this.getFieldName,
276
276
  setInput: this.setInput,
277
277
  onSubFieldFocus: this.onSubFieldFocus,
278
278
  onBlur: this.onBlur
279
- }) }), ve = /* @__PURE__ */ S(K, { children: [
280
- B === "gather" && /* @__PURE__ */ x(pe, { children: "Math Equation Response Question" }),
281
- Z && $ && (C ? /* @__PURE__ */ x("div", { dangerouslySetInnerHTML: { __html: h } }) : /* @__PURE__ */ x(q, {
279
+ }) }), $ = /* @__PURE__ */ b(G, { children: [
280
+ z === "gather" && /* @__PURE__ */ y(me, { children: "Math Equation Response Question" }),
281
+ X && Q && (S ? /* @__PURE__ */ y("div", { dangerouslySetInnerHTML: { __html: m } }) : /* @__PURE__ */ y(K, {
282
282
  labels: {
283
283
  hidden: "Show Teacher Instructions",
284
284
  visible: "Hide Teacher Instructions"
285
285
  },
286
- children: /* @__PURE__ */ x("div", { dangerouslySetInnerHTML: { __html: h } })
286
+ children: /* @__PURE__ */ y("div", { dangerouslySetInnerHTML: { __html: m } })
287
287
  })),
288
- N && /* @__PURE__ */ x(se, { children: /* @__PURE__ */ x(j, { prompt: N }) }),
289
- ge ? _e : /* @__PURE__ */ x(ee, {
288
+ M && /* @__PURE__ */ y(ce, { children: /* @__PURE__ */ y(A, { prompt: M }) }),
289
+ _e ? ve : /* @__PURE__ */ y(te, {
290
290
  false: !0,
291
- children: /* @__PURE__ */ S(de, {
291
+ children: /* @__PURE__ */ b(fe, {
292
292
  tabIndex: 0,
293
- children: [F === e.simple && /* @__PURE__ */ x(t, {
293
+ children: [P === e.simple && /* @__PURE__ */ y(t, {
294
294
  onSimpleResponseChange: this.onSimpleResponseChange,
295
- showCorrect: a,
296
- emptyResponse: U,
295
+ showCorrect: i,
296
+ emptyResponse: H,
297
297
  model: n,
298
298
  session: o,
299
299
  onSubFieldFocus: this.onSubFieldFocus,
300
- showKeypad: !!i
301
- }), F === e.advanced && /* @__PURE__ */ x(ue, {
300
+ showKeypad: !!r
301
+ }), P === e.advanced && /* @__PURE__ */ y(de, {
302
302
  ref: c,
303
- isIncorrect: !U && !Y && !a,
304
- isCorrect: !U && (Y || a),
305
- showCorrectness: !U && f && d && !m,
306
- correctAnswerShown: a,
307
- printCorrect: w && E,
308
- children: /* @__PURE__ */ x(T, {
303
+ isIncorrect: !H && !J && !i,
304
+ isCorrect: !H && (J || i),
305
+ showCorrectness: !H && d && u && !p,
306
+ correctAnswerShown: i,
307
+ printCorrect: w && T,
308
+ children: /* @__PURE__ */ y(C, {
309
309
  ref: (e) => this.setTooltipRef(e),
310
310
  enterTouchDelay: 0,
311
311
  interactive: !0,
312
- open: !!i,
312
+ open: !!r,
313
313
  slotProps: {
314
314
  popper: {
315
315
  container: c?.current || void 0,
@@ -355,21 +355,21 @@ var U = class extends n.Component {
355
355
  boxShadow: "none"
356
356
  } }
357
357
  },
358
- title: Object.keys(o.answers).map((e) => e === i && !(a || f) && /* @__PURE__ */ x(le, {
358
+ title: Object.keys(o.answers).map((e) => e === r && !(i || d) && /* @__PURE__ */ y(ue, {
359
359
  "data-keypad": !0,
360
- style: { width: ie(J, L) },
361
- children: /* @__PURE__ */ x(s, {
362
- additionalKeys: J,
363
- mode: L || ne,
360
+ style: { width: ae(q, I) },
361
+ children: /* @__PURE__ */ y(a, {
362
+ additionalKeys: q,
363
+ mode: I || re,
364
364
  onClick: this.onClick
365
365
  })
366
366
  }, e) || null),
367
- children: /* @__PURE__ */ x("div", { children: /* @__PURE__ */ x(l.Static, {
367
+ children: /* @__PURE__ */ y("div", { children: /* @__PURE__ */ y(s.Static, {
368
368
  className: "static-math",
369
369
  ref: (e) => {
370
370
  e && (this.mqStatic = e);
371
371
  },
372
- latex: X,
372
+ latex: Y,
373
373
  onSubFieldChange: this.subFieldChanged,
374
374
  getFieldName: this.getFieldName,
375
375
  setInput: this.setInput,
@@ -380,31 +380,31 @@ var U = class extends n.Component {
380
380
  })]
381
381
  })
382
382
  }),
383
- Z && H && /* @__PURE__ */ x(ce, { dangerouslySetInnerHTML: { __html: `<strong>Note:</strong> ${A}` } }),
384
- Z && Q && (C ? /* @__PURE__ */ x("div", { dangerouslySetInnerHTML: { __html: g } }) : /* @__PURE__ */ x(M, {
383
+ X && V && /* @__PURE__ */ y(le, { dangerouslySetInnerHTML: { __html: `<strong>Note:</strong> ${k}` } }),
384
+ X && Z && (S ? /* @__PURE__ */ y("div", { dangerouslySetInnerHTML: { __html: h } }) : /* @__PURE__ */ y(j, {
385
385
  labels: {
386
386
  hidden: "Show Rationale",
387
387
  visible: "Hide Rationale"
388
388
  },
389
- children: /* @__PURE__ */ x("div", { dangerouslySetInnerHTML: { __html: g } })
389
+ children: /* @__PURE__ */ y("div", { dangerouslySetInnerHTML: { __html: h } })
390
390
  }))
391
391
  ] });
392
- return he && (W || $ || Q || _) ? /* @__PURE__ */ x(G, {
393
- extraCSSRules: p,
392
+ return ge && (U || Q || Z || x) ? /* @__PURE__ */ y(W, {
393
+ extraCSSRules: f,
394
394
  ref: (e) => {
395
- let t = D.findDOMNode(e);
395
+ let t = E.findDOMNode(e);
396
396
  this.root = t || this.root;
397
397
  },
398
- children: /* @__PURE__ */ x(oe, {
398
+ children: /* @__PURE__ */ y(se, {
399
399
  interactive: !0,
400
400
  enterTouchDelay: 0,
401
401
  placement: "bottom-start",
402
402
  slotProps: {
403
403
  tooltip: { sx: (e) => ({
404
- background: `${v.primaryLight()} !important`,
405
- color: v.text(),
404
+ background: `${g.primaryLight()} !important`,
405
+ color: g.text(),
406
406
  padding: e.spacing(2),
407
- border: `1px solid ${v.secondary()}`,
407
+ border: `1px solid ${g.secondary()}`,
408
408
  fontSize: "16px",
409
409
  "& :not(.MathJax) > table tr": { "&:nth-child(2n)": { backgroundColor: "unset !important" } }
410
410
  }) },
@@ -416,52 +416,52 @@ var U = class extends n.Component {
416
416
  }]
417
417
  }
418
418
  },
419
- title: /* @__PURE__ */ S("div", { children: [
420
- /* @__PURE__ */ x(K, { children: W && /* @__PURE__ */ x(me, {
421
- language: O,
419
+ title: /* @__PURE__ */ b("div", { children: [
420
+ /* @__PURE__ */ y(G, { children: U && /* @__PURE__ */ y(he, {
421
+ language: D,
422
422
  show: !0,
423
- toggled: a,
423
+ toggled: i,
424
424
  onToggle: this.toggleShowCorrect
425
425
  }) }),
426
- $ && /* @__PURE__ */ x(q, {
426
+ Q && /* @__PURE__ */ y(K, {
427
427
  labels: {
428
428
  hidden: "Show Teacher Instructions",
429
429
  visible: "Hide Teacher Instructions"
430
430
  },
431
- children: /* @__PURE__ */ x(j, { prompt: h })
431
+ children: /* @__PURE__ */ y(A, { prompt: m })
432
432
  }, "collapsible-teacher-instructions"),
433
- H && b(A) && /* @__PURE__ */ x(q, {
433
+ V && v(k) && /* @__PURE__ */ y(K, {
434
434
  labels: {
435
- hidden: I.t("common:showNote", { lng: O }),
436
- visible: I.t("common:hideNote", { lng: O })
435
+ hidden: F.t("common:showNote", { lng: D }),
436
+ visible: F.t("common:hideNote", { lng: D })
437
437
  },
438
- children: /* @__PURE__ */ x(j, { prompt: A })
438
+ children: /* @__PURE__ */ y(A, { prompt: k })
439
439
  }, "collapsible-note"),
440
- Q && /* @__PURE__ */ x(q, {
440
+ Z && /* @__PURE__ */ y(K, {
441
441
  labels: {
442
442
  hidden: "Show Rationale",
443
443
  visible: "Hide Rationale"
444
444
  },
445
- children: /* @__PURE__ */ x(j, { prompt: g })
445
+ children: /* @__PURE__ */ y(A, { prompt: h })
446
446
  }, "collapsible-rationale"),
447
- _ && /* @__PURE__ */ x(te, {
448
- correctness: d.correctness,
449
- feedback: _
447
+ x && /* @__PURE__ */ y(ne, {
448
+ correctness: u.correctness,
449
+ feedback: x
450
450
  })
451
451
  ] }),
452
- children: ve
452
+ children: $
453
453
  })
454
- }) : /* @__PURE__ */ x(G, {
455
- id: z,
456
- extraCSSRules: p,
454
+ }) : /* @__PURE__ */ y(W, {
455
+ id: R,
456
+ extraCSSRules: f,
457
457
  ref: (e) => {
458
- let t = D.findDOMNode(e);
458
+ let t = E.findDOMNode(e);
459
459
  this.root = t || this.root;
460
460
  },
461
- children: ve
461
+ children: $
462
462
  });
463
463
  }
464
- }, W = () => ({
464
+ }, U = () => ({
465
465
  blockContainer: "block-container",
466
466
  blockResponse: "block-response",
467
467
  blockMath: "block-math"
@@ -490,8 +490,8 @@ if (typeof document < "u") {
490
490
  flex-basis: auto;
491
491
  }
492
492
  .block-math {
493
- color: ${v.text()};
494
- background-color: ${v.background()};
493
+ color: ${g.text()};
494
+ background-color: ${g.background()};
495
495
  padding: 4px !important;
496
496
  display: flex;
497
497
  align-items: center;
@@ -510,32 +510,32 @@ if (typeof document < "u") {
510
510
  overflow: hidden;
511
511
  }
512
512
  .static-math > .mq-root-block > .mq-editable-field {
513
- border-color: ${v.text()};
513
+ border-color: ${g.text()};
514
514
  }
515
515
  `, document.head.appendChild(t);
516
516
  }
517
517
  }
518
- var G = w(A)(() => ({
519
- color: v.text(),
520
- backgroundColor: v.background(),
518
+ var W = S(k)(() => ({
519
+ color: g.text(),
520
+ backgroundColor: g.background(),
521
521
  display: "inline-block"
522
- })), oe = w(T)({}), se = w("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), K = w("div")({
522
+ })), se = S(C)({}), ce = S("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), G = S("div")({
523
523
  width: "100%",
524
524
  position: "relative",
525
- backgroundColor: v.background(),
526
- color: v.text()
527
- }), ce = w("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), q = w(M)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), le = w("div")(({ theme: e }) => ({
525
+ backgroundColor: g.background(),
526
+ color: g.text()
527
+ }), le = S("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), K = S(j)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), ue = S("div")(({ theme: e }) => ({
528
528
  zIndex: 10,
529
529
  minWidth: "400px",
530
530
  marginTop: e.spacing(2)
531
- })), ue = w("div", { shouldForwardProp: (e) => ![
531
+ })), de = S("div", { shouldForwardProp: (e) => ![
532
532
  "isIncorrect",
533
533
  "isCorrect",
534
534
  "showCorrectness",
535
535
  "correctAnswerShown",
536
536
  "printCorrect"
537
537
  ].includes(e) })(({ theme: e, isIncorrect: t, isCorrect: n, showCorrectness: r, correctAnswerShown: i, printCorrect: a }) => {
538
- let o = t ? v.incorrect() : n ? v.correct() : void 0;
538
+ let o = t ? g.incorrect() : n ? g.correct() : void 0;
539
539
  return {
540
540
  maxWidth: "fit-content",
541
541
  padding: e.spacing(.25),
@@ -545,7 +545,7 @@ var G = w(A)(() => ({
545
545
  padding: e.spacing(1),
546
546
  letterSpacing: "0.5px"
547
547
  },
548
- ...a && { border: `2px solid ${v.correct()} !important` },
548
+ ...a && { border: `2px solid ${g.correct()} !important` },
549
549
  "& .mq-math-mode": {
550
550
  "& .mq-root-block": {
551
551
  paddingRight: "0 !important",
@@ -558,7 +558,7 @@ var G = w(A)(() => ({
558
558
  "& sup": { top: 0 }
559
559
  }
560
560
  };
561
- }), de = w("div")({
561
+ }), fe = S("div")({
562
562
  position: "relative",
563
563
  "& .mq-overarrow-inner": {
564
564
  border: "none !important",
@@ -588,19 +588,19 @@ var G = w(A)(() => ({
588
588
  paddingTop: "1.5px !important"
589
589
  },
590
590
  "& .mq-parallelogram": { lineHeight: .85 }
591
- }), fe = w("div")(({ theme: e }) => ({
591
+ }), pe = S("div")(({ theme: e }) => ({
592
592
  marginBottom: e.spacing(1),
593
593
  pointerEvents: "none"
594
- })), pe = w("h2")({
594
+ })), me = S("h2")({
595
595
  position: "absolute",
596
596
  left: "-10000px",
597
597
  top: "auto",
598
598
  width: "1px",
599
599
  height: "1px",
600
600
  overflow: "hidden"
601
- }), me = w(o)(({ theme: e }) => ({
602
- color: v.text(),
601
+ }), he = S(i)(({ theme: e }) => ({
602
+ color: g.text(),
603
603
  marginBottom: e.spacing(2)
604
604
  }));
605
605
  //#endregion
606
- export { U as Main, U as default };
606
+ export { H as Main, H as default };