@pie-qti/item-player 0.1.9 → 0.1.11

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 (737) hide show
  1. package/README.md +17 -0
  2. package/dist/catalog/applyGlossaryTriggers.d.ts +13 -3
  3. package/dist/catalog/applyGlossaryTriggers.js +1 -0
  4. package/dist/catalog/applyGlossaryTriggers.js.map +1 -0
  5. package/dist/catalog/catalogExtractor.d.ts +0 -1
  6. package/dist/catalog/catalogExtractor.js +1 -0
  7. package/dist/catalog/catalogExtractor.js.map +1 -0
  8. package/dist/catalog/catalogLookup.d.ts +0 -1
  9. package/dist/catalog/catalogLookup.js +1 -0
  10. package/dist/catalog/catalogLookup.js.map +1 -0
  11. package/dist/catalog/glossaryAction.d.ts +4 -3
  12. package/dist/catalog/glossaryAction.js +1 -0
  13. package/dist/catalog/glossaryAction.js.map +1 -0
  14. package/dist/catalog/types.d.ts +0 -1
  15. package/dist/catalog/types.js +1 -0
  16. package/dist/catalog/types.js.map +1 -0
  17. package/dist/components/actions/typesetAction.d.ts +0 -1
  18. package/dist/components/actions/typesetAction.js +1 -0
  19. package/dist/components/actions/typesetAction.js.map +1 -0
  20. package/dist/components/utils/feedbackUtils.d.ts +0 -1
  21. package/dist/components/utils/feedbackUtils.js +1 -0
  22. package/dist/components/utils/feedbackUtils.js.map +1 -0
  23. package/dist/components/utils/index.d.ts +1 -3
  24. package/dist/components/utils/index.js +2 -2
  25. package/dist/components/utils/index.js.map +1 -0
  26. package/dist/components/utils/stimulusRender.d.ts +0 -1
  27. package/dist/components/utils/stimulusRender.js +1 -0
  28. package/dist/components/utils/stimulusRender.js.map +1 -0
  29. package/dist/components/utils/stylesheetRender.d.ts +0 -1
  30. package/dist/components/utils/stylesheetRender.js +1 -0
  31. package/dist/components/utils/stylesheetRender.js.map +1 -0
  32. package/dist/core/ComponentRegistry.d.ts +10 -2
  33. package/dist/core/ComponentRegistry.js +43 -1
  34. package/dist/core/ComponentRegistry.js.map +1 -0
  35. package/dist/core/Player.d.ts +10 -3
  36. package/dist/core/Player.js +55 -46
  37. package/dist/core/Player.js.map +1 -0
  38. package/dist/core/Plugin.d.ts +0 -1
  39. package/dist/core/Plugin.js +1 -0
  40. package/dist/core/Plugin.js.map +1 -0
  41. package/dist/core/PluginManager.d.ts +0 -1
  42. package/dist/core/PluginManager.js +1 -0
  43. package/dist/core/PluginManager.js.map +1 -0
  44. package/dist/core/constants.d.ts +0 -1
  45. package/dist/core/constants.js +1 -0
  46. package/dist/core/constants.js.map +1 -0
  47. package/dist/core/declarations.d.ts +0 -1
  48. package/dist/core/declarations.js +1 -0
  49. package/dist/core/declarations.js.map +1 -0
  50. package/dist/core/parsingLimits.d.ts +0 -1
  51. package/dist/core/parsingLimits.js +1 -0
  52. package/dist/core/parsingLimits.js.map +1 -0
  53. package/dist/core/random.d.ts +0 -1
  54. package/dist/core/random.js +1 -0
  55. package/dist/core/random.js.map +1 -0
  56. package/dist/core/rolePolicy.d.ts +0 -1
  57. package/dist/core/rolePolicy.js +1 -0
  58. package/dist/core/rolePolicy.js.map +1 -0
  59. package/dist/core/sanitizer.d.ts +0 -1
  60. package/dist/core/sanitizer.js +1 -0
  61. package/dist/core/sanitizer.js.map +1 -0
  62. package/dist/core/trustedTypes.d.ts +0 -1
  63. package/dist/core/trustedTypes.js +1 -0
  64. package/dist/core/trustedTypes.js.map +1 -0
  65. package/dist/core/urlPolicy.d.ts +0 -1
  66. package/dist/core/urlPolicy.js +1 -0
  67. package/dist/core/urlPolicy.js.map +1 -0
  68. package/dist/document/AssessmentItemDocument.d.ts +1 -2
  69. package/dist/document/AssessmentItemDocument.js +1 -0
  70. package/dist/document/AssessmentItemDocument.js.map +1 -0
  71. package/dist/element.d.ts +15 -0
  72. package/dist/element.js +1816 -1625
  73. package/dist/element.js.map +1 -1
  74. package/dist/extensions/MathLiveEditor.d.ts +0 -1
  75. package/dist/extensions/MathLiveEditor.js +1 -0
  76. package/dist/extensions/MathLiveEditor.js.map +1 -0
  77. package/dist/extraction/ExtractionRegistry.d.ts +1 -2
  78. package/dist/extraction/ExtractionRegistry.js +1 -0
  79. package/dist/extraction/ExtractionRegistry.js.map +1 -0
  80. package/dist/extraction/createContext.d.ts +1 -2
  81. package/dist/extraction/createContext.js +1 -0
  82. package/dist/extraction/createContext.js.map +1 -0
  83. package/dist/extraction/index.d.ts +2 -3
  84. package/dist/extraction/index.js +2 -1
  85. package/dist/extraction/index.js.map +1 -0
  86. package/dist/extraction/interactionExtractionPipeline.d.ts +1 -2
  87. package/dist/extraction/interactionExtractionPipeline.js +1 -0
  88. package/dist/extraction/interactionExtractionPipeline.js.map +1 -0
  89. package/dist/extraction/interactionSecurity.d.ts +1 -2
  90. package/dist/extraction/interactionSecurity.js +1 -0
  91. package/dist/extraction/interactionSecurity.js.map +1 -0
  92. package/dist/extraction/types.d.ts +1 -2
  93. package/dist/extraction/types.js +1 -0
  94. package/dist/extraction/types.js.map +1 -0
  95. package/dist/extraction/utils.d.ts +0 -1
  96. package/dist/extraction/utils.js +1 -0
  97. package/dist/extraction/utils.js.map +1 -0
  98. package/dist/iframe/IFramePlayerHost.d.ts +0 -1
  99. package/dist/iframe/IFramePlayerHost.js +1 -0
  100. package/dist/iframe/IFramePlayerHost.js.map +1 -0
  101. package/dist/iframe/index.d.ts +0 -1
  102. package/dist/iframe/index.js +1 -0
  103. package/dist/iframe/index.js.map +1 -0
  104. package/dist/iframe/protocol.d.ts +0 -1
  105. package/dist/iframe/protocol.js +1 -0
  106. package/dist/iframe/protocol.js.map +1 -0
  107. package/dist/index.d.ts +0 -1
  108. package/dist/index.js +1 -0
  109. package/dist/index.js.map +1 -0
  110. package/dist/interactions/associate/extractor.d.ts +0 -1
  111. package/dist/interactions/associate/extractor.js +1 -0
  112. package/dist/interactions/associate/extractor.js.map +1 -0
  113. package/dist/interactions/associate/index.d.ts +0 -1
  114. package/dist/interactions/associate/index.js +1 -0
  115. package/dist/interactions/associate/index.js.map +1 -0
  116. package/dist/interactions/associate/types.d.ts +0 -1
  117. package/dist/interactions/associate/types.js +1 -0
  118. package/dist/interactions/associate/types.js.map +1 -0
  119. package/dist/interactions/choice/extractor.d.ts +0 -1
  120. package/dist/interactions/choice/extractor.js +1 -0
  121. package/dist/interactions/choice/extractor.js.map +1 -0
  122. package/dist/interactions/choice/index.d.ts +0 -1
  123. package/dist/interactions/choice/index.js +1 -0
  124. package/dist/interactions/choice/index.js.map +1 -0
  125. package/dist/interactions/choice/types.d.ts +0 -1
  126. package/dist/interactions/choice/types.js +1 -0
  127. package/dist/interactions/choice/types.js.map +1 -0
  128. package/dist/interactions/custom/extractor.d.ts +0 -1
  129. package/dist/interactions/custom/extractor.js +1 -0
  130. package/dist/interactions/custom/extractor.js.map +1 -0
  131. package/dist/interactions/custom/index.d.ts +0 -1
  132. package/dist/interactions/custom/index.js +1 -0
  133. package/dist/interactions/custom/index.js.map +1 -0
  134. package/dist/interactions/custom/types.d.ts +0 -1
  135. package/dist/interactions/custom/types.js +1 -0
  136. package/dist/interactions/custom/types.js.map +1 -0
  137. package/dist/interactions/drawing/extractor.d.ts +0 -1
  138. package/dist/interactions/drawing/extractor.js +1 -0
  139. package/dist/interactions/drawing/extractor.js.map +1 -0
  140. package/dist/interactions/drawing/index.d.ts +0 -1
  141. package/dist/interactions/drawing/index.js +1 -0
  142. package/dist/interactions/drawing/index.js.map +1 -0
  143. package/dist/interactions/drawing/types.d.ts +0 -1
  144. package/dist/interactions/drawing/types.js +1 -0
  145. package/dist/interactions/drawing/types.js.map +1 -0
  146. package/dist/interactions/end-attempt/extractor.d.ts +0 -1
  147. package/dist/interactions/end-attempt/extractor.js +1 -0
  148. package/dist/interactions/end-attempt/extractor.js.map +1 -0
  149. package/dist/interactions/end-attempt/index.d.ts +0 -1
  150. package/dist/interactions/end-attempt/index.js +1 -0
  151. package/dist/interactions/end-attempt/index.js.map +1 -0
  152. package/dist/interactions/end-attempt/types.d.ts +0 -1
  153. package/dist/interactions/end-attempt/types.js +1 -0
  154. package/dist/interactions/end-attempt/types.js.map +1 -0
  155. package/dist/interactions/extended-text/extractor.d.ts +0 -1
  156. package/dist/interactions/extended-text/extractor.js +1 -0
  157. package/dist/interactions/extended-text/extractor.js.map +1 -0
  158. package/dist/interactions/extended-text/index.d.ts +0 -1
  159. package/dist/interactions/extended-text/index.js +1 -0
  160. package/dist/interactions/extended-text/index.js.map +1 -0
  161. package/dist/interactions/extended-text/types.d.ts +0 -1
  162. package/dist/interactions/extended-text/types.js +1 -0
  163. package/dist/interactions/extended-text/types.js.map +1 -0
  164. package/dist/interactions/gap-match/extractor.d.ts +0 -1
  165. package/dist/interactions/gap-match/extractor.js +1 -0
  166. package/dist/interactions/gap-match/extractor.js.map +1 -0
  167. package/dist/interactions/gap-match/index.d.ts +0 -1
  168. package/dist/interactions/gap-match/index.js +1 -0
  169. package/dist/interactions/gap-match/index.js.map +1 -0
  170. package/dist/interactions/gap-match/types.d.ts +0 -1
  171. package/dist/interactions/gap-match/types.js +1 -0
  172. package/dist/interactions/gap-match/types.js.map +1 -0
  173. package/dist/interactions/graphic-associate/extractor.d.ts +0 -1
  174. package/dist/interactions/graphic-associate/extractor.js +1 -0
  175. package/dist/interactions/graphic-associate/extractor.js.map +1 -0
  176. package/dist/interactions/graphic-associate/index.d.ts +0 -1
  177. package/dist/interactions/graphic-associate/index.js +1 -0
  178. package/dist/interactions/graphic-associate/index.js.map +1 -0
  179. package/dist/interactions/graphic-associate/types.d.ts +0 -1
  180. package/dist/interactions/graphic-associate/types.js +1 -0
  181. package/dist/interactions/graphic-associate/types.js.map +1 -0
  182. package/dist/interactions/graphic-gap-match/extractor.d.ts +0 -1
  183. package/dist/interactions/graphic-gap-match/extractor.js +1 -0
  184. package/dist/interactions/graphic-gap-match/extractor.js.map +1 -0
  185. package/dist/interactions/graphic-gap-match/index.d.ts +0 -1
  186. package/dist/interactions/graphic-gap-match/index.js +1 -0
  187. package/dist/interactions/graphic-gap-match/index.js.map +1 -0
  188. package/dist/interactions/graphic-gap-match/types.d.ts +0 -1
  189. package/dist/interactions/graphic-gap-match/types.js +1 -0
  190. package/dist/interactions/graphic-gap-match/types.js.map +1 -0
  191. package/dist/interactions/graphic-order/extractor.d.ts +0 -1
  192. package/dist/interactions/graphic-order/extractor.js +1 -0
  193. package/dist/interactions/graphic-order/extractor.js.map +1 -0
  194. package/dist/interactions/graphic-order/index.d.ts +0 -1
  195. package/dist/interactions/graphic-order/index.js +1 -0
  196. package/dist/interactions/graphic-order/index.js.map +1 -0
  197. package/dist/interactions/graphic-order/types.d.ts +0 -1
  198. package/dist/interactions/graphic-order/types.js +1 -0
  199. package/dist/interactions/graphic-order/types.js.map +1 -0
  200. package/dist/interactions/hotspot/extractor.d.ts +0 -1
  201. package/dist/interactions/hotspot/extractor.js +1 -0
  202. package/dist/interactions/hotspot/extractor.js.map +1 -0
  203. package/dist/interactions/hotspot/index.d.ts +0 -1
  204. package/dist/interactions/hotspot/index.js +1 -0
  205. package/dist/interactions/hotspot/index.js.map +1 -0
  206. package/dist/interactions/hotspot/types.d.ts +0 -1
  207. package/dist/interactions/hotspot/types.js +1 -0
  208. package/dist/interactions/hotspot/types.js.map +1 -0
  209. package/dist/interactions/hottext/extractor.d.ts +0 -1
  210. package/dist/interactions/hottext/extractor.js +1 -0
  211. package/dist/interactions/hottext/extractor.js.map +1 -0
  212. package/dist/interactions/hottext/index.d.ts +0 -1
  213. package/dist/interactions/hottext/index.js +1 -0
  214. package/dist/interactions/hottext/index.js.map +1 -0
  215. package/dist/interactions/hottext/types.d.ts +0 -1
  216. package/dist/interactions/hottext/types.js +1 -0
  217. package/dist/interactions/hottext/types.js.map +1 -0
  218. package/dist/interactions/index.d.ts +0 -1
  219. package/dist/interactions/index.js +1 -0
  220. package/dist/interactions/index.js.map +1 -0
  221. package/dist/interactions/inline/index.d.ts +0 -1
  222. package/dist/interactions/inline/index.js +1 -0
  223. package/dist/interactions/inline/index.js.map +1 -0
  224. package/dist/interactions/inline/render-plan.d.ts +0 -1
  225. package/dist/interactions/inline/render-plan.js +1 -0
  226. package/dist/interactions/inline/render-plan.js.map +1 -0
  227. package/dist/interactions/inline-choice/extractor.d.ts +0 -1
  228. package/dist/interactions/inline-choice/extractor.js +1 -0
  229. package/dist/interactions/inline-choice/extractor.js.map +1 -0
  230. package/dist/interactions/inline-choice/index.d.ts +0 -1
  231. package/dist/interactions/inline-choice/index.js +1 -0
  232. package/dist/interactions/inline-choice/index.js.map +1 -0
  233. package/dist/interactions/inline-choice/types.d.ts +0 -1
  234. package/dist/interactions/inline-choice/types.js +1 -0
  235. package/dist/interactions/inline-choice/types.js.map +1 -0
  236. package/dist/interactions/match/extractor.d.ts +0 -1
  237. package/dist/interactions/match/extractor.js +1 -0
  238. package/dist/interactions/match/extractor.js.map +1 -0
  239. package/dist/interactions/match/index.d.ts +0 -1
  240. package/dist/interactions/match/index.js +1 -0
  241. package/dist/interactions/match/index.js.map +1 -0
  242. package/dist/interactions/match/types.d.ts +0 -1
  243. package/dist/interactions/match/types.js +1 -0
  244. package/dist/interactions/match/types.js.map +1 -0
  245. package/dist/interactions/media/extractor.d.ts +0 -1
  246. package/dist/interactions/media/extractor.js +1 -0
  247. package/dist/interactions/media/extractor.js.map +1 -0
  248. package/dist/interactions/media/index.d.ts +0 -1
  249. package/dist/interactions/media/index.js +1 -0
  250. package/dist/interactions/media/index.js.map +1 -0
  251. package/dist/interactions/media/types.d.ts +0 -1
  252. package/dist/interactions/media/types.js +1 -0
  253. package/dist/interactions/media/types.js.map +1 -0
  254. package/dist/interactions/modules.d.ts +0 -1
  255. package/dist/interactions/modules.js +1 -0
  256. package/dist/interactions/modules.js.map +1 -0
  257. package/dist/interactions/order/extractor.d.ts +0 -1
  258. package/dist/interactions/order/extractor.js +1 -0
  259. package/dist/interactions/order/extractor.js.map +1 -0
  260. package/dist/interactions/order/index.d.ts +0 -1
  261. package/dist/interactions/order/index.js +1 -0
  262. package/dist/interactions/order/index.js.map +1 -0
  263. package/dist/interactions/order/types.d.ts +0 -1
  264. package/dist/interactions/order/types.js +1 -0
  265. package/dist/interactions/order/types.js.map +1 -0
  266. package/dist/interactions/portable-custom/extractor.d.ts +0 -1
  267. package/dist/interactions/portable-custom/extractor.js +1 -0
  268. package/dist/interactions/portable-custom/extractor.js.map +1 -0
  269. package/dist/interactions/portable-custom/index.d.ts +0 -1
  270. package/dist/interactions/portable-custom/index.js +1 -0
  271. package/dist/interactions/portable-custom/index.js.map +1 -0
  272. package/dist/interactions/portable-custom/types.d.ts +0 -1
  273. package/dist/interactions/portable-custom/types.js +1 -0
  274. package/dist/interactions/portable-custom/types.js.map +1 -0
  275. package/dist/interactions/position-object/extractor.d.ts +0 -1
  276. package/dist/interactions/position-object/extractor.js +1 -0
  277. package/dist/interactions/position-object/extractor.js.map +1 -0
  278. package/dist/interactions/position-object/index.d.ts +0 -1
  279. package/dist/interactions/position-object/index.js +1 -0
  280. package/dist/interactions/position-object/index.js.map +1 -0
  281. package/dist/interactions/position-object/types.d.ts +0 -1
  282. package/dist/interactions/position-object/types.js +1 -0
  283. package/dist/interactions/position-object/types.js.map +1 -0
  284. package/dist/interactions/select-point/extractor.d.ts +0 -1
  285. package/dist/interactions/select-point/extractor.js +1 -0
  286. package/dist/interactions/select-point/extractor.js.map +1 -0
  287. package/dist/interactions/select-point/index.d.ts +0 -1
  288. package/dist/interactions/select-point/index.js +1 -0
  289. package/dist/interactions/select-point/index.js.map +1 -0
  290. package/dist/interactions/select-point/types.d.ts +0 -1
  291. package/dist/interactions/select-point/types.js +1 -0
  292. package/dist/interactions/select-point/types.js.map +1 -0
  293. package/dist/interactions/shared/index.d.ts +0 -1
  294. package/dist/interactions/shared/index.js +1 -0
  295. package/dist/interactions/shared/index.js.map +1 -0
  296. package/dist/interactions/shared/types.d.ts +0 -1
  297. package/dist/interactions/shared/types.js +1 -0
  298. package/dist/interactions/shared/types.js.map +1 -0
  299. package/dist/interactions/slider/extractor.d.ts +0 -1
  300. package/dist/interactions/slider/extractor.js +1 -0
  301. package/dist/interactions/slider/extractor.js.map +1 -0
  302. package/dist/interactions/slider/index.d.ts +0 -1
  303. package/dist/interactions/slider/index.js +1 -0
  304. package/dist/interactions/slider/index.js.map +1 -0
  305. package/dist/interactions/slider/types.d.ts +0 -1
  306. package/dist/interactions/slider/types.js +1 -0
  307. package/dist/interactions/slider/types.js.map +1 -0
  308. package/dist/interactions/text-entry/extractor.d.ts +0 -1
  309. package/dist/interactions/text-entry/extractor.js +1 -0
  310. package/dist/interactions/text-entry/extractor.js.map +1 -0
  311. package/dist/interactions/text-entry/index.d.ts +0 -1
  312. package/dist/interactions/text-entry/index.js +1 -0
  313. package/dist/interactions/text-entry/index.js.map +1 -0
  314. package/dist/interactions/text-entry/types.d.ts +0 -1
  315. package/dist/interactions/text-entry/types.js +1 -0
  316. package/dist/interactions/text-entry/types.js.map +1 -0
  317. package/dist/interactions/upload/extractor.d.ts +0 -1
  318. package/dist/interactions/upload/extractor.js +1 -0
  319. package/dist/interactions/upload/extractor.js.map +1 -0
  320. package/dist/interactions/upload/index.d.ts +0 -1
  321. package/dist/interactions/upload/index.js +1 -0
  322. package/dist/interactions/upload/index.js.map +1 -0
  323. package/dist/interactions/upload/types.d.ts +0 -1
  324. package/dist/interactions/upload/types.js +1 -0
  325. package/dist/interactions/upload/types.js.map +1 -0
  326. package/dist/pci/PciHost.d.ts +0 -1
  327. package/dist/pci/PciHost.js +1 -0
  328. package/dist/pci/PciHost.js.map +1 -0
  329. package/dist/pci/types.d.ts +0 -1
  330. package/dist/pci/types.js +1 -0
  331. package/dist/pci/types.js.map +1 -0
  332. package/dist/pnp/applyPnp.d.ts +0 -1
  333. package/dist/pnp/applyPnp.js +1 -0
  334. package/dist/pnp/applyPnp.js.map +1 -0
  335. package/dist/pnp/parsePnpXml.d.ts +0 -1
  336. package/dist/pnp/parsePnpXml.js +1 -0
  337. package/dist/pnp/parsePnpXml.js.map +1 -0
  338. package/dist/pnp/types.d.ts +0 -1
  339. package/dist/pnp/types.js +1 -0
  340. package/dist/pnp/types.js.map +1 -0
  341. package/dist/presentation/itemPresentationPlan.d.ts +53 -0
  342. package/dist/presentation/itemPresentationPlan.js +98 -0
  343. package/dist/presentation/itemPresentationPlan.js.map +1 -0
  344. package/dist/server.d.ts +0 -1
  345. package/dist/server.js +1 -0
  346. package/dist/server.js.map +1 -0
  347. package/dist/types/index.d.ts +17 -3
  348. package/dist/types/index.js +1 -3
  349. package/dist/types/index.js.map +1 -0
  350. package/dist/types/responseValidation.d.ts +0 -1
  351. package/dist/types/responseValidation.js +1 -0
  352. package/dist/types/responseValidation.js.map +1 -0
  353. package/dist/utils/PerformanceMonitor.d.ts +0 -1
  354. package/dist/utils/PerformanceMonitor.js +1 -0
  355. package/dist/utils/PerformanceMonitor.js.map +1 -0
  356. package/dist/utils/drawingUtils.d.ts +0 -1
  357. package/dist/utils/drawingUtils.js +1 -0
  358. package/dist/utils/drawingUtils.js.map +1 -0
  359. package/dist/utils/responseUtils.d.ts +0 -1
  360. package/dist/utils/responseUtils.js +1 -0
  361. package/dist/utils/responseUtils.js.map +1 -0
  362. package/dist/web-components/QTIInteractionBase.d.ts +1 -2
  363. package/dist/web-components/QTIInteractionBase.js +1 -0
  364. package/dist/web-components/QTIInteractionBase.js.map +1 -0
  365. package/dist/web-components/QTIInteractionElement.d.ts +1 -2
  366. package/dist/web-components/QTIInteractionElement.js +1 -0
  367. package/dist/web-components/QTIInteractionElement.js.map +1 -0
  368. package/dist/web-components/index.d.ts +0 -1
  369. package/dist/web-components/index.js +1 -0
  370. package/dist/web-components/index.js.map +1 -0
  371. package/package.json +7 -14
  372. package/dist/catalog/applyGlossaryTriggers.d.ts.map +0 -1
  373. package/dist/catalog/catalogExtractor.d.ts.map +0 -1
  374. package/dist/catalog/catalogLookup.d.ts.map +0 -1
  375. package/dist/catalog/glossaryAction.d.ts.map +0 -1
  376. package/dist/catalog/types.d.ts.map +0 -1
  377. package/dist/components/actions/typesetAction.d.ts.map +0 -1
  378. package/dist/components/utils/assignProps.d.ts +0 -2
  379. package/dist/components/utils/assignProps.d.ts.map +0 -1
  380. package/dist/components/utils/assignProps.js +0 -1
  381. package/dist/components/utils/feedbackUtils.d.ts.map +0 -1
  382. package/dist/components/utils/index.d.ts.map +0 -1
  383. package/dist/components/utils/stimulusRender.d.ts.map +0 -1
  384. package/dist/components/utils/stylesheetRender.d.ts.map +0 -1
  385. package/dist/core/ComponentRegistry.d.ts.map +0 -1
  386. package/dist/core/ItemRenderer.d.ts +0 -91
  387. package/dist/core/ItemRenderer.d.ts.map +0 -1
  388. package/dist/core/ItemRenderer.js +0 -248
  389. package/dist/core/Player.d.ts.map +0 -1
  390. package/dist/core/Plugin.d.ts.map +0 -1
  391. package/dist/core/PluginManager.d.ts.map +0 -1
  392. package/dist/core/constants.d.ts.map +0 -1
  393. package/dist/core/declarations.d.ts.map +0 -1
  394. package/dist/core/parsingLimits.d.ts.map +0 -1
  395. package/dist/core/random.d.ts.map +0 -1
  396. package/dist/core/rolePolicy.d.ts.map +0 -1
  397. package/dist/core/sanitizer.d.ts.map +0 -1
  398. package/dist/core/trustedTypes.d.ts.map +0 -1
  399. package/dist/core/urlPolicy.d.ts.map +0 -1
  400. package/dist/document/AssessmentItemDocument.d.ts.map +0 -1
  401. package/dist/extensions/MathLiveEditor.d.ts.map +0 -1
  402. package/dist/extraction/ExtractionRegistry.d.ts.map +0 -1
  403. package/dist/extraction/createContext.d.ts.map +0 -1
  404. package/dist/extraction/extractors/associateExtractor.d.ts +0 -2
  405. package/dist/extraction/extractors/associateExtractor.d.ts.map +0 -1
  406. package/dist/extraction/extractors/associateExtractor.js +0 -1
  407. package/dist/extraction/extractors/choiceExtractor.d.ts +0 -2
  408. package/dist/extraction/extractors/choiceExtractor.d.ts.map +0 -1
  409. package/dist/extraction/extractors/choiceExtractor.js +0 -1
  410. package/dist/extraction/extractors/customExtractor.d.ts +0 -2
  411. package/dist/extraction/extractors/customExtractor.d.ts.map +0 -1
  412. package/dist/extraction/extractors/customExtractor.js +0 -1
  413. package/dist/extraction/extractors/drawingExtractor.d.ts +0 -2
  414. package/dist/extraction/extractors/drawingExtractor.d.ts.map +0 -1
  415. package/dist/extraction/extractors/drawingExtractor.js +0 -1
  416. package/dist/extraction/extractors/endAttemptExtractor.d.ts +0 -2
  417. package/dist/extraction/extractors/endAttemptExtractor.d.ts.map +0 -1
  418. package/dist/extraction/extractors/endAttemptExtractor.js +0 -1
  419. package/dist/extraction/extractors/extendedTextExtractor.d.ts +0 -2
  420. package/dist/extraction/extractors/extendedTextExtractor.d.ts.map +0 -1
  421. package/dist/extraction/extractors/extendedTextExtractor.js +0 -1
  422. package/dist/extraction/extractors/gapMatchExtractor.d.ts +0 -2
  423. package/dist/extraction/extractors/gapMatchExtractor.d.ts.map +0 -1
  424. package/dist/extraction/extractors/gapMatchExtractor.js +0 -1
  425. package/dist/extraction/extractors/graphicAssociateExtractor.d.ts +0 -2
  426. package/dist/extraction/extractors/graphicAssociateExtractor.d.ts.map +0 -1
  427. package/dist/extraction/extractors/graphicAssociateExtractor.js +0 -1
  428. package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts +0 -2
  429. package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts.map +0 -1
  430. package/dist/extraction/extractors/graphicGapMatchExtractor.js +0 -1
  431. package/dist/extraction/extractors/graphicOrderExtractor.d.ts +0 -2
  432. package/dist/extraction/extractors/graphicOrderExtractor.d.ts.map +0 -1
  433. package/dist/extraction/extractors/graphicOrderExtractor.js +0 -1
  434. package/dist/extraction/extractors/hotspotExtractor.d.ts +0 -2
  435. package/dist/extraction/extractors/hotspotExtractor.d.ts.map +0 -1
  436. package/dist/extraction/extractors/hotspotExtractor.js +0 -1
  437. package/dist/extraction/extractors/hottextExtractor.d.ts +0 -2
  438. package/dist/extraction/extractors/hottextExtractor.d.ts.map +0 -1
  439. package/dist/extraction/extractors/hottextExtractor.js +0 -1
  440. package/dist/extraction/extractors/index.d.ts +0 -9
  441. package/dist/extraction/extractors/index.d.ts.map +0 -1
  442. package/dist/extraction/extractors/index.js +0 -8
  443. package/dist/extraction/extractors/inlineChoiceExtractor.d.ts +0 -2
  444. package/dist/extraction/extractors/inlineChoiceExtractor.d.ts.map +0 -1
  445. package/dist/extraction/extractors/inlineChoiceExtractor.js +0 -1
  446. package/dist/extraction/extractors/matchExtractor.d.ts +0 -2
  447. package/dist/extraction/extractors/matchExtractor.d.ts.map +0 -1
  448. package/dist/extraction/extractors/matchExtractor.js +0 -1
  449. package/dist/extraction/extractors/mediaExtractor.d.ts +0 -2
  450. package/dist/extraction/extractors/mediaExtractor.d.ts.map +0 -1
  451. package/dist/extraction/extractors/mediaExtractor.js +0 -1
  452. package/dist/extraction/extractors/orderExtractor.d.ts +0 -2
  453. package/dist/extraction/extractors/orderExtractor.d.ts.map +0 -1
  454. package/dist/extraction/extractors/orderExtractor.js +0 -1
  455. package/dist/extraction/extractors/portableCustomExtractor.d.ts +0 -2
  456. package/dist/extraction/extractors/portableCustomExtractor.d.ts.map +0 -1
  457. package/dist/extraction/extractors/portableCustomExtractor.js +0 -1
  458. package/dist/extraction/extractors/positionObjectExtractor.d.ts +0 -2
  459. package/dist/extraction/extractors/positionObjectExtractor.d.ts.map +0 -1
  460. package/dist/extraction/extractors/positionObjectExtractor.js +0 -1
  461. package/dist/extraction/extractors/selectPointExtractor.d.ts +0 -2
  462. package/dist/extraction/extractors/selectPointExtractor.d.ts.map +0 -1
  463. package/dist/extraction/extractors/selectPointExtractor.js +0 -1
  464. package/dist/extraction/extractors/sliderExtractor.d.ts +0 -2
  465. package/dist/extraction/extractors/sliderExtractor.d.ts.map +0 -1
  466. package/dist/extraction/extractors/sliderExtractor.js +0 -1
  467. package/dist/extraction/extractors/textEntryExtractor.d.ts +0 -2
  468. package/dist/extraction/extractors/textEntryExtractor.d.ts.map +0 -1
  469. package/dist/extraction/extractors/textEntryExtractor.js +0 -1
  470. package/dist/extraction/extractors/uploadExtractor.d.ts +0 -2
  471. package/dist/extraction/extractors/uploadExtractor.d.ts.map +0 -1
  472. package/dist/extraction/extractors/uploadExtractor.js +0 -1
  473. package/dist/extraction/index.d.ts.map +0 -1
  474. package/dist/extraction/interactionExtractionPipeline.d.ts.map +0 -1
  475. package/dist/extraction/interactionSecurity.d.ts.map +0 -1
  476. package/dist/extraction/types.d.ts.map +0 -1
  477. package/dist/extraction/utils.d.ts.map +0 -1
  478. package/dist/iframe/IFramePlayerHost.d.ts.map +0 -1
  479. package/dist/iframe/index.d.ts.map +0 -1
  480. package/dist/iframe/protocol.d.ts.map +0 -1
  481. package/dist/index.d.ts.map +0 -1
  482. package/dist/interactions/associate/extractor.d.ts.map +0 -1
  483. package/dist/interactions/associate/index.d.ts.map +0 -1
  484. package/dist/interactions/associate/types.d.ts.map +0 -1
  485. package/dist/interactions/choice/extractor.d.ts.map +0 -1
  486. package/dist/interactions/choice/index.d.ts.map +0 -1
  487. package/dist/interactions/choice/types.d.ts.map +0 -1
  488. package/dist/interactions/custom/extractor.d.ts.map +0 -1
  489. package/dist/interactions/custom/index.d.ts.map +0 -1
  490. package/dist/interactions/custom/types.d.ts.map +0 -1
  491. package/dist/interactions/drawing/extractor.d.ts.map +0 -1
  492. package/dist/interactions/drawing/index.d.ts.map +0 -1
  493. package/dist/interactions/drawing/types.d.ts.map +0 -1
  494. package/dist/interactions/end-attempt/extractor.d.ts.map +0 -1
  495. package/dist/interactions/end-attempt/index.d.ts.map +0 -1
  496. package/dist/interactions/end-attempt/types.d.ts.map +0 -1
  497. package/dist/interactions/extended-text/extractor.d.ts.map +0 -1
  498. package/dist/interactions/extended-text/index.d.ts.map +0 -1
  499. package/dist/interactions/extended-text/types.d.ts.map +0 -1
  500. package/dist/interactions/gap-match/extractor.d.ts.map +0 -1
  501. package/dist/interactions/gap-match/index.d.ts.map +0 -1
  502. package/dist/interactions/gap-match/types.d.ts.map +0 -1
  503. package/dist/interactions/graphic-associate/extractor.d.ts.map +0 -1
  504. package/dist/interactions/graphic-associate/index.d.ts.map +0 -1
  505. package/dist/interactions/graphic-associate/types.d.ts.map +0 -1
  506. package/dist/interactions/graphic-gap-match/extractor.d.ts.map +0 -1
  507. package/dist/interactions/graphic-gap-match/index.d.ts.map +0 -1
  508. package/dist/interactions/graphic-gap-match/types.d.ts.map +0 -1
  509. package/dist/interactions/graphic-order/extractor.d.ts.map +0 -1
  510. package/dist/interactions/graphic-order/index.d.ts.map +0 -1
  511. package/dist/interactions/graphic-order/types.d.ts.map +0 -1
  512. package/dist/interactions/hotspot/extractor.d.ts.map +0 -1
  513. package/dist/interactions/hotspot/index.d.ts.map +0 -1
  514. package/dist/interactions/hotspot/types.d.ts.map +0 -1
  515. package/dist/interactions/hottext/extractor.d.ts.map +0 -1
  516. package/dist/interactions/hottext/index.d.ts.map +0 -1
  517. package/dist/interactions/hottext/types.d.ts.map +0 -1
  518. package/dist/interactions/index.d.ts.map +0 -1
  519. package/dist/interactions/inline/index.d.ts.map +0 -1
  520. package/dist/interactions/inline/render-plan.d.ts.map +0 -1
  521. package/dist/interactions/inline-choice/extractor.d.ts.map +0 -1
  522. package/dist/interactions/inline-choice/index.d.ts.map +0 -1
  523. package/dist/interactions/inline-choice/types.d.ts.map +0 -1
  524. package/dist/interactions/match/extractor.d.ts.map +0 -1
  525. package/dist/interactions/match/index.d.ts.map +0 -1
  526. package/dist/interactions/match/types.d.ts.map +0 -1
  527. package/dist/interactions/media/extractor.d.ts.map +0 -1
  528. package/dist/interactions/media/index.d.ts.map +0 -1
  529. package/dist/interactions/media/types.d.ts.map +0 -1
  530. package/dist/interactions/modules.d.ts.map +0 -1
  531. package/dist/interactions/order/extractor.d.ts.map +0 -1
  532. package/dist/interactions/order/index.d.ts.map +0 -1
  533. package/dist/interactions/order/types.d.ts.map +0 -1
  534. package/dist/interactions/portable-custom/extractor.d.ts.map +0 -1
  535. package/dist/interactions/portable-custom/index.d.ts.map +0 -1
  536. package/dist/interactions/portable-custom/types.d.ts.map +0 -1
  537. package/dist/interactions/position-object/extractor.d.ts.map +0 -1
  538. package/dist/interactions/position-object/index.d.ts.map +0 -1
  539. package/dist/interactions/position-object/types.d.ts.map +0 -1
  540. package/dist/interactions/select-point/extractor.d.ts.map +0 -1
  541. package/dist/interactions/select-point/index.d.ts.map +0 -1
  542. package/dist/interactions/select-point/types.d.ts.map +0 -1
  543. package/dist/interactions/shared/index.d.ts.map +0 -1
  544. package/dist/interactions/shared/types.d.ts.map +0 -1
  545. package/dist/interactions/slider/extractor.d.ts.map +0 -1
  546. package/dist/interactions/slider/index.d.ts.map +0 -1
  547. package/dist/interactions/slider/types.d.ts.map +0 -1
  548. package/dist/interactions/text-entry/extractor.d.ts.map +0 -1
  549. package/dist/interactions/text-entry/index.d.ts.map +0 -1
  550. package/dist/interactions/text-entry/types.d.ts.map +0 -1
  551. package/dist/interactions/upload/extractor.d.ts.map +0 -1
  552. package/dist/interactions/upload/index.d.ts.map +0 -1
  553. package/dist/interactions/upload/types.d.ts.map +0 -1
  554. package/dist/pci/PciHost.d.ts.map +0 -1
  555. package/dist/pci/types.d.ts.map +0 -1
  556. package/dist/pnp/applyPnp.d.ts.map +0 -1
  557. package/dist/pnp/parsePnpXml.d.ts.map +0 -1
  558. package/dist/pnp/types.d.ts.map +0 -1
  559. package/dist/server.d.ts.map +0 -1
  560. package/dist/types/index.d.ts.map +0 -1
  561. package/dist/types/interactions.d.ts +0 -8
  562. package/dist/types/interactions.d.ts.map +0 -1
  563. package/dist/types/interactions.js +0 -7
  564. package/dist/types/responseValidation.d.ts.map +0 -1
  565. package/dist/utils/PerformanceMonitor.d.ts.map +0 -1
  566. package/dist/utils/drawingUtils.d.ts.map +0 -1
  567. package/dist/utils/responseUtils.d.ts.map +0 -1
  568. package/dist/utils/touchDragHelper.d.ts +0 -2
  569. package/dist/utils/touchDragHelper.d.ts.map +0 -1
  570. package/dist/utils/touchDragHelper.js +0 -1
  571. package/dist/web-components/QTIInteractionBase.d.ts.map +0 -1
  572. package/dist/web-components/QTIInteractionElement.d.ts.map +0 -1
  573. package/dist/web-components/index.d.ts.map +0 -1
  574. package/src/__tests__/catalog.test.ts +0 -267
  575. package/src/__tests__/fixtures/pci/echo-pci.js +0 -49
  576. package/src/__tests__/pci.test.ts +0 -353
  577. package/src/__tests__/qti3-attribute-extraction.test.ts +0 -174
  578. package/src/__tests__/qti3-debug.test.ts +0 -140
  579. package/src/__tests__/qti3-extraction.test.ts +0 -309
  580. package/src/catalog/applyGlossaryTriggers.ts +0 -372
  581. package/src/catalog/catalogExtractor.ts +0 -130
  582. package/src/catalog/catalogLookup.ts +0 -53
  583. package/src/catalog/glossaryAction.ts +0 -38
  584. package/src/catalog/types.ts +0 -37
  585. package/src/components/ItemBody.svelte +0 -363
  586. package/src/components/ItemPlayer.svelte +0 -163
  587. package/src/components/ModalFeedbackDisplay.svelte +0 -97
  588. package/src/components/actions/typesetAction.ts +0 -74
  589. package/src/components/index.ts +0 -22
  590. package/src/components/utils/assignProps.ts +0 -2
  591. package/src/components/utils/feedbackUtils.ts +0 -140
  592. package/src/components/utils/index.ts +0 -13
  593. package/src/components/utils/stimulusRender.ts +0 -93
  594. package/src/components/utils/stylesheetRender.ts +0 -58
  595. package/src/core/ComponentRegistry.ts +0 -248
  596. package/src/core/Player.ts +0 -1618
  597. package/src/core/Plugin.ts +0 -123
  598. package/src/core/PluginManager.ts +0 -182
  599. package/src/core/constants.ts +0 -117
  600. package/src/core/declarations.ts +0 -171
  601. package/src/core/parsingLimits.ts +0 -62
  602. package/src/core/random.ts +0 -24
  603. package/src/core/rolePolicy.ts +0 -34
  604. package/src/core/sanitizer.ts +0 -305
  605. package/src/core/trustedTypes.ts +0 -63
  606. package/src/core/urlPolicy.ts +0 -98
  607. package/src/document/AssessmentItemDocument.ts +0 -247
  608. package/src/element.ts +0 -128
  609. package/src/extensions/MathLiveEditor.ts +0 -313
  610. package/src/extraction/ExtractionRegistry.ts +0 -335
  611. package/src/extraction/createContext.ts +0 -52
  612. package/src/extraction/extractors/associateExtractor.ts +0 -1
  613. package/src/extraction/extractors/choiceExtractor.ts +0 -1
  614. package/src/extraction/extractors/conformance-qti3-advanced.test.ts +0 -239
  615. package/src/extraction/extractors/conformance-qti3-basic.test.ts +0 -82
  616. package/src/extraction/extractors/conformance.test.ts +0 -208
  617. package/src/extraction/extractors/customExtractor.ts +0 -1
  618. package/src/extraction/extractors/drawingExtractor.ts +0 -1
  619. package/src/extraction/extractors/endAttemptExtractor.ts +0 -1
  620. package/src/extraction/extractors/extendedTextExtractor.ts +0 -1
  621. package/src/extraction/extractors/gapMatchExtractor.ts +0 -1
  622. package/src/extraction/extractors/graphicAssociateExtractor.ts +0 -1
  623. package/src/extraction/extractors/graphicGapMatchExtractor.ts +0 -1
  624. package/src/extraction/extractors/graphicOrderExtractor.ts +0 -1
  625. package/src/extraction/extractors/hotspotExtractor.ts +0 -1
  626. package/src/extraction/extractors/hottextExtractor.ts +0 -1
  627. package/src/extraction/extractors/index.ts +0 -9
  628. package/src/extraction/extractors/inlineChoiceExtractor.ts +0 -1
  629. package/src/extraction/extractors/matchExtractor.ts +0 -1
  630. package/src/extraction/extractors/mediaExtractor.ts +0 -1
  631. package/src/extraction/extractors/orderExtractor.ts +0 -1
  632. package/src/extraction/extractors/portableCustomExtractor.ts +0 -1
  633. package/src/extraction/extractors/positionObjectExtractor.ts +0 -1
  634. package/src/extraction/extractors/selectPointExtractor.ts +0 -1
  635. package/src/extraction/extractors/sliderExtractor.ts +0 -1
  636. package/src/extraction/extractors/textEntryExtractor.ts +0 -1
  637. package/src/extraction/extractors/uploadExtractor.ts +0 -1
  638. package/src/extraction/index.ts +0 -108
  639. package/src/extraction/interactionExtractionPipeline.ts +0 -70
  640. package/src/extraction/interactionSecurity.ts +0 -60
  641. package/src/extraction/types.ts +0 -246
  642. package/src/extraction/utils.ts +0 -243
  643. package/src/iframe/IFramePlayerHost.ts +0 -265
  644. package/src/iframe/index.ts +0 -11
  645. package/src/iframe/protocol.ts +0 -137
  646. package/src/index.ts +0 -101
  647. package/src/interactions/associate/extractor.ts +0 -133
  648. package/src/interactions/associate/index.ts +0 -2
  649. package/src/interactions/associate/types.ts +0 -1
  650. package/src/interactions/choice/extractor.ts +0 -121
  651. package/src/interactions/choice/index.ts +0 -2
  652. package/src/interactions/choice/types.ts +0 -1
  653. package/src/interactions/custom/extractor.ts +0 -72
  654. package/src/interactions/custom/index.ts +0 -2
  655. package/src/interactions/custom/types.ts +0 -1
  656. package/src/interactions/drawing/extractor.ts +0 -113
  657. package/src/interactions/drawing/index.ts +0 -2
  658. package/src/interactions/drawing/types.ts +0 -1
  659. package/src/interactions/end-attempt/extractor.ts +0 -74
  660. package/src/interactions/end-attempt/index.ts +0 -2
  661. package/src/interactions/end-attempt/types.ts +0 -1
  662. package/src/interactions/extended-text/extractor.ts +0 -92
  663. package/src/interactions/extended-text/index.ts +0 -2
  664. package/src/interactions/extended-text/types.ts +0 -1
  665. package/src/interactions/gap-match/extractor.ts +0 -193
  666. package/src/interactions/gap-match/index.ts +0 -2
  667. package/src/interactions/gap-match/types.ts +0 -1
  668. package/src/interactions/graphic-associate/extractor.ts +0 -192
  669. package/src/interactions/graphic-associate/index.ts +0 -2
  670. package/src/interactions/graphic-associate/types.ts +0 -1
  671. package/src/interactions/graphic-gap-match/extractor.ts +0 -257
  672. package/src/interactions/graphic-gap-match/index.ts +0 -2
  673. package/src/interactions/graphic-gap-match/types.ts +0 -1
  674. package/src/interactions/graphic-order/extractor.ts +0 -162
  675. package/src/interactions/graphic-order/index.ts +0 -2
  676. package/src/interactions/graphic-order/types.ts +0 -1
  677. package/src/interactions/hotspot/extractor.ts +0 -208
  678. package/src/interactions/hotspot/index.ts +0 -2
  679. package/src/interactions/hotspot/types.ts +0 -1
  680. package/src/interactions/hottext/extractor.ts +0 -163
  681. package/src/interactions/hottext/index.ts +0 -2
  682. package/src/interactions/hottext/types.ts +0 -1
  683. package/src/interactions/index.ts +0 -52
  684. package/src/interactions/inline/index.ts +0 -1
  685. package/src/interactions/inline/render-plan.ts +0 -105
  686. package/src/interactions/inline-choice/InlineChoice.svelte +0 -57
  687. package/src/interactions/inline-choice/extractor.ts +0 -105
  688. package/src/interactions/inline-choice/index.ts +0 -2
  689. package/src/interactions/inline-choice/types.ts +0 -1
  690. package/src/interactions/match/extractor.ts +0 -187
  691. package/src/interactions/match/index.ts +0 -2
  692. package/src/interactions/match/types.ts +0 -1
  693. package/src/interactions/media/extractor.ts +0 -168
  694. package/src/interactions/media/index.ts +0 -2
  695. package/src/interactions/media/types.ts +0 -1
  696. package/src/interactions/modules.ts +0 -111
  697. package/src/interactions/order/extractor.ts +0 -120
  698. package/src/interactions/order/index.ts +0 -2
  699. package/src/interactions/order/types.ts +0 -1
  700. package/src/interactions/portable-custom/extractor.ts +0 -122
  701. package/src/interactions/portable-custom/index.ts +0 -2
  702. package/src/interactions/portable-custom/types.ts +0 -1
  703. package/src/interactions/position-object/extractor.ts +0 -243
  704. package/src/interactions/position-object/index.ts +0 -2
  705. package/src/interactions/position-object/types.ts +0 -1
  706. package/src/interactions/select-point/extractor.ts +0 -143
  707. package/src/interactions/select-point/index.ts +0 -2
  708. package/src/interactions/select-point/types.ts +0 -1
  709. package/src/interactions/shared/index.ts +0 -1
  710. package/src/interactions/shared/types.ts +0 -430
  711. package/src/interactions/slider/extractor.ts +0 -102
  712. package/src/interactions/slider/index.ts +0 -2
  713. package/src/interactions/slider/types.ts +0 -1
  714. package/src/interactions/text-entry/InlineTextEntry.svelte +0 -75
  715. package/src/interactions/text-entry/extractor.ts +0 -79
  716. package/src/interactions/text-entry/index.ts +0 -2
  717. package/src/interactions/text-entry/types.ts +0 -1
  718. package/src/interactions/upload/extractor.ts +0 -81
  719. package/src/interactions/upload/index.ts +0 -2
  720. package/src/interactions/upload/types.ts +0 -1
  721. package/src/pci/PciHost.ts +0 -138
  722. package/src/pci/types.ts +0 -70
  723. package/src/pnp/applyPnp.ts +0 -29
  724. package/src/pnp/parsePnpXml.ts +0 -215
  725. package/src/pnp/types.ts +0 -75
  726. package/src/server.ts +0 -14
  727. package/src/types/index.ts +0 -388
  728. package/src/types/interactions.ts +0 -8
  729. package/src/types/responseValidation.ts +0 -29
  730. package/src/types/xmldom.d.ts +0 -12
  731. package/src/utils/PerformanceMonitor.ts +0 -335
  732. package/src/utils/drawingUtils.ts +0 -73
  733. package/src/utils/responseUtils.ts +0 -51
  734. package/src/utils/touchDragHelper.ts +0 -1
  735. package/src/web-components/QTIInteractionBase.ts +0 -303
  736. package/src/web-components/QTIInteractionElement.ts +0 -125
  737. package/src/web-components/index.ts +0 -22
