@learnosity/lib-qti-converter 0.16.1 → 0.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/package.json +9 -9
  2. package/packages/cli/dist/{batchProcessors-BI6C89vy.js → batchProcessors-BGdELwug.js} +12 -12
  3. package/packages/cli/dist/{batchProcessors-BI6C89vy.js.map → batchProcessors-BGdELwug.js.map} +1 -1
  4. package/packages/cli/dist/batchWorker.js +1 -1
  5. package/packages/cli/dist/{configOutput-CJ-ryN3j.js → configOutput-DYPwNQf7.js} +1 -1
  6. package/packages/cli/dist/{configOutput-CJ-ryN3j.js.map → configOutput-DYPwNQf7.js.map} +1 -1
  7. package/packages/cli/dist/{create-prompt-m0MC0vT_.js → create-prompt-C3XKo-s3.js} +77 -34
  8. package/packages/cli/dist/create-prompt-C3XKo-s3.js.map +1 -0
  9. package/packages/cli/dist/{dist-8MaFD1oj.js → dist-D7b9-VIt.js} +8 -7
  10. package/packages/cli/dist/dist-D7b9-VIt.js.map +1 -0
  11. package/packages/cli/dist/{learnosityToQti-BDf_faIV.js → learnosityToQti-CN6KKSmF.js} +4 -4
  12. package/packages/cli/dist/{learnosityToQti-BDf_faIV.js.map → learnosityToQti-CN6KKSmF.js.map} +1 -1
  13. package/packages/cli/dist/{learnosityToQtiPackage-w-BXgsLt.js → learnosityToQtiPackage-CMOQRiCV.js} +22 -15
  14. package/packages/cli/dist/learnosityToQtiPackage-CMOQRiCV.js.map +1 -0
  15. package/packages/cli/dist/main.js +5 -5
  16. package/packages/cli/dist/{nodeFileAccess-BBS4FAK7.js → nodeFileAccess-_jRCd340.js} +2 -2
  17. package/packages/cli/dist/{nodeFileAccess-BBS4FAK7.js.map → nodeFileAccess-_jRCd340.js.map} +1 -1
  18. package/packages/cli/dist/{pathUtils-BUJJCvvp.js → pathUtils-I2bRHUwu.js} +14 -11
  19. package/packages/cli/dist/pathUtils-I2bRHUwu.js.map +1 -0
  20. package/packages/cli/dist/{qtiPackageToLearnosity-C24effmB.js → qtiPackageToLearnosity-JRb3TTyC.js} +6 -6
  21. package/packages/cli/dist/{qtiPackageToLearnosity-C24effmB.js.map → qtiPackageToLearnosity-JRb3TTyC.js.map} +1 -1
  22. package/packages/cli/dist/{qtiToLearnosity-BEOaukuf.js → qtiToLearnosity-C-jQYKqR.js} +5 -5
  23. package/packages/cli/dist/{qtiToLearnosity-BEOaukuf.js.map → qtiToLearnosity-C-jQYKqR.js.map} +1 -1
  24. package/packages/cli/dist/{resolveOptions-l0Hpn8hY.js → resolveOptions-ikupjaRQ.js} +6 -6
  25. package/packages/cli/dist/{resolveOptions-l0Hpn8hY.js.map → resolveOptions-ikupjaRQ.js.map} +1 -1
  26. package/packages/cli/dist/{rolldown-runtime-BVN1G_yT.js → rolldown-runtime-BuRBZLzk.js} +8 -6
  27. package/packages/cli/dist/{table-BkrwlSAQ.js → table-6SiZD7aK.js} +323 -326
  28. package/packages/cli/dist/table-6SiZD7aK.js.map +1 -0
  29. package/packages/core/dist/index.js +325 -332
  30. package/packages/core/dist/node.js +330 -337
  31. package/packages/cli/dist/create-prompt-m0MC0vT_.js.map +0 -1
  32. package/packages/cli/dist/dist-8MaFD1oj.js.map +0 -1
  33. package/packages/cli/dist/learnosityToQtiPackage-w-BXgsLt.js.map +0 -1
  34. package/packages/cli/dist/pathUtils-BUJJCvvp.js.map +0 -1
  35. package/packages/cli/dist/table-BkrwlSAQ.js.map +0 -1
@@ -16,12 +16,14 @@ var __exportAll = (all, flags) => {
16
16
  return flags & 2 ? target : Object.preventExtensions(target);
17
17
  };
18
18
  var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
20
- key = keys[i];
21
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
22
- get: ((k) => from[k]).bind(null, key),
23
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
24
- });
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) {
21
+ desc = __getOwnPropDesc(from, key);
22
+ __defProp(to, key, {
23
+ get: desc && desc.get && !desc.configurable ? desc.get : () => from[key],
24
+ enumerable: !desc || desc.enumerable
25
+ });
26
+ }
25
27
  }
26
28
  return to;
27
29
  };
@@ -3218,8 +3220,7 @@ function parseQuestionData(value, type, file, diagnostics) {
3218
3220
  });
3219
3221
  return null;
3220
3222
  }
3221
- const parser = QUESTION_DATA_PARSER_MAP[type];
3222
- return parser(data, file, diagnostics);
3223
+ return (0, QUESTION_DATA_PARSER_MAP[type])(data, file, diagnostics);
3223
3224
  }
3224
3225
  function _extractPaginatedContent(obj, file, diagnostics) {
3225
3226
  if (!Array.isArray(obj.pages)) {
@@ -9548,7 +9549,7 @@ const xmlEncodeRegex = /["&'<>\u0080-\uFFFF]/g;
9548
9549
  * @param code Code unit to test.
9549
9550
  */
9550
9551
  function isXmlEscapable(code) {
9551
- return code >= 128 || code >= 32 && code < 64 && (1342177476 >>> code & 1) === 1;
9552
+ return code >= 128 || code >= 32 && code < 64 && (0x500000c4 >>> code & 1) === 1;
9552
9553
  }
9553
9554
  /**
9554
9555
  * Encodes all non-ASCII characters, as well as characters not valid in XML
@@ -13301,7 +13302,7 @@ var HTMLBodyElement = class extends HTMLElement {
13301
13302
  super(ownerDocument, localName);
13302
13303
  }
13303
13304
  };
13304
- // ../../node_modules/.pnpm/cssomnom@0.1.11/node_modules/cssomnom/dist/CSSStyleDeclaration-CTvlGElf.js
13305
+ // ../../node_modules/.pnpm/cssomnom@0.1.12/node_modules/cssomnom/dist/CSSStyleDeclaration-D6HTs6vj.js
13305
13306
  /**
13306
13307
  * @license
13307
13308
  * Copyright 2026 Google LLC
@@ -15252,7 +15253,11 @@ function tryExpandCssWide(filtered, longhands, extraKeywords) {
15252
15253
  return null;
15253
15254
  }
15254
15255
  function checkUniformCssWide(serializedVals, checkVar = false) {
15255
- if (serializedVals.some((v) => CSS_WIDE_KEYWORDS$2.has(v.toLowerCase()) || checkVar && v.toLowerCase().startsWith("var("))) return serializedVals.every((v) => v.toLowerCase() === serializedVals[0].toLowerCase()) ? serializedVals[0] : null;
15256
+ if (serializedVals.some((v) => CSS_WIDE_KEYWORDS$2.has(v.toLowerCase()) || checkVar && v.toLowerCase().startsWith("var("))) {
15257
+ const firstLower = serializedVals[0].toLowerCase();
15258
+ if (!serializedVals.every((v) => v.toLowerCase() === firstLower)) return null;
15259
+ return CSS_WIDE_KEYWORDS$2.has(firstLower) ? firstLower : serializedVals[0];
15260
+ }
15256
15261
  }
15257
15262
  function expandFourSides(data) {
15258
15263
  const s0 = [data[0]];
@@ -15565,6 +15570,17 @@ function contractBackground(longhands) {
15565
15570
  const clip = longhands["background-clip"];
15566
15571
  const color = longhands["background-color"];
15567
15572
  if (!image || !position || !size || !repeat || !attachment || !origin || !clip || !color) return null;
15573
+ const wide = checkUniformCssWide([
15574
+ image,
15575
+ position,
15576
+ size,
15577
+ repeat,
15578
+ attachment,
15579
+ origin,
15580
+ clip,
15581
+ color
15582
+ ].map((v) => serialize(v).trim()));
15583
+ if (wide !== void 0) return wide;
15568
15584
  const imageLayers = splitTokensByComma(image);
15569
15585
  const positionLayers = splitTokensByComma(position);
15570
15586
  const sizeLayers = splitTokensByComma(size);
@@ -16145,7 +16161,6 @@ const FONT_OTHER_VARIANTS = [
16145
16161
  ];
16146
16162
  function contractFont(values) {
16147
16163
  for (const lh of FONT_PRIMARY_LONGHANDS) if (!values[lh]) return null;
16148
- for (const lh of FONT_OTHER_VARIANTS) if (values[lh] && serialize(values[lh]).trim().toLowerCase() !== "normal") return null;
16149
16164
  const sStyle = serialize(values["font-style"]).trim();
16150
16165
  const sCaps = serialize(values["font-variant-caps"]).trim();
16151
16166
  const sWeight = serialize(values["font-weight"]).trim();
@@ -16160,9 +16175,11 @@ function contractFont(values) {
16160
16175
  sStretch,
16161
16176
  sSize,
16162
16177
  sLineHeight,
16163
- sFamily
16178
+ sFamily,
16179
+ ...FONT_OTHER_VARIANTS.map((lh) => values[lh] ? serialize(values[lh]).trim() : sStyle)
16164
16180
  ]);
16165
16181
  if (wide !== void 0) return wide;
16182
+ for (const lh of FONT_OTHER_VARIANTS) if (values[lh] && serialize(values[lh]).trim().toLowerCase() !== "normal") return null;
16166
16183
  if (!sSize || !sFamily) return null;
16167
16184
  const parts = [];
16168
16185
  if (sStyle.toLowerCase() !== "normal") parts.push(sStyle);
@@ -16398,6 +16415,8 @@ function contractLineClamp(values) {
16398
16415
  const lines = values["max-lines"];
16399
16416
  if (!lines) return null;
16400
16417
  const sLines = serialize(lines).trim();
16418
+ const wide = checkUniformCssWide([sLines, ...[values["block-ellipsis"], values["continue"]].filter(Boolean).map((v) => serialize(v).trim())]);
16419
+ if (wide !== void 0) return wide;
16401
16420
  return sLines.toLowerCase() === "none" ? "none" : sLines;
16402
16421
  }
16403
16422
  const BORDER_RADIUS_PHYSICAL = [
@@ -17776,8 +17795,7 @@ function getFirstToken(node) {
17776
17795
  function getLastToken(node) {
17777
17796
  if (typeof node !== "object" || node === null) return null;
17778
17797
  if (node.type === "simple-block") {
17779
- const start = node.associatedToken?.value;
17780
- const end = getMirrorToken(start);
17798
+ const end = getMirrorToken(node.associatedToken?.value);
17781
17799
  return {
17782
17800
  type: end || ")",
17783
17801
  value: end
@@ -19608,11 +19626,18 @@ var CSSStyleRule = class CSSStyleRule extends CSSGroupingRule {
19608
19626
  const defaultNamespacePrefixes = /* @__PURE__ */ new Set();
19609
19627
  const sheet = this.parentStyleSheet || (this.parentRule ? findParentStyleSheet(this.parentRule) : null);
19610
19628
  if (sheet) {
19611
- const nsRules = Array.from(sheet.cssRules).filter((r) => r.type === 10);
19612
- const defaultNs = nsRules.find((ns) => ns.prefix === "");
19613
- if (defaultNs) {
19614
- hasDefaultNamespace = true;
19615
- for (const ns of nsRules) if (ns.namespaceURI === defaultNs.namespaceURI && ns.prefix !== "") defaultNamespacePrefixes.add(ns.prefix);
19629
+ const nsRules = [];
19630
+ for (const r of sheet._rules) {
19631
+ if (isImportRule(r)) continue;
19632
+ if (isNamespaceRule(r)) nsRules.push(r);
19633
+ else break;
19634
+ }
19635
+ if (nsRules.length > 0) {
19636
+ const defaultNs = nsRules.find((ns) => ns.prefix === "");
19637
+ if (defaultNs) {
19638
+ hasDefaultNamespace = true;
19639
+ for (const ns of nsRules) if (ns.namespaceURI === defaultNs.namespaceURI && ns.prefix !== "") defaultNamespacePrefixes.add(ns.prefix);
19640
+ }
19616
19641
  }
19617
19642
  }
19618
19643
  return {
@@ -19629,7 +19654,12 @@ var CSSStyleRule = class CSSStyleRule extends CSSGroupingRule {
19629
19654
  }
19630
19655
  set selectorText(value) {
19631
19656
  const sheet = this.parentStyleSheet || (this.parentRule ? findParentStyleSheet(this.parentRule) : null);
19632
- const declaredNamespaces = new Set(sheet ? Array.from(sheet.cssRules).filter((r) => r.type === 10).map((r) => r.prefix) : []);
19657
+ const declaredNamespaces = /* @__PURE__ */ new Set();
19658
+ if (sheet) for (const r of sheet._rules) {
19659
+ if (isImportRule(r)) continue;
19660
+ if (isNamespaceRule(r)) declaredNamespaces.add(r.prefix);
19661
+ else break;
19662
+ }
19633
19663
  const nsContext = this._getNamespaceContext();
19634
19664
  let isNested = false;
19635
19665
  let allowRelative = false;
@@ -22026,8 +22056,13 @@ CSSGroupingRule._parser = {
22026
22056
  */
22027
22057
  const CSS_WIDE_KEYWORDS = /* @__PURE__ */ new Set("inherit,initial,unset,revert,revert-layer".split(","));
22028
22058
  const LOGICAL_SHORTHANDS = /* @__PURE__ */ new Set("margin,padding,inset,scroll-margin,scroll-padding,border-width,border-style,border-color".split(","));
22059
+ const proxyToTarget = /* @__PURE__ */ new WeakMap();
22060
+ /** @internal */
22061
+ function unwrapStyle(style) {
22062
+ return proxyToTarget.get(style) ?? style;
22063
+ }
22029
22064
  function createStyleProxy(target) {
22030
- return new Proxy(target, {
22065
+ const proxy = new Proxy(target, {
22031
22066
  get(t, prop) {
22032
22067
  if (typeof prop === "string") {
22033
22068
  if (!isNaN(Number(prop))) {
@@ -22037,12 +22072,7 @@ function createStyleProxy(target) {
22037
22072
  }
22038
22073
  if (prop in t && (typeof t[prop] !== "undefined" || prop.startsWith("_"))) return t[prop];
22039
22074
  if (prop.startsWith("--")) return t._allowCustomProperties ? t.getPropertyValue(prop) : void 0;
22040
- const isCustomProp = prop.startsWith("--");
22041
- let cssProp = prop;
22042
- if (!isCustomProp) {
22043
- if (prop === "cssFloat") cssProp = "float";
22044
- else cssProp = camelToDashed(prop);
22045
- }
22075
+ const cssProp = prop === "cssFloat" ? "float" : camelToDashed(prop);
22046
22076
  if (t._isPropertySupported(cssProp)) return t.getPropertyValue(cssProp);
22047
22077
  }
22048
22078
  return t[prop];
@@ -22080,7 +22110,7 @@ function createStyleProxy(target) {
22080
22110
  const dashed = camelToDashed(prop);
22081
22111
  if (t._isPropertySupported(dashed)) return true;
22082
22112
  if (prop in SHORTHANDS) return true;
22083
- for (const s of Object.values(SHORTHANDS)) if (s.longhands.includes(prop)) return true;
22113
+ if (prop in LONGHAND_TO_SHORTHAND) return true;
22084
22114
  }
22085
22115
  return Reflect.has(t, prop);
22086
22116
  },
@@ -22102,6 +22132,8 @@ function createStyleProxy(target) {
22102
22132
  } : void 0;
22103
22133
  }
22104
22134
  });
22135
+ proxyToTarget.set(proxy, target);
22136
+ return proxy;
22105
22137
  }
22106
22138
  var CSSStyleDeclaration = class extends CSSStyleProperties {
22107
22139
  /** @internal */ _declarations;
@@ -22131,6 +22163,10 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22131
22163
  get _allowImportant() {
22132
22164
  return true;
22133
22165
  }
22166
+ /** @internal */
22167
+ get _useDirectDeclMap() {
22168
+ return true;
22169
+ }
22134
22170
  constructor(parentRuleOrDeclarations, onChangeOrReadonly) {
22135
22171
  super();
22136
22172
  this._declarations = [];
@@ -22146,57 +22182,54 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22146
22182
  this._readonly = typeof onChangeOrReadonly === "boolean" ? onChangeOrReadonly : false;
22147
22183
  if (typeof onChangeOrReadonly === "function") this._onChange = onChangeOrReadonly;
22148
22184
  }
22149
- const addDeclarationRecursive = (decl, isTopLevel = false) => {
22150
- if (decl.name === "--") return;
22151
- if (decl.important && !this._allowImportant) return;
22152
- const normalizedName = decl.name.startsWith("--") ? decl.name : decl.name.toLowerCase();
22153
- if (normalizedName.startsWith("--") && !this._allowCustomProperties) return;
22154
- if (this._filterDeclarationsInConstructor && !normalizedName.startsWith("--") && !this._isPropertySupported(normalizedName)) return;
22155
- decl.name = normalizedName;
22156
- if (isTopLevel) this._rawDeclarations.push(decl);
22157
- const shorthand = SHORTHANDS[decl.name];
22158
- if (shorthand) {
22159
- if (!(serialize(decl.value).includes("var(") || serialize(decl.value).includes("env("))) {
22160
- const expanded = shorthand.expand(decl.value);
22161
- if (expanded) {
22162
- for (const [lh, val] of Object.entries(expanded)) addDeclarationRecursive({
22163
- type: "declaration",
22164
- name: lh,
22165
- value: val,
22166
- important: decl.important,
22167
- fromAll: decl.name === "all" || decl.fromAll
22168
- });
22169
- return;
22170
- }
22185
+ for (const d of declarations) this._ingestDeclaration(d, this._filterDeclarationsInConstructor, true);
22186
+ return createStyleProxy(this);
22187
+ }
22188
+ _ingestDeclaration(decl, filterSupported, isTopLevel) {
22189
+ if (decl.name === "--") return;
22190
+ if (decl.important && !this._allowImportant) return;
22191
+ const normalizedName = decl.name.startsWith("--") ? decl.name : decl.name.toLowerCase();
22192
+ if (normalizedName.startsWith("--") && !this._allowCustomProperties) return;
22193
+ if (filterSupported && !normalizedName.startsWith("--") && !this._isPropertySupported(normalizedName)) return;
22194
+ decl.name = normalizedName;
22195
+ if (isTopLevel) this._rawDeclarations.push(decl);
22196
+ const shorthand = SHORTHANDS[decl.name];
22197
+ if (shorthand) {
22198
+ const ser = serialize(decl.value);
22199
+ if (!(ser.includes("var(") || ser.includes("env("))) {
22200
+ const expanded = shorthand.expand(decl.value);
22201
+ if (expanded) {
22202
+ for (const [lh, val] of Object.entries(expanded)) this._ingestDeclaration({
22203
+ type: "declaration",
22204
+ name: lh,
22205
+ value: val,
22206
+ important: decl.important,
22207
+ fromAll: decl.name === "all" || decl.fromAll
22208
+ }, filterSupported, false);
22209
+ return;
22171
22210
  }
22172
22211
  }
22173
- this._addDeclaration(decl);
22174
- };
22175
- for (const d of declarations) addDeclarationRecursive(d, true);
22176
- return createStyleProxy(this);
22212
+ }
22213
+ this._addDeclaration(decl);
22177
22214
  }
22178
22215
  _addDeclaration(d) {
22179
22216
  const shorthand = SHORTHANDS[d.name];
22180
- if (shorthand) {
22181
- for (const lh of shorthand.longhands) if (this._declMap.has(lh)) {
22182
- const existing = this._declMap.get(lh);
22183
- if (existing.important && !d.important) continue;
22217
+ if (shorthand) for (const lh of shorthand.longhands) {
22218
+ const existing = this._declMap.get(lh);
22219
+ if (existing && (!existing.important || d.important)) {
22184
22220
  const index = this._declarations.indexOf(existing);
22185
22221
  if (index !== -1) this._declarations.splice(index, 1);
22186
22222
  this._declMap.delete(lh);
22187
22223
  }
22188
22224
  }
22189
- if (this._declMap.has(d.name)) {
22190
- const existing = this._declMap.get(d.name);
22225
+ const existing = this._declMap.get(d.name);
22226
+ if (existing) {
22191
22227
  if (existing.important && !d.important) return;
22192
22228
  const index = this._declarations.indexOf(existing);
22193
22229
  if (index !== -1) this._declarations.splice(index, 1);
22194
- this._declarations.push(d);
22195
- this._declMap.set(d.name, d);
22196
- } else {
22197
- this._declarations.push(d);
22198
- this._declMap.set(d.name, d);
22199
22230
  }
22231
+ this._declarations.push(d);
22232
+ this._declMap.set(d.name, d);
22200
22233
  }
22201
22234
  get length() {
22202
22235
  return this._declarations.length;
@@ -22206,60 +22239,51 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22206
22239
  }
22207
22240
  /** @internal */
22208
22241
  _getLonghandForContraction(lh) {
22209
- const decl = this._getWinningDeclaration(lh);
22242
+ const decl = unwrapStyle(this)._getWinningDeclaration(lh);
22210
22243
  if (decl && decl.value.length > 0) return {
22211
22244
  value: decl.value,
22212
22245
  important: decl.important
22213
22246
  };
22214
22247
  return null;
22215
22248
  }
22249
+ _serializeDirectShorthand(property, shorthand) {
22250
+ const directDecl = this._getWinningDeclaration(property);
22251
+ if (directDecl) {
22252
+ const directIdx = this._declarations.indexOf(directDecl);
22253
+ const allLonghands = getShorthandAllLonghands(shorthand);
22254
+ if (this._declarations.some((d, idx) => {
22255
+ if (!allLonghands.includes(d.name)) return false;
22256
+ if (d.important && !directDecl.important) return true;
22257
+ if (d.important === directDecl.important && idx > directIdx) return true;
22258
+ return false;
22259
+ })) return "";
22260
+ return serialize(directDecl.value).trim();
22261
+ }
22262
+ return "";
22263
+ }
22216
22264
  getPropertyValue(property) {
22265
+ const self = unwrapStyle(this);
22217
22266
  if (!property.startsWith("--")) property = property.toLowerCase();
22218
22267
  else if (!isValidDashedIdent(property)) return "";
22219
- const shorthandLonghands = SHORTHANDS[property]?.longhands || SHORTHANDS_DATA[property];
22220
- if (shorthandLonghands && shorthandLonghands.length > 0) {
22221
- let allCssWide = null;
22222
- let allMatch = true;
22223
- let firstPrio = null;
22224
- let allSamePriority = true;
22225
- for (const lh of shorthandLonghands) {
22226
- const val = this.getPropertyValue(lh);
22227
- if (!val) {
22228
- allMatch = false;
22229
- break;
22230
- }
22231
- const prio = this.getPropertyPriority(lh);
22232
- if (firstPrio === null) firstPrio = prio;
22233
- else if (firstPrio !== prio) allSamePriority = false;
22234
- const trimmed = val.trim().toLowerCase();
22235
- if ([
22236
- "initial",
22237
- "inherit",
22238
- "unset",
22239
- "revert",
22240
- "revert-layer"
22241
- ].includes(trimmed)) {
22242
- if (allCssWide === null) allCssWide = trimmed;
22243
- else if (allCssWide !== trimmed) {
22244
- allMatch = false;
22245
- break;
22246
- }
22247
- } else {
22248
- allMatch = false;
22249
- break;
22250
- }
22251
- }
22252
- if (allMatch && allCssWide && allSamePriority) return allCssWide;
22253
- }
22268
+ const map = self._useDirectDeclMap ? self._declMap : null;
22254
22269
  const shorthand = SHORTHANDS[property];
22255
22270
  if (shorthand) {
22271
+ if (map && !map.has("all")) {
22272
+ const hasSubLonghands = (lh) => map.has(lh) || lh in SHORTHANDS && SHORTHANDS[lh].longhands.every((sub) => map.has(sub));
22273
+ let canContract = shorthand.longhands.every(hasSubLonghands);
22274
+ if (!canContract && shorthand.logicalLonghands) canContract = shorthand.logicalLonghands.every((lh) => map.has(lh));
22275
+ if (!canContract) {
22276
+ if (!map.has(property)) return "";
22277
+ return self._serializeDirectShorthand(property, shorthand);
22278
+ }
22279
+ }
22256
22280
  const longhandValues = {};
22257
22281
  let anySet = false;
22258
22282
  let important = null;
22259
22283
  let consistentImportant = true;
22260
22284
  const allLonghandsToCheck = getShorthandAllLonghands(shorthand);
22261
22285
  for (const lh of allLonghandsToCheck) {
22262
- const item = this._getLonghandForContraction(lh);
22286
+ const item = self._getLonghandForContraction(lh);
22263
22287
  if (item && item.value.length > 0) {
22264
22288
  anySet = true;
22265
22289
  longhandValues[lh] = item.value;
@@ -22269,26 +22293,32 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22269
22293
  }
22270
22294
  }
22271
22295
  if (anySet && consistentImportant) {
22272
- const wm = this.getPropertyValue("writing-mode") || "horizontal-tb";
22273
- const dir = this.getPropertyValue("direction") || "ltr";
22274
- const physicalToLogicalSet = /* @__PURE__ */ new Map();
22275
- for (const lh of Object.keys(longhandValues)) {
22276
- const physicalProp = resolveLogicalProperty(lh, wm, dir);
22277
- const decl = this._getWinningDeclaration(lh);
22278
- if (physicalToLogicalSet.has(physicalProp)) {
22279
- const other = physicalToLogicalSet.get(physicalProp);
22280
- if (!(decl?.name === "all" || decl?.fromAll || other.decl?.name === "all" || other.decl?.fromAll)) {
22281
- if (serialize(longhandValues[lh]).trim() !== serialize(longhandValues[other.lh]).trim()) return "";
22296
+ const lhKeys = Object.keys(longhandValues);
22297
+ const hasLogicalKey = lhKeys.some((lh) => lh in LOGICAL_MAPPING);
22298
+ let wm = "horizontal-tb";
22299
+ let dir = "ltr";
22300
+ if (hasLogicalKey) {
22301
+ wm = self.getPropertyValue("writing-mode") || "horizontal-tb";
22302
+ dir = self.getPropertyValue("direction") || "ltr";
22303
+ const physicalToLogicalSet = /* @__PURE__ */ new Map();
22304
+ for (const lh of lhKeys) {
22305
+ const physicalProp = resolveLogicalProperty(lh, wm, dir);
22306
+ const decl = self._getWinningDeclaration(lh);
22307
+ if (physicalToLogicalSet.has(physicalProp)) {
22308
+ const other = physicalToLogicalSet.get(physicalProp);
22309
+ if (!(decl?.name === "all" || decl?.fromAll || other.decl?.name === "all" || other.decl?.fromAll)) {
22310
+ if (serialize(longhandValues[lh]).trim() !== serialize(longhandValues[other.lh]).trim()) return "";
22311
+ }
22282
22312
  }
22313
+ if (decl && decl.name !== "all" && !decl.fromAll) physicalToLogicalSet.set(physicalProp, {
22314
+ lh,
22315
+ decl
22316
+ });
22317
+ else if (!physicalToLogicalSet.has(physicalProp)) physicalToLogicalSet.set(physicalProp, {
22318
+ lh,
22319
+ decl
22320
+ });
22283
22321
  }
22284
- if (decl && decl.name !== "all" && !decl.fromAll) physicalToLogicalSet.set(physicalProp, {
22285
- lh,
22286
- decl
22287
- });
22288
- else if (!physicalToLogicalSet.has(physicalProp)) physicalToLogicalSet.set(physicalProp, {
22289
- lh,
22290
- decl
22291
- });
22292
22322
  }
22293
22323
  const valuesForContractor = {};
22294
22324
  let anyLogical = false;
@@ -22297,7 +22327,7 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22297
22327
  const val = longhandValues[lh];
22298
22328
  if (val) {
22299
22329
  valuesForContractor[lh] = val;
22300
- if (resolveLogicalProperty(lh, wm, dir) !== lh) anyLogical = true;
22330
+ if (hasLogicalKey && resolveLogicalProperty(lh, wm, dir) !== lh) anyLogical = true;
22301
22331
  if (shorthand.logicalLonghands?.includes(lh)) anyLogical = true;
22302
22332
  }
22303
22333
  }
@@ -22313,21 +22343,43 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22313
22343
  return res || "";
22314
22344
  }
22315
22345
  }
22316
- const directDecl = this._getWinningDeclaration(property);
22317
- if (directDecl) {
22318
- const directIdx = this._declarations.indexOf(directDecl);
22319
- const allLonghands = getShorthandAllLonghands(shorthand);
22320
- if (this._declarations.some((d, idx) => {
22321
- if (!allLonghands.includes(d.name)) return false;
22322
- if (d.important && !directDecl.important) return true;
22323
- if (d.important === directDecl.important && idx > directIdx) return true;
22324
- return false;
22325
- })) return "";
22326
- return serialize(directDecl.value).trim();
22346
+ return self._serializeDirectShorthand(property, shorthand);
22347
+ } else if (property in SHORTHANDS_DATA) {
22348
+ const shorthandLonghands = SHORTHANDS_DATA[property];
22349
+ if (shorthandLonghands && shorthandLonghands.length > 0) {
22350
+ let allCssWide = null;
22351
+ let allMatch = true;
22352
+ let firstPrio = null;
22353
+ let allSamePriority = true;
22354
+ for (const lh of shorthandLonghands) {
22355
+ if (map && !map.has("all") && !map.has(lh) && !(lh in SHORTHANDS) && !(lh in SHORTHANDS_DATA)) {
22356
+ allMatch = false;
22357
+ break;
22358
+ }
22359
+ const val = self.getPropertyValue(lh);
22360
+ if (!val) {
22361
+ allMatch = false;
22362
+ break;
22363
+ }
22364
+ const trimmed = val.trim().toLowerCase();
22365
+ if (CSS_WIDE_KEYWORDS.has(trimmed)) {
22366
+ const prio = self.getPropertyPriority(lh);
22367
+ if (firstPrio === null) firstPrio = prio;
22368
+ else if (firstPrio !== prio) allSamePriority = false;
22369
+ if (allCssWide === null) allCssWide = trimmed;
22370
+ else if (allCssWide !== trimmed) {
22371
+ allMatch = false;
22372
+ break;
22373
+ }
22374
+ } else {
22375
+ allMatch = false;
22376
+ break;
22377
+ }
22378
+ }
22379
+ if (allMatch && allCssWide && allSamePriority) return allCssWide;
22327
22380
  }
22328
- return "";
22329
22381
  }
22330
- const winner = this._getWinningDeclaration(property);
22382
+ const winner = self._getWinningDeclaration(property);
22331
22383
  if (winner) {
22332
22384
  if (winner.name === "all") return serialize(winner.value);
22333
22385
  const isCustom = winner.name.startsWith("--");
@@ -22345,47 +22397,45 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22345
22397
  }
22346
22398
  /** @internal */
22347
22399
  _getExactWinningDeclaration(property) {
22400
+ const self = unwrapStyle(this);
22348
22401
  if (!property.startsWith("--")) property = property.toLowerCase();
22349
- const isCoveredByAll = !property.startsWith("--") && property !== "direction" && property !== "unicode-bidi" && property !== "all";
22350
- let winner = null;
22351
- for (let i = this._declarations.length - 1; i >= 0; i--) {
22352
- const d = this._declarations[i];
22353
- const isMatch = d.name === property;
22354
- const isAll = d.name === "all" && isCoveredByAll;
22355
- if (isMatch || isAll) {
22356
- if (!winner || d.important && !winner.important) {
22357
- winner = d;
22358
- if (winner.important) break;
22359
- }
22360
- }
22361
- }
22362
- return winner;
22402
+ const exact = self._declMap.get(property);
22403
+ const allDecl = !property.startsWith("--") && property !== "direction" && property !== "unicode-bidi" && property !== "all" ? self._declMap.get("all") : void 0;
22404
+ if (!allDecl) return exact ?? null;
22405
+ if (!exact) return allDecl;
22406
+ if (exact.important !== allDecl.important) return exact.important ? exact : allDecl;
22407
+ return self._declarations.indexOf(allDecl) > self._declarations.indexOf(exact) ? allDecl : exact;
22363
22408
  }
22364
22409
  /** @internal */
22365
22410
  _getWinningDeclaration(property) {
22366
- const exact = this._getExactWinningDeclaration(property);
22411
+ const self = unwrapStyle(this);
22412
+ const exact = self._getExactWinningDeclaration(property);
22413
+ if (!exact) return null;
22367
22414
  const shorthands = LONGHAND_TO_SHORTHAND[property];
22368
- if (shorthands) for (const sh of shorthands) {
22369
- const shDecl = this._getExactWinningDeclaration(sh);
22370
- if (shDecl) {
22371
- if (shDecl.important && (!exact || !exact.important)) return null;
22372
- if (exact && !exact.important && !shDecl.important) {
22373
- if (this._declarations.indexOf(shDecl) > this._declarations.indexOf(exact)) return null;
22415
+ if (shorthands && !exact.important) {
22416
+ let exactIdx = -1;
22417
+ for (const sh of shorthands) {
22418
+ const shDecl = self._declMap.get(sh);
22419
+ if (shDecl) {
22420
+ if (shDecl.important) return null;
22421
+ if (exactIdx === -1) exactIdx = self._declarations.indexOf(exact);
22422
+ if (self._declarations.indexOf(shDecl) > exactIdx) return null;
22374
22423
  }
22375
22424
  }
22376
22425
  }
22377
22426
  return exact;
22378
22427
  }
22379
22428
  getPropertyPriority(property) {
22429
+ const self = unwrapStyle(this);
22380
22430
  if (!property.startsWith("--")) property = property.toLowerCase();
22381
22431
  const shorthand = SHORTHANDS[property];
22382
22432
  if (shorthand) {
22383
- if (this.getPropertyValue(property) === "") return "";
22433
+ if (self.getPropertyValue(property) === "") return "";
22384
22434
  const checkSet = (longhands) => {
22385
22435
  let importantCount = 0;
22386
22436
  const values = {};
22387
22437
  for (const lh of longhands) {
22388
- const item = this._getLonghandForContraction(lh);
22438
+ const item = self._getLonghandForContraction(lh);
22389
22439
  if (item && item.value.length > 0) {
22390
22440
  values[lh] = item.value;
22391
22441
  if (item.important) importantCount++;
@@ -22396,27 +22446,19 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22396
22446
  values
22397
22447
  };
22398
22448
  };
22399
- const primaryResult = checkSet(shorthand.longhands);
22400
- if (primaryResult.importantCount === shorthand.longhands.length && shorthand.longhands.length > 0) {
22401
- if (shorthand.contract(primaryResult.values)) return "important";
22402
- }
22403
- if (shorthand.logicalLonghands) {
22404
- const logicalResult = checkSet(shorthand.logicalLonghands);
22405
- if (logicalResult.importantCount === shorthand.logicalLonghands.length && shorthand.logicalLonghands.length > 0) {
22406
- if (shorthand.contract(logicalResult.values)) return "important";
22407
- }
22408
- }
22409
- if (shorthand.physicalLonghands) {
22410
- const physicalResult = checkSet(shorthand.physicalLonghands);
22411
- if (physicalResult.importantCount === shorthand.physicalLonghands.length && shorthand.physicalLonghands.length > 0) {
22412
- if (shorthand.contract(physicalResult.values)) return "important";
22413
- }
22414
- }
22415
- const directDecl = this._getWinningDeclaration(property);
22449
+ for (const set of [
22450
+ shorthand.longhands,
22451
+ shorthand.logicalLonghands,
22452
+ shorthand.physicalLonghands
22453
+ ]) if (set && set.length > 0) {
22454
+ const res = checkSet(set);
22455
+ if (res.importantCount === set.length && shorthand.contract(res.values)) return "important";
22456
+ }
22457
+ const directDecl = self._getWinningDeclaration(property);
22416
22458
  if (directDecl && directDecl.important) return "important";
22417
22459
  return "";
22418
22460
  }
22419
- const winner = this._getWinningDeclaration(property);
22461
+ const winner = self._getWinningDeclaration(property);
22420
22462
  return winner && winner.important ? "important" : "";
22421
22463
  }
22422
22464
  setProperty(property, value, priority = "") {
@@ -22439,23 +22481,19 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22439
22481
  }
22440
22482
  if (value === void 0 && !property.startsWith("--") && !CUSTOM_IDENT_PROPERTIES.has(property)) return;
22441
22483
  const valueStr = typeof value === "string" ? value : String(value);
22442
- if (property.startsWith("--")) {
22443
- if (!isValidDashedIdent(property)) return;
22444
- const tokens = tokenize(valueStr);
22445
- if (tokens.some((t) => t.type === "bad-string" || t.type === "bad-url")) return;
22446
- if (!validateCustomPropertyValue(parseComponentValues(tokens))) return;
22447
- }
22448
22484
  const tokens = tokenize(valueStr, property === "unicode-range");
22449
22485
  if (tokens.some((t) => t.type === "bad-string" || t.type === "bad-url")) return;
22450
- if (property === "all") {
22451
- this._declarations = this._declarations.filter((d) => d.name !== "all");
22452
- this._declMap.delete("all");
22453
- }
22454
22486
  const compVals = parseComponentValues(tokens);
22455
- if (!property.startsWith("--")) {
22487
+ if (property.startsWith("--")) {
22488
+ if (!isValidDashedIdent(property) || !validateCustomPropertyValue(compVals)) return;
22489
+ } else {
22456
22490
  if (!validateDeclarationValue(compVals)) return;
22457
22491
  if (ParseHooks.validatePropertyValue && !ParseHooks.validatePropertyValue(property, valueStr, value)) return;
22458
22492
  }
22493
+ if (property === "all") {
22494
+ this._declarations = this._declarations.filter((d) => d.name !== "all");
22495
+ this._declMap.delete("all");
22496
+ }
22459
22497
  const shorthand = SHORTHANDS[property];
22460
22498
  if (shorthand) {
22461
22499
  const hasVar = valueStr.includes("var(") || valueStr.includes("env(");
@@ -22484,14 +22522,13 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22484
22522
  else if (!shorthand.stub) return;
22485
22523
  }
22486
22524
  const existing = this._declMap.get(property);
22487
- const componentValues = parseComponentValues(tokens);
22488
22525
  if (property === "unicode-range") {
22489
- const assembled = assembleUnicodeRanges(componentValues);
22526
+ const assembled = assembleUnicodeRanges(compVals);
22490
22527
  if (!assembled) return;
22491
- componentValues.splice(0, componentValues.length, ...assembled);
22528
+ compVals.splice(0, compVals.length, ...assembled);
22492
22529
  }
22493
22530
  if (existing) {
22494
- existing.value = componentValues;
22531
+ existing.value = compVals;
22495
22532
  existing.important = isImportant;
22496
22533
  existing.fromAll = fromAll;
22497
22534
  if (property.startsWith("--")) existing.raw = valueStr ?? void 0;
@@ -22512,7 +22549,7 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22512
22549
  const decl = {
22513
22550
  type: "declaration",
22514
22551
  name: property,
22515
- value: componentValues,
22552
+ value: compVals,
22516
22553
  important: isImportant,
22517
22554
  fromAll: fromAll || void 0,
22518
22555
  raw: property.startsWith("--") ? valueStr ?? void 0 : void 0
@@ -22525,7 +22562,7 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22525
22562
  this._rawDeclarations.push({
22526
22563
  type: "declaration",
22527
22564
  name: property,
22528
- value: componentValues,
22565
+ value: compVals,
22529
22566
  important: isImportant,
22530
22567
  raw: property.startsWith("--") ? valueStr ?? void 0 : void 0
22531
22568
  });
@@ -22537,52 +22574,40 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22537
22574
  if (!property.startsWith("--")) property = property.toLowerCase();
22538
22575
  if (property === "all") {
22539
22576
  const value = this.getPropertyValue("all");
22540
- let changed = false;
22541
- this._rawDeclarations = this._rawDeclarations.filter((d) => d.name === "direction" || d.name === "unicode-bidi" || d.name.startsWith("--"));
22542
- for (let i = this._declarations.length - 1; i >= 0; i--) {
22543
- const d = this._declarations[i];
22544
- if (d.name !== "direction" && d.name !== "unicode-bidi" && !d.name.startsWith("--")) {
22545
- this._declarations.splice(i, 1);
22577
+ const isRetained = (name) => name === "direction" || name === "unicode-bidi" || name.startsWith("--");
22578
+ const prevLen = this._declarations.length;
22579
+ this._rawDeclarations = this._rawDeclarations.filter((d) => isRetained(d.name));
22580
+ this._declarations = this._declarations.filter((d) => {
22581
+ if (!isRetained(d.name)) {
22546
22582
  this._declMap.delete(d.name);
22547
- changed = true;
22583
+ return false;
22548
22584
  }
22549
- }
22550
- if (changed) this._onChange?.();
22585
+ return true;
22586
+ });
22587
+ if (this._declarations.length !== prevLen) this._onChange?.();
22551
22588
  return value;
22552
22589
  }
22553
22590
  const shorthand = SHORTHANDS[property];
22554
- if (shorthand) {
22555
- const value = this.getPropertyValue(property);
22556
- const allLh = shorthand.logicalLonghands ? [...shorthand.longhands, ...shorthand.logicalLonghands] : shorthand.longhands;
22557
- this._rawDeclarations = this._rawDeclarations.filter((d) => d.name !== property && !allLh.includes(d.name));
22558
- let changed = false;
22559
- for (const lh of allLh) if (this._declMap.has(lh)) {
22560
- const index = this._declarations.findIndex((d) => d.name === lh);
22561
- if (index !== -1) {
22562
- this._declarations.splice(index, 1);
22563
- this._declMap.delete(lh);
22564
- changed = true;
22565
- }
22566
- }
22567
- const index = this._declarations.findIndex((d) => d.name === property);
22568
- if (index !== -1) {
22569
- this._declarations.splice(index, 1);
22570
- this._declMap.delete(property);
22591
+ const propsToRemove = shorthand ? [
22592
+ property,
22593
+ ...shorthand.longhands,
22594
+ ...shorthand.logicalLonghands ?? []
22595
+ ] : [property];
22596
+ const value = this.getPropertyValue(property);
22597
+ const removeSet = new Set(propsToRemove);
22598
+ this._rawDeclarations = this._rawDeclarations.filter((d) => !removeSet.has(d.name));
22599
+ let changed = false;
22600
+ for (const p of propsToRemove) {
22601
+ const decl = this._declMap.get(p);
22602
+ if (decl) {
22603
+ const idx = this._declarations.indexOf(decl);
22604
+ if (idx !== -1) this._declarations.splice(idx, 1);
22605
+ this._declMap.delete(p);
22571
22606
  changed = true;
22572
22607
  }
22573
- if (changed) this._onChange?.();
22574
- return value;
22575
22608
  }
22576
- const value = this.getPropertyValue(property);
22577
- this._rawDeclarations = this._rawDeclarations.filter((d) => d.name !== property);
22578
- const index = this._declarations.findIndex((d) => d.name === property);
22579
- if (index !== -1) {
22580
- this._declarations.splice(index, 1);
22581
- this._declMap.delete(property);
22582
- this._onChange?.();
22583
- return value;
22584
- }
22585
- return "";
22609
+ if (changed) this._onChange?.();
22610
+ return value;
22586
22611
  }
22587
22612
  get cssText() {
22588
22613
  if (this._declarations.length === 0) return "";
@@ -22604,31 +22629,7 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22604
22629
  return this._isPropertySupported(d.name.toLowerCase());
22605
22630
  });
22606
22631
  this._declMap.clear();
22607
- for (const d of newStyle._declarations) {
22608
- if (d.name === "--") continue;
22609
- if (d.important && !this._allowImportant) continue;
22610
- const normalizedName = d.name.startsWith("--") ? d.name : d.name.toLowerCase();
22611
- if (normalizedName.startsWith("--") && !this._allowCustomProperties) continue;
22612
- if (!normalizedName.startsWith("--") && !this._isPropertySupported(normalizedName)) continue;
22613
- d.name = normalizedName;
22614
- const shorthand = SHORTHANDS[d.name];
22615
- if (shorthand) {
22616
- if (!(serialize(d.value).includes("var(") || serialize(d.value).includes("env("))) {
22617
- const expanded = shorthand.expand(d.value);
22618
- if (expanded) {
22619
- for (const [lh, val] of Object.entries(expanded)) this._addDeclaration({
22620
- type: "declaration",
22621
- name: lh,
22622
- value: val,
22623
- important: d.important,
22624
- fromAll: d.name === "all" || d.fromAll
22625
- });
22626
- continue;
22627
- }
22628
- }
22629
- }
22630
- this._addDeclaration(d);
22631
- }
22632
+ for (const d of newStyle._declarations) this._ingestDeclaration(d, true, false);
22632
22633
  return true;
22633
22634
  }
22634
22635
  set cssText(value) {
@@ -22689,10 +22690,7 @@ function defineDescriptorProperties(proto, dashedProps, skip) {
22689
22690
  configurable: true
22690
22691
  };
22691
22692
  Object.defineProperty(proto, cssProp, desc);
22692
- if (cssProp.includes("-")) {
22693
- const camelProp = cssProp.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
22694
- Object.defineProperty(proto, camelProp, desc);
22695
- }
22693
+ if (cssProp.includes("-")) Object.defineProperty(proto, cssProp.replace(/-([a-z])/g, (_, c) => c.toUpperCase()), desc);
22696
22694
  }
22697
22695
  }
22698
22696
  defineDescriptorProperties(CSSPageDescriptors.prototype, PAGE_DESCRIPTOR_PROPERTIES);
@@ -28402,7 +28400,7 @@ function mapImageclozeassociationV2ToGraphicGapMatch(question, questionRef, diag
28402
28400
  * question's folder distinct while staying deterministic.
28403
28401
  */
28404
28402
  function gapTileFolder(questionRef) {
28405
- let hash = 2166136261;
28403
+ let hash = 0x811c9dc5;
28406
28404
  for (let i = 0; i < questionRef.length; i++) {
28407
28405
  hash ^= questionRef.charCodeAt(i);
28408
28406
  hash = Math.imul(hash, 16777619) >>> 0;
@@ -29042,11 +29040,7 @@ function mapMultiWidgetItem(model, diagnostics) {
29042
29040
  });
29043
29041
  }
29044
29042
  let responseProcessing;
29045
- if (model.questions.length === 1 && interactions.length === 1) {
29046
- const question = model.questions[0];
29047
- const interaction = interactions[0];
29048
- responseProcessing = determineResponseProcessingStrategy(question, hasInteractionCorrectResponse(interaction));
29049
- }
29043
+ if (model.questions.length === 1 && interactions.length === 1) responseProcessing = determineResponseProcessingStrategy(model.questions[0], hasInteractionCorrectResponse(interactions[0]));
29050
29044
  let instructorStimulus;
29051
29045
  if (model.questions.length === 1) {
29052
29046
  const question = model.questions[0];
@@ -29132,8 +29126,7 @@ function mapChoicematrixToMultipleChoiceInteractions(question, questionRef, diag
29132
29126
  }
29133
29127
  const interactions = [];
29134
29128
  for (let stemIndex = 0; stemIndex < data.stems.length; stemIndex++) {
29135
- const stem = data.stems[stemIndex];
29136
- const stemResult = sanitizeHtmlContent(stem, `questions[].data.stems[${stemIndex}]`);
29129
+ const stemResult = sanitizeHtmlContent(data.stems[stemIndex], `questions[].data.stems[${stemIndex}]`);
29137
29130
  diagnostics.push(...stemResult.diagnostics);
29138
29131
  diagnostics.push(...optionDiagnostics);
29139
29132
  const choices = optionContents.map((content, i) => ({
@@ -33543,70 +33536,70 @@ const S = [
33543
33536
  ];
33544
33537
  /** Binary-integer parts of the sines of integers (constants) — the MD5 K table. */
33545
33538
  const K = [
33546
- 3614090360,
33547
- 3905402710,
33539
+ 0xd76aa478,
33540
+ 0xe8c7b756,
33548
33541
  606105819,
33549
- 3250441966,
33550
- 4118548399,
33551
- 1200080426,
33552
- 2821735955,
33553
- 4249261313,
33554
- 1770035416,
33555
- 2336552879,
33556
- 4294925233,
33557
- 2304563134,
33558
- 1804603682,
33559
- 4254626195,
33560
- 2792965006,
33561
- 1236535329,
33562
- 4129170786,
33563
- 3225465664,
33542
+ 0xc1bdceee,
33543
+ 0xf57c0faf,
33544
+ 0x4787c62a,
33545
+ 0xa8304613,
33546
+ 0xfd469501,
33547
+ 0x698098d8,
33548
+ 0x8b44f7af,
33549
+ 0xffff5bb1,
33550
+ 0x895cd7be,
33551
+ 0x6b901122,
33552
+ 0xfd987193,
33553
+ 0xa679438e,
33554
+ 0x49b40821,
33555
+ 0xf61e2562,
33556
+ 0xc040b340,
33564
33557
  643717713,
33565
- 3921069994,
33566
- 3593408605,
33558
+ 0xe9b6c7aa,
33559
+ 0xd62f105d,
33567
33560
  38016083,
33568
- 3634488961,
33569
- 3889429448,
33561
+ 0xd8a1e681,
33562
+ 0xe7d3fbc8,
33570
33563
  568446438,
33571
- 3275163606,
33572
- 4107603335,
33573
- 1163531501,
33574
- 2850285829,
33575
- 4243563512,
33576
- 1735328473,
33577
- 2368359562,
33578
- 4294588738,
33579
- 2272392833,
33580
- 1839030562,
33581
- 4259657740,
33582
- 2763975236,
33583
- 1272893353,
33584
- 4139469664,
33585
- 3200236656,
33564
+ 0xc33707d6,
33565
+ 0xf4d50d87,
33566
+ 0x455a14ed,
33567
+ 0xa9e3e905,
33568
+ 0xfcefa3f8,
33569
+ 0x676f02d9,
33570
+ 0x8d2a4c8a,
33571
+ 0xfffa3942,
33572
+ 0x8771f681,
33573
+ 0x6d9d6122,
33574
+ 0xfde5380c,
33575
+ 0xa4beea44,
33576
+ 0x4bdecfa9,
33577
+ 0xf6bb4b60,
33578
+ 0xbebfbc70,
33586
33579
  681279174,
33587
- 3936430074,
33588
- 3572445317,
33580
+ 0xeaa127fa,
33581
+ 0xd4ef3085,
33589
33582
  76029189,
33590
- 3654602809,
33591
- 3873151461,
33583
+ 0xd9d4d039,
33584
+ 0xe6db99e5,
33592
33585
  530742520,
33593
- 3299628645,
33594
- 4096336452,
33595
- 1126891415,
33596
- 2878612391,
33597
- 4237533241,
33598
- 1700485571,
33599
- 2399980690,
33600
- 4293915773,
33601
- 2240044497,
33602
- 1873313359,
33603
- 4264355552,
33604
- 2734768916,
33605
- 1309151649,
33606
- 4149444226,
33607
- 3174756917,
33586
+ 0xc4ac5665,
33587
+ 0xf4292244,
33588
+ 0x432aff97,
33589
+ 0xab9423a7,
33590
+ 0xfc93a039,
33591
+ 0x655b59c3,
33592
+ 0x8f0ccc92,
33593
+ 0xffeff47d,
33594
+ 0x85845dd1,
33595
+ 0x6fa87e4f,
33596
+ 0xfe2ce6e0,
33597
+ 0xa3014314,
33598
+ 0x4e0811a1,
33599
+ 0xf7537e82,
33600
+ 0xbd3af235,
33608
33601
  718787259,
33609
- 3951481745
33602
+ 0xeb86d391
33610
33603
  ];
33611
33604
  const HEX$1 = Array.from({ length: 256 }, (_, i) => (i + 256).toString(16).slice(1));
33612
33605
  function leftRotate(x, c) {
@@ -33631,9 +33624,9 @@ function md5Bytes(msg) {
33631
33624
  buf[totalLen - 3] = hi >>> 8 & 255;
33632
33625
  buf[totalLen - 2] = hi >>> 16 & 255;
33633
33626
  buf[totalLen - 1] = hi >>> 24 & 255;
33634
- let a0 = 1732584193;
33635
- let b0 = 4023233417;
33636
- let c0 = 2562383102;
33627
+ let a0 = 0x67452301;
33628
+ let b0 = 0xefcdab89;
33629
+ let c0 = 0x98badcfe;
33637
33630
  let d0 = 271733878;
33638
33631
  const M = /* @__PURE__ */ new Uint32Array(16);
33639
33632
  for (let chunk = 0; chunk < totalLen; chunk += 64) {
@@ -41877,7 +41870,7 @@ var zh = function(d, b, z) {
41877
41870
  ];
41878
41871
  };
41879
41872
  var z64hs = function(d, b, l, z, sc, su, off) {
41880
- var nsc = sc == 4294967295, nsu = su == 4294967295, noff = off == 4294967295, e = b + l;
41873
+ var nsc = sc == 0xffffffff, nsu = su == 0xffffffff, noff = off == 0xffffffff, e = b + l;
41881
41874
  var nf = nsc + nsu + noff;
41882
41875
  if (z && nf) {
41883
41876
  for (; b + 4 < e; b += 4 + b2(d, b + 2)) if (b2(d, b) == 1) return [
@@ -41905,14 +41898,14 @@ var z64hs = function(d, b, l, z, sc, su, off) {
41905
41898
  function unzipSync(data, opts) {
41906
41899
  var files = {};
41907
41900
  var e = data.length - 22;
41908
- for (; b4(data, e) != 101010256; --e) if (!e || data.length - e > 65558) err(13);
41901
+ for (; b4(data, e) != 0x6054b50; --e) if (!e || data.length - e > 65558) err(13);
41909
41902
  var c = b2(data, e + 8);
41910
41903
  if (!c) return {};
41911
41904
  var o = b4(data, e + 16);
41912
- var z = b4(data, e - 20) == 117853008;
41905
+ var z = b4(data, e - 20) == 0x7064b50;
41913
41906
  if (z) {
41914
41907
  var ze = b4(data, e - 12);
41915
- z = b4(data, ze) == 101075792;
41908
+ z = b4(data, ze) == 0x6064b50;
41916
41909
  if (z) {
41917
41910
  c = b4(data, ze + 32);
41918
41911
  o = b4(data, ze + 48);
@@ -41920,7 +41913,7 @@ function unzipSync(data, opts) {
41920
41913
  }
41921
41914
  var fltr = opts && opts.filter;
41922
41915
  for (var i = 0; i < c; ++i) {
41923
- var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);
41916
+ var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], b = slzh(data, _a[5]);
41924
41917
  o = no;
41925
41918
  if (!fltr || fltr({
41926
41919
  name: fn,