@pie-element/match 12.1.2-next.2 → 12.1.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.
Files changed (97) hide show
  1. package/CHANGELOG.json +1462 -0
  2. package/CHANGELOG.md +2337 -0
  3. package/LICENSE.md +5 -0
  4. package/README.md +1 -0
  5. package/configure/CHANGELOG.json +892 -0
  6. package/configure/CHANGELOG.md +2040 -0
  7. package/configure/lib/add-row.js +40 -0
  8. package/configure/lib/add-row.js.map +1 -0
  9. package/configure/lib/answer-config-block.js +288 -0
  10. package/configure/lib/answer-config-block.js.map +1 -0
  11. package/configure/lib/common.js +31 -0
  12. package/configure/lib/common.js.map +1 -0
  13. package/configure/lib/configure.js +410 -0
  14. package/configure/lib/configure.js.map +1 -0
  15. package/configure/lib/defaults.js +201 -0
  16. package/configure/lib/defaults.js.map +1 -0
  17. package/configure/lib/general-config-block.js +144 -0
  18. package/configure/lib/general-config-block.js.map +1 -0
  19. package/configure/lib/index.js +152 -0
  20. package/configure/lib/index.js.map +1 -0
  21. package/configure/lib/row.js +321 -0
  22. package/configure/lib/row.js.map +1 -0
  23. package/configure/lib/utils.js +12 -0
  24. package/configure/lib/utils.js.map +1 -0
  25. package/configure/package.json +29 -0
  26. package/configure/utils.js +19 -0
  27. package/controller/CHANGELOG.json +502 -0
  28. package/controller/CHANGELOG.md +1363 -0
  29. package/controller/lib/defaults.js +25 -0
  30. package/controller/lib/defaults.js.map +1 -0
  31. package/controller/lib/index.js +424 -0
  32. package/controller/lib/index.js.map +1 -0
  33. package/controller/package.json +24 -0
  34. package/docs/config-schema.json +2929 -0
  35. package/docs/config-schema.json.md +2162 -0
  36. package/docs/demo/config.js +8 -0
  37. package/docs/demo/generate.js +49 -0
  38. package/docs/demo/index.html +1 -0
  39. package/docs/demo/session.js +11 -0
  40. package/docs/pie-schema.json +1530 -0
  41. package/docs/pie-schema.json.md +907 -0
  42. package/lib/answer-grid.js +166 -0
  43. package/lib/answer-grid.js.map +1 -0
  44. package/lib/index.js +85 -0
  45. package/lib/index.js.map +1 -0
  46. package/lib/main.js +163 -0
  47. package/lib/main.js.map +1 -0
  48. package/package.json +21 -87
  49. package/configure.js +0 -2
  50. package/controller.js +0 -1
  51. package/dist/author/add-row.d.ts +0 -17
  52. package/dist/author/add-row.js +0 -24
  53. package/dist/author/answer-config-block.d.ts +0 -36
  54. package/dist/author/answer-config-block.js +0 -176
  55. package/dist/author/common.d.ts +0 -22
  56. package/dist/author/configure.d.ts +0 -48
  57. package/dist/author/configure.js +0 -259
  58. package/dist/author/defaults.d.ts +0 -203
  59. package/dist/author/defaults.js +0 -151
  60. package/dist/author/general-config-block.d.ts +0 -22
  61. package/dist/author/general-config-block.js +0 -93
  62. package/dist/author/index.d.ts +0 -44
  63. package/dist/author/index.js +0 -76
  64. package/dist/author/row.d.ts +0 -51
  65. package/dist/author/row.js +0 -204
  66. package/dist/author/utils.d.ts +0 -10
  67. package/dist/author/utils.js +0 -10
  68. package/dist/browser/Typography-DSiRJjOv.js +0 -9224
  69. package/dist/browser/Typography-DSiRJjOv.js.map +0 -1
  70. package/dist/browser/author/index.js +0 -41596
  71. package/dist/browser/author/index.js.map +0 -1
  72. package/dist/browser/browser-kkT1XVKw.js +0 -219
  73. package/dist/browser/browser-kkT1XVKw.js.map +0 -1
  74. package/dist/browser/controller/index.js +0 -267
  75. package/dist/browser/controller/index.js.map +0 -1
  76. package/dist/browser/delivery/index.js +0 -1984
  77. package/dist/browser/delivery/index.js.map +0 -1
  78. package/dist/browser/dist-i687VHmY.js +0 -100
  79. package/dist/browser/dist-i687VHmY.js.map +0 -1
  80. package/dist/browser/match.css +0 -2
  81. package/dist/controller/defaults.d.ts +0 -27
  82. package/dist/controller/defaults.js +0 -25
  83. package/dist/controller/index.d.ts +0 -29
  84. package/dist/controller/index.js +0 -154
  85. package/dist/delivery/answer-grid.d.ts +0 -28
  86. package/dist/delivery/answer-grid.js +0 -99
  87. package/dist/delivery/index.d.ts +0 -21
  88. package/dist/delivery/index.js +0 -51
  89. package/dist/delivery/main.d.ts +0 -26
  90. package/dist/delivery/main.js +0 -112
  91. package/dist/index.d.ts +0 -1
  92. package/dist/index.iife.d.ts +0 -8
  93. package/dist/index.iife.js +0 -148
  94. package/dist/index.js +0 -2
  95. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +0 -16
  96. package/dist/runtime-support.d.ts +0 -12
  97. package/dist/runtime-support.js +0 -12