@@ -0,0 +1 @@
1
+ {"version":3,"file":"itemPresentationPlan.js","sourceRoot":"","sources":["../../src/presentation/itemPresentationPlan.ts"],"names":[],"mappings":"AACA,OAAO,EACN,yBAAyB,GAEzB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,mBAAmB,EAAyB,MAAM,uBAAuB,CAAC;AAEnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC7G,OAAO,EACN,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,GAEvB,MAAM,uCAAuC,CAAC;AAqD/C,MAAM,UAAU,0BAA0B,CAAC,EAC1C,MAAM,EACN,SAAS,GAAG,EAAE,EACd,QAAQ,GAAG,KAAK,EAChB,IAAI,GAAG,WAAW,EAClB,aAAa,GAAG,EAAE,EAClB,gBAAgB,EAChB,eAAe,GAAG,EAAE,EACpB,eAAe,EACf,qBAAqB,GAAG,4BAA4B,EACpD,gBAAgB,GACmB;IACnC,MAAM,YAAY,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC;IACjD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,iBAAiB,GAAG,QAAQ,IAAI,gBAAgB,CAAC,UAAU,CAAC;IAClE,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,uBAAuB,CAAC,C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,MAAM,EAAE,EAAE,SAAS,EAAE,eAAe,KAAK,IAAI;gBACrE,QAAQ,EAAE,iBAAiB;gBAC3B,aAAa,EAAE,gBAAgB,CAAC,uBAAuB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;aAC9E,CAAC;YACF,OAAO,KAAK,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,gBAAgB,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;YACvC,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,IAAI,EAAwC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,WAA4B;IAC1D,MAAM,cAAc,GAAG,WAAkB,CAAC;IAC1C,MAAM,GAAG,GACR,KAAK,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;QAC1E,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAC3F,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,MAAM,GAAG,OAAO,cAAc,EAAE,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACvF,OAAO,GAAG,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,UAAU,IAAI,GAAG,IAAI,MAAM,EAAE,CAAC;AACzE,CAAC","sourcesContent":["import type { ResolvedItemDeliveryContext } from '@pie-qti/ims-cp-core';\nimport {\n\tnormalizeHeuristicsConfig,\n\ttype QtiHeuristicsConfig,\n} from '@pie-qti/ims-cp-core';\nimport type { PnpProfile } from '../pnp/types.js';\nimport { getRoleCapabilities, type RoleCapabilities } from '../core/rolePolicy.js';\nimport type { InteractionData, HtmlContent, QTIRole } from '../types/index.js';\nimport { processFeedbackInline } from '../components/utils/feedbackUtils.js';\nimport { buildScopedStylesheetCss } from '../components/utils/stylesheetRender.js';\nimport { buildEffectiveStimulusContent, injectStimulusContent } from '../components/utils/stimulusRender.js';\nimport {\n\tcreateInlineRenderPlan,\n\tisInlineInteractionTagName,\n\tisInlineInteractionType,\n\ttype InlineRenderSegment,\n} from '../interactions/inline/render-plan.js';\n\nexport type ItemPresentationResponseValue = unknown;\nexport type ItemPresentationResponseMap = Record<string, ItemPresentationResponseValue>;\n\nexport interface ItemPresentationComponentRegistry {\n\tgetTagName(interaction: InteractionData): string;\n}\n\nexport interface ItemPresentationPlayer {\n\tgetComponentRegistry(): ItemPresentationComponentRegistry;\n\tgetInteractionData(): InteractionData[];\n\tgetCorrectResponses(): Record<string, unknown>;\n\tgetItemBodyHtml(): HtmlContent;\n\tgetDeliveryContext(): ResolvedItemDeliveryContext | undefined;\n\tsanitizeHtmlContent(html: string): string;\n\tgetPnp(): PnpProfile | undefined;\n}\n\nexport interface CreateItemPresentationPlanOptions {\n\tplayer: ItemPresentationPlayer;\n\tresponses?: ItemPresentationResponseMap;\n\tdisabled?: boolean;\n\trole?: QTIRole;\n\toutcomeValues?: Record<string, unknown>;\n\theuristicsConfig?: QtiHeuristicsConfig;\n\tstimulusContent?: Record<string, string>;\n\tdeliveryContext?: ResolvedItemDeliveryContext;\n\titemBodyScopeSelector?: string;\n\tonComponentError?: (interaction: InteractionData, error: unknown) => void;\n}\n\nexport interface BlockInteractionPresentation {\n\tinteraction: InteractionData;\n\ttagName: string;\n\tkey: string;\n\tresponse: ItemPresentationResponseValue | null;\n\tcorrectResponse: unknown;\n\tpnp: PnpProfile | undefined;\n\teliminationTool: boolean;\n\tdisabled: boolean;\n\tcomponentRole: 'scorer' | undefined;\n}\n\nexport interface ItemPresentationPlan {\n\troleCapabilities: RoleCapabilities;\n\teffectiveDisabled: boolean;\n\tcorrectResponses: Record<string, unknown>;\n\titemBodyHtml: string;\n\tinlineSegments: InlineRenderSegment[];\n\tblockInteractions: BlockInteractionPresentation[];\n}\n\nexport function createItemPresentationPlan({\n\tplayer,\n\tresponses = {},\n\tdisabled = false,\n\trole = 'candidate',\n\toutcomeValues = {},\n\theuristicsConfig,\n\tstimulusContent = {},\n\tdeliveryContext,\n\titemBodyScopeSelector = '[data-qti-item-body-scope]',\n\tonComponentError,\n}: CreateItemPresentationPlanOptions): ItemPresentationPlan {\n\tconst interactions = player.getInteractionData();\n\tconst roleCapabilities = getRoleCapabilities(role);\n\tconst effectiveDisabled = disabled || roleCapabilities.isReadOnly;\n\tconst correctResponses = roleCapabilities.canViewCorrectResponses ? player.getCorrectResponses() : {};\n\tconst itemBodyHtml = buildItemBodyPresentationHtml({\n\t\tplayer,\n\t\toutcomeValues,\n\t\theuristicsConfig,\n\t\tstimulusContent,\n\t\tdeliveryContext,\n\t\titemBodyScopeSelector,\n\t});\n\n\treturn {\n\t\troleCapabilities,\n\t\teffectiveDisabled,\n\t\tcorrectResponses,\n\t\titemBodyHtml,\n\t\tinlineSegments: createInlineRenderPlan(itemBodyHtml, interactions),\n\t\tblockInteractions: createBlockInteractionPresentations({\n\t\t\tinteractions,\n\t\t\tplayer,\n\t\t\tresponses,\n\t\t\tcorrectResponses,\n\t\t\troleCapabilities,\n\t\t\teffectiveDisabled,\n\t\t\tonComponentError,\n\t\t}),\n\t};\n}\n\nfunction buildItemBodyPresentationHtml({\n\tplayer,\n\toutcomeValues,\n\theuristicsConfig,\n\tstimulusContent,\n\tdeliveryContext,\n\titemBodyScopeSelector,\n}: {\n\tplayer: ItemPresentationPlayer;\n\toutcomeValues: Record<string, unknown>;\n\theuristicsConfig: QtiHeuristicsConfig | undefined;\n\tstimulusContent: Record<string, string>;\n\tdeliveryContext: ResolvedItemDeliveryContext | undefined;\n\titemBodyScopeSelector: string;\n}): string {\n\tlet html = String(player.getItemBodyHtml());\n\tconst resolvedDeliveryContext = deliveryContext ?? player.getDeliveryContext();\n\tconst stylesheetCss = buildScopedStylesheetCss(resolvedDeliveryContext, itemBodyScopeSelector);\n\tconst effectiveStimulusContent = buildEffectiveStimulusContent(\n\t\tresolvedDeliveryContext,\n\t\tstimulusContent,\n\t\t(content) => player.sanitizeHtmlContent(content)\n\t);\n\n\thtml = injectStimulusContent(html, effectiveStimulusContent);\n\tif (stylesheetCss) {\n\t\thtml = `<style data-qti-stylesheets=\"resolved\">${stylesheetCss}</style>${html}`;\n\t}\n\n\tconst heuristics = normalizeHeuristicsConfig(heuristicsConfig);\n\thtml = processFeedbackInline(html, {\n\t\toutcomeValues,\n\t\tapplyHeuristics: heuristics.feedbackTextFormatting,\n\t\twrapWithSpan: false,\n\t});\n\n\treturn hideBlockInteractionMarkup(html);\n}\n\nfunction hideBlockInteractionMarkup(html: string): string {\n\treturn html.replace(\n\t\t/<(\\w+Interaction|qti-[\\w-]+-interaction)(\\s[^>]*)?>[\\s\\S]*?<\\/\\1>/gi,\n\t\t(match, tagName) => {\n\t\t\tconst lower = tagName.toLowerCase();\n\t\t\tif (isInlineInteractionTagName(lower)) return match;\n\t\t\treturn `<span class=\"qti-hidden-interaction\">${match}</span>`;\n\t\t}\n\t);\n}\n\nfunction createBlockInteractionPresentations({\n\tinteractions,\n\tplayer,\n\tresponses,\n\tcorrectResponses,\n\troleCapabilities,\n\teffectiveDisabled,\n\tonComponentError,\n}: {\n\tinteractions: InteractionData[];\n\tplayer: ItemPresentationPlayer;\n\tresponses: ItemPresentationResponseMap;\n\tcorrectResponses: Record<string, unknown>;\n\troleCapabilities: RoleCapabilities;\n\teffectiveDisabled: boolean;\n\tonComponentError?: (interaction: InteractionData, error: unknown) => void;\n}): BlockInteractionPresentation[] {\n\tconst componentRegistry = player.getComponentRegistry();\n\treturn interactions\n\t\t.filter((interaction) => !isInlineInteractionType(interaction.type))\n\t\t.map((interaction) => {\n\t\t\ttry {\n\t\t\t\tconst block: BlockInteractionPresentation = {\n\t\t\t\t\tinteraction,\n\t\t\t\t\ttagName: componentRegistry.getTagName(interaction),\n\t\t\t\t\tkey: interactionKey(interaction),\n\t\t\t\t\tresponse: responses[interaction.responseId] ?? null,\n\t\t\t\t\tcorrectResponse: roleCapabilities.canViewCorrectResponses\n\t\t\t\t\t\t? (correctResponses[interaction.responseId] ?? null)\n\t\t\t\t\t\t: null,\n\t\t\t\t\tpnp: player.getPnp(),\n\t\t\t\t\teliminationTool: player.getPnp()?.cognitive?.eliminationTool === true,\n\t\t\t\t\tdisabled: effectiveDisabled,\n\t\t\t\t\tcomponentRole: roleCapabilities.canViewCorrectResponses ? 'scorer' : undefined,\n\t\t\t\t};\n\t\t\t\treturn block;\n\t\t\t} catch (error) {\n\t\t\t\tonComponentError?.(interaction, error);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t})\n\t\t.filter((item): item is BlockInteractionPresentation => item !== null);\n}\n\nexport function interactionKey(interaction: InteractionData): string {\n\tconst anyInteraction = interaction as any;\n\tconst ids =\n\t\tArray.isArray(anyInteraction?.choices) && anyInteraction.choices.length > 0\n\t\t\t? anyInteraction.choices.map((choice: any) => choice?.identifier).filter(Boolean).join(',')\n\t\t\t: '';\n\tconst prompt = typeof anyInteraction?.prompt === 'string' ? anyInteraction.prompt : '';\n\treturn `${interaction.type}|${interaction.responseId}|${ids}|${prompt}`;\n}\n"]}
package/dist/server.d.ts CHANGED
@@ -7,4 +7,3 @@
7
7
  export * from './core/constants.js';
