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,1608 @@
1
+ import type DOMPoint from '../DOMPoint.js';
2
+ import type IDOMPointInit from '../IDOMPointInit.js';
3
+ import * as PropertySymbol from '../../PropertySymbol.js';
4
+ import type { TDOMMatrixInit } from './TDOMMatrixInit.js';
5
+ import type { TDOMMatrix2DArray } from './TDOMMatrix2DArray.js';
6
+ import type { TDOMMatrix3DArray } from './TDOMMatrix3DArray.js';
7
+ import type IDOMMatrixJSON from './IDOMMatrixJSON.js';
8
+ import type IDOMMatrixCompatibleObject from './IDOMMatrixCompatibleObject.js';
9
+ import type BrowserWindow from '../../window/BrowserWindow.js';
10
+
11
+ const DEFAULT_MATRIX_JSON: IDOMMatrixJSON = {
12
+ a: 1,
13
+ b: 0,
14
+ c: 0,
15
+ d: 1,
16
+ e: 0,
17
+ f: 0,
18
+ m11: 1,
19
+ m12: 0,
20
+ m13: 0,
21
+ m14: 0,
22
+ m21: 0,
23
+ m22: 1,
24
+ m23: 0,
25
+ m24: 0,
26
+ m31: 0,
27
+ m32: 0,
28
+ m33: 1,
29
+ m34: 0,
30
+ m41: 0,
31
+ m42: 0,
32
+ m43: 0,
33
+ m44: 1,
34
+ is2D: true,
35
+ isIdentity: true
36
+ };
37
+
38
+ const TRANSFORM_REGEXP = /([a-zA-Z0-9]+)\(([^)]+)\)/gm;
39
+ const TRANSFORM_PARAMETER_SPLIT_REGEXP = /[\s,]+/;
40
+
41
+ /**
42
+ * DOM Matrix.
43
+ *
44
+ * Based on:
45
+ * - https://github.com/trusktr/geometry-interfaces
46
+ * - https://github.com/thednp/dommatrix/tree/master
47
+ * - https://github.com/jarek-foksa/geometry-polyfill/blob/master/geometry-polyfill.js
48
+ * - https://github.com/Automattic/node-canvas/blob/master/lib/DOMMatrix.js
49
+ *
50
+ *
51
+ * 3D Matrix:
52
+ * _________________________
53
+ * | m11 | m21 | m31 | m41 |
54
+ * | m12 | m22 | m32 | m42 |
55
+ * | m13 | m23 | m33 | m43 |
56
+ * | m14 | m24 | m34 | m44 |
57
+ * -------------------------̣
58
+ *
59
+ * 2D Matrix:
60
+ * _________________________
61
+ * | m11 | m21 | 0 | m41 |
62
+ * | m12 | m22 | 0 | m42 |
63
+ * | 0 | 0 | 1 | 0 |
64
+ * | 0 | 0 | 0 | 1 |
65
+ * -------------------------
66
+ *
67
+ *
68
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrixReadOnly
69
+ */
70
+ export default class DOMMatrixReadOnly {
71
+ // Injected by WindowContextClassExtender
72
+ protected declare [PropertySymbol.window]: BrowserWindow;
73
+
74
+ public [PropertySymbol.m11]: number = 1;
75
+ public [PropertySymbol.m12]: number = 0;
76
+ public [PropertySymbol.m13]: number = 0;
77
+ public [PropertySymbol.m14]: number = 0;
78
+ public [PropertySymbol.m21]: number = 0;
79
+ public [PropertySymbol.m22]: number = 1;
80
+ public [PropertySymbol.m23]: number = 0;
81
+ public [PropertySymbol.m24]: number = 0;
82
+ public [PropertySymbol.m31]: number = 0;
83
+ public [PropertySymbol.m32]: number = 0;
84
+ public [PropertySymbol.m33]: number = 1;
85
+ public [PropertySymbol.m34]: number = 0;
86
+ public [PropertySymbol.m41]: number = 0;
87
+ public [PropertySymbol.m42]: number = 0;
88
+ public [PropertySymbol.m43]: number = 0;
89
+ public [PropertySymbol.m44]: number = 1;
90
+
91
+ /**
92
+ * Constructor.
93
+ *
94
+ * @param init Init parameter.
95
+ */
96
+ constructor(init?: TDOMMatrixInit) {
97
+ if (init) {
98
+ this[PropertySymbol.setMatrixValue](init);
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Returns the `a` value of the matrix.
104
+ */
105
+ public get a(): number {
106
+ return this[PropertySymbol.m11];
107
+ }
108
+
109
+ /**
110
+ * Returns the `b` value of the matrix.
111
+ */
112
+ public get b(): number {
113
+ return this[PropertySymbol.m12];
114
+ }
115
+
116
+ /**
117
+ * Returns the `c` value of the matrix.
118
+ */
119
+ public get c(): number {
120
+ return this[PropertySymbol.m21];
121
+ }
122
+
123
+ /**
124
+ * Returns the `d` value of the matrix.
125
+ */
126
+ public get d(): number {
127
+ return this[PropertySymbol.m22];
128
+ }
129
+
130
+ /**
131
+ * Returns the `e` value of the matrix.
132
+ */
133
+ public get e(): number {
134
+ return this[PropertySymbol.m41];
135
+ }
136
+
137
+ /**
138
+ * Returns the `f` value of the matrix.
139
+ */
140
+ public get f(): number {
141
+ return this[PropertySymbol.m42];
142
+ }
143
+
144
+ /**
145
+ * Returns the `m11` value of the matrix.
146
+ */
147
+ public get m11(): number {
148
+ return this[PropertySymbol.m11];
149
+ }
150
+
151
+ /**
152
+ * Returns the `m12` value of the matrix.
153
+ */
154
+ public get m12(): number {
155
+ return this[PropertySymbol.m12];
156
+ }
157
+
158
+ /**
159
+ * Returns the `m13` value of the matrix.
160
+ */
161
+ public get m13(): number {
162
+ return this[PropertySymbol.m13];
163
+ }
164
+
165
+ /**
166
+ * Returns the `m14` value of the matrix.
167
+ */
168
+ public get m14(): number {
169
+ return this[PropertySymbol.m14];
170
+ }
171
+
172
+ /**
173
+ * Returns the `m21` value of the matrix.
174
+ */
175
+ public get m21(): number {
176
+ return this[PropertySymbol.m21];
177
+ }
178
+
179
+ /**
180
+ * Returns the `m22` value of the matrix.
181
+ */
182
+ public get m22(): number {
183
+ return this[PropertySymbol.m22];
184
+ }
185
+
186
+ /**
187
+ * Returns the `m23` value of the matrix.
188
+ */
189
+ public get m23(): number {
190
+ return this[PropertySymbol.m23];
191
+ }
192
+
193
+ /**
194
+ * Returns the `m24` value of the matrix.
195
+ */
196
+ public get m24(): number {
197
+ return this[PropertySymbol.m24];
198
+ }
199
+
200
+ /**
201
+ * Returns the `m31` value of the matrix.
202
+ */
203
+ public get m31(): number {
204
+ return this[PropertySymbol.m31];
205
+ }
206
+
207
+ /**
208
+ * Returns the `m32` value of the matrix.
209
+ */
210
+ public get m32(): number {
211
+ return this[PropertySymbol.m32];
212
+ }
213
+
214
+ /**
215
+ * Returns the `m33` value of the matrix.
216
+ */
217
+ public get m33(): number {
218
+ return this[PropertySymbol.m33];
219
+ }
220
+
221
+ /**
222
+ * Returns the `m34` value of the matrix.
223
+ */
224
+ public get m34(): number {
225
+ return this[PropertySymbol.m34];
226
+ }
227
+
228
+ /**
229
+ * Returns the `m41` value of the matrix.
230
+ */
231
+ public get m41(): number {
232
+ return this[PropertySymbol.m41];
233
+ }
234
+
235
+ /**
236
+ * Returns the `m42` value of the matrix.
237
+ */
238
+ public get m42(): number {
239
+ return this[PropertySymbol.m42];
240
+ }
241
+
242
+ /**
243
+ * Returns the `m43` value of the matrix.
244
+ */
245
+ public get m43(): number {
246
+ return this[PropertySymbol.m43];
247
+ }
248
+
249
+ /**
250
+ * Returns the `m44` value of the matrix.
251
+ */
252
+ public get m44(): number {
253
+ return this[PropertySymbol.m44];
254
+ }
255
+
256
+ /**
257
+ * A `Boolean` whose value is `true` if the matrix is the identity matrix.
258
+ *
259
+ * The identity matrix is one in which every value is 0 except those on the main diagonal from top-left to bottom-right corner (in other words, where the offsets in each direction are equal).
260
+ *
261
+ * @returns "true" if the matrix is the identity matrix.
262
+ */
263
+ public get isIdentity(): boolean {
264
+ return (
265
+ this[PropertySymbol.m11] === 1 &&
266
+ this[PropertySymbol.m12] === 0 &&
267
+ this[PropertySymbol.m13] === 0 &&
268
+ this[PropertySymbol.m14] === 0 &&
269
+ this[PropertySymbol.m21] === 0 &&
270
+ this[PropertySymbol.m22] === 1 &&
271
+ this[PropertySymbol.m23] === 0 &&
272
+ this[PropertySymbol.m24] === 0 &&
273
+ this[PropertySymbol.m31] === 0 &&
274
+ this[PropertySymbol.m32] === 0 &&
275
+ this[PropertySymbol.m33] === 1 &&
276
+ this[PropertySymbol.m34] === 0 &&
277
+ this[PropertySymbol.m41] === 0 &&
278
+ this[PropertySymbol.m42] === 0 &&
279
+ this[PropertySymbol.m43] === 0 &&
280
+ this[PropertySymbol.m44] === 1
281
+ );
282
+ }
283
+
284
+ /**
285
+ * A `Boolean` flag whose value is `true` if the matrix is a 2D matrix and `false` if the matrix is 3D.
286
+ *
287
+ * @returns "true" if the matrix is a 2D matrix.
288
+ */
289
+ public get is2D(): boolean {
290
+ return (
291
+ this[PropertySymbol.m31] === 0 &&
292
+ this[PropertySymbol.m32] === 0 &&
293
+ this[PropertySymbol.m33] === 1 &&
294
+ this[PropertySymbol.m34] === 0 &&
295
+ this[PropertySymbol.m43] === 0 &&
296
+ this[PropertySymbol.m44] === 1
297
+ );
298
+ }
299
+
300
+ /**
301
+ * Returns a *Float32Array* containing elements which comprise the matrix.
302
+ *
303
+ * The method can return either the 16 elements or the 6 elements depending on the value of the `is2D` parameter.
304
+ *
305
+ * @param [is2D] Set to `true` to return a 2D matrix.
306
+ * @returns An *Array* representation of the matrix.
307
+ */
308
+ public toFloat32Array(is2D?: boolean): Float32Array {
309
+ return Float32Array.from(this[PropertySymbol.toArray](is2D));
310
+ }
311
+
312
+ /**
313
+ * Returns a *Float64Array* containing elements which comprise the matrix.
314
+ *
315
+ * The method can return either the 16 elements or the 6 elements depending on the value of the `is2D` parameter.
316
+ *
317
+ * @param [is2D] Set to `true` to return a 2D matrix.
318
+ * @returns An *Array* representation of the matrix
319
+ */
320
+ public toFloat64Array(is2D?: boolean): Float64Array {
321
+ return Float64Array.from(this[PropertySymbol.toArray](is2D));
322
+ }
323
+
324
+ /**
325
+ * Returns a string representation of the matrix in `CSS` matrix syntax, using the appropriate `CSS` matrix notation.
326
+ *
327
+ * Examples:
328
+ * - `matrix3d(m11, m12, m13, m14, m21, ...)`
329
+ * - `matrix(a, b, c, d, e, f)`
330
+ *
331
+ * @returns A string representation of the matrix.
332
+ */
333
+ public toString(): string {
334
+ const is2D = this.is2D;
335
+ const values = this[PropertySymbol.toArray](is2D).join(', ');
336
+ const type = is2D ? 'matrix' : 'matrix3d';
337
+ return `${type}(${values})`;
338
+ }
339
+
340
+ /**
341
+ * Returns an Object that can be serialized to a JSON string.
342
+ *
343
+ * The result can be used as a second parameter for the `fromMatrix` static method to load values into another matrix instance.
344
+ *
345
+ * @returns An *Object* with matrix values.
346
+ */
347
+ public toJSON(): IDOMMatrixJSON {
348
+ const { is2D, isIdentity } = this;
349
+ return {
350
+ m11: this[PropertySymbol.m11],
351
+ m12: this[PropertySymbol.m12],
352
+ m13: this[PropertySymbol.m13],
353
+ m14: this[PropertySymbol.m14],
354
+ m21: this[PropertySymbol.m21],
355
+ m22: this[PropertySymbol.m22],
356
+ m23: this[PropertySymbol.m23],
357
+ m24: this[PropertySymbol.m24],
358
+ m31: this[PropertySymbol.m31],
359
+ m32: this[PropertySymbol.m32],
360
+ m33: this[PropertySymbol.m33],
361
+ m34: this[PropertySymbol.m34],
362
+ m41: this[PropertySymbol.m41],
363
+ m42: this[PropertySymbol.m42],
364
+ m43: this[PropertySymbol.m43],
365
+ m44: this[PropertySymbol.m44],
366
+ a: this[PropertySymbol.m11],
367
+ b: this[PropertySymbol.m12],
368
+ c: this[PropertySymbol.m21],
369
+ d: this[PropertySymbol.m22],
370
+ e: this[PropertySymbol.m41],
371
+ f: this[PropertySymbol.m42],
372
+ is2D,
373
+ isIdentity
374
+ };
375
+ }
376
+
377
+ /**
378
+ * Returns a new DOMMatrix instance which is the result of this matrix multiplied by the passed matrix.
379
+ *
380
+ * @param secondMatrix DOMMatrix
381
+ * @returns A new DOMMatrix object.
382
+ */
383
+ public multiply(secondMatrix?: IDOMMatrixCompatibleObject): DOMMatrixReadOnly {
384
+ const matrix = new (<typeof DOMMatrixReadOnly>this.constructor)(this);
385
+ if (secondMatrix) {
386
+ matrix[PropertySymbol.multiplySelf](secondMatrix);
387
+ }
388
+ return matrix;
389
+ }
390
+
391
+ /**
392
+ * Returns a new DOMMatrix instance which is this matrix post multiplied by a translation matrix containing the passed values.
393
+ *
394
+ * @param [x=0] X component of the translation value.
395
+ * @param [y=0] Y component of the translation value.
396
+ * @param [z=0] Z component of the translation value.
397
+ * @returns The resulted matrix
398
+ */
399
+ public translate(x: number = 0, y: number = 0, z: number = 0): DOMMatrixReadOnly {
400
+ const matrix = new (<typeof DOMMatrixReadOnly>this.constructor)(this);
401
+ matrix[PropertySymbol.translateSelf](x, y, z);
402
+ return matrix;
403
+ }
404
+
405
+ /**
406
+ * Returns a new DOMMatrix instance which is this matrix post multiplied by a scale 2D matrix containing the passed values.
407
+ *
408
+ * @param [scaleX] X-Axis scale.
409
+ * @param [scaleY] Y-Axis scale.
410
+ * @param [scaleZ] Z-Axis scale.
411
+ * @param [originX] X-Axis scale.
412
+ * @param [originY] Y-Axis scale.
413
+ * @param [originZ] Z-Axis scale.
414
+ * @returns The resulted matrix
415
+ */
416
+ public scale(
417
+ scaleX?: number,
418
+ scaleY?: number,
419
+ scaleZ = 1,
420
+ originX = 0,
421
+ originY = 0,
422
+ originZ = 0
423
+ ): DOMMatrixReadOnly {
424
+ const matrix = new (<typeof DOMMatrixReadOnly>this.constructor)(this);
425
+ matrix[PropertySymbol.scaleSelf](scaleX, scaleY, scaleZ, originX, originY, originZ);
426
+ return matrix;
427
+ }
428
+
429
+ /**
430
+ * Returns a new DOMMatrix instance which is this matrix post multiplied by a scale 3D matrix containing the passed values.
431
+ *
432
+ * @param [scale] The scale factor.
433
+ * @param [originX] X-Axis scale.
434
+ * @param [originY] Y-Axis scale.
435
+ * @param [originZ] Z-Axis scale.
436
+ * @returns The resulted matrix
437
+ */
438
+ public scale3d(scale = 1, originX = 0, originY = 0, originZ = 0): DOMMatrixReadOnly {
439
+ const matrix = new (<typeof DOMMatrixReadOnly>this.constructor)(this);
440
+ matrix[PropertySymbol.scale3dSelf](scale, originX, originY, originZ);
441
+ return matrix;
442
+ }
443
+
444
+ /**
445
+ * Returns a new DOMMatrix instance which is this matrix post multiplied by a scale 3D matrix containing the passed values.
446
+ *
447
+ * @param [scaleX] X-Axis scale.
448
+ * @param [scaleY] Y-Axis scale.
449
+ * @returns The resulted matrix
450
+ */
451
+ public scaleNonUniform(scaleX = 1, scaleY = 1): DOMMatrixReadOnly {
452
+ const matrix = new (<typeof DOMMatrixReadOnly>this.constructor)(this);
453
+ matrix[PropertySymbol.scaleNonUniformSelf](scaleX, scaleY);
454
+ return matrix;
455
+ }
456
+
457
+ /**
458
+ * Returns a new DOMMatrix instance which is this matrix post multiplied by a rotation matrix with the given axis and `angle`.
459
+ *
460
+ * @param [x] The X component of the axis vector.
461
+ * @param [y] The Y component of the axis vector.
462
+ * @param [z] The Z component of the axis vector.
463
+ * @param [angle] Angle of rotation about the axis vector, in degrees.
464
+ * @returns The resulted matrix
465
+ */
466
+ public rotateAxisAngle(x = 0, y = 0, z = 0, angle = 0): DOMMatrixReadOnly {
467
+ const matrix = new (<typeof DOMMatrixReadOnly>this.constructor)(this);
468
+ matrix[PropertySymbol.rotateAxisAngleSelf](x, y, z, angle);
469
+ return matrix;
470
+ }
471
+
472
+ /**
473
+ * Returns a new DOMMatrix instance which is this matrix post multiplied by each of 3 rotation matrices about the major axes, first X, then Y, then Z.
474
+ *
475
+ * @param [x] X component of the rotation, or Z if Y and Z are null.
476
+ * @param [y] Y component of the rotation value.
477
+ * @param [z] Z component of the rotation value.
478
+ * @returns The resulted matrix
479
+ */
480
+ public rotate(x = 0, y?: number, z?: number): DOMMatrixReadOnly {
481
+ const matrix = new (<typeof DOMMatrixReadOnly>this.constructor)(this);
482
+ matrix[PropertySymbol.rotateSelf](x, y, z);
483
+ return matrix;
484
+ }
485
+
486
+ /**
487
+ * Returns a new DOMMatrix instance which is this matrix post multiplied by a rotation matrix with the angle between the specified vector and (1, 0).
488
+ *
489
+ * @param [x] X-Axis skew.
490
+ * @param [y] Y-Axis skew.
491
+ */
492
+ public rotateFromVector(x = 0, y = 0): DOMMatrixReadOnly {
493
+ const matrix = new (<typeof DOMMatrixReadOnly>this.constructor)(this);
494
+ matrix[PropertySymbol.rotateFromVectorSelf](x, y);
495
+ return matrix;
496
+ }
497
+
498
+ /**
499
+ * Returns a new DOMMatrix instance that specifies a skew transformation along X-Axis by the given angle.
500
+ *
501
+ * @param angle Angle amount in degrees to skew.
502
+ * @returns The resulted matrix
503
+ */
504
+ public skewX(angle: number): DOMMatrixReadOnly {
505
+ const matrix = new (<typeof DOMMatrixReadOnly>this.constructor)(this);
506
+ matrix[PropertySymbol.skewXSelf](angle);
507
+ return matrix;
508
+ }
509
+
510
+ /**
511
+ * Returns a new DOMMatrix instance that specifies a skew transformation along Y-Axis by the given angle.
512
+ *
513
+ * @param angle Angle amount in degrees to skew.
514
+ * @returns The resulted matrix
515
+ */
516
+ public skewY(angle: number): DOMMatrixReadOnly {
517
+ const matrix = new (<typeof DOMMatrixReadOnly>this.constructor)(this);
518
+ matrix[PropertySymbol.skewYSelf](angle);
519
+ return matrix;
520
+ }
521
+
522
+ /**
523
+ * Returns a new DOMMatrix instance which is this matrix flipped on X-axis.
524
+ */
525
+ public flipX(): DOMMatrixReadOnly {
526
+ const matrix = new (<typeof DOMMatrixReadOnly>this.constructor)(this);
527
+ matrix[PropertySymbol.flipXSelf]();
528
+ return matrix;
529
+ }
530
+
531
+ /**
532
+ * Returns a new DOMMatrix instance which is this matrix flipped on Y-axis.
533
+ */
534
+ public flipY(): DOMMatrixReadOnly {
535
+ const matrix = new (<typeof DOMMatrixReadOnly>this.constructor)(this);
536
+ matrix[PropertySymbol.flipYSelf]();
537
+ return matrix;
538
+ }
539
+
540
+ /**
541
+ * Returns a new DOMMatrix instance which is this matrix inversed.
542
+ */
543
+ public inverse(): DOMMatrixReadOnly {
544
+ const matrix = new (<typeof DOMMatrixReadOnly>this.constructor)(this);
545
+ matrix[PropertySymbol.invertSelf]();
546
+ return matrix;
547
+ }
548
+
549
+ /**
550
+ * Returns a new DOMPoint instance with the vector transformed using the matrix.
551
+ *
552
+ * @param domPoint DOM point compatible object.
553
+ * @returns A new DOMPoint object.
554
+ */
555
+ public transformPoint(domPoint?: IDOMPointInit): DOMPoint {
556
+ const xPoint = domPoint?.x ?? 0;
557
+ const yPoint = domPoint?.y ?? 0;
558
+ const zPoint = domPoint?.z ?? 0;
559
+ const wPoint = domPoint?.w ?? 1;
560
+
561
+ const x =
562
+ this[PropertySymbol.m11] * xPoint +
563
+ this[PropertySymbol.m21] * yPoint +
564
+ this[PropertySymbol.m31] * zPoint +
565
+ this[PropertySymbol.m41] * wPoint;
566
+ const y =
567
+ this[PropertySymbol.m12] * xPoint +
568
+ this[PropertySymbol.m22] * yPoint +
569
+ this[PropertySymbol.m32] * zPoint +
570
+ this[PropertySymbol.m42] * wPoint;
571
+ const z =
572
+ this[PropertySymbol.m13] * xPoint +
573
+ this[PropertySymbol.m23] * yPoint +
574
+ this[PropertySymbol.m33] * zPoint +
575
+ this[PropertySymbol.m43] * wPoint;
576
+ const w =
577
+ this[PropertySymbol.m14] * xPoint +
578
+ this[PropertySymbol.m24] * yPoint +
579
+ this[PropertySymbol.m34] * zPoint +
580
+ this[PropertySymbol.m44] * wPoint;
581
+
582
+ return new this[PropertySymbol.window].DOMPoint(x, y, z, w);
583
+ }
584
+
585
+ /**
586
+ * The `setMatrixValue` method replaces the existing matrix with one computed in the browser (e.g.`matrix(1,0.25,-0.25,1,0,0)`).
587
+ *
588
+ * @param source A `DOMMatrix`, `Float32Array`, `Float64Array`, `Array`, or DOMMatrix compatible object to set the matrix values from.
589
+ */
590
+ public [PropertySymbol.setMatrixValue](source?: TDOMMatrixInit): void {
591
+ let matrix: DOMMatrixReadOnly | null = null;
592
+
593
+ // String
594
+ if (typeof source === 'string' && source.length && source !== 'none') {
595
+ matrix = (<typeof DOMMatrixReadOnly>this.constructor)[PropertySymbol.fromString](source);
596
+ }
597
+ // Array
598
+ else if (
599
+ Array.isArray(source) ||
600
+ source instanceof Float64Array ||
601
+ source instanceof Float32Array
602
+ ) {
603
+ matrix = (<typeof DOMMatrixReadOnly>this.constructor)[PropertySymbol.fromArray](source);
604
+ }
605
+ // DOMMatrixReadOnly or IDOMMatrixCompatibleObject
606
+ else if (typeof source === 'object') {
607
+ matrix = (<typeof DOMMatrixReadOnly>this.constructor).fromMatrix(
608
+ <IDOMMatrixCompatibleObject>source
609
+ );
610
+ } else {
611
+ return;
612
+ }
613
+
614
+ this[PropertySymbol.m11] = matrix[PropertySymbol.m11];
615
+ this[PropertySymbol.m12] = matrix[PropertySymbol.m12];
616
+ this[PropertySymbol.m13] = matrix[PropertySymbol.m13];
617
+ this[PropertySymbol.m14] = matrix[PropertySymbol.m14];
618
+ this[PropertySymbol.m21] = matrix[PropertySymbol.m21];
619
+ this[PropertySymbol.m22] = matrix[PropertySymbol.m22];
620
+ this[PropertySymbol.m23] = matrix[PropertySymbol.m23];
621
+ this[PropertySymbol.m24] = matrix[PropertySymbol.m24];
622
+ this[PropertySymbol.m31] = matrix[PropertySymbol.m31];
623
+ this[PropertySymbol.m32] = matrix[PropertySymbol.m32];
624
+ this[PropertySymbol.m33] = matrix[PropertySymbol.m33];
625
+ this[PropertySymbol.m34] = matrix[PropertySymbol.m34];
626
+ this[PropertySymbol.m41] = matrix[PropertySymbol.m41];
627
+ this[PropertySymbol.m42] = matrix[PropertySymbol.m42];
628
+ this[PropertySymbol.m43] = matrix[PropertySymbol.m43];
629
+ this[PropertySymbol.m44] = matrix[PropertySymbol.m44];
630
+ }
631
+
632
+ /**
633
+ * Applies a multiply operation to the current matrix.
634
+ *
635
+ * @param matrixCompatibleObject Second matrix.
636
+ */
637
+ public [PropertySymbol.multiplySelf](matrixCompatibleObject?: IDOMMatrixCompatibleObject): void {
638
+ if (!matrixCompatibleObject) {
639
+ return;
640
+ }
641
+
642
+ let matrix: IDOMMatrixJSON = <IDOMMatrixJSON>matrixCompatibleObject;
643
+
644
+ if (!(matrix instanceof DOMMatrixReadOnly)) {
645
+ if (matrix?.m11 === undefined && matrix?.a !== undefined) {
646
+ matrix = Object.assign({}, DEFAULT_MATRIX_JSON, matrix);
647
+ matrix.m11 = matrix.a;
648
+ matrix.m12 = matrix.b;
649
+ matrix.m21 = matrix.c;
650
+ matrix.m22 = matrix.d;
651
+ matrix.m41 = matrix.e;
652
+ matrix.m42 = matrix.f;
653
+ } else {
654
+ matrix = Object.assign({}, DEFAULT_MATRIX_JSON, matrix);
655
+ }
656
+ }
657
+
658
+ const m11 =
659
+ this[PropertySymbol.m11] * matrix.m11 +
660
+ this[PropertySymbol.m21] * matrix.m12 +
661
+ this[PropertySymbol.m31] * matrix.m13 +
662
+ this[PropertySymbol.m41] * matrix.m14;
663
+ const m21 =
664
+ this[PropertySymbol.m11] * matrix.m21 +
665
+ this[PropertySymbol.m21] * matrix.m22 +
666
+ this[PropertySymbol.m31] * matrix.m23 +
667
+ this[PropertySymbol.m41] * matrix.m24;
668
+ const m31 =
669
+ this[PropertySymbol.m11] * matrix.m31 +
670
+ this[PropertySymbol.m21] * matrix.m32 +
671
+ this[PropertySymbol.m31] * matrix.m33 +
672
+ this[PropertySymbol.m41] * matrix.m34;
673
+ const m41 =
674
+ this[PropertySymbol.m11] * matrix.m41 +
675
+ this[PropertySymbol.m21] * matrix.m42 +
676
+ this[PropertySymbol.m31] * matrix.m43 +
677
+ this[PropertySymbol.m41] * matrix.m44;
678
+
679
+ const m12 =
680
+ this[PropertySymbol.m12] * matrix.m11 +
681
+ this[PropertySymbol.m22] * matrix.m12 +
682
+ this[PropertySymbol.m32] * matrix.m13 +
683
+ this[PropertySymbol.m42] * matrix.m14;
684
+ const m22 =
685
+ this[PropertySymbol.m12] * matrix.m21 +
686
+ this[PropertySymbol.m22] * matrix.m22 +
687
+ this[PropertySymbol.m32] * matrix.m23 +
688
+ this[PropertySymbol.m42] * matrix.m24;
689
+ const m32 =
690
+ this[PropertySymbol.m12] * matrix.m31 +
691
+ this[PropertySymbol.m22] * matrix.m32 +
692
+ this[PropertySymbol.m32] * matrix.m33 +
693
+ this[PropertySymbol.m42] * matrix.m34;
694
+ const m42 =
695
+ this[PropertySymbol.m12] * matrix.m41 +
696
+ this[PropertySymbol.m22] * matrix.m42 +
697
+ this[PropertySymbol.m32] * matrix.m43 +
698
+ this[PropertySymbol.m42] * matrix.m44;
699
+
700
+ const m13 =
701
+ this[PropertySymbol.m13] * matrix.m11 +
702
+ this[PropertySymbol.m23] * matrix.m12 +
703
+ this[PropertySymbol.m33] * matrix.m13 +
704
+ this[PropertySymbol.m43] * matrix.m14;
705
+ const m23 =
706
+ this[PropertySymbol.m13] * matrix.m21 +
707
+ this[PropertySymbol.m23] * matrix.m22 +
708
+ this[PropertySymbol.m33] * matrix.m23 +
709
+ this[PropertySymbol.m43] * matrix.m24;
710
+ const m33 =
711
+ this[PropertySymbol.m13] * matrix.m31 +
712
+ this[PropertySymbol.m23] * matrix.m32 +
713
+ this[PropertySymbol.m33] * matrix.m33 +
714
+ this[PropertySymbol.m43] * matrix.m34;
715
+ const m43 =
716
+ this[PropertySymbol.m13] * matrix.m41 +
717
+ this[PropertySymbol.m23] * matrix.m42 +
718
+ this[PropertySymbol.m33] * matrix.m43 +
719
+ this[PropertySymbol.m43] * matrix.m44;
720
+
721
+ const m14 =
722
+ this[PropertySymbol.m14] * matrix.m11 +
723
+ this[PropertySymbol.m24] * matrix.m12 +
724
+ this[PropertySymbol.m34] * matrix.m13 +
725
+ this[PropertySymbol.m44] * matrix.m14;
726
+ const m24 =
727
+ this[PropertySymbol.m14] * matrix.m21 +
728
+ this[PropertySymbol.m24] * matrix.m22 +
729
+ this[PropertySymbol.m34] * matrix.m23 +
730
+ this[PropertySymbol.m44] * matrix.m24;
731
+ const m34 =
732
+ this[PropertySymbol.m14] * matrix.m31 +
733
+ this[PropertySymbol.m24] * matrix.m32 +
734
+ this[PropertySymbol.m34] * matrix.m33 +
735
+ this[PropertySymbol.m44] * matrix.m34;
736
+ const m44 =
737
+ this[PropertySymbol.m14] * matrix.m41 +
738
+ this[PropertySymbol.m24] * matrix.m42 +
739
+ this[PropertySymbol.m34] * matrix.m43 +
740
+ this[PropertySymbol.m44] * matrix.m44;
741
+
742
+ this[PropertySymbol.m11] = m11;
743
+ this[PropertySymbol.m12] = m12;
744
+ this[PropertySymbol.m13] = m13;
745
+ this[PropertySymbol.m14] = m14;
746
+ this[PropertySymbol.m21] = m21;
747
+ this[PropertySymbol.m22] = m22;
748
+ this[PropertySymbol.m23] = m23;
749
+ this[PropertySymbol.m24] = m24;
750
+ this[PropertySymbol.m31] = m31;
751
+ this[PropertySymbol.m32] = m32;
752
+ this[PropertySymbol.m33] = m33;
753
+ this[PropertySymbol.m34] = m34;
754
+ this[PropertySymbol.m41] = m41;
755
+ this[PropertySymbol.m42] = m42;
756
+ this[PropertySymbol.m43] = m43;
757
+ this[PropertySymbol.m44] = m44;
758
+ }
759
+
760
+ /**
761
+ * Applies translate to the matrix.
762
+ *
763
+ * This method is equivalent to the CSS `translate3d()` function.
764
+ *
765
+ * @see https://drafts.csswg.org/css-transforms-1/#TranslateDefined
766
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/translate3d
767
+ * @see https://www.w3.org/TR/css-transforms-1/#transform-functions
768
+ * @param [x] X-Axis position.
769
+ * @param [y] Y-Axis position.
770
+ * @param [z] Z-Axis position.
771
+ */
772
+ public [PropertySymbol.translateSelf](x: number = 0, y: number = 0, z: number = 0): void {
773
+ // prettier-ignore
774
+ const translationMatrix = (<typeof DOMMatrixReadOnly>this.constructor)[PropertySymbol.fromArray]([
775
+ 1, 0, 0, 0,
776
+ 0, 1, 0, 0,
777
+ 0, 0, 1, 0,
778
+ x, y, z, 1,
779
+ ]);
780
+
781
+ this[PropertySymbol.multiplySelf](translationMatrix);
782
+ }
783
+
784
+ /**
785
+ * Applies a scale to the matrix.
786
+ *
787
+ * This method is equivalent to the CSS `scale()` function.
788
+ *
789
+ * @see https://drafts.csswg.org/css-transforms-1/#ScaleDefined
790
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/scale
791
+ * @see https://www.w3.org/TR/css-transforms-1/#transform-functions
792
+ * @param [scaleX] X-Axis scale.
793
+ * @param [scaleY] Y-Axis scale.
794
+ * @param [scaleZ] Z-Axis scale.
795
+ * @param [originX] X-Axis scale.
796
+ * @param [originY] Y-Axis scale.
797
+ * @param [originZ] Z-Axis scale.
798
+ */
799
+ public [PropertySymbol.scaleSelf](
800
+ scaleX?: number,
801
+ scaleY?: number,
802
+ scaleZ = 1,
803
+ originX = 0,
804
+ originY = 0,
805
+ originZ = 0
806
+ ): void {
807
+ // If scaleY is missing, set scaleY to the value of scaleX.
808
+ scaleX = scaleX === undefined ? 1 : Number(scaleX);
809
+ scaleY = scaleY === undefined ? scaleX : Number(scaleY);
810
+
811
+ if (originX !== 0 || originY !== 0 || originZ !== 0) {
812
+ this[PropertySymbol.translateSelf](originX, originY, originZ);
813
+ }
814
+
815
+ if (scaleX !== 1 || scaleY !== 1 || scaleZ !== 1) {
816
+ // prettier-ignore
817
+ this[PropertySymbol.multiplySelf]((<typeof DOMMatrixReadOnly>this.constructor)[PropertySymbol.fromArray]([
818
+ scaleX, 0, 0, 0,
819
+ 0, scaleY, 0, 0,
820
+ 0, 0, scaleZ, 0,
821
+ 0, 0, 0, 1,
822
+ ]));
823
+ }
824
+
825
+ if (originX !== 0 || originY !== 0 || originZ !== 0) {
826
+ this[PropertySymbol.translateSelf](-originX, -originY, -originZ);
827
+ }
828
+ }
829
+
830
+ /**
831
+ * Applies a scale to the matrix.
832
+ *
833
+ * This method is equivalent to the CSS `scale()` function.
834
+ *
835
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/scale3d
836
+ * @see https://www.w3.org/TR/css-transforms-1/#transform-functions
837
+ * @param [scale] The scale factor.
838
+ * @param [originX] X-Axis scale.
839
+ * @param [originY] Y-Axis scale.
840
+ * @param [originZ] Z-Axis scale.
841
+ */
842
+ public [PropertySymbol.scale3dSelf](scale = 1, originX = 0, originY = 0, originZ = 0): void {
843
+ if (originX !== 0 || originY !== 0 || originZ !== 0) {
844
+ this[PropertySymbol.translateSelf](originX, originY, originZ);
845
+ }
846
+
847
+ if (scale !== 1) {
848
+ // prettier-ignore
849
+ this[PropertySymbol.multiplySelf]((<typeof DOMMatrixReadOnly>this.constructor)[PropertySymbol.fromArray]([
850
+ scale, 0, 0, 0,
851
+ 0, scale, 0, 0,
852
+ 0, 0, scale, 0,
853
+ 0, 0, 0, 1,
854
+ ]));
855
+ }
856
+
857
+ if (originX !== 0 || originY !== 0 || originZ !== 0) {
858
+ this[PropertySymbol.translateSelf](-originX, -originY, -originZ);
859
+ }
860
+ }
861
+
862
+ /**
863
+ * Applies a scale to the matrix.
864
+ *
865
+ * @see https://www.w3.org/TR/css-transforms-1/#transform-functions
866
+ * @param [scaleX] X-Axis scale.
867
+ * @param [scaleY] Y-Axis scale.
868
+ */
869
+ public [PropertySymbol.scaleNonUniformSelf](scaleX = 1, scaleY = 1): void {
870
+ if (scaleX === 1 && scaleY === 1) {
871
+ return;
872
+ }
873
+
874
+ // prettier-ignore
875
+ this[PropertySymbol.multiplySelf]((<typeof DOMMatrixReadOnly>this.constructor)[PropertySymbol.fromArray]([
876
+ scaleX, 0, 0, 0,
877
+ 0, scaleY, 0, 0,
878
+ 0, 0, 1, 0,
879
+ 0, 0, 0, 1,
880
+ ]));
881
+ }
882
+
883
+ /**
884
+ * Applies a rotation to the matrix.
885
+ *
886
+ * This method is equivalent to the CSS `rotate3d()` function.
887
+ *
888
+ * @see https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-rotateaxisangleself
889
+ * @see https://www.w3.org/TR/css-transforms-1/#transform-functions
890
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d
891
+ * @param [x] X-Axis vector.
892
+ * @param [y] Y-Axis vector.
893
+ * @param [z] Z-Axis vector.
894
+ * @param [angle] Angle in degrees of the rotation.
895
+ */
896
+ public [PropertySymbol.rotateAxisAngleSelf](x = 0, y = 0, z = 0, angle = 0): void {
897
+ x = Number(x);
898
+ y = Number(y);
899
+ z = Number(z);
900
+ angle = Number(angle);
901
+
902
+ if (isNaN(x) || isNaN(y) || isNaN(z) || isNaN(angle)) {
903
+ throw new this[PropertySymbol.window].TypeError(
904
+ `Failed to execute 'rotateAxisAngleSelf' on 'DOMMatrix': The arguments must be numbers.`
905
+ );
906
+ }
907
+
908
+ const length = Math.hypot(x, y, z);
909
+
910
+ if (length === 0) {
911
+ return;
912
+ }
913
+
914
+ if (length !== 1) {
915
+ x /= length;
916
+ y /= length;
917
+ z /= length;
918
+ }
919
+
920
+ // Degree to radian divided by 2
921
+ const alpha = -((angle * Math.PI) / 360);
922
+ const round = this.#round;
923
+ const sc = Math.sin(alpha) * Math.cos(alpha);
924
+ const sq = Math.sin(alpha) * Math.sin(alpha);
925
+
926
+ // We round it as the calculation is off by about 0.000000000000001, which causes the matrix to be different from the browser.
927
+ // The rounding doesn't solve the issue for all cases, it would be better to find a more accurate solution.
928
+
929
+ const m11 = round(1 - 2 * (y * y + z * z) * sq);
930
+ const m12 = round(2 * (x * y * sq + z * sc));
931
+ const m13 = round(2 * (x * z * sq - y * sc));
932
+ const m21 = round(2 * (x * y * sq - z * sc));
933
+ const m22 = round(1 - 2 * (x * x + z * z) * sq);
934
+ const m23 = round(2 * (y * z * sq + x * sc));
935
+ const m31 = round(2 * (x * z * sq + y * sc));
936
+ const m32 = round(2 * (y * z * sq - x * sc));
937
+ const m33 = round(1 - 2 * (x * x + y * y) * sq);
938
+
939
+ // prettier-ignore
940
+ const matrix = (<typeof DOMMatrixReadOnly>this.constructor)[PropertySymbol.fromArray]([
941
+ m11, m21, m31, 0,
942
+ m12, m22, m32, 0,
943
+ m13, m23, m33, 0,
944
+ 0, 0, 0, 1
945
+ ]);
946
+
947
+ this[PropertySymbol.multiplySelf](matrix);
948
+ }
949
+
950
+ /**
951
+ * Applies a rotation to the matrix.
952
+ *
953
+ * @see http://en.wikipedia.org/wiki/Rotation_matrix
954
+ * @see https://www.w3.org/TR/css-transforms-1/#transform-functions
955
+ * @param [x] X-Axis rotation in degrees.
956
+ * @param [y] Y-Axis rotation in degrees.
957
+ * @param [z] Z-Axis rotation in degrees.
958
+ */
959
+ public [PropertySymbol.rotateSelf](x = 0, y?: number, z?: number): void {
960
+ // If Y and Z are both missing, set Z to the value of X and set X and Y to 0.
961
+ if (y === undefined && z === undefined) {
962
+ z = x;
963
+ x = 0;
964
+ y = 0;
965
+ }
966
+
967
+ // If Y is still missing, set Y to 0.
968
+ if (y === undefined) {
969
+ y = 0;
970
+ }
971
+
972
+ // If Z is still missing, set Z to 0
973
+ if (z === undefined) {
974
+ z = 0;
975
+ }
976
+
977
+ x = Number(x);
978
+ y = Number(y);
979
+ z = Number(z);
980
+
981
+ if (isNaN(x) || isNaN(y) || isNaN(z)) {
982
+ throw new this[PropertySymbol.window].TypeError(
983
+ `Failed to execute 'rotateSelf' on 'DOMMatrix': The arguments must be numbers.`
984
+ );
985
+ }
986
+
987
+ if (z !== 0) {
988
+ this[PropertySymbol.rotateAxisAngleSelf](0, 0, 1, z);
989
+ }
990
+ if (y !== 0) {
991
+ this[PropertySymbol.rotateAxisAngleSelf](0, 1, 0, y);
992
+ }
993
+ if (x !== 0) {
994
+ this[PropertySymbol.rotateAxisAngleSelf](1, 0, 0, x);
995
+ }
996
+ }
997
+
998
+ /**
999
+ * Modifies the matrix by rotating it by the angle between the specified vector and (1, 0).
1000
+ *
1001
+ * @param x The X component of the axis vector.
1002
+ * @param y The Y component of the axis vector.
1003
+ */
1004
+ public [PropertySymbol.rotateFromVectorSelf](x = 0, y = 0): void {
1005
+ if (x === 0 && y === 0) {
1006
+ return;
1007
+ }
1008
+ this[PropertySymbol.rotateSelf]((Math.atan2(y, x) * 180) / Math.PI);
1009
+ }
1010
+
1011
+ /**
1012
+ * Applies a skew operation to the matrix on the X axis.
1013
+ *
1014
+ * This method is equivalent to the CSS `skewX()` function.
1015
+ *
1016
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/skewX
1017
+ * @see https://www.w3.org/TR/css-transforms-1/#transform-functions
1018
+ * @param angle Angle in degrees.
1019
+ */
1020
+ public [PropertySymbol.skewXSelf](angle: number): void {
1021
+ const matrix = Object.assign({}, DEFAULT_MATRIX_JSON);
1022
+ const value = Math.tan((angle * Math.PI) / 180);
1023
+
1024
+ matrix.m21 = value;
1025
+ matrix.c = value;
1026
+
1027
+ this[PropertySymbol.multiplySelf](matrix);
1028
+ }
1029
+
1030
+ /**
1031
+ * Applies a skew operation to the matrix on the Y axis.
1032
+ *
1033
+ * This method is equivalent to the CSS `skewY()` function.
1034
+ *
1035
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/skewY
1036
+ * @see https://www.w3.org/TR/css-transforms-1/#transform-functions
1037
+ * @param angle Angle in degrees.
1038
+ */
1039
+ public [PropertySymbol.skewYSelf](angle: number): void {
1040
+ const matrix = Object.assign({}, DEFAULT_MATRIX_JSON);
1041
+ const value = Math.tan((angle * Math.PI) / 180);
1042
+
1043
+ matrix.m12 = value;
1044
+ matrix.b = value;
1045
+
1046
+ this[PropertySymbol.multiplySelf](matrix);
1047
+ }
1048
+
1049
+ /**
1050
+ * Applies a flip operation to the matrix on the X axis.
1051
+ */
1052
+ public [PropertySymbol.flipXSelf](): void {
1053
+ // prettier-ignore
1054
+ const matrix = (<typeof DOMMatrixReadOnly>this.constructor)[PropertySymbol.fromArray]([
1055
+ -1, 0, 0, 0,
1056
+ 0, 1, 0, 0,
1057
+ 0, 0, 1, 0,
1058
+ 0, 0, 0, 1
1059
+ ]);
1060
+ this[PropertySymbol.multiplySelf](matrix);
1061
+ }
1062
+
1063
+ /**
1064
+ * Applies a flip operation to the matrix on the Y axis.
1065
+ */
1066
+ public [PropertySymbol.flipYSelf](): void {
1067
+ // prettier-ignore
1068
+ const matrix = (<typeof DOMMatrixReadOnly>this.constructor)[PropertySymbol.fromArray]([
1069
+ 1, 0, 0, 0,
1070
+ 0, -1, 0, 0,
1071
+ 0, 0, 1, 0,
1072
+ 0, 0, 0, 1
1073
+ ]);
1074
+ this[PropertySymbol.multiplySelf](matrix);
1075
+ }
1076
+
1077
+ /**
1078
+ * Applies an inversion operation to the matrix.
1079
+ */
1080
+ public [PropertySymbol.invertSelf](): void {
1081
+ const m11 =
1082
+ this[PropertySymbol.m22] * this[PropertySymbol.m33] * this[PropertySymbol.m44] -
1083
+ this[PropertySymbol.m22] * this[PropertySymbol.m34] * this[PropertySymbol.m43] -
1084
+ this[PropertySymbol.m32] * this[PropertySymbol.m23] * this[PropertySymbol.m44] +
1085
+ this[PropertySymbol.m32] * this[PropertySymbol.m24] * this[PropertySymbol.m43] +
1086
+ this[PropertySymbol.m42] * this[PropertySymbol.m23] * this[PropertySymbol.m34] -
1087
+ this[PropertySymbol.m42] * this[PropertySymbol.m24] * this[PropertySymbol.m33];
1088
+
1089
+ const m12 =
1090
+ -this[PropertySymbol.m12] * this[PropertySymbol.m33] * this[PropertySymbol.m44] +
1091
+ this[PropertySymbol.m12] * this[PropertySymbol.m34] * this[PropertySymbol.m43] +
1092
+ this[PropertySymbol.m32] * this[PropertySymbol.m13] * this[PropertySymbol.m44] -
1093
+ this[PropertySymbol.m32] * this[PropertySymbol.m14] * this[PropertySymbol.m43] -
1094
+ this[PropertySymbol.m42] * this[PropertySymbol.m13] * this[PropertySymbol.m34] +
1095
+ this[PropertySymbol.m42] * this[PropertySymbol.m14] * this[PropertySymbol.m33];
1096
+
1097
+ const m13 =
1098
+ this[PropertySymbol.m12] * this[PropertySymbol.m23] * this[PropertySymbol.m44] -
1099
+ this[PropertySymbol.m12] * this[PropertySymbol.m24] * this[PropertySymbol.m43] -
1100
+ this[PropertySymbol.m22] * this[PropertySymbol.m13] * this[PropertySymbol.m44] +
1101
+ this[PropertySymbol.m22] * this[PropertySymbol.m14] * this[PropertySymbol.m43] +
1102
+ this[PropertySymbol.m42] * this[PropertySymbol.m13] * this[PropertySymbol.m24] -
1103
+ this[PropertySymbol.m42] * this[PropertySymbol.m14] * this[PropertySymbol.m23];
1104
+
1105
+ const m14 =
1106
+ -this[PropertySymbol.m12] * this[PropertySymbol.m23] * this[PropertySymbol.m34] +
1107
+ this[PropertySymbol.m12] * this[PropertySymbol.m24] * this[PropertySymbol.m33] +
1108
+ this[PropertySymbol.m22] * this[PropertySymbol.m13] * this[PropertySymbol.m34] -
1109
+ this[PropertySymbol.m22] * this[PropertySymbol.m14] * this[PropertySymbol.m33] -
1110
+ this[PropertySymbol.m32] * this[PropertySymbol.m13] * this[PropertySymbol.m24] +
1111
+ this[PropertySymbol.m32] * this[PropertySymbol.m14] * this[PropertySymbol.m23];
1112
+
1113
+ const det =
1114
+ this[PropertySymbol.m11] * m11 +
1115
+ this[PropertySymbol.m21] * m12 +
1116
+ this[PropertySymbol.m31] * m13 +
1117
+ this[PropertySymbol.m41] * m14;
1118
+
1119
+ // If the current matrix is not invertible set all attributes to NaN and set is 2D to false.
1120
+ if (det === 0) {
1121
+ this[PropertySymbol.m11] = NaN;
1122
+ this[PropertySymbol.m12] = NaN;
1123
+ this[PropertySymbol.m13] = NaN;
1124
+ this[PropertySymbol.m14] = NaN;
1125
+ this[PropertySymbol.m21] = NaN;
1126
+ this[PropertySymbol.m22] = NaN;
1127
+ this[PropertySymbol.m23] = NaN;
1128
+ this[PropertySymbol.m24] = NaN;
1129
+ this[PropertySymbol.m31] = NaN;
1130
+ this[PropertySymbol.m32] = NaN;
1131
+ this[PropertySymbol.m33] = NaN;
1132
+ this[PropertySymbol.m34] = NaN;
1133
+ this[PropertySymbol.m41] = NaN;
1134
+ this[PropertySymbol.m42] = NaN;
1135
+ this[PropertySymbol.m43] = NaN;
1136
+ this[PropertySymbol.m44] = NaN;
1137
+ return;
1138
+ }
1139
+
1140
+ const m21 =
1141
+ -this[PropertySymbol.m21] * this[PropertySymbol.m33] * this[PropertySymbol.m44] +
1142
+ this[PropertySymbol.m21] * this[PropertySymbol.m34] * this[PropertySymbol.m43] +
1143
+ this[PropertySymbol.m31] * this[PropertySymbol.m23] * this[PropertySymbol.m44] -
1144
+ this[PropertySymbol.m31] * this[PropertySymbol.m24] * this[PropertySymbol.m43] -
1145
+ this[PropertySymbol.m41] * this[PropertySymbol.m23] * this[PropertySymbol.m34] +
1146
+ this[PropertySymbol.m41] * this[PropertySymbol.m24] * this[PropertySymbol.m33];
1147
+
1148
+ const m22 =
1149
+ this[PropertySymbol.m11] * this[PropertySymbol.m33] * this[PropertySymbol.m44] -
1150
+ this[PropertySymbol.m11] * this[PropertySymbol.m34] * this[PropertySymbol.m43] -
1151
+ this[PropertySymbol.m31] * this[PropertySymbol.m13] * this[PropertySymbol.m44] +
1152
+ this[PropertySymbol.m31] * this[PropertySymbol.m14] * this[PropertySymbol.m43] +
1153
+ this[PropertySymbol.m41] * this[PropertySymbol.m13] * this[PropertySymbol.m34] -
1154
+ this[PropertySymbol.m41] * this[PropertySymbol.m14] * this[PropertySymbol.m33];
1155
+
1156
+ const m23 =
1157
+ -this[PropertySymbol.m11] * this[PropertySymbol.m23] * this[PropertySymbol.m44] +
1158
+ this[PropertySymbol.m11] * this[PropertySymbol.m24] * this[PropertySymbol.m43] +
1159
+ this[PropertySymbol.m21] * this[PropertySymbol.m13] * this[PropertySymbol.m44] -
1160
+ this[PropertySymbol.m21] * this[PropertySymbol.m14] * this[PropertySymbol.m43] -
1161
+ this[PropertySymbol.m41] * this[PropertySymbol.m13] * this[PropertySymbol.m24] +
1162
+ this[PropertySymbol.m41] * this[PropertySymbol.m14] * this[PropertySymbol.m23];
1163
+
1164
+ const m24 =
1165
+ this[PropertySymbol.m11] * this[PropertySymbol.m23] * this[PropertySymbol.m34] -
1166
+ this[PropertySymbol.m11] * this[PropertySymbol.m24] * this[PropertySymbol.m33] -
1167
+ this[PropertySymbol.m21] * this[PropertySymbol.m13] * this[PropertySymbol.m34] +
1168
+ this[PropertySymbol.m21] * this[PropertySymbol.m14] * this[PropertySymbol.m33] +
1169
+ this[PropertySymbol.m31] * this[PropertySymbol.m13] * this[PropertySymbol.m24] -
1170
+ this[PropertySymbol.m31] * this[PropertySymbol.m14] * this[PropertySymbol.m23];
1171
+
1172
+ const m31 =
1173
+ this[PropertySymbol.m21] * this[PropertySymbol.m32] * this[PropertySymbol.m44] -
1174
+ this[PropertySymbol.m21] * this[PropertySymbol.m34] * this[PropertySymbol.m42] -
1175
+ this[PropertySymbol.m31] * this[PropertySymbol.m22] * this[PropertySymbol.m44] +
1176
+ this[PropertySymbol.m31] * this[PropertySymbol.m24] * this[PropertySymbol.m42] +
1177
+ this[PropertySymbol.m41] * this[PropertySymbol.m22] * this[PropertySymbol.m34] -
1178
+ this[PropertySymbol.m41] * this[PropertySymbol.m24] * this[PropertySymbol.m32];
1179
+
1180
+ const m32 =
1181
+ -this[PropertySymbol.m11] * this[PropertySymbol.m32] * this[PropertySymbol.m44] +
1182
+ this[PropertySymbol.m11] * this[PropertySymbol.m34] * this[PropertySymbol.m42] +
1183
+ this[PropertySymbol.m31] * this[PropertySymbol.m12] * this[PropertySymbol.m44] -
1184
+ this[PropertySymbol.m31] * this[PropertySymbol.m14] * this[PropertySymbol.m42] -
1185
+ this[PropertySymbol.m41] * this[PropertySymbol.m12] * this[PropertySymbol.m34] +
1186
+ this[PropertySymbol.m41] * this[PropertySymbol.m14] * this[PropertySymbol.m32];
1187
+
1188
+ const m33 =
1189
+ this[PropertySymbol.m11] * this[PropertySymbol.m22] * this[PropertySymbol.m44] -
1190
+ this[PropertySymbol.m11] * this[PropertySymbol.m24] * this[PropertySymbol.m42] -
1191
+ this[PropertySymbol.m21] * this[PropertySymbol.m12] * this[PropertySymbol.m44] +
1192
+ this[PropertySymbol.m21] * this[PropertySymbol.m14] * this[PropertySymbol.m42] +
1193
+ this[PropertySymbol.m41] * this[PropertySymbol.m12] * this[PropertySymbol.m24] -
1194
+ this[PropertySymbol.m41] * this[PropertySymbol.m14] * this[PropertySymbol.m22];
1195
+
1196
+ const m34 =
1197
+ -this[PropertySymbol.m11] * this[PropertySymbol.m22] * this[PropertySymbol.m34] +
1198
+ this[PropertySymbol.m11] * this[PropertySymbol.m24] * this[PropertySymbol.m32] +
1199
+ this[PropertySymbol.m21] * this[PropertySymbol.m12] * this[PropertySymbol.m34] -
1200
+ this[PropertySymbol.m21] * this[PropertySymbol.m14] * this[PropertySymbol.m32] -
1201
+ this[PropertySymbol.m31] * this[PropertySymbol.m12] * this[PropertySymbol.m24] +
1202
+ this[PropertySymbol.m31] * this[PropertySymbol.m14] * this[PropertySymbol.m22];
1203
+
1204
+ const m41 =
1205
+ -this[PropertySymbol.m21] * this[PropertySymbol.m32] * this[PropertySymbol.m43] +
1206
+ this[PropertySymbol.m21] * this[PropertySymbol.m33] * this[PropertySymbol.m42] +
1207
+ this[PropertySymbol.m31] * this[PropertySymbol.m22] * this[PropertySymbol.m43] -
1208
+ this[PropertySymbol.m31] * this[PropertySymbol.m23] * this[PropertySymbol.m42] -
1209
+ this[PropertySymbol.m41] * this[PropertySymbol.m22] * this[PropertySymbol.m33] +
1210
+ this[PropertySymbol.m41] * this[PropertySymbol.m23] * this[PropertySymbol.m32];
1211
+
1212
+ const m42 =
1213
+ this[PropertySymbol.m11] * this[PropertySymbol.m32] * this[PropertySymbol.m43] -
1214
+ this[PropertySymbol.m11] * this[PropertySymbol.m33] * this[PropertySymbol.m42] -
1215
+ this[PropertySymbol.m31] * this[PropertySymbol.m12] * this[PropertySymbol.m43] +
1216
+ this[PropertySymbol.m31] * this[PropertySymbol.m13] * this[PropertySymbol.m42] +
1217
+ this[PropertySymbol.m41] * this[PropertySymbol.m12] * this[PropertySymbol.m33] -
1218
+ this[PropertySymbol.m41] * this[PropertySymbol.m13] * this[PropertySymbol.m32];
1219
+
1220
+ const m43 =
1221
+ -this[PropertySymbol.m11] * this[PropertySymbol.m22] * this[PropertySymbol.m43] +
1222
+ this[PropertySymbol.m11] * this[PropertySymbol.m23] * this[PropertySymbol.m42] +
1223
+ this[PropertySymbol.m21] * this[PropertySymbol.m12] * this[PropertySymbol.m43] -
1224
+ this[PropertySymbol.m21] * this[PropertySymbol.m13] * this[PropertySymbol.m42] -
1225
+ this[PropertySymbol.m41] * this[PropertySymbol.m12] * this[PropertySymbol.m23] +
1226
+ this[PropertySymbol.m41] * this[PropertySymbol.m13] * this[PropertySymbol.m22];
1227
+
1228
+ const m44 =
1229
+ this[PropertySymbol.m11] * this[PropertySymbol.m22] * this[PropertySymbol.m33] -
1230
+ this[PropertySymbol.m11] * this[PropertySymbol.m23] * this[PropertySymbol.m32] -
1231
+ this[PropertySymbol.m21] * this[PropertySymbol.m12] * this[PropertySymbol.m33] +
1232
+ this[PropertySymbol.m21] * this[PropertySymbol.m13] * this[PropertySymbol.m32] +
1233
+ this[PropertySymbol.m31] * this[PropertySymbol.m12] * this[PropertySymbol.m23] -
1234
+ this[PropertySymbol.m31] * this[PropertySymbol.m13] * this[PropertySymbol.m22];
1235
+
1236
+ this[PropertySymbol.m11] = m11 / det || 0;
1237
+ this[PropertySymbol.m12] = m12 / det || 0;
1238
+ this[PropertySymbol.m13] = m13 / det || 0;
1239
+ this[PropertySymbol.m14] = m14 / det || 0;
1240
+ this[PropertySymbol.m21] = m21 / det || 0;
1241
+ this[PropertySymbol.m22] = m22 / det || 0;
1242
+ this[PropertySymbol.m23] = m23 / det || 0;
1243
+ this[PropertySymbol.m24] = m24 / det || 0;
1244
+ this[PropertySymbol.m31] = m31 / det || 0;
1245
+ this[PropertySymbol.m32] = m32 / det || 0;
1246
+ this[PropertySymbol.m33] = m33 / det || 0;
1247
+ this[PropertySymbol.m34] = m34 / det || 0;
1248
+ this[PropertySymbol.m41] = m41 / det || 0;
1249
+ this[PropertySymbol.m42] = m42 / det || 0;
1250
+ this[PropertySymbol.m43] = m43 / det || 0;
1251
+ this[PropertySymbol.m44] = m44 / det || 0;
1252
+ }
1253
+
1254
+ /**
1255
+ * Returns an *Array* containing elements which comprise the matrix.
1256
+ *
1257
+ * @param matrix Matrix to convert.
1258
+ * @param [is2D] If the matrix is 2D.
1259
+ * @returns Array representation of the matrix.
1260
+ */
1261
+ public [PropertySymbol.toArray](is2D: boolean = false): TDOMMatrix2DArray | TDOMMatrix3DArray {
1262
+ if (is2D) {
1263
+ return [
1264
+ this[PropertySymbol.m11],
1265
+ this[PropertySymbol.m12],
1266
+ this[PropertySymbol.m21],
1267
+ this[PropertySymbol.m22],
1268
+ this[PropertySymbol.m41],
1269
+ this[PropertySymbol.m42]
1270
+ ];
1271
+ }
1272
+
1273
+ return [
1274
+ this[PropertySymbol.m11],
1275
+ this[PropertySymbol.m12],
1276
+ this[PropertySymbol.m13],
1277
+ this[PropertySymbol.m14],
1278
+ this[PropertySymbol.m21],
1279
+ this[PropertySymbol.m22],
1280
+ this[PropertySymbol.m23],
1281
+ this[PropertySymbol.m24],
1282
+ this[PropertySymbol.m31],
1283
+ this[PropertySymbol.m32],
1284
+ this[PropertySymbol.m33],
1285
+ this[PropertySymbol.m34],
1286
+ this[PropertySymbol.m41],
1287
+ this[PropertySymbol.m42],
1288
+ this[PropertySymbol.m43],
1289
+ this[PropertySymbol.m44]
1290
+ ];
1291
+ }
1292
+
1293
+ /**
1294
+ * Rounds the value to the given number of decimals.
1295
+ *
1296
+ * @param value The value to round.
1297
+ * @param [decimals] The number of decimals to round to.
1298
+ */
1299
+ #round(value: number, decimals: number = 1e15): number {
1300
+ return Math.round(value * decimals) / decimals;
1301
+ }
1302
+
1303
+ /**
1304
+ * Returns a new `DOMMatrix` instance given an existing matrix.
1305
+ *
1306
+ * @param matrix Matrix.
1307
+ */
1308
+ public static fromMatrix(matrix: IDOMMatrixCompatibleObject): DOMMatrixReadOnly {
1309
+ if (!(matrix instanceof DOMMatrixReadOnly)) {
1310
+ if (matrix?.m11 === undefined && matrix?.a !== undefined) {
1311
+ matrix = Object.assign({}, DEFAULT_MATRIX_JSON, matrix);
1312
+ matrix.m11 = matrix.a;
1313
+ matrix.m12 = matrix.b;
1314
+ matrix.m21 = matrix.c;
1315
+ matrix.m22 = matrix.d;
1316
+ matrix.m41 = matrix.e;
1317
+ matrix.m42 = matrix.f;
1318
+ } else {
1319
+ matrix = Object.assign({}, DEFAULT_MATRIX_JSON, matrix);
1320
+ }
1321
+ }
1322
+
1323
+ return this[PropertySymbol.fromArray]([
1324
+ matrix.m11,
1325
+ matrix.m12,
1326
+ matrix.m13,
1327
+ matrix.m14,
1328
+ matrix.m21,
1329
+ matrix.m22,
1330
+ matrix.m23,
1331
+ matrix.m24,
1332
+ matrix.m31,
1333
+ matrix.m32,
1334
+ matrix.m33,
1335
+ matrix.m34,
1336
+ matrix.m41,
1337
+ matrix.m42,
1338
+ matrix.m43,
1339
+ matrix.m44
1340
+ ]);
1341
+ }
1342
+
1343
+ /**
1344
+ * Returns a new `DOMMatrix` instance given an array of 16/6 floating point values.
1345
+ *
1346
+ * @param array An `Array` to feed values from.
1347
+ * @returns DOMMatrix instance.
1348
+ */
1349
+ public static fromFloat32Array(array: Float32Array): DOMMatrixReadOnly {
1350
+ return this[PropertySymbol.fromArray](array);
1351
+ }
1352
+
1353
+ /**
1354
+ * Returns a new `DOMMatrix` instance given an array of 16/6 floating point values.
1355
+ *
1356
+ * @param array An `Array` to feed values from.
1357
+ * @returns DOMMatrix instance.
1358
+ */
1359
+ public static fromFloat64Array(array: Float64Array): DOMMatrixReadOnly {
1360
+ return this[PropertySymbol.fromArray](array);
1361
+ }
1362
+
1363
+ /**
1364
+ * Returns a new `DOMMatrix` instance given an array of 16/6 floating point values.
1365
+ *
1366
+ * Conditions:
1367
+ * - If the array has six values, the result is a 2D matrix.
1368
+ * - If the array has 16 values, the result is a 3D matrix.
1369
+ * - Otherwise, a TypeError exception is thrown.
1370
+ *
1371
+ * @param array An `Array` to feed values from.
1372
+ * @returns DOMMatrix instance.
1373
+ */
1374
+ public static [PropertySymbol.fromArray](
1375
+ array: any[] | Float32Array | Float64Array
1376
+ ): DOMMatrixReadOnly {
1377
+ if (
1378
+ !(array instanceof Float64Array || array instanceof Float32Array || Array.isArray(array)) ||
1379
+ (array.length !== 6 && array.length !== 16)
1380
+ ) {
1381
+ throw TypeError(
1382
+ `Failed to execute 'fromArray' on '${this.name}': '${String(
1383
+ array
1384
+ )}' is not a compatible array.`
1385
+ );
1386
+ }
1387
+
1388
+ const matrix = new (<typeof DOMMatrixReadOnly>this)();
1389
+
1390
+ if (array.length === 16) {
1391
+ const [m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44] =
1392
+ array;
1393
+
1394
+ matrix[PropertySymbol.m11] = m11;
1395
+ matrix[PropertySymbol.m12] = m12;
1396
+ matrix[PropertySymbol.m13] = m13;
1397
+ matrix[PropertySymbol.m14] = m14;
1398
+ matrix[PropertySymbol.m21] = m21;
1399
+ matrix[PropertySymbol.m22] = m22;
1400
+ matrix[PropertySymbol.m23] = m23;
1401
+ matrix[PropertySymbol.m24] = m24;
1402
+ matrix[PropertySymbol.m31] = m31;
1403
+ matrix[PropertySymbol.m32] = m32;
1404
+ matrix[PropertySymbol.m33] = m33;
1405
+ matrix[PropertySymbol.m34] = m34;
1406
+ matrix[PropertySymbol.m41] = m41;
1407
+ matrix[PropertySymbol.m42] = m42;
1408
+ matrix[PropertySymbol.m43] = m43;
1409
+ matrix[PropertySymbol.m44] = m44;
1410
+ } else if (array.length === 6) {
1411
+ const [m11, m12, m21, m22, m41, m42] = array;
1412
+
1413
+ matrix[PropertySymbol.m11] = m11;
1414
+ matrix[PropertySymbol.m12] = m12;
1415
+ matrix[PropertySymbol.m21] = m21;
1416
+ matrix[PropertySymbol.m22] = m22;
1417
+ matrix[PropertySymbol.m41] = m41;
1418
+ matrix[PropertySymbol.m42] = m42;
1419
+ }
1420
+
1421
+ return matrix;
1422
+ }
1423
+
1424
+ /**
1425
+ * Returns a new `DOMMatrix` instance from a DOM transform string.
1426
+ *
1427
+ * @param source valid CSS transform string syntax.
1428
+ * @returns DOMMatrix instance.
1429
+ */
1430
+ public static [PropertySymbol.fromString](source: string): DOMMatrixReadOnly {
1431
+ if (typeof source !== 'string') {
1432
+ throw TypeError(
1433
+ `Failed to execute 'setMatrixValue' on '${this.name}': Expected '${String(
1434
+ source
1435
+ )}' to be a string.`
1436
+ );
1437
+ }
1438
+
1439
+ const domMatrix = new (<typeof DOMMatrixReadOnly>this)();
1440
+ const regexp = new RegExp(TRANSFORM_REGEXP);
1441
+
1442
+ let match: RegExpMatchArray | null;
1443
+
1444
+ while ((match = regexp.exec(source))) {
1445
+ const name = match[1];
1446
+ const parameters: number[] = <number[]>(
1447
+ (<unknown>match[2].split(TRANSFORM_PARAMETER_SPLIT_REGEXP))
1448
+ );
1449
+
1450
+ for (let i = 0, max = parameters.length; i < max; i++) {
1451
+ parameters[i] = this[PropertySymbol.getLength](<string>(<unknown>parameters[i]));
1452
+ }
1453
+
1454
+ const [x, y, z, a] = parameters;
1455
+
1456
+ switch (name) {
1457
+ case 'perspective':
1458
+ if (!isNaN(x) && x !== 0 && y === undefined && z === undefined) {
1459
+ domMatrix[PropertySymbol.m34] = -1 / x;
1460
+ }
1461
+ break;
1462
+ case 'translate':
1463
+ if (!isNaN(x) && z === undefined) {
1464
+ domMatrix[PropertySymbol.translateSelf](x, y || 0, 0);
1465
+ }
1466
+ break;
1467
+ case 'translate3d':
1468
+ if (!isNaN(x) && !isNaN(y) && !isNaN(z)) {
1469
+ domMatrix[PropertySymbol.translateSelf](x, y, z);
1470
+ }
1471
+ break;
1472
+ case 'translateX':
1473
+ if (!isNaN(x) && y === undefined && z === undefined) {
1474
+ domMatrix[PropertySymbol.translateSelf](x);
1475
+ }
1476
+ break;
1477
+ case 'translateY':
1478
+ if (!isNaN(x) && y === undefined && z === undefined) {
1479
+ domMatrix[PropertySymbol.translateSelf](0, x);
1480
+ }
1481
+ break;
1482
+ case 'translateZ':
1483
+ if (!isNaN(x) && y === undefined && z === undefined) {
1484
+ domMatrix[PropertySymbol.translateSelf](0, 0, x);
1485
+ }
1486
+ break;
1487
+ case 'matrix':
1488
+ case 'matrix3d':
1489
+ if (parameters.length === 6 || parameters.length === 16) {
1490
+ domMatrix[PropertySymbol.setMatrixValue](this[PropertySymbol.fromArray](parameters));
1491
+ }
1492
+ break;
1493
+ case 'rotate':
1494
+ case 'rotateZ':
1495
+ if (!isNaN(x) && y === undefined && z === undefined) {
1496
+ domMatrix[PropertySymbol.rotateSelf](0, 0, x);
1497
+ }
1498
+ break;
1499
+ case 'rotateX':
1500
+ if (!isNaN(x) && y === undefined && z === undefined) {
1501
+ domMatrix[PropertySymbol.rotateSelf](x, 0, 0);
1502
+ }
1503
+ break;
1504
+ case 'rotateY':
1505
+ if (!isNaN(x) && y === undefined && z === undefined) {
1506
+ domMatrix[PropertySymbol.rotateSelf](0, x, 0);
1507
+ }
1508
+ case 'rotate3d':
1509
+ if (!isNaN(x) && !isNaN(y) && !isNaN(z) && !isNaN(a)) {
1510
+ domMatrix[PropertySymbol.rotateAxisAngleSelf](x, y, z, a);
1511
+ }
1512
+ break;
1513
+ case 'scale':
1514
+ if (!isNaN(x) && x !== 1 && z === undefined) {
1515
+ domMatrix[PropertySymbol.scaleSelf](x, isNaN(y) ? x : y);
1516
+ }
1517
+ break;
1518
+ case 'scale3d':
1519
+ if (!isNaN(x) && !isNaN(y) && !isNaN(z)) {
1520
+ domMatrix[PropertySymbol.scaleSelf](x, y, z);
1521
+ }
1522
+ break;
1523
+ case 'scaleX':
1524
+ if (!isNaN(x) && y === undefined && z === undefined) {
1525
+ domMatrix[PropertySymbol.scaleSelf](x, 1, 1);
1526
+ }
1527
+ break;
1528
+ case 'scaleY':
1529
+ if (!isNaN(x) && y === undefined && z === undefined) {
1530
+ domMatrix[PropertySymbol.scaleSelf](1, x, 1);
1531
+ }
1532
+ break;
1533
+ case 'scaleZ':
1534
+ if (!isNaN(x) && y === undefined && z === undefined) {
1535
+ domMatrix[PropertySymbol.scaleSelf](1, 1, x);
1536
+ }
1537
+ break;
1538
+ case 'skew':
1539
+ if (!isNaN(x)) {
1540
+ domMatrix[PropertySymbol.skewXSelf](x);
1541
+ }
1542
+ if (!isNaN(y)) {
1543
+ domMatrix[PropertySymbol.skewYSelf](y);
1544
+ }
1545
+ break;
1546
+ case 'skewX':
1547
+ if (!isNaN(x) && y === undefined) {
1548
+ domMatrix[PropertySymbol.skewXSelf](x);
1549
+ }
1550
+ break;
1551
+ case 'skewY':
1552
+ if (!isNaN(x) && y === undefined) {
1553
+ domMatrix[PropertySymbol.skewYSelf](x);
1554
+ }
1555
+ break;
1556
+ default:
1557
+ throw TypeError(
1558
+ `Failed to execute 'setMatrixValue' on '${this.name}': Unknown transform function '${match[1]}'.`
1559
+ );
1560
+ }
1561
+ }
1562
+
1563
+ return domMatrix;
1564
+ }
1565
+
1566
+ /**
1567
+ * Returns length.
1568
+ *
1569
+ * @param length Length to convert.
1570
+ * @returns Length.
1571
+ */
1572
+ private static [PropertySymbol.getLength](length: string): number {
1573
+ const value = parseFloat(length);
1574
+ const unit = length.replace(value.toString(), '');
1575
+ switch (unit) {
1576
+ case 'rem':
1577
+ case 'em':
1578
+ case 'vw':
1579
+ case 'vh':
1580
+ case '%':
1581
+ case 'vmin':
1582
+ case 'vmax':
1583
+ throw new SyntaxError(
1584
+ `Failed to construct '${this.name}': Lengths must be absolute, not relative`
1585
+ );
1586
+ case 'rad':
1587
+ return value * (180 / Math.PI);
1588
+ case 'turn':
1589
+ return value * 360;
1590
+ case 'px':
1591
+ return value;
1592
+ case 'cm':
1593
+ return value * 37.7812;
1594
+ case 'mm':
1595
+ return value * 3.7781;
1596
+ case 'in':
1597
+ return value * 96;
1598
+ case 'pt':
1599
+ return value * 1.3281;
1600
+ case 'pc':
1601
+ return value * 16;
1602
+ case 'Q':
1603
+ return value * 0.945;
1604
+ default:
1605
+ return value;
1606
+ }
1607
+ }
1608
+ }