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,968 @@
1
+ # SES
2
+
3
+ SES is a [shim][define shim] for [Hardened JavaScript][] as [proposed][SES
4
+ proposal] to ECMA TC39.
5
+ SES stands for *fearless cooperation*.
6
+ Hardened JavaScript is highly compatible with ordinary JavaScript.
7
+ Most existing JavaScript libraries can run on Hardened JavaScript.
8
+
9
+ * **Compartments** Compartments are separate execution contexts: each one has
10
+ its own global object and global lexical scope.
11
+ * **Frozen realm** Compartments share their intrinsics to avoid identity
12
+ discontinuity. By freezing the intrinsics, SES protects programs from each
13
+ other. By sharing the intrinsics, programs from separate compartments
14
+ can recognize each other's arrays, data objects, and so on.
15
+ * **Strict mode** SES enforces JavaScript strict mode that enhances security,
16
+ for example by changing some silent failures into thrown errors.
17
+ * **POLA** (Principle of Least Authority) By default, Compartments receive no
18
+ ambient authority. They are created without host-provided APIs, (for example
19
+ no `fetch`). Compartments can be selectively endowed with powerful arguments,
20
+ globals, or modules.
21
+
22
+ SES safely executes third-party JavaScript 'strict' mode programs in
23
+ compartments that have no excess authority in their global scope.
24
+ SES runs atop an ES6-compliant platform, enabling safe interaction of
25
+ mutually-suspicious code, using object-capability -style programming.
26
+
27
+ Agoric and MetaMask rely on Hardened JavaScript and this SES shim as part of
28
+ systems that sandbox third-party plugins or smart contracts and mitigate supply
29
+ chain attacks for production web applications, web extensions, and build
30
+ systems.
31
+
32
+ [![Agoric Logo](docs/agoric-x100.png)](https://agoric.com/)
33
+ [![MetaMask Logo](docs/metamask-x100.png)](https://metamask.io/)
34
+
35
+ See <https://github.com/Agoric/Jessie> to see how SES fits into the various
36
+ flavors of confined JavaScript execution. And visit
37
+ <https://ses-demo.agoric.app/demos/> for a demo.
38
+
39
+ SES starts where the Caja project left off
40
+ <https://github.com/google/caja/wiki/SES>, and goes on to introduce compartments
41
+ and modernize the permitted JavaScript features.
42
+
43
+ Please join the conversation on our [Mailing List][SES Strategy Group] and
44
+ [Matrix][Endo Matrix].
45
+ We record a [weekly conference call][SES Strategy Recordings] with the Hardened
46
+ JavaScript engineering community.
47
+
48
+ *Hardened JavaScript*, Kris Kowal:
49
+
50
+ [![Primer on Hardened JavaScript](https://img.youtube.com/vi/RZ7bBIU8DRc/0.jpg)](https://www.youtube.com/watch?v=RZ7bBIU8DRc)
51
+
52
+ *Don't add Security, Remove Insecurity*, Mark Miller:
53
+
54
+ [![Don't add Security, Remove Insecurity](https://img.youtube.com/vi/u-XETUbxNUU/0.jpg)](https://www.youtube.com/watch?v=u-XETUbxNUU)
55
+
56
+ ## Install
57
+
58
+ ```sh
59
+ npm install ses
60
+ ```
61
+
62
+ ## Usage
63
+
64
+ The SES shim runs in most engines, either as an ESM module `ses` or as a
65
+ `<script>` tag.
66
+ For a script tag, the content encoding charset must be UTF-8, either by virtue
67
+ of `<head><meta charset="utf-8"></head>` (a general best practice for all HTML
68
+ files) or specifically `<script src="node_modules/ses/dist/ses.umd.min.js"
69
+ charset="utf-8">`.
70
+
71
+ SES can be bundled by Webpack, Browseriy, Rollup, and Parcel, but any of these
72
+ tools could be coopted with a supply-chain attack to invalidate the security
73
+ properties of SES. We generally recommend installing SES as a separate script
74
+ tag.
75
+
76
+ ### Lockdown
77
+
78
+ SES introduces the `lockdown()` function.
79
+ Calling `lockdown()` alters the surrounding execution environment, or
80
+ **realm**, such that no two programs running in the same realm can observe or
81
+ affect each other until they have been introduced, and even then can only
82
+ interact through their own exposed interfaces.
83
+
84
+ To do this, `lockdown()` tamper-proofs all of the JavaScript intrinsics, to
85
+ prevent **prototype pollution**.
86
+ After that, no program can subvert the methods of these objects (preventing
87
+ some **man in the middle attacks**).
88
+ Also, no program can use these mutable objects to pass notes to parties that
89
+ haven't been expressly introduced (preventing some **covert communication
90
+ channels**).
91
+
92
+ Lockdown freezes all objects that are effectively undeniable to programs in the
93
+ realm. The set of such objects includes but is not limited to: `globalThis`,
94
+ prototype objects of Array, Function, GeneratorFunction, and Object, and objects
95
+ accessible from those objects (such as `Object.prototype.toString`).
96
+
97
+ The `lockdown()` function also **tames** some objects including regular
98
+ expressions, locale methods, and errors.
99
+ A tamed `RegExp` does not have the deprecated `compile` method.
100
+ A tamed error does not have a V8 `stack`, but the `console` can still see the
101
+ stack.
102
+ Lockdown replaces locale methods like `String.prototype.localeCompare` with
103
+ generic versions that do not reveal the host locale.
104
+
105
+ ```js
106
+ import 'ses';
107
+
108
+ lockdown();
109
+
110
+ console.log(Object.isFrozen([].__proto__));
111
+ // true
112
+ ```
113
+
114
+ Lockdown does not erase any powerful objects from the initial global scope.
115
+ Instead, **Compartments** give complete control over what powerful objects
116
+ exist for client code.
117
+
118
+ See [`lockdown` options](../../docs/lockdown.md) for configuration options to
119
+ `lockdown`. However, all of these have sensible defaults that should
120
+ work for most projects out of the box.
121
+
122
+ ### Harden
123
+
124
+ SES introduces the `harden` function.
125
+ *After* calling `lockdown`, the `harden` function ensures that every object in
126
+ the transitive closure over property and prototype access starting with that
127
+ object has been **frozen** by `Object.freeze`.
128
+ This means that the object can be passed among programs and none of those
129
+ programs will be able to tamper with the **surface** of that object graph.
130
+ They can only read the surface data and call the surface functions.
131
+
132
+ ```js
133
+ import 'ses';
134
+
135
+ lockdown();
136
+
137
+ let counter = 0;
138
+ const capability = harden({
139
+ inc() {
140
+ counter++;
141
+ },
142
+ });
143
+
144
+ console.log(Object.isFrozen(capability));
145
+ // true
146
+ console.log(Object.isFrozen(capability.inc));
147
+ // true
148
+ ```
149
+
150
+ Note that although the **surface** of the capability is frozen, the capability
151
+ still closes over the mutable counter.
152
+ Hardening an object graph makes the surface immutable, but does not guarantee
153
+ that methods are free of side effects.
154
+
155
+ ### Compartment
156
+
157
+ SES introduces the `Compartment` constructor.
158
+ A compartment is an evaluation and execution environment with its own
159
+ `globalThis` and wholly independent system of modules, but otherwise shares
160
+ the same batch of intrinsics like `Array` with the surrounding compartment.
161
+ The concept of a compartment implies an **initial compartment**, the initial
162
+ execution environment of a **realm**.
163
+
164
+ In the following example, we create a compartment endowed with a `print()`
165
+ function on `globalThis`.
166
+
167
+ ```js
168
+ import 'ses';
169
+
170
+ lockdown();
171
+
172
+ const c = new Compartment({
173
+ globals: {
174
+ print: harden(console.log),
175
+ },
176
+ __options__: true, // temporary migration affordance
177
+ });
178
+
179
+ c.evaluate(`
180
+ print('Hello! Hello?');
181
+ `);
182
+ ```
183
+
184
+ The new compartment has a different global object than the start compartment.
185
+ The global object is initially mutable.
186
+ Locking down the realm hardened the objects in global scope.
187
+ After `lockdown`, no compartment can tamper with these **intrinsics** and
188
+ **undeniable** objects.
189
+ Many of these are identical in the new compartment.
190
+
191
+ ```js
192
+ const c = new Compartment();
193
+ c.globalThis === globalThis; // false
194
+ c.globalThis.JSON === JSON; // true
195
+ ```
196
+
197
+ Other pairs of compartments also share many identical intrinsics and undeniable
198
+ objects of the realm.
199
+ Each has a unique, initially mutable, global object.
200
+
201
+ ```js
202
+ const c1 = new Compartment();
203
+ const c2 = new Compartment();
204
+ c1.globalThis === c2.globalThis; // false
205
+ c1.globalThis.JSON === c2.globalThis.JSON; // true
206
+ ```
207
+
208
+ The global scope of every compartment includes a shallow, specialized copy of
209
+ the JavaScript intrinsics, disabling `Math.random`, `Date.now` and the
210
+ behaviors of the `Date` constructor which would reveal the current time.
211
+ Compartments leave these out since they can be used as covert communication
212
+ channels between programs.
213
+ However, a compartment may be expressly given access to these objects
214
+ through:
215
+
216
+ * the first argument to the compartment constructor or
217
+ * by assigning them to the compartment's `globalThis` after construction.
218
+
219
+ ```js
220
+ const powerfulCompartment = new Compartment({
221
+ globals: { Math },
222
+ __options__: true, // temporary migration affordance
223
+ });
224
+ powerfulCompartment.globalThis.Date = Date;
225
+ ```
226
+
227
+ Because every compartment shares one JavaScript agent, see
228
+ [Limitations](../../docs/lockdown.md#limitations) for the availability and
229
+ memory-exhaustion threats a `Compartment` cannot mitigate.
230
+
231
+ ### Compartment + Lockdown
232
+
233
+ Together, Compartment and lockdown isolate client code in an environment with
234
+ limited powers and communication channels.
235
+ A compartment has only the capabilities it is expressly given and cannot modify
236
+ any of the shared intrinsics.
237
+ Every compartment gets its own globals, including such objects as the
238
+ `Function` constructor.
239
+ Yet, compartment and lockdown do not break `instanceof` for any of these
240
+ intrinsics types!
241
+
242
+ All of the evaluators in one compartment are captured by that compartment's
243
+ global scope, including `Function`, indirect `eval`, dynamic `import`, and its
244
+ own `Compartment` constructor for child compartments.
245
+ For example, the `Function` constructor in one compartment creates functions
246
+ that evaluate in the global scope of that compartment.
247
+
248
+ ```js
249
+ const c1 = new Compartment();
250
+ const f1 = new c.globalThis.Function('return globalThis');
251
+ f1() === c1.globalThis; // true
252
+
253
+ const c2 = new Compartment();
254
+ const f2 = new c.globalThis.Function('return globalThis');
255
+ f2() === c2.globalThis; // true
256
+
257
+ f1() === f2(); // false
258
+ ```
259
+
260
+ Lockdown prepares for compartments with separate globals by freezing
261
+ their shared prototypes and replacing their prototype constructors
262
+ with powerless dummies.
263
+ So, `Function` is different in two compartments, `Function.prototype` is the
264
+ same, and `Function` is not the same as `Function.prototype.constructor`.
265
+ The `Function.prototype.constructor` can only throw exceptions.
266
+ So, a function passed between compartments does not carry access to
267
+ its compartment's globals along with it.
268
+ Yet, `f instanceof Function` works, even when `f` and `Function` are
269
+ from different compartments.
270
+
271
+ The `globalThis` in each compartment is mutable.
272
+ This can and should be frozen before running any dynamic code in that
273
+ compartment, yet is not strictly necessary if the compartment only
274
+ runs code from a single party.
275
+
276
+ ### Modules
277
+
278
+ Any code executed within a compartment shares a set of module instances.
279
+ For modules to work within a compartment, the creator must provide
280
+ module descriptors.
281
+ A compartment can be configured with module descriptors, from highest to lowest
282
+ precedence:
283
+
284
+ * the `modules` map provided to the `Compartment` constructor,
285
+ * returned by a `moduleMapHook(specifier)` passed as an option to the
286
+ `Compartment` constructor.
287
+ * returned by either the `importHook(specifier)` or `importNowHook(specifier)`
288
+ option passed to the `Compartment` constructor. Calling
289
+ `compartment.import(specifier)` falls through to the `importHook` which may
290
+ return a promises, whereas `compartment.importNow(specifier)` falls through
291
+ to the synchronous `importNowHook`.
292
+
293
+ The `resolveHook` determines how the compartment will infer the full module
294
+ specifier for another module from a referrer module and the import specifier.
295
+
296
+ ```js
297
+ import 'ses';
298
+ import { ModuleSource } from '@endo/module-source';
299
+
300
+ const c1 = new Compartment({
301
+ name: "first compartment",
302
+ resolveHook: (moduleSpecifier, moduleReferrer) => {
303
+ return resolve(moduleSpecifier, moduleReferrer);
304
+ },
305
+ importHook: async moduleSpecifier => {
306
+ const moduleLocation = locate(moduleSpecifier);
307
+ const moduleText = await retrieve(moduleLocation);
308
+ return {
309
+ source: new ModuleSource(moduleText, moduleLocation)
310
+ };
311
+ },
312
+ __options__: true, // temporary migration affordance
313
+ });
314
+ ```
315
+
316
+ > The Hardened JavaScript language specifies a global `ModuleSource`, but this
317
+ > is not provided by the shim because it entrains a full JavaScript parser that
318
+ > is an unnecessary performance penalty for the SES runtime.
319
+ > Instead, the SES shim accepts a pre-compiled module source duck-type that
320
+ > is tightly coupled to the shim implementation.
321
+
322
+ A compartment can also link a module in another compartment.
323
+
324
+ ```js
325
+ const c2 = new Compartment({
326
+ name: "second compartment",
327
+ modules: {
328
+ 'c1': {
329
+ source: './main.js',
330
+ compartment: c1,
331
+ },
332
+ },
333
+ resolveHook,
334
+ importHook,
335
+ __options__: true, // temporary migration affordance
336
+ });
337
+ ```
338
+
339
+ #### Module Descriptors
340
+
341
+ Comparments can load and initialize module namespaces from module descriptors.
342
+ Like property descriptors, module descriptors are ordinary objects with various
343
+ forms.
344
+
345
+ ##### Descriptors with `source` property
346
+
347
+ * If fhe value of the `source` property is a string, the parent compartment
348
+ loads the module but the compartment itself initializes the module.
349
+
350
+ * Otherwise, if the value of the `source` property is the module source, the
351
+ module is initialized from the module source.
352
+
353
+ * Otherwise, the value of the `source` property must be an object. The module
354
+ is loaded and initialized from the object according to the [virtual module
355
+ source](#VirtualModuleSource) pattern.
356
+
357
+ If the `importMeta` property is present, its value must be an object. The
358
+ default `importMeta` object is an empty object.
359
+
360
+ Compartments copy the `importMeta` object properties into the module
361
+ `import.meta` object like `Object.assign`.
362
+
363
+ If the `specifier` property is present, its value is coerced into a string and
364
+ becomes the referrer specifier of the module, on which all import specifiers
365
+ are resolved using the `resolveHook`.
366
+
367
+ ##### Descriptors with `namespace` property
368
+
369
+ * If fhe value of the `namespace` property is a string, the descriptor shares a
370
+ module to be loaded and initialized by the compartment referred by the
371
+ `compartment` property.
372
+
373
+ * If the `compartment` property is present, its value must be a
374
+ compartment.
375
+ * If absent, the `compartment` property defaults to the compartment being
376
+ constructed in the `modules` option, or being hooked in the `loadHook`
377
+ and `loadNowHook` options.
378
+
379
+ * Otherwise, if the value of the `namespace` property is a module namepace, the
380
+ descriptor shares a module that is already available.
381
+
382
+ * Otherwise, the value of `namespace` property must be an object. The module is
383
+ loaded and initialized from the object according to the [virtual module
384
+ namespace](#VirtualModuleNamespace) pattern.
385
+
386
+ #### Redirects
387
+
388
+ If a compartment imports a module specified as `"./utility"` but actually
389
+ implemented by an alias like `"./utility/index.js"`, the `importHook` may
390
+ follow redirects, symbolic links, or search for candidates using its own logic
391
+ and return a module that has a different "response specifier" than the original
392
+ "request specifier".
393
+ The `importHook` may return an "alias" object with `source`, `compartment`,
394
+ and `specifier` properties.
395
+
396
+ * `source` must be a module source, either a virtual module source
397
+ or a compiled module source.
398
+ * `compartment` is optional, to be specified if the alias transits to a
399
+ the specified different compartment, and
400
+ * `specifier` is the full module specifier of the module in its compartment.
401
+ This defaults to the request specifier, which is only useful if the
402
+ compartment is different.
403
+
404
+ In the following example, the importHook searches for a file and returns an
405
+ alias.
406
+
407
+ ```js
408
+ const importHook = async specifier => {
409
+ const candidates = [specifier, `${specifier}.js`, `${specifier}/index.js`];
410
+ for (const candidate of candidates) {
411
+ const source = await maybeImportSource(candidate);
412
+ if (source !== undefined) {
413
+ return {
414
+ source,
415
+ specifier: candidate,
416
+ compartment,
417
+ };
418
+ }
419
+ }
420
+ throw new Error(`Cannot find module ${specifier}`);
421
+ };
422
+
423
+ const compartment = new Compartment({
424
+ resolveHook,
425
+ importHook,
426
+ __options__: true, // temporary migration affordance
427
+ });
428
+ ```
429
+
430
+ #### moduleMapHook
431
+
432
+ The module map above allows modules to be introduced to a compartment up-front.
433
+ Some modules cannot be known that early.
434
+ For example, in Node.js, a package might have a dependency that brings in an
435
+ entire subtree of modules.
436
+ Also, a pair of compartments with cyclic dependencies between modules they each
437
+ contain cannot use `compartment.module` to link the second compartment
438
+ constructed to the first.
439
+ For these cases, the `Compartment` constructor accepts a `moduleMapHook` option
440
+ that is like the dynamic version of the static `moduleMap` argument.
441
+ This is a function that accepts a module specifier and returns the module
442
+ namespace for that module specifier, or `undefined`.
443
+ If the `moduleMapHook` returns `undefined`, the compartment proceeds to the
444
+ `importHook` to attempt to asynchronously obtain the module's source.
445
+
446
+ ```js
447
+ const moduleMapHook = moduleSpecifier => {
448
+ if (moduleSpecifier === 'even') {
449
+ return {
450
+ source: './index.js',
451
+ compartment: even,
452
+ };
453
+ } else if (moduleSpecifier === 'odd') {
454
+ return {
455
+ source: './index.js',
456
+ compartment: odd,
457
+ };
458
+ }
459
+ };
460
+
461
+ const even = new Compartment({
462
+ resolveHook: nodeResolveHook,
463
+ importHook: makeImportHook('https://example.com/even'),
464
+ moduleMapHook,
465
+ __options__: true, // temporary migration affordance
466
+ });
467
+
468
+ const odd = new Compartment({
469
+ resolveHook: nodeResolveHook,
470
+ importHook: makeImportHook('https://example.com/odd'),
471
+ moduleMapHook,
472
+ __options__: true, // temporary migration affordance
473
+ });
474
+ ```
475
+
476
+ #### importNowHook
477
+
478
+ Additionally, an `importNowHook` may be provided that the compartment will use
479
+ as means to synchronously load modules not seen before in situations where
480
+ calling out to asynchronous `importHook` is not possible.
481
+ Specifically, when `compartmentInstance.importNow('specifier')` is called, the
482
+ compartment will first look up module records it's already aware of and call
483
+ `moduleMapHook` and if none of that is successful in finding a module record
484
+ matching the specifier, it will call `importNowHook` expecting to synchronously
485
+ receive the same record type as from `importHook` or throw if it cannot.
486
+
487
+ ```js
488
+ import 'ses';
489
+ import { ModuleSource } from '@endo/module-source';
490
+
491
+ const compartment = new Compartment({
492
+ name: "first compartment",
493
+ modules: {
494
+ c: {
495
+ source: new ModuleSource(''),
496
+ },
497
+ },
498
+ resolveHook: (moduleSpecifier, moduleReferrer) => {
499
+ return resolve(moduleSpecifier, moduleReferrer);
500
+ },
501
+ importHook: async moduleSpecifier => {
502
+ const moduleLocation = locate(moduleSpecifier);
503
+ const moduleText = await retrieve(moduleLocation);
504
+ return {
505
+ source: new ModuleSource(moduleText, moduleLocation),
506
+ };
507
+ },
508
+ importNowHook: moduleSpecifier => {
509
+ const moduleLocation = locate(moduleSpecifier);
510
+ // Platform-specific synchronous read API can be used
511
+ const moduleText = fs.readFileSync(moduleLocation);
512
+ return {
513
+ source: new ModuleSource(moduleText, moduleLocation),
514
+ };
515
+ },
516
+ __options__: true, // temporary migration affordance
517
+ });
518
+ //... | importHook | importNowHook
519
+ await compartment.import('a'); //| called | not called
520
+ compartment.importNow('b'); //| not called | called
521
+ compartment.importNow('a'); //| not called | not called
522
+ compartment.importNow('c'); //| not called | not called
523
+ ```
524
+
525
+ ### <a name="VirtualModuleSource"></a> Virtual Module Source
526
+
527
+ To incorporate modules not implemented as JavaScript modules, third-parties may
528
+ implement a `VirtualModuleSource` interface.
529
+ The object must have an `imports` array and an `execute` method.
530
+ The compartment will call `execute` with:
531
+
532
+ 1. the proxied `exports` namespace object,
533
+ 2. a `resolvedImports` object that maps import names (from `imports`) to their
534
+ corresponding resolved specifiers (through the compartment's `resolveHook`),
535
+ and
536
+ 3. the `compartment`, such that `importNow` can obtain any of the module's
537
+ specified `imports`.
538
+
539
+ :warning: A future breaking version may allow the `importNow` and the `execute`
540
+ method of virtual module sources to return promises, to support
541
+ top-level await.
542
+
543
+ :warning: The virtual module source interface does not yet agree with the
544
+ [XS](https://www.moddable.com/hardening-xs) implementation of [Hardened
545
+ JavaScript](https://hardenedjs.org/).
546
+
547
+ ### Compiled modules
548
+
549
+ Instead of the `ModuleSource` constructor specified for the SES language,
550
+ the SES shim uses compiled module source records as a stand-in.
551
+ These can be created with a `ModuleSource` constructor from a package
552
+ like `@endo/module-source`.
553
+ We omitted `ModuleSource` from the SES shim because it entrains a heavy
554
+ dependency on a JavaScript parser.
555
+ The shim depends upon a `ModuleSource` constructor to analyze and
556
+ transform the source of a JavaScript module (known as an ESM or a `.mjs` file)
557
+ into a JavaScript program suitable for evaluation with `compartment.evaluate`
558
+ using a particular calling convention to initialize a module instance.
559
+
560
+ A compiled module source record has the following shape:
561
+
562
+ * `imports` is a record that maps partial module specifiers to a list of
563
+ names imported from the corresponding module.
564
+ * `exports` is an array of all the names that the module will export.
565
+ * `reexports` is an array of partial module specifier for which this
566
+ module exports all imported names.
567
+ This field is optional.
568
+ * `__syncModuleProgram__` is a string that evaluates to a function that accepts
569
+ an initialization record and initializes the module.
570
+ This property distinguishes this type of module record.
571
+ The name implies a future record type that supports top-level await.
572
+ * An initialization record has the properties `imports`, `liveVar`, `importMeta` and
573
+ `onceVar`.
574
+ * `imports` is a function that accepts a map from partial import
575
+ module specifiers to maps from names that the corresponding module
576
+ exports to notifier functions.
577
+ A notifier function accepts an update function and registers
578
+ to receive updates for the value exported by the other module.
579
+ * `importMeta` is a null-prototype object with keys transferred from `importMeta`
580
+ property in the envelope returned by importHook and/or mutated by
581
+ calling `importMetaHook(moduleSpecifier, importMeta)`
582
+ * `liveVar` is a record that maps names exported by this module
583
+ to a function that may be called to initialize or update
584
+ the corresponding value in another module.
585
+ * `onceVar` is a record that maps constants exported by this
586
+ module to a function that may be called to initialize the
587
+ corresponding value in another module.
588
+ * `__syncModuleFunctor__` is an optional function that if present is used
589
+ instead of the evaluation of the `__syncModuleProgram__` string. It will be
590
+ called with the initialization record described above. It is intended to be
591
+ used in environments where eval is not available. Sandboxing of the functor is
592
+ the responsibility of the author of the ModuleSource.
593
+ * `__liveExportsMap__` is a record that maps import names or names in the lexical
594
+ scope of the module to export names, for variables that may change after
595
+ initialization. Any reexported name is assumed to possibly change.
596
+ The exported name is wrapped in a duple array like `["exportedName", true]`.
597
+ The second value, a boolean, indicates that the variable has a temporal
598
+ dead-zone (a time between creation and initialization) when access to that
599
+ name should throw a `ReferenceError`.
600
+ * `__fixedExportsMap__` is a record that maps import names to export names
601
+ for constants exported by this module.
602
+ The fixed exports map is an aesthetic subtype of the live exports map,
603
+ so the value is wrapped in a simple array like `["exportedName"]`
604
+
605
+ ### Transforms
606
+
607
+ The `Compartment` constructor accepts a `transforms` option.
608
+ This is an array of JavaScript source to source translation functions,
609
+ in the order they should be applied.
610
+ Passing the source to the first function's input, then from each function's
611
+ output to the next's input, the final function's output must be a valid
612
+ JavaScript "Program" grammar construction, code that is valid in a `<script>`,
613
+ not a module.
614
+
615
+ ```js
616
+ const transforms = [addCodeCoverageInstrumentation];
617
+ const c = new Compartment({
618
+ globals: { console, coverage },
619
+ transforms,
620
+ __options__: true, // temporary migration affordance
621
+ });
622
+ c.evaluate('console.log("Hello");');
623
+ ```
624
+
625
+ The `evaluate` method of a compartment also accepts a `transforms` option.
626
+ These apply before and in addition to the compartment-scoped transforms.
627
+
628
+ ```js
629
+ const transform = source => source.replace(/Farewell/g, 'Hello');
630
+ const transforms = [transform];
631
+ c.evaluate('console.log("Farewell, World!")', { transforms });
632
+ // Hello, World!
633
+ ```
634
+
635
+ These transforms do not apply to modules.
636
+ To transform the source of a JavaScript module, the `importHook` must
637
+ intercept the source and transform it before passing it to the
638
+ `ModuleSource` constructor.
639
+ These are distinct because programs and modules have distinct grammar
640
+ productions.
641
+
642
+ An **internal implementation detail** of the SES-shim is that it
643
+ converts modules to programs and evaluates them as programs.
644
+ So, only for this implementation of `Compartment`, it is possible for a program
645
+ transform to be equally applicable for modules, but that transform will
646
+ have a window into the internal translation, will be sensitive to changes to
647
+ that translation between any pair of releases, even those that do not disclose
648
+ any breaking changes, and will only work on SES-shim, not any other
649
+ implementation of `Compartment` like the one provided by XS.
650
+
651
+ The SES-shim `Compartment` constructor accepts a `__shimTransforms__`
652
+ option for this purpose.
653
+ For the `Compartment` to use the same transforms for both evaluated strings
654
+ and modules converted to programs, pass them as `__shimTransforms__`
655
+ instead of `transforms`.
656
+
657
+ ```js
658
+ const __shimTransforms__ = [addCoverage];
659
+ const c = new Compartment({
660
+ globals: { console, coverage },
661
+ __shimTransforms__,
662
+ __options__: true, // temporary migration affordance
663
+ });
664
+ c.evaluate('console.log("Hello");');
665
+ ```
666
+
667
+ The `__shimTransforms__` feature is designed to uphold the security properties
668
+ of compartments, since an attacker may use all available features, whether they
669
+ are standard or not.
670
+
671
+ ### Logging Errors
672
+
673
+ `lockdown()` adds new global `assert` and tames the global `console`. The error
674
+ taming hides error stacks, accumulating them in side tables. The `assert`
675
+ system generates other diagnostic information hidden in side tables. The tamed
676
+ console uses these side tables to output more informative diagnostics.
677
+ [Logging Errors](../../docs/errors.md) explains the design.
678
+
679
+ ### Controlling Module-Loading Errors
680
+
681
+ The `Compartment` constructor now accepts a `boolean` option, `noAggregateLoadErrors`, to control how module-loading errors are reported.
682
+
683
+ By default, its value is `false`, which causes all relevant errors to be collected and rejected or thrown in a single exception from `compartment.import()` or `compartment.importNow()`, respectively.
684
+
685
+ If set to `true`, this will cause the *first* module-loading error encountered to be thrown (or rejected) immediately; no further module-loading will be attempted, and no further errors will be collected.
686
+
687
+ This is mostly useful for supporting optional dependencies in CommonJS modules, for example:
688
+
689
+ ```js
690
+ try {
691
+ require('something-optional')
692
+ } catch (err) {
693
+ // continue
694
+ }
695
+ ```
696
+
697
+ ## Security claims and caveats
698
+
699
+ The `ses` shim concerns boundaries between programs in the same process and
700
+ JavaScript realm.
701
+ In terms of the [Taxonomy of Security Issues](https://papers.agoric.com/taxonomy-of-security-issues/),
702
+ the `ses` shim creates a boundary that is finer than an operating system
703
+ process or thread and facilitates boundaries as fine as individual objects.
704
+ While `ses` can interpose at granularities where process isolation is not a
705
+ viable boundary, as between an application and its dependencies or between a
706
+ platform and a plugin, `ses` combines well with coarser boundaries for defense
707
+ in depth.
708
+
709
+ For the purposes of these claims and caveats, a "host program" is a program
710
+ that arranges `ses`, calls `lockdown`, and orchestrates one or more "guest
711
+ programs", providing limited access to its resources.
712
+
713
+ ### Single-guest Compartment Isolation
714
+
715
+ Provided that the `ses` implementation and its
716
+ [trusted compute base](#trusted-compute-base) are correct, we claim that a host
717
+ program can evaluate a guest program (`program`) in a compartment after
718
+ `lockdown` and that the guest program:
719
+
720
+ * will initially only have access to one mutable object, the compartment's
721
+ `globalThis`,
722
+ * specifically cannot modify any shared primordial objects, which are part of
723
+ the default execution environment,
724
+ * cannot initially perform any I/O (except I/O necessarily performed by the
725
+ trusted compute base like paging virtual memory),
726
+ * and specifically cannot measure the passage of time at any resolution.
727
+
728
+ However, such a program can:
729
+
730
+ * execute for an indefinite amount of time,
731
+ * allocate arbitrary amounts of memory,
732
+ * detect the platform endianness,
733
+ * in some JavaScript engines, observe the contents of the stack.
734
+ This may include sensitive information about the layout of files on the host
735
+ disk.
736
+ In cases where the stack is data-dependent, a guest can infer the data.
737
+ `ses` occludes the stack on V8 and SpiderMonkey, but cannot on
738
+ JavaScriptCore.
739
+
740
+ ```js
741
+ lockdown();
742
+ const compartment = new Compartment();
743
+ compartment.evaluate(program);
744
+ ```
745
+
746
+ ### Multi-guest Compartment Isolation
747
+
748
+ If the host program arranges for the compartment's `globalThis` to
749
+ be frozen, we additionally claim that the host can evaluate any two guest
750
+ programs (`program1` and `program2`) in that compartment such that neither
751
+ guest program will:
752
+
753
+ * initially share *any* mutable objects.
754
+ * be able to observe the relative passage of time of the other program,
755
+ as they would had they been given a reference to a working `Date.now()`.
756
+ * be able to communicate, as they would if they had shared access to mutable
757
+ state like an unfrozen object, a hardened collection like a `Map`, or even
758
+ `Math.random()`.
759
+
760
+ ```js
761
+ lockdown();
762
+ const compartment = new Compartment();
763
+ harden(compartment.globaThis);
764
+ compartment.evaluate(program1);
765
+ compartment.evaluate(program2);
766
+ ```
767
+
768
+ ### Endowment Protection
769
+
770
+ The above `program`, `program1`, and `program2` guest programs are only useful
771
+ as glorified calculators.
772
+ When going beyond that by "endowing" a compartment with extra objects, a host
773
+ program is responsible for maintaining any of the invariants above that it
774
+ considers necessary.
775
+
776
+ For example, a host program may run two guest programs in separate
777
+ compartments, giving one the ability to resolve a promise and the other
778
+ the ability to observe the settlement (fulfillment or rejection) of
779
+ that promise.
780
+ The host program is responsible for hardening the objects implementing such
781
+ abilities.
782
+
783
+ ```js
784
+ lockdown();
785
+
786
+ const promise = new Promise(resolve => {
787
+ const compartmentA = new Compartment({
788
+ globals: harden({ resolve }),
789
+ __options__: true, // temporary migration affordance
790
+ });
791
+ compartmentA.evaluate(programA);
792
+ });
793
+
794
+ const compartmentB = new Compartment({
795
+ globals: harden({ promise }),
796
+ __options__: true, // temporary migration affordance
797
+ });
798
+ compartmentB.evaluate(programB);
799
+ ```
800
+
801
+ With `ses`, guest programs are initially powerless.
802
+ A host can explicitly share limited powers with guest programs
803
+ and provide intentional communication channels between them.
804
+
805
+ ### Caveats
806
+
807
+ Host programs must maintain the `ses` boundary with care in what they present
808
+ as endowments.
809
+ A host program should take care not to share mutable state with guests,
810
+ or distribute mutable state to multiple guests, such as an object that has not
811
+ been frozen with `harden` or a collection like a `Map` or `Set` or typed array
812
+ (collections retain some mutability even if hardened).
813
+
814
+ For the purposes of sharing state, pseudo-random number generators (PRNG) like
815
+ `Math.random()` are equivalent to read and write access to shared state, and
816
+ any guest can use one to eavesdrop on other guests or the host that share one.
817
+
818
+ If a guest program needs a high resolution timer to function, the host should
819
+ only invite one guest to a single operating system process and limit the
820
+ activity of the host program in the same process.
821
+
822
+ Hosts must avoid exposing `SharedArrayBuffer` to guests.
823
+ Any two JavaScript programs sharing a `SharedArrayBuffer` can use the shared
824
+ buffer to construct a high resolution timer.
825
+
826
+ The `ses` shim does not in itself isolate the stack of guest programs, even
827
+ when evaluated in separate compartments.
828
+ This is relevant when objects are shared between guest programs.
829
+
830
+ When a program interacts with an object introduced by another program (as
831
+ through the per-compartment `globalThis`, function arguments or returned
832
+ values), there are potential risks due to the synchronous nature of object
833
+ access.
834
+ Even interactions that are not explicit function calls may cause code from
835
+ another program, like property accessors or proxy traps, to execute on the same
836
+ stack, which may be able to detect the stack height, throw an exception, or call
837
+ back into the program in pursuit of a reentrancy attack.
838
+
839
+ A host object can defend itself from reentrancy attacks by ensuring that it
840
+ interacts with guest objects on a clean stack through the use of promises.
841
+
842
+ Within these constraints, a host program can provide objects that grant limited
843
+ I/O capabilities to guest programs, and even revoke or suspend those
844
+ capabilities at runtime.
845
+
846
+ ### Trusted Compute Base
847
+
848
+ The trusted compute base (TCB) for `ses` includes:
849
+
850
+ * the host hardware,
851
+ * the host operating system,
852
+ * any intermediate virtual operating systems or hypervisors,
853
+ * the process memory manager,
854
+ * an implementation of JavaScript conforming to ECMAScript 262 as of
855
+ 2021, providing no unspecified embedding host behavior like the introduction of syntax
856
+ that when evaluated reveals a mutable object.
857
+ `ses` accounts for one such host behavior provided by Node.js, namely the `domain`
858
+ property on promises, by preventing the use of `ses` in concert with the
859
+ `domain` module.
860
+ * Also, any attached debugger, and
861
+ * any JavaScript that has executed in the same realm before the host program calls
862
+ `lockdown`, including JavaScript that executes after `ses` initializes.
863
+
864
+ ## Audits
865
+
866
+ In June 2021, `ses` underwent formal third party vulnerability assessment over a
867
+ period of 4 weeks with 3 engineers and a dedicated project manager that
868
+ surfaced no unknown security issues or vulnerabilities within the code. As a
869
+ result of this assessment, [a single code change was
870
+ made](https://github.com/endojs/endo/issues/126) to set a flag to disable the
871
+ domain module in Node.js to mitigate a known issue identified in the code. The
872
+ code will be the subject of another round of intense application security
873
+ review mid-2022 by a reputable application security firm renowned for their
874
+ results in security reviews.
875
+
876
+ In July 2021, `ses` was the target of an intensive collaborative bug hunt lead by
877
+ the MetaMask team.
878
+ No critical flaws in the code surfaced during the review.
879
+ As a result of the search for flaws, deficiencies, and weaknesses in the code,
880
+ a series of small code changes and documentation improvements were made. There
881
+ is a report available on the
882
+ [Agoric blog](https://agoric.com/blog/technology/purple-teaming-how-metamask-and-agoric-hunted-bugs-to-harden-javascript)
883
+ that includes links to recordings of code walk-throughs and technical
884
+ discussion, and issues are tagged
885
+ [audit-SEStival](https://github.com/endojs/endo/issues?q=label%3Aaudit-sestival).
886
+ The [video recordings of the MetaMask and Agoric collaborative
887
+ review](https://www.youtube.com/playlist?list=PLzDw4TTug5O2d1XOdB7VNCZbIxRZu3gov).
888
+ provide useful background for future audits, reviews, and for learning more
889
+ about how the `ses` shim constructs a Hardened JavaScript environment.
890
+
891
+ In addition to vulnerability assessments, active efforts to [formally verify
892
+ the Agoric kernel](https://agoric.com/blog/technology/the-path-to-verified-blds-how-informal-systems-and-agoric-are-using-formal)
893
+ have found the object capability model that `ses` provides to be sound.
894
+
895
+ Hardened JavaScript is also within the scope of the [Agoric bug bounty
896
+ program](https://hackerone.com/agoric), which rewards researchers for surfacing valid
897
+ bugs in our code. We welcome the opportunity to cooperate with researchers,
898
+ whose efforts will undoubtedly yield stronger, more resilient code.
899
+
900
+ ## Bug Disclosure
901
+
902
+ Please help us practice coordinated security bug disclosure, by using the
903
+ instructions in [SECURITY.md][] to report security-sensitive bugs privately.
904
+
905
+ For non-security bugs, please use the [regular Issues page][SES Issues].
906
+
907
+ ## Ecosystem Compatibility
908
+
909
+ Most ordinary JavaScript can run without issues in a realm locked down by SES.
910
+ Exceptions are tracked at [issue #576][incompatibility tracking], and almost
911
+ always take the form of assignments that fail because the
912
+ "[override mistake][override mistake]" prevents overriding properties inherited
913
+ from a frozen intrinsic object in the prototype chain. When that is the case,
914
+ the code is often incompatible with *all* environments in which intrinsic
915
+ objects are frozen (such as in Node.js with the
916
+ [`--frozen-intrinsics`][Node frozen intrinsics] option) and can be fixed by
917
+ replacing `<lhs>.<propertyKey> = <rhs>;` or `<lhs>[<propertyKey>] = <rhs>;` with
918
+
919
+ ```js
920
+ Object.defineProperties(<lhs>, {
921
+ [<propertyKey>]: {
922
+ value: <rhs>,
923
+ writable: true,
924
+ enumerable: true,
925
+ configurable: true,
926
+ },
927
+ });
928
+ ```
929
+
930
+ Upon encountering an incompatibility, we recommend that you add a comment to
931
+ [issue #576][incompatibility tracking] and file an issue with the external
932
+ project referencing this section.
933
+ Projects often have their own unique issue reporting templates, but generally
934
+ provide some place to include text like
935
+
936
+ > ```
937
+ > This project has some assignments that break in an environment with frozen
938
+ > intrinsic objects, such as
939
+ > [Hardened JS (a.k.a. SES)](https://github.com/endojs/endo/blob/master/packages/ses#ecosystem-compatibility)
940
+ > or Node.js with the
941
+ > [`--frozen-intrinsics`](https://nodejs.org/docs/latest/api/cli.html#--frozen-intrinsics)
942
+ > option.
943
+ > Specifically, [link to source in the project] does not work correctly in such
944
+ > an environment.
945
+ >
946
+ > Please consider increasing support by replacing assignments to object
947
+ > properties inherited from intrinsics with use of `Object.defineProperties`
948
+ > (thereby working around the JavaScript "override mistake"), and if applicable
949
+ > also by avoiding mutation of intrinsic objects.
950
+ > If you don't have the capacity but would accept a PR, please comment to that
951
+ > effect so that a volunteer knows their efforts would be welcomed.
952
+ > ```
953
+
954
+ We find that library authors are generally amenable to making these small changes to increase
955
+ compatibility with any environment that protects itself from prototype pollution attacks by freezing
956
+ intrinsics, including `ses`.
957
+
958
+ [Hardened JavaScript]: https://hardenedjs.org/
959
+ [define shim]: https://en.wikipedia.org/wiki/Shim_(computing)
960
+ [Endo Matrix]: https://matrix.to/#/#endojs:matrix.org
961
+ [incompatibility tracking]: https://github.com/endojs/endo/issues/576
962
+ [Node frozen intrinsics]: https://nodejs.org/docs/latest/api/cli.html#--frozen-intrinsics
963
+ [override mistake]: https://web.archive.org/web/20141230041441/http://wiki.ecmascript.org/doku.php?id=strawman:fixing_override_mistake
964
+ [SECURITY.md]: https://github.com/endojs/endo/blob/master/packages/ses/SECURITY.md
965
+ [SES Issues]: https://github.com/endojs/endo/issues
966
+ [SES proposal]: https://github.com/tc39/proposal-ses
967
+ [SES Strategy Group]: https://groups.google.com/g/ses-strategy
968
+ [SES Strategy Recordings]: https://www.youtube.com/playlist?list=PLzDw4TTug5O1jzKodRDp3qec8zl88oxGd