@@ -1,219 +0,0 @@
1
- import * as __pieBrowserCjsReactRequire from "react";
2
- const __pieBrowserCjsRequire = (specifier) => {
3
- switch (specifier) {
4
- case "react": return __pieBrowserCjsReactRequire;
5
-
6
-
7
-
8
-
9
- default:
10
- throw new Error(`Unsupported browser CJS require: ${specifier}`);
11
- }
12
- };
13
- //#region \0rolldown/runtime.js
14
- var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
15
- let r = {};
16
- for (var i in e) t(r, i, {
17
- get: e[i],
18
- enumerable: !0
19
- });
20
- return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
21
- }, c = (e, i, o, s) => {
22
- if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
23
- get: ((e) => i[e]).bind(null, d),
24
- enumerable: !(s = n(i, d)) || s.enumerable
25
- });
26
- return e;
27
- }, l = (n, r, a) => (a = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule ? t(a, "default", {
28
- value: n,
29
- enumerable: !0
30
- }) : a, n)), u = __pieBrowserCjsRequire, d = /* @__PURE__ */ o(((e, t) => {
31
- var n = 1e3, r = n * 60, i = r * 60, a = i * 24, o = a * 7, s = a * 365.25;
32
- t.exports = function(e, t) {
33
- t ||= {};
34
- var n = typeof e;
35
- if (n === "string" && e.length > 0) return c(e);
36
- if (n === "number" && isFinite(e)) return t.long ? u(e) : l(e);
37
- throw Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(e));
38
- };
39
- function c(e) {
40
- if (e = String(e), !(e.length > 100)) {
41
- var t = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);
42
- if (t) {
43
- var c = parseFloat(t[1]);
44
- switch ((t[2] || "ms").toLowerCase()) {
45
- case "years":
46
- case "year":
47
- case "yrs":
48
- case "yr":
49
- case "y": return c * s;
50
- case "weeks":
51
- case "week":
52
- case "w": return c * o;
53
- case "days":
54
- case "day":
55
- case "d": return c * a;
56
- case "hours":
57
- case "hour":
58
- case "hrs":
59
- case "hr":
60
- case "h": return c * i;
61
- case "minutes":
62
- case "minute":
63
- case "mins":
64
- case "min":
65
- case "m": return c * r;
66
- case "seconds":
67
- case "second":
68
- case "secs":
69
- case "sec":
70
- case "s": return c * n;
71
- case "milliseconds":
72
- case "millisecond":
73
- case "msecs":
74
- case "msec":
75
- case "ms": return c;
76
- default: return;
77
- }
78
- }
79
- }
80
- }
81
- function l(e) {
82
- var t = Math.abs(e);
83
- return t >= a ? Math.round(e / a) + "d" : t >= i ? Math.round(e / i) + "h" : t >= r ? Math.round(e / r) + "m" : t >= n ? Math.round(e / n) + "s" : e + "ms";
84
- }
85
- function u(e) {
86
- var t = Math.abs(e);
87
- return t >= a ? d(e, t, a, "day") : t >= i ? d(e, t, i, "hour") : t >= r ? d(e, t, r, "minute") : t >= n ? d(e, t, n, "second") : e + " ms";
88
- }
89
- function d(e, t, n, r) {
90
- var i = t >= n * 1.5;
91
- return Math.round(e / n) + " " + r + (i ? "s" : "");
92
- }
93
- })), f = /* @__PURE__ */ o(((e, t) => {
94
- function n(e) {
95
- n.debug = n, n.default = n, n.coerce = c, n.disable = o, n.enable = i, n.enabled = s, n.humanize = d(), n.destroy = l, Object.keys(e).forEach((t) => {
96
- n[t] = e[t];
97
- }), n.names = [], n.skips = [], n.formatters = {};
98
- function t(e) {
99
- let t = 0;
100
- for (let n = 0; n < e.length; n++) t = (t << 5) - t + e.charCodeAt(n), t |= 0;
101
- return n.colors[Math.abs(t) % n.colors.length];
102
- }
103
- n.selectColor = t;
104
- function n(e) {
105
- let t, i = null, a, o;
106
- function s(...e) {
107
- if (!s.enabled) return;
108
- let r = s, i = Number(/* @__PURE__ */ new Date());
109
- r.diff = i - (t || i), r.prev = t, r.curr = i, t = i, e[0] = n.coerce(e[0]), typeof e[0] != "string" && e.unshift("%O");
110
- let a = 0;
111
- e[0] = e[0].replace(/%([a-zA-Z%])/g, (t, i) => {
112
- if (t === "%%") return "%";
113
- a++;
114
- let o = n.formatters[i];
115
- if (typeof o == "function") {
116
- let n = e[a];
117
- t = o.call(r, n), e.splice(a, 1), a--;
118
- }
119
- return t;
120
- }), n.formatArgs.call(r, e), (r.log || n.log).apply(r, e);
121
- }
122
- return s.namespace = e, s.useColors = n.useColors(), s.color = n.selectColor(e), s.extend = r, s.destroy = n.destroy, Object.defineProperty(s, "enabled", {
123
- enumerable: !0,
124
- configurable: !1,
125
- get: () => i === null ? (a !== n.namespaces && (a = n.namespaces, o = n.enabled(e)), o) : i,
126
- set: (e) => {
127
- i = e;
128
- }
129
- }), typeof n.init == "function" && n.init(s), s;
130
- }
131
- function r(e, t) {
132
- let r = n(this.namespace + (t === void 0 ? ":" : t) + e);
133
- return r.log = this.log, r;
134
- }
135
- function i(e) {
136
- n.save(e), n.namespaces = e, n.names = [], n.skips = [];
137
- let t = (typeof e == "string" ? e : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
138
- for (let e of t) e[0] === "-" ? n.skips.push(e.slice(1)) : n.names.push(e);
139
- }
140
- function a(e, t) {
141
- let n = 0, r = 0, i = -1, a = 0;
142
- for (; n < e.length;) if (r < t.length && (t[r] === e[n] || t[r] === "*")) t[r] === "*" ? (i = r, a = n, r++) : (n++, r++);
143
- else if (i !== -1) r = i + 1, a++, n = a;
144
- else return !1;
145
- for (; r < t.length && t[r] === "*";) r++;
146
- return r === t.length;
147
- }
148
- function o() {
149
- let e = [...n.names, ...n.skips.map((e) => "-" + e)].join(",");
150
- return n.enable(""), e;
151
- }
152
- function s(e) {
153
- for (let t of n.skips) if (a(e, t)) return !1;
154
- for (let t of n.names) if (a(e, t)) return !0;
155
- return !1;
156
- }
157
- function c(e) {
158
- return e instanceof Error ? e.stack || e.message : e;
159
- }
160
- function l() {
161
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
162
- }
163
- return n.enable(n.load()), n;
164
- }
165
- t.exports = n;
166
- })), p = /* @__PURE__ */ o(((e, t) => {
167
- e.formatArgs = r, e.save = i, e.load = a, e.useColors = n, e.storage = o(), e.destroy = (() => {
168
- let e = !1;
169
- return () => {
170
- e || (e = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));
171
- };
172
- })(), e.colors = /* @__PURE__ */ "#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33".split(".");
173
- function n() {
174
- if (typeof window < "u" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) return !0;
175
- if (typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return !1;
176
- let e;
177
- return typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator < "u" && navigator.userAgent && (e = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(e[1], 10) >= 31 || typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
178
- }
179
- function r(e) {
180
- if (e[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + e[0] + (this.useColors ? "%c " : " ") + "+" + t.exports.humanize(this.diff), !this.useColors) return;
181
- let n = "color: " + this.color;
182
- e.splice(1, 0, n, "color: inherit");
183
- let r = 0, i = 0;
184
- e[0].replace(/%[a-zA-Z%]/g, (e) => {
185
- e !== "%%" && (r++, e === "%c" && (i = r));
186
- }), e.splice(i, 0, n);
187
- }
188
- e.log = console.debug || console.log || (() => {});
189
- function i(t) {
190
- try {
191
- t ? e.storage.setItem("debug", t) : e.storage.removeItem("debug");
192
- } catch {}
193
- }
194
- function a() {
195
- let t;
196
- try {
197
- t = e.storage.getItem("debug") || e.storage.getItem("DEBUG");
198
- } catch {}
199
- return !t && typeof process < "u" && "env" in process && (t = process.env.DEBUG), t;
200
- }
201
- function o() {
202
- try {
203
- return localStorage;
204
- } catch {}
205
- }
206
- t.exports = f()(e);
207
- var { formatters: s } = t.exports;
208
- s.j = function(e) {
209
- try {
210
- return JSON.stringify(e);
211
- } catch (e) {
212
- return "[UnexpectedJSONParseError]: " + e.message;
213
- }
214
- };
215
- }));
216
- //#endregion
217
- export { l as a, u as i, o as n, s as r, p as t };
218
-
219
- //# sourceMappingURL=browser-kkT1XVKw.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser-kkT1XVKw.js","names":[],"sources":["../../../../../node_modules/.bun/ms@2.1.3/node_modules/ms/index.js","../../../../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/common.js","../../../../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/browser.js"],"sourcesContent":["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;;;;;;;;;;;;;;;;;;;CAIA,IAAI,IAAI,KACJ,IAAI,IAAI,IACR,IAAI,IAAI,IACR,IAAI,IAAI,IACR,IAAI,IAAI,GACR,IAAI,IAAI;CAgBZ,EAAO,UAAU,SAAU,GAAK,GAAS;EACvC,MAAqB,CAAC;EACtB,IAAI,IAAO,OAAO;EAClB,IAAI,MAAS,YAAY,EAAI,SAAS,GACpC,OAAO,EAAM,CAAG;EACX,IAAI,MAAS,YAAY,SAAS,CAAG,GAC1C,OAAO,EAAQ,OAAO,EAAQ,CAAG,IAAI,EAAS,CAAG;EAEnD,MAAU,MACR,0DACE,KAAK,UAAU,CAAG,CACtB;CACF;CAUA,SAAS,EAAM,GAAK;EAClB,QAAM,OAAO,CAAG,GACZ,IAAI,SAAS,MAGjB;OAAI,IAAQ,mIAAmI,KAC7I,CACF;GACK,OAGL;QAAI,IAAI,WAAW,EAAM,EAAE;IAE3B,SADY,EAAM,MAAM,MAAM,YACnB,GAAX;KACE,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb,KAAK;KACL,KAAK;KACL,KAAK;KACL,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{
6
- type: "default",
7
- default: "Correct",
8
- custom: "Correct"
9
- },
10
- incorrect: {
11
- type: "default",
12
- default: "Incorrect",
13
- custom: "Incorrect"
14
- },
15
- partial: {
16
- type: "default",
17
- default: "Nearly",
18
- custom: "Nearly"
19
- },
20
- unanswered: {
21
- type: "default",
22
- default: "You have not entered a response",
23
- custom: "You have not entered a response"
24
- }
25
- };
26
- function o(e) {
27
- return e === "partially-correct" ? "partial" : e;
28
- }
29
- function s(e, t = {}) {
30
- return new Promise((n) => {
31
- let r = {
32
- ...a,
33
- ...t
34
- }, i = o(e), s = r[i], l = a[i];
35
- c(s, l[s.type]).then(n);
36
- });
37
- }
38
- function c(e, t) {
39
- return new Promise((n) => {
40
- if (!e || e.type === "none") {
41
- n(void 0);
42
- return;
43
- }
44
- n(e[e.type] || t);
45
- });
46
- }
47
- //#endregion
48
- //#region ../../shared/controller-utils/dist/index.js
49
- var l = Object.defineProperty, u = (e, t) => {
50
- let n = {};
51
- for (var r in e) l(n, r, {
52
- get: e[r],
53
- enumerable: !0
54
- });
55
- return t || l(n, Symbol.toStringTag, { value: "Module" }), n;
56
- };
57
- function d(e) {
58
- return Array.isArray(e) ? e.filter((e) => e != null) : [];
59
- }
60
- function f(e) {
61
- let t = [...e];
62
- for (let e = t.length - 1; e > 0; e--) {
63
- let n = Math.floor(Math.random() * (e + 1));
64
- [t[e], t[n]] = [t[n], t[e]];
65
- }
66
- return t;
67
- }
68
- function p(e) {
69
- return e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1;
70
- }
71
- async function m(e, t, n, r = "value") {
72
- let i = d(t?.data?.shuffledValues ?? t?.shuffledValues ?? []);
73
- if (!t) {
74
- console.warn("Unable to save shuffled choices because there's no session.");
75
- return;
76
- }
77
- if (!p(i)) return d(i.map((t) => e.find((e) => e[r] === t)));
78
- let a = f(e);
79
- if (n && typeof n == "function") try {
80
- let e = d(a.map((e) => e[r]));
81
- p(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(a)}, key: ${r}`) : t.id && t.element && await n(t.id, t.element, { shuffledValues: e });
82
- } catch (e) {
83
- console.warn("Unable to save shuffled order for choices"), console.error(e);
84
- }
85
- else console.warn("Unable to save shuffled choices, shuffle will happen every time.");
86
- return a;
87
- }
88
- function h(e, t, n) {
89
- return !!(e.lockChoiceOrder || n["@pie-element"]?.lockChoiceOrder || (n.role ?? "student") === "instructor");
90
- }
91
- var g = /* @__PURE__ */ u({ enabled: () => _ });
92
- function _(e, t, n) {
93
- return e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n == "boolean" ? n : !0;
94
- }
95
- //#endregion
96
- //#region src/controller/defaults.ts
97
- var v = /* @__PURE__ */ e(t(), 1), y = {
98
- choiceMode: "radio",
99
- feedbackEnabled: !1,
100
- headers: [
101
- "Column 1",
102
- "Column 2",
103
- "Column 3"
104
- ],
105
- layout: 3,
106
- lockChoiceOrder: !0,
107
- partialScoring: !1,
108
- prompt: "",
109
- promptEnabled: !0,
110
- rationale: "",
111
- rationaleEnabled: !0,
112
- rows: [],
113
- scoringType: "auto",
114
- studentInstructionsEnabled: !0,
115
- teacherInstructions: "",
116
- teacherInstructionsEnabled: !0,
117
- toolbarEditorPosition: "bottom"
118
- }, b = (0, v.default)("@pie-element:match:controller"), x = (e, t, n = {}) => {
119
- let r = g.enabled(e, n), i = e.rows, a = e.choiceMode === "checkbox";
120
- if (!t || Object.keys(t).length === 0) return "unanswered";
121
- let o = a ? E(e) : T(e), s, c = 0;
122
- if (a) {
123
- let e = C(i, t);
124
- s = e.correctAnswers, c = e.incorrectAnswers;
125
- } else s = w(i, t);
126
- return o === s && !c ? "correct" : s === 0 ? "incorrect" : r ? "partial" : "incorrect";
127
- }, S = (e, t, n = {}) => {
128
- if (t.mode === "evaluate") return x(e, n, t);
129
- }, C = (e, t) => {
130
- let n = 0, r = 0;
131
- return e.forEach((e) => {
132
- let i = t[e.id];
133
- i && e.values.forEach((e, t) => {
134
- i[t] && i[t] === e ? n += 1 : i[t] && i[t] !== e && (r += 1);
135
- });
136
- }), {
137
- correctAnswers: n,
138
- incorrectAnswers: r
139
- };
140
- }, w = (e, t) => {
141
- let n = 0;
142
- return e.forEach((e) => {
143
- i(e.values, t[e.id]) && (n += 1);
144
- }), n;
145
- }, T = (e) => {
146
- let t = e.choiceMode === "checkbox" ? e.layout - 1 : 1;
147
- return (e.rows.length || 0) * t;
148
- }, E = (e) => {
149
- let t = 0;
150
- return e.rows.forEach((e) => {
151
- e.values.forEach((e) => {
152
- e && (t += 1);
153
- });
154
- }), t;
155
- }, D = (e, t) => {
156
- if (e.choiceMode === "checkbox") {
157
- let { correctAnswers: n, incorrectAnswers: r } = C(e.rows, t), i = E(e), a = i === 0 ? 1 : i;
158
- if (n + r > i) {
159
- let e = n + r - i, t = parseFloat(((n - e) / a).toFixed(2));
160
- return t < 0 ? 0 : t;
161
- } else return parseFloat((n / a).toFixed(2));
162
- } else {
163
- let n = w(e.rows, t), r = T(e) === 0 ? 1 : T(e);
164
- return parseFloat((n / r).toFixed(2));
165
- }
166
- }, O = (e, t, n = {}) => {
167
- let r = S(e, t, n), i = g.enabled(e, t);
168
- return r === "correct" ? 1 : r === "partial" && i ? D(e, n) : 0;
169
- }, k = (e, t, n) => {
170
- let r = [], a = t?.answers || {}, o = e?.rows || [], s = e.choiceMode === "checkbox";
171
- if (!a || Object.keys(a).length === 0) return r.push("Student did not provide any answer."), r;
172
- r.push(`Match item contains ${o.length} row(s).`), r.push(`Matching mode: ${s ? "checkbox (multiple matches allowed)" : "radio (single match per row)"}.`);
173
- let c = 0, l = 0, u = 0;
174
- o.forEach((e) => {
175
- let t = a[e.id], n = e.values || [];
176
- s ? n.forEach((e, n) => {
177
- e && u++, t && t[n] && (t[n] === e ? c++ : l++);
178
- }) : (u++, t && (i(n, t) ? c++ : l++));
179
- }), c > 0 && r.push(`${c} correct match(es) selected.`), l > 0 && r.push(`${l} incorrect match(es) selected.`), c === 0 && l === 0 && r.push("Student provided answers, but none matched the correct responses.");
180
- let d = g.enabled(e, n);
181
- d ? (r.push("Score calculated using partial scoring."), s ? (r.push("Score is based on the number of correct minus extra incorrect matches, divided by the total number of correct matches."), c + l > u && r.push("Extra selected matches beyond the correct set reduce the score.")) : r.push("Score is based on the number of correctly matched rows divided by the total number of rows.")) : (r.push("Score calculated using all-or-nothing scoring."), r.push("Student must match all rows correctly to receive full credit."));
182
- let f = O(e, n, a), p = d ? f : +(f === 1);
183
- return r.push(`Final score: ${p}.`), r;
184
- }, A = (e, t, r) => new Promise((i) => {
185
- r.mode === "evaluate" ? ((!t || n(t)) && i({
186
- score: 0,
187
- empty: !0,
188
- logTrace: ["Student did not provide any answer."]
189
- }), i({
190
- score: O(e, r, t.answers),
191
- empty: !1,
192
- logTrace: k(e, t, r)
193
- })) : i({
194
- score: void 0,
195
- completed: void 0,
196
- logTrace: []
197
- });
198
- });
199
- function j(e = {}) {
200
- return new Promise((t) => {
201
- t({
202
- ...y,
203
- ...e
204
- });
205
- });
206
- }
207
- var M = (e) => ({
208
- ...y,
209
- ...e
210
- });
211
- async function N(e, t, i, a) {
212
- let o = r(M(e)), c, l;
213
- (!t || n(t)) && i.mode === "evaluate" ? (c = "unanswered", l = "0%") : (c = S(o, i, t && t.answers), l = `${O(o, i, t && t.answers) * 100}%`);
214
- let u = {}, d = {
215
- score: l,
216
- correctness: c
217
- }, f = h(o, t, i);
218
- f || (o.rows = await m(o.rows, t, a, "id")), o.rows.forEach((e) => {
219
- u[e.id] = e.values, i.mode !== "evaluate" && delete e.values;
220
- });
221
- let p = i.mode === "evaluate" && o.feedbackEnabled ? await s(d.correctness, o.feedback) : void 0, { extraCSSRules: g, feedbackEnabled: _, promptEnabled: v, prompt: y, lockChoiceOrder: x, ...C } = o, w = {
222
- ...C,
223
- extraCSSRules: g,
224
- allowFeedback: _,
225
- prompt: v ? y : null,
226
- shuffled: !f,
227
- feedback: p,
228
- disabled: i.mode !== "gather",
229
- view: i.mode === "view"
230
- };
231
- return i.role === "instructor" && (i.mode === "view" || i.mode === "evaluate") ? (w.teacherInstructions = o.teacherInstructionsEnabled ? o.teacherInstructions : null, w.rationale = o.rationaleEnabled ? o.rationale : null) : (w.rationale = null, w.teacherInstructions = null), i.mode === "evaluate" && Object.assign(w, {
232
- correctResponse: u,
233
- correctness: d
234
- }), b("out: ", w), w;
235
- }
236
- var P = (e, t) => new Promise((n) => {
237
- if (t.mode !== "evaluate" && t.role === "instructor") {
238
- let { rows: t } = e, r = {};
239
- t.forEach((e) => {
240
- r[e.id] = e.values;
241
- }), n({
242
- answers: r,
243
- id: "1"
244
- });
245
- } else n(null);
246
- }), F = (e) => (e || "").replaceAll(/<[^>]*>/g, ""), I = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), L = (e = {}, t = {}) => {
247
- let { rows: n, choiceMode: r, headers: i } = e, { minQuestions: a, maxQuestions: o, maxLengthQuestionsHeading: s, maxAnswers: c, maxLengthAnswers: l, maxLengthFirstColumnHeading: u } = t, d = {}, f = {}, p = {};
248
- [
249
- "teacherInstructions",
250
- "prompt",
251
- "rationale"
252
- ].forEach((n) => {
253
- t[n]?.required && !I(e[n]) && (p[n] = "This field is required.");
254
- }), n.length < a ? p.noOfRowsError = `There should be at least ${a} question rows.` : n.length > o && (p.noOfRowsError = `No more than ${o} question rows should be defined.`), (n || []).forEach((e, t) => {
255
- let { id: r, values: i = [], title: a } = e;
256
- d[r] = "", s && F(a).length > s && (d[r] += `Content length should be maximum ${s} characters. `), I(a) ? n.slice(0, t).some((e) => I(e.title) === I(a)) && (d[r] += "Content should be unique. ") : d[r] += "Content should not be empty. ", i.some((e) => !!e) || (d[r] += "No correct response defined.");
257
- }), c && i.length - 1 > c && (p.columnsLengthError = `There should be maximum ${c} answers.`), u && i[0].length > u && (f[0] = `Content length should be maximum ${u} characters.`);
258
- let m = (i || []).map((e) => I(e));
259
- return m.shift(), m.forEach((e, t) => {
260
- let n = t + 1;
261
- f[n] = "", l && F(e).length > l && (f[n] += `Content length should be maximum ${l} characters. `), e ? m.slice(0, t).some((t) => t === e) && (f[t + 1] += "Content should be unique.") : f[n] += "Content should not be empty.";
262
- }), Object.values(d).some((e) => (e || "").length) && (p.rowsErrors = d, Object.values(d).some((e) => (e || "").includes("No correct response defined.")) && (p.correctResponseError = r === "radio" ? "There should be a correct response defined for every row." : "There should be at least one correct response defined for every row.")), Object.values(f).some((e) => (e || "").length) && (p.columnsErrors = f), p;
263
- };
264
- //#endregion
265
- export { P as createCorrectResponseSession, j as createDefaultModel, k as getLogTrace, N as model, M as normalize, A as outcome, L as validate };
266
-
267
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../shared/feedback/dist/index.js","../../../../../shared/controller-utils/dist/index.js","../../../src/controller/defaults.ts","../../../src/controller/index.ts"],"sourcesContent":["//#region src/defaults.ts\nvar e = {\n\tcorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Correct\",\n\t\tcustom: \"Correct\"\n\t},\n\tincorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Incorrect\",\n\t\tcustom: \"Incorrect\"\n\t},\n\tpartial: {\n\t\ttype: \"default\",\n\t\tdefault: \"Nearly\",\n\t\tcustom: \"Nearly\"\n\t},\n\tunanswered: {\n\t\ttype: \"default\",\n\t\tdefault: \"You have not entered a response\",\n\t\tcustom: \"You have not entered a response\"\n\t}\n};\n//#endregion\n//#region src/utils.ts\nfunction t(e) {\n\treturn e === \"partially-correct\" ? \"partial\" : e;\n}\n//#endregion\n//#region src/index.ts\nfunction n(n, i = {}) {\n\treturn new Promise((a) => {\n\t\tlet o = {\n\t\t\t...e,\n\t\t\t...i\n\t\t}, s = t(n), c = o[s], l = e[s];\n\t\tr(c, l[c.type]).then(a);\n\t});\n}\nfunction r(e, t) {\n\treturn new Promise((n) => {\n\t\tif (!e || e.type === \"none\") {\n\t\t\tn(void 0);\n\t\t\treturn;\n\t\t}\n\t\tn(e[e.type] || t);\n\t});\n}\nfunction i(n, r = {}) {\n\tlet i = {\n\t\t...e,\n\t\t...r\n\t}, o = t(n), s = i[o], c = e[o];\n\treturn a(s, c[s.type]);\n}\nfunction a(e, t) {\n\tif (!(!e || e.type === \"none\")) return e[e.type] || t;\n}\n//#endregion\nexport { e as defaultFeedback, a as getActualFeedback, i as getActualFeedbackForCorrectness, r as getFeedback, n as getFeedbackForCorrectness, t as normalizeCorrectness };\n","//#region \\0rolldown/runtime.js\nvar e = Object.defineProperty, t = (t, n) => {\n\tlet r = {};\n\tfor (var i in t) e(r, i, {\n\t\tget: t[i],\n\t\tenumerable: !0\n\t});\n\treturn n || e(r, Symbol.toStringTag, { value: \"Module\" }), r;\n};\n//#endregion\n//#region src/persistence.ts\nfunction n(e) {\n\treturn Array.isArray(e) ? e.filter((e) => e != null) : [];\n}\nfunction r(e) {\n\tlet t = [...e];\n\tfor (let e = t.length - 1; e > 0; e--) {\n\t\tlet n = Math.floor(Math.random() * (e + 1));\n\t\t[t[e], t[n]] = [t[n], t[e]];\n\t}\n\treturn t;\n}\nfunction i(e) {\n\treturn e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == \"object\" ? Object.keys(e).length === 0 : !1;\n}\nasync function a(e, t, a, o = \"value\") {\n\tlet s = n(t?.data?.shuffledValues ?? t?.shuffledValues ?? []);\n\tif (!t) {\n\t\tconsole.warn(\"Unable to save shuffled choices because there's no session.\");\n\t\treturn;\n\t}\n\tif (!i(s)) return n(s.map((t) => e.find((e) => e[o] === t)));\n\tlet c = r(e);\n\tif (a && typeof a == \"function\") try {\n\t\tlet e = n(c.map((e) => e[o]));\n\t\ti(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(c)}, key: ${o}`) : t.id && t.element && await a(t.id, t.element, { shuffledValues: e });\n\t} catch (e) {\n\t\tconsole.warn(\"Unable to save shuffled order for choices\"), console.error(e);\n\t}\n\telse console.warn(\"Unable to save shuffled choices, shuffle will happen every time.\");\n\treturn c;\n}\nfunction o(e, t, n) {\n\treturn !!(e.lockChoiceOrder || n[\"@pie-element\"]?.lockChoiceOrder || (n.role ?? \"student\") === \"instructor\");\n}\n//#endregion\n//#region src/partial-scoring.ts\nvar s = /* @__PURE__ */ t({ enabled: () => c });\nfunction c(e, t, n) {\n\treturn e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n == \"boolean\" ? n : !0;\n}\n//#endregion\nexport { a as getShuffledChoices, o as lockChoices, s as partialScoring };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/match/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport default {\n choiceMode: 'radio',\n feedbackEnabled: false,\n headers: ['Column 1', 'Column 2', 'Column 3'],\n layout: 3,\n lockChoiceOrder: true,\n partialScoring: false,\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n rows: [],\n scoringType: 'auto',\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/match/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { cloneDeep, isEmpty, isEqual } from '@pie-element/shared-lodash';\nimport { getFeedbackForCorrectness } from '@pie-element/shared-feedback';\nimport { lockChoices, getShuffledChoices, partialScoring } from '@pie-element/shared-controller-utils';\nimport debug from 'debug';\n\nconst log = debug('@pie-element:match:controller');\n\nimport defaults from './defaults.js';\n\nconst getResponseCorrectness = (model, answers, env = {}) => {\n const isPartialScoring = partialScoring.enabled(model, env);\n const rows = model.rows;\n const checkboxMode = model.choiceMode === 'checkbox';\n\n if (!answers || Object.keys(answers).length === 0) {\n return 'unanswered';\n }\n\n const totalCorrectAnswers = checkboxMode ? getTotalCorrectAnswers(model) : getTotalCorrect(model);\n let correctAnswers;\n let incorrectAnswers = 0;\n\n if (checkboxMode) {\n const checkboxes = getCheckboxes(rows, answers);\n\n correctAnswers = checkboxes.correctAnswers;\n incorrectAnswers = checkboxes.incorrectAnswers;\n } else {\n correctAnswers = getCorrectRadios(rows, answers);\n }\n\n if (totalCorrectAnswers === correctAnswers && !incorrectAnswers) {\n return 'correct';\n } else if (correctAnswers === 0) {\n return 'incorrect';\n } else if (isPartialScoring) {\n return 'partial';\n }\n\n return 'incorrect';\n};\n\nconst getCorrectness = (question, env, answers = {}) => {\n if (env.mode === 'evaluate') {\n return getResponseCorrectness(question, answers, env);\n }\n};\n\nconst getCheckboxes = (rows, answers) => {\n let correctAnswers = 0;\n let incorrectAnswers = 0;\n\n rows.forEach((row) => {\n const answer = answers[row.id];\n\n if (answer) {\n row.values.forEach((v, i) => {\n if (answer[i] && answer[i] === v) {\n correctAnswers += 1;\n } else if (answer[i] && answer[i] !== v) {\n incorrectAnswers += 1;\n }\n });\n }\n });\n\n return { correctAnswers, incorrectAnswers };\n};\n\nconst getCorrectRadios = (rows, answers) => {\n let correctAnswers = 0;\n\n rows.forEach((row) => {\n if (isEqual(row.values, answers[row.id])) {\n correctAnswers += 1;\n }\n });\n\n return correctAnswers;\n};\n\nconst getTotalCorrect = (question) => {\n const checkboxMode = question.choiceMode === 'checkbox';\n const matchingTable = checkboxMode ? question.layout - 1 : 1;\n return (question.rows.length || 0) * matchingTable;\n};\n\nconst getTotalCorrectAnswers = (question) => {\n let noOfTotalCorrectAnswers = 0;\n\n question.rows.forEach((row) => {\n row.values.forEach((value) => {\n if (value) {\n noOfTotalCorrectAnswers += 1;\n }\n });\n });\n\n return noOfTotalCorrectAnswers;\n};\n\nconst getPartialScore = (question, answers) => {\n const checkboxMode = question.choiceMode === 'checkbox';\n\n if (checkboxMode) {\n const { correctAnswers, incorrectAnswers } = getCheckboxes(question.rows, answers);\n const totalCorrect = getTotalCorrectAnswers(question);\n\n const total = totalCorrect === 0 ? 1 : totalCorrect;\n\n if (correctAnswers + incorrectAnswers > totalCorrect) {\n const extraAnswers = correctAnswers + incorrectAnswers - totalCorrect;\n const score = parseFloat(((correctAnswers - extraAnswers) / total).toFixed(2));\n\n return score < 0 ? 0 : score;\n } else {\n return parseFloat((correctAnswers / total).toFixed(2));\n }\n } else {\n const correctAnswers = getCorrectRadios(question.rows, answers);\n const totalCorrect = getTotalCorrect(question) === 0 ? 1 : getTotalCorrect(question);\n\n return parseFloat((correctAnswers / totalCorrect).toFixed(2));\n }\n};\n\nconst getOutComeScore = (question, env, answers = {}) => {\n const correctness = getCorrectness(question, env, answers);\n const isPartialScoring = partialScoring.enabled(question, env);\n\n return correctness === 'correct'\n ? 1\n : correctness === 'partial' && isPartialScoring\n ? getPartialScore(question, answers)\n : 0;\n};\n\n/**\n * Generates detailed trace log for match item scoring evaluation\n * @param {Object} question\n * @param {Object} session\n * @param {Object} env\n * @returns {Array<string>} traceLog\n */\nexport const getLogTrace = (question, session, env) => {\n const traceLog = [];\n\n const answers = session?.answers || {};\n const rows = question?.rows || [];\n const checkboxMode = question.choiceMode === 'checkbox';\n\n if (!answers || Object.keys(answers).length === 0) {\n traceLog.push('Student did not provide any answer.');\n return traceLog;\n }\n\n traceLog.push(`Match item contains ${rows.length} row(s).`);\n traceLog.push(`Matching mode: ${checkboxMode ? 'checkbox (multiple matches allowed)' : 'radio (single match per row)'}.`);\n\n let correctCount = 0;\n let incorrectCount = 0;\n let totalCorrect = 0;\n\n rows.forEach((row) => {\n const studentAnswer = answers[row.id];\n const correctValues = row.values || [];\n\n if (checkboxMode) {\n correctValues.forEach((v, idx) => {\n if (v) {\n totalCorrect++;\n }\n\n if (studentAnswer && studentAnswer[idx]) {\n if (studentAnswer[idx] === v) {\n correctCount++;\n } else {\n incorrectCount++;\n }\n }\n });\n } else {\n totalCorrect++;\n if (studentAnswer) {\n if (isEqual(correctValues, studentAnswer)) {\n correctCount++;\n } else {\n incorrectCount++;\n }\n }\n }\n });\n\n if (correctCount > 0) {\n traceLog.push(`${correctCount} correct match(es) selected.`);\n }\n\n if (incorrectCount > 0) {\n traceLog.push(`${incorrectCount} incorrect match(es) selected.`);\n }\n\n if (correctCount === 0 && incorrectCount === 0) {\n traceLog.push('Student provided answers, but none matched the correct responses.');\n }\n\n const partialScoringEnabled = partialScoring.enabled(question, env);\n\n if (partialScoringEnabled) {\n traceLog.push('Score calculated using partial scoring.');\n\n if (checkboxMode) {\n traceLog.push(\n 'Score is based on the number of correct minus extra incorrect matches, divided by the total number of correct matches.',\n );\n\n if (correctCount + incorrectCount > totalCorrect) {\n traceLog.push('Extra selected matches beyond the correct set reduce the score.');\n }\n } else {\n traceLog.push(\n 'Score is based on the number of correctly matched rows divided by the total number of rows.',\n );\n }\n } else {\n traceLog.push('Score calculated using all-or-nothing scoring.');\n traceLog.push('Student must match all rows correctly to receive full credit.');\n }\n\n const rawScore = getOutComeScore(question, env, answers);\n const finalScore = partialScoringEnabled ? rawScore : rawScore === 1 ? 1 : 0;\n\n traceLog.push(`Final score: ${finalScore}.`);\n\n return traceLog;\n};\n\nexport const outcome = (question, session, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate') {\n resolve({ score: undefined, completed: undefined, logTrace: [] });\n } else {\n if (!session || isEmpty(session)) {\n resolve({ score: 0, empty: true, logTrace: ['Student did not provide any answer.'] });\n }\n\n const out = {\n score: getOutComeScore(question, env, session.answers),\n empty: false,\n logTrace: getLogTrace(question, session, env),\n };\n\n resolve(out);\n }\n });\n};\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n}\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n * @param {*} updateSession - optional - a function that will set the properties passed into it on the session.\n */\nexport async function model(question, session, env, updateSession) {\n const normalizedQuestion = cloneDeep(normalize(question));\n let correctness, score;\n\n if ((!session || isEmpty(session)) && env.mode === 'evaluate') {\n correctness = 'unanswered';\n score = '0%';\n } else {\n correctness = getCorrectness(normalizedQuestion, env, session && session.answers);\n score = `${getOutComeScore(normalizedQuestion, env, session && session.answers) * 100}%`;\n }\n\n const correctResponse = {};\n const correctInfo = {\n score,\n correctness,\n };\n\n const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);\n\n if (!lockChoiceOrder) {\n normalizedQuestion.rows = await getShuffledChoices(normalizedQuestion.rows, session, updateSession, 'id');\n }\n\n normalizedQuestion.rows.forEach((row) => {\n correctResponse[row.id] = row.values;\n\n if (env.mode !== 'evaluate') {\n delete row.values;\n }\n });\n\n const feedback =\n env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled\n ? await getFeedbackForCorrectness(correctInfo.correctness, normalizedQuestion.feedback)\n : undefined;\n\n const {\n extraCSSRules,\n feedbackEnabled,\n promptEnabled,\n prompt,\n lockChoiceOrder: _,\n ...essentials\n } = normalizedQuestion;\n const out = {\n ...essentials,\n extraCSSRules,\n allowFeedback: feedbackEnabled,\n prompt: promptEnabled ? prompt : null,\n shuffled: !lockChoiceOrder,\n feedback,\n disabled: env.mode !== 'gather',\n view: env.mode === 'view',\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n out.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n } else {\n out.rationale = null;\n out.teacherInstructions = null;\n }\n\n if (env.mode === 'evaluate') {\n Object.assign(out, {\n correctResponse,\n correctness: correctInfo,\n });\n }\n\n log('out: ', out);\n return out;\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { rows } = question;\n const answers = {};\n\n rows.forEach((r) => {\n answers[r.id] = r.values;\n });\n\n resolve({\n answers,\n id: '1',\n });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { rows, choiceMode, headers } = model;\n const {\n minQuestions,\n maxQuestions,\n maxLengthQuestionsHeading,\n maxAnswers,\n maxLengthAnswers,\n maxLengthFirstColumnHeading,\n } = config;\n const rowsErrors = {};\n const columnsErrors = {};\n const errors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n if (rows.length < minQuestions) {\n errors.noOfRowsError = `There should be at least ${minQuestions} question rows.`;\n } else if (rows.length > maxQuestions) {\n errors.noOfRowsError = `No more than ${maxQuestions} question rows should be defined.`;\n }\n\n (rows || []).forEach((row, index) => {\n const { id, values = [], title } = row;\n rowsErrors[id] = '';\n\n if (maxLengthQuestionsHeading && getInnerText(title).length > maxLengthQuestionsHeading) {\n rowsErrors[id] += `Content length should be maximum ${maxLengthQuestionsHeading} characters. `;\n }\n\n if (!getContent(title)) {\n rowsErrors[id] += 'Content should not be empty. ';\n } else {\n // check for identical content with the previous answers\n const identicalAnswer = rows.slice(0, index).some((r) => getContent(r.title) === getContent(title));\n\n if (identicalAnswer) {\n rowsErrors[id] += 'Content should be unique. ';\n }\n }\n\n const hasCorrectResponse = values.some((value) => !!value);\n\n if (!hasCorrectResponse) {\n rowsErrors[id] += 'No correct response defined.';\n }\n });\n\n if (maxAnswers && headers.length - 1 > maxAnswers) {\n errors.columnsLengthError = `There should be maximum ${maxAnswers} answers.`;\n }\n\n if (maxLengthFirstColumnHeading && headers[0].length > maxLengthFirstColumnHeading) {\n columnsErrors[0] = `Content length should be maximum ${maxLengthFirstColumnHeading} characters.`;\n }\n\n const headersContent = (headers || []).map((heading) => getContent(heading));\n headersContent.shift(); // remove first column since it does not require validation\n\n headersContent.forEach((heading, index) => {\n const headerIndex = index + 1; // we need to add 1 because we removed first header from validation\n columnsErrors[headerIndex] = '';\n\n if (maxLengthAnswers && getInnerText(heading).length > maxLengthAnswers) {\n columnsErrors[headerIndex] += `Content length should be maximum ${maxLengthAnswers} characters. `;\n }\n\n if (!heading) {\n columnsErrors[headerIndex] += 'Content should not be empty.';\n } else {\n // check for identical content with the previous headers\n const identicalAnswer = headersContent.slice(0, index).some((head) => head === heading);\n\n if (identicalAnswer) {\n columnsErrors[index + 1] += 'Content should be unique.';\n }\n }\n });\n\n const hasRowErrors = Object.values(rowsErrors).some((error) => (error || '').length);\n\n if (hasRowErrors) {\n errors.rowsErrors = rowsErrors;\n\n const noCorrectAnswer = Object.values(rowsErrors).some((error) =>\n (error || '').includes('No correct response defined.'),\n );\n\n if (noCorrectAnswer) {\n errors.correctResponseError =\n choiceMode === 'radio'\n ? 'There should be a correct response defined for every row.'\n : 'There should be at least one correct response defined for every row.';\n }\n }\n\n const hasColumnErrors = Object.values(columnsErrors).some((error) => (error || '').length);\n\n if (hasColumnErrors) {\n errors.columnsErrors = columnsErrors;\n }\n\n return errors;\n};\n"],"mappings":";;;AACA,IAAI,IAAI;CACP,SAAS;EACR,MAAM;EACN,SAAS;EACT,QAAQ;CACT;CACA,WAAW;EACV,MAAM;EACN,SAAS;EACT,QAAQ;CACT;CACA,SAAS;EACR,MAAM;EACN,SAAS;EACT,QAAQ;CACT;CACA,YAAY;EACX,MAAM;EACN,SAAS;EACT,QAAQ;CACT;AACD;AAGA,SAAS,EAAE,GAAG;CACb,OAAO,MAAM,sBAAsB,YAAY;AAChD;AAGA,SAAS,EAAE,GAAG,IAAI,CAAC,GAAG;CACrB,OAAO,IAAI,SAAS,MAAM;EACzB,IAAI,IAAI;GACP,GAAG;GACH,GAAG;EACJ,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,EAA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