8
8
  export * from './core/declarations.js';
9
9
  export { Player } from './core/Player.js';
10
- //# sourceMappingURL=server.d.ts.map
package/dist/server.js CHANGED
@@ -8,3 +8,4 @@
8
8
  export * from './core/constants.js';
9
9
  export * from './core/declarations.js';
10
10
  export { Player } from './core/Player.js';
11
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,gEAAgE;AAChE,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["/**\n * Server-safe entrypoint for @pie-qti/item-player\n *\n * This module must remain free of browser/DOM globals (document, window, HTMLElement).\n * Use it from SSR / backend code (e.g. SvelteKit endpoints) for scoring and parsing.\n */\n\n\n// These are used by scoring/processing and are DOM-independent.\nexport * from './core/constants.js';\nexport * from './core/declarations.js';\nexport { Player } from './core/Player.js';\n\n\n"]}
@@ -91,7 +91,22 @@ export interface SerializedItemSessionState {
91
91
  validationMessages: ResponseValidationResult['issues'];
92
92
  savedAt: string;
93
93
  }
94
- export type ItemSessionAction = 'suspendAttempt' | 'endAttempt' | 'scoreAttempt' | 'newTemplate';
94
+ export type ItemSessionAction = 'suspendAttempt' | 'endAttempt' | 'scoreAttempt' | 'newTemplate' | 'submitAttempt';
95
+ export type ItemSessionActionCommand = {
96
+ action: 'suspendAttempt';
97
+ } | {
98
+ action: 'endAttempt';
99
+ countAttempt?: boolean;
100
+ validateResponses?: boolean;
101
+ } | {
102
+ action: 'scoreAttempt';
103
+ } | {
104
+ action: 'newTemplate';
105
+ resetResponses?: boolean;
106
+ } | {
107
+ action: 'submitAttempt';
108
+ countAttempt?: boolean;
109
+ };
95
110
  export interface ItemSessionActionResult {
96
111
  action: ItemSessionAction;
97
112
  lifecycleStatus: ItemLifecycleStatus;
@@ -346,6 +361,5 @@ export interface InteractionContext {
346
361
  shuffle?: boolean;
347
362
  orientation?: 'horizontal' | 'vertical';
348
363
  }
349
- export * from './interactions.js';
364
+ export type * from '../interactions/index.js';
350
365
  export * from './responseValidation.js';
351
- //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,5 @@
1
1
  /**
2
2
  * Core QTI types for the player
3
3
  */
4
- // Interaction data shapes for the component/plugin system.
5
- // Exported here so consumers can import them from `@pie-qti/item-player`.
6
- export * from './interactions.js';
7
4
  export * from './responseValidation.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AA6YH,cAAc,yBAAyB,CAAC","sourcesContent":["/**\n * Core QTI types for the player\n */\n\nimport type {\n\tBaseType as ProcessingBaseType,\n\tCardinality as ProcessingCardinality,\n\tQtiValue,\n} from '@pie-qti/qti-processing';\nimport type { ResolvedItemDeliveryContext } from '@pie-qti/ims-cp-core';\nimport type { ResponseValidationResult } from './responseValidation.js';\n\n/**\n * QTI base type identifier\n * Extensible string type allows custom base types\n */\nexport type VariableBaseType = ProcessingBaseType;\n\n/**\n * QTI cardinality identifier\n * Extensible string type allows custom cardinality values\n */\nexport type VariableCardinality = ProcessingCardinality;\n\nexport interface VariableDeclaration {\n\tidentifier: string;\n\tbaseType: VariableBaseType;\n\tcardinality: VariableCardinality;\n\tvalue: any;\n\tdefaultValue?: any;\n\tmapping?: Mapping;\n\tareaMapping?: AreaMapping;\n}\n\nexport interface Mapping {\n\tdefaultValue?: number;\n\tlowerBound?: number;\n\tupperBound?: number;\n\t/**\n\t * QTI attribute on <mapping>. When \"false\", string mappings are case-insensitive by default.\n\t * Stored as raw string to match XML attribute values (\"true\"/\"false\").\n\t */\n\tcaseSensitive?: string;\n\tentries: Record<string, MapEntry>;\n}\n\nexport interface MapEntry {\n\tmapKey: string;\n\tmappedValue: number;\n\tcaseSensitive?: string;\n}\n\nexport interface AreaMapping {\n\tdefaultValue?: number;\n\tlowerBound?: number;\n\tupperBound?: number;\n\tentries: AreaMapEntry[];\n}\n\nexport interface AreaMapEntry {\n\tshape: 'circle' | 'rect' | 'poly' | 'ellipse' | 'default';\n\tcoords: string;\n\tmappedValue: number;\n}\n\nexport interface ResponseDeclaration extends VariableDeclaration {\n\tcorrectResponse?: any;\n}\n\nexport interface OutcomeDeclaration extends VariableDeclaration {\n\tinterpretation?: string;\n\tlongInterpretation?: string;\n\tnormalMaximum?: number;\n\tnormalMinimum?: number;\n\tmasteryValue?: number;\n\tviews?: string[];\n}\n\nexport interface ItemSessionState {\n\t[variableId: string]: any;\n}\n\nexport type ItemLifecycleStatus = 'initial' | 'interacting' | 'suspended' | 'closed' | 'review' | 'solution' | 'answer';\n\nexport type SerializedVariableKind = 'response' | 'outcome' | 'template' | 'context';\n\nexport interface SerializedItemSessionVariable {\n\tidentifier: string;\n\tkind: SerializedVariableKind;\n\tbaseType: VariableBaseType;\n\tcardinality: VariableCardinality;\n\tvalue: any;\n\tdefaultValue?: any;\n}\n\nexport interface SerializedItemSessionState {\n\titemIdentifier?: string;\n\tsessionGuid: string;\n\tlifecycleStatus: ItemLifecycleStatus;\n\tcompletionStatus: CompletionStatus;\n\tnumAttempts: number;\n\t/**\n\t * Time-on-task in milliseconds, stored as the QTI built-in duration variable value.\n\t */\n\tduration: number;\n\tresponseVariables: Record<string, SerializedItemSessionVariable>;\n\toutcomeVariables: Record<string, SerializedItemSessionVariable>;\n\ttemplateVariables: Record<string, SerializedItemSessionVariable>;\n\tcontextVariables: Record<string, SerializedItemSessionVariable>;\n\tvalidationMessages: ResponseValidationResult['issues'];\n\tsavedAt: string;\n}\n\nexport type ItemSessionAction =\n\t| 'suspendAttempt'\n\t| 'endAttempt'\n\t| 'scoreAttempt'\n\t| 'newTemplate'\n\t| 'submitAttempt';\n\nexport type ItemSessionActionCommand =\n\t| { action: 'suspendAttempt' }\n\t| { action: 'endAttempt'; countAttempt?: boolean; validateResponses?: boolean }\n\t| { action: 'scoreAttempt' }\n\t| { action: 'newTemplate'; resetResponses?: boolean }\n\t| { action: 'submitAttempt'; countAttempt?: boolean };\n\nexport interface ItemSessionActionResult {\n\taction: ItemSessionAction;\n\tlifecycleStatus: ItemLifecycleStatus;\n\tcompletionStatus: CompletionStatus;\n\tnumAttempts: number;\n\tduration: number;\n\tcompleted: boolean;\n\tsessionState: SerializedItemSessionState;\n\tvalidation?: ResponseValidationResult;\n\tscoring?: ScoringResult;\n}\n\nexport interface InteractionResponse {\n\t[responseId: string]: any;\n}\n\n/**\n * Serializable representation of a QTI baseType=\"file\" response.\n * (We cannot store a browser File object in session state / JSON exports.)\n */\nexport interface QTIFileResponse {\n\tname: string;\n\ttype: string;\n\tsize: number;\n\tlastModified: number;\n\t/** Base64 data URL, e.g. data:application/pdf;base64,... */\n\tdataUrl: string;\n\t/**\n\t * Optional ImageData extracted from canvas (for drawing interactions).\n\t * This allows custom operators to analyze drawing content synchronously\n\t * without needing to decode the dataUrl asynchronously.\n\t */\n\timageData?: {\n\t\tdata: Uint8ClampedArray;\n\t\twidth: number;\n\t\theight: number;\n\t};\n}\n\nexport interface ModalFeedback {\n\t/** Unique identifier for this feedback block */\n\tidentifier: string;\n\t/** Outcome variable identifier this feedback is tied to */\n\toutcomeIdentifier: string;\n\t/** When to show: 'show' means display when outcome matches identifier */\n\tshowHide: 'show' | 'hide';\n\t/** HTML content to display */\n\tcontent: HtmlContent;\n\t/** Optional title for the feedback */\n\ttitle?: string;\n}\n\nexport interface ScoringResult {\n\tscore: number;\n\tmaxScore: number;\n\tcompleted: boolean;\n\toutcomeValues: Record<string, any>;\n\t/** Modal feedback elements that should be displayed based on outcome values */\n\tmodalFeedback?: ModalFeedback[];\n}\n\n/**\n * QTI 2.2 completionStatus values for adaptive items\n * - not_attempted: No interaction has occurred yet\n * - unknown: Response exists but hasn't been scored/evaluated\n * - incomplete: Item has been scored but is still active (can submit again)\n * - completed: Item is finished (final state)\n */\nexport type CompletionStatus = 'not_attempted' | 'unknown' | 'incomplete' | 'completed';\n\n/**\n * Extended scoring result for adaptive items with multi-attempt support\n */\nexport interface AdaptiveAttemptResult extends ScoringResult {\n\t/** Number of attempts made so far */\n\tnumAttempts: number;\n\t/** Current completion status of the item */\n\tcompletionStatus: CompletionStatus;\n\t/** Whether the item can accept more submissions */\n\tcanContinue: boolean;\n}\n\n/**\n * QTI role/view actors used for audience filtering (for example rubric/outcome visibility).\n * Runtime interaction behavior (readonly vs editable, correct-answer visibility) is a player\n * policy layered on top of these roles.\n */\nexport type QTIRole = 'candidate' | 'scorer' | 'proctor' | 'testConstructor' | 'tutor' | 'author';\n\nexport interface RubricBlock {\n\tview: string[]; // Array of role strings that can see this rubric\n\thtml: HtmlContent; // HTML content of the rubric\n}\n\n/**\n * QTI specification compliance configuration.\n * Controls whether the player enforces strict QTI 2.2 spec or allows vendor extensions.\n */\nexport interface QTIComplianceConfig {\n\t/** Enable strict QTI 2.2 compliance mode. Default: false (lenient) */\n\tenabled?: boolean;\n\n\t/** Reject items with unknown or non-standard elements. Default: false */\n\trejectUnknownExtensions?: boolean;\n\n\t/** Log warnings for spec deviations and vendor extensions. Default: true */\n\tlogDeviations?: boolean;\n}\n\nexport interface PlayerConfig {\n\titemXml?: string;\n\t/**\n\t * QTI 3.0 §6.2 Personal Needs and Preferences profile.\n\t * Color scheme is applied immediately as data-qti-colorscheme on the player root.\n\t * Use player.updatePnp() to change mid-session without re-parsing the item.\n\t */\n\tpnp?: import('../pnp/types.js').PnpProfile;\n\t/**\n\t * Optional shared catalog XML string (QTI 3.0 §6.3).\n\t * Parsed and merged with any catalog embedded in the item XML.\n\t * Item-level catalog entries take precedence over shared entries with the same identifier.\n\t * Deferred: external catalog files from IMS manifest (G-15) are not yet supported.\n\t */\n\tcatalogXml?: string;\n\t/**\n\t * Optional resolved delivery context produced by IMS package/assessment layers.\n\t * This is additive to catalogXml: shared catalog sources are merged first, then\n\t * catalogXml, then item-embedded catalog entries so item-local entries win.\n\t */\n\tdeliveryContext?: ResolvedItemDeliveryContext;\n\tsessionState?: ItemSessionState;\n\tresponses?: InteractionResponse;\n\trole?: QTIRole;\n\t/** Optional seed for deterministic random operations (e.g. templateProcessing randomInteger) */\n\tseed?: number;\n\t/** Optional RNG override (takes precedence over seed if provided) */\n\trng?: () => number;\n\t/**\n\t * Optional element name mapper for handling different QTI versions.\n\t * Defaults to Qti2xElementNameMapper (primary supported QTI format).\n\t * @since 0.2.0\n\t */\n\telementNameMapper?: any; // Will be ElementNameMapper from @pie-qti/qti-common\n\t/**\n\t * Optional attribute name mapper for handling different QTI versions.\n\t * Defaults to Qti2xAttributeNameMapper (primary supported QTI format).\n\t * @since 0.3.0\n\t */\n\tattributeNameMapper?: any; // Will be AttributeNameMapper from @pie-qti/qti-common\n\t/** Optional web component registry for custom interaction components */\n\tcomponentRegistry?: any; // Will be ComponentRegistry, but avoiding circular dependency\n\t/** Optional extraction registry for custom element extractors */\n\textractionRegistry?: any; // Will be ExtractionRegistry, but avoiding circular dependency\n\t/** Optional plugins to extend player functionality */\n\tplugins?: any[]; // Will be QTIPlugin[], but avoiding circular dependency\n\t/**\n\t * Optional i18n provider for internationalization.\n\t * If not provided, defaults to DefaultI18nProvider with English messages.\n\t */\n\ti18nProvider?: any; // Will be I18nProvider from @pie-qti/i18n\n\t/**\n\t * Optional registry for executing QTI <customOperator> expressions.\n\t * Keyed by operator `class` (preferred) or `definition` URI.\n\t */\n\tcustomOperators?: Record<string, (args: QtiValue[], meta: { class?: string; definition?: string }) => QtiValue>;\n\t/**\n\t * Optional base URL for resolving relative PCI module paths.\n\t * Defaults to document.baseURI when running in a browser.\n\t */\n\tpciBaseUrl?: string;\n\n\t/**\n\t * Security-related controls for untrusted QTI rendered into the host DOM.\n\t * Defaults are conservative for same-DOM embedding.\n\t */\n\tsecurity?: PlayerSecurityConfig;\n\n\t/**\n\t * QTI specification compliance settings.\n\t * Set strictQtiCompliance.enabled = true for strict QTI 2.2 validation.\n\t */\n\tstrictQtiCompliance?: QTIComplianceConfig;\n}\n\nexport interface UrlPolicyConfig {\n\t/**\n\t * Optional base URL used to resolve relative asset URLs (e.g. images/media).\n\t * If omitted, relative URLs are preserved as-is.\n\t */\n\tassetBaseUrl?: string;\n\t/** Allow https: URLs */\n\tallowHttps?: boolean;\n\t/** Allow http: URLs (default false; prefer https) */\n\tallowHttp?: boolean;\n\t/** Allow protocol-relative URLs (e.g. //cdn.example/asset). Default false. */\n\tallowProtocolRelative?: boolean;\n\t/** Allow data:image/* for <img src>. */\n\tallowDataImages?: boolean;\n\t/** Allow data:image/svg+xml (default false) */\n\tallowSvgDataImages?: boolean;\n\t/** Optional allowlist of hostnames for absolute URLs (exact match). */\n\tallowedHosts?: string[];\n}\n\n/**\n * Trusted Types support:\n * - When enabled and supported by the host browser + CSP, HTML-returning APIs may return TrustedHTML instead of string.\n * - When not enabled (default), APIs return plain strings as before.\n */\nexport type TrustedTypesHtml = typeof globalThis extends { TrustedHTML: infer T } ? T : never;\nexport type HtmlContent = string | TrustedTypesHtml;\n\nexport interface PlayerSecurityConfig {\n\t/** URL policy applied to extracted URL fields and HTML attribute URLs */\n\turlPolicy?: UrlPolicyConfig;\n\t/** Allow <object>/<embed> usage (default false) */\n\tallowObjectEmbeds?: boolean;\n\t/** Allow <iframe> usage (default false) */\n\tallowIframes?: boolean;\n\t/**\n\t * Optional parsing/processing guardrails to reduce DoS risk from untrusted QTI.\n\t * Disabled by default for compatibility.\n\t */\n\tparsingLimits?: ParsingLimitsConfig;\n\t/**\n\t * Optional Trusted Types policy name (host-controlled).\n\t * When set, and Trusted Types is available, the player will produce TrustedHTML for HTML injection sinks.\n\t *\n\t * Note: this is only effective when the host enables Trusted Types via CSP.\n\t */\n\ttrustedTypesPolicyName?: string;\n}\n\nexport interface ParsingLimitsConfig {\n\t/**\n\t * Enables parsing limits. When false/undefined, the player behaves exactly as before (compat default).\n\t */\n\tenabled?: boolean;\n\t/**\n\t * Reject any XML containing <!DOCTYPE ...> (case-insensitive) when enabled.\n\t * Helps reduce entity-expansion and other parser edge-case risks.\n\t */\n\trejectDoctype?: boolean;\n\t/**\n\t * Maximum bytes for `itemXml` input (UTF-8). Enforced when enabled.\n\t */\n\tmaxItemXmlBytes?: number;\n\t/**\n\t * Maximum bytes for HTML strings passed to sanitizer (UTF-8). Enforced when enabled.\n\t */\n\tmaxHtmlBytes?: number;\n\t/**\n\t * Maximum number of element nodes sanitized per HTML input. Enforced when enabled.\n\t */\n\tmaxHtmlNodes?: number;\n\t/**\n\t * Maximum element depth sanitized per HTML input. Enforced when enabled.\n\t */\n\tmaxHtmlDepth?: number;\n}\n\nexport interface InteractionContext {\n\tresponseIdentifier: string;\n\tmaxChoices?: number;\n\tminChoices?: number;\n\tshuffle?: boolean;\n\torientation?: 'horizontal' | 'vertical';\n}\n\n// Interaction data shapes for the component/plugin system.\n// Exported here so consumers can import them from `@pie-qti/item-player`.\nexport type * from '../interactions/index.js';\nexport * from './responseValidation.js';\n"]}
@@ -22,4 +22,3 @@ export interface ResponseValidationResult {
22
22
  entries: Record<string, ResponseValidationEntry>;
23
23
  issues: ResponseValidationIssue[];
24
24
  }
25
- //# sourceMappingURL=responseValidation.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=responseValidation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responseValidation.js","sourceRoot":"","sources":["../../src/types/responseValidation.ts"],"names":[],"mappings":"","sourcesContent":["export type ResponseValidationSeverity = 'error' | 'warning';\n\nexport interface ResponseValidationIssue {\n\tresponseId: string;\n\tcode: string;\n\tmessage: string;\n\tseverity: ResponseValidationSeverity;\n}\n\nexport interface ResponseValidationEntry {\n\tresponseId: string;\n\tinteractionType: string;\n\t/** Whether this interaction is required for submission purposes (derived from constraints like minPlays/minChoices). */\n\trequired: boolean;\n\t/** Whether the interaction is complete for submission purposes. */\n\tcomplete: boolean;\n\t/** Whether the response value is valid (shape + constraints). */\n\tvalid: boolean;\n\terrors: string[];\n\twarnings: string[];\n}\n\nexport interface ResponseValidationResult {\n\tvalid: boolean;\n\tentries: Record<string, ResponseValidationEntry>;\n\tissues: ResponseValidationIssue[];\n}\n\n\n"]}
@@ -167,4 +167,3 @@ export declare class PerformanceMonitor {
167
167
  * ```
168
168
  */
169
169
  export declare const globalPerformanceMonitor: PerformanceMonitor;
170
- //# sourceMappingURL=PerformanceMonitor.d.ts.map
@@ -240,3 +240,4 @@ export const globalPerformanceMonitor = new PerformanceMonitor({
240
240
  maxEntries: 100,
241
241
  logWarnings: false,
242
242
  });
243
+ //# sourceMappingURL=PerformanceMonitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PerformanceMonitor.js","sourceRoot":"","sources":["../../src/utils/PerformanceMonitor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAgDH,MAAM,OAAO,kBAAkB;IAW9B,YAAY,SAAmC,EAAE;QAJzC,YAAO,GAAuB,EAAE,CAAC;QACjC,kBAAa,GAAG,CAAC,CAAC;QAClB,eAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;QAG9C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,KAAK,CAAC;QACvC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,GAAG,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,KAAK,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,KAAK,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,MAAM;QACL,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,OAAO;QACN,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,SAAS;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,IAAY,EAAE,QAAkC;QAC1D,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC,QAAQ;QAC1B,CAAC;QAED,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QACpC,MAAM,QAAQ,GAAG,GAAG,IAAI,IAAI,SAAS,EAAE,CAAC;QACxC,IAAI,CA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AAC,GAAG,CAAC,YAAY,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAClD,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAClD,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACtD,OAAO,CAAC,QAAQ,EAAE,CAAC;QACpB,CAAC;QAED,OAAO,CAAC,QAAQ,EAAE,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACH,mBAAmB;QAKlB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACnC,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ;SACxB,CAAC,CAAC,CAAC;IACL,CAAC;CACD;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,kBAAkB,CAAC;IAC9D,OAAO,EAAE,KAAK,EAAE,yCAAyC;IACzD,UAAU,EAAE,GAAG;IACf,WAAW,EAAE,KAAK;CAClB,CAAC,CAAC","sourcesContent":["/**\n * Performance Monitor Utility\n *\n * Provides lightweight performance monitoring for QTI player operations\n * without requiring external dependencies. Useful for debugging, optimization,\n * and tracking performance metrics in production.\n *\n * Features:\n * - Measure operation durations\n * - Track custom metrics\n * - Export performance data\n * - Memory-efficient (circular buffer for metrics)\n *\n * Usage:\n * ```typescript\n * import { PerformanceMonitor } from './utils/PerformanceMonitor';\n *\n * const monitor = new PerformanceMonitor({ enabled: true, maxEntries: 100 });\n *\n * // Measure an operation\n * const stopTimer = monitor.startTimer('render-item');\n * // ... do work\n * stopTimer(); // Records duration\n *\n * // Track custom metrics\n * monitor.recordMetric('item-response-time', 245);\n *\n * // Get performance report\n * const report = monitor.getReport();\n * console.log(report);\n * ```\n */\n\nexport interface PerformanceEntry {\n\t/** Metric name */\n\tname: string;\n\t/** Timestamp when metric was recorded (ms since epoch) */\n\ttimestamp: number;\n\t/** Duration in milliseconds (for timers) */\n\tduration?: number;\n\t/** Custom value (for non-timer metrics) */\n\tvalue?: number;\n\t/** Additional metadata */\n\tmetadata?: Record<string, unknown>;\n}\n\nexport interface PerformanceReport {\n\t/** Total number of metrics recorded */\n\ttotalEntries: number;\n\t/** Number of entries currently stored (may be less due to circular buffer) */\n\tstoredEntries: number;\n\t/** Summary statistics by metric name */\n\tmetrics: Record<\n\t\tstring,\n\t\t{\n\t\t\tcount: number;\n\t\t\tmin: number;\n\t\t\tmax: number;\n\t\t\tavg: number;\n\t\t\ttotal: number;\n\t\t}\n\t>;\n\t/** Recent entries (last N based on buffer size) */\n\trecentEntries: PerformanceEntry[];\n}\n\nexport interface PerformanceMonitorConfig {\n\t/** Enable/disable monitoring (default: false) */\n\tenabled?: boolean;\n\t/** Maximum entries to store (circular buffer, default: 100) */\n\tmaxEntries?: number;\n\t/** Auto-export metrics when buffer is full (default: false) */\n\tautoExport?: boolean;\n\t/** Callback for auto-export */\n\tonExport?: (report: PerformanceReport) => void;\n\t/** Log warnings to console (default: false) */\n\tlogWarnings?: boolean;\n}\n\nexport class PerformanceMonitor {\n\tprivate enabled: boolean;\n\tprivate maxEntries: number;\n\tprivate autoExport: boolean;\n\tprivate onExport?: (report: PerformanceReport) => void;\n\tprivate logWarnings: boolean;\n\n\tprivate entries: PerformanceEntry[] = [];\n\tprivate totalRecorded = 0;\n\tprivate startTimes = new Map<string, number>();\n\n\tconstructor(config: PerformanceMonitorConfig = {}) {\n\t\tthis.enabled = config.enabled ?? false;\n\t\tthis.maxEntries = config.maxEntries ?? 100;\n\t\tthis.autoExport = config.autoExport ?? false;\n\t\tthis.onExport = config.onExport;\n\t\tthis.logWarnings = config.logWarnings ?? false;\n\t}\n\n\t/**\n\t * Enable performance monitoring\n\t */\n\tenable(): void {\n\t\tthis.enabled = true;\n\t}\n\n\t/**\n\t * Disable performance monitoring\n\t */\n\tdisable(): void {\n\t\tthis.enabled = false;\n\t}\n\n\t/**\n\t * Check if monitoring is enabled\n\t */\n\tisEnabled(): boolean {\n\t\treturn this.enabled;\n\t}\n\n\t/**\n\t * Start a timer for an operation\n\t *\n\t * @param name - Name of the operation\n\t * @param metadata - Optional metadata to attach\n\t * @returns Function to stop the timer and record duration\n\t *\n\t * @example\n\t * const stop = monitor.startTimer('render-item', { itemId: 'item-001' });\n\t * // ... do work\n\t * stop(); // Records duration automatically\n\t */\n\tstartTimer(name: string, metadata?: Record<string, unknown>): () => void {\n\t\tif (!this.enabled) {\n\t\t\treturn () => {}; // No-op\n\t\t}\n\n\t\tconst startTime = performance.now();\n\t\tconst timerKey = `${name}:${startTime}`;\n\t\tthis.startTimes.set(timerKey, startTime);\n\n\t\treturn () => {\n\t\t\tconst endTime = performance.now();\n\t\t\tconst duration = endTime - startTime;\n\t\t\tthis.startTimes.delete(timerKey);\n\n\t\t\tthis.recordEntry({\n\t\t\t\tname,\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t\tduration,\n\t\t\t\tmetadata,\n\t\t\t});\n\t\t};\n\t}\n\n\t/**\n\t * Record a custom metric value\n\t *\n\t * @param name - Name of the metric\n\t * @param value - Numeric value\n\t * @param metadata - Optional metadata\n\t *\n\t * @example\n\t * monitor.recordMetric('item-count', 25);\n\t * monitor.recordMetric('memory-usage', process.memoryUsage().heapUsed);\n\t */\n\trecordMetric(name: string, value: number, metadata?: Record<string, unknown>): void {\n\t\tif (!this.enabled) return;\n\n\t\tthis.recordEntry({\n\t\t\tname,\n\t\t\ttimestamp: Date.now(),\n\t\t\tvalue,\n\t\t\tmetadata,\n\t\t});\n\t}\n\n\t/**\n\t * Record a performance entry\n\t */\n\tprivate recordEntry(entry: PerformanceEntry): void {\n\t\tthis.totalRecorded++;\n\n\t\t// Add to circular buffer\n\t\tif (this.entries.length >= this.maxEntries) {\n\t\t\t// Remove oldest entry\n\t\t\tthis.entries.shift();\n\n\t\t\t// Auto-export if configured\n\t\t\tif (this.autoExport && this.onExport) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.onExport(this.getReport());\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (this.logWarnings) {\n\t\t\t\t\t\tconsole.warn('Performance monitor auto-export failed:', error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.entries.push(entry);\n\t}\n\n\t/**\n\t * Get performance report with statistics\n\t */\n\tgetReport(): PerformanceReport {\n\t\tconst metrics: Record<\n\t\t\tstring,\n\t\t\t{\n\t\t\t\tcount: number;\n\t\t\t\tmin: number;\n\t\t\t\tmax: number;\n\t\t\t\tavg: number;\n\t\t\t\ttotal: number;\n\t\t\t}\n\t\t> = {};\n\n\t\t// Calculate statistics for each metric\n\t\tfor (const entry of this.entries) {\n\t\t\tconst value = entry.duration ?? entry.value ?? 0;\n\n\t\t\tif (!metrics[entry.name]) {\n\t\t\t\tmetrics[entry.name] = {\n\t\t\t\t\tcount: 0,\n\t\t\t\t\tmin: Infinity,\n\t\t\t\t\tmax: -Infinity,\n\t\t\t\t\tavg: 0,\n\t\t\t\t\ttotal: 0,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst stats = metrics[entry.name];\n\t\t\tstats.count++;\n\t\t\tstats.total += value;\n\t\t\tstats.min = Math.min(stats.min, value);\n\t\t\tstats.max = Math.max(stats.max, value);\n\t\t}\n\n\t\t// Calculate averages\n\t\tfor (const stats of Object.values(metrics)) {\n\t\t\tstats.avg = stats.total / stats.count;\n\t\t}\n\n\t\treturn {\n\t\t\ttotalEntries: this.totalRecorded,\n\t\t\tstoredEntries: this.entries.length,\n\t\t\tmetrics,\n\t\t\trecentEntries: [...this.entries],\n\t\t};\n\t}\n\n\t/**\n\t * Get entries for a specific metric name\n\t */\n\tgetEntriesByName(name: string): PerformanceEntry[] {\n\t\treturn this.entries.filter((entry) => entry.name === name);\n\t}\n\n\t/**\n\t * Clear all stored entries\n\t */\n\tclear(): void {\n\t\tthis.entries = [];\n\t\tthis.totalRecorded = 0;\n\t\tthis.startTimes.clear();\n\t}\n\n\t/**\n\t * Export report as JSON string\n\t */\n\texportJSON(): string {\n\t\treturn JSON.stringify(this.getReport(), null, 2);\n\t}\n\n\t/**\n\t * Export report to console\n\t */\n\texportToConsole(): void {\n\t\tconst report = this.getReport();\n\n\t\tconsole.group('📊 Performance Report');\n\t\tconsole.log(`Total Entries: ${report.totalEntries}`);\n\t\tconsole.log(`Stored Entries: ${report.storedEntries}`);\n\t\tconsole.log('\\nMetrics:');\n\n\t\tfor (const [name, stats] of Object.entries(report.metrics)) {\n\t\t\tconsole.group(` ${name}`);\n\t\t\tconsole.log(` Count: ${stats.count}`);\n\t\t\tconsole.log(` Min: ${stats.min.toFixed(2)}ms`);\n\t\t\tconsole.log(` Max: ${stats.max.toFixed(2)}ms`);\n\t\t\tconsole.log(` Avg: ${stats.avg.toFixed(2)}ms`);\n\t\t\tconsole.log(` Total: ${stats.total.toFixed(2)}ms`);\n\t\t\tconsole.groupEnd();\n\t\t}\n\n\t\tconsole.groupEnd();\n\t}\n\n\t/**\n\t * Get performance marks for Web Performance API integration\n\t *\n\t * If using browser's Performance API, this exports entries\n\t * in a compatible format.\n\t */\n\tgetPerformanceMarks(): Array<{\n\t\tname: string;\n\t\tstartTime: number;\n\t\tduration?: number;\n\t}> {\n\t\treturn this.entries.map((entry) => ({\n\t\t\tname: entry.name,\n\t\t\tstartTime: entry.timestamp,\n\t\t\tduration: entry.duration,\n\t\t}));\n\t}\n}\n\n/**\n * Singleton instance for global performance monitoring\n *\n * Usage:\n * ```typescript\n * import { globalPerformanceMonitor } from './utils/PerformanceMonitor';\n *\n * globalPerformanceMonitor.enable();\n * const stop = globalPerformanceMonitor.startTimer('operation');\n * // ... work\n * stop();\n * ```\n */\nexport const globalPerformanceMonitor = new PerformanceMonitor({\n\tenabled: false, // Disabled by default, enable explicitly\n\tmaxEntries: 100,\n\tlogWarnings: false,\n});\n"]}
@@ -36,4 +36,3 @@ export declare function getImageDataFromResponse(fileResponse: QTIFileResponse |
36
36
  * @returns true if drawing contains content, false otherwise
37
37
  */
38
38
  export declare function analyzeDrawing(fileResponse: QTIFileResponse | null | undefined, threshold?: number): boolean;
39
- //# sourceMappingURL=drawingUtils.d.ts.map
@@ -55,3 +55,4 @@ export function analyzeDrawing(fileResponse, threshold = 50) {
55
55
  }
56
56
  return hasLine(imageData, threshold);
57
57
  }
58
+ //# sourceMappingURL=drawingUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawingUtils.js","sourceRoot":"","sources":["../../src/utils/drawingUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CACtB,SAAqE,EACrE,YAAoB,EAAE;IAEtB,MAAM,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;IAC3B,IAAI,cAAc,GAAG,CAAC,CAAC;IAEvB,oDAAoD;IACpD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACzC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACtB,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACtB,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAEtB,+BAA+B;QAC/B,gCAAgC;QAChC,0DAA0D;QAC1D,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC;YAC/C,cAAc,EAAE,CAAC;QAClB,CAAC;IACF,CAAC;IAED,OAAO,cAAc,IAAI,SAAS,CAAC;AACpC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CACvC,YAAgD;IAEhD,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,YAAY,CAAC,SAAS,CAAC;AAC/B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC7B,YAAgD,EAChD,YAAoB,EAAE;IAEtB,MAAM,SAAS,GAAG,wBAAwB,CAAC,YAAY,CAAC,CAAC;IACzD,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AACtC,CAAC","sourcesContent":["/**\n * Drawing analysis utilities for QTI drawing interactions\n * \n * These utilities help analyze drawing content for scoring purposes.\n * They work with ImageData extracted from canvas elements.\n */\n\nimport type { QTIFileResponse } from '../types/index.js';\n\n/**\n * Check if a drawing contains at least some drawn content (non-white pixels)\n * \n * @param imageData - ImageData from canvas (RGBA format, 4 bytes per pixel)\n * @param threshold - Minimum number of non-white pixels to consider a line drawn (default: 50)\n * @returns true if the drawing contains at least threshold non-white pixels\n */\nexport function hasLine(\n\timageData: { data: Uint8ClampedArray; width: number; height: number },\n\tthreshold: number = 50\n): boolean {\n\tconst { data } = imageData;\n\tlet nonWhitePixels = 0;\n\t\n\t// Check each pixel (RGBA format: 4 bytes per pixel)\n\tfor (let i = 0; i < data.length; i += 4) {\n\t\tconst r = data[i];\n\t\tconst g = data[i + 1];\n\t\tconst b = data[i + 2];\n\t\tconst a = data[i + 3];\n\t\t\n\t\t// Consider pixel non-white if:\n\t\t// - Alpha is significant (> 10)\n\t\t// - AND color is not white/very light (any channel < 240)\n\t\tif (a > 10 && (r < 240 || g < 240 || b < 240)) {\n\t\t\tnonWhitePixels++;\n\t\t}\n\t}\n\t\n\treturn nonWhitePixels >= threshold;\n}\n\n/**\n * Get ImageData from a QTIFileResponse if available\n * \n * @param fileResponse - QTIFileResponse object (may contain imageData)\n * @returns ImageData if available, null otherwise\n */\nexport function getImageDataFromResponse(\n\tfileResponse: QTIFileResponse | null | undefined\n): { data: Uint8ClampedArray; width: number; height: number } | null {\n\tif (!fileResponse?.imageData) {\n\t\treturn null;\n\t}\n\treturn fileResponse.imageData;\n}\n\n/**\n * Analyze a drawing response to determine if it contains drawn content\n * \n * @param fileResponse - QTIFileResponse from drawing interaction\n * @param threshold - Minimum number of non-white pixels (default: 50)\n * @returns true if drawing contains content, false otherwise\n */\nexport function analyzeDrawing(\n\tfileResponse: QTIFileResponse | null | undefined,\n\tthreshold: number = 50\n): boolean {\n\tconst imageData = getImageDataFromResponse(fileResponse);\n\tif (!imageData) {\n\t\treturn false;\n\t}\n\treturn hasLine(imageData, threshold);\n}\n"]}
@@ -13,4 +13,3 @@
13
13
  */
14
14
  export declare function isResponseEmpty(value: unknown): boolean;
15
15
  export declare function countAnsweredForResponseIds(responses: Record<string, unknown>, responseIds: readonly string[]): number;
16
- //# sourceMappingURL=responseUtils.d.ts.map
@@ -43,3 +43,4 @@ export function countAnsweredForResponseIds(responses, responseIds) {
43
43
  }
44
44
  return count;
45
45
  }
46
+ //# sourceMappingURL=responseUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responseUtils.js","sourceRoot":"","sources":["../../src/utils/responseUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC7C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAEvD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;IAE1D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACpC,oFAAoF;QACpF,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED,8DAA8D;IAC9D,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,KAAK,YAAY,IAAI;QAAE,OAAO,KAAK,CAAC;IAEvE,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,GAAG,GAAG,KAAgC,CAAC;QAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,qEAAqE;IACrE,OAAO,KAAK,CAAC;AACd,CAAC;AAED,MAAM,UAAU,2BAA2B,CAC1C,SAAkC,EAClC,WAA8B;IAE9B,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,EAAE,IAAI,WAAW,EAAE,CAAC;QAC9B,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;YAAE,KAAK,EAAE,CAAC;IAC9C,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["/**\n * Generic response/value helpers.\n *\n * These are UI-agnostic utilities intended to keep \"is this answered?\"\n * logic consistent across apps (example, assessment player, etc).\n */\n\n/**\n * Returns true when a response value should be treated as \"no response / unanswered\".\n *\n * Notes:\n * - `0` and `false` are valid answers in some interactions, so they are NOT empty.\n * - Empty objects are treated as empty, and objects whose values are all empty are treated as empty.\n */\nexport function isResponseEmpty(value: unknown): boolean {\n\tif (value === null || value === undefined) return true;\n\n\tif (typeof value === 'string') return value.trim() === '';\n\n\tif (Array.isArray(value)) {\n\t\tif (value.length === 0) return true;\n\t\t// Some interactions may emit arrays with empty members; treat \"all empty\" as empty.\n\t\treturn value.every((v) => isResponseEmpty(v));\n\t}\n\n\t// Files/blobs are valid user responses (upload interactions).\n\tif (typeof Blob !== 'undefined' && value instanceof Blob) return false;\n\n\tif (typeof value === 'object') {\n\t\tconst obj = value as Record<string, unknown>;\n\t\tconst keys = Object.keys(obj);\n\t\tif (keys.length === 0) return true;\n\t\treturn keys.every((k) => isResponseEmpty(obj[k]));\n\t}\n\n\t// numbers, booleans, symbols, functions -> treat as \"has a response\"\n\treturn false;\n}\n\nexport function countAnsweredForResponseIds(\n\tresponses: Record<string, unknown>,\n\tresponseIds: readonly string[]\n): number {\n\tlet count = 0;\n\tfor (const id of responseIds) {\n\t\tif (!isResponseEmpty(responses[id])) count++;\n\t}\n\treturn count;\n}\n\n\n"]}
@@ -23,7 +23,7 @@
23
23
  * ```
24
24
  */
25
25
  import type { HtmlContent } from '../types/index.js';
26
- import type { InteractionData } from '../types/interactions.js';
26
+ import type { InteractionData } from '../interactions/index.js';
27
27
  import { type InteractionResponseValue, type QTIInteractionElement } from './QTIInteractionElement.js';
28
28
  export declare abstract class QTIInteractionBase<TData extends InteractionData = InteractionData> extends HTMLElement implements QTIInteractionElement<TData> {
29
29
  private _interaction;
@@ -117,4 +117,3 @@ export declare abstract class QTIInteractionBase<TData extends InteractionData =
117
117
  */
118
118
  protected createElement<K extends keyof HTMLElementTagNameMap>(tagName: K, classes?: string[]): HTMLElementTagNameMap[K];
119
119
  }
120
- //# sourceMappingURL=QTIInteractionBase.d.ts.map
@@ -241,3 +241,4 @@ export class QTIInteractionBase extends HTMLElement {
241
241
  return element;
242
242
  }
243
243
  }
244
+ //# sourceMappingURL=QTIInteractionBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QTIInteractionBase.js","sourceRoot":"","sources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K,EAAE,CAAC;gBAChB,IAAI,CAAC,SAAS,CAAC,KAAc,EAAE,aAAa,CAAC,CAAC;YAC/C,CAAC;QACF,CAAC;IACF,CAAC;IAED;;;OAGG;IACO,SAAS;QAClB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BN,CAAC;IACH,CAAC;IAED;;OAEG;IACO,gBAAgB,CAAC,OAAiC,EAAE,IAAiB;QAC9E,IAAI,CAAC;YACJ,OAAO,CAAC,SAAS,GAAG,IAAW,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,SAAS,CAAC,KAAc,EAAE,cAAc,CAAC,CAAC;YAC/C,OAAO,CAAC,SAAS,GAAG,uDAAuD,CAAC;QAC7E,CAAC;IACF,CAAC;IAED;;OAEG;IACO,aAAa,CACtB,OAAU,EACV,OAAkB;QAElB,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,OAAO,CAAC;IAChB,CAAC;CACD","sourcesContent":["/**\n * Abstract base class for all QTI interaction web components\n *\n * Provides common functionality including:\n * - Reactive property system\n * - Shadow DOM management\n * - Event emission helpers\n * - Update scheduling\n * - Lifecycle management\n *\n * @example\n * ```typescript\n * export class QTIChoiceInteraction extends QTIInteractionBase<ChoiceInteractionData> {\n * protected render(): void {\n * this.shadowRoot.innerHTML = `...`;\n * this.attachEventListeners();\n * }\n *\n * protected cleanup(): void {\n * // Optional cleanup\n * }\n * }\n * ```\n */\n\nimport type { HtmlContent } from '../types/index.js';\nimport type { InteractionData } from '../interactions/index.js';\nimport {\n\ttype InteractionResponseValue,\n\tQTIChangeEvent,\n\tQTIErrorEvent,\n\ttype QTIInteractionElement,\n\tQTIReadyEvent,\n} from './QTIInteractionElement.js';\n\nexport abstract class QTIInteractionBase<TData extends InteractionData = InteractionData>\n\textends HTMLElement\n\timplements QTIInteractionElement<TData>\n{\n\tprivate _interaction: TData | null = null;\n\tprivate _response: InteractionResponseValue<TData> | null = null;\n\tprivate _disabled = false;\n\tprivate _typeset?: (element: HTMLElement) => void;\n\n\tdeclare shadowRoot: ShadowRoot; // Override HTMLElement's shadowRoot type\n\tprivate updateScheduled = false;\n\tprivate isInitialized = false;\n\n\tconstructor() {\n\t\tsuper();\n\t\t// attachShadow returns ShadowRoot, and we cast to ensure type compatibility\n\t\t(this as any).shadowRoot = this.attachShadow({ mode: 'open' });\n\t}\n\n\t// ========== Property Getters/Setters ==========\n\n\t/**\n\t * The processed interaction data from QTI XML\n\t * Required property - throws if accessed before being set\n\t */\n\tget interaction(): TData {\n\t\tif (!this._interaction) {\n\t\t\tthrow new Error(\n\t\t\t\t`${this.tagName}: interaction property must be set before use`\n\t\t\t);\n\t\t}\n\t\treturn this._interaction;\n\t}\n\n\tset interaction(value: TData) {\n\t\tif (this._interaction !== value) {\n\t\t\tthis._interaction = value;\n\t\t\tthis.requestUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * Current response value (type depends on interaction type)\n\t * May be null if no response has been provided yet\n\t */\n\tget response(): InteractionResponseValue<TData> | null {\n\t\treturn this._response;\n\t}\n\n\tset response(value: InteractionResponseValue<TData> | null) {\n\t\tif (this._response !== value) {\n\t\t\tthis._response = value;\n\t\t\tthis.requestUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * Whether the interaction is in read-only/disabled mode\n\t */\n\tget disabled(): boolean {\n\t\treturn this._disabled;\n\t}\n\n\tset disabled(value: boolean) {\n\t\tconst newValue = Boolean(value);\n\t\tif (this._disabled !== newValue) {\n\t\t\tthis._disabled = newValue;\n\t\t\tthis.requestUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * Optional function to apply math typesetting (e.g., KaTeX, MathJax)\n\t */\n\tget typeset(): ((element: HTMLElement) => void) | undefined {\n\t\treturn this._typeset;\n\t}\n\n\tset typeset(value: ((element: HTMLElement) => void) | undefined) {\n\t\tif (this._typeset !== value) {\n\t\t\tthis._typeset = value;\n\t\t\tthis.requestUpdate();\n\t\t}\n\t}\n\n\t// ========== Lifecycle Hooks ==========\n\n\t/**\n\t * Called when the element is connected to the DOM\n\t */\n\tconnectedCallback(): void {\n\t\tif (!this.isInitialized) {\n\t\t\tthis.isInitialized = true;\n\t\t\tthis.init();\n\t\t}\n\t\tthis.requestUpdate();\n\t}\n\n\t/**\n\t * Called when the element is disconnected from the DOM\n\t */\n\tdisconnectedCallback(): void {\n\t\tthis.cleanup();\n\t}\n\n\t/**\n\t * Called once when the element is first connected\n\t * Override this to perform one-time initialization\n\t */\n\tprotected init(): void {\n\t\t// Override in subclasses if needed\n\t}\n\n\t// ========== Reactive Updates ==========\n\n\t/**\n\t * Schedule a re-render on the next microtask\n\t * Multiple calls within the same tick are batched\n\t */\n\tprotected requestUpdate(): void {\n\t\tif (!this.updateScheduled && this.isConnected) {\n\t\t\tthis.updateScheduled = true;\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tthis.updateScheduled = false;\n\t\t\t\ttry {\n\t\t\t\t\tthis.render();\n\t\t\t\t\tif (this.isInitialized) {\n\t\t\t\t\t\tthis.emitReady();\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis.emitError(error as Error, 'render');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t// ========== Abstract Methods ==========\n\n\t/**\n\t * Render the component's UI\n\t * Called automatically when properties change\n\t * Must be implemented by subclasses\n\t */\n\tprotected abstract render(): void;\n\n\t/**\n\t * Clean up resources when component is removed from DOM\n\t * Override this to remove event listeners, cancel timers, etc.\n\t */\n\tprotected abstract cleanup(): void;\n\n\t// ========== Event Helpers ==========\n\n\t/**\n\t * Emit a qti-change event when the user response changes\n\t * @param value - The new response value\n\t */\n\tprotected emitChange(value: InteractionResponseValue<TData> | null): void {\n\t\tif (!this._interaction) {\n\t\t\tconsole.warn(`${this.tagName}: Cannot emit change without interaction data`);\n\t\t\treturn;\n\t\t}\n\n\t\tconst event = new QTIChangeEvent({\n\t\t\tresponseId: this._interaction.responseId,\n\t\t\tvalue,\n\t\t\ttimestamp: Date.now(),\n\t\t});\n\n\t\tthis.dispatchEvent(event);\n\t}\n\n\t/**\n\t * Emit a qti-ready event when component is initialized\n\t */\n\tprivate emitReady(): void {\n\t\tthis.dispatchEvent(new QTIReadyEvent());\n\t}\n\n\t/**\n\t * Emit a qti-error event when an error occurs\n\t */\n\tprotected emitError(error: Error, context: string): void {\n\t\tconst event = new QTIErrorEvent({ error, context });\n\t\tthis.dispatchEvent(event);\n\t\tconsole.error(`${this.tagName} error in ${context}:`, error);\n\t}\n\n\t// ========== Utility Methods ==========\n\n\t/**\n\t * Apply math typesetting to the shadow root\n\t * Call this after updating the DOM with math content\n\t */\n\tprotected applyTypesetting(): void {\n\t\tif (this._typeset && this.shadowRoot) {\n\t\t\ttry {\n\t\t\t\tthis._typeset(this.shadowRoot as any);\n\t\t\t} catch (error) {\n\t\t\t\tthis.emitError(error as Error, 'typesetting');\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Get base styles for all interaction components\n\t * Override and call super.getStyles() to extend these styles\n\t */\n\tprotected getStyles(): string {\n\t\treturn `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t\tfont-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',\n\t\t\t\t\tRoboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n\t\t\t\tfont-size: 16px;\n\t\t\t\tline-height: 1.5;\n\t\t\t}\n\n\t\t\t:host([disabled]) {\n\t\t\t\topacity: 0.6;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\n\t\t\t* {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\n\t\t\t.qti-prompt {\n\t\t\t\tmargin-bottom: 1rem;\n\t\t\t\tfont-weight: 600;\n\t\t\t}\n\n\t\t\t.qti-error {\n\t\t\t\tcolor: #dc2626;\n\t\t\t\tpadding: 0.75rem;\n\t\t\t\tbackground: #fee2e2;\n\t\t\t\tborder-radius: 0.375rem;\n\t\t\t\tmargin: 0.5rem 0;\n\t\t\t}\n\t\t`;\n\t}\n\n\t/**\n\t * Safely set innerHTML with error handling\n\t */\n\tprotected safeSetInnerHTML(element: HTMLElement | ShadowRoot, html: HtmlContent): void {\n\t\ttry {\n\t\t\telement.innerHTML = html as any;\n\t\t} catch (error) {\n\t\t\tthis.emitError(error as Error, 'setInnerHTML');\n\t\t\telement.innerHTML = `<div class=\"qti-error\">Failed to render content</div>`;\n\t\t}\n\t}\n\n\t/**\n\t * Create an element with classes\n\t */\n\tprotected createElement<K extends keyof HTMLElementTagNameMap>(\n\t\ttagName: K,\n\t\tclasses?: string[]\n\t): HTMLElementTagNameMap[K] {\n\t\tconst element = document.createElement(tagName);\n\t\tif (classes && classes.length > 0) {\n\t\t\telement.className = classes.join(' ');\n\t\t}\n\t\treturn element;\n\t}\n}\n"]}
@@ -4,7 +4,7 @@
4
4
  * All QTI interaction web components must implement the QTIInteractionElement
5
5
  * interface and emit QTIChangeEvent when the user response changes.
6
6
  */
7
- import type { InteractionData, InteractionValueMap } from '../types/interactions.js';
7
+ import type { InteractionData, InteractionValueMap } from '../interactions/index.js';
8
8
  export type InteractionResponseValue<TData extends InteractionData = InteractionData> = TData extends {
9
9
  type: infer TType;
10
10
  } ? TType extends keyof InteractionValueMap ? InteractionValueMap[TType] : unknown : unknown;
@@ -77,4 +77,3 @@ export interface QTISelectionChangeEventDetail {
77
77
  export declare class QTISelectionChangeEvent extends CustomEvent<QTISelectionChangeEventDetail> {
78
78
  constructor(detail: QTISelectionChangeEventDetail);
79
79
  }
80
- //# sourceMappingURL=QTIInteractionElement.d.ts.map
@@ -59,3 +59,4 @@ export class QTISelectionChangeEvent extends CustomEvent {
59
59
  });
60
60
  }
61
61
  }
62
+ //# sourceMappingURL=QTIInteractionElement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QTIInteractionElement.js","sourceRoot":"","sources":["../../src/web-components/QTIInteractionElement.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA0CH;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,cAAyD,SAAQ,WAAyC;IACtH,YAAY,MAAoC;QAC/C,KAAK,CAAC,YAAY,EAAE;YACnB,MAAM;YACN,OAAO,EAAE,IAAI,EAAE,6BAA6B;YAC5C,QAAQ,EAAE,IAAI,EAAE,8BAA8B;YAC9C,UAAU,EAAE,KAAK,EAAE,sBAAsB;SACzC,CAAC,CAAC;IACJ,CAAC;CACD;AAED;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAiB;IACnD;QACC,KAAK,CAAC,WAAW,EAAE;YAClB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,KAAK;SACjB,CAAC,CAAC;IACJ,CAAC;CACD;AAaD,MAAM,OAAO,aAAc,SAAQ,WAAgC;IAClE,YAAY,MAA2B;QACtC,KAAK,CAAC,WAAW,EAAE;YAClB,MAAM;YACN,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,KAAK;SACjB,CAAC,CAAC;IACJ,CAAC;CACD;AAWD,MAAM,OAAO,uBAAwB,SAAQ,WAA0C;IACtF,YAAY,MAAqC;QAChD,KAAK,CAAC,sBAAsB,EAAE;YAC7B,MAAM;YACN,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,KAAK;SACjB,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["/**\n * Standard interface and event types for QTI interaction web components\n *\n * All QTI interaction web components must implement the QTIInteractionElement\n * interface and emit QTIChangeEvent when the user response changes.\n */\n\nimport type { InteractionData, InteractionValueMap } from '../interactions/index.js';\n\nexport type InteractionResponseValue<TData extends InteractionData = InteractionData> =\n\tTData extends { type: infer TType }\n\t\t? TType extends keyof InteractionValueMap\n\t\t\t? InteractionValueMap[TType]\n\t\t\t: unknown\n\t\t: unknown;\n\n/**\n * Standard interface that all QTI interaction web components must implement\n */\nexport interface QTIInteractionElement<TData extends InteractionData = InteractionData> extends HTMLElement {\n\t/** The processed interaction data from the QTI XML */\n\tinteraction: TData;\n\n\t/** The current response value (type depends on interaction type) */\n\tresponse: InteractionResponseValue<TData> | null;\n\n\t/** Whether the interaction is in read-only/disabled mode */\n\tdisabled: boolean;\n\n\t/** Optional function to apply math typesetting (e.g., KaTeX, MathJax) */\n\ttypeset?: (element: HTMLElement) => void;\n}\n\n/**\n * Detail payload for the qti-change event\n */\nexport interface QTIChangeEventDetail<TValue = InteractionResponseValue | null> {\n\t/** The response identifier for this interaction */\n\tresponseId: string;\n\n\t/** The new response value */\n\tvalue: TValue;\n\n\t/** Timestamp when the change occurred */\n\ttimestamp: number;\n}\n\n/**\n * Custom event emitted when an interaction's response changes\n *\n * This event bubbles and can cross shadow DOM boundaries, making it\n * easy to listen for changes at the container level.\n *\n * @example\n * ```typescript\n * element.addEventListener('qti-change', (event: QTIChangeEvent) => {\n * console.log('Response changed:', event.detail.responseId, event.detail.value);\n * });\n * ```\n */\nexport class QTIChangeEvent<TValue = InteractionResponseValue | null> extends CustomEvent<QTIChangeEventDetail<TValue>> {\n\tconstructor(detail: QTIChangeEventDetail<TValue>) {\n\t\tsuper('qti-change', {\n\t\t\tdetail,\n\t\t\tbubbles: true, // Bubble up through DOM tree\n\t\t\tcomposed: true, // Cross shadow DOM boundaries\n\t\t\tcancelable: false, // Cannot be prevented\n\t\t});\n\t}\n}\n\n/**\n * Event emitted when a component is ready (initialized and rendered)\n */\nexport class QTIReadyEvent extends CustomEvent<void> {\n\tconstructor() {\n\t\tsuper('qti-ready', {\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t\tcancelable: false,\n\t\t});\n\t}\n}\n\n/**\n * Event emitted when an error occurs in a component\n */\nexport interface QTIErrorEventDetail {\n\t/** The error that occurred */\n\terror: Error;\n\n\t/** Context about where the error occurred */\n\tcontext: string;\n}\n\nexport class QTIErrorEvent extends CustomEvent<QTIErrorEventDetail> {\n\tconstructor(detail: QTIErrorEventDetail) {\n\t\tsuper('qti-error', {\n\t\t\tdetail,\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t\tcancelable: false,\n\t\t});\n\t}\n}\n\n/**\n * Special event for AssociateInteraction selection state\n * (used for tracking which item is selected for pairing)\n */\nexport interface QTISelectionChangeEventDetail {\n\t/** The identifier of the selected item, or null if deselected */\n\tselected: string | null;\n}\n\nexport class QTISelectionChangeEvent extends CustomEvent<QTISelectionChangeEventDetail> {\n\tconstructor(detail: QTISelectionChangeEventDetail) {\n\t\tsuper('qti-selection-change', {\n\t\t\tdetail,\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t\tcancelable: false,\n\t\t});\n\t}\n}\n"]}
@@ -5,4 +5,3 @@
5
5
  */
6
6
  export { QTIInteractionBase } from './QTIInteractionBase.js';
7
7
  export { QTIChangeEvent, type InteractionResponseValue, type QTIChangeEventDetail, QTIErrorEvent, type QTIErrorEventDetail, type QTIInteractionElement, QTIReadyEvent, QTISelectionChangeEvent, type QTISelectionChangeEventDetail, } from './QTIInteractionElement.js';
8
- //# sourceMappingURL=index.d.ts.map
@@ -8,3 +8,4 @@ export { QTIInteractionBase } from './QTIInteractionBase.js';
8
8
  export { QTIChangeEvent, QTIErrorEvent, QTIReadyEvent, QTISelectionChangeEvent, } from './QTIInteractionElement.js';
9
9
  // Note: Web component implementations are provided by separate packages
10
10
  // (e.g., @pie-qti/default-components) that use these base classes
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/web-components/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qCAAqC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACN,cAAc,EAGd,aAAa,EAGb,aAAa,EACb,uBAAuB,GAEvB,MAAM,4BAA4B,CAAC;AAEpC,wEAAwE;AACxE,kEAAkE","sourcesContent":["/**\n * Web Components for QTI Interactions\n *\n * Framework-agnostic web components that can be used in any JavaScript environment\n */\n\n// Export base classes and interfaces\nexport { QTIInteractionBase } from './QTIInteractionBase.js';\nexport {\n\tQTIChangeEvent,\n\ttype InteractionResponseValue,\n\ttype QTIChangeEventDetail,\n\tQTIErrorEvent,\n\ttype QTIErrorEventDetail,\n\ttype QTIInteractionElement,\n\tQTIReadyEvent,\n\tQTISelectionChangeEvent,\n\ttype QTISelectionChangeEventDetail,\n} from './QTIInteractionElement.js';\n\n// Note: Web component implementations are provided by separate packages\n// (e.g., @pie-qti/default-components) that use these base classes\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-qti/item-player",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Modern QTI player supporting QTI 2.2 and 3.0 - Client-side with optional backend hooks",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -27,11 +27,11 @@
27
27
  ],
28
28
  "license": "MIT",
29
29
  "dependencies": {
30
- "@pie-qti/i18n": "0.1.9",
31
- "@pie-qti/ims-cp-core": "0.1.9",
32
- "@pie-qti/qti-common": "0.1.9",
33
- "@pie-qti/qti-processing": "0.1.9",
34
- "@pie-qti/typeset-katex": "0.1.9",
30
+ "@pie-qti/i18n": "0.1.11",
31
+ "@pie-qti/ims-cp-core": "0.1.11",
32
+ "@pie-qti/qti-common": "0.1.11",
33
+ "@pie-qti/qti-processing": "0.1.11",
34
+ "@pie-qti/typeset-katex": "0.1.11",
35
35
  "@tiptap/core": "^3.15.3",
36
36
  "@tiptap/extension-mathematics": "^3.15.3",
37
37
  "@tiptap/extension-placeholder": "^3.15.3",
@@ -69,12 +69,6 @@
69
69
  "types": "./dist/iframe/index.d.ts",
70
70
  "import": "./dist/iframe/index.js"
71
71
  },
72
- "./components": {
73
- "types": "./src/components/index.ts",
74
- "import": "./src/components/index.ts",
75
- "svelte": "./src/components/index.ts",
76
- "default": "./src/components/index.ts"
77
- },
78
72
  "./components/utils": {
79
73
  "types": "./dist/components/utils/index.d.ts",
80
74
  "import": "./dist/components/utils/index.js"
@@ -103,8 +97,7 @@
103
97
  "node": ">=20.19.0"
104
98
  },
105
99
  "files": [
106
- "dist",
107
- "src"
100
+ "dist"
108
101
  ],
109
102
  "unpkg": "./dist/element.js",
110
103
  "jsdelivr": "./dist/element.js"
@@ -1 +0,0 @@
1
- {"version":3,"file":"applyGlossaryTriggers.d.ts","sourceRoot":"","sources":["../../src/catalog/applyGlossaryTriggers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AA2BhD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,CA8GxF;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,WAAW,GAAG,IAAI,CAUpE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"catalogExtractor.d.ts","sourceRoot":"","sources":["../../src/catalog/catalogExtractor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA6B,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAUxD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAKvE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,GAAG,YAAY,CAMtF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"catalogLookup.d.ts","sourceRoot":"","sources":["../../src/catalog/catalogLookup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC9B,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,MAAM,GACX,MAAM,GAAG,IAAI,CA8Bf"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"glossaryAction.d.ts","sourceRoot":"","sources":["../../src/catalog/glossaryAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,MAAM,WAAW,oBAAoB;IACpC,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,oBAAoB;sBAQ1D,oBAAoB;;EAcvC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/catalog/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAEpD,MAAM,WAAW,WAAW;IAC3B,OAAO,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC5B;;;;OAIG;IACH,KAAK,EACF,oBAAoB,GACpB,qBAAqB,GACrB,sBAAsB,GACtB,mBAAmB,GACnB,oBAAoB,GACpB,cAAc,GACd,mBAAmB,GACnB,sBAAsB,GACtB,MAAM,CAAC;IACV,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;CACb"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"typesetAction.d.ts","sourceRoot":"","sources":["../../../src/components/actions/typesetAction.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtD;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,mBAAmB;iBAuC7D,mBAAmB;;EAWjC"}
@@ -1,2 +0,0 @@
1
- export { assignProps, type AssignPropsOptions } from '@pie-qti/qti-common';
2
- //# sourceMappingURL=assignProps.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assignProps.d.ts","sourceRoot":"","sources":["../../../src/components/utils/assignProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1 +0,0 @@
1
- export { assignProps } from '@pie-qti/qti-common';
@@ -1 +0,0 @@
1
- {"version":3,"file":"feedbackUtils.d.ts","sourceRoot":"","sources":["../../../src/components/utils/feedbackUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,2BAA2B,EAAE,iBAAiB,EAQ1D,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAChC,OAAO,EAAE,MAAM,EACf,UAAU,GAAE,iBAAiB,EAAgC,GAC3D,MAAM,CASR;AAED;;;GAGG;AACH,eAAO,MAAM,2BAA2B,aAAa,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC5C,8CAA8C;IAC9C,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,yDAAyD;IACzD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qEAAqE;IACrE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,4BAA4B,GACnC,MAAM,CAuCR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,GACjC,MAAM,iBAAiB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"stimulusRender.d.ts","sourceRoot":"","sources":["../../../src/components/utils/stimulusRender.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAExE,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAEzD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC5C,eAAe,EAAE,2BAA2B,GAAG,SAAS,EACxD,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/C,QAAQ,EAAE,iBAAiB,GACzB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWxB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAoC3G"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"stylesheetRender.d.ts","sourceRoot":"","sources":["../../../src/components/utils/stylesheetRender.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,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G,MAAM;IAwC9D;;;OAGG;IACH,kBAAkB,IAAI,MAAM,EAAE;IAI9B;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAInC;;;;;;;OAOG;IACH,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAK9C;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,iBAAiB,CAE3D;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IAEb,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAEhB,yBAAyB;IACzB,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC5C"}
@@ -1,91 +0,0 @@
1
- /**
2
- * ItemRenderer - Framework-agnostic rendering engine for QTI items
3
- *
4
- * Replaces ItemBody.svelte with vanilla JavaScript. Creates and manages
5
- * web component instances for QTI interactions, handles response state,
6
- * and orchestrates the rendering pipeline.
7
- */
8
- import type { Player } from './Player.js';
9
- /**
10
- * Configuration for ItemRenderer
11
- */
12
- export interface ItemRendererConfig {
13
- /** Player instance containing the QTI item */
14
- player: Player;
15
- /** DOM container where the item will be rendered */
16
- container: HTMLElement;
17
- /** Current response values keyed by responseId */
18
- responses?: Record<string, any>;
19
- /** Whether the item is in read-only/disabled mode */
20
- disabled?: boolean;
21
- /** Optional function to apply math typesetting (e.g., KaTeX, MathJax) */
22
- typeset?: (element: HTMLElement) => void;
23
- /** Callback when a response changes */
24
- onResponseChange?: (responseId: string, value: any) => void;
25
- }
26
- /**
27
- * ItemRenderer class manages the rendering of QTI items using web components
28
- */
29
- export declare class ItemRenderer {
30
- private player;
31
- private container;
32
- private componentRegistry;
33
- private responses;
34
- private disabled;
35
- private typeset?;
36
- private onResponseChange;
37
- private renderedElements;
38
- private eventListeners;
39
- private selectedForPairing;
40
- constructor(config: ItemRendererConfig);
41
- /**
42
- * Render the entire item with all interactions
43
- */
44
- render(): void;
45
- /**
46
- * Get item body HTML with block interactions removed
47
- */
48
- private getProcessedItemBodyHtml;
49
- /**
50
- * Process inline interactions (textEntry, inlineChoice)
51
- * Replaces QTI XML tags with web component placeholders
52
- */
53
- private processInlineInteractions;
54
- /**
55
- * Create a web component element for an interaction
56
- */
57
- private createInteractionElement;
58
- /**
59
- * Handle response change from an interaction
60
- */
61
- private handleResponseChange;
62
- /**
63
- * Update a specific interaction element's response value
64
- */
65
- private updateInteractionElement;
66
- /**
67
- * Update all responses at once
68
- */
69
- setResponses(responses: Record<string, any>): void;
70
- /**
71
- * Set disabled state for all interactions
72
- */
73
- setDisabled(disabled: boolean): void;
74
- /**
75
- * Get current responses
76
- */
77
- getResponses(): Record<string, any>;
78
- /**
79
- * Clean up event listeners and elements
80
- */
81
- private cleanup;
82
- /**
83
- * Destroy the renderer and clean up all resources
84
- */
85
- destroy(): void;
86
- }
87
- /**
88
- * Create a new ItemRenderer instance
89
- */
90
- export declare function createItemRenderer(config: ItemRendererConfig): ItemRenderer;
91
- //# sourceMappingURL=ItemRenderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ItemRenderer.d.ts","sourceRoot":"","sources":["../../src/core/ItemRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAK1C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IAEf,oDAAoD;IACpD,SAAS,EAAE,WAAW,CAAC;IAEvB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEhC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,yEAAyE;IACzE,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAA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