@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
@@ -1,13 +1,13 @@
1
1
  import { createRequire } from "node:module";
2
- import { createRequire as createRequire$1 } from "module";
3
2
  import { closeSync, existsSync, openSync, readFileSync, readSync, realpathSync } from "fs";
4
3
  import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "path";
5
4
  import * as fs from "node:fs";
6
5
  import { existsSync as existsSync$1, readFileSync as readFileSync$1, readdirSync, statSync, writeFileSync } from "node:fs";
6
+ import { createRequire as createRequire$1 } from "module";
7
+ import { mkdir, writeFile } from "node:fs/promises";
8
+ import * as crypto from "node:crypto";
7
9
  import * as path from "node:path";
8
10
  import { join as join$1, relative as relative$1, sep as sep$1 } from "node:path";
9
- import * as crypto from "node:crypto";
10
- import { mkdir, writeFile } from "node:fs/promises";
11
11
  // \0rolldown/runtime.js
12
12
  var __create = Object.create;
13
13
  var __defProp = Object.defineProperty;
@@ -26,12 +26,14 @@ var __exportAll = (all, flags) => {
26
26
  return flags & 2 ? target : Object.preventExtensions(target);
27
27
  };
28
28
  var __copyProps = (to, from, except, desc) => {
29
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
30
- key = keys[i];
31
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
32
- get: ((k) => from[k]).bind(null, key),
33
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
34
- });
29
+ if (from && typeof from === "object" || typeof from === "function") {
30
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) {
31
+ desc = __getOwnPropDesc(from, key);
32
+ __defProp(to, key, {
33
+ get: desc && desc.get && !desc.configurable ? desc.get : () => from[key],
34
+ enumerable: !desc || desc.enumerable
35
+ });
36
+ }
35
37
  }
36
38
  return to;
37
39
  };
@@ -3225,8 +3227,7 @@ function parseQuestionData(value, type, file, diagnostics) {
3225
3227
  });
3226
3228
  return null;
3227
3229
  }
3228
- const parser = QUESTION_DATA_PARSER_MAP[type];
3229
- return parser(data, file, diagnostics);
3230
+ return (0, QUESTION_DATA_PARSER_MAP[type])(data, file, diagnostics);
3230
3231
  }
