@pie-element/categorize 14.0.2-next.20261007003844 → 14.0.2

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.
@@ -6,8 +6,9 @@ import a from "prop-types";
6
6
  import { styled as o } from "@mui/material/styles";
7
7
  import { uid as s } from "@pie-lib/drag";
8
8
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
+ import { sanitizeModelHtml as u } from "@pie-element/shared-utils";
9
10
  //#region src/delivery/categorize/categories.tsx
10
- var u = class extends r.Component {
11
+ var d = class extends r.Component {
11
12
  static propTypes = {
12
13
  categories: a.arrayOf(a.shape(n)),
13
14
  model: a.shape({ categoriesPerRow: a.number }),
@@ -22,58 +23,58 @@ var u = class extends r.Component {
22
23
  };
23
24
  static defaultProps = { model: { categoriesPerRow: 1 } };
24
25
  render() {
25
- let { categories: n, model: r, disabled: i, onDropChoice: a, onRemoveChoice: o, rowLabels: s, selectedItem: u, onSelectClick: m, onPlacementClick: h, uid: g } = this.props, { categoriesPerRow: _, minRowHeight: v } = r, y = [], b = n || [];
26
- for (let e = 0; e < b.length; e += _) y.push(b.slice(e, e + _));
27
- let x = (e) => {
26
+ let { categories: n, model: r, disabled: i, onDropChoice: a, onRemoveChoice: o, rowLabels: s, selectedItem: d, onSelectClick: h, onPlacementClick: g, uid: _ } = this.props, { categoriesPerRow: v, minRowHeight: y } = r, b = [], x = n || [];
27
+ for (let e = 0; e < x.length; e += v) b.push(x.slice(e, e + v));
28
+ let S = (e) => {
28
29
  let t = !1;
29
30
  return (e || []).forEach((e) => {
30
31
  typeof e == "string" && e.trim() !== "" && e.trim() !== "<div></div>" && (t = !0);
31
32
  }), t;
32
33
  };
33
34
  return /* @__PURE__ */ c(e, {
34
- columns: _,
35
- rows: Math.ceil(n.length / _) * 2,
35
+ columns: v,
36
+ rows: Math.ceil(n.length / v) * 2,
36
37
  extraStyle: { flex: 1 },
37
- children: y.map((e, n) => {
38
+ children: b.map((e, n) => {
38
39
  let r = [];
39
- return e.forEach((e, _) => {
40
- let y = `categorize-${g}-category-label-${n}-${_}`;
40
+ return e.forEach((e, v) => {
41
+ let b = `categorize-${_}-category-label-${n}-${v}`;
41
42
  r.push(/* @__PURE__ */ l("div", {
42
43
  style: { display: "flex" },
43
- children: [_ === 0 && x(s) ? /* @__PURE__ */ c(f, { dangerouslySetInnerHTML: { __html: s[n] || "" } }, n) : null, /* @__PURE__ */ l(p, { children: [/* @__PURE__ */ c(d, {
44
- id: y,
45
- dangerouslySetInnerHTML: { __html: e.label }
46
- }, `category-label-${n}-${_}`), /* @__PURE__ */ c(t, {
47
- minRowHeight: v,
48
- labelId: y,
44
+ children: [v === 0 && S(s) ? /* @__PURE__ */ c(p, { dangerouslySetInnerHTML: { __html: u(s[n]) } }, n) : null, /* @__PURE__ */ l(m, { children: [/* @__PURE__ */ c(f, {
45
+ id: b,
46
+ dangerouslySetInnerHTML: { __html: u(e.label) }
47
+ }, `category-label-${n}-${v}`), /* @__PURE__ */ c(t, {
48
+ minRowHeight: y,
49
+ labelId: b,
49
50
  onDropChoice: (t) => a(e.id, t),
50
51
  onRemoveChoice: o,
51
52
  disabled: i,
52
- selectedItem: u,
53
- onSelectClick: m,
54
- onPlacementClick: h,
53
+ selectedItem: d,
54
+ onSelectClick: h,
55
+ onPlacementClick: g,
55
56
  ...e
56
- }, `category-element-${n}-${_}`)] })]
57
+ }, `category-element-${n}-${v}`)] })]
57
58
  }));
58
- }), r = r.concat(Array(_ - e.length).fill(/* @__PURE__ */ c("div", {})).map((e, t) => /* @__PURE__ */ c("div", {}, `fill-space-final-${t}`))), r;
59
+ }), r = r.concat(Array(v - e.length).fill(/* @__PURE__ */ c("div", {})).map((e, t) => /* @__PURE__ */ c("div", {}, `fill-space-final-${t}`))), r;
59
60
  })
60
61
  });
61
62
  }
62
- }, d = o("div")(({ theme: e }) => ({
63
+ }, f = o("div")(({ theme: e }) => ({
63
64
  color: i.text(),
64
65
  backgroundColor: i.background(),
65
66
  textAlign: "center",
66
67
  paddingTop: e.spacing(1)
67
- })), f = o("div")({
68
+ })), p = o("div")({
68
69
  alignItems: "center",
69
70
  display: "flex",
70
71
  justifyContent: "center",
71
72
  flex: .5,
72
73
  marginRight: "12px"
73
- }), p = o("div")({
74
+ }), m = o("div")({
74
75
  display: "flex",
75
76
  flex: "2",
76
77
  flexDirection: "column"
77
- }), m = s.withUid(u);
78
+ }), h = s.withUid(d);
78
79
  //#endregion
79
- export { u as Categories, n as CategoryType, m as default };
80
+ export { d as Categories, n as CategoryType, h as default };
@@ -8,12 +8,13 @@ import { uid as o } from "@pie-lib/drag";
8
8
  import { jsx as s } from "react/jsx-runtime";
9
9
  import c from "@mui/material/Card";
10
10
  import l from "@mui/material/CardContent";
11
+ import { sanitizeModelHtml as u } from "@pie-element/shared-utils";
11
12
  //#region src/delivery/categorize/choice.tsx
12
13
  r("@pie-ui:categorize:choice");
13
- var u = {
14
+ var d = {
14
15
  content: n.string.isRequired,
15
16
  id: n.string
16
- }, d = i("div", { shouldForwardProp: (e) => ![
17
+ }, f = i("div", { shouldForwardProp: (e) => ![
17
18
  "isDragging",
18
19
  "disabled",
19
20
  "correct",
@@ -26,21 +27,21 @@ var u = {
26
27
  ...i && { border: `solid 2px ${t.buttonFocusOutline()}` },
27
28
  ...r === !0 && { border: `solid 2px ${t.correct()}` },
28
29
  ...r === !1 && { border: `solid 2px ${t.incorrect()}` }
29
- })), f = i(c, { shouldForwardProp: (e) => e !== "isSelected" })(({ isSelected: e }) => ({
30
+ })), p = i(c, { shouldForwardProp: (e) => e !== "isSelected" })(({ isSelected: e }) => ({
30
31
  color: t.text(),
31
32
  backgroundColor: t.background(),
32
33
  width: "100%",
33
34
  opacity: e ? .5 : 1
34
- })), p = i(l)(({ theme: e }) => ({
35
+ })), m = i(l)(({ theme: e }) => ({
35
36
  color: t.text(),
36
37
  backgroundColor: t.v("pie")("background", t.defaults.WHITE),
37
38
  "&:last-child": { paddingBottom: e.spacing(2) },
38
39
  borderRadius: "4px",
39
40
  border: "1px solid",
40
41
  "& p": { margin: "0px" }
41
- })), m = class extends e.Component {
42
+ })), h = class extends e.Component {
42
43
  static propTypes = {
43
- ...u,
44
+ ...d,
44
45
  disabled: n.bool,
45
46
  correct: n.bool,
46
47
  isDragging: n.bool,
@@ -49,18 +50,18 @@ var u = {
49
50
  static defaultProps = {};
50
51
  render() {
51
52
  let { content: e, isDragging: t, disabled: n, correct: r, isSelected: i, showsSelectionBorder: a } = this.props;
52
- return /* @__PURE__ */ s(d, {
53
+ return /* @__PURE__ */ s(f, {
53
54
  isDragging: t,
54
55
  disabled: n,
55
56
  correct: r,
56
57
  isSelected: i,
57
- children: /* @__PURE__ */ s(f, {
58
+ children: /* @__PURE__ */ s(p, {
58
59
  isSelected: i,
59
- children: /* @__PURE__ */ s(p, { dangerouslySetInnerHTML: { __html: e } })
60
+ children: /* @__PURE__ */ s(m, { dangerouslySetInnerHTML: { __html: u(e) } })
60
61
  })
61
62
  });
62
63
  }
63
- }, h = ({ id: e, content: t, disabled: n, correct: r, extraStyle: i, categoryId: o, choiceIndex: c, selectedItem: l, onSelectClick: u }) => {
64
+ }, g = ({ id: e, content: t, disabled: n, correct: r, extraStyle: i, categoryId: o, choiceIndex: c, selectedItem: l, onSelectClick: u }) => {
64
65
  let d = o === void 0 ? `choice-${e}-board` : `choice-${e}-${o}-${c}`, f = {
65
66
  id: e,
66
67
  categoryId: o,
@@ -68,7 +69,7 @@ var u = {
68
69
  value: t,
69
70
  itemType: "categorize",
70
71
  type: "choice"
71
- }, { attributes: p, listeners: h, setNodeRef: g, isDragging: _ } = a({
72
+ }, { attributes: p, listeners: m, setNodeRef: g, isDragging: _ } = a({
72
73
  id: d,
73
74
  data: f,
74
75
  disabled: n
@@ -88,9 +89,9 @@ var u = {
88
89
  ...i
89
90
  },
90
91
  onClick: y,
91
- ...h,
92
+ ...m,
92
93
  ...p,
93
- children: /* @__PURE__ */ s(m, {
94
+ children: /* @__PURE__ */ s(h, {
94
95
  id: e,
95
96
  content: t,
96
97
  disabled: n,
@@ -100,8 +101,8 @@ var u = {
100
101
  })
101
102
  });
102
103
  };
103
- h.propTypes = {
104
- ...u,
104
+ g.propTypes = {
105
+ ...d,
105
106
  extraStyle: n.object,
106
107
  categoryId: n.string,
107
108
  choiceIndex: n.number,
@@ -109,6 +110,6 @@ h.propTypes = {
109
110
  selectedItem: n.object,
110
111
  onSelectClick: n.func
111
112
  };
112
- var g = o.withUid(h);
113
+ var _ = o.withUid(g);
113
114
  //#endregion
114
- export { u as ChoiceType, m as Layout, g as default };
115
+ export { d as ChoiceType, h as Layout, _ as default };
@@ -5,15 +5,16 @@ import i from "prop-types";
5
5
  import { styled as a } from "@mui/material/styles";
6
6
  import { uid as o } from "@pie-lib/drag";
7
7
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
8
+ import { sanitizeModelHtml as l } from "@pie-element/shared-utils";
8
9
  //#region src/delivery/categorize/choices.tsx
9
- var l = a("div")({
10
+ var u = a("div")({
10
11
  flex: 1,
11
12
  touchAction: "none"
12
- }), u = a("div")(({ theme: e }) => ({
13
+ }), d = a("div")(({ theme: e }) => ({
13
14
  margin: "0 auto",
14
15
  textAlign: "center",
15
16
  paddingTop: e.spacing(1)
16
- })), d = class extends r.Component {
17
+ })), f = class extends r.Component {
17
18
  static propTypes = {
18
19
  choices: i.arrayOf(i.oneOfType([i.shape(t), i.shape({ empty: i.bool })])),
19
20
  model: i.shape({
@@ -35,30 +36,30 @@ var l = a("div")({
35
36
  choicesLabel: ""
36
37
  } };
37
38
  render() {
38
- let { choices: t = [], model: r, disabled: i, onDropChoice: a, onRemoveChoice: o, choicePosition: d, correct: f, selectedItem: p, onSelectClick: m, onPlacementClick: h, uid: g } = this.props, _ = !!r.choicesLabel && r.choicesLabel !== "", v = _ ? `categorize-${g}-choices-label` : void 0, y = { textAlign: "center" };
39
- return d === "left" && (y.direction = "rtl"), /* @__PURE__ */ s(l, { children: /* @__PURE__ */ c(n, {
39
+ let { choices: t = [], model: r, disabled: i, onDropChoice: a, onRemoveChoice: o, choicePosition: f, correct: p, selectedItem: m, onSelectClick: h, onPlacementClick: g, uid: _ } = this.props, v = !!r.choicesLabel && r.choicesLabel !== "", y = v ? `categorize-${_}-choices-label` : void 0, b = { textAlign: "center" };
40
+ return f === "left" && (b.direction = "rtl"), /* @__PURE__ */ s(u, { children: /* @__PURE__ */ c(n, {
40
41
  id: "choices-board",
41
- labelId: v,
42
+ labelId: y,
42
43
  onDropChoice: a,
43
44
  onRemoveChoice: o,
44
45
  disabled: i,
45
46
  style: { background: "none" },
46
47
  choiceBoard: !0,
47
- correct: f,
48
- selectedItem: p,
49
- onPlacementClick: h,
50
- children: [_ && /* @__PURE__ */ s(u, {
51
- id: v,
52
- dangerouslySetInnerHTML: { __html: r.choicesLabel }
48
+ correct: p,
49
+ selectedItem: m,
50
+ onPlacementClick: g,
51
+ children: [v && /* @__PURE__ */ s(d, {
52
+ id: y,
53
+ dangerouslySetInnerHTML: { __html: l(r.choicesLabel) }
53
54
  }), t.map((t, n) => t.empty ? /* @__PURE__ */ s("div", {}, n) : /* @__PURE__ */ s(e, {
54
55
  disabled: i,
55
56
  extraStyle: { maxWidth: `${95 / r.categoriesPerRow}%` },
56
- selectedItem: p,
57
- onSelectClick: m,
57
+ selectedItem: m,
58
+ onSelectClick: h,
58
59
  ...t
59
60
  }, n))]
60
61
  }) });
61
62
  }
62
- }, f = o.withUid(d);
63
+ }, p = o.withUid(f);
63
64
  //#endregion
64
- export { t as ChoiceType, d as Choices, f as default };
65
+ export { t as ChoiceType, f as Choices, p as default };
@@ -18,14 +18,15 @@ import { DragProvider as T, createDragCollision as E, uid as D } from "@pie-lib/
18
18
  import { jsx as O, jsxs as k } from "react/jsx-runtime";
19
19
  import A from "@pie-lib/translator";
20
20
  import { AlertDialog as j } from "@pie-lib/config-ui";
21
+ import { sanitizeModelHtml as M } from "@pie-element/shared-utils";
21
22
  //#region src/delivery/categorize/index.tsx
22
- function M(e) {
23
+ function N(e) {
23
24
  return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
24
25
  }
25
- function N(e, t) {
26
- return !e || M(e) ? e : M(e.default) ? e.default : t && M(e[t]) ? e[t] : t && M(e[t]?.default) ? e[t].default : e;
26
+ function P(e, t) {
27
+ return !e || N(e) ? e : N(e.default) ? e.default : t && N(e[t]) ? e[t] : t && N(e[t]?.default) ? e[t].default : e;
27
28
  }
28
- var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt") || N(B.PreviewPrompt, "PreviewPrompt"), I = N(c, "Collapsible") || N(B.Collapsible, "Collapsible"), L = N(l, "Feedback") || N(B.Feedback, "Feedback"), R = s, z = R.default, B = z && typeof z == "object" ? z : R, { translator: V } = A, H = _("@pie-ui:categorize"), U = 250, W = class extends a.Component {
29
+ var F = P(d, "UiLayout") || P(V.UiLayout, "UiLayout"), I = P(u, "PreviewPrompt") || P(V.PreviewPrompt, "PreviewPrompt"), L = P(c, "Collapsible") || P(V.Collapsible, "Collapsible"), R = P(l, "Feedback") || P(V.Feedback, "Feedback"), z = s, B = z.default, V = B && typeof B == "object" ? B : z, { translator: H } = A, U = _("@pie-ui:categorize"), W = 250, G = class extends a.Component {
29
30
  static propTypes = { children: g.node };
30
31
  containerRef = a.createRef();
31
32
  componentDidMount() {
@@ -37,7 +38,7 @@ var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt")
37
38
  children: this.props.children
38
39
  });
39
40
  }
40
- }, G = class extends a.Component {
41
+ }, K = class extends a.Component {
41
42
  static propTypes = {
42
43
  model: g.object,
43
44
  session: g.shape({ answers: g.arrayOf(g.shape({
@@ -61,19 +62,19 @@ var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt")
61
62
  };
62
63
  }
63
64
  removeChoice = (e) => {
64
- H("[removeChoice]: ", e);
65
+ U("[removeChoice]: ", e);
65
66
  let { onAnswersChange: t, session: n } = this.props;
66
67
  t(w(e.id, e.categoryId, e.choiceIndex, n.answers));
67
68
  };
68
69
  dropChoice = (e, t) => {
69
70
  let { session: n, onAnswersChange: r, model: i } = this.props, { maxChoicesPerCategory: a = 0 } = i || {}, { answers: o = [] } = n || {}, s;
70
- t ? H("[dropChoice] category: ", t.categoryId, "choice: ", t) : H("[dropChoice] category: ", void 0, "choice: ", void 0);
71
+ t ? U("[dropChoice] category: ", t.categoryId, "choice: ", t) : U("[dropChoice] category: ", void 0, "choice: ", void 0);
71
72
  let c = o.find((t) => t.category === e);
72
73
  t && a === 1 && c && c.choices && c.choices.length === 1 ? (s = C(t.id, t.categoryId, e, t.choiceIndex, o), s = w(c.choices[0], e, 0, s)) : t && a > 1 && c && c.choices && c.choices.length === a ? (s = t.categoryId ? C(t.id, t.categoryId, t.categoryId, t.choiceIndex, o) : w(t.id, t.categoryId, t.choiceIndex, o), this.setState({ showMaxChoiceAlert: !0 })) : a !== 0 && c && c.choices && c.choices.length > a ? (s = o, this.setState({ showMaxChoiceAlert: !0 })) : s = t ? C(t.id, t.categoryId, e, t.choiceIndex, o) : this.removeChoice(e), t && r(s);
73
74
  };
74
75
  UNSAFE_componentWillReceiveProps(e) {
75
76
  let { model: t } = this.props, { model: n } = e;
76
- t.note && t.language && t.language !== n.language && t.note === V.t("common:commonCorrectAnswerWithAlternates", { lng: t.language }) && (t.note = V.t("common:commonCorrectAnswerWithAlternates", { lng: n.language })), this.setState({ showCorrect: !1 });
77
+ t.note && t.language && t.language !== n.language && t.note === H.t("common:commonCorrectAnswerWithAlternates", { lng: t.language }) && (t.note = H.t("common:commonCorrectAnswerWithAlternates", { lng: n.language })), this.setState({ showCorrect: !1 });
77
78
  }
78
79
  toggleShowCorrect = () => this.setState({ showCorrect: !this.state.showCorrect }, () => {
79
80
  this.props.onShowCorrectToggle();
@@ -101,38 +102,38 @@ var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt")
101
102
  let { model: e, session: r, selectedItem: i, onSelectClick: o, onPlacementClick: s } = this.props, { showCorrect: c, showMaxChoiceAlert: l } = this.state, { choicesPosition: u, extraCSSRules: d, note: f, showNote: p, env: g, language: _, maxChoicesPerCategory: v, autoplayAudioEnabled: y, customAudioButton: b } = e, { mode: C, role: w } = g || {}, T = u || "above", E = {
102
103
  flexDirection: this.getPositionDirection(T),
103
104
  gap: "8px"
104
- }, { categories: D, choices: A, correct: M } = S(e.categories, e.choices, c ? e.correctResponse : r.answers, e.correctResponse);
105
- H("[render] disabled: ", e.disabled);
106
- let { rowLabels: N, categoriesPerRow: P, correctResponse: I, fontSizeFactor: R } = e, z = D && Math.ceil(D.length / P) || 0, B = this.existAlternateResponse(I) || !1, U = (c || C === "view" && w === "instructor") && p && f && B, W = V.t("translation:categorize:limitMaxChoicesPerCategory", {
105
+ }, { categories: D, choices: A, correct: N } = S(e.categories, e.choices, c ? e.correctResponse : r.answers, e.correctResponse);
106
+ U("[render] disabled: ", e.disabled);
107
+ let { rowLabels: P, categoriesPerRow: F, correctResponse: L, fontSizeFactor: z } = e, B = D && Math.ceil(D.length / F) || 0, V = this.existAlternateResponse(L) || !1, W = (c || C === "view" && w === "instructor") && p && f && V, G = H.t("translation:categorize:limitMaxChoicesPerCategory", {
107
108
  lng: e.language,
108
109
  maxChoicesPerCategory: v
109
- }), G = V.t("common:warning", { lng: e.language }), K = V.t("common:cancel", { lng: e.language }), Q = e.rationale && (h(e.rationale) || m(e.rationale)), $ = e.teacherInstructions && (h(e.teacherInstructions) || m(e.teacherInstructions));
110
- return /* @__PURE__ */ k(q, {
110
+ }), K = H.t("common:warning", { lng: e.language }), q = H.t("common:cancel", { lng: e.language }), $ = e.rationale && (h(e.rationale) || m(e.rationale)), ee = e.teacherInstructions && (h(e.teacherInstructions) || m(e.teacherInstructions));
111
+ return /* @__PURE__ */ k(J, {
111
112
  extraCSSRules: d,
112
113
  id: this.mainContainerId,
113
114
  className: "main-container",
114
- fontSizeFactor: R,
115
+ fontSizeFactor: z,
115
116
  children: [
116
- $ && /* @__PURE__ */ O(a.Fragment, { children: /* @__PURE__ */ O(Z, {
117
+ ee && /* @__PURE__ */ O(a.Fragment, { children: /* @__PURE__ */ O(Q, {
117
118
  labels: {
118
- hidden: V.t("common:showTeacherInstructions", { lng: _ }),
119
- visible: V.t("common:hideTeacherInstructions", { lng: _ })
119
+ hidden: H.t("common:showTeacherInstructions", { lng: _ }),
120
+ visible: H.t("common:hideTeacherInstructions", { lng: _ })
120
121
  },
121
- children: /* @__PURE__ */ O(F, { prompt: e.teacherInstructions })
122
+ children: /* @__PURE__ */ O(I, { prompt: e.teacherInstructions })
122
123
  }) }),
123
- e.prompt && /* @__PURE__ */ O(F, {
124
+ e.prompt && /* @__PURE__ */ O(I, {
124
125
  prompt: e.prompt,
125
126
  autoplayAudioEnabled: y,
126
127
  customAudioButton: b,
127
128
  language: _
128
129
  }),
129
130
  /* @__PURE__ */ O(x, {
130
- show: c || M === !1,
131
+ show: c || N === !1,
131
132
  toggled: c,
132
133
  onToggle: this.toggleShowCorrect,
133
134
  language: _
134
135
  }),
135
- /* @__PURE__ */ O(Y, { children: /* @__PURE__ */ k(X, {
136
+ /* @__PURE__ */ O(X, { children: /* @__PURE__ */ k(Z, {
136
137
  style: E,
137
138
  children: [/* @__PURE__ */ O("div", {
138
139
  style: {
@@ -145,7 +146,7 @@ var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt")
145
146
  categories: D,
146
147
  onDropChoice: this.dropChoice,
147
148
  onRemoveChoice: this.removeChoice,
148
- rowLabels: (N || []).slice(0, z),
149
+ rowLabels: (P || []).slice(0, B),
149
150
  selectedItem: i,
150
151
  onSelectClick: o,
151
152
  onPlacementClick: s
@@ -157,35 +158,35 @@ var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt")
157
158
  choicePosition: T,
158
159
  onDropChoice: this.dropChoice,
159
160
  onRemoveChoice: this.removeChoice,
160
- correct: M,
161
+ correct: N,
161
162
  selectedItem: i,
162
163
  onSelectClick: o,
163
164
  onPlacementClick: s
164
165
  })]
165
166
  }) }),
166
- U && /* @__PURE__ */ O(J, { dangerouslySetInnerHTML: { __html: f } }),
167
- Q && /* @__PURE__ */ O(Z, {
167
+ W && /* @__PURE__ */ O(Y, { dangerouslySetInnerHTML: { __html: M(f) } }),
168
+ $ && /* @__PURE__ */ O(Q, {
168
169
  labels: {
169
- hidden: V.t("common:showRationale", { lng: _ }),
170
- visible: V.t("common:hideRationale", { lng: _ })
170
+ hidden: H.t("common:showRationale", { lng: _ }),
171
+ visible: H.t("common:hideRationale", { lng: _ })
171
172
  },
172
- children: /* @__PURE__ */ O(F, { prompt: e.rationale })
173
+ children: /* @__PURE__ */ O(I, { prompt: e.rationale })
173
174
  }),
174
- e.correctness && e.feedback && !c && /* @__PURE__ */ O(L, {
175
+ e.correctness && e.feedback && !c && /* @__PURE__ */ O(R, {
175
176
  correctness: e.correctness,
176
177
  feedback: e.feedback
177
178
  }),
178
179
  /* @__PURE__ */ O(j, {
179
- title: G,
180
- text: W,
180
+ title: K,
181
+ text: G,
181
182
  open: l,
182
- onCloseText: K,
183
+ onCloseText: q,
183
184
  onClose: () => this.setState({ showMaxChoiceAlert: !1 })
184
185
  })
185
186
  ]
186
187
  });
187
188
  }
188
- }, K = class extends a.Component {
189
+ }, q = class extends a.Component {
189
190
  static propTypes = {
190
191
  model: g.object,
191
192
  session: g.shape({ answers: g.arrayOf(g.shape({
@@ -263,7 +264,7 @@ var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt")
263
264
  let { selectedItem: t } = this.state;
264
265
  t && (this.commitPlacement(t, e), this.cancelSelection(), this.endAnyLiveKeyboardDrag());
265
266
  };
266
- isClickSoonAfterDragEnd = () => Date.now() - this.lastDragEndAt < U;
267
+ isClickSoonAfterDragEnd = () => Date.now() - this.lastDragEndAt < W;
267
268
  onItemClick = (e) => {
268
269
  this.isClickSoonAfterDragEnd() || (this.endAnyLiveKeyboardDrag(), this.toggleItemSelection(e));
269
270
  };
@@ -299,7 +300,7 @@ var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt")
299
300
  modifiers: this.dragCollision.modifiers,
300
301
  children: /* @__PURE__ */ k(D.Provider, {
301
302
  value: this.uid,
302
- children: [/* @__PURE__ */ O(G, {
303
+ children: [/* @__PURE__ */ O(K, {
303
304
  ref: (e) => this.categorizeRef = e,
304
305
  ...this.props,
305
306
  selectedItem: t,
@@ -307,23 +308,23 @@ var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt")
307
308
  onPlacementClick: this.onPlacementClick
308
309
  }), /* @__PURE__ */ O(y, {
309
310
  dropAnimation: n,
310
- children: /* @__PURE__ */ O(W, { children: this.renderDragOverlay() })
311
+ children: /* @__PURE__ */ O(G, { children: this.renderDragOverlay() })
311
312
  })]
312
313
  })
313
314
  });
314
315
  }
315
- }, q = v(P)({
316
+ }, J = v(F)({
316
317
  color: f.text(),
317
318
  backgroundColor: f.background(),
318
319
  position: "relative"
319
- }), J = v("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), Y = v("div")(({ theme: e }) => ({
320
+ }), Y = v("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), X = v("div")(({ theme: e }) => ({
320
321
  marginBottom: e.spacing(1),
321
322
  maxWidth: "100%",
322
323
  overflowX: "auto",
323
324
  overflowY: "hidden"
324
- })), X = v("div")(() => ({
325
+ })), Z = v("div")(() => ({
325
326
  display: "flex",
326
327
  minWidth: "min-content"
327
- })), Z = v(I)(({ theme: e }) => ({ paddingBottom: e.spacing(2) }));
328
+ })), Q = v(L)(({ theme: e }) => ({ paddingBottom: e.spacing(2) }));
328
329
  //#endregion
329
- export { G as Categorize, K as default };
330
+ export { K as Categorize, q as default };