@citolab/qti-components 7.28.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +6178 -2946
  3. package/dist/base.d.ts +9 -50
  4. package/dist/base.js +31 -6
  5. package/dist/chunk-5QYII4OZ.js +1374 -0
  6. package/dist/chunk-5QYII4OZ.js.map +1 -0
  7. package/dist/{chunk-FK2IVMS3.js → chunk-5SJS36BI.js} +4264 -3647
  8. package/dist/chunk-5SJS36BI.js.map +1 -0
  9. package/dist/chunk-64XSIBGO.js +241 -0
  10. package/dist/chunk-64XSIBGO.js.map +1 -0
  11. package/dist/{chunk-F6WP6WEF.js → chunk-7V4HJFHW.js} +3 -3
  12. package/dist/{chunk-F6WP6WEF.js.map → chunk-7V4HJFHW.js.map} +1 -1
  13. package/dist/{chunk-Z2SUBRH5.js → chunk-H3J7LFRO.js} +834 -1005
  14. package/dist/chunk-H3J7LFRO.js.map +1 -0
  15. package/dist/chunk-IJD53WY6.js +719 -0
  16. package/dist/chunk-IJD53WY6.js.map +1 -0
  17. package/dist/chunk-KYEZRYO6.js +1608 -0
  18. package/dist/chunk-KYEZRYO6.js.map +1 -0
  19. package/dist/{chunk-PINGOK2F.js → chunk-LZJHHZQ2.js} +1979 -1775
  20. package/dist/chunk-LZJHHZQ2.js.map +1 -0
  21. package/dist/chunk-MGF5F3S2.js +11 -0
  22. package/dist/chunk-MGF5F3S2.js.map +1 -0
  23. package/dist/chunk-MJVPNN7W.js +11 -0
  24. package/dist/chunk-MJVPNN7W.js.map +1 -0
  25. package/dist/{chunk-YLIYPNMK.js → chunk-NA2N2WSG.js} +1303 -1193
  26. package/dist/chunk-NA2N2WSG.js.map +1 -0
  27. package/dist/chunk-V5G7X53Y.js +11 -0
  28. package/dist/chunk-V5G7X53Y.js.map +1 -0
  29. package/dist/chunk-W4QZPCNC.js +294 -0
  30. package/dist/chunk-W4QZPCNC.js.map +1 -0
  31. package/dist/chunk-WCQ26LV7.js +102 -0
  32. package/dist/chunk-WCQ26LV7.js.map +1 -0
  33. package/dist/{chunk-OQ77SE2W.js → chunk-WVVMNF74.js} +851 -925
  34. package/dist/chunk-WVVMNF74.js.map +1 -0
  35. package/dist/{chunk-N7S3GNUP.js → chunk-X3E5HXG2.js} +2 -2
  36. package/dist/corrections.d.ts +1 -0
  37. package/dist/corrections.js +84 -0
  38. package/dist/elements.d.ts +1 -399
  39. package/dist/elements.js +6 -5
  40. package/dist/index.d.ts +9 -23
  41. package/dist/index.js +189 -76
  42. package/dist/interactions.d.ts +1 -915
  43. package/dist/interactions.js +19 -15
  44. package/dist/item.css +4118 -1920
  45. package/dist/item.d.ts +1 -127
  46. package/dist/item.js +6 -11
  47. package/dist/loader.d.ts +1 -22
  48. package/dist/loader.js +2 -3
  49. package/dist/processing.d.ts +1 -731
  50. package/dist/processing.js +2 -3
  51. package/dist/qti-components-jsx.d.ts +5394 -2718
  52. package/dist/test.d.ts +1 -537
  53. package/dist/test.js +26 -11
  54. package/dist/transformers.d.ts +1 -18
  55. package/dist/transformers.js +1 -2
  56. package/package.json +20 -16
  57. package/custom-elements.json +0 -43161
  58. package/dist/chunk-BPIDAS3T.js +0 -495
  59. package/dist/chunk-BPIDAS3T.js.map +0 -1
  60. package/dist/chunk-FK2IVMS3.js.map +0 -1
  61. package/dist/chunk-LQZCSHN5.js +0 -3673
  62. package/dist/chunk-LQZCSHN5.js.map +0 -1
  63. package/dist/chunk-OQ77SE2W.js.map +0 -1
  64. package/dist/chunk-PINGOK2F.js.map +0 -1
  65. package/dist/chunk-QXBXORM3.js +0 -27
  66. package/dist/chunk-U2FLSHK7.js +0 -510
  67. package/dist/chunk-U2FLSHK7.js.map +0 -1
  68. package/dist/chunk-YLIYPNMK.js.map +0 -1
  69. package/dist/chunk-Z2SUBRH5.js.map +0 -1
  70. package/dist/computed-item.context-DfsW_96S.d.ts +0 -22
  71. package/dist/computed.context-DHbxad0N.d.ts +0 -45
  72. package/dist/config.context-BjZ2bZSY.d.ts +0 -42
  73. package/dist/interaction-Bgzlw7Iu.d.ts +0 -110
  74. package/dist/item.context-CkUeDcaO.d.ts +0 -15
  75. package/dist/qti-condition-expression-B1BYmCcq.d.ts +0 -26
  76. package/dist/qti-feedback-ChmXhZuf.d.ts +0 -21
  77. package/dist/qti-rule-base-ajOnfGXY.d.ts +0 -16
  78. package/dist/qti-transform-test-DMx816H0.d.ts +0 -68
  79. package/dist/qti.context-B8PSyIWm.d.ts +0 -14
  80. package/dist/test.context-CByZZjkR.d.ts +0 -15
  81. package/dist/variables-CMYcDbyW.d.ts +0 -70
  82. /package/dist/{chunk-N7S3GNUP.js.map → chunk-X3E5HXG2.js.map} +0 -0
  83. /package/dist/{chunk-QXBXORM3.js.map → corrections.js.map} +0 -0
