buninu-browser 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (830) hide show
  1. package/AGENTS.md +13 -0
  2. package/Architecture.md +601 -0
  3. package/LICENSE +21 -0
  4. package/LICENSES/Apache-2.0.txt +202 -0
  5. package/LICENSES/BSD-3-Clause-Skia.txt +29 -0
  6. package/LICENSES/Bitstream-Vera.txt +44 -0
  7. package/LICENSES/CC-BY-4.0.txt +396 -0
  8. package/LICENSES/OFL-1.1.txt +91 -0
  9. package/LICENSES/README.md +9 -0
  10. package/LICENSES/acorn.txt +21 -0
  11. package/LICENSES/chromium.txt +27 -0
  12. package/LICENSES/dropflow.txt +19 -0
  13. package/LICENSES/emscripten.txt +102 -0
  14. package/LICENSES/freetype.txt +169 -0
  15. package/LICENSES/happy-dom.txt +22 -0
  16. package/LICENSES/harfbuzz.txt +42 -0
  17. package/LICENSES/icu.txt +512 -0
  18. package/LICENSES/libjpeg-ijg.txt +260 -0
  19. package/LICENSES/libjpeg-turbo.txt +147 -0
  20. package/LICENSES/libpng.txt +134 -0
  21. package/LICENSES/libwebp.txt +30 -0
  22. package/LICENSES/ses-aura.txt +16 -0
  23. package/LICENSES/ses-caja.txt +13 -0
  24. package/LICENSES/ses-corejs.txt +19 -0
  25. package/LICENSES/ses-v8.txt +9 -0
  26. package/LICENSES/ses.txt +201 -0
  27. package/LICENSES/termdom.txt +21 -0
  28. package/LICENSES/wasmpeg.txt +501 -0
  29. package/LICENSES/woff2.txt +19 -0
  30. package/LICENSES/wuffs.txt +211 -0
  31. package/LICENSES/zlib.txt +22 -0
  32. package/Linux +0 -0
  33. package/PORTING.md +825 -0
  34. package/README.md +283 -0
  35. package/THIRD_PARTY_NOTICES.md +224 -0
  36. package/bunfig.toml +2 -0
  37. package/buninu-browser.js +65 -0
  38. package/index.js +149 -0
  39. package/lib/cdp-server.js +1424 -0
  40. package/lib/cdp.js +203 -0
  41. package/lib/happy-dom/entities-adapter.js +51 -0
  42. package/lib/happy-dom/image-size-adapter.js +8 -0
  43. package/lib/happy-dom/mime-type-adapter.js +27 -0
  44. package/lib/happy-dom/parser.js +53 -0
  45. package/lib/happy-dom/websocket-adapter.js +62 -0
  46. package/lib/headless-shell.js +362 -0
  47. package/lib/input/hit-test.js +78 -0
  48. package/lib/layout/scroll-viewport.js +53 -0
  49. package/lib/layout/text-layout.js +2236 -0
  50. package/lib/log.js +85 -0
  51. package/lib/network/cookie-jar.js +178 -0
  52. package/lib/network/network-service.js +268 -0
  53. package/lib/network/resolver.js +97 -0
  54. package/lib/paint/display-list.js +359 -0
  55. package/lib/paint/frame.js +88 -0
  56. package/lib/paint/gradient.js +207 -0
  57. package/lib/render-tree/index.js +263 -0
  58. package/lib/render-tree/svg.js +210 -0
  59. package/lib/renderer/bindings.js +1291 -0
  60. package/lib/renderer/compositor.js +123 -0
  61. package/lib/renderer/flags.js +20 -0
  62. package/lib/renderer/host.js +503 -0
  63. package/lib/renderer/main.js +234 -0
  64. package/lib/renderer/module-transform.js +399 -0
  65. package/lib/renderer/page-realm.js +1471 -0
  66. package/lib/renderer/page-renderer.js +1691 -0
  67. package/lib/renderer/script-rewrite.js +232 -0
  68. package/lib/renderer/seccomp.js +215 -0
  69. package/lib/renderer/syscall-numbers.js +139 -0
  70. package/lib/style/computed-style.js +2053 -0
  71. package/package.json +39 -0
  72. package/patches/happy-dom/0001-use-bun-entity-adapter.patch +15 -0
  73. package/patches/happy-dom/0002-use-bun-platform-adapters.patch +69 -0
  74. package/patches/happy-dom/README.md +38 -0
  75. package/test/chromium-headless-shell +5 -0
  76. package/test/compositor.test.js +154 -0
  77. package/test/computed-style.test.js +434 -0
  78. package/test/display-list.test.js +128 -0
  79. package/test/entities-adapter.test.js +43 -0
  80. package/test/fixtures/fake-renderer.js +26 -0
  81. package/test/fixtures/seccomp-child.js +32 -0
  82. package/test/fixtures/video.mp4 +0 -0
  83. package/test/flex.test.js +150 -0
  84. package/test/gradient.test.js +56 -0
  85. package/test/grid.test.js +253 -0
  86. package/test/happy-dom-platform-adapters.test.js +18 -0
  87. package/test/headless-shell.test.js +318 -0
  88. package/test/hit-test.test.js +49 -0
  89. package/test/html-parser.test.js +40 -0
  90. package/test/index.test.js +29 -0
  91. package/test/log.test.js +40 -0
  92. package/test/mobile.test.js +85 -0
  93. package/test/network-service.test.js +214 -0
  94. package/test/page-scripts.test.js +552 -0
  95. package/test/poc-backend.js +189 -0
  96. package/test/poc-backend.test.js +154 -0
  97. package/test/positioning.test.js +112 -0
  98. package/test/render-tree.test.js +103 -0
  99. package/test/renderer-host.test.js +69 -0
  100. package/test/resolver.test.js +51 -0
  101. package/test/script-rewrite.test.js +31 -0
  102. package/test/scroll-viewport.test.js +25 -0
  103. package/test/seccomp.test.js +71 -0
  104. package/test/site-isolation.test.js +74 -0
  105. package/test/svg.test.js +61 -0
  106. package/test/text-layout.test.js +419 -0
  107. package/usr/README.md +20 -0
  108. package/usr/lib/canvaskit/LICENSE +29 -0
  109. package/usr/lib/canvaskit/canvaskit.js +264 -0
  110. package/usr/lib/canvaskit/canvaskit.wasm +0 -0
  111. package/usr/share/fonts/DejaVuSansMono-Bold.ttf +0 -0
  112. package/usr/share/fonts/DejaVuSansMono.ttf +0 -0
  113. package/usr/share/fonts/LICENSE-Apache-2.0.txt +202 -0
  114. package/usr/share/fonts/LICENSE-DejaVu.txt +44 -0
  115. package/usr/share/fonts/LICENSE-OFL-1.1.txt +91 -0
  116. package/usr/share/fonts/NotoColorEmoji.ttf +0 -0
  117. package/usr/share/fonts/NotoColorEmojiFlags.ttf +0 -0
  118. package/usr/share/fonts/NotoSansCJK-Regular.ttc +0 -0
  119. package/usr/share/fonts/NotoSansSymbols-Regular-Subsetted.ttf +0 -0
  120. package/usr/share/fonts/NotoSansSymbols-Regular-Subsetted2.ttf +0 -0
  121. package/usr/share/fonts/Roboto-Regular.ttf +0 -0
  122. package/usr/share/fonts/fonts.json +28 -0
  123. package/vendor/acorn/LICENSE +21 -0
  124. package/vendor/acorn/README.md +309 -0
  125. package/vendor/acorn/dist/acorn.mjs +6313 -0
  126. package/vendor/acorn/package.json +50 -0
  127. package/vendor/happy-dom/.editorconfig +8 -0
  128. package/vendor/happy-dom/.eslintignore +6 -0
  129. package/vendor/happy-dom/.eslintrc.cjs +188 -0
  130. package/vendor/happy-dom/.github/CODEOWNERS +2 -0
  131. package/vendor/happy-dom/.github/FUNDING.yml +1 -0
  132. package/vendor/happy-dom/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
  133. package/vendor/happy-dom/.github/ISSUE_TEMPLATE/custom.md +10 -0
  134. package/vendor/happy-dom/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
  135. package/vendor/happy-dom/.github/PULL_REQUEST_TEMPLATE.md +27 -0
  136. package/vendor/happy-dom/.github/workflows/auto-assign.yml +23 -0
  137. package/vendor/happy-dom/.github/workflows/pull_request.yml +53 -0
  138. package/vendor/happy-dom/.github/workflows/release.yml +143 -0
  139. package/vendor/happy-dom/.husky/pre-commit +1 -0
  140. package/vendor/happy-dom/.prettierignore +1 -0
  141. package/vendor/happy-dom/.prettierrc.cjs +6 -0
  142. package/vendor/happy-dom/.vscode/extensions.json +3 -0
  143. package/vendor/happy-dom/CODE_OF_CONDUCT.md +128 -0
  144. package/vendor/happy-dom/CONTRIBUTING.md +147 -0
  145. package/vendor/happy-dom/LICENSE +21 -0
  146. package/vendor/happy-dom/README.md +62 -0
  147. package/vendor/happy-dom/SECURITY.md +12 -0
  148. package/vendor/happy-dom/cspell.json +34 -0
  149. package/vendor/happy-dom/docs/happy-dom-logo.jpg +0 -0
  150. package/vendor/happy-dom/integration-test/.editorconfig +8 -0
  151. package/vendor/happy-dom/integration-test/LICENSE +21 -0
  152. package/vendor/happy-dom/integration-test/README.md +1 -0
  153. package/vendor/happy-dom/integration-test/package.json +24 -0
  154. package/vendor/happy-dom/package-lock.json +15520 -0
  155. package/vendor/happy-dom/package.json +55 -0
  156. package/vendor/happy-dom/packages/@happy-dom/global-registrator/LICENSE +21 -0
  157. package/vendor/happy-dom/packages/@happy-dom/global-registrator/README.md +60 -0
  158. package/vendor/happy-dom/packages/@happy-dom/global-registrator/package.json +52 -0
  159. package/vendor/happy-dom/packages/@happy-dom/global-registrator/register.js +2 -0
  160. package/vendor/happy-dom/packages/@happy-dom/global-registrator/src/GlobalRegistrator.ts +121 -0
  161. package/vendor/happy-dom/packages/@happy-dom/global-registrator/src/index.ts +3 -0
  162. package/vendor/happy-dom/packages/@happy-dom/global-registrator/tsconfig.json +30 -0
  163. package/vendor/happy-dom/packages/@happy-dom/jest-environment/LICENSE +21 -0
  164. package/vendor/happy-dom/packages/@happy-dom/jest-environment/README.md +71 -0
  165. package/vendor/happy-dom/packages/@happy-dom/jest-environment/package.json +93 -0
  166. package/vendor/happy-dom/packages/@happy-dom/jest-environment/src/index.ts +192 -0
  167. package/vendor/happy-dom/packages/@happy-dom/jest-environment/tsconfig.json +30 -0
  168. package/vendor/happy-dom/packages/@happy-dom/node-canvas-adapter/README.md +48 -0
  169. package/vendor/happy-dom/packages/@happy-dom/node-canvas-adapter/package.json +41 -0
  170. package/vendor/happy-dom/packages/@happy-dom/node-canvas-adapter/src/CanvasAdapter.ts +275 -0
  171. package/vendor/happy-dom/packages/@happy-dom/node-canvas-adapter/src/index.ts +1 -0
  172. package/vendor/happy-dom/packages/@happy-dom/server-renderer/LICENSE +21 -0
  173. package/vendor/happy-dom/packages/@happy-dom/server-renderer/README.md +100 -0
  174. package/vendor/happy-dom/packages/@happy-dom/server-renderer/bin/src/happy-dom-sr.ts +30 -0
  175. package/vendor/happy-dom/packages/@happy-dom/server-renderer/package.json +62 -0
  176. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRenderer.ts +368 -0
  177. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRendererBrowser.ts +142 -0
  178. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRendererBrowserWorker.ts +29 -0
  179. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRendererPage.ts +305 -0
  180. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRendererPageWorker.ts +55 -0
  181. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRendererServer.ts +332 -0
  182. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/config/DefaultServerRendererConfiguration.ts +47 -0
  183. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/enums/ServerRendererLogLevelEnum.ts +9 -0
  184. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/enums/ServerRendererModeEnum.ts +8 -0
  185. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/index.ts +19 -0
  186. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/types/IOptionalServerRendererConfiguration.ts +127 -0
  187. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/types/IServerRendererConfiguration.ts +126 -0
  188. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/types/IServerRendererItem.ts +6 -0
  189. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/types/IServerRendererResult.ts +11 -0
  190. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/BrowserWindowPolyfill.ts +138 -0
  191. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/HelpPrinter.ts +36 -0
  192. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/HelpPrinterRows.ts +288 -0
  193. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/PackageVersion.ts +12 -0
  194. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/ProcessArgumentsParser.ts +387 -0
  195. package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/ServerRendererConfigurationFactory.ts +91 -0
  196. package/vendor/happy-dom/packages/happy-dom/LICENSE +21 -0
  197. package/vendor/happy-dom/packages/happy-dom/README.md +42 -0
  198. package/vendor/happy-dom/packages/happy-dom/package.json +58 -0
  199. package/vendor/happy-dom/packages/happy-dom/src/PropertySymbol.ts +431 -0
  200. package/vendor/happy-dom/packages/happy-dom/src/animation/Animation.ts +273 -0
  201. package/vendor/happy-dom/packages/happy-dom/src/animation/AnimationTimeline.ts +15 -0
  202. package/vendor/happy-dom/packages/happy-dom/src/animation/DocumentTimeline.ts +33 -0
  203. package/vendor/happy-dom/packages/happy-dom/src/animation/KeyframeEffect.ts +295 -0
  204. package/vendor/happy-dom/packages/happy-dom/src/async-task-manager/AsyncTaskManager.ts +340 -0
  205. package/vendor/happy-dom/packages/happy-dom/src/async-task-manager/AsyncTaskManagerDebugError.ts +14 -0
  206. package/vendor/happy-dom/packages/happy-dom/src/base64/Base64.ts +97 -0
  207. package/vendor/happy-dom/packages/happy-dom/src/browser/Browser.ts +123 -0
  208. package/vendor/happy-dom/packages/happy-dom/src/browser/BrowserContext.ts +100 -0
  209. package/vendor/happy-dom/packages/happy-dom/src/browser/BrowserFrame.ts +232 -0
  210. package/vendor/happy-dom/packages/happy-dom/src/browser/BrowserPage.ts +205 -0
  211. package/vendor/happy-dom/packages/happy-dom/src/browser/BrowserSettingsFactory.ts +96 -0
  212. package/vendor/happy-dom/packages/happy-dom/src/browser/DefaultBrowserSettings.ts +67 -0
  213. package/vendor/happy-dom/packages/happy-dom/src/browser/detached-browser/DetachedBrowser.ts +129 -0
  214. package/vendor/happy-dom/packages/happy-dom/src/browser/detached-browser/DetachedBrowserContext.ts +103 -0
  215. package/vendor/happy-dom/packages/happy-dom/src/browser/detached-browser/DetachedBrowserFrame.ts +250 -0
  216. package/vendor/happy-dom/packages/happy-dom/src/browser/detached-browser/DetachedBrowserPage.ts +218 -0
  217. package/vendor/happy-dom/packages/happy-dom/src/browser/enums/BrowserErrorCaptureEnum.ts +10 -0
  218. package/vendor/happy-dom/packages/happy-dom/src/browser/enums/BrowserNavigationCrossOriginPolicyEnum.ts +10 -0
  219. package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowser.ts +51 -0
  220. package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowserContext.ts +44 -0
  221. package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowserFrame.ts +112 -0
  222. package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowserPage.ts +110 -0
  223. package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowserPageViewport.ts +5 -0
  224. package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowserSettings.ts +194 -0
  225. package/vendor/happy-dom/packages/happy-dom/src/browser/types/IGoToOptions.ts +17 -0
  226. package/vendor/happy-dom/packages/happy-dom/src/browser/types/IOptionalBrowserPageViewport.ts +5 -0
  227. package/vendor/happy-dom/packages/happy-dom/src/browser/types/IOptionalBrowserSettings.ts +190 -0
  228. package/vendor/happy-dom/packages/happy-dom/src/browser/types/IReloadOptions.ts +27 -0
  229. package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserExceptionObserver.ts +123 -0
  230. package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserFrameFactory.ts +106 -0
  231. package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserFrameNavigator.ts +574 -0
  232. package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserFrameScriptEvaluator.ts +71 -0
  233. package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserFrameURL.ts +30 -0
  234. package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserFrameValidator.ts +84 -0
  235. package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserPageUtility.ts +56 -0
  236. package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasAdapter.ts +63 -0
  237. package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasAdapterCaller.ts +9 -0
  238. package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasGradient.ts +8 -0
  239. package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasPattern.ts +10 -0
  240. package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasRenderingContext2D.ts +162 -0
  241. package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasShape.ts +7 -0
  242. package/vendor/happy-dom/packages/happy-dom/src/canvas/IImageBitmapOptions.ts +8 -0
  243. package/vendor/happy-dom/packages/happy-dom/src/canvas/ITextMetrics.ts +12 -0
  244. package/vendor/happy-dom/packages/happy-dom/src/canvas/ImageBitmap.ts +162 -0
  245. package/vendor/happy-dom/packages/happy-dom/src/canvas/ImageData.ts +83 -0
  246. package/vendor/happy-dom/packages/happy-dom/src/canvas/OffscreenCanvas.ts +162 -0
  247. package/vendor/happy-dom/packages/happy-dom/src/canvas/TCanvasImage.ts +14 -0
  248. package/vendor/happy-dom/packages/happy-dom/src/canvas/TImageBitmapSource.ts +12 -0
  249. package/vendor/happy-dom/packages/happy-dom/src/clipboard/Clipboard.ts +108 -0
  250. package/vendor/happy-dom/packages/happy-dom/src/clipboard/ClipboardItem.ts +57 -0
  251. package/vendor/happy-dom/packages/happy-dom/src/config/HTMLElementConfig.ts +536 -0
  252. package/vendor/happy-dom/packages/happy-dom/src/config/HTMLElementConfigContentModelEnum.ts +12 -0
  253. package/vendor/happy-dom/packages/happy-dom/src/config/IHTMLElementTagNameMap.ts +181 -0
  254. package/vendor/happy-dom/packages/happy-dom/src/config/ISVGElementTagNameMap.ts +127 -0
  255. package/vendor/happy-dom/packages/happy-dom/src/config/NamespaceURI.ts +8 -0
  256. package/vendor/happy-dom/packages/happy-dom/src/config/SVGElementConfig.ts +70 -0
  257. package/vendor/happy-dom/packages/happy-dom/src/console/IConsole.ts +161 -0
  258. package/vendor/happy-dom/packages/happy-dom/src/console/IVirtualConsoleLogEntry.ts +10 -0
  259. package/vendor/happy-dom/packages/happy-dom/src/console/IVirtualConsoleLogGroup.ts +6 -0
  260. package/vendor/happy-dom/packages/happy-dom/src/console/IVirtualConsolePrinter.ts +58 -0
  261. package/vendor/happy-dom/packages/happy-dom/src/console/VirtualConsole.ts +363 -0
  262. package/vendor/happy-dom/packages/happy-dom/src/console/VirtualConsolePrinter.ts +148 -0
  263. package/vendor/happy-dom/packages/happy-dom/src/console/enums/VirtualConsoleLogLevelEnum.ts +12 -0
  264. package/vendor/happy-dom/packages/happy-dom/src/console/enums/VirtualConsoleLogTypeEnum.ts +29 -0
  265. package/vendor/happy-dom/packages/happy-dom/src/console/utilities/VirtualConsoleLogEntryStringifier.ts +100 -0
  266. package/vendor/happy-dom/packages/happy-dom/src/cookie/CookieContainer.ts +91 -0
  267. package/vendor/happy-dom/packages/happy-dom/src/cookie/DefaultCookie.ts +17 -0
  268. package/vendor/happy-dom/packages/happy-dom/src/cookie/ICookie.ts +14 -0
  269. package/vendor/happy-dom/packages/happy-dom/src/cookie/ICookieContainer.ts +33 -0
  270. package/vendor/happy-dom/packages/happy-dom/src/cookie/IOptionalCookie.ts +16 -0
  271. package/vendor/happy-dom/packages/happy-dom/src/cookie/enums/CookieSameSiteEnum.ts +6 -0
  272. package/vendor/happy-dom/packages/happy-dom/src/cookie/urilities/CookieExpireUtility.ts +16 -0
  273. package/vendor/happy-dom/packages/happy-dom/src/cookie/urilities/CookieStringUtility.ts +119 -0
  274. package/vendor/happy-dom/packages/happy-dom/src/cookie/urilities/CookieURLUtility.ts +27 -0
  275. package/vendor/happy-dom/packages/happy-dom/src/cookie-store/CookieStore.ts +226 -0
  276. package/vendor/happy-dom/packages/happy-dom/src/cookie-store/ICookieStoreDeleteOptions.ts +9 -0
  277. package/vendor/happy-dom/packages/happy-dom/src/cookie-store/ICookieStoreGetOptions.ts +7 -0
  278. package/vendor/happy-dom/packages/happy-dom/src/cookie-store/ICookieStoreItem.ts +13 -0
  279. package/vendor/happy-dom/packages/happy-dom/src/cookie-store/ICookieStoreSetOptions.ts +12 -0
  280. package/vendor/happy-dom/packages/happy-dom/src/css/CSS.ts +63 -0
  281. package/vendor/happy-dom/packages/happy-dom/src/css/CSSRule.ts +84 -0
  282. package/vendor/happy-dom/packages/happy-dom/src/css/CSSRuleTypeEnum.ts +18 -0
  283. package/vendor/happy-dom/packages/happy-dom/src/css/CSSStyleSheet.ts +141 -0
  284. package/vendor/happy-dom/packages/happy-dom/src/css/CSSUnitValue.ts +26 -0
  285. package/vendor/happy-dom/packages/happy-dom/src/css/CSSUnits.ts +31 -0
  286. package/vendor/happy-dom/packages/happy-dom/src/css/MediaList.ts +177 -0
  287. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/CSSPropertyList.ts +1273 -0
  288. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/CSSStyleDeclaration.ts +355 -0
  289. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/ICSSStyleDeclaration.ts +1178 -0
  290. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/computed-style/CSSComputedStyle.ts +502 -0
  291. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/computed-style/config/CSSComputedStyleElementDefault.ts +133 -0
  292. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/computed-style/config/CSSComputedStyleInheritedProperties.ts +39 -0
  293. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/computed-style/config/CSSComputedStyleMeasurementProperties.ts +41 -0
  294. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/CSSPropertyManager.ts +641 -0
  295. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/parsers/CSSPropertyGetParser.ts +741 -0
  296. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/parsers/CSSPropertySetParser.ts +2955 -0
  297. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/types/ICSSPropertyMap.ts +5 -0
  298. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/types/ICSSPropertyValue.ts +4 -0
  299. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/utilities/CSSStringUtility.ts +90 -0
  300. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/utilities/CSSValueFormatter.ts +447 -0
  301. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/utilities/CSSVariableFormatter.ts +76 -0
  302. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/utilities/CSSMeasurementConverter.ts +79 -0
  303. package/vendor/happy-dom/packages/happy-dom/src/css/declaration/utilities/CSSTextParser.ts +44 -0
  304. package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSConditionRule.ts +20 -0
  305. package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSContainerRule.ts +34 -0
  306. package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSFontFaceRule.ts +45 -0
  307. package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSGroupingRule.ts +84 -0
  308. package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSKeyframeRule.ts +53 -0
  309. package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSKeyframesRule.ts +147 -0
  310. package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSMediaRule.ts +50 -0
  311. package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSScopeRule.ts +53 -0
  312. package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSStyleRule.ts +73 -0
  313. package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSSupportsRule.ts +30 -0
  314. package/vendor/happy-dom/packages/happy-dom/src/css/style-property-map/CSSKeywordValue.ts +35 -0
  315. package/vendor/happy-dom/packages/happy-dom/src/css/style-property-map/CSSStyleValue.ts +37 -0
  316. package/vendor/happy-dom/packages/happy-dom/src/css/style-property-map/StylePropertyMap.ts +45 -0
  317. package/vendor/happy-dom/packages/happy-dom/src/css/style-property-map/StylePropertyMapReadOnly.ts +128 -0
  318. package/vendor/happy-dom/packages/happy-dom/src/css/utilities/CSSEscaper.ts +87 -0
  319. package/vendor/happy-dom/packages/happy-dom/src/css/utilities/CSSRuleParser.ts +315 -0
  320. package/vendor/happy-dom/packages/happy-dom/src/custom-element/CustomElementReactionStack.ts +91 -0
  321. package/vendor/happy-dom/packages/happy-dom/src/custom-element/CustomElementRegistry.ts +186 -0
  322. package/vendor/happy-dom/packages/happy-dom/src/custom-element/CustomElementUtility.ts +34 -0
  323. package/vendor/happy-dom/packages/happy-dom/src/custom-element/ICustomElementDefinition.ts +16 -0
  324. package/vendor/happy-dom/packages/happy-dom/src/dom/DOMPoint.ts +84 -0
  325. package/vendor/happy-dom/packages/happy-dom/src/dom/DOMPointReadOnly.ts +117 -0
  326. package/vendor/happy-dom/packages/happy-dom/src/dom/DOMRect.ts +92 -0
  327. package/vendor/happy-dom/packages/happy-dom/src/dom/DOMRectList.ts +34 -0
  328. package/vendor/happy-dom/packages/happy-dom/src/dom/DOMRectReadOnly.ts +129 -0
  329. package/vendor/happy-dom/packages/happy-dom/src/dom/DOMStringMap.ts +93 -0
  330. package/vendor/happy-dom/packages/happy-dom/src/dom/DOMStringMapUtility.ts +33 -0
  331. package/vendor/happy-dom/packages/happy-dom/src/dom/DOMTokenList.ts +363 -0
  332. package/vendor/happy-dom/packages/happy-dom/src/dom/IDOMPointInit.ts +6 -0
  333. package/vendor/happy-dom/packages/happy-dom/src/dom/IDOMRectInit.ts +6 -0
  334. package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/DOMMatrix.ts +526 -0
  335. package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/DOMMatrixReadOnly.ts +1608 -0
  336. package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/IDOMMatrixCompatibleObject.ts +24 -0
  337. package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/IDOMMatrixJSON.ts +26 -0
  338. package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/TDOMMatrix2DArray.ts +3 -0
  339. package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/TDOMMatrix3DArray.ts +20 -0
  340. package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/TDOMMatrixInit.ts +8 -0
  341. package/vendor/happy-dom/packages/happy-dom/src/dom-implementation/DOMImplementation.ts +81 -0
  342. package/vendor/happy-dom/packages/happy-dom/src/dom-parser/DOMParser.ts +47 -0
  343. package/vendor/happy-dom/packages/happy-dom/src/event/DataTransfer.ts +128 -0
  344. package/vendor/happy-dom/packages/happy-dom/src/event/DataTransferItem.ts +47 -0
  345. package/vendor/happy-dom/packages/happy-dom/src/event/DataTransferItemList.ts +44 -0
  346. package/vendor/happy-dom/packages/happy-dom/src/event/Event.ts +222 -0
  347. package/vendor/happy-dom/packages/happy-dom/src/event/EventPhaseEnum.ts +7 -0
  348. package/vendor/happy-dom/packages/happy-dom/src/event/EventTarget.ts +396 -0
  349. package/vendor/happy-dom/packages/happy-dom/src/event/IEventInit.ts +5 -0
  350. package/vendor/happy-dom/packages/happy-dom/src/event/IEventListenerOptions.ts +10 -0
  351. package/vendor/happy-dom/packages/happy-dom/src/event/ITouchInit.ts +16 -0
  352. package/vendor/happy-dom/packages/happy-dom/src/event/IUIEventInit.ts +7 -0
  353. package/vendor/happy-dom/packages/happy-dom/src/event/MessagePort.ts +32 -0
  354. package/vendor/happy-dom/packages/happy-dom/src/event/TEventListener.ts +4 -0
  355. package/vendor/happy-dom/packages/happy-dom/src/event/TEventListenerFunction.ts +3 -0
  356. package/vendor/happy-dom/packages/happy-dom/src/event/TEventListenerObject.ts +5 -0
  357. package/vendor/happy-dom/packages/happy-dom/src/event/Touch.ts +40 -0
  358. package/vendor/happy-dom/packages/happy-dom/src/event/UIEvent.ts +32 -0
  359. package/vendor/happy-dom/packages/happy-dom/src/event/events/AnimationEvent.ts +25 -0
  360. package/vendor/happy-dom/packages/happy-dom/src/event/events/ClipboardEvent.ts +22 -0
  361. package/vendor/happy-dom/packages/happy-dom/src/event/events/CloseEvent.ts +25 -0
  362. package/vendor/happy-dom/packages/happy-dom/src/event/events/CookieChangeEvent.ts +25 -0
  363. package/vendor/happy-dom/packages/happy-dom/src/event/events/CustomEvent.ts +53 -0
  364. package/vendor/happy-dom/packages/happy-dom/src/event/events/ErrorEvent.ts +29 -0
  365. package/vendor/happy-dom/packages/happy-dom/src/event/events/FocusEvent.ts +22 -0
  366. package/vendor/happy-dom/packages/happy-dom/src/event/events/HashChangeEvent.ts +25 -0
  367. package/vendor/happy-dom/packages/happy-dom/src/event/events/IAnimationEventInit.ts +7 -0
  368. package/vendor/happy-dom/packages/happy-dom/src/event/events/IClipboardEventInit.ts +6 -0
  369. package/vendor/happy-dom/packages/happy-dom/src/event/events/ICloseEventInit.ts +7 -0
  370. package/vendor/happy-dom/packages/happy-dom/src/event/events/ICookieChangeEventInit.ts +10 -0
  371. package/vendor/happy-dom/packages/happy-dom/src/event/events/ICustomEventInit.ts +5 -0
  372. package/vendor/happy-dom/packages/happy-dom/src/event/events/IErrorEventInit.ts +8 -0
  373. package/vendor/happy-dom/packages/happy-dom/src/event/events/IFocusEventInit.ts +6 -0
  374. package/vendor/happy-dom/packages/happy-dom/src/event/events/IHashChangeEventInit.ts +6 -0
  375. package/vendor/happy-dom/packages/happy-dom/src/event/events/IInputEventInit.ts +9 -0
  376. package/vendor/happy-dom/packages/happy-dom/src/event/events/IKeyboardEventInit.ts +23 -0
  377. package/vendor/happy-dom/packages/happy-dom/src/event/events/IMediaQueryListEventInit.ts +6 -0
  378. package/vendor/happy-dom/packages/happy-dom/src/event/events/IMediaQueryListInit.ts +6 -0
  379. package/vendor/happy-dom/packages/happy-dom/src/event/events/IMessageEventInit.ts +11 -0
  380. package/vendor/happy-dom/packages/happy-dom/src/event/events/IMouseEventInit.ts +21 -0
  381. package/vendor/happy-dom/packages/happy-dom/src/event/events/IPointerEventInit.ts +19 -0
  382. package/vendor/happy-dom/packages/happy-dom/src/event/events/IPopStateEventInit.ts +6 -0
  383. package/vendor/happy-dom/packages/happy-dom/src/event/events/IProgressEventInit.ts +7 -0
  384. package/vendor/happy-dom/packages/happy-dom/src/event/events/IStorageEventInit.ts +10 -0
  385. package/vendor/happy-dom/packages/happy-dom/src/event/events/ISubmitEventInit.ts +6 -0
  386. package/vendor/happy-dom/packages/happy-dom/src/event/events/ITouchEventInit.ts +12 -0
  387. package/vendor/happy-dom/packages/happy-dom/src/event/events/IWheelEventInit.ts +8 -0
  388. package/vendor/happy-dom/packages/happy-dom/src/event/events/InputEvent.ts +28 -0
  389. package/vendor/happy-dom/packages/happy-dom/src/event/events/KeyboardEvent.ts +80 -0
  390. package/vendor/happy-dom/packages/happy-dom/src/event/events/MediaQueryListEvent.ts +23 -0
  391. package/vendor/happy-dom/packages/happy-dom/src/event/events/MediaStreamTrackEvent.ts +22 -0
  392. package/vendor/happy-dom/packages/happy-dom/src/event/events/MessageEvent.ts +33 -0
  393. package/vendor/happy-dom/packages/happy-dom/src/event/events/MouseEvent.ts +52 -0
  394. package/vendor/happy-dom/packages/happy-dom/src/event/events/PointerEvent.ts +51 -0
  395. package/vendor/happy-dom/packages/happy-dom/src/event/events/PopStateEvent.ts +23 -0
  396. package/vendor/happy-dom/packages/happy-dom/src/event/events/ProgressEvent.ts +25 -0
  397. package/vendor/happy-dom/packages/happy-dom/src/event/events/StorageEvent.ts +30 -0
  398. package/vendor/happy-dom/packages/happy-dom/src/event/events/SubmitEvent.ts +22 -0
  399. package/vendor/happy-dom/packages/happy-dom/src/event/events/TouchEvent.ts +34 -0
  400. package/vendor/happy-dom/packages/happy-dom/src/event/events/WheelEvent.ts +30 -0
  401. package/vendor/happy-dom/packages/happy-dom/src/exception/DOMException.ts +21 -0
  402. package/vendor/happy-dom/packages/happy-dom/src/exception/DOMExceptionNameEnum.ts +23 -0
  403. package/vendor/happy-dom/packages/happy-dom/src/fetch/AbortController.ts +25 -0
  404. package/vendor/happy-dom/packages/happy-dom/src/fetch/AbortSignal.ts +182 -0
  405. package/vendor/happy-dom/packages/happy-dom/src/fetch/Fetch.ts +1072 -0
  406. package/vendor/happy-dom/packages/happy-dom/src/fetch/Headers.ts +177 -0
  407. package/vendor/happy-dom/packages/happy-dom/src/fetch/ReadableStreamWrapper.ts +30 -0
  408. package/vendor/happy-dom/packages/happy-dom/src/fetch/Request.ts +492 -0
  409. package/vendor/happy-dom/packages/happy-dom/src/fetch/ResourceFetch.ts +190 -0
  410. package/vendor/happy-dom/packages/happy-dom/src/fetch/Response.ts +439 -0
  411. package/vendor/happy-dom/packages/happy-dom/src/fetch/SyncFetch.ts +717 -0
  412. package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/preflight/ICacheablePreflightRequest.ts +7 -0
  413. package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/preflight/ICacheablePreflightResponse.ts +7 -0
  414. package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/preflight/ICachedPreflightResponse.ts +5 -0
  415. package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/preflight/IPreflightResponseCache.ts +33 -0
  416. package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/preflight/PreflightResponseCache.ts +94 -0
  417. package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/CachedResponseStateEnum.ts +5 -0
  418. package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/ICacheableRequest.ts +7 -0
  419. package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/ICacheableResponse.ts +11 -0
  420. package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/ICachedResponse.ts +40 -0
  421. package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/IResponseCache.ts +37 -0
  422. package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/IResponseCacheFileSystem.ts +18 -0
  423. package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/ResponseCache.ts +248 -0
  424. package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/ResponseCacheFileSystem.ts +175 -0
  425. package/vendor/happy-dom/packages/happy-dom/src/fetch/certificate/FetchHTTPSCertificate.ts +52 -0
  426. package/vendor/happy-dom/packages/happy-dom/src/fetch/data-uri/DataURIParser.ts +66 -0
  427. package/vendor/happy-dom/packages/happy-dom/src/fetch/multipart/MultipartFormDataParser.ts +174 -0
  428. package/vendor/happy-dom/packages/happy-dom/src/fetch/multipart/MultipartReader.ts +216 -0
  429. package/vendor/happy-dom/packages/happy-dom/src/fetch/preload/PreloadEntry.ts +50 -0
  430. package/vendor/happy-dom/packages/happy-dom/src/fetch/preload/PreloadUtility.ts +33 -0
  431. package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IFetchInterceptor.ts +60 -0
  432. package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IFetchRequestHeaders.ts +9 -0
  433. package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IRequestInit.ts +23 -0
  434. package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IResourceFetchResponse.ts +4 -0
  435. package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IResponseInit.ts +10 -0
  436. package/vendor/happy-dom/packages/happy-dom/src/fetch/types/ISyncResponse.ts +18 -0
  437. package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IVirtualServer.ts +7 -0
  438. package/vendor/happy-dom/packages/happy-dom/src/fetch/types/THeadersInit.ts +3 -0
  439. package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestBody.ts +14 -0
  440. package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestCredentials.ts +1 -0
  441. package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestInfo.ts +4 -0
  442. package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestMode.ts +1 -0
  443. package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestRedirect.ts +1 -0
  444. package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestReferrerPolicy.ts +10 -0
  445. package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TResponseBody.ts +14 -0
  446. package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchBodyUtility.ts +284 -0
  447. package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchCORSUtility.ts +23 -0
  448. package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchRequestHeaderUtility.ts +141 -0
  449. package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchRequestReferrerUtility.ts +259 -0
  450. package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchRequestValidationUtility.ts +128 -0
  451. package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchResponseHeaderUtility.ts +48 -0
  452. package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchResponseRedirectUtility.ts +27 -0
  453. package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/SyncFetchScriptBuilder.ts +77 -0
  454. package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/VirtualServerUtility.ts +114 -0
  455. package/vendor/happy-dom/packages/happy-dom/src/file/Blob.ts +163 -0
  456. package/vendor/happy-dom/packages/happy-dom/src/file/File.ts +43 -0
  457. package/vendor/happy-dom/packages/happy-dom/src/file/FileReader.ts +211 -0
  458. package/vendor/happy-dom/packages/happy-dom/src/file/FileReaderEventTypeEnum.ts +9 -0
  459. package/vendor/happy-dom/packages/happy-dom/src/file/FileReaderFormatEnum.ts +7 -0
  460. package/vendor/happy-dom/packages/happy-dom/src/file/FileReaderReadyStateEnum.ts +6 -0
  461. package/vendor/happy-dom/packages/happy-dom/src/form-data/FormData.ts +291 -0
  462. package/vendor/happy-dom/packages/happy-dom/src/history/History.ts +220 -0
  463. package/vendor/happy-dom/packages/happy-dom/src/history/HistoryItemList.ts +72 -0
  464. package/vendor/happy-dom/packages/happy-dom/src/history/HistoryScrollRestorationEnum.ts +5 -0
  465. package/vendor/happy-dom/packages/happy-dom/src/history/IHistoryItem.ts +12 -0
  466. package/vendor/happy-dom/packages/happy-dom/src/html-parser/HTMLParser.ts +920 -0
  467. package/vendor/happy-dom/packages/happy-dom/src/html-serializer/HTMLSerializer.ts +172 -0
  468. package/vendor/happy-dom/packages/happy-dom/src/index.ts +495 -0
  469. package/vendor/happy-dom/packages/happy-dom/src/intersection-observer/IIntersectionObserverInit.ts +16 -0
  470. package/vendor/happy-dom/packages/happy-dom/src/intersection-observer/IntersectionObserver.ts +64 -0
  471. package/vendor/happy-dom/packages/happy-dom/src/intersection-observer/IntersectionObserverEntry.ts +26 -0
  472. package/vendor/happy-dom/packages/happy-dom/src/javascript/IJavaScriptCompiledResult.ts +9 -0
  473. package/vendor/happy-dom/packages/happy-dom/src/javascript/JavaScriptCompiler.ts +381 -0
  474. package/vendor/happy-dom/packages/happy-dom/src/location/Location.ts +319 -0
  475. package/vendor/happy-dom/packages/happy-dom/src/match-media/IMediaQueryRange.ts +5 -0
  476. package/vendor/happy-dom/packages/happy-dom/src/match-media/IMediaQueryRule.ts +4 -0
  477. package/vendor/happy-dom/packages/happy-dom/src/match-media/MediaQueryItem.ts +354 -0
  478. package/vendor/happy-dom/packages/happy-dom/src/match-media/MediaQueryList.ts +133 -0
  479. package/vendor/happy-dom/packages/happy-dom/src/match-media/MediaQueryParser.ts +113 -0
  480. package/vendor/happy-dom/packages/happy-dom/src/match-media/MediaQueryTypeEnum.ts +7 -0
  481. package/vendor/happy-dom/packages/happy-dom/src/module/CSSModule.ts +53 -0
  482. package/vendor/happy-dom/packages/happy-dom/src/module/ECMAScriptModule.ts +194 -0
  483. package/vendor/happy-dom/packages/happy-dom/src/module/ECMAScriptModuleCompiler.ts +961 -0
  484. package/vendor/happy-dom/packages/happy-dom/src/module/JSONModule.ts +58 -0
  485. package/vendor/happy-dom/packages/happy-dom/src/module/ModuleFactory.ts +148 -0
  486. package/vendor/happy-dom/packages/happy-dom/src/module/ModuleURLUtility.ts +199 -0
  487. package/vendor/happy-dom/packages/happy-dom/src/module/UnresolvedModule.ts +81 -0
  488. package/vendor/happy-dom/packages/happy-dom/src/module/enums/ECMAScriptModuleEvaluateStateEnum.ts +7 -0
  489. package/vendor/happy-dom/packages/happy-dom/src/module/types/IECMAScriptModuleCachedResult.ts +9 -0
  490. package/vendor/happy-dom/packages/happy-dom/src/module/types/IECMAScriptModuleCompiledResult.ts +19 -0
  491. package/vendor/happy-dom/packages/happy-dom/src/module/types/IECMAScriptModuleImport.ts +4 -0
  492. package/vendor/happy-dom/packages/happy-dom/src/module/types/IECMAScriptModuleInit.ts +10 -0
  493. package/vendor/happy-dom/packages/happy-dom/src/module/types/IModule.ts +20 -0
  494. package/vendor/happy-dom/packages/happy-dom/src/module/types/IModuleImportMap.ts +10 -0
  495. package/vendor/happy-dom/packages/happy-dom/src/module/types/IModuleImportMapRule.ts +4 -0
  496. package/vendor/happy-dom/packages/happy-dom/src/module/types/IModuleImportMapScope.ts +6 -0
  497. package/vendor/happy-dom/packages/happy-dom/src/module/types/IModuleInit.ts +12 -0
  498. package/vendor/happy-dom/packages/happy-dom/src/module/types/IResolveNodeModules.ts +8 -0
  499. package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/IMutationListener.ts +7 -0
  500. package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/IMutationObserverInit.ts +14 -0
  501. package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/MutationObserver.ts +175 -0
  502. package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/MutationObserverListener.ts +115 -0
  503. package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/MutationRecord.ts +55 -0
  504. package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/MutationTypeEnum.ts +7 -0
  505. package/vendor/happy-dom/packages/happy-dom/src/navigator/MimeType.ts +35 -0
  506. package/vendor/happy-dom/packages/happy-dom/src/navigator/MimeTypeArray.ts +48 -0
  507. package/vendor/happy-dom/packages/happy-dom/src/navigator/Navigator.ts +247 -0
  508. package/vendor/happy-dom/packages/happy-dom/src/navigator/Plugin.ts +61 -0
  509. package/vendor/happy-dom/packages/happy-dom/src/navigator/PluginArray.ts +58 -0
  510. package/vendor/happy-dom/packages/happy-dom/src/nodes/NodeFactory.ts +38 -0
  511. package/vendor/happy-dom/packages/happy-dom/src/nodes/attr/Attr.ts +119 -0
  512. package/vendor/happy-dom/packages/happy-dom/src/nodes/character-data/CharacterData.ts +218 -0
  513. package/vendor/happy-dom/packages/happy-dom/src/nodes/character-data/CharacterDataUtility.ts +68 -0
  514. package/vendor/happy-dom/packages/happy-dom/src/nodes/child-node/ChildNodeUtility.ts +100 -0
  515. package/vendor/happy-dom/packages/happy-dom/src/nodes/child-node/IChildNode.ts +29 -0
  516. package/vendor/happy-dom/packages/happy-dom/src/nodes/child-node/INonDocumentTypeChildNode.ts +7 -0
  517. package/vendor/happy-dom/packages/happy-dom/src/nodes/child-node/NonDocumentChildNodeUtility.ts +37 -0
  518. package/vendor/happy-dom/packages/happy-dom/src/nodes/comment/Comment.ts +36 -0
  519. package/vendor/happy-dom/packages/happy-dom/src/nodes/document/Document.ts +2310 -0
  520. package/vendor/happy-dom/packages/happy-dom/src/nodes/document/DocumentReadyStateEnum.ts +6 -0
  521. package/vendor/happy-dom/packages/happy-dom/src/nodes/document/DocumentReadyStateManager.ts +52 -0
  522. package/vendor/happy-dom/packages/happy-dom/src/nodes/document/VisibilityStateEnum.ts +6 -0
  523. package/vendor/happy-dom/packages/happy-dom/src/nodes/document-fragment/DocumentFragment.ts +208 -0
  524. package/vendor/happy-dom/packages/happy-dom/src/nodes/document-type/DocumentType.ts +70 -0
  525. package/vendor/happy-dom/packages/happy-dom/src/nodes/element/Element.ts +1842 -0
  526. package/vendor/happy-dom/packages/happy-dom/src/nodes/element/ElementEventAttributeUtility.ts +96 -0
  527. package/vendor/happy-dom/packages/happy-dom/src/nodes/element/HTMLCollection.ts +228 -0
  528. package/vendor/happy-dom/packages/happy-dom/src/nodes/element/NamedNodeMap.ts +274 -0
  529. package/vendor/happy-dom/packages/happy-dom/src/nodes/element/NamedNodeMapProxyFactory.ts +127 -0
  530. package/vendor/happy-dom/packages/happy-dom/src/nodes/element/THTMLCollectionListener.ts +6 -0
  531. package/vendor/happy-dom/packages/happy-dom/src/nodes/element/TNamedNodeMapListener.ts +3 -0
  532. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-anchor-element/HTMLAnchorElement.ts +439 -0
  533. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-area-element/HTMLAreaElement.ts +426 -0
  534. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-audio-element/Audio.ts +28 -0
  535. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-audio-element/HTMLAudioElement.ts +10 -0
  536. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-base-element/HTMLBaseElement.ts +64 -0
  537. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-body-element/HTMLBodyElement.ts +161 -0
  538. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-br-element/HTMLBRElement.ts +7 -0
  539. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-button-element/HTMLButtonElement.ts +406 -0
  540. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-canvas-element/CanvasCaptureMediaStreamTrack.ts +51 -0
  541. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-canvas-element/HTMLCanvasElement.ts +304 -0
  542. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-d-list-element/HTMLDListElement.ts +7 -0
  543. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-data-element/HTMLDataElement.ts +25 -0
  544. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-data-list-element/HTMLDataListElement.ts +28 -0
  545. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-details-element/HTMLDetailsElement.ts +112 -0
  546. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-dialog-element/HTMLDialogElement.ts +104 -0
  547. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-div-element/HTMLDivElement.ts +7 -0
  548. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-document/HTMLDocument.ts +82 -0
  549. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-element/HTMLElement.ts +1149 -0
  550. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-element/HTMLElementUtility.ts +119 -0
  551. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-embed-element/HTMLEmbedElement.ts +90 -0
  552. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-field-set-element/HTMLFieldSetElement.ts +165 -0
  553. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-form-element/HTMLFormControlsCollection.ts +35 -0
  554. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-form-element/HTMLFormElement.ts +675 -0
  555. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-form-element/RadioNodeList.ts +25 -0
  556. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-form-element/THTMLFormControlElement.ts +16 -0
  557. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-head-element/HTMLHeadElement.ts +7 -0
  558. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-heading-element/HTMLHeadingElement.ts +7 -0
  559. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-hr-element/HTMLHRElement.ts +7 -0
  560. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-html-element/HTMLHtmlElement.ts +7 -0
  561. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-hyperlink-element/HTMLHyperlinkElementUtility.ts +329 -0
  562. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-hyperlink-element/IHTMLHyperlinkElement.ts +19 -0
  563. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-iframe-element/HTMLIFrameElement.ts +460 -0
  564. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-image-element/HTMLImageElement.ts +500 -0
  565. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-image-element/Image.ts +33 -0
  566. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/FileList.ts +34 -0
  567. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElement.ts +1550 -0
  568. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElementDateUtility.ts +50 -0
  569. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElementSelectionDirectionEnum.ts +6 -0
  570. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElementSelectionModeEnum.ts +7 -0
  571. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElementValueSanitizer.ts +211 -0
  572. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElementValueStepping.ts +92 -0
  573. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-label-element/HTMLLabelElement.ts +128 -0
  574. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-label-element/HTMLLabelElementUtility.ts +45 -0
  575. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-legend-element/HTMLLegendElement.ts +27 -0
  576. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-li-element/HTMLLIElement.ts +31 -0
  577. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-link-element/HTMLLinkElement.ts +501 -0
  578. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-map-element/HTMLMapElement.ts +47 -0
  579. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/HTMLMediaElement.ts +906 -0
  580. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/IMediaTrackCapabilities.ts +21 -0
  581. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/IMediaTrackSettings.ts +5 -0
  582. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/MediaStream.ts +114 -0
  583. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/MediaStreamTrack.ts +182 -0
  584. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/RemotePlayback.ts +47 -0
  585. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TextTrack.ts +156 -0
  586. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TextTrackCue.ts +51 -0
  587. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TextTrackCueList.ts +37 -0
  588. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TextTrackKindEnum.ts +9 -0
  589. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TextTrackList.ts +182 -0
  590. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TimeRanges.ts +73 -0
  591. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/VTTCue.ts +80 -0
  592. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/VTTRegion.ts +15 -0
  593. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-menu-element/HTMLMenuElement.ts +7 -0
  594. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-meta-element/HTMLMetaElement.ts +80 -0
  595. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-meter-element/HTMLMeterElement.ts +216 -0
  596. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-mod-element/HTMLModElement.ts +54 -0
  597. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-o-list-element/HTMLOListElement.ts +83 -0
  598. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-object-element/HTMLObjectElement.ts +223 -0
  599. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-opt-group-element/HTMLOptGroupElement.ts +53 -0
  600. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-option-element/HTMLOptionElement.ts +192 -0
  601. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-output-element/HTMLOutputElement.ts +179 -0
  602. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-paragraph-element/HTMLParagraphElement.ts +7 -0
  603. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-param-element/HTMLParamElement.ts +7 -0
  604. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-picture-element/HTMLPictureElement.ts +7 -0
  605. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-pre-element/HTMLPreElement.ts +7 -0
  606. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-progress-element/HTMLProgressElement.ts +100 -0
  607. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-quote-element/HTMLQuoteElement.ts +36 -0
  608. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-script-element/HTMLScriptElement.ts +735 -0
  609. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-select-element/HTMLOptionsCollection.ts +69 -0
  610. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-select-element/HTMLSelectElement.ts +779 -0
  611. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-slot-element/HTMLSlotElement.ts +249 -0
  612. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-source-element/HTMLSourceElement.ts +148 -0
  613. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-span-element/HTMLSpanElement.ts +7 -0
  614. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-style-element/HTMLStyleElement.ts +125 -0
  615. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-caption-element/HTMLTableCaptionElement.ts +7 -0
  616. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-cell-element/HTMLTableCellElement.ts +125 -0
  617. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-col-element/HTMLTableColElement.ts +7 -0
  618. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-element/HTMLTableElement.ts +343 -0
  619. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-row-element/HTMLTableRowElement.ts +149 -0
  620. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-section-element/HTMLTableSectionElement.ts +88 -0
  621. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-template-element/HTMLTemplateElement.ts +154 -0
  622. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-text-area-element/HTMLTextAreaElement.ts +649 -0
  623. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-time-element/HTMLTimeElement.ts +27 -0
  624. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-title-element/HTMLTitleElement.ts +48 -0
  625. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-track-element/HTMLTrackElement.ts +164 -0
  626. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-u-list-element/HTMLUListElement.ts +7 -0
  627. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-unknown-element/HTMLUnknownElement.ts +9 -0
  628. package/vendor/happy-dom/packages/happy-dom/src/nodes/html-video-element/HTMLVideoElement.ts +10 -0
  629. package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedComputedStyleResult.ts +6 -0
  630. package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedElementByIdResult.ts +6 -0
  631. package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedElementByTagNameResult.ts +6 -0
  632. package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedElementsByTagNameResult.ts +6 -0
  633. package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedMatchesResult.ts +6 -0
  634. package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedQuerySelectorAllResult.ts +7 -0
  635. package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedQuerySelectorResult.ts +6 -0
  636. package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedResult.ts +3 -0
  637. package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedStyleResult.ts +6 -0
  638. package/vendor/happy-dom/packages/happy-dom/src/nodes/node/Node.ts +1373 -0
  639. package/vendor/happy-dom/packages/happy-dom/src/nodes/node/NodeDocumentPositionEnum.ts +10 -0
  640. package/vendor/happy-dom/packages/happy-dom/src/nodes/node/NodeList.ts +224 -0
  641. package/vendor/happy-dom/packages/happy-dom/src/nodes/node/NodeTypeEnum.ts +13 -0
  642. package/vendor/happy-dom/packages/happy-dom/src/nodes/node/NodeUtility.ts +330 -0
  643. package/vendor/happy-dom/packages/happy-dom/src/nodes/node/TNodeListListener.ts +1 -0
  644. package/vendor/happy-dom/packages/happy-dom/src/nodes/parent-node/IParentNode.ts +109 -0
  645. package/vendor/happy-dom/packages/happy-dom/src/nodes/parent-node/ParentNodeUtility.ts +334 -0
  646. package/vendor/happy-dom/packages/happy-dom/src/nodes/processing-instruction/ProcessingInstruction.ts +22 -0
  647. package/vendor/happy-dom/packages/happy-dom/src/nodes/shadow-root/ShadowRoot.ts +290 -0
  648. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-animate-element/SVGAnimateElement.ts +8 -0
  649. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-animate-motion-element/SVGAnimateMotionElement.ts +8 -0
  650. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-animate-transform-element/SVGAnimateTransformElement.ts +8 -0
  651. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-animation-element/SVGAnimationElement.ts +94 -0
  652. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-circle-element/SVGCircleElement.ts +72 -0
  653. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-clip-path-element/SVGClipPathElement.ts +34 -0
  654. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-component-transfer-function-element/SVGComponentTransferFunctionElement.ts +167 -0
  655. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-defs-element/SVGDefsElement.ts +8 -0
  656. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-desc-element/SVGDescElement.ts +8 -0
  657. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-element/SVGElement.ts +828 -0
  658. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-ellipse-element/SVGEllipseElement.ts +92 -0
  659. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-blend-element/SVGFEBlendElement.ts +192 -0
  660. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-color-matrix-element/SVGFEColorMatrixElement.ts +204 -0
  661. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-component-transfer-element/SVGFEComponentTransferElement.ts +133 -0
  662. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-composite-element/SVGFECompositeElement.ts +186 -0
  663. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-convolve-matrix-element/SVGFEConvolveMatrixElement.ts +366 -0
  664. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-diffuse-lighting-element/SVGFEDiffuseLightingElement.ts +214 -0
  665. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-displacement-map-element/SVGFEDisplacementMapElement.ts +226 -0
  666. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-distant-light-element/SVGFEDistantLightElement.ts +52 -0
  667. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-drop-shadow-element/SVGFEDropShadowElement.ts +227 -0
  668. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-flood-element/SVGFEFloodElement.ts +113 -0
  669. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-func-a-element/SVGFEFuncAElement.ts +8 -0
  670. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-func-b-element/SVGFEFuncBElement.ts +8 -0
  671. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-func-g-element/SVGFEFuncGElement.ts +8 -0
  672. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-func-r-element/SVGFEFuncRElement.ts +8 -0
  673. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-gaussian-blur-element/SVGFEGaussianBlurElement.ts +214 -0
  674. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-image-element/SVGFEImageElement.ts +173 -0
  675. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-merge-element/SVGFEMergeElement.ts +113 -0
  676. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-merge-node-element/SVGFEMergeNodeElement.ts +32 -0
  677. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-morphology-element/SVGFEMorphologyElement.ts +202 -0
  678. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-offset-element/SVGFEOffsetElement.ts +174 -0
  679. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-point-light-element/SVGFEPointLightElement.ts +72 -0
  680. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-specular-lighting-element/SVGFESpecularLightingElement.ts +237 -0
  681. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-spot-light-element/SVGFESpotLightElement.ts +173 -0
  682. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-tile-element/SVGFETileElement.ts +133 -0
  683. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-turbulence-element/SVGFETurbulenceElement.ts +249 -0
  684. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-filter-element/SVGFilterElement.ts +158 -0
  685. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-foreign-object-element/SVGForeignObjectElement.ts +92 -0
  686. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-g-element/SVGGElement.ts +8 -0
  687. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-geometry-element/SVGGeometryElement.ts +94 -0
  688. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-gradient-element/SVGGradientElement.ts +104 -0
  689. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-graphics-element/SVGGraphicsElement.ts +134 -0
  690. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-image-element/SVGImageElement.ts +188 -0
  691. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-line-element/SVGLineElement.ts +92 -0
  692. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-linear-gradient-element/SVGLinearGradientElement.ts +92 -0
  693. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-m-path-element/SVGMPathElement.ts +32 -0
  694. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-marker-element/SVGMarkerElement.ts +230 -0
  695. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-mask-element/SVGMaskElement.ts +137 -0
  696. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-metadata-element/SVGMetadataElement.ts +8 -0
  697. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-path-element/SVGPathElement.ts +8 -0
  698. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-pattern-element/SVGPatternElement.ts +179 -0
  699. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-polygon-element/SVGPolygonElement.ts +53 -0
  700. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-polyline-element/SVGPolylineElement.ts +53 -0
  701. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-radial-gradient-element/SVGRadialGradientElement.ts +112 -0
  702. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-rect-element/SVGRectElement.ts +132 -0
  703. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-script-element/SVGScriptElement.ts +50 -0
  704. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-set-element/SVGSetElement.ts +8 -0
  705. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-stop-element/SVGStopElement.ts +32 -0
  706. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-style-element/SVGStyleElement.ts +143 -0
  707. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-svg-element/SVGSVGElement.ts +601 -0
  708. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-switch-element/SVGSwitchElement.ts +8 -0
  709. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-symbol-element/SVGSymbolElement.ts +8 -0
  710. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-t-span-element/SVGTSpanElement.ts +8 -0
  711. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-text-content-element/SVGTextContentElement.ts +143 -0
  712. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-text-element/SVGTextElement.ts +8 -0
  713. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-text-path-element/SVGTextPathElement.ts +106 -0
  714. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-text-positioning-element/SVGTextPositioningElement.ts +113 -0
  715. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-title-element/SVGTitleElement.ts +8 -0
  716. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-use-element/SVGUseElement.ts +113 -0
  717. package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-view-element/SVGViewElement.ts +8 -0
  718. package/vendor/happy-dom/packages/happy-dom/src/nodes/text/Text.ts +154 -0
  719. package/vendor/happy-dom/packages/happy-dom/src/nodes/xml-document/XMLDocument.ts +10 -0
  720. package/vendor/happy-dom/packages/happy-dom/src/permissions/PermissionNameEnum.ts +32 -0
  721. package/vendor/happy-dom/packages/happy-dom/src/permissions/PermissionStatus.ts +23 -0
  722. package/vendor/happy-dom/packages/happy-dom/src/permissions/Permissions.ts +59 -0
  723. package/vendor/happy-dom/packages/happy-dom/src/query-selector/ISelectorAttribute.ts +7 -0
  724. package/vendor/happy-dom/packages/happy-dom/src/query-selector/ISelectorMatch.ts +3 -0
  725. package/vendor/happy-dom/packages/happy-dom/src/query-selector/ISelectorPseudo.ts +8 -0
  726. package/vendor/happy-dom/packages/happy-dom/src/query-selector/QuerySelector.ts +849 -0
  727. package/vendor/happy-dom/packages/happy-dom/src/query-selector/SelectorCombinatorEnum.ts +9 -0
  728. package/vendor/happy-dom/packages/happy-dom/src/query-selector/SelectorItem.ts +575 -0
  729. package/vendor/happy-dom/packages/happy-dom/src/query-selector/SelectorParser.ts +699 -0
  730. package/vendor/happy-dom/packages/happy-dom/src/query-selector/TGlobalMatchFunction.ts +12 -0
  731. package/vendor/happy-dom/packages/happy-dom/src/range/IRangeBoundaryPoint.ts +9 -0
  732. package/vendor/happy-dom/packages/happy-dom/src/range/Range.ts +1161 -0
  733. package/vendor/happy-dom/packages/happy-dom/src/range/RangeHowEnum.ts +8 -0
  734. package/vendor/happy-dom/packages/happy-dom/src/range/RangeUtility.ts +118 -0
  735. package/vendor/happy-dom/packages/happy-dom/src/resize-observer/ResizeObserver.ts +33 -0
  736. package/vendor/happy-dom/packages/happy-dom/src/screen/Screen.ts +19 -0
  737. package/vendor/happy-dom/packages/happy-dom/src/screen/ScreenDetailed.ts +17 -0
  738. package/vendor/happy-dom/packages/happy-dom/src/screen/ScreenDetails.ts +27 -0
  739. package/vendor/happy-dom/packages/happy-dom/src/selection/Selection.ts +556 -0
  740. package/vendor/happy-dom/packages/happy-dom/src/selection/SelectionDirectionEnum.ts +7 -0
  741. package/vendor/happy-dom/packages/happy-dom/src/storage/Storage.ts +149 -0
  742. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAngle.ts +310 -0
  743. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAngleTypeEnum.ts +9 -0
  744. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedAngle.ts +100 -0
  745. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedBoolean.ts +80 -0
  746. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedEnumeration.ts +119 -0
  747. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedInteger.ts +97 -0
  748. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedLength.ts +100 -0
  749. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedLengthList.ts +101 -0
  750. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedNumber.ts +101 -0
  751. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedNumberList.ts +101 -0
  752. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedPreserveAspectRatio.ts +100 -0
  753. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedRect.ts +100 -0
  754. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedString.ts +83 -0
  755. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedTransformList.ts +101 -0
  756. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGLength.ts +375 -0
  757. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGLengthList.ts +489 -0
  758. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGLengthTypeEnum.ts +15 -0
  759. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGMatrix.ts +429 -0
  760. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGNumber.ts +83 -0
  761. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGNumberList.ts +522 -0
  762. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGPoint.ts +114 -0
  763. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGPointList.ts +526 -0
  764. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGPreserveAspectRatio.ts +176 -0
  765. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGPreserveAspectRatioAlignEnum.ts +15 -0
  766. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGPreserveAspectRatioMeetOrSliceEnum.ts +7 -0
  767. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGRect.ts +200 -0
  768. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGStringList.ts +422 -0
  769. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGTransform.ts +369 -0
  770. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGTransformList.ts +531 -0
  771. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGTransformTypeEnum.ts +11 -0
  772. package/vendor/happy-dom/packages/happy-dom/src/svg/SVGUnitTypes.ts +26 -0
  773. package/vendor/happy-dom/packages/happy-dom/src/tree-walker/NodeFilter.ts +18 -0
  774. package/vendor/happy-dom/packages/happy-dom/src/tree-walker/NodeFilterMask.ts +28 -0
  775. package/vendor/happy-dom/packages/happy-dom/src/tree-walker/NodeIterator.ts +85 -0
  776. package/vendor/happy-dom/packages/happy-dom/src/tree-walker/TNodeFilter.ts +3 -0
  777. package/vendor/happy-dom/packages/happy-dom/src/tree-walker/TreeWalker.ts +339 -0
  778. package/vendor/happy-dom/packages/happy-dom/src/url/URL.ts +45 -0
  779. package/vendor/happy-dom/packages/happy-dom/src/utilities/AttributeUtility.ts +43 -0
  780. package/vendor/happy-dom/packages/happy-dom/src/utilities/ClassMethodBinder.ts +71 -0
  781. package/vendor/happy-dom/packages/happy-dom/src/utilities/StringUtility.ts +47 -0
  782. package/vendor/happy-dom/packages/happy-dom/src/utilities/XMLEncodeUtility.ts +166 -0
  783. package/vendor/happy-dom/packages/happy-dom/src/validity-state/ValidityState.ts +234 -0
  784. package/vendor/happy-dom/packages/happy-dom/src/version.ts +1 -0
  785. package/vendor/happy-dom/packages/happy-dom/src/web-socket/WebSocket.ts +408 -0
  786. package/vendor/happy-dom/packages/happy-dom/src/web-socket/WebSocketReadyStateEnum.ts +8 -0
  787. package/vendor/happy-dom/packages/happy-dom/src/window/BrowserWindow.ts +3074 -0
  788. package/vendor/happy-dom/packages/happy-dom/src/window/CrossOriginBrowserWindow.ts +152 -0
  789. package/vendor/happy-dom/packages/happy-dom/src/window/DetachedWindowAPI.ts +133 -0
  790. package/vendor/happy-dom/packages/happy-dom/src/window/GlobalWindow.ts +90 -0
  791. package/vendor/happy-dom/packages/happy-dom/src/window/INodeJSGlobal.ts +76 -0
  792. package/vendor/happy-dom/packages/happy-dom/src/window/IOptionalTimerLoopsLimit.ts +4 -0
  793. package/vendor/happy-dom/packages/happy-dom/src/window/IScrollToOptions.ts +5 -0
  794. package/vendor/happy-dom/packages/happy-dom/src/window/ITimerLoopsLimit.ts +4 -0
  795. package/vendor/happy-dom/packages/happy-dom/src/window/VMGlobalPropertyScript.ts +59 -0
  796. package/vendor/happy-dom/packages/happy-dom/src/window/Window.ts +67 -0
  797. package/vendor/happy-dom/packages/happy-dom/src/window/WindowBrowserContext.ts +117 -0
  798. package/vendor/happy-dom/packages/happy-dom/src/window/WindowContextClassExtender.ts +288 -0
  799. package/vendor/happy-dom/packages/happy-dom/src/window/WindowPageOpenUtility.ts +200 -0
  800. package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpRequest.ts +577 -0
  801. package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpRequestEventTarget.ts +88 -0
  802. package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpRequestReadyStateEnum.ts +9 -0
  803. package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpRequestResponseDataParser.ts +70 -0
  804. package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpRequestUpload.ts +6 -0
  805. package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpResponseTypeEnum.ts +9 -0
  806. package/vendor/happy-dom/packages/happy-dom/src/xml-parser/XMLParser.ts +744 -0
  807. package/vendor/happy-dom/packages/happy-dom/src/xml-serializer/XMLSerializer.ts +280 -0
  808. package/vendor/happy-dom/turbo.json +52 -0
  809. package/vendor/ses/LICENSE +201 -0
  810. package/vendor/ses/LICENSE-aura +16 -0
  811. package/vendor/ses/LICENSE-caja +13 -0
  812. package/vendor/ses/LICENSE-corejs +19 -0
  813. package/vendor/ses/LICENSE-v8 +9 -0
  814. package/vendor/ses/README.md +968 -0
  815. package/vendor/ses/dist/ses.mjs +15219 -0
  816. package/vendor/ses/package.json +142 -0
  817. package/vendor/wasmpeg/LICENSE +501 -0
  818. package/vendor/wasmpeg/NOTICE +30 -0
  819. package/vendor/wasmpeg/VENDORING.md +35 -0
  820. package/vendor/wasmpeg/dist/cpu.js +2 -0
  821. package/vendor/wasmpeg/dist/cpu.wasm +0 -0
  822. package/vendor/wasmpeg/package.json +45 -0
  823. package/vendor/wasmpeg/source-v1.0.1.tar.gz +0 -0
  824. package/vendor/wasmpeg/src/js/exec.mjs +478 -0
  825. package/vendor/wasmpeg/src/js/ffmpeg.js +94 -0
  826. package/vendor/wasmpeg/src/js/formats.js +84 -0
  827. package/vendor/wasmpeg/src/js/gpu.js +480 -0
  828. package/vendor/wasmpeg/src/js/index.d.ts +154 -0
  829. package/vendor/wasmpeg/src/js/index.js +7 -0
  830. package/vendor/wasmpeg/src/js/wasmpeg.mjs +221 -0
