@iblai/web-containers 1.73.0 → 1.74.0

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 (281) hide show
  1. package/dist/cjs/_virtual/index2.js +2 -2
  2. package/dist/cjs/_virtual/index3.js +2 -2
  3. package/dist/cjs/components/activity-tab/activity-empty-state.js +2 -2
  4. package/dist/cjs/components/activity-tab/activity-empty-state.js.map +1 -1
  5. package/dist/cjs/components/canvas/canvas-rich-text-editor.js +8 -8
  6. package/dist/cjs/components/canvas/tiptap-math-extension.js +1 -1
  7. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js +2 -2
  8. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js.map +1 -1
  9. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js +5 -5
  10. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js.map +1 -1
  11. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js +7 -6
  12. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js.map +1 -1
  13. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js +50 -42
  14. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js.map +1 -1
  15. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/index.js +64 -33
  16. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/index.js.map +1 -1
  17. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/labels.js +68 -46
  18. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/labels.js.map +1 -1
  19. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js +13 -6
  20. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js.map +1 -1
  21. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js +16 -7
  22. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js.map +1 -1
  23. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/utils.js +14 -0
  24. package/dist/cjs/components/modals/edit-mentor-modal/tabs/evaluation-tab/utils.js.map +1 -1
  25. package/dist/cjs/components/modals/edit-mentor-modal/tabs/human-support-tab/use-support-tickets-with-pagination.js +1 -1
  26. package/dist/cjs/components/modals/edit-mentor-modal/tabs/skills-tab/index.js +1 -1
  27. package/dist/cjs/components/modals/edit-mentor-modal/tabs/tasks-tab/tasks-tab-content.js +1 -1
  28. package/dist/cjs/components/modals/edit-mentor-modal/tabs/tasks-tab/tasks-tab-toolbar.js +1 -1
  29. package/dist/cjs/components/modals/edit-mentor-modal/tabs/tasks-tab.js +1 -1
  30. package/dist/cjs/components/modals/user-profile-modal.js +1 -1
  31. package/dist/cjs/components/platform-sidebar/index.js +2 -0
  32. package/dist/cjs/components/platform-sidebar/index.js.map +1 -1
  33. package/dist/cjs/components/profile/benchmarks/add-items-modal.js +25 -90
  34. package/dist/cjs/components/profile/benchmarks/add-items-modal.js.map +1 -1
  35. package/dist/cjs/components/profile/benchmarks/benchmark-items-modal.js +27 -6
  36. package/dist/cjs/components/profile/benchmarks/benchmark-items-modal.js.map +1 -1
  37. package/dist/cjs/components/profile/benchmarks/create-benchmark-modal.js +164 -18
  38. package/dist/cjs/components/profile/benchmarks/create-benchmark-modal.js.map +1 -1
  39. package/dist/cjs/components/profile/benchmarks/delete-item-confirm.js +9 -8
  40. package/dist/cjs/components/profile/benchmarks/delete-item-confirm.js.map +1 -1
  41. package/dist/cjs/components/profile/benchmarks/evals-ui.js +43 -0
  42. package/dist/cjs/components/profile/benchmarks/evals-ui.js.map +1 -0
  43. package/dist/cjs/components/profile/benchmarks/index.js +29 -10
  44. package/dist/cjs/components/profile/benchmarks/index.js.map +1 -1
  45. package/dist/cjs/components/profile/benchmarks/qa-form.js +236 -0
  46. package/dist/cjs/components/profile/benchmarks/qa-form.js.map +1 -0
  47. package/dist/cjs/components/rich-text-editor.js +33 -12
  48. package/dist/cjs/components/rich-text-editor.js.map +1 -1
  49. package/dist/cjs/components/summernote-text-editor.js +1 -1
  50. package/dist/cjs/components/workflows/workflow-editor.js +28 -8
  51. package/dist/cjs/components/workflows/workflow-editor.js.map +1 -1
  52. package/dist/cjs/i18n/messages/en.json.js +100 -74
  53. package/dist/cjs/i18n/messages/en.json.js.map +1 -1
  54. package/dist/cjs/i18n/messages/es.json.js +81 -55
  55. package/dist/cjs/i18n/messages/es.json.js.map +1 -1
  56. package/dist/cjs/i18n/messages/fr.json.js +82 -56
  57. package/dist/cjs/i18n/messages/fr.json.js.map +1 -1
  58. package/dist/cjs/i18n/messages/zh.json.js +71 -45
  59. package/dist/cjs/i18n/messages/zh.json.js.map +1 -1
  60. package/dist/cjs/index.js +1 -1
  61. package/dist/cjs/lib/sanitize-html.js +1 -1
  62. package/dist/cjs/lib/utils.js +1 -1
  63. package/dist/cjs/node_modules/.pnpm/@tiptap_core@3.34.0_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/index.js +6650 -0
  64. package/dist/cjs/node_modules/.pnpm/@tiptap_core@3.34.0_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/index.js.map +1 -0
  65. package/dist/cjs/node_modules/.pnpm/@tiptap_core@3.34.0_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +59 -0
  66. package/dist/cjs/node_modules/.pnpm/@tiptap_core@3.34.0_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +1 -0
  67. package/dist/cjs/node_modules/.pnpm/@tiptap_core@3.34.0_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js +16 -0
  68. package/dist/cjs/node_modules/.pnpm/@tiptap_core@3.34.0_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js.map +1 -0
  69. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-blockquote@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-blockquote@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-blockquote/dist/index.js +2 -2
  70. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-blockquote@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-blockquote@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-blockquote/dist/index.js.map +1 -1
  71. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-bold@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-bold@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-bold/dist/index.js +2 -2
  72. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-bold@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-bold@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-bold/dist/index.js.map +1 -1
  73. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-code-block@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-code-block@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-code-block/dist/index.js +1 -1
  74. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-code-block@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-code-block@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-code-block/dist/index.js.map +1 -1
  75. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-code@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-code@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-code/dist/index.js +1 -1
  76. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-code@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-code@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-code/dist/index.js.map +1 -1
  77. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-document@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-document@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-document/dist/index.js +1 -1
  78. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-document@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-document@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-document/dist/index.js.map +1 -1
  79. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-hard-break@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-hard-break@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-hard-break/dist/index.js +1 -1
  80. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-hard-break@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-hard-break@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-hard-break/dist/index.js.map +1 -1
  81. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-heading@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-heading@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-heading/dist/index.js +1 -1
  82. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-heading@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-heading@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-heading/dist/index.js.map +1 -1
  83. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-horizontal-rule@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-horizontal-rule@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +1 -1
  84. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-horizontal-rule@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-horizontal-rule@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +1 -1
  85. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-image@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-image@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-image/dist/index.js +1 -1
  86. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-image@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-image@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-image/dist/index.js.map +1 -1
  87. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-italic@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-italic@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-italic/dist/index.js +1 -1
  88. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-italic@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-italic@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-italic/dist/index.js.map +1 -1
  89. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-link@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-link@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-link/dist/index.js +1 -1
  90. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-link@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-link@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-link/dist/index.js.map +1 -1
  91. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-list@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-list@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-list/dist/index.js +1 -1
  92. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-list@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-list@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-list/dist/index.js.map +1 -1
  93. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-paragraph@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-paragraph@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-paragraph/dist/index.js +1 -1
  94. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-paragraph@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-paragraph@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-paragraph/dist/index.js.map +1 -1
  95. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-placeholder@3.20.4_@tiptap_extensions@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4_ → @tiptap_extension-placeholder@3.20.4_@tiptap_extensions@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-placeholder/dist/index.js +1 -1
  96. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-placeholder@3.20.4_@tiptap_extensions@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4_ → @tiptap_extension-placeholder@3.20.4_@tiptap_extensions@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-placeholder/dist/index.js.map +1 -1
  97. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-strike@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-strike@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-strike/dist/index.js +1 -1
  98. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-strike@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-strike@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-strike/dist/index.js.map +1 -1
  99. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-table-cell@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.20.4__e5a3c3ff8b554aab527bcd6db879f930 → @tiptap_extension-table-cell@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.34.0__9df690ad40c269aaedbdba7ccdf2b3c5}/node_modules/@tiptap/extension-table-cell/dist/index.js +1 -1
  100. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-table-cell@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.20.4__e5a3c3ff8b554aab527bcd6db879f930 → @tiptap_extension-table-cell@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.34.0__9df690ad40c269aaedbdba7ccdf2b3c5}/node_modules/@tiptap/extension-table-cell/dist/index.js.map +1 -1
  101. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-table-header@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.20._c6a57e4e630f72502685143ac4e5ec96 → @tiptap_extension-table-header@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.34._e738836bb39716a2c7e36c23583c8027}/node_modules/@tiptap/extension-table-header/dist/index.js +1 -1
  102. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-table-header@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.20._c6a57e4e630f72502685143ac4e5ec96 → @tiptap_extension-table-header@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.34._e738836bb39716a2c7e36c23583c8027}/node_modules/@tiptap/extension-table-header/dist/index.js.map +1 -1
  103. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-table-row@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.20.4_@_65ee6090c5cc8114f0f28fc8fa71a1d1 → @tiptap_extension-table-row@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.34.0_@_5ee469de7f353d0b0b7ac18cdf819cfe}/node_modules/@tiptap/extension-table-row/dist/index.js +1 -1
  104. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-table-row@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.20.4_@_65ee6090c5cc8114f0f28fc8fa71a1d1 → @tiptap_extension-table-row@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.34.0_@_5ee469de7f353d0b0b7ac18cdf819cfe}/node_modules/@tiptap/extension-table-row/dist/index.js.map +1 -1
  105. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-table@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-table@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-table/dist/index.js +1 -1
  106. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-table@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-table@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-table/dist/index.js.map +1 -1
  107. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-text-align@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-text-align@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-text-align/dist/index.js +1 -1
  108. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-text-align@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-text-align@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-text-align/dist/index.js.map +1 -1
  109. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-text-style@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-text-style@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-text-style/dist/index.js +1 -1
  110. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-text-style@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-text-style@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-text-style/dist/index.js.map +1 -1
  111. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-text@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-text@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-text/dist/index.js +1 -1
  112. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-text@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-text@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-text/dist/index.js.map +1 -1
  113. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-underline@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-underline@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-underline/dist/index.js +1 -1
  114. package/dist/cjs/node_modules/.pnpm/{@tiptap_extension-underline@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-underline@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-underline/dist/index.js.map +1 -1
  115. package/dist/cjs/node_modules/.pnpm/{@tiptap_extensions@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extensions@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extensions/dist/index.js +1 -1
  116. package/dist/cjs/node_modules/.pnpm/{@tiptap_extensions@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extensions@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extensions/dist/index.js.map +1 -1
  117. package/dist/cjs/node_modules/.pnpm/{@tiptap_react@3.14.0_@floating-ui_dom@1.7.6_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tip_17d91a0ec98b7b4802004f8a5d3f7d72 → @tiptap_react@3.14.0_@floating-ui_dom@1.7.6_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tip_3f15bb542eb86077efc89f6845872e48}/node_modules/@tiptap/react/dist/index.js +5 -8
  118. package/dist/cjs/node_modules/.pnpm/{@tiptap_react@3.14.0_@floating-ui_dom@1.7.6_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tip_17d91a0ec98b7b4802004f8a5d3f7d72 → @tiptap_react@3.14.0_@floating-ui_dom@1.7.6_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tip_3f15bb542eb86077efc89f6845872e48}/node_modules/@tiptap/react/dist/index.js.map +1 -1
  119. package/dist/cjs/node_modules/.pnpm/@tiptap_starter-kit@3.14.0/node_modules/@tiptap/starter-kit/dist/index.js +17 -17
  120. package/dist/cjs/node_modules/.pnpm/css-mediaquery@0.1.2/node_modules/css-mediaquery/index.js +1 -1
  121. package/dist/cjs/node_modules/.pnpm/dompurify@3.4.18/node_modules/dompurify/dist/purify.es.js +2403 -0
  122. package/dist/cjs/node_modules/.pnpm/dompurify@3.4.18/node_modules/dompurify/dist/purify.es.js.map +1 -0
  123. package/dist/cjs/node_modules/.pnpm/matchmediaquery@0.4.2/node_modules/matchmediaquery/index.js +1 -1
  124. package/dist/cjs/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +1 -1
  125. package/dist/cjs/node_modules/.pnpm/prosemirror-commands@1.7.1/node_modules/prosemirror-commands/dist/index.js +47 -47
  126. package/dist/cjs/node_modules/.pnpm/prosemirror-commands@1.7.1/node_modules/prosemirror-commands/dist/index.js.map +1 -1
  127. package/dist/cjs/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.js +9 -0
  128. package/dist/cjs/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.js.map +1 -1
  129. package/dist/cjs/web-containers/tsconfig.build.tsbuildinfo +1 -1
  130. package/dist/esm/_virtual/index2.js +2 -2
  131. package/dist/esm/_virtual/index3.js +2 -2
  132. package/dist/esm/components/activity-tab/activity-empty-state.js +2 -2
  133. package/dist/esm/components/activity-tab/activity-empty-state.js.map +1 -1
  134. package/dist/esm/components/canvas/canvas-rich-text-editor.js +8 -8
  135. package/dist/esm/components/canvas/tiptap-math-extension.js +3 -3
  136. package/dist/esm/components/canvas/tiptap-math-extension.js.map +1 -1
  137. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js +2 -2
  138. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js.map +1 -1
  139. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js +6 -6
  140. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js.map +1 -1
  141. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js +7 -6
  142. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js.map +1 -1
  143. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js +51 -43
  144. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js.map +1 -1
  145. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/index.js +68 -37
  146. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/index.js.map +1 -1
  147. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/labels.js +68 -46
  148. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/labels.js.map +1 -1
  149. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js +13 -6
  150. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js.map +1 -1
  151. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js +16 -7
  152. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js.map +1 -1
  153. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/utils.js +14 -1
  154. package/dist/esm/components/modals/edit-mentor-modal/tabs/evaluation-tab/utils.js.map +1 -1
  155. package/dist/esm/components/modals/edit-mentor-modal/tabs/human-support-tab/use-support-tickets-with-pagination.js +1 -1
  156. package/dist/esm/components/modals/edit-mentor-modal/tabs/skills-tab/index.js +1 -1
  157. package/dist/esm/components/modals/edit-mentor-modal/tabs/tasks-tab/tasks-tab-content.js +1 -1
  158. package/dist/esm/components/modals/edit-mentor-modal/tabs/tasks-tab/tasks-tab-toolbar.js +1 -1
  159. package/dist/esm/components/modals/edit-mentor-modal/tabs/tasks-tab.js +1 -1
  160. package/dist/esm/components/modals/user-profile-modal.js +1 -1
  161. package/dist/esm/components/platform-sidebar/index.js +2 -0
  162. package/dist/esm/components/platform-sidebar/index.js.map +1 -1
  163. package/dist/esm/components/profile/benchmarks/add-items-modal.js +26 -91
  164. package/dist/esm/components/profile/benchmarks/add-items-modal.js.map +1 -1
  165. package/dist/esm/components/profile/benchmarks/benchmark-items-modal.js +28 -7
  166. package/dist/esm/components/profile/benchmarks/benchmark-items-modal.js.map +1 -1
  167. package/dist/esm/components/profile/benchmarks/create-benchmark-modal.js +166 -20
  168. package/dist/esm/components/profile/benchmarks/create-benchmark-modal.js.map +1 -1
  169. package/dist/esm/components/profile/benchmarks/delete-item-confirm.js +10 -9
  170. package/dist/esm/components/profile/benchmarks/delete-item-confirm.js.map +1 -1
  171. package/dist/esm/components/profile/benchmarks/evals-ui.js +39 -0
  172. package/dist/esm/components/profile/benchmarks/evals-ui.js.map +1 -0
  173. package/dist/esm/components/profile/benchmarks/index.js +30 -11
  174. package/dist/esm/components/profile/benchmarks/index.js.map +1 -1
  175. package/dist/esm/components/profile/benchmarks/qa-form.js +233 -0
  176. package/dist/esm/components/profile/benchmarks/qa-form.js.map +1 -0
  177. package/dist/esm/components/rich-text-editor.js +37 -16
  178. package/dist/esm/components/rich-text-editor.js.map +1 -1
  179. package/dist/esm/components/summernote-text-editor.js +2 -2
  180. package/dist/esm/components/summernote-text-editor.js.map +1 -1
  181. package/dist/esm/components/workflows/workflow-editor.js +28 -8
  182. package/dist/esm/components/workflows/workflow-editor.js.map +1 -1
  183. package/dist/esm/i18n/messages/en.json.js +100 -74
  184. package/dist/esm/i18n/messages/en.json.js.map +1 -1
  185. package/dist/esm/i18n/messages/es.json.js +81 -55
  186. package/dist/esm/i18n/messages/es.json.js.map +1 -1
  187. package/dist/esm/i18n/messages/fr.json.js +82 -56
  188. package/dist/esm/i18n/messages/fr.json.js.map +1 -1
  189. package/dist/esm/i18n/messages/zh.json.js +71 -45
  190. package/dist/esm/i18n/messages/zh.json.js.map +1 -1
  191. package/dist/esm/index.js +1 -1
  192. package/dist/esm/lib/sanitize-html.js +2 -2
  193. package/dist/esm/lib/sanitize-html.js.map +1 -1
  194. package/dist/esm/lib/utils.js +1 -1
  195. package/dist/esm/node_modules/.pnpm/@tiptap_core@3.34.0_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/index.js +6554 -0
  196. package/dist/esm/node_modules/.pnpm/@tiptap_core@3.34.0_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/index.js.map +1 -0
  197. package/dist/esm/node_modules/.pnpm/@tiptap_core@3.34.0_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +55 -0
  198. package/dist/esm/node_modules/.pnpm/@tiptap_core@3.34.0_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +1 -0
  199. package/dist/esm/node_modules/.pnpm/@tiptap_core@3.34.0_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js +14 -0
  200. package/dist/esm/node_modules/.pnpm/@tiptap_core@3.34.0_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js.map +1 -0
  201. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-blockquote@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-blockquote@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-blockquote/dist/index.js +3 -3
  202. package/dist/esm/node_modules/.pnpm/@tiptap_extension-blockquote@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_/node_modules/@tiptap/extension-blockquote/dist/index.js.map +1 -0
  203. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-bold@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-bold@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-bold/dist/index.js +2 -2
  204. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-bold@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-bold@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-bold/dist/index.js.map +1 -1
  205. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-code-block@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-code-block@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-code-block/dist/index.js +2 -2
  206. package/dist/esm/node_modules/.pnpm/@tiptap_extension-code-block@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4/node_modules/@tiptap/extension-code-block/dist/index.js.map +1 -0
  207. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-code@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-code@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-code/dist/index.js +1 -1
  208. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-code@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-code@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-code/dist/index.js.map +1 -1
  209. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-document@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-document@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-document/dist/index.js +2 -2
  210. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-document@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-document@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-document/dist/index.js.map +1 -1
  211. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-hard-break@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-hard-break@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-hard-break/dist/index.js +2 -2
  212. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-hard-break@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-hard-break@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-hard-break/dist/index.js.map +1 -1
  213. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-heading@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-heading@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-heading/dist/index.js +2 -2
  214. package/dist/esm/node_modules/.pnpm/@tiptap_extension-heading@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_/node_modules/@tiptap/extension-heading/dist/index.js.map +1 -0
  215. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-horizontal-rule@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-horizontal-rule@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +2 -2
  216. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-horizontal-rule@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-horizontal-rule@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +1 -1
  217. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-image@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-image@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-image/dist/index.js +2 -2
  218. package/dist/esm/node_modules/.pnpm/@tiptap_extension-image@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_/node_modules/@tiptap/extension-image/dist/index.js.map +1 -0
  219. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-italic@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-italic@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-italic/dist/index.js +1 -1
  220. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-italic@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-italic@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-italic/dist/index.js.map +1 -1
  221. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-link@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-link@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-link/dist/index.js +1 -1
  222. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-link@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-link@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-link/dist/index.js.map +1 -1
  223. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-list@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-list@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-list/dist/index.js +6 -6
  224. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-list@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-list@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-list/dist/index.js.map +1 -1
  225. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-paragraph@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-paragraph@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-paragraph/dist/index.js +2 -2
  226. package/dist/esm/node_modules/.pnpm/@tiptap_extension-paragraph@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_/node_modules/@tiptap/extension-paragraph/dist/index.js.map +1 -0
  227. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-placeholder@3.20.4_@tiptap_extensions@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4_ → @tiptap_extension-placeholder@3.20.4_@tiptap_extensions@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-placeholder/dist/index.js +1 -1
  228. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-placeholder@3.20.4_@tiptap_extensions@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4_ → @tiptap_extension-placeholder@3.20.4_@tiptap_extensions@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-placeholder/dist/index.js.map +1 -1
  229. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-strike@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-strike@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-strike/dist/index.js +1 -1
  230. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-strike@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-strike@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-strike/dist/index.js.map +1 -1
  231. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-table-cell@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.20.4__e5a3c3ff8b554aab527bcd6db879f930 → @tiptap_extension-table-cell@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.34.0__9df690ad40c269aaedbdba7ccdf2b3c5}/node_modules/@tiptap/extension-table-cell/dist/index.js +1 -1
  232. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-table-cell@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.20.4__e5a3c3ff8b554aab527bcd6db879f930 → @tiptap_extension-table-cell@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.34.0__9df690ad40c269aaedbdba7ccdf2b3c5}/node_modules/@tiptap/extension-table-cell/dist/index.js.map +1 -1
  233. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-table-header@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.20._c6a57e4e630f72502685143ac4e5ec96 → @tiptap_extension-table-header@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.34._e738836bb39716a2c7e36c23583c8027}/node_modules/@tiptap/extension-table-header/dist/index.js +1 -1
  234. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-table-header@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.20._c6a57e4e630f72502685143ac4e5ec96 → @tiptap_extension-table-header@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.34._e738836bb39716a2c7e36c23583c8027}/node_modules/@tiptap/extension-table-header/dist/index.js.map +1 -1
  235. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-table-row@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.20.4_@_65ee6090c5cc8114f0f28fc8fa71a1d1 → @tiptap_extension-table-row@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.34.0_@_5ee469de7f353d0b0b7ac18cdf819cfe}/node_modules/@tiptap/extension-table-row/dist/index.js +1 -1
  236. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-table-row@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.20.4_@_65ee6090c5cc8114f0f28fc8fa71a1d1 → @tiptap_extension-table-row@3.20.4_@tiptap_extension-table@3.20.4_@tiptap_core@3.34.0_@_5ee469de7f353d0b0b7ac18cdf819cfe}/node_modules/@tiptap/extension-table-row/dist/index.js.map +1 -1
  237. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-table@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-table@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-table/dist/index.js +5 -5
  238. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-table@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extension-table@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extension-table/dist/index.js.map +1 -1
  239. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-text-align@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-text-align@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-text-align/dist/index.js +1 -1
  240. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-text-align@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-text-align@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-text-align/dist/index.js.map +1 -1
  241. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-text-style@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-text-style@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-text-style/dist/index.js +1 -1
  242. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-text-style@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-text-style@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-text-style/dist/index.js.map +1 -1
  243. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-text@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-text@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-text/dist/index.js +2 -2
  244. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-text@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-text@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-text/dist/index.js.map +1 -1
  245. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-underline@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-underline@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-underline/dist/index.js +1 -1
  246. package/dist/esm/node_modules/.pnpm/{@tiptap_extension-underline@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_ → @tiptap_extension-underline@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4_}/node_modules/@tiptap/extension-underline/dist/index.js.map +1 -1
  247. package/dist/esm/node_modules/.pnpm/{@tiptap_extensions@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extensions@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extensions/dist/index.js +1 -1
  248. package/dist/esm/node_modules/.pnpm/{@tiptap_extensions@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4 → @tiptap_extensions@3.20.4_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4}/node_modules/@tiptap/extensions/dist/index.js.map +1 -1
  249. package/dist/esm/node_modules/.pnpm/{@tiptap_react@3.14.0_@floating-ui_dom@1.7.6_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tip_17d91a0ec98b7b4802004f8a5d3f7d72 → @tiptap_react@3.14.0_@floating-ui_dom@1.7.6_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tip_3f15bb542eb86077efc89f6845872e48}/node_modules/@tiptap/react/dist/index.js +2 -2
  250. package/dist/esm/node_modules/.pnpm/{@tiptap_react@3.14.0_@floating-ui_dom@1.7.6_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tip_17d91a0ec98b7b4802004f8a5d3f7d72 → @tiptap_react@3.14.0_@floating-ui_dom@1.7.6_@tiptap_core@3.34.0_@tiptap_pm@3.20.4__@tip_3f15bb542eb86077efc89f6845872e48}/node_modules/@tiptap/react/dist/index.js.map +1 -1
  251. package/dist/esm/node_modules/.pnpm/@tiptap_starter-kit@3.14.0/node_modules/@tiptap/starter-kit/dist/index.js +17 -17
  252. package/dist/esm/node_modules/.pnpm/css-mediaquery@0.1.2/node_modules/css-mediaquery/index.js +1 -1
  253. package/dist/esm/node_modules/.pnpm/dompurify@3.4.18/node_modules/dompurify/dist/purify.es.js +2401 -0
  254. package/dist/esm/node_modules/.pnpm/dompurify@3.4.18/node_modules/dompurify/dist/purify.es.js.map +1 -0
  255. package/dist/esm/node_modules/.pnpm/matchmediaquery@0.4.2/node_modules/matchmediaquery/index.js +1 -1
  256. package/dist/esm/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +1 -1
  257. package/dist/esm/node_modules/.pnpm/prosemirror-commands@1.7.1/node_modules/prosemirror-commands/dist/index.js +2 -2
  258. package/dist/esm/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.js +9 -1
  259. package/dist/esm/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.js.map +1 -1
  260. package/dist/esm/node_modules/.pnpm/prosemirror-schema-list@1.5.1/node_modules/prosemirror-schema-list/dist/index.js +1 -1
  261. package/dist/esm/web-containers/tsconfig.build.tsbuildinfo +1 -1
  262. package/dist/next/index.d.ts +26 -11
  263. package/dist/package.json +1 -1
  264. package/package.json +4 -4
  265. package/dist/cjs/node_modules/.pnpm/@tiptap_core@3.20.4_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/index.js +0 -6229
  266. package/dist/cjs/node_modules/.pnpm/@tiptap_core@3.20.4_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/index.js.map +0 -1
  267. package/dist/cjs/node_modules/.pnpm/@tiptap_core@3.20.4_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +0 -23
  268. package/dist/cjs/node_modules/.pnpm/@tiptap_core@3.20.4_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +0 -1
  269. package/dist/cjs/node_modules/.pnpm/dompurify@3.4.11/node_modules/dompurify/dist/purify.es.js +0 -2251
  270. package/dist/cjs/node_modules/.pnpm/dompurify@3.4.11/node_modules/dompurify/dist/purify.es.js.map +0 -1
  271. package/dist/esm/node_modules/.pnpm/@tiptap_core@3.20.4_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/index.js +0 -6130
  272. package/dist/esm/node_modules/.pnpm/@tiptap_core@3.20.4_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/index.js.map +0 -1
  273. package/dist/esm/node_modules/.pnpm/@tiptap_core@3.20.4_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +0 -17
  274. package/dist/esm/node_modules/.pnpm/@tiptap_core@3.20.4_@tiptap_pm@3.20.4/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +0 -1
  275. package/dist/esm/node_modules/.pnpm/@tiptap_extension-blockquote@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_/node_modules/@tiptap/extension-blockquote/dist/index.js.map +0 -1
  276. package/dist/esm/node_modules/.pnpm/@tiptap_extension-code-block@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4__@tiptap_pm@3.20.4/node_modules/@tiptap/extension-code-block/dist/index.js.map +0 -1
  277. package/dist/esm/node_modules/.pnpm/@tiptap_extension-heading@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_/node_modules/@tiptap/extension-heading/dist/index.js.map +0 -1
  278. package/dist/esm/node_modules/.pnpm/@tiptap_extension-image@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_/node_modules/@tiptap/extension-image/dist/index.js.map +0 -1
  279. package/dist/esm/node_modules/.pnpm/@tiptap_extension-paragraph@3.20.4_@tiptap_core@3.20.4_@tiptap_pm@3.20.4_/node_modules/@tiptap/extension-paragraph/dist/index.js.map +0 -1
  280. package/dist/esm/node_modules/.pnpm/dompurify@3.4.11/node_modules/dompurify/dist/purify.es.js +0 -2249
  281. package/dist/esm/node_modules/.pnpm/dompurify@3.4.11/node_modules/dompurify/dist/purify.es.js.map +0 -1
@@ -0,0 +1,2403 @@
1
+ 'use strict';
2
+
3
+ /*! @license DOMPurify 3.4.18 | (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.18/LICENSE */
4
+ function _arrayLikeToArray(r, a) {
5
+ (null == a || a > r.length) && (a = r.length);
6
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
7
+ return n;
8
+ }
9
+ function _arrayWithHoles(r) {
10
+ if (Array.isArray(r)) return r;
11
+ }
12
+ function _iterableToArrayLimit(r, l) {
13
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
14
+ if (null != t) {
15
+ var e, n, i, u, a = [], f = true, o = false;
16
+ try {
17
+ if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
18
+ } catch (r) {
19
+ o = true, n = r;
20
+ } finally {
21
+ try {
22
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
23
+ } finally {
24
+ if (o) throw n;
25
+ }
26
+ }
27
+ return a;
28
+ }
29
+ }
30
+ function _nonIterableRest() {
31
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
32
+ }
33
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
34
+ function _slicedToArray(r, e) {
35
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
36
+ }
37
+ function _unsupportedIterableToArray(r, a) {
38
+ if (r) {
39
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
40
+ var t = {}.toString.call(r).slice(8, -1);
41
+ return "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;
42
+ }
43
+ }
44
+ const entries = Object.entries;
45
+ const objectKeys = Object.keys;
46
+ const setPrototypeOf = Object.setPrototypeOf;
47
+ const isFrozen = Object.isFrozen;
48
+ const getPrototypeOf = Object.getPrototypeOf;
49
+ const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
50
+ let freeze = Object.freeze;
51
+ let seal = Object.seal;
52
+ let create = Object.create;
53
+ let _ref = typeof Reflect !== "undefined" && Reflect;
54
+ let apply = _ref.apply;
55
+ let construct = _ref.construct;
56
+ if (!freeze) freeze = function freeze(x) {
57
+ return x;
58
+ };
59
+ if (!seal) seal = function seal(x) {
60
+ return x;
61
+ };
62
+ if (!apply) apply = function apply(func, thisArg) {
63
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];
64
+ return func.apply(thisArg, args);
65
+ };
66
+ if (!construct) construct = function construct(Func) {
67
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];
68
+ return new Func(...args);
69
+ };
70
+ const arrayForEach = unapply(Array.prototype.forEach);
71
+ const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
72
+ const arrayPop = unapply(Array.prototype.pop);
73
+ const arrayPush = unapply(Array.prototype.push);
74
+ const arraySlice = unapply(Array.prototype.slice);
75
+ const arraySplice = unapply(Array.prototype.splice);
76
+ const arrayIsArray = Array.isArray;
77
+ const setCreate = unconstruct(Set);
78
+ const setAdd = unapply(Set.prototype.add);
79
+ const setHas = unapply(Set.prototype.has);
80
+ const stringToLowerCase = unapply(String.prototype.toLowerCase);
81
+ const stringToString = unapply(String.prototype.toString);
82
+ const stringMatch = unapply(String.prototype.match);
83
+ const stringReplace = unapply(String.prototype.replace);
84
+ const stringIndexOf = unapply(String.prototype.indexOf);
85
+ const stringTrim = unapply(String.prototype.trim);
86
+ const numberToString = unapply(Number.prototype.toString);
87
+ const booleanToString = unapply(Boolean.prototype.toString);
88
+ const bigintToString = typeof BigInt === "undefined" ? null : unapply(BigInt.prototype.toString);
89
+ const symbolToString = typeof Symbol === "undefined" ? null : unapply(Symbol.prototype.toString);
90
+ const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
91
+ const objectToString = unapply(Object.prototype.toString);
92
+ const regExpTestRaw = RegExp.prototype.test;
93
+ const regExpTest = function regExpTest(regExp, value) {
94
+ if (regExp instanceof RegExp) regExp.lastIndex = 0;
95
+ return apply(regExpTestRaw, regExp, [value]);
96
+ };
97
+ const typeErrorCreate = unconstruct(TypeError);
98
+ /**
99
+ * Creates a new function that calls the given function with a specified thisArg and arguments.
100
+ *
101
+ * @param func - The function to be wrapped and called.
102
+ * @returns A new function that calls the given function with a specified thisArg and arguments.
103
+ */
104
+ function unapply(func) {
105
+ return function(thisArg) {
106
+ for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];
107
+ return apply(func, thisArg, args);
108
+ };
109
+ }
110
+ /**
111
+ * Creates a new function that constructs an instance of the given constructor function with the provided arguments.
112
+ *
113
+ * @param func - The constructor function to be wrapped and called.
114
+ * @returns A new function that constructs an instance of the given constructor function with the provided arguments.
115
+ */
116
+ function unconstruct(Func) {
117
+ return function() {
118
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];
119
+ return construct(Func, args);
120
+ };
121
+ }
122
+ /**
123
+ * Add properties to a lookup table
124
+ *
125
+ * @param set - The set to which elements will be added.
126
+ * @param array - The array containing elements to be added to the set.
127
+ * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
128
+ * @returns The modified set with added elements.
129
+ */
130
+ function addToSet(set, array) {
131
+ let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
132
+ if (setPrototypeOf) setPrototypeOf(set, null);
133
+ if (!arrayIsArray(array)) return set;
134
+ let l = array.length;
135
+ while (l--) {
136
+ let element = array[l];
137
+ if (typeof element === "string") {
138
+ const lcElement = transformCaseFunc(element);
139
+ if (lcElement !== element) {
140
+ if (!isFrozen(array)) array[l] = lcElement;
141
+ element = lcElement;
142
+ }
143
+ }
144
+ set[element] = true;
145
+ }
146
+ return set;
147
+ }
148
+ /**
149
+ * Clean up an array to harden against CSPP
150
+ *
151
+ * @param array - The array to be cleaned.
152
+ * @returns The cleaned version of the array
153
+ */
154
+ function cleanArray(array) {
155
+ for (let index = 0; index < array.length; index++) if (!objectHasOwnProperty(array, index)) array[index] = null;
156
+ return array;
157
+ }
158
+ /**
159
+ * Shallow clone an object
160
+ *
161
+ * @param object - The object to be cloned.
162
+ * @returns A new object that copies the original.
163
+ */
164
+ function clone(object) {
165
+ const newObject = create(null);
166
+ for (const _ref2 of entries(object)) {
167
+ var _ref3 = _slicedToArray(_ref2, 2);
168
+ const property = _ref3[0];
169
+ const value = _ref3[1];
170
+ if (objectHasOwnProperty(object, property)) {
171
+ if (arrayIsArray(value)) newObject[property] = cleanArray(value);
172
+ else if (value && typeof value === "object" && value.constructor === Object) newObject[property] = clone(value);
173
+ else newObject[property] = value;
174
+ }
175
+ }
176
+ return newObject;
177
+ }
178
+ /**
179
+ * Copy a flat lookup table
180
+ *
181
+ * @param set - The set to copy.
182
+ * @returns A new prototype-free set with the same entries.
183
+ */
184
+ function cloneSet(set) {
185
+ const newSet = create(null);
186
+ const keys = objectKeys(set);
187
+ let l = keys.length;
188
+ while (l--) newSet[keys[l]] = set[keys[l]];
189
+ return newSet;
190
+ }
191
+ /**
192
+ * Convert non-node values into strings without depending on direct property access.
193
+ *
194
+ * @param value - The value to stringify.
195
+ * @returns A string representation of the provided value.
196
+ */
197
+ function stringifyValue(value) {
198
+ switch (typeof value) {
199
+ case "string": return value;
200
+ case "number": return numberToString(value);
201
+ case "boolean": return booleanToString(value);
202
+ case "bigint": return bigintToString ? bigintToString(value) : "0";
203
+ case "symbol": return symbolToString ? symbolToString(value) : "Symbol()";
204
+ case "undefined": return objectToString(value);
205
+ case "function":
206
+ case "object": {
207
+ if (value === null) return objectToString(value);
208
+ const valueAsRecord = value;
209
+ const valueToString = lookupGetter(valueAsRecord, "toString");
210
+ if (typeof valueToString === "function") {
211
+ const stringified = valueToString(valueAsRecord);
212
+ return typeof stringified === "string" ? stringified : objectToString(stringified);
213
+ }
214
+ return objectToString(value);
215
+ }
216
+ default: return objectToString(value);
217
+ }
218
+ }
219
+ /**
220
+ * This method automatically checks if the prop is function or getter and behaves accordingly.
221
+ *
222
+ * @param object - The object to look up the getter function in its prototype chain.
223
+ * @param prop - The property name for which to find the getter function.
224
+ * @returns The getter function found in the prototype chain or a fallback function.
225
+ */
226
+ function lookupGetter(object, prop) {
227
+ while (object !== null) {
228
+ const desc = getOwnPropertyDescriptor(object, prop);
229
+ if (desc) {
230
+ if (desc.get) return unapply(desc.get);
231
+ if (typeof desc.value === "function") return unapply(desc.value);
232
+ }
233
+ object = getPrototypeOf(object);
234
+ }
235
+ function fallbackValue() {
236
+ return null;
237
+ }
238
+ return fallbackValue;
239
+ }
240
+ /**
241
+ * Like lookupGetter, but for accessor properties only, and returns null
242
+ * instead of a null-returning fallback when no getter exists on the chain.
243
+ * Lets a caller fall back to a direct property read in environments that
244
+ * lack the getter, where a fallback returning null would be indistinguishable
245
+ * from a legitimate null value (e.g. namespaceURI of a no-namespace element).
246
+ *
247
+ * @param object - The object (usually a prototype) to start the lookup at.
248
+ * @param prop - The accessor property name.
249
+ * @returns The unapplied getter, or null if none was found.
250
+ */
251
+ function lookupAccessor(object, prop) {
252
+ while (object !== null) {
253
+ const desc = getOwnPropertyDescriptor(object, prop);
254
+ if (desc) return desc.get ? unapply(desc.get) : null;
255
+ object = getPrototypeOf(object);
256
+ }
257
+ return null;
258
+ }
259
+ function isRegex(value) {
260
+ if (!value) return false;
261
+ try {
262
+ regExpTest(value, "");
263
+ return true;
264
+ } catch (_unused) {
265
+ return false;
266
+ }
267
+ }
268
+ const html$1 = freeze([
269
+ "a",
270
+ "abbr",
271
+ "acronym",
272
+ "address",
273
+ "area",
274
+ "article",
275
+ "aside",
276
+ "audio",
277
+ "b",
278
+ "bdi",
279
+ "bdo",
280
+ "big",
281
+ "blink",
282
+ "blockquote",
283
+ "body",
284
+ "br",
285
+ "button",
286
+ "canvas",
287
+ "caption",
288
+ "center",
289
+ "cite",
290
+ "code",
291
+ "col",
292
+ "colgroup",
293
+ "content",
294
+ "data",
295
+ "datalist",
296
+ "dd",
297
+ "decorator",
298
+ "del",
299
+ "details",
300
+ "dfn",
301
+ "dialog",
302
+ "dir",
303
+ "div",
304
+ "dl",
305
+ "dt",
306
+ "element",
307
+ "em",
308
+ "fieldset",
309
+ "figcaption",
310
+ "figure",
311
+ "font",
312
+ "footer",
313
+ "form",
314
+ "h1",
315
+ "h2",
316
+ "h3",
317
+ "h4",
318
+ "h5",
319
+ "h6",
320
+ "head",
321
+ "header",
322
+ "hgroup",
323
+ "hr",
324
+ "html",
325
+ "i",
326
+ "img",
327
+ "input",
328
+ "ins",
329
+ "kbd",
330
+ "label",
331
+ "legend",
332
+ "li",
333
+ "main",
334
+ "map",
335
+ "mark",
336
+ "marquee",
337
+ "menu",
338
+ "menuitem",
339
+ "meter",
340
+ "nav",
341
+ "nobr",
342
+ "ol",
343
+ "optgroup",
344
+ "option",
345
+ "output",
346
+ "p",
347
+ "picture",
348
+ "pre",
349
+ "progress",
350
+ "q",
351
+ "rp",
352
+ "rt",
353
+ "ruby",
354
+ "s",
355
+ "samp",
356
+ "search",
357
+ "section",
358
+ "select",
359
+ "shadow",
360
+ "slot",
361
+ "small",
362
+ "source",
363
+ "spacer",
364
+ "span",
365
+ "strike",
366
+ "strong",
367
+ "style",
368
+ "sub",
369
+ "summary",
370
+ "sup",
371
+ "table",
372
+ "tbody",
373
+ "td",
374
+ "template",
375
+ "textarea",
376
+ "tfoot",
377
+ "th",
378
+ "thead",
379
+ "time",
380
+ "tr",
381
+ "track",
382
+ "tt",
383
+ "u",
384
+ "ul",
385
+ "var",
386
+ "video",
387
+ "wbr"
388
+ ]);
389
+ const svg$1 = freeze([
390
+ "svg",
391
+ "a",
392
+ "altglyph",
393
+ "altglyphdef",
394
+ "altglyphitem",
395
+ "animatecolor",
396
+ "animatemotion",
397
+ "animatetransform",
398
+ "circle",
399
+ "clippath",
400
+ "defs",
401
+ "desc",
402
+ "ellipse",
403
+ "filter",
404
+ "font",
405
+ "g",
406
+ "glyph",
407
+ "glyphref",
408
+ "hkern",
409
+ "image",
410
+ "line",
411
+ "lineargradient",
412
+ "marker",
413
+ "mask",
414
+ "metadata",
415
+ "mpath",
416
+ "path",
417
+ "pattern",
418
+ "polygon",
419
+ "polyline",
420
+ "radialgradient",
421
+ "rect",
422
+ "stop",
423
+ "style",
424
+ "switch",
425
+ "symbol",
426
+ "text",
427
+ "textpath",
428
+ "title",
429
+ "tref",
430
+ "tspan",
431
+ "view",
432
+ "vkern"
433
+ ]);
434
+ const svgFilters = freeze([
435
+ "feBlend",
436
+ "feColorMatrix",
437
+ "feComponentTransfer",
438
+ "feComposite",
439
+ "feConvolveMatrix",
440
+ "feDiffuseLighting",
441
+ "feDisplacementMap",
442
+ "feDistantLight",
443
+ "feDropShadow",
444
+ "feFlood",
445
+ "feFuncA",
446
+ "feFuncB",
447
+ "feFuncG",
448
+ "feFuncR",
449
+ "feGaussianBlur",
450
+ "feImage",
451
+ "feMerge",
452
+ "feMergeNode",
453
+ "feMorphology",
454
+ "feOffset",
455
+ "fePointLight",
456
+ "feSpecularLighting",
457
+ "feSpotLight",
458
+ "feTile",
459
+ "feTurbulence"
460
+ ]);
461
+ const svgDisallowed = freeze([
462
+ "animate",
463
+ "color-profile",
464
+ "cursor",
465
+ "discard",
466
+ "font-face",
467
+ "font-face-format",
468
+ "font-face-name",
469
+ "font-face-src",
470
+ "font-face-uri",
471
+ "foreignobject",
472
+ "hatch",
473
+ "hatchpath",
474
+ "mesh",
475
+ "meshgradient",
476
+ "meshpatch",
477
+ "meshrow",
478
+ "missing-glyph",
479
+ "script",
480
+ "set",
481
+ "solidcolor",
482
+ "unknown",
483
+ "use"
484
+ ]);
485
+ const mathMl$1 = freeze([
486
+ "math",
487
+ "menclose",
488
+ "merror",
489
+ "mfenced",
490
+ "mfrac",
491
+ "mglyph",
492
+ "mi",
493
+ "mlabeledtr",
494
+ "mmultiscripts",
495
+ "mn",
496
+ "mo",
497
+ "mover",
498
+ "mpadded",
499
+ "mphantom",
500
+ "mroot",
501
+ "mrow",
502
+ "ms",
503
+ "mspace",
504
+ "msqrt",
505
+ "mstyle",
506
+ "msub",
507
+ "msup",
508
+ "msubsup",
509
+ "mtable",
510
+ "mtd",
511
+ "mtext",
512
+ "mtr",
513
+ "munder",
514
+ "munderover",
515
+ "mprescripts"
516
+ ]);
517
+ const mathMlDisallowed = freeze([
518
+ "maction",
519
+ "maligngroup",
520
+ "malignmark",
521
+ "mlongdiv",
522
+ "mscarries",
523
+ "mscarry",
524
+ "msgroup",
525
+ "mstack",
526
+ "msline",
527
+ "msrow",
528
+ "semantics",
529
+ "annotation",
530
+ "annotation-xml",
531
+ "mprescripts",
532
+ "none"
533
+ ]);
534
+ const text = freeze(["#text"]);
535
+ const html = freeze([
536
+ "accept",
537
+ "action",
538
+ "align",
539
+ "alt",
540
+ "autocapitalize",
541
+ "autocomplete",
542
+ "autopictureinpicture",
543
+ "autoplay",
544
+ "background",
545
+ "bgcolor",
546
+ "border",
547
+ "capture",
548
+ "cellpadding",
549
+ "cellspacing",
550
+ "checked",
551
+ "cite",
552
+ "class",
553
+ "clear",
554
+ "color",
555
+ "cols",
556
+ "colspan",
557
+ "command",
558
+ "commandfor",
559
+ "controls",
560
+ "controlslist",
561
+ "coords",
562
+ "crossorigin",
563
+ "datetime",
564
+ "decoding",
565
+ "default",
566
+ "dir",
567
+ "disabled",
568
+ "disablepictureinpicture",
569
+ "disableremoteplayback",
570
+ "download",
571
+ "draggable",
572
+ "enctype",
573
+ "enterkeyhint",
574
+ "exportparts",
575
+ "face",
576
+ "for",
577
+ "headers",
578
+ "height",
579
+ "hidden",
580
+ "high",
581
+ "href",
582
+ "hreflang",
583
+ "id",
584
+ "inert",
585
+ "inputmode",
586
+ "integrity",
587
+ "ismap",
588
+ "kind",
589
+ "label",
590
+ "lang",
591
+ "list",
592
+ "loading",
593
+ "loop",
594
+ "low",
595
+ "max",
596
+ "maxlength",
597
+ "media",
598
+ "method",
599
+ "min",
600
+ "minlength",
601
+ "multiple",
602
+ "muted",
603
+ "name",
604
+ "nonce",
605
+ "noshade",
606
+ "novalidate",
607
+ "nowrap",
608
+ "open",
609
+ "optimum",
610
+ "part",
611
+ "pattern",
612
+ "placeholder",
613
+ "playsinline",
614
+ "popover",
615
+ "popovertarget",
616
+ "popovertargetaction",
617
+ "poster",
618
+ "preload",
619
+ "pubdate",
620
+ "radiogroup",
621
+ "readonly",
622
+ "rel",
623
+ "required",
624
+ "rev",
625
+ "reversed",
626
+ "role",
627
+ "rows",
628
+ "rowspan",
629
+ "spellcheck",
630
+ "scope",
631
+ "selected",
632
+ "shape",
633
+ "size",
634
+ "sizes",
635
+ "slot",
636
+ "span",
637
+ "srclang",
638
+ "start",
639
+ "src",
640
+ "srcset",
641
+ "step",
642
+ "style",
643
+ "summary",
644
+ "tabindex",
645
+ "title",
646
+ "translate",
647
+ "type",
648
+ "usemap",
649
+ "valign",
650
+ "value",
651
+ "width",
652
+ "wrap",
653
+ "xmlns"
654
+ ]);
655
+ const svg = freeze([
656
+ "accent-height",
657
+ "accumulate",
658
+ "additive",
659
+ "alignment-baseline",
660
+ "amplitude",
661
+ "ascent",
662
+ "attributename",
663
+ "attributetype",
664
+ "azimuth",
665
+ "basefrequency",
666
+ "baseline-shift",
667
+ "begin",
668
+ "bias",
669
+ "by",
670
+ "class",
671
+ "clip",
672
+ "clippathunits",
673
+ "clip-path",
674
+ "clip-rule",
675
+ "color",
676
+ "color-interpolation",
677
+ "color-interpolation-filters",
678
+ "color-profile",
679
+ "color-rendering",
680
+ "cx",
681
+ "cy",
682
+ "d",
683
+ "dx",
684
+ "dy",
685
+ "diffuseconstant",
686
+ "direction",
687
+ "display",
688
+ "divisor",
689
+ "dominant-baseline",
690
+ "dur",
691
+ "edgemode",
692
+ "elevation",
693
+ "end",
694
+ "exponent",
695
+ "fill",
696
+ "fill-opacity",
697
+ "fill-rule",
698
+ "filter",
699
+ "filterunits",
700
+ "flood-color",
701
+ "flood-opacity",
702
+ "font-family",
703
+ "font-size",
704
+ "font-size-adjust",
705
+ "font-stretch",
706
+ "font-style",
707
+ "font-variant",
708
+ "font-weight",
709
+ "fx",
710
+ "fy",
711
+ "g1",
712
+ "g2",
713
+ "glyph-name",
714
+ "glyphref",
715
+ "gradientunits",
716
+ "gradienttransform",
717
+ "height",
718
+ "href",
719
+ "id",
720
+ "image-rendering",
721
+ "in",
722
+ "in2",
723
+ "intercept",
724
+ "k",
725
+ "k1",
726
+ "k2",
727
+ "k3",
728
+ "k4",
729
+ "kerning",
730
+ "keypoints",
731
+ "keysplines",
732
+ "keytimes",
733
+ "lang",
734
+ "lengthadjust",
735
+ "letter-spacing",
736
+ "kernelmatrix",
737
+ "kernelunitlength",
738
+ "lighting-color",
739
+ "local",
740
+ "marker-end",
741
+ "marker-mid",
742
+ "marker-start",
743
+ "markerheight",
744
+ "markerunits",
745
+ "markerwidth",
746
+ "maskcontentunits",
747
+ "maskunits",
748
+ "max",
749
+ "mask",
750
+ "mask-type",
751
+ "media",
752
+ "method",
753
+ "mode",
754
+ "min",
755
+ "name",
756
+ "numoctaves",
757
+ "offset",
758
+ "operator",
759
+ "opacity",
760
+ "order",
761
+ "orient",
762
+ "orientation",
763
+ "origin",
764
+ "overflow",
765
+ "paint-order",
766
+ "path",
767
+ "pathlength",
768
+ "patterncontentunits",
769
+ "patterntransform",
770
+ "patternunits",
771
+ "pointer-events",
772
+ "points",
773
+ "preservealpha",
774
+ "preserveaspectratio",
775
+ "primitiveunits",
776
+ "r",
777
+ "rx",
778
+ "ry",
779
+ "radius",
780
+ "refx",
781
+ "refy",
782
+ "repeatcount",
783
+ "repeatdur",
784
+ "restart",
785
+ "result",
786
+ "rotate",
787
+ "scale",
788
+ "seed",
789
+ "shape-rendering",
790
+ "slope",
791
+ "specularconstant",
792
+ "specularexponent",
793
+ "spreadmethod",
794
+ "startoffset",
795
+ "stddeviation",
796
+ "stitchtiles",
797
+ "stop-color",
798
+ "stop-opacity",
799
+ "stroke-dasharray",
800
+ "stroke-dashoffset",
801
+ "stroke-linecap",
802
+ "stroke-linejoin",
803
+ "stroke-miterlimit",
804
+ "stroke-opacity",
805
+ "stroke",
806
+ "stroke-width",
807
+ "style",
808
+ "surfacescale",
809
+ "systemlanguage",
810
+ "tabindex",
811
+ "tablevalues",
812
+ "targetx",
813
+ "targety",
814
+ "transform",
815
+ "transform-origin",
816
+ "text-anchor",
817
+ "text-decoration",
818
+ "text-orientation",
819
+ "text-rendering",
820
+ "textlength",
821
+ "type",
822
+ "u1",
823
+ "u2",
824
+ "unicode",
825
+ "values",
826
+ "vector-effect",
827
+ "viewbox",
828
+ "visibility",
829
+ "version",
830
+ "vert-adv-y",
831
+ "vert-origin-x",
832
+ "vert-origin-y",
833
+ "width",
834
+ "word-spacing",
835
+ "wrap",
836
+ "writing-mode",
837
+ "xchannelselector",
838
+ "ychannelselector",
839
+ "x",
840
+ "x1",
841
+ "x2",
842
+ "xmlns",
843
+ "y",
844
+ "y1",
845
+ "y2",
846
+ "z",
847
+ "zoomandpan"
848
+ ]);
849
+ const mathMl = freeze([
850
+ "accent",
851
+ "accentunder",
852
+ "align",
853
+ "bevelled",
854
+ "close",
855
+ "columnalign",
856
+ "columnlines",
857
+ "columnspacing",
858
+ "columnspan",
859
+ "denomalign",
860
+ "depth",
861
+ "dir",
862
+ "display",
863
+ "displaystyle",
864
+ "encoding",
865
+ "fence",
866
+ "frame",
867
+ "height",
868
+ "href",
869
+ "id",
870
+ "largeop",
871
+ "length",
872
+ "linethickness",
873
+ "lquote",
874
+ "lspace",
875
+ "mathbackground",
876
+ "mathcolor",
877
+ "mathsize",
878
+ "mathvariant",
879
+ "maxsize",
880
+ "minsize",
881
+ "movablelimits",
882
+ "notation",
883
+ "numalign",
884
+ "open",
885
+ "rowalign",
886
+ "rowlines",
887
+ "rowspacing",
888
+ "rowspan",
889
+ "rspace",
890
+ "rquote",
891
+ "scriptlevel",
892
+ "scriptminsize",
893
+ "scriptsizemultiplier",
894
+ "selection",
895
+ "separator",
896
+ "separators",
897
+ "stretchy",
898
+ "subscriptshift",
899
+ "supscriptshift",
900
+ "symmetric",
901
+ "voffset",
902
+ "width",
903
+ "xmlns"
904
+ ]);
905
+ const xml = freeze([
906
+ "xlink:href",
907
+ "xml:id",
908
+ "xlink:title",
909
+ "xml:space",
910
+ "xmlns:xlink"
911
+ ]);
912
+ const MUSTACHE_EXPR = seal(/{{[\w\W]*|^[\w\W]*}}/g);
913
+ const ERB_EXPR = seal(/<%[\w\W]*|^[\w\W]*%>/g);
914
+ const TMPLIT_EXPR = seal(/\${[\w\W]*/g);
915
+ const TMPL_MARKER_SERIALIZED = seal(/{{|}}|\${|<%|%>|&lt;%|%&gt;/);
916
+ const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
917
+ const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
918
+ const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);
919
+ const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
920
+ const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);
921
+ const DOCTYPE_NAME = seal(/^html$/i);
922
+ const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
923
+ const ELEMENT_MARKUP_PROBE = seal(/<[/\w!]/g);
924
+ const COMMENT_MARKUP_PROBE = seal(/<[/\w]/g);
925
+ const FALLBACK_TAG_CLOSE = seal(/<\/no(script|embed|frames)/i);
926
+ const SELF_CLOSING_TAG = seal(/\/>/i);
927
+ const ATTR_VALUE_BREAKOUT = seal(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i);
928
+ const LEADING_WHITESPACE = seal(/^[\r\n\t ]+/);
929
+ const NODE_TYPE = {
930
+ element: 1,
931
+ text: 3,
932
+ processingInstruction: 7,
933
+ comment: 8,
934
+ document: 9,
935
+ documentFragment: 11
936
+ };
937
+ const LITERAL_TEXT_ELEMENTS = freeze(addToSet({}, [
938
+ "style",
939
+ "script",
940
+ "xmp",
941
+ "iframe",
942
+ "noembed",
943
+ "noframes",
944
+ "plaintext",
945
+ "noscript"
946
+ ]));
947
+ const getGlobal = function getGlobal() {
948
+ return typeof window === "undefined" ? null : window;
949
+ };
950
+ /**
951
+ * Creates a no-op policy for internal use only.
952
+ * Don't export this function outside this module!
953
+ * @param trustedTypes The policy factory.
954
+ * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
955
+ * @return The policy created (or null, if Trusted Types
956
+ * are not supported or creating the policy failed).
957
+ */
958
+ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
959
+ if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") return null;
960
+ let suffix = null;
961
+ const ATTR_NAME = "data-tt-policy-suffix";
962
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) suffix = purifyHostElement.getAttribute(ATTR_NAME);
963
+ const policyName = "dompurify" + (suffix ? "#" + suffix : "");
964
+ try {
965
+ return trustedTypes.createPolicy(policyName, {
966
+ createHTML(html) {
967
+ return html;
968
+ },
969
+ createScriptURL(scriptUrl) {
970
+ return scriptUrl;
971
+ }
972
+ });
973
+ } catch (_) {
974
+ console.warn("TrustedTypes policy " + policyName + " could not be created.");
975
+ return null;
976
+ }
977
+ };
978
+ const _createHooksMap = function _createHooksMap() {
979
+ return {
980
+ afterSanitizeAttributes: [],
981
+ afterSanitizeElements: [],
982
+ afterSanitizeShadowDOM: [],
983
+ beforeSanitizeAttributes: [],
984
+ beforeSanitizeElements: [],
985
+ beforeSanitizeShadowDOM: [],
986
+ uponSanitizeAttribute: [],
987
+ uponSanitizeElement: [],
988
+ uponSanitizeShadowNode: []
989
+ };
990
+ };
991
+ /**
992
+ * Resolve a set-valued configuration option.
993
+ *
994
+ * @param cfg the cloned, prototype-free configuration object
995
+ * @param key the configuration property to read
996
+ * @param fallback the set to use when the option is absent or not an array
997
+ * @param options case transform, and an optional base set to extend a copy of
998
+ * @returns a fresh set built from cfg[key], or the fallback
999
+ */
1000
+ const _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {
1001
+ return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? cloneSet(options.base) : {}, cfg[key], options.transform) : fallback;
1002
+ };
1003
+ /**
1004
+ * Resolve an object-valued configuration option.
1005
+ *
1006
+ * @param cfg the cloned, prototype-free configuration object
1007
+ * @param key the configuration property to read
1008
+ * @param fallback the read-only value to use when the option is absent
1009
+ * @returns a prototype-free clone of cfg[key], or the fallback
1010
+ */
1011
+ const _resolveObjectOption = function _resolveObjectOption(cfg, key, fallback) {
1012
+ const value = objectHasOwnProperty(cfg, key) ? cfg[key] : void 0;
1013
+ return value && typeof value === "object" ? clone(value) : fallback;
1014
+ };
1015
+ function createDOMPurify() {
1016
+ let window = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
1017
+ const DOMPurify = (root) => createDOMPurify(root);
1018
+ DOMPurify.version = "3.4.18";
1019
+ DOMPurify.removed = [];
1020
+ if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
1021
+ DOMPurify.isSupported = false;
1022
+ return DOMPurify;
1023
+ }
1024
+ let document = window.document;
1025
+ const originalDocument = document;
1026
+ const currentScript = originalDocument.currentScript;
1027
+ const HTMLTemplateElement = window.HTMLTemplateElement, Node = window.Node, Element = window.Element, NodeFilter = window.NodeFilter, DOMParser = window.DOMParser, trustedTypes = window.trustedTypes;
1028
+ const ElementPrototype = Element.prototype;
1029
+ const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
1030
+ const remove = lookupGetter(ElementPrototype, "remove");
1031
+ const removeAttributeNode = lookupGetter(ElementPrototype, "removeAttributeNode");
1032
+ const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
1033
+ const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
1034
+ const getParentNode = lookupGetter(ElementPrototype, "parentNode");
1035
+ const getShadowRoot = lookupGetter(ElementPrototype, "shadowRoot");
1036
+ const getAttributes = lookupGetter(ElementPrototype, "attributes");
1037
+ const getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, "nodeType") : null;
1038
+ const getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, "nodeName") : null;
1039
+ const getOwnerDocument = Node && Node.prototype ? lookupGetter(Node.prototype, "ownerDocument") : null;
1040
+ const _readNodeType = function _readNodeType(node) {
1041
+ return getNodeType ? getNodeType(node) : node.nodeType;
1042
+ };
1043
+ const _readNodeName = function _readNodeName(node) {
1044
+ return getNodeName ? getNodeName(node) : node.nodeName;
1045
+ };
1046
+ const getNamespaceURI = lookupAccessor(ElementPrototype, "namespaceURI");
1047
+ const _readNamespaceURI = function _readNamespaceURI(element) {
1048
+ return getNamespaceURI ? getNamespaceURI(element) : element.namespaceURI;
1049
+ };
1050
+ if (typeof HTMLTemplateElement === "function") {
1051
+ const template = document.createElement("template");
1052
+ if (template.content && template.content.ownerDocument) document = template.content.ownerDocument;
1053
+ }
1054
+ let trustedTypesPolicy;
1055
+ let emptyHTML = "";
1056
+ let defaultTrustedTypesPolicy;
1057
+ let defaultTrustedTypesPolicyResolved = false;
1058
+ let IN_TRUSTED_TYPES_POLICY = 0;
1059
+ const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {
1060
+ if (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.");
1061
+ };
1062
+ const _createTrustedHTML = function _createTrustedHTML(html) {
1063
+ _assertNotInTrustedTypesPolicy();
1064
+ IN_TRUSTED_TYPES_POLICY++;
1065
+ try {
1066
+ return trustedTypesPolicy.createHTML(html);
1067
+ } finally {
1068
+ IN_TRUSTED_TYPES_POLICY--;
1069
+ }
1070
+ };
1071
+ const _signOutput = function _signOutput(html) {
1072
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(html) : html;
1073
+ };
1074
+ const _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {
1075
+ _assertNotInTrustedTypesPolicy();
1076
+ IN_TRUSTED_TYPES_POLICY++;
1077
+ try {
1078
+ return trustedTypesPolicy.createScriptURL(scriptUrl);
1079
+ } finally {
1080
+ IN_TRUSTED_TYPES_POLICY--;
1081
+ }
1082
+ };
1083
+ const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {
1084
+ if (!defaultTrustedTypesPolicyResolved) {
1085
+ defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
1086
+ defaultTrustedTypesPolicyResolved = true;
1087
+ }
1088
+ return defaultTrustedTypesPolicy;
1089
+ };
1090
+ const _document = document, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName;
1091
+ const importNode = originalDocument.importNode;
1092
+ let hooks = _createHooksMap();
1093
+ /**
1094
+ * Expose whether this browser supports running the full DOMPurify.
1095
+ */
1096
+ DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
1097
+ const 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;
1098
+ let IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
1099
+ /**
1100
+ * We consider the elements and attributes below to be safe. Ideally
1101
+ * don't add any new ones but feel free to remove unwanted ones.
1102
+ */
1103
+ let ALLOWED_TAGS = null;
1104
+ const DEFAULT_ALLOWED_TAGS = addToSet({}, [
1105
+ ...html$1,
1106
+ ...svg$1,
1107
+ ...svgFilters,
1108
+ ...mathMl$1,
1109
+ ...text
1110
+ ]);
1111
+ let ALLOWED_ATTR = null;
1112
+ const DEFAULT_ALLOWED_ATTR = addToSet({}, [
1113
+ ...html,
1114
+ ...svg,
1115
+ ...mathMl,
1116
+ ...xml
1117
+ ]);
1118
+ let CUSTOM_ELEMENT_HANDLING = null;
1119
+ let FORBID_TAGS = null;
1120
+ let FORBID_ATTR = null;
1121
+ const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
1122
+ tagCheck: {
1123
+ writable: true,
1124
+ configurable: false,
1125
+ enumerable: true,
1126
+ value: null
1127
+ },
1128
+ attributeCheck: {
1129
+ writable: true,
1130
+ configurable: false,
1131
+ enumerable: true,
1132
+ value: null
1133
+ }
1134
+ }));
1135
+ let ALLOW_ARIA_ATTR = true;
1136
+ let ALLOW_DATA_ATTR = true;
1137
+ let ALLOW_UNKNOWN_PROTOCOLS = false;
1138
+ let ALLOW_SELF_CLOSE_IN_ATTR = true;
1139
+ let SAFE_FOR_TEMPLATES = false;
1140
+ let SAFE_FOR_XML = true;
1141
+ let WHOLE_DOCUMENT = false;
1142
+ let SET_CONFIG = false;
1143
+ let SET_CONFIG_ALLOWED_TAGS = null;
1144
+ let SET_CONFIG_ALLOWED_ATTR = null;
1145
+ let FORCE_BODY = false;
1146
+ let RETURN_DOM = false;
1147
+ let RETURN_DOM_FRAGMENT = false;
1148
+ let RETURN_TRUSTED_TYPE = false;
1149
+ let SANITIZE_DOM = true;
1150
+ let SANITIZE_NAMED_PROPS = false;
1151
+ const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
1152
+ let KEEP_CONTENT = true;
1153
+ let IN_PLACE = false;
1154
+ let IN_PLACE_VISITED = null;
1155
+ let USE_PROFILES = false;
1156
+ let FORBID_CONTENTS = null;
1157
+ const DEFAULT_FORBID_CONTENTS = addToSet({}, [
1158
+ "annotation-xml",
1159
+ "audio",
1160
+ "colgroup",
1161
+ "desc",
1162
+ "foreignobject",
1163
+ "head",
1164
+ "iframe",
1165
+ "math",
1166
+ "mi",
1167
+ "mn",
1168
+ "mo",
1169
+ "ms",
1170
+ "mtext",
1171
+ "noembed",
1172
+ "noframes",
1173
+ "noscript",
1174
+ "plaintext",
1175
+ "script",
1176
+ "selectedcontent",
1177
+ "style",
1178
+ "svg",
1179
+ "template",
1180
+ "thead",
1181
+ "title",
1182
+ "video",
1183
+ "xmp"
1184
+ ]);
1185
+ let DATA_URI_TAGS = null;
1186
+ const DEFAULT_DATA_URI_TAGS = addToSet({}, [
1187
+ "audio",
1188
+ "video",
1189
+ "img",
1190
+ "source",
1191
+ "image",
1192
+ "track"
1193
+ ]);
1194
+ let URI_SAFE_ATTRIBUTES = null;
1195
+ const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [
1196
+ "alt",
1197
+ "class",
1198
+ "for",
1199
+ "id",
1200
+ "label",
1201
+ "name",
1202
+ "pattern",
1203
+ "placeholder",
1204
+ "role",
1205
+ "summary",
1206
+ "title",
1207
+ "value",
1208
+ "style",
1209
+ "xmlns"
1210
+ ]);
1211
+ const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
1212
+ const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
1213
+ const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
1214
+ let NAMESPACE = HTML_NAMESPACE;
1215
+ let IS_EMPTY_INPUT = false;
1216
+ let ALLOWED_NAMESPACES = null;
1217
+ const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [
1218
+ MATHML_NAMESPACE,
1219
+ SVG_NAMESPACE,
1220
+ HTML_NAMESPACE
1221
+ ], stringToString);
1222
+ const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze(addToSet({}, [
1223
+ "mi",
1224
+ "mo",
1225
+ "mn",
1226
+ "ms",
1227
+ "mtext"
1228
+ ]));
1229
+ let MATHML_TEXT_INTEGRATION_POINTS = null;
1230
+ const DEFAULT_HTML_INTEGRATION_POINTS = freeze(addToSet({}, ["annotation-xml"]));
1231
+ let HTML_INTEGRATION_POINTS = null;
1232
+ const DEFAULT_CUSTOM_ELEMENT_HANDLING = freeze(create(null));
1233
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [
1234
+ "title",
1235
+ "style",
1236
+ "font",
1237
+ "a",
1238
+ "script"
1239
+ ]);
1240
+ let PARSER_MEDIA_TYPE = null;
1241
+ const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
1242
+ const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
1243
+ let transformCaseFunc = null;
1244
+ let CONFIG = null;
1245
+ const formElement = document.createElement("form");
1246
+ const isRegexOrFunction = function isRegexOrFunction(testValue) {
1247
+ return testValue instanceof RegExp || testValue instanceof Function;
1248
+ };
1249
+ /**
1250
+ * _parseConfig
1251
+ *
1252
+ * @param cfg optional config literal
1253
+ */
1254
+ const _parseConfig = function _parseConfig() {
1255
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1256
+ if (!cfg || typeof cfg !== "object") cfg = {};
1257
+ cfg = clone(cfg);
1258
+ PARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
1259
+ transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
1260
+ ALLOWED_TAGS = _resolveSetOption(cfg, "ALLOWED_TAGS", DEFAULT_ALLOWED_TAGS, { transform: transformCaseFunc });
1261
+ ALLOWED_ATTR = _resolveSetOption(cfg, "ALLOWED_ATTR", DEFAULT_ALLOWED_ATTR, { transform: transformCaseFunc });
1262
+ ALLOWED_NAMESPACES = _resolveSetOption(cfg, "ALLOWED_NAMESPACES", DEFAULT_ALLOWED_NAMESPACES, { transform: stringToString });
1263
+ URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, "ADD_URI_SAFE_ATTR", DEFAULT_URI_SAFE_ATTRIBUTES, {
1264
+ transform: transformCaseFunc,
1265
+ base: DEFAULT_URI_SAFE_ATTRIBUTES
1266
+ });
1267
+ DATA_URI_TAGS = _resolveSetOption(cfg, "ADD_DATA_URI_TAGS", DEFAULT_DATA_URI_TAGS, {
1268
+ transform: transformCaseFunc,
1269
+ base: DEFAULT_DATA_URI_TAGS
1270
+ });
1271
+ FORBID_CONTENTS = _resolveSetOption(cfg, "FORBID_CONTENTS", DEFAULT_FORBID_CONTENTS, { transform: transformCaseFunc });
1272
+ FORBID_TAGS = _resolveSetOption(cfg, "FORBID_TAGS", create(null), { transform: transformCaseFunc });
1273
+ FORBID_ATTR = _resolveSetOption(cfg, "FORBID_ATTR", create(null), { transform: transformCaseFunc });
1274
+ USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === "object" ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
1275
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
1276
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
1277
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
1278
+ ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
1279
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
1280
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
1281
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
1282
+ RETURN_DOM = cfg.RETURN_DOM || false;
1283
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
1284
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
1285
+ FORCE_BODY = cfg.FORCE_BODY || false;
1286
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
1287
+ SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
1288
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
1289
+ IN_PLACE = cfg.IN_PLACE || false;
1290
+ IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI;
1291
+ NAMESPACE = typeof cfg.NAMESPACE === "string" ? cfg.NAMESPACE : HTML_NAMESPACE;
1292
+ MATHML_TEXT_INTEGRATION_POINTS = _resolveObjectOption(cfg, "MATHML_TEXT_INTEGRATION_POINTS", DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);
1293
+ HTML_INTEGRATION_POINTS = _resolveObjectOption(cfg, "HTML_INTEGRATION_POINTS", DEFAULT_HTML_INTEGRATION_POINTS);
1294
+ const customElementHandling = _resolveObjectOption(cfg, "CUSTOM_ELEMENT_HANDLING", DEFAULT_CUSTOM_ELEMENT_HANDLING);
1295
+ CUSTOM_ELEMENT_HANDLING = create(null);
1296
+ if (objectHasOwnProperty(customElementHandling, "tagNameCheck") && isRegexOrFunction(customElementHandling.tagNameCheck)) CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck;
1297
+ if (objectHasOwnProperty(customElementHandling, "attributeNameCheck") && isRegexOrFunction(customElementHandling.attributeNameCheck)) CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck;
1298
+ if (objectHasOwnProperty(customElementHandling, "allowCustomizedBuiltInElements") && typeof customElementHandling.allowCustomizedBuiltInElements === "boolean") CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements;
1299
+ seal(CUSTOM_ELEMENT_HANDLING);
1300
+ if (SAFE_FOR_TEMPLATES) ALLOW_DATA_ATTR = false;
1301
+ if (RETURN_DOM_FRAGMENT) RETURN_DOM = true;
1302
+ if (USE_PROFILES) {
1303
+ if ((objectHasOwnProperty(cfg, "ALLOWED_TAGS") || objectHasOwnProperty(cfg, "ALLOWED_ATTR")) && typeof console !== "undefined" && typeof console.warn === "function") console.warn("DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together.");
1304
+ ALLOWED_TAGS = addToSet({}, text);
1305
+ ALLOWED_ATTR = create(null);
1306
+ if (USE_PROFILES.html === true) {
1307
+ addToSet(ALLOWED_TAGS, html$1);
1308
+ addToSet(ALLOWED_ATTR, html);
1309
+ }
1310
+ if (USE_PROFILES.svg === true) {
1311
+ addToSet(ALLOWED_TAGS, svg$1);
1312
+ addToSet(ALLOWED_ATTR, svg);
1313
+ addToSet(ALLOWED_ATTR, xml);
1314
+ }
1315
+ if (USE_PROFILES.svgFilters === true) {
1316
+ addToSet(ALLOWED_TAGS, svgFilters);
1317
+ addToSet(ALLOWED_ATTR, svg);
1318
+ addToSet(ALLOWED_ATTR, xml);
1319
+ }
1320
+ if (USE_PROFILES.mathMl === true) {
1321
+ addToSet(ALLOWED_TAGS, mathMl$1);
1322
+ addToSet(ALLOWED_ATTR, mathMl);
1323
+ addToSet(ALLOWED_ATTR, xml);
1324
+ }
1325
+ }
1326
+ EXTRA_ELEMENT_HANDLING.tagCheck = null;
1327
+ EXTRA_ELEMENT_HANDLING.attributeCheck = null;
1328
+ if (objectHasOwnProperty(cfg, "ADD_TAGS")) {
1329
+ if (typeof cfg.ADD_TAGS === "function") EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
1330
+ else if (arrayIsArray(cfg.ADD_TAGS)) {
1331
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) ALLOWED_TAGS = cloneSet(ALLOWED_TAGS);
1332
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
1333
+ }
1334
+ }
1335
+ if (objectHasOwnProperty(cfg, "ADD_ATTR")) {
1336
+ if (typeof cfg.ADD_ATTR === "function") EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
1337
+ else if (arrayIsArray(cfg.ADD_ATTR)) {
1338
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) ALLOWED_ATTR = cloneSet(ALLOWED_ATTR);
1339
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
1340
+ }
1341
+ }
1342
+ if (objectHasOwnProperty(cfg, "ADD_FORBID_CONTENTS") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {
1343
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = cloneSet(FORBID_CONTENTS);
1344
+ addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
1345
+ }
1346
+ if (KEEP_CONTENT) ALLOWED_TAGS["#text"] = true;
1347
+ if (WHOLE_DOCUMENT) addToSet(ALLOWED_TAGS, [
1348
+ "html",
1349
+ "head",
1350
+ "body"
1351
+ ]);
1352
+ if (ALLOWED_TAGS.table) {
1353
+ ALLOWED_TAGS.tbody = true;
1354
+ delete FORBID_TAGS.tbody;
1355
+ }
1356
+ if (cfg.TRUSTED_TYPES_POLICY) {
1357
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
1358
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
1359
+ const previousTrustedTypesPolicy = trustedTypesPolicy;
1360
+ trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
1361
+ try {
1362
+ emptyHTML = _createTrustedHTML("");
1363
+ } catch (error) {
1364
+ trustedTypesPolicy = previousTrustedTypesPolicy;
1365
+ throw error;
1366
+ }
1367
+ } else if (cfg.TRUSTED_TYPES_POLICY === null) {
1368
+ trustedTypesPolicy = void 0;
1369
+ emptyHTML = "";
1370
+ } else {
1371
+ if (trustedTypesPolicy === void 0) trustedTypesPolicy = _getDefaultTrustedTypesPolicy();
1372
+ if (trustedTypesPolicy && typeof emptyHTML === "string") emptyHTML = _createTrustedHTML("");
1373
+ }
1374
+ CONFIG = freeze(cfg);
1375
+ };
1376
+ const ALL_SVG_TAGS = addToSet({}, [
1377
+ ...svg$1,
1378
+ ...svgFilters,
1379
+ ...svgDisallowed
1380
+ ]);
1381
+ const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
1382
+ /**
1383
+ * Namespace rules for an element in the SVG namespace.
1384
+ *
1385
+ * @param tagName the element's lowercase tag name
1386
+ * @param parentNamespace the (possibly simulated) parent's namespace
1387
+ * @param parentTagName the parent's lowercase tag name
1388
+ * @returns true if a spec-compliant parser could produce this element
1389
+ */
1390
+ const _checkSvgNamespace = function _checkSvgNamespace(tagName, parentNamespace, parentTagName) {
1391
+ if (parentNamespace === HTML_NAMESPACE) return tagName === "svg";
1392
+ if (parentNamespace === MATHML_NAMESPACE) return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
1393
+ return Boolean(ALL_SVG_TAGS[tagName]);
1394
+ };
1395
+ /**
1396
+ * Namespace rules for an element in the MathML namespace.
1397
+ *
1398
+ * @param tagName the element's lowercase tag name
1399
+ * @param parentNamespace the (possibly simulated) parent's namespace
1400
+ * @param parentTagName the parent's lowercase tag name
1401
+ * @returns true if a spec-compliant parser could produce this element
1402
+ */
1403
+ const _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parentNamespace, parentTagName) {
1404
+ if (parentNamespace === HTML_NAMESPACE) return tagName === "math";
1405
+ if (parentNamespace === SVG_NAMESPACE) return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
1406
+ return Boolean(ALL_MATHML_TAGS[tagName]);
1407
+ };
1408
+ /**
1409
+ * Namespace rules for an element in the HTML namespace.
1410
+ *
1411
+ * @param tagName the element's lowercase tag name
1412
+ * @param parentNamespace the (possibly simulated) parent's namespace
1413
+ * @param parentTagName the parent's lowercase tag name
1414
+ * @returns true if a spec-compliant parser could produce this element
1415
+ */
1416
+ const _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parentNamespace, parentTagName) {
1417
+ if (parentNamespace === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) return false;
1418
+ if (parentNamespace === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) return false;
1419
+ return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
1420
+ };
1421
+ /**
1422
+ * @param element a DOM element whose namespace is being checked
1423
+ * @returns Return false if the element has a
1424
+ * namespace that a spec-compliant parser would never
1425
+ * return. Return true otherwise.
1426
+ */
1427
+ const _checkValidNamespace = function _checkValidNamespace(element) {
1428
+ const elementNamespace = _readNamespaceURI(element);
1429
+ const tagName = stringToLowerCase(_readNodeName(element));
1430
+ const parentNode = getParentNode(element);
1431
+ let parentNamespace = NAMESPACE;
1432
+ let parentTagName = "template";
1433
+ if (parentNode && _readNodeType(parentNode) === NODE_TYPE.element) {
1434
+ parentNamespace = _readNamespaceURI(parentNode);
1435
+ parentTagName = stringToLowerCase(_readNodeName(parentNode));
1436
+ }
1437
+ if (!ALLOWED_NAMESPACES[elementNamespace]) return false;
1438
+ if (elementNamespace === SVG_NAMESPACE) return _checkSvgNamespace(tagName, parentNamespace, parentTagName);
1439
+ if (elementNamespace === MATHML_NAMESPACE) return _checkMathMlNamespace(tagName, parentNamespace, parentTagName);
1440
+ if (elementNamespace === HTML_NAMESPACE) return _checkHtmlNamespace(tagName, parentNamespace, parentTagName);
1441
+ return PARSER_MEDIA_TYPE === "application/xhtml+xml";
1442
+ };
1443
+ /**
1444
+ * _forceRemove
1445
+ *
1446
+ * @param node a DOM node
1447
+ */
1448
+ const _forceRemove = function _forceRemove(node) {
1449
+ arrayPush(DOMPurify.removed, { element: node });
1450
+ try {
1451
+ getParentNode(node).removeChild(node);
1452
+ } catch (_) {
1453
+ remove(node);
1454
+ if (!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");
1455
+ }
1456
+ };
1457
+ /**
1458
+ * Removes an Attr node as that exact node, without book-keeping. Name-based
1459
+ * removal lowercases the name in HTML documents and would miss a
1460
+ * case-preserved one such as `ONERROR`, so it is only the fallback for
1461
+ * clobbered or detached nodes.
1462
+ *
1463
+ * @param element the element to strip the attribute from
1464
+ * @param attribute the Attr node to remove
1465
+ * @param name the attribute's name, for the fallback path
1466
+ */
1467
+ const _stripAttributeNode = function _stripAttributeNode(element, attribute, name) {
1468
+ try {
1469
+ removeAttributeNode(element, attribute);
1470
+ } catch (_) {
1471
+ try {
1472
+ element.removeAttribute(name);
1473
+ } catch (_) {}
1474
+ }
1475
+ };
1476
+ /**
1477
+ * Fail-closed teardown of an in-place root: strip every disallowed attribute
1478
+ * in the subtree first, so nothing armed is left behind, then remove all
1479
+ * children and the root's own attributes.
1480
+ *
1481
+ * @param root the in-place root to empty
1482
+ */
1483
+ const _neutralizeRoot = function _neutralizeRoot(root) {
1484
+ _neutralizeSubtree(root);
1485
+ const childNodes = getChildNodes(root);
1486
+ if (childNodes) arrayForEach(arraySlice(childNodes), (child) => {
1487
+ try {
1488
+ remove(child);
1489
+ } catch (_) {}
1490
+ });
1491
+ if (_readNodeType(root) === NODE_TYPE.element) _stripAttributes(root, false);
1492
+ };
1493
+ /**
1494
+ * Removes an attribute, preferably as its exact Attr node: name-based
1495
+ * removal lowercases the name in HTML documents and misses case-preserved
1496
+ * names, e.g. from imported XHTML.
1497
+ *
1498
+ * @param name an Attribute name
1499
+ * @param element a DOM node
1500
+ * @param attr the exact Attr node to remove, when the caller has it
1501
+ */
1502
+ const _removeAttribute = function _removeAttribute(name, element, attr) {
1503
+ if (!attr) try {
1504
+ attr = element.getAttributeNode(name);
1505
+ } catch (_) {
1506
+ attr = null;
1507
+ }
1508
+ arrayPush(DOMPurify.removed, {
1509
+ attribute: attr || null,
1510
+ from: element
1511
+ });
1512
+ if (attr) _stripAttributeNode(element, attr, name);
1513
+ else try {
1514
+ element.removeAttribute(name);
1515
+ } catch (_) {}
1516
+ if (name === "is") {
1517
+ if (RETURN_DOM || RETURN_DOM_FRAGMENT) try {
1518
+ _forceRemove(element);
1519
+ } catch (_) {}
1520
+ else try {
1521
+ element.setAttribute(name, "");
1522
+ } catch (_) {}
1523
+ }
1524
+ };
1525
+ /**
1526
+ * Removes an element's attributes without book-keeping. Used to neutralize
1527
+ * nodes discarded from an in-place tree.
1528
+ *
1529
+ * @param element the element to strip
1530
+ * @param keepAllowed whether attributes on the allowlist stay
1531
+ */
1532
+ const _stripAttributes = function _stripAttributes(element, keepAllowed) {
1533
+ const attributes = getAttributes(element);
1534
+ if (!attributes) return;
1535
+ for (let i = attributes.length - 1; i >= 0; --i) {
1536
+ const attribute = attributes[i];
1537
+ const name = attribute && attribute.name;
1538
+ if (typeof name === "string" && !(keepAllowed && ALLOWED_ATTR[transformCaseFunc(name)])) _stripAttributeNode(element, attribute, name);
1539
+ }
1540
+ };
1541
+ /**
1542
+ * Iterative depth-first walk, so deep trees cannot overflow the call stack,
1543
+ * reading through the cached getters, so clobbering cannot hide children.
1544
+ * When `visit` returns false, the node's children are skipped. With
1545
+ * `intoShadow`, open shadow roots are walked after their host's children.
1546
+ *
1547
+ * @param root where to start
1548
+ * @param visit called for every node
1549
+ * @param intoShadow whether to enter open shadow roots
1550
+ */
1551
+ const _walkTree = function _walkTree(root, visit) {
1552
+ let intoShadow = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
1553
+ const stack = [root];
1554
+ while (stack.length > 0) {
1555
+ const node = stack.pop();
1556
+ if (visit(node) === false) continue;
1557
+ if (intoShadow && _readNodeType(node) === NODE_TYPE.element) {
1558
+ const shadowRoot = getShadowRoot(node);
1559
+ if (_isDocumentFragment(shadowRoot)) stack.push(shadowRoot);
1560
+ }
1561
+ const childNodes = getChildNodes(node);
1562
+ if (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push(childNodes[i]);
1563
+ }
1564
+ };
1565
+ /**
1566
+ * Strips disallowed attributes from every element of a discarded subtree,
1567
+ * so a handler that is already queued (a loading image) cannot fire.
1568
+ *
1569
+ * @param root the root of a removed subtree
1570
+ */
1571
+ const _neutralizeSubtree = function _neutralizeSubtree(root) {
1572
+ _walkTree(root, (node) => {
1573
+ if (_readNodeType(node) === NODE_TYPE.element) _stripAttributes(node, true);
1574
+ });
1575
+ };
1576
+ /**
1577
+ * All nodes under `root`, root first, including open shadow roots. Template
1578
+ * content is not entered, it is inert.
1579
+ *
1580
+ * @param root the in-place root
1581
+ * @return the nodes
1582
+ */
1583
+ const _collectLiveNodes = function _collectLiveNodes(root) {
1584
+ const nodes = [];
1585
+ _walkTree(root, (node) => {
1586
+ nodes.push(node);
1587
+ }, true);
1588
+ return nodes;
1589
+ };
1590
+ /**
1591
+ * Strips disallowed attributes from every element that was under the
1592
+ * in-place root when the call started and no longer is, whatever removed
1593
+ * or moved it.
1594
+ *
1595
+ * @param root the in-place root
1596
+ * @param before the root's nodes, collected before the walk
1597
+ */
1598
+ const _neutralizeEscapedElements = function _neutralizeEscapedElements(root, before) {
1599
+ const reachable = setCreate();
1600
+ arrayForEach(_collectLiveNodes(root), (node) => {
1601
+ if (_readNodeType(node) === NODE_TYPE.element) setAdd(reachable, node);
1602
+ });
1603
+ arrayForEach(before, (node) => {
1604
+ if (_readNodeType(node) === NODE_TYPE.element && !setHas(reachable, node)) _stripAttributes(node, true);
1605
+ });
1606
+ };
1607
+ /**
1608
+ * Neutralizes everything that left the in-place tree during the call: what
1609
+ * DOMPurify removed, and what hooks or custom elements removed or moved out.
1610
+ *
1611
+ * @param root the in-place root
1612
+ * @param before the root's nodes, collected before the walk
1613
+ * @return true if the root itself was removed
1614
+ */
1615
+ const _neutralizeDiscarded = function _neutralizeDiscarded(root, before) {
1616
+ let rootRemoved = false;
1617
+ arrayForEach(DOMPurify.removed, (entry) => {
1618
+ if (entry.element) {
1619
+ rootRemoved = rootRemoved || entry.element === root;
1620
+ _neutralizeSubtree(entry.element);
1621
+ }
1622
+ });
1623
+ _neutralizeEscapedElements(root, before);
1624
+ return rootRemoved;
1625
+ };
1626
+ const MAX_UNVISITED_ROUNDS = 8;
1627
+ /**
1628
+ * The walk only moves forward, so a node moved to a position it already
1629
+ * passed is never visited. Give every original node that is still in the
1630
+ * tree but unvisited the normal treatment, hooks included. Nodes created
1631
+ * during the call are left alone. Fails closed if the tree keeps changing.
1632
+ *
1633
+ * @param root the in-place root
1634
+ * @param before the root's nodes, collected before the walk
1635
+ */
1636
+ const _sanitizeUnvisitedNodes = function _sanitizeUnvisitedNodes(root, before) {
1637
+ const visited = IN_PLACE_VISITED;
1638
+ let original = null;
1639
+ const getOriginal = () => {
1640
+ if (!original) {
1641
+ original = setCreate();
1642
+ arrayForEach(before, (beforeNode) => {
1643
+ setAdd(original, beforeNode);
1644
+ });
1645
+ }
1646
+ return original;
1647
+ };
1648
+ for (let round = 0;; round++) {
1649
+ const live = _collectLiveNodes(root);
1650
+ const containers = [root];
1651
+ let pending = false;
1652
+ arrayForEach(live, (node) => {
1653
+ if (_readNodeType(node) === NODE_TYPE.documentFragment) arrayPush(containers, node);
1654
+ else if (!pending && !setHas(visited, node)) pending = setHas(getOriginal(), node);
1655
+ });
1656
+ if (!pending) return;
1657
+ if (round >= MAX_UNVISITED_ROUNDS) throw typeErrorCreate("the tree kept changing during in-place sanitization; refusing to return it");
1658
+ arrayForEach(containers, (container, index) => {
1659
+ _sanitizeUnvisitedIn(container, index > 0, root, getOriginal());
1660
+ });
1661
+ }
1662
+ };
1663
+ /**
1664
+ * One _sanitizeUnvisitedNodes pass over the root or an open shadow root.
1665
+ *
1666
+ * @param container the root or an open shadow root
1667
+ * @param inShadow whether container is a shadow root
1668
+ * @param root the in-place root
1669
+ * @param original the root's nodes collected before the walk, as a set
1670
+ */
1671
+ const _sanitizeUnvisitedIn = function _sanitizeUnvisitedIn(container, inShadow, root, original) {
1672
+ const iterator = _createNodeIterator(container);
1673
+ let node;
1674
+ while (node = iterator.nextNode()) {
1675
+ if (!setHas(original, node) || setHas(IN_PLACE_VISITED, node)) continue;
1676
+ if (inShadow) _executeHooks(hooks.uponSanitizeShadowNode, node, null);
1677
+ _sanitizeNode(node, root);
1678
+ }
1679
+ };
1680
+ /**
1681
+ * Records that _sanitizeElements processed `node`. No-op outside IN_PLACE.
1682
+ *
1683
+ * @param node the node being processed
1684
+ */
1685
+ const _markVisited = function _markVisited(node) {
1686
+ if (IN_PLACE_VISITED) setAdd(IN_PLACE_VISITED, node);
1687
+ };
1688
+ /**
1689
+ * Patch-linkage attributes (declarative partial updates): `patchsrc`
1690
+ * always, `for` everywhere except on <label> and <output>. Gated on
1691
+ * SAFE_FOR_XML. Shared by the IN_PLACE pre-pass and _isValidAttribute.
1692
+ *
1693
+ * @param lcName the transformCaseFunc'd attribute name
1694
+ * @param lcTag the transformCaseFunc'd tag name of the carrying element
1695
+ * @return true if the attribute is patch linkage and must be dropped
1696
+ */
1697
+ const _isPatchLinkageAttribute = function _isPatchLinkageAttribute(lcName, lcTag) {
1698
+ if (!SAFE_FOR_XML) return false;
1699
+ if (lcName === "patchsrc") return true;
1700
+ return lcName === "for" && lcTag !== "label" && lcTag !== "output";
1701
+ };
1702
+ /**
1703
+ * IN_PLACE pre-pass: sever all patch linkage before the walk, so no patch
1704
+ * can fire mid-walk into a part of the tree the walker already passed.
1705
+ * Removes range markers (processing instructions, comments with markup)
1706
+ * and strips linkage attributes. It cannot undo a patch that already fired.
1707
+ *
1708
+ * TODO: if the shipped feature can patch through `for` on <label>/<output>,
1709
+ * drop that pair here too.
1710
+ *
1711
+ * @param root the in-place root to sweep
1712
+ */
1713
+ const _neutralizePatchLinkage = function _neutralizePatchLinkage(root) {
1714
+ if (!SAFE_FOR_XML) return;
1715
+ _walkTree(root, (node) => {
1716
+ const nodeType = _readNodeType(node);
1717
+ if (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {
1718
+ try {
1719
+ remove(node);
1720
+ } catch (_) {}
1721
+ return false;
1722
+ }
1723
+ if (nodeType === NODE_TYPE.element) {
1724
+ const element = node;
1725
+ const lcTag = transformCaseFunc(_readNodeName(node));
1726
+ try {
1727
+ if (element.hasAttribute && element.hasAttribute("patchsrc")) element.removeAttribute("patchsrc");
1728
+ if (element.hasAttribute && element.hasAttribute("for") && _isPatchLinkageAttribute("for", lcTag)) element.removeAttribute("for");
1729
+ } catch (_) {}
1730
+ }
1731
+ return true;
1732
+ });
1733
+ };
1734
+ /**
1735
+ * _initDocument
1736
+ *
1737
+ * @param dirty - a string of dirty markup
1738
+ * @return a DOM, filled with the dirty markup
1739
+ */
1740
+ const _initDocument = function _initDocument(dirty) {
1741
+ let doc = null;
1742
+ let leadingWhitespace = null;
1743
+ if (FORCE_BODY) dirty = "<remove></remove>" + dirty;
1744
+ else {
1745
+ const matches = stringMatch(dirty, LEADING_WHITESPACE);
1746
+ leadingWhitespace = matches && matches[0];
1747
+ }
1748
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) dirty = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + dirty + "</body></html>";
1749
+ const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;
1750
+ if (NAMESPACE === HTML_NAMESPACE) try {
1751
+ doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
1752
+ } catch (_) {}
1753
+ if (!doc || !doc.documentElement) {
1754
+ doc = implementation.createDocument(NAMESPACE, "template", null);
1755
+ try {
1756
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
1757
+ } catch (_) {}
1758
+ }
1759
+ const body = doc.body || doc.documentElement;
1760
+ if (dirty && leadingWhitespace) body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
1761
+ if (NAMESPACE === HTML_NAMESPACE) return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
1762
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
1763
+ };
1764
+ /**
1765
+ * Creates a NodeIterator over `root`. ownerDocument is read through the
1766
+ * cached getter: a form child named "ownerDocument" shadows the direct
1767
+ * read and would make createNodeIterator throw.
1768
+ *
1769
+ * @param root The node to start traversing on.
1770
+ * @param characterDataOnly whether to skip elements
1771
+ * @return The created NodeIterator
1772
+ */
1773
+ const _createNodeIterator = function _createNodeIterator(root) {
1774
+ let characterDataOnly = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
1775
+ const doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;
1776
+ return createNodeIterator.call(doc || root, root, (characterDataOnly ? 0 : NodeFilter.SHOW_ELEMENT) | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
1777
+ };
1778
+ /**
1779
+ * Replace template expression syntax (mustache, ERB, template
1780
+ * literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub
1781
+ * sites. Order matters: mustache, then ERB, then template literal.
1782
+ *
1783
+ * @param value the string to scrub
1784
+ * @returns the scrubbed string
1785
+ */
1786
+ const _stripTemplateExpressions = function _stripTemplateExpressions(value) {
1787
+ value = stringReplace(value, MUSTACHE_EXPR$1, " ");
1788
+ value = stringReplace(value, ERB_EXPR$1, " ");
1789
+ value = stringReplace(value, TMPLIT_EXPR$1, " ");
1790
+ return value;
1791
+ };
1792
+ /**
1793
+ * Strips template expressions from the character data under `node`,
1794
+ * template contents included. Runs after the walk, since an expression can
1795
+ * also form when a removed element leaves two text nodes adjacent. Works on
1796
+ * the nodes rather than on markup, which keeps node references intact and
1797
+ * sees `<%` unescaped. Attribute values are handled in _sanitizeAttributes.
1798
+ *
1799
+ * @param node The root element whose character data should be scrubbed.
1800
+ */
1801
+ const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {
1802
+ var _node$querySelectorAl;
1803
+ _scrubOwnCharacterData(node);
1804
+ const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, "template");
1805
+ if (templates) arrayForEach(templates, (tmpl) => {
1806
+ if (_isDocumentFragment(tmpl.content)) _scrubTemplateExpressions2(tmpl.content);
1807
+ });
1808
+ };
1809
+ /**
1810
+ * Normalizes `node` and strips template expressions from its own character
1811
+ * data. Template contents and shadow roots are not entered, their own
1812
+ * _sanitizeShadowDOM call scrubs them.
1813
+ *
1814
+ * @param node The root whose own character data should be scrubbed.
1815
+ */
1816
+ const _scrubOwnCharacterData = function _scrubOwnCharacterData(node) {
1817
+ node.normalize();
1818
+ const walker = _createNodeIterator(node, true);
1819
+ let currentNode = walker.nextNode();
1820
+ while (currentNode) {
1821
+ currentNode.data = _stripTemplateExpressions(currentNode.data);
1822
+ currentNode = walker.nextNode();
1823
+ }
1824
+ };
1825
+ /**
1826
+ * Detects DOM clobbering on a form, the only element whose named children
1827
+ * shadow its own properties. Each probe compares a direct read with what
1828
+ * the property has to be.
1829
+ *
1830
+ * @param element element to check for clobbering attacks
1831
+ * @return true if clobbered, false if safe
1832
+ */
1833
+ const _isClobbered = function _isClobbered(element) {
1834
+ const realTagName = getNodeName ? getNodeName(element) : null;
1835
+ if (typeof realTagName !== "string") return false;
1836
+ if (transformCaseFunc(realTagName) !== "form") return false;
1837
+ return 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);
1838
+ };
1839
+ /**
1840
+ * Reads nodeType through the cached getter, so the result holds for nodes
1841
+ * from any realm (GHSA-4w3q-35jp-p934) and cannot be clobbered.
1842
+ *
1843
+ * @param value anything
1844
+ * @return the node type, or null if value is not a DOM node
1845
+ */
1846
+ const _nodeTypeOf = function _nodeTypeOf(value) {
1847
+ if (!getNodeType || typeof value !== "object" || value === null) return null;
1848
+ try {
1849
+ const nodeType = getNodeType(value);
1850
+ return typeof nodeType === "number" ? nodeType : null;
1851
+ } catch (_) {
1852
+ return null;
1853
+ }
1854
+ };
1855
+ const _isDocumentFragment = function _isDocumentFragment(value) {
1856
+ return _nodeTypeOf(value) === NODE_TYPE.documentFragment;
1857
+ };
1858
+ const _isNode = function _isNode(value) {
1859
+ return _nodeTypeOf(value) !== null;
1860
+ };
1861
+ function _executeHooks(hooks, currentNode, data) {
1862
+ if (hooks.length === 0) return;
1863
+ arrayForEach(hooks, (hook) => {
1864
+ hook.call(DOMPurify, currentNode, data, CONFIG);
1865
+ });
1866
+ }
1867
+ /**
1868
+ * Structural-threat checks that condemn a node regardless of the
1869
+ * allowlists: mXSS via namespace confusion, risky CSS construction,
1870
+ * processing instructions, markup-bearing comments. Pure predicate;
1871
+ * the caller removes. Check order is load-bearing.
1872
+ *
1873
+ * @param currentNode the node to inspect
1874
+ * @param tagName the node's transformCaseFunc'd tag name
1875
+ * @param nodeType the node's type, read through the cached getter
1876
+ * @return true if the node must be removed
1877
+ */
1878
+ const _isUnsafeNode = function _isUnsafeNode(currentNode, tagName, nodeType) {
1879
+ if (SAFE_FOR_XML && nodeType === NODE_TYPE.element && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) return true;
1880
+ if (SAFE_FOR_XML && LITERAL_TEXT_ELEMENTS[tagName] && nodeType === NODE_TYPE.element && _readNamespaceURI(currentNode) === HTML_NAMESPACE && (_isNode(currentNode.firstElementChild) || typeof currentNode.textContent === "string" && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent))) return true;
1881
+ if (nodeType === NODE_TYPE.processingInstruction) return true;
1882
+ if (SAFE_FOR_XML && nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) return true;
1883
+ return false;
1884
+ };
1885
+ /**
1886
+ * Evaluate a CUSTOM_ELEMENT_HANDLING check (a RegExp or a predicate
1887
+ * function, per the validation in _parseConfig) against a name.
1888
+ * Additional arguments are forwarded to predicate functions - the
1889
+ * attributeNameCheck predicate receives the tag name as its second
1890
+ * argument. A null/absent check never matches.
1891
+ *
1892
+ * @param check the configured tagNameCheck / attributeNameCheck value
1893
+ * @param name the name to test
1894
+ * @param args extra arguments forwarded to a predicate function
1895
+ * @return true if the check matches the name
1896
+ */
1897
+ const _matchesNameCheck = function _matchesNameCheck(check, name) {
1898
+ if (check instanceof RegExp) return regExpTest(check, name);
1899
+ if (check instanceof Function) {
1900
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];
1901
+ return Boolean(check(name, ...args));
1902
+ }
1903
+ return false;
1904
+ };
1905
+ /**
1906
+ * Handles a node whose tag is forbidden or not allowlisted: hoists its
1907
+ * content per KEEP_CONTENT and removes it. The one exception is a custom
1908
+ * element allowed via CUSTOM_ELEMENT_HANDLING, which is kept.
1909
+ *
1910
+ * @param currentNode the disallowed node
1911
+ * @param tagName the node's transformCaseFunc'd tag name
1912
+ * @return true if the node was removed, false if kept
1913
+ */
1914
+ const _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName, root) {
1915
+ if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;
1916
+ if (KEEP_CONTENT && !FORBID_CONTENTS[tagName] && !FORBID_CONTENTS[stringToLowerCase(tagName)]) {
1917
+ const parentNode = getParentNode(currentNode);
1918
+ const childNodes = getChildNodes(currentNode);
1919
+ if (childNodes && parentNode) {
1920
+ const childCount = childNodes.length;
1921
+ for (let i = childCount - 1; i >= 0; --i) {
1922
+ const hoisted = currentNode === root ? cloneNode(childNodes[i], true) : childNodes[i];
1923
+ parentNode.insertBefore(hoisted, getNextSibling(currentNode));
1924
+ }
1925
+ }
1926
+ }
1927
+ _forceRemove(currentNode);
1928
+ return true;
1929
+ };
1930
+ /**
1931
+ * Forks an allowlist off its shared binding (the instance default or the
1932
+ * setConfig() capture) before a hook sees it, so a hook's widening stays
1933
+ * within the call. A set that is already call-local is returned as is.
1934
+ *
1935
+ * @param hookList the uponSanitize* hook array for this event
1936
+ * @param set the current ALLOWED_TAGS / ALLOWED_ATTR binding
1937
+ * @param defaultSet the per-instance DEFAULT_ALLOWED_* constant
1938
+ * @param setConfigSet the captured setConfig() binding, or null
1939
+ * @return a call-local clone if a hook is present and set is still shared,
1940
+ * else set unchanged
1941
+ */
1942
+ const _forkSharedAllowlist = function _forkSharedAllowlist(hookList, set, defaultSet, setConfigSet) {
1943
+ if (hookList.length === 0) return set;
1944
+ return set === defaultSet || set === setConfigSet ? cloneSet(set) : set;
1945
+ };
1946
+ /**
1947
+ * A hook may have detached the node it was called for. If so, treat it as
1948
+ * removed and stop processing it; the walk root is exempt. On the IN_PLACE
1949
+ * path the detached subtree is neutralized right away.
1950
+ *
1951
+ * @param currentNode the node a hook may have detached
1952
+ * @param root the current walk root
1953
+ * @return true if the node was detached
1954
+ */
1955
+ const _handleHookDetachedNode = function _handleHookDetachedNode(currentNode, root) {
1956
+ if (currentNode === root || getParentNode(currentNode) !== null) return false;
1957
+ if (IN_PLACE) _neutralizeSubtree(currentNode);
1958
+ return true;
1959
+ };
1960
+ /**
1961
+ * _sanitizeElements
1962
+ *
1963
+ * @protect nodeName
1964
+ * @protect textContent
1965
+ * @protect removeChild
1966
+ * @param currentNode to check for permission to exist
1967
+ * @return true if node was killed, false if left alive
1968
+ */
1969
+ const _sanitizeElements = function _sanitizeElements(currentNode, root) {
1970
+ _markVisited(currentNode);
1971
+ _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
1972
+ if (_handleHookDetachedNode(currentNode, root)) return true;
1973
+ if (_isClobbered(currentNode)) {
1974
+ _forceRemove(currentNode);
1975
+ return true;
1976
+ }
1977
+ const tagName = transformCaseFunc(_readNodeName(currentNode));
1978
+ const nodeType = _readNodeType(currentNode);
1979
+ ALLOWED_TAGS = _forkSharedAllowlist(hooks.uponSanitizeElement, ALLOWED_TAGS, DEFAULT_ALLOWED_TAGS, SET_CONFIG_ALLOWED_TAGS);
1980
+ _executeHooks(hooks.uponSanitizeElement, currentNode, {
1981
+ tagName,
1982
+ allowedTags: ALLOWED_TAGS
1983
+ });
1984
+ if (_handleHookDetachedNode(currentNode, root)) return true;
1985
+ if (_isUnsafeNode(currentNode, tagName, nodeType)) {
1986
+ _forceRemove(currentNode);
1987
+ return true;
1988
+ }
1989
+ if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
1990
+ const removed = _sanitizeDisallowedNode(currentNode, tagName, root);
1991
+ if (removed === false) {
1992
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
1993
+ if (_handleHookDetachedNode(currentNode, root)) return true;
1994
+ }
1995
+ return removed;
1996
+ }
1997
+ if (nodeType === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {
1998
+ _forceRemove(currentNode);
1999
+ return true;
2000
+ }
2001
+ if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {
2002
+ _forceRemove(currentNode);
2003
+ return true;
2004
+ }
2005
+ if (SAFE_FOR_TEMPLATES && nodeType === NODE_TYPE.text) {
2006
+ const text = currentNode.textContent;
2007
+ const content = _stripTemplateExpressions(text);
2008
+ if (text !== content) {
2009
+ arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
2010
+ currentNode.textContent = content;
2011
+ }
2012
+ }
2013
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
2014
+ return _handleHookDetachedNode(currentNode, root);
2015
+ };
2016
+ /**
2017
+ * _isValidAttribute
2018
+ *
2019
+ * @param lcTag Lowercase tag name of containing element.
2020
+ * @param lcName Lowercase attribute name.
2021
+ * @param value Attribute value.
2022
+ * @return Returns true if `value` is valid, otherwise false.
2023
+ */
2024
+ const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
2025
+ if (FORBID_ATTR[lcName]) return false;
2026
+ if (_isPatchLinkageAttribute(lcName, lcTag)) return false;
2027
+ if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document || value in formElement)) return false;
2028
+ const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);
2029
+ if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) return true;
2030
+ if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) return true;
2031
+ if (!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);
2032
+ if (URI_SAFE_ATTRIBUTES[lcName]) return true;
2033
+ const compactValue = stringReplace(value, ATTR_WHITESPACE$1, "");
2034
+ if (regExpTest(IS_ALLOWED_URI$1, compactValue)) return true;
2035
+ if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag]) return true;
2036
+ if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, compactValue)) return true;
2037
+ return !value;
2038
+ };
2039
+ const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, [
2040
+ "annotation-xml",
2041
+ "color-profile",
2042
+ "font-face",
2043
+ "font-face-format",
2044
+ "font-face-name",
2045
+ "font-face-src",
2046
+ "font-face-uri",
2047
+ "missing-glyph"
2048
+ ]);
2049
+ /**
2050
+ * _isBasicCustomElement
2051
+ * checks if at least one dash is included in tagName, and it's not the first char
2052
+ * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
2053
+ *
2054
+ * @param tagName name of the tag of the node to sanitize
2055
+ * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
2056
+ */
2057
+ const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
2058
+ return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);
2059
+ };
2060
+ /**
2061
+ * Wrap an attribute value in the matching Trusted Types object when
2062
+ * the active policy requires it. Namespaced attributes pass through
2063
+ * unchanged (no TT support yet, see
2064
+ * https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).
2065
+ *
2066
+ * @param lcTag lowercase tag name of the containing element
2067
+ * @param lcName lowercase attribute name
2068
+ * @param namespaceURI the attribute's namespace, if any
2069
+ * @param value the attribute value to wrap
2070
+ * @return the value, wrapped when Trusted Types demand it
2071
+ */
2072
+ const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {
2073
+ if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function" && !namespaceURI) switch (trustedTypes.getAttributeType(lcTag, lcName)) {
2074
+ case "TrustedHTML": return _createTrustedHTML(value);
2075
+ case "TrustedScriptURL": return _createTrustedScriptURL(value);
2076
+ }
2077
+ return value;
2078
+ };
2079
+ /**
2080
+ * Writes a changed attribute value back. If the new value clobbers, the
2081
+ * element is removed; if the write fails, the attribute is.
2082
+ *
2083
+ * @param currentNode the element carrying the attribute
2084
+ * @param name the attribute name as present on the element
2085
+ * @param namespaceURI the attribute's namespace, if any
2086
+ * @param value the new attribute value
2087
+ * @return true if the value was written without introducing clobbering
2088
+ */
2089
+ const _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {
2090
+ try {
2091
+ if (namespaceURI) currentNode.setAttributeNS(namespaceURI, name, value);
2092
+ else currentNode.setAttribute(name, value);
2093
+ if (_isClobbered(currentNode)) {
2094
+ _forceRemove(currentNode);
2095
+ return false;
2096
+ }
2097
+ return true;
2098
+ } catch (_) {
2099
+ _removeAttribute(name, currentNode);
2100
+ return false;
2101
+ }
2102
+ };
2103
+ /**
2104
+ * Value checks that apply before a hook can force-keep an attribute. Also
2105
+ * used by isValidAttribute(), so it never approves a value that sanitize()
2106
+ * would strip.
2107
+ *
2108
+ * @param name the attribute name as found on the node (case preserved)
2109
+ * @param value the attribute value
2110
+ * @returns true if the attribute must be removed because of its value
2111
+ */
2112
+ const _isUnsafeAttributeValue = function _isUnsafeAttributeValue(name, value) {
2113
+ if (SAFE_FOR_XML && regExpTest(ATTR_VALUE_BREAKOUT, value)) return true;
2114
+ return stringToLowerCase(name) === "attributename" && stringIndexOf(value, "href") !== -1;
2115
+ };
2116
+ /**
2117
+ * _sanitizeAttributes
2118
+ *
2119
+ * @protect attributes
2120
+ * @protect nodeName
2121
+ * @protect removeAttribute
2122
+ * @protect setAttribute
2123
+ *
2124
+ * @param currentNode to sanitize
2125
+ * @param root the current walk root
2126
+ */
2127
+ const _sanitizeAttributes = function _sanitizeAttributes(currentNode, root) {
2128
+ _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
2129
+ if (_handleHookDetachedNode(currentNode, root)) return;
2130
+ const attributes = currentNode.attributes;
2131
+ if (!attributes || _isClobbered(currentNode)) return;
2132
+ ALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);
2133
+ const hookEvent = {
2134
+ attrName: "",
2135
+ attrValue: "",
2136
+ keepAttr: true,
2137
+ allowedAttributes: ALLOWED_ATTR,
2138
+ forceKeepAttr: void 0
2139
+ };
2140
+ let l = attributes.length;
2141
+ const lcTag = transformCaseFunc(_readNodeName(currentNode));
2142
+ while (l--) {
2143
+ const attr = attributes[l];
2144
+ const name = attr.name, namespaceURI = attr.namespaceURI, attrValue = attr.value;
2145
+ const lcName = transformCaseFunc(name);
2146
+ const initValue = attrValue;
2147
+ let value = name === "value" ? initValue : stringTrim(initValue);
2148
+ let recreatedNamedProp = false;
2149
+ hookEvent.attrName = lcName;
2150
+ hookEvent.attrValue = value;
2151
+ hookEvent.keepAttr = true;
2152
+ hookEvent.forceKeepAttr = void 0;
2153
+ _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
2154
+ value = hookEvent.attrValue;
2155
+ if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {
2156
+ _removeAttribute(name, currentNode, attr);
2157
+ value = SANITIZE_NAMED_PROPS_PREFIX + value;
2158
+ recreatedNamedProp = true;
2159
+ }
2160
+ if (_isUnsafeAttributeValue(name, value)) {
2161
+ _removeAttribute(name, currentNode, attr);
2162
+ continue;
2163
+ }
2164
+ if (hookEvent.forceKeepAttr) continue;
2165
+ if (!hookEvent.keepAttr) {
2166
+ _removeAttribute(name, currentNode, attr);
2167
+ continue;
2168
+ }
2169
+ if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {
2170
+ _removeAttribute(name, currentNode, attr);
2171
+ continue;
2172
+ }
2173
+ if (SAFE_FOR_TEMPLATES) value = _stripTemplateExpressions(value);
2174
+ if (!_isValidAttribute(lcTag, lcName, value)) {
2175
+ _removeAttribute(name, currentNode, attr);
2176
+ continue;
2177
+ }
2178
+ value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
2179
+ if (value !== initValue) {
2180
+ if (_setAttributeValue(currentNode, name, namespaceURI, value) && recreatedNamedProp) arrayPop(DOMPurify.removed);
2181
+ }
2182
+ }
2183
+ _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
2184
+ _handleHookDetachedNode(currentNode, root);
2185
+ };
2186
+ /**
2187
+ * Sanitizes one node: the node itself, its attributes and, for a
2188
+ * template, its content.
2189
+ *
2190
+ * @param node the node to sanitize
2191
+ * @param root the current walk root
2192
+ */
2193
+ const _sanitizeNode = function _sanitizeNode(node, root) {
2194
+ _sanitizeElements(node, root);
2195
+ _sanitizeAttributes(node, root);
2196
+ if (_isDocumentFragment(node.content)) _sanitizeShadowDOM2(node.content);
2197
+ };
2198
+ /**
2199
+ * _sanitizeShadowDOM
2200
+ *
2201
+ * @param fragment to iterate over recursively
2202
+ */
2203
+ const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {
2204
+ let shadowNode = null;
2205
+ const shadowIterator = _createNodeIterator(fragment);
2206
+ _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
2207
+ while (shadowNode = shadowIterator.nextNode()) {
2208
+ _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
2209
+ _sanitizeNode(shadowNode, fragment);
2210
+ if (_readNodeType(shadowNode) === NODE_TYPE.element) {
2211
+ const innerSr = getShadowRoot(shadowNode);
2212
+ if (_isDocumentFragment(innerSr)) {
2213
+ _sanitizeAttachedShadowRoots(innerSr);
2214
+ _sanitizeShadowDOM2(innerSr);
2215
+ }
2216
+ }
2217
+ }
2218
+ if (SAFE_FOR_TEMPLATES) _scrubOwnCharacterData(fragment);
2219
+ _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
2220
+ };
2221
+ /**
2222
+ * Sanitizes every attached shadow root under `root`, since the node
2223
+ * iterator does not enter shadow trees. Needed for IN_PLACE input and for
2224
+ * DOM input whose clonable shadow roots were copied by importNode().
2225
+ *
2226
+ * @param root the subtree root to walk for attached shadow roots
2227
+ */
2228
+ const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {
2229
+ const stack = [{
2230
+ node: root,
2231
+ shadow: null
2232
+ }];
2233
+ while (stack.length > 0) {
2234
+ const item = stack.pop();
2235
+ if (item.shadow) {
2236
+ _sanitizeShadowDOM2(item.shadow);
2237
+ continue;
2238
+ }
2239
+ const node = item.node;
2240
+ const isElement = _readNodeType(node) === NODE_TYPE.element;
2241
+ const childNodes = getChildNodes(node);
2242
+ if (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push({
2243
+ node: childNodes[i],
2244
+ shadow: null
2245
+ });
2246
+ if (isElement) {
2247
+ const rootName = getNodeName ? getNodeName(node) : null;
2248
+ if (typeof rootName === "string" && transformCaseFunc(rootName) === "template") {
2249
+ const content = node.content;
2250
+ if (_isDocumentFragment(content)) stack.push({
2251
+ node: content,
2252
+ shadow: null
2253
+ });
2254
+ }
2255
+ }
2256
+ if (isElement) {
2257
+ const sr = getShadowRoot(node);
2258
+ if (_isDocumentFragment(sr)) stack.push({
2259
+ node: null,
2260
+ shadow: sr
2261
+ }, {
2262
+ node: sr,
2263
+ shadow: null
2264
+ });
2265
+ }
2266
+ }
2267
+ };
2268
+ DOMPurify.sanitize = function(dirty) {
2269
+ let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2270
+ let body = null;
2271
+ let importedNode = null;
2272
+ let currentNode = null;
2273
+ let returnNode = null;
2274
+ IS_EMPTY_INPUT = !dirty;
2275
+ if (IS_EMPTY_INPUT) dirty = "<!-->";
2276
+ if (typeof dirty !== "string" && !_isNode(dirty)) {
2277
+ dirty = stringifyValue(dirty);
2278
+ if (typeof dirty !== "string") throw typeErrorCreate("dirty is not a string, aborting");
2279
+ }
2280
+ if (!DOMPurify.isSupported) return dirty;
2281
+ if (SET_CONFIG) {
2282
+ ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;
2283
+ ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;
2284
+ } else _parseConfig(cfg);
2285
+ DOMPurify.removed = [];
2286
+ const inPlace = IN_PLACE && typeof dirty !== "string" && _isNode(dirty);
2287
+ let inPlaceNodes = [];
2288
+ const outerVisited = IN_PLACE_VISITED;
2289
+ if (inPlace) {
2290
+ _neutralizePatchLinkage(dirty);
2291
+ const nn = _readNodeName(dirty);
2292
+ if (typeof nn === "string") {
2293
+ const tagName = transformCaseFunc(nn);
2294
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
2295
+ _neutralizeRoot(dirty);
2296
+ throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
2297
+ }
2298
+ }
2299
+ if (_isClobbered(dirty)) {
2300
+ _neutralizeRoot(dirty);
2301
+ throw typeErrorCreate("root node is clobbered and cannot be sanitized in-place");
2302
+ }
2303
+ inPlaceNodes = _collectLiveNodes(dirty);
2304
+ IN_PLACE_VISITED = setCreate();
2305
+ } else if (_isNode(dirty)) {
2306
+ body = _initDocument("<!---->");
2307
+ importedNode = body.ownerDocument.importNode(dirty, true);
2308
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") body = importedNode;
2309
+ else if (importedNode.nodeName === "HTML") body = importedNode;
2310
+ else body.appendChild(importedNode);
2311
+ _sanitizeAttachedShadowRoots(body);
2312
+ } else {
2313
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf("<") === -1) return _signOutput(dirty);
2314
+ body = _initDocument(dirty);
2315
+ if (!body) return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
2316
+ }
2317
+ if (body && FORCE_BODY) _forceRemove(body.firstChild);
2318
+ const walkRoot = inPlace ? dirty : body;
2319
+ try {
2320
+ if (inPlace) _sanitizeAttachedShadowRoots(dirty);
2321
+ const nodeIterator = _createNodeIterator(walkRoot);
2322
+ while (currentNode = nodeIterator.nextNode()) _sanitizeNode(currentNode, walkRoot);
2323
+ if (inPlace) _sanitizeUnvisitedNodes(dirty, inPlaceNodes);
2324
+ } catch (error) {
2325
+ if (inPlace) {
2326
+ _neutralizeRoot(dirty);
2327
+ _neutralizeDiscarded(dirty, inPlaceNodes);
2328
+ }
2329
+ throw error;
2330
+ } finally {
2331
+ IN_PLACE_VISITED = outerVisited;
2332
+ }
2333
+ if (inPlace) {
2334
+ if (_neutralizeDiscarded(dirty, inPlaceNodes)) throw typeErrorCreate("a node selected for removal could not be safely returned; refusing to sanitize in place");
2335
+ if (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(dirty);
2336
+ return dirty;
2337
+ }
2338
+ if (RETURN_DOM) {
2339
+ if (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(body);
2340
+ if (RETURN_DOM_FRAGMENT) {
2341
+ returnNode = createDocumentFragment.call(body.ownerDocument);
2342
+ while (body.firstChild) returnNode.appendChild(body.firstChild);
2343
+ } else returnNode = body;
2344
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) returnNode = importNode.call(originalDocument, returnNode, true);
2345
+ return returnNode;
2346
+ }
2347
+ const serialize = () => WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
2348
+ let serializedHTML = serialize();
2349
+ if (SAFE_FOR_TEMPLATES && regExpTest(TMPL_MARKER_SERIALIZED, serializedHTML)) {
2350
+ _scrubOwnCharacterData(body);
2351
+ serializedHTML = serialize();
2352
+ }
2353
+ if (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;
2354
+ return _signOutput(serializedHTML);
2355
+ };
2356
+ DOMPurify.setConfig = function() {
2357
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2358
+ _parseConfig(cfg);
2359
+ SET_CONFIG = true;
2360
+ SET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;
2361
+ SET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;
2362
+ };
2363
+ DOMPurify.clearConfig = function() {
2364
+ CONFIG = null;
2365
+ SET_CONFIG = false;
2366
+ SET_CONFIG_ALLOWED_TAGS = null;
2367
+ SET_CONFIG_ALLOWED_ATTR = null;
2368
+ trustedTypesPolicy = defaultTrustedTypesPolicy;
2369
+ emptyHTML = "";
2370
+ };
2371
+ DOMPurify.isValidAttribute = function(tag, attr, value) {
2372
+ if (!CONFIG) _parseConfig({});
2373
+ const lcTag = transformCaseFunc(tag);
2374
+ const lcName = transformCaseFunc(attr);
2375
+ if (typeof value === "string" && (_isUnsafeAttributeValue(attr, value) || !ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value))) return false;
2376
+ return _isValidAttribute(lcTag, lcName, value);
2377
+ };
2378
+ DOMPurify.addHook = function(entryPoint, hookFunction) {
2379
+ if (typeof hookFunction !== "function") return;
2380
+ if (!objectHasOwnProperty(hooks, entryPoint)) return;
2381
+ arrayPush(hooks[entryPoint], hookFunction);
2382
+ };
2383
+ DOMPurify.removeHook = function(entryPoint, hookFunction) {
2384
+ if (!objectHasOwnProperty(hooks, entryPoint)) return;
2385
+ if (hookFunction !== void 0) {
2386
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
2387
+ return index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];
2388
+ }
2389
+ return arrayPop(hooks[entryPoint]);
2390
+ };
2391
+ DOMPurify.removeHooks = function(entryPoint) {
2392
+ if (!objectHasOwnProperty(hooks, entryPoint)) return;
2393
+ hooks[entryPoint] = [];
2394
+ };
2395
+ DOMPurify.removeAllHooks = function() {
2396
+ hooks = _createHooksMap();
2397
+ };
2398
+ return DOMPurify;
2399
+ }
2400
+ var purify_default = createDOMPurify();
2401
+
2402
+ module.exports = purify_default;
2403
+ //# sourceMappingURL=purify.es.js.map