@@ -1,27 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __typeError = (msg) => {
4
- throw TypeError(msg);
5
- };
6
- var __decorateClass = (decorators, target, key, kind) => {
7
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
8
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
9
- if (decorator = decorators[i])
10
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11
- if (kind && result) __defProp(target, key, result);
12
- return result;
13
- };
14
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
15
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
16
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
17
- var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
18
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
19
-
20
- export {
21
- __decorateClass,
22
- __privateGet,
23
- __privateAdd,
24
- __privateSet,
25
- __privateMethod
26
- };
27
- //# sourceMappingURL=chunk-QXBXORM3.js.map
@@ -1,510 +0,0 @@
1
- import {
2
- item_default,
3
- m
4
- } from "./chunk-LQZCSHN5.js";
5
- import {
6
- qtiTransformItem
7
- } from "./chunk-BPIDAS3T.js";
8
- import {
9
- T,
10
- c,
11
- computedItemContext,
12
- configContext,
13
- e,
14
- i,
15
- i2,
16
- n,
17
- r,
18
- t,
19
- watch
20
- } from "./chunk-Z2SUBRH5.js";
21
- import {
22
- __decorateClass,
23
- __privateAdd,
24
- __privateGet,
25
- __privateMethod,
26
- __privateSet
27
- } from "./chunk-QXBXORM3.js";
28
-
29
- // ../qti-item/src/components/item-container/item-container.ts
30
- var _templateContent, _ItemContainer_instances, initializeTemplateContent_fn, applyStyles_fn;
31
- var ItemContainer = class extends i2 {
32
- constructor() {
33
- super(...arguments);
34
- __privateAdd(this, _ItemContainer_instances);
35
- this.itemURL = null;
36
- this.itemDoc = null;
37
- this.itemXML = null;
38
- /** Template content if provided */
39
- __privateAdd(this, _templateContent, null);
40
- }
41
- async handleItemURLChange() {
42
- if (!this.itemURL) return;
43
- try {
44
- const api = await qtiTransformItem().load(this.itemURL);
45
- this.itemDoc = api.htmlDoc();
46
- } catch (error) {
47
- console.error("Error loading or parsing XML:", error);
48
- }
49
- }
50
- handleItemXMLChange() {
51
- if (!this.itemXML) return;
52
- try {
53
- this.itemDoc = qtiTransformItem().parse(this.itemXML).htmlDoc();
54
- } catch (error) {
55
- console.error("Error parsing XML:", error);
56
- }
57
- }
58
- async connectedCallback() {
59
- super.connectedCallback();
60
- __privateMethod(this, _ItemContainer_instances, initializeTemplateContent_fn).call(this);
61
- __privateMethod(this, _ItemContainer_instances, applyStyles_fn).call(this);
62
- if (this.itemURL) {
63
- this.handleItemURLChange();
64
- }
65
- if (this.itemXML) {
66
- this.handleItemXMLChange();
67
- }
68
- }
69
- render() {
70
- return T`
71
- ${__privateGet(this, _templateContent)}
72
- <slot></slot>
73
- ${m(this.itemDoc, T`<span>Loading...</span>`)}
74
- `;
75
- }
76
- };
77
- _templateContent = new WeakMap();
78
- _ItemContainer_instances = new WeakSet();
79
- initializeTemplateContent_fn = function() {
80
- const template = this.querySelector("template");
81
- __privateSet(this, _templateContent, template ? template.content : T``);
82
- };
83
- applyStyles_fn = function() {
84
- const sheet = new CSSStyleSheet();
85
- sheet.replaceSync(item_default);
86
- this.shadowRoot.adoptedStyleSheets = [sheet];
87
- };
88
- __decorateClass([
89
- n({ type: String, attribute: "item-url" })
90
- ], ItemContainer.prototype, "itemURL", 2);
91
- __decorateClass([
92
- r()
93
- ], ItemContainer.prototype, "itemDoc", 2);
94
- __decorateClass([
95
- r()
96
- ], ItemContainer.prototype, "itemXML", 2);
97
- __decorateClass([
98
- watch("itemURL", { waitUntilFirstUpdate: true })
99
- ], ItemContainer.prototype, "handleItemURLChange", 1);
100
- __decorateClass([
101
- watch("itemXML", { waitUntilFirstUpdate: true })
102
- ], ItemContainer.prototype, "handleItemXMLChange", 1);
103
- ItemContainer = __decorateClass([
104
- t("item-container")
105
- ], ItemContainer);
106
-
107
- // ../qti-item/src/components/item-correct-response-mode/item-correct-response-mode.ts
108
- var _ItemCorrectResponseMode_instances, switchMode_fn;
109
- var ItemCorrectResponseMode = class extends i2 {
110
- constructor() {
111
- super(...arguments);
112
- __privateAdd(this, _ItemCorrectResponseMode_instances);
113
- this.label = "Correct response mode";
114
- this._options = {
115
- internal: "Internal",
116
- full: "Full (copy)"
117
- };
118
- }
119
- render() {
120
- return T`
121
- <label part="label" for="modeSelect">${this.label}</label>
122
- <select
123
- part="select"
124
- id="modeSelect"
125
- @change=${(e2) => {
126
- const el = e2.target;
127
- __privateMethod(this, _ItemCorrectResponseMode_instances, switchMode_fn).call(this, el.value);
128
- }}
129
- >
130
- ${Object.keys(this._options).map(
131
- (value) => T`<option value="${value}" ?selected=${value === this.itemContext?.correctResponseMode}>
132
- ${this._options[value]}
133
- </option>`
134
- )}
135
- </select>
136
- `;
137
- }
138
- };
139
- _ItemCorrectResponseMode_instances = new WeakSet();
140
- switchMode_fn = function(view) {
141
- this.dispatchEvent(
142
- new CustomEvent("item-switch-correct-response-mode", {
143
- detail: view,
144
- bubbles: true
145
- })
146
- );
147
- };
148
- __decorateClass([
149
- c({ context: configContext, subscribe: true })
150
- ], ItemCorrectResponseMode.prototype, "itemContext", 2);
151
- __decorateClass([
152
- n({ type: String })
153
- ], ItemCorrectResponseMode.prototype, "label", 2);
154
- __decorateClass([
155
- r()
156
- ], ItemCorrectResponseMode.prototype, "_options", 2);
157
- ItemCorrectResponseMode = __decorateClass([
158
- t("item-correct-response-mode")
159
- ], ItemCorrectResponseMode);
160
-
161
- // ../qti-item/src/components/styles.ts
162
- var form = i`
163
- display: inline-flex;
164
- align-items: center;
165
- cursor: pointer;
166
- padding: 0.5rem 1rem;
167
- border-radius: 0.25rem;
168
- user-select: none;
169
- `;
170
- var btn = i`
171
- background-color: lightgray;
172
- ${form};
173
- `;
174
- var dis = i`
175
- cursor: not-allowed;
176
- opacity: 0.8;
177
- `;
178
- var ind = i`
179
- ${form};
180
- border: 1px solid gray;
181
- `;
182
-
183
- // ../qti-item/src/components/item-show-candidate-correction/item-show-candidate-correction.ts
184
- var _hasCorrectResponse, _previousActiveItem, _ItemShowCandidateCorrection_instances, toggleState_fn, getDisplayedText_fn;
185
- var ItemShowCandidateCorrection = class extends i2 {
186
- // Store previous active item reference
187
- constructor() {
188
- super();
189
- __privateAdd(this, _ItemShowCandidateCorrection_instances);
190
- this.shown = false;
191
- this.disabled = false;
192
- this.showCandidateCorrectionText = "Show candidate correction";
193
- this.hideCandidateCorrectionText = "Hide candidate correction";
194
- this.noCorrectResponseText = "No correct response specified";
195
- __privateAdd(this, _hasCorrectResponse, false);
196
- // correct response is removed on certain point
197
- __privateAdd(this, _previousActiveItem, "");
198
- }
199
- updated() {
200
- if (!__privateGet(this, _hasCorrectResponse) || __privateGet(this, _previousActiveItem) !== this.computedContext?.identifier) {
201
- __privateSet(this, _previousActiveItem, this.computedContext?.identifier);
202
- const containsCorrectResponse = !!this.computedContext?.variables.some((v) => v["correctResponse"]);
203
- const containsMapping = !!this.computedContext?.variables.some((v) => {
204
- return v["mapping"]?.mapEntries?.length > 0 || v["areaMapping"]?.areaMapEntries?.length > 0;
205
- });
206
- __privateSet(this, _hasCorrectResponse, containsCorrectResponse || containsMapping);
207
- }
208
- this.disabled = !__privateGet(this, _hasCorrectResponse);
209
- }
210
- render() {
211
- return T` <div @click="${__privateMethod(this, _ItemShowCandidateCorrection_instances, toggleState_fn)}">${__privateMethod(this, _ItemShowCandidateCorrection_instances, getDisplayedText_fn).call(this)}</div> `;
212
- }
213
- };
214
- _hasCorrectResponse = new WeakMap();
215
- _previousActiveItem = new WeakMap();
216
- _ItemShowCandidateCorrection_instances = new WeakSet();
217
- toggleState_fn = function() {
218
- if (this.disabled) return;
219
- this.dispatchEvent(
220
- new CustomEvent("item-show-candidate-correction", {
221
- detail: !this.shown,
222
- bubbles: true
223
- })
224
- );
225
- };
226
- getDisplayedText_fn = function() {
227
- return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCandidateCorrectionText : this.showCandidateCorrectionText;
228
- };
229
- ItemShowCandidateCorrection.styles = i`
230
- :host {
231
- ${btn};
232
- }
233
- :host([disabled]) {
234
- ${dis};
235
- }
236
- `;
237
- __decorateClass([
238
- c({ context: computedItemContext, subscribe: true })
239
- ], ItemShowCandidateCorrection.prototype, "computedContext", 2);
240
- __decorateClass([
241
- n({ type: Boolean, reflect: true })
242
- ], ItemShowCandidateCorrection.prototype, "shown", 2);
243
- __decorateClass([
244
- n({ type: Boolean, reflect: true })
245
- ], ItemShowCandidateCorrection.prototype, "disabled", 2);
246
- __decorateClass([
247
- n({ type: String })
248
- ], ItemShowCandidateCorrection.prototype, "showCandidateCorrectionText", 2);
249
- __decorateClass([
250
- n({ type: String })
251
- ], ItemShowCandidateCorrection.prototype, "hideCandidateCorrectionText", 2);
252
- __decorateClass([
253
- n({ type: String })
254
- ], ItemShowCandidateCorrection.prototype, "noCorrectResponseText", 2);
255
- ItemShowCandidateCorrection = __decorateClass([
256
- t("item-show-candidate-correction")
257
- ], ItemShowCandidateCorrection);
258
-
259
- // ../qti-item/src/components/item-show-correct-response/item-show-correct-response.ts
260
- var _hasCorrectResponse2, _previousActiveItem2, _ItemShowCorrectResponse_instances, toggleState_fn2, getDisplayedText_fn2;
261
- var ItemShowCorrectResponse = class extends i2 {
262
- constructor() {
263
- super(...arguments);
264
- __privateAdd(this, _ItemShowCorrectResponse_instances);
265
- this.shown = false;
266
- this.disabled = false;
267
- this.showCorrectText = "Show correct response";
268
- this.hideCorrectText = "Hide correct response";
269
- this.noCorrectResponseText = "No correct response specified";
270
- __privateAdd(this, _hasCorrectResponse2, false);
271
- // correct response is removed on certain point
272
- __privateAdd(this, _previousActiveItem2, "");
273
- }
274
- // Store previous active item reference
275
- updated() {
276
- if (!__privateGet(this, _hasCorrectResponse2) || __privateGet(this, _previousActiveItem2) !== this.computedContext?.identifier) {
277
- __privateSet(this, _previousActiveItem2, this.computedContext?.identifier);
278
- const containsCorrectResponse = !!this.computedContext?.variables.some((v) => v["correctResponse"]);
279
- const containsMapping = !!this.computedContext?.variables.some((v) => {
280
- return v["mapping"]?.mapEntries?.length > 0 || v["areaMapping"]?.areaMapEntries?.length > 0;
281
- });
282
- __privateSet(this, _hasCorrectResponse2, containsCorrectResponse || containsMapping);
283
- }
284
- this.disabled = !__privateGet(this, _hasCorrectResponse2);
285
- }
286
- render() {
287
- return T` <div @click="${__privateMethod(this, _ItemShowCorrectResponse_instances, toggleState_fn2)}">${__privateMethod(this, _ItemShowCorrectResponse_instances, getDisplayedText_fn2).call(this)}</div> `;
288
- }
289
- };
290
- _hasCorrectResponse2 = new WeakMap();
291
- _previousActiveItem2 = new WeakMap();
292
- _ItemShowCorrectResponse_instances = new WeakSet();
293
- toggleState_fn2 = function() {
294
- if (this.disabled) return;
295
- this.dispatchEvent(
296
- new CustomEvent("item-show-correct-response", {
297
- detail: !this.shown,
298
- bubbles: true
299
- })
300
- );
301
- };
302
- getDisplayedText_fn2 = function() {
303
- return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCorrectText : this.showCorrectText;
304
- };
305
- ItemShowCorrectResponse.styles = i`
306
- :host {
307
- ${btn};
308
- }
309
- :host([disabled]) {
310
- ${dis};
311
- }
312
- `;
313
- __decorateClass([
314
- c({ context: computedItemContext, subscribe: true })
315
- ], ItemShowCorrectResponse.prototype, "computedContext", 2);
316
- __decorateClass([
317
- n({ type: Boolean, reflect: true })
318
- ], ItemShowCorrectResponse.prototype, "shown", 2);
319
- __decorateClass([
320
- n({ type: Boolean, reflect: true })
321
- ], ItemShowCorrectResponse.prototype, "disabled", 2);
322
- __decorateClass([
323
- n({ type: String })
324
- ], ItemShowCorrectResponse.prototype, "showCorrectText", 2);
325
- __decorateClass([
326
- n({ type: String })
327
- ], ItemShowCorrectResponse.prototype, "hideCorrectText", 2);
328
- __decorateClass([
329
- n({ type: String })
330
- ], ItemShowCorrectResponse.prototype, "noCorrectResponseText", 2);
331
- ItemShowCorrectResponse = __decorateClass([
332
- t("item-show-correct-response")
333
- ], ItemShowCorrectResponse);
334
-
335
- // ../qti-item/src/components/item-print-variables/item-print-variables.ts
336
- var ItemPrintVariables = class extends i2 {
337
- render() {
338
- const activeItem = this.computedContext;
339
- if (!activeItem || !activeItem.variables) return T``;
340
- const responseVariables = activeItem.variables.filter((v) => v.type === "response");
341
- const outcomeVariables = activeItem.variables.filter((v) => v.type === "outcome");
342
- const renderTable = (variables, title) => T`
343
- <h3>${title}</h3>
344
- <table>
345
- <thead>
346
- <tr>
347
- <th>Identifier</th>
348
- <th>Value</th>
349
- <th>Cardinality</th>
350
- <th>Base Type</th>
351
- <th>Correct Response / Mappings</th>
352
- </tr>
353
- </thead>
354
- <tbody>
355
- ${variables.map((v) => {
356
- const correctResponse = v.correctResponse ? Array.isArray(v.correctResponse) ? v.correctResponse.join(", ") : v.correctResponse : "";
357
- const mapEntries = v.mapping?.mapEntries?.map((m2) => `${m2.mapKey}=${m2.mappedValue}pt`).join(", ") || "";
358
- const areaMapEntries = v.areaMapping?.areaMapEntries?.map((m2) => `${m2.shape}(${m2.coords})=${m2.mappedValue}pt`).join(", ") || "";
359
- return T`
360
- <tr>
361
- <td>${v.identifier}</td>
362
- <td>${Array.isArray(v.value) ? v.value.join(", ") : v.value}</td>
363
- <td>${v.cardinality}</td>
364
- <td>${v.baseType}</td>
365
- <td>${correctResponse || mapEntries || areaMapEntries}</td>
366
- </tr>
367
- `;
368
- })}
369
- </tbody>
370
- </table>
371
- `;
372
- return T`
373
- ${renderTable(responseVariables, "Response Variables")} ${renderTable(outcomeVariables, "Outcome Variables")}
374
- `;
375
- }
376
- };
377
- ItemPrintVariables.styles = i`
378
- table {
379
- width: 100%;
380
- border-collapse: collapse;
381
- margin: 20px 0;
382
- font-size: 14px;
383
- text-align: left;
384
- }
385
- th,
386
- td {
387
- border: 1px solid #ddd;
388
- padding: 8px;
389
- }
390
- th {
391
- background-color: #f4f4f4;
392
- font-weight: bold;
393
- }
394
- h3 {
395
- margin-top: 20px;
396
- font-size: 16px;
397
- }
398
- `;
399
- __decorateClass([
400
- c({ context: computedItemContext, subscribe: true })
401
- ], ItemPrintVariables.prototype, "computedContext", 2);
402
- ItemPrintVariables = __decorateClass([
403
- t("item-print-variables")
404
- ], ItemPrintVariables);
405
-
406
- // ../qti-item/src/components/qti-item/qti-item.ts
407
- var _qtiAssessmentItem, _onItemContextChanged, _onAssessmentItemConnected, _onHandleShowCorrectResponse, _onHandleShowCandidateCorrection, _onHandleSwitchCorrectResponseMode, _QtiItem_instances, handleItemContextChanged_fn, handleAssessmentItemConnected_fn, handleShowCorrectResponse_fn, handleShowCandidateCorrection_fn, handleSwitchCorrectResponseMode_fn, updateItemVariablesInTestContext_fn;
408
- var QtiItem = class extends i2 {
409
- constructor() {
410
- super();
411
- __privateAdd(this, _QtiItem_instances);
412
- __privateAdd(this, _qtiAssessmentItem);
413
- this.configContext = {};
414
- // Store event handlers as instance properties
415
- __privateAdd(this, _onItemContextChanged, __privateMethod(this, _QtiItem_instances, handleItemContextChanged_fn).bind(this));
416
- __privateAdd(this, _onAssessmentItemConnected, __privateMethod(this, _QtiItem_instances, handleAssessmentItemConnected_fn).bind(this));
417
- __privateAdd(this, _onHandleShowCorrectResponse, __privateMethod(this, _QtiItem_instances, handleShowCorrectResponse_fn).bind(this));
418
- __privateAdd(this, _onHandleShowCandidateCorrection, __privateMethod(this, _QtiItem_instances, handleShowCandidateCorrection_fn).bind(this));
419
- __privateAdd(this, _onHandleSwitchCorrectResponseMode, __privateMethod(this, _QtiItem_instances, handleSwitchCorrectResponseMode_fn).bind(this));
420
- this.addEventListener("qti-item-context-updated", __privateGet(this, _onItemContextChanged));
421
- this.addEventListener("qti-assessment-item-connected", __privateGet(this, _onAssessmentItemConnected));
422
- this.addEventListener("item-show-correct-response", __privateGet(this, _onHandleShowCorrectResponse));
423
- this.addEventListener("item-show-candidate-correction", __privateGet(this, _onHandleShowCandidateCorrection));
424
- this.addEventListener("item-switch-correct-response-mode", __privateGet(this, _onHandleSwitchCorrectResponseMode));
425
- }
426
- render() {
427
- return T`<slot></slot>`;
428
- }
429
- disconnectedCallback() {
430
- super.disconnectedCallback();
431
- this.removeEventListener("qti-item-context-changed", __privateGet(this, _onItemContextChanged));
432
- this.removeEventListener("qti-assessment-item-connected", __privateGet(this, _onAssessmentItemConnected));
433
- }
434
- };
435
- _qtiAssessmentItem = new WeakMap();
436
- _onItemContextChanged = new WeakMap();
437
- _onAssessmentItemConnected = new WeakMap();
438
- _onHandleShowCorrectResponse = new WeakMap();
439
- _onHandleShowCandidateCorrection = new WeakMap();
440
- _onHandleSwitchCorrectResponseMode = new WeakMap();
441
- _QtiItem_instances = new WeakSet();
442
- handleItemContextChanged_fn = function(e2) {
443
- __privateMethod(this, _QtiItem_instances, updateItemVariablesInTestContext_fn).call(this, e2.detail.itemContext.identifier, e2.detail?.itemContext?.variables || []);
444
- };
445
- handleAssessmentItemConnected_fn = function(e2) {
446
- const fullVariables = e2.detail._context.variables;
447
- __privateSet(this, _qtiAssessmentItem, e2.detail);
448
- this.computedContext = this.computedContext?.identifier === __privateGet(this, _qtiAssessmentItem).identifier ? { ...this.computedContext, title: __privateGet(this, _qtiAssessmentItem).title } : {
449
- identifier: __privateGet(this, _qtiAssessmentItem).identifier,
450
- title: __privateGet(this, _qtiAssessmentItem).title,
451
- adaptive: __privateGet(this, _qtiAssessmentItem).getAttribute("adaptive")?.toLowerCase() === "true" || false,
452
- variables: fullVariables,
453
- correctResponseMode: "internal"
454
- };
455
- __privateMethod(this, _QtiItem_instances, updateItemVariablesInTestContext_fn).call(this, __privateGet(this, _qtiAssessmentItem).identifier, fullVariables || []);
456
- };
457
- handleShowCorrectResponse_fn = function(e2) {
458
- if (__privateGet(this, _qtiAssessmentItem)) {
459
- __privateGet(this, _qtiAssessmentItem).showCorrectResponse(e2.detail);
460
- }
461
- };
462
- handleShowCandidateCorrection_fn = function(e2) {
463
- if (__privateGet(this, _qtiAssessmentItem)) {
464
- __privateGet(this, _qtiAssessmentItem).showCandidateCorrection(e2.detail);
465
- }
466
- };
467
- handleSwitchCorrectResponseMode_fn = function(e2) {
468
- __privateMethod(this, _QtiItem_instances, handleShowCorrectResponse_fn).call(this, new CustomEvent("item-show-correct-response", { detail: false, bubbles: true }));
469
- this.configContext = {
470
- ...this.configContext,
471
- correctResponseMode: e2.detail
472
- };
473
- };
474
- updateItemVariablesInTestContext_fn = function(identifier, variables) {
475
- const rawscore = variables?.find((vr) => vr.identifier == "SCORE")?.value;
476
- const score = parseFloat(rawscore?.toString());
477
- const completionStatus = variables?.find((v) => v.identifier === "completionStatus")?.value;
478
- const correct = score !== void 0 && !isNaN(score) && score > 0;
479
- const incorrect = score !== void 0 && !isNaN(score) && score <= 0;
480
- const completed = completionStatus === "completed";
481
- this.computedContext = {
482
- ...this.computedContext,
483
- identifier,
484
- correct,
485
- incorrect,
486
- completed,
487
- variables
488
- };
489
- };
490
- __decorateClass([
491
- r(),
492
- e({ context: computedItemContext })
493
- ], QtiItem.prototype, "computedContext", 2);
494
- __decorateClass([
495
- r(),
496
- e({ context: configContext })
497
- ], QtiItem.prototype, "configContext", 2);
498
- QtiItem = __decorateClass([
499
- t("qti-item")
500
- ], QtiItem);
501
-
502
- export {
503
- ItemContainer,
504
- ItemCorrectResponseMode,
505
- ItemShowCandidateCorrection,
506
- ItemShowCorrectResponse,
507
- ItemPrintVariables,
508
- QtiItem
509
- };
510
- //# sourceMappingURL=chunk-U2FLSHK7.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../qti-item/src/components/item-container/item-container.ts","../../qti-item/src/components/item-correct-response-mode/item-correct-response-mode.ts","../../qti-item/src/components/styles.ts","../../qti-item/src/components/item-show-candidate-correction/item-show-candidate-correction.ts","../../qti-item/src/components/item-show-correct-response/item-show-correct-response.ts","../../qti-item/src/components/item-print-variables/item-print-variables.ts","../../qti-item/src/components/qti-item/qti-item.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { until } from 'lit/directives/until.js';\n\nimport { watch } from '@qti-components/utilities';\nimport { qtiTransformItem } from '@qti-components/transformers';\n\n// eslint-disable-next-line import/no-relative-packages\nimport itemCss from '../../../../qti-theme/src/item.css?inline';\n\n/**\n * `<item-container>` is a custom element designed for hosting the qti-assessment-item.\n * The `qti-assessment-item` will be placed inside the shadow DOM of this element.\n * The element loads the item from the provided URL and renders it inside the shadow DOM.\n *\n * ### Styling\n * Add a class to the element for styling.\n *\n * ```html\n * <qti-item>\n * <item-container class=\"m-4 bg-white\" item-url=\"./path/to/item.xml\"></item-container>\n * </qti-item>\n * ```\n */\n@customElement('item-container')\nexport class ItemContainer extends LitElement {\n /** URL of the item to load */\n @property({ type: String, attribute: 'item-url' })\n itemURL: string = null;\n\n /** A parsed HTML document */\n @state()\n itemDoc: DocumentFragment = null;\n\n /** The raw XML string */\n @state()\n itemXML: string = null;\n\n /** Template content if provided */\n #templateContent: unknown = null;\n\n @watch('itemURL', { waitUntilFirstUpdate: true })\n protected async handleItemURLChange() {\n if (!this.itemURL) return;\n try {\n const api = await qtiTransformItem().load(this.itemURL);\n this.itemDoc = api.htmlDoc();\n } catch (error) {\n console.error('Error loading or parsing XML:', error);\n }\n }\n\n @watch('itemXML', { waitUntilFirstUpdate: true })\n protected handleItemXMLChange() {\n if (!this.itemXML) return;\n try {\n this.itemDoc = qtiTransformItem().parse(this.itemXML).htmlDoc();\n } catch (error) {\n console.error('Error parsing XML:', error);\n }\n }\n\n override async connectedCallback(): Promise<void> {\n super.connectedCallback();\n this.#initializeTemplateContent();\n this.#applyStyles();\n if (this.itemURL) {\n this.handleItemURLChange();\n }\n if (this.itemXML) {\n this.handleItemXMLChange();\n }\n }\n\n #initializeTemplateContent() {\n const template = this.querySelector('template') as HTMLTemplateElement;\n this.#templateContent = template ? template.content : html``;\n }\n\n #applyStyles() {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(itemCss);\n this.shadowRoot.adoptedStyleSheets = [sheet];\n }\n\n override render() {\n return html`\n ${this.#templateContent}\n <slot></slot>\n ${until(this.itemDoc, html`<span>Loading...</span>`)}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-container': ItemContainer;\n }\n}\n","import { html, LitElement } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport { configContext } from '@qti-components/base';\n\nimport type { ConfigContext, CorrectResponseMode } from '@qti-components/base';\n\n@customElement('item-correct-response-mode')\nexport class ItemCorrectResponseMode extends LitElement {\n @consume({ context: configContext, subscribe: true })\n private itemContext: ConfigContext;\n\n @property({ type: String })\n label = 'Correct response mode';\n\n @state()\n private _options = {\n internal: 'Internal',\n full: 'Full (copy)'\n };\n\n #switchMode(view: CorrectResponseMode) {\n this.dispatchEvent(\n new CustomEvent('item-switch-correct-response-mode', {\n detail: view,\n bubbles: true\n })\n );\n }\n\n override render() {\n return html`\n <label part=\"label\" for=\"modeSelect\">${this.label}</label>\n <select\n part=\"select\"\n id=\"modeSelect\"\n @change=${(e: Event) => {\n const el = e.target as HTMLSelectElement;\n this.#switchMode(el.value as CorrectResponseMode);\n }}\n >\n ${Object.keys(this._options).map(\n value =>\n html`<option value=\"${value}\" ?selected=${value === this.itemContext?.correctResponseMode}>\n ${this._options[value as keyof typeof this._options]}\n </option>`\n )}\n </select>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-correct-response-mode': ItemCorrectResponseMode;\n }\n}\n","import { css } from 'lit';\n\nexport const form = css`\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n padding: 0.5rem 1rem;\n border-radius: 0.25rem;\n user-select: none;\n`;\n\nexport const btn = css`\n background-color: lightgray;\n ${form};\n`;\n\nexport const dis = css`\n cursor: not-allowed;\n opacity: 0.8;\n`;\n\nexport const ind = css`\n ${form};\n border: 1px solid gray;\n`;\n","import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport { computedItemContext } from '@qti-components/base';\n\nimport * as styles from '../styles';\n\nimport type { ComputedItemContext } from '@qti-components/base';\n\n@customElement('item-show-candidate-correction')\nexport class ItemShowCandidateCorrection extends LitElement {\n @consume({ context: computedItemContext, subscribe: true })\n public computedContext?: ComputedItemContext;\n\n static override styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n @property({ type: Boolean, reflect: true }) shown = false;\n @property({ type: Boolean, reflect: true }) disabled = false; // Reflects to `disabled` attribute\n @property({ type: String }) showCandidateCorrectionText = 'Show candidate correction';\n @property({ type: String }) hideCandidateCorrectionText = 'Hide candidate correction';\n @property({ type: String }) noCorrectResponseText = 'No correct response specified';\n\n #hasCorrectResponse = false; // correct response is removed on certain point\n #previousActiveItem = ''; // Store previous active item reference\n\n constructor() {\n super();\n }\n\n override updated() {\n if (!this.#hasCorrectResponse || this.#previousActiveItem !== this.computedContext?.identifier) {\n this.#previousActiveItem = this.computedContext?.identifier;\n const containsCorrectResponse = !!this.computedContext?.variables.some(v => (v as any)['correctResponse']);\n const containsMapping = !!this.computedContext?.variables.some(v => {\n return (v as any)['mapping']?.mapEntries?.length > 0 || (v as any)['areaMapping']?.areaMapEntries?.length > 0;\n });\n this.#hasCorrectResponse = containsCorrectResponse || containsMapping;\n }\n this.disabled = !this.#hasCorrectResponse;\n }\n\n #toggleState() {\n if (this.disabled) return; // Prevent toggle if disabled\n\n this.dispatchEvent(\n new CustomEvent('item-show-candidate-correction', {\n detail: !this.shown,\n bubbles: true\n })\n );\n }\n\n #getDisplayedText(): string {\n return this.disabled\n ? this.noCorrectResponseText\n : this.shown\n ? this.hideCandidateCorrectionText\n : this.showCandidateCorrectionText;\n }\n\n override render() {\n return html` <div @click=\"${this.#toggleState}\">${this.#getDisplayedText()}</div> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-show-candidate-correction': ItemShowCandidateCorrection;\n }\n}\n","import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport { computedItemContext } from '@qti-components/base';\n\nimport * as styles from '../styles';\n\nimport type { ComputedItemContext } from '@qti-components/base';\n\n@customElement('item-show-correct-response')\nexport class ItemShowCorrectResponse extends LitElement {\n @consume({ context: computedItemContext, subscribe: true })\n public computedContext?: ComputedItemContext;\n\n static override styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n @property({ type: Boolean, reflect: true }) shown = false;\n @property({ type: Boolean, reflect: true }) disabled = false; // Reflects to `disabled` attribute\n @property({ type: String }) showCorrectText = 'Show correct response';\n @property({ type: String }) hideCorrectText = 'Hide correct response';\n @property({ type: String }) noCorrectResponseText = 'No correct response specified';\n\n #hasCorrectResponse = false; // correct response is removed on certain point\n #previousActiveItem = ''; // Store previous active item reference\n\n override updated() {\n if (!this.#hasCorrectResponse || this.#previousActiveItem !== this.computedContext?.identifier) {\n this.#previousActiveItem = this.computedContext?.identifier;\n const containsCorrectResponse = !!this.computedContext?.variables.some(v => (v as any)['correctResponse']);\n const containsMapping = !!this.computedContext?.variables.some(v => {\n return (v as any)['mapping']?.mapEntries?.length > 0 || (v as any)['areaMapping']?.areaMapEntries?.length > 0;\n });\n this.#hasCorrectResponse = containsCorrectResponse || containsMapping;\n }\n this.disabled = !this.#hasCorrectResponse;\n }\n\n #toggleState() {\n if (this.disabled) return; // Prevent toggle if disabled\n\n this.dispatchEvent(\n new CustomEvent('item-show-correct-response', {\n detail: !this.shown,\n bubbles: true\n })\n );\n }\n\n #getDisplayedText(): string {\n return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCorrectText : this.showCorrectText;\n }\n\n override render() {\n return html` <div @click=\"${this.#toggleState}\">${this.#getDisplayedText()}</div> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-show-correct-response': ItemShowCorrectResponse;\n }\n}\n","import { consume } from '@lit/context';\nimport { css, html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport { computedItemContext } from '@qti-components/base';\n\nimport type { ResponseVariable } from '@qti-components/base';\nimport type { ComputedItemContext } from '@qti-components/base';\n\n@customElement('item-print-variables')\nexport class ItemPrintVariables extends LitElement {\n @consume({ context: computedItemContext, subscribe: true })\n protected computedContext?: ComputedItemContext;\n\n static override styles = css`\n table {\n width: 100%;\n border-collapse: collapse;\n margin: 20px 0;\n font-size: 14px;\n text-align: left;\n }\n th,\n td {\n border: 1px solid #ddd;\n padding: 8px;\n }\n th {\n background-color: #f4f4f4;\n font-weight: bold;\n }\n h3 {\n margin-top: 20px;\n font-size: 16px;\n }\n `;\n\n override render() {\n const activeItem = this.computedContext;\n\n if (!activeItem || !activeItem.variables) return html``;\n\n const responseVariables: ResponseVariable[] = activeItem.variables.filter(v => v.type === 'response');\n const outcomeVariables = activeItem.variables.filter(v => v.type === 'outcome');\n\n const renderTable = (variables: ResponseVariable[], title: string) => html`\n <h3>${title}</h3>\n <table>\n <thead>\n <tr>\n <th>Identifier</th>\n <th>Value</th>\n <th>Cardinality</th>\n <th>Base Type</th>\n <th>Correct Response / Mappings</th>\n </tr>\n </thead>\n <tbody>\n ${variables.map(v => {\n const correctResponse = v.correctResponse\n ? Array.isArray(v.correctResponse)\n ? v.correctResponse.join(', ')\n : v.correctResponse\n : '';\n\n const mapEntries = v.mapping?.mapEntries?.map(m => `${m.mapKey}=${m.mappedValue}pt`).join(', ') || '';\n\n const areaMapEntries =\n v.areaMapping?.areaMapEntries?.map(m => `${m.shape}(${m.coords})=${m.mappedValue}pt`).join(', ') || '';\n\n return html`\n <tr>\n <td>${v.identifier}</td>\n <td>${Array.isArray(v.value) ? v.value.join(', ') : v.value}</td>\n <td>${v.cardinality}</td>\n <td>${v.baseType}</td>\n <td>${correctResponse || mapEntries || areaMapEntries}</td>\n </tr>\n `;\n })}\n </tbody>\n </table>\n `;\n\n return html`\n ${renderTable(responseVariables, 'Response Variables')} ${renderTable(outcomeVariables, 'Outcome Variables')}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-print-variables': ItemPrintVariables;\n }\n}\n","import { provide } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { customElement, state } from 'lit/decorators.js';\n\nimport { computedItemContext } from '@qti-components/base';\nimport { configContext } from '@qti-components/base';\n\nimport type { QtiAssessmentItem } from '@qti-components/elements';\nimport type { ConfigContext, CorrectResponseMode } from '@qti-components/base';\nimport type { ItemContext } from '@qti-components/base';\nimport type { VariableDeclaration } from '@qti-components/base';\nimport type { ComputedItemContext } from '@qti-components/base';\n\n/**\n * `<qti-item>` is a custom element designed for rendering a single `qti-assessment-item`.\n * It can also host some functionalities to interact with the item like scoring, showing feedback, etc.\n * Placing a mandatory `<item-container>` inside '<qti-item>' will load or parse the item and render it.\n * See `<item-container>` for more details.\n *\n * ```html\n * <qti-item>\n * <item-container class=\"m-4 bg-white\" item-url=\"./path/to/item.xml\"></item-container>\n * </qti-item>\n * ```\n */\n@customElement('qti-item')\nexport class QtiItem extends LitElement {\n @state()\n @provide({ context: computedItemContext })\n public computedContext: ComputedItemContext;\n #qtiAssessmentItem?: QtiAssessmentItem;\n\n @state()\n @provide({ context: configContext })\n public configContext: ConfigContext = {};\n\n // Store event handlers as instance properties\n #onItemContextChanged = this.#handleItemContextChanged.bind(this);\n #onAssessmentItemConnected = this.#handleAssessmentItemConnected.bind(this);\n\n #onHandleShowCorrectResponse = this.#handleShowCorrectResponse.bind(this);\n #onHandleShowCandidateCorrection = this.#handleShowCandidateCorrection.bind(this);\n #onHandleSwitchCorrectResponseMode = this.#handleSwitchCorrectResponseMode.bind(this);\n\n constructor() {\n super();\n this.addEventListener('qti-item-context-updated', this.#onItemContextChanged);\n this.addEventListener('qti-assessment-item-connected', this.#onAssessmentItemConnected);\n this.addEventListener('item-show-correct-response', this.#onHandleShowCorrectResponse);\n this.addEventListener('item-show-candidate-correction', this.#onHandleShowCandidateCorrection);\n this.addEventListener('item-switch-correct-response-mode', this.#onHandleSwitchCorrectResponseMode);\n }\n\n #handleItemContextChanged(e: CustomEvent<{ itemContext: ItemContext }>) {\n this.#updateItemVariablesInTestContext(e.detail.itemContext.identifier, e.detail?.itemContext?.variables || []);\n }\n\n #handleAssessmentItemConnected(e: CustomEvent<QtiAssessmentItem>) {\n const fullVariables = (e.detail as any)._context.variables;\n this.#qtiAssessmentItem = e.detail;\n this.computedContext =\n this.computedContext?.identifier === this.#qtiAssessmentItem.identifier\n ? { ...this.computedContext, title: this.#qtiAssessmentItem.title }\n : ({\n identifier: this.#qtiAssessmentItem.identifier,\n title: this.#qtiAssessmentItem.title,\n adaptive: this.#qtiAssessmentItem.getAttribute('adaptive')?.toLowerCase() === 'true' || false,\n variables: fullVariables,\n correctResponseMode: 'internal'\n } as ComputedItemContext);\n this.#updateItemVariablesInTestContext(this.#qtiAssessmentItem.identifier, fullVariables || []);\n }\n\n #handleShowCorrectResponse(e: CustomEvent<boolean>) {\n if (this.#qtiAssessmentItem) {\n this.#qtiAssessmentItem.showCorrectResponse(e.detail);\n }\n }\n\n #handleShowCandidateCorrection(e: CustomEvent<boolean>) {\n if (this.#qtiAssessmentItem) {\n this.#qtiAssessmentItem.showCandidateCorrection(e.detail);\n }\n }\n\n #handleSwitchCorrectResponseMode(e: CustomEvent<CorrectResponseMode>) {\n // Switch off the correct response first\n this.#handleShowCorrectResponse(new CustomEvent('item-show-correct-response', { detail: false, bubbles: true }));\n\n this.configContext = {\n ...this.configContext,\n correctResponseMode: e.detail\n };\n }\n\n #updateItemVariablesInTestContext(\n identifier: string,\n variables: readonly VariableDeclaration<string | string[] | null>[]\n ): void {\n const rawscore = variables?.find(vr => vr.identifier == 'SCORE')?.value;\n const score = parseFloat(rawscore?.toString());\n const completionStatus = variables?.find(v => v.identifier === 'completionStatus')?.value;\n\n const correct = score !== undefined && !isNaN(score) && score > 0;\n const incorrect = score !== undefined && !isNaN(score) && score <= 0;\n const completed = completionStatus === 'completed';\n this.computedContext = {\n ...this.computedContext,\n identifier,\n correct,\n incorrect,\n completed,\n variables\n };\n }\n\n override render() {\n return html`<slot></slot>`;\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('qti-item-context-changed', this.#onItemContextChanged);\n this.removeEventListener('qti-assessment-item-connected', this.#onAssessmentItemConnected);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-item': QtiItem;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAyBO,IAAM,gBAAN,cAA4BA,GAAW;AAAA,EAAvC;AAAA;AAAA;AAGL,mBAAkB;AAIlB,mBAA4B;AAI5B,mBAAkB;AAGlB;AAAA,yCAA4B;AAAA;AAAA,EAG5B,MAAgB,sBAAsB;AACpC,QAAI,CAAC,KAAK,QAAS;AACnB,QAAI;AACF,Y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