@@ -0,0 +1,1842 @@
1
+ import Node from '../node/Node.js';
2
+ import * as PropertySymbol from '../../PropertySymbol.js';
3
+ import type ShadowRoot from '../shadow-root/ShadowRoot.js';
4
+ import DOMRect from '../../dom/DOMRect.js';
5
+ import DOMTokenList from '../../dom/DOMTokenList.js';
6
+ import QuerySelector from '../../query-selector/QuerySelector.js';
7
+ import ChildNodeUtility from '../child-node/ChildNodeUtility.js';
8
+ import ParentNodeUtility from '../parent-node/ParentNodeUtility.js';
9
+ import NonDocumentChildNodeUtility from '../child-node/NonDocumentChildNodeUtility.js';
10
+ import HTMLCollection from './HTMLCollection.js';
11
+ import type Text from '../text/Text.js';
12
+ import DOMRectList from '../../dom/DOMRectList.js';
13
+ import type Attr from '../attr/Attr.js';
14
+ import NamedNodeMap from './NamedNodeMap.js';
15
+ import Event from '../../event/Event.js';
16
+ import NodeTypeEnum from '../node/NodeTypeEnum.js';
17
+ import type IHTMLElementTagNameMap from '../../config/IHTMLElementTagNameMap.js';
18
+ import type ISVGElementTagNameMap from '../../config/ISVGElementTagNameMap.js';
19
+ import type IChildNode from '../child-node/IChildNode.js';
20
+ import type INonDocumentTypeChildNode from '../child-node/INonDocumentTypeChildNode.js';
21
+ import type IParentNode from '../parent-node/IParentNode.js';
22
+ import MutationRecord from '../../mutation-observer/MutationRecord.js';
23
+ import MutationTypeEnum from '../../mutation-observer/MutationTypeEnum.js';
24
+ import NamespaceURI from '../../config/NamespaceURI.js';
25
+ import type NodeList from '../node/NodeList.js';
26
+ import type CSSStyleDeclaration from '../../css/declaration/CSSStyleDeclaration.js';
27
+ import NamedNodeMapProxyFactory from './NamedNodeMapProxyFactory.js';
28
+ import NodeFactory from '../NodeFactory.js';
29
+ import HTMLSerializer from '../../html-serializer/HTMLSerializer.js';
30
+ import HTMLParser from '../../html-parser/HTMLParser.js';
31
+ import type IScrollToOptions from '../../window/IScrollToOptions.js';
32
+ import { AttributeUtility } from '../../utilities/AttributeUtility.js';
33
+ import DOMExceptionNameEnum from '../../exception/DOMExceptionNameEnum.js';
34
+ import ElementEventAttributeUtility from './ElementEventAttributeUtility.js';
35
+ import type Animation from '../../animation/Animation.js';
36
+ import type {
37
+ IKeyframe,
38
+ IKeyframeEffectOptions,
39
+ IPropertyIndexedKeyframes
40
+ } from '../../animation/KeyframeEffect.js';
41
+
42
+ type InsertAdjacentPosition = 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend';
43
+
44
+ /**
45
+ * Element.
46
+ */
47
+ export default class Element
48
+ extends Node
49
+ implements IChildNode, INonDocumentTypeChildNode, IParentNode
50
+ {
51
+ public static [PropertySymbol.tagName]: string | null = null;
52
+ public static [PropertySymbol.localName]: string | null = null;
53
+ public static [PropertySymbol.namespaceURI]: string | null = null;
54
+ public declare cloneNode: (deep?: boolean) => Element;
55
+
56
+ // Internal properties
57
+ public declare [PropertySymbol.classList]: DOMTokenList | null;
58
+ public declare [PropertySymbol.isValue]: string | null;
59
+ public declare [PropertySymbol.nodeType]: NodeTypeEnum;
60
+ public declare [PropertySymbol.prefix]: string | null;
61
+ public declare [PropertySymbol.shadowRoot]: ShadowRoot | null;
62
+ public declare [PropertySymbol.scrollHeight]: number;
63
+ public declare [PropertySymbol.scrollWidth]: number;
64
+ public declare [PropertySymbol.scrollTop]: number;
65
+ public declare [PropertySymbol.scrollLeft]: number;
66
+ public declare [PropertySymbol.attributes]: NamedNodeMap;
67
+ public declare [PropertySymbol.attributesProxy]: NamedNodeMap | null;
68
+ public declare [PropertySymbol.children]: HTMLCollection<Element> | null;
69
+ public declare [PropertySymbol.computedStyle]: CSSStyleDeclaration | null;
70
+ public declare [PropertySymbol.pointerCaptures]: Set<number>;
71
+ public declare [PropertySymbol.propertyEventListeners]: Map<
72
+ string,
73
+ ((event: Event) => void) | null
74
+ >;
75
+ public declare [PropertySymbol.tagName]: string | null;
76
+ public declare [PropertySymbol.localName]: string | null;
77
+ public declare [PropertySymbol.namespaceURI]: string | null;
78
+ public declare [PropertySymbol.animations]: Animation[];
79
+
80
+ /**
81
+ * Constructor.
82
+ */
83
+ constructor() {
84
+ super();
85
+
86
+ // When upgrading a custom element in-place, constructor() returns the existing
87
+ // element. This propagates through the entire super() chain so the custom element's
88
+ // constructor runs with `this` = the existing element (same mechanism real browsers use)
89
+ //
90
+ // It's also important to not initialize properties
91
+ if ((<typeof Element>this.constructor)[PropertySymbol.customElementUpgradeTarget]) {
92
+ return <Element>(<typeof Element>this.constructor)[PropertySymbol.customElementUpgradeTarget];
93
+ }
94
+
95
+ this[PropertySymbol.classList] = null;
96
+ this[PropertySymbol.isValue] = null;
97
+ this[PropertySymbol.nodeType] = NodeTypeEnum.elementNode;
98
+ this[PropertySymbol.prefix] = null;
99
+ this[PropertySymbol.shadowRoot] = null;
100
+ this[PropertySymbol.scrollHeight] = 0;
101
+ this[PropertySymbol.scrollWidth] = 0;
102
+ this[PropertySymbol.scrollTop] = 0;
103
+ this[PropertySymbol.scrollLeft] = 0;
104
+ this[PropertySymbol.attributes] = new NamedNodeMap(this);
105
+ this[PropertySymbol.attributesProxy] = null;
106
+ this[PropertySymbol.children] = null;
107
+ this[PropertySymbol.computedStyle] = null;
108
+ this[PropertySymbol.pointerCaptures] = new Set();
109
+ this[PropertySymbol.propertyEventListeners] = new Map();
110
+ this[PropertySymbol.animations] = [];
111
+
112
+ // CustomElementRegistry will populate the properties upon calling "CustomElementRegistry.define()".
113
+ // Elements that can be constructed with the "new" keyword (without using "Document.createElement()") will also populate the properties.
114
+
115
+ if (!this[PropertySymbol.tagName]) {
116
+ this[PropertySymbol.tagName] = null;
117
+ }
118
+
119
+ if (!this[PropertySymbol.localName]) {
120
+ this[PropertySymbol.localName] = null;
121
+ }
122
+
123
+ if (!this[PropertySymbol.namespaceURI]) {
124
+ this[PropertySymbol.namespaceURI] = null;
125
+ }
126
+ }
127
+
128
+ // Events
129
+
130
+ /* eslint-disable jsdoc/require-jsdoc */
131
+
132
+ public get onfullscreenerror(): ((event: Event) => void) | null {
133
+ return ElementEventAttributeUtility.getEventListener(this, 'onfullscreenerror');
134
+ }
135
+
136
+ public set onfullscreenerror(value: ((event: Event) => void) | null) {
137
+ this[PropertySymbol.propertyEventListeners].set('onfullscreenerror', value);
138
+ }
139
+
140
+ public get onfullscreenchange(): ((event: Event) => void) | null {
141
+ return ElementEventAttributeUtility.getEventListener(this, 'onfullscreenchange');
142
+ }
143
+
144
+ public set onfullscreenchange(value: ((event: Event) => void) | null) {
145
+ this[PropertySymbol.propertyEventListeners].set('onfullscreenchange', value);
146
+ }
147
+
148
+ public get onbeforecopy(): ((event: Event) => void) | null {
149
+ return ElementEventAttributeUtility.getEventListener(this, 'onbeforecopy');
150
+ }
151
+
152
+ public set onbeforecopy(value: ((event: Event) => void) | null) {
153
+ this[PropertySymbol.propertyEventListeners].set('onbeforecopy', value);
154
+ }
155
+
156
+ public get onbeforecut(): ((event: Event) => void) | null {
157
+ return ElementEventAttributeUtility.getEventListener(this, 'onbeforecut');
158
+ }
159
+
160
+ public set onbeforecut(value: ((event: Event) => void) | null) {
161
+ this[PropertySymbol.propertyEventListeners].set('onbeforecut', value);
162
+ }
163
+
164
+ public get onbeforepaste(): ((event: Event) => void) | null {
165
+ return ElementEventAttributeUtility.getEventListener(this, 'onbeforepaste');
166
+ }
167
+
168
+ public set onbeforepaste(value: ((event: Event) => void) | null) {
169
+ this[PropertySymbol.propertyEventListeners].set('onbeforepaste', value);
170
+ }
171
+
172
+ public get onsearch(): ((event: Event) => void) | null {
173
+ return ElementEventAttributeUtility.getEventListener(this, 'onsearch');
174
+ }
175
+
176
+ public set onsearch(value: ((event: Event) => void) | null) {
177
+ this[PropertySymbol.propertyEventListeners].set('onsearch', value);
178
+ }
179
+
180
+ /* eslint-enable jsdoc/require-jsdoc */
181
+
182
+ /**
183
+ * Returns tag name.
184
+ *
185
+ * @returns Tag name.
186
+ */
187
+ public get tagName(): string {
188
+ return <string>this[PropertySymbol.tagName];
189
+ }
190
+
191
+ /**
192
+ * Returns prefix.
193
+ *
194
+ * @returns Prefix.
195
+ */
196
+ public get prefix(): string | null {
197
+ return <string>this[PropertySymbol.prefix];
198
+ }
199
+
200
+ /**
201
+ * Returns shadow root.
202
+ *
203
+ * @returns Shadow root.
204
+ */
205
+ public get shadowRoot(): ShadowRoot | null {
206
+ const shadowRoot = this[PropertySymbol.shadowRoot];
207
+ return shadowRoot && shadowRoot[PropertySymbol.mode] === 'open' ? shadowRoot : null;
208
+ }
209
+
210
+ /**
211
+ * Returns scroll height.
212
+ *
213
+ * @returns Scroll height.
214
+ */
215
+ public get scrollHeight(): number {
216
+ return this[PropertySymbol.scrollHeight];
217
+ }
218
+
219
+ /**
220
+ * Returns scroll width.
221
+ *
222
+ * @returns Scroll width.
223
+ */
224
+ public get scrollWidth(): number {
225
+ return this[PropertySymbol.scrollWidth];
226
+ }
227
+
228
+ /**
229
+ * Returns scroll top.
230
+ *
231
+ * @returns Scroll top.
232
+ */
233
+ public get scrollTop(): number {
234
+ return this[PropertySymbol.scrollTop];
235
+ }
236
+
237
+ /**
238
+ * Sets scroll top.
239
+ *
240
+ * @param value Scroll top.
241
+ */
242
+ public set scrollTop(value: number) {
243
+ this[PropertySymbol.scrollTop] = value;
244
+ }
245
+
246
+ /**
247
+ * Returns scroll left.
248
+ *
249
+ * @returns Scroll left.
250
+ */
251
+ public get scrollLeft(): number {
252
+ return this[PropertySymbol.scrollLeft];
253
+ }
254
+
255
+ /**
256
+ * Sets scroll left.
257
+ *
258
+ * @param value Scroll left.
259
+ */
260
+ public set scrollLeft(value: number) {
261
+ this[PropertySymbol.scrollLeft] = value;
262
+ }
263
+
264
+ /**
265
+ * Returns attributes.
266
+ *
267
+ * @returns Attributes.
268
+ */
269
+ public get attributes(): NamedNodeMap {
270
+ if (!this[PropertySymbol.attributesProxy]) {
271
+ this[PropertySymbol.attributesProxy] = NamedNodeMapProxyFactory.createProxy(
272
+ this[PropertySymbol.attributes]
273
+ );
274
+ }
275
+ return this[PropertySymbol.attributesProxy];
276
+ }
277
+
278
+ /**
279
+ * Returns namespace URI.
280
+ *
281
+ * @returns Namespace URI.
282
+ */
283
+ public get namespaceURI(): string | null {
284
+ return this[PropertySymbol.namespaceURI];
285
+ }
286
+
287
+ /**
288
+ * Returns element children.
289
+ */
290
+ public get children(): HTMLCollection<Element> {
291
+ if (!this[PropertySymbol.children]) {
292
+ const elements = this[PropertySymbol.elementArray];
293
+ this[PropertySymbol.children] = new HTMLCollection<Element>(
294
+ PropertySymbol.illegalConstructor,
295
+ () => elements
296
+ );
297
+ }
298
+ return this[PropertySymbol.children];
299
+ }
300
+
301
+ /**
302
+ * Returns class list.
303
+ *
304
+ * @returns Class list.
305
+ */
306
+ public get classList(): DOMTokenList {
307
+ if (!this[PropertySymbol.classList]) {
308
+ this[PropertySymbol.classList] = new DOMTokenList(
309
+ PropertySymbol.illegalConstructor,
310
+ this,
311
+ 'class'
312
+ );
313
+ }
314
+ return <DOMTokenList>this[PropertySymbol.classList];
315
+ }
316
+
317
+ /**
318
+ * Sets class list.
319
+ *
320
+ * @param value Class list.
321
+ */
322
+ public set classList(value: string) {
323
+ this.setAttribute('class', value);
324
+ }
325
+
326
+ /**
327
+ * Returns ID.
328
+ *
329
+ * @returns ID.
330
+ */
331
+ public get id(): string {
332
+ return this.getAttribute('id') || '';
333
+ }
334
+
335
+ /**
336
+ * Sets ID.
337
+ *
338
+ * @param id ID.
339
+ */
340
+ public set id(id: string) {
341
+ this.setAttribute('id', id);
342
+ }
343
+
344
+ /**
345
+ * Returns class name.
346
+ *
347
+ * @returns Class name.
348
+ */
349
+ public get className(): string {
350
+ return this.getAttribute('class') || '';
351
+ }
352
+
353
+ /**
354
+ * Sets class name.
355
+ *
356
+ * @param className Class name.
357
+ */
358
+ public set className(className: string) {
359
+ this.setAttribute('class', className);
360
+ }
361
+
362
+ /**
363
+ * Node name.
364
+ *
365
+ * @returns Node name.
366
+ */
367
+ public get nodeName(): string {
368
+ return this[PropertySymbol.tagName]!;
369
+ }
370
+
371
+ /**
372
+ * Local name.
373
+ *
374
+ * @returns Local name.
375
+ */
376
+ public get localName(): string {
377
+ return this[PropertySymbol.localName]!;
378
+ }
379
+
380
+ /**
381
+ * Returns role.
382
+ *
383
+ * @returns Role.
384
+ */
385
+ public get role(): string {
386
+ return this.getAttribute('role') || '';
387
+ }
388
+
389
+ /**
390
+ * Sets role.
391
+ *
392
+ * @param role Role.
393
+ */
394
+ public set role(role: string) {
395
+ this.setAttribute('role', role);
396
+ }
397
+
398
+ /**
399
+ * Previous element sibling.
400
+ *
401
+ * @returns Element.
402
+ */
403
+ public get previousElementSibling(): Element {
404
+ return NonDocumentChildNodeUtility.previousElementSibling(this);
405
+ }
406
+
407
+ /**
408
+ * Next element sibling.
409
+ *
410
+ * @returns Element.
411
+ */
412
+ public get nextElementSibling(): Element {
413
+ return NonDocumentChildNodeUtility.nextElementSibling(this);
414
+ }
415
+
416
+ /**
417
+ * Get text value of children.
418
+ *
419
+ * @returns Text content.
420
+ */
421
+ public get textContent(): string {
422
+ let result = '';
423
+ for (const childNode of this[PropertySymbol.nodeArray]) {
424
+ if (
425
+ childNode[PropertySymbol.nodeType] === NodeTypeEnum.elementNode ||
426
+ childNode[PropertySymbol.nodeType] === NodeTypeEnum.textNode
427
+ ) {
428
+ result += childNode.textContent;
429
+ }
430
+ }
431
+ return result;
432
+ }
433
+
434
+ /**
435
+ * Sets text content.
436
+ *
437
+ * @param textContent Text content.
438
+ */
439
+ public set textContent(textContent: string) {
440
+ const childNodes = this[PropertySymbol.nodeArray];
441
+ while (childNodes.length) {
442
+ this.removeChild(childNodes[0]);
443
+ }
444
+ if (textContent) {
445
+ this.appendChild(this[PropertySymbol.ownerDocument].createTextNode(textContent));
446
+ }
447
+ }
448
+
449
+ /**
450
+ * Returns inner HTML.
451
+ *
452
+ * @returns HTML.
453
+ */
454
+ public get innerHTML(): string {
455
+ return this.getHTML();
456
+ }
457
+
458
+ /**
459
+ * Sets inner HTML.
460
+ *
461
+ * @param html HTML.
462
+ */
463
+ public set innerHTML(html: string) {
464
+ const childNodes = this[PropertySymbol.nodeArray];
465
+
466
+ while (childNodes.length) {
467
+ this.removeChild(childNodes[0]);
468
+ }
469
+
470
+ new HTMLParser(this[PropertySymbol.window]).parse(html, this);
471
+ }
472
+
473
+ /**
474
+ * Returns outer HTML.
475
+ *
476
+ * @returns HTML.
477
+ */
478
+ public get outerHTML(): string {
479
+ return new HTMLSerializer().serializeToString(this);
480
+ }
481
+
482
+ /**
483
+ * Returns outer HTML.
484
+ *
485
+ * @param html HTML.
486
+ */
487
+ public set outerHTML(html: string) {
488
+ const childNodes = new HTMLParser(this[PropertySymbol.window]).parse(html)[
489
+ PropertySymbol.nodeArray
490
+ ];
491
+ this.replaceWith(...childNodes);
492
+ }
493
+
494
+ /**
495
+ * Last element child.
496
+ *
497
+ * @returns Element.
498
+ */
499
+ public get childElementCount(): number {
500
+ return this[PropertySymbol.elementArray].length;
501
+ }
502
+
503
+ /**
504
+ * First element child.
505
+ *
506
+ * @returns Element.
507
+ */
508
+ public get firstElementChild(): Element {
509
+ return this[PropertySymbol.elementArray][0] ?? null;
510
+ }
511
+
512
+ /**
513
+ * Last element child.
514
+ *
515
+ * @returns Element.
516
+ */
517
+ public get lastElementChild(): Element {
518
+ const children = this[PropertySymbol.elementArray];
519
+ return children[children.length - 1] ?? null;
520
+ }
521
+
522
+ /**
523
+ * Returns slot.
524
+ *
525
+ * @returns Slot.
526
+ */
527
+ public get slot(): string {
528
+ return this.getAttributeNS(null, 'slot') || '';
529
+ }
530
+
531
+ /**
532
+ * Returns slot.
533
+ *
534
+ * @param slot Slot.
535
+ */
536
+ public set slot(title: string) {
537
+ this.setAttribute('slot', title);
538
+ }
539
+
540
+ /**
541
+ * Returns inner HTML and optionally the content of shadow roots.
542
+ *
543
+ * @deprecated
544
+ * @param [options] Options.
545
+ * @param [options.includeShadowRoots] Set to "true" to include shadow roots.
546
+ * @returns HTML.
547
+ */
548
+ public getInnerHTML(options?: { includeShadowRoots?: boolean }): string {
549
+ const serializer = new HTMLSerializer({
550
+ allShadowRoots: !!options?.includeShadowRoots
551
+ });
552
+
553
+ let html = '';
554
+
555
+ for (const node of this[PropertySymbol.nodeArray]) {
556
+ html += serializer.serializeToString(node);
557
+ }
558
+
559
+ return html;
560
+ }
561
+
562
+ /**
563
+ * Returns inner HTML and optionally the content of shadow roots.
564
+ *
565
+ * @param [options] Options.
566
+ * @param [options.serializableShadowRoots] A boolean value that specifies whether to include serializable shadow roots. The default value is false.
567
+ * @param [options.shadowRoots] An array of ShadowRoot objects to serialize. These are included regardless of whether they are marked as serializable, or if they are open or closed. The default value is an empty array.
568
+ * @returns HTML.
569
+ */
570
+ public getHTML(options?: {
571
+ serializableShadowRoots?: boolean;
572
+ shadowRoots?: ShadowRoot[];
573
+ }): string {
574
+ const serializer = new HTMLSerializer({
575
+ serializableShadowRoots: !!options?.serializableShadowRoots,
576
+ shadowRoots: options?.shadowRoots ?? null
577
+ });
578
+
579
+ let html = '';
580
+
581
+ for (const node of this[PropertySymbol.nodeArray]) {
582
+ html += serializer.serializeToString(node);
583
+ }
584
+
585
+ return html;
586
+ }
587
+
588
+ /**
589
+ * @override
590
+ */
591
+ public override [PropertySymbol.cloneNode](deep = false): Element {
592
+ const clone = <Element>super[PropertySymbol.cloneNode](deep);
593
+
594
+ clone[PropertySymbol.tagName] = this[PropertySymbol.tagName];
595
+ clone[PropertySymbol.localName] = this[PropertySymbol.localName];
596
+ clone[PropertySymbol.namespaceURI] = this[PropertySymbol.namespaceURI];
597
+
598
+ if (this[PropertySymbol.shadowRoot]?.[PropertySymbol.clonable]) {
599
+ clone[PropertySymbol.shadowRoot] = this[PropertySymbol.shadowRoot].cloneNode(deep);
600
+ clone[PropertySymbol.shadowRoot][PropertySymbol.host] = clone;
601
+ }
602
+
603
+ clone[PropertySymbol.attributes] = new NamedNodeMap(clone);
604
+
605
+ for (const attr of this[PropertySymbol.attributes][PropertySymbol.items].values()) {
606
+ clone[PropertySymbol.attributes].setNamedItem(attr.cloneNode(deep));
607
+ }
608
+
609
+ return <Element>clone;
610
+ }
611
+
612
+ /**
613
+ * Removes the node from its parent.
614
+ */
615
+ public remove(): void {
616
+ ChildNodeUtility.remove(this);
617
+ }
618
+
619
+ /**
620
+ * The Node.replaceWith() method replaces this Node in the children list of its parent with a set of Node or DOMString objects.
621
+ *
622
+ * @param nodes List of Node or DOMString.
623
+ */
624
+ public replaceWith(...nodes: (Node | string)[]): void {
625
+ ChildNodeUtility.replaceWith(this, ...nodes);
626
+ }
627
+
628
+ /**
629
+ * Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent, just before this ChildNode. DOMString objects are inserted as equivalent Text nodes.
630
+ *
631
+ * @param nodes List of Node or DOMString.
632
+ */
633
+ public before(...nodes: (string | Node)[]): void {
634
+ ChildNodeUtility.before(this, ...nodes);
635
+ }
636
+
637
+ /**
638
+ * Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent, just after this ChildNode. DOMString objects are inserted as equivalent Text nodes.
639
+ *
640
+ * @param nodes List of Node or DOMString.
641
+ */
642
+ public after(...nodes: (string | Node)[]): void {
643
+ ChildNodeUtility.after(this, ...nodes);
644
+ }
645
+
646
+ /**
647
+ * Inserts a set of Node objects or DOMString objects after the last child of the ParentNode. DOMString objects are inserted as equivalent Text nodes.
648
+ *
649
+ * @param nodes List of Node or DOMString.
650
+ */
651
+ public append(...nodes: (string | Node)[]): void {
652
+ ParentNodeUtility.append(this, ...nodes);
653
+ }
654
+
655
+ /**
656
+ * Inserts a set of Node objects or DOMString objects before the first child of the ParentNode. DOMString objects are inserted as equivalent Text nodes.
657
+ *
658
+ * @param nodes List of Node or DOMString.
659
+ */
660
+ public prepend(...nodes: (string | Node)[]): void {
661
+ ParentNodeUtility.prepend(this, ...nodes);
662
+ }
663
+
664
+ /**
665
+ * Replaces the existing children of a node with a specified new set of children.
666
+ *
667
+ * @param nodes List of Node or DOMString.
668
+ */
669
+ public replaceChildren(...nodes: (string | Node)[]): void {
670
+ ParentNodeUtility.replaceChildren(this, ...nodes);
671
+ }
672
+
673
+ /**
674
+ * Inserts a node to the given position.
675
+ *
676
+ * @param position Position to insert element.
677
+ * @param element Node to insert.
678
+ * @returns Inserted node or null if couldn't insert.
679
+ */
680
+ public insertAdjacentElement(position: InsertAdjacentPosition, element: Node): Node | null {
681
+ if (position === 'beforebegin') {
682
+ if (!this.parentElement) {
683
+ return null;
684
+ }
685
+
686
+ this.parentElement.insertBefore(element, this);
687
+ } else if (position === 'afterbegin') {
688
+ this.insertBefore(element, this.firstChild);
689
+ } else if (position === 'beforeend') {
690
+ this.appendChild(element);
691
+ } else if (position === 'afterend') {
692
+ if (!this.parentElement) {
693
+ return null;
694
+ }
695
+
696
+ this.parentElement.insertBefore(element, this.nextSibling);
697
+ }
698
+
699
+ return element;
700
+ }
701
+
702
+ /**
703
+ * Inserts an HTML string to the given position.
704
+ *
705
+ * @param position Position to insert text.
706
+ * @param text HTML string to insert.
707
+ */
708
+ public insertAdjacentHTML(position: InsertAdjacentPosition, text: string): void {
709
+ const childNodes = new HTMLParser(this[PropertySymbol.window]).parse(text)[
710
+ PropertySymbol.nodeArray
711
+ ];
712
+ while (childNodes.length) {
713
+ this.insertAdjacentElement(position, childNodes[0]);
714
+ }
715
+ }
716
+
717
+ /**
718
+ * Inserts text to the given position.
719
+ *
720
+ * @param position Position to insert text.
721
+ * @param text String to insert.
722
+ */
723
+ public insertAdjacentText(position: InsertAdjacentPosition, text: string): void {
724
+ if (!text) {
725
+ return;
726
+ }
727
+ const textNode = <Text>this[PropertySymbol.ownerDocument].createTextNode(text);
728
+ this.insertAdjacentElement(position, textNode);
729
+ }
730
+
731
+ /**
732
+ * Sets an attribute.
733
+ *
734
+ * @param name Name.
735
+ * @param value Value.
736
+ */
737
+ public setAttribute(name: string, value: string): void {
738
+ AttributeUtility.validateAttributeName(
739
+ name,
740
+ this[PropertySymbol.ownerDocument][PropertySymbol.contentType],
741
+ { method: 'setAttribute', instance: 'Element' }
742
+ );
743
+ name = String(name);
744
+
745
+ const namespaceURI = this[PropertySymbol.namespaceURI];
746
+
747
+ if (namespaceURI === NamespaceURI.html) {
748
+ const attribute = this[PropertySymbol.ownerDocument].createAttribute(name);
749
+ attribute[PropertySymbol.value] = String(value);
750
+ this[PropertySymbol.attributes][PropertySymbol.setNamedItem](attribute);
751
+ } else {
752
+ const nameParts = name.split(':');
753
+ let attributeNamespaceURI = null;
754
+
755
+ // In the XML namespace, the attribute "xmlns" should be set to the "http://www.w3.org/2000/xmlns/" namespace and "xlink" to the "http://www.w3.org/1999/xlink" namespace.
756
+ switch (nameParts[0]) {
757
+ case 'xmlns':
758
+ attributeNamespaceURI =
759
+ !nameParts[1] || nameParts[1] === 'xlink' ? NamespaceURI.xmlns : null;
760
+ break;
761
+ case 'xlink':
762
+ attributeNamespaceURI = NamespaceURI.xlink;
763
+ break;
764
+ }
765
+
766
+ const attribute = NodeFactory.createNode(
767
+ this[PropertySymbol.ownerDocument],
768
+ this[PropertySymbol.window].Attr
769
+ );
770
+
771
+ attribute[PropertySymbol.namespaceURI] = attributeNamespaceURI;
772
+ attribute[PropertySymbol.name] = name;
773
+ attribute[PropertySymbol.localName] =
774
+ attributeNamespaceURI && nameParts[1] ? nameParts[1] : name;
775
+ attribute[PropertySymbol.prefix] =
776
+ attributeNamespaceURI && nameParts[1] ? nameParts[0] : null;
777
+ attribute[PropertySymbol.value] = String(value);
778
+
779
+ this[PropertySymbol.attributes][PropertySymbol.setNamedItem](attribute);
780
+ }
781
+ }
782
+
783
+ /**
784
+ * Sets a namespace attribute.
785
+ *
786
+ * @param namespaceURI Namespace URI.
787
+ * @param name Name.
788
+ * @param value Value.
789
+ */
790
+ public setAttributeNS(namespaceURI: string, name: string, value: string): void {
791
+ const attribute = this[PropertySymbol.ownerDocument].createAttributeNS(namespaceURI, name);
792
+ if (!namespaceURI && attribute[PropertySymbol.prefix]) {
793
+ throw new this[PropertySymbol.window].DOMException(
794
+ `Failed to execute 'setAttributeNS' on 'Element': '' is an invalid namespace for attributes.`,
795
+ DOMExceptionNameEnum.namespaceError
796
+ );
797
+ }
798
+ attribute[PropertySymbol.value] = String(value);
799
+ this[PropertySymbol.attributes].setNamedItemNS(attribute);
800
+ }
801
+
802
+ /**
803
+ * Returns attribute names.
804
+ *
805
+ * @returns Attribute names.
806
+ */
807
+ public getAttributeNames(): string[] {
808
+ const names = [];
809
+ for (const item of this[PropertySymbol.attributes][PropertySymbol.items].values()) {
810
+ names.push(item[PropertySymbol.name]!);
811
+ }
812
+ return names;
813
+ }
814
+
815
+ /**
816
+ * Returns attribute value.
817
+ *
818
+ * @param name Name.
819
+ */
820
+ public getAttribute(name: string): string | null {
821
+ const attribute = this[PropertySymbol.attributes].getNamedItem(name);
822
+ if (attribute) {
823
+ return attribute[PropertySymbol.value];
824
+ }
825
+ return null;
826
+ }
827
+
828
+ /**
829
+ * Toggle an attribute.
830
+ * Returns `true` if attribute name is eventually present, and `false` otherwise.
831
+ *
832
+ * @param name A DOMString specifying the name of the attribute to be toggled.
833
+ * @param force A boolean value to determine whether the attribute should be added or removed, no matter whether the attribute is present or not at the moment.
834
+ */
835
+ public toggleAttribute(name: string, force?: boolean): boolean {
836
+ name = name.toLowerCase();
837
+ const attribute = this[PropertySymbol.attributes].getNamedItem(name);
838
+ if (attribute) {
839
+ if (force === true) {
840
+ return true;
841
+ }
842
+ this[PropertySymbol.attributes][PropertySymbol.removeNamedItem](attribute);
843
+ return false;
844
+ }
845
+ if (force === false) {
846
+ return false;
847
+ }
848
+ this.setAttribute(name, '');
849
+ return true;
850
+ }
851
+
852
+ /**
853
+ * Returns namespace attribute value.
854
+ *
855
+ * @param namespace Namespace URI.
856
+ * @param localName Local name.
857
+ */
858
+ public getAttributeNS(namespace: string | null, localName: string): string | null {
859
+ const attribute = this.getAttributeNodeNS(namespace, localName);
860
+ if (attribute) {
861
+ return attribute[PropertySymbol.value];
862
+ }
863
+ return null;
864
+ }
865
+
866
+ /**
867
+ * Returns a boolean value indicating whether the specified element has the attribute or not.
868
+ *
869
+ * @param name Attribute name.
870
+ * @returns True if attribute exists, false otherwise.
871
+ */
872
+ public hasAttribute(name: string): boolean {
873
+ return !!this.getAttributeNode(name);
874
+ }
875
+
876
+ /**
877
+ * Returns a boolean value indicating whether the specified element has the namespace attribute or not.
878
+ *
879
+ * @param namespace Namespace URI.
880
+ * @param localName Local name.
881
+ * @returns True if attribute exists, false otherwise.
882
+ */
883
+ public hasAttributeNS(namespace: string | null, localName: string): boolean {
884
+ return this[PropertySymbol.attributes].getNamedItemNS(namespace, localName) !== null;
885
+ }
886
+
887
+ /**
888
+ * Returns "true" if the element has attributes.
889
+ *
890
+ * @returns "true" if the element has attributes.
891
+ */
892
+ public hasAttributes(): boolean {
893
+ return this[PropertySymbol.attributes][PropertySymbol.items].size > 0;
894
+ }
895
+
896
+ /**
897
+ * Removes an attribute.
898
+ *
899
+ * @param name Name.
900
+ */
901
+ public removeAttribute(name: string): void {
902
+ const item = this[PropertySymbol.attributes].getNamedItem(name);
903
+ if (item) {
904
+ this[PropertySymbol.attributes][PropertySymbol.removeNamedItem](item);
905
+ }
906
+ }
907
+
908
+ /**
909
+ * Removes a namespace attribute.
910
+ *
911
+ * @param namespace Namespace URI.
912
+ * @param localName Local name.
913
+ */
914
+ public removeAttributeNS(namespace: string | null, localName: string): void {
915
+ const item = this[PropertySymbol.attributes].getNamedItemNS(namespace, localName);
916
+ if (item) {
917
+ this[PropertySymbol.attributes][PropertySymbol.removeNamedItem](item);
918
+ }
919
+ }
920
+
921
+ /**
922
+ * Attaches a shadow root.
923
+ *
924
+ * @param init Shadow root init.
925
+ * @param init.mode Shadow root mode.
926
+ * @param [init.clonable] Clonable.
927
+ * @param [init.delegateFocus] Delegate focus.
928
+ * @param [init.serializable] Serializable.
929
+ * @param [init.slotAssignment] Slot assignment.
930
+ * @returns Shadow root.
931
+ */
932
+ public attachShadow(init: {
933
+ mode: 'open' | 'closed';
934
+ clonable?: boolean;
935
+ delegateFocus?: boolean;
936
+ serializable?: boolean;
937
+ slotAssignment?: 'named' | 'manual';
938
+ }): ShadowRoot {
939
+ const window = this[PropertySymbol.window];
940
+
941
+ if (!init) {
942
+ throw new window.TypeError(
943
+ "Failed to execute 'attachShadow' on 'Element': 1 argument required, but only 0 present."
944
+ );
945
+ }
946
+
947
+ if (!init.mode) {
948
+ throw new window.TypeError(
949
+ "Failed to execute 'attachShadow' on 'Element': Failed to read the 'mode' property from 'ShadowRootInit': Required member is undefined."
950
+ );
951
+ }
952
+
953
+ if (init.mode !== 'open' && init.mode !== 'closed') {
954
+ throw new window.TypeError(
955
+ `Failed to execute 'attachShadow' on 'Element': Failed to read the 'mode' property from 'ShadowRootInit': The provided value '${init.mode}' is not a valid enum value of type ShadowRootMode.`
956
+ );
957
+ }
958
+
959
+ if (this[PropertySymbol.shadowRoot]) {
960
+ throw new window.DOMException(
961
+ "Failed to execute 'attachShadow' on 'Element': Shadow root cannot be created on a host which already hosts a shadow tree."
962
+ );
963
+ }
964
+
965
+ const shadowRoot = NodeFactory.createNode(
966
+ this[PropertySymbol.ownerDocument],
967
+ this[PropertySymbol.window].ShadowRoot
968
+ );
969
+
970
+ this[PropertySymbol.shadowRoot] = shadowRoot;
971
+
972
+ shadowRoot[PropertySymbol.host] = this;
973
+ shadowRoot[PropertySymbol.mode] = init.mode;
974
+ shadowRoot[PropertySymbol.clonable] = !!init.clonable;
975
+ shadowRoot[PropertySymbol.delegatesFocus] = !!init.delegateFocus;
976
+ shadowRoot[PropertySymbol.serializable] = !!init.serializable;
977
+ shadowRoot[PropertySymbol.slotAssignment] =
978
+ init.slotAssignment === 'manual' ? 'manual' : 'named';
979
+
980
+ shadowRoot[PropertySymbol.connectedToNode]();
981
+
982
+ return this[PropertySymbol.shadowRoot];
983
+ }
984
+
985
+ /**
986
+ * Converts to string.
987
+ *
988
+ * @returns String.
989
+ */
990
+ public toString(): string {
991
+ return this.outerHTML;
992
+ }
993
+
994
+ /**
995
+ * Returns the size of an element and its position relative to the viewport.
996
+ *
997
+ * @returns DOM rect.
998
+ */
999
+ public getBoundingClientRect(): DOMRect {
1000
+ // TODO: Not full implementation
1001
+ return new DOMRect();
1002
+ }
1003
+
1004
+ /**
1005
+ * Returns a collection of DOMRect objects that indicate the bounding rectangles for each CSS border box in a client.
1006
+ *
1007
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getClientRects
1008
+ * @returns DOM rect list.
1009
+ */
1010
+ public getClientRects(): DOMRectList {
1011
+ // TODO: Not full implementation
1012
+ const domRectList = new DOMRectList(PropertySymbol.illegalConstructor);
1013
+ domRectList.push(this.getBoundingClientRect());
1014
+ return domRectList;
1015
+ }
1016
+
1017
+ /**
1018
+ * Designates a specific element as the capture target of future pointer events.
1019
+ *
1020
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/setPointerCapture
1021
+ * @param pointerId Pointer ID.
1022
+ */
1023
+ public setPointerCapture(pointerId: number): void {
1024
+ this[PropertySymbol.pointerCaptures].add(pointerId);
1025
+ }
1026
+
1027
+ /**
1028
+ * Returns whether the element on which it is invoked has pointer capture for the pointer identified by the given pointer ID.
1029
+ *
1030
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/hasPointerCapture
1031
+ * @param pointerId Pointer ID.
1032
+ * @returns Whether the element has pointer capture.
1033
+ */
1034
+ public hasPointerCapture(pointerId: number): boolean {
1035
+ return this[PropertySymbol.pointerCaptures].has(pointerId);
1036
+ }
1037
+
1038
+ /**
1039
+ * Releases pointer capture that was previously set for a specific pointer.
1040
+ *
1041
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/releasePointerCapture
1042
+ * @param pointerId Pointer ID.
1043
+ */
1044
+ public releasePointerCapture(pointerId: number): void {
1045
+ this[PropertySymbol.pointerCaptures].delete(pointerId);
1046
+ }
1047
+
1048
+ /**
1049
+ * The matches() method checks to see if the Element would be selected by the provided selectorString.
1050
+ *
1051
+ * @param selector Selector.
1052
+ * @returns "true" if matching.
1053
+ */
1054
+ public matches(selector: string): boolean {
1055
+ return !!QuerySelector.matches(this, selector);
1056
+ }
1057
+
1058
+ /**
1059
+ * Traverses the Element and its parents (heading toward the document root) until it finds a node that matches the provided selector string.
1060
+ *
1061
+ * @param selector Selector.
1062
+ * @returns Closest matching element.
1063
+ */
1064
+ public closest(selector: string): Element | null {
1065
+ // eslint-disable-next-line
1066
+ let parent: Element | null = this;
1067
+
1068
+ while (parent) {
1069
+ if (QuerySelector.matches(parent, selector)) {
1070
+ return parent;
1071
+ }
1072
+ parent = parent.parentElement;
1073
+ }
1074
+
1075
+ return null;
1076
+ }
1077
+
1078
+ /**
1079
+ * Connected callback.
1080
+ */
1081
+ public connectedCallback?(): void;
1082
+
1083
+ /**
1084
+ * Disconnected callback.
1085
+ */
1086
+ public disconnectedCallback?(): void;
1087
+
1088
+ /**
1089
+ * Attribute changed callback.
1090
+ *
1091
+ * @param name Name.
1092
+ * @param oldValue Old value.
1093
+ * @param newValue New value.
1094
+ */
1095
+ public attributeChangedCallback?(
1096
+ name: string,
1097
+ oldValue: string | null,
1098
+ newValue: string | null
1099
+ ): void;
1100
+
1101
+ /**
1102
+ * Query CSS selector to find matching nodes.
1103
+ *
1104
+ * @param selector CSS selector.
1105
+ * @returns Matching elements.
1106
+ */
1107
+ public querySelectorAll<K extends keyof IHTMLElementTagNameMap>(
1108
+ selector: K
1109
+ ): NodeList<IHTMLElementTagNameMap[K]>;
1110
+
1111
+ /**
1112
+ * Query CSS selector to find matching elements.
1113
+ *
1114
+ * @param selector CSS selector.
1115
+ * @returns Matching elements.
1116
+ */
1117
+ public querySelectorAll<K extends keyof ISVGElementTagNameMap>(
1118
+ selector: K
1119
+ ): NodeList<ISVGElementTagNameMap[K]>;
1120
+
1121
+ /**
1122
+ * Query CSS selector to find matching elements.
1123
+ *
1124
+ * @param selector CSS selector.
1125
+ * @returns Matching elements.
1126
+ */
1127
+ public querySelectorAll<E extends Element = Element>(selector: string): NodeList<E>;
1128
+
1129
+ /**
1130
+ * Query CSS selector to find matching elements.
1131
+ *
1132
+ * @param selector CSS selector.
1133
+ * @returns Matching elements.
1134
+ */
1135
+ public querySelectorAll(selector: string): NodeList<Element> {
1136
+ return QuerySelector.querySelectorAll(this, selector);
1137
+ }
1138
+
1139
+ /**
1140
+ * Query CSS Selector to find matching node.
1141
+ *
1142
+ * @param selector CSS selector.
1143
+ * @returns Matching element.
1144
+ */
1145
+ public querySelector<K extends keyof IHTMLElementTagNameMap>(
1146
+ selector: K
1147
+ ): IHTMLElementTagNameMap[K] | null;
1148
+
1149
+ /**
1150
+ * Query CSS Selector to find matching node.
1151
+ *
1152
+ * @param selector CSS selector.
1153
+ * @returns Matching element.
1154
+ */
1155
+ public querySelector<K extends keyof ISVGElementTagNameMap>(
1156
+ selector: K
1157
+ ): ISVGElementTagNameMap[K] | null;
1158
+
1159
+ /**
1160
+ * Query CSS Selector to find matching node.
1161
+ *
1162
+ * @param selector CSS selector.
1163
+ * @returns Matching element.
1164
+ */
1165
+ public querySelector<E extends Element = Element>(selector: string): E | null;
1166
+
1167
+ /**
1168
+ * Query CSS Selector to find matching node.
1169
+ *
1170
+ * @param selector CSS selector.
1171
+ * @returns Matching element.
1172
+ */
1173
+ public querySelector(selector: string): Element | null {
1174
+ return QuerySelector.querySelector(this, selector);
1175
+ }
1176
+
1177
+ /**
1178
+ * Returns an elements by class name.
1179
+ *
1180
+ * @param className Tag name.
1181
+ * @returns Matching element.
1182
+ */
1183
+ public getElementsByClassName(className: string): HTMLCollection<Element> {
1184
+ return ParentNodeUtility.getElementsByClassName(this, className);
1185
+ }
1186
+
1187
+ /**
1188
+ * Returns an elements by tag name.
1189
+ *
1190
+ * @param tagName Tag name.
1191
+ * @returns Matching element.
1192
+ */
1193
+ public getElementsByTagName<K extends keyof IHTMLElementTagNameMap>(
1194
+ tagName: K
1195
+ ): HTMLCollection<IHTMLElementTagNameMap[K]>;
1196
+
1197
+ /**
1198
+ * Returns an elements by tag name.
1199
+ *
1200
+ * @param tagName Tag name.
1201
+ * @returns Matching element.
1202
+ */
1203
+ public getElementsByTagName<K extends keyof ISVGElementTagNameMap>(
1204
+ tagName: K
1205
+ ): HTMLCollection<ISVGElementTagNameMap[K]>;
1206
+
1207
+ /**
1208
+ * Returns an elements by tag name.
1209
+ *
1210
+ * @param tagName Tag name.
1211
+ * @returns Matching element.
1212
+ */
1213
+ public getElementsByTagName(tagName: string): HTMLCollection<Element>;
1214
+
1215
+ /**
1216
+ * Returns an elements by tag name.
1217
+ *
1218
+ * @param tagName Tag name.
1219
+ * @returns Matching element.
1220
+ */
1221
+ public getElementsByTagName(tagName: string): HTMLCollection<Element> {
1222
+ return ParentNodeUtility.getElementsByTagName(this, tagName);
1223
+ }
1224
+
1225
+ /**
1226
+ * Returns an elements by tag name and namespace.
1227
+ *
1228
+ * @param namespaceURI Namespace URI.
1229
+ * @param tagName Tag name.
1230
+ * @returns Matching element.
1231
+ */
1232
+ public getElementsByTagNameNS<K extends keyof IHTMLElementTagNameMap>(
1233
+ namespaceURI: 'http://www.w3.org/1999/xhtml',
1234
+ tagName: K
1235
+ ): HTMLCollection<IHTMLElementTagNameMap[K]>;
1236
+
1237
+ /**
1238
+ * Returns an elements by tag name and namespace.
1239
+ *
1240
+ * @param namespaceURI Namespace URI.
1241
+ * @param tagName Tag name.
1242
+ * @returns Matching element.
1243
+ */
1244
+ public getElementsByTagNameNS<K extends keyof ISVGElementTagNameMap>(
1245
+ namespaceURI: 'http://www.w3.org/2000/svg',
1246
+ tagName: K
1247
+ ): HTMLCollection<ISVGElementTagNameMap[K]>;
1248
+
1249
+ /**
1250
+ * Returns an elements by tag name and namespace.
1251
+ *
1252
+ * @param namespaceURI Namespace URI.
1253
+ * @param tagName Tag name.
1254
+ * @returns Matching element.
1255
+ */
1256
+ public getElementsByTagNameNS(namespaceURI: string, tagName: string): HTMLCollection<Element>;
1257
+
1258
+ /**
1259
+ * Returns an elements by tag name and namespace.
1260
+ *
1261
+ * @param namespaceURI Namespace URI.
1262
+ * @param tagName Tag name.
1263
+ * @returns Matching element.
1264
+ */
1265
+ public getElementsByTagNameNS(namespaceURI: string, tagName: string): HTMLCollection<Element> {
1266
+ return ParentNodeUtility.getElementsByTagNameNS(this, namespaceURI, tagName);
1267
+ }
1268
+
1269
+ /**
1270
+ * The setAttributeNode() method adds a new Attr node to the specified element.
1271
+ *
1272
+ * @param attribute Attribute.
1273
+ * @returns Replaced attribute.
1274
+ */
1275
+ public setAttributeNode(attribute: Attr): Attr | null {
1276
+ return this[PropertySymbol.attributes].setNamedItem(attribute);
1277
+ }
1278
+
1279
+ /**
1280
+ * The setAttributeNodeNS() method adds a new Attr node to the specified element.
1281
+ *
1282
+ * @param attribute Attribute.
1283
+ * @returns Replaced attribute.
1284
+ */
1285
+ public setAttributeNodeNS(attribute: Attr): Attr | null {
1286
+ return this[PropertySymbol.attributes].setNamedItemNS(attribute);
1287
+ }
1288
+
1289
+ /**
1290
+ * Returns an Attr node.
1291
+ *
1292
+ * @param name Name.
1293
+ * @returns Replaced attribute.
1294
+ */
1295
+ public getAttributeNode(name: string): Attr | null {
1296
+ return this[PropertySymbol.attributes].getNamedItem(name);
1297
+ }
1298
+
1299
+ /**
1300
+ * Returns a namespaced Attr node.
1301
+ *
1302
+ * @param namespace Namespace.
1303
+ * @param localName Name.
1304
+ * @returns Replaced attribute.
1305
+ */
1306
+ public getAttributeNodeNS(namespace: string | null, localName: string): Attr | null {
1307
+ return this[PropertySymbol.attributes].getNamedItemNS(namespace, localName);
1308
+ }
1309
+
1310
+ /**
1311
+ * Removes an Attr node.
1312
+ *
1313
+ * @param attribute Attribute.
1314
+ * @returns Removed attribute.
1315
+ */
1316
+ public removeAttributeNode(attribute: Attr): Attr | null {
1317
+ if (attribute[PropertySymbol.ownerElement] !== this) {
1318
+ throw new this[PropertySymbol.window].DOMException(
1319
+ "Failed to execute 'removeAttributeNode' on 'Element': The node provided is owned by another element."
1320
+ );
1321
+ }
1322
+ this[PropertySymbol.attributes][PropertySymbol.removeNamedItem](attribute);
1323
+ return attribute;
1324
+ }
1325
+
1326
+ /**
1327
+ * Scrolls to a particular set of coordinates.
1328
+ *
1329
+ * @param x X position or options object.
1330
+ * @param y Y position.
1331
+ */
1332
+ public scroll(x: IScrollToOptions | number, y?: number): void {
1333
+ if (typeof x !== 'object' && arguments.length === 1) {
1334
+ throw new this[PropertySymbol.window].TypeError(
1335
+ "Failed to execute 'scroll' on 'Element': The provided value is not of type 'ScrollToOptions'."
1336
+ );
1337
+ }
1338
+
1339
+ const options = typeof x === 'object' ? x : { left: x, top: y };
1340
+
1341
+ if (options.behavior === 'smooth') {
1342
+ this[PropertySymbol.window].setTimeout(() => {
1343
+ if (options.top !== undefined) {
1344
+ const top = Number(options.top);
1345
+ (<number>this.scrollTop) = isNaN(top) ? 0 : top;
1346
+ }
1347
+ if (options.left !== undefined) {
1348
+ const left = Number(options.left);
1349
+ (<number>this.scrollLeft) = isNaN(left) ? 0 : left;
1350
+ }
1351
+ });
1352
+ } else {
1353
+ if (options.top !== undefined) {
1354
+ const top = Number(options.top);
1355
+ (<number>this.scrollTop) = isNaN(top) ? 0 : top;
1356
+ }
1357
+ if (options.left !== undefined) {
1358
+ const left = Number(options.left);
1359
+ (<number>this.scrollLeft) = isNaN(left) ? 0 : left;
1360
+ }
1361
+ }
1362
+ }
1363
+
1364
+ /**
1365
+ * Scrolls to a particular set of coordinates.
1366
+ *
1367
+ * @param x X position or options object.
1368
+ * @param y Y position.
1369
+ */
1370
+ public scrollTo(x: IScrollToOptions | number, y?: number): void {
1371
+ if (typeof x !== 'object' && arguments.length === 1) {
1372
+ throw new this[PropertySymbol.window].TypeError(
1373
+ "Failed to execute 'scrollTo' on 'Element': The provided value is not of type 'ScrollToOptions'."
1374
+ );
1375
+ }
1376
+ this.scroll(x, y);
1377
+ }
1378
+
1379
+ /**
1380
+ * Scrolls by a relative amount from the current position.
1381
+ *
1382
+ * @param x Pixels to scroll by from top or scroll options object.
1383
+ * @param y Pixels to scroll by from left.
1384
+ */
1385
+ public scrollBy(x: IScrollToOptions | number, y?: number): void {
1386
+ if (typeof x !== 'object' && arguments.length === 1) {
1387
+ throw new this[PropertySymbol.window].TypeError(
1388
+ "Failed to execute 'scrollBy' on 'Element': The provided value is not of type 'ScrollToOptions'."
1389
+ );
1390
+ }
1391
+ const options = typeof x === 'object' ? x : { left: x, top: y };
1392
+ this.scroll({
1393
+ left: this.scrollLeft + (options.left ?? 0),
1394
+ top: this.scrollTop + (options.top ?? 0),
1395
+ behavior: options.behavior
1396
+ });
1397
+ }
1398
+
1399
+ /**
1400
+ * Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
1401
+ *
1402
+ * @param [_options] Options.
1403
+ */
1404
+ public scrollIntoView(
1405
+ _options?:
1406
+ | boolean
1407
+ | {
1408
+ behavior?: 'smooth' | 'instant' | 'auto';
1409
+ block?: 'start' | 'center' | 'end' | 'nearest';
1410
+ inline?: 'start' | 'center' | 'end' | 'nearest';
1411
+ }
1412
+ ): void {
1413
+ // Do nothing
1414
+ }
1415
+
1416
+ /**
1417
+ * Checks if the element is visible.
1418
+ *
1419
+ * @param [options] Options.
1420
+ * @param [options.contentVisibilityAuto] Set to "true" to check "content-visibility: auto".
1421
+ * @param [options.opacityProperty] Set to "true" to check "opacity" property.
1422
+ * @param [options.visibilityProperty] Set to "true" to check "visibility" property.
1423
+ * @param [options.checkOpacity] A historic alias for opacityProperty.
1424
+ * @param [options.checkVisibilityCSS] A historic alias for visibilityProperty.
1425
+ */
1426
+ public checkVisibility(options?: {
1427
+ contentVisibilityAuto?: boolean;
1428
+ opacityProperty?: boolean;
1429
+ visibilityProperty?: boolean;
1430
+ /** @deprecated Use "opacityProperty" */
1431
+ checkOpacity?: boolean;
1432
+ /** @deprecated Use "visibilityProperty" */
1433
+ checkVisibilityCSS?: boolean;
1434
+ }): boolean {
1435
+ if (!this[PropertySymbol.isConnected]) {
1436
+ return false;
1437
+ }
1438
+ let parent: Element | null = this;
1439
+ while (parent) {
1440
+ const computedStyle = this[PropertySymbol.window].getComputedStyle(parent);
1441
+ if (computedStyle.display === 'none') {
1442
+ return false;
1443
+ }
1444
+ if (computedStyle.display === 'contents') {
1445
+ let isChildVisible = false;
1446
+ for (const child of parent[PropertySymbol.elementArray]) {
1447
+ const childComputedStyle = this[PropertySymbol.window].getComputedStyle(child);
1448
+ if (childComputedStyle.display !== 'none') {
1449
+ isChildVisible = true;
1450
+ break;
1451
+ }
1452
+ }
1453
+ if (!isChildVisible) {
1454
+ return false;
1455
+ }
1456
+ }
1457
+ if ((options?.opacityProperty || options?.checkOpacity) && computedStyle.opacity === '0') {
1458
+ return false;
1459
+ }
1460
+ if (
1461
+ (options?.visibilityProperty || options?.checkVisibilityCSS) &&
1462
+ computedStyle.visibility === 'hidden'
1463
+ ) {
1464
+ return false;
1465
+ }
1466
+ parent = <Element>parent.parentElement;
1467
+ }
1468
+ return true;
1469
+ }
1470
+
1471
+ /**
1472
+ * Creates and starts an animation for the element.
1473
+ *
1474
+ * @param keyframes Keyframes.
1475
+ * @param options Timing options.
1476
+ * @returns Animation.
1477
+ */
1478
+ public animate(
1479
+ keyframes: IKeyframe[] | IPropertyIndexedKeyframes | null,
1480
+ options: number | IKeyframeEffectOptions = {}
1481
+ ): Animation {
1482
+ const effect = new this[PropertySymbol.window].KeyframeEffect(this, keyframes, options);
1483
+ const animation = new this[PropertySymbol.window].Animation(
1484
+ effect,
1485
+ this[PropertySymbol.ownerDocument].timeline
1486
+ );
1487
+ this[PropertySymbol.animations].push(animation);
1488
+ animation.play();
1489
+ return animation;
1490
+ }
1491
+
1492
+ /**
1493
+ * Returns animations affecting the element.
1494
+ *
1495
+ * @returns Animations.
1496
+ */
1497
+ public getAnimations(): Animation[] {
1498
+ return this[PropertySymbol.animations].filter((animation) => animation.playState !== 'idle');
1499
+ }
1500
+
1501
+ /**
1502
+ * @override
1503
+ */
1504
+ public override [PropertySymbol.appendChild](node: Node, disableValidations = false): Node {
1505
+ const returnValue = super[PropertySymbol.appendChild](node, disableValidations);
1506
+ this[PropertySymbol.onSlotChange](node);
1507
+ return returnValue;
1508
+ }
1509
+
1510
+ /**
1511
+ * @override
1512
+ */
1513
+ public override [PropertySymbol.removeChild](node: Node): Node {
1514
+ const returnValue = super[PropertySymbol.removeChild](node);
1515
+ this[PropertySymbol.onSlotChange](node);
1516
+ return returnValue;
1517
+ }
1518
+
1519
+ /**
1520
+ * @override
1521
+ */
1522
+ public override [PropertySymbol.insertBefore](
1523
+ newNode: Node,
1524
+ referenceNode: Node | null,
1525
+ disableValidations = false
1526
+ ): Node {
1527
+ const returnValue = super[PropertySymbol.insertBefore](
1528
+ newNode,
1529
+ referenceNode,
1530
+ disableValidations
1531
+ );
1532
+ this[PropertySymbol.onSlotChange](newNode);
1533
+ return returnValue;
1534
+ }
1535
+
1536
+ /**
1537
+ * Triggered when an attribute is set.
1538
+ *
1539
+ * @param attribute Attribute.
1540
+ * @param replacedAttribute Replaced attribute.
1541
+ */
1542
+ public [PropertySymbol.onSetAttribute](attribute: Attr, replacedAttribute: Attr | null): void {
1543
+ if (!attribute[PropertySymbol.name]) {
1544
+ return;
1545
+ }
1546
+
1547
+ const oldValue = replacedAttribute ? replacedAttribute[PropertySymbol.value] : null;
1548
+
1549
+ if (
1550
+ attribute[PropertySymbol.name] === 'slot' &&
1551
+ this[PropertySymbol.parentNode] &&
1552
+ (<Element>this[PropertySymbol.parentNode])[PropertySymbol.shadowRoot]
1553
+ ) {
1554
+ const shadowRoot = (<Element>this[PropertySymbol.parentNode])[PropertySymbol.shadowRoot];
1555
+
1556
+ if (shadowRoot && attribute[PropertySymbol.value] !== oldValue) {
1557
+ // Previous slot
1558
+ if (oldValue !== null && replacedAttribute) {
1559
+ const slot = shadowRoot.querySelector(
1560
+ `slot[name="${replacedAttribute[PropertySymbol.value]}"]`
1561
+ );
1562
+ if (slot) {
1563
+ slot.dispatchEvent(new Event('slotchange', { bubbles: true }));
1564
+ }
1565
+ } else {
1566
+ const slot = shadowRoot.querySelector('slot:not([name])');
1567
+ if (slot) {
1568
+ slot.dispatchEvent(new Event('slotchange', { bubbles: true }));
1569
+ }
1570
+ }
1571
+
1572
+ // New slot
1573
+ const slot = shadowRoot.querySelector(`slot[name="${attribute[PropertySymbol.value]}"]`);
1574
+ if (slot) {
1575
+ slot.dispatchEvent(new Event('slotchange', { bubbles: true }));
1576
+ }
1577
+ }
1578
+ }
1579
+
1580
+ if (
1581
+ this[<'constructor'>attribute[PropertySymbol.name]] !== undefined &&
1582
+ attribute[PropertySymbol.name][0] === 'o' &&
1583
+ attribute[PropertySymbol.name][1] === 'n'
1584
+ ) {
1585
+ this[PropertySymbol.propertyEventListeners].delete(attribute[PropertySymbol.name]);
1586
+ }
1587
+
1588
+ if (attribute[PropertySymbol.name] === 'id' && this[PropertySymbol.isConnected]) {
1589
+ if (replacedAttribute?.[PropertySymbol.value]) {
1590
+ this[PropertySymbol.removeIdentifierFromWindow](replacedAttribute[PropertySymbol.value]);
1591
+ }
1592
+ this[PropertySymbol.addIdentifierToWindow](attribute[PropertySymbol.value]);
1593
+ }
1594
+
1595
+ this[PropertySymbol.reportMutation](
1596
+ new MutationRecord({
1597
+ type: MutationTypeEnum.attributes,
1598
+ target: this,
1599
+ attributeName: attribute[PropertySymbol.name],
1600
+ oldValue
1601
+ })
1602
+ );
1603
+ }
1604
+
1605
+ /**
1606
+ * Triggered when an attribute is set.
1607
+ *
1608
+ * @param removedAttribute Attribute.
1609
+ */
1610
+ public [PropertySymbol.onRemoveAttribute](removedAttribute: Attr): void {
1611
+ if (
1612
+ removedAttribute[PropertySymbol.name] === 'slot' &&
1613
+ this[PropertySymbol.parentNode] &&
1614
+ (<Element>this[PropertySymbol.parentNode])[PropertySymbol.shadowRoot]
1615
+ ) {
1616
+ const shadowRoot = (<Element>this[PropertySymbol.parentNode])[PropertySymbol.shadowRoot]!;
1617
+ const namedSlot = shadowRoot.querySelector(
1618
+ `slot[name="${removedAttribute[PropertySymbol.value]}"]`
1619
+ );
1620
+ const defaultSlot = shadowRoot.querySelector('slot:not([name])');
1621
+ if (namedSlot) {
1622
+ namedSlot.dispatchEvent(new Event('slotchange', { bubbles: true }));
1623
+ }
1624
+ if (defaultSlot) {
1625
+ defaultSlot.dispatchEvent(new Event('slotchange', { bubbles: true }));
1626
+ }
1627
+ }
1628
+
1629
+ if (removedAttribute[PropertySymbol.name] === 'id' && this[PropertySymbol.isConnected]) {
1630
+ this[PropertySymbol.removeIdentifierFromWindow](removedAttribute[PropertySymbol.value]);
1631
+ }
1632
+
1633
+ this[PropertySymbol.reportMutation](
1634
+ new MutationRecord({
1635
+ type: MutationTypeEnum.attributes,
1636
+ target: this,
1637
+ attributeName: removedAttribute[PropertySymbol.name],
1638
+ oldValue: removedAttribute[PropertySymbol.value]
1639
+ })
1640
+ );
1641
+ }
1642
+
1643
+ /**
1644
+ * @override
1645
+ */
1646
+ public override [PropertySymbol.connectedToDocument](): void {
1647
+ const id = this.getAttribute('id');
1648
+ if (id) {
1649
+ this[PropertySymbol.addIdentifierToWindow](id);
1650
+ }
1651
+
1652
+ super[PropertySymbol.connectedToDocument]();
1653
+
1654
+ this[PropertySymbol.window][PropertySymbol.customElementReactionStack].enqueueReaction(
1655
+ this,
1656
+ 'connectedCallback'
1657
+ );
1658
+
1659
+ if (this[PropertySymbol.shadowRoot]) {
1660
+ for (const childNode of this[PropertySymbol.nodeArray]) {
1661
+ this[PropertySymbol.onSlotChange](childNode);
1662
+ }
1663
+ }
1664
+ }
1665
+
1666
+ /**
1667
+ * @override
1668
+ */
1669
+ public override [PropertySymbol.disconnectedFromDocument](): void {
1670
+ super[PropertySymbol.disconnectedFromDocument]();
1671
+
1672
+ const id = this.getAttribute('id');
1673
+ if (id) {
1674
+ this[PropertySymbol.removeIdentifierFromWindow](id);
1675
+ }
1676
+
1677
+ this[PropertySymbol.window][PropertySymbol.customElementReactionStack].enqueueReaction(
1678
+ this,
1679
+ 'disconnectedCallback'
1680
+ );
1681
+ }
1682
+
1683
+ /**
1684
+ * @override
1685
+ */
1686
+ public override [PropertySymbol.destroy](): void {
1687
+ const id = this.getAttribute('id');
1688
+ if (id) {
1689
+ this[PropertySymbol.removeIdentifierFromWindow](id);
1690
+ }
1691
+
1692
+ this[PropertySymbol.window][PropertySymbol.customElementReactionStack].enqueueReaction(
1693
+ this,
1694
+ 'disconnectedCallback'
1695
+ );
1696
+
1697
+ super[PropertySymbol.destroy]();
1698
+
1699
+ if (this[PropertySymbol.shadowRoot]) {
1700
+ this[PropertySymbol.shadowRoot][PropertySymbol.destroy]();
1701
+ }
1702
+
1703
+ this[PropertySymbol.classList] = null;
1704
+ this[PropertySymbol.shadowRoot] = null;
1705
+ this[PropertySymbol.attributesProxy] = null;
1706
+ this[PropertySymbol.children] = null;
1707
+ this[PropertySymbol.computedStyle] = null;
1708
+ this[PropertySymbol.propertyEventListeners].clear();
1709
+ this[PropertySymbol.attributes][PropertySymbol.itemsByNamespaceURI].clear();
1710
+ this[PropertySymbol.attributes][PropertySymbol.itemsByName].clear();
1711
+ this[PropertySymbol.attributes][PropertySymbol.items].clear();
1712
+ }
1713
+
1714
+ /**
1715
+ * Adds identifier to the window object.
1716
+ *
1717
+ * @param id Identifier.
1718
+ */
1719
+ public [PropertySymbol.addIdentifierToWindow](id: string | null): void {
1720
+ if (!id) {
1721
+ return;
1722
+ }
1723
+
1724
+ const document = this[PropertySymbol.ownerDocument];
1725
+ const window = this[PropertySymbol.window];
1726
+
1727
+ // We should not add the identifier when inside a shadow root
1728
+ if (this[PropertySymbol.rootNode] && this[PropertySymbol.rootNode] !== document) {
1729
+ return;
1730
+ }
1731
+
1732
+ if (!document[PropertySymbol.elementIdMap].has(id)) {
1733
+ document[PropertySymbol.elementIdMap].set(id, { elements: [], htmlCollection: null });
1734
+ }
1735
+
1736
+ const entry = document[PropertySymbol.elementIdMap].get(id);
1737
+
1738
+ if (!entry) {
1739
+ return;
1740
+ }
1741
+
1742
+ // HTMLFormElement and HTMLSelectElement can be a proxy, but the scope can be the target and not the actual proxy
1743
+ // To make sure we use the proxy we can check for the proxy property
1744
+ const element = this[PropertySymbol.proxy] || this;
1745
+
1746
+ entry.elements.push(element);
1747
+
1748
+ if (entry.elements.length > 1) {
1749
+ if (!entry.htmlCollection) {
1750
+ entry.htmlCollection = new HTMLCollection<Element>(
1751
+ PropertySymbol.illegalConstructor,
1752
+ () => entry.elements
1753
+ );
1754
+ }
1755
+
1756
+ if (!(id in window) || (<any>window)[id] === entry.elements[0]) {
1757
+ (<any>window)[id] = entry.htmlCollection;
1758
+ }
1759
+ } else if (
1760
+ !(id in window) ||
1761
+ (entry.htmlCollection !== null && (<any>window)[id] === entry.htmlCollection)
1762
+ ) {
1763
+ (<any>window)[id] = element;
1764
+ }
1765
+ }
1766
+
1767
+ /**
1768
+ * Removes identifier from the window object.
1769
+ *
1770
+ * @param id Identifier.
1771
+ */
1772
+ public [PropertySymbol.removeIdentifierFromWindow](id: string | null): void {
1773
+ if (!id) {
1774
+ return;
1775
+ }
1776
+
1777
+ const document = this[PropertySymbol.ownerDocument];
1778
+ const window = this[PropertySymbol.window];
1779
+
1780
+ // We should not add the identifier when inside a shadow root
1781
+ if (this[PropertySymbol.rootNode] && this[PropertySymbol.rootNode] !== document) {
1782
+ return;
1783
+ }
1784
+
1785
+ const entry = document[PropertySymbol.elementIdMap].get(id);
1786
+
1787
+ if (!entry) {
1788
+ return;
1789
+ }
1790
+
1791
+ // HTMLFormElement and HTMLSelectElement can be a proxy, but the scope can be the target and not the actual proxy
1792
+ // To make sure we use the proxy we can check for the proxy property
1793
+ const element = this[PropertySymbol.proxy] || this;
1794
+ const index = entry.elements.indexOf(element);
1795
+
1796
+ if (index !== -1) {
1797
+ entry.elements.splice(index, 1);
1798
+ }
1799
+
1800
+ if (entry.elements.length === 1) {
1801
+ if ((<any>window)[id] === entry.htmlCollection) {
1802
+ (<any>window)[id] = entry.elements[0];
1803
+ }
1804
+
1805
+ entry.htmlCollection = null;
1806
+ } else if (!entry.elements.length) {
1807
+ document[PropertySymbol.elementIdMap].delete(id);
1808
+
1809
+ if ((<any>window)[id] === element || (<any>window)[id] === entry.htmlCollection) {
1810
+ delete (<any>window)[id];
1811
+ }
1812
+ }
1813
+ }
1814
+
1815
+ /**
1816
+ * Triggered when child nodes are changed.
1817
+ *
1818
+ * @param addedOrRemovedNode Changed node.
1819
+ */
1820
+ public [PropertySymbol.onSlotChange](addedOrRemovedNode: Node): void {
1821
+ const shadowRoot = this[PropertySymbol.shadowRoot];
1822
+
1823
+ if (!shadowRoot || !this[PropertySymbol.isConnected]) {
1824
+ return;
1825
+ }
1826
+
1827
+ const slotName = (<Element>addedOrRemovedNode)['getAttribute']
1828
+ ? (<Element>addedOrRemovedNode).getAttribute('slot')
1829
+ : null;
1830
+ if (slotName) {
1831
+ const slot = shadowRoot.querySelector(`slot[name="${slotName}"]`);
1832
+ if (slot) {
1833
+ slot.dispatchEvent(new Event('slotchange', { bubbles: true }));
1834
+ }
1835
+ } else if (addedOrRemovedNode[PropertySymbol.nodeType] !== NodeTypeEnum.commentNode) {
1836
+ const slot = shadowRoot.querySelector('slot:not([name])');
1837
+ if (slot) {
1838
+ slot.dispatchEvent(new Event('slotchange', { bubbles: true }));
1839
+ }
1840
+ }
1841
+ }
1842
+ }