@pie-qti/item-player 0.1.18 → 0.1.19

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.
@@ -3281,7 +3281,20 @@ function Ds(e) {
3281
3281
  });
3282
3282
  return r || !n || /url\(/i.test(i);
3283
3283
  }
3284
- function Os(e, t, n, r) {
3284
+ function Os(e) {
3285
+ let t = e.parentNode;
3286
+ for (; t;) {
3287
+ if (t.rawTagName?.toLowerCase() === "svg") return !0;
3288
+ t = t.parentNode;
3289
+ }
3290
+ return !1;
3291
+ }
3292
+ function ks(e, t, n, r) {
3293
+ let i = [...e.childNodes];
3294
+ for (let e of i) e.rawTagName && As(e, t, n, r + 1);
3295
+ e.replaceWith(...e.childNodes);
3296
+ }
3297
+ function As(e, t, n, r) {
3285
3298
  if (n.enabled) {
3286
3299
  if (r > n.maxDepth) throw new ps(`HTML depth exceeds maxHtmlDepth (${r} > ${n.maxDepth})`);
3287
3300
  if (n.nodes++, n.nodes > n.maxNodes) throw new ps(`HTML node count exceeds maxHtmlNodes (${n.nodes} > ${n.maxNodes})`);
@@ -3292,7 +3305,11 @@ function Os(e, t, n, r) {
3292
3305
  return;
3293
3306
  }
3294
3307
  if (i && Es.has(i)) {
3295
- e.remove();
3308
+ if (Os(e)) {
3309
+ e.remove();
3310
+ return;
3311
+ }
3312
+ ks(e, t, n, r);
3296
3313
  return;
3297
3314
  }
3298
3315
  if (i === "iframe" && !gs(t)) {
@@ -3300,7 +3317,7 @@ function Os(e, t, n, r) {
3300
3317
  return;
3301
3318
  }
3302
3319
  if ((i === "object" || i === "embed") && !hs(t)) {
3303
- let n = js(e, t);
3320
+ let n = Ns(e, t);
3304
3321
  if (n) {
3305
3322
  e.replaceWith(n);
3306
3323
  return;
@@ -3313,9 +3330,7 @@ function Os(e, t, n, r) {
3313
3330
  return;
3314
3331
  }
3315
3332
  if (i?.includes("-") && !ws(i)) {
3316
- let i = [...e.childNodes];
3317
- for (let e of i) e.rawTagName && Os(e, t, n, r + 1);
3318
- e.replaceWith(...e.childNodes);
3333
+ ks(e, t, n, r);
3319
3334
  return;
3320
3335
  }
3321
3336
  let a = e.attributes || {};
@@ -3360,9 +3375,9 @@ function Os(e, t, n, r) {
3360
3375
  }
3361
3376
  }
3362
3377
  let o = e.childNodes.filter((e) => e.rawTagName);
3363
- for (let e of o) Os(e, t, n, r + 1);
3378
+ for (let e of o) As(e, t, n, r + 1);
3364
3379
  }
3365
- function ks(e, t) {
3380
+ function js(e, t) {
3366
3381
  if (!e || typeof e != "string") return "";
3367
3382
  try {
3368
3383
  let n = To(t?.security);
@@ -3376,16 +3391,16 @@ function ks(e, t) {
3376
3391
  maxNodes: n.maxHtmlNodes,
3377
3392
  maxDepth: n.maxHtmlDepth
3378
3393
  };
3379
- for (let e of i) Os(e, t, a, 1);
3394
+ for (let e of i) As(e, t, a, 1);
3380
3395
  return r.toString();
3381
3396
  } catch (e) {
3382
3397
  return e instanceof ps || console.error("HTML sanitization failed:", e), "";
3383
3398
  }
3384
3399
  }
3385
- function As(e, t) {
3386
- return !e || typeof e != "string" ? "" : /<[^>]+>/.test(e) ? ks(e, t) : e;
3400
+ function Ms(e, t) {
3401
+ return !e || typeof e != "string" ? "" : /<[^>]+>/.test(e) ? js(e, t) : e;
3387
3402
  }
3388
- function js(e, t) {
3403
+ function Ns(e, t) {
3389
3404
  if (e.rawTagName?.toLowerCase() !== "object") return null;
3390
3405
  let n = e.getAttribute("type")?.trim().toLowerCase() ?? "", r = e.getAttribute("data")?.trim() ?? "";
3391
3406
  if (!n || !r) return null;
@@ -3410,7 +3425,7 @@ function js(e, t) {
3410
3425
  }
3411
3426
  //#endregion
3412
3427
  //#region src/interactions/hottext/extractor.ts
3413
- var Ms = {
3428
+ var Ps = {
3414
3429
  id: "qti:hottext-interaction",
3415
3430
  name: "QTI Standard Hottext Interaction",
3416
3431
  priority: 10,
@@ -3433,7 +3448,7 @@ var Ms = {
3433
3448
  };
3434
3449
  }), a = n.getNumberAttribute(e, "maxChoices", 1), o = n.getNumberAttribute(e, "minChoices", 0), s = n.getClasses(e), c = n.getAttribute(e, "data-max-selections-message", "") || null, l = n.getAttribute(e, "data-min-selections-message", "") || null, u = n.getChildrenByTag(e, "prompt"), d = u.length > 0 ? n.getHtmlContent(u[0]) : null, f = "";
3435
3450
  for (let t of e.childNodes) typeof t != "string" && t.rawTagName !== "prompt" && t.rawTagName !== "qti-prompt" ? f += t.outerHTML || t.toString() : typeof t == "string" && (f += t);
3436
- return f = ks(f, { security: t.config.security }), {
3451
+ return f = js(f, { security: t.config.security }), {
3437
3452
  hottextChoices: i,
3438
3453
  contentHtml: f,
3439
3454
  maxChoices: a,
@@ -3456,7 +3471,7 @@ var Ms = {
3456
3471
  warnings: n.length > 0 ? n : void 0
3457
3472
  };
3458
3473
  }
3459
- }, Ns = {
3474
+ }, Fs = {
3460
3475
  id: "qti:inline-choice-interaction",
3461
3476
  name: "QTI Standard Inline Choice Interaction",
3462
3477
  priority: 10,
@@ -3495,7 +3510,7 @@ var Ms = {
3495
3510
  warnings: n.length > 0 ? n : void 0
3496
3511
  };
3497
3512
  }
3498
- }, Ps = {
3513
+ }, Is = {
3499
3514
  id: "qti:match-interaction",
3500
3515
  name: "QTI Standard Match Interaction",
3501
3516
  priority: 10,
@@ -3574,7 +3589,7 @@ var Ms = {
3574
3589
  errors: t.length > 0 ? t : void 0
3575
3590
  };
3576
3591
  }
3577
- }, Fs = {
3592
+ }, Ls = {
3578
3593
  id: "qti:media-interaction",
3579
3594
  name: "QTI Standard Media Interaction",
3580
3595
  priority: 10,
@@ -3639,7 +3654,7 @@ var Ms = {
3639
3654
  warnings: n.length > 0 ? n : void 0
3640
3655
  };
3641
3656
  }
3642
- }, Is = {
3657
+ }, Rs = {
3643
3658
  id: "qti:order-interaction",
3644
3659
  name: "QTI Standard Order Interaction",
3645
3660
  priority: 10,
@@ -3686,7 +3701,7 @@ var Ms = {
3686
3701
  };
3687
3702
  //#endregion
3688
3703
  //#region src/interactions/position-object/extractor.ts
3689
- function Ls(e, t, n, r) {
3704
+ function zs(e, t, n, r) {
3690
3705
  if (!e) return null;
3691
3706
  let i = t.getAttribute(e, "type", ""), a = t.getAttribute(e, "data", ""), o = t.getAttribute(e, "width", n), s = t.getAttribute(e, "height", r), c = t.getHtmlContent(e);
3692
3707
  return i.startsWith("image/svg") && /<svg[\s>]/i.test(c) ? {
@@ -3701,7 +3716,7 @@ function Ls(e, t, n, r) {
3701
3716
  height: s
3702
3717
  };
3703
3718
  }
3704
- var Rs = {
3719
+ var Bs = {
3705
3720
  id: "qti:position-object-interaction",
3706
3721
  name: "QTI Standard Position Object Interaction",
3707
3722
  priority: 10,
@@ -3712,7 +3727,7 @@ var Rs = {
3712
3727
  return t === "positionobjectinteraction" || t === "qti-position-object-interaction";
3713
3728
  },
3714
3729
  extract(e, t) {
3715
- let { utils: n, responseId: r } = t, i = e.parentNode, a = i?.rawTagName?.toLowerCase(), o = i && (a === "positionobjectstage" || a === "qti-position-object-stage") && n.getChildrenByTag(i, "positionObjectInteraction").includes(e) ? i : void 0, s = o ? n.getChildrenByTag(o, "object")[0] : void 0, c = n.getChildrenByTag(e, "object")[0], l = Ls(s, n, "500", "300"), u = Ls(c, n, "50", "50"), d = n.getNumberAttribute(e, "maxChoices", 1), f = n.getNumberAttribute(e, "minChoices", 0), p = n.getTextContent(c).trim() || r, m = n.getClasses(e), h = n.getPrompt(e);
3730
+ let { utils: n, responseId: r } = t, i = e.parentNode, a = i?.rawTagName?.toLowerCase(), o = i && (a === "positionobjectstage" || a === "qti-position-object-stage") && n.getChildrenByTag(i, "positionObjectInteraction").includes(e) ? i : void 0, s = o ? n.getChildrenByTag(o, "object")[0] : void 0, c = n.getChildrenByTag(e, "object")[0], l = zs(s, n, "500", "300"), u = zs(c, n, "50", "50"), d = n.getNumberAttribute(e, "maxChoices", 1), f = n.getNumberAttribute(e, "minChoices", 0), p = n.getTextContent(c).trim() || r, m = n.getClasses(e), h = n.getPrompt(e);
3716
3731
  return {
3717
3732
  imageData: l,
3718
3733
  positionObjectStages: [{
@@ -3738,7 +3753,7 @@ var Rs = {
3738
3753
  warnings: n.length > 0 ? n : void 0
3739
3754
  };
3740
3755
  }
3741
- }, zs = {
3756
+ }, Vs = {
3742
3757
  id: "qti:portable-custom-interaction",
3743
3758
  name: "QTI Portable Custom Interaction",
3744
3759
  priority: 20,
@@ -3749,29 +3764,29 @@ var Rs = {
3749
3764
  ],
3750
3765
  description: "Extracts QTI 2.x/3.0 portable custom interaction module paths, markup, and config",
3751
3766
  canHandle(e, t) {
3752
- let n = Bs(e);
3753
- return n === "portablecustominteraction" || n === "qti-portable-custom-interaction" || n === "custominteraction" && Vs(e, ["portablecustominteraction"]) !== null;
3767
+ let n = Hs(e);
3768
+ return n === "portablecustominteraction" || n === "qti-portable-custom-interaction" || n === "custominteraction" && Us(e, ["portablecustominteraction"]) !== null;
3754
3769
  },
3755
3770
  extract(e, t) {
3756
- let { utils: n } = t, r = Bs(e) === "custominteraction" ? Vs(e, ["portablecustominteraction"]) : e;
3771
+ let { utils: n } = t, r = Hs(e) === "custominteraction" ? Us(e, ["portablecustominteraction"]) : e;
3757
3772
  if (!r) throw Error("customInteraction does not contain a portableCustomInteraction payload");
3758
- let i = n.getAttribute(e, "responseIdentifier") || n.getAttribute(e, "response-identifier") || t.responseId || "", a = n.getAttribute(r, "customInteractionTypeIdentifier") || n.getAttribute(r, "custom-interaction-type-identifier") || n.getAttribute(r, "customInteractionIdentifierType") || n.getAttribute(r, "custom-interaction-identifier-type") || "", o = "", s, c = Vs(r, ["interactionmodules", "qti-interaction-modules"]);
3773
+ let i = n.getAttribute(e, "responseIdentifier") || n.getAttribute(e, "response-identifier") || t.responseId || "", a = n.getAttribute(r, "customInteractionTypeIdentifier") || n.getAttribute(r, "custom-interaction-type-identifier") || n.getAttribute(r, "customInteractionIdentifierType") || n.getAttribute(r, "custom-interaction-identifier-type") || "", o = "", s, c = Us(r, ["interactionmodules", "qti-interaction-modules"]);
3759
3774
  if (c) {
3760
- let e = Vs(c, ["interactionmodule", "qti-interaction-module"]);
3775
+ let e = Us(c, ["interactionmodule", "qti-interaction-module"]);
3761
3776
  if (e) {
3762
3777
  o = n.getAttribute(e, "primaryPath") || n.getAttribute(e, "primary-path") || "";
3763
3778
  let t = n.getAttribute(e, "fallbackPath") || n.getAttribute(e, "fallback-path") || "";
3764
3779
  t && (s = t);
3765
3780
  }
3766
3781
  }
3767
- let l = Vs(r, ["instance"]);
3782
+ let l = Us(r, ["instance"]);
3768
3783
  if (!o && l) {
3769
- let e = Hs(l, ["script"]).find((e) => !!n.getAttribute(e, "src"));
3784
+ let e = Ws(l, ["script"]).find((e) => !!n.getAttribute(e, "src"));
3770
3785
  o = e ? n.getAttribute(e, "src") : "";
3771
3786
  }
3772
- let u = Vs(r, ["interactionmarkup", "qti-interaction-markup"]) ?? l, d = u ? n.getHtmlContent(u) : "", f = {}, p = Vs(r, ["pciproperties", "qti-pci-properties"]);
3787
+ let u = Us(r, ["interactionmarkup", "qti-interaction-markup"]) ?? l, d = u ? n.getHtmlContent(u) : "", f = {}, p = Us(r, ["pciproperties", "qti-pci-properties"]);
3773
3788
  if (p) {
3774
- let e = Hs(p, ["pciproperty", "qti-pci-property"]);
3789
+ let e = Ws(p, ["pciproperty", "qti-pci-property"]);
3775
3790
  for (let t of e) {
3776
3791
  let e = n.getAttribute(t, "key") || n.getAttribute(t, "name") || "", r = n.getAttribute(t, "value") || (t.textContent ?? "").trim() || "";
3777
3792
  e && (f[e] = r);
@@ -3796,25 +3811,25 @@ var Rs = {
3796
3811
  };
3797
3812
  }
3798
3813
  };
3799
- function Bs(e) {
3814
+ function Hs(e) {
3800
3815
  let t = e.rawTagName?.toLowerCase() ?? "";
3801
3816
  return t.includes(":") ? t.slice(t.lastIndexOf(":") + 1) : t;
3802
3817
  }
3803
- function Vs(e, t) {
3804
- return Hs(e, t)[0] ?? null;
3818
+ function Us(e, t) {
3819
+ return Ws(e, t)[0] ?? null;
3805
3820
  }
3806
- function Hs(e, t) {
3821
+ function Ws(e, t) {
3807
3822
  let n = new Set(t.map((e) => e.toLowerCase())), r = [], i = (e) => {
3808
3823
  for (let t of e.childNodes ?? []) {
3809
3824
  let e = t;
3810
- e.rawTagName && (n.has(Bs(e)) && r.push(e), i(e));
3825
+ e.rawTagName && (n.has(Hs(e)) && r.push(e), i(e));
3811
3826
  }
3812
3827
  };
3813
3828
  return i(e), r;
3814
3829
  }
3815
3830
  //#endregion
3816
3831
  //#region src/interactions/modules.ts
3817
- var Us = [
3832
+ var Gs = [
3818
3833
  {
3819
3834
  type: "choiceInteraction",
3820
3835
  extractor: No,
@@ -3860,17 +3875,17 @@ var Us = [
3860
3875
  },
3861
3876
  {
3862
3877
  type: "inlineChoiceInteraction",
3863
- extractor: Ns,
3878
+ extractor: Fs,
3864
3879
  placement: "inline"
3865
3880
  },
3866
3881
  {
3867
3882
  type: "orderInteraction",
3868
- extractor: Is,
3883
+ extractor: Rs,
3869
3884
  placement: "block"
3870
3885
  },
3871
3886
  {
3872
3887
  type: "matchInteraction",
3873
- extractor: Ps,
3888
+ extractor: Is,
3874
3889
  placement: "block"
3875
3890
  },
3876
3891
  {
@@ -3977,17 +3992,17 @@ var Us = [
3977
3992
  },
3978
3993
  {
3979
3994
  type: "portableCustomInteraction",
3980
- extractor: zs,
3995
+ extractor: Vs,
3981
3996
  placement: "block"
3982
3997
  },
3983
3998
  {
3984
3999
  type: "mediaInteraction",
3985
- extractor: Fs,
4000
+ extractor: Ls,
3986
4001
  placement: "block"
3987
4002
  },
3988
4003
  {
3989
4004
  type: "hottextInteraction",
3990
- extractor: Ms,
4005
+ extractor: Ps,
3991
4006
  placement: "block"
3992
4007
  },
3993
4008
  {
@@ -4056,7 +4071,7 @@ var Us = [
4056
4071
  },
4057
4072
  {
4058
4073
  type: "positionObjectInteraction",
4059
- extractor: Rs,
4074
+ extractor: Bs,
4060
4075
  placement: "block"
4061
4076
  },
4062
4077
  {
@@ -4065,29 +4080,29 @@ var Us = [
4065
4080
  placement: "block"
4066
4081
  }
4067
4082
  ];
4068
- function Ws() {
4069
- return Us.map((e) => e.extractor);
4083
+ function Ks() {
4084
+ return Gs.map((e) => e.extractor);
4070
4085
  }
4071
- var Gs = new Map(Us.map((e) => [e.type.toLowerCase(), e.type]));
4072
- function Ks(e) {
4086
+ var qs = new Map(Gs.map((e) => [e.type.toLowerCase(), e.type]));
4087
+ function Js(e) {
4073
4088
  let t = e.toLowerCase();
4074
- return t.startsWith("qti-") ? t.slice(4).replace(/-([a-z])/g, (e, t) => t.toUpperCase()) : Gs.get(t) ?? e;
4089
+ return t.startsWith("qti-") ? t.slice(4).replace(/-([a-z])/g, (e, t) => t.toUpperCase()) : qs.get(t) ?? e;
4075
4090
  }
4076
- function qs(e) {
4077
- let t = Ks(e);
4078
- return Us.find((e) => e.type === t) ?? null;
4091
+ function Ys(e) {
4092
+ let t = Js(e);
4093
+ return Gs.find((e) => e.type === t) ?? null;
4079
4094
  }
4080
- function Js(e) {
4081
- return qs(e)?.placement === "inline";
4095
+ function Xs(e) {
4096
+ return Ys(e)?.placement === "inline";
4082
4097
  }
4083
- function Ys(e) {
4084
- return Js(Ks(e));
4098
+ function Zs(e) {
4099
+ return Xs(Js(e));
4085
4100
  }
4086
4101
  //#endregion
4087
4102
  //#region src/document/AssessmentItemDocument.ts
4088
- var Xs = class {
4103
+ var Qs = class {
4089
4104
  constructor({ itemXml: e, elementNameMapper: t, attributeNameMapper: n, security: r }) {
4090
- this.extractionDocument = null, this.extractionRoot = null, this.itemXml = e, this.security = r, this.mathMlPrefixes = ec(e), this.elementNameMapper = t, this.attributeNameMapper = n, Eo(this.itemXml, this.security), this.xmlDocument = b(this.itemXml), this.assessmentItem = g(this.xmlDocument);
4105
+ this.extractionDocument = null, this.extractionRoot = null, this.itemXml = e, this.security = r, this.mathMlPrefixes = nc(e), this.elementNameMapper = t, this.attributeNameMapper = n, Eo(this.itemXml, this.security), this.xmlDocument = b(this.itemXml), this.assessmentItem = g(this.xmlDocument);
4091
4106
  }
4092
4107
  getAssessmentItem() {
4093
4108
  return this.assessmentItem;
@@ -4122,7 +4137,7 @@ var Xs = class {
4122
4137
  return this.assessmentItem.getAttribute(this.attributeNameMapper.toNative(e));
4123
4138
  }
4124
4139
  serializeChildren(e) {
4125
- return tc($s(this.serializeChildNodes(e)), this.mathMlPrefixes);
4140
+ return rc(tc(this.serializeChildNodes(e)), this.mathMlPrefixes);
4126
4141
  }
4127
4142
  findExtractionElements(e) {
4128
4143
  let t = this.getExtractionRoot();
@@ -4136,7 +4151,7 @@ var Xs = class {
4136
4151
  element: e,
4137
4152
  contextRoot: t,
4138
4153
  responseIdentifier: a,
4139
- normalizedType: Ks(i)
4154
+ normalizedType: Js(i)
4140
4155
  });
4141
4156
  }), r;
4142
4157
  }
@@ -4171,7 +4186,7 @@ var Xs = class {
4171
4186
  walkExtractionChildren(e, t) {
4172
4187
  for (let n of e.childNodes ?? []) {
4173
4188
  let e = n;
4174
- e.rawTagName && (Zs(e.rawTagName) || (t(e), this.walkExtractionChildren(e, t)));
4189
+ e.rawTagName && ($s(e.rawTagName) || (t(e), this.walkExtractionChildren(e, t)));
4175
4190
  }
4176
4191
  }
4177
4192
  getExtractionResponseIdentifier(e) {
@@ -4179,17 +4194,17 @@ var Xs = class {
4179
4194
  return e.getAttribute?.("responseIdentifier") || e.getAttribute?.(t) || e.getAttribute?.("response-identifier") || e.getAttribute?.("responseidentifier") || "";
4180
4195
  }
4181
4196
  };
4182
- function Zs(e) {
4197
+ function $s(e) {
4183
4198
  let t = e.toLowerCase();
4184
4199
  return t === "rubricblock" || t === "qti-rubric-block";
4185
4200
  }
4186
- function Qs(e) {
4187
- return new Xs(e);
4201
+ function ec(e) {
4202
+ return new Qs(e);
4188
4203
  }
4189
- function $s(e) {
4204
+ function tc(e) {
4190
4205
  return e.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g, (e, t) => t);
4191
4206
  }
4192
- function ec(e) {
4207
+ function nc(e) {
4193
4208
  let t = /* @__PURE__ */ new Set();
4194
4209
  for (let n of e.matchAll(/\sxmlns:([A-Za-z_][\w.-]*)=(["'])http:\/\/www\.w3\.org\/1998\/Math\/MathML\2/g)) {
4195
4210
  let e = n[1];
@@ -4197,24 +4212,24 @@ function ec(e) {
4197
4212
  }
4198
4213
  return t;
4199
4214
  }
4200
- function tc(e, t) {
4215
+ function rc(e, t) {
4201
4216
  let n = e;
4202
4217
  for (let e of t) {
4203
- let t = nc(e);
4218
+ let t = ic(e);
4204
4219
  n = n.replace(RegExp(`(<\\/?)${t}:([A-Za-z][\\w.-]*)(?=[\\s>/])`, "g"), "$1$2").replace(RegExp(`\\sxmlns:${t}=(["'])http:\\/\\/www\\.w3\\.org\\/1998\\/Math\\/MathML\\1`, "g"), "");
4205
4220
  }
4206
4221
  return n;
4207
4222
  }
4208
- function nc(e) {
4223
+ function ic(e) {
4209
4224
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4210
4225
  }
4211
4226
  //#endregion
4212
4227
  //#region src/extraction/types.ts
4213
- var rc = class extends Error {
4228
+ var ac = class extends Error {
4214
4229
  constructor(e, t, n, r) {
4215
4230
  super(e), this.extractorId = t, this.elementType = n, this.cause = r, this.name = "ExtractionError";
4216
4231
  }
4217
- }, ic = class e {
4232
+ }, oc = class e {
4218
4233
  constructor(e) {
4219
4234
  this.extractorsById = /* @__PURE__ */ new Map(), this.extractorsByType = /* @__PURE__ */ new Map(), this.extractorCache = /* @__PURE__ */ new WeakMap(), this.qti2xMapper = new t(), this.elementNameMapper = e;
4220
4235
  }
@@ -4263,7 +4278,7 @@ var rc = class extends Error {
4263
4278
  let t = e.rawTagName || "unknown";
4264
4279
  return {
4265
4280
  success: !1,
4266
- error: new rc(`No extractor available for element '${t}'. Registered types: ${Array.from(this.extractorsByType.keys()).join(", ")}`, "none", t)
4281
+ error: new ac(`No extractor available for element '${t}'. Registered types: ${Array.from(this.extractorsByType.keys()).join(", ")}`, "none", t)
4267
4282
  };
4268
4283
  }
4269
4284
  try {
@@ -4272,7 +4287,7 @@ var rc = class extends Error {
4272
4287
  let t = n.validate(r);
4273
4288
  if (!t.valid) return {
4274
4289
  success: !1,
4275
- error: new rc(`Validation failed for extractor '${n.id}': ${t.errors?.join(", ")}`, n.id, e.rawTagName || "unknown")
4290
+ error: new ac(`Validation failed for extractor '${n.id}': ${t.errors?.join(", ")}`, n.id, e.rawTagName || "unknown")
4276
4291
  };
4277
4292
  if (t.warnings && t.warnings.length > 0) return {
4278
4293
  success: !0,
@@ -4288,7 +4303,7 @@ var rc = class extends Error {
4288
4303
  let r = e.rawTagName || "unknown";
4289
4304
  return {
4290
4305
  success: !1,
4291
- error: t instanceof rc ? t : new rc(`Extraction failed for '${r}': ${t instanceof Error ? t.message : String(t)}`, n.id, r, t instanceof Error ? t : void 0)
4306
+ error: t instanceof ac ? t : new ac(`Extraction failed for '${r}': ${t instanceof Error ? t.message : String(t)}`, n.id, r, t instanceof Error ? t : void 0)
4292
4307
  };
4293
4308
  }
4294
4309
  }
@@ -4312,21 +4327,21 @@ var rc = class extends Error {
4312
4327
  return t;
4313
4328
  }
4314
4329
  };
4315
- function ac(e) {
4316
- return new ic(e);
4330
+ function sc(e) {
4331
+ return new oc(e);
4317
4332
  }
4318
4333
  //#endregion
4319
4334
  //#region src/extraction/utils.ts
4320
- function oc(e) {
4335
+ function cc(e) {
4321
4336
  return e?.textContent?.trim() || "";
4322
4337
  }
4323
- function sc(e) {
4324
- return As(e?.innerHTML?.trim() || "");
4338
+ function lc(e) {
4339
+ return Ms(e?.innerHTML?.trim() || "");
4325
4340
  }
4326
- function cc(e, t, n) {
4327
- return e?.childNodes ? e.childNodes.filter((e) => pc(e.rawTagName, t, n)) : [];
4341
+ function uc(e, t, n) {
4342
+ return e?.childNodes ? e.childNodes.filter((e) => hc(e.rawTagName, t, n)) : [];
4328
4343
  }
4329
- function lc(e, t, n = !1, r) {
4344
+ function dc(e, t, n = !1, r) {
4330
4345
  let i = e.getAttribute(t);
4331
4346
  if (i == null && r) {
4332
4347
  let n = r.toNative(t);
@@ -4334,7 +4349,7 @@ function lc(e, t, n = !1, r) {
4334
4349
  }
4335
4350
  return i == null ? n : i === "true";
4336
4351
  }
4337
- function uc(e, t, n, r) {
4352
+ function fc(e, t, n, r) {
4338
4353
  let i = e.getAttribute(t);
4339
4354
  if (i == null && r) {
4340
4355
  let n = r.toNative(t);
@@ -4342,7 +4357,7 @@ function uc(e, t, n, r) {
4342
4357
  }
4343
4358
  return i ? Number(i) : n;
4344
4359
  }
4345
- function dc(e, t, n = "", r) {
4360
+ function pc(e, t, n = "", r) {
4346
4361
  let i = e.getAttribute(t);
4347
4362
  if (i == null && r) {
4348
4363
  let n = r.toNative(t);
@@ -4350,26 +4365,26 @@ function dc(e, t, n = "", r) {
4350
4365
  }
4351
4366
  return i || n;
4352
4367
  }
4353
- function fc(e) {
4368
+ function mc(e) {
4354
4369
  let t = e.getAttribute("class");
4355
4370
  return t ? t.split(/\s+/).filter(Boolean) : [];
4356
4371
  }
4357
- function pc(e, t, n) {
4372
+ function hc(e, t, n) {
4358
4373
  if (!e) return !1;
4359
4374
  let r = t.toLowerCase(), i = n.toNative(r);
4360
4375
  return e.toLowerCase() === i.toLowerCase();
4361
4376
  }
4362
- function mc(n, r, i) {
4377
+ function gc(n, r, i) {
4363
4378
  let a = r || new t(), o = i || new e();
4364
4379
  return {
4365
4380
  getChildrenByTag(e, t) {
4366
- return cc(e, t, a);
4381
+ return uc(e, t, a);
4367
4382
  },
4368
4383
  querySelectorAll(e, t) {
4369
4384
  let n = t.split(/\s+/), r = [e];
4370
4385
  for (let e of n) {
4371
4386
  let t = [];
4372
- for (let n of r) if (pc(n.rawTagName, e, a) && t.push(n), n.childNodes) for (let r of n.childNodes) typeof r != "string" && pc(r.rawTagName, e, a) && t.push(r);
4387
+ for (let n of r) if (hc(n.rawTagName, e, a) && t.push(n), n.childNodes) for (let r of n.childNodes) typeof r != "string" && hc(r.rawTagName, e, a) && t.push(r);
4373
4388
  r = t;
4374
4389
  }
4375
4390
  return r;
@@ -4380,69 +4395,69 @@ function mc(n, r, i) {
4380
4395
  },
4381
4396
  hasChildWithTag(e, t) {
4382
4397
  if (!e.childNodes) return !1;
4383
- for (let n of e.childNodes) if (typeof n != "string" && pc(n.rawTagName, t, a)) return !0;
4398
+ for (let n of e.childNodes) if (typeof n != "string" && hc(n.rawTagName, t, a)) return !0;
4384
4399
  return !1;
4385
4400
  },
4386
4401
  getHtmlContent(e) {
4387
- return As(e?.innerHTML?.trim() || "", { security: n });
4402
+ return Ms(e?.innerHTML?.trim() || "", { security: n });
4388
4403
  },
4389
4404
  getTextContent(e) {
4390
- return oc(e);
4405
+ return cc(e);
4391
4406
  },
4392
4407
  getAttribute(e, t, n = "") {
4393
- return dc(e, t, n, o);
4408
+ return pc(e, t, n, o);
4394
4409
  },
4395
4410
  getBooleanAttribute(e, t, n = !1) {
4396
- return lc(e, t, n, o);
4411
+ return dc(e, t, n, o);
4397
4412
  },
4398
4413
  getNumberAttribute(e, t, n = 0) {
4399
- return uc(e, t, n, o);
4414
+ return fc(e, t, n, o);
4400
4415
  },
4401
4416
  getPrompt(e) {
4402
- let t = cc(e, "prompt", a)[0];
4403
- return t ? sc(t) : null;
4417
+ let t = uc(e, "prompt", a)[0];
4418
+ return t ? lc(t) : null;
4404
4419
  },
4405
4420
  getClasses(e) {
4406
- return fc(e);
4421
+ return mc(e);
4407
4422
  }
4408
4423
  };
4409
4424
  }
4410
4425
  //#endregion
4411
4426
  //#region src/extraction/createContext.ts
4412
- function hc(e, t, n, r, i, a) {
4427
+ function _c(e, t, n, r, i, a) {
4413
4428
  let o = i.elementNameMapper, s = i.attributeNameMapper;
4414
4429
  return {
4415
4430
  element: e,
4416
4431
  responseId: t,
4417
4432
  dom: n,
4418
4433
  declarations: r,
4419
- utils: mc(i.security, o, s),
4434
+ utils: gc(i.security, o, s),
4420
4435
  config: i,
4421
4436
  ...a ? { shuffleRng: ko(a, t) } : {}
4422
4437
  };
4423
4438
  }
4424
4439
  //#endregion
4425
4440
  //#region src/core/trustedTypes.ts
4426
- function gc() {
4441
+ function vc() {
4427
4442
  return globalThis.trustedTypes;
4428
4443
  }
4429
- var _c = /* @__PURE__ */ new Map();
4430
- function vc(e) {
4431
- let t = _c.get(e);
4444
+ var yc = /* @__PURE__ */ new Map();
4445
+ function bc(e) {
4446
+ let t = yc.get(e);
4432
4447
  if (t) return t;
4433
- let n = gc();
4448
+ let n = vc();
4434
4449
  if (!n?.createPolicy) return null;
4435
4450
  try {
4436
4451
  let t = n.createPolicy(e, { createHTML: (e) => e });
4437
- return t?.createHTML ? (_c.set(e, t), t) : null;
4452
+ return t?.createHTML ? (yc.set(e, t), t) : null;
4438
4453
  } catch {
4439
4454
  return null;
4440
4455
  }
4441
4456
  }
4442
- function yc(e, t) {
4457
+ function xc(e, t) {
4443
4458
  if (!t) return e;
4444
4459
  if (!e) return "";
4445
- let n = vc(t);
4460
+ let n = bc(t);
4446
4461
  if (!n) return e;
4447
4462
  try {
4448
4463
  return n.createHTML(e);
@@ -4452,39 +4467,39 @@ function yc(e, t) {
4452
4467
  }
4453
4468
  //#endregion
4454
4469
  //#region src/extraction/interactionSecurity.ts
4455
- function bc(e, t) {
4470
+ function Sc(e, t) {
4456
4471
  let n = t?.urlPolicy, r = t?.allowObjectEmbeds === !0, i = t?.trustedTypesPolicyName;
4457
4472
  for (let t of e) {
4458
- if (t.type === "choiceInteraction" && Array.isArray(t.choices)) for (let e of t.choices) typeof e?.text == "string" && (e.text = yc(e.text, i));
4459
- if (t.imageData?.src && (t.imageData.src = ls(t.imageData.src, n, "img") ?? ""), t.imageData?.content && typeof t.imageData.content == "string" && (t.imageData.content = yc(t.imageData.content, i)), Array.isArray(t.positionObjectStages)) for (let e of t.positionObjectStages) e?.objectData?.src && (e.objectData.src = ls(e.objectData.src, n, "img") ?? ""), e?.objectData?.content && typeof e.objectData.content == "string" && (e.objectData.content = yc(e.objectData.content, i));
4473
+ if (t.type === "choiceInteraction" && Array.isArray(t.choices)) for (let e of t.choices) typeof e?.text == "string" && (e.text = xc(e.text, i));
4474
+ if (t.imageData?.src && (t.imageData.src = ls(t.imageData.src, n, "img") ?? ""), t.imageData?.content && typeof t.imageData.content == "string" && (t.imageData.content = xc(t.imageData.content, i)), Array.isArray(t.positionObjectStages)) for (let e of t.positionObjectStages) e?.objectData?.src && (e.objectData.src = ls(e.objectData.src, n, "img") ?? ""), e?.objectData?.content && typeof e.objectData.content == "string" && (e.objectData.content = xc(e.objectData.content, i));
4460
4475
  if (t.type === "mediaInteraction" && t.mediaElement?.src) {
4461
4476
  let e = t.mediaElement.type === "object" ? "object" : "media";
4462
4477
  t.mediaElement.src = ls(t.mediaElement.src, n, e) ?? "", t.allowObjectEmbeds = r;
4463
4478
  }
4464
- t.type === "hottextInteraction" && typeof t.contentHtml == "string" && (t.contentHtml = yc(t.contentHtml, i));
4479
+ t.type === "hottextInteraction" && typeof t.contentHtml == "string" && (t.contentHtml = xc(t.contentHtml, i));
4465
4480
  }
4466
4481
  return e;
4467
4482
  }
4468
4483
  //#endregion
4469
4484
  //#region src/extraction/interactionExtractionPipeline.ts
4470
- function xc({ document: e, extractionRegistry: t, declarations: n, config: r, sessionGuid: i }) {
4471
- let a = Cc(n), o = e.findExtractionElements(Sc(t)), s = [];
4485
+ function Cc({ document: e, extractionRegistry: t, declarations: n, config: r, sessionGuid: i }) {
4486
+ let a = Tc(n), o = e.findExtractionElements(wc(t)), s = [];
4472
4487
  for (let e of o) {
4473
- let n = hc(e.element, e.responseIdentifier, e.contextRoot, a, r, i), o = t.extract(e.element, n);
4488
+ let n = _c(e.element, e.responseIdentifier, e.contextRoot, a, r, i), o = t.extract(e.element, n);
4474
4489
  o.success && s.push({
4475
4490
  type: o.data?.type ?? e.normalizedType,
4476
4491
  responseId: e.responseIdentifier,
4477
4492
  ...o.data
4478
4493
  });
4479
4494
  }
4480
- return bc(s, r.security);
4495
+ return Sc(s, r.security);
4481
4496
  }
4482
- function Sc(e) {
4497
+ function wc(e) {
4483
4498
  let t = /* @__PURE__ */ new Set();
4484
4499
  for (let n of e.getExtractors()) for (let e of n.elementTypes) t.add(e);
4485
4500
  return [...t];
4486
4501
  }
4487
- function Cc(e) {
4502
+ function Tc(e) {
4488
4503
  let t = /* @__PURE__ */ new Map();
4489
4504
  for (let n of Object.values(e)) t.set(n.identifier, {
4490
4505
  identifier: n.identifier,
@@ -4495,7 +4510,7 @@ function Cc(e) {
4495
4510
  }
4496
4511
  //#endregion
4497
4512
  //#region src/core/ComponentRegistry.ts
4498
- var wc = {
4513
+ var Ec = {
4499
4514
  choiceInteraction: {
4500
4515
  name: "default-choice",
4501
4516
  tagName: "pie-qti-choice"
@@ -4580,7 +4595,7 @@ var wc = {
4580
4595
  name: "default-catalog-popup",
4581
4596
  tagName: "pie-qti-catalog-popup"
4582
4597
  }
4583
- }, Tc = class {
4598
+ }, Dc = class {
4584
4599
  constructor() {
4585
4600
  this.components = /* @__PURE__ */ new Map(), this.definedElements = /* @__PURE__ */ new Set();
4586
4601
  }
@@ -4622,12 +4637,12 @@ var wc = {
4622
4637
  return !t || t.length === 0 ? null : t[0].config.tagName;
4623
4638
  }
4624
4639
  };
4625
- function Ec() {
4626
- let e = new Tc();
4627
- return Dc(e), e;
4640
+ function Oc() {
4641
+ let e = new Dc();
4642
+ return kc(e), e;
4628
4643
  }
4629
- function Dc(e) {
4630
- for (let [t, n] of Object.entries(wc)) e.register(t, {
4644
+ function kc(e) {
4645
+ for (let [t, n] of Object.entries(Ec)) e.register(t, {
4631
4646
  ...n,
4632
4647
  description: `Default web component tag for ${t}`,
4633
4648
  priority: -100
@@ -4635,30 +4650,30 @@ function Dc(e) {
4635
4650
  }
4636
4651
  //#endregion
4637
4652
  //#region src/pnp/applyPnp.ts
4638
- var Oc = "data-qti-colorscheme", kc = "data-qti-magnification";
4639
- function Ac(e, t) {
4653
+ var Ac = "data-qti-colorscheme", jc = "data-qti-magnification";
4654
+ function Mc(e, t) {
4640
4655
  let n = t?.display?.colorScheme;
4641
- !n || n === "default" ? e.removeAttribute(Oc) : e.setAttribute(Oc, n);
4656
+ !n || n === "default" ? e.removeAttribute(Ac) : e.setAttribute(Ac, n);
4642
4657
  let r = t?.display?.magnification;
4643
- r !== void 0 && Number.isFinite(r) && r > 0 ? (e.setAttribute(kc, String(r)), e.style?.setProperty?.("--qti-magnification", String(r))) : (e.removeAttribute(kc), e.style?.removeProperty?.("--qti-magnification"));
4658
+ r !== void 0 && Number.isFinite(r) && r > 0 ? (e.setAttribute(jc, String(r)), e.style?.setProperty?.("--qti-magnification", String(r))) : (e.removeAttribute(jc), e.style?.removeProperty?.("--qti-magnification"));
4644
4659
  }
4645
4660
  //#endregion
4646
4661
  //#region src/catalog/catalogExtractor.ts
4647
- function jc(e) {
4662
+ function Nc(e) {
4648
4663
  if (!e.trim()) return /* @__PURE__ */ new Map();
4649
4664
  let t = ie(`<root>${e}</root>`, { lowerCaseTagName: !0 }).querySelector("qti-catalog-info");
4650
- return t ? Pc(t) : /* @__PURE__ */ new Map();
4665
+ return t ? Ic(t) : /* @__PURE__ */ new Map();
4651
4666
  }
4652
- function Mc(e) {
4667
+ function Pc(e) {
4653
4668
  let t = ie(e, { lowerCaseTagName: !0 }).querySelector("qti-catalog-info");
4654
- return t ? Pc(t) : /* @__PURE__ */ new Map();
4669
+ return t ? Ic(t) : /* @__PURE__ */ new Map();
4655
4670
  }
4656
- function Nc(e, t) {
4671
+ function Fc(e, t) {
4657
4672
  let n = new Map(e);
4658
4673
  for (let [e, r] of t) n.set(e, r);
4659
4674
  return n;
4660
4675
  }
4661
- function Pc(e) {
4676
+ function Ic(e) {
4662
4677
  let t = /* @__PURE__ */ new Map();
4663
4678
  for (let n of e.querySelectorAll("qti-catalog")) {
4664
4679
  let e = n.getAttribute("id") ?? n.getAttribute("identifier");
@@ -4666,14 +4681,14 @@ function Pc(e) {
4666
4681
  let r = [];
4667
4682
  for (let e of n.querySelectorAll("qti-card")) {
4668
4683
  let t = e.getAttribute("support") ?? e.getAttribute("usage");
4669
- for (let n of Fc(e, t ?? void 0)) r.push(n);
4684
+ for (let n of Lc(e, t ?? void 0)) r.push(n);
4670
4685
  }
4671
4686
  r.length > 0 && t.set(e, { entries: r });
4672
4687
  }
4673
4688
  for (let n of e.querySelectorAll("qti-card")) {
4674
4689
  let e = n.getAttribute("identifier");
4675
4690
  if (!e) continue;
4676
- let r = Fc(n);
4691
+ let r = Lc(n);
4677
4692
  if (r.length > 0) {
4678
4693
  let n = t.get(e);
4679
4694
  n ? n.entries.push(...r) : t.set(e, { entries: r });
@@ -4681,35 +4696,35 @@ function Pc(e) {
4681
4696
  }
4682
4697
  return t;
4683
4698
  }
4684
- function Fc(e, t) {
4699
+ function Lc(e, t) {
4685
4700
  let n = e.querySelectorAll("qti-card-entry"), r = [];
4686
4701
  if (n.length > 0) {
4687
4702
  for (let e of n) {
4688
4703
  let n = e.getAttribute("usage") ?? e.getAttribute("data-reading-type") ?? t;
4689
4704
  n && r.push({
4690
4705
  usage: n,
4691
- lang: Ic(e),
4692
- html: Lc(e)
4706
+ lang: Rc(e),
4707
+ html: zc(e)
4693
4708
  });
4694
4709
  }
4695
4710
  return r;
4696
4711
  }
4697
4712
  return t && r.push({
4698
4713
  usage: t,
4699
- lang: Ic(e),
4700
- html: Lc(e)
4714
+ lang: Rc(e),
4715
+ html: zc(e)
4701
4716
  }), r;
4702
4717
  }
4703
- function Ic(e) {
4718
+ function Rc(e) {
4704
4719
  return e.getAttribute("xml:lang") ?? e.getAttribute("xmllang") ?? e.getAttribute("lang") ?? void 0;
4705
4720
  }
4706
- function Lc(e) {
4721
+ function zc(e) {
4707
4722
  let t = e.querySelector("qti-html-content"), n = e.querySelector("qti-file-href");
4708
4723
  return t ? t.innerHTML ?? t.text ?? "" : n ? n.getAttribute("src") ?? n.text?.trim() ?? "" : "";
4709
4724
  }
4710
4725
  //#endregion
4711
4726
  //#region src/catalog/catalogLookup.ts
4712
- function Rc(e, t, n, r) {
4727
+ function Bc(e, t, n, r) {
4713
4728
  let i = e.get(t);
4714
4729
  if (!i) return null;
4715
4730
  let a = i.entries.filter((e) => e.usage === n);
@@ -4725,11 +4740,11 @@ function Rc(e, t, n, r) {
4725
4740
  }
4726
4741
  //#endregion
4727
4742
  //#region src/pci/types.ts
4728
- var zc = class extends Error {
4743
+ var Vc = class extends Error {
4729
4744
  constructor(e, t) {
4730
4745
  super(`PCI module loading is disabled for response '${e}'. Provide a host-controlled moduleResolver before loading '${t}'.`), this.responseIdentifier = e, this.authoredPath = t, this.name = "PciModuleResolverRequiredError";
4731
4746
  }
4732
- }, Bc = class extends Error {
4747
+ }, Hc = class extends Error {
4733
4748
  constructor(e, t, n) {
4734
4749
  super(t ? `PCI module failed to load from '${e}' and fallback '${t}'` : `PCI module failed to load from '${e}'`), this.primaryPath = e, this.fallbackPath = t, this.name = "PciLoadError", n && Object.defineProperty(this, "cause", {
4735
4750
  value: n,
@@ -4737,7 +4752,7 @@ var zc = class extends Error {
4737
4752
  configurable: !0
4738
4753
  });
4739
4754
  }
4740
- }, Vc = class {
4755
+ }, Uc = class {
4741
4756
  constructor(e, t = {}) {
4742
4757
  this.module = null, this.destroyed = !1, this.loadGeneration = 0, this._response = null, this._hasResponse = !1, this._responseChangeListeners = /* @__PURE__ */ new Set(), this.data = e, this.baseUrl = typeof t == "string" ? t : t.baseUrl ?? "", this.moduleResolver = typeof t == "string" ? void 0 : t.moduleResolver;
4743
4758
  }
@@ -4746,7 +4761,7 @@ var zc = class extends Error {
4746
4761
  }
4747
4762
  async load() {
4748
4763
  if (this.destroyed) throw Error("Cannot load a destroyed PciHost");
4749
- if (!this.moduleResolver) throw new zc(this.data.responseIdentifier, this.data.primaryPath);
4764
+ if (!this.moduleResolver) throw new Vc(this.data.responseIdentifier, this.data.primaryPath);
4750
4765
  let e = ++this.loadGeneration, t = this.resolveUrl(this.data.primaryPath);
4751
4766
  try {
4752
4767
  let n = await this.resolveModule(t, this.data.primaryPath, "primary");
@@ -4754,14 +4769,14 @@ var zc = class extends Error {
4754
4769
  return;
4755
4770
  } catch (t) {
4756
4771
  if (!this.isCurrentLoad(e)) throw t;
4757
- if (!this.data.fallbackPath) throw new Bc(this.data.primaryPath, void 0, t);
4772
+ if (!this.data.fallbackPath) throw new Hc(this.data.primaryPath, void 0, t);
4758
4773
  }
4759
4774
  let n = this.resolveUrl(this.data.fallbackPath);
4760
4775
  try {
4761
4776
  let t = await this.resolveModule(n, this.data.fallbackPath, "fallback");
4762
4777
  this.adoptResolvedModule(t, this.data.fallbackPath, e);
4763
4778
  } catch (t) {
4764
- throw this.isCurrentLoad(e) ? new Bc(this.data.primaryPath, this.data.fallbackPath, t) : t;
4779
+ throw this.isCurrentLoad(e) ? new Hc(this.data.primaryPath, this.data.fallbackPath, t) : t;
4765
4780
  }
4766
4781
  }
4767
4782
  initialize(e) {
@@ -4832,15 +4847,15 @@ var zc = class extends Error {
4832
4847
  if (r.length > 0) throw Error(`PCI module at '${t}' does not export a valid PciModule interface; missing: ${r.join(", ")}`);
4833
4848
  return n;
4834
4849
  }
4835
- }, Hc = class {
4850
+ }, Wc = class {
4836
4851
  constructor(i) {
4837
- this.responseProcessingProgram = null, this.templateProcessingProgram = null, this.outcomeProcessingProgram = null, this._catalogIndex = /* @__PURE__ */ new Map(), this._stimulusCatalogIndexes = /* @__PURE__ */ new Map(), this._pciHosts = /* @__PURE__ */ new Map(), this._pnpChangeListeners = /* @__PURE__ */ new Set(), this.lifecycleStatus = "initial", this.accumulatedDurationMs = 0, this.config = i, this.itemXml = i.itemXml ?? "", this.role = i.role ?? "candidate", this.sessionGuid = Wc(), this.sessionStartedAt = Date.now(), this.rng = i.rng ?? (typeof i.seed == "number" ? Do(i.seed) : Math.random), i.elementNameMapper ? (this.mapper = i.elementNameMapper, i.attributeNameMapper || (i.attributeNameMapper = this.mapper.version === "3.0" ? new n() : new e())) : o(this.itemXml) === "3.0" ? (this.mapper = new r(), i.elementNameMapper = this.mapper, i.attributeNameMapper || (i.attributeNameMapper = new n())) : (this.mapper = new t(), i.elementNameMapper = this.mapper, i.attributeNameMapper || (i.attributeNameMapper = new e())), this.itemDocument = Qs({
4852
+ this.responseProcessingProgram = null, this.templateProcessingProgram = null, this.outcomeProcessingProgram = null, this._catalogIndex = /* @__PURE__ */ new Map(), this._stimulusCatalogIndexes = /* @__PURE__ */ new Map(), this._pciHosts = /* @__PURE__ */ new Map(), this._pnpChangeListeners = /* @__PURE__ */ new Set(), this.lifecycleStatus = "initial", this.accumulatedDurationMs = 0, this.config = i, this.itemXml = i.itemXml ?? "", this.role = i.role ?? "candidate", this.sessionGuid = Kc(), this.sessionStartedAt = Date.now(), this.rng = i.rng ?? (typeof i.seed == "number" ? Do(i.seed) : Math.random), i.elementNameMapper ? (this.mapper = i.elementNameMapper, i.attributeNameMapper || (i.attributeNameMapper = this.mapper.version === "3.0" ? new n() : new e())) : o(this.itemXml) === "3.0" ? (this.mapper = new r(), i.elementNameMapper = this.mapper, i.attributeNameMapper || (i.attributeNameMapper = new n())) : (this.mapper = new t(), i.elementNameMapper = this.mapper, i.attributeNameMapper || (i.attributeNameMapper = new e())), this.itemDocument = ec({
4838
4853
  itemXml: this.itemXml,
4839
4854
  elementNameMapper: this.mapper,
4840
4855
  attributeNameMapper: i.attributeNameMapper,
4841
4856
  security: this.config.security
4842
- }), this.assessmentItem = this.itemDocument.getAssessmentItem(), this.decls = this.buildDeclarations(), this.ensureBuiltinDeclarations(this.decls), this.ctx = new s(this.decls), this.ops = new c(), i.sessionState && this.applySessionState(i.sessionState), this.extractionRegistry = i.extractionRegistry ?? ac(this.mapper), this.componentRegistry = i.componentRegistry ?? Ec(), this.i18nProvider = i.i18nProvider ?? this.createDefaultI18nProvider();
4843
- for (let e of Ws()) try {
4857
+ }), this.assessmentItem = this.itemDocument.getAssessmentItem(), this.decls = this.buildDeclarations(), this.ensureBuiltinDeclarations(this.decls), this.ctx = new s(this.decls), this.ops = new c(), i.sessionState && this.applySessionState(i.sessionState), this.extractionRegistry = i.extractionRegistry ?? sc(this.mapper), this.componentRegistry = i.componentRegistry ?? Oc(), this.i18nProvider = i.i18nProvider ?? this.createDefaultI18nProvider();
4858
+ for (let e of Ks()) try {
4844
4859
  this.extractionRegistry.register(e);
4845
4860
  } catch {}
4846
4861
  for (let e of i.plugins ?? []) try {
@@ -4861,19 +4876,19 @@ var zc = class extends Error {
4861
4876
  h === "unknown" ? console.warn("[QTI Player] Could not detect QTI version. Assuming QTI 2.2 compatibility.") : h === "2.0" ? console.warn("[QTI Player] QTI 2.0 detected. Some features may not be fully supported. QTI 2.2 is recommended.") : h === "2.1" && console.info("[QTI Player] QTI 2.1 detected. Using QTI 2.2 compatibility mode with CC2 template support."), this._pnp = i.pnp;
4862
4877
  let g = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
4863
4878
  for (let e of i.deliveryContext?.catalogSources ?? []) {
4864
- let t = jc(e.xml);
4879
+ let t = Nc(e.xml);
4865
4880
  if (e.scope === "stimulus" && e.stimulusIdentifier) {
4866
4881
  let n = this._stimulusCatalogIndexes.get(e.stimulusIdentifier) ?? /* @__PURE__ */ new Map();
4867
- this._stimulusCatalogIndexes.set(e.stimulusIdentifier, Nc(n, t));
4868
- } else _ = Nc(_, t);
4882
+ this._stimulusCatalogIndexes.set(e.stimulusIdentifier, Fc(n, t));
4883
+ } else _ = Fc(_, t);
4869
4884
  }
4870
- i.catalogXml && (g = Nc(g, Mc(i.catalogXml))), g = Nc(g, Mc(this.itemXml)), this._catalogIndex = Nc(g, _), this.config.strictQtiCompliance?.enabled && this.validateStrictCompliance();
4885
+ i.catalogXml && (g = Fc(g, Pc(i.catalogXml))), g = Fc(g, Pc(this.itemXml)), this._catalogIndex = Fc(g, _), this.config.strictQtiCompliance?.enabled && this.validateStrictCompliance();
4871
4886
  }
4872
4887
  applyPnp(e) {
4873
- this._rootEl = e, Ac(e, this._pnp);
4888
+ this._rootEl = e, Mc(e, this._pnp);
4874
4889
  }
4875
4890
  updatePnp(e) {
4876
- this._pnp = Uc(this._pnp, e), this._rootEl && Ac(this._rootEl, this._pnp);
4891
+ this._pnp = Gc(this._pnp, e), this._rootEl && Mc(this._rootEl, this._pnp);
4877
4892
  for (let e of this._pnpChangeListeners) e(this._pnp);
4878
4893
  }
4879
4894
  getPnp() {
@@ -4886,14 +4901,14 @@ var zc = class extends Error {
4886
4901
  return this.config.deliveryContext;
4887
4902
  }
4888
4903
  getCatalogEntry(e, t, n, r) {
4889
- let i = (r?.stimulusIdentifier ? Rc(this._stimulusCatalogIndexes.get(r.stimulusIdentifier) ?? /* @__PURE__ */ new Map(), e, t, n) : null) ?? Rc(this._catalogIndex, e, t, n);
4890
- return i === null ? null : Gc(i) ? ls(i.trim(), this.config.security?.urlPolicy, "img") : this.sanitizeHtmlContent(i);
4904
+ let i = (r?.stimulusIdentifier ? Bc(this._stimulusCatalogIndexes.get(r.stimulusIdentifier) ?? /* @__PURE__ */ new Map(), e, t, n) : null) ?? Bc(this._catalogIndex, e, t, n);
4905
+ return i === null ? null : qc(i) ? ls(i.trim(), this.config.security?.urlPolicy, "img") : this.sanitizeHtmlContent(i);
4891
4906
  }
4892
4907
  sanitizeHtmlContent(e) {
4893
- return ks(e, { security: this.config.security });
4908
+ return js(e, { security: this.config.security });
4894
4909
  }
4895
4910
  createPciHost(e) {
4896
- let t = new Vc(e, {
4911
+ let t = new Uc(e, {
4897
4912
  baseUrl: this.config.pci?.baseUrl ?? this.config.pciBaseUrl,
4898
4913
  moduleResolver: this.config.pci?.moduleResolver
4899
4914
  });
@@ -5100,7 +5115,7 @@ var zc = class extends Error {
5100
5115
  if (e.scope && e.scope !== "all" && n !== e.scope) continue;
5101
5116
  let a = (y(i, "view") || "").trim(), o = a ? a.split(/[\s,]+/).filter(Boolean) : [], s = (y(i, "use") || "").trim() || void 0;
5102
5117
  if (o.length > 0 && t && !o.includes(t)) continue;
5103
- let c = this.itemDocument.serializeChildren(i) || i.textContent || "", l = yc(ks(this.renderPrintedVariables(c), { security: this.config.security }), this.config.security?.trustedTypesPolicyName);
5118
+ let c = this.itemDocument.serializeChildren(i) || i.textContent || "", l = xc(js(this.renderPrintedVariables(c), { security: this.config.security }), this.config.security?.trustedTypesPolicyName);
5104
5119
  r.push({
5105
5120
  view: o,
5106
5121
  html: l,
@@ -5117,7 +5132,7 @@ var zc = class extends Error {
5117
5132
  return this.extractionRegistry;
5118
5133
  }
5119
5134
  getInteractionData() {
5120
- return xc({
5135
+ return Cc({
5121
5136
  document: this.itemDocument,
5122
5137
  extractionRegistry: this.extractionRegistry,
5123
5138
  declarations: this.decls,
@@ -5742,12 +5757,12 @@ var zc = class extends Error {
5742
5757
  return r = r.replace(/<printedVariable\b([^>]*)\/>/gi, (e, r) => n(t(String(r)))), r;
5743
5758
  }
5744
5759
  renderHtmlContent(e) {
5745
- return yc(ks(this.renderPrintedVariables(e), { security: this.config.security }), this.config.security?.trustedTypesPolicyName);
5760
+ return xc(js(this.renderPrintedVariables(e), { security: this.config.security }), this.config.security?.trustedTypesPolicyName);
5746
5761
  }
5747
5762
  getModalFeedback(e) {
5748
5763
  let t = this.itemDocument.findModalFeedbackElements(), n = [];
5749
5764
  for (let r of t) {
5750
- let t = this.getAttrMapped(r, "identifier") || "", i = this.getAttrMapped(r, "outcomeIdentifier") || "", a = this.getAttrMapped(r, "showHide") || "show", o = this.getAttrMapped(r, "title") || void 0, s = yc(ks(this.itemDocument.serializeChildren(r) || r.textContent || "", { security: this.config.security }), this.config.security?.trustedTypesPolicyName), c = e[i];
5765
+ let t = this.getAttrMapped(r, "identifier") || "", i = this.getAttrMapped(r, "outcomeIdentifier") || "", a = this.getAttrMapped(r, "showHide") || "show", o = this.getAttrMapped(r, "title") || void 0, s = xc(js(this.itemDocument.serializeChildren(r) || r.textContent || "", { security: this.config.security }), this.config.security?.trustedTypesPolicyName), c = e[i];
5751
5766
  (a === "show" ? c === t : c !== t) && s && n.push({
5752
5767
  identifier: t,
5753
5768
  outcomeIdentifier: i,
@@ -5759,7 +5774,7 @@ var zc = class extends Error {
5759
5774
  return n;
5760
5775
  }
5761
5776
  };
5762
- function Uc(e, t) {
5777
+ function Gc(e, t) {
5763
5778
  return {
5764
5779
  display: {
5765
5780
  ...e?.display ?? {},
@@ -5775,7 +5790,7 @@ function Uc(e, t) {
5775
5790
  }
5776
5791
  };
5777
5792
  }
5778
- function Wc() {
5793
+ function Kc() {
5779
5794
  let e = typeof crypto < "u" ? crypto : void 0;
5780
5795
  if (typeof e?.randomUUID == "function") return e.randomUUID();
5781
5796
  if (typeof e?.getRandomValues == "function") {
@@ -5784,13 +5799,13 @@ function Wc() {
5784
5799
  }
5785
5800
  throw Error("No Web Crypto API available: cannot generate a session GUID. @pie-qti/item-player requires crypto.randomUUID or crypto.getRandomValues (present in all supported browsers and in Node >= 20).");
5786
5801
  }
5787
- function Gc(e) {
5802
+ function qc(e) {
5788
5803
  let t = e.trim();
5789
5804
  return /^(https?:\/\/|\/\/|\/|\.{0,2}\/|data:|blob:)/i.test(t) || /\.(png|jpe?g|gif|webp|svg|mp3|wav|ogg|mp4|webm|pdf)(\?.*)?$/i.test(t);
5790
5805
  }
5791
5806
  //#endregion
5792
5807
  //#region src/components/actions/typesetAction.ts
5793
- function Kc(e, t) {
5808
+ function Jc(e, t) {
5794
5809
  if (!(typeof window < "u" && typeof MutationObserver < "u")) return {
5795
5810
  update() {},
5796
5811
  destroy() {}
@@ -5821,7 +5836,7 @@ function Kc(e, t) {
5821
5836
  }
5822
5837
  //#endregion
5823
5838
  //#region src/catalog/applyGlossaryTriggers.ts
5824
- var qc = [
5839
+ var Yc = [
5825
5840
  {
5826
5841
  usage: "tts-pronunciation",
5827
5842
  flag: "ttsPronunciation",
@@ -5852,90 +5867,90 @@ var qc = [
5852
5867
  label: "Request extended description",
5853
5868
  text: "D"
5854
5869
  }
5855
- ], Jc = "illustrated-glossary", Yc = new Set([
5870
+ ], Xc = "illustrated-glossary", Zc = new Set([
5856
5871
  "glossary-on-screen",
5857
5872
  "keyword-translation",
5858
- Jc
5859
- ]), Xc = new Set(qc.map((e) => e.flag)), Zc = new Set(qc.map((e) => e.usage)), Qc = /^[a-z][a-z0-9._-]*$/;
5860
- function $c(e, t) {
5861
- el(e);
5873
+ Xc
5874
+ ]), Qc = new Set(Yc.map((e) => e.flag)), $c = new Set(Yc.map((e) => e.usage)), el = /^[a-z][a-z0-9._-]*$/;
5875
+ function tl(e, t) {
5876
+ nl(e);
5862
5877
  let n = t.getPnp();
5863
- if (!n) return () => el(e);
5864
- let r = n.content?.glossaryOnScreen === !0, i = n.content?.keywordTranslation, a = i?.active === !0 && !!i.languageCode, o = n.content?.illustratedGlossary === !0, s = n.content?.catalogSupports ?? {}, c = il(s), l = qc.some((e) => ol(al(s, e)));
5865
- if (!r && !a && !o && !l && c.length === 0) return () => el(e);
5878
+ if (!n) return () => nl(e);
5879
+ let r = n.content?.glossaryOnScreen === !0, i = n.content?.keywordTranslation, a = i?.active === !0 && !!i.languageCode, o = n.content?.illustratedGlossary === !0, s = n.content?.catalogSupports ?? {}, c = ol(s), l = Yc.some((e) => cl(sl(s, e)));
5880
+ if (!r && !a && !o && !l && c.length === 0) return () => nl(e);
5866
5881
  let u = e.querySelectorAll("[data-catalog-idref]");
5867
- if (u.length === 0) return () => el(e);
5882
+ if (u.length === 0) return () => nl(e);
5868
5883
  let d = null;
5869
5884
  for (let e of Array.from(u)) {
5870
5885
  let n = e.getAttribute("data-catalog-idref");
5871
5886
  if (!n) continue;
5872
- let l = rl(e), u = document.createElement("span");
5887
+ let l = al(e), u = document.createElement("span");
5873
5888
  if (u.className = "qti-catalog-term", u.style.cssText = "position:relative;display:inline", e.parentNode?.insertBefore(u, e), u.appendChild(e), r) {
5874
- let r = tl(e.textContent ?? n, "glossary-on-screen", "Show definition");
5889
+ let r = rl(e.textContent ?? n, "glossary-on-screen", "Show definition");
5875
5890
  u.appendChild(r), r.addEventListener("click", () => {
5876
5891
  if (d) {
5877
5892
  d(), d = null;
5878
5893
  return;
5879
5894
  }
5880
5895
  let i = t.getCatalogEntry(n, "glossary-on-screen", void 0, { stimulusIdentifier: l });
5881
- i !== null && (d = ul(u, e.textContent ?? n, i, r, t, () => {
5896
+ i !== null && (d = fl(u, e.textContent ?? n, i, r, t, () => {
5882
5897
  d = null;
5883
5898
  }));
5884
5899
  });
5885
5900
  }
5886
5901
  if (a) {
5887
- let r = i.languageCode, a = tl(e.textContent ?? n, "keyword-translation", "Show translation");
5902
+ let r = i.languageCode, a = rl(e.textContent ?? n, "keyword-translation", "Show translation");
5888
5903
  u.appendChild(a), a.addEventListener("click", () => {
5889
5904
  if (d) {
5890
5905
  d(), d = null;
5891
5906
  return;
5892
5907
  }
5893
5908
  let i = t.getCatalogEntry(n, "keyword-translation", r, { stimulusIdentifier: l });
5894
- i !== null && (d = ul(u, e.textContent ?? n, i, a, t, () => {
5909
+ i !== null && (d = fl(u, e.textContent ?? n, i, a, t, () => {
5895
5910
  d = null;
5896
5911
  }));
5897
5912
  });
5898
5913
  }
5899
5914
  if (o) {
5900
- let r = tl(e.textContent ?? n, Jc, "Show illustrated glossary");
5915
+ let r = rl(e.textContent ?? n, Xc, "Show illustrated glossary");
5901
5916
  u.appendChild(r), r.addEventListener("click", () => {
5902
5917
  if (d) {
5903
5918
  d(), d = null;
5904
5919
  return;
5905
5920
  }
5906
- let i = t.getCatalogEntry(n, Jc, void 0, { stimulusIdentifier: l });
5907
- i !== null && (d = ul(u, e.textContent ?? n, i, r, t, () => {
5921
+ let i = t.getCatalogEntry(n, Xc, void 0, { stimulusIdentifier: l });
5922
+ i !== null && (d = fl(u, e.textContent ?? n, i, r, t, () => {
5908
5923
  d = null;
5909
5924
  }));
5910
5925
  });
5911
5926
  }
5912
- for (let r of qc) {
5913
- let i = al(s, r);
5914
- ol(i) && nl(u, e, n, {
5927
+ for (let r of Yc) {
5928
+ let i = sl(s, r);
5929
+ cl(i) && il(u, e, n, {
5915
5930
  ...r,
5916
- languageCode: sl(i)
5931
+ languageCode: ll(i)
5917
5932
  }, t, l);
5918
5933
  }
5919
- for (let r of c) nl(u, e, n, r, t, l);
5934
+ for (let r of c) il(u, e, n, r, t, l);
5920
5935
  }
5921
5936
  return () => {
5922
- d?.(), el(e);
5937
+ d?.(), nl(e);
5923
5938
  };
5924
5939
  }
5925
- function el(e) {
5940
+ function nl(e) {
5926
5941
  for (let t of Array.from(e.querySelectorAll(".qti-catalog-term"))) {
5927
5942
  let e = Array.from(t.children).find((e) => e.getAttribute?.("data-catalog-idref") !== null);
5928
5943
  e && t.parentNode && t.parentNode.insertBefore(e, t), t.remove();
5929
5944
  }
5930
5945
  }
5931
- function tl(e, t, n, r) {
5946
+ function rl(e, t, n, r) {
5932
5947
  let i = document.createElement("button");
5933
- return i.type = "button", i.className = "qti-catalog-trigger", i.style.cssText = "display:inline-flex;align-items:center;justify-content:center;min-width:1.75rem;min-height:1.75rem;margin-inline:0.25rem;line-height:1;", i.setAttribute("aria-label", `${n}: ${e}`), i.setAttribute("data-catalog-usage", t), i.textContent = r ?? (t === "keyword-translation" ? "T" : t === Jc ? "I" : "?"), i;
5948
+ return i.type = "button", i.className = "qti-catalog-trigger", i.style.cssText = "display:inline-flex;align-items:center;justify-content:center;min-width:1.75rem;min-height:1.75rem;margin-inline:0.25rem;line-height:1;", i.setAttribute("aria-label", `${n}: ${e}`), i.setAttribute("data-catalog-usage", t), i.textContent = r ?? (t === "keyword-translation" ? "T" : t === Xc ? "I" : "?"), i;
5934
5949
  }
5935
- function nl(e, t, n, r, i, a) {
5950
+ function il(e, t, n, r, i, a) {
5936
5951
  let o = i.getCatalogEntry(n, r.usage, r.languageCode, { stimulusIdentifier: a });
5937
5952
  if (o === null) return;
5938
- let s = tl(t.textContent ?? n, r.usage, r.label, r.text);
5953
+ let s = rl(t.textContent ?? n, r.usage, r.label, r.text);
5939
5954
  e.appendChild(s), s.addEventListener("click", () => {
5940
5955
  s.dispatchEvent(new CustomEvent("qti-catalog-lookup", {
5941
5956
  bubbles: !0,
@@ -5950,39 +5965,39 @@ function nl(e, t, n, r, i, a) {
5950
5965
  }));
5951
5966
  });
5952
5967
  }
5953
- function rl(e) {
5968
+ function al(e) {
5954
5969
  return (e.closest?.("[data-stimulus-idref]"))?.getAttribute?.("data-stimulus-idref")?.trim() || void 0;
5955
5970
  }
5956
- function il(e) {
5971
+ function ol(e) {
5957
5972
  return Object.entries(e).map(([e, t]) => ({
5958
- usage: cl(e),
5973
+ usage: ul(e),
5959
5974
  preference: t
5960
- })).filter(({ usage: e, preference: t }) => e !== null && ol(t) && !ll(e)).map(({ usage: e, preference: t }) => ({
5975
+ })).filter(({ usage: e, preference: t }) => e !== null && cl(t) && !dl(e)).map(({ usage: e, preference: t }) => ({
5961
5976
  usage: e,
5962
5977
  label: `Request ${e.replace(/[-_]+/g, " ")}`,
5963
5978
  text: e.slice(0, 1).toUpperCase(),
5964
- languageCode: sl(t)
5979
+ languageCode: ll(t)
5965
5980
  }));
5966
5981
  }
5967
- function al(e, t) {
5982
+ function sl(e, t) {
5968
5983
  return e[t.flag] ?? e[t.usage];
5969
5984
  }
5970
- function ol(e) {
5985
+ function cl(e) {
5971
5986
  return e === void 0 ? !1 : typeof e == "boolean" ? e : e.active !== !1;
5972
5987
  }
5973
- function sl(e) {
5988
+ function ll(e) {
5974
5989
  if (!e || typeof e == "boolean") return;
5975
5990
  let t = e.languageCode?.trim();
5976
5991
  if (!(!t || !/^[a-zA-Z]{2,8}(?:-[a-zA-Z0-9]{1,8})*$/.test(t))) return t;
5977
5992
  }
5978
- function cl(e) {
5993
+ function ul(e) {
5979
5994
  let t = e.trim().toLowerCase();
5980
- return Qc.test(t) ? t : null;
5995
+ return el.test(t) ? t : null;
5981
5996
  }
5982
- function ll(e) {
5983
- return Xc.has(e) || Zc.has(e) || Yc.has(e);
5997
+ function dl(e) {
5998
+ return Qc.has(e) || $c.has(e) || Zc.has(e);
5984
5999
  }
5985
- function ul(e, t, n, r, i, a) {
6000
+ function fl(e, t, n, r, i, a) {
5986
6001
  let o = i.getComponentRegistry(), s, c = !1;
5987
6002
  function l() {
5988
6003
  c || (c = !0, s.remove(), r.focus(), a());
@@ -5991,10 +6006,10 @@ function ul(e, t, n, r, i, a) {
5991
6006
  if (u !== null) {
5992
6007
  let r = document.createElement(u);
5993
6008
  r.content = n, r.label = t, r.onClose = l, e.appendChild(r), s = r;
5994
- } else s = dl(t, n, l), e.appendChild(s);
6009
+ } else s = pl(t, n, l), e.appendChild(s);
5995
6010
  return l;
5996
6011
  }
5997
- function dl(e, t, n) {
6012
+ function pl(e, t, n) {
5998
6013
  let r = document.createElement("div");
5999
6014
  r.className = "card card-bordered bg-base-100 shadow-lg qti-catalog-popup", r.setAttribute("role", "dialog"), r.setAttribute("aria-label", e), r.setAttribute("aria-modal", "true"), r.style.cssText = "position:absolute;z-index:1000;min-width:16rem;max-width:24rem";
6000
6015
  let i = document.createElement("div");
@@ -6028,14 +6043,14 @@ function dl(e, t, n) {
6028
6043
  }
6029
6044
  //#endregion
6030
6045
  //#region src/catalog/glossaryAction.ts
6031
- function fl(e, t) {
6032
- let n = $c(e, t.player), r = t.player.onPnpChange?.(() => {
6033
- n(), n = $c(e, t.player);
6046
+ function ml(e, t) {
6047
+ let n = tl(e, t.player), r = t.player.onPnpChange?.(() => {
6048
+ n(), n = tl(e, t.player);
6034
6049
  }) ?? (() => {});
6035
6050
  return {
6036
6051
  update(t) {
6037
- n(), r(), n = $c(e, t.player), r = t.player.onPnpChange?.(() => {
6038
- n(), n = $c(e, t.player);
6052
+ n(), r(), n = tl(e, t.player), r = t.player.onPnpChange?.(() => {
6053
+ n(), n = tl(e, t.player);
6039
6054
  }) ?? (() => {});
6040
6055
  },
6041
6056
  destroy() {
@@ -6045,23 +6060,23 @@ function fl(e, t) {
6045
6060
  }
6046
6061
  //#endregion
6047
6062
  //#region src/interactions/inline-choice/InlineChoice.svelte
6048
- var pl = /* @__PURE__ */ J("<option> </option>"), ml = /* @__PURE__ */ J("<span class=\"qti-inline-choice-correct-badge svelte-p2969z\"> </span>"), hl = /* @__PURE__ */ J("<span class=\"inline-choice-wrapper svelte-p2969z\"><select><option> </option><!></select> <!></span>"), gl = {
6063
+ var hl = /* @__PURE__ */ J("<option> </option>"), gl = /* @__PURE__ */ J("<span class=\"qti-inline-choice-correct-badge svelte-p2969z\"> </span>"), _l = /* @__PURE__ */ J("<span class=\"inline-choice-wrapper svelte-p2969z\"><select><option> </option><!></select> <!></span>"), vl = {
6049
6064
  hash: "svelte-p2969z",
6050
6065
  code: ".inline-choice-wrapper.svelte-p2969z {position:relative;display:inline-block;}.qti-inline-select.svelte-p2969z {display:inline-block;width:auto;min-width:120px;margin:0 4px;padding:0.25rem 1.75rem 0.25rem 0.5rem;border:1px solid var(--pie-qti-base-300, oklch(95% 0 0));border-radius:0.5rem;background:var(--pie-qti-base-100, oklch(100% 0 0));color:var(--pie-qti-base-content, oklch(21% 0 0));font:inherit;}.qti-inline-select.svelte-p2969z:focus-visible {outline:2px solid var(--pie-qti-focus, var(--pie-qti-primary, oklch(45% 0.24 277)));outline-offset:2px;}.qti-inline-select-correct.svelte-p2969z {border-color:var(--pie-qti-success, oklch(76% 0.177 163.223));background:color-mix(in oklch, var(--pie-qti-success, oklch(76% 0.177 163.223)) 10%, transparent);}.qti-inline-choice-correct-badge.svelte-p2969z {position:absolute;top:-1.5rem;left:0;display:inline-flex;align-items:center;white-space:nowrap;min-height:1.1rem;padding:0 0.5rem;border:1px solid var(--pie-qti-success, oklch(76% 0.177 163.223));border-radius:9999px;background:color-mix(in oklch, var(--pie-qti-success, oklch(76% 0.177 163.223)) 12%, transparent);color:var(--pie-qti-base-content, oklch(21% 0 0));font-size:0.7rem;font-weight:600;}"
6051
6066
  };
6052
- function _l(e, t) {
6053
- Ot(t, !0), Ba(e, gl);
6067
+ function yl(e, t) {
6068
+ Ot(t, !0), Ba(e, vl);
6054
6069
  let n = Z(t, "response", 3, ""), r = Z(t, "correctAnswer", 3, null), i = Z(t, "disabled", 3, !1), a = Z(t, "onResponseChange", 3, () => {}), o = /* @__PURE__ */ F(() => r() === null ? n() : r()), s = /* @__PURE__ */ F(() => r() ? t.interaction.choices.find((e) => e.identifier === r()) : null);
6055
6070
  function c(e) {
6056
6071
  let n = e.currentTarget?.value ?? "";
6057
6072
  a()(t.interaction.responseId, n);
6058
6073
  }
6059
- var l = hl(), u = V(l);
6074
+ var l = _l(), u = V(l);
6060
6075
  let d;
6061
6076
  var f = V(u), p = V(f, !0);
6062
6077
  D(f), f.value = f.__value = "", Ma(qr(f), 17, () => t.interaction.choices, Oa, (e, t) => {
6063
6078
  let n = /* @__PURE__ */ F(() => r() === q(t).identifier);
6064
- var i = pl(), a = V(i);
6079
+ var i = hl(), a = V(i);
6065
6080
  D(i);
6066
6081
  var o = {};
6067
6082
  H(() => {
@@ -6071,7 +6086,7 @@ function _l(e, t) {
6071
6086
  var m;
6072
6087
  eo(u);
6073
6088
  var h = qr(u, 2), g = (e) => {
6074
- var n = ml(), r = V(n);
6089
+ var n = gl(), r = V(n);
6075
6090
  D(n), H((e) => pa(r, `${e ?? ""}: ${q(s).text ?? ""}`), [() => t.i18n?.t("interactions.choice.correct", "Correct") ?? "Correct"]), Y(e, n);
6076
6091
  };
6077
6092
  Da(h, (e) => {
@@ -6086,12 +6101,12 @@ function _l(e, t) {
6086
6101
  aa(["change"]);
6087
6102
  //#endregion
6088
6103
  //#region src/interactions/text-entry/InlineTextEntry.svelte
6089
- var vl = /* @__PURE__ */ J("<span role=\"alert\" class=\"qti-text-entry-error svelte-v4bfxs\"> </span>"), yl = /* @__PURE__ */ J("<input type=\"text\"/> <!>", 1), bl = {
6104
+ var bl = /* @__PURE__ */ J("<span role=\"alert\" class=\"qti-text-entry-error svelte-v4bfxs\"> </span>"), xl = /* @__PURE__ */ J("<input type=\"text\"/> <!>", 1), Sl = {
6090
6105
  hash: "svelte-v4bfxs",
6091
6106
  code: ".qti-inline-input.svelte-v4bfxs {box-sizing:border-box;padding:0.25rem 0.5rem;border:1px solid var(--pie-qti-base-300, oklch(95% 0 0));border-radius:0.5rem;background:var(--pie-qti-base-100, oklch(100% 0 0));color:var(--pie-qti-base-content, oklch(21% 0 0));font:inherit;}.qti-inline-input.svelte-v4bfxs:focus-visible {outline:2px solid var(--pie-qti-focus, var(--pie-qti-primary, oklch(45% 0.24 277)));outline-offset:2px;}.qti-inline-input-correct.svelte-v4bfxs {border-color:var(--pie-qti-success, oklch(76% 0.177 163.223));background:color-mix(in oklch, var(--pie-qti-success, oklch(76% 0.177 163.223)) 10%, transparent);}.qti-text-entry-error.svelte-v4bfxs {display:block;color:var(--pie-qti-error, oklch(71% 0.194 13.428));font-size:0.75rem;}"
6092
6107
  };
6093
- function xl(e, t) {
6094
- Ot(t, !0), Ba(e, bl);
6108
+ function Cl(e, t) {
6109
+ Ot(t, !0), Ba(e, Sl);
6095
6110
  let n = Z(t, "response", 3, ""), r = Z(t, "correctAnswer", 3, null), i = Z(t, "disabled", 3, !1), a = Z(t, "onResponseChange", 3, () => {}), o = /* @__PURE__ */ z(null), s = /* @__PURE__ */ F(() => r() === null ? n() : r()), c = /* @__PURE__ */ F(() => (t.interaction.interactionClasses ?? []).find((e) => e.startsWith("qti-input-width-"))), l = /* @__PURE__ */ F(() => (t.interaction.interactionClasses ?? []).filter((e) => !e.startsWith("qti-input-width-")).join(" ")), u = /* @__PURE__ */ F(() => `${t.interaction.responseId}-error`);
6096
6111
  function d(e) {
6097
6112
  let n = e.currentTarget, r = n?.value ?? "";
@@ -6103,10 +6118,10 @@ function xl(e, t) {
6103
6118
  function p(e) {
6104
6119
  e.currentTarget?.checkValidity();
6105
6120
  }
6106
- var m = yl(), h = Kr(m);
6121
+ var m = xl(), h = Kr(m);
6107
6122
  oo(h);
6108
6123
  var g = qr(h, 2), _ = (e) => {
6109
- var t = vl(), n = V(t, !0);
6124
+ var t = bl(), n = V(t, !0);
6110
6125
  D(t), H(() => {
6111
6126
  X(t, "id", q(u)), pa(n, q(o));
6112
6127
  }), Y(e, t);
@@ -6125,14 +6140,14 @@ function xl(e, t) {
6125
6140
  aa(["input"]);
6126
6141
  //#endregion
6127
6142
  //#region src/core/rolePolicy.ts
6128
- var Sl = new Set([
6143
+ var wl = new Set([
6129
6144
  "scorer",
6130
6145
  "author",
6131
6146
  "tutor",
6132
6147
  "testConstructor"
6133
6148
  ]);
6134
- function Cl(e) {
6135
- let t = e === "candidate", n = Sl.has(e);
6149
+ function Tl(e) {
6150
+ let t = e === "candidate", n = wl.has(e);
6136
6151
  return {
6137
6152
  isCandidate: t,
6138
6153
  isReadOnly: !t,
@@ -6141,7 +6156,7 @@ function Cl(e) {
6141
6156
  }
6142
6157
  //#endregion
6143
6158
  //#region src/components/utils/feedbackUtils.ts
6144
- var wl = [
6159
+ var El = [
6145
6160
  {
6146
6161
  pattern: /<strong>Incorrect;<\/strong>/gi,
6147
6162
  replacement: "<strong>Incorrect</strong> "
@@ -6159,55 +6174,55 @@ var wl = [
6159
6174
  replacement: "Correct "
6160
6175
  }
6161
6176
  ];
6162
- function Tl(e, t = wl) {
6177
+ function Dl(e, t = El) {
6163
6178
  if (!e) return e;
6164
6179
  let n = e;
6165
6180
  for (let e of t) n = n.replace(e.pattern, e.replacement);
6166
6181
  return n;
6167
6182
  }
6168
- function El(e, t) {
6183
+ function Ol(e, t) {
6169
6184
  let { outcomeValues: n, applyHeuristics: r = !1, wrapWithSpan: i = !1, transforms: a } = t;
6170
6185
  return e && e.replace(/<feedbackInline\b([^>]*)>([\s\S]*?)<\/feedbackInline>/gi, (e, t, o) => {
6171
- let s = Dl(t, "outcomeIdentifier"), c = Dl(t, "identifier"), l = Dl(t, "showHide") ?? "show", u = s ? n[s] : void 0;
6186
+ let s = kl(t, "outcomeIdentifier"), c = kl(t, "identifier"), l = kl(t, "showHide") ?? "show", u = s ? n[s] : void 0;
6172
6187
  if (s === null || c === null || u == null || u === "") return "";
6173
6188
  let d = Array.isArray(u) ? u.includes(c) : u === c;
6174
- return (l.toLowerCase() === "show" ? d : !d) ? (r && (o = Tl(o, a)), i ? ` <span class="qti-feedback-inline">${o}</span>` : o) : "";
6189
+ return (l.toLowerCase() === "show" ? d : !d) ? (r && (o = Dl(o, a)), i ? ` <span class="qti-feedback-inline">${o}</span>` : o) : "";
6175
6190
  });
6176
6191
  }
6177
- function Dl(e, t) {
6192
+ function kl(e, t) {
6178
6193
  return (RegExp(`\\b${t}\\s*=\\s*"([^"]*)"`, "i").exec(e) ?? RegExp(`\\b${t}\\s*=\\s*'([^']*)'`, "i").exec(e))?.[1] ?? null;
6179
6194
  }
6180
6195
  //#endregion
6181
6196
  //#region src/components/utils/stylesheetRender.ts
6182
- function Ol(e, t = "[data-qti-item-body-scope]") {
6183
- return e ? e.stylesheets.map((e) => kl(e, t)).filter(Boolean).join("\n") : "";
6197
+ function Al(e, t = "[data-qti-item-body-scope]") {
6198
+ return e ? e.stylesheets.map((e) => jl(e, t)).filter(Boolean).join("\n") : "";
6184
6199
  }
6185
- function kl(e, t) {
6200
+ function jl(e, t) {
6186
6201
  let n = e.cssText?.trim();
6187
- return !n || oe(n) ? "" : Nl(n, Il(e, t)) || "";
6202
+ return !n || oe(n) ? "" : Fl(n, Rl(e, t)) || "";
6188
6203
  }
6189
- var Al = new Set([
6204
+ var Ml = new Set([
6190
6205
  "media",
6191
6206
  "supports",
6192
6207
  "container",
6193
6208
  "layer",
6194
6209
  "scope"
6195
- ]), jl = /^(?::root|html|body)(?![\w-])/, Ml = /^@(?:-[a-z]+-)?([\w-]+)/i;
6196
- function Nl(e, t = "[data-qti-item-body-scope]") {
6210
+ ]), Nl = /^(?::root|html|body)(?![\w-])/, Pl = /^@(?:-[a-z]+-)?([\w-]+)/i;
6211
+ function Fl(e, t = "[data-qti-item-body-scope]") {
6197
6212
  if (!e) return "";
6198
6213
  let n = t?.trim();
6199
- return n ? Pl(Vl(e), n).trim() : e;
6214
+ return n ? Il(Ul(e), n).trim() : e;
6200
6215
  }
6201
- function Pl(e, t) {
6216
+ function Il(e, t) {
6202
6217
  let n = "", r = 0;
6203
6218
  for (; r < e.length;) {
6204
- let i = Rl(e, r);
6219
+ let i = Bl(e, r);
6205
6220
  if (i.end <= r) break;
6206
- n += Fl(i, t), r = i.end;
6221
+ n += Ll(i, t), r = i.end;
6207
6222
  }
6208
6223
  return n;
6209
6224
  }
6210
- function Fl(e, t) {
6225
+ function Ll(e, t) {
6211
6226
  if (e.kind === "statement") {
6212
6227
  let t = e.text.trim();
6213
6228
  return t === ";" ? "" : `${t}\n`;
@@ -6216,28 +6231,28 @@ function Fl(e, t) {
6216
6231
  let n = e.prelude.trim();
6217
6232
  if (!n) return "";
6218
6233
  if (n.startsWith("@")) {
6219
- let r = Ml.exec(n)?.[1]?.toLowerCase();
6220
- if (r && Al.has(r)) {
6221
- let r = Pl(e.block, t);
6234
+ let r = Pl.exec(n)?.[1]?.toLowerCase();
6235
+ if (r && Ml.has(r)) {
6236
+ let r = Il(e.block, t);
6222
6237
  return r.trim() ? `${n} {\n${r}}\n` : "";
6223
6238
  }
6224
6239
  return `${n} {${e.block}}\n`;
6225
6240
  }
6226
6241
  let r = e.block.trim();
6227
6242
  if (!r) return "";
6228
- let i = Bl(n, ",").map((e) => Ll(e.trim(), t)).filter(Boolean);
6243
+ let i = Hl(n, ",").map((e) => zl(e.trim(), t)).filter(Boolean);
6229
6244
  return i.length === 0 ? "" : `${i.join(", ")} { ${r} }\n`;
6230
6245
  }
6231
- function Il(e, t) {
6232
- return e.source !== "stimulus" || !e.stimulusIdentifier ? t : `${t} [data-stimulus-idref="${Hl(e.stimulusIdentifier)}"]`;
6246
+ function Rl(e, t) {
6247
+ return e.source !== "stimulus" || !e.stimulusIdentifier ? t : `${t} [data-stimulus-idref="${Wl(e.stimulusIdentifier)}"]`;
6233
6248
  }
6234
- function Ll(e, t) {
6249
+ function zl(e, t) {
6235
6250
  if (!e) return "";
6236
6251
  if (e === t || e.startsWith(`${t} `)) return e;
6237
- let n = jl.exec(e);
6252
+ let n = Nl.exec(e);
6238
6253
  return n ? `${t}${e.slice(n[0].length)}` : `${t} ${e}`;
6239
6254
  }
6240
- function Rl(e, t) {
6255
+ function Bl(e, t) {
6241
6256
  let n = t, r = null, i = 0;
6242
6257
  for (; n < e.length;) {
6243
6258
  let a = e[n];
@@ -6251,7 +6266,7 @@ function Rl(e, t) {
6251
6266
  end: n + 1
6252
6267
  };
6253
6268
  else if (i === 0 && a === "{") {
6254
- let r = zl(e, n);
6269
+ let r = Vl(e, n);
6255
6270
  return {
6256
6271
  kind: "rule",
6257
6272
  prelude: e.slice(t, n),
@@ -6267,7 +6282,7 @@ function Rl(e, t) {
6267
6282
  end: e.length
6268
6283
  };
6269
6284
  }
6270
- function zl(e, t) {
6285
+ function Vl(e, t) {
6271
6286
  let n = 0, r = null;
6272
6287
  for (let i = t; i < e.length; i += 1) {
6273
6288
  let t = e[i];
@@ -6290,7 +6305,7 @@ function zl(e, t) {
6290
6305
  end: e.length
6291
6306
  };
6292
6307
  }
6293
- function Bl(e, t) {
6308
+ function Hl(e, t) {
6294
6309
  let n = [], r = "", i = null, a = 0;
6295
6310
  for (let o = 0; o < e.length; o += 1) {
6296
6311
  let s = e[o];
@@ -6310,7 +6325,7 @@ function Bl(e, t) {
6310
6325
  }
6311
6326
  return n.push(r), n;
6312
6327
  }
6313
- function Vl(e) {
6328
+ function Ul(e) {
6314
6329
  let t = "", n = null, r = 0;
6315
6330
  for (; r < e.length;) {
6316
6331
  let i = e[r];
@@ -6335,71 +6350,71 @@ function Vl(e) {
6335
6350
  }
6336
6351
  return t;
6337
6352
  }
6338
- function Hl(e) {
6353
+ function Wl(e) {
6339
6354
  return e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n|\r|\f/g, " ");
6340
6355
  }
6341
6356
  //#endregion
6342
6357
  //#region src/components/utils/stimulusRender.ts
6343
- function Ul(e, t, n) {
6358
+ function Gl(e, t, n) {
6344
6359
  let r = Object.fromEntries(Object.entries(e?.stimuli ?? {}).map(([e, t]) => [e, n(t.bodyHtml)])), i = Object.fromEntries(Object.entries(t).map(([e, t]) => [e, n(t)]));
6345
6360
  return {
6346
6361
  ...r,
6347
6362
  ...i
6348
6363
  };
6349
6364
  }
6350
- function Wl(e, t) {
6365
+ function Kl(e, t) {
6351
6366
  if (Object.keys(t).length === 0) return e;
6352
6367
  let n = /* @__PURE__ */ new Set(), r = e.replace(/<([a-z][\w:-]*)([^>]*\bdata-stimulus-idref=(["'])([^"']+)\3[^>]*)>\s*<\/\1>/gi, (e, r, i, a, o) => {
6353
6368
  let s = t[o];
6354
- return s ? (n.add(o), `<${r}${Kl(i, "qti-stimulus-dock")}>${s}</${r}>`) : e;
6369
+ return s ? (n.add(o), `<${r}${Jl(i, "qti-stimulus-dock")}>${s}</${r}>`) : e;
6355
6370
  });
6356
6371
  r = r.replace(/<qti-assessment-stimulus-ref\b([^>]*)\/?>\s*(?:<\/qti-assessment-stimulus-ref>)?/gi, (e, r) => {
6357
- let i = Gl(r, "identifier");
6372
+ let i = ql(r, "identifier");
6358
6373
  if (!i) return e;
6359
6374
  if (n.has(i)) return "";
6360
6375
  let a = t[i];
6361
- return a ? (n.add(i), `<div data-stimulus-idref="${ql(i)}" class="qti-stimulus-dock">${a}</div>`) : e;
6376
+ return a ? (n.add(i), `<div data-stimulus-idref="${Yl(i)}" class="qti-stimulus-dock">${a}</div>`) : e;
6362
6377
  });
6363
- let i = Object.entries(t).filter(([e]) => !n.has(e)).map(([e, t]) => `<div data-stimulus-idref="${ql(e)}" class="qti-stimulus-block">${t}</div>`).join("");
6378
+ let i = Object.entries(t).filter(([e]) => !n.has(e)).map(([e, t]) => `<div data-stimulus-idref="${Yl(e)}" class="qti-stimulus-block">${t}</div>`).join("");
6364
6379
  return i ? i + r : r;
6365
6380
  }
6366
- function Gl(e, t) {
6381
+ function ql(e, t) {
6367
6382
  return e.match(RegExp(`\\b${t}\\s*=\\s*["']([^"']+)["']`, "i"))?.[1] ?? null;
6368
6383
  }
6369
- function Kl(e, t) {
6384
+ function Jl(e, t) {
6370
6385
  let n = e.match(/\bclass\s*=\s*(["'])([^"']*)\1/i);
6371
6386
  if (!n) return `${e} class="${t}"`;
6372
6387
  let r = n[1], i = n[2] ?? "", a = new Set(i.split(/\s+/).filter(Boolean));
6373
6388
  return a.add(t), e.replace(n[0], `class=${r}${Array.from(a).join(" ")}${r}`);
6374
6389
  }
6375
- function ql(e) {
6390
+ function Yl(e) {
6376
6391
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
6377
6392
  }
6378
6393
  //#endregion
6379
6394
  //#region src/interactions/inline/render-plan.ts
6380
- function Jl(e) {
6381
- return Js(e);
6395
+ function Xl(e) {
6396
+ return Xs(e);
6382
6397
  }
6383
- function Yl(e) {
6384
- return Ys(e);
6398
+ function Zl(e) {
6399
+ return Zs(e);
6385
6400
  }
6386
- function Xl(e, t) {
6387
- return e.replace(/<textEntryInteraction[^>]*responseIdentifier="([^"]+)"[^>]*?(?:\/>|><\/textEntryInteraction>)/gi, (e, n) => $l(t, n, "textEntryInteraction") ? Ql("textEntry", n) : e).replace(/<qti-text-entry-interaction[^>]*response-identifier="([^"]+)"[^>]*?(?:\/>|><\/qti-text-entry-interaction>)/gi, (e, n) => $l(t, n, "textEntryInteraction") ? Ql("textEntry", n) : e).replace(/<inlineChoiceInteraction[^>]*responseIdentifier="([^"]+)"[^>]*>[\s\S]*?<\/inlineChoiceInteraction>/gi, (e, n) => $l(t, n, "inlineChoiceInteraction") ? Ql("inlineChoice", n) : e).replace(/<qti-inline-choice-interaction[^>]*response-identifier="([^"]+)"[^>]*>[\s\S]*?<\/qti-inline-choice-interaction>/gi, (e, n) => $l(t, n, "inlineChoiceInteraction") ? Ql("inlineChoice", n) : e);
6401
+ function Ql(e, t) {
6402
+ return e.replace(/<textEntryInteraction[^>]*responseIdentifier="([^"]+)"[^>]*?(?:\/>|><\/textEntryInteraction>)/gi, (e, n) => tu(t, n, "textEntryInteraction") ? eu("textEntry", n) : e).replace(/<qti-text-entry-interaction[^>]*response-identifier="([^"]+)"[^>]*?(?:\/>|><\/qti-text-entry-interaction>)/gi, (e, n) => tu(t, n, "textEntryInteraction") ? eu("textEntry", n) : e).replace(/<inlineChoiceInteraction[^>]*responseIdentifier="([^"]+)"[^>]*>[\s\S]*?<\/inlineChoiceInteraction>/gi, (e, n) => tu(t, n, "inlineChoiceInteraction") ? eu("inlineChoice", n) : e).replace(/<qti-inline-choice-interaction[^>]*response-identifier="([^"]+)"[^>]*>[\s\S]*?<\/qti-inline-choice-interaction>/gi, (e, n) => tu(t, n, "inlineChoiceInteraction") ? eu("inlineChoice", n) : e);
6388
6403
  }
6389
- function Zl(e, t) {
6390
- let n = Xl(e, t), r = [], i = /\[TEXTENTRY:([^\]]+)\]|\[INLINECHOICE:([^\]]+)\]/g, a = 0, o;
6404
+ function $l(e, t) {
6405
+ let n = Ql(e, t), r = [], i = /\[TEXTENTRY:([^\]]+)\]|\[INLINECHOICE:([^\]]+)\]/g, a = 0, o;
6391
6406
  for (; (o = i.exec(n)) !== null;) {
6392
6407
  if (o.index > a && r.push({
6393
6408
  type: "html",
6394
6409
  content: n.substring(a, o.index)
6395
6410
  }), o[0].startsWith("[TEXTENTRY:")) {
6396
- let e = eu(t, o[1], "textEntryInteraction");
6411
+ let e = nu(t, o[1], "textEntryInteraction");
6397
6412
  e && r.push({
6398
6413
  type: "textEntry",
6399
6414
  interaction: e
6400
6415
  });
6401
6416
  } else {
6402
- let e = eu(t, o[2], "inlineChoiceInteraction");
6417
+ let e = nu(t, o[2], "inlineChoiceInteraction");
6403
6418
  e && r.push({
6404
6419
  type: "inlineChoice",
6405
6420
  interaction: e
@@ -6415,19 +6430,19 @@ function Zl(e, t) {
6415
6430
  content: n
6416
6431
  }];
6417
6432
  }
6418
- function Ql(e, t) {
6433
+ function eu(e, t) {
6419
6434
  return e === "textEntry" ? `[TEXTENTRY:${t}]` : `[INLINECHOICE:${t}]`;
6420
6435
  }
6421
- function $l(e, t, n) {
6422
- return !!eu(e, t, n);
6436
+ function tu(e, t, n) {
6437
+ return !!nu(e, t, n);
6423
6438
  }
6424
- function eu(e, t, n) {
6439
+ function nu(e, t, n) {
6425
6440
  return e.find((e) => e.responseId === t && e.type === n) ?? null;
6426
6441
  }
6427
6442
  //#endregion
6428
6443
  //#region src/presentation/itemPresentationPlan.ts
6429
- function tu({ player: e, responses: t = {}, disabled: n = !1, role: r = "candidate", outcomeValues: i = {}, heuristicsConfig: a, stimulusContent: o = {}, deliveryContext: s, itemBodyScopeSelector: c = "[data-qti-item-body-scope]", renderItemBodyRubrics: l = !0, onComponentError: u }) {
6430
- let d = e.getInteractionData(), f = Cl(r), p = n || f.isReadOnly, m = f.canViewCorrectResponses ? e.getCorrectResponses() : {}, h = nu({
6444
+ function ru({ player: e, responses: t = {}, disabled: n = !1, role: r = "candidate", outcomeValues: i = {}, heuristicsConfig: a, stimulusContent: o = {}, deliveryContext: s, itemBodyScopeSelector: c = "[data-qti-item-body-scope]", renderItemBodyRubrics: l = !0, onComponentError: u }) {
6445
+ let d = e.getInteractionData(), f = Tl(r), p = n || f.isReadOnly, m = f.canViewCorrectResponses ? e.getCorrectResponses() : {}, h = iu({
6431
6446
  player: e,
6432
6447
  role: r,
6433
6448
  outcomeValues: i,
@@ -6442,8 +6457,8 @@ function tu({ player: e, responses: t = {}, disabled: n = !1, role: r = "candida
6442
6457
  effectiveDisabled: p,
6443
6458
  correctResponses: m,
6444
6459
  itemBodyHtml: h,
6445
- inlineSegments: Zl(h, d),
6446
- blockInteractions: fu({
6460
+ inlineSegments: $l(h, d),
6461
+ blockInteractions: mu({
6447
6462
  interactions: d,
6448
6463
  player: e,
6449
6464
  responses: t,
@@ -6454,75 +6469,75 @@ function tu({ player: e, responses: t = {}, disabled: n = !1, role: r = "candida
6454
6469
  })
6455
6470
  };
6456
6471
  }
6457
- function nu({ player: e, role: t, outcomeValues: n, heuristicsConfig: r, stimulusContent: i, deliveryContext: a, itemBodyScopeSelector: o, renderItemBodyRubrics: s }) {
6458
- let c = String(e.getItemBodyHtml()), l = a ?? e.getDeliveryContext(), u = Ol(l, o), d = Ul(l, i, (t) => e.sanitizeHtmlContent(t));
6459
- c = Wl(c, d), u && (c = `<style data-qti-stylesheets="resolved">${u}</style>${c}`), c = ru(c, t, { renderRubrics: s });
6472
+ function iu({ player: e, role: t, outcomeValues: n, heuristicsConfig: r, stimulusContent: i, deliveryContext: a, itemBodyScopeSelector: o, renderItemBodyRubrics: s }) {
6473
+ let c = String(e.getItemBodyHtml()), l = a ?? e.getDeliveryContext(), u = Al(l, o), d = Gl(l, i, (t) => e.sanitizeHtmlContent(t));
6474
+ c = Kl(c, d), u && (c = `<style data-qti-stylesheets="resolved">${u}</style>${c}`), c = au(c, t, { renderRubrics: s });
6460
6475
  let f = ce(r);
6461
- return c = El(c, {
6476
+ return c = Ol(c, {
6462
6477
  outcomeValues: n,
6463
6478
  applyHeuristics: f.feedbackTextFormatting,
6464
6479
  wrapWithSpan: !1
6465
- }), du(c);
6480
+ }), pu(c);
6466
6481
  }
6467
- function ru(e, t, { renderRubrics: n }) {
6482
+ function au(e, t, { renderRubrics: n }) {
6468
6483
  if (!e || !/rubric-?block/i.test(e)) return e;
6469
6484
  try {
6470
6485
  let r = ie(e, {
6471
6486
  lowerCaseTagName: !1,
6472
6487
  comment: !1
6473
6488
  });
6474
- return iu(r, t, { renderRubrics: n }), r.toString();
6489
+ return ou(r, t, { renderRubrics: n }), r.toString();
6475
6490
  } catch {
6476
6491
  return e;
6477
6492
  }
6478
6493
  }
6479
- function iu(e, t, { renderRubrics: n }) {
6494
+ function ou(e, t, { renderRubrics: n }) {
6480
6495
  let r = [...e.childNodes];
6481
6496
  for (let e of r) {
6482
6497
  let r = e.rawTagName?.toLowerCase();
6483
- if (r && au(r) && (!n || !ou(e, t))) {
6498
+ if (r && su(r) && (!n || !cu(e, t))) {
6484
6499
  e.remove();
6485
6500
  continue;
6486
6501
  }
6487
- e.childNodes?.length && iu(e, t, { renderRubrics: n }), r && au(r) && e.replaceWith(su(e));
6502
+ e.childNodes?.length && ou(e, t, { renderRubrics: n }), r && su(r) && e.replaceWith(lu(e));
6488
6503
  }
6489
6504
  }
6490
- function au(e) {
6505
+ function su(e) {
6491
6506
  return e === "rubricblock" || e === "qti-rubric-block";
6492
6507
  }
6493
- function ou(e, t) {
6508
+ function cu(e, t) {
6494
6509
  let n = e.getAttribute("view")?.trim();
6495
- return n ? cu(n).includes(t) : !0;
6510
+ return n ? uu(n).includes(t) : !0;
6496
6511
  }
6497
- function su(e) {
6512
+ function lu(e) {
6498
6513
  let t = e.getAttribute("view")?.trim(), n = e.getAttribute("use")?.trim();
6499
6514
  return `<div ${[
6500
6515
  "class=\"qti-rubric-block\"",
6501
- t ? `data-qti-rubric-view="${uu(t)}"` : "",
6502
- n ? `data-qti-rubric-use="${uu(n)}"` : ""
6503
- ].filter(Boolean).join(" ")}>${lu(e)}</div>`;
6516
+ t ? `data-qti-rubric-view="${fu(t)}"` : "",
6517
+ n ? `data-qti-rubric-use="${fu(n)}"` : ""
6518
+ ].filter(Boolean).join(" ")}>${du(e)}</div>`;
6504
6519
  }
6505
- function cu(e) {
6520
+ function uu(e) {
6506
6521
  return e.split(/[\s,]+/).filter(Boolean);
6507
6522
  }
6508
- function lu(e) {
6523
+ function du(e) {
6509
6524
  return [...e.childNodes].map((e) => e.toString()).join("");
6510
6525
  }
6511
- function uu(e) {
6526
+ function fu(e) {
6512
6527
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
6513
6528
  }
6514
- function du(e) {
6515
- return e.replace(/<(\w+Interaction|qti-[\w-]+-interaction)(\s[^>]*)?>[\s\S]*?<\/\1>/gi, (e, t) => Yl(t.toLowerCase()) ? e : `<span class="qti-hidden-interaction">${e}</span>`);
6529
+ function pu(e) {
6530
+ return e.replace(/<(\w+Interaction|qti-[\w-]+-interaction)(\s[^>]*)?>[\s\S]*?<\/\1>/gi, (e, t) => Zl(t.toLowerCase()) ? e : `<span class="qti-hidden-interaction">${e}</span>`);
6516
6531
  }
6517
- function fu({ interactions: e, player: t, responses: n, correctResponses: r, roleCapabilities: i, effectiveDisabled: a, onComponentError: o }) {
6532
+ function mu({ interactions: e, player: t, responses: n, correctResponses: r, roleCapabilities: i, effectiveDisabled: a, onComponentError: o }) {
6518
6533
  let s = t.getComponentRegistry();
6519
- return e.filter((e) => !Jl(e.type)).map((e) => {
6534
+ return e.filter((e) => !Xl(e.type)).map((e) => {
6520
6535
  try {
6521
6536
  let o = "stringIdentifier" in e && typeof e.stringIdentifier == "string" ? e.stringIdentifier : void 0;
6522
6537
  return {
6523
6538
  interaction: e,
6524
6539
  tagName: s.getTagName(e),
6525
- key: pu(e),
6540
+ key: hu(e),
6526
6541
  response: n[e.responseId] ?? null,
6527
6542
  ...o ? { stringResponse: n[o] ?? null } : {},
6528
6543
  correctResponse: i.canViewCorrectResponses ? r[e.responseId] ?? null : null,
@@ -6536,19 +6551,19 @@ function fu({ interactions: e, player: t, responses: n, correctResponses: r, rol
6536
6551
  }
6537
6552
  }).filter((e) => e !== null);
6538
6553
  }
6539
- function pu(e) {
6554
+ function hu(e) {
6540
6555
  let t = e, n = Array.isArray(t?.choices) && t.choices.length > 0 ? t.choices.map((e) => e?.identifier).filter(Boolean).join(",") : "", r = typeof t?.prompt == "string" ? t.prompt : "";
6541
6556
  return `${e.type}|${e.responseId}|${n}|${r}`;
6542
6557
  }
6543
6558
  //#endregion
6544
6559
  //#region src/components/ItemBody.svelte
6545
- var mu = 0, hu = /* @__PURE__ */ J("<div class=\"qti-item-body svelte-11qbngh\"><div class=\"qti-item-body-content svelte-11qbngh\"><div class=\"inline-interaction-container svelte-11qbngh\"></div></div> <!></div>"), gu = {
6560
+ var gu = 0, _u = /* @__PURE__ */ J("<div class=\"qti-item-body svelte-11qbngh\"><div class=\"qti-item-body-content svelte-11qbngh\"><div class=\"inline-interaction-container svelte-11qbngh\"></div></div> <!></div>"), vu = {
6546
6561
  hash: "svelte-11qbngh",
6547
6562
  code: "\n /* Allow the whole item body to shrink inside flex/grid layouts (prevents overflow). */.qti-item-body.svelte-11qbngh {max-width:100%;min-width:0;}.qti-item-body-content.svelte-11qbngh {max-width:none;margin-bottom:1rem;}\n\n /*\n * Custom elements default to inline; force them to be block-level and width-contained.\n * This prevents wide interactions (SVGs, tables, canvases) from spilling outside panels.\n */.qti-item-body :is(\n pie-qti-choice,\n pie-qti-slider,\n pie-qti-order,\n pie-qti-match,\n pie-qti-associate,\n pie-qti-gap-match,\n pie-qti-hotspot,\n pie-qti-hottext,\n pie-qti-media,\n pie-qti-custom,\n pie-qti-portable-custom,\n pie-qti-end-attempt,\n pie-qti-position-object,\n pie-qti-graphic-gap-match,\n pie-qti-graphic-order,\n pie-qti-graphic-associate,\n pie-qti-select-point,\n pie-qti-extended-text\n ) {display:block;max-width:100%;min-width:0;}\n\n /* Keep inline interactions from breaking paragraph flow */.inline-interaction-container.svelte-11qbngh p {display:inline;}\n\n /*\n * Hide all QTI interaction elements wrapped with qti-hidden-interaction.\n * These are rendered separately as web components above.\n * Keeping them in the HTML (but hidden) makes debugging easier and is fully extensible.\n * Any *Interaction element will be automatically wrapped and hidden - no hardcoded list needed!\n */.qti-item-body .qti-hidden-interaction {display:none !important;}\n\n /*\n * Style for inline feedback elements that appear within choice text or other content.\n * Provides visual distinction and spacing for feedback that appears inline with content.\n */.qti-feedback-inline {display:inline-block;margin-left:0.5rem;padding-left:0.5rem;border-left:2px solid var(--pie-qti-base-content, currentColor);opacity:0.8;}\n\n /* QTI 3.0 Shared Stimulus: stimulus blocks that were prepended before the item body */.qti-stimulus-block {margin-bottom:1rem;}\n\n /* QTI rubricBlock / qti-rubric-block content rendered in item-body source order. */.qti-item-body .qti-rubric-block {display:block;max-width:100%;min-width:0;margin:1rem 0;padding:1rem;overflow-x:auto;border:1px solid var(--pie-qti-base-300, #d1d5db);border-inline-start:4px solid var(--pie-qti-primary, #2563eb);border-radius:0.5rem;background:var(--pie-qti-base-200, #f8fafc);}.qti-item-body .qti-rubric-block > :first-child {margin-top:0;}.qti-item-body .qti-rubric-block > :last-child {margin-bottom:0;}.qti-item-body .qti-rubric-block table {max-width:100%;border-collapse:collapse;}.qti-item-body .qti-rubric-block th,\n .qti-item-body .qti-rubric-block td {padding:0.5rem;border:1px solid var(--pie-qti-base-300, #d1d5db);vertical-align:top;}\n\n /* QTI 3.0 Shared Vocabulary: qti-input-width-N sets minimum input width in character units. */.qti-input-width-1 {min-width:1ch;}.qti-input-width-2 {min-width:2ch;}.qti-input-width-3 {min-width:3ch;}.qti-input-width-4 {min-width:4ch;}.qti-input-width-5 {min-width:5ch;}.qti-input-width-6 {min-width:6ch;}.qti-input-width-10 {min-width:10ch;}.qti-input-width-15 {min-width:15ch;}.qti-input-width-20 {min-width:20ch;}.qti-input-width-25 {min-width:25ch;}.qti-input-width-30 {min-width:30ch;}.qti-input-width-35 {min-width:35ch;}.qti-input-width-40 {min-width:40ch;}.qti-input-width-45 {min-width:45ch;}.qti-input-width-50 {min-width:50ch;}.qti-input-width-72 {min-width:72ch;}"
6548
6563
  };
6549
- function _u(e, t) {
6550
- Ot(t, !0), Ba(e, gu);
6551
- let n = Z(t, "responses", 19, () => ({})), r = Z(t, "disabled", 3, !1), a = Z(t, "role", 3, "candidate"), o = Z(t, "onResponseChange", 3, () => {}), s = Z(t, "outcomeValues", 19, () => ({})), c = Z(t, "stimulusContent", 19, () => ({})), l = Z(t, "renderItemBodyRubrics", 3, !0), u = `qti-item-body-${++mu}`, d = `[data-qti-item-body-scope="${u}"]`, f = /* @__PURE__ */ F(() => tu({
6564
+ function yu(e, t) {
6565
+ Ot(t, !0), Ba(e, vu);
6566
+ let n = Z(t, "responses", 19, () => ({})), r = Z(t, "disabled", 3, !1), a = Z(t, "role", 3, "candidate"), o = Z(t, "onResponseChange", 3, () => {}), s = Z(t, "outcomeValues", 19, () => ({})), c = Z(t, "stimulusContent", 19, () => ({})), l = Z(t, "renderItemBodyRubrics", 3, !0), u = `qti-item-body-${++gu}`, d = `[data-qti-item-body-scope="${u}"]`, f = /* @__PURE__ */ F(() => ru({
6552
6567
  player: t.player,
6553
6568
  responses: n(),
6554
6569
  disabled: r(),
@@ -6591,7 +6606,7 @@ function _u(e, t) {
6591
6606
  destroy() {}
6592
6607
  };
6593
6608
  }
6594
- var y = hu(), b = V(y), x = V(b);
6609
+ var y = _u(), b = V(y), x = V(b);
6595
6610
  Ma(x, 21, () => q(f).inlineSegments, Oa, (e, n) => {
6596
6611
  var r = fa(), i = Kr(r), a = (e) => {
6597
6612
  var t = fa();
@@ -6600,7 +6615,7 @@ function _u(e, t) {
6600
6615
  let r = /* @__PURE__ */ F(() => q(f).roleCapabilities.canViewCorrectResponses ? q(f).correctResponses[q(n).interaction.responseId] ?? null : null);
6601
6616
  {
6602
6617
  let i = /* @__PURE__ */ F(() => p(q(n).interaction.responseId)), a = /* @__PURE__ */ F(() => q(f).roleCapabilities.canViewCorrectResponses ? q(r) : null);
6603
- xl(e, {
6618
+ Cl(e, {
6604
6619
  get interaction() {
6605
6620
  return q(n).interaction;
6606
6621
  },
@@ -6623,7 +6638,7 @@ function _u(e, t) {
6623
6638
  let r = /* @__PURE__ */ F(() => q(f).roleCapabilities.canViewCorrectResponses ? q(f).correctResponses[q(n).interaction.responseId] ?? null : null);
6624
6639
  {
6625
6640
  let i = /* @__PURE__ */ F(() => p(q(n).interaction.responseId)), a = /* @__PURE__ */ F(() => q(f).roleCapabilities.canViewCorrectResponses ? q(r) : null);
6626
- _l(e, {
6641
+ yl(e, {
6627
6642
  get interaction() {
6628
6643
  return q(n).interaction;
6629
6644
  },
@@ -6664,16 +6679,16 @@ function _u(e, t) {
6664
6679
  createPciHost: g
6665
6680
  }));
6666
6681
  }), Y(e, r);
6667
- }), D(y), bo(y, (e) => B(_, e), () => q(_)), Va(y, (e, t) => Kc?.(e, t), () => ({ typeset: t.typeset })), Va(y, (e, t) => fl?.(e, t), () => ({ player: t.player })), H(() => X(y, "data-qti-item-body-scope", u)), Y(e, y), kt();
6682
+ }), D(y), bo(y, (e) => B(_, e), () => q(_)), Va(y, (e, t) => Jc?.(e, t), () => ({ typeset: t.typeset })), Va(y, (e, t) => ml?.(e, t), () => ({ player: t.player })), H(() => X(y, "data-qti-item-body-scope", u)), Y(e, y), kt();
6668
6683
  }
6669
6684
  //#endregion
6670
6685
  //#region src/components/ModalFeedbackDisplay.svelte
6671
- var vu = /* @__PURE__ */ J("<h3 class=\"qti-feedback-title svelte-i66ia0\"> </h3>"), yu = /* @__PURE__ */ J("<div class=\"qti-feedback-content svelte-i66ia0\"></div>"), bu = /* @__PURE__ */ J("<div><!> <!></div>"), xu = /* @__PURE__ */ J("<dialog open=\"\" class=\"qti-feedback-modal svelte-i66ia0\" aria-modal=\"true\"><div class=\"qti-feedback-modal-box svelte-i66ia0\"><button class=\"qti-feedback-close-button svelte-i66ia0\" type=\"button\">✕</button> <!> <div class=\"qti-feedback-actions svelte-i66ia0\"><button class=\"qti-feedback-primary-button svelte-i66ia0\" type=\"button\"> </button></div></div></dialog>"), Su = {
6686
+ var bu = /* @__PURE__ */ J("<h3 class=\"qti-feedback-title svelte-i66ia0\"> </h3>"), xu = /* @__PURE__ */ J("<div class=\"qti-feedback-content svelte-i66ia0\"></div>"), Su = /* @__PURE__ */ J("<div><!> <!></div>"), Cu = /* @__PURE__ */ J("<dialog open=\"\" class=\"qti-feedback-modal svelte-i66ia0\" aria-modal=\"true\"><div class=\"qti-feedback-modal-box svelte-i66ia0\"><button class=\"qti-feedback-close-button svelte-i66ia0\" type=\"button\">✕</button> <!> <div class=\"qti-feedback-actions svelte-i66ia0\"><button class=\"qti-feedback-primary-button svelte-i66ia0\" type=\"button\"> </button></div></div></dialog>"), wu = {
6672
6687
  hash: "svelte-i66ia0",
6673
6688
  code: ".qti-feedback-modal.svelte-i66ia0 {box-sizing:border-box;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background-color:rgba(0, 0, 0, 0.5);color:var(--pie-qti-base-content, oklch(21% 0 0));}.qti-feedback-modal[open].svelte-i66ia0 {display:grid;place-items:center;}.qti-feedback-modal-box.svelte-i66ia0 {position:relative;box-sizing:border-box;width:min(48rem, calc(100vw - 2rem));max-height:80vh;overflow-y:auto;padding:1.5rem;border:1px solid var(--pie-qti-base-300, oklch(95% 0 0));border-radius:1rem;background:var(--pie-qti-base-100, oklch(100% 0 0));box-shadow:0 20px 45px rgba(0, 0, 0, 0.2);}.qti-feedback-close-button.svelte-i66ia0,\n .qti-feedback-primary-button.svelte-i66ia0 {display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--pie-qti-base-300, oklch(95% 0 0));background:var(--pie-qti-base-100, oklch(100% 0 0));color:var(--pie-qti-base-content, oklch(21% 0 0));font:inherit;cursor:pointer;}.qti-feedback-close-button.svelte-i66ia0 {position:absolute;top:0.5rem;right:0.5rem;width:2rem;height:2rem;padding:0;border-radius:9999px;background:transparent;border-color:transparent;}.qti-feedback-close-button.svelte-i66ia0:hover {background:var(--pie-qti-base-200, oklch(98% 0 0));border-color:var(--pie-qti-base-300, oklch(95% 0 0));}.qti-feedback-primary-button.svelte-i66ia0 {gap:0.5rem;padding:0.5rem 0.75rem;border-radius:0.75rem;border-color:var(--pie-qti-primary, oklch(45% 0.24 277));background:color-mix(in oklch, var(--pie-qti-primary, oklch(45% 0.24 277)) 12%, transparent);}.qti-feedback-close-button.svelte-i66ia0:focus-visible,\n .qti-feedback-primary-button.svelte-i66ia0:focus-visible {outline:2px solid var(--pie-qti-focus, var(--pie-qti-primary, oklch(45% 0.24 277)));outline-offset:2px;}.qti-feedback-item.svelte-i66ia0 {margin-bottom:1rem;}.qti-feedback-item-bordered.svelte-i66ia0 {padding-bottom:1rem;border-bottom:1px solid var(--pie-qti-base-300, oklch(95% 0 0));}.qti-feedback-title.svelte-i66ia0 {margin:0 0 0.5rem;font-size:1.125rem;font-weight:700;}.qti-feedback-content.svelte-i66ia0 {max-width:none;}.qti-feedback-actions.svelte-i66ia0 {display:flex;justify-content:flex-end;margin-top:1rem;}"
6674
6689
  };
6675
- function Cu(e, t) {
6676
- Ot(t, !0), Ba(e, Su);
6690
+ function Tu(e, t) {
6691
+ Ot(t, !0), Ba(e, wu);
6677
6692
  let n = Z(t, "feedback", 19, () => []), r = /* @__PURE__ */ F(() => n().length > 0), i = "item-player-modal-feedback-title", a = /* @__PURE__ */ F(() => n().find((e) => e.title)?.title);
6678
6693
  function o() {
6679
6694
  t.onClose?.();
@@ -6682,12 +6697,12 @@ function Cu(e, t) {
6682
6697
  e.target === e.currentTarget && o();
6683
6698
  }
6684
6699
  var c = fa(), l = Kr(c), u = (e) => {
6685
- var r = xu(), c = V(r), l = V(c), u = qr(l, 2);
6700
+ var r = Cu(), c = V(r), l = V(c), u = qr(l, 2);
6686
6701
  Ma(u, 17, n, Oa, (e, r, a) => {
6687
- var o = bu();
6702
+ var o = Su();
6688
6703
  let s;
6689
6704
  var c = V(o), l = (e) => {
6690
- var t = vu();
6705
+ var t = bu();
6691
6706
  X(t, "id", a === 0 ? i : void 0);
6692
6707
  var n = V(t, !0);
6693
6708
  D(t), H(() => pa(n, q(r).title)), Y(e, t);
@@ -6696,10 +6711,10 @@ function Cu(e, t) {
6696
6711
  q(r).title && e(l);
6697
6712
  });
6698
6713
  var u = qr(c, 2), d = (e) => {
6699
- var n = yu();
6700
- Ra(n, () => q(r).content, !0), D(n), Va(n, (e, t) => Kc?.(e, t), () => ({ typeset: t.typeset })), Y(e, n);
6714
+ var n = xu();
6715
+ Ra(n, () => q(r).content, !0), D(n), Va(n, (e, t) => Jc?.(e, t), () => ({ typeset: t.typeset })), Y(e, n);
6701
6716
  }, f = (e) => {
6702
- var t = yu();
6717
+ var t = xu();
6703
6718
  Ra(t, () => q(r).content, !0), D(t), Y(e, t);
6704
6719
  };
6705
6720
  Da(u, (e) => {
@@ -6725,16 +6740,16 @@ function Cu(e, t) {
6725
6740
  aa(["click"]);
6726
6741
  //#endregion
6727
6742
  //#region src/components/ItemPlayer.svelte
6728
- var wu = /* @__PURE__ */ J("<div class=\"qti-player-alert qti-player-alert-error svelte-129urwy\"><span> </span></div>"), Tu = /* @__PURE__ */ J("<span class=\"qti-player-badge qti-player-badge-success svelte-129urwy\"> </span>"), Eu = /* @__PURE__ */ J("<span> </span>"), Du = /* @__PURE__ */ J("<div class=\"qti-player-attempt-status svelte-129urwy\"><!></div>"), Ou = /* @__PURE__ */ J("<div class=\"qti-player-actions svelte-129urwy\"><button class=\"qti-player-button qti-player-button-primary svelte-129urwy\"> </button> <!></div>"), ku = /* @__PURE__ */ J("<!> <!> <!>", 1), Au = /* @__PURE__ */ J("<div class=\"qti-player-alert qti-player-alert-info svelte-129urwy\"><span> </span></div>"), ju = /* @__PURE__ */ J("<div class=\"qti-item-player svelte-129urwy\"><!></div>"), Mu = {
6743
+ var Eu = /* @__PURE__ */ J("<div class=\"qti-player-alert qti-player-alert-error svelte-129urwy\"><span> </span></div>"), Du = /* @__PURE__ */ J("<span class=\"qti-player-badge qti-player-badge-success svelte-129urwy\"> </span>"), Ou = /* @__PURE__ */ J("<span> </span>"), ku = /* @__PURE__ */ J("<div class=\"qti-player-attempt-status svelte-129urwy\"><!></div>"), Au = /* @__PURE__ */ J("<div class=\"qti-player-actions svelte-129urwy\"><button class=\"qti-player-button qti-player-button-primary svelte-129urwy\"> </button> <!></div>"), ju = /* @__PURE__ */ J("<!> <!> <!>", 1), Mu = /* @__PURE__ */ J("<div class=\"qti-player-alert qti-player-alert-info svelte-129urwy\"><span> </span></div>"), Nu = /* @__PURE__ */ J("<div class=\"qti-item-player svelte-129urwy\"><!></div>"), Pu = {
6729
6744
  hash: "svelte-129urwy",
6730
6745
  code: ".qti-item-player.svelte-129urwy {color:var(--pie-qti-base-content, oklch(21% 0 0));}.qti-player-alert.svelte-129urwy {display:flex;align-items:center;gap:0.5rem;padding:0.75rem 1rem;border:1px solid var(--pie-qti-base-300, oklch(95% 0 0));border-radius:0.75rem;background:var(--pie-qti-base-200, oklch(98% 0 0));color:var(--pie-qti-base-content, oklch(21% 0 0));}.qti-player-alert-error.svelte-129urwy {border-color:var(--pie-qti-error, oklch(71% 0.194 13.428));background:color-mix(in oklch, var(--pie-qti-error, oklch(71% 0.194 13.428)) 8%, transparent);}.qti-player-alert-info.svelte-129urwy {border-color:var(--pie-qti-info, oklch(74% 0.16 232.661));background:color-mix(in oklch, var(--pie-qti-info, oklch(74% 0.16 232.661)) 8%, transparent);}.qti-player-actions.svelte-129urwy {display:flex;align-items:center;gap:1rem;margin-top:1.5rem;}.qti-player-button.svelte-129urwy {display:inline-flex;align-items:center;justify-content:center;gap:0.5rem;padding:0.5rem 0.75rem;border:1px solid var(--pie-qti-base-300, oklch(95% 0 0));border-radius:0.75rem;background:var(--pie-qti-base-200, oklch(98% 0 0));color:var(--pie-qti-base-content, oklch(21% 0 0));font:inherit;line-height:1.1;cursor:pointer;}.qti-player-button-primary.svelte-129urwy {border-color:var(--pie-qti-primary, oklch(45% 0.24 277));background:color-mix(in oklch, var(--pie-qti-primary, oklch(45% 0.24 277)) 12%, transparent);}.qti-player-button.svelte-129urwy:disabled {opacity:0.55;cursor:not-allowed;}.qti-player-button.svelte-129urwy:focus-visible {outline:2px solid var(--pie-qti-focus, var(--pie-qti-primary, oklch(45% 0.24 277)));outline-offset:2px;}.qti-player-attempt-status.svelte-129urwy {color:color-mix(in oklch, var(--pie-qti-base-content, oklch(21% 0 0)) 70%, transparent);font-size:0.875rem;}.qti-player-badge.svelte-129urwy {display:inline-flex;align-items:center;justify-content:center;min-height:1.25rem;padding:0 0.5rem;border:1px solid var(--pie-qti-base-300, oklch(95% 0 0));border-radius:9999px;font-size:0.75rem;font-weight:600;}.qti-player-badge-success.svelte-129urwy {border-color:var(--pie-qti-success, oklch(76% 0.177 163.223));background:color-mix(in oklch, var(--pie-qti-success, oklch(76% 0.177 163.223)) 12%, transparent);}"
6731
6746
  };
6732
- function Nu(e, t) {
6733
- Ot(t, !0), Ba(e, Mu);
6747
+ function Fu(e, t) {
6748
+ Ot(t, !0), Ba(e, Pu);
6734
6749
  let n = Z(t, "role", 3, "candidate"), r = Z(t, "responses", 19, () => ({})), i = Z(t, "disabled", 3, !1), a = Z(t, "renderItemBodyRubrics", 3, !0), o = /* @__PURE__ */ F(() => t.showSubmit ?? !!t.onSubmit), s = /* @__PURE__ */ z(null), c = /* @__PURE__ */ z(Fr({})), l = /* @__PURE__ */ z(null), u = /* @__PURE__ */ z(Fr([])), d = /* @__PURE__ */ z(Fr({})), f = /* @__PURE__ */ z(!1), p = /* @__PURE__ */ z(!1), m = /* @__PURE__ */ z(0);
6735
6750
  ri(() => {
6736
6751
  try {
6737
- let e = Ki(() => r()), i = new Hc({
6752
+ let e = Ki(() => r()), i = new Wc({
6738
6753
  itemXml: t.itemXml,
6739
6754
  role: n(),
6740
6755
  security: t.security,
@@ -6776,12 +6791,12 @@ function Nu(e, t) {
6776
6791
  function _() {
6777
6792
  B(u, [], !0);
6778
6793
  }
6779
- var v = { submit: g }, y = ju(), b = V(y), x = (e) => {
6780
- var t = wu(), n = V(t), r = V(n, !0);
6794
+ var v = { submit: g }, y = Nu(), b = V(y), x = (e) => {
6795
+ var t = Eu(), n = V(t), r = V(n, !0);
6781
6796
  D(n), D(t), H(() => pa(r, q(l))), Y(e, t);
6782
6797
  }, S = (e) => {
6783
- var r = ku(), l = Kr(r);
6784
- _u(l, {
6798
+ var r = ju(), l = Kr(r);
6799
+ yu(l, {
6785
6800
  get player() {
6786
6801
  return q(s);
6787
6802
  },
@@ -6813,14 +6828,14 @@ function Nu(e, t) {
6813
6828
  });
6814
6829
  var v = qr(l, 2), y = (e) => {
6815
6830
  let n = /* @__PURE__ */ F(() => q(s).canSubmitResponses(q(c)));
6816
- var r = Ou(), i = V(r), a = V(i, !0);
6831
+ var r = Au(), i = V(r), a = V(i, !0);
6817
6832
  D(i);
6818
6833
  var o = qr(i, 2), l = (e) => {
6819
- var n = Du(), r = V(n), i = (e) => {
6820
- var n = Tu(), r = V(n, !0);
6834
+ var n = ku(), r = V(n), i = (e) => {
6835
+ var n = Du(), r = V(n, !0);
6821
6836
  D(n), H((e) => pa(r, e), [() => t.i18n?.t("item.complete") ?? "item.complete"]), Y(e, n);
6822
6837
  }, a = (e) => {
6823
- var n = Eu(), r = V(n, !0);
6838
+ var n = Ou(), r = V(n, !0);
6824
6839
  D(n), H((e) => pa(r, e), [() => t.i18n?.t("item.attempt", { numAttempts: q(m) + 1 }) ?? `item.attempt (${q(m) + 1})`]), Y(e, n);
6825
6840
  };
6826
6841
  Da(r, (e) => {
@@ -6835,7 +6850,7 @@ function Nu(e, t) {
6835
6850
  };
6836
6851
  Da(v, (e) => {
6837
6852
  n() === "candidate" && !i() && q(o) && e(y);
6838
- }), Cu(qr(v, 2), {
6853
+ }), Tu(qr(v, 2), {
6839
6854
  get feedback() {
6840
6855
  return q(u);
6841
6856
  },
@@ -6848,7 +6863,7 @@ function Nu(e, t) {
6848
6863
  }
6849
6864
  }), Y(e, r);
6850
6865
  }, ee = (e) => {
6851
- var n = Au(), r = V(n), i = V(r, !0);
6866
+ var n = Mu(), r = V(n), i = V(r, !0);
6852
6867
  D(r), D(n), H((e) => pa(i, e), [() => t.i18n?.t("item.loading") ?? "item.loading"]), Y(e, n);
6853
6868
  };
6854
6869
  return Da(b, (e) => {
@@ -6858,16 +6873,16 @@ function Nu(e, t) {
6858
6873
  aa(["click"]);
6859
6874
  //#endregion
6860
6875
  //#region src/element-class.ts
6861
- var Pu = globalThis.HTMLElement ?? class {}, Fu = /* @__PURE__ */ new WeakMap(), Iu = /* @__PURE__ */ new WeakMap(), Lu = /* @__PURE__ */ new WeakMap(), Ru = /* @__PURE__ */ new WeakMap(), zu = /* @__PURE__ */ new WeakMap(), Bu = /* @__PURE__ */ new WeakMap(), Vu = /* @__PURE__ */ new WeakMap(), Hu = /* @__PURE__ */ new WeakMap(), Uu = /* @__PURE__ */ new WeakMap(), Wu = /* @__PURE__ */ new WeakMap(), Gu = /* @__PURE__ */ new WeakMap(), Ku = /* @__PURE__ */ new WeakMap(), qu = /* @__PURE__ */ new WeakMap(), Ju = /* @__PURE__ */ new WeakMap(), Yu = /* @__PURE__ */ new WeakMap(), Xu = /* @__PURE__ */ new WeakMap(), Zu = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakSet(), Qu = class extends Pu {
6876
+ var Iu = globalThis.HTMLElement ?? class {}, Lu = /* @__PURE__ */ new WeakMap(), Ru = /* @__PURE__ */ new WeakMap(), zu = /* @__PURE__ */ new WeakMap(), Bu = /* @__PURE__ */ new WeakMap(), Vu = /* @__PURE__ */ new WeakMap(), Hu = /* @__PURE__ */ new WeakMap(), Uu = /* @__PURE__ */ new WeakMap(), Wu = /* @__PURE__ */ new WeakMap(), Gu = /* @__PURE__ */ new WeakMap(), Ku = /* @__PURE__ */ new WeakMap(), qu = /* @__PURE__ */ new WeakMap(), Ju = /* @__PURE__ */ new WeakMap(), Yu = /* @__PURE__ */ new WeakMap(), Xu = /* @__PURE__ */ new WeakMap(), Zu = /* @__PURE__ */ new WeakMap(), Qu = /* @__PURE__ */ new WeakMap(), $u = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakSet(), ed = class extends Iu {
6862
6877
  constructor(...e) {
6863
- super(...e), Jt(this, Q), A(this, Fu, a({
6878
+ super(...e), Jt(this, Q), A(this, Lu, a({
6864
6879
  host: this,
6865
- mount: (e, t) => ma(Nu, {
6880
+ mount: (e, t) => ma(Fu, {
6866
6881
  target: e,
6867
6882
  props: t
6868
6883
  }),
6869
6884
  unmount: va
6870
- })), A(this, Iu, ""), A(this, Lu, "candidate"), A(this, Ru, !1), A(this, zu, !0), A(this, Bu, void 0), A(this, Vu, void 0), A(this, Hu, void 0), A(this, Uu, void 0), A(this, Wu, void 0), A(this, Gu, void 0), A(this, Ku, void 0), A(this, qu, void 0), A(this, Ju, void 0), A(this, Yu, void 0), A(this, Xu, void 0), A(this, Zu, void 0);
6885
+ })), A(this, Ru, ""), A(this, zu, "candidate"), A(this, Bu, !1), A(this, Vu, !0), A(this, Hu, void 0), A(this, Uu, void 0), A(this, Wu, void 0), A(this, Gu, void 0), A(this, Ku, void 0), A(this, qu, void 0), A(this, Ju, void 0), A(this, Yu, void 0), A(this, Xu, void 0), A(this, Zu, void 0), A(this, Qu, void 0), A(this, $u, void 0);
6871
6886
  }
6872
6887
  static get observedAttributes() {
6873
6888
  return [
@@ -6877,103 +6892,103 @@ var Pu = globalThis.HTMLElement ?? class {}, Fu = /* @__PURE__ */ new WeakMap(),
6877
6892
  ];
6878
6893
  }
6879
6894
  get itemXml() {
6880
- return N(Iu, this);
6895
+ return N(Ru, this);
6881
6896
  }
6882
6897
  set itemXml(e) {
6883
- M(Iu, this, e ?? ""), j(Q, this, $).call(this);
6898
+ M(Ru, this, e ?? ""), j(Q, this, $).call(this);
6884
6899
  }
6885
6900
  get role() {
6886
- return N(Lu, this);
6901
+ return N(zu, this);
6887
6902
  }
6888
6903
  set role(e) {
6889
- M(Lu, this, e ?? "candidate"), j(Q, this, $).call(this);
6904
+ M(zu, this, e ?? "candidate"), j(Q, this, $).call(this);
6890
6905
  }
6891
6906
  get disabled() {
6892
- return N(Ru, this);
6907
+ return N(Bu, this);
6893
6908
  }
6894
6909
  set disabled(e) {
6895
- M(Ru, this, !!e), j(Q, this, $).call(this);
6910
+ M(Bu, this, !!e), j(Q, this, $).call(this);
6896
6911
  }
6897
6912
  get renderItemBodyRubrics() {
6898
- return N(zu, this);
6913
+ return N(Vu, this);
6899
6914
  }
6900
6915
  set renderItemBodyRubrics(e) {
6901
- M(zu, this, e !== !1), j(Q, this, $).call(this);
6916
+ M(Vu, this, e !== !1), j(Q, this, $).call(this);
6902
6917
  }
6903
6918
  get typeset() {
6904
- return N(Bu, this);
6919
+ return N(Hu, this);
6905
6920
  }
6906
6921
  set typeset(e) {
6907
- M(Bu, this, e), j(Q, this, $).call(this);
6922
+ M(Hu, this, e), j(Q, this, $).call(this);
6908
6923
  }
6909
6924
  get i18n() {
6910
- return N(Vu, this);
6925
+ return N(Uu, this);
6911
6926
  }
6912
6927
  set i18n(e) {
6913
- M(Vu, this, e), j(Q, this, $).call(this);
6928
+ M(Uu, this, e), j(Q, this, $).call(this);
6914
6929
  }
6915
6930
  get security() {
6916
- return N(Hu, this);
6931
+ return N(Wu, this);
6917
6932
  }
6918
6933
  set security(e) {
6919
- M(Hu, this, e), j(Q, this, $).call(this);
6934
+ M(Wu, this, e), j(Q, this, $).call(this);
6920
6935
  }
6921
6936
  get pnp() {
6922
- return N(Uu, this);
6937
+ return N(Gu, this);
6923
6938
  }
6924
6939
  set pnp(e) {
6925
- M(Uu, this, e), j(Q, this, $).call(this);
6940
+ M(Gu, this, e), j(Q, this, $).call(this);
6926
6941
  }
6927
6942
  get deliveryContext() {
6928
- return N(Wu, this);
6943
+ return N(Ku, this);
6929
6944
  }
6930
6945
  set deliveryContext(e) {
6931
- M(Wu, this, e), j(Q, this, $).call(this);
6946
+ M(Ku, this, e), j(Q, this, $).call(this);
6932
6947
  }
6933
6948
  get pci() {
6934
- return N(qu, this);
6949
+ return N(Yu, this);
6935
6950
  }
6936
6951
  set pci(e) {
6937
- M(qu, this, e), j(Q, this, $).call(this);
6952
+ M(Yu, this, e), j(Q, this, $).call(this);
6938
6953
  }
6939
6954
  get resolveProcessingFragment() {
6940
- return N(Gu, this);
6955
+ return N(qu, this);
6941
6956
  }
6942
6957
  set resolveProcessingFragment(e) {
6943
- M(Gu, this, e), j(Q, this, $).call(this);
6958
+ M(qu, this, e), j(Q, this, $).call(this);
6944
6959
  }
6945
6960
  get processingFragmentLimits() {
6946
- return N(Ku, this);
6961
+ return N(Ju, this);
6947
6962
  }
6948
6963
  set processingFragmentLimits(e) {
6949
- M(Ku, this, e), j(Q, this, $).call(this);
6964
+ M(Ju, this, e), j(Q, this, $).call(this);
6950
6965
  }
6951
6966
  get responses() {
6952
- return N(Ju, this);
6967
+ return N(Xu, this);
6953
6968
  }
6954
6969
  set responses(e) {
6955
- M(Ju, this, e ? { ...e } : void 0), j(Q, this, $).call(this);
6970
+ M(Xu, this, e ? { ...e } : void 0), j(Q, this, $).call(this);
6956
6971
  }
6957
6972
  get onResponseChange() {
6958
- return N(Yu, this);
6973
+ return N(Zu, this);
6959
6974
  }
6960
6975
  set onResponseChange(e) {
6961
- M(Yu, this, e);
6976
+ M(Zu, this, e);
6962
6977
  }
6963
6978
  get onSubmit() {
6964
- return N(Xu, this);
6979
+ return N(Qu, this);
6965
6980
  }
6966
6981
  set onSubmit(e) {
6967
- M(Xu, this, e), j(Q, this, $).call(this);
6982
+ M(Qu, this, e), j(Q, this, $).call(this);
6968
6983
  }
6969
6984
  get onComplete() {
6970
- return N(Zu, this);
6985
+ return N($u, this);
6971
6986
  }
6972
6987
  set onComplete(e) {
6973
- M(Zu, this, e);
6988
+ M($u, this, e);
6974
6989
  }
6975
6990
  connectedCallback() {
6976
- N(Fu, this).mountOrUpdate(j(Q, this, $u).call(this)), queueMicrotask(() => {
6991
+ N(Lu, this).mountOrUpdate(j(Q, this, td).call(this)), queueMicrotask(() => {
6977
6992
  this.isConnected && this.dispatchEvent(new CustomEvent("ready", {
6978
6993
  bubbles: !0,
6979
6994
  composed: !0
@@ -6981,45 +6996,45 @@ var Pu = globalThis.HTMLElement ?? class {}, Fu = /* @__PURE__ */ new WeakMap(),
6981
6996
  });
6982
6997
  }
6983
6998
  disconnectedCallback() {
6984
- N(Fu, this).teardown({ removeContainer: !0 });
6999
+ N(Lu, this).teardown({ removeContainer: !0 });
6985
7000
  }
6986
7001
  attributeChangedCallback(e, t, n) {
6987
- e === "item-xml" ? M(Iu, this, n ?? "") : e === "role" ? M(Lu, this, n ?? "candidate") : e === "disabled" && M(Ru, this, n !== null), j(Q, this, $).call(this);
7002
+ e === "item-xml" ? M(Ru, this, n ?? "") : e === "role" ? M(zu, this, n ?? "candidate") : e === "disabled" && M(Bu, this, n !== null), j(Q, this, $).call(this);
6988
7003
  }
6989
7004
  submit(e = !0) {
6990
- return N(Fu, this).instance?.submit(e);
7005
+ return N(Lu, this).instance?.submit(e);
6991
7006
  }
6992
7007
  addEventListener(e, t, n) {
6993
7008
  super.addEventListener(e, t, n);
6994
7009
  }
6995
7010
  };
6996
- function $u() {
7011
+ function td() {
6997
7012
  return {
6998
- itemXml: N(Iu, this),
6999
- role: N(Lu, this),
7000
- disabled: N(Ru, this),
7001
- renderItemBodyRubrics: N(zu, this),
7002
- typeset: N(Bu, this),
7003
- i18n: N(Vu, this),
7013
+ itemXml: N(Ru, this),
7014
+ role: N(zu, this),
7015
+ disabled: N(Bu, this),
7016
+ renderItemBodyRubrics: N(Vu, this),
7017
+ typeset: N(Hu, this),
7018
+ i18n: N(Uu, this),
7004
7019
  security: {
7005
- ...N(Hu, this) ?? {},
7020
+ ...N(Wu, this) ?? {},
7006
7021
  parsingLimits: {
7007
7022
  enabled: !0,
7008
- ...N(Hu, this)?.parsingLimits ?? {}
7023
+ ...N(Wu, this)?.parsingLimits ?? {}
7009
7024
  }
7010
7025
  },
7011
- pnp: N(Uu, this),
7012
- deliveryContext: N(Wu, this),
7013
- resolveProcessingFragment: N(Gu, this),
7014
- processingFragmentLimits: N(Ku, this),
7015
- pci: N(qu, this),
7016
- responses: N(Ju, this),
7026
+ pnp: N(Gu, this),
7027
+ deliveryContext: N(Ku, this),
7028
+ resolveProcessingFragment: N(qu, this),
7029
+ processingFragmentLimits: N(Ju, this),
7030
+ pci: N(Yu, this),
7031
+ responses: N(Xu, this),
7017
7032
  onResponseChange: (e, t) => {
7018
7033
  let n = {
7019
- ...N(Ju, this) ?? {},
7034
+ ...N(Xu, this) ?? {},
7020
7035
  [e]: t
7021
7036
  };
7022
- M(Ju, this, n), N(Yu, this)?.call(this, e, t), this.dispatchEvent(new CustomEvent("response-change", {
7037
+ M(Xu, this, n), N(Zu, this)?.call(this, e, t), this.dispatchEvent(new CustomEvent("response-change", {
7023
7038
  detail: {
7024
7039
  responseId: e,
7025
7040
  value: t,
@@ -7031,7 +7046,7 @@ function $u() {
7031
7046
  },
7032
7047
  onSubmit: (e, t) => {
7033
7048
  let n = { ...e };
7034
- M(Ju, this, n), N(Xu, this)?.call(this, n, t), this.dispatchEvent(new CustomEvent("submit", {
7049
+ M(Xu, this, n), N(Qu, this)?.call(this, n, t), this.dispatchEvent(new CustomEvent("submit", {
7035
7050
  detail: {
7036
7051
  responses: n,
7037
7052
  result: t
@@ -7040,9 +7055,9 @@ function $u() {
7040
7055
  composed: !0
7041
7056
  }));
7042
7057
  },
7043
- showSubmit: !!N(Xu, this),
7058
+ showSubmit: !!N(Qu, this),
7044
7059
  onComplete: (e) => {
7045
- N(Zu, this)?.call(this, e), this.dispatchEvent(new CustomEvent("complete", {
7060
+ N($u, this)?.call(this, e), this.dispatchEvent(new CustomEvent("complete", {
7046
7061
  detail: { result: e },
7047
7062
  bubbles: !0,
7048
7063
  composed: !0
@@ -7051,9 +7066,9 @@ function $u() {
7051
7066
  };
7052
7067
  }
7053
7068
  function $() {
7054
- N(Fu, this).update(j(Q, this, $u).call(this));
7069
+ N(Lu, this).update(j(Q, this, td).call(this));
7055
7070
  }
7056
7071
  //#endregion
7057
- export { Qu as t };
7072
+ export { ed as t };
7058
7073
 
7059
- //# sourceMappingURL=element-class-C8OTgYHE.js.map
7074
+ //# sourceMappingURL=element-class-BEpwHdcP.js.map