@pie-qti/player-elements 0.1.23 → 0.1.25

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 (81) hide show
  1. package/dist/ItemToolBar-d36g3aw4-B6TGPyKt.js +3079 -0
  2. package/dist/ItemToolBar-d36g3aw4-B6TGPyKt.js.map +1 -0
  3. package/dist/ar-SA-BDmOol_3.js +854 -0
  4. package/dist/ar-SA-BDmOol_3.js.map +1 -0
  5. package/dist/{define-CqE08oOW.js → define-D80uAEx4.js} +2891 -4399
  6. package/dist/define-D80uAEx4.js.map +1 -0
  7. package/dist/dist-BSG0NOza.js +229 -0
  8. package/dist/dist-BSG0NOza.js.map +1 -0
  9. package/dist/{dist-CsEP48m1.js → dist-C8BDh5vZ.js} +1129 -760
  10. package/dist/dist-C8BDh5vZ.js.map +1 -0
  11. package/dist/dist-CQel8-vi.js +2507 -0
  12. package/dist/dist-CQel8-vi.js.map +1 -0
  13. package/dist/{dist-DQ_jFQFX.js → dist-L-bDDBry.js} +231 -147
  14. package/dist/dist-L-bDDBry.js.map +1 -0
  15. package/dist/{element-DU-n15ch.js → element-C5rTAwch.js} +2 -2
  16. package/dist/{element-DU-n15ch.js.map → element-C5rTAwch.js.map} +1 -1
  17. package/dist/{element-class-DBV-1lkb-BeszDwN_.js → element-class-B_qAd8ET-DGj15cBY.js} +4404 -3503
  18. package/dist/element-class-B_qAd8ET-DGj15cBY.js.map +1 -0
  19. package/dist/elements/BaseSvelteMountElement.d.ts +1 -0
  20. package/dist/elements/QtiAssessmentPlayerElement.d.ts +1 -0
  21. package/dist/elements.js +3 -3
  22. package/dist/es-ES-C98YtDtb.js +802 -0
  23. package/dist/es-ES-C98YtDtb.js.map +1 -0
  24. package/dist/fr-FR-CrmmiRPf.js +802 -0
  25. package/dist/fr-FR-CrmmiRPf.js.map +1 -0
  26. package/dist/index.js +2 -2
  27. package/dist/item-toolbar-element-BgqPFwsS.js +1990 -0
  28. package/dist/item-toolbar-element-BgqPFwsS.js.map +1 -0
  29. package/dist/{types-BFOGFD4R.js → language-tags-BwFWXo71.js} +24 -3
  30. package/dist/language-tags-BwFWXo71.js.map +1 -0
  31. package/dist/nl-NL-BRA_1Wcl.js +507 -0
  32. package/dist/nl-NL-BRA_1Wcl.js.map +1 -0
  33. package/dist/nl-NL-CAR7pgVz.js +802 -0
  34. package/dist/nl-NL-CAR7pgVz.js.map +1 -0
  35. package/dist/pie-DwmznDHb.js +363 -0
  36. package/dist/pie-DwmznDHb.js.map +1 -0
  37. package/dist/pie-assessment-toolkit-Cruxm385.js +5 -0
  38. package/dist/pie-assessment-toolkit-Cruxm385.js.map +1 -0
  39. package/dist/pie-assessment-toolkit-DJfg6laX.js +5 -0
  40. package/dist/pie-assessment-toolkit-DJfg6laX.js.map +1 -0
  41. package/dist/{pie-assessment-toolkit-element-BGOTMhdG.js → pie-assessment-toolkit-element-CT5UuvVY.js} +1679 -1245
  42. package/dist/pie-assessment-toolkit-element-CT5UuvVY.js.map +1 -0
  43. package/dist/pie-tool-calculator-Crfk-IZe.js +378 -0
  44. package/dist/pie-tool-calculator-Crfk-IZe.js.map +1 -0
  45. package/dist/{root-Dqg3cyBt.js → provider-gBXlGb0d.js} +4 -44
  46. package/dist/provider-gBXlGb0d.js.map +1 -0
  47. package/dist/register-players.js +1 -1
  48. package/dist/register.js +10603 -10162
  49. package/dist/register.js.map +1 -1
  50. package/dist/{resolveItems-DhQQhD2k.js → resolveItems-CNMvD8LP.js} +2 -2
  51. package/dist/{resolveItems-DhQQhD2k.js.map → resolveItems-CNMvD8LP.js.map} +1 -1
  52. package/dist/ro-RO-DTZbhL0e.js +802 -0
  53. package/dist/ro-RO-DTZbhL0e.js.map +1 -0
  54. package/dist/root-dCY6j_Hh.js +47 -0
  55. package/dist/root-dCY6j_Hh.js.map +1 -0
  56. package/dist/tag-names-DZGvnAgd.js +2495 -0
  57. package/dist/tag-names-DZGvnAgd.js.map +1 -0
  58. package/dist/th-TH-aqlT_oK3.js +802 -0
  59. package/dist/th-TH-aqlT_oK3.js.map +1 -0
  60. package/dist/tool-tts-inline-k3hLJUfp.js +4447 -0
  61. package/dist/tool-tts-inline-k3hLJUfp.js.map +1 -0
  62. package/dist/zh-CN-DCqaRRhU.js +802 -0
  63. package/dist/zh-CN-DCqaRRhU.js.map +1 -0
  64. package/package.json +8 -8
  65. package/dist/define-CqE08oOW.js.map +0 -1
  66. package/dist/dist-B1Rc9Jhz.js +0 -220
  67. package/dist/dist-B1Rc9Jhz.js.map +0 -1
  68. package/dist/dist-CQEJemjs.js +0 -5061
  69. package/dist/dist-CQEJemjs.js.map +0 -1
  70. package/dist/dist-CsEP48m1.js.map +0 -1
  71. package/dist/dist-DQ_jFQFX.js.map +0 -1
  72. package/dist/element-class-DBV-1lkb-BeszDwN_.js.map +0 -1
  73. package/dist/item-toolbar-element-iE73NEkH.js +0 -1922
  74. package/dist/item-toolbar-element-iE73NEkH.js.map +0 -1
  75. package/dist/pie-assessment-toolkit-element-BGOTMhdG.js.map +0 -1
  76. package/dist/pie-tool-calculator-CkQb5qxg.js +0 -2243
  77. package/dist/pie-tool-calculator-CkQb5qxg.js.map +0 -1
  78. package/dist/root-Dqg3cyBt.js.map +0 -1
  79. package/dist/tool-tts-inline-CA3VjWU4.js +0 -3670
  80. package/dist/tool-tts-inline-CA3VjWU4.js.map +0 -1
  81. package/dist/types-BFOGFD4R.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dist-CQel8-vi.js","names":["DOMPurify"],"sources":["../../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/i18n/messages/en-US.js","../../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/i18n/provider.js","../../../node_modules/.bun/dompurify@3.4.16/node_modules/dompurify/dist/purify.es.mjs","../../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/security/sanitize-forbidden-lists.js","../../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/security/sanitize-style-attribute.js","../../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/security/sanitize-svg-icon.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/internal/constants.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/internal/debug.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/internal/re.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/internal/parse-options.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/internal/identifiers.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/classes/semver.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/parse.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/valid.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/clean.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/inc.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/diff.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/major.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/minor.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/patch.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/prerelease.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/compare.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/rcompare.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/compare-loose.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/compare-build.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/sort.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/rsort.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/gt.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/lt.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/eq.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/neq.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/gte.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/lte.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/cmp.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/coerce.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/truncate.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/internal/lrucache.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/classes/range.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/classes/comparator.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/functions/satisfies.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/ranges/to-comparators.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/ranges/min-version.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/ranges/valid.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/ranges/outside.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/ranges/gtr.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/ranges/ltr.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/ranges/intersects.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/ranges/simplify.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/ranges/subset.js","../../../node_modules/.bun/semver@7.8.5/node_modules/semver/index.js","../../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/loaders/element-package-policy.js","../../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/loaders/element-loader.js","../../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/ui/first-focusable.js","../../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/ui/focus-trap.js"],"sourcesContent":["/**\n * English (United States) message catalog — the source of truth.\n *\n * This catalog's *shape* generates `MessageKey`, so every other locale is\n * checked against it and a mistyped key at a call site is a compile error. Add a\n * key here first.\n *\n * A TypeScript module rather than JSON: `tsc` compiles it to real JS, which\n * removes the `with { type: \"json\" }` import-attribute hazard that already broke\n * every non-English locale once under Node's ESM loader, and it lets the key\n * union be derived rather than maintained.\n *\n * Conventions:\n * - `{placeholder}` slots interpolate; keep the names stable across locales.\n * - A plural group is an object of CLDR categories; `other` is required and\n * `Intl.PluralRules` picks the rest, so a locale may carry more forms than\n * English has.\n * - Keys ending `A11y` are for assistive technology only and are never rendered\n * as visible text. They carry the operating instructions a sighted user reads\n * from the layout.\n * - Developer-facing diagnostics (`throw`/`console`) are deliberately absent.\n * Only strings a learner, teacher or author can see belong here.\n *\n * @module @pie-players/pie-players-shared/i18n/messages/en-US\n */\nconst enUS = {\n /** Verbs and nouns reused across more than one package. */\n common: {\n close: \"Close\",\n cancel: \"Cancel\",\n save: \"Save\",\n reset: \"Reset\",\n retry: \"Retry\",\n back: \"Back\",\n next: \"Next\",\n previous: \"Previous\",\n submit: \"Submit\",\n continue: \"Continue\",\n finish: \"Finish\",\n yes: \"Yes\",\n no: \"No\",\n ok: \"OK\",\n any: \"Any\",\n off: \"Off\",\n auto: \"Auto\",\n all: \"All\",\n none: \"None\",\n loading: \"Loading…\",\n error: \"Error\",\n settings: \"Settings\",\n language: \"Language\",\n theme: \"Theme\",\n preview: \"Preview\",\n author: \"Author\",\n unknown: \"Unknown\",\n untitled: \"Untitled\",\n apply: \"Apply\",\n enabled: \"Enabled\",\n disabled: \"Disabled\",\n closeA11y: \"Close\",\n settingsA11y: \"Open settings menu\",\n },\n /**\n * Player chrome: the section, item and assessment players' own surfaces.\n * Not the authored content, which carries its own language.\n */\n player: {\n passage: \"Passage\",\n passages: \"Passages\",\n question: \"Question\",\n questionNumbered: \"Question {position}\",\n questions: \"Questions\",\n items: \"Items\",\n section: \"Section\",\n loadingSection: \"Loading section content…\",\n loadingPassage: \"Loading passage content…\",\n configurationError: \"Configuration Error\",\n playerError: \"Player Error\",\n authoringBackendError: \"Authoring Backend Configuration Error\",\n itemLoadError: \"Question could not be loaded.\",\n sectionTabsA11y: \"Section content tabs\",\n passagesRegionA11y: \"Passages\",\n itemsRegionA11y: \"Items\",\n sectionToolsA11y: \"Section tools\",\n scrollDownA11y: \"Scroll down\",\n resizePanels: \"Resize panels\",\n resizePassagesAndItemsA11y: \"Resize passages and items panels\",\n resizeMediaRegion: \"Resize media region\",\n resizeQuestionAndMediaA11y: \"Resize question and media panels\",\n resizePassageAndMediaA11y: \"Resize passage and media panels\",\n /**\n * The assessment player's own section-to-section navigation. Its Back and\n * Next controls take `common.back` / `common.next`.\n */\n assessment: {\n sectionPosition: \"Section {position} of {total}\",\n noSections: \"No sections\",\n loadFailed: \"The assessment could not be loaded. Try again.\",\n restoreFailed: \"Your saved answers for this section could not be restored. Try again.\",\n },\n /** Formative delivery: check-answer control and its outcome announcements. */\n formative: {\n checkAnswer: \"Check answer\",\n tryAgain: \"Try again\",\n answerRecorded: \"Answer recorded.\",\n correct: \"Correct.\",\n partlyCorrect: \"Partly correct.\",\n notCorrect: \"Not correct.\",\n notAutoScored: \"Answer recorded. This question is not scored automatically.\",\n checkFailed: \"This question could not be checked. Try again.\",\n /**\n * Appended after the outcome, so the announcement reads\n * \"Not correct. 2 tries left.\" Kept a separate plural group rather than\n * folded into each outcome: the tries count varies independently of\n * correctness, and cross-multiplying them is 4 x N strings.\n */\n triesLeft: {\n one: \"{count} try left.\",\n other: \"{count} tries left.\",\n },\n },\n /**\n * Timed media: what the learner is told as the timeline reveals questions and\n * a gate holds playback. Announced through a polite live region and shown as\n * visible text, because a pause the learner did not ask for has to be\n * perceivable without hearing it (WCAG 1.1.1, 4.1.3).\n */\n timedMedia: {\n waitingForMedia: \"Questions will appear as the media plays.\",\n questionAvailable: \"Question {position} is now available.\",\n /** Playback really is stopped: the media source reported it can pause. */\n playbackPaused: \"Playback paused. Answer question {position} to continue.\",\n /**\n * The same gate where the source cannot pause. Worded as a request rather\n * than a statement, because claiming playback stopped when it did not is\n * exactly the silent degradation this contract refuses.\n */\n playbackAdvisory: \"Answer question {position} before continuing with the media.\",\n playbackReleased: \"Answer accepted. Continue playing the media.\",\n },\n },\n /** Toolbar and tool-shell chrome owned by the assessment toolkit. */\n toolkit: {\n toolsA11y: \"Assessment tools\",\n toolbarInitError: \"Unable to initialize assessment toolkit.\",\n settingsTitle: \"Settings\",\n closeSettingsA11y: \"Close settings\",\n dragPanelA11y: \"Drag panel\",\n closePanelA11y: \"Close panel\",\n resizeWindow: \"Resize window\",\n minimize: \"Minimize\",\n maximize: \"Maximize\",\n minimizePanelA11y: \"Minimize panel\",\n maximizePanelA11y: \"Maximize panel\",\n /** Tool-window keyboard controls, exposed only to assistive technology. */\n window: {\n moveLeftA11y: \"Move tool left\",\n moveRightA11y: \"Move tool right\",\n moveUpA11y: \"Move tool up\",\n moveDownA11y: \"Move tool down\",\n shrinkA11y: \"Shrink tool window\",\n growA11y: \"Grow tool window\",\n centerA11y: \"Center tool window\",\n closeA11y: \"Close tool\",\n },\n /**\n * Live-region announcements shared by the draggable tools — ruler,\n * protractor, line reader. Keyboard movement and rotation read the same in\n * every one of them, so the strings live once here rather than per tool.\n */\n announce: {\n movedUp: \"Moved up to {position}\",\n movedDown: \"Moved down to {position}\",\n movedLeft: \"Moved left to {position}\",\n movedRight: \"Moved right to {position}\",\n rotatedTo: \"Rotated to {degrees} degrees\",\n },\n },\n /**\n * Per-capability strings, keyed by `toolId`.\n *\n * `name` and `description` back `ToolRegistration.nameKey` /\n * `descriptionKey`, so the toolbar label and the registration contract read\n * the same catalog entry.\n */\n tools: {\n calculator: {\n name: \"Calculator\",\n nameBasic: \"Basic Calculator\",\n nameScientific: \"Scientific Calculator\",\n nameGraphing: \"Graphing Calculator\",\n description: \"Multi-type calculator (basic, scientific, graphing)\",\n // Announced by the inline calculator's toggle. One key per variant and\n // state rather than \"{name} opened\": Dutch and German put the participle\n // last, so the sentence has to be authored whole. All three variants the\n // provider implements are covered, not just the two the packaged toolbar\n // registration offers — the inline element takes its type from the host.\n openedBasic: \"Basic calculator opened\",\n openedScientific: \"Scientific calculator opened\",\n openedGraphing: \"Graphing calculator opened\",\n closedBasic: \"Basic calculator closed\",\n closedScientific: \"Scientific calculator closed\",\n closedGraphing: \"Graphing calculator closed\",\n toolA11y: \"Calculator tool\",\n loading: \"Loading calculator…\",\n providerUnavailable: \"The calculator is unavailable.\",\n },\n graph: {\n name: \"Graph\",\n description: \"Graphing calculator and coordinate plane\",\n buttonA11y: \"Graph, graphing calculator\",\n tooltip: \"Graph\",\n toolA11y: \"Graph tool — draw points and lines on a coordinate grid\",\n canvasA11y: \"Graph canvas — use tools to add points and draw lines\",\n grid: \"Grid:\",\n gridOpacityA11y: \"Grid opacity\",\n pointA11y: \"Graph point {id}\",\n modeSelector: \"Selector\",\n modeSelectorHint: \"Selector: click and drag points to move them or associated lines.\",\n modePoint: \"Point\",\n modePointHint: \"Point: click on the grid to add points.\",\n modeLine: \"Line\",\n modeLineHint: \"Line: click a starting point, then an ending point to draw a line.\",\n modeDelete: \"Delete\",\n modeDeleteHint: \"Delete: click on a point to delete it and any connected lines.\",\n },\n periodicTable: {\n name: \"Periodic Table\",\n description: \"Chemistry periodic table reference\",\n buttonA11y: \"Periodic Table, chemistry reference\",\n tooltip: \"Periodic Table\",\n toolA11y: \"Periodic table — select an element to view its details\",\n elementsA11y: \"Periodic table elements\",\n showAllA11y: \"Show all elements\",\n allElements: \"All Elements\",\n atomicMass: \"Atomic Mass\",\n atomicNumber: \"Atomic No\",\n electronConfig: \"Electron Config\",\n phase: \"Phase\",\n filterByA11y: \"Filter by {category}\",\n /**\n * Element cell label. Element *names* come from the periodic-table data\n * file, not from here: they are content, and a locale that renames them\n * needs a translated data file rather than 118 catalog keys.\n */\n elementA11y: \"{name}, Symbol: {symbol}, Atomic number: {number}, Atomic mass: {mass}, Category: {category}\",\n outsideFilterA11y: \", outside the current filter\",\n /** IUPAC element categories. Chemistry nomenclature, translated per locale. */\n category: {\n unknown: \"Unknown\",\n alkaliMetal: \"Alkali Metal\",\n alkalineEarthMetal: \"Alkaline Earth Metal\",\n transitionMetal: \"Transition Metal\",\n postTransitionMetal: \"Post-transition Metal\",\n metalloid: \"Metalloid\",\n diatomicNonmetal: \"Diatomic Nonmetal\",\n polyatomicNonmetal: \"Polyatomic Nonmetal\",\n nobleGas: \"Noble Gas\",\n lanthanide: \"Lanthanide\",\n actinide: \"Actinide\",\n },\n },\n ruler: {\n name: \"Ruler\",\n description: \"On-screen ruler for measurements\",\n buttonA11y: \"Ruler\",\n tooltip: \"Ruler\",\n toolA11y: \"Draggable and rotatable ruler measurement tool\",\n unitSelectionA11y: \"Ruler unit selection\",\n inches: \"Inches\",\n centimeters: \"Centimeters\",\n // Second form of each unit name, for interpolation into a sentence —\n // `switchedTo`, `applicationA11y`, `imageAlt`. English needs it for\n // sentence case; a language that capitalises nouns everywhere will have\n // the two forms identical. Both are spelled out rather than abbreviated\n // because every one of those three is read aloud, and a screen reader\n // says \"cm\" as two letters.\n inchesInSentence: \"inches\",\n centimetersInSentence: \"centimeters\",\n switchToInchesA11y: \"Switch to inches\",\n switchToCentimetersA11y: \"Switch to centimeters\",\n switchedTo: \"Switched to {unit}\",\n applicationA11y: \"Ruler tool. Use arrow keys to move, Shift+arrows to rotate, PageUp or PageDown for fine rotation, U to toggle units. Current unit: {unit}\",\n imageAlt: \"Ruler showing {unit}\",\n },\n protractor: {\n name: \"Protractor\",\n description: \"On-screen protractor for angle measurements\",\n buttonA11y: \"Protractor\",\n tooltip: \"Protractor\",\n toolA11y: \"Protractor tool. Use arrow keys to move, Shift+arrows to rotate, and PageUp or PageDown for fine rotation.\",\n roleA11y: \"Draggable and rotatable protractor measurement tool\",\n imageAlt: \"Protractor with 180-degree semicircular scale marked from 0 to 180 degrees in both directions, with degree markings every 10 degrees\",\n },\n /**\n * The two dictionaries. `toolA11y` names the floating panel; the button\n * names follow the toolbar rule — the tooltip verbatim, plus a purpose\n * clause only where the tooltip alone does not identify the tool.\n */\n dictionary: {\n name: \"Dictionary\",\n description: \"Look up word definitions\",\n buttonA11y: \"Dictionary, look up word definitions\",\n tooltip: \"Dictionary\",\n toolA11y: \"Dictionary\",\n },\n pictureDictionary: {\n name: \"Picture Dictionary\",\n description: \"Look up pictures for words\",\n buttonA11y: \"Picture Dictionary, look up pictures for words\",\n tooltip: \"Picture Dictionary\",\n toolA11y: \"Picture Dictionary\",\n },\n /**\n * The Spanish variants. Named in the interface locale like every other tool label —\n * a Dutch-speaking proctor reading a Dutch interface still sees which language the\n * dictionary looks words up in.\n */\n dictionarySpanish: {\n name: \"Spanish Dictionary\",\n description: \"Look up word definitions in Spanish\",\n buttonA11y: \"Spanish Dictionary, look up word definitions in Spanish\",\n tooltip: \"Spanish Dictionary\",\n toolA11y: \"Spanish Dictionary\",\n },\n pictureDictionarySpanish: {\n name: \"Spanish Picture Dictionary\",\n description: \"Look up pictures for words in Spanish\",\n buttonA11y: \"Spanish Picture Dictionary, look up pictures for words in Spanish\",\n tooltip: \"Spanish Picture Dictionary\",\n toolA11y: \"Spanish Picture Dictionary\",\n },\n lineReader: {\n name: \"Line Reader\",\n description: \"Reading guide overlay\",\n buttonA11y: \"Line Reader, reading guide\",\n tooltip: \"Line Reader\",\n roleA11y: \"Draggable and resizable reading guide overlay\",\n close: \"Close line reader\",\n resizeWindowA11y: \"Drag to resize the reading window\",\n resizeFrameA11y: \"Drag to resize the frame and window width\",\n windowHeightAnnounce: \"Reading window height {pixels} pixels\",\n frameHeightAnnounce: \"Frame height {pixels} pixels\",\n widthAnnounce: \"Width {pixels} pixels\",\n applicationA11y: \"Line Reader tool. A clear reading window inside an obscuring frame. Use arrow keys to move, +/- to resize the reading window, Escape to close. Reading window height: {paneHeight} pixels, Frame height: {frameHeight} pixels\",\n resizeWindowFullA11y: \"Resize the reading window. Drag, or use the up and down arrow keys to change its height. Current height {paneHeight} pixels\",\n resizeFrameFullA11y: \"Resize the frame. Drag, or use the up and down arrow keys to change the frame height and the left and right arrow keys to change the width. Current frame height {frameHeight} pixels, width {width} pixels\",\n },\n answerEliminator: {\n name: \"Answer Eliminator\",\n description: \"Strike through answer choices\",\n buttonA11y: \"Strike Through, eliminate answer choices\",\n tooltip: \"Strike Through\",\n },\n highlighter: {\n name: \"Highlighter\",\n description: \"Highlight and annotate text\",\n buttonA11y: \"Highlight text\",\n tooltip: \"Highlight\",\n },\n annotationToolbar: {\n name: \"Annotation\",\n description: \"Highlight and annotate text\",\n buttonA11y: \"Annotate, highlight and mark up text\",\n // Not \"Highlight\": that is `tools.highlighter.tooltip`, and two toolbar\n // buttons carrying the same visible label is a defect rather than a style\n // choice. This tool does more than highlight — underline, remove, clear.\n tooltip: \"Annotate\",\n toolbarA11y: \"Text annotation toolbar\",\n underline: \"Underline\",\n underlineA11y: \"Underline selected text\",\n readAloud: \"Read Aloud\",\n readAloudA11y: \"Read selected text aloud\",\n remove: \"Remove\",\n removeA11y: \"Remove this annotation\",\n clearAll: \"Clear All\",\n clearAllA11y: \"Clear all annotations from document\",\n highlightYellowA11y: \"Yellow highlight\",\n highlightPinkA11y: \"Pink highlight\",\n highlightBlueA11y: \"Blue highlight\",\n highlightGreenA11y: \"Green highlight\",\n },\n theme: {\n name: \"Theme\",\n description: \"Accessible themes and contrast\",\n buttonA11y: \"Theme, change colors and contrast\",\n tooltip: \"Theme\",\n selectorA11y: \"Theme selector\",\n hint: \"Select a theme to improve readability and reduce eye strain.\",\n selectA11y: \"Select theme\",\n selectCurrentA11y: \"Select theme. Current theme: {name}\",\n optionUnavailableA11y: \"{name}, unavailable\",\n unavailableName: \"Unavailable theme: {id}\",\n unavailableDescription: \"PIE's managed base theme remains active until this theme becomes available again.\",\n unavailableStatus: \"The selected theme is unavailable. PIE's managed base theme is active until it becomes available again.\",\n },\n textToSpeech: {\n name: \"Text to Speech\",\n description: \"Read content aloud\",\n toolA11y: \"Text-to-speech tool\",\n title: \"Text-to-Speech\",\n initializing: \"Initializing…\",\n initFailed: \"Failed to initialize text-to-speech.\",\n selectText: \"Select text on the page to read it aloud.\",\n speed: \"Speed:\",\n play: \"Play\",\n pause: \"Pause\",\n resume: \"Resume\",\n stop: \"Stop\",\n speaking: \"Speaking…\",\n paused: \"Paused\",\n charactersSelected: {\n one: \"{count} character selected\",\n other: \"{count} characters selected\",\n },\n rate: {\n slow: \"Slow\",\n slower: \"Slower\",\n normal: \"Normal\",\n faster: \"Faster\",\n fast: \"Fast\",\n veryFast: \"Very Fast\",\n },\n /** Inline reading controls and their live-region announcements. */\n inline: {\n controlsA11y: \"Reading controls\",\n playbackSpeedA11y: \"Playback speed\",\n rewindA11y: \"Rewind\",\n fastForwardA11y: \"Fast-forward\",\n stopA11y: \"Stop reading\",\n initializing: \"Initializing text-to-speech\",\n initFailed: \"Unable to initialize text-to-speech. Try again.\",\n starting: \"Starting reading\",\n started: \"Reading started\",\n resumed: \"Reading resumed\",\n pausedAnnouncement: \"Reading paused\",\n stopped: \"Reading stopped\",\n switchedSection: \"Reading switched to another section\",\n startFailed: \"Unable to start reading\",\n skippedForward: \"Skipped forward\",\n skipForwardFailed: \"Unable to skip forward\",\n skippedBackward: \"Skipped backward\",\n skipBackwardFailed: \"Unable to skip backward\",\n speedChangeFailed: \"Unable to change playback speed\",\n speedAnnounce: \"Playback speed {label}\",\n playA11y: \"Play reading\",\n pauseA11y: \"Pause reading\",\n resumeA11y: \"Resume reading\",\n },\n },\n signLanguage: {\n name: \"Sign Language\",\n description: \"Signed alternate for authored content\",\n /**\n * Names of the signed language itself, keyed by its ISO 639-3 code.\n *\n * The name of the *adaptation*, never inferred from the item's content\n * language. `signedEnglish` is not a distinct sign language; it rides\n * the same card type tagged with a spoken-language code.\n */\n generic: \"Sign language\",\n unknown: \"Sign language ({code})\",\n ase: \"American Sign Language\",\n bfi: \"British Sign Language\",\n fsl: \"French Sign Language\",\n gss: \"Greek Sign Language\",\n mfs: \"Mexican Sign Language\",\n signedEnglish: \"Signed English\",\n regionA11y: \"{language} translation\",\n },\n audioTranscript: {\n name: \"Audio Transcript\",\n description: \"Text transcript of audio content\",\n regionA11y: \"Transcript\",\n },\n },\n /**\n * Developer panel chrome.\n *\n * These packages ship as published custom elements, so their chrome is\n * localized like any other. The JSON payloads they dump are data, not\n * message content, and stay as authored.\n */\n debug: {\n session: \"Session\",\n sessionData: \"Session Data\",\n sessionDataPersistent: \"PIE Session Data (Persistent)\",\n noItemSessionYet: \"No item session data yet. Interact with the item to see updates here.\",\n itemSessionsSnapshot: \"Item Sessions Snapshot\",\n sectionControllerUnavailable: \"Section controller not available for this section yet.\",\n filteredModel: \"Filtered Model\",\n environment: \"Environment\",\n events: \"Events\",\n controllerEvents: \"Controller Events\",\n instrumentation: \"Instrumentation\",\n databaseState: \"Database state\",\n sessionDb: \"Session DB (Server)\",\n noRows: \"No rows\",\n noRecords: \"No instrumentation records yet.\",\n selectRecord: \"Select a record to inspect details.\",\n selectEvent: \"Select an event to inspect payload details.\",\n showRawTables: \"Show raw tables\",\n showReconstructedSnapshots: \"Show reconstructed snapshots\",\n showSectionRequest: \"Show section request\",\n showAssessmentRequest: \"Show assessment request\",\n liveUpdatesUnsupported: \"Live updates are not supported in this browser\",\n liveUpdatesDisconnected: \"Live updates disconnected; retrying…\",\n fieldType: \"Type:\",\n fieldTarget: \"Target:\",\n fieldItem: \"Item:\",\n fieldCanonical: \"Canonical:\",\n fieldIntent: \"Intent:\",\n fieldDuplicates: \"Duplicates:\",\n fieldSemanticRepeats: \"Semantic Repeats:\",\n dragItemSessionPanelA11y: \"Drag item session panel\",\n debuggerTabsA11y: \"Debugger tabs\",\n sessionDataJsonA11y: \"Session data JSON\",\n environmentJsonA11y: \"Environment JSON\",\n filteredModelJsonA11y: \"Filtered model JSON\",\n sectionSessionJsonA11y: \"Section session snapshot JSON\",\n eventLevelFilterA11y: \"Event level filter\",\n controllerEventDetailsA11y: \"Controller event details\",\n instrumentationFilterA11y: \"Filter instrumentation record type\",\n instrumentationDetailsA11y: \"Instrumentation record details\",\n toggleSessionPanelA11y: \"Toggle session panel\",\n toggleEventPanelA11y: \"Toggle event broadcast panel\",\n toggleDatabasePanelA11y: \"Toggle database state panel\",\n toggleInstrumentationPanelA11y: \"Toggle instrumentation panel\",\n /** PNP debugger. */\n pnp: {\n title: \"PNP Profile\",\n noAssessmentBound: \"No assessment bound\",\n determinationReadOnly: \"Determination (read-only)\",\n toolsEditor: \"Tools Editor\",\n enforcement: \"PNP enforcement\",\n allAvailableTools: \"All available tools\",\n clearPlacement: \"Clear placement\",\n tool: \"Tool\",\n placement: \"Placement\",\n provider: \"Provider\",\n simulation: \"PNP simulation\",\n resolvedTools: \"Resolved Tools (toolkit)\",\n provenanceSummary: \"Tool Policy Provenance Summary\",\n perToolDecisions: \"Per-Tool Decisions\",\n profileReadOnly: \"PNP Profile (read-only)\",\n },\n /** TTS settings panel. */\n tts: {\n title: \"TTS settings\",\n closeA11y: \"Close TTS settings\",\n toolbarLayoutMode: \"Toolbar layout mode\",\n reservedRow: \"Reserved row\",\n expandingRow: \"Expanding row\",\n floatingOverlay: \"Floating overlay\",\n leftAlignedControls: \"Left-aligned controls\",\n inlineSpeedButtons: \"Inline speed buttons\",\n resetToDefaults: \"Reset to defaults\",\n mathHighlighting: \"Math highlighting\",\n checkingAvailability: \"Checking availability…\",\n recheck: \"Recheck\",\n voice: \"Voice\",\n bestAvailableVoice: \"Best available voice (auto)\",\n unnamedVoice: \"Unnamed voice\",\n apiEndpoint: \"API endpoint\",\n gender: \"Gender\",\n any: \"Any\",\n male: \"Male\",\n female: \"Female\",\n neutral: \"Neutral\",\n engine: \"Engine\",\n neural: \"Neural\",\n standard: \"Standard\",\n providerDefault: \"Provider default\",\n format: \"Format\",\n sampleRate: \"Sample rate\",\n speechMarks: \"Speech marks\",\n word: \"Word\",\n wordAndSentence: \"Word + sentence\",\n voiceType: \"Voice type\",\n wavenetVoiceType: \"WaveNet\",\n studioVoiceType: \"Studio\",\n plainText: \"Plain text\",\n sampleText: \"Sample text\",\n resetSample: \"Reset sample\",\n providerAvailable: \"Provider available.\",\n providerUnavailable: \"Provider unavailable.\",\n providerCheckFailed: \"Provider availability check failed.\",\n providerNotChecked: \"Provider availability has not been checked yet.\",\n webSpeechUnavailable: \"Web Speech API is not available in this browser.\",\n browserNoVoices: \"Browser text-to-speech is available, but no voices were returned yet.\",\n browserUnavailable: \"Browser text-to-speech is not available.\",\n googleUnavailable: \"Google Cloud TTS is not available from the configured API.\",\n // No keys for the preview sample text: it is spoken by the voice under\n // test, so its language follows that voice, not the interface locale.\n pollyUnavailable: \"AWS Polly is not available from the configured API.\",\n recommendedVoices: \"Recommended voices\",\n allVoices: \"All available voices\",\n previewVoice: \"Preview voice\",\n stopPreview: \"Stop preview\",\n applying: \"Applying…\",\n ssmlPreviewUnsupported: \"SSML preview is not supported in the Browser backend.\",\n pollySsmlHint: \"Some Polly neural voices reject certain SSML tags (for example emphasis). Use basic SSML tags if preview fails.\",\n mathHighlightParts: \"Highlighting each part of a formula as it is read, falling back to the whole formula when alignment is uncertain.\",\n mathHighlightBlock: \"Highlighting each formula as a single block instead of breaking it into parts.\",\n previewFailed: \"Failed to play preview audio.\",\n previewNoAudio: \"Preview response did not include audio content.\",\n previewEnterText: \"Enter preview text before starting playback.\",\n previewUnavailable: \"Cannot preview while this service is unavailable.\",\n browserSynthesisUnavailable: \"Browser speech synthesis is unavailable.\",\n browserSynthesisEndedEarly: \"Browser speech synthesis ended before audio started. Restart the browser and try again.\",\n browserSynthesisQueueFailed: \"Browser speech synthesis failed to queue preview audio.\",\n browserPreviewFailed: \"Failed to play browser voice preview.\",\n ssmlWordTrackingDisabled: \"Google SSML preview preserves authored SSML, so word tracking is disabled.\",\n applyUnavailable: \"Cannot apply settings while this service is unavailable.\",\n coordinatorUnavailable: \"Toolkit coordinator is not available for text-to-speech updates.\",\n },\n },\n};\nexport default enUS;\n","/**\n * The bundled i18n provider.\n *\n * Deliberately imports only the English catalog. The dynamic loader map for every\n * other locale lives in `./catalogs.js`, which players import and tools do not:\n * every player and tool `vite.config.ts` sets `external: []`, so anything\n * reachable from a tool's entry inlines into that tool's bundle. Keeping the\n * loader map out of this module is what stops a locale chunk from being emitted\n * into eighteen tool bundles that will never call `setLocale`.\n *\n * @module @pie-players/pie-players-shared/i18n/provider\n */\nimport { findBestLanguageMatch, normalizeLanguageTag, } from \"./language-tags.js\";\nimport enUS from \"./messages/en-US.js\";\n/** The locale every fallback chain terminates at. */\nexport const DEFAULT_LOCALE = \"en-US\";\n/**\n * Assert that a runtime-assembled string is a message key.\n *\n * Every other call site passes a literal checked against `MessageKey`, so a\n * typo is a compile error. This is the one escape hatch, for a key built from an\n * id the catalog cannot enumerate — a host-supplied element category, a\n * colour-scheme id. Unchecked, like any assertion: pair it with `hasKey` where a\n * miss must not reach the screen.\n */\nexport function dynamicMessageKey(key) {\n return key;\n}\n/**\n * Right-to-left primary language subtags.\n *\n * Consulted only where `Intl.Locale.prototype.textInfo` is unavailable — it is\n * the authoritative CLDR answer but shipped late in Safari, and an assessment\n * laid out left-to-right for an Arabic reader is not a graceful degradation.\n * Replaces a four-entry list that omitted every subtag below.\n */\nconst RTL_LANGUAGES = new Set([\n \"ar\", // Arabic\n \"ckb\", // Central Kurdish\n \"dv\", // Dhivehi\n \"fa\", // Persian\n \"he\",\n \"iw\", // Hebrew, current and legacy subtags\n \"ks\", // Kashmiri\n \"ku\", // Kurdish\n \"nqo\", // N'Ko\n \"ps\", // Pashto\n \"sd\", // Sindhi\n \"syr\", // Syriac\n \"ug\", // Uyghur\n \"ur\", // Urdu\n \"yi\", // Yiddish\n]);\nconst PLURAL_CATEGORIES = new Set([\n \"zero\",\n \"one\",\n \"two\",\n \"few\",\n \"many\",\n \"other\",\n]);\nfunction isPluralGroup(node) {\n if (typeof node !== \"object\" || node === null)\n return false;\n const keys = Object.keys(node);\n return keys.length > 0 && keys.every((key) => PLURAL_CATEGORIES.has(key));\n}\n/**\n * Writing direction of a locale tag.\n *\n * Exported because the catalog resolver and the TTS voice selector need it\n * without constructing a provider.\n */\nexport function localeDirection(locale) {\n try {\n const textInfo = new Intl.Locale(locale).textInfo;\n if (textInfo?.direction === \"rtl\" || textInfo?.direction === \"ltr\") {\n return textInfo.direction;\n }\n }\n catch {\n // Not a tag `Intl.Locale` accepts; the subtag check below still answers.\n }\n const language = normalizeLanguageTag(locale).split(\"-\")[0] ?? \"\";\n return RTL_LANGUAGES.has(language) ? \"rtl\" : \"ltr\";\n}\n/**\n * The browser's preferred locale, or `DEFAULT_LOCALE` where there is no\n * `navigator` — so this is safe in Node, which `players-shared` must remain.\n *\n * Nothing calls this by default. Under fixed lockstep patch-only versioning a\n * rendered-string change reaches a host's live delivery on their next install\n * with no build signal on their side, so auto-detection would silently switch an\n * English deployment's chrome on a Dutch-configured laptop. A host that wants\n * detection opts into it.\n */\nexport function detectBrowserLocale() {\n if (typeof navigator === \"undefined\")\n return DEFAULT_LOCALE;\n return navigator.language || navigator.languages?.[0] || DEFAULT_LOCALE;\n}\n/**\n * The bundled provider.\n *\n * Retains the `SimpleI18n` name and the `I18nServiceApi` surface it published\n * before adoption. What changed is behaviour that had no caller: catalogs are\n * BCP-47 keyed and resolved through RFC 4647 lookup rather than string equality,\n * `dir`/`lang` are no longer written to `document.documentElement` (an embedded\n * player has no business writing the host page's root), and plural categories\n * come from `Intl.PluralRules` alone.\n */\nexport class SimpleI18n {\n /** Shared across instances and views: `Intl.PluralRules` is not cheap. */\n static pluralRules = new Map();\n locale;\n fallbackLocale;\n /** Shared by reference with every `withLocale` view. */\n catalogs;\n customMessages;\n loading;\n listeners = new Set();\n config;\n constructor(config = {}) {\n this.config = { ...config };\n this.fallbackLocale = normalizeTag(config.fallbackLocale) || DEFAULT_LOCALE;\n this.catalogs = new Map([[DEFAULT_LOCALE, enUS]]);\n this.customMessages = { ...(config.customMessages ?? {}) };\n this.loading = new Map();\n this.locale = this.resolveLocaleTag(config.locale) ?? DEFAULT_LOCALE;\n }\n /**\n * Set the locale, loading its catalog first.\n *\n * Convenience over `setLocale` for a host that constructs the provider and\n * configures it in two steps. Never falls back to the browser locale; see\n * {@link detectBrowserLocale}.\n */\n async initialize(config) {\n this.config = { ...this.config, ...config };\n if (config.customMessages) {\n for (const [locale, messages] of Object.entries(config.customMessages)) {\n this.addCustomMessages(locale, messages);\n }\n }\n await this.setLocale(config.locale ?? this.locale);\n }\n getLocale() {\n return this.locale;\n }\n /**\n * Switch locale.\n *\n * Resolves the request against the catalogs this provider can serve, loads\n * the winner if it is not resident, then notifies subscribers — in that\n * order, so a component's reactive read re-runs against a catalog that is\n * already in place rather than against the previous locale.\n */\n async setLocale(locale) {\n const resolved = this.resolveLocaleTag(locale);\n if (!resolved) {\n // A locale we ship no catalog for is legitimate: the host may have\n // supplied its own messages for it. Honour the tag and let the\n // fallback chain cover whatever those messages omit.\n this.locale = normalizeTag(locale) || DEFAULT_LOCALE;\n this.notify();\n return;\n }\n if (!this.catalogs.has(resolved)) {\n const inFlight = this.loading.get(resolved);\n if (inFlight) {\n await inFlight;\n }\n else {\n const load = this.loadCatalog(resolved);\n this.loading.set(resolved, load);\n try {\n await load;\n }\n finally {\n this.loading.delete(resolved);\n }\n }\n }\n this.locale = resolved;\n this.notify();\n }\n t(key, values) {\n const message = this.lookup(key);\n if (message === undefined) {\n this.config.onMissingKey?.(key, this.locale);\n return key;\n }\n return interpolate(message, values);\n }\n /**\n * Translate a plural group.\n *\n * The category comes from `Intl.PluralRules` for the active locale, so a\n * locale with more than two forms resolves correctly: Arabic selects among\n * zero/one/two/few/many/other, Polish among one/few/many/other. A category the\n * catalog does not carry resolves to `other`.\n */\n plural(key, options) {\n const group = this.lookupNode(key);\n if (group === undefined || !isPluralGroup(group)) {\n return this.t(key, options);\n }\n const category = this.selectPluralCategory(options.count);\n const form = group[category] ?? group.other;\n return interpolate(form, options);\n }\n getDirection() {\n return localeDirection(this.locale);\n }\n /**\n * Locales this provider can serve: resident catalogs, whatever the loader\n * declares, and any locale the host supplied messages for.\n */\n getAvailableLocales() {\n const tags = new Set([\n ...this.catalogs.keys(),\n ...(this.config.availableLocales ?? []),\n ...Object.keys(this.customMessages),\n ]);\n return [...tags];\n }\n isLocaleLoaded(locale) {\n const resolved = this.resolveLocaleTag(locale);\n return resolved !== undefined && this.catalogs.has(resolved);\n }\n subscribe(listener) {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n }\n hasKey(key) {\n return this.lookup(key) !== undefined;\n }\n /**\n * Add or override messages for one locale.\n *\n * Deep-merged, so a deployment can override a single label without restating\n * a catalog.\n */\n addCustomMessages(locale, messages) {\n const tag = normalizeTag(locale);\n this.customMessages[tag] = deepMerge(this.customMessages[tag] ?? {}, messages);\n this.notify();\n }\n /**\n * A view of this provider fixed to another locale.\n *\n * Catalogs, in-flight loads and custom messages are shared by reference, so\n * `setLocale` through either side is visible to both and no catalog is parsed\n * twice. This is what lets two players on one page render different chrome\n * locales: the locale is per-view, the catalogs are per-provider.\n */\n withLocale(locale) {\n const resolved = this.resolveLocaleTag(locale) ?? normalizeTag(locale);\n if (resolved === this.locale)\n return this;\n const view = new SimpleI18n({ ...this.config, locale: resolved });\n view.locale = resolved || DEFAULT_LOCALE;\n view.catalogs = this.catalogs;\n view.customMessages = this.customMessages;\n view.loading = this.loading;\n return view;\n }\n formatNumber(value, options) {\n try {\n return new Intl.NumberFormat(this.locale, options).format(value);\n }\n catch {\n return new Intl.NumberFormat(DEFAULT_LOCALE, options).format(value);\n }\n }\n formatDate(date, options) {\n try {\n return new Intl.DateTimeFormat(this.locale, options).format(date);\n }\n catch {\n return new Intl.DateTimeFormat(DEFAULT_LOCALE, options).format(date);\n }\n }\n /** The resolved catalog for a locale, for a host that wants to inspect it. */\n getBundle(locale = this.locale) {\n const tag = this.resolveLocaleTag(locale);\n if (!tag)\n return undefined;\n const translations = this.catalogs.get(tag);\n if (!translations)\n return undefined;\n return { locale: tag, translations, direction: localeDirection(tag) };\n }\n /**\n * Which shipped catalog serves a requested tag.\n *\n * RFC 4647 lookup first, so `nl-BE` reaches `nl-NL` through `nl`; then\n * primary-subtag widening, so a bare `nl` reaches the regional `nl-NL`\n * catalog we actually ship. POSIX `nl_NL` normalizes on the way in, which is\n * the form the Learnosity transform emits.\n */\n resolveLocaleTag(locale) {\n if (!locale)\n return undefined;\n const available = this.getAvailableLocales();\n const exactOrPrefix = findBestLanguageMatch(locale, available);\n if (exactOrPrefix)\n return exactOrPrefix;\n const requestedLanguage = normalizeLanguageTag(locale).split(\"-\")[0];\n if (!requestedLanguage)\n return undefined;\n return available.find((candidate) => normalizeLanguageTag(candidate).split(\"-\")[0] === requestedLanguage);\n }\n async loadCatalog(locale) {\n const load = this.config.loadCatalog;\n if (!load)\n return;\n try {\n this.catalogs.set(locale, await load(locale));\n }\n catch (error) {\n // A failed load is not fatal: the fallback chain still resolves every\n // key to English. Rethrowing here would take down a player over a\n // missing chunk.\n throw new Error(`Failed to load i18n catalog for locale: ${locale}`, {\n cause: error,\n });\n }\n }\n /**\n * Resolution order for one key. Host overrides for the active locale win, so\n * a deployment can rename one label without forking a catalog.\n */\n lookupNode(key) {\n const sources = [\n this.customMessages[this.locale],\n this.catalogs.get(this.locale),\n this.customMessages[this.fallbackLocale],\n this.catalogs.get(this.fallbackLocale),\n ];\n for (const source of sources) {\n const hit = readPath(source, key);\n if (hit !== undefined)\n return hit;\n }\n return undefined;\n }\n lookup(key) {\n const node = this.lookupNode(key);\n if (typeof node === \"string\")\n return node;\n // A key landing on a namespace (`t(\"common\")`) or on a plural group is a\n // miss, not a hit: returning the object would put one where the caller\n // expects a string, and interpolating it throws.\n if (node !== undefined && isPluralGroup(node))\n return node.other;\n return undefined;\n }\n selectPluralCategory(count) {\n let rules = SimpleI18n.pluralRules.get(this.locale);\n if (!rules) {\n try {\n rules = new Intl.PluralRules(this.locale);\n }\n catch {\n return count === 1 ? \"one\" : \"other\";\n }\n SimpleI18n.pluralRules.set(this.locale, rules);\n }\n return rules.select(count);\n }\n notify() {\n for (const listener of this.listeners)\n listener();\n }\n}\nfunction normalizeTag(locale) {\n return locale ? locale.trim().replace(/_/g, \"-\") : \"\";\n}\nfunction readPath(source, key) {\n if (!source)\n return undefined;\n let current = source;\n for (const part of key.split(\".\")) {\n if (typeof current !== \"object\" || current === null)\n return undefined;\n current = current[part];\n if (current === undefined)\n return undefined;\n }\n return current;\n}\nfunction interpolate(text, values) {\n if (!values)\n return text;\n return text.replace(/\\{(\\w+)\\}/g, (match, name) => {\n const value = values[name];\n return value === undefined || value === null ? match : String(value);\n });\n}\nfunction deepMerge(target, source) {\n const result = { ...target };\n for (const [key, value] of Object.entries(source)) {\n const existing = result[key];\n if (value &&\n typeof value === \"object\" &&\n existing &&\n typeof existing === \"object\") {\n result[key] = deepMerge(existing, value);\n }\n else {\n result[key] = value;\n }\n }\n return result;\n}\n/**\n * The graceful default: an English-only provider, shared process-wide.\n *\n * `composition-context.md` requires a resolver to work with no publisher\n * present, and this is that state. A tool mounted bare — in `print-player`, in\n * Studio preview, in an authoring harness — resolves this and renders English\n * rather than leaking raw message keys onto the screen. It carries no locale\n * loader, so it pulls no catalog beyond the 5 KB English one already in the\n * bundle.\n */\nlet defaultProvider;\nexport function getDefaultI18n() {\n if (!defaultProvider)\n defaultProvider = new SimpleI18n();\n return defaultProvider;\n}\n/**\n * Resolve a component's interface-locale provider from a published context.\n *\n * Returns a **fresh** object on every call, and that is the whole point. A\n * provider is mutable: `setLocale` swaps its catalog in place, so its identity is\n * unchanged before and after a locale load. A reactive `$derived` reading the\n * provider directly therefore never invalidates, and a label rendered while the\n * catalog was still loading stays English forever — the exact silent failure\n * `composition-context.md` records for a context published without a change\n * signal, and it is silent here too because English is a plausible answer.\n *\n * Deriving this instead gives the component a value whose identity tracks the\n * context republish, so the strings built from it re-render. Call it inside\n * `$derived`, never once at setup:\n *\n * ```ts\n * const interfaceI18n = $derived(resolveInterfaceI18n(runtimeContext));\n * ```\n *\n * A context with no provider — no publisher at all — resolves to the English-only\n * default rather than nothing, which is the graceful default the pull pattern\n * requires.\n */\nexport function resolveInterfaceI18n(source) {\n const provider = source?.i18n ?? getDefaultI18n();\n // A thin facade rather than the provider itself: cheap to allocate (a handful\n // of times per session, once per republish) and it carries no state of its own,\n // so it cannot drift from the provider it delegates to.\n return {\n getLocale: () => provider.getLocale(),\n setLocale: (locale) => provider.setLocale(locale),\n t: (key, values) => provider.t(key, values),\n plural: (key, options) => provider.plural?.(key, options) ?? provider.t(key, options),\n getDirection: () => provider.getDirection?.() ?? \"ltr\",\n hasKey: (key) => provider.hasKey?.(key) ?? false,\n subscribe: (listener) => provider.subscribe?.(listener) ?? (() => { }),\n };\n}\n","/*! @license DOMPurify 3.4.16 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.16/LICENSE */\nfunction _OverloadYield(e, d) {\n\tthis.v = e, this.k = d;\n}\nfunction _arrayLikeToArray(r, a) {\n\t(null == a || a > r.length) && (a = r.length);\n\tfor (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n\treturn n;\n}\nfunction _arrayWithHoles(r) {\n\tif (Array.isArray(r)) return r;\n}\nfunction _iterableToArrayLimit(r, l) {\n\tvar t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n\tif (null != t) {\n\t\tvar e, n, i, u, a = [], f = !0, o = !1;\n\t\ttry {\n\t\t\tif (i = (t = t.call(r)).next, 0 === l) {\n\t\t\t\tif (Object(t) !== t) return;\n\t\t\t\tf = !1;\n\t\t\t} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n\t\t} catch (r) {\n\t\t\to = !0, n = r;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n\t\t\t} finally {\n\t\t\t\tif (o) throw n;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n}\nfunction _nonIterableRest() {\n\tthrow new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */\nfunction _slicedToArray(r, e) {\n\treturn _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();\n}\nfunction _unsupportedIterableToArray(r, a) {\n\tif (r) {\n\t\tif (\"string\" == typeof r) return _arrayLikeToArray(r, a);\n\t\tvar t = {}.toString.call(r).slice(8, -1);\n\t\treturn \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;\n\t}\n}\nfunction AsyncGenerator(e) {\n\tvar t, n;\n\tfunction resume(t, n) {\n\t\ttry {\n\t\t\tvar r = e[t](n), o = r.value, u = o instanceof _OverloadYield;\n\t\t\tPromise.resolve(u ? o.v : o).then(function(n) {\n\t\t\t\tif (u) {\n\t\t\t\t\tvar i = \"return\" === t && o.k ? t : \"next\";\n\t\t\t\t\tif (!o.k || n.done) return resume(i, n);\n\t\t\t\t\tn = e[i](n).value;\n\t\t\t\t}\n\t\t\t\tsettle(!!r.done, n);\n\t\t\t}, function(e) {\n\t\t\t\tresume(\"throw\", e);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tsettle(2, e);\n\t\t}\n\t}\n\tfunction settle(e, r) {\n\t\t2 === e ? t.reject(r) : t.resolve({\n\t\t\tvalue: r,\n\t\t\tdone: e\n\t\t}), (t = t.next) ? resume(t.key, t.arg) : n = null;\n\t}\n\tthis._invoke = function(e, r) {\n\t\treturn new Promise(function(o, u) {\n\t\t\tvar i = {\n\t\t\t\tkey: e,\n\t\t\t\targ: r,\n\t\t\t\tresolve: o,\n\t\t\t\treject: u,\n\t\t\t\tnext: null\n\t\t\t};\n\t\t\tn ? n = n.next = i : (t = n = i, resume(e, r));\n\t\t});\n\t}, \"function\" != typeof e.return && (this.return = void 0);\n}\nAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function() {\n\treturn this;\n}, AsyncGenerator.prototype.next = function(e) {\n\treturn this._invoke(\"next\", e);\n}, AsyncGenerator.prototype.throw = function(e) {\n\treturn this._invoke(\"throw\", e);\n}, AsyncGenerator.prototype.return = function(e) {\n\treturn this._invoke(\"return\", e);\n};\nconst entries = Object.entries;\nconst setPrototypeOf = Object.setPrototypeOf;\nconst isFrozen = Object.isFrozen;\nconst getPrototypeOf = Object.getPrototypeOf;\nconst getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nlet freeze = Object.freeze;\nlet seal = Object.seal;\nlet create = Object.create;\nlet _ref = typeof Reflect !== \"undefined\" && Reflect;\nlet apply = _ref.apply;\nlet construct = _ref.construct;\nif (!freeze) freeze = function freeze(x) {\n\treturn x;\n};\nif (!seal) seal = function seal(x) {\n\treturn x;\n};\nif (!apply) apply = function apply(func, thisArg) {\n\tfor (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];\n\treturn func.apply(thisArg, args);\n};\nif (!construct) construct = function construct(Func) {\n\tfor (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];\n\treturn new Func(...args);\n};\nconst arrayForEach = unapply(Array.prototype.forEach);\nArray.prototype.indexOf;\nconst arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nArray.prototype.slice;\nconst arraySplice = unapply(Array.prototype.splice);\nconst arrayIsArray = Array.isArray;\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst numberToString = unapply(Number.prototype.toString);\nconst booleanToString = unapply(Boolean.prototype.toString);\nconst bigintToString = typeof BigInt === \"undefined\" ? null : unapply(BigInt.prototype.toString);\nconst symbolToString = typeof Symbol === \"undefined\" ? null : unapply(Symbol.prototype.toString);\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst objectToString = unapply(Object.prototype.toString);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n/**\n* Creates a new function that calls the given function with a specified thisArg and arguments.\n*\n* @param func - The function to be wrapped and called.\n* @returns A new function that calls the given function with a specified thisArg and arguments.\n*/\nfunction unapply(func) {\n\treturn function(thisArg) {\n\t\tif (thisArg instanceof RegExp) thisArg.lastIndex = 0;\n\t\tfor (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];\n\t\treturn apply(func, thisArg, args);\n\t};\n}\n/**\n* Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n*\n* @param func - The constructor function to be wrapped and called.\n* @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n*/\nfunction unconstruct(Func) {\n\treturn function() {\n\t\tfor (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];\n\t\treturn construct(Func, args);\n\t};\n}\n/**\n* Add properties to a lookup table\n*\n* @param set - The set to which elements will be added.\n* @param array - The array containing elements to be added to the set.\n* @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n* @returns The modified set with added elements.\n*/\nfunction addToSet(set, array) {\n\tlet transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;\n\tif (setPrototypeOf) setPrototypeOf(set, null);\n\tif (!arrayIsArray(array)) return set;\n\tlet l = array.length;\n\twhile (l--) {\n\t\tlet element = array[l];\n\t\tif (typeof element === \"string\") {\n\t\t\tconst lcElement = transformCaseFunc(element);\n\t\t\tif (lcElement !== element) {\n\t\t\t\tif (!isFrozen(array)) array[l] = lcElement;\n\t\t\t\telement = lcElement;\n\t\t\t}\n\t\t}\n\t\tset[element] = true;\n\t}\n\treturn set;\n}\n/**\n* Clean up an array to harden against CSPP\n*\n* @param array - The array to be cleaned.\n* @returns The cleaned version of the array\n*/\nfunction cleanArray(array) {\n\tfor (let index = 0; index < array.length; index++) if (!objectHasOwnProperty(array, index)) array[index] = null;\n\treturn array;\n}\n/**\n* Shallow clone an object\n*\n* @param object - The object to be cloned.\n* @returns A new object that copies the original.\n*/\nfunction clone(object) {\n\tconst newObject = create(null);\n\tfor (const _ref2 of entries(object)) {\n\t\tvar _ref3 = _slicedToArray(_ref2, 2);\n\t\tconst property = _ref3[0];\n\t\tconst value = _ref3[1];\n\t\tif (objectHasOwnProperty(object, property)) {\n\t\t\tif (arrayIsArray(value)) newObject[property] = cleanArray(value);\n\t\t\telse if (value && typeof value === \"object\" && value.constructor === Object) newObject[property] = clone(value);\n\t\t\telse newObject[property] = value;\n\t\t}\n\t}\n\treturn newObject;\n}\n/**\n* Convert non-node values into strings without depending on direct property access.\n*\n* @param value - The value to stringify.\n* @returns A string representation of the provided value.\n*/\nfunction stringifyValue(value) {\n\tswitch (typeof value) {\n\t\tcase \"string\": return value;\n\t\tcase \"number\": return numberToString(value);\n\t\tcase \"boolean\": return booleanToString(value);\n\t\tcase \"bigint\": return bigintToString ? bigintToString(value) : \"0\";\n\t\tcase \"symbol\": return symbolToString ? symbolToString(value) : \"Symbol()\";\n\t\tcase \"undefined\": return objectToString(value);\n\t\tcase \"function\":\n\t\tcase \"object\": {\n\t\t\tif (value === null) return objectToString(value);\n\t\t\tconst valueAsRecord = value;\n\t\t\tconst valueToString = lookupGetter(valueAsRecord, \"toString\");\n\t\t\tif (typeof valueToString === \"function\") {\n\t\t\t\tconst stringified = valueToString(valueAsRecord);\n\t\t\t\treturn typeof stringified === \"string\" ? stringified : objectToString(stringified);\n\t\t\t}\n\t\t\treturn objectToString(value);\n\t\t}\n\t\tdefault: return objectToString(value);\n\t}\n}\n/**\n* This method automatically checks if the prop is function or getter and behaves accordingly.\n*\n* @param object - The object to look up the getter function in its prototype chain.\n* @param prop - The property name for which to find the getter function.\n* @returns The getter function found in the prototype chain or a fallback function.\n*/\nfunction lookupGetter(object, prop) {\n\twhile (object !== null) {\n\t\tconst desc = getOwnPropertyDescriptor(object, prop);\n\t\tif (desc) {\n\t\t\tif (desc.get) return unapply(desc.get);\n\t\t\tif (typeof desc.value === \"function\") return unapply(desc.value);\n\t\t}\n\t\tobject = getPrototypeOf(object);\n\t}\n\tfunction fallbackValue() {\n\t\treturn null;\n\t}\n\treturn fallbackValue;\n}\nfunction isRegex(value) {\n\ttry {\n\t\tregExpTest(value, \"\");\n\t\treturn true;\n\t} catch (_unused) {\n\t\treturn false;\n\t}\n}\nconst html$1 = freeze([\n\t\"a\",\n\t\"abbr\",\n\t\"acronym\",\n\t\"address\",\n\t\"area\",\n\t\"article\",\n\t\"aside\",\n\t\"audio\",\n\t\"b\",\n\t\"bdi\",\n\t\"bdo\",\n\t\"big\",\n\t\"blink\",\n\t\"blockquote\",\n\t\"body\",\n\t\"br\",\n\t\"button\",\n\t\"canvas\",\n\t\"caption\",\n\t\"center\",\n\t\"cite\",\n\t\"code\",\n\t\"col\",\n\t\"colgroup\",\n\t\"content\",\n\t\"data\",\n\t\"datalist\",\n\t\"dd\",\n\t\"decorator\",\n\t\"del\",\n\t\"details\",\n\t\"dfn\",\n\t\"dialog\",\n\t\"dir\",\n\t\"div\",\n\t\"dl\",\n\t\"dt\",\n\t\"element\",\n\t\"em\",\n\t\"fieldset\",\n\t\"figcaption\",\n\t\"figure\",\n\t\"font\",\n\t\"footer\",\n\t\"form\",\n\t\"h1\",\n\t\"h2\",\n\t\"h3\",\n\t\"h4\",\n\t\"h5\",\n\t\"h6\",\n\t\"head\",\n\t\"header\",\n\t\"hgroup\",\n\t\"hr\",\n\t\"html\",\n\t\"i\",\n\t\"img\",\n\t\"input\",\n\t\"ins\",\n\t\"kbd\",\n\t\"label\",\n\t\"legend\",\n\t\"li\",\n\t\"main\",\n\t\"map\",\n\t\"mark\",\n\t\"marquee\",\n\t\"menu\",\n\t\"menuitem\",\n\t\"meter\",\n\t\"nav\",\n\t\"nobr\",\n\t\"ol\",\n\t\"optgroup\",\n\t\"option\",\n\t\"output\",\n\t\"p\",\n\t\"picture\",\n\t\"pre\",\n\t\"progress\",\n\t\"q\",\n\t\"rp\",\n\t\"rt\",\n\t\"ruby\",\n\t\"s\",\n\t\"samp\",\n\t\"search\",\n\t\"section\",\n\t\"select\",\n\t\"shadow\",\n\t\"slot\",\n\t\"small\",\n\t\"source\",\n\t\"spacer\",\n\t\"span\",\n\t\"strike\",\n\t\"strong\",\n\t\"style\",\n\t\"sub\",\n\t\"summary\",\n\t\"sup\",\n\t\"table\",\n\t\"tbody\",\n\t\"td\",\n\t\"template\",\n\t\"textarea\",\n\t\"tfoot\",\n\t\"th\",\n\t\"thead\",\n\t\"time\",\n\t\"tr\",\n\t\"track\",\n\t\"tt\",\n\t\"u\",\n\t\"ul\",\n\t\"var\",\n\t\"video\",\n\t\"wbr\"\n]);\nconst svg$1 = freeze([\n\t\"svg\",\n\t\"a\",\n\t\"altglyph\",\n\t\"altglyphdef\",\n\t\"altglyphitem\",\n\t\"animatecolor\",\n\t\"animatemotion\",\n\t\"animatetransform\",\n\t\"circle\",\n\t\"clippath\",\n\t\"defs\",\n\t\"desc\",\n\t\"ellipse\",\n\t\"enterkeyhint\",\n\t\"exportparts\",\n\t\"filter\",\n\t\"font\",\n\t\"g\",\n\t\"glyph\",\n\t\"glyphref\",\n\t\"hkern\",\n\t\"image\",\n\t\"inputmode\",\n\t\"line\",\n\t\"lineargradient\",\n\t\"marker\",\n\t\"mask\",\n\t\"metadata\",\n\t\"mpath\",\n\t\"part\",\n\t\"path\",\n\t\"pattern\",\n\t\"polygon\",\n\t\"polyline\",\n\t\"radialgradient\",\n\t\"rect\",\n\t\"stop\",\n\t\"style\",\n\t\"switch\",\n\t\"symbol\",\n\t\"text\",\n\t\"textpath\",\n\t\"title\",\n\t\"tref\",\n\t\"tspan\",\n\t\"view\",\n\t\"vkern\"\n]);\nconst svgFilters = freeze([\n\t\"feBlend\",\n\t\"feColorMatrix\",\n\t\"feComponentTransfer\",\n\t\"feComposite\",\n\t\"feConvolveMatrix\",\n\t\"feDiffuseLighting\",\n\t\"feDisplacementMap\",\n\t\"feDistantLight\",\n\t\"feDropShadow\",\n\t\"feFlood\",\n\t\"feFuncA\",\n\t\"feFuncB\",\n\t\"feFuncG\",\n\t\"feFuncR\",\n\t\"feGaussianBlur\",\n\t\"feImage\",\n\t\"feMerge\",\n\t\"feMergeNode\",\n\t\"feMorphology\",\n\t\"feOffset\",\n\t\"fePointLight\",\n\t\"feSpecularLighting\",\n\t\"feSpotLight\",\n\t\"feTile\",\n\t\"feTurbulence\"\n]);\nconst svgDisallowed = freeze([\n\t\"animate\",\n\t\"color-profile\",\n\t\"cursor\",\n\t\"discard\",\n\t\"font-face\",\n\t\"font-face-format\",\n\t\"font-face-name\",\n\t\"font-face-src\",\n\t\"font-face-uri\",\n\t\"foreignobject\",\n\t\"hatch\",\n\t\"hatchpath\",\n\t\"mesh\",\n\t\"meshgradient\",\n\t\"meshpatch\",\n\t\"meshrow\",\n\t\"missing-glyph\",\n\t\"script\",\n\t\"set\",\n\t\"solidcolor\",\n\t\"unknown\",\n\t\"use\"\n]);\nconst mathMl$1 = freeze([\n\t\"math\",\n\t\"menclose\",\n\t\"merror\",\n\t\"mfenced\",\n\t\"mfrac\",\n\t\"mglyph\",\n\t\"mi\",\n\t\"mlabeledtr\",\n\t\"mmultiscripts\",\n\t\"mn\",\n\t\"mo\",\n\t\"mover\",\n\t\"mpadded\",\n\t\"mphantom\",\n\t\"mroot\",\n\t\"mrow\",\n\t\"ms\",\n\t\"mspace\",\n\t\"msqrt\",\n\t\"mstyle\",\n\t\"msub\",\n\t\"msup\",\n\t\"msubsup\",\n\t\"mtable\",\n\t\"mtd\",\n\t\"mtext\",\n\t\"mtr\",\n\t\"munder\",\n\t\"munderover\",\n\t\"mprescripts\"\n]);\nconst mathMlDisallowed = freeze([\n\t\"maction\",\n\t\"maligngroup\",\n\t\"malignmark\",\n\t\"mlongdiv\",\n\t\"mscarries\",\n\t\"mscarry\",\n\t\"msgroup\",\n\t\"mstack\",\n\t\"msline\",\n\t\"msrow\",\n\t\"semantics\",\n\t\"annotation\",\n\t\"annotation-xml\",\n\t\"mprescripts\",\n\t\"none\"\n]);\nconst text = freeze([\"#text\"]);\nconst html = freeze([\n\t\"accept\",\n\t\"action\",\n\t\"align\",\n\t\"alt\",\n\t\"autocapitalize\",\n\t\"autocomplete\",\n\t\"autopictureinpicture\",\n\t\"autoplay\",\n\t\"background\",\n\t\"bgcolor\",\n\t\"border\",\n\t\"capture\",\n\t\"cellpadding\",\n\t\"cellspacing\",\n\t\"checked\",\n\t\"cite\",\n\t\"class\",\n\t\"clear\",\n\t\"color\",\n\t\"cols\",\n\t\"colspan\",\n\t\"command\",\n\t\"commandfor\",\n\t\"controls\",\n\t\"controlslist\",\n\t\"coords\",\n\t\"crossorigin\",\n\t\"datetime\",\n\t\"decoding\",\n\t\"default\",\n\t\"dir\",\n\t\"disabled\",\n\t\"disablepictureinpicture\",\n\t\"disableremoteplayback\",\n\t\"download\",\n\t\"draggable\",\n\t\"enctype\",\n\t\"enterkeyhint\",\n\t\"exportparts\",\n\t\"face\",\n\t\"for\",\n\t\"headers\",\n\t\"height\",\n\t\"hidden\",\n\t\"high\",\n\t\"href\",\n\t\"hreflang\",\n\t\"id\",\n\t\"inert\",\n\t\"inputmode\",\n\t\"integrity\",\n\t\"ismap\",\n\t\"kind\",\n\t\"label\",\n\t\"lang\",\n\t\"list\",\n\t\"loading\",\n\t\"loop\",\n\t\"low\",\n\t\"max\",\n\t\"maxlength\",\n\t\"media\",\n\t\"method\",\n\t\"min\",\n\t\"minlength\",\n\t\"multiple\",\n\t\"muted\",\n\t\"name\",\n\t\"nonce\",\n\t\"noshade\",\n\t\"novalidate\",\n\t\"nowrap\",\n\t\"open\",\n\t\"optimum\",\n\t\"part\",\n\t\"pattern\",\n\t\"placeholder\",\n\t\"playsinline\",\n\t\"popover\",\n\t\"popovertarget\",\n\t\"popovertargetaction\",\n\t\"poster\",\n\t\"preload\",\n\t\"pubdate\",\n\t\"radiogroup\",\n\t\"readonly\",\n\t\"rel\",\n\t\"required\",\n\t\"rev\",\n\t\"reversed\",\n\t\"role\",\n\t\"rows\",\n\t\"rowspan\",\n\t\"spellcheck\",\n\t\"scope\",\n\t\"selected\",\n\t\"shape\",\n\t\"size\",\n\t\"sizes\",\n\t\"slot\",\n\t\"span\",\n\t\"srclang\",\n\t\"start\",\n\t\"src\",\n\t\"srcset\",\n\t\"step\",\n\t\"style\",\n\t\"summary\",\n\t\"tabindex\",\n\t\"title\",\n\t\"translate\",\n\t\"type\",\n\t\"usemap\",\n\t\"valign\",\n\t\"value\",\n\t\"width\",\n\t\"wrap\",\n\t\"xmlns\"\n]);\nconst svg = freeze([\n\t\"accent-height\",\n\t\"accumulate\",\n\t\"additive\",\n\t\"alignment-baseline\",\n\t\"amplitude\",\n\t\"ascent\",\n\t\"attributename\",\n\t\"attributetype\",\n\t\"azimuth\",\n\t\"basefrequency\",\n\t\"baseline-shift\",\n\t\"begin\",\n\t\"bias\",\n\t\"by\",\n\t\"class\",\n\t\"clip\",\n\t\"clippathunits\",\n\t\"clip-path\",\n\t\"clip-rule\",\n\t\"color\",\n\t\"color-interpolation\",\n\t\"color-interpolation-filters\",\n\t\"color-profile\",\n\t\"color-rendering\",\n\t\"cx\",\n\t\"cy\",\n\t\"d\",\n\t\"dx\",\n\t\"dy\",\n\t\"diffuseconstant\",\n\t\"direction\",\n\t\"display\",\n\t\"divisor\",\n\t\"dominant-baseline\",\n\t\"dur\",\n\t\"edgemode\",\n\t\"elevation\",\n\t\"end\",\n\t\"exponent\",\n\t\"fill\",\n\t\"fill-opacity\",\n\t\"fill-rule\",\n\t\"filter\",\n\t\"filterunits\",\n\t\"flood-color\",\n\t\"flood-opacity\",\n\t\"font-family\",\n\t\"font-size\",\n\t\"font-size-adjust\",\n\t\"font-stretch\",\n\t\"font-style\",\n\t\"font-variant\",\n\t\"font-weight\",\n\t\"fx\",\n\t\"fy\",\n\t\"g1\",\n\t\"g2\",\n\t\"glyph-name\",\n\t\"glyphref\",\n\t\"gradientunits\",\n\t\"gradienttransform\",\n\t\"height\",\n\t\"href\",\n\t\"id\",\n\t\"image-rendering\",\n\t\"in\",\n\t\"in2\",\n\t\"intercept\",\n\t\"k\",\n\t\"k1\",\n\t\"k2\",\n\t\"k3\",\n\t\"k4\",\n\t\"kerning\",\n\t\"keypoints\",\n\t\"keysplines\",\n\t\"keytimes\",\n\t\"lang\",\n\t\"lengthadjust\",\n\t\"letter-spacing\",\n\t\"kernelmatrix\",\n\t\"kernelunitlength\",\n\t\"lighting-color\",\n\t\"local\",\n\t\"marker-end\",\n\t\"marker-mid\",\n\t\"marker-start\",\n\t\"markerheight\",\n\t\"markerunits\",\n\t\"markerwidth\",\n\t\"maskcontentunits\",\n\t\"maskunits\",\n\t\"max\",\n\t\"mask\",\n\t\"mask-type\",\n\t\"media\",\n\t\"method\",\n\t\"mode\",\n\t\"min\",\n\t\"name\",\n\t\"numoctaves\",\n\t\"offset\",\n\t\"operator\",\n\t\"opacity\",\n\t\"order\",\n\t\"orient\",\n\t\"orientation\",\n\t\"origin\",\n\t\"overflow\",\n\t\"paint-order\",\n\t\"path\",\n\t\"pathlength\",\n\t\"patterncontentunits\",\n\t\"patterntransform\",\n\t\"patternunits\",\n\t\"pointer-events\",\n\t\"points\",\n\t\"preservealpha\",\n\t\"preserveaspectratio\",\n\t\"primitiveunits\",\n\t\"r\",\n\t\"rx\",\n\t\"ry\",\n\t\"radius\",\n\t\"refx\",\n\t\"refy\",\n\t\"repeatcount\",\n\t\"repeatdur\",\n\t\"restart\",\n\t\"result\",\n\t\"rotate\",\n\t\"scale\",\n\t\"seed\",\n\t\"shape-rendering\",\n\t\"slope\",\n\t\"specularconstant\",\n\t\"specularexponent\",\n\t\"spreadmethod\",\n\t\"startoffset\",\n\t\"stddeviation\",\n\t\"stitchtiles\",\n\t\"stop-color\",\n\t\"stop-opacity\",\n\t\"stroke-dasharray\",\n\t\"stroke-dashoffset\",\n\t\"stroke-linecap\",\n\t\"stroke-linejoin\",\n\t\"stroke-miterlimit\",\n\t\"stroke-opacity\",\n\t\"stroke\",\n\t\"stroke-width\",\n\t\"style\",\n\t\"surfacescale\",\n\t\"systemlanguage\",\n\t\"tabindex\",\n\t\"tablevalues\",\n\t\"targetx\",\n\t\"targety\",\n\t\"transform\",\n\t\"transform-origin\",\n\t\"text-anchor\",\n\t\"text-decoration\",\n\t\"text-orientation\",\n\t\"text-rendering\",\n\t\"textlength\",\n\t\"type\",\n\t\"u1\",\n\t\"u2\",\n\t\"unicode\",\n\t\"values\",\n\t\"vector-effect\",\n\t\"viewbox\",\n\t\"visibility\",\n\t\"version\",\n\t\"vert-adv-y\",\n\t\"vert-origin-x\",\n\t\"vert-origin-y\",\n\t\"width\",\n\t\"word-spacing\",\n\t\"wrap\",\n\t\"writing-mode\",\n\t\"xchannelselector\",\n\t\"ychannelselector\",\n\t\"x\",\n\t\"x1\",\n\t\"x2\",\n\t\"xmlns\",\n\t\"y\",\n\t\"y1\",\n\t\"y2\",\n\t\"z\",\n\t\"zoomandpan\"\n]);\nconst mathMl = freeze([\n\t\"accent\",\n\t\"accentunder\",\n\t\"align\",\n\t\"bevelled\",\n\t\"close\",\n\t\"columnalign\",\n\t\"columnlines\",\n\t\"columnspacing\",\n\t\"columnspan\",\n\t\"denomalign\",\n\t\"depth\",\n\t\"dir\",\n\t\"display\",\n\t\"displaystyle\",\n\t\"encoding\",\n\t\"fence\",\n\t\"frame\",\n\t\"height\",\n\t\"href\",\n\t\"id\",\n\t\"largeop\",\n\t\"length\",\n\t\"linethickness\",\n\t\"lquote\",\n\t\"lspace\",\n\t\"mathbackground\",\n\t\"mathcolor\",\n\t\"mathsize\",\n\t\"mathvariant\",\n\t\"maxsize\",\n\t\"minsize\",\n\t\"movablelimits\",\n\t\"notation\",\n\t\"numalign\",\n\t\"open\",\n\t\"rowalign\",\n\t\"rowlines\",\n\t\"rowspacing\",\n\t\"rowspan\",\n\t\"rspace\",\n\t\"rquote\",\n\t\"scriptlevel\",\n\t\"scriptminsize\",\n\t\"scriptsizemultiplier\",\n\t\"selection\",\n\t\"separator\",\n\t\"separators\",\n\t\"stretchy\",\n\t\"subscriptshift\",\n\t\"supscriptshift\",\n\t\"symmetric\",\n\t\"voffset\",\n\t\"width\",\n\t\"xmlns\"\n]);\nconst xml = freeze([\n\t\"xlink:href\",\n\t\"xml:id\",\n\t\"xlink:title\",\n\t\"xml:space\",\n\t\"xmlns:xlink\"\n]);\nconst MUSTACHE_EXPR = seal(/{{[\\w\\W]*|^[\\w\\W]*}}/g);\nconst ERB_EXPR = seal(/<%[\\w\\W]*|^[\\w\\W]*%>/g);\nconst TMPLIT_EXPR = seal(/\\${[\\w\\W]*/g);\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]+$/);\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/);\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g);\nconst DOCTYPE_NAME = seal(/^html$/i);\nconst CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\nconst ELEMENT_MARKUP_PROBE = seal(/<[/\\w!]/g);\nconst COMMENT_MARKUP_PROBE = seal(/<[/\\w]/g);\nconst FALLBACK_TAG_CLOSE = seal(/<\\/no(script|embed|frames)/i);\nconst SELF_CLOSING_TAG = seal(/\\/>/i);\nconst NODE_TYPE = {\n\telement: 1,\n\tattribute: 2,\n\ttext: 3,\n\tcdataSection: 4,\n\tentityReference: 5,\n\tentityNode: 6,\n\tprocessingInstruction: 7,\n\tcomment: 8,\n\tdocument: 9,\n\tdocumentType: 10,\n\tdocumentFragment: 11,\n\tnotation: 12\n};\nconst LITERAL_TEXT_ELEMENT_NAMES = [\n\t\"style\",\n\t\"script\",\n\t\"xmp\",\n\t\"iframe\",\n\t\"noembed\",\n\t\"noframes\",\n\t\"plaintext\",\n\t\"noscript\"\n];\nconst LITERAL_TEXT_ELEMENTS = freeze(addToSet({}, LITERAL_TEXT_ELEMENT_NAMES));\nconst LITERAL_TEXT_CLOSE = function() {\n\tconst map = {};\n\tarrayForEach(LITERAL_TEXT_ELEMENT_NAMES, (name) => {\n\t\tmap[name] = seal(new RegExp(\"</\" + name + \"(?=[\\\\t\\\\n\\\\f\\\\r />])\", \"i\"));\n\t});\n\treturn freeze(map);\n}();\nconst getGlobal = function getGlobal() {\n\treturn typeof window === \"undefined\" ? null : window;\n};\n/**\n* Creates a no-op policy for internal use only.\n* Don't export this function outside this module!\n* @param trustedTypes The policy factory.\n* @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n* @return The policy created (or null, if Trusted Types\n* are not supported or creating the policy failed).\n*/\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n\tif (typeof trustedTypes !== \"object\" || typeof trustedTypes.createPolicy !== \"function\") return null;\n\tlet suffix = null;\n\tconst ATTR_NAME = \"data-tt-policy-suffix\";\n\tif (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) suffix = purifyHostElement.getAttribute(ATTR_NAME);\n\tconst policyName = \"dompurify\" + (suffix ? \"#\" + suffix : \"\");\n\ttry {\n\t\treturn trustedTypes.createPolicy(policyName, {\n\t\t\tcreateHTML(html) {\n\t\t\t\treturn html;\n\t\t\t},\n\t\t\tcreateScriptURL(scriptUrl) {\n\t\t\t\treturn scriptUrl;\n\t\t\t}\n\t\t});\n\t} catch (_) {\n\t\tconsole.warn(\"TrustedTypes policy \" + policyName + \" could not be created.\");\n\t\treturn null;\n\t}\n};\nconst _createHooksMap = function _createHooksMap() {\n\treturn {\n\t\tafterSanitizeAttributes: [],\n\t\tafterSanitizeElements: [],\n\t\tafterSanitizeShadowDOM: [],\n\t\tbeforeSanitizeAttributes: [],\n\t\tbeforeSanitizeElements: [],\n\t\tbeforeSanitizeShadowDOM: [],\n\t\tuponSanitizeAttribute: [],\n\t\tuponSanitizeElement: [],\n\t\tuponSanitizeShadowNode: []\n\t};\n};\n/**\n* Resolve a set-valued configuration option: a fresh set built from\n* cfg[key] when it is an own array property (seeded with a clone of\n* options.base when given, case-normalized via options.transform),\n* the fallback set otherwise.\n*\n* @param cfg the cloned, prototype-free configuration object\n* @param key the configuration property to read\n* @param fallback the set to use when the option is absent or not an array\n* @param options transform and optional base set to merge into\n* @returns the resolved set\n*/\nconst _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {\n\treturn objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;\n};\n/**\n* Resolve an object-valued configuration option: a prototype-free clone\n* of cfg[key] when it is an own, truthy object property, else a fresh\n* fallback built by makeFallback (fresh on every parse, so a previous\n* parse can never leak state into the next one).\n*\n* @param cfg the cloned, prototype-free configuration object\n* @param key the configuration property to read\n* @param makeFallback builds the fallback value when the option is absent\n* @returns the resolved object\n*/\nconst _resolveObjectOption = function _resolveObjectOption(cfg, key, makeFallback) {\n\tconst value = objectHasOwnProperty(cfg, key) ? cfg[key] : void 0;\n\treturn value && typeof value === \"object\" ? clone(value) : makeFallback();\n};\nfunction createDOMPurify() {\n\tlet window = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();\n\tconst DOMPurify = (root) => createDOMPurify(root);\n\tDOMPurify.version = \"3.4.16\";\n\tDOMPurify.removed = [];\n\tif (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {\n\t\tDOMPurify.isSupported = false;\n\t\treturn DOMPurify;\n\t}\n\tlet document = window.document;\n\tconst originalDocument = document;\n\tconst currentScript = originalDocument.currentScript;\n\twindow.DocumentFragment;\n\tconst HTMLTemplateElement = window.HTMLTemplateElement, Node = window.Node, Element = window.Element, NodeFilter = window.NodeFilter;\n\twindow.NamedNodeMap === void 0 && (window.NamedNodeMap || window.MozNamedAttrMap);\n\twindow.HTMLFormElement;\n\tconst DOMParser = window.DOMParser, trustedTypes = window.trustedTypes;\n\tconst ElementPrototype = Element.prototype;\n\tconst cloneNode = lookupGetter(ElementPrototype, \"cloneNode\");\n\tconst remove = lookupGetter(ElementPrototype, \"remove\");\n\tconst removeAttributeNode = lookupGetter(ElementPrototype, \"removeAttributeNode\");\n\tconst getNextSibling = lookupGetter(ElementPrototype, \"nextSibling\");\n\tconst getChildNodes = lookupGetter(ElementPrototype, \"childNodes\");\n\tconst getParentNode = lookupGetter(ElementPrototype, \"parentNode\");\n\tconst getShadowRoot = lookupGetter(ElementPrototype, \"shadowRoot\");\n\tconst getAttributes = lookupGetter(ElementPrototype, \"attributes\");\n\tconst getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, \"nodeType\") : null;\n\tconst getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, \"nodeName\") : null;\n\tconst getOwnerDocument = Node && Node.prototype ? lookupGetter(Node.prototype, \"ownerDocument\") : null;\n\tconst _readNodeType = function _readNodeType(node) {\n\t\treturn getNodeType ? getNodeType(node) : node.nodeType;\n\t};\n\tconst _readNodeName = function _readNodeName(node) {\n\t\treturn getNodeName ? getNodeName(node) : node.nodeName;\n\t};\n\tif (typeof HTMLTemplateElement === \"function\") {\n\t\tconst template = document.createElement(\"template\");\n\t\tif (template.content && template.content.ownerDocument) document = template.content.ownerDocument;\n\t}\n\tlet trustedTypesPolicy;\n\tlet emptyHTML = \"\";\n\tlet defaultTrustedTypesPolicy;\n\tlet defaultTrustedTypesPolicyResolved = false;\n\tlet IN_TRUSTED_TYPES_POLICY = 0;\n\tconst _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {\n\t\tif (IN_TRUSTED_TYPES_POLICY > 0) throw typeErrorCreate(\"A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \\\"DOMPurify and Trusted Types\\\" section of the README.\");\n\t};\n\tconst _createTrustedHTML = function _createTrustedHTML(html) {\n\t\t_assertNotInTrustedTypesPolicy();\n\t\tIN_TRUSTED_TYPES_POLICY++;\n\t\ttry {\n\t\t\treturn trustedTypesPolicy.createHTML(html);\n\t\t} finally {\n\t\t\tIN_TRUSTED_TYPES_POLICY--;\n\t\t}\n\t};\n\tconst _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {\n\t\t_assertNotInTrustedTypesPolicy();\n\t\tIN_TRUSTED_TYPES_POLICY++;\n\t\ttry {\n\t\t\treturn trustedTypesPolicy.createScriptURL(scriptUrl);\n\t\t} finally {\n\t\t\tIN_TRUSTED_TYPES_POLICY--;\n\t\t}\n\t};\n\tconst _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {\n\t\tif (!defaultTrustedTypesPolicyResolved) {\n\t\t\tdefaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n\t\t\tdefaultTrustedTypesPolicyResolved = true;\n\t\t}\n\t\treturn defaultTrustedTypesPolicy;\n\t};\n\tconst _document = document, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName;\n\tconst importNode = originalDocument.importNode;\n\tlet hooks = _createHooksMap();\n\t/**\n\t* Expose whether this browser supports running the full DOMPurify.\n\t*/\n\tDOMPurify.isSupported = typeof entries === \"function\" && typeof getParentNode === \"function\" && implementation && implementation.createHTMLDocument !== void 0;\n\tconst MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE, CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;\n\tlet IS_ALLOWED_URI$1 = IS_ALLOWED_URI;\n\t/**\n\t* We consider the elements and attributes below to be safe. Ideally\n\t* don't add any new ones but feel free to remove unwanted ones.\n\t*/\n\tlet ALLOWED_TAGS = null;\n\tconst DEFAULT_ALLOWED_TAGS = addToSet({}, [\n\t\t...html$1,\n\t\t...svg$1,\n\t\t...svgFilters,\n\t\t...mathMl$1,\n\t\t...text\n\t]);\n\tlet ALLOWED_ATTR = null;\n\tconst DEFAULT_ALLOWED_ATTR = addToSet({}, [\n\t\t...html,\n\t\t...svg,\n\t\t...mathMl,\n\t\t...xml\n\t]);\n\tlet CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n\t\ttagNameCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tattributeNameCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tallowCustomizedBuiltInElements: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: false\n\t\t}\n\t}));\n\tlet FORBID_TAGS = null;\n\tlet FORBID_ATTR = null;\n\tconst EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {\n\t\ttagCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tattributeCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t}\n\t}));\n\tlet ALLOW_ARIA_ATTR = true;\n\tlet ALLOW_DATA_ATTR = true;\n\tlet ALLOW_UNKNOWN_PROTOCOLS = false;\n\tlet ALLOW_SELF_CLOSE_IN_ATTR = true;\n\tlet SAFE_FOR_TEMPLATES = false;\n\tlet SAFE_FOR_XML = true;\n\tlet WHOLE_DOCUMENT = false;\n\tlet SET_CONFIG = false;\n\tlet SET_CONFIG_ALLOWED_TAGS = null;\n\tlet SET_CONFIG_ALLOWED_ATTR = null;\n\tlet FORCE_BODY = false;\n\tlet RETURN_DOM = false;\n\tlet RETURN_DOM_FRAGMENT = false;\n\tlet RETURN_TRUSTED_TYPE = false;\n\tlet SANITIZE_DOM = true;\n\tlet SANITIZE_NAMED_PROPS = false;\n\tconst SANITIZE_NAMED_PROPS_PREFIX = \"user-content-\";\n\tlet KEEP_CONTENT = true;\n\tlet IN_PLACE = false;\n\tlet USE_PROFILES = {};\n\tlet FORBID_CONTENTS = null;\n\tconst DEFAULT_FORBID_CONTENTS = addToSet({}, [\n\t\t\"annotation-xml\",\n\t\t\"audio\",\n\t\t\"colgroup\",\n\t\t\"desc\",\n\t\t\"foreignobject\",\n\t\t\"head\",\n\t\t\"iframe\",\n\t\t\"math\",\n\t\t\"mi\",\n\t\t\"mn\",\n\t\t\"mo\",\n\t\t\"ms\",\n\t\t\"mtext\",\n\t\t\"noembed\",\n\t\t\"noframes\",\n\t\t\"noscript\",\n\t\t\"plaintext\",\n\t\t\"script\",\n\t\t\"selectedcontent\",\n\t\t\"style\",\n\t\t\"svg\",\n\t\t\"template\",\n\t\t\"thead\",\n\t\t\"title\",\n\t\t\"video\",\n\t\t\"xmp\"\n\t]);\n\tlet DATA_URI_TAGS = null;\n\tconst DEFAULT_DATA_URI_TAGS = addToSet({}, [\n\t\t\"audio\",\n\t\t\"video\",\n\t\t\"img\",\n\t\t\"source\",\n\t\t\"image\",\n\t\t\"track\"\n\t]);\n\tlet URI_SAFE_ATTRIBUTES = null;\n\tconst DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [\n\t\t\"alt\",\n\t\t\"class\",\n\t\t\"for\",\n\t\t\"id\",\n\t\t\"label\",\n\t\t\"name\",\n\t\t\"pattern\",\n\t\t\"placeholder\",\n\t\t\"role\",\n\t\t\"summary\",\n\t\t\"title\",\n\t\t\"value\",\n\t\t\"style\",\n\t\t\"xmlns\"\n\t]);\n\tconst MATHML_NAMESPACE = \"http://www.w3.org/1998/Math/MathML\";\n\tconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\n\tconst HTML_NAMESPACE = \"http://www.w3.org/1999/xhtml\";\n\tlet NAMESPACE = HTML_NAMESPACE;\n\tlet IS_EMPTY_INPUT = false;\n\tlet ALLOWED_NAMESPACES = null;\n\tconst DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [\n\t\tMATHML_NAMESPACE,\n\t\tSVG_NAMESPACE,\n\t\tHTML_NAMESPACE\n\t], stringToString);\n\tconst DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze([\n\t\t\"mi\",\n\t\t\"mo\",\n\t\t\"mn\",\n\t\t\"ms\",\n\t\t\"mtext\"\n\t]);\n\tlet MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);\n\tconst DEFAULT_HTML_INTEGRATION_POINTS = freeze([\"annotation-xml\"]);\n\tlet HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);\n\tconst COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [\n\t\t\"title\",\n\t\t\"style\",\n\t\t\"font\",\n\t\t\"a\",\n\t\t\"script\"\n\t]);\n\tlet PARSER_MEDIA_TYPE = null;\n\tconst SUPPORTED_PARSER_MEDIA_TYPES = [\"application/xhtml+xml\", \"text/html\"];\n\tconst DEFAULT_PARSER_MEDIA_TYPE = \"text/html\";\n\tlet transformCaseFunc = null;\n\tlet CONFIG = null;\n\tconst formElement = document.createElement(\"form\");\n\tconst isRegexOrFunction = function isRegexOrFunction(testValue) {\n\t\treturn testValue instanceof RegExp || testValue instanceof Function;\n\t};\n\t/**\n\t* _parseConfig\n\t*\n\t* @param cfg optional config literal\n\t*/\n\tconst _parseConfig = function _parseConfig() {\n\t\tlet cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n\t\tif (CONFIG && CONFIG === cfg) return;\n\t\tif (!cfg || typeof cfg !== \"object\") cfg = {};\n\t\tcfg = clone(cfg);\n\t\tPARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\t\ttransformCaseFunc = PARSER_MEDIA_TYPE === \"application/xhtml+xml\" ? stringToString : stringToLowerCase;\n\t\tALLOWED_TAGS = _resolveSetOption(cfg, \"ALLOWED_TAGS\", DEFAULT_ALLOWED_TAGS, { transform: transformCaseFunc });\n\t\tALLOWED_ATTR = _resolveSetOption(cfg, \"ALLOWED_ATTR\", DEFAULT_ALLOWED_ATTR, { transform: transformCaseFunc });\n\t\tALLOWED_NAMESPACES = _resolveSetOption(cfg, \"ALLOWED_NAMESPACES\", DEFAULT_ALLOWED_NAMESPACES, { transform: stringToString });\n\t\tURI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, \"ADD_URI_SAFE_ATTR\", DEFAULT_URI_SAFE_ATTRIBUTES, {\n\t\t\ttransform: transformCaseFunc,\n\t\t\tbase: DEFAULT_URI_SAFE_ATTRIBUTES\n\t\t});\n\t\tDATA_URI_TAGS = _resolveSetOption(cfg, \"ADD_DATA_URI_TAGS\", DEFAULT_DATA_URI_TAGS, {\n\t\t\ttransform: transformCaseFunc,\n\t\t\tbase: DEFAULT_DATA_URI_TAGS\n\t\t});\n\t\tFORBID_CONTENTS = _resolveSetOption(cfg, \"FORBID_CONTENTS\", DEFAULT_FORBID_CONTENTS, { transform: transformCaseFunc });\n\t\tFORBID_TAGS = _resolveSetOption(cfg, \"FORBID_TAGS\", clone({}), { transform: transformCaseFunc });\n\t\tFORBID_ATTR = _resolveSetOption(cfg, \"FORBID_ATTR\", clone({}), { transform: transformCaseFunc });\n\t\tUSE_PROFILES = objectHasOwnProperty(cfg, \"USE_PROFILES\") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === \"object\" ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;\n\t\tALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;\n\t\tALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;\n\t\tALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;\n\t\tALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;\n\t\tSAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;\n\t\tSAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;\n\t\tWHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;\n\t\tRETURN_DOM = cfg.RETURN_DOM || false;\n\t\tRETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;\n\t\tRETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;\n\t\tFORCE_BODY = cfg.FORCE_BODY || false;\n\t\tSANITIZE_DOM = cfg.SANITIZE_DOM !== false;\n\t\tSANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;\n\t\tKEEP_CONTENT = cfg.KEEP_CONTENT !== false;\n\t\tIN_PLACE = cfg.IN_PLACE || false;\n\t\tIS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI;\n\t\tNAMESPACE = typeof cfg.NAMESPACE === \"string\" ? cfg.NAMESPACE : HTML_NAMESPACE;\n\t\tMATHML_TEXT_INTEGRATION_POINTS = _resolveObjectOption(cfg, \"MATHML_TEXT_INTEGRATION_POINTS\", () => addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS));\n\t\tHTML_INTEGRATION_POINTS = _resolveObjectOption(cfg, \"HTML_INTEGRATION_POINTS\", () => addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS));\n\t\tconst customElementHandling = _resolveObjectOption(cfg, \"CUSTOM_ELEMENT_HANDLING\", () => create(null));\n\t\tCUSTOM_ELEMENT_HANDLING = create(null);\n\t\tif (objectHasOwnProperty(customElementHandling, \"tagNameCheck\") && isRegexOrFunction(customElementHandling.tagNameCheck)) CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck;\n\t\tif (objectHasOwnProperty(customElementHandling, \"attributeNameCheck\") && isRegexOrFunction(customElementHandling.attributeNameCheck)) CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck;\n\t\tif (objectHasOwnProperty(customElementHandling, \"allowCustomizedBuiltInElements\") && typeof customElementHandling.allowCustomizedBuiltInElements === \"boolean\") CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements;\n\t\tseal(CUSTOM_ELEMENT_HANDLING);\n\t\tif (SAFE_FOR_TEMPLATES) ALLOW_DATA_ATTR = false;\n\t\tif (RETURN_DOM_FRAGMENT) RETURN_DOM = true;\n\t\tif (USE_PROFILES) {\n\t\t\tALLOWED_TAGS = addToSet({}, text);\n\t\t\tALLOWED_ATTR = create(null);\n\t\t\tif (USE_PROFILES.html === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, html$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, html);\n\t\t\t}\n\t\t\tif (USE_PROFILES.svg === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, svg$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, svg);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\t\t\tif (USE_PROFILES.svgFilters === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, svgFilters);\n\t\t\t\taddToSet(ALLOWED_ATTR, svg);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\t\t\tif (USE_PROFILES.mathMl === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, mathMl$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, mathMl);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\t\t}\n\t\tEXTRA_ELEMENT_HANDLING.tagCheck = null;\n\t\tEXTRA_ELEMENT_HANDLING.attributeCheck = null;\n\t\tif (objectHasOwnProperty(cfg, \"ADD_TAGS\")) {\n\t\t\tif (typeof cfg.ADD_TAGS === \"function\") EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;\n\t\t\telse if (arrayIsArray(cfg.ADD_TAGS)) {\n\t\t\t\tif (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) ALLOWED_TAGS = clone(ALLOWED_TAGS);\n\t\t\t\taddToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n\t\t\t}\n\t\t}\n\t\tif (objectHasOwnProperty(cfg, \"ADD_ATTR\")) {\n\t\t\tif (typeof cfg.ADD_ATTR === \"function\") EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;\n\t\t\telse if (arrayIsArray(cfg.ADD_ATTR)) {\n\t\t\t\tif (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) ALLOWED_ATTR = clone(ALLOWED_ATTR);\n\t\t\t\taddToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n\t\t\t}\n\t\t}\n\t\tif (objectHasOwnProperty(cfg, \"ADD_FORBID_CONTENTS\") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {\n\t\t\tif (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);\n\t\t\taddToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);\n\t\t}\n\t\tif (KEEP_CONTENT) ALLOWED_TAGS[\"#text\"] = true;\n\t\tif (WHOLE_DOCUMENT) addToSet(ALLOWED_TAGS, [\n\t\t\t\"html\",\n\t\t\t\"head\",\n\t\t\t\"body\"\n\t\t]);\n\t\tif (ALLOWED_TAGS.table) {\n\t\t\taddToSet(ALLOWED_TAGS, [\"tbody\"]);\n\t\t\tdelete FORBID_TAGS.tbody;\n\t\t}\n\t\tif (cfg.TRUSTED_TYPES_POLICY) {\n\t\t\tif (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== \"function\") throw typeErrorCreate(\"TRUSTED_TYPES_POLICY configuration option must provide a \\\"createHTML\\\" hook.\");\n\t\t\tif (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== \"function\") throw typeErrorCreate(\"TRUSTED_TYPES_POLICY configuration option must provide a \\\"createScriptURL\\\" hook.\");\n\t\t\tconst previousTrustedTypesPolicy = trustedTypesPolicy;\n\t\t\ttrustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\t\t\ttry {\n\t\t\t\temptyHTML = _createTrustedHTML(\"\");\n\t\t\t} catch (error) {\n\t\t\t\ttrustedTypesPolicy = previousTrustedTypesPolicy;\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t} else if (cfg.TRUSTED_TYPES_POLICY === null) {\n\t\t\ttrustedTypesPolicy = void 0;\n\t\t\temptyHTML = \"\";\n\t\t} else {\n\t\t\tif (trustedTypesPolicy === void 0) trustedTypesPolicy = _getDefaultTrustedTypesPolicy();\n\t\t\tif (trustedTypesPolicy && typeof emptyHTML === \"string\") emptyHTML = _createTrustedHTML(\"\");\n\t\t}\n\t\tif (freeze) freeze(cfg);\n\t\tCONFIG = cfg;\n\t};\n\tconst ALL_SVG_TAGS = addToSet({}, [\n\t\t...svg$1,\n\t\t...svgFilters,\n\t\t...svgDisallowed\n\t]);\n\tconst ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\t/**\n\t* Namespace rules for an element in the SVG namespace.\n\t*\n\t* @param tagName the element's lowercase tag name\n\t* @param parent the (possibly simulated) parent node\n\t* @param parentTagName the parent's lowercase tag name\n\t* @returns true if a spec-compliant parser could produce this element\n\t*/\n\tconst _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {\n\t\tif (parent.namespaceURI === HTML_NAMESPACE) return tagName === \"svg\";\n\t\tif (parent.namespaceURI === MATHML_NAMESPACE) return tagName === \"svg\" && (parentTagName === \"annotation-xml\" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n\t\treturn Boolean(ALL_SVG_TAGS[tagName]);\n\t};\n\t/**\n\t* Namespace rules for an element in the MathML namespace.\n\t*\n\t* @param tagName the element's lowercase tag name\n\t* @param parent the (possibly simulated) parent node\n\t* @param parentTagName the parent's lowercase tag name\n\t* @returns true if a spec-compliant parser could produce this element\n\t*/\n\tconst _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {\n\t\tif (parent.namespaceURI === HTML_NAMESPACE) return tagName === \"math\";\n\t\tif (parent.namespaceURI === SVG_NAMESPACE) return tagName === \"math\" && HTML_INTEGRATION_POINTS[parentTagName];\n\t\treturn Boolean(ALL_MATHML_TAGS[tagName]);\n\t};\n\t/**\n\t* Namespace rules for an element in the HTML namespace.\n\t*\n\t* @param tagName the element's lowercase tag name\n\t* @param parent the (possibly simulated) parent node\n\t* @param parentTagName the parent's lowercase tag name\n\t* @returns true if a spec-compliant parser could produce this element\n\t*/\n\tconst _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {\n\t\tif (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) return false;\n\t\tif (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) return false;\n\t\treturn !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n\t};\n\t/**\n\t* @param element a DOM element whose namespace is being checked\n\t* @returns Return false if the element has a\n\t* namespace that a spec-compliant parser would never\n\t* return. Return true otherwise.\n\t*/\n\tconst _checkValidNamespace = function _checkValidNamespace(element) {\n\t\tlet parent = getParentNode(element);\n\t\tif (!parent || !parent.tagName) parent = {\n\t\t\tnamespaceURI: NAMESPACE,\n\t\t\ttagName: \"template\"\n\t\t};\n\t\tconst tagName = stringToLowerCase(element.tagName);\n\t\tconst parentTagName = stringToLowerCase(parent.tagName);\n\t\tif (!ALLOWED_NAMESPACES[element.namespaceURI]) return false;\n\t\tif (element.namespaceURI === SVG_NAMESPACE) return _checkSvgNamespace(tagName, parent, parentTagName);\n\t\tif (element.namespaceURI === MATHML_NAMESPACE) return _checkMathMlNamespace(tagName, parent, parentTagName);\n\t\tif (element.namespaceURI === HTML_NAMESPACE) return _checkHtmlNamespace(tagName, parent, parentTagName);\n\t\tif (PARSER_MEDIA_TYPE === \"application/xhtml+xml\" && ALLOWED_NAMESPACES[element.namespaceURI]) return true;\n\t\treturn false;\n\t};\n\t/**\n\t* _forceRemove\n\t*\n\t* @param node a DOM node\n\t*/\n\tconst _forceRemove = function _forceRemove(node) {\n\t\tarrayPush(DOMPurify.removed, { element: node });\n\t\ttry {\n\t\t\tgetParentNode(node).removeChild(node);\n\t\t} catch (_) {\n\t\t\tremove(node);\n\t\t\tif (!getParentNode(node)) throw typeErrorCreate(\"a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place\");\n\t\t}\n\t};\n\t/**\n\t* _stripAttributeNode\n\t*\n\t* Remove a single Attr node case/namespace-exactly on an attribute-teardown\n\t* path. Name-based removeAttribute() ASCII-lowercases its lookup key for an\n\t* HTML element in an HTML document and so silently misses a case-preserved\n\t* handler (e.g. `ONERROR` off an XML/XHTML import) - the same defect\n\t* _removeAttribute() was fixed for, which a name-based call would reintroduce\n\t* on these IN_PLACE teardown paths. Unlike _removeAttribute this does not\n\t* record into DOMPurify.removed: the neutralize passes intentionally do not\n\t* book-keep. A clobbered/detached node falls back to best-effort name-based\n\t* removal.\n\t*\n\t* @param element the element to strip the attribute from\n\t* @param attribute the Attr node to remove\n\t* @param name the attribute's name, for the fallback path\n\t*/\n\tconst _stripAttributeNode = function _stripAttributeNode(element, attribute, name) {\n\t\ttry {\n\t\t\tremoveAttributeNode(element, attribute);\n\t\t} catch (_) {\n\t\t\ttry {\n\t\t\t\telement.removeAttribute(name);\n\t\t\t} catch (_) {}\n\t\t}\n\t};\n\t/**\n\t* _neutralizeRoot\n\t*\n\t* Fail-closed teardown of an in-place root after the sanitize walk aborts\n\t* (campaign-3 F2). An internal throw mid-walk — e.g. a page-registered\n\t* custom element's reaction detaches a node so `_forceRemove`'s deliberate\n\t* parentless guard throws, or any other re-entrant engine mutation — would\n\t* otherwise leave the caller's *live* tree half-sanitized, with everything\n\t* after the abort point still carrying its handlers. There is no safe way\n\t* to resume the walk (the tree mutated under us), so we strip the root bare:\n\t* remove every child and every attribute, then let the caller's catch see\n\t* the original error. Clobber-safe (cached `remove`/`childNodes`/`attributes`\n\t* getters; the root was already clobber-pre-flighted at the IN_PLACE entry).\n\t*\n\t* @param root the in-place root to empty\n\t*/\n\tconst _neutralizeRoot = function _neutralizeRoot(root) {\n\t\t_neutralizeSubtree(root);\n\t\tconst childNodes = getChildNodes(root);\n\t\tif (childNodes) {\n\t\t\tconst snapshot = [];\n\t\t\tarrayForEach(childNodes, (child) => {\n\t\t\t\tarrayPush(snapshot, child);\n\t\t\t});\n\t\t\tarrayForEach(snapshot, (child) => {\n\t\t\t\ttry {\n\t\t\t\t\tremove(child);\n\t\t\t\t} catch (_) {}\n\t\t\t});\n\t\t}\n\t\tconst attributes = getAttributes(root);\n\t\tif (attributes) for (let i = attributes.length - 1; i >= 0; --i) {\n\t\t\tconst attribute = attributes[i];\n\t\t\tconst name = attribute && attribute.name;\n\t\t\tif (typeof name === \"string\") _stripAttributeNode(root, attribute, name);\n\t\t}\n\t};\n\t/**\n\t* _removeAttribute\n\t*\n\t* Name-based getAttributeNode()/removeAttribute() ASCII-lowercase their\n\t* lookup key for HTML elements in an HTML document, so they silently miss an\n\t* attribute whose stored qualified name still contains uppercase ASCII\n\t* letters. That happens when the node came from a case-preserving source\n\t* (an XML/XHTML document imported via importNode(), or createAttributeNS()),\n\t* where e.g. `ONERROR` survives the walk: the policy check lowercases to\n\t* `onerror` and rejects it, but `removeAttribute('ONERROR')` looks up\n\t* `onerror` and finds nothing. Remove the exact Attr node instead, which is\n\t* case- and namespace-exact, and fall back to name-based removal only when\n\t* the caller could not supply the node.\n\t*\n\t* @param name an Attribute name\n\t* @param element a DOM node\n\t* @param attr the exact Attr node to remove, when the caller has it\n\t*/\n\tconst _removeAttribute = function _removeAttribute(name, element, attr) {\n\t\tif (!attr) try {\n\t\t\tattr = element.getAttributeNode(name);\n\t\t} catch (_) {\n\t\t\tattr = null;\n\t\t}\n\t\tarrayPush(DOMPurify.removed, {\n\t\t\tattribute: attr || null,\n\t\t\tfrom: element\n\t\t});\n\t\ttry {\n\t\t\tif (attr) removeAttributeNode(element, attr);\n\t\t\telse element.removeAttribute(name);\n\t\t} catch (_) {\n\t\t\ttry {\n\t\t\t\telement.removeAttribute(name);\n\t\t\t} catch (_) {}\n\t\t}\n\t\tif (name === \"is\") {\n\t\t\tif (RETURN_DOM || RETURN_DOM_FRAGMENT) try {\n\t\t\t\t_forceRemove(element);\n\t\t\t} catch (_) {}\n\t\t\telse try {\n\t\t\t\telement.setAttribute(name, \"\");\n\t\t\t} catch (_) {}\n\t\t}\n\t};\n\t/**\n\t* _stripDisallowedAttributes\n\t*\n\t* Removes every attribute the active configuration does not allow from a\n\t* single element, using the same allowlist as the main attribute pass (so\n\t* `on*` handlers go, but no `/^on/` blocklist is introduced). Used only to\n\t* neutralise nodes that are being discarded from an in-place tree.\n\t*\n\t* @param element the element to strip\n\t*/\n\tconst _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {\n\t\tconst attributes = getAttributes(element);\n\t\tif (!attributes) return;\n\t\tfor (let i = attributes.length - 1; i >= 0; --i) {\n\t\t\tconst attribute = attributes[i];\n\t\t\tconst name = attribute && attribute.name;\n\t\t\tif (typeof name !== \"string\" || ALLOWED_ATTR[transformCaseFunc(name)]) continue;\n\t\t\t_stripAttributeNode(element, attribute, name);\n\t\t}\n\t};\n\t/**\n\t* _neutralizeSubtree\n\t*\n\t* Completes the audit-5 F1 fix across every removal path. The KEEP_CONTENT\n\t* move-hoist neutralises only disallowed-tag removals; clobber, mXSS-canary,\n\t* namespace, comment, processing-instruction and KEEP_CONTENT:false removals\n\t* all drop their subtree wholesale via `_forceRemove`. On the IN_PLACE path\n\t* those dropped nodes are detached from the caller's LIVE tree but a\n\t* handler-bearing original among them (an `<img onerror>`/`<video>` that was\n\t* loading) keeps its queued resource event, which fires in page scope after\n\t* sanitize returns. This walks a removed subtree and strips every attribute\n\t* the active configuration does not allow — so `on*` handlers are cancelled\n\t* through the SAME allowlist that governs kept nodes, not a separate `/^on/`\n\t* blocklist. Run synchronously before sanitize returns, i.e. before any\n\t* queued event can fire. Hook-free by design: these nodes leave the output,\n\t* so firing attribute hooks for them would be surprising. Clobber-safe reads;\n\t* a doomed clobbered node may shadow `removeAttribute` (its own attributes are\n\t* irrelevant — it is discarded — while its non-clobbered descendants, e.g.\n\t* the `<img>`, are reached and scrubbed).\n\t*\n\t* @param root the root of a removed subtree to neutralise\n\t*/\n\tconst _neutralizeSubtree = function _neutralizeSubtree(root) {\n\t\tconst stack = [root];\n\t\twhile (stack.length > 0) {\n\t\t\tconst node = stack.pop();\n\t\t\tif (_readNodeType(node) === NODE_TYPE.element) _stripDisallowedAttributes(node);\n\t\t\tconst childNodes = getChildNodes(node);\n\t\t\tif (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push(childNodes[i]);\n\t\t}\n\t};\n\t/**\n\t* _neutralizePatchLinkage\n\t*\n\t* IN_PLACE entry pre-pass (declarative-partial-updates / streaming\n\t* hardening, https://github.com/WICG/declarative-partial-updates).\n\t*\n\t* The main walk strips patch linkage (`for`/`patchsrc`) and removes range\n\t* markers (PIs / markup comments) node-by-node, in document order, AS it\n\t* reaches each node. On a live in-place root that leaves a window: from the\n\t* moment the root is connected until the walk arrives at a given node, that\n\t* node's linkage is live. A patch applied on connection/stream can fire as\n\t* a microtask during the walk and inject or teleport an unsanitized DOM\n\t* range into a region the iterator has already passed and will not revisit,\n\t* so the post-return \"tree is sanitized\" contract is violated. Sweep the\n\t* whole tree once up front and sever every linkage before the walk begins,\n\t* closing that window.\n\t*\n\t* This CANNOT undo a patch that already fired before sanitize ran — that is\n\t* the irreducible \"do not IN_PLACE a live-connected attacker tree\" caveat —\n\t* but it closes everything from sanitize-start onward. Gated on SAFE_FOR_XML\n\t* to group with the rest of the declarative-partial-updates handling and\n\t* stay overridable, consistent with the codebase.\n\t*\n\t* Clobber-safe traversal (cached childNodes getter); per-node try/catch so a\n\t* clobbered root cannot defeat the sweep of its non-clobbered descendants.\n\t*\n\t* NOTE (pending real-Chrome confirmation, see test/declarative-patch-probe\n\t* .html Q1): this mirrors the existing policy of keeping `for` on\n\t* <label>/<output>. If the shipping feature can drive a patch through a\n\t* surviving `for`-on-label/output + `id` pair, this pre-pass and the\n\t* attribute check at _isBasicCustomElement's caller must additionally drop\n\t* that pair on the IN_PLACE path. Left as-is until the taxonomy is verified.\n\t*\n\t* @param root the in-place root to sweep\n\t*/\n\t/**\n\t* Central policy for declarative-partial-updates patch-linkage attributes,\n\t* shared by the _neutralizePatchLinkage pre-pass and _isValidAttribute so\n\t* the two sites cannot drift: `patchsrc` always links, `for` links\n\t* everywhere except on <label>/<output>, and the whole policy is gated on\n\t* SAFE_FOR_XML (see the rationale block in _isValidAttribute).\n\t*\n\t* @param lcName the transformCaseFunc'd attribute name\n\t* @param lcTag the transformCaseFunc'd tag name of the carrying element\n\t* @return true if the attribute is patch linkage and must be dropped\n\t*/\n\tconst _isPatchLinkageAttribute = function _isPatchLinkageAttribute(lcName, lcTag) {\n\t\tif (!SAFE_FOR_XML) return false;\n\t\tif (lcName === \"patchsrc\") return true;\n\t\treturn lcName === \"for\" && lcTag !== \"label\" && lcTag !== \"output\";\n\t};\n\tconst _neutralizePatchLinkage = function _neutralizePatchLinkage(root) {\n\t\tif (!SAFE_FOR_XML) return;\n\t\tconst stack = [root];\n\t\twhile (stack.length > 0) {\n\t\t\tconst node = stack.pop();\n\t\t\tconst nodeType = _readNodeType(node);\n\t\t\tif (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {\n\t\t\t\ttry {\n\t\t\t\t\tremove(node);\n\t\t\t\t} catch (_) {}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (nodeType === NODE_TYPE.element) {\n\t\t\t\tconst element = node;\n\t\t\t\tconst lcTag = transformCaseFunc(_readNodeName(node));\n\t\t\t\ttry {\n\t\t\t\t\tif (element.hasAttribute && element.hasAttribute(\"patchsrc\")) element.removeAttribute(\"patchsrc\");\n\t\t\t\t\tif (element.hasAttribute && element.hasAttribute(\"for\") && _isPatchLinkageAttribute(\"for\", lcTag)) element.removeAttribute(\"for\");\n\t\t\t\t} catch (_) {}\n\t\t\t}\n\t\t\tconst childNodes = getChildNodes(node);\n\t\t\tif (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push(childNodes[i]);\n\t\t}\n\t};\n\t/**\n\t* _initDocument\n\t*\n\t* @param dirty - a string of dirty markup\n\t* @return a DOM, filled with the dirty markup\n\t*/\n\tconst _initDocument = function _initDocument(dirty) {\n\t\tlet doc = null;\n\t\tlet leadingWhitespace = null;\n\t\tif (FORCE_BODY) dirty = \"<remove></remove>\" + dirty;\n\t\telse {\n\t\t\tconst matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n\t\t\tleadingWhitespace = matches && matches[0];\n\t\t}\n\t\tif (PARSER_MEDIA_TYPE === \"application/xhtml+xml\" && NAMESPACE === HTML_NAMESPACE) dirty = \"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\"><head></head><body>\" + dirty + \"</body></html>\";\n\t\tconst dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;\n\t\tif (NAMESPACE === HTML_NAMESPACE) try {\n\t\t\tdoc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n\t\t} catch (_) {}\n\t\tif (!doc || !doc.documentElement) {\n\t\t\tdoc = implementation.createDocument(NAMESPACE, \"template\", null);\n\t\t\ttry {\n\t\t\t\tdoc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n\t\t\t} catch (_) {}\n\t\t}\n\t\tconst body = doc.body || doc.documentElement;\n\t\tif (dirty && leadingWhitespace) body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n\t\tif (NAMESPACE === HTML_NAMESPACE) return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? \"html\" : \"body\")[0];\n\t\treturn WHOLE_DOCUMENT ? doc.documentElement : body;\n\t};\n\t/**\n\t* Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n\t*\n\t* @param root The root element or node to start traversing on.\n\t* @return The created NodeIterator\n\t*/\n\tconst _createNodeIterator = function _createNodeIterator(root) {\n\t\tconst doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;\n\t\treturn createNodeIterator.call(doc || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n\t};\n\t/**\n\t* Replace template expression syntax (mustache, ERB, template\n\t* literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub\n\t* sites. Order matters: mustache, then ERB, then template literal.\n\t*\n\t* @param value the string to scrub\n\t* @returns the scrubbed string\n\t*/\n\tconst _stripTemplateExpressions = function _stripTemplateExpressions(value) {\n\t\tvalue = stringReplace(value, MUSTACHE_EXPR$1, \" \");\n\t\tvalue = stringReplace(value, ERB_EXPR$1, \" \");\n\t\tvalue = stringReplace(value, TMPLIT_EXPR$1, \" \");\n\t\treturn value;\n\t};\n\t/**\n\t* Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the\n\t* character data of an element subtree. Used as the final safety net for\n\t* SAFE_FOR_TEMPLATES on every DOM-returning code path so that expressions\n\t* which only form after text-node normalization (e.g. fragments split across\n\t* stripped elements) cannot survive into a template-evaluating framework.\n\t*\n\t* Walks text/comment/CDATA/processing-instruction nodes and mutates `.data`\n\t* in place rather than round-tripping through innerHTML. This preserves\n\t* descendant node references (important for IN_PLACE callers), avoids a\n\t* serialize/reparse cycle, and reads literal character data — which means\n\t* `<%...%>` in text content matches the ERB regex against its real bytes\n\t* instead of the HTML-entity-escaped form innerHTML would produce.\n\t*\n\t* Attribute values are not visited here; SAFE_FOR_TEMPLATES handling for\n\t* attributes is performed during the per-node `_sanitizeAttributes` pass.\n\t*\n\t* @param node The root element whose character data should be scrubbed.\n\t*/\n\tconst _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {\n\t\tvar _node$querySelectorAl;\n\t\tnode.normalize();\n\t\tconst doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;\n\t\tconst walker = createNodeIterator.call(doc || node, node, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);\n\t\tlet currentNode = walker.nextNode();\n\t\twhile (currentNode) {\n\t\t\tcurrentNode.data = _stripTemplateExpressions(currentNode.data);\n\t\t\tcurrentNode = walker.nextNode();\n\t\t}\n\t\tconst templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, \"template\");\n\t\tif (templates) arrayForEach(templates, (tmpl) => {\n\t\t\tif (_isDocumentFragment(tmpl.content)) _scrubTemplateExpressions2(tmpl.content);\n\t\t});\n\t};\n\t/**\n\t* _isClobbered\n\t*\n\t* Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML\n\t* interface with [LegacyOverrideBuiltIns]; a descendant element with a\n\t* `name` attribute matching a prototype property shadows that property\n\t* on direct reads. We use this check at the IN_PLACE entry-point and\n\t* during attribute sanitization to refuse clobbered forms.\n\t*\n\t* @param element element to check for clobbering attacks\n\t* @return true if clobbered, false if safe\n\t*/\n\tconst _isClobbered = function _isClobbered(element) {\n\t\tconst realTagName = getNodeName ? getNodeName(element) : null;\n\t\tif (typeof realTagName !== \"string\") return false;\n\t\tif (transformCaseFunc(realTagName) !== \"form\") return false;\n\t\treturn typeof element.nodeName !== \"string\" || typeof element.textContent !== \"string\" || typeof element.removeChild !== \"function\" || element.attributes !== getAttributes(element) || typeof element.removeAttribute !== \"function\" || typeof element.removeAttributeNode !== \"function\" || typeof element.getAttributeNode !== \"function\" || typeof element.setAttribute !== \"function\" || typeof element.namespaceURI !== \"string\" || typeof element.insertBefore !== \"function\" || typeof element.hasChildNodes !== \"function\" || element.nodeType !== getNodeType(element) || element.childNodes !== getChildNodes(element);\n\t};\n\t/**\n\t* Checks whether the given value is a DocumentFragment from any realm.\n\t*\n\t* The realm-independent replacement reads `nodeType` through the cached\n\t* Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE\n\t* constant (11). nodeType is a numeric value resolved from the node's\n\t* internal slot, identical across realms for the same kind of node.\n\t*\n\t* @param value object to check\n\t* @return true if value is a DocumentFragment-shaped node from any realm\n\t*/\n\tconst _isDocumentFragment = function _isDocumentFragment(value) {\n\t\tif (!getNodeType || typeof value !== \"object\" || value === null) return false;\n\t\ttry {\n\t\t\treturn getNodeType(value) === NODE_TYPE.documentFragment;\n\t\t} catch (_) {\n\t\t\treturn false;\n\t\t}\n\t};\n\t/**\n\t* Checks whether the given object is a DOM node, including nodes that\n\t* originate from a different window/realm (e.g. an iframe's\n\t* contentDocument). The previous `value instanceof Node` check was\n\t* realm-bound: nodes from a different window failed it, causing\n\t* sanitize() to silently stringify them and reset IN_PLACE to false,\n\t* returning the original node unsanitized. See GHSA-4w3q-35jp-p934.\n\t*\n\t* @param value object to check whether it's a DOM node\n\t* @return true if value is a DOM node from any realm\n\t*/\n\tconst _isNode = function _isNode(value) {\n\t\tif (!getNodeType || typeof value !== \"object\" || value === null) return false;\n\t\ttry {\n\t\t\treturn typeof getNodeType(value) === \"number\";\n\t\t} catch (_) {\n\t\t\treturn false;\n\t\t}\n\t};\n\tfunction _executeHooks(hooks, currentNode, data) {\n\t\tif (hooks.length === 0) return;\n\t\tarrayForEach(hooks, (hook) => {\n\t\t\thook.call(DOMPurify, currentNode, data, CONFIG);\n\t\t});\n\t}\n\t/**\n\t* Structural-threat checks that condemn a node regardless of the\n\t* allowlists: mXSS via namespace confusion, risky CSS construction,\n\t* processing instructions, markup-bearing comments. Pure predicate;\n\t* the caller removes. Check order is load-bearing.\n\t*\n\t* @param currentNode the node to inspect\n\t* @param tagName the node's transformCaseFunc'd tag name\n\t* @return true if the node must be removed\n\t*/\n\tconst _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {\n\t\tif (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) return true;\n\t\tif (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && LITERAL_TEXT_ELEMENTS[tagName] && (_isNode(currentNode.firstElementChild) || typeof currentNode.textContent === \"string\" && regExpTest(LITERAL_TEXT_CLOSE[tagName], currentNode.textContent))) return true;\n\t\tif (currentNode.nodeType === NODE_TYPE.processingInstruction) return true;\n\t\tif (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) return true;\n\t\treturn false;\n\t};\n\t/**\n\t* Evaluate a CUSTOM_ELEMENT_HANDLING check (a RegExp or a predicate\n\t* function, per the validation in _parseConfig) against a name.\n\t* Additional arguments are forwarded to predicate functions - the\n\t* attributeNameCheck predicate receives the tag name as its second\n\t* argument. A null/absent check never matches.\n\t*\n\t* @param check the configured tagNameCheck / attributeNameCheck value\n\t* @param name the name to test\n\t* @param args extra arguments forwarded to a predicate function\n\t* @return true if the check matches the name\n\t*/\n\tconst _matchesNameCheck = function _matchesNameCheck(check, name) {\n\t\tif (check instanceof RegExp) return regExpTest(check, name);\n\t\tif (check instanceof Function) {\n\t\t\tfor (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];\n\t\t\treturn Boolean(check(name, ...args));\n\t\t}\n\t\treturn false;\n\t};\n\t/**\n\t* Handle a node whose tag is forbidden or not allowlisted: keep\n\t* allowed custom elements (false return exits _sanitizeElements\n\t* early - the namespace and fallback-tag removal checks are\n\t* intentionally skipped for kept custom elements), else hoist\n\t* content per KEEP_CONTENT and remove.\n\t*\n\t* A kept custom element is the ONLY case in which this function\n\t* returns false, so the caller uses that return value to run the\n\t* afterSanitizeElements hook on the kept element and keep the\n\t* element-hook lifecycle consistent with normal allowlisted\n\t* elements (GHSA-c2j3-45gr-mqc4).\n\t*\n\t* @param currentNode the disallowed node\n\t* @param tagName the node's transformCaseFunc'd tag name\n\t* @return true if the node was removed, false if kept\n\t*/\n\tconst _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName, root) {\n\t\tif (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;\n\t\tif (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n\t\t\tconst parentNode = getParentNode(currentNode);\n\t\t\tconst childNodes = getChildNodes(currentNode);\n\t\t\tif (childNodes && parentNode) {\n\t\t\t\tconst childCount = childNodes.length;\n\t\t\t\tfor (let i = childCount - 1; i >= 0; --i) {\n\t\t\t\t\tconst hoisted = currentNode === root ? cloneNode(childNodes[i], true) : childNodes[i];\n\t\t\t\t\tparentNode.insertBefore(hoisted, getNextSibling(currentNode));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_forceRemove(currentNode);\n\t\treturn true;\n\t};\n\t/**\n\t* Fork a hook-mutable allowlist off its shared binding the first time a\n\t* (possibly lazily-installed) uponSanitize* hook is about to see it, so the\n\t* hook cannot widen the per-instance default or the setConfig binding by\n\t* reference and leak past the call. Returns the set unchanged once it is\n\t* already call-local, so repeated calls across elements are idempotent.\n\t*\n\t* @param hookList the uponSanitize* hook array for this event\n\t* @param set the current ALLOWED_TAGS / ALLOWED_ATTR binding\n\t* @param defaultSet the per-instance DEFAULT_ALLOWED_* constant\n\t* @param setConfigSet the captured setConfig() binding, or null\n\t* @return a call-local clone if a hook is present and set is still shared,\n\t* else set unchanged\n\t*/\n\tconst _forkSharedAllowlist = function _forkSharedAllowlist(hookList, set, defaultSet, setConfigSet) {\n\t\tif (hookList.length === 0) return set;\n\t\treturn set === defaultSet || set === setConfigSet ? clone(set) : set;\n\t};\n\t/**\n\t* Shared guard for a node that a hook has detached from the walk tree,\n\t* used after each element-hook site in _sanitizeElements. Detaching is a\n\t* long-standing user pattern (issue #469; draw.io-style foreignObject\n\t* filtering). Per the cached, unclobberable parentNode getter the node is\n\t* genuinely out of the tree, so it can reach neither the serialized\n\t* output nor an IN_PLACE live tree; treat it as removed and stop\n\t* processing it. Without this guard, the unsafe-node / namespace checks\n\t* would call _forceRemove on a parentless node and hit the REPORT-3\n\t* fail-closed throw — which exists for nodes DOMPurify wants gone but\n\t* *cannot* detach (clobbered / parentless roots), the opposite of a node\n\t* that is already safely gone. The walk root is exempt: a detached\n\t* IN_PLACE root is legitimate input and must still be fully sanitized,\n\t* and a kill-decision on it must keep hitting the REPORT-3 throw.\n\t*\n\t* Nodes detached by hooks stay the hook's responsibility for placement:\n\t* they are not recorded in DOMPurify.removed, so the post-walk IN_PLACE\n\t* pass (which iterates DOMPurify.removed) does not reach them. But a\n\t* hook-detached subtree can still hold a queued resource-event handler -\n\t* e.g. an <img onload> that began loading when the caller built the live\n\t* tree - which fires in page scope after sanitize returns even though the\n\t* handler never reached the returned tree. That is the audit-5 F1 hazard,\n\t* and the documented node.remove() hook pattern walks straight into it.\n\t* So on the IN_PLACE path we neutralize the detached subtree inline,\n\t* stripping its non-allow-listed attributes before returning, exactly as\n\t* the post-walk pass does for _forceRemove'd subtrees.\n\t*\n\t* @param currentNode the node a hook may have detached\n\t* @param root the current walk root\n\t* @return true if the node is detached and now handled, false otherwise\n\t*/\n\tconst _handleHookDetachedNode = function _handleHookDetachedNode(currentNode, root) {\n\t\tif (currentNode === root || getParentNode(currentNode) !== null) return false;\n\t\tif (IN_PLACE) _neutralizeSubtree(currentNode);\n\t\treturn true;\n\t};\n\t/**\n\t* _sanitizeElements\n\t*\n\t* @protect nodeName\n\t* @protect textContent\n\t* @protect removeChild\n\t* @param currentNode to check for permission to exist\n\t* @return true if node was killed, false if left alive\n\t*/\n\tconst _sanitizeElements = function _sanitizeElements(currentNode, root) {\n\t\t_executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n\t\tif (_handleHookDetachedNode(currentNode, root)) return true;\n\t\tif (_isClobbered(currentNode)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tconst tagName = transformCaseFunc(_readNodeName(currentNode));\n\t\tALLOWED_TAGS = _forkSharedAllowlist(hooks.uponSanitizeElement, ALLOWED_TAGS, DEFAULT_ALLOWED_TAGS, SET_CONFIG_ALLOWED_TAGS);\n\t\t_executeHooks(hooks.uponSanitizeElement, currentNode, {\n\t\t\ttagName,\n\t\t\tallowedTags: ALLOWED_TAGS\n\t\t});\n\t\tif (_handleHookDetachedNode(currentNode, root)) return true;\n\t\tif (_isUnsafeNode(currentNode, tagName)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tif (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {\n\t\t\tconst removed = _sanitizeDisallowedNode(currentNode, tagName, root);\n\t\t\tif (removed === false) {\n\t\t\t\t_executeHooks(hooks.afterSanitizeElements, currentNode, null);\n\t\t\t\tif (_handleHookDetachedNode(currentNode, root)) return true;\n\t\t\t}\n\t\t\treturn removed;\n\t\t}\n\t\tif (_readNodeType(currentNode) === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tif ((tagName === \"noscript\" || tagName === \"noembed\" || tagName === \"noframes\") && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tif (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n\t\t\tconst content = _stripTemplateExpressions(currentNode.textContent);\n\t\t\tif (currentNode.textContent !== content) {\n\t\t\t\tarrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n\t\t\t\tcurrentNode.textContent = content;\n\t\t\t}\n\t\t}\n\t\t_executeHooks(hooks.afterSanitizeElements, currentNode, null);\n\t\treturn _handleHookDetachedNode(currentNode, root);\n\t};\n\t/**\n\t* _isValidAttribute\n\t*\n\t* @param lcTag Lowercase tag name of containing element.\n\t* @param lcName Lowercase attribute name.\n\t* @param value Attribute value.\n\t* @return Returns true if `value` is valid, otherwise false.\n\t*/\n\tconst _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n\t\tif (FORBID_ATTR[lcName]) return false;\n\t\tif (_isPatchLinkageAttribute(lcName, lcTag)) return false;\n\t\tif (SANITIZE_DOM && (lcName === \"id\" || lcName === \"name\") && (value in document || value in formElement)) return false;\n\t\tconst nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);\n\t\tif (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) return true;\n\t\tif (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) return true;\n\t\tif (!nameIsPermitted) return _isBasicCustomElement(lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName, lcTag) || lcName === \"is\" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value);\n\t\tif (URI_SAFE_ATTRIBUTES[lcName]) return true;\n\t\tif (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, \"\"))) return true;\n\t\tif ((lcName === \"src\" || lcName === \"xlink:href\" || lcName === \"href\") && lcTag !== \"script\" && stringIndexOf(value, \"data:\") === 0 && DATA_URI_TAGS[lcTag]) return true;\n\t\tif (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, \"\"))) return true;\n\t\treturn !value;\n\t};\n\tconst RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, [\n\t\t\"annotation-xml\",\n\t\t\"color-profile\",\n\t\t\"font-face\",\n\t\t\"font-face-format\",\n\t\t\"font-face-name\",\n\t\t\"font-face-src\",\n\t\t\"font-face-uri\",\n\t\t\"missing-glyph\"\n\t]);\n\t/**\n\t* _isBasicCustomElement\n\t* checks if at least one dash is included in tagName, and it's not the first char\n\t* for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n\t*\n\t* @param tagName name of the tag of the node to sanitize\n\t* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n\t*/\n\tconst _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n\t\treturn !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);\n\t};\n\t/**\n\t* Wrap an attribute value in the matching Trusted Types object when\n\t* the active policy requires it. Namespaced attributes pass through\n\t* unchanged (no TT support yet, see\n\t* https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).\n\t*\n\t* @param lcTag lowercase tag name of the containing element\n\t* @param lcName lowercase attribute name\n\t* @param namespaceURI the attribute's namespace, if any\n\t* @param value the attribute value to wrap\n\t* @return the value, wrapped when Trusted Types demand it\n\t*/\n\tconst _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {\n\t\tif (trustedTypesPolicy && typeof trustedTypes === \"object\" && typeof trustedTypes.getAttributeType === \"function\" && !namespaceURI) switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n\t\t\tcase \"TrustedHTML\": return _createTrustedHTML(value);\n\t\t\tcase \"TrustedScriptURL\": return _createTrustedScriptURL(value);\n\t\t}\n\t\treturn value;\n\t};\n\t/**\n\t* Write a modified attribute value back onto the element. On\n\t* success, re-probe for clobbering introduced by the new value and\n\t* remove the element when found; otherwise, when this writeback is the\n\t* recreate half of the SANITIZE_NAMED_PROPS remove-and-recreate, pop the\n\t* removal entry that path recorded so it does not show as removed. On\n\t* failure, remove the attribute instead.\n\t*\n\t* Returns true only on a clean write (the value was set and the new value\n\t* introduced no clobbering). The caller uses that, together with its own\n\t* knowledge of whether this attribute pushed a DOMPurify.removed record, to\n\t* decide whether to pop that record. The pop must happen ONLY for the\n\t* named-prop remove-and-recreate; popping on any other value change (trim,\n\t* template scrubbing, Trusted Types) would consume an unrelated _forceRemove\n\t* subtree-cleanup record and let that detached subtree keep a live event\n\t* handler through the IN_PLACE neutralization pass (SO-001).\n\t*\n\t* @param currentNode the element carrying the attribute\n\t* @param name the attribute name as present on the element\n\t* @param namespaceURI the attribute's namespace, if any\n\t* @param value the new attribute value\n\t* @return true if the value was written without introducing clobbering\n\t*/\n\tconst _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {\n\t\ttry {\n\t\t\tif (namespaceURI) currentNode.setAttributeNS(namespaceURI, name, value);\n\t\t\telse currentNode.setAttribute(name, value);\n\t\t\tif (_isClobbered(currentNode)) {\n\t\t\t\t_forceRemove(currentNode);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (_) {\n\t\t\t_removeAttribute(name, currentNode);\n\t\t\treturn false;\n\t\t}\n\t};\n\t/**\n\t* _sanitizeAttributes\n\t*\n\t* @protect attributes\n\t* @protect nodeName\n\t* @protect removeAttribute\n\t* @protect setAttribute\n\t*\n\t* @param currentNode to sanitize\n\t* @param root the current walk root\n\t*/\n\tconst _sanitizeAttributes = function _sanitizeAttributes(currentNode, root) {\n\t\t_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n\t\tif (_handleHookDetachedNode(currentNode, root)) return;\n\t\tconst attributes = currentNode.attributes;\n\t\tif (!attributes || _isClobbered(currentNode)) return;\n\t\tALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);\n\t\tconst hookEvent = {\n\t\t\tattrName: \"\",\n\t\t\tattrValue: \"\",\n\t\t\tkeepAttr: true,\n\t\t\tallowedAttributes: ALLOWED_ATTR,\n\t\t\tforceKeepAttr: void 0\n\t\t};\n\t\tlet l = attributes.length;\n\t\tconst lcTag = transformCaseFunc(currentNode.nodeName);\n\t\twhile (l--) {\n\t\t\tconst attr = attributes[l];\n\t\t\tconst name = attr.name, namespaceURI = attr.namespaceURI, attrValue = attr.value;\n\t\t\tconst lcName = transformCaseFunc(name);\n\t\t\tconst initValue = attrValue;\n\t\t\tlet value = name === \"value\" ? initValue : stringTrim(initValue);\n\t\t\tlet recreatedNamedProp = false;\n\t\t\thookEvent.attrName = lcName;\n\t\t\thookEvent.attrValue = value;\n\t\t\thookEvent.keepAttr = true;\n\t\t\thookEvent.forceKeepAttr = void 0;\n\t\t\t_executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n\t\t\tvalue = hookEvent.attrValue;\n\t\t\tif (SANITIZE_NAMED_PROPS && (lcName === \"id\" || lcName === \"name\") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tvalue = SANITIZE_NAMED_PROPS_PREFIX + value;\n\t\t\t\trecreatedNamedProp = true;\n\t\t\t}\n\t\t\tif (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (lcName === \"attributename\" && stringMatch(value, \"href\")) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (hookEvent.forceKeepAttr) continue;\n\t\t\tif (!hookEvent.keepAttr) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (SAFE_FOR_TEMPLATES) value = _stripTemplateExpressions(value);\n\t\t\tif (!_isValidAttribute(lcTag, lcName, value)) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvalue = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);\n\t\t\tif (value !== initValue) {\n\t\t\t\tif (_setAttributeValue(currentNode, name, namespaceURI, value) && recreatedNamedProp) arrayPop(DOMPurify.removed);\n\t\t\t}\n\t\t}\n\t\t_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n\t\t_handleHookDetachedNode(currentNode, root);\n\t};\n\t/**\n\t* _sanitizeShadowDOM\n\t*\n\t* @param fragment to iterate over recursively\n\t*/\n\tconst _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {\n\t\tlet shadowNode = null;\n\t\tconst shadowIterator = _createNodeIterator(fragment);\n\t\t_executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n\t\twhile (shadowNode = shadowIterator.nextNode()) {\n\t\t\t_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n\t\t\t_sanitizeElements(shadowNode, fragment);\n\t\t\t_sanitizeAttributes(shadowNode, fragment);\n\t\t\tif (_isDocumentFragment(shadowNode.content)) _sanitizeShadowDOM2(shadowNode.content);\n\t\t\tif (_readNodeType(shadowNode) === NODE_TYPE.element) {\n\t\t\t\tconst innerSr = getShadowRoot(shadowNode);\n\t\t\t\tif (_isDocumentFragment(innerSr)) {\n\t\t\t\t\t_sanitizeAttachedShadowRoots(innerSr);\n\t\t\t\t\t_sanitizeShadowDOM2(innerSr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n\t};\n\t/**\n\t* _sanitizeAttachedShadowRoots\n\t*\n\t* Walks `root` and feeds every attached shadow root we encounter into\n\t* the existing _sanitizeShadowDOM pipeline. The default node iterator\n\t* does not descend into shadow trees, so nodes inside an attached\n\t* shadow root would otherwise be skipped entirely.\n\t*\n\t* Two real input paths put attached shadow roots in front of us:\n\t* 1. IN_PLACE on a DOM node that already has shadow roots attached.\n\t* 2. DOM-node input where importNode(dirty, true) deep-clones the\n\t* shadow root because it was created with `clonable: true`.\n\t*\n\t* This pass runs once, up front, so the main iteration loop (and the\n\t* existing _sanitizeShadowDOM template-content recursion) stay\n\t* untouched — string-input paths are not affected.\n\t*\n\t* @param root the subtree root to walk for attached shadow roots\n\t*/\n\tconst _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {\n\t\tconst stack = [{\n\t\t\tnode: root,\n\t\t\tshadow: null\n\t\t}];\n\t\twhile (stack.length > 0) {\n\t\t\tconst item = stack.pop();\n\t\t\tif (item.shadow) {\n\t\t\t\t_sanitizeShadowDOM2(item.shadow);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst node = item.node;\n\t\t\tconst isElement = _readNodeType(node) === NODE_TYPE.element;\n\t\t\tconst childNodes = getChildNodes(node);\n\t\t\tif (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push({\n\t\t\t\tnode: childNodes[i],\n\t\t\t\tshadow: null\n\t\t\t});\n\t\t\tif (isElement) {\n\t\t\t\tconst rootName = getNodeName ? getNodeName(node) : null;\n\t\t\t\tif (typeof rootName === \"string\" && transformCaseFunc(rootName) === \"template\") {\n\t\t\t\t\tconst content = node.content;\n\t\t\t\t\tif (_isDocumentFragment(content)) stack.push({\n\t\t\t\t\t\tnode: content,\n\t\t\t\t\t\tshadow: null\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isElement) {\n\t\t\t\tconst sr = getShadowRoot(node);\n\t\t\t\tif (_isDocumentFragment(sr)) stack.push({\n\t\t\t\t\tnode: null,\n\t\t\t\t\tshadow: sr\n\t\t\t\t}, {\n\t\t\t\t\tnode: sr,\n\t\t\t\t\tshadow: null\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\tDOMPurify.sanitize = function(dirty) {\n\t\tlet cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n\t\tlet body = null;\n\t\tlet importedNode = null;\n\t\tlet currentNode = null;\n\t\tlet returnNode = null;\n\t\tIS_EMPTY_INPUT = !dirty;\n\t\tif (IS_EMPTY_INPUT) dirty = \"<!-->\";\n\t\tif (typeof dirty !== \"string\" && !_isNode(dirty)) {\n\t\t\tdirty = stringifyValue(dirty);\n\t\t\tif (typeof dirty !== \"string\") throw typeErrorCreate(\"dirty is not a string, aborting\");\n\t\t}\n\t\tif (!DOMPurify.isSupported) return dirty;\n\t\tif (SET_CONFIG) {\n\t\t\tALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;\n\t\t\tALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;\n\t\t} else _parseConfig(cfg);\n\t\tif (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) ALLOWED_TAGS = clone(ALLOWED_TAGS);\n\t\tif (hooks.uponSanitizeAttribute.length > 0) ALLOWED_ATTR = clone(ALLOWED_ATTR);\n\t\tDOMPurify.removed = [];\n\t\tconst inPlace = IN_PLACE && typeof dirty !== \"string\" && _isNode(dirty);\n\t\tif (inPlace) {\n\t\t\t_neutralizePatchLinkage(dirty);\n\t\t\tconst nn = _readNodeName(dirty);\n\t\t\tif (typeof nn === \"string\") {\n\t\t\t\tconst tagName = transformCaseFunc(nn);\n\t\t\t\tif (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n\t\t\t\t\t_neutralizeRoot(dirty);\n\t\t\t\t\tthrow typeErrorCreate(\"root node is forbidden and cannot be sanitized in-place\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (_isClobbered(dirty)) {\n\t\t\t\t_neutralizeRoot(dirty);\n\t\t\t\tthrow typeErrorCreate(\"root node is clobbered and cannot be sanitized in-place\");\n\t\t\t}\n\t\t\ttry {\n\t\t\t\t_sanitizeAttachedShadowRoots(dirty);\n\t\t\t} catch (error) {\n\t\t\t\t_neutralizeRoot(dirty);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t} else if (_isNode(dirty)) {\n\t\t\tbody = _initDocument(\"<!---->\");\n\t\t\timportedNode = body.ownerDocument.importNode(dirty, true);\n\t\t\tif (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === \"BODY\") body = importedNode;\n\t\t\telse if (importedNode.nodeName === \"HTML\") body = importedNode;\n\t\t\telse body.appendChild(importedNode);\n\t\t\t_sanitizeAttachedShadowRoots(body);\n\t\t} else {\n\t\t\tif (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf(\"<\") === -1) return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;\n\t\t\tbody = _initDocument(dirty);\n\t\t\tif (!body) return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : \"\";\n\t\t}\n\t\tif (body && FORCE_BODY) _forceRemove(body.firstChild);\n\t\tconst walkRoot = inPlace ? dirty : body;\n\t\ttry {\n\t\t\tconst nodeIterator = _createNodeIterator(walkRoot);\n\t\t\twhile (currentNode = nodeIterator.nextNode()) {\n\t\t\t\t_sanitizeElements(currentNode, walkRoot);\n\t\t\t\t_sanitizeAttributes(currentNode, walkRoot);\n\t\t\t\tif (_isDocumentFragment(currentNode.content)) _sanitizeShadowDOM2(currentNode.content);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (inPlace) {\n\t\t\t\t_neutralizeRoot(dirty);\n\t\t\t\tarrayForEach(DOMPurify.removed, (entry) => {\n\t\t\t\t\tif (entry.element) _neutralizeSubtree(entry.element);\n\t\t\t\t});\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t\tif (inPlace) {\n\t\t\tlet rootWasRemoved = false;\n\t\t\tarrayForEach(DOMPurify.removed, (entry) => {\n\t\t\t\tif (entry.element) {\n\t\t\t\t\tif (entry.element === dirty) rootWasRemoved = true;\n\t\t\t\t\t_neutralizeSubtree(entry.element);\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (rootWasRemoved) throw typeErrorCreate(\"a node selected for removal could not be safely returned; refusing to sanitize in place\");\n\t\t\tif (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(dirty);\n\t\t\treturn dirty;\n\t\t}\n\t\tif (RETURN_DOM) {\n\t\t\tif (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(body);\n\t\t\tif (RETURN_DOM_FRAGMENT) {\n\t\t\t\treturnNode = createDocumentFragment.call(body.ownerDocument);\n\t\t\t\twhile (body.firstChild) returnNode.appendChild(body.firstChild);\n\t\t\t} else returnNode = body;\n\t\t\tif (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) returnNode = importNode.call(originalDocument, returnNode, true);\n\t\t\treturn returnNode;\n\t\t}\n\t\tlet serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\t\tif (WHOLE_DOCUMENT && ALLOWED_TAGS[\"!doctype\"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) serializedHTML = \"<!DOCTYPE \" + body.ownerDocument.doctype.name + \">\\n\" + serializedHTML;\n\t\tif (SAFE_FOR_TEMPLATES) serializedHTML = _stripTemplateExpressions(serializedHTML);\n\t\treturn trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;\n\t};\n\tDOMPurify.setConfig = function() {\n\t\tlet cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n\t\t_parseConfig(cfg);\n\t\tSET_CONFIG = true;\n\t\tSET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;\n\t\tSET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;\n\t};\n\tDOMPurify.clearConfig = function() {\n\t\tCONFIG = null;\n\t\tSET_CONFIG = false;\n\t\tSET_CONFIG_ALLOWED_TAGS = null;\n\t\tSET_CONFIG_ALLOWED_ATTR = null;\n\t\ttrustedTypesPolicy = defaultTrustedTypesPolicy;\n\t\temptyHTML = \"\";\n\t};\n\tDOMPurify.isValidAttribute = function(tag, attr, value) {\n\t\tif (!CONFIG) _parseConfig({});\n\t\tconst lcTag = transformCaseFunc(tag);\n\t\tconst lcName = transformCaseFunc(attr);\n\t\treturn _isValidAttribute(lcTag, lcName, value);\n\t};\n\tDOMPurify.addHook = function(entryPoint, hookFunction) {\n\t\tif (typeof hookFunction !== \"function\") return;\n\t\tif (!objectHasOwnProperty(hooks, entryPoint)) return;\n\t\tarrayPush(hooks[entryPoint], hookFunction);\n\t};\n\tDOMPurify.removeHook = function(entryPoint, hookFunction) {\n\t\tif (!objectHasOwnProperty(hooks, entryPoint)) return;\n\t\tif (hookFunction !== void 0) {\n\t\t\tconst index = arrayLastIndexOf(hooks[entryPoint], hookFunction);\n\t\t\treturn index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];\n\t\t}\n\t\treturn arrayPop(hooks[entryPoint]);\n\t};\n\tDOMPurify.removeHooks = function(entryPoint) {\n\t\tif (!objectHasOwnProperty(hooks, entryPoint)) return;\n\t\thooks[entryPoint] = [];\n\t};\n\tDOMPurify.removeAllHooks = function() {\n\t\thooks = _createHooksMap();\n\t};\n\treturn DOMPurify;\n}\nvar purify_default = createDOMPurify();\nexport { purify_default as default };\n\n//# sourceMappingURL=purify.es.mjs.map","/**\n * Shared DOMPurify forbid-lists for every in-repo sanitizer (item/passage\n * markup, SVG icons). Keeping one canonical list means a newly-identified\n * dangerous tag or attribute only needs to be added once to cover every\n * sanitizer instead of drifting between hand-maintained copies.\n */\nexport const SANITIZER_FORBIDDEN_TAGS = [\n \"script\",\n \"iframe\",\n \"object\",\n \"embed\",\n \"base\",\n \"form\",\n \"meta\",\n \"link\",\n // A <style> element is a document-global stylesheet. The item player renders\n // in light DOM (`shadow: \"none\"`), so a <style> in authored markup restyles\n // host chrome outside the item. DOMPurify's defaults already drop a\n // top-level HTML <style>; the SVG profile keeps one, whose rules apply\n // document-wide all the same — verified in Chromium 2026-08-30, where\n // `<svg><style>` passed this list and hid an element outside the player.\n // `style` is in DOMPurify's default FORBID_CONTENTS, so the CSS text is\n // dropped with the tag rather than surfacing as item text.\n \"style\",\n // <foreignObject> inside an <svg> is a well-known escape hatch back into\n // HTML context.\n \"foreignobject\",\n];\n// DOMPurify already strips `on*` handlers via its default block-list; these\n// entries guarantee they stay stripped even if a consumer tweaks defaults,\n// and they cover the common SVG / math sinks.\nexport const SANITIZER_FORBIDDEN_ATTRS = [\n \"onerror\",\n \"onload\",\n \"onclick\",\n \"onmouseover\",\n \"onmouseout\",\n \"onmouseenter\",\n \"onmouseleave\",\n \"onfocus\",\n \"onblur\",\n \"onkeydown\",\n \"onkeyup\",\n \"onkeypress\",\n \"onsubmit\",\n \"onchange\",\n \"onbeforeunload\",\n \"formaction\",\n \"xlink:href\",\n];\n","/**\n * Declaration-level filter for the `style` attribute on authored markup and\n * tool icons.\n *\n * DOMPurify lists `style` among its URI-safe attributes, so it permits the\n * attribute and inspects nothing inside it. Two things in an inline style\n * therefore reach the page unchecked: a URL-fetching function, which makes the\n * browser request an arbitrary origin every time the item renders and reports\n * back which learner saw which item, and `position: fixed`, which leaves the\n * item's box and covers the host page — the item player renders in light DOM\n * (`shadow: \"none\"`), so nothing else confines it.\n *\n * What stays permitted is the point of filtering declarations rather than\n * dropping the attribute: authored items use inline styles for ordinary\n * per-element presentation, and `position: absolute` in particular is\n * load-bearing for accessibility — MathJax's `mjx-assistive-mml` carries\n * `position: absolute; width: 1px; height: 1px; overflow: hidden` to expose\n * MathML to a screen reader while hiding it visually.\n *\n * `position: absolute` and `position: sticky` are deliberately left alone.\n * Sticky cannot leave its containing block, so it is not an escape. Absolute\n * can, when no ancestor between the node and the viewport is positioned, and\n * closing that means making the player's own container a containing block\n * rather than filtering the declaration — a change that re-anchors every\n * absolutely positioned node a PIE element renders, so it is a separate\n * decision with its own visual review.\n */\n/**\n * CSS functions that make the browser fetch a URL. Serialized CSSOM values are\n * matched against this, so an escaped spelling (`\\75 rl(`) is normalized to\n * `url(` before it gets here.\n */\nconst URL_FUNCTION_REGEX = /(?:^|[^\\w-])(?:url|image-set|-webkit-image-set|src)\\s*\\(/i;\n/**\n * Cheap gate on the raw attribute so the common case costs one regex and no\n * CSSOM parse. `position` is included because that check needs the parser, and\n * a backslash because it introduces a CSS escape, which is exactly how a\n * forbidden token hides from a raw-string match.\n */\nconst NEEDS_INSPECTION_REGEX = /url\\s*\\(|image-set\\s*\\(|src\\s*\\(|position|\\\\/i;\nfunction isForbiddenDeclaration(property, value) {\n if (URL_FUNCTION_REGEX.test(value))\n return true;\n // `position` is a shorthand for nothing, so the CSSOM reports it verbatim.\n return property.toLowerCase() === \"position\" && /\\bfixed\\b/i.test(value);\n}\n/**\n * Rebuild the attribute from the parsed declarations, dropping the forbidden\n * ones. Anything the engine failed to parse is dropped with them: an unparsed\n * declaration cannot be inspected, and this path only runs on input that\n * already tripped the gate.\n */\nfunction rebuildFromCssom(value, doc) {\n const probe = doc.createElement(\"span\");\n probe.setAttribute(\"style\", value);\n const declarations = probe.style;\n const kept = [];\n for (let index = 0; index < declarations.length; index += 1) {\n const property = declarations.item(index);\n if (!property)\n continue;\n const propertyValue = declarations.getPropertyValue(property);\n if (isForbiddenDeclaration(property, propertyValue))\n continue;\n const priority = declarations.getPropertyPriority(property);\n kept.push(`${property}: ${propertyValue}${priority ? ` !${priority}` : \"\"}`);\n }\n return kept.join(\"; \");\n}\n/**\n * Filter one `style` attribute value.\n *\n * Returns the input unchanged when nothing needs removing, so authored markup\n * keeps its own spelling — shorthands stay shorthands — in every case but the\n * one that carries something forbidden.\n */\nexport function sanitizeStyleAttribute(value, doc) {\n if (typeof value !== \"string\" || value.length === 0)\n return \"\";\n if (!doc)\n return value;\n if (!NEEDS_INSPECTION_REGEX.test(value))\n return value;\n const probe = doc.createElement(\"span\");\n probe.setAttribute(\"style\", value);\n const declarations = probe.style;\n let hasForbidden = false;\n for (let index = 0; index < declarations.length; index += 1) {\n const property = declarations.item(index);\n if (!property)\n continue;\n if (isForbiddenDeclaration(property, declarations.getPropertyValue(property))) {\n hasForbidden = true;\n break;\n }\n }\n // A raw value carrying a URL function the engine did not parse into a\n // declaration still goes through the rebuild, which drops it.\n if (!hasForbidden && !URL_FUNCTION_REGEX.test(value))\n return value;\n return rebuildFromCssom(value, doc);\n}\n/**\n * Install the filter on a DOMPurify instance.\n *\n * `afterSanitizeAttributes` rather than a post-pass over the output string:\n * DOMPurify has already parsed the markup at that point, so the declarations\n * are filtered on the node it is about to serialize instead of costing another\n * DOM round-trip.\n */\nexport function installStyleAttributeHook(purifier) {\n if (typeof purifier.addHook !== \"function\")\n return;\n purifier.addHook(\"afterSanitizeAttributes\", (node) => {\n const element = node;\n if (!element || typeof element.getAttribute !== \"function\")\n return;\n const raw = element.getAttribute(\"style\");\n if (!raw)\n return;\n const filtered = sanitizeStyleAttribute(raw, element.ownerDocument);\n if (filtered === raw)\n return;\n if (filtered)\n element.setAttribute(\"style\", filtered);\n else\n element.removeAttribute(\"style\");\n });\n}\n","/**\n * Sanitize an SVG string intended to be rendered as an icon.\n *\n * Used by toolbars and tool-button components when their icon prop is an\n * inline SVG supplied by a tool configuration. Runs DOMPurify with the\n * SVG profile, forbids `<script>` / `<foreignObject>` and strips\n * event-handler attributes.\n *\n * Returns an empty string when `window` / `document` are unavailable (SSR)\n * or the input is not a string.\n */\nimport DOMPurify from \"dompurify\";\nimport { SANITIZER_FORBIDDEN_ATTRS, SANITIZER_FORBIDDEN_TAGS, } from \"./sanitize-forbidden-lists.js\";\nimport { installStyleAttributeHook } from \"./sanitize-style-attribute.js\";\nlet svgPurifierInstance = null;\nfunction resolveSvgPurifier() {\n if (svgPurifierInstance)\n return svgPurifierInstance;\n if (typeof window === \"undefined\" || !window.document)\n return null;\n const factory = DOMPurify;\n svgPurifierInstance =\n typeof factory === \"function\"\n ? factory(window)\n : DOMPurify;\n installStyleAttributeHook(svgPurifierInstance);\n return svgPurifierInstance;\n}\nconst FORBIDDEN_TAGS = SANITIZER_FORBIDDEN_TAGS;\nconst FORBIDDEN_ATTRS = SANITIZER_FORBIDDEN_ATTRS;\nconst stringCache = new Map();\nconst STRING_CACHE_MAX = 64;\nexport function sanitizeSvgIcon(icon) {\n if (typeof icon !== \"string\" || icon.length === 0)\n return \"\";\n const trimmed = icon.trimStart();\n if (!trimmed.toLowerCase().startsWith(\"<svg\"))\n return \"\";\n const cached = stringCache.get(icon);\n if (cached !== undefined)\n return cached;\n const purifier = resolveSvgPurifier();\n if (!purifier)\n return \"\";\n const result = purifier.sanitize(icon, {\n USE_PROFILES: { svg: true, svgFilters: true },\n FORBID_TAGS: FORBIDDEN_TAGS,\n FORBID_ATTR: FORBIDDEN_ATTRS,\n ALLOW_UNKNOWN_PROTOCOLS: false,\n RETURN_TRUSTED_TYPE: false,\n });\n const str = typeof result === \"string\" ? result : String(result ?? \"\");\n if (stringCache.size >= STRING_CACHE_MAX) {\n // Naive LRU: clear oldest half when the cache fills up. Tool icons are\n // a small fixed set per assessment so this is rarely hit.\n const keys = [...stringCache.keys()];\n for (let i = 0; i < keys.length / 2; i += 1) {\n stringCache.delete(keys[i]);\n }\n }\n stringCache.set(icon, str);\n return str;\n}\n/** Reset sanitizer state. Intended for tests. */\nexport function resetSvgSanitizerForTesting() {\n svgPurifierInstance = null;\n stringCache.clear();\n}\n","'use strict'\n\n// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n/* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\n// Max safe length for a build identifier. The max length minus 6 characters for\n// the shortest version with a build 0.0.0+BUILD.\nconst MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6\n\nconst RELEASE_TYPES = [\n 'major',\n 'premajor',\n 'minor',\n 'preminor',\n 'patch',\n 'prepatch',\n 'prerelease',\n]\n\nmodule.exports = {\n MAX_LENGTH,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 0b001,\n FLAG_LOOSE: 0b010,\n}\n","'use strict'\n\nconst debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","'use strict'\n\nconst {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH,\n} = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst safeRe = exports.safeRe = []\nconst src = exports.src = []\nconst safeSrc = exports.safeSrc = []\nconst t = exports.t = {}\nlet R = 0\n\nconst LETTERDASHNUMBER = '[a-zA-Z0-9-]'\n\n// Replace some greedy regex tokens to prevent regex dos issues. These regex are\n// used internally via the safeRe object since all inputs in this library get\n// normalized first to trim and collapse all extra whitespace. The original\n// regexes are exported for userland consumption and lower level usage. A\n// future breaking change could export the safer regex only with a note that\n// all input should have extra whitespace removed.\nconst safeRegexReplacements = [\n ['\\\\s', 1],\n ['\\\\d', MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],\n]\n\nconst makeSafeRegex = (value) => {\n for (const [token, max] of safeRegexReplacements) {\n value = value\n .split(`${token}*`).join(`${token}{0,${max}}`)\n .split(`${token}+`).join(`${token}{1,${max}}`)\n }\n return value\n}\n\nconst createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value)\n const index = R++\n debug(name, index, value)\n t[name] = index\n src[index] = value\n safeSrc[index] = safe\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '\\\\d+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n// Non-numeric identifiers include numeric identifiers but can be longer.\n// Therefore non-numeric identifiers must go first.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]\n}|${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER]\n}|${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifier, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCEPLAIN', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)\ncreateToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\\\d])`)\ncreateToken('COERCEFULL', src[t.COERCEPLAIN] +\n `(?:${src[t.PRERELEASE]})?` +\n `(?:${src[t.BUILD]})?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\ncreateToken('COERCERTLFULL', src[t.COERCEFULL], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$')\n","'use strict'\n\n// parse out just the options we care about\nconst looseOption = Object.freeze({ loose: true })\nconst emptyOpts = Object.freeze({ })\nconst parseOptions = options => {\n if (!options) {\n return emptyOpts\n }\n\n if (typeof options !== 'object') {\n return looseOption\n }\n\n return options\n}\nmodule.exports = parseOptions\n","'use strict'\n\nconst numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n if (typeof a === 'number' && typeof b === 'number') {\n return a === b ? 0 : a < b ? -1 : 1\n }\n\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers,\n}\n","'use strict'\n\nconst debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\n\nconst isPrereleaseIdentifier = (prerelease, identifier) => {\n const identifiers = identifier.split('.')\n if (identifiers.length > prerelease.length) {\n return false\n }\n\n for (let i = 0; i < identifiers.length; i++) {\n if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {\n return false\n }\n }\n\n return true\n}\n\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n if (this.major < other.major) {\n return -1\n }\n if (this.major > other.major) {\n return 1\n }\n if (this.minor < other.minor) {\n return -1\n }\n if (this.minor > other.minor) {\n return 1\n }\n if (this.patch < other.patch) {\n return -1\n }\n if (this.patch > other.patch) {\n return 1\n }\n return 0\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('build compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier, identifierBase) {\n if (release.startsWith('pre')) {\n if (!identifier && identifierBase === false) {\n throw new Error('invalid increment argument: identifier is empty')\n }\n // Avoid an invalid semver results\n if (identifier) {\n const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])\n if (!match || match[1] !== identifier) {\n throw new Error(`invalid identifier: ${identifier}`)\n }\n }\n }\n\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier, identifierBase)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier, identifierBase)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier, identifierBase)\n this.inc('pre', identifier, identifierBase)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase)\n }\n this.inc('pre', identifier, identifierBase)\n break\n case 'release':\n if (this.prerelease.length === 0) {\n throw new Error(`version ${this.raw} is not a prerelease`)\n }\n this.prerelease.length = 0\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre': {\n const base = Number(identifierBase) ? 1 : 0\n\n if (this.prerelease.length === 0) {\n this.prerelease = [base]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n if (identifier === this.prerelease.join('.') && identifierBase === false) {\n throw new Error('invalid increment argument: identifier already exists')\n }\n this.prerelease.push(base)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n let prerelease = [identifier, base]\n if (identifierBase === false) {\n prerelease = [identifier]\n }\n if (isPrereleaseIdentifier(this.prerelease, identifier)) {\n const prereleaseBase = this.prerelease[identifier.split('.').length]\n if (isNaN(prereleaseBase)) {\n this.prerelease = prerelease\n }\n } else {\n this.prerelease = prerelease\n }\n }\n break\n }\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.raw = this.format()\n if (this.build.length) {\n this.raw += `+${this.build.join('.')}`\n }\n return this\n }\n}\n\nmodule.exports = SemVer\n","'use strict'\n\nconst SemVer = require('../classes/semver')\nconst parse = (version, options, throwErrors = false) => {\n if (version instanceof SemVer) {\n return version\n }\n try {\n return new SemVer(version, options)\n } catch (er) {\n if (!throwErrors) {\n return null\n }\n throw er\n }\n}\n\nmodule.exports = parse\n","'use strict'\n\nconst parse = require('./parse')\nconst valid = (version, options) => {\n const v = parse(version, options)\n return v ? v.version : null\n}\nmodule.exports = valid\n","'use strict'\n\nconst parse = require('./parse')\nconst clean = (version, options) => {\n const s = parse(version.trim().replace(/^[=v]+/, ''), options)\n return s ? s.version : null\n}\nmodule.exports = clean\n","'use strict'\n\nconst SemVer = require('../classes/semver')\n\nconst inc = (version, release, options, identifier, identifierBase) => {\n if (typeof (options) === 'string') {\n identifierBase = identifier\n identifier = options\n options = undefined\n }\n\n try {\n return new SemVer(\n version instanceof SemVer ? version.version : version,\n options\n ).inc(release, identifier, identifierBase).version\n } catch (er) {\n return null\n }\n}\nmodule.exports = inc\n","'use strict'\n\nconst parse = require('./parse.js')\n\nconst diff = (version1, version2) => {\n const v1 = parse(version1, null, true)\n const v2 = parse(version2, null, true)\n const comparison = v1.compare(v2)\n\n if (comparison === 0) {\n return null\n }\n\n const v1Higher = comparison > 0\n const highVersion = v1Higher ? v1 : v2\n const lowVersion = v1Higher ? v2 : v1\n const highHasPre = !!highVersion.prerelease.length\n const lowHasPre = !!lowVersion.prerelease.length\n\n if (lowHasPre && !highHasPre) {\n // Going from prerelease -> no prerelease requires some special casing\n\n // If the low version has only a major, then it will always be a major\n // Some examples:\n // 1.0.0-1 -> 1.0.0\n // 1.0.0-1 -> 1.1.1\n // 1.0.0-1 -> 2.0.0\n if (!lowVersion.patch && !lowVersion.minor) {\n return 'major'\n }\n\n // If the main part has no difference\n if (lowVersion.compareMain(highVersion) === 0) {\n if (lowVersion.minor && !lowVersion.patch) {\n return 'minor'\n }\n return 'patch'\n }\n }\n\n // add the `pre` prefix if we are going to a prerelease version\n const prefix = highHasPre ? 'pre' : ''\n\n if (v1.major !== v2.major) {\n return prefix + 'major'\n }\n\n if (v1.minor !== v2.minor) {\n return prefix + 'minor'\n }\n\n if (v1.patch !== v2.patch) {\n return prefix + 'patch'\n }\n\n // high and low are prereleases\n return 'prerelease'\n}\n\nmodule.exports = diff\n","'use strict'\n\nconst SemVer = require('../classes/semver')\nconst major = (a, loose) => new SemVer(a, loose).major\nmodule.exports = major\n","'use strict'\n\nconst SemVer = require('../classes/semver')\nconst minor = (a, loose) => new SemVer(a, loose).minor\nmodule.exports = minor\n","'use strict'\n\nconst SemVer = require('../classes/semver')\nconst patch = (a, loose) => new SemVer(a, loose).patch\nmodule.exports = patch\n","'use strict'\n\nconst parse = require('./parse')\nconst prerelease = (version, options) => {\n const parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\nmodule.exports = prerelease\n","'use strict'\n\nconst SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","'use strict'\n\nconst compare = require('./compare')\nconst rcompare = (a, b, loose) => compare(b, a, loose)\nmodule.exports = rcompare\n","'use strict'\n\nconst compare = require('./compare')\nconst compareLoose = (a, b) => compare(a, b, true)\nmodule.exports = compareLoose\n","'use strict'\n\nconst SemVer = require('../classes/semver')\nconst compareBuild = (a, b, loose) => {\n const versionA = new SemVer(a, loose)\n const versionB = new SemVer(b, loose)\n return versionA.compare(versionB) || versionA.compareBuild(versionB)\n}\nmodule.exports = compareBuild\n","'use strict'\n\nconst compareBuild = require('./compare-build')\nconst sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))\nmodule.exports = sort\n","'use strict'\n\nconst compareBuild = require('./compare-build')\nconst rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))\nmodule.exports = rsort\n","'use strict'\n\nconst compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","'use strict'\n\nconst compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","'use strict'\n\nconst compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","'use strict'\n\nconst compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","'use strict'\n\nconst compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","'use strict'\n\nconst compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","'use strict'\n\nconst eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a === b\n\n case '!==':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","'use strict'\n\nconst SemVer = require('../classes/semver')\nconst parse = require('./parse')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst coerce = (version, options) => {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n let match = null\n if (!options.rtl) {\n match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]\n let next\n while ((next = coerceRtlRegex.exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n coerceRtlRegex.lastIndex = -1\n }\n\n if (match === null) {\n return null\n }\n\n const major = match[2]\n const minor = match[3] || '0'\n const patch = match[4] || '0'\n const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''\n const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''\n\n return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)\n}\nmodule.exports = coerce\n","'use strict'\n\nconst parse = require('./parse')\nconst constants = require('../internal/constants')\nconst SemVer = require('../classes/semver')\n\nconst truncate = (version, truncation, options) => {\n if (!constants.RELEASE_TYPES.includes(truncation)) {\n return null\n }\n\n const clonedVersion = cloneInputVersion(version, options)\n return clonedVersion && doTruncation(clonedVersion, truncation)\n}\n\nconst cloneInputVersion = (version, options) => {\n const versionStringToParse = (\n version instanceof SemVer ? version.version : version\n )\n\n return parse(versionStringToParse, options)\n}\n\nconst doTruncation = (version, truncation) => {\n if (isPrerelease(truncation)) {\n return version.version\n }\n\n version.prerelease = []\n\n switch (truncation) {\n case 'major':\n version.minor = 0\n version.patch = 0\n break\n case 'minor':\n version.patch = 0\n break\n }\n\n return version.format()\n}\n\nconst isPrerelease = (type) => {\n return type.startsWith('pre')\n}\n\nmodule.exports = truncate\n","'use strict'\n\nclass LRUCache {\n constructor () {\n this.max = 1000\n this.map = new Map()\n }\n\n get (key) {\n const value = this.map.get(key)\n if (value === undefined) {\n return undefined\n } else {\n // Remove the key from the map and add it to the end\n this.map.delete(key)\n this.map.set(key, value)\n return value\n }\n }\n\n delete (key) {\n return this.map.delete(key)\n }\n\n set (key, value) {\n const deleted = this.delete(key)\n\n if (!deleted && value !== undefined) {\n // If cache is full, delete the least recently used item\n if (this.map.size >= this.max) {\n const firstKey = this.map.keys().next().value\n this.delete(firstKey)\n }\n\n this.map.set(key, value)\n }\n\n return this\n }\n}\n\nmodule.exports = LRUCache\n","'use strict'\n\nconst SPACE_CHARACTERS = /\\s+/g\n\n// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.formatted = undefined\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First reduce all whitespace as much as possible so we do not have to rely\n // on potentially slow regexes like \\s*. This is then stored and used for\n // future error messages as well.\n this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')\n\n // First, split on ||\n this.set = this.raw\n .split('||')\n // map the range to a 2d array of comparators\n .map(r => this.parseRange(r.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${this.raw}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0) {\n this.set = [first]\n } else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.formatted = undefined\n }\n\n get range () {\n if (this.formatted === undefined) {\n this.formatted = ''\n for (let i = 0; i < this.set.length; i++) {\n if (i > 0) {\n this.formatted += '||'\n }\n const comps = this.set[i]\n for (let k = 0; k < comps.length; k++) {\n if (k > 0) {\n this.formatted += ' '\n }\n this.formatted += comps[k].toString().trim()\n }\n }\n }\n return this.formatted\n }\n\n format () {\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n // strip build metadata so it can't bleed into the version\n range = range.replace(BUILDSTRIPRE, '')\n\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts =\n (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |\n (this.options.loose && FLAG_LOOSE)\n const memoKey = memoOpts + ':' + range\n const cached = cache.get(memoKey)\n if (cached) {\n return cached\n }\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range)\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n debug('tilde trim', range)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n debug('caret trim', range)\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n let rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n\n if (loose) {\n // in loose mode, throw out any that are not valid comparators\n rangeList = rangeList.filter(comp => {\n debug('loose invalid filter', comp, this.options)\n return !!comp.match(re[t.COMPARATORLOOSE])\n })\n }\n debug('range list', rangeList)\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const rangeMap = new Map()\n const comparators = rangeList.map(comp => new Comparator(comp, this.options))\n for (const comp of comparators) {\n if (isNullSet(comp)) {\n return [comp]\n }\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has('')) {\n rangeMap.delete('')\n }\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\n\nmodule.exports = Range\n\nconst LRU = require('../internal/lrucache')\nconst cache = new LRU()\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n safeRe: re,\n src,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace,\n} = require('../internal/re')\nconst { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')\n\n// unbounded global build-metadata stripper used by parseRange\nconst BUILDSTRIPRE = new RegExp(src[t.BUILD], 'g')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n comp = comp.replace(re[t.BUILD], '')\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\nconst invalidXRangeOrder = (M, m, p) => (\n (isX(M) && !isX(m)) ||\n (isX(m) && p && !isX(p))\n)\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\n// ~0.0.1 --> >=0.0.1 <0.1.0-0\nconst replaceTildes = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceTilde(c, options))\n .join(' ')\n}\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n // if we're including prereleases in the match, then the lower bound is\n // -0, the lowest possible prerelease value, just like x-ranges and carets.\n // this keeps `~1.2` equivalent to the `1.2.x` x-range it's documented as.\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\n// ^0.0.1 --> >=0.0.1 <0.0.2-0\n// ^0.1.0 --> >=0.1.0 <0.2.0-0\nconst replaceCarets = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceCaret(c, options))\n .join(' ')\n}\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp\n .split(/\\s+/)\n .map((c) => replaceXRange(c, options))\n .join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n if (invalidXRangeOrder(M, m, p)) {\n return comp\n }\n\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<') {\n pr = '-0'\n }\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp\n .trim()\n .replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp\n .trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\n// TODO build?\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return `${from} ${to}`.trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n","'use strict'\n\nconst ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n comp = comp.trim().split(/\\s+/).join(' ')\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n options = parseOptions(options)\n\n // Special cases where nothing can possibly be lower\n if (options.includePrerelease &&\n (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {\n return false\n }\n if (!options.includePrerelease &&\n (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {\n return false\n }\n\n // Same direction increasing (> or >=)\n if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {\n return true\n }\n // Same direction decreasing (< or <=)\n if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {\n return true\n }\n // same SemVer and both sides are inclusive (<= or >=)\n if (\n (this.semver.version === comp.semver.version) &&\n this.operator.includes('=') && comp.operator.includes('=')) {\n return true\n }\n // opposite directions less than\n if (cmp(this.semver, '<', comp.semver, options) &&\n this.operator.startsWith('>') && comp.operator.startsWith('<')) {\n return true\n }\n // opposite directions greater than\n if (cmp(this.semver, '>', comp.semver, options) &&\n this.operator.startsWith('<') && comp.operator.startsWith('>')) {\n return true\n }\n return false\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst { safeRe: re, t } = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n","'use strict'\n\nconst Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n","'use strict'\n\nconst Range = require('../classes/range')\n\n// Mostly just for testing and legacy API reasons\nconst toComparators = (range, options) =>\n new Range(range, options).set\n .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))\n\nmodule.exports = toComparators\n","'use strict'\n\nconst SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\n\nconst maxSatisfying = (versions, range, options) => {\n let max = null\n let maxSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\nmodule.exports = maxSatisfying\n","'use strict'\n\nconst SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst minSatisfying = (versions, range, options) => {\n let min = null\n let minSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\nmodule.exports = minSatisfying\n","'use strict'\n\nconst SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst gt = require('../functions/gt')\n\nconst minVersion = (range, loose) => {\n range = new Range(range, loose)\n\n let minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let setMin = null\n comparators.forEach((comparator) => {\n // Clone to avoid manipulating the comparator's semver object.\n const compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!setMin || gt(compver, setMin)) {\n setMin = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error(`Unexpected operation: ${comparator.operator}`)\n }\n })\n if (setMin && (!minver || gt(minver, setMin))) {\n minver = setMin\n }\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\nmodule.exports = minVersion\n","'use strict'\n\nconst Range = require('../classes/range')\nconst validRange = (range, options) => {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\nmodule.exports = validRange\n","'use strict'\n\nconst SemVer = require('../classes/semver')\nconst Comparator = require('../classes/comparator')\nconst { ANY } = Comparator\nconst Range = require('../classes/range')\nconst satisfies = require('../functions/satisfies')\nconst gt = require('../functions/gt')\nconst lt = require('../functions/lt')\nconst lte = require('../functions/lte')\nconst gte = require('../functions/gte')\n\nconst outside = (version, range, hilo, options) => {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n let gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisfies the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let high = null\n let low = null\n\n comparators.forEach((comparator) => {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nmodule.exports = outside\n","'use strict'\n\n// Determine if version is greater than all the versions possible in the range.\nconst outside = require('./outside')\nconst gtr = (version, range, options) => outside(version, range, '>', options)\nmodule.exports = gtr\n","'use strict'\n\nconst outside = require('./outside')\n// Determine if version is less than all the versions possible in the range\nconst ltr = (version, range, options) => outside(version, range, '<', options)\nmodule.exports = ltr\n","'use strict'\n\nconst Range = require('../classes/range')\nconst intersects = (r1, r2, options) => {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2, options)\n}\nmodule.exports = intersects\n","'use strict'\n\n// given a set of versions and a range, create a \"simplified\" range\n// that includes the same versions that the original range does\n// If the original range is shorter than the simplified one, return that.\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\nmodule.exports = (versions, range, options) => {\n const set = []\n let first = null\n let prev = null\n const v = versions.sort((a, b) => compare(a, b, options))\n for (const version of v) {\n const included = satisfies(version, range, options)\n if (included) {\n prev = version\n if (!first) {\n first = version\n }\n } else {\n if (prev) {\n set.push([first, prev])\n }\n prev = null\n first = null\n }\n }\n if (first) {\n set.push([first, null])\n }\n\n const ranges = []\n for (const [min, max] of set) {\n if (min === max) {\n ranges.push(min)\n } else if (!max && min === v[0]) {\n ranges.push('*')\n } else if (!max) {\n ranges.push(`>=${min}`)\n } else if (min === v[0]) {\n ranges.push(`<=${max}`)\n } else {\n ranges.push(`${min} - ${max}`)\n }\n }\n const simplified = ranges.join(' || ')\n const original = typeof range.raw === 'string' ? range.raw : String(range)\n return simplified.length < original.length ? simplified : range\n}\n","'use strict'\n\nconst Range = require('../classes/range.js')\nconst Comparator = require('../classes/comparator.js')\nconst { ANY } = Comparator\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\n\n// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:\n// - Every simple range `r1, r2, ...` is a null set, OR\n// - Every simple range `r1, r2, ...` which is not a null set is a subset of\n// some `R1, R2, ...`\n//\n// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:\n// - If c is only the ANY comparator\n// - If C is only the ANY comparator, return true\n// - Else if in prerelease mode, return false\n// - else replace c with `[>=0.0.0]`\n// - If C is only the ANY comparator\n// - if in prerelease mode, return true\n// - else replace C with `[>=0.0.0]`\n// - Let EQ be the set of = comparators in c\n// - If EQ is more than one, return true (null set)\n// - Let GT be the highest > or >= comparator in c\n// - Let LT be the lowest < or <= comparator in c\n// - If GT and LT, and GT.semver > LT.semver, return true (null set)\n// - If any C is a = range, and GT or LT are set, return false\n// - If EQ\n// - If GT, and EQ does not satisfy GT, return true (null set)\n// - If LT, and EQ does not satisfy LT, return true (null set)\n// - If EQ satisfies every C, return true\n// - Else return false\n// - If GT\n// - If GT.semver is lower than any > or >= comp in C, return false\n// - If GT is >=, and GT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the GT.semver tuple, return false\n// - If LT\n// - If LT.semver is greater than any < or <= comp in C, return false\n// - If LT is <=, and LT.semver does not satisfy every C, return false\n// - If LT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the LT.semver tuple, return false\n// - Else return true\n\nconst subset = (sub, dom, options = {}) => {\n if (sub === dom) {\n return true\n }\n\n sub = new Range(sub, options)\n dom = new Range(dom, options)\n let sawNonNull = false\n\n OUTER: for (const simpleSub of sub.set) {\n for (const simpleDom of dom.set) {\n const isSub = simpleSubset(simpleSub, simpleDom, options)\n sawNonNull = sawNonNull || isSub !== null\n if (isSub) {\n continue OUTER\n }\n }\n // the null set is a subset of everything, but null simple ranges in\n // a complex range should be ignored. so if we saw a non-null range,\n // then we know this isn't a subset, but if EVERY simple range was null,\n // then it is a subset.\n if (sawNonNull) {\n return false\n }\n }\n return true\n}\n\nconst minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]\nconst minimumVersion = [new Comparator('>=0.0.0')]\n\nconst simpleSubset = (sub, dom, options) => {\n if (sub === dom) {\n return true\n }\n\n if (sub.length === 1 && sub[0].semver === ANY) {\n if (dom.length === 1 && dom[0].semver === ANY) {\n return true\n } else if (options.includePrerelease) {\n sub = minimumVersionWithPreRelease\n } else {\n sub = minimumVersion\n }\n }\n\n if (dom.length === 1 && dom[0].semver === ANY) {\n if (options.includePrerelease) {\n return true\n } else {\n dom = minimumVersion\n }\n }\n\n const eqSet = new Set()\n let gt, lt\n for (const c of sub) {\n if (c.operator === '>' || c.operator === '>=') {\n gt = higherGT(gt, c, options)\n } else if (c.operator === '<' || c.operator === '<=') {\n lt = lowerLT(lt, c, options)\n } else {\n eqSet.add(c.semver)\n }\n }\n\n if (eqSet.size > 1) {\n return null\n }\n\n let gtltComp\n if (gt && lt) {\n gtltComp = compare(gt.semver, lt.semver, options)\n if (gtltComp > 0) {\n return null\n } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {\n return null\n }\n }\n\n // will iterate one or zero times\n for (const eq of eqSet) {\n if (gt && !satisfies(eq, String(gt), options)) {\n return null\n }\n\n if (lt && !satisfies(eq, String(lt), options)) {\n return null\n }\n\n for (const c of dom) {\n if (!satisfies(eq, String(c), options)) {\n return false\n }\n }\n\n return true\n }\n\n let higher, lower\n let hasDomLT, hasDomGT\n // if the subset has a prerelease, we need a comparator in the superset\n // with the same tuple and a prerelease, or it's not a subset\n let needDomLTPre = lt &&\n !options.includePrerelease &&\n lt.semver.prerelease.length ? lt.semver : false\n let needDomGTPre = gt &&\n !options.includePrerelease &&\n gt.semver.prerelease.length ? gt.semver : false\n // exception: <1.2.3-0 is the same as <1.2.3\n if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&\n lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {\n needDomLTPre = false\n }\n\n for (const c of dom) {\n hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='\n hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='\n if (gt) {\n if (needDomGTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomGTPre.major &&\n c.semver.minor === needDomGTPre.minor &&\n c.semver.patch === needDomGTPre.patch) {\n needDomGTPre = false\n }\n }\n if (c.operator === '>' || c.operator === '>=') {\n higher = higherGT(gt, c, options)\n if (higher === c && higher !== gt) {\n return false\n }\n } else if (gt.operator === '>=' && !c.test(gt.semver)) {\n return false\n }\n }\n if (lt) {\n if (needDomLTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomLTPre.major &&\n c.semver.minor === needDomLTPre.minor &&\n c.semver.patch === needDomLTPre.patch) {\n needDomLTPre = false\n }\n }\n if (c.operator === '<' || c.operator === '<=') {\n lower = lowerLT(lt, c, options)\n if (lower === c && lower !== lt) {\n return false\n }\n } else if (lt.operator === '<=' && !c.test(lt.semver)) {\n return false\n }\n }\n if (!c.operator && (lt || gt) && gtltComp !== 0) {\n return false\n }\n }\n\n // if there was a < or >, and nothing in the dom, then must be false\n // UNLESS it was limited by another range in the other direction.\n // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0\n if (gt && hasDomLT && !lt && gtltComp !== 0) {\n return false\n }\n\n if (lt && hasDomGT && !gt && gtltComp !== 0) {\n return false\n }\n\n // we needed a prerelease range in a specific tuple, but didn't get one\n // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,\n // because it includes prereleases in the 1.2.3 tuple\n if (needDomGTPre || needDomLTPre) {\n return false\n }\n\n return true\n}\n\n// >=1.2.3 is lower than >1.2.3\nconst higherGT = (a, b, options) => {\n if (!a) {\n return b\n }\n const comp = compare(a.semver, b.semver, options)\n return comp > 0 ? a\n : comp < 0 ? b\n : b.operator === '>' && a.operator === '>=' ? b\n : a\n}\n\n// <=1.2.3 is higher than <1.2.3\nconst lowerLT = (a, b, options) => {\n if (!a) {\n return b\n }\n const comp = compare(a.semver, b.semver, options)\n return comp < 0 ? a\n : comp > 0 ? b\n : b.operator === '<' && a.operator === '<=' ? b\n : a\n}\n\nmodule.exports = subset\n","'use strict'\n\n// just pre-load all the stuff that index.js lazily exports\nconst internalRe = require('./internal/re')\nconst constants = require('./internal/constants')\nconst SemVer = require('./classes/semver')\nconst identifiers = require('./internal/identifiers')\nconst parse = require('./functions/parse')\nconst valid = require('./functions/valid')\nconst clean = require('./functions/clean')\nconst inc = require('./functions/inc')\nconst diff = require('./functions/diff')\nconst major = require('./functions/major')\nconst minor = require('./functions/minor')\nconst patch = require('./functions/patch')\nconst prerelease = require('./functions/prerelease')\nconst compare = require('./functions/compare')\nconst rcompare = require('./functions/rcompare')\nconst compareLoose = require('./functions/compare-loose')\nconst compareBuild = require('./functions/compare-build')\nconst sort = require('./functions/sort')\nconst rsort = require('./functions/rsort')\nconst gt = require('./functions/gt')\nconst lt = require('./functions/lt')\nconst eq = require('./functions/eq')\nconst neq = require('./functions/neq')\nconst gte = require('./functions/gte')\nconst lte = require('./functions/lte')\nconst cmp = require('./functions/cmp')\nconst coerce = require('./functions/coerce')\nconst truncate = require('./functions/truncate')\nconst Comparator = require('./classes/comparator')\nconst Range = require('./classes/range')\nconst satisfies = require('./functions/satisfies')\nconst toComparators = require('./ranges/to-comparators')\nconst maxSatisfying = require('./ranges/max-satisfying')\nconst minSatisfying = require('./ranges/min-satisfying')\nconst minVersion = require('./ranges/min-version')\nconst validRange = require('./ranges/valid')\nconst outside = require('./ranges/outside')\nconst gtr = require('./ranges/gtr')\nconst ltr = require('./ranges/ltr')\nconst intersects = require('./ranges/intersects')\nconst simplifyRange = require('./ranges/simplify')\nconst subset = require('./ranges/subset')\nmodule.exports = {\n parse,\n valid,\n clean,\n inc,\n diff,\n major,\n minor,\n patch,\n prerelease,\n compare,\n rcompare,\n compareLoose,\n compareBuild,\n sort,\n rsort,\n gt,\n lt,\n eq,\n neq,\n gte,\n lte,\n cmp,\n coerce,\n truncate,\n Comparator,\n Range,\n satisfies,\n toComparators,\n maxSatisfying,\n minSatisfying,\n minVersion,\n validRange,\n outside,\n gtr,\n ltr,\n intersects,\n simplifyRange,\n subset,\n SemVer,\n re: internalRe.re,\n src: internalRe.src,\n tokens: internalRe.t,\n SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,\n RELEASE_TYPES: constants.RELEASE_TYPES,\n compareIdentifiers: identifiers.compareIdentifiers,\n rcompareIdentifiers: identifiers.rcompareIdentifiers,\n}\n","import { valid as validSemver } from \"semver\";\nimport { parsePackageName } from \"../pie/utils.js\";\nexport class ElementPackagePolicyError extends Error {\n tagName;\n packageSpec;\n name = \"ElementPackagePolicyError\";\n constructor(tagName, packageSpec, message) {\n super(message);\n this.tagName = tagName;\n this.packageSpec = packageSpec;\n }\n}\nfunction isExactSemver(version) {\n return validSemver(version) === version;\n}\nfunction parsePolicyPackageSpec(spec) {\n const parsed = parsePackageName(spec);\n return {\n packageName: parsed.name,\n packagePath: parsed.path ? `${parsed.name}/${parsed.path}` : parsed.name,\n version: parsed.version,\n };\n}\n/**\n * Validate an element map only when a host explicitly supplies a policy.\n * Omitting the policy preserves the existing trusted-application behavior.\n */\nexport function assertElementPackagesAllowed(elements, policy) {\n if (!policy)\n return;\n const allowed = policy.allowedPackages\n .filter((entry) => typeof entry === \"string\")\n .map((entry) => entry.trim())\n .filter(Boolean);\n for (const [tagName, rawSpec] of Object.entries(elements)) {\n const packageSpec = String(rawSpec).trim();\n let parsed;\n try {\n parsed = parsePolicyPackageSpec(packageSpec);\n }\n catch {\n throw new ElementPackagePolicyError(tagName, packageSpec, `Element package policy rejected invalid package spec \"${packageSpec}\" for ${tagName}.`);\n }\n if ((policy.requireExactVersions ?? true) &&\n !isExactSemver(parsed.version)) {\n const restriction = parsed.version.includes(\"+\")\n ? \"does not allow semver build metadata because legacy IIFE bundle routes use + as a package separator\"\n : \"requires an exact version\";\n throw new ElementPackagePolicyError(tagName, packageSpec, `Element package policy ${restriction} for ${tagName}; received \"${packageSpec}\".`);\n }\n const permitted = allowed.some((entry) => {\n if (entry === packageSpec)\n return true;\n try {\n const allowedSpec = parsePolicyPackageSpec(entry);\n return (allowedSpec.version.length === 0 &&\n allowedSpec.packagePath === parsed.packagePath);\n }\n catch {\n return false;\n }\n });\n if (!permitted) {\n throw new ElementPackagePolicyError(tagName, packageSpec, `Element package policy does not allow \"${packageSpec}\" for ${tagName}.`);\n }\n }\n}\n","/**\n * ElementLoader primitive — the one place where \"these tags are registered\n * with customElements\" is decided.\n *\n * Owns the truthful promise contract end-to-end:\n *\n * ensureRegistered(elements, options) resolves iff every requested tag\n * is in `customElements` at the moment of resolution. On partial\n * success it rejects with an `ElementLoaderError` carrying the set of\n * unregistered tags and a per-tag `RegistrationFailureReason` map.\n *\n * The primitive delegates the actual fetch/register work to a backend\n * adapter (IIFE or ESM) but always verifies the outcome via\n * `customElements.whenDefined`. An adapter cannot silently under-register\n * — the primitive will catch it and surface a timeout reason.\n *\n * See packages/players-shared/tests/element-loader-contract.test.ts for\n * the executable specification of every failure mode this primitive is\n * required to catch.\n */\nimport { DEFAULT_IIFE_BUNDLE_RETRY_CONFIG } from \"../loader-config.js\";\nimport { AdapterFailure, } from \"./element-loader-types.js\";\nimport { createEsmBackend } from \"./esm-adapter.js\";\nimport { createIifeBackend } from \"./iife-adapter.js\";\nimport { assertElementPackagesAllowed, } from \"./element-package-policy.js\";\nexport { AdapterFailure } from \"./element-loader-types.js\";\n/**\n * Aggregate error thrown by `ensureRegistered` when one or more requested\n * tags were not registered by the time verification timed out.\n */\nexport class ElementLoaderError extends Error {\n name = \"ElementLoaderError\";\n unregisteredTags;\n reasons;\n constructor(message, unregisteredTags, reasons) {\n super(message);\n this.unregisteredTags = unregisteredTags;\n this.reasons = reasons;\n }\n}\n/**\n * Thrown by `assertRegistered` when any requested tag is missing from\n * `customElements`. Carries enough detail for the host to diagnose what\n * pre-registration step was skipped.\n */\nexport class ElementAssertionError extends Error {\n name = \"ElementAssertionError\";\n expectedTags;\n missingTags;\n currentlyRegisteredTags;\n constructor(expected, missing, currentlyRegistered) {\n super(buildAssertionMessage(expected, missing, currentlyRegistered));\n this.expectedTags = expected;\n this.missingTags = missing;\n this.currentlyRegisteredTags = currentlyRegistered;\n }\n}\nfunction buildAssertionMessage(expected, missing, registered) {\n const expectedStr = expected.join(\", \");\n const missingStr = missing.join(\", \");\n const registeredStr = registered.length\n ? registered.join(\", \")\n : \"(none enumerable)\";\n return (`ElementLoader.assertRegistered: expected [${expectedStr}], ` +\n `missing [${missingStr}]. customElements contains: [${registeredStr}].`);\n}\nconst DEFAULT_WHEN_DEFINED_TIMEOUT_MS = 5000;\nconst DEFAULT_LOAD_TIMEOUT_MS = DEFAULT_IIFE_BUNDLE_RETRY_CONFIG.timeoutMs;\n// Module-scoped in-flight cache. Key: backend signature + sorted elements.\n// Keeps concurrent identical requests collapsed to one backend call.\nconst inFlightRequests = new Map();\nconst resolvedEsmBackends = new Map();\nconst resolvedBackendOverrides = new Map();\n/**\n * Resolve iff every tag in `elements` is registered with `customElements`.\n * Reject with `ElementLoaderError` otherwise.\n *\n * The primitive is the sole authority on registration state:\n * - Empty element map resolves immediately (no backend call).\n * - Already-registered tags resolve immediately (no backend call).\n * - Concurrent identical requests share one backend call.\n * - After the adapter's `load` settles, a post-load verification pass\n * (bounded `customElements.whenDefined`) checks every tag. Any missing\n * tag becomes a rejection.\n */\nexport async function ensureRegistered(elements, options) {\n if (!elements || Object.keys(elements).length === 0)\n return;\n // Enforce policy before the already-registered fast path: a matching tag in\n // the registry must not turn a disallowed authored package into valid input.\n assertElementPackagesAllowed(elements, options.elementPackagePolicy);\n const tags = Object.keys(elements);\n const timeoutMs = options.whenDefinedTimeoutMs ?? DEFAULT_WHEN_DEFINED_TIMEOUT_MS;\n const loadTimeoutMs = options.loadTimeoutMs ?? DEFAULT_LOAD_TIMEOUT_MS;\n // Fast path: everything already registered. Skip backend and dedup\n // bookkeeping entirely.\n if (allAlreadyRegistered(tags))\n return;\n const dedupKey = buildDedupKey(options.backend, elements);\n const existing = inFlightRequests.get(dedupKey);\n if (existing)\n return existing;\n const backend = resolveBackend(options.backend);\n const doc = resolveDoc(options.doc);\n const promise = runEnsureRegistered(elements, tags, backend, { doc, whenDefinedTimeoutMs: timeoutMs }, timeoutMs, loadTimeoutMs);\n inFlightRequests.set(dedupKey, promise);\n try {\n await promise;\n }\n finally {\n if (inFlightRequests.get(dedupKey) === promise) {\n inFlightRequests.delete(dedupKey);\n }\n }\n}\nasync function runEnsureRegistered(elements, tags, backend, context, timeoutMs, loadTimeoutMs) {\n let adapterError;\n try {\n await raceWithLoadTimeout(backend.load(elements, context), tags, loadTimeoutMs);\n }\n catch (err) {\n adapterError = err instanceof Error ? err : new Error(String(err));\n }\n const verification = await Promise.all(tags.map(async (tag) => {\n if (isRegistered(tag))\n return { tag, ok: true };\n try {\n await whenDefinedWithTimeout(tag, timeoutMs);\n return { tag, ok: true };\n }\n catch {\n return { tag, ok: false };\n }\n }));\n const unregistered = new Set();\n const reasons = new Map();\n for (const v of verification) {\n if (v.ok)\n continue;\n unregistered.add(v.tag);\n const adapterReason = extractAdapterReason(adapterError, v.tag);\n reasons.set(v.tag, adapterReason ?? { kind: \"timeout\", tag: v.tag, timeoutMs });\n }\n if (unregistered.size > 0) {\n throw new ElementLoaderError(`Element registration failed; missing tags: ${[...unregistered].join(\", \")}`, unregistered, reasons);\n }\n}\n/**\n * Race the backend's `load()` against a cumulative deadline.\n *\n * On timeout, synthesize an `AdapterFailure` whose `reasons` map carries\n * a `kind: \"timeout\"` entry per requested tag. The verification pass in\n * `runEnsureRegistered` will then produce a normal `ElementLoaderError`\n * with structured per-tag reasons — same surface shape as any other\n * adapter rejection.\n */\nasync function raceWithLoadTimeout(loadPromise, tags, loadTimeoutMs) {\n let timer;\n try {\n await Promise.race([\n loadPromise,\n new Promise((_, reject) => {\n timer = setTimeout(() => {\n const reasons = new Map();\n for (const tag of tags) {\n reasons.set(tag, {\n kind: \"timeout\",\n tag,\n timeoutMs: loadTimeoutMs,\n });\n }\n reject(new AdapterFailure(reasons));\n }, loadTimeoutMs);\n }),\n ]);\n }\n finally {\n if (timer)\n clearTimeout(timer);\n }\n}\n/**\n * Synchronously assert that every tag is already in `customElements`.\n * Throws `ElementAssertionError` with diagnostic detail otherwise.\n *\n * Used by hosts that opt into the \"preloaded\" strategy — they pre-register\n * elements out-of-band and want a loud failure if anything is missing.\n */\nexport function assertRegistered(tags) {\n if (!tags || tags.length === 0)\n return;\n const missing = tags.filter((tag) => !isRegistered(tag));\n if (missing.length === 0)\n return;\n throw new ElementAssertionError(tags, missing, snapshotRegisteredTags());\n}\n// ─── Internals ───────────────────────────────────────────────────────────────\nfunction resolveBackend(backend) {\n if (isDirectBackend(backend))\n return backend;\n if (\"kind\" in backend) {\n if (backend.kind === \"iife\")\n return createIifeBackend(backend);\n if (backend.kind === \"esm\") {\n const backendKey = backendKeyOf(backend);\n const override = resolvedBackendOverrides.get(backendKey);\n if (override)\n return override;\n const existing = resolvedEsmBackends.get(backendKey);\n if (existing)\n return existing;\n const created = createEsmBackend(backend);\n resolvedEsmBackends.set(backendKey, created);\n return created;\n }\n }\n throw new Error(\"ElementLoader: invalid backend option\");\n}\nfunction isDirectBackend(backend) {\n return (typeof backend.load === \"function\" &&\n !(\"kind\" in backend));\n}\nfunction resolveDoc(doc) {\n if (doc)\n return doc;\n if (typeof document !== \"undefined\")\n return document;\n throw new Error(\"ElementLoader: no Document available; pass options.doc explicitly\");\n}\nfunction buildDedupKey(backend, elements) {\n const backendKey = backendKeyOf(backend);\n const entries = Object.entries(elements).sort(([a], [b]) => a.localeCompare(b));\n return `${backendKey}|${JSON.stringify(entries)}`;\n}\nconst backendIds = new WeakMap();\nlet nextBackendId = 0;\nconst functionIds = new WeakMap();\nlet nextFunctionId = 0;\nconst opaqueObjectIds = new WeakMap();\nlet nextOpaqueObjectId = 0;\nfunction backendKeyOf(backend) {\n if (isDirectBackend(backend)) {\n let id = backendIds.get(backend);\n if (!id) {\n id = `b${++nextBackendId}`;\n backendIds.set(backend, id);\n }\n return `backend#${id}`;\n }\n if (\"kind\" in backend) {\n if (backend.kind === \"iife\") {\n return `iife#${fingerprintValue({\n kind: \"iife\",\n bundleHost: backend.bundleHost,\n bundleType: backend.bundleType ?? \"\",\n needsControllers: backend.needsControllers ?? true,\n bundleInfo: backend.bundleInfo ?? null,\n debugEnabled: backend.debugEnabled ?? null,\n bundleRetry: backend.bundleRetry ?? null,\n onBundleRetryStatus: backend.onBundleRetryStatus ?? null,\n trackPageActions: backend.trackPageActions ?? false,\n instrumentationProvider: backend.instrumentationProvider ?? null,\n })}`;\n }\n if (backend.kind === \"esm\") {\n return `esm#${fingerprintValue({\n kind: \"esm\",\n cdnBaseUrl: backend.cdnBaseUrl,\n cdnProvider: backend.cdnProvider ?? null,\n moduleResolution: backend.moduleResolution ?? \"url\",\n view: backend.view ?? \"delivery\",\n viewConfig: backend.viewConfig ?? null,\n loadControllers: backend.loadControllers ?? true,\n debugEnabled: backend.debugEnabled ?? null,\n trackPageActions: backend.trackPageActions ?? false,\n instrumentationProvider: backend.instrumentationProvider ?? null,\n })}`;\n }\n }\n return \"unknown\";\n}\nfunction fingerprintValue(value) {\n return JSON.stringify(normalizeForFingerprint(value, new Map()));\n}\nfunction normalizeForFingerprint(value, seen) {\n if (value === null || value === undefined)\n return value;\n const primitiveType = typeof value;\n if (primitiveType === \"string\" ||\n primitiveType === \"number\" ||\n primitiveType === \"boolean\") {\n return value;\n }\n if (primitiveType === \"function\") {\n return { __functionRef: getFunctionRefId(value) };\n }\n if (primitiveType !== \"object\") {\n return String(value);\n }\n const objectValue = value;\n const existing = seen.get(objectValue);\n if (existing)\n return { __cycleRef: existing };\n const cycleRefId = `cycle#${seen.size + 1}`;\n seen.set(objectValue, cycleRefId);\n if (Array.isArray(value)) {\n return value.map((entry) => normalizeForFingerprint(entry, seen));\n }\n if (!isPlainObject(value)) {\n return { __objectRef: getOpaqueObjectRefId(objectValue) };\n }\n const normalized = {};\n for (const key of Object.keys(value).sort()) {\n normalized[key] = normalizeForFingerprint(value[key], seen);\n }\n return normalized;\n}\nfunction isPlainObject(value) {\n if (!value || typeof value !== \"object\")\n return false;\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\nfunction getFunctionRefId(fn) {\n let id = functionIds.get(fn);\n if (!id) {\n id = `fn#${++nextFunctionId}`;\n functionIds.set(fn, id);\n }\n return id;\n}\nfunction getOpaqueObjectRefId(value) {\n let id = opaqueObjectIds.get(value);\n if (!id) {\n id = `obj#${++nextOpaqueObjectId}`;\n opaqueObjectIds.set(value, id);\n }\n return id;\n}\nfunction allAlreadyRegistered(tags) {\n return tags.every((tag) => isRegistered(tag));\n}\nfunction isRegistered(tag) {\n if (typeof customElements === \"undefined\")\n return false;\n return customElements.get(tag) !== undefined;\n}\nasync function whenDefinedWithTimeout(tag, timeoutMs) {\n if (typeof customElements === \"undefined\") {\n throw new Error(`no customElements to await ${tag}`);\n }\n let timer;\n try {\n return await Promise.race([\n customElements.whenDefined(tag).then(() => undefined),\n new Promise((_, reject) => {\n timer = setTimeout(() => reject(new Error(`Timeout waiting for ${tag}`)), timeoutMs);\n }),\n ]);\n }\n finally {\n if (timer)\n clearTimeout(timer);\n }\n}\nfunction snapshotRegisteredTags() {\n if (typeof customElements === \"undefined\")\n return [];\n // Standard `CustomElementRegistry` does not expose iteration. Tests install\n // a scripted registry with a `__pieSnapshot` extension to make diagnostic\n // messages assertable. Production falls through to an empty list —\n // still strictly better than today's \"missing tags: X\" error which leaks\n // no registry state at all.\n const reg = customElements;\n if (typeof reg.__pieSnapshot === \"function\") {\n try {\n return reg.__pieSnapshot();\n }\n catch {\n return [];\n }\n }\n return [];\n}\nfunction extractAdapterReason(err, tag) {\n if (!err)\n return undefined;\n if (err instanceof AdapterFailure)\n return err.reasons.get(tag);\n return { kind: \"backend-rejected\", tag, cause: err.message };\n}\n// ─── Test-only helpers ───────────────────────────────────────────────────────\n/**\n * Internal helpers for test harnesses. Not part of the public runtime API;\n * production code should never reach for these.\n *\n * @internal\n */\nexport const __testing = {\n resetDedupState() {\n inFlightRequests.clear();\n resolvedEsmBackends.clear();\n resolvedBackendOverrides.clear();\n },\n inFlightCount() {\n return inFlightRequests.size;\n },\n dedupKeyFor(elements, backend) {\n return buildDedupKey(backend, elements);\n },\n replaceResolvedBackendForTesting(backend, resolvedBackend) {\n resolvedBackendOverrides.set(backendKeyOf(backend), resolvedBackend);\n },\n restoreResolvedBackendsForTesting() {\n resolvedEsmBackends.clear();\n resolvedBackendOverrides.clear();\n },\n};\n","/**\n * Selector for elements that are commonly keyboard-focusable in assessment UI.\n * Kept in sync with `focus-trap.ts` for consistent tab-order surfaces.\n */\nexport const FOCUSABLE_SELECTOR = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled]):not([type='hidden'])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n \"[contenteditable]:not([contenteditable='false'])\",\n \"[tabindex]:not([tabindex='-1'])\",\n].join(\",\");\n/**\n * Whether `el` is a reasonable programmatic focus target (matches selector,\n * not disabled, not inside `inert`, and has a layout box).\n */\nexport function isProgrammaticFocusTarget(el) {\n if (!el.matches(FOCUSABLE_SELECTOR))\n return false;\n if (el.hasAttribute(\"disabled\"))\n return false;\n if (el.closest(\"[inert]\"))\n return false;\n return el.offsetParent !== null || el.getClientRects().length > 0;\n}\n/**\n * Whether `el` is in the sequential tab order.\n *\n * Stricter than {@link isProgrammaticFocusTarget}, which deliberately accepts\n * `tabindex=\"-1\"`: such an element is a valid `focus()` target — a roving-tabindex\n * control or a landmark focused after a view change — but is explicitly not tabbable.\n * A tab order that included it would stop on elements the browser skips.\n */\nexport function isTabbable(el) {\n if (el.getAttribute(\"tabindex\") === \"-1\")\n return false;\n return isProgrammaticFocusTarget(el);\n}\n/**\n * Focusable descendants of `root` in tab order, descending into open shadow roots.\n *\n * `querySelectorAll` stops at a shadow boundary, which makes it the wrong tool for\n * collecting a tab order in this codebase: every tool renders into `shadow: \"open\"`,\n * so a container holding one has focusable content the selector cannot see. A focus\n * trap built on the flat query traps Tab in the host's own chrome and never reaches\n * the tool — the tool's controls are then unreachable by keyboard entirely.\n *\n * Closed shadow roots are invisible to script and are skipped; nothing can be done\n * for them from outside.\n */\nexport function collectFocusable(root) {\n const found = [];\n const visit = (node) => {\n for (const child of Array.from(node.children)) {\n if (!(child instanceof HTMLElement))\n continue;\n // `inert` and its subtree take no focus, so there is nothing below to collect.\n if (child.hasAttribute(\"inert\"))\n continue;\n if (isTabbable(child))\n found.push(child);\n // A shadow host's own light children are slotted into its shadow tree, so the\n // shadow root is where tab order continues.\n if (child.shadowRoot)\n visit(child.shadowRoot);\n else\n visit(child);\n }\n };\n visit(root);\n return found;\n}\n","import { collectFocusable } from \"./first-focusable.js\";\n/**\n * Shadow-aware: a trapped panel almost always hosts a custom element rendering into\n * `shadow: \"open\"`, and a flat `querySelectorAll` would collect only the panel's own\n * chrome — trapping Tab there and leaving the hosted tool's controls unreachable.\n */\nfunction getFocusableElements(container) {\n return collectFocusable(container);\n}\nfunction getDeepActiveElement(root) {\n let active = root.activeElement;\n while (active?.shadowRoot?.activeElement) {\n active = active.shadowRoot.activeElement;\n }\n return active;\n}\nfunction focusInitialTarget(container, initialFocus) {\n try {\n if (initialFocus && container.contains(initialFocus)) {\n initialFocus.focus();\n return;\n }\n const focusable = getFocusableElements(container);\n if (focusable.length > 0) {\n focusable[0].focus();\n return;\n }\n container.focus?.();\n }\n catch {\n // ignore\n }\n}\n/**\n * Focus trap helper for floating dialogs/panels.\n *\n * Keeps tab navigation contained, supports Escape callback,\n * and restores prior focus when the trap is removed.\n */\nexport function createFocusTrap(container, options = {}) {\n const prev = typeof document !== \"undefined\"\n ? getDeepActiveElement(document)\n : null;\n const wrap = options.wrap ?? true;\n const onKeydown = (event) => {\n if (event.key === \"Escape\") {\n options.onEscape?.();\n return;\n }\n if (event.key !== \"Tab\")\n return;\n const focusable = getFocusableElements(container);\n if (!focusable.length) {\n if (!wrap)\n return;\n event.preventDefault();\n container.focus?.();\n return;\n }\n const current = getDeepActiveElement(container.getRootNode() instanceof ShadowRoot\n ? container.getRootNode()\n : document);\n const currentIndex = focusable.indexOf(current || focusable[0]);\n if (event.shiftKey) {\n if (currentIndex <= 0) {\n if (wrap) {\n event.preventDefault();\n focusable[focusable.length - 1].focus();\n }\n else {\n options.onTabExit?.(\"backward\", event);\n }\n }\n return;\n }\n if (currentIndex === focusable.length - 1) {\n if (wrap) {\n event.preventDefault();\n focusable[0].focus();\n }\n else {\n options.onTabExit?.(\"forward\", event);\n }\n }\n };\n queueMicrotask(() => focusInitialTarget(container, options.initialFocus));\n container.addEventListener(\"keydown\", onKeydown);\n return () => {\n container.removeEventListener(\"keydown\", onKeydown);\n try {\n prev?.focus?.();\n }\n catch {\n // ignore\n }\n };\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55],"mappings":";;;;AAyBA,IAAM,IAAO;CAET,QAAQ;EACJ,OAAO;EACP,QAAQ;EACR,MAAM;EACN,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;EACN,UAAU;EACV,QAAQ;EACR,UAAU;EACV,QAAQ;EACR,KAAK;EACL,IAAI;EACJ,IAAI;EACJ,KAAK;EACL,KAAK;EACL,MAAM;EACN,KAAK;EACL,MAAM;EACN,SAAS;EACT,OAAO;EACP,UAAU;EACV,UAAU;EACV,OAAO;EACP,SAAS;EACT,QAAQ;EACR,SAAS;EACT,UAAU;EACV,OAAO;EACP,SAAS;EACT,UAAU;EACV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S,EAAO,iqBAwHtB,CAAC,GACK,KAAQ,EAAO,sYAgDrB,CAAC,GACK,KAAa,EAAO;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC,GACK,KAAgB,EAAO;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC,GACK,KAAW,EAAO,qOA+BxB,CAAC,GACK,KAAmB,EAAO;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC,GACK,KAAO,EAAO,CAAC,OAAO,CAAC,GACvB,KAAO,EAAO,u8BAuHpB,CAAC,GACK,KAAM,EAAO,g3DAiMnB,CAAC,GACK,KAAS,EAAO,shBAuDtB,CAAC,GACK,KAAM,EAAO;CAClB;CACA;CACA;CACA;CACA;AACD,CAAC,GACK,KAAgB,EAAK,uBAAuB,GAC5C,KAAW,EAAK,uBAAuB,GACvC,KAAc,EAAK,aAAa,GAChC,KAAY,EAAK,8BAA8B,GAC/C,KAAY,EAAK,gBAAgB,GACjC,KAAiB,EAAK,kGAAkG,GACxH,KAAoB,EAAK,uBAAuB,GAChD,KAAkB,EAAK,6DAA6D,GACpF,KAAe,EAAK,SAAS,GAC7B,KAAiB,EAAK,0BAA0B,GAChD,KAAuB,EAAK,UAAU,GACtC,KAAuB,EAAK,SAAS,GACrC,KAAqB,EAAK,6BAA6B,GACvD,KAAmB,EAAK,MAAM,GAC9B,IAAY;CACjB,SAAS;CACT,WAAW;CACX,MAAM;CACN,cAAc;CACd,iBAAiB;CACjB,YAAY;CACZ,uBAAuB;CACvB,SAAS;CACT,UAAU;CACV,cAAc;CACd,kBAAkB;CAClB,UAAU;AACX,GACM,KAA6B;CAClC;CACA;CACA;C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