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,2955 @@
1
+ import CSSValueFormatter from '../utilities/CSSValueFormatter.js';
2
+ import CSSStringUtility from '../utilities/CSSStringUtility.js';
3
+ import type ICSSPropertyValue from '../types/ICSSPropertyValue.js';
4
+ import type ICSSPropertyMap from '../types/ICSSPropertyMap.js';
5
+ import CSSVariableFormatter from '../utilities/CSSVariableFormatter.js';
6
+
7
+ const RECT_REGEXP = /^rect\((.*)\)$/i;
8
+ const SPLIT_COMMA_SEPARATED_WITH_PARANTHESES_REGEXP = /,(?=(?:(?:(?!\))[\s\S])*\()|[^\(\)]*$)/; // Split on commas that are outside of parentheses
9
+ const SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP = /\s+(?=(?:(?:(?!\))[\s\S])*\()|[^\(\)]*$)/; // Split on spaces that are outside of parentheses
10
+ const WHITE_SPACE_GLOBAL_REGEXP = /\s+/gm;
11
+ const BORDER_STYLE = [
12
+ 'none',
13
+ 'hidden',
14
+ 'dotted',
15
+ 'dashed',
16
+ 'solid',
17
+ 'double',
18
+ 'groove',
19
+ 'ridge',
20
+ 'inset',
21
+ 'outset'
22
+ ];
23
+ const BORDER_WIDTH = ['thin', 'medium', 'thick'];
24
+ const BORDER_COLLAPSE = ['separate', 'collapse'];
25
+ const BACKGROUND_REPEAT = ['repeat', 'repeat-x', 'repeat-y', 'no-repeat'];
26
+ const BACKGROUND_ORIGIN = ['border-box', 'padding-box', 'content-box'];
27
+ const BACKGROUND_CLIP = ['border-box', 'padding-box', 'content-box'];
28
+ const BACKGROUND_ATTACHMENT = ['scroll', 'fixed'];
29
+ const FLEX_BASIS = ['auto', 'fill', 'content'];
30
+ const CLEAR = ['none', 'left', 'right', 'both'];
31
+ const FLOAT = ['none', 'left', 'right', 'inline-start', 'inline-end'];
32
+ const SYSTEM_FONT = ['caption', 'icon', 'menu', 'message-box', 'small-caption', 'status-bar'];
33
+ const FONT_WEIGHT = ['normal', 'bold', 'bolder', 'lighter'];
34
+ const FONT_STYLE = ['normal', 'italic', 'oblique'];
35
+ const FONT_SIZE = [
36
+ 'xx-small',
37
+ 'x-small',
38
+ 'small',
39
+ 'medium',
40
+ 'large',
41
+ 'x-large',
42
+ 'xx-large',
43
+ 'xxx-large',
44
+ 'smaller',
45
+ 'larger'
46
+ ];
47
+ const FONT_STRETCH = [
48
+ 'ultra-condensed',
49
+ 'extra-condensed',
50
+ 'condensed',
51
+ 'semi-condensed',
52
+ 'normal',
53
+ 'semi-expanded',
54
+ 'expanded',
55
+ 'extra-expanded',
56
+ 'ultra-expanded'
57
+ ];
58
+
59
+ const DISPLAY = [
60
+ /* Legacy values */
61
+ 'block',
62
+ 'inline',
63
+ 'inline-block',
64
+ 'flex',
65
+ 'inline-flex',
66
+ 'grid',
67
+ 'inline-grid',
68
+ 'flow-root',
69
+
70
+ /* Box generation */
71
+ 'none',
72
+ 'contents',
73
+
74
+ /* Two-value syntax */
75
+ 'block flow',
76
+ 'inline flow',
77
+ 'inline flow-root',
78
+ 'block flex',
79
+ 'inline flex',
80
+ 'block grid',
81
+ 'inline grid',
82
+ 'block flow-root',
83
+
84
+ /* Other values */
85
+ 'table',
86
+ 'table-row',
87
+ 'list-item'
88
+ ];
89
+ const BORDER_IMAGE_REPEAT = ['stretch', 'repeat', 'round', 'space'];
90
+ const TEXT_TRANSFORM = [
91
+ 'capitalize',
92
+ 'uppercase',
93
+ 'lowercase',
94
+ 'none',
95
+ 'full-width',
96
+ 'full-size-kana'
97
+ ];
98
+ const VISIBILITY = ['visible', 'hidden', 'collapse'];
99
+
100
+ /**
101
+ * Computed style property parser.
102
+ */
103
+ export default class CSSPropertySetParser {
104
+ /**
105
+ * Returns border collapse.
106
+ *
107
+ * @param name Name.
108
+ * @param value Value.
109
+ * @param important Important.
110
+ * @returns Property values
111
+ */
112
+ public static getDefault(
113
+ name: string,
114
+ value: string,
115
+ important: boolean
116
+ ): ICSSPropertyMap | null {
117
+ const parsedValue =
118
+ CSSVariableFormatter.getVariable(value) || CSSValueFormatter.getGlobal(value) || value;
119
+ return parsedValue ? { [name]: { value: parsedValue, important } } : null;
120
+ }
121
+
122
+ /**
123
+ * Returns border collapse.
124
+ *
125
+ * @param value Value.
126
+ * @param important Important.
127
+ * @returns Property values
128
+ */
129
+ public static getBorderCollapse(value: string, important: boolean): ICSSPropertyMap | null {
130
+ const variable = CSSVariableFormatter.getVariable(value);
131
+ if (variable) {
132
+ return { 'border-collapse': { value: variable, important } };
133
+ }
134
+ const lowerValue = value.toLowerCase();
135
+ if (CSSValueFormatter.getGlobal(lowerValue) || BORDER_COLLAPSE.includes(lowerValue)) {
136
+ return { 'border-collapse': { value: lowerValue, important } };
137
+ }
138
+ return null;
139
+ }
140
+
141
+ /**
142
+ * Returns display.
143
+ *
144
+ * @param value Value.
145
+ * @param important Important.
146
+ * @returns Property values
147
+ */
148
+ public static getDisplay(value: string, important: boolean): ICSSPropertyMap | null {
149
+ const variable = CSSVariableFormatter.getVariable(value);
150
+ if (variable) {
151
+ return { display: { value: variable, important } };
152
+ }
153
+ const lowerValue = value.toLowerCase();
154
+ if (CSSValueFormatter.getGlobal(lowerValue) || DISPLAY.includes(lowerValue)) {
155
+ return { display: { value: lowerValue, important } };
156
+ }
157
+ return null;
158
+ }
159
+
160
+ /**
161
+ * Returns direction.
162
+ *
163
+ * @param value Value.
164
+ * @param important Important.
165
+ * @returns Property values
166
+ */
167
+ public static getDirection(value: string, important: boolean): ICSSPropertyMap | null {
168
+ const variable = CSSVariableFormatter.getVariable(value);
169
+ if (variable) {
170
+ return { direction: { value: variable, important } };
171
+ }
172
+ const lowerValue = value.toLowerCase();
173
+ if (CSSValueFormatter.getGlobal(lowerValue) || lowerValue === 'ltr' || lowerValue === 'rtl') {
174
+ return { direction: { value: lowerValue, important } };
175
+ }
176
+ return null;
177
+ }
178
+
179
+ /**
180
+ * Returns letter spacing.
181
+ *
182
+ * @param value Value.
183
+ * @param important Important.
184
+ * @returns Property values
185
+ */
186
+ public static getLetterSpacing(value: string, important: boolean): ICSSPropertyMap | null {
187
+ const parsedValue =
188
+ CSSVariableFormatter.getVariable(value) ||
189
+ CSSValueFormatter.getGlobal(value) ||
190
+ CSSValueFormatter.getContentMeasurement(value);
191
+ return parsedValue ? { 'letter-spacing': { value: parsedValue, important } } : null;
192
+ }
193
+
194
+ /**
195
+ * Returns word spacing.
196
+ *
197
+ * @param value Value.
198
+ * @param important Important.
199
+ * @returns Property values
200
+ */
201
+ public static getWordSpacing(value: string, important: boolean): ICSSPropertyMap | null {
202
+ const parsedValue =
203
+ CSSVariableFormatter.getVariable(value) ||
204
+ CSSValueFormatter.getGlobal(value) ||
205
+ CSSValueFormatter.getContentMeasurement(value);
206
+ return parsedValue ? { 'word-spacing': { value: parsedValue, important } } : null;
207
+ }
208
+
209
+ /**
210
+ * Returns text indent.
211
+ *
212
+ * @param value Value.
213
+ * @param important Important.
214
+ * @returns Property values
215
+ */
216
+ public static getTextIndent(value: string, important: boolean): ICSSPropertyMap | null {
217
+ const parsedValue =
218
+ CSSVariableFormatter.getVariable(value) ||
219
+ CSSValueFormatter.getGlobal(value) ||
220
+ CSSValueFormatter.getContentMeasurement(value);
221
+ return parsedValue ? { 'text-indent': { value: parsedValue, important } } : null;
222
+ }
223
+
224
+ /**
225
+ * Returns width.
226
+ *
227
+ * @param value Value.
228
+ * @param important Important.
229
+ * @returns Property values
230
+ */
231
+ public static getWidth(value: string, important: boolean): ICSSPropertyMap | null {
232
+ const parsedValue =
233
+ CSSVariableFormatter.getVariable(value) ||
234
+ CSSValueFormatter.getGlobal(value) ||
235
+ CSSValueFormatter.getContentMeasurement(value);
236
+ return parsedValue ? { width: { value: parsedValue, important } } : null;
237
+ }
238
+
239
+ /**
240
+ * Returns height.
241
+ *
242
+ * @param value Value.
243
+ * @param important Important.
244
+ * @returns Property values
245
+ */
246
+ public static getHeight(value: string, important: boolean): ICSSPropertyMap | null {
247
+ const parsedValue =
248
+ CSSVariableFormatter.getVariable(value) ||
249
+ CSSValueFormatter.getGlobal(value) ||
250
+ CSSValueFormatter.getContentMeasurement(value);
251
+ return parsedValue ? { height: { value: parsedValue, important } } : null;
252
+ }
253
+
254
+ /**
255
+ * Returns top.
256
+ *
257
+ * @param value Value.
258
+ * @param important Important.
259
+ * @returns Property values
260
+ */
261
+ public static getTop(value: string, important: boolean): ICSSPropertyMap | null {
262
+ const parsedValue =
263
+ CSSVariableFormatter.getVariable(value) ||
264
+ CSSValueFormatter.getGlobal(value) ||
265
+ CSSValueFormatter.getContentMeasurement(value);
266
+ return parsedValue ? { top: { value: parsedValue, important } } : null;
267
+ }
268
+
269
+ /**
270
+ * Returns top.
271
+ *
272
+ * @param value Value.
273
+ * @param important Important.
274
+ * @returns Property values
275
+ */
276
+ public static getRight(value: string, important: boolean): ICSSPropertyMap | null {
277
+ const parsedValue =
278
+ CSSVariableFormatter.getVariable(value) ||
279
+ CSSValueFormatter.getGlobal(value) ||
280
+ CSSValueFormatter.getContentMeasurement(value);
281
+ return parsedValue ? { right: { value: parsedValue, important } } : null;
282
+ }
283
+
284
+ /**
285
+ * Returns top.
286
+ *
287
+ * @param value Value.
288
+ * @param important Important.
289
+ * @returns Property values
290
+ */
291
+ public static getBottom(value: string, important: boolean): ICSSPropertyMap | null {
292
+ const parsedValue =
293
+ CSSVariableFormatter.getVariable(value) ||
294
+ CSSValueFormatter.getGlobal(value) ||
295
+ CSSValueFormatter.getContentMeasurement(value);
296
+ return parsedValue ? { bottom: { value: parsedValue, important } } : null;
297
+ }
298
+
299
+ /**
300
+ * Returns top.
301
+ *
302
+ * @param value Value.
303
+ * @param important Important.
304
+ * @returns Property values
305
+ */
306
+ public static getLeft(value: string, important: boolean): ICSSPropertyMap | null {
307
+ const parsedValue =
308
+ CSSVariableFormatter.getVariable(value) ||
309
+ CSSValueFormatter.getGlobal(value) ||
310
+ CSSValueFormatter.getContentMeasurement(value);
311
+ return parsedValue ? { left: { value: parsedValue, important } } : null;
312
+ }
313
+
314
+ /**
315
+ * Returns clear.
316
+ *
317
+ * @param value Value.
318
+ * @param important Important.
319
+ * @returns Property values
320
+ */
321
+ public static getClear(value: string, important: boolean): ICSSPropertyMap | null {
322
+ const variable = CSSVariableFormatter.getVariable(value);
323
+ if (variable) {
324
+ return { clear: { value: variable, important } };
325
+ }
326
+ const lowerValue = value.toLowerCase();
327
+ if (CSSValueFormatter.getGlobal(lowerValue) || CLEAR.includes(lowerValue)) {
328
+ return { clear: { value: lowerValue, important } };
329
+ }
330
+ return null;
331
+ }
332
+
333
+ /**
334
+ * Returns clip
335
+ *
336
+ * Based on:
337
+ * https://github.com/jsdom/cssstyle/blob/master/lib/properties/clip.js
338
+ *
339
+ * @param value Value.
340
+ * @param important Important.
341
+ * @returns Property values
342
+ */
343
+ public static getClip(value: string, important: boolean): ICSSPropertyMap | null {
344
+ const variable = CSSVariableFormatter.getVariable(value);
345
+ if (variable) {
346
+ return { clip: { value: variable, important } };
347
+ }
348
+ const lowerValue = value.toLowerCase();
349
+ if (CSSValueFormatter.getGlobal(lowerValue) || lowerValue === 'auto') {
350
+ return { clip: { value: lowerValue, important } };
351
+ }
352
+ const matches = lowerValue.match(RECT_REGEXP);
353
+ if (!matches) {
354
+ return null;
355
+ }
356
+ const parts = matches[1].split(/\s*,\s*/);
357
+ if (parts.length !== 4) {
358
+ return null;
359
+ }
360
+ for (const part of parts) {
361
+ if (!CSSValueFormatter.getMeasurement(part)) {
362
+ return null;
363
+ }
364
+ }
365
+ return { clip: { value, important } };
366
+ }
367
+
368
+ /**
369
+ * Returns float.
370
+ *
371
+ * @param value Value.
372
+ * @param important Important.
373
+ * @returns Property values
374
+ */
375
+ public static getFloat(value: string, important: boolean): ICSSPropertyMap | null {
376
+ const variable = CSSVariableFormatter.getVariable(value);
377
+ if (variable) {
378
+ return { float: { value: variable, important } };
379
+ }
380
+ const lowerValue = value.toLowerCase();
381
+ if (CSSValueFormatter.getGlobal(lowerValue) || FLOAT.includes(lowerValue)) {
382
+ return { float: { value: lowerValue, important } };
383
+ }
384
+ return null;
385
+ }
386
+
387
+ /**
388
+ * Returns float.
389
+ *
390
+ * @param value Value.
391
+ * @param important Important.
392
+ * @returns Property values
393
+ */
394
+ public static getCSSFloat(value: string, important: boolean): ICSSPropertyMap | null {
395
+ const variable = CSSVariableFormatter.getVariable(value);
396
+ if (variable) {
397
+ return { 'css-float': { value: variable, important } };
398
+ }
399
+ const float = this.getFloat(value, important);
400
+ return float ? { 'css-float': float['float'] } : null;
401
+ }
402
+
403
+ /**
404
+ * Returns outline.
405
+ *
406
+ * @param value Value.
407
+ * @param important Important.
408
+ * @returns Property values.
409
+ */
410
+ public static getOutline(
411
+ value: string,
412
+ important: boolean
413
+ ): { [key: string]: ICSSPropertyValue } | null {
414
+ const variable = CSSVariableFormatter.getVariable(value);
415
+ if (variable) {
416
+ return { outline: { value: variable, important } };
417
+ }
418
+
419
+ const globalValue = CSSValueFormatter.getGlobal(value);
420
+
421
+ if (globalValue) {
422
+ return {
423
+ ...this.getOutlineColor(globalValue, important),
424
+ ...this.getOutlineStyle(globalValue, important),
425
+ ...this.getOutlineWidth(globalValue, important)
426
+ };
427
+ }
428
+
429
+ const properties = {
430
+ ...this.getOutlineColor('initial', important),
431
+ ...this.getOutlineStyle('initial', important),
432
+ ...this.getOutlineWidth('initial', important)
433
+ };
434
+
435
+ const parts = value.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
436
+
437
+ for (const part of parts) {
438
+ const width = this.getOutlineWidth(part, important);
439
+ const style = this.getOutlineStyle(part, important);
440
+ const color = this.getOutlineColor(part, important);
441
+
442
+ if (width === null && style === null && color === null) {
443
+ return null;
444
+ }
445
+
446
+ Object.assign(properties, width, style, color);
447
+ }
448
+
449
+ return properties;
450
+ }
451
+
452
+ /**
453
+ * Returns outline color.
454
+ *
455
+ * @param value Value.
456
+ * @param important Important.
457
+ * @returns Property values
458
+ */
459
+ public static getOutlineColor(value: string, important: boolean): ICSSPropertyMap | null {
460
+ const color =
461
+ CSSVariableFormatter.getVariable(value) ||
462
+ CSSValueFormatter.getGlobal(value) ||
463
+ CSSValueFormatter.getColor(value);
464
+ return color
465
+ ? {
466
+ 'outline-color': { value: color, important }
467
+ }
468
+ : null;
469
+ }
470
+
471
+ /**
472
+ * Returns outline offset.
473
+ *
474
+ * @param value Value.
475
+ * @param important Important.
476
+ * @returns Property values
477
+ */
478
+ public static getOutlineOffset(value: string, important: boolean): ICSSPropertyMap | null {
479
+ const parsedValue =
480
+ CSSVariableFormatter.getVariable(value) || CSSValueFormatter.getLength(value);
481
+ return parsedValue ? { 'outline-offset': { value: parsedValue, important } } : null;
482
+ }
483
+
484
+ /**
485
+ * Returns outline style.
486
+ *
487
+ * @param value Value.
488
+ * @param important Important.
489
+ * @returns Property values
490
+ */
491
+ public static getOutlineStyle(value: string, important: boolean): ICSSPropertyMap | null {
492
+ const variable = CSSVariableFormatter.getVariable(value);
493
+ if (variable) {
494
+ return { 'outline-style': { value: variable, important } };
495
+ }
496
+
497
+ const lowerValue = value.toLowerCase();
498
+ if (CSSValueFormatter.getGlobal(lowerValue) || BORDER_STYLE.includes(lowerValue)) {
499
+ return {
500
+ 'outline-style': { value: lowerValue, important }
501
+ };
502
+ }
503
+ return null;
504
+ }
505
+
506
+ /**
507
+ * Returns outline width.
508
+ *
509
+ * @param value Value.
510
+ * @param important Important.
511
+ * @returns Property values
512
+ */
513
+ public static getOutlineWidth(value: string, important: boolean): ICSSPropertyMap | null {
514
+ const variable = CSSVariableFormatter.getVariable(value);
515
+ if (variable) {
516
+ return { 'outline-width': { value: variable, important } };
517
+ }
518
+
519
+ const lowerValue = value.toLowerCase();
520
+ const parsedValue =
521
+ BORDER_WIDTH.includes(lowerValue) || CSSValueFormatter.getGlobal(lowerValue)
522
+ ? lowerValue
523
+ : CSSValueFormatter.getLength(value);
524
+ if (parsedValue) {
525
+ return {
526
+ 'outline-width': { value: parsedValue, important }
527
+ };
528
+ }
529
+ return null;
530
+ }
531
+
532
+ /**
533
+ * Returns border.
534
+ *
535
+ * @param value Value.
536
+ * @param important Important.
537
+ * @returns Property values.
538
+ */
539
+ public static getBorder(
540
+ value: string,
541
+ important: boolean
542
+ ): { [key: string]: ICSSPropertyValue } | null {
543
+ const variable = CSSVariableFormatter.getVariable(value);
544
+ if (variable) {
545
+ return { border: { value: variable, important } };
546
+ }
547
+
548
+ const globalValue = CSSValueFormatter.getGlobal(value);
549
+
550
+ if (globalValue) {
551
+ return {
552
+ ...this.getBorderWidth(globalValue, important),
553
+ ...this.getBorderStyle(globalValue, important),
554
+ ...this.getBorderColor(globalValue, important),
555
+ ...this.getBorderImage(globalValue, important)
556
+ };
557
+ }
558
+
559
+ const properties = {
560
+ ...this.getBorderWidth('initial', important),
561
+ ...this.getBorderStyle('initial', important),
562
+ ...this.getBorderColor('initial', important),
563
+ ...this.getBorderImage('initial', important)
564
+ };
565
+
566
+ const parts = value
567
+ .replace(/\s*,\s*/g, ',')
568
+ .split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
569
+
570
+ for (const part of parts) {
571
+ const width = this.getBorderWidth(part, important);
572
+ const style = this.getBorderStyle(part, important);
573
+ const color = this.getBorderColor(part, important);
574
+
575
+ if (width === null && style === null && color === null) {
576
+ return null;
577
+ }
578
+
579
+ Object.assign(properties, width, style, color);
580
+ }
581
+
582
+ return properties;
583
+ }
584
+
585
+ /**
586
+ * Returns border width.
587
+ *
588
+ * @param value Value.
589
+ * @param important Important.
590
+ * @returns Property values
591
+ */
592
+ public static getBorderWidth(value: string, important: boolean): ICSSPropertyMap | null {
593
+ const variable = CSSVariableFormatter.getVariable(value);
594
+ if (variable) {
595
+ return { 'border-width': { value: variable, important } };
596
+ }
597
+
598
+ const globalValue = CSSValueFormatter.getGlobal(value);
599
+
600
+ if (globalValue) {
601
+ return {
602
+ ...this.getBorderTopWidth(globalValue, important),
603
+ ...this.getBorderRightWidth(globalValue, important),
604
+ ...this.getBorderBottomWidth(globalValue, important),
605
+ ...this.getBorderLeftWidth(globalValue, important)
606
+ };
607
+ }
608
+
609
+ const parts = value.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
610
+ const top = this.getBorderTopWidth(parts[0], important);
611
+ const right = this.getBorderRightWidth(parts[1] || parts[0], important);
612
+ const bottom = this.getBorderBottomWidth(parts[2] || parts[0], important);
613
+ const left = this.getBorderLeftWidth(parts[3] || parts[1] || parts[0], important);
614
+
615
+ if (!top || !right || !bottom || !left) {
616
+ return null;
617
+ }
618
+
619
+ return {
620
+ ...top,
621
+ ...right,
622
+ ...bottom,
623
+ ...left
624
+ };
625
+ }
626
+ /**
627
+ * Returns border style.
628
+ *
629
+ * @param value Value.
630
+ * @param important Important.
631
+ * @returns Property values
632
+ */
633
+ public static getBorderStyle(value: string, important: boolean): ICSSPropertyMap | null {
634
+ const variable = CSSVariableFormatter.getVariable(value);
635
+ if (variable) {
636
+ return { 'border-style': { value: variable, important } };
637
+ }
638
+
639
+ const globalValue = CSSValueFormatter.getGlobal(value);
640
+
641
+ if (globalValue) {
642
+ return {
643
+ ...this.getBorderTopStyle(globalValue, important),
644
+ ...this.getBorderRightStyle(globalValue, important),
645
+ ...this.getBorderBottomStyle(globalValue, important),
646
+ ...this.getBorderLeftStyle(globalValue, important)
647
+ };
648
+ }
649
+
650
+ const parts = value.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
651
+ const top = this.getBorderTopStyle(parts[0], important);
652
+ const right = this.getBorderRightStyle(parts[1] || parts[0], important);
653
+ const bottom = this.getBorderBottomStyle(parts[2] || parts[0], important);
654
+ const left = this.getBorderLeftStyle(parts[3] || parts[1] || parts[0], important);
655
+
656
+ if (!top || !right || !bottom || !left) {
657
+ return null;
658
+ }
659
+
660
+ return {
661
+ ...top,
662
+ ...right,
663
+ ...bottom,
664
+ ...left
665
+ };
666
+ }
667
+
668
+ /**
669
+ * Returns border color.
670
+ *
671
+ * @param value Value.
672
+ * @param important Important.
673
+ * @returns Property values
674
+ */
675
+ public static getBorderColor(value: string, important: boolean): ICSSPropertyMap | null {
676
+ const variable = CSSVariableFormatter.getVariable(value);
677
+ if (variable) {
678
+ return { 'border-color': { value: variable, important } };
679
+ }
680
+
681
+ const globalValue = CSSValueFormatter.getGlobal(value);
682
+
683
+ if (globalValue) {
684
+ return {
685
+ ...this.getBorderTopColor(globalValue, important),
686
+ ...this.getBorderRightColor(globalValue, important),
687
+ ...this.getBorderBottomColor(globalValue, important),
688
+ ...this.getBorderLeftColor(globalValue, important)
689
+ };
690
+ }
691
+
692
+ const parts = value.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
693
+ const top = this.getBorderTopColor(parts[0], important);
694
+ const right = this.getBorderRightColor(parts[1] || parts[0], important);
695
+ const bottom = this.getBorderBottomColor(parts[2] || parts[0], important);
696
+ const left = this.getBorderLeftColor(parts[3] || parts[1] || parts[0], important);
697
+
698
+ if (!top || !right || !bottom || !left) {
699
+ return null;
700
+ }
701
+
702
+ return {
703
+ ...top,
704
+ ...right,
705
+ ...bottom,
706
+ ...left
707
+ };
708
+ }
709
+
710
+ /**
711
+ * Returns border image.
712
+ *
713
+ * @param value Value.
714
+ * @param important Important.
715
+ * @returns Property values
716
+ */
717
+ public static getBorderImage(value: string, important: boolean): ICSSPropertyMap | null {
718
+ const variable = CSSVariableFormatter.getVariable(value);
719
+ if (variable) {
720
+ return { 'border-image': { value: variable, important } };
721
+ }
722
+
723
+ const globalValue = CSSValueFormatter.getGlobal(value);
724
+
725
+ if (globalValue) {
726
+ return {
727
+ ...this.getBorderImageSource(globalValue, important),
728
+ ...this.getBorderImageSlice(globalValue, important),
729
+ ...this.getBorderImageWidth(globalValue, important),
730
+ ...this.getBorderImageOutset(globalValue, important),
731
+ ...this.getBorderImageRepeat(globalValue, important)
732
+ };
733
+ }
734
+
735
+ let parsedValue = value.replace(/\s\/\s/g, '/');
736
+ const sourceMatch = parsedValue.match(/\s*([a-zA-Z-]+\([^)]*\))\s*/);
737
+
738
+ if (sourceMatch) {
739
+ parsedValue = parsedValue.replace(sourceMatch[0], '');
740
+ }
741
+
742
+ const parts = parsedValue.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
743
+
744
+ if (sourceMatch) {
745
+ parts.push(sourceMatch[1]);
746
+ }
747
+
748
+ const properties = {
749
+ ...this.getBorderImageSource('none', important),
750
+ ...this.getBorderImageSlice('100%', important),
751
+ ...this.getBorderImageWidth('1', important),
752
+ ...this.getBorderImageOutset('0', important),
753
+ ...this.getBorderImageRepeat('stretch', important)
754
+ };
755
+
756
+ for (let i = 0, max = parts.length; i < max; i++) {
757
+ const part = parts[i];
758
+ const previousPart = i > 0 ? parts[i - 1] : '';
759
+
760
+ if (!part.startsWith('url') && part.includes('/')) {
761
+ const [slice, width, outset] = part.split('/');
762
+ const borderImageSlice =
763
+ this.getBorderImageSlice(`${previousPart} ${slice}`, important) ||
764
+ this.getBorderImageSlice(slice, important);
765
+ const borderImageWidth = this.getBorderImageWidth(width, important);
766
+ const borderImageOutset = outset && this.getBorderImageOutset(outset, important);
767
+
768
+ if (!borderImageSlice || !borderImageWidth || borderImageOutset === null) {
769
+ return null;
770
+ }
771
+
772
+ Object.assign(properties, borderImageSlice, borderImageWidth, borderImageOutset);
773
+ } else {
774
+ const slice =
775
+ this.getBorderImageSlice(`${previousPart} ${part}`, important) ||
776
+ this.getBorderImageSlice(part, important);
777
+ const source = this.getBorderImageSource(part, important);
778
+ const repeat = this.getBorderImageRepeat(part, important);
779
+
780
+ if (!slice && !source && !repeat) {
781
+ return null;
782
+ }
783
+
784
+ Object.assign(properties, slice, source, repeat);
785
+ }
786
+ }
787
+
788
+ return properties;
789
+ }
790
+
791
+ /**
792
+ * Returns border source.
793
+ *
794
+ * @param value Value.
795
+ * @param important Important.
796
+ * @returns Property values
797
+ */
798
+ public static getBorderImageSource(value: string, important: boolean): ICSSPropertyMap | null {
799
+ const variable = CSSVariableFormatter.getVariable(value);
800
+ if (variable) {
801
+ return { 'border-image-source': { value: variable, important } };
802
+ }
803
+
804
+ const lowerValue = value.toLowerCase();
805
+
806
+ if (CSSValueFormatter.getGlobal(lowerValue) || lowerValue === 'none') {
807
+ return {
808
+ 'border-image-source': {
809
+ important,
810
+ value: lowerValue
811
+ }
812
+ };
813
+ }
814
+
815
+ const parsedValue = CSSValueFormatter.getURL(value) || CSSValueFormatter.getGradient(value);
816
+
817
+ if (!parsedValue) {
818
+ return null;
819
+ }
820
+
821
+ return {
822
+ 'border-image-source': {
823
+ important,
824
+ value: parsedValue
825
+ }
826
+ };
827
+ }
828
+
829
+ /**
830
+ * Returns border slice.
831
+ *
832
+ * @param value Value.
833
+ * @param important Important.
834
+ * @returns Property values
835
+ */
836
+ public static getBorderImageSlice(value: string, important: boolean): ICSSPropertyMap | null {
837
+ const variable = CSSVariableFormatter.getVariable(value);
838
+ if (variable) {
839
+ return { 'border-image-slice': { value: variable, important } };
840
+ }
841
+
842
+ const lowerValue = value.toLowerCase();
843
+
844
+ if (CSSValueFormatter.getGlobal(lowerValue)) {
845
+ return {
846
+ 'border-image-slice': {
847
+ important,
848
+ value: lowerValue
849
+ }
850
+ };
851
+ }
852
+
853
+ if (lowerValue !== lowerValue.trim()) {
854
+ return null;
855
+ }
856
+
857
+ const regexp = /(fill)|(calc\([^^)]+\))|([0-9]+%)|([0-9]+)/g;
858
+ const values = [];
859
+ let match;
860
+
861
+ while ((match = regexp.exec(lowerValue))) {
862
+ const previousCharacter = lowerValue[match.index - 1];
863
+ const nextCharacter = lowerValue[match.index + match[0].length];
864
+
865
+ if (
866
+ (previousCharacter && previousCharacter !== ' ') ||
867
+ (nextCharacter && nextCharacter !== ' ')
868
+ ) {
869
+ return null;
870
+ }
871
+
872
+ const fill = match[1] && 'fill';
873
+ const calc = match[2] && CSSValueFormatter.getCalc(match[2]);
874
+ const percentage = match[3] && CSSValueFormatter.getPercentage(match[3]);
875
+ const integer = match[4] && CSSValueFormatter.getInteger(match[4]);
876
+
877
+ if (!fill && !calc && !percentage && !integer) {
878
+ return null;
879
+ }
880
+
881
+ values.push(fill || calc || percentage || integer);
882
+ }
883
+
884
+ if (!values.length || values.length > 4) {
885
+ return null;
886
+ }
887
+
888
+ return {
889
+ 'border-image-slice': {
890
+ important,
891
+ value: values.join(' ')
892
+ }
893
+ };
894
+ }
895
+
896
+ /**
897
+ * Returns border width.
898
+ *
899
+ * @param value Value.
900
+ * @param important Important.
901
+ * @returns Property values
902
+ */
903
+ public static getBorderImageWidth(value: string, important: boolean): ICSSPropertyMap | null {
904
+ const variable = CSSVariableFormatter.getVariable(value);
905
+ if (variable) {
906
+ return { 'border-image-width': { value: variable, important } };
907
+ }
908
+
909
+ const lowerValue = value.toLowerCase();
910
+
911
+ if (CSSValueFormatter.getGlobal(lowerValue)) {
912
+ return {
913
+ 'border-image-width': {
914
+ important,
915
+ value: lowerValue
916
+ }
917
+ };
918
+ }
919
+
920
+ const parts = lowerValue.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
921
+
922
+ if (parts.length > 4) {
923
+ return null;
924
+ }
925
+
926
+ for (const part of parts) {
927
+ if (!CSSValueFormatter.getInteger(part) && !CSSValueFormatter.getAutoMeasurement(part)) {
928
+ return null;
929
+ }
930
+ }
931
+
932
+ return {
933
+ 'border-image-width': {
934
+ important,
935
+ value
936
+ }
937
+ };
938
+ }
939
+
940
+ /**
941
+ * Returns border outset.
942
+ *
943
+ * @param value Value.
944
+ * @param important Important.
945
+ * @returns Property values
946
+ */
947
+ public static getBorderImageOutset(value: string, important: boolean): ICSSPropertyMap | null {
948
+ if (value === '0') {
949
+ return {
950
+ 'border-image-outset': {
951
+ important,
952
+ value
953
+ }
954
+ };
955
+ }
956
+
957
+ const variable = CSSVariableFormatter.getVariable(value);
958
+ if (variable) {
959
+ return { 'border-image-outset': { value: variable, important } };
960
+ }
961
+
962
+ const lowerValue = value.toLowerCase();
963
+
964
+ if (CSSValueFormatter.getGlobal(lowerValue)) {
965
+ return {
966
+ 'border-image-outset': {
967
+ important,
968
+ value: lowerValue
969
+ }
970
+ };
971
+ }
972
+
973
+ const parts = value.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
974
+
975
+ if (parts.length > 4) {
976
+ return null;
977
+ }
978
+
979
+ const newParts = [];
980
+
981
+ for (const part of parts) {
982
+ const parsedValue = CSSValueFormatter.getLength(part) || CSSValueFormatter.getFloat(part);
983
+ if (!parsedValue) {
984
+ return null;
985
+ }
986
+ newParts.push(parsedValue === '0px' ? '0' : parsedValue);
987
+ }
988
+
989
+ return {
990
+ 'border-image-outset': {
991
+ important,
992
+ value: newParts.join(' ')
993
+ }
994
+ };
995
+ }
996
+
997
+ /**
998
+ * Returns border repeat.
999
+ *
1000
+ * @param value Value.
1001
+ * @param important Important.
1002
+ * @returns Property values
1003
+ */
1004
+ public static getBorderImageRepeat(value: string, important: boolean): ICSSPropertyMap | null {
1005
+ const variable = CSSVariableFormatter.getVariable(value);
1006
+ if (variable) {
1007
+ return { 'border-image-repeat': { value: variable, important } };
1008
+ }
1009
+
1010
+ const lowerValue = value.toLowerCase();
1011
+
1012
+ if (CSSValueFormatter.getGlobal(lowerValue)) {
1013
+ return {
1014
+ 'border-image-repeat': {
1015
+ important,
1016
+ value: lowerValue
1017
+ }
1018
+ };
1019
+ }
1020
+
1021
+ const parts = lowerValue.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
1022
+
1023
+ if (parts.length > 2) {
1024
+ return null;
1025
+ }
1026
+
1027
+ for (const part of parts) {
1028
+ if (!BORDER_IMAGE_REPEAT.includes(part)) {
1029
+ return null;
1030
+ }
1031
+ }
1032
+
1033
+ return {
1034
+ 'border-image-repeat': {
1035
+ important,
1036
+ value
1037
+ }
1038
+ };
1039
+ }
1040
+
1041
+ /**
1042
+ * Returns border width.
1043
+ *
1044
+ * @param value Value.
1045
+ * @param important Important.
1046
+ * @returns Property values
1047
+ */
1048
+ public static getBorderTopWidth(value: string, important: boolean): ICSSPropertyMap | null {
1049
+ const variable = CSSVariableFormatter.getVariable(value);
1050
+ if (variable) {
1051
+ return { 'border-top-width': { value: variable, important } };
1052
+ }
1053
+
1054
+ const lowerValue = value.toLowerCase();
1055
+ const parsedValue =
1056
+ BORDER_WIDTH.includes(lowerValue) || CSSValueFormatter.getGlobal(lowerValue)
1057
+ ? lowerValue
1058
+ : CSSValueFormatter.getLength(value);
1059
+ if (parsedValue) {
1060
+ return {
1061
+ 'border-top-width': { value: parsedValue, important }
1062
+ };
1063
+ }
1064
+ return null;
1065
+ }
1066
+
1067
+ /**
1068
+ * Returns border width.
1069
+ *
1070
+ * @param value Value.
1071
+ * @param important Important.
1072
+ * @returns Property values
1073
+ */
1074
+ public static getBorderRightWidth(value: string, important: boolean): ICSSPropertyMap | null {
1075
+ const variable = CSSVariableFormatter.getVariable(value);
1076
+ if (variable) {
1077
+ return { 'border-right-width': { value: variable, important } };
1078
+ }
1079
+
1080
+ const lowerValue = value.toLowerCase();
1081
+ const parsedValue =
1082
+ BORDER_WIDTH.includes(lowerValue) || CSSValueFormatter.getGlobal(lowerValue)
1083
+ ? lowerValue
1084
+ : CSSValueFormatter.getLength(value);
1085
+ if (parsedValue) {
1086
+ return {
1087
+ 'border-right-width': { value: parsedValue, important }
1088
+ };
1089
+ }
1090
+ return null;
1091
+ }
1092
+
1093
+ /**
1094
+ * Returns border width.
1095
+ *
1096
+ * @param value Value.
1097
+ * @param important Important.
1098
+ * @returns Property values
1099
+ */
1100
+ public static getBorderBottomWidth(value: string, important: boolean): ICSSPropertyMap | null {
1101
+ const variable = CSSVariableFormatter.getVariable(value);
1102
+ if (variable) {
1103
+ return { 'border-bottom-width': { value: variable, important } };
1104
+ }
1105
+
1106
+ const lowerValue = value.toLowerCase();
1107
+ const parsedValue =
1108
+ BORDER_WIDTH.includes(lowerValue) || CSSValueFormatter.getGlobal(lowerValue)
1109
+ ? lowerValue
1110
+ : CSSValueFormatter.getLength(value);
1111
+ if (parsedValue) {
1112
+ return {
1113
+ 'border-bottom-width': { value: parsedValue, important }
1114
+ };
1115
+ }
1116
+ return null;
1117
+ }
1118
+
1119
+ /**
1120
+ * Returns border width.
1121
+ *
1122
+ * @param value Value.
1123
+ * @param important Important.
1124
+ * @returns Property values
1125
+ */
1126
+ public static getBorderLeftWidth(value: string, important: boolean): ICSSPropertyMap | null {
1127
+ const variable = CSSVariableFormatter.getVariable(value);
1128
+ if (variable) {
1129
+ return { 'border-left-width': { value: variable, important } };
1130
+ }
1131
+
1132
+ const lowerValue = value.toLowerCase();
1133
+ const parsedValue =
1134
+ BORDER_WIDTH.includes(lowerValue) || CSSValueFormatter.getGlobal(lowerValue)
1135
+ ? lowerValue
1136
+ : CSSValueFormatter.getLength(value);
1137
+ if (parsedValue) {
1138
+ return {
1139
+ 'border-left-width': { value: parsedValue, important }
1140
+ };
1141
+ }
1142
+ return null;
1143
+ }
1144
+
1145
+ /**
1146
+ * Returns border style.
1147
+ *
1148
+ * @param value Value.
1149
+ * @param important Important.
1150
+ * @returns Property values
1151
+ */
1152
+ public static getBorderTopStyle(value: string, important: boolean): ICSSPropertyMap | null {
1153
+ const variable = CSSVariableFormatter.getVariable(value);
1154
+ if (variable) {
1155
+ return { 'border-top-style': { value: variable, important } };
1156
+ }
1157
+
1158
+ const lowerValue = value.toLowerCase();
1159
+ if (CSSValueFormatter.getGlobal(lowerValue) || BORDER_STYLE.includes(lowerValue)) {
1160
+ return {
1161
+ 'border-top-style': { value: lowerValue, important }
1162
+ };
1163
+ }
1164
+ return null;
1165
+ }
1166
+
1167
+ /**
1168
+ * Returns border style.
1169
+ *
1170
+ * @param value Value.
1171
+ * @param important Important.
1172
+ * @returns Property values
1173
+ */
1174
+ public static getBorderRightStyle(value: string, important: boolean): ICSSPropertyMap | null {
1175
+ const variable = CSSVariableFormatter.getVariable(value);
1176
+ if (variable) {
1177
+ return { 'border-right-style': { value: variable, important } };
1178
+ }
1179
+
1180
+ const lowerValue = value.toLowerCase();
1181
+ if (CSSValueFormatter.getGlobal(lowerValue) || BORDER_STYLE.includes(lowerValue)) {
1182
+ return {
1183
+ 'border-right-style': { value: lowerValue, important }
1184
+ };
1185
+ }
1186
+ return null;
1187
+ }
1188
+
1189
+ /**
1190
+ * Returns border style.
1191
+ *
1192
+ * @param value Value.
1193
+ * @param important Important.
1194
+ * @returns Property values
1195
+ */
1196
+ public static getBorderBottomStyle(value: string, important: boolean): ICSSPropertyMap | null {
1197
+ const variable = CSSVariableFormatter.getVariable(value);
1198
+ if (variable) {
1199
+ return { 'border-bottom-style': { value: variable, important } };
1200
+ }
1201
+
1202
+ const lowerValue = value.toLowerCase();
1203
+ if (CSSValueFormatter.getGlobal(lowerValue) || BORDER_STYLE.includes(lowerValue)) {
1204
+ return {
1205
+ 'border-bottom-style': { value: lowerValue, important }
1206
+ };
1207
+ }
1208
+ return null;
1209
+ }
1210
+
1211
+ /**
1212
+ * Returns border style.
1213
+ *
1214
+ * @param value Value.
1215
+ * @param important Important.
1216
+ * @returns Property values
1217
+ */
1218
+ public static getBorderLeftStyle(value: string, important: boolean): ICSSPropertyMap | null {
1219
+ const variable = CSSVariableFormatter.getVariable(value);
1220
+ if (variable) {
1221
+ return { 'border-left-style': { value: variable, important } };
1222
+ }
1223
+
1224
+ const lowerValue = value.toLowerCase();
1225
+ if (CSSValueFormatter.getGlobal(lowerValue) || BORDER_STYLE.includes(lowerValue)) {
1226
+ return {
1227
+ 'border-left-style': { value: lowerValue, important }
1228
+ };
1229
+ }
1230
+ return null;
1231
+ }
1232
+
1233
+ /**
1234
+ * Returns border color.
1235
+ *
1236
+ * @param value Value.
1237
+ * @param important Important.
1238
+ * @returns Property values
1239
+ */
1240
+ public static getBorderTopColor(value: string, important: boolean): ICSSPropertyMap | null {
1241
+ const variable = CSSVariableFormatter.getVariable(value);
1242
+ if (variable) {
1243
+ return { 'border-top-color': { value: variable, important } };
1244
+ }
1245
+
1246
+ const color = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getColor(value);
1247
+ return color
1248
+ ? {
1249
+ 'border-top-color': { value: color, important }
1250
+ }
1251
+ : null;
1252
+ }
1253
+
1254
+ /**
1255
+ * Returns border color.
1256
+ *
1257
+ * @param value Value.
1258
+ * @param important Important.
1259
+ * @returns Property values
1260
+ */
1261
+ public static getBorderRightColor(value: string, important: boolean): ICSSPropertyMap | null {
1262
+ const variable = CSSVariableFormatter.getVariable(value);
1263
+ if (variable) {
1264
+ return { 'border-right-color': { value: variable, important } };
1265
+ }
1266
+
1267
+ const color = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getColor(value);
1268
+ return color
1269
+ ? {
1270
+ 'border-right-color': { value: color, important }
1271
+ }
1272
+ : null;
1273
+ }
1274
+
1275
+ /**
1276
+ * Returns border color.
1277
+ *
1278
+ * @param value Value.
1279
+ * @param important Important.
1280
+ * @returns Property values
1281
+ */
1282
+ public static getBorderBottomColor(value: string, important: boolean): ICSSPropertyMap | null {
1283
+ const variable = CSSVariableFormatter.getVariable(value);
1284
+ if (variable) {
1285
+ return { 'border-bottom-color': { value: variable, important } };
1286
+ }
1287
+
1288
+ const color = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getColor(value);
1289
+ return color
1290
+ ? {
1291
+ 'border-bottom-color': { value: color, important }
1292
+ }
1293
+ : null;
1294
+ }
1295
+
1296
+ /**
1297
+ * Returns border color.
1298
+ *
1299
+ * @param value Value.
1300
+ * @param important Important.
1301
+ * @returns Property values
1302
+ */
1303
+ public static getBorderLeftColor(value: string, important: boolean): ICSSPropertyMap | null {
1304
+ const variable = CSSVariableFormatter.getVariable(value);
1305
+ if (variable) {
1306
+ return { 'border-left-color': { value: variable, important } };
1307
+ }
1308
+
1309
+ const color = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getColor(value);
1310
+ return color
1311
+ ? {
1312
+ 'border-left-color': { value: color, important }
1313
+ }
1314
+ : null;
1315
+ }
1316
+
1317
+ /**
1318
+ * Returns border radius.
1319
+ *
1320
+ * @param value Value.
1321
+ * @param important Important.
1322
+ * @returns Property values.
1323
+ */
1324
+ public static getBorderRadius(
1325
+ value: string,
1326
+ important: boolean
1327
+ ): { [key: string]: ICSSPropertyValue } | null {
1328
+ const variable = CSSVariableFormatter.getVariable(value);
1329
+ if (variable) {
1330
+ return { 'border-radius': { value: variable, important } };
1331
+ }
1332
+
1333
+ const globalValue = CSSValueFormatter.getGlobal(value);
1334
+
1335
+ if (globalValue) {
1336
+ return {
1337
+ ...this.getBorderTopLeftRadius(globalValue, important),
1338
+ ...this.getBorderTopRightRadius(globalValue, important),
1339
+ ...this.getBorderBottomRightRadius(globalValue, important),
1340
+ ...this.getBorderBottomLeftRadius(globalValue, important)
1341
+ };
1342
+ }
1343
+
1344
+ const parts = value.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
1345
+ const topLeft = this.getBorderTopLeftRadius(parts[0], important);
1346
+ const topRight = this.getBorderTopRightRadius(parts[1] || parts[0], important);
1347
+ const bottomRight = this.getBorderBottomRightRadius(parts[2] || parts[0], important);
1348
+ const bottomLeft = this.getBorderBottomLeftRadius(parts[3] || parts[1] || parts[0], important);
1349
+
1350
+ if (!topLeft || !topRight || !bottomRight || !bottomLeft) {
1351
+ return null;
1352
+ }
1353
+
1354
+ return {
1355
+ ...topLeft,
1356
+ ...topRight,
1357
+ ...bottomRight,
1358
+ ...bottomLeft
1359
+ };
1360
+ }
1361
+
1362
+ /**
1363
+ * Returns border radius.
1364
+ *
1365
+ * @param value Value.
1366
+ * @param important Important.
1367
+ * @returns Property values.
1368
+ */
1369
+ public static getBorderTopLeftRadius(
1370
+ value: string,
1371
+ important: boolean
1372
+ ): { [key: string]: ICSSPropertyValue } | null {
1373
+ const variable = CSSVariableFormatter.getVariable(value);
1374
+ if (variable) {
1375
+ return { 'border-top-left-radius': { value: variable, important } };
1376
+ }
1377
+
1378
+ const radius = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getMeasurement(value);
1379
+ return radius ? { 'border-top-left-radius': { important, value: radius } } : null;
1380
+ }
1381
+
1382
+ /**
1383
+ * Returns border radius.
1384
+ *
1385
+ * @param value Value.
1386
+ * @param important Important.
1387
+ * @returns Property values.
1388
+ */
1389
+ public static getBorderTopRightRadius(
1390
+ value: string,
1391
+ important: boolean
1392
+ ): { [key: string]: ICSSPropertyValue } | null {
1393
+ const variable = CSSVariableFormatter.getVariable(value);
1394
+ if (variable) {
1395
+ return { 'border-top-right-radius': { value: variable, important } };
1396
+ }
1397
+
1398
+ const radius = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getMeasurement(value);
1399
+ return radius ? { 'border-top-right-radius': { important, value: radius } } : null;
1400
+ }
1401
+
1402
+ /**
1403
+ * Returns border radius.
1404
+ *
1405
+ * @param value Value.
1406
+ * @param important Important.
1407
+ * @returns Property values.
1408
+ */
1409
+ public static getBorderBottomRightRadius(
1410
+ value: string,
1411
+ important: boolean
1412
+ ): { [key: string]: ICSSPropertyValue } | null {
1413
+ const variable = CSSVariableFormatter.getVariable(value);
1414
+ if (variable) {
1415
+ return { 'border-bottom-right-radius': { value: variable, important } };
1416
+ }
1417
+
1418
+ const radius = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getMeasurement(value);
1419
+ return radius ? { 'border-bottom-right-radius': { important, value: radius } } : null;
1420
+ }
1421
+
1422
+ /**
1423
+ * Returns border radius.
1424
+ *
1425
+ * @param value Value.
1426
+ * @param important Important.
1427
+ * @returns Property values.
1428
+ */
1429
+ public static getBorderBottomLeftRadius(
1430
+ value: string,
1431
+ important: boolean
1432
+ ): { [key: string]: ICSSPropertyValue } | null {
1433
+ const variable = CSSVariableFormatter.getVariable(value);
1434
+ if (variable) {
1435
+ return { 'border-bottom-left-radius': { value: variable, important } };
1436
+ }
1437
+
1438
+ const radius = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getMeasurement(value);
1439
+ return radius ? { 'border-bottom-left-radius': { important, value: radius } } : null;
1440
+ }
1441
+
1442
+ /**
1443
+ * Returns border top, right, bottom or left.
1444
+ *
1445
+ * @param value Value.
1446
+ * @param important Important.
1447
+ * @returns Property values.
1448
+ */
1449
+ public static getBorderTop(
1450
+ value: string,
1451
+ important: boolean
1452
+ ): { [key: string]: ICSSPropertyValue } | null {
1453
+ const variable = CSSVariableFormatter.getVariable(value);
1454
+ if (variable) {
1455
+ return { 'border-top': { value: variable, important } };
1456
+ }
1457
+
1458
+ const globalValue = CSSValueFormatter.getGlobal(value);
1459
+
1460
+ if (globalValue) {
1461
+ return {
1462
+ ...this.getBorderTopWidth(globalValue, important),
1463
+ ...this.getBorderTopStyle(globalValue, important),
1464
+ ...this.getBorderTopColor(globalValue, important)
1465
+ };
1466
+ }
1467
+
1468
+ const properties = {
1469
+ ...this.getBorderTopWidth('initial', important),
1470
+ ...this.getBorderTopStyle('initial', important),
1471
+ ...this.getBorderTopColor('initial', important)
1472
+ };
1473
+
1474
+ const parts = value.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
1475
+
1476
+ for (const part of parts) {
1477
+ const width = this.getBorderTopWidth(part, important);
1478
+ const style = this.getBorderTopStyle(part, important);
1479
+ const color = this.getBorderTopColor(part, important);
1480
+
1481
+ if (width === null && style === null && color === null) {
1482
+ return null;
1483
+ }
1484
+
1485
+ Object.assign(properties, width, style, color);
1486
+ }
1487
+
1488
+ return properties;
1489
+ }
1490
+
1491
+ /**
1492
+ * Returns border top, right, bottom or left.
1493
+ *
1494
+ * @param value Value.
1495
+ * @param important Important.
1496
+ * @returns Property values.
1497
+ */
1498
+ public static getBorderRight(
1499
+ value: string,
1500
+ important: boolean
1501
+ ): { [key: string]: ICSSPropertyValue } | null {
1502
+ const variable = CSSVariableFormatter.getVariable(value);
1503
+ if (variable) {
1504
+ return { 'border-right': { value: variable, important } };
1505
+ }
1506
+
1507
+ const globalValue = CSSValueFormatter.getGlobal(value);
1508
+
1509
+ if (globalValue) {
1510
+ return {
1511
+ ...this.getBorderRightWidth(globalValue, important),
1512
+ ...this.getBorderRightStyle(globalValue, important),
1513
+ ...this.getBorderRightColor(globalValue, important)
1514
+ };
1515
+ }
1516
+
1517
+ const properties = {
1518
+ ...this.getBorderRightWidth('initial', important),
1519
+ ...this.getBorderRightStyle('initial', important),
1520
+ ...this.getBorderRightColor('initial', important)
1521
+ };
1522
+
1523
+ const parts = value.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
1524
+
1525
+ for (const part of parts) {
1526
+ const width = this.getBorderRightWidth(part, important);
1527
+ const style = this.getBorderRightStyle(part, important);
1528
+ const color = this.getBorderRightColor(part, important);
1529
+
1530
+ if (width === null && style === null && color === null) {
1531
+ return null;
1532
+ }
1533
+
1534
+ Object.assign(properties, width, style, color);
1535
+ }
1536
+
1537
+ return properties;
1538
+ }
1539
+
1540
+ /**
1541
+ * Returns border top, right, bottom or left.
1542
+ *
1543
+ * @param value Value.
1544
+ * @param important Important.
1545
+ * @returns Property values.
1546
+ */
1547
+ public static getBorderBottom(
1548
+ value: string,
1549
+ important: boolean
1550
+ ): { [key: string]: ICSSPropertyValue } | null {
1551
+ const variable = CSSVariableFormatter.getVariable(value);
1552
+ if (variable) {
1553
+ return { 'border-bottom': { value: variable, important } };
1554
+ }
1555
+
1556
+ const globalValue = CSSValueFormatter.getGlobal(value);
1557
+
1558
+ if (globalValue) {
1559
+ return {
1560
+ ...this.getBorderBottomWidth(globalValue, important),
1561
+ ...this.getBorderBottomStyle(globalValue, important),
1562
+ ...this.getBorderBottomColor(globalValue, important)
1563
+ };
1564
+ }
1565
+
1566
+ const properties = {
1567
+ ...this.getBorderBottomWidth('initial', important),
1568
+ ...this.getBorderBottomStyle('initial', important),
1569
+ ...this.getBorderBottomColor('initial', important)
1570
+ };
1571
+
1572
+ const parts = value.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
1573
+
1574
+ for (const part of parts) {
1575
+ const width = this.getBorderBottomWidth(part, important);
1576
+ const style = this.getBorderBottomStyle(part, important);
1577
+ const color = this.getBorderBottomColor(part, important);
1578
+
1579
+ if (width === null && style === null && color === null) {
1580
+ return null;
1581
+ }
1582
+
1583
+ Object.assign(properties, width, style, color);
1584
+ }
1585
+
1586
+ return properties;
1587
+ }
1588
+
1589
+ /**
1590
+ * Returns border top, right, bottom or left.
1591
+ *
1592
+ * @param value Value.
1593
+ * @param important Important.
1594
+ * @returns Property values.
1595
+ */
1596
+ public static getBorderLeft(
1597
+ value: string,
1598
+ important: boolean
1599
+ ): { [key: string]: ICSSPropertyValue } | null {
1600
+ const variable = CSSVariableFormatter.getVariable(value);
1601
+ if (variable) {
1602
+ return { 'border-left': { value: variable, important } };
1603
+ }
1604
+
1605
+ const globalValue = CSSValueFormatter.getGlobal(value);
1606
+
1607
+ if (globalValue) {
1608
+ return {
1609
+ ...this.getBorderLeftWidth(globalValue, important),
1610
+ ...this.getBorderLeftStyle(globalValue, important),
1611
+ ...this.getBorderLeftColor(globalValue, important)
1612
+ };
1613
+ }
1614
+
1615
+ const properties = {
1616
+ ...this.getBorderLeftWidth('initial', important),
1617
+ ...this.getBorderLeftStyle('initial', important),
1618
+ ...this.getBorderLeftColor('initial', important)
1619
+ };
1620
+
1621
+ const parts = value.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
1622
+
1623
+ for (const part of parts) {
1624
+ const width = this.getBorderLeftWidth(part, important);
1625
+ const style = this.getBorderLeftStyle(part, important);
1626
+ const color = this.getBorderLeftColor(part, important);
1627
+
1628
+ if (width === null && style === null && color === null) {
1629
+ return null;
1630
+ }
1631
+
1632
+ Object.assign(properties, width, style, color);
1633
+ }
1634
+
1635
+ return properties;
1636
+ }
1637
+
1638
+ /**
1639
+ * Returns padding.
1640
+ *
1641
+ * @param value Value.
1642
+ * @param important Important.
1643
+ */
1644
+ public static getPadding(
1645
+ value: string,
1646
+ important: boolean
1647
+ ): { [key: string]: ICSSPropertyValue } | null {
1648
+ const variable = CSSVariableFormatter.getVariable(value);
1649
+ if (variable) {
1650
+ return { padding: { value: variable, important } };
1651
+ }
1652
+
1653
+ const globalValue = CSSValueFormatter.getGlobal(value);
1654
+
1655
+ if (globalValue) {
1656
+ return {
1657
+ ...this.getPaddingTop(globalValue, important),
1658
+ ...this.getPaddingRight(globalValue, important),
1659
+ ...this.getPaddingBottom(globalValue, important),
1660
+ ...this.getPaddingLeft(globalValue, important)
1661
+ };
1662
+ }
1663
+
1664
+ const parts = value.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
1665
+ const top = this.getPaddingTop(parts[0], important);
1666
+ const right = this.getPaddingRight(parts[1] || parts[0], important);
1667
+ const bottom = this.getPaddingBottom(parts[2] || parts[0], important);
1668
+ const left = this.getPaddingLeft(parts[3] || parts[1] || parts[0], important);
1669
+
1670
+ if (!top || !right || !bottom || !left) {
1671
+ return null;
1672
+ }
1673
+
1674
+ return {
1675
+ ...top,
1676
+ ...right,
1677
+ ...bottom,
1678
+ ...left
1679
+ };
1680
+ }
1681
+
1682
+ /**
1683
+ * Returns padding top.
1684
+ *
1685
+ * @param value Value.
1686
+ * @param important Important.
1687
+ * @returns Property values.
1688
+ */
1689
+ public static getPaddingTop(
1690
+ value: string,
1691
+ important: boolean
1692
+ ): { [key: string]: ICSSPropertyValue } | null {
1693
+ const variable = CSSVariableFormatter.getVariable(value);
1694
+ if (variable) {
1695
+ return { 'padding-top': { value: variable, important } };
1696
+ }
1697
+
1698
+ const padding = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getMeasurement(value);
1699
+ return padding ? { 'padding-top': { value: padding, important } } : null;
1700
+ }
1701
+
1702
+ /**
1703
+ * Returns padding right.
1704
+ *
1705
+ * @param value Value.
1706
+ * @param important Important.
1707
+ * @returns Property values.
1708
+ */
1709
+ public static getPaddingRight(
1710
+ value: string,
1711
+ important: boolean
1712
+ ): { [key: string]: ICSSPropertyValue } | null {
1713
+ const variable = CSSVariableFormatter.getVariable(value);
1714
+ if (variable) {
1715
+ return { 'padding-right': { value: variable, important } };
1716
+ }
1717
+
1718
+ const padding = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getMeasurement(value);
1719
+ return padding ? { 'padding-right': { value: padding, important } } : null;
1720
+ }
1721
+
1722
+ /**
1723
+ * Returns padding bottom.
1724
+ *
1725
+ * @param value Value.
1726
+ * @param important Important.
1727
+ * @returns Property values.
1728
+ */
1729
+ public static getPaddingBottom(
1730
+ value: string,
1731
+ important: boolean
1732
+ ): { [key: string]: ICSSPropertyValue } | null {
1733
+ const variable = CSSVariableFormatter.getVariable(value);
1734
+ if (variable) {
1735
+ return { 'padding-bottom': { value: variable, important } };
1736
+ }
1737
+
1738
+ const padding = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getMeasurement(value);
1739
+ return padding ? { 'padding-bottom': { value: padding, important } } : null;
1740
+ }
1741
+
1742
+ /**
1743
+ * Returns padding left.
1744
+ *
1745
+ * @param value Value.
1746
+ * @param important Important.
1747
+ * @returns Property values.
1748
+ */
1749
+ public static getPaddingLeft(
1750
+ value: string,
1751
+ important: boolean
1752
+ ): { [key: string]: ICSSPropertyValue } | null {
1753
+ const variable = CSSVariableFormatter.getVariable(value);
1754
+ if (variable) {
1755
+ return { 'padding-left': { value: variable, important } };
1756
+ }
1757
+
1758
+ const padding = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getMeasurement(value);
1759
+ return padding ? { 'padding-left': { value: padding, important } } : null;
1760
+ }
1761
+
1762
+ /**
1763
+ * Returns margin.
1764
+ *
1765
+ * @param value Value.
1766
+ * @param important Important.
1767
+ * @returns Property values.
1768
+ */
1769
+ public static getMargin(
1770
+ value: string,
1771
+ important: boolean
1772
+ ): { [key: string]: ICSSPropertyValue } | null {
1773
+ const variable = CSSVariableFormatter.getVariable(value);
1774
+ if (variable) {
1775
+ return { margin: { value: variable, important } };
1776
+ }
1777
+
1778
+ const globalValue = CSSValueFormatter.getGlobal(value);
1779
+
1780
+ if (globalValue) {
1781
+ return {
1782
+ ...this.getMarginTop(globalValue, important),
1783
+ ...this.getMarginRight(globalValue, important),
1784
+ ...this.getMarginBottom(globalValue, important),
1785
+ ...this.getMarginLeft(globalValue, important)
1786
+ };
1787
+ }
1788
+
1789
+ const parts = value.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
1790
+ const top = this.getMarginTop(parts[0], important);
1791
+ const right = this.getMarginRight(parts[1] || parts[0], important);
1792
+ const bottom = this.getMarginBottom(parts[2] || parts[0], important);
1793
+ const left = this.getMarginLeft(parts[3] || parts[1] || parts[0], important);
1794
+
1795
+ if (!top || !right || !bottom || !left) {
1796
+ return null;
1797
+ }
1798
+
1799
+ return {
1800
+ ...top,
1801
+ ...right,
1802
+ ...bottom,
1803
+ ...left
1804
+ };
1805
+ }
1806
+
1807
+ /**
1808
+ * Returns margin top.
1809
+ *
1810
+ * @param value Value.
1811
+ * @param important Important.
1812
+ * @returns Property values.
1813
+ */
1814
+ public static getMarginTop(
1815
+ value: string,
1816
+ important: boolean
1817
+ ): { [key: string]: ICSSPropertyValue } | null {
1818
+ const variable = CSSVariableFormatter.getVariable(value);
1819
+ if (variable) {
1820
+ return { 'margin-top': { value: variable, important } };
1821
+ }
1822
+
1823
+ const margin =
1824
+ CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getAutoMeasurement(value);
1825
+ return margin ? { 'margin-top': { value: margin, important } } : null;
1826
+ }
1827
+
1828
+ /**
1829
+ * Returns margin right.
1830
+ *
1831
+ * @param value Value.
1832
+ * @param important Important.
1833
+ * @returns Property values.
1834
+ */
1835
+ public static getMarginRight(
1836
+ value: string,
1837
+ important: boolean
1838
+ ): { [key: string]: ICSSPropertyValue } | null {
1839
+ const variable = CSSVariableFormatter.getVariable(value);
1840
+ if (variable) {
1841
+ return { 'margin-right': { value: variable, important } };
1842
+ }
1843
+
1844
+ const margin =
1845
+ CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getAutoMeasurement(value);
1846
+ return margin ? { 'margin-right': { value: margin, important } } : null;
1847
+ }
1848
+
1849
+ /**
1850
+ * Returns margin right.
1851
+ *
1852
+ * @param value Value.
1853
+ * @param important Important.
1854
+ * @returns Property values.
1855
+ */
1856
+ public static getMarginBottom(
1857
+ value: string,
1858
+ important: boolean
1859
+ ): { [key: string]: ICSSPropertyValue } | null {
1860
+ const variable = CSSVariableFormatter.getVariable(value);
1861
+ if (variable) {
1862
+ return { 'margin-bottom': { value: variable, important } };
1863
+ }
1864
+
1865
+ const margin =
1866
+ CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getAutoMeasurement(value);
1867
+ return margin ? { 'margin-bottom': { value: margin, important } } : null;
1868
+ }
1869
+
1870
+ /**
1871
+ * Returns margin left.
1872
+ *
1873
+ * @param value Value.
1874
+ * @param important Important.
1875
+ * @returns Property values.
1876
+ */
1877
+ public static getMarginLeft(
1878
+ value: string,
1879
+ important: boolean
1880
+ ): { [key: string]: ICSSPropertyValue } | null {
1881
+ const variable = CSSVariableFormatter.getVariable(value);
1882
+ if (variable) {
1883
+ return { 'margin-left': { value: variable, important } };
1884
+ }
1885
+
1886
+ const margin =
1887
+ CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getAutoMeasurement(value);
1888
+ return margin ? { 'margin-left': { value: margin, important } } : null;
1889
+ }
1890
+
1891
+ /**
1892
+ * Returns flex.
1893
+ *
1894
+ * @param value Value.
1895
+ * @param important Important.
1896
+ * @returns Property values.
1897
+ */
1898
+ public static getFlex(
1899
+ value: string,
1900
+ important: boolean
1901
+ ): { [key: string]: ICSSPropertyValue } | null {
1902
+ const variable = CSSVariableFormatter.getVariable(value);
1903
+ if (variable) {
1904
+ return { flex: { value: variable, important } };
1905
+ }
1906
+
1907
+ const lowerValue = value.trim().toLowerCase();
1908
+ const globalValue = CSSValueFormatter.getGlobal(value);
1909
+
1910
+ if (globalValue) {
1911
+ return {
1912
+ ...this.getFlexGrow(globalValue, important),
1913
+ ...this.getFlexShrink(globalValue, important),
1914
+ ...this.getFlexBasis(globalValue, important)
1915
+ };
1916
+ }
1917
+
1918
+ switch (lowerValue) {
1919
+ case 'none':
1920
+ return {
1921
+ ...this.getFlexGrow('0', important),
1922
+ ...this.getFlexShrink('0', important),
1923
+ ...this.getFlexBasis('auto', important)
1924
+ };
1925
+ case 'auto':
1926
+ return {
1927
+ ...this.getFlexGrow('1', important),
1928
+ ...this.getFlexShrink('1', important),
1929
+ ...this.getFlexBasis('auto', important)
1930
+ };
1931
+ }
1932
+
1933
+ const measurement = CSSValueFormatter.getContentMeasurement(lowerValue);
1934
+
1935
+ if (measurement) {
1936
+ return {
1937
+ ...this.getFlexGrow('1', important),
1938
+ ...this.getFlexShrink('1', important),
1939
+ ...this.getFlexBasis(measurement, important)
1940
+ };
1941
+ }
1942
+
1943
+ const parts = value.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
1944
+ const flexGrow = this.getFlexGrow(parts[0], important);
1945
+ const flexShrink = this.getFlexShrink(parts[1] || '1', important);
1946
+ const flexBasis = this.getFlexBasis(parts[2] || '0%', important);
1947
+
1948
+ if (!flexGrow || !flexShrink || !flexBasis) {
1949
+ return null;
1950
+ }
1951
+
1952
+ return {
1953
+ ...flexGrow,
1954
+ ...flexShrink,
1955
+ ...flexBasis
1956
+ };
1957
+ }
1958
+
1959
+ /**
1960
+ * Returns flex basis.
1961
+ *
1962
+ * @param value Value.
1963
+ * @param important Important.
1964
+ * @returns Property values
1965
+ */
1966
+ public static getFlexBasis(value: string, important: boolean): ICSSPropertyMap | null {
1967
+ const variable = CSSVariableFormatter.getVariable(value);
1968
+ if (variable) {
1969
+ return { 'flex-basis': { value: variable, important } };
1970
+ }
1971
+
1972
+ const lowerValue = value.toLowerCase();
1973
+ if (CSSValueFormatter.getGlobal(lowerValue) || FLEX_BASIS.includes(lowerValue)) {
1974
+ return { 'flex-basis': { value: lowerValue, important } };
1975
+ }
1976
+ const measurement = CSSValueFormatter.getContentMeasurement(lowerValue);
1977
+ return measurement ? { 'flex-basis': { value: measurement, important } } : null;
1978
+ }
1979
+
1980
+ /**
1981
+ * Returns flex shrink.
1982
+ *
1983
+ * @param value Value.
1984
+ * @param important Important.
1985
+ * @returns Property values
1986
+ */
1987
+ public static getFlexShrink(value: string, important: boolean): ICSSPropertyMap | null {
1988
+ const variable = CSSVariableFormatter.getVariable(value);
1989
+ if (variable) {
1990
+ return { 'flex-shrink': { value: variable, important } };
1991
+ }
1992
+
1993
+ const parsedValue = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getFloat(value);
1994
+ return parsedValue ? { 'flex-shrink': { value: parsedValue, important } } : null;
1995
+ }
1996
+
1997
+ /**
1998
+ * Returns flex grow.
1999
+ *
2000
+ * @param value Value.
2001
+ * @param important Important.
2002
+ * @returns Property values
2003
+ */
2004
+ public static getFlexGrow(value: string, important: boolean): ICSSPropertyMap | null {
2005
+ const variable = CSSVariableFormatter.getVariable(value);
2006
+ if (variable) {
2007
+ return { 'flex-grow': { value: variable, important } };
2008
+ }
2009
+
2010
+ const parsedValue = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getFloat(value);
2011
+ return parsedValue ? { 'flex-grow': { value: parsedValue, important } } : null;
2012
+ }
2013
+
2014
+ /**
2015
+ * Returns background.
2016
+ *
2017
+ * @param name Name.
2018
+ * @param value Value.
2019
+ * @param important Important.
2020
+ * @returns Property values.
2021
+ */
2022
+ public static getBackground(
2023
+ value: string,
2024
+ important: boolean
2025
+ ): { [key: string]: ICSSPropertyValue } | null {
2026
+ const variable = CSSVariableFormatter.getVariable(value);
2027
+ if (variable) {
2028
+ return { background: { value: variable, important } };
2029
+ }
2030
+
2031
+ const globalValue = CSSValueFormatter.getGlobal(value);
2032
+
2033
+ if (globalValue) {
2034
+ return {
2035
+ ...this.getBackgroundImage(globalValue, important),
2036
+ ...this.getBackgroundPosition(globalValue, important),
2037
+ ...this.getBackgroundSize(globalValue, important),
2038
+ ...this.getBackgroundRepeat(globalValue, important),
2039
+ ...this.getBackgroundAttachment(globalValue, important),
2040
+ ...this.getBackgroundOrigin(globalValue, important),
2041
+ ...this.getBackgroundClip(globalValue, important),
2042
+ ...this.getBackgroundColor(globalValue, important)
2043
+ };
2044
+ }
2045
+
2046
+ const properties = {
2047
+ ...this.getBackgroundImage('initial', important),
2048
+ ...this.getBackgroundPosition('initial', important),
2049
+ ...this.getBackgroundSize('initial', important),
2050
+ ...this.getBackgroundRepeat('initial', important),
2051
+ ...this.getBackgroundAttachment('initial', important),
2052
+ ...this.getBackgroundOrigin('initial', important),
2053
+ ...this.getBackgroundClip('initial', important),
2054
+ ...this.getBackgroundColor('initial', important)
2055
+ };
2056
+
2057
+ const parts = CSSStringUtility.splitBySpace(value.replace(/\s+\/\s+/g, '/'));
2058
+ const backgroundPositions = [];
2059
+
2060
+ for (const part of parts) {
2061
+ if (!part.startsWith('url') && part.includes('/')) {
2062
+ const [position, size] = part.split('/');
2063
+ const backgroundPositionX = this.getBackgroundPositionX(position, important);
2064
+ const backgroundPositionY = this.getBackgroundPositionY(position, important);
2065
+
2066
+ const backgroundSize = this.getBackgroundSize(size, important);
2067
+
2068
+ if ((!backgroundPositionX && !backgroundPositionY) || !backgroundSize) {
2069
+ return null;
2070
+ }
2071
+
2072
+ if (backgroundPositionY) {
2073
+ backgroundPositions.push(backgroundPositionY['background-position-y'].value);
2074
+ } else if (backgroundPositionX) {
2075
+ backgroundPositions.push(backgroundPositionX['background-position-x'].value);
2076
+ }
2077
+
2078
+ Object.assign(properties, backgroundSize);
2079
+ } else {
2080
+ const backgroundImage = this.getBackgroundImage(part, important);
2081
+ const backgroundRepeat = this.getBackgroundRepeat(part, important);
2082
+ const backgroundAttachment = this.getBackgroundAttachment(part, important);
2083
+ const backgroundPositionX = this.getBackgroundPositionX(part, important);
2084
+ const backgroundPositionY = this.getBackgroundPositionY(part, important);
2085
+ const backgroundColor = this.getBackgroundColor(part, important);
2086
+ const backgroundOrigin = this.getBackgroundOrigin(part, important);
2087
+ const backgroundClip = this.getBackgroundClip(part, important);
2088
+
2089
+ if (
2090
+ !backgroundImage &&
2091
+ !backgroundRepeat &&
2092
+ !backgroundAttachment &&
2093
+ !backgroundPositionX &&
2094
+ !backgroundPositionY &&
2095
+ !backgroundColor &&
2096
+ !backgroundOrigin &&
2097
+ !backgroundClip
2098
+ ) {
2099
+ return null;
2100
+ }
2101
+
2102
+ if (backgroundPositionX) {
2103
+ backgroundPositions.push(backgroundPositionX['background-position-x'].value);
2104
+ } else if (backgroundPositionY) {
2105
+ backgroundPositions.push(backgroundPositionY['background-position-y'].value);
2106
+ }
2107
+
2108
+ Object.assign(
2109
+ properties,
2110
+ backgroundImage,
2111
+ backgroundRepeat,
2112
+ backgroundAttachment,
2113
+ backgroundColor,
2114
+ backgroundOrigin,
2115
+ backgroundClip
2116
+ );
2117
+ }
2118
+ }
2119
+
2120
+ if (backgroundPositions.length) {
2121
+ Object.assign(
2122
+ properties,
2123
+ this.getBackgroundPosition(backgroundPositions.join(' '), important)
2124
+ );
2125
+ }
2126
+
2127
+ return properties;
2128
+ }
2129
+
2130
+ /**
2131
+ * Returns background size.
2132
+ *
2133
+ * @param value Value.
2134
+ * @param important Important.
2135
+ * @returns Property values
2136
+ */
2137
+ public static getBackgroundSize(value: string, important: boolean): ICSSPropertyMap | null {
2138
+ const variable = CSSVariableFormatter.getVariable(value);
2139
+ if (variable) {
2140
+ return { 'background-size': { value: variable, important } };
2141
+ }
2142
+
2143
+ const lowerValue = value.toLowerCase();
2144
+ if (CSSValueFormatter.getGlobal(lowerValue)) {
2145
+ return { 'background-size': { value: lowerValue, important } };
2146
+ }
2147
+
2148
+ const imageParts = lowerValue.split(SPLIT_COMMA_SEPARATED_WITH_PARANTHESES_REGEXP);
2149
+ const parsed = [];
2150
+
2151
+ for (const imagePart of imageParts) {
2152
+ const parts = imagePart.trim().split(' ');
2153
+ if (parts.length !== 1 && parts.length !== 2) {
2154
+ return null;
2155
+ }
2156
+ if (parts.length === 1) {
2157
+ if (
2158
+ parts[0] !== 'cover' &&
2159
+ parts[0] !== 'contain' &&
2160
+ !CSSValueFormatter.getAutoMeasurement(parts[0])
2161
+ ) {
2162
+ return null;
2163
+ }
2164
+ parsed.push(parts[0]);
2165
+ } else {
2166
+ if (
2167
+ !CSSValueFormatter.getAutoMeasurement(parts[0]) ||
2168
+ !CSSValueFormatter.getAutoMeasurement(parts[1])
2169
+ ) {
2170
+ return null;
2171
+ }
2172
+ parsed.push(`${parts[0]} ${parts[1]}`);
2173
+ }
2174
+ }
2175
+ if (parsed.length === 1) {
2176
+ return { 'background-size': { value: parsed.join(', '), important } };
2177
+ }
2178
+ return null;
2179
+ }
2180
+
2181
+ /**
2182
+ * Returns background origin.
2183
+ *
2184
+ * @param value Value.
2185
+ * @param important Important.
2186
+ * @returns Property values
2187
+ */
2188
+ public static getBackgroundOrigin(value: string, important: boolean): ICSSPropertyMap | null {
2189
+ const variable = CSSVariableFormatter.getVariable(value);
2190
+ if (variable) {
2191
+ return { 'background-origin': { value: variable, important } };
2192
+ }
2193
+
2194
+ const lowerValue = value.toLowerCase();
2195
+ if (CSSValueFormatter.getGlobal(lowerValue) || BACKGROUND_ORIGIN.includes(lowerValue)) {
2196
+ return { 'background-origin': { value: lowerValue, important } };
2197
+ }
2198
+ return null;
2199
+ }
2200
+
2201
+ /**
2202
+ * Returns background clip.
2203
+ *
2204
+ * @param value Value.
2205
+ * @param important Important.
2206
+ * @returns Property values
2207
+ */
2208
+ public static getBackgroundClip(value: string, important: boolean): ICSSPropertyMap | null {
2209
+ const variable = CSSVariableFormatter.getVariable(value);
2210
+ if (variable) {
2211
+ return { 'background-clip': { value: variable, important } };
2212
+ }
2213
+
2214
+ const lowerValue = value.toLowerCase();
2215
+ if (CSSValueFormatter.getGlobal(lowerValue) || BACKGROUND_CLIP.includes(lowerValue)) {
2216
+ return { 'background-clip': { value: lowerValue, important } };
2217
+ }
2218
+ return null;
2219
+ }
2220
+
2221
+ /**
2222
+ * Returns background repeat.
2223
+ *
2224
+ * @param value Value.
2225
+ * @param important Important.
2226
+ * @returns Property values
2227
+ */
2228
+ public static getBackgroundRepeat(value: string, important: boolean): ICSSPropertyMap | null {
2229
+ const variable = CSSVariableFormatter.getVariable(value);
2230
+ if (variable) {
2231
+ return { 'background-repeat': { value: variable, important } };
2232
+ }
2233
+
2234
+ const lowerValue = value.toLowerCase();
2235
+ if (CSSValueFormatter.getGlobal(lowerValue) || BACKGROUND_REPEAT.includes(lowerValue)) {
2236
+ return { 'background-repeat': { value: lowerValue, important } };
2237
+ }
2238
+ return null;
2239
+ }
2240
+
2241
+ /**
2242
+ * Returns background attachment.
2243
+ *
2244
+ * @param value Value.
2245
+ * @param important Important.
2246
+ * @returns Property values
2247
+ */
2248
+ public static getBackgroundAttachment(value: string, important: boolean): ICSSPropertyMap | null {
2249
+ const variable = CSSVariableFormatter.getVariable(value);
2250
+ if (variable) {
2251
+ return { 'background-attachment': { value: variable, important } };
2252
+ }
2253
+
2254
+ const lowerValue = value.toLowerCase();
2255
+ if (CSSValueFormatter.getGlobal(lowerValue) || BACKGROUND_ATTACHMENT.includes(lowerValue)) {
2256
+ return { 'background-attachment': { value: lowerValue, important } };
2257
+ }
2258
+ return null;
2259
+ }
2260
+
2261
+ /**
2262
+ * Returns background position.
2263
+ *
2264
+ * @param value Value.
2265
+ * @param important Important.
2266
+ * @returns Property values
2267
+ */
2268
+ public static getBackgroundPosition(value: string, important: boolean): ICSSPropertyMap | null {
2269
+ const variable = CSSVariableFormatter.getVariable(value);
2270
+ if (variable) {
2271
+ return { 'background-position': { value: variable, important } };
2272
+ }
2273
+
2274
+ const globalValue = CSSValueFormatter.getGlobal(value);
2275
+ if (globalValue) {
2276
+ return {
2277
+ ...this.getBackgroundPositionX(globalValue, important),
2278
+ ...this.getBackgroundPositionY(globalValue, important)
2279
+ };
2280
+ }
2281
+
2282
+ const imageParts = value.split(SPLIT_COMMA_SEPARATED_WITH_PARANTHESES_REGEXP);
2283
+ let x = '';
2284
+ let y = '';
2285
+
2286
+ for (const imagePart of imageParts) {
2287
+ const parts = imagePart.trim().split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
2288
+
2289
+ if (x) {
2290
+ x += ',';
2291
+ y += ',';
2292
+ }
2293
+
2294
+ switch (parts.length) {
2295
+ case 1:
2296
+ if (parts[0] === 'top' || parts[0] === 'bottom') {
2297
+ x += 'center';
2298
+ y += parts[0];
2299
+ } else if (parts[0] === 'left' || parts[0] === 'right') {
2300
+ x += parts[0];
2301
+ y += 'center';
2302
+ } else if (parts[0] === 'center') {
2303
+ x += 'center';
2304
+ y += 'center';
2305
+ }
2306
+ break;
2307
+ case 2:
2308
+ x += parts[0] === 'top' || parts[0] === 'bottom' ? parts[1] : parts[0];
2309
+ y += parts[0] === 'top' || parts[0] === 'bottom' ? parts[0] : parts[1];
2310
+ break;
2311
+ case 3:
2312
+ if (
2313
+ parts[0] === 'top' ||
2314
+ parts[0] === 'bottom' ||
2315
+ parts[1] === 'left' ||
2316
+ parts[1] === 'right' ||
2317
+ parts[2] === 'left' ||
2318
+ parts[2] === 'right'
2319
+ ) {
2320
+ if (CSSValueFormatter.getMeasurement(parts[1])) {
2321
+ x += parts[2];
2322
+ y += `${parts[0]} ${parts[1]}`;
2323
+ } else {
2324
+ x += `${parts[1]} ${parts[2]}`;
2325
+ y += parts[0];
2326
+ }
2327
+ } else {
2328
+ if (CSSValueFormatter.getMeasurement(parts[1])) {
2329
+ x += `${parts[0]} ${parts[1]}`;
2330
+ y += parts[2];
2331
+ } else {
2332
+ x += parts[0];
2333
+ y += `${parts[1]} ${parts[2]}`;
2334
+ }
2335
+ }
2336
+ break;
2337
+ case 4:
2338
+ x +=
2339
+ parts[0] === 'top' ||
2340
+ parts[0] === 'bottom' ||
2341
+ parts[1] === 'top' ||
2342
+ parts[1] === 'bottom'
2343
+ ? `${parts[2]} ${parts[3]}`
2344
+ : `${parts[0]} ${parts[1]}`;
2345
+ y +=
2346
+ parts[0] === 'top' ||
2347
+ parts[0] === 'bottom' ||
2348
+ parts[1] === 'top' ||
2349
+ parts[1] === 'bottom'
2350
+ ? `${parts[0]} ${parts[1]}`
2351
+ : `${parts[2]} ${parts[3]}`;
2352
+ break;
2353
+ default:
2354
+ return null;
2355
+ }
2356
+ }
2357
+
2358
+ const xValue = this.getBackgroundPositionX(x, important);
2359
+ const yValue = this.getBackgroundPositionY(y, important);
2360
+
2361
+ if (xValue && yValue) {
2362
+ return {
2363
+ ...xValue,
2364
+ ...yValue
2365
+ };
2366
+ }
2367
+
2368
+ return null;
2369
+ }
2370
+
2371
+ /**
2372
+ * Returns background position.
2373
+ *
2374
+ * @param value Value.
2375
+ * @param important Important.
2376
+ * @returns Property values
2377
+ */
2378
+ public static getBackgroundPositionX(value: string, important: boolean): ICSSPropertyMap | null {
2379
+ const variable = CSSVariableFormatter.getVariable(value);
2380
+ if (variable) {
2381
+ return { 'background-position-x': { value: variable, important } };
2382
+ }
2383
+
2384
+ const lowerValue = value.toLowerCase();
2385
+
2386
+ if (CSSValueFormatter.getGlobal(lowerValue)) {
2387
+ return { 'background-position-x': { value: lowerValue, important } };
2388
+ }
2389
+
2390
+ const imageParts = lowerValue.split(SPLIT_COMMA_SEPARATED_WITH_PARANTHESES_REGEXP);
2391
+ let parsedValue = '';
2392
+
2393
+ for (const imagePart of imageParts) {
2394
+ const parts = imagePart.trim().split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
2395
+
2396
+ if (parsedValue) {
2397
+ parsedValue += ',';
2398
+ }
2399
+
2400
+ for (const part of parts) {
2401
+ const measurement = CSSValueFormatter.getMeasurement(part);
2402
+ if (!measurement && part !== 'left' && part !== 'right' && part !== 'center') {
2403
+ return null;
2404
+ }
2405
+
2406
+ if (parsedValue) {
2407
+ parsedValue += ' ';
2408
+ }
2409
+
2410
+ parsedValue += measurement || part;
2411
+ }
2412
+ }
2413
+
2414
+ return { 'background-position-x': { value: parsedValue, important } };
2415
+ }
2416
+
2417
+ /**
2418
+ * Returns background position.
2419
+ *
2420
+ * @param value Value.
2421
+ * @param important Important.
2422
+ * @returns Property values
2423
+ */
2424
+ public static getBackgroundPositionY(value: string, important: boolean): ICSSPropertyMap | null {
2425
+ const variable = CSSVariableFormatter.getVariable(value);
2426
+ if (variable) {
2427
+ return { 'background-position-y': { value: variable, important } };
2428
+ }
2429
+
2430
+ const lowerValue = value.toLowerCase();
2431
+
2432
+ if (CSSValueFormatter.getGlobal(lowerValue)) {
2433
+ return { 'background-position-y': { value: lowerValue, important } };
2434
+ }
2435
+
2436
+ const imageParts = lowerValue.split(SPLIT_COMMA_SEPARATED_WITH_PARANTHESES_REGEXP);
2437
+ let parsedValue = '';
2438
+
2439
+ for (const imagePart of imageParts) {
2440
+ const parts = imagePart.trim().split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
2441
+
2442
+ if (parsedValue) {
2443
+ parsedValue += ',';
2444
+ }
2445
+
2446
+ for (const part of parts) {
2447
+ const measurement = CSSValueFormatter.getMeasurement(part);
2448
+ if (!measurement && part !== 'top' && part !== 'bottom' && part !== 'center') {
2449
+ return null;
2450
+ }
2451
+
2452
+ if (parsedValue) {
2453
+ parsedValue += ' ';
2454
+ }
2455
+
2456
+ parsedValue += measurement || part;
2457
+ }
2458
+ }
2459
+
2460
+ return { 'background-position-y': { value: parsedValue, important } };
2461
+ }
2462
+
2463
+ /**
2464
+ * Returns background color.
2465
+ *
2466
+ * @param value Value.
2467
+ * @param important Important.
2468
+ * @returns Property value.
2469
+ */
2470
+ public static getBackgroundColor(
2471
+ value: string,
2472
+ important: boolean
2473
+ ): { [key: string]: ICSSPropertyValue } | null {
2474
+ const variable = CSSVariableFormatter.getVariable(value);
2475
+ if (variable) {
2476
+ return { 'background-color': { value: variable, important } };
2477
+ }
2478
+
2479
+ const color = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getColor(value);
2480
+
2481
+ return color
2482
+ ? {
2483
+ ['background-color']: { important, value: color }
2484
+ }
2485
+ : null;
2486
+ }
2487
+
2488
+ /**
2489
+ * Returns background image.
2490
+ *
2491
+ * @param value Value.
2492
+ * @param important Important.
2493
+ * @returns Property value.
2494
+ */
2495
+ public static getBackgroundImage(
2496
+ value: string,
2497
+ important: boolean
2498
+ ): { [key: string]: ICSSPropertyValue } | null {
2499
+ const variable = CSSVariableFormatter.getVariable(value);
2500
+ if (variable) {
2501
+ return { 'background-image': { value: variable, important } };
2502
+ }
2503
+
2504
+ const lowerValue = value.toLowerCase();
2505
+
2506
+ if (CSSValueFormatter.getGlobal(lowerValue) || lowerValue === 'none') {
2507
+ return { 'background-image': { value: lowerValue, important } };
2508
+ }
2509
+
2510
+ const parts = CSSStringUtility.splitByComma(value);
2511
+ const parsed = [];
2512
+
2513
+ for (const part of parts) {
2514
+ const parsedValue =
2515
+ CSSValueFormatter.getURL(part.trim()) || CSSValueFormatter.getGradient(part.trim());
2516
+ if (!parsedValue) {
2517
+ return null;
2518
+ }
2519
+ parsed.push(parsedValue);
2520
+ }
2521
+
2522
+ if (parsed.length) {
2523
+ return { 'background-image': { value: parsed.join(', '), important } };
2524
+ }
2525
+
2526
+ return null;
2527
+ }
2528
+
2529
+ /**
2530
+ * Returns color.
2531
+ *
2532
+ * @param value Value.
2533
+ * @param important Important.
2534
+ * @returns Property value.
2535
+ */
2536
+ public static getColor(
2537
+ value: string,
2538
+ important: boolean
2539
+ ): { [key: string]: ICSSPropertyValue } | null {
2540
+ const variable = CSSVariableFormatter.getVariable(value);
2541
+ if (variable) {
2542
+ return { color: { value: variable, important } };
2543
+ }
2544
+
2545
+ const color = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getColor(value);
2546
+
2547
+ return color ? { color: { important, value: color } } : null;
2548
+ }
2549
+
2550
+ /**
2551
+ * Returns color.
2552
+ *
2553
+ * @param value Value.
2554
+ * @param important Important.
2555
+ * @returns Property value.
2556
+ */
2557
+ public static getFloodColor(
2558
+ value: string,
2559
+ important: boolean
2560
+ ): { [key: string]: ICSSPropertyValue } | null {
2561
+ const variable = CSSVariableFormatter.getVariable(value);
2562
+ if (variable) {
2563
+ return { 'flood-color': { value: variable, important } };
2564
+ }
2565
+ const color = CSSValueFormatter.getGlobal(value) || CSSValueFormatter.getColor(value);
2566
+
2567
+ return color ? { 'flood-color': { important, value: color } } : null;
2568
+ }
2569
+
2570
+ /**
2571
+ * Returns font.
2572
+ *
2573
+ * @param value Value.
2574
+ * @param important Important.
2575
+ * @returns Property values
2576
+ */
2577
+ public static getFont(value: string, important: boolean): ICSSPropertyMap | null {
2578
+ const variable = CSSVariableFormatter.getVariable(value);
2579
+ if (variable) {
2580
+ return { font: { value: variable, important } };
2581
+ }
2582
+
2583
+ const lowerValue = value.toLowerCase();
2584
+
2585
+ if (CSSValueFormatter.getGlobal(lowerValue)) {
2586
+ return {
2587
+ ...this.getFontStyle(lowerValue, important),
2588
+ ...this.getFontVariant(lowerValue, important),
2589
+ ...this.getFontWeight(lowerValue, important),
2590
+ ...this.getFontStretch(lowerValue, important),
2591
+ ...this.getFontSize(lowerValue, important),
2592
+ ...this.getLineHeight(lowerValue, important),
2593
+ ...this.getFontFamily(lowerValue, important)
2594
+ };
2595
+ }
2596
+
2597
+ if (SYSTEM_FONT.includes(lowerValue)) {
2598
+ return { font: { value: lowerValue, important } };
2599
+ }
2600
+
2601
+ const properties = {
2602
+ ...this.getFontStyle('normal', important),
2603
+ ...this.getFontVariant('normal', important),
2604
+ ...this.getFontWeight('normal', important),
2605
+ ...this.getFontStretch('normal', important),
2606
+ ...this.getLineHeight('normal', important)
2607
+ };
2608
+
2609
+ const parts = value
2610
+ .replace(/\s*\/\s*/g, '/')
2611
+ .split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
2612
+
2613
+ for (let i = 0, max = parts.length; i < max; i++) {
2614
+ const part = parts[i];
2615
+ if (part.includes('/')) {
2616
+ const [size, height] = part.split('/');
2617
+ const fontSize = this.getFontSize(size, important);
2618
+ const lineHeight = this.getLineHeight(height, important);
2619
+
2620
+ if (!fontSize || !lineHeight) {
2621
+ return null;
2622
+ }
2623
+
2624
+ Object.assign(properties, fontSize, lineHeight);
2625
+ } else {
2626
+ const fontStyle = this.getFontStyle(part, important);
2627
+ const fontVariant = this.getFontVariant(part, important);
2628
+ const fontWeight = this.getFontWeight(part, important);
2629
+ const fontSize = this.getFontSize(part, important);
2630
+ const fontStretch = this.getFontStretch(part, important);
2631
+
2632
+ if (fontStyle) {
2633
+ Object.assign(properties, fontStyle);
2634
+ } else if (fontVariant) {
2635
+ Object.assign(properties, fontVariant);
2636
+ } else if (fontWeight) {
2637
+ Object.assign(properties, fontWeight);
2638
+ } else if (fontSize) {
2639
+ Object.assign(properties, fontSize);
2640
+ } else if (fontStretch) {
2641
+ Object.assign(properties, fontStretch);
2642
+ } else {
2643
+ const fontFamilyValue = parts.slice(i).join(' ');
2644
+ const fontFamily = this.getFontFamily(fontFamilyValue, important);
2645
+ if (!fontFamily) {
2646
+ return null;
2647
+ }
2648
+ Object.assign(properties, fontFamily);
2649
+ break;
2650
+ }
2651
+ }
2652
+ }
2653
+
2654
+ return properties;
2655
+ }
2656
+
2657
+ /**
2658
+ * Returns font style.
2659
+ *
2660
+ * @param value Value.
2661
+ * @param important Important.
2662
+ * @returns Property values
2663
+ */
2664
+ public static getFontStyle(value: string, important: boolean): ICSSPropertyMap | null {
2665
+ const variable = CSSVariableFormatter.getVariable(value);
2666
+ if (variable) {
2667
+ return { 'font-style': { value: variable, important } };
2668
+ }
2669
+
2670
+ const lowerValue = value.toLowerCase();
2671
+ if (CSSValueFormatter.getGlobal(lowerValue) || FONT_STYLE.includes(lowerValue)) {
2672
+ return { 'font-style': { value: lowerValue, important } };
2673
+ }
2674
+ const parts = value.split(SPLIT_SPACE_SEPARATED_WITH_PARANTHESES_REGEXP);
2675
+ if (parts.length === 2 && parts[0] === 'oblique') {
2676
+ const degree = CSSValueFormatter.getDegree(parts[1]);
2677
+ return degree ? { 'font-style': { value: lowerValue, important } } : null;
2678
+ }
2679
+ return null;
2680
+ }
2681
+
2682
+ /**
2683
+ * Returns font variant.
2684
+ *
2685
+ * @param value Value.
2686
+ * @param important Important.
2687
+ * @returns Property values
2688
+ */
2689
+ public static getFontVariant(value: string, important: boolean): ICSSPropertyMap | null {
2690
+ const variable = CSSVariableFormatter.getVariable(value);
2691
+ if (variable) {
2692
+ return { 'font-variant': { value: variable, important } };
2693
+ }
2694
+
2695
+ const lowerValue = value.toLowerCase();
2696
+ return CSSValueFormatter.getGlobal(lowerValue) ||
2697
+ lowerValue === 'normal' ||
2698
+ lowerValue === 'small-caps'
2699
+ ? { 'font-variant': { value: lowerValue, important } }
2700
+ : null;
2701
+ }
2702
+
2703
+ /**
2704
+ * Returns font strech.
2705
+ *
2706
+ * @param value Value.
2707
+ * @param important Important.
2708
+ * @returns Property values
2709
+ */
2710
+ public static getFontStretch(value: string, important: boolean): ICSSPropertyMap | null {
2711
+ const variable = CSSVariableFormatter.getVariable(value);
2712
+ if (variable) {
2713
+ return { 'font-stretch': { value: variable, important } };
2714
+ }
2715
+
2716
+ const lowerValue = value.toLowerCase();
2717
+ if (CSSValueFormatter.getGlobal(lowerValue) || FONT_STRETCH.includes(lowerValue)) {
2718
+ return { 'font-stretch': { value: lowerValue, important } };
2719
+ }
2720
+ const percentage = CSSValueFormatter.getPercentage(value);
2721
+ return percentage ? { 'font-stretch': { value: percentage, important } } : null;
2722
+ }
2723
+
2724
+ /**
2725
+ * Returns font weight.
2726
+ *
2727
+ * @param value Value.
2728
+ * @param important Important.
2729
+ * @returns Property values
2730
+ */
2731
+ public static getFontWeight(value: string, important: boolean): ICSSPropertyMap | null {
2732
+ const variable = CSSVariableFormatter.getVariable(value);
2733
+ if (variable) {
2734
+ return { 'font-weight': { value: variable, important } };
2735
+ }
2736
+
2737
+ const lowerValue = value.toLowerCase();
2738
+ if (CSSValueFormatter.getGlobal(lowerValue) || FONT_WEIGHT.includes(lowerValue)) {
2739
+ return { 'font-weight': { value: lowerValue, important } };
2740
+ }
2741
+ const integer = CSSValueFormatter.getInteger(value);
2742
+ return integer ? { 'font-weight': { value: integer, important } } : null;
2743
+ }
2744
+
2745
+ /**
2746
+ * Returns font size.
2747
+ *
2748
+ * @param value Value.
2749
+ * @param important Important.
2750
+ * @returns Property values
2751
+ */
2752
+ public static getFontSize(value: string, important: boolean): ICSSPropertyMap | null {
2753
+ const variable = CSSVariableFormatter.getVariable(value);
2754
+ if (variable) {
2755
+ return { 'font-size': { value: variable, important } };
2756
+ }
2757
+
2758
+ const lowerValue = value.toLowerCase();
2759
+ if (CSSValueFormatter.getGlobal(lowerValue) || FONT_SIZE.includes(lowerValue)) {
2760
+ return { 'font-size': { value: lowerValue, important } };
2761
+ }
2762
+ const measurement = CSSValueFormatter.getMeasurement(value);
2763
+ return measurement ? { 'font-size': { value: measurement, important } } : null;
2764
+ }
2765
+
2766
+ /**
2767
+ * Returns line height.
2768
+ *
2769
+ * @param value Value.
2770
+ * @param important Important.
2771
+ * @returns Property values
2772
+ */
2773
+ public static getLineHeight(value: string, important: boolean): ICSSPropertyMap | null {
2774
+ const variable = CSSVariableFormatter.getVariable(value);
2775
+ if (variable) {
2776
+ return { 'line-height': { value: variable, important } };
2777
+ }
2778
+
2779
+ const lowerValue = value.toLowerCase();
2780
+ if (CSSValueFormatter.getGlobal(lowerValue) || lowerValue === 'normal') {
2781
+ return { 'line-height': { value: lowerValue, important } };
2782
+ }
2783
+ const lineHeight = CSSValueFormatter.getFloat(value) || CSSValueFormatter.getMeasurement(value);
2784
+ return lineHeight ? { 'line-height': { value: lineHeight, important } } : null;
2785
+ }
2786
+
2787
+ /**
2788
+ * Returns font family.
2789
+ *
2790
+ * @param value Value.
2791
+ * @param important Important.
2792
+ * @returns Property values
2793
+ */
2794
+ public static getFontFamily(value: string, important: boolean): ICSSPropertyMap | null {
2795
+ const variable = CSSVariableFormatter.getVariable(value);
2796
+ if (variable) {
2797
+ return { 'font-family': { value: variable, important } };
2798
+ }
2799
+
2800
+ const globalValue = CSSValueFormatter.getGlobal(value);
2801
+
2802
+ if (globalValue) {
2803
+ return { 'font-family': { value: globalValue, important } };
2804
+ }
2805
+
2806
+ const parts = value.split(',');
2807
+ let parsedValue = '';
2808
+ let endWithApostroph = false;
2809
+
2810
+ for (let i = 0, max = parts.length; i < max; i++) {
2811
+ let trimmedPart = parts[i].trim().replace(/'/g, '"');
2812
+
2813
+ if (!trimmedPart) {
2814
+ return null;
2815
+ }
2816
+
2817
+ if (trimmedPart.includes(' ')) {
2818
+ const apostrophCount = (trimmedPart.match(/"/g) || []).length;
2819
+ if ((trimmedPart[0] !== '"' || i !== 0) && apostrophCount !== 2 && apostrophCount !== 0) {
2820
+ return null;
2821
+ }
2822
+ if (trimmedPart[0] === '"' && trimmedPart[trimmedPart.length - 1] !== '"') {
2823
+ endWithApostroph = true;
2824
+ } else if (trimmedPart[0] !== '"' && trimmedPart[trimmedPart.length - 1] !== '"') {
2825
+ trimmedPart = `"${trimmedPart}"`;
2826
+ }
2827
+ } else {
2828
+ trimmedPart = trimmedPart.replace(/"/g, '');
2829
+ }
2830
+
2831
+ if (i > 0) {
2832
+ parsedValue += ', ';
2833
+ }
2834
+
2835
+ parsedValue += trimmedPart;
2836
+ }
2837
+
2838
+ if (endWithApostroph) {
2839
+ parsedValue += '"';
2840
+ }
2841
+
2842
+ if (!parsedValue) {
2843
+ return null;
2844
+ }
2845
+
2846
+ return {
2847
+ 'font-family': {
2848
+ important,
2849
+ value: parsedValue
2850
+ }
2851
+ };
2852
+ }
2853
+
2854
+ /**
2855
+ * Returns font family.
2856
+ *
2857
+ * @param value Value.
2858
+ * @param important Important.
2859
+ * @returns Property values
2860
+ */
2861
+ public static getTextTransform(value: string, important: boolean): ICSSPropertyMap | null {
2862
+ const variable = CSSVariableFormatter.getVariable(value);
2863
+ if (variable) {
2864
+ return { 'text-transform': { value: variable, important } };
2865
+ }
2866
+
2867
+ const lowerValue = value.toLowerCase();
2868
+ const parsedValue =
2869
+ CSSValueFormatter.getGlobal(lowerValue) ||
2870
+ (TEXT_TRANSFORM.includes(lowerValue) && lowerValue);
2871
+ if (parsedValue) {
2872
+ return {
2873
+ 'text-transform': { value: parsedValue, important }
2874
+ };
2875
+ }
2876
+ return null;
2877
+ }
2878
+
2879
+ /**
2880
+ * Returns visibility.
2881
+ *
2882
+ * @param value Value.
2883
+ * @param important Important.
2884
+ * @returns Property
2885
+ */
2886
+ public static getVisibility(value: string, important: boolean): ICSSPropertyMap | null {
2887
+ const variable = CSSVariableFormatter.getVariable(value);
2888
+ if (variable) {
2889
+ return { visibility: { value: variable, important } };
2890
+ }
2891
+
2892
+ const lowerValue = value.toLowerCase();
2893
+ const parsedValue =
2894
+ CSSValueFormatter.getGlobal(lowerValue) || (VISIBILITY.includes(lowerValue) && lowerValue);
2895
+ if (parsedValue) {
2896
+ return {
2897
+ visibility: { value: parsedValue, important }
2898
+ };
2899
+ }
2900
+ return null;
2901
+ }
2902
+
2903
+ /**
2904
+ * Returns aspect ratio.
2905
+ *
2906
+ * @param value Value.
2907
+ * @param important Important.
2908
+ * @returns Property
2909
+ */
2910
+ public static getAspectRatio(value: string, important: boolean): ICSSPropertyMap | null {
2911
+ const variable = CSSVariableFormatter.getVariable(value);
2912
+ if (variable) {
2913
+ return { 'aspect-ratio': { value: variable, important } };
2914
+ }
2915
+
2916
+ const lowerValue = value.toLowerCase();
2917
+
2918
+ if (CSSValueFormatter.getGlobal(lowerValue)) {
2919
+ return { 'aspect-ratio': { value: lowerValue, important } };
2920
+ }
2921
+
2922
+ let parsedValue = value;
2923
+
2924
+ const hasAuto = parsedValue.includes('auto');
2925
+
2926
+ if (hasAuto) {
2927
+ parsedValue = parsedValue.replace('auto', '');
2928
+ }
2929
+
2930
+ parsedValue = parsedValue.replace(WHITE_SPACE_GLOBAL_REGEXP, '');
2931
+
2932
+ if (!parsedValue) {
2933
+ return { 'aspect-ratio': { value: 'auto', important } };
2934
+ }
2935
+
2936
+ const aspectRatio = parsedValue.split('/');
2937
+
2938
+ if (aspectRatio.length > 3) {
2939
+ return null;
2940
+ }
2941
+
2942
+ const width = Number(aspectRatio[0]);
2943
+ const height = aspectRatio[1] ? Number(aspectRatio[1]) : 1;
2944
+
2945
+ if (isNaN(width) || isNaN(height)) {
2946
+ return null;
2947
+ }
2948
+
2949
+ if (hasAuto) {
2950
+ return { 'aspect-ratio': { value: `auto ${width} / ${height}`, important } };
2951
+ }
2952
+
2953
+ return { 'aspect-ratio': { value: `${width} / ${height}`, important } };
2954
+ }
2955
+ }