3231
3232
  function _extractPaginatedContent(obj, file, diagnostics) {
3232
3233
  if (!Array.isArray(obj.pages)) {
@@ -9555,7 +9556,7 @@ const xmlEncodeRegex = /["&'<>\u0080-\uFFFF]/g;
9555
9556
  * @param code Code unit to test.
9556
9557
  */
9557
9558
  function isXmlEscapable(code) {
9558
- return code >= 128 || code >= 32 && code < 64 && (1342177476 >>> code & 1) === 1;
9559
+ return code >= 128 || code >= 32 && code < 64 && (0x500000c4 >>> code & 1) === 1;
9559
9560
  }
9560
9561
  /**
9561
9562
  * Encodes all non-ASCII characters, as well as characters not valid in XML
@@ -13308,7 +13309,7 @@ var HTMLBodyElement = class extends HTMLElement {
13308
13309
  super(ownerDocument, localName);
13309
13310
  }
13310
13311
  };
13311
- // ../../node_modules/.pnpm/cssomnom@0.1.11/node_modules/cssomnom/dist/CSSStyleDeclaration-CTvlGElf.js
13312
+ // ../../node_modules/.pnpm/cssomnom@0.1.12/node_modules/cssomnom/dist/CSSStyleDeclaration-D6HTs6vj.js
13312
13313
  /**
13313
13314
  * @license
13314
13315
  * Copyright 2026 Google LLC
@@ -15259,7 +15260,11 @@ function tryExpandCssWide(filtered, longhands, extraKeywords) {
15259
15260
  return null;
15260
15261
  }
15261
15262
  function checkUniformCssWide(serializedVals, checkVar = false) {
15262
- 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;
15263
+ if (serializedVals.some((v) => CSS_WIDE_KEYWORDS$2.has(v.toLowerCase()) || checkVar && v.toLowerCase().startsWith("var("))) {
15264
+ const firstLower = serializedVals[0].toLowerCase();
15265
+ if (!serializedVals.every((v) => v.toLowerCase() === firstLower)) return null;
15266
+ return CSS_WIDE_KEYWORDS$2.has(firstLower) ? firstLower : serializedVals[0];
15267
+ }
15263
15268
  }
15264
15269
  function expandFourSides(data) {
15265
15270
  const s0 = [data[0]];
@@ -15572,6 +15577,17 @@ function contractBackground(longhands) {
15572
15577
  const clip = longhands["background-clip"];
15573
15578
  const color = longhands["background-color"];
15574
15579
  if (!image || !position || !size || !repeat || !attachment || !origin || !clip || !color) return null;
15580
+ const wide = checkUniformCssWide([
15581
+ image,
15582
+ position,
15583
+ size,
15584
+ repeat,
15585
+ attachment,
15586
+ origin,
15587
+ clip,
15588
+ color
15589
+ ].map((v) => serialize(v).trim()));
15590
+ if (wide !== void 0) return wide;
15575
15591
  const imageLayers = splitTokensByComma(image);
15576
15592
  const positionLayers = splitTokensByComma(position);
15577
15593
  const sizeLayers = splitTokensByComma(size);
@@ -16152,7 +16168,6 @@ const FONT_OTHER_VARIANTS = [
16152
16168
  ];
16153
16169
  function contractFont(values) {
16154
16170
  for (const lh of FONT_PRIMARY_LONGHANDS) if (!values[lh]) return null;
16155
- for (const lh of FONT_OTHER_VARIANTS) if (values[lh] && serialize(values[lh]).trim().toLowerCase() !== "normal") return null;
16156
16171
  const sStyle = serialize(values["font-style"]).trim();
16157
16172
  const sCaps = serialize(values["font-variant-caps"]).trim();
16158
16173
  const sWeight = serialize(values["font-weight"]).trim();
@@ -16167,9 +16182,11 @@ function contractFont(values) {
16167
16182
  sStretch,
16168
16183
  sSize,
16169
16184
  sLineHeight,
16170
- sFamily
16185
+ sFamily,
16186
+ ...FONT_OTHER_VARIANTS.map((lh) => values[lh] ? serialize(values[lh]).trim() : sStyle)
16171
16187
  ]);
16172
16188
  if (wide !== void 0) return wide;
16189
+ for (const lh of FONT_OTHER_VARIANTS) if (values[lh] && serialize(values[lh]).trim().toLowerCase() !== "normal") return null;
16173
16190
  if (!sSize || !sFamily) return null;
16174
16191
  const parts = [];
16175
16192
  if (sStyle.toLowerCase() !== "normal") parts.push(sStyle);
@@ -16405,6 +16422,8 @@ function contractLineClamp(values) {
16405
16422
  const lines = values["max-lines"];
16406
16423
  if (!lines) return null;
16407
16424
  const sLines = serialize(lines).trim();
16425
+ const wide = checkUniformCssWide([sLines, ...[values["block-ellipsis"], values["continue"]].filter(Boolean).map((v) => serialize(v).trim())]);
16426
+ if (wide !== void 0) return wide;
16408
16427
  return sLines.toLowerCase() === "none" ? "none" : sLines;
16409
16428
  }
16410
16429
  const BORDER_RADIUS_PHYSICAL = [
@@ -17783,8 +17802,7 @@ function getFirstToken(node) {
17783
17802
  function getLastToken(node) {
17784
17803
  if (typeof node !== "object" || node === null) return null;
17785
17804
  if (node.type === "simple-block") {
17786
- const start = node.associatedToken?.value;
17787
- const end = getMirrorToken(start);
17805
+ const end = getMirrorToken(node.associatedToken?.value);
17788
17806
  return {
17789
17807
  type: end || ")",
17790
17808
  value: end
@@ -19615,11 +19633,18 @@ var CSSStyleRule = class CSSStyleRule extends CSSGroupingRule {
19615
19633
  const defaultNamespacePrefixes = /* @__PURE__ */ new Set();
19616
19634
  const sheet = this.parentStyleSheet || (this.parentRule ? findParentStyleSheet(this.parentRule) : null);
19617
19635
  if (sheet) {
19618
- const nsRules = Array.from(sheet.cssRules).filter((r) => r.type === 10);
19619
- const defaultNs = nsRules.find((ns) => ns.prefix === "");
19620
- if (defaultNs) {
19621
- hasDefaultNamespace = true;
19622
- for (const ns of nsRules) if (ns.namespaceURI === defaultNs.namespaceURI && ns.prefix !== "") defaultNamespacePrefixes.add(ns.prefix);
19636
+ const nsRules = [];
19637
+ for (const r of sheet._rules) {
19638
+ if (isImportRule(r)) continue;
19639
+ if (isNamespaceRule(r)) nsRules.push(r);
19640
+ else break;
19641
+ }
19642
+ if (nsRules.length > 0) {
19643
+ const defaultNs = nsRules.find((ns) => ns.prefix === "");
19644
+ if (defaultNs) {
19645
+ hasDefaultNamespace = true;
19646
+ for (const ns of nsRules) if (ns.namespaceURI === defaultNs.namespaceURI && ns.prefix !== "") defaultNamespacePrefixes.add(ns.prefix);
19647
+ }
19623
19648
  }
19624
19649
  }
19625
19650
  return {
@@ -19636,7 +19661,12 @@ var CSSStyleRule = class CSSStyleRule extends CSSGroupingRule {
19636
19661
  }
19637
19662
  set selectorText(value) {
19638
19663
  const sheet = this.parentStyleSheet || (this.parentRule ? findParentStyleSheet(this.parentRule) : null);
19639
- const declaredNamespaces = new Set(sheet ? Array.from(sheet.cssRules).filter((r) => r.type === 10).map((r) => r.prefix) : []);
19664
+ const declaredNamespaces = /* @__PURE__ */ new Set();
19665
+ if (sheet) for (const r of sheet._rules) {
19666
+ if (isImportRule(r)) continue;
19667
+ if (isNamespaceRule(r)) declaredNamespaces.add(r.prefix);
19668
+ else break;
19669
+ }
19640
19670
  const nsContext = this._getNamespaceContext();
19641
19671
  let isNested = false;
19642
19672
  let allowRelative = false;
@@ -22033,8 +22063,13 @@ CSSGroupingRule._parser = {
22033
22063
  */
22034
22064
  const CSS_WIDE_KEYWORDS = /* @__PURE__ */ new Set("inherit,initial,unset,revert,revert-layer".split(","));
22035
22065
  const LOGICAL_SHORTHANDS = /* @__PURE__ */ new Set("margin,padding,inset,scroll-margin,scroll-padding,border-width,border-style,border-color".split(","));
22066
+ const proxyToTarget = /* @__PURE__ */ new WeakMap();
22067
+ /** @internal */
22068
+ function unwrapStyle(style) {
22069
+ return proxyToTarget.get(style) ?? style;
22070
+ }
22036
22071
  function createStyleProxy(target) {
22037
- return new Proxy(target, {
22072
+ const proxy = new Proxy(target, {
22038
22073
  get(t, prop) {
22039
22074
  if (typeof prop === "string") {
22040
22075
  if (!isNaN(Number(prop))) {
@@ -22044,12 +22079,7 @@ function createStyleProxy(target) {
22044
22079
  }
22045
22080
  if (prop in t && (typeof t[prop] !== "undefined" || prop.startsWith("_"))) return t[prop];
22046
22081
  if (prop.startsWith("--")) return t._allowCustomProperties ? t.getPropertyValue(prop) : void 0;
22047
- const isCustomProp = prop.startsWith("--");
22048
- let cssProp = prop;
22049
- if (!isCustomProp) {
22050
- if (prop === "cssFloat") cssProp = "float";
22051
- else cssProp = camelToDashed(prop);
22052
- }
22082
+ const cssProp = prop === "cssFloat" ? "float" : camelToDashed(prop);
22053
22083
  if (t._isPropertySupported(cssProp)) return t.getPropertyValue(cssProp);
22054
22084
  }
22055
22085
  return t[prop];
@@ -22087,7 +22117,7 @@ function createStyleProxy(target) {
22087
22117
  const dashed = camelToDashed(prop);
22088
22118
  if (t._isPropertySupported(dashed)) return true;
22089
22119
  if (prop in SHORTHANDS) return true;
22090
- for (const s of Object.values(SHORTHANDS)) if (s.longhands.includes(prop)) return true;
22120
+ if (prop in LONGHAND_TO_SHORTHAND) return true;
22091
22121
  }
22092
22122
  return Reflect.has(t, prop);
22093
22123
  },
@@ -22109,6 +22139,8 @@ function createStyleProxy(target) {
22109
22139
  } : void 0;
22110
22140
  }
22111
22141
  });
22142
+ proxyToTarget.set(proxy, target);
22143
+ return proxy;
22112
22144
  }
22113
22145
  var CSSStyleDeclaration = class extends CSSStyleProperties {
22114
22146
  /** @internal */ _declarations;
@@ -22138,6 +22170,10 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22138
22170
  get _allowImportant() {
22139
22171
  return true;
22140
22172
  }
22173
+ /** @internal */
22174
+ get _useDirectDeclMap() {
22175
+ return true;
22176
+ }
22141
22177
  constructor(parentRuleOrDeclarations, onChangeOrReadonly) {
22142
22178
  super();
22143
22179
  this._declarations = [];
@@ -22153,57 +22189,54 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22153
22189
  this._readonly = typeof onChangeOrReadonly === "boolean" ? onChangeOrReadonly : false;
22154
22190
  if (typeof onChangeOrReadonly === "function") this._onChange = onChangeOrReadonly;
22155
22191
  }
22156
- const addDeclarationRecursive = (decl, isTopLevel = false) => {
22157
- if (decl.name === "--") return;
22158
- if (decl.important && !this._allowImportant) return;
22159
- const normalizedName = decl.name.startsWith("--") ? decl.name : decl.name.toLowerCase();
22160
- if (normalizedName.startsWith("--") && !this._allowCustomProperties) return;
22161
- if (this._filterDeclarationsInConstructor && !normalizedName.startsWith("--") && !this._isPropertySupported(normalizedName)) return;
22162
- decl.name = normalizedName;
22163
- if (isTopLevel) this._rawDeclarations.push(decl);
22164
- const shorthand = SHORTHANDS[decl.name];
22165
- if (shorthand) {
22166
- if (!(serialize(decl.value).includes("var(") || serialize(decl.value).includes("env("))) {
22167
- const expanded = shorthand.expand(decl.value);
22168
- if (expanded) {
22169
- for (const [lh, val] of Object.entries(expanded)) addDeclarationRecursive({
22170
- type: "declaration",
22171
- name: lh,
22172
- value: val,
22173
- important: decl.important,
22174
- fromAll: decl.name === "all" || decl.fromAll
22175
- });
22176
- return;
22177
- }
22192
+ for (const d of declarations) this._ingestDeclaration(d, this._filterDeclarationsInConstructor, true);
22193
+ return createStyleProxy(this);
22194
+ }
22195
+ _ingestDeclaration(decl, filterSupported, isTopLevel) {
22196
+ if (decl.name === "--") return;
22197
+ if (decl.important && !this._allowImportant) return;
22198
+ const normalizedName = decl.name.startsWith("--") ? decl.name : decl.name.toLowerCase();
22199
+ if (normalizedName.startsWith("--") && !this._allowCustomProperties) return;
22200
+ if (filterSupported && !normalizedName.startsWith("--") && !this._isPropertySupported(normalizedName)) return;
22201
+ decl.name = normalizedName;
22202
+ if (isTopLevel) this._rawDeclarations.push(decl);
22203
+ const shorthand = SHORTHANDS[decl.name];
22204
+ if (shorthand) {
22205
+ const ser = serialize(decl.value);
22206
+ if (!(ser.includes("var(") || ser.includes("env("))) {
22207
+ const expanded = shorthand.expand(decl.value);
22208
+ if (expanded) {
22209
+ for (const [lh, val] of Object.entries(expanded)) this._ingestDeclaration({
22210
+ type: "declaration",
22211
+ name: lh,
22212
+ value: val,
22213
+ important: decl.important,
22214
+ fromAll: decl.name === "all" || decl.fromAll
22215
+ }, filterSupported, false);
22216
+ return;
22178
22217
  }
22179
22218
  }
22180
- this._addDeclaration(decl);
22181
- };
22182
- for (const d of declarations) addDeclarationRecursive(d, true);
22183
- return createStyleProxy(this);
22219
+ }
22220
+ this._addDeclaration(decl);
22184
22221
  }
22185
22222
  _addDeclaration(d) {
22186
22223
  const shorthand = SHORTHANDS[d.name];
22187
- if (shorthand) {
22188
- for (const lh of shorthand.longhands) if (this._declMap.has(lh)) {
22189
- const existing = this._declMap.get(lh);
22190
- if (existing.important && !d.important) continue;
22224
+ if (shorthand) for (const lh of shorthand.longhands) {
22225
+ const existing = this._declMap.get(lh);
22226
+ if (existing && (!existing.important || d.important)) {
22191
22227
  const index = this._declarations.indexOf(existing);
22192
22228
  if (index !== -1) this._declarations.splice(index, 1);
22193
22229
  this._declMap.delete(lh);
22194
22230
  }
22195
22231
  }
22196
- if (this._declMap.has(d.name)) {
22197
- const existing = this._declMap.get(d.name);
22232
+ const existing = this._declMap.get(d.name);
22233
+ if (existing) {
22198
22234
  if (existing.important && !d.important) return;
22199
22235
  const index = this._declarations.indexOf(existing);
22200
22236
  if (index !== -1) this._declarations.splice(index, 1);
22201
- this._declarations.push(d);
22202
- this._declMap.set(d.name, d);
22203
- } else {
22204
- this._declarations.push(d);
22205
- this._declMap.set(d.name, d);
22206
22237
  }
22238
+ this._declarations.push(d);
22239
+ this._declMap.set(d.name, d);
22207
22240
  }
22208
22241
  get length() {
22209
22242
  return this._declarations.length;
@@ -22213,60 +22246,51 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22213
22246
  }
22214
22247
  /** @internal */
22215
22248
  _getLonghandForContraction(lh) {
22216
- const decl = this._getWinningDeclaration(lh);
22249
+ const decl = unwrapStyle(this)._getWinningDeclaration(lh);
22217
22250
  if (decl && decl.value.length > 0) return {
22218
22251
  value: decl.value,
22219
22252
  important: decl.important
22220
22253
  };
22221
22254
  return null;
22222
22255
  }
22256
+ _serializeDirectShorthand(property, shorthand) {
22257
+ const directDecl = this._getWinningDeclaration(property);
22258
+ if (directDecl) {
22259
+ const directIdx = this._declarations.indexOf(directDecl);
22260
+ const allLonghands = getShorthandAllLonghands(shorthand);
22261
+ if (this._declarations.some((d, idx) => {
22262
+ if (!allLonghands.includes(d.name)) return false;
22263
+ if (d.important && !directDecl.important) return true;
22264
+ if (d.important === directDecl.important && idx > directIdx) return true;
22265
+ return false;
22266
+ })) return "";
22267
+ return serialize(directDecl.value).trim();
22268
+ }
22269
+ return "";
22270
+ }
22223
22271
  getPropertyValue(property) {
22272
+ const self = unwrapStyle(this);
22224
22273
  if (!property.startsWith("--")) property = property.toLowerCase();
22225
22274
  else if (!isValidDashedIdent(property)) return "";
22226
- const shorthandLonghands = SHORTHANDS[property]?.longhands || SHORTHANDS_DATA[property];
22227
- if (shorthandLonghands && shorthandLonghands.length > 0) {
22228
- let allCssWide = null;
22229
- let allMatch = true;
22230
- let firstPrio = null;
22231
- let allSamePriority = true;
22232
- for (const lh of shorthandLonghands) {
22233
- const val = this.getPropertyValue(lh);
22234
- if (!val) {
22235
- allMatch = false;
22236
- break;
22237
- }
22238
- const prio = this.getPropertyPriority(lh);
22239
- if (firstPrio === null) firstPrio = prio;
22240
- else if (firstPrio !== prio) allSamePriority = false;
22241
- const trimmed = val.trim().toLowerCase();
22242
- if ([
22243
- "initial",
22244
- "inherit",
22245
- "unset",
22246
- "revert",
22247
- "revert-layer"
22248
- ].includes(trimmed)) {
22249
- if (allCssWide === null) allCssWide = trimmed;
22250
- else if (allCssWide !== trimmed) {
22251
- allMatch = false;
22252
- break;
22253
- }
22254
- } else {
22255
- allMatch = false;
22256
- break;
22257
- }
22258
- }
22259
- if (allMatch && allCssWide && allSamePriority) return allCssWide;
22260
- }
22275
+ const map = self._useDirectDeclMap ? self._declMap : null;
22261
22276
  const shorthand = SHORTHANDS[property];
22262
22277
  if (shorthand) {
22278
+ if (map && !map.has("all")) {
22279
+ const hasSubLonghands = (lh) => map.has(lh) || lh in SHORTHANDS && SHORTHANDS[lh].longhands.every((sub) => map.has(sub));
22280
+ let canContract = shorthand.longhands.every(hasSubLonghands);
22281
+ if (!canContract && shorthand.logicalLonghands) canContract = shorthand.logicalLonghands.every((lh) => map.has(lh));
22282
+ if (!canContract) {
22283
+ if (!map.has(property)) return "";
22284
+ return self._serializeDirectShorthand(property, shorthand);
22285
+ }
22286
+ }
22263
22287
  const longhandValues = {};
22264
22288
  let anySet = false;
22265
22289
  let important = null;
22266
22290
  let consistentImportant = true;
22267
22291
  const allLonghandsToCheck = getShorthandAllLonghands(shorthand);
22268
22292
  for (const lh of allLonghandsToCheck) {
22269
- const item = this._getLonghandForContraction(lh);
22293
+ const item = self._getLonghandForContraction(lh);
22270
22294
  if (item && item.value.length > 0) {
22271
22295
  anySet = true;
22272
22296
  longhandValues[lh] = item.value;
@@ -22276,26 +22300,32 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22276
22300
  }
22277
22301
  }
22278
22302
  if (anySet && consistentImportant) {
22279
- const wm = this.getPropertyValue("writing-mode") || "horizontal-tb";
22280
- const dir = this.getPropertyValue("direction") || "ltr";
22281
- const physicalToLogicalSet = /* @__PURE__ */ new Map();
22282
- for (const lh of Object.keys(longhandValues)) {
22283
- const physicalProp = resolveLogicalProperty(lh, wm, dir);
22284
- const decl = this._getWinningDeclaration(lh);
22285
- if (physicalToLogicalSet.has(physicalProp)) {
22286
- const other = physicalToLogicalSet.get(physicalProp);
22287
- if (!(decl?.name === "all" || decl?.fromAll || other.decl?.name === "all" || other.decl?.fromAll)) {
22288
- if (serialize(longhandValues[lh]).trim() !== serialize(longhandValues[other.lh]).trim()) return "";
22303
+ const lhKeys = Object.keys(longhandValues);
22304
+ const hasLogicalKey = lhKeys.some((lh) => lh in LOGICAL_MAPPING);
22305
+ let wm = "horizontal-tb";
22306
+ let dir = "ltr";
22307
+ if (hasLogicalKey) {
22308
+ wm = self.getPropertyValue("writing-mode") || "horizontal-tb";
22309
+ dir = self.getPropertyValue("direction") || "ltr";
22310
+ const physicalToLogicalSet = /* @__PURE__ */ new Map();
22311
+ for (const lh of lhKeys) {
22312
+ const physicalProp = resolveLogicalProperty(lh, wm, dir);
22313
+ const decl = self._getWinningDeclaration(lh);
22314
+ if (physicalToLogicalSet.has(physicalProp)) {
22315
+ const other = physicalToLogicalSet.get(physicalProp);
22316
+ if (!(decl?.name === "all" || decl?.fromAll || other.decl?.name === "all" || other.decl?.fromAll)) {
22317
+ if (serialize(longhandValues[lh]).trim() !== serialize(longhandValues[other.lh]).trim()) return "";
22318
+ }
22289
22319
  }
22320
+ if (decl && decl.name !== "all" && !decl.fromAll) physicalToLogicalSet.set(physicalProp, {
22321
+ lh,
22322
+ decl
22323
+ });
22324
+ else if (!physicalToLogicalSet.has(physicalProp)) physicalToLogicalSet.set(physicalProp, {
22325
+ lh,
22326
+ decl
22327
+ });
22290
22328
  }
22291
- if (decl && decl.name !== "all" && !decl.fromAll) physicalToLogicalSet.set(physicalProp, {
22292
- lh,
22293
- decl
22294
- });
22295
- else if (!physicalToLogicalSet.has(physicalProp)) physicalToLogicalSet.set(physicalProp, {
22296
- lh,
22297
- decl
22298
- });
22299
22329
  }
22300
22330
  const valuesForContractor = {};
22301
22331
  let anyLogical = false;
@@ -22304,7 +22334,7 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22304
22334
  const val = longhandValues[lh];
22305
22335
  if (val) {
22306
22336
  valuesForContractor[lh] = val;
22307
- if (resolveLogicalProperty(lh, wm, dir) !== lh) anyLogical = true;
22337
+ if (hasLogicalKey && resolveLogicalProperty(lh, wm, dir) !== lh) anyLogical = true;
22308
22338
  if (shorthand.logicalLonghands?.includes(lh)) anyLogical = true;
22309
22339
  }
22310
22340
  }
@@ -22320,21 +22350,43 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22320
22350
  return res || "";
22321
22351
  }
22322
22352
  }
22323
- const directDecl = this._getWinningDeclaration(property);
22324
- if (directDecl) {
22325
- const directIdx = this._declarations.indexOf(directDecl);
22326
- const allLonghands = getShorthandAllLonghands(shorthand);
22327
- if (this._declarations.some((d, idx) => {
22328
- if (!allLonghands.includes(d.name)) return false;
22329
- if (d.important && !directDecl.important) return true;
22330
- if (d.important === directDecl.important && idx > directIdx) return true;
22331
- return false;
22332
- })) return "";
22333
- return serialize(directDecl.value).trim();
22353
+ return self._serializeDirectShorthand(property, shorthand);
22354
+ } else if (property in SHORTHANDS_DATA) {
22355
+ const shorthandLonghands = SHORTHANDS_DATA[property];
22356
+ if (shorthandLonghands && shorthandLonghands.length > 0) {
22357
+ let allCssWide = null;
22358
+ let allMatch = true;
22359
+ let firstPrio = null;
22360
+ let allSamePriority = true;
22361
+ for (const lh of shorthandLonghands) {
22362
+ if (map && !map.has("all") && !map.has(lh) && !(lh in SHORTHANDS) && !(lh in SHORTHANDS_DATA)) {
22363
+ allMatch = false;
22364
+ break;
22365
+ }
22366
+ const val = self.getPropertyValue(lh);
22367
+ if (!val) {
22368
+ allMatch = false;
22369
+ break;
22370
+ }
22371
+ const trimmed = val.trim().toLowerCase();
22372
+ if (CSS_WIDE_KEYWORDS.has(trimmed)) {
22373
+ const prio = self.getPropertyPriority(lh);
22374
+ if (firstPrio === null) firstPrio = prio;
22375
+ else if (firstPrio !== prio) allSamePriority = false;
22376
+ if (allCssWide === null) allCssWide = trimmed;
22377
+ else if (allCssWide !== trimmed) {
22378
+ allMatch = false;
22379
+ break;
22380
+ }
22381
+ } else {
22382
+ allMatch = false;
22383
+ break;
22384
+ }
22385
+ }
22386
+ if (allMatch && allCssWide && allSamePriority) return allCssWide;
22334
22387
  }
22335
- return "";
22336
22388
  }
22337
- const winner = this._getWinningDeclaration(property);
22389
+ const winner = self._getWinningDeclaration(property);
22338
22390
  if (winner) {
22339
22391
  if (winner.name === "all") return serialize(winner.value);
22340
22392
  const isCustom = winner.name.startsWith("--");
@@ -22352,47 +22404,45 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22352
22404
  }
22353
22405
  /** @internal */
22354
22406
  _getExactWinningDeclaration(property) {
22407
+ const self = unwrapStyle(this);
22355
22408
  if (!property.startsWith("--")) property = property.toLowerCase();
22356
- const isCoveredByAll = !property.startsWith("--") && property !== "direction" && property !== "unicode-bidi" && property !== "all";
22357
- let winner = null;
22358
- for (let i = this._declarations.length - 1; i >= 0; i--) {
22359
- const d = this._declarations[i];
22360
- const isMatch = d.name === property;
22361
- const isAll = d.name === "all" && isCoveredByAll;
22362
- if (isMatch || isAll) {
22363
- if (!winner || d.important && !winner.important) {
22364
- winner = d;
22365
- if (winner.important) break;
22366
- }
22367
- }
22368
- }
22369
- return winner;
22409
+ const exact = self._declMap.get(property);
22410
+ const allDecl = !property.startsWith("--") && property !== "direction" && property !== "unicode-bidi" && property !== "all" ? self._declMap.get("all") : void 0;
22411
+ if (!allDecl) return exact ?? null;
22412
+ if (!exact) return allDecl;
22413
+ if (exact.important !== allDecl.important) return exact.important ? exact : allDecl;
22414
+ return self._declarations.indexOf(allDecl) > self._declarations.indexOf(exact) ? allDecl : exact;
22370
22415
  }
22371
22416
  /** @internal */
22372
22417
  _getWinningDeclaration(property) {
22373
- const exact = this._getExactWinningDeclaration(property);
22418
+ const self = unwrapStyle(this);
22419
+ const exact = self._getExactWinningDeclaration(property);
22420
+ if (!exact) return null;
22374
22421
  const shorthands = LONGHAND_TO_SHORTHAND[property];
22375
- if (shorthands) for (const sh of shorthands) {
22376
- const shDecl = this._getExactWinningDeclaration(sh);
22377
- if (shDecl) {
22378
- if (shDecl.important && (!exact || !exact.important)) return null;
22379
- if (exact && !exact.important && !shDecl.important) {
22380
- if (this._declarations.indexOf(shDecl) > this._declarations.indexOf(exact)) return null;
22422
+ if (shorthands && !exact.important) {
22423
+ let exactIdx = -1;
22424
+ for (const sh of shorthands) {
22425
+ const shDecl = self._declMap.get(sh);
22426
+ if (shDecl) {
22427
+ if (shDecl.important) return null;
22428
+ if (exactIdx === -1) exactIdx = self._declarations.indexOf(exact);
22429
+ if (self._declarations.indexOf(shDecl) > exactIdx) return null;
22381
22430
  }
22382
22431
  }
22383
22432
  }
22384
22433
  return exact;
22385
22434
  }
22386
22435
  getPropertyPriority(property) {
22436
+ const self = unwrapStyle(this);
22387
22437
  if (!property.startsWith("--")) property = property.toLowerCase();
22388
22438
  const shorthand = SHORTHANDS[property];
22389
22439
  if (shorthand) {
22390
- if (this.getPropertyValue(property) === "") return "";
22440
+ if (self.getPropertyValue(property) === "") return "";
22391
22441
  const checkSet = (longhands) => {
22392
22442
  let importantCount = 0;
22393
22443
  const values = {};
22394
22444
  for (const lh of longhands) {
22395
- const item = this._getLonghandForContraction(lh);
22445
+ const item = self._getLonghandForContraction(lh);
22396
22446
  if (item && item.value.length > 0) {
22397
22447
  values[lh] = item.value;
22398
22448
  if (item.important) importantCount++;
@@ -22403,27 +22453,19 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22403
22453
  values
22404
22454
  };
22405
22455
  };
22406
- const primaryResult = checkSet(shorthand.longhands);
22407
- if (primaryResult.importantCount === shorthand.longhands.length && shorthand.longhands.length > 0) {
22408
- if (shorthand.contract(primaryResult.values)) return "important";
22409
- }
22410
- if (shorthand.logicalLonghands) {
22411
- const logicalResult = checkSet(shorthand.logicalLonghands);
22412
- if (logicalResult.importantCount === shorthand.logicalLonghands.length && shorthand.logicalLonghands.length > 0) {
22413
- if (shorthand.contract(logicalResult.values)) return "important";
22414
- }
22415
- }
22416
- if (shorthand.physicalLonghands) {
22417
- const physicalResult = checkSet(shorthand.physicalLonghands);
22418
- if (physicalResult.importantCount === shorthand.physicalLonghands.length && shorthand.physicalLonghands.length > 0) {
22419
- if (shorthand.contract(physicalResult.values)) return "important";
22420
- }
22421
- }
22422
- const directDecl = this._getWinningDeclaration(property);
22456
+ for (const set of [
22457
+ shorthand.longhands,
22458
+ shorthand.logicalLonghands,
22459
+ shorthand.physicalLonghands
22460
+ ]) if (set && set.length > 0) {
22461
+ const res = checkSet(set);
22462
+ if (res.importantCount === set.length && shorthand.contract(res.values)) return "important";
22463
+ }
22464
+ const directDecl = self._getWinningDeclaration(property);
22423
22465
  if (directDecl && directDecl.important) return "important";
22424
22466
  return "";
22425
22467
  }
22426
- const winner = this._getWinningDeclaration(property);
22468
+ const winner = self._getWinningDeclaration(property);
22427
22469
  return winner && winner.important ? "important" : "";
22428
22470
  }
22429
22471
  setProperty(property, value, priority = "") {
@@ -22446,23 +22488,19 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22446
22488
  }
22447
22489
  if (value === void 0 && !property.startsWith("--") && !CUSTOM_IDENT_PROPERTIES.has(property)) return;
22448
22490
  const valueStr = typeof value === "string" ? value : String(value);
22449
- if (property.startsWith("--")) {
22450
- if (!isValidDashedIdent(property)) return;
22451
- const tokens = tokenize(valueStr);
22452
- if (tokens.some((t) => t.type === "bad-string" || t.type === "bad-url")) return;
22453
- if (!validateCustomPropertyValue(parseComponentValues(tokens))) return;
22454
- }
22455
22491
  const tokens = tokenize(valueStr, property === "unicode-range");
22456
22492
  if (tokens.some((t) => t.type === "bad-string" || t.type === "bad-url")) return;
22457
- if (property === "all") {
22458
- this._declarations = this._declarations.filter((d) => d.name !== "all");
22459
- this._declMap.delete("all");
22460
- }
22461
22493
  const compVals = parseComponentValues(tokens);
22462
- if (!property.startsWith("--")) {
22494
+ if (property.startsWith("--")) {
22495
+ if (!isValidDashedIdent(property) || !validateCustomPropertyValue(compVals)) return;
22496
+ } else {
22463
22497
  if (!validateDeclarationValue(compVals)) return;
22464
22498
  if (ParseHooks.validatePropertyValue && !ParseHooks.validatePropertyValue(property, valueStr, value)) return;
22465
22499
  }
22500
+ if (property === "all") {
22501
+ this._declarations = this._declarations.filter((d) => d.name !== "all");
22502
+ this._declMap.delete("all");
22503
+ }
22466
22504
  const shorthand = SHORTHANDS[property];
22467
22505
  if (shorthand) {
22468
22506
  const hasVar = valueStr.includes("var(") || valueStr.includes("env(");
@@ -22491,14 +22529,13 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22491
22529
  else if (!shorthand.stub) return;
22492
22530
  }
22493
22531
  const existing = this._declMap.get(property);
22494
- const componentValues = parseComponentValues(tokens);
22495
22532
  if (property === "unicode-range") {
22496
- const assembled = assembleUnicodeRanges(componentValues);
22533
+ const assembled = assembleUnicodeRanges(compVals);
22497
22534
  if (!assembled) return;
22498
- componentValues.splice(0, componentValues.length, ...assembled);
22535
+ compVals.splice(0, compVals.length, ...assembled);
22499
22536
  }
22500
22537
  if (existing) {
22501
- existing.value = componentValues;
22538
+ existing.value = compVals;
22502
22539
  existing.important = isImportant;
22503
22540
  existing.fromAll = fromAll;
22504
22541
  if (property.startsWith("--")) existing.raw = valueStr ?? void 0;
@@ -22519,7 +22556,7 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22519
22556
  const decl = {
22520
22557
  type: "declaration",
22521
22558
  name: property,
22522
- value: componentValues,
22559
+ value: compVals,
22523
22560
  important: isImportant,
22524
22561
  fromAll: fromAll || void 0,
22525
22562
  raw: property.startsWith("--") ? valueStr ?? void 0 : void 0
@@ -22532,7 +22569,7 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22532
22569
  this._rawDeclarations.push({
22533
22570
  type: "declaration",
22534
22571
  name: property,
22535
- value: componentValues,
22572
+ value: compVals,
22536
22573
  important: isImportant,
22537
22574
  raw: property.startsWith("--") ? valueStr ?? void 0 : void 0
22538
22575
  });
@@ -22544,52 +22581,40 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22544
22581
  if (!property.startsWith("--")) property = property.toLowerCase();
22545
22582
  if (property === "all") {
22546
22583
  const value = this.getPropertyValue("all");
22547
- let changed = false;
22548
- this._rawDeclarations = this._rawDeclarations.filter((d) => d.name === "direction" || d.name === "unicode-bidi" || d.name.startsWith("--"));
22549
- for (let i = this._declarations.length - 1; i >= 0; i--) {
22550
- const d = this._declarations[i];
22551
- if (d.name !== "direction" && d.name !== "unicode-bidi" && !d.name.startsWith("--")) {
22552
- this._declarations.splice(i, 1);
22584
+ const isRetained = (name) => name === "direction" || name === "unicode-bidi" || name.startsWith("--");
22585
+ const prevLen = this._declarations.length;
22586
+ this._rawDeclarations = this._rawDeclarations.filter((d) => isRetained(d.name));
22587
+ this._declarations = this._declarations.filter((d) => {
22588
+ if (!isRetained(d.name)) {
22553
22589
  this._declMap.delete(d.name);
22554
- changed = true;
22590
+ return false;
22555
22591
  }
22556
- }
22557
- if (changed) this._onChange?.();
22592
+ return true;
22593
+ });
22594
+ if (this._declarations.length !== prevLen) this._onChange?.();
22558
22595
  return value;
22559
22596
  }
22560
22597
  const shorthand = SHORTHANDS[property];
22561
- if (shorthand) {
22562
- const value = this.getPropertyValue(property);
22563
- const allLh = shorthand.logicalLonghands ? [...shorthand.longhands, ...shorthand.logicalLonghands] : shorthand.longhands;
22564
- this._rawDeclarations = this._rawDeclarations.filter((d) => d.name !== property && !allLh.includes(d.name));
22565
- let changed = false;
22566
- for (const lh of allLh) if (this._declMap.has(lh)) {
22567
- const index = this._declarations.findIndex((d) => d.name === lh);
22568
- if (index !== -1) {
22569
- this._declarations.splice(index, 1);
22570
- this._declMap.delete(lh);
22571
- changed = true;
22572
- }
22573
- }
22574
- const index = this._declarations.findIndex((d) => d.name === property);
22575
- if (index !== -1) {
22576
- this._declarations.splice(index, 1);
22577
- this._declMap.delete(property);
22598
+ const propsToRemove = shorthand ? [
22599
+ property,
22600
+ ...shorthand.longhands,
22601
+ ...shorthand.logicalLonghands ?? []
22602
+ ] : [property];
22603
+ const value = this.getPropertyValue(property);
22604
+ const removeSet = new Set(propsToRemove);
22605
+ this._rawDeclarations = this._rawDeclarations.filter((d) => !removeSet.has(d.name));
22606
+ let changed = false;
22607
+ for (const p of propsToRemove) {
22608
+ const decl = this._declMap.get(p);
22609
+ if (decl) {
22610
+ const idx = this._declarations.indexOf(decl);
22611
+ if (idx !== -1) this._declarations.splice(idx, 1);
22612
+ this._declMap.delete(p);
22578
22613
  changed = true;
22579
22614
  }
22580
- if (changed) this._onChange?.();
22581
- return value;
22582
22615
  }
22583
- const value = this.getPropertyValue(property);
22584
- this._rawDeclarations = this._rawDeclarations.filter((d) => d.name !== property);
22585
- const index = this._declarations.findIndex((d) => d.name === property);
22586
- if (index !== -1) {
22587
- this._declarations.splice(index, 1);
22588
- this._declMap.delete(property);
22589
- this._onChange?.();
22590
- return value;
22591
- }
22592
- return "";
22616
+ if (changed) this._onChange?.();
22617
+ return value;
22593
22618
  }
22594
22619
  get cssText() {
22595
22620
  if (this._declarations.length === 0) return "";
@@ -22611,31 +22636,7 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
22611
22636
  return this._isPropertySupported(d.name.toLowerCase());
22612
22637
  });
22613
22638
  this._declMap.clear();
22614
- for (const d of newStyle._declarations) {
22615
- if (d.name === "--") continue;
22616
- if (d.important && !this._allowImportant) continue;
22617
- const normalizedName = d.name.startsWith("--") ? d.name : d.name.toLowerCase();
22618
- if (normalizedName.startsWith("--") && !this._allowCustomProperties) continue;
22619
- if (!normalizedName.startsWith("--") && !this._isPropertySupported(normalizedName)) continue;
22620
- d.name = normalizedName;
22621
- const shorthand = SHORTHANDS[d.name];
22622
- if (shorthand) {
22623
- if (!(serialize(d.value).includes("var(") || serialize(d.value).includes("env("))) {
22624
- const expanded = shorthand.expand(d.value);
22625
- if (expanded) {
22626
- for (const [lh, val] of Object.entries(expanded)) this._addDeclaration({
22627
- type: "declaration",
22628
- name: lh,
22629
- value: val,
22630
- important: d.important,
22631
- fromAll: d.name === "all" || d.fromAll
22632
- });
22633
- continue;
22634
- }
22635
- }
22636
- }
22637
- this._addDeclaration(d);
22638
- }
22639
+ for (const d of newStyle._declarations) this._ingestDeclaration(d, true, false);
22639
22640
  return true;
22640
22641
  }
22641
22642
  set cssText(value) {
@@ -22696,10 +22697,7 @@ function defineDescriptorProperties(proto, dashedProps, skip) {
22696
22697
  configurable: true
22697
22698
  };
22698
22699
  Object.defineProperty(proto, cssProp, desc);
22699
- if (cssProp.includes("-")) {
22700
- const camelProp = cssProp.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
22701
- Object.defineProperty(proto, camelProp, desc);
22702
- }
22700
+ if (cssProp.includes("-")) Object.defineProperty(proto, cssProp.replace(/-([a-z])/g, (_, c) => c.toUpperCase()), desc);
22703
22701
  }
22704
22702
  }
22705
22703
  defineDescriptorProperties(CSSPageDescriptors.prototype, PAGE_DESCRIPTOR_PROPERTIES);
@@ -28409,7 +28407,7 @@ function mapImageclozeassociationV2ToGraphicGapMatch(question, questionRef, diag
28409
28407
  * question's folder distinct while staying deterministic.
28410
28408
  */
28411
28409
  function gapTileFolder(questionRef) {
28412
- let hash = 2166136261;
28410
+ let hash = 0x811c9dc5;
28413
28411
  for (let i = 0; i < questionRef.length; i++) {
28414
28412
  hash ^= questionRef.charCodeAt(i);
28415
28413
  hash = Math.imul(hash, 16777619) >>> 0;
@@ -29049,11 +29047,7 @@ function mapMultiWidgetItem(model, diagnostics) {
29049
29047
  });
29050
29048
  }
29051
29049
  let responseProcessing;
29052
- if (model.questions.length === 1 && interactions.length === 1) {
29053
- const question = model.questions[0];
29054
- const interaction = interactions[0];
29055
- responseProcessing = determineResponseProcessingStrategy(question, hasInteractionCorrectResponse(interaction));
29056
- }
29050
+ if (model.questions.length === 1 && interactions.length === 1) responseProcessing = determineResponseProcessingStrategy(model.questions[0], hasInteractionCorrectResponse(interactions[0]));
29057
29051
  let instructorStimulus;
29058
29052
  if (model.questions.length === 1) {
29059
29053
  const question = model.questions[0];
@@ -29139,8 +29133,7 @@ function mapChoicematrixToMultipleChoiceInteractions(question, questionRef, diag
29139
29133
  }
29140
29134
  const interactions = [];
29141
29135
  for (let stemIndex = 0; stemIndex < data.stems.length; stemIndex++) {
29142
- const stem = data.stems[stemIndex];
29143
- const stemResult = sanitizeHtmlContent(stem, `questions[].data.stems[${stemIndex}]`);
29136
+ const stemResult = sanitizeHtmlContent(data.stems[stemIndex], `questions[].data.stems[${stemIndex}]`);
29144
29137
  diagnostics.push(...stemResult.diagnostics);
29145
29138
  diagnostics.push(...optionDiagnostics);
29146
29139
  const choices = optionContents.map((content, i) => ({
@@ -33550,70 +33543,70 @@ const S = [
33550
33543
  ];
33551
33544
  /** Binary-integer parts of the sines of integers (constants) — the MD5 K table. */
33552
33545
  const K = [
33553
- 3614090360,
33554
- 3905402710,
33546
+ 0xd76aa478,
33547
+ 0xe8c7b756,
33555
33548
  606105819,
33556
- 3250441966,
33557
- 4118548399,
33558
- 1200080426,
33559
- 2821735955,
33560
- 4249261313,
33561
- 1770035416,
33562
- 2336552879,
33563
- 4294925233,
33564
- 2304563134,
33565
- 1804603682,
33566
- 4254626195,
33567
- 2792965006,
33568
- 1236535329,
33569
- 4129170786,
33570
- 3225465664,
33549
+ 0xc1bdceee,
33550
+ 0xf57c0faf,
33551
+ 0x4787c62a,
33552
+ 0xa8304613,
33553
+ 0xfd469501,
33554
+ 0x698098d8,
33555
+ 0x8b44f7af,
33556
+ 0xffff5bb1,
33557
+ 0x895cd7be,
33558
+ 0x6b901122,
33559
+ 0xfd987193,
33560
+ 0xa679438e,
33561
+ 0x49b40821,
33562
+ 0xf61e2562,
33563
+ 0xc040b340,
33571
33564
  643717713,
33572
- 3921069994,
33573
- 3593408605,
33565
+ 0xe9b6c7aa,
33566
+ 0xd62f105d,
33574
33567
  38016083,
33575
- 3634488961,
33576
- 3889429448,
33568
+ 0xd8a1e681,
33569
+ 0xe7d3fbc8,
33577
33570
  568446438,
33578
- 3275163606,
33579
- 4107603335,
33580
- 1163531501,
33581
- 2850285829,
33582
- 4243563512,
33583
- 1735328473,
33584
- 2368359562,
33585
- 4294588738,
33586
- 2272392833,
33587
- 1839030562,
33588
- 4259657740,
33589
- 2763975236,
33590
- 1272893353,
33591
- 4139469664,
33592
- 3200236656,
33571
+ 0xc33707d6,
33572
+ 0xf4d50d87,
33573
+ 0x455a14ed,
33574
+ 0xa9e3e905,
33575
+ 0xfcefa3f8,
33576
+ 0x676f02d9,
33577
+ 0x8d2a4c8a,
33578
+ 0xfffa3942,
33579
+ 0x8771f681,
33580
+ 0x6d9d6122,
33581
+ 0xfde5380c,
33582
+ 0xa4beea44,
33583
+ 0x4bdecfa9,
33584
+ 0xf6bb4b60,
33585
+ 0xbebfbc70,
33593
33586
  681279174,
33594
- 3936430074,
33595
- 3572445317,
33587
+ 0xeaa127fa,
33588
+ 0xd4ef3085,
33596
33589
  76029189,
33597
- 3654602809,
33598
- 3873151461,
33590
+ 0xd9d4d039,
33591
+ 0xe6db99e5,
33599
33592
  530742520,
33600
- 3299628645,
33601
- 4096336452,
33602
- 1126891415,
33603
- 2878612391,
33604
- 4237533241,
33605
- 1700485571,
33606
- 2399980690,
33607
- 4293915773,
33608
- 2240044497,
33609
- 1873313359,
33610
- 4264355552,
33611
- 2734768916,
33612
- 1309151649,
33613
- 4149444226,
33614
- 3174756917,
33593
+ 0xc4ac5665,
33594
+ 0xf4292244,
33595
+ 0x432aff97,
33596
+ 0xab9423a7,
33597
+ 0xfc93a039,
33598
+ 0x655b59c3,
33599
+ 0x8f0ccc92,
33600
+ 0xffeff47d,
33601
+ 0x85845dd1,
33602
+ 0x6fa87e4f,
33603
+ 0xfe2ce6e0,
33604
+ 0xa3014314,
33605
+ 0x4e0811a1,
33606
+ 0xf7537e82,
33607
+ 0xbd3af235,
33615
33608
  718787259,
33616
- 3951481745
33609
+ 0xeb86d391
33617
33610
  ];
33618
33611
  const HEX$1 = Array.from({ length: 256 }, (_, i) => (i + 256).toString(16).slice(1));
33619
33612
  function leftRotate(x, c) {
@@ -33638,9 +33631,9 @@ function md5Bytes(msg) {
33638
33631
  buf[totalLen - 3] = hi >>> 8 & 255;
33639
33632
  buf[totalLen - 2] = hi >>> 16 & 255;
33640
33633
  buf[totalLen - 1] = hi >>> 24 & 255;
33641
- let a0 = 1732584193;
33642
- let b0 = 4023233417;
33643
- let c0 = 2562383102;
33634
+ let a0 = 0x67452301;
33635
+ let b0 = 0xefcdab89;
33636
+ let c0 = 0x98badcfe;
33644
33637
  let d0 = 271733878;
33645
33638
  const M = /* @__PURE__ */ new Uint32Array(16);
33646
33639
  for (let chunk = 0; chunk < totalLen; chunk += 64) {
@@ -42250,7 +42243,7 @@ function strToU8(str, latin1) {
42250
42243
  var c = str.charCodeAt(i);
42251
42244
  if (c < 128 || latin1) w(c);
42252
42245
  else if (c < 2048) w(192 | c >> 6), w(128 | c & 63);
42253
- else if (c > 55295 && c < 57344) c = 65536 + (c & 1047552) | str.charCodeAt(++i) & 1023, w(240 | c >> 18), w(128 | c >> 12 & 63), w(128 | c >> 6 & 63), w(128 | c & 63);
42246
+ else if (c > 55295 && c < 57344) c = 65536 + (c & 0xffc00) | str.charCodeAt(++i) & 1023, w(240 | c >> 18), w(128 | c >> 12 & 63), w(128 | c >> 6 & 63), w(128 | c & 63);
42254
42247
  else w(224 | c >> 12), w(128 | c >> 6 & 63), w(128 | c & 63);
42255
42248
  }
42256
42249
  return slc(ar, 0, ai);
@@ -42290,7 +42283,7 @@ var zh = function(d, b, z) {
42290
42283
  ];
42291
42284
  };
42292
42285
  var z64hs = function(d, b, l, z, sc, su, off) {
42293
- var nsc = sc == 4294967295, nsu = su == 4294967295, noff = off == 4294967295, e = b + l;
42286
+ var nsc = sc == 0xffffffff, nsu = su == 0xffffffff, noff = off == 0xffffffff, e = b + l;
42294
42287
  var nf = nsc + nsu + noff;
42295
42288
  if (z && nf) {
42296
42289
  for (; b + 4 < e; b += 4 + b2(d, b + 2)) if (b2(d, b) == 1) return [
@@ -42352,7 +42345,7 @@ var wzh = function(d, b, f, fn, u, c, ce, co) {
42352
42345
  return b;
42353
42346
  };
42354
42347
  var wzf = function(o, b, c, d, e) {
42355
- wbytes(o, b, 101010256);
42348
+ wbytes(o, b, 0x6054b50);
42356
42349
  wbytes(o, b + 8, c);
42357
42350
  wbytes(o, b + 10, c);
42358
42351
  wbytes(o, b + 12, d);
@@ -42416,14 +42409,14 @@ function zipSync(data, opts) {
42416
42409
  function unzipSync(data, opts) {
42417
42410
  var files = {};
42418
42411
  var e = data.length - 22;
42419
- for (; b4(data, e) != 101010256; --e) if (!e || data.length - e > 65558) err(13);
42412
+ for (; b4(data, e) != 0x6054b50; --e) if (!e || data.length - e > 65558) err(13);
42420
42413
  var c = b2(data, e + 8);
42421
42414
  if (!c) return {};
42422
42415
  var o = b4(data, e + 16);
42423
- var z = b4(data, e - 20) == 117853008;
42416
+ var z = b4(data, e - 20) == 0x7064b50;
42424
42417
  if (z) {
42425
42418
  var ze = b4(data, e - 12);
42426
- z = b4(data, ze) == 101075792;
42419
+ z = b4(data, ze) == 0x6064b50;
42427
42420
  if (z) {
42428
42421
  c = b4(data, ze + 32);
42429
42422
  o = b4(data, ze + 48);
@@ -42431,7 +42424,7 @@ function unzipSync(data, opts) {
42431
42424
  }
42432
42425
  var fltr = opts && opts.filter;
42433
42426
  for (var i = 0; i < c; ++i) {
42434
- 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);
42427
+ 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]);
42435
42428
  o = no;
42436
42429
  if (!fltr || fltr({
42437
42430
  name: fn,