@rindo/core 1.8.12 → 2.5.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 (608) hide show
  1. package/LICENSE.md +27 -27
  2. package/bin/cli.ts +20 -0
  3. package/bin/rindo +51 -22
  4. package/cli/index.cjs +1263 -0
  5. package/cli/index.d.ts +15 -0
  6. package/cli/index.js +1237 -0
  7. package/cli/package.json +14 -0
  8. package/compiler/lib.d.ts +24 -0
  9. package/compiler/lib.dom.d.ts +20230 -0
  10. package/compiler/lib.dom.iterable.d.ts +351 -0
  11. package/compiler/lib.es2015.collection.d.ts +89 -0
  12. package/compiler/lib.es2015.core.d.ts +517 -0
  13. package/compiler/lib.es2015.d.ts +30 -0
  14. package/compiler/lib.es2015.generator.d.ts +79 -0
  15. package/compiler/lib.es2015.iterable.d.ts +505 -0
  16. package/compiler/lib.es2015.promise.d.ts +150 -0
  17. package/compiler/lib.es2015.proxy.d.ts +41 -0
  18. package/compiler/lib.es2015.reflect.d.ts +123 -0
  19. package/compiler/lib.es2015.symbol.d.ts +48 -0
  20. package/compiler/lib.es2015.symbol.wellknown.d.ts +324 -0
  21. package/compiler/lib.es2016.array.include.d.ts +118 -0
  22. package/compiler/lib.es2016.d.ts +22 -0
  23. package/compiler/lib.es2016.full.d.ts +25 -0
  24. package/compiler/lib.es2017.d.ts +26 -0
  25. package/compiler/lib.es2017.full.d.ts +25 -0
  26. package/compiler/lib.es2017.intl.d.ts +32 -0
  27. package/compiler/lib.es2017.object.d.ts +51 -0
  28. package/compiler/lib.es2017.sharedmemory.d.ts +137 -0
  29. package/compiler/lib.es2017.string.d.ts +47 -0
  30. package/compiler/lib.es2017.typedarrays.d.ts +55 -0
  31. package/compiler/lib.es2018.asyncgenerator.d.ts +79 -0
  32. package/compiler/lib.es2018.asynciterable.d.ts +45 -0
  33. package/compiler/lib.es2018.d.ts +26 -0
  34. package/compiler/lib.es2018.full.d.ts +25 -0
  35. package/compiler/lib.es2018.intl.d.ts +61 -0
  36. package/compiler/lib.es2018.promise.d.ts +32 -0
  37. package/compiler/lib.es2018.regexp.d.ts +39 -0
  38. package/compiler/lib.es2019.array.d.ts +85 -0
  39. package/compiler/lib.es2019.d.ts +25 -0
  40. package/compiler/lib.es2019.full.d.ts +25 -0
  41. package/compiler/lib.es2019.object.d.ts +35 -0
  42. package/compiler/lib.es2019.string.d.ts +33 -0
  43. package/compiler/lib.es2019.symbol.d.ts +26 -0
  44. package/compiler/lib.es2020.bigint.d.ts +728 -0
  45. package/compiler/lib.es2020.d.ts +27 -0
  46. package/compiler/lib.es2020.full.d.ts +25 -0
  47. package/compiler/lib.es2020.intl.d.ts +310 -0
  48. package/compiler/lib.es2020.promise.d.ts +50 -0
  49. package/compiler/lib.es2020.sharedmemory.d.ts +99 -0
  50. package/compiler/lib.es2020.string.d.ts +30 -0
  51. package/compiler/lib.es2020.symbol.wellknown.d.ts +39 -0
  52. package/compiler/lib.es5.d.ts +4435 -0
  53. package/compiler/lib.es6.d.ts +25 -0
  54. package/compiler/lib.esnext.d.ts +25 -0
  55. package/compiler/lib.esnext.full.d.ts +25 -0
  56. package/compiler/lib.esnext.intl.d.ts +32 -0
  57. package/compiler/lib.esnext.promise.d.ts +43 -0
  58. package/compiler/lib.esnext.string.d.ts +35 -0
  59. package/compiler/lib.esnext.weakref.d.ts +75 -0
  60. package/compiler/lib.scripthost.d.ts +327 -0
  61. package/compiler/lib.webworker.d.ts +6042 -0
  62. package/compiler/lib.webworker.importscripts.d.ts +26 -0
  63. package/compiler/lib.webworker.iterable.d.ts +166 -0
  64. package/compiler/package.json +8 -6
  65. package/compiler/rindo.d.ts +95 -0
  66. package/compiler/rindo.js +65051 -6657
  67. package/compiler/rindo.min.js +4 -0
  68. package/dependencies.json +103 -0
  69. package/dev-server/client/app-error.d.ts +18 -0
  70. package/dev-server/client/events.d.ts +6 -0
  71. package/dev-server/client/hmr-components.d.ts +1 -0
  72. package/dev-server/client/hmr-external-styles.d.ts +1 -0
  73. package/dev-server/client/hmr-images.d.ts +1 -0
  74. package/dev-server/client/hmr-inline-styles.d.ts +1 -0
  75. package/dev-server/client/hmr-util.d.ts +9 -0
  76. package/dev-server/client/hmr-window.d.ts +10 -0
  77. package/dev-server/client/index.d.ts +6 -0
  78. package/dev-server/client/index.js +808 -0
  79. package/dev-server/client/logger.d.ts +5 -0
  80. package/dev-server/client/package.json +8 -0
  81. package/dev-server/client/progress.d.ts +3 -0
  82. package/dev-server/client/status.d.ts +4 -0
  83. package/dev-server/connector.html +6 -0
  84. package/dev-server/index.d.ts +3 -0
  85. package/dev-server/index.js +264 -0
  86. package/dev-server/open-in-editor-api.js +1 -0
  87. package/dev-server/package.json +8 -0
  88. package/dev-server/server-process.js +1738 -0
  89. package/dev-server/server-worker-thread.js +39 -0
  90. package/{dist/dev-server → dev-server}/templates/directory-index.html +132 -132
  91. package/{dist/dev-server → dev-server}/templates/initial-load.html +160 -160
  92. package/dev-server/ws.js +1 -0
  93. package/internal/app-data/index.cjs +90 -0
  94. package/internal/app-data/index.d.ts +4 -0
  95. package/internal/{client/build-conditionals.mjs → app-data/index.js} +25 -21
  96. package/internal/app-data/package.json +15 -0
  97. package/internal/client/css-shim.js +4 -0
  98. package/internal/client/{dom.rindo-client.mjs → dom.js} +73 -137
  99. package/{dist/client/index.mjs → internal/client/index.js} +863 -789
  100. package/internal/client/package.json +8 -0
  101. package/internal/client/patch-browser.js +120 -0
  102. package/internal/client/patch-esm.js +23 -0
  103. package/internal/client/polyfills/core-js.js +11 -10
  104. package/internal/client/polyfills/css-shim.js +1 -656
  105. package/internal/client/polyfills/dom.js +79 -146
  106. package/internal/client/polyfills/es5-html-element.js +1 -18
  107. package/internal/client/polyfills/index.js +34 -35
  108. package/internal/client/{shadow-css.rindo-client.mjs → shadow-css.js} +20 -17
  109. package/internal/hydrate/index.js +1097 -0
  110. package/internal/hydrate/package.json +7 -0
  111. package/internal/hydrate/runner.d.ts +217 -0
  112. package/internal/hydrate/runner.js +777 -0
  113. package/internal/hydrate/shadow-css.js +146 -0
  114. package/internal/index.d.ts +4 -18
  115. package/internal/index.js +1 -1
  116. package/internal/package.json +9 -6
  117. package/internal/rindo-core/index.cjs +1 -0
  118. package/internal/rindo-core/index.d.ts +51 -0
  119. package/internal/rindo-core/index.js +15 -0
  120. package/internal/rindo-ext-modules.d.ts +41 -0
  121. package/internal/rindo-private.d.ts +2128 -0
  122. package/internal/rindo-public-compiler.d.ts +2170 -0
  123. package/{dist/declarations/docs.d.ts → internal/rindo-public-docs.d.ts} +13 -1
  124. package/internal/rindo-public-runtime.d.ts +1555 -0
  125. package/internal/testing/index.js +1055 -0
  126. package/internal/testing/package.json +7 -0
  127. package/internal/testing/shadow-css.js +146 -0
  128. package/mock-doc/index.cjs +4610 -0
  129. package/mock-doc/index.d.ts +916 -0
  130. package/mock-doc/index.js +4574 -2
  131. package/mock-doc/package.json +15 -10
  132. package/package.json +132 -186
  133. package/readme.md +21 -174
  134. package/screenshot/compare/build/app.css +1 -1
  135. package/screenshot/compare/build/app.esm.js +1 -1
  136. package/screenshot/compare/build/app.js +33 -818
  137. package/screenshot/compare/build/{p-113f7459.js → p-081b0641.js} +1 -1
  138. package/screenshot/compare/build/p-227a1e18.entry.js +1 -0
  139. package/screenshot/compare/build/p-2c298727.entry.js +1 -0
  140. package/screenshot/compare/build/p-5479268c.entry.js +1 -0
  141. package/screenshot/compare/build/p-573ec8a4.entry.js +1 -0
  142. package/screenshot/compare/build/p-6ba08604.entry.js +1 -0
  143. package/screenshot/compare/build/p-6bc63295.entry.js +1 -0
  144. package/screenshot/compare/build/p-7a3759fd.entry.js +1 -0
  145. package/screenshot/compare/build/{p-ejpsp3kx.js → p-7b4e3ba7.js} +1 -1
  146. package/screenshot/compare/build/p-988eb362.css +1 -0
  147. package/screenshot/compare/build/p-9b6a9315.js +1 -0
  148. package/screenshot/compare/build/p-b4cc611c.entry.js +1 -0
  149. package/screenshot/compare/build/p-d1bf53f5.entry.js +1 -0
  150. package/screenshot/compare/build/{p-efb0eac6.js → p-e2efe0df.js} +1 -1
  151. package/screenshot/compare/build/p-e8ca6d97.entry.js +1 -0
  152. package/screenshot/compare/build/p-ec2f13e0.entry.js +1 -0
  153. package/screenshot/compare/build/p-f0b99977.entry.js +1 -0
  154. package/screenshot/compare/build/p-f4745c2f.entry.js +1 -0
  155. package/screenshot/compare/build/p-fbbae598.js +1 -0
  156. package/screenshot/compare/host.config.json +14 -14
  157. package/screenshot/compare/index.html +1 -1
  158. package/{dist/screenshot → screenshot}/connector-base.d.ts +1 -1
  159. package/{dist/screenshot → screenshot}/connector-local.d.ts +1 -1
  160. package/screenshot/connector.js +2 -3
  161. package/{dist/screenshot → screenshot}/index.d.ts +1 -1
  162. package/screenshot/index.js +659 -2
  163. package/screenshot/local-connector.js +2 -3
  164. package/screenshot/package.json +15 -13
  165. package/screenshot/pixel-match.js +62 -49
  166. package/screenshot/screenshot-compare.d.ts +3 -0
  167. package/{dist/screenshot → screenshot}/screenshot-fs.d.ts +1 -1
  168. package/sys/deno/index.js +1785 -0
  169. package/sys/deno/node-compat.js +2654 -0
  170. package/sys/deno/worker.js +44 -0
  171. package/sys/node/autoprefixer.js +8 -0
  172. package/sys/node/glob.js +1 -0
  173. package/sys/node/graceful-fs.js +1 -0
  174. package/sys/node/index.d.ts +18 -0
  175. package/sys/node/index.js +1386 -2
  176. package/sys/node/node-fetch.js +1 -0
  177. package/sys/node/package.json +8 -5
  178. package/sys/node/prompts.js +1 -0
  179. package/sys/node/worker.js +52 -0
  180. package/{dist/testing → testing}/index.d.ts +5 -6
  181. package/testing/index.js +4017 -2
  182. package/testing/jest/jest-config.d.ts +5 -0
  183. package/{dist/testing → testing}/jest/jest-environment.d.ts +4 -2
  184. package/{dist/testing → testing}/jest/jest-preprocessor.d.ts +1 -0
  185. package/{dist/testing → testing}/jest/jest-runner.d.ts +1 -1
  186. package/{dist/testing → testing}/jest/jest-screenshot.d.ts +1 -1
  187. package/{dist/testing → testing}/jest/jest-serializer.d.ts +1 -1
  188. package/testing/jest-environment.js +3 -3
  189. package/testing/jest-preprocessor.js +3 -3
  190. package/testing/jest-preset.js +32 -40
  191. package/testing/jest-runner.js +3 -3
  192. package/testing/jest-setuptestframework.js +3 -3
  193. package/{dist/testing → testing}/matchers/events.d.ts +9 -1
  194. package/{dist/testing → testing}/matchers/index.d.ts +3 -1
  195. package/{dist/testing → testing}/matchers/screenshot.d.ts +1 -1
  196. package/testing/mock-fetch.d.ts +11 -0
  197. package/testing/mocks.d.ts +14 -0
  198. package/testing/package.json +8 -6
  199. package/testing/puppeteer/index.d.ts +2 -0
  200. package/{dist/testing → testing}/puppeteer/puppeteer-browser.d.ts +3 -3
  201. package/{dist/testing → testing}/puppeteer/puppeteer-declarations.d.ts +18 -18
  202. package/{dist/testing → testing}/puppeteer/puppeteer-element.d.ts +7 -5
  203. package/testing/puppeteer/puppeteer-emulate.d.ts +2 -0
  204. package/{dist/testing → testing}/puppeteer/puppeteer-events.d.ts +9 -9
  205. package/testing/puppeteer/puppeteer-page.d.ts +2 -0
  206. package/testing/puppeteer/puppeteer-screenshot.d.ts +4 -0
  207. package/testing/reset-build-conditionals.d.ts +2 -0
  208. package/testing/spec-page.d.ts +2 -0
  209. package/testing/test-transpile.d.ts +2 -0
  210. package/{dist/testing → testing}/testing-logger.d.ts +10 -8
  211. package/testing/testing-sys.d.ts +1 -0
  212. package/{dist/testing → testing}/testing-utils.d.ts +3 -2
  213. package/testing/testing.d.ts +2 -0
  214. package/build-conditionals/index.d.ts +0 -2
  215. package/build-conditionals/index.mjs +0 -66
  216. package/build-conditionals/package.json +0 -6
  217. package/compiler/index.js +0 -2
  218. package/dist/cli/index.js +0 -6068
  219. package/dist/client/css-shim-14a9812e.js +0 -656
  220. package/dist/client/css-shim-69821662.js +0 -658
  221. package/dist/client/declarations/rindo.core.d.ts +0 -1347
  222. package/dist/client/dom-68c8fe31.js +0 -139
  223. package/dist/client/dom-af01458a.js +0 -137
  224. package/dist/client/index.js +0 -2937
  225. package/dist/client/polyfills/core-js.js +0 -10
  226. package/dist/client/polyfills/css-shim.js +0 -656
  227. package/dist/client/polyfills/dom.js +0 -146
  228. package/dist/client/polyfills/es5-html-element.js +0 -18
  229. package/dist/client/polyfills/index.js +0 -35
  230. package/dist/client/polyfills/promise.js +0 -9
  231. package/dist/client/polyfills/system.js +0 -6
  232. package/dist/client/shadow-css-6ef31c68.js +0 -386
  233. package/dist/client/shadow-css-8fd1a9e4.js +0 -388
  234. package/dist/compiler/app-core/app-es5-disabled.d.ts +0 -2
  235. package/dist/compiler/app-core/app-polyfills.d.ts +0 -3
  236. package/dist/compiler/app-core/build-conditionals.d.ts +0 -6
  237. package/dist/compiler/app-core/bundle-app-core.d.ts +0 -6
  238. package/dist/compiler/app-core/component-styles.d.ts +0 -4
  239. package/dist/compiler/app-core/format-component-runtime-meta.d.ts +0 -4
  240. package/dist/compiler/app-core/optimize-module.d.ts +0 -7
  241. package/dist/compiler/browser/build-conditionals-client.d.ts +0 -3
  242. package/dist/compiler/browser/compile-options.d.ts +0 -12
  243. package/dist/compiler/browser/compile.d.ts +0 -2
  244. package/dist/compiler/browser/create-compiler.d.ts +0 -14
  245. package/dist/compiler/browser/index.d.ts +0 -11
  246. package/dist/compiler/build/build-ctx.d.ts +0 -74
  247. package/dist/compiler/build/build-finish.d.ts +0 -3
  248. package/dist/compiler/build/build-hmr.d.ts +0 -2
  249. package/dist/compiler/build/build-results.d.ts +0 -2
  250. package/dist/compiler/build/build-stats.d.ts +0 -3
  251. package/dist/compiler/build/build.d.ts +0 -2
  252. package/dist/compiler/build/cache-stats.d.ts +0 -4
  253. package/dist/compiler/build/compiler-build-id.d.ts +0 -6
  254. package/dist/compiler/build/compiler-ctx.d.ts +0 -44
  255. package/dist/compiler/build/init-index-html.d.ts +0 -2
  256. package/dist/compiler/build/validate-files.d.ts +0 -2
  257. package/dist/compiler/build/write-build.d.ts +0 -2
  258. package/dist/compiler/cache.d.ts +0 -22
  259. package/dist/compiler/compiler.d.ts +0 -27
  260. package/dist/compiler/component-hydrate/bundle-hydrate-factory.d.ts +0 -3
  261. package/dist/compiler/component-hydrate/generate-hydrate-app.d.ts +0 -2
  262. package/dist/compiler/component-hydrate/hydrate-factory-closure.d.ts +0 -2
  263. package/dist/compiler/component-hydrate/update-to-hydrate-components.d.ts +0 -2
  264. package/dist/compiler/component-hydrate/write-hydrate-outputs.d.ts +0 -3
  265. package/dist/compiler/component-lazy/generate-cjs.d.ts +0 -3
  266. package/dist/compiler/component-lazy/generate-esm-browser.d.ts +0 -3
  267. package/dist/compiler/component-lazy/generate-esm.d.ts +0 -3
  268. package/dist/compiler/component-lazy/generate-lazy-app.d.ts +0 -3
  269. package/dist/compiler/component-lazy/generate-lazy-module.d.ts +0 -4
  270. package/dist/compiler/component-lazy/generate-system.d.ts +0 -3
  271. package/dist/compiler/component-lazy/update-to-lazy-component.d.ts +0 -2
  272. package/dist/compiler/component-lazy/write-lazy-entry-module.d.ts +0 -2
  273. package/dist/compiler/component-native/update-to-native-component.d.ts +0 -2
  274. package/dist/compiler/config/config-reload.d.ts +0 -3
  275. package/dist/compiler/config/config-utils.d.ts +0 -4
  276. package/dist/compiler/config/validate-config.d.ts +0 -4
  277. package/dist/compiler/config/validate-copy.d.ts +0 -2
  278. package/dist/compiler/config/validate-dev-server.d.ts +0 -2
  279. package/dist/compiler/config/validate-docs.d.ts +0 -2
  280. package/dist/compiler/config/validate-namespace.d.ts +0 -3
  281. package/dist/compiler/config/validate-output-stats.d.ts +0 -2
  282. package/dist/compiler/config/validate-outputs-angular.d.ts +0 -2
  283. package/dist/compiler/config/validate-outputs-custom.d.ts +0 -2
  284. package/dist/compiler/config/validate-outputs-dist-module.d.ts +0 -2
  285. package/dist/compiler/config/validate-outputs-dist.d.ts +0 -2
  286. package/dist/compiler/config/validate-outputs-hydrate-script.d.ts +0 -2
  287. package/dist/compiler/config/validate-outputs-www.d.ts +0 -2
  288. package/dist/compiler/config/validate-outputs.d.ts +0 -2
  289. package/dist/compiler/config/validate-paths.d.ts +0 -2
  290. package/dist/compiler/config/validate-plugins.d.ts +0 -2
  291. package/dist/compiler/config/validate-prerender.d.ts +0 -2
  292. package/dist/compiler/config/validate-rollup-config.d.ts +0 -2
  293. package/dist/compiler/config/validate-service-worker.d.ts +0 -2
  294. package/dist/compiler/config/validate-testing.d.ts +0 -2
  295. package/dist/compiler/config/validate-workers.d.ts +0 -2
  296. package/dist/compiler/copy/assets-copy-tasks.d.ts +0 -3
  297. package/dist/compiler/copy/hashed-copy.d.ts +0 -2
  298. package/dist/compiler/copy/local-copy-tasks.d.ts +0 -3
  299. package/dist/compiler/docs/constants.d.ts +0 -2
  300. package/dist/compiler/docs/custom/index.d.ts +0 -2
  301. package/dist/compiler/docs/docs.d.ts +0 -2
  302. package/dist/compiler/docs/generate-doc-data.d.ts +0 -3
  303. package/dist/compiler/docs/json/index.d.ts +0 -3
  304. package/dist/compiler/docs/readme/docs-util.d.ts +0 -13
  305. package/dist/compiler/docs/readme/index.d.ts +0 -3
  306. package/dist/compiler/docs/readme/markdown-css-props.d.ts +0 -2
  307. package/dist/compiler/docs/readme/markdown-dependencies.d.ts +0 -2
  308. package/dist/compiler/docs/readme/markdown-events.d.ts +0 -2
  309. package/dist/compiler/docs/readme/markdown-methods.d.ts +0 -2
  310. package/dist/compiler/docs/readme/markdown-props.d.ts +0 -2
  311. package/dist/compiler/docs/readme/markdown-slots.d.ts +0 -2
  312. package/dist/compiler/docs/readme/markdown-usage.d.ts +0 -6
  313. package/dist/compiler/docs/readme/output-docs.d.ts +0 -3
  314. package/dist/compiler/docs/style-docs.d.ts +0 -2
  315. package/dist/compiler/docs/vscode/index.d.ts +0 -2
  316. package/dist/compiler/entries/component-bundles.d.ts +0 -3
  317. package/dist/compiler/entries/component-graph.d.ts +0 -2
  318. package/dist/compiler/entries/default-bundles.d.ts +0 -3
  319. package/dist/compiler/entries/entry-modules.d.ts +0 -6
  320. package/dist/compiler/entries/resolve-component-dependencies.d.ts +0 -2
  321. package/dist/compiler/events.d.ts +0 -15
  322. package/dist/compiler/fs-watch/fs-watch-init.d.ts +0 -2
  323. package/dist/compiler/fs-watch/fs-watch-log.d.ts +0 -2
  324. package/dist/compiler/fs-watch/fs-watch-rebuild.d.ts +0 -7
  325. package/dist/compiler/html/inject-module-preloads.d.ts +0 -3
  326. package/dist/compiler/html/inject-sw-script.d.ts +0 -4
  327. package/dist/compiler/html/inline-esm-import.d.ts +0 -2
  328. package/dist/compiler/html/inline-style-sheets.d.ts +0 -2
  329. package/dist/compiler/html/update-global-styles-link.d.ts +0 -2
  330. package/dist/compiler/html/used-components.d.ts +0 -2
  331. package/dist/compiler/html/utils.d.ts +0 -2
  332. package/dist/compiler/html/validate-manifest-json.d.ts +0 -2
  333. package/dist/compiler/index.d.ts +0 -10
  334. package/dist/compiler/index.js +0 -18008
  335. package/dist/compiler/output-targets/empty-dir.d.ts +0 -6
  336. package/dist/compiler/output-targets/index.d.ts +0 -2
  337. package/dist/compiler/output-targets/output-angular.d.ts +0 -4
  338. package/dist/compiler/output-targets/output-app.d.ts +0 -4
  339. package/dist/compiler/output-targets/output-collection.d.ts +0 -3
  340. package/dist/compiler/output-targets/output-copy.d.ts +0 -2
  341. package/dist/compiler/output-targets/output-custom.d.ts +0 -2
  342. package/dist/compiler/output-targets/output-docs.d.ts +0 -2
  343. package/dist/compiler/output-targets/output-hydrate.d.ts +0 -2
  344. package/dist/compiler/output-targets/output-lazy-loader.d.ts +0 -2
  345. package/dist/compiler/output-targets/output-module.d.ts +0 -4
  346. package/dist/compiler/output-targets/output-prerender.d.ts +0 -2
  347. package/dist/compiler/output-targets/output-service-workers.d.ts +0 -2
  348. package/dist/compiler/output-targets/output-types.d.ts +0 -2
  349. package/dist/compiler/output-targets/output-utils.d.ts +0 -54
  350. package/dist/compiler/output-targets/output-www.d.ts +0 -2
  351. package/dist/compiler/plugin/plugin.d.ts +0 -6
  352. package/dist/compiler/prerender/crawl-urls.d.ts +0 -3
  353. package/dist/compiler/prerender/host-config.d.ts +0 -12
  354. package/dist/compiler/prerender/prerender-config.d.ts +0 -2
  355. package/dist/compiler/prerender/prerender-main.d.ts +0 -2
  356. package/dist/compiler/prerender/prerender-queue.d.ts +0 -3
  357. package/dist/compiler/prerender/prerender-template-html.d.ts +0 -2
  358. package/dist/compiler/prerender/prerendered-write-path.d.ts +0 -2
  359. package/dist/compiler/prerender/robots-txt.d.ts +0 -2
  360. package/dist/compiler/prerender/sitemap-xml.d.ts +0 -3
  361. package/dist/compiler/rollup-plugins/component-entry.d.ts +0 -3
  362. package/dist/compiler/rollup-plugins/css-transformer.d.ts +0 -3
  363. package/dist/compiler/rollup-plugins/global-scripts.d.ts +0 -4
  364. package/dist/compiler/rollup-plugins/image-plugin.d.ts +0 -3
  365. package/dist/compiler/rollup-plugins/in-memory-fs-read.d.ts +0 -3
  366. package/dist/compiler/rollup-plugins/loader.d.ts +0 -4
  367. package/dist/compiler/rollup-plugins/plugin-helper.d.ts +0 -5
  368. package/dist/compiler/rollup-plugins/rindo-build-conditionals.d.ts +0 -7
  369. package/dist/compiler/rollup-plugins/rindo-client.d.ts +0 -3
  370. package/dist/compiler/rollup-plugins/rindo-external-runtime.d.ts +0 -2
  371. package/dist/compiler/rollup-plugins/rindo-hydrate.d.ts +0 -3
  372. package/dist/compiler/rollup-plugins/rindo-public-plugin.d.ts +0 -2
  373. package/dist/compiler/service-worker/generate-sw.d.ts +0 -7
  374. package/dist/compiler/service-worker/service-worker-util.d.ts +0 -2
  375. package/dist/compiler/style/cached-styles.d.ts +0 -5
  376. package/dist/compiler/style/component-styles.d.ts +0 -2
  377. package/dist/compiler/style/css-imports.d.ts +0 -9
  378. package/dist/compiler/style/css-to-esm.d.ts +0 -5
  379. package/dist/compiler/style/generate-styles.d.ts +0 -2
  380. package/dist/compiler/style/global-styles.d.ts +0 -3
  381. package/dist/compiler/style/normalize-styles.d.ts +0 -2
  382. package/dist/compiler/style/optimize-css.d.ts +0 -2
  383. package/dist/compiler/style/scope-css.d.ts +0 -3
  384. package/dist/compiler/style/style-utils.d.ts +0 -10
  385. package/dist/compiler/transformers/add-component-meta-proxy.d.ts +0 -3
  386. package/dist/compiler/transformers/add-component-meta-static.d.ts +0 -4
  387. package/dist/compiler/transformers/add-imports.d.ts +0 -3
  388. package/dist/compiler/transformers/collections/add-external-import.d.ts +0 -2
  389. package/dist/compiler/transformers/collections/parse-collection-components.d.ts +0 -2
  390. package/dist/compiler/transformers/collections/parse-collection-deprecated.d.ts +0 -2
  391. package/dist/compiler/transformers/collections/parse-collection-manifest.d.ts +0 -7
  392. package/dist/compiler/transformers/collections/parse-collection-module.d.ts +0 -2
  393. package/dist/compiler/transformers/component-build-conditionals.d.ts +0 -2
  394. package/dist/compiler/transformers/component-hydrate/hydrate-component.d.ts +0 -3
  395. package/dist/compiler/transformers/component-hydrate/hydrate-runtime-cmp-meta.d.ts +0 -3
  396. package/dist/compiler/transformers/component-hydrate/tranform-to-hydrate-component.d.ts +0 -2
  397. package/dist/compiler/transformers/component-lazy/lazy-component.d.ts +0 -3
  398. package/dist/compiler/transformers/component-lazy/lazy-constructor.d.ts +0 -3
  399. package/dist/compiler/transformers/component-lazy/lazy-element-getter.d.ts +0 -3
  400. package/dist/compiler/transformers/component-lazy/transform-lazy-component.d.ts +0 -4
  401. package/dist/compiler/transformers/component-native/native-component.d.ts +0 -3
  402. package/dist/compiler/transformers/component-native/native-connected-callback.d.ts +0 -3
  403. package/dist/compiler/transformers/component-native/native-constructor.d.ts +0 -3
  404. package/dist/compiler/transformers/component-native/native-element-getter.d.ts +0 -3
  405. package/dist/compiler/transformers/component-native/native-static-style.d.ts +0 -3
  406. package/dist/compiler/transformers/component-native/tranform-to-native-component.d.ts +0 -4
  407. package/dist/compiler/transformers/core-runtime-apis.d.ts +0 -30
  408. package/dist/compiler/transformers/create-event.d.ts +0 -3
  409. package/dist/compiler/transformers/decorators-to-static/component-decorator.d.ts +0 -3
  410. package/dist/compiler/transformers/decorators-to-static/convert-decorators.d.ts +0 -3
  411. package/dist/compiler/transformers/decorators-to-static/decorator-utils.d.ts +0 -10
  412. package/dist/compiler/transformers/decorators-to-static/element-decorator.d.ts +0 -3
  413. package/dist/compiler/transformers/decorators-to-static/event-decorator.d.ts +0 -4
  414. package/dist/compiler/transformers/decorators-to-static/listen-decorator.d.ts +0 -6
  415. package/dist/compiler/transformers/decorators-to-static/method-decorator.d.ts +0 -3
  416. package/dist/compiler/transformers/decorators-to-static/prop-decorator.d.ts +0 -4
  417. package/dist/compiler/transformers/decorators-to-static/state-decorator.d.ts +0 -3
  418. package/dist/compiler/transformers/decorators-to-static/style-to-static.d.ts +0 -3
  419. package/dist/compiler/transformers/decorators-to-static/watch-decorator.d.ts +0 -3
  420. package/dist/compiler/transformers/define-custom-element.d.ts +0 -3
  421. package/dist/compiler/transformers/host-data-transform.d.ts +0 -3
  422. package/dist/compiler/transformers/legacy-props.d.ts +0 -3
  423. package/dist/compiler/transformers/remove-static-meta-properties.d.ts +0 -2
  424. package/dist/compiler/transformers/reserved-public-members.d.ts +0 -3
  425. package/dist/compiler/transformers/rindo-import-path.d.ts +0 -3
  426. package/dist/compiler/transformers/static-to-meta/call-expression.d.ts +0 -3
  427. package/dist/compiler/transformers/static-to-meta/class-methods.d.ts +0 -3
  428. package/dist/compiler/transformers/static-to-meta/component.d.ts +0 -3
  429. package/dist/compiler/transformers/static-to-meta/element-ref.d.ts +0 -2
  430. package/dist/compiler/transformers/static-to-meta/encapsulation.d.ts +0 -3
  431. package/dist/compiler/transformers/static-to-meta/events.d.ts +0 -3
  432. package/dist/compiler/transformers/static-to-meta/import.d.ts +0 -3
  433. package/dist/compiler/transformers/static-to-meta/listeners.d.ts +0 -3
  434. package/dist/compiler/transformers/static-to-meta/methods.d.ts +0 -3
  435. package/dist/compiler/transformers/static-to-meta/props.d.ts +0 -3
  436. package/dist/compiler/transformers/static-to-meta/states.d.ts +0 -3
  437. package/dist/compiler/transformers/static-to-meta/string-literal.d.ts +0 -3
  438. package/dist/compiler/transformers/static-to-meta/styles.d.ts +0 -3
  439. package/dist/compiler/transformers/static-to-meta/vdom.d.ts +0 -3
  440. package/dist/compiler/transformers/static-to-meta/visitor.d.ts +0 -3
  441. package/dist/compiler/transformers/static-to-meta/watchers.d.ts +0 -3
  442. package/dist/compiler/transformers/style-imports.d.ts +0 -3
  443. package/dist/compiler/transformers/transform-utils.d.ts +0 -31
  444. package/dist/compiler/transformers/update-component-class.d.ts +0 -3
  445. package/dist/compiler/transformers/update-rindo-core-import.d.ts +0 -3
  446. package/dist/compiler/transformers/watcher-meta-transform.d.ts +0 -3
  447. package/dist/compiler/transpile/compiler-options.d.ts +0 -4
  448. package/dist/compiler/transpile/transpile-app.d.ts +0 -2
  449. package/dist/compiler/transpile/transpile-module.d.ts +0 -5
  450. package/dist/compiler/transpile/transpile-service.d.ts +0 -3
  451. package/dist/compiler/transpile/transpile-to-es5-main.d.ts +0 -2
  452. package/dist/compiler/transpile/validate-types-main.d.ts +0 -2
  453. package/dist/compiler/types/generate-app-types.d.ts +0 -2
  454. package/dist/compiler/types/generate-component-types.d.ts +0 -8
  455. package/dist/compiler/types/generate-event-types.d.ts +0 -2
  456. package/dist/compiler/types/generate-method-types.d.ts +0 -2
  457. package/dist/compiler/types/generate-prop-types.d.ts +0 -2
  458. package/dist/compiler/types/generate-types.d.ts +0 -2
  459. package/dist/compiler/types/rindo-types.d.ts +0 -3
  460. package/dist/compiler/types/types-utils.d.ts +0 -4
  461. package/dist/compiler/types/update-import-refs.d.ts +0 -11
  462. package/dist/compiler/types/validate-package-json.d.ts +0 -9
  463. package/dist/declarations/assets.d.ts +0 -17
  464. package/dist/declarations/browser-compile.d.ts +0 -47
  465. package/dist/declarations/build-conditionals.d.ts +0 -91
  466. package/dist/declarations/build-events.d.ts +0 -19
  467. package/dist/declarations/build.d.ts +0 -247
  468. package/dist/declarations/cache.d.ts +0 -11
  469. package/dist/declarations/collection-manifest.d.ts +0 -106
  470. package/dist/declarations/collection.d.ts +0 -139
  471. package/dist/declarations/compiler.d.ts +0 -53
  472. package/dist/declarations/component-compiler-meta.d.ts +0 -198
  473. package/dist/declarations/component-constructor.d.ts +0 -61
  474. package/dist/declarations/component-interfaces.d.ts +0 -123
  475. package/dist/declarations/config.d.ts +0 -409
  476. package/dist/declarations/css-var-shim.d.ts +0 -9
  477. package/dist/declarations/decorators.d.ts +0 -150
  478. package/dist/declarations/dev-server.d.ts +0 -135
  479. package/dist/declarations/diagnostics.d.ts +0 -21
  480. package/dist/declarations/entry.d.ts +0 -28
  481. package/dist/declarations/events.d.ts +0 -13
  482. package/dist/declarations/file-system.d.ts +0 -91
  483. package/dist/declarations/fs-watch.d.ts +0 -15
  484. package/dist/declarations/host-element.d.ts +0 -53
  485. package/dist/declarations/hydrate.d.ts +0 -99
  486. package/dist/declarations/in-memory-fs.d.ts +0 -59
  487. package/dist/declarations/index.d.ts +0 -45
  488. package/dist/declarations/jsdoc.d.ts +0 -16
  489. package/dist/declarations/jsx.d.ts +0 -1050
  490. package/dist/declarations/logger.d.ts +0 -25
  491. package/dist/declarations/minify-js.d.ts +0 -11
  492. package/dist/declarations/module.d.ts +0 -35
  493. package/dist/declarations/optimize-css.d.ts +0 -12
  494. package/dist/declarations/output-targets.d.ts +0 -189
  495. package/dist/declarations/plugin.d.ts +0 -23
  496. package/dist/declarations/prerender.d.ts +0 -79
  497. package/dist/declarations/render.d.ts +0 -62
  498. package/dist/declarations/runtime.d.ts +0 -92
  499. package/dist/declarations/screenshots.d.ts +0 -192
  500. package/dist/declarations/server.d.ts +0 -19
  501. package/dist/declarations/style.d.ts +0 -35
  502. package/dist/declarations/system.d.ts +0 -174
  503. package/dist/declarations/testing.d.ts +0 -523
  504. package/dist/declarations/transpile.d.ts +0 -24
  505. package/dist/declarations/types.d.ts +0 -24
  506. package/dist/declarations/vdom.d.ts +0 -55
  507. package/dist/declarations/worker.d.ts +0 -33
  508. package/dist/dev-server/content-type-db.json +0 -1
  509. package/dist/dev-server/index.js +0 -887
  510. package/dist/dev-server/static/app-error.css +0 -257
  511. package/dist/dev-server/static/dev-server-client.html +0 -13
  512. package/dist/hydrate/index.d.ts +0 -101
  513. package/dist/hydrate/index.mjs +0 -1281
  514. package/dist/hydrate/platform.mjs +0 -347
  515. package/dist/index.d.ts +0 -99
  516. package/dist/index.js +0 -1
  517. package/dist/mock-doc/index.d.ts +0 -851
  518. package/dist/mock-doc/index.js +0 -3982
  519. package/dist/mock-doc/index.mjs +0 -3954
  520. package/dist/runtime/index.js +0 -2576
  521. package/dist/runtime/index.mjs +0 -2521
  522. package/dist/runtime/shadow-css-6ef31c68.js +0 -386
  523. package/dist/runtime/shadow-css-8fd1a9e4.js +0 -388
  524. package/dist/screenshot/index.js +0 -520
  525. package/dist/sys/node/graceful-fs.js +0 -975
  526. package/dist/sys/node/index.js +0 -33545
  527. package/dist/sys/node/node-fetch.js +0 -1779
  528. package/dist/sys/node/open-in-editor.js +0 -734
  529. package/dist/sys/node/sys-worker.js +0 -67035
  530. package/dist/sys/node/websocket.js +0 -3728
  531. package/dist/testing/build-conditionals.d.ts +0 -4
  532. package/dist/testing/build-conditionals.js +0 -43
  533. package/dist/testing/core.d.ts +0 -35
  534. package/dist/testing/core.js +0 -52
  535. package/dist/testing/index.js +0 -40511
  536. package/dist/testing/jest/jest-config.d.ts +0 -4
  537. package/dist/testing/mock-fetch.d.ts +0 -46
  538. package/dist/testing/mocks.d.ts +0 -12
  539. package/dist/testing/platform.d.ts +0 -23
  540. package/dist/testing/platform.js +0 -321
  541. package/dist/testing/puppeteer/puppeteer-emulate.d.ts +0 -2
  542. package/dist/testing/puppeteer/puppeteer-find.d.ts +0 -5
  543. package/dist/testing/puppeteer/puppeteer-page.d.ts +0 -2
  544. package/dist/testing/puppeteer/puppeteer-screenshot.d.ts +0 -4
  545. package/dist/testing/spec-page.d.ts +0 -5
  546. package/dist/testing/task-queue.d.ts +0 -15
  547. package/dist/testing/test-transpile.d.ts +0 -5
  548. package/dist/testing/testing-fs.d.ts +0 -31
  549. package/dist/testing/testing-sys.d.ts +0 -19
  550. package/dist/testing/testing.d.ts +0 -12
  551. package/dist/utils/index.js +0 -1575
  552. package/dist/utils/index.mjs +0 -1511
  553. package/internal/client/css-shim.rindo-client.mjs +0 -656
  554. package/internal/client/index.mjs +0 -2859
  555. package/internal/client/polyfills/promise.js +0 -9
  556. package/internal/images.d.ts +0 -5
  557. package/runtime/package.json +0 -5
  558. package/screenshot/compare/build/p-020f8d73.js +0 -1
  559. package/screenshot/compare/build/p-09qdknbg.system.entry.js +0 -1
  560. package/screenshot/compare/build/p-0a13mpsc.system.entry.js +0 -1
  561. package/screenshot/compare/build/p-168ec2c4.system.js +0 -1
  562. package/screenshot/compare/build/p-2ab1fdf1.system.js +0 -1
  563. package/screenshot/compare/build/p-2pxcsgrj.entry.js +0 -1
  564. package/screenshot/compare/build/p-42fb7034.system.js +0 -1
  565. package/screenshot/compare/build/p-54d9d7c2.system.js +0 -1
  566. package/screenshot/compare/build/p-67c1f911.js +0 -1
  567. package/screenshot/compare/build/p-68613371.system.js +0 -1
  568. package/screenshot/compare/build/p-7dvsjpu0.entry.js +0 -1
  569. package/screenshot/compare/build/p-aa67fb06.js +0 -1
  570. package/screenshot/compare/build/p-aeb3cec1.system.js +0 -1
  571. package/screenshot/compare/build/p-b6e44a24.js +0 -1
  572. package/screenshot/compare/build/p-c1c25b8a.js +0 -1
  573. package/screenshot/compare/build/p-c9bopbjy.system.entry.js +0 -1
  574. package/screenshot/compare/build/p-c9iqz1pp.system.entry.js +0 -1
  575. package/screenshot/compare/build/p-dizjz8rg.entry.js +0 -1
  576. package/screenshot/compare/build/p-dnta0rwp.system.entry.js +0 -1
  577. package/screenshot/compare/build/p-e9670d22.system.js +0 -1
  578. package/screenshot/compare/build/p-ei9jkpd0.system.entry.js +0 -1
  579. package/screenshot/compare/build/p-ejwcppol.entry.js +0 -1
  580. package/screenshot/compare/build/p-f6612d5d.system.js +0 -1
  581. package/screenshot/compare/build/p-foiivsfc.css +0 -1
  582. package/screenshot/compare/build/p-gpjjyogx.entry.js +0 -1
  583. package/screenshot/compare/build/p-howklem2.system.entry.js +0 -1
  584. package/screenshot/compare/build/p-knv9wvoc.entry.js +0 -1
  585. package/screenshot/compare/build/p-nsqsfhhy.entry.js +0 -1
  586. package/screenshot/compare/build/p-ojt278pp.entry.js +0 -1
  587. package/screenshot/compare/build/p-oywass99.entry.js +0 -1
  588. package/screenshot/compare/build/p-q3ujhub6.entry.js +0 -1
  589. package/screenshot/compare/build/p-qw4xnmxv.entry.js +0 -1
  590. package/screenshot/compare/build/p-t1wvevhc.system.entry.js +0 -1
  591. package/screenshot/compare/build/p-tnjarrex.system.entry.js +0 -1
  592. package/screenshot/compare/build/p-vhfpd6kk.system.entry.js +0 -1
  593. package/screenshot/compare/build/p-vk6rhemd.system.entry.js +0 -1
  594. package/screenshot/compare/build/p-w6bnm16k.entry.js +0 -1
  595. package/screenshot/compare/build/p-xje6d7zl.system.entry.js +0 -1
  596. package/screenshot/compare/build/p-y5jlrcha.system.entry.js +0 -1
  597. package/screenshot/compare/build/p-yh170wkt.entry.js +0 -1
  598. package/testing/jest.preprocessor.js +0 -7
  599. /package/{dist/dev-server → dev-server}/static/favicon.ico +0 -0
  600. /package/{dist/sys/node → dev-server}/visualstudio.vbs +0 -0
  601. /package/{dist/sys/node → dev-server}/xdg-open +0 -0
  602. /package/{dist/compiler/polyfills.d.ts → screenshot/compare/build/index.esm.js} +0 -0
  603. /package/{dist/screenshot → screenshot}/pixel-match.d.ts +0 -0
  604. /package/{dist/testing → testing}/jest/jest-setup-test-framework.d.ts +0 -0
  605. /package/{dist/testing → testing}/matchers/attributes.d.ts +0 -0
  606. /package/{dist/testing → testing}/matchers/class-list.d.ts +0 -0
  607. /package/{dist/testing → testing}/matchers/html.d.ts +0 -0
  608. /package/{dist/testing → testing}/matchers/text.d.ts +0 -0
package/testing/index.js CHANGED
@@ -1,2 +1,4017 @@
1
- /* @rindo/core/testing */
2
- module.exports = require('../dist/testing');
1
+ /*!
2
+ Rindo Testing v2.5.2 | MIT Licensed | https://rindojs.web.app
3
+ */
4
+ function _lazyRequire(e) {
5
+ return new Proxy({}, {
6
+ get(t, r) {
7
+ const s = require(e);
8
+ return Reflect.get(s, r);
9
+ },
10
+ set(t, r, s) {
11
+ const n = require(e);
12
+ return Reflect.set(n, r, s);
13
+ }
14
+ });
15
+ }
16
+
17
+ function _interopDefaultLegacy(e) {
18
+ return e && "object" == typeof e && "default" in e ? e : {
19
+ default: e
20
+ };
21
+ }
22
+
23
+ async function startPuppeteerBrowser(e) {
24
+ if (!e.flags.e2e) return null;
25
+ const t = process.env, r = e.testing.browserExecutablePath ? "puppeteer-core" : "puppeteer", s = e.sys.lazyRequire.getModulePath(e.rootDir, r), n = e.sys.lazyRequire.require(e.rootDir, s);
26
+ t.__RINDO_PUPPETEER_MODULE__ = s, t.__RINDO_BROWSER_WAIT_UNTIL = e.testing.browserWaitUntil,
27
+ e.flags.devtools && (e.testing.browserDevtools = !0, e.testing.browserHeadless = !1,
28
+ t.__RINDO_E2E_DEVTOOLS__ = "true"), e.logger.debug(`puppeteer: ${s}`), e.logger.debug(`puppeteer headless: ${e.testing.browserHeadless}`),
29
+ Array.isArray(e.testing.browserArgs) && e.logger.debug(`puppeteer args: ${e.testing.browserArgs.join(" ")}`),
30
+ "boolean" == typeof e.testing.browserDevtools && e.logger.debug(`puppeteer devtools: ${e.testing.browserDevtools}`),
31
+ "number" == typeof e.testing.browserSlowMo && e.logger.debug(`puppeteer slowMo: ${e.testing.browserSlowMo}`);
32
+ const o = {
33
+ ignoreHTTPSErrors: !0,
34
+ args: e.testing.browserArgs,
35
+ headless: e.testing.browserHeadless,
36
+ devtools: e.testing.browserDevtools,
37
+ slowMo: e.testing.browserSlowMo
38
+ };
39
+ e.testing.browserExecutablePath && (o.executablePath = e.testing.browserExecutablePath);
40
+ const i = await (e.testing.browserWSEndpoint ? n.connect({
41
+ ...o,
42
+ browserWSEndpoint: e.testing.browserWSEndpoint
43
+ }) : n.launch({
44
+ ...o
45
+ }));
46
+ return t.__RINDO_BROWSER_WS_ENDPOINT__ = i.wsEndpoint(), e.logger.debug(`puppeteer browser wsEndpoint: ${t.__RINDO_BROWSER_WS_ENDPOINT__}`),
47
+ i;
48
+ }
49
+
50
+ function getAppStyleUrl(e, t) {
51
+ return e.globalStyle ? getAppUrl(e, t, `${e.fsNamespace}.css`) : null;
52
+ }
53
+
54
+ function getAppUrl(e, t, r) {
55
+ const s = e.outputTargets.find(isOutputTargetWww);
56
+ if (s) {
57
+ const e = s.buildDir, n = path$2.join(e, r), o = path$2.relative(s.dir, n);
58
+ return new URL(o, t).href;
59
+ }
60
+ const n = e.outputTargets.find(isOutputTargetDistLazy);
61
+ if (n) {
62
+ const s = n.esmDir, o = path$2.join(s, r), i = path$2.relative(e.rootDir, o);
63
+ return new URL(i, t).href;
64
+ }
65
+ return t;
66
+ }
67
+
68
+ function setScreenshotEmulateData(e, t) {
69
+ const r = {
70
+ userAgent: "default",
71
+ viewport: {
72
+ width: 800,
73
+ height: 600,
74
+ deviceScaleFactor: 1,
75
+ isMobile: !1,
76
+ hasTouch: !1,
77
+ isLandscape: !1
78
+ }
79
+ };
80
+ if ("string" == typeof e.device) try {
81
+ const s = require(t.__RINDO_PUPPETEER_MODULE__ + "/DeviceDescriptors")[e.device];
82
+ if (!s) return void console.error(`invalid emulate device: ${e.device}`);
83
+ r.device = e.device, r.userAgent = s.userAgent, r.viewport = s.viewport;
84
+ } catch (e) {
85
+ return void console.error("error loading puppeteer DeviceDescriptors", e);
86
+ }
87
+ e.viewport && ("number" == typeof e.viewport.width && (r.viewport.width = e.viewport.width),
88
+ "number" == typeof e.viewport.height && (r.viewport.height = e.viewport.height),
89
+ "number" == typeof e.viewport.deviceScaleFactor && (r.viewport.deviceScaleFactor = e.viewport.deviceScaleFactor),
90
+ "boolean" == typeof e.viewport.hasTouch && (r.viewport.hasTouch = e.viewport.hasTouch),
91
+ "boolean" == typeof e.viewport.isLandscape && (r.viewport.isLandscape = e.viewport.isLandscape),
92
+ "boolean" == typeof e.viewport.isMobile && (r.viewport.isMobile = e.viewport.isMobile),
93
+ "string" == typeof e.userAgent && (r.userAgent = e.userAgent)), t.__RINDO_EMULATE__ = JSON.stringify(r);
94
+ }
95
+
96
+ async function runJest(e, t) {
97
+ let r = !1;
98
+ try {
99
+ const s = function s(e, t) {
100
+ let r = e.emulate.slice();
101
+ if ("string" == typeof t.emulate) {
102
+ const e = t.emulate.toLowerCase();
103
+ r = r.filter((t => "string" == typeof t.device && t.device.toLowerCase() === e || !("string" != typeof t.userAgent || !t.userAgent.toLowerCase().includes(e))));
104
+ }
105
+ return r;
106
+ }(e.testing, e.flags);
107
+ t.__RINDO_EMULATE_CONFIGS__ = JSON.stringify(s), t.__RINDO_ENV__ = JSON.stringify(e.env),
108
+ e.flags.ci || e.flags.e2e ? t.__RINDO_DEFAULT_TIMEOUT__ = "30000" : t.__RINDO_DEFAULT_TIMEOUT__ = "15000",
109
+ e.flags.devtools && (t.__RINDO_DEFAULT_TIMEOUT__ = "300000000"), e.logger.debug(`default timeout: ${t.__RINDO_DEFAULT_TIMEOUT__}`);
110
+ const n = function n(e) {
111
+ const t = require("yargs"), r = [ ...e.flags.unknownArgs.slice(), ...e.flags.knownArgs.slice() ];
112
+ r.some((e => e.startsWith("--max-workers") || e.startsWith("--maxWorkers"))) || r.push(`--max-workers=${e.maxConcurrentWorkers}`),
113
+ e.flags.devtools && r.push("--runInBand"), e.logger.info(e.logger.magenta(`jest args: ${r.join(" ")}`));
114
+ const {options: s} = require("jest-cli/build/cli/args"), n = t(r).options(s).argv;
115
+ if (n.config = function o(e) {
116
+ const t = e.testing, r = require("jest-config").defaults, s = Object.keys(r), n = {};
117
+ return Object.keys(t).forEach((e => {
118
+ s.includes(e) && (n[e] = t[e]);
119
+ })), n.rootDir = e.rootDir, isString(t.collectCoverage) && (n.collectCoverage = t.collectCoverage),
120
+ Array.isArray(t.collectCoverageFrom) && (n.collectCoverageFrom = t.collectCoverageFrom),
121
+ isString(t.coverageDirectory) && (n.coverageDirectory = t.coverageDirectory), t.coverageThreshold && (n.coverageThreshold = t.coverageThreshold),
122
+ isString(t.globalSetup) && (n.globalSetup = t.globalSetup), isString(t.globalTeardown) && (n.globalTeardown = t.globalTeardown),
123
+ isString(t.preset) && (n.preset = t.preset), t.projects && (n.projects = t.projects),
124
+ Array.isArray(t.reporters) && (n.reporters = t.reporters), isString(t.testResultsProcessor) && (n.testResultsProcessor = t.testResultsProcessor),
125
+ t.transform && (n.transform = t.transform), t.verbose && (n.verbose = t.verbose),
126
+ JSON.stringify(n);
127
+ }(e), "string" == typeof n.maxWorkers) try {
128
+ n.maxWorkers = parseInt(n.maxWorkers, 10);
129
+ } catch (e) {}
130
+ return "string" == typeof n.ci && (n.ci = "true" === n.ci || "" === n.ci), n;
131
+ }(e), o = function o(e, t) {
132
+ const r = t.projects ? t.projects : [];
133
+ return r.push(e.rootDir), r;
134
+ }(e, n), {runCLI: i} = require("@jest/core");
135
+ r = !!(await i(n, o)).results.success;
136
+ } catch (t) {
137
+ e.logger.error(`runJest: ${t}`);
138
+ }
139
+ return r;
140
+ }
141
+
142
+ function createBuildId() {
143
+ const e = new Date;
144
+ let t = e.getFullYear() + "";
145
+ return t += ("0" + (e.getMonth() + 1)).slice(-2), t += ("0" + e.getDate()).slice(-2),
146
+ t += ("0" + e.getHours()).slice(-2), t += ("0" + e.getMinutes()).slice(-2), t += ("0" + e.getSeconds()).slice(-2),
147
+ t;
148
+ }
149
+
150
+ function createBuildMessage() {
151
+ const e = new Date;
152
+ let t = e.getFullYear() + "-";
153
+ return t += ("0" + (e.getMonth() + 1)).slice(-2) + "-", t += ("0" + e.getDate()).slice(-2) + " ",
154
+ t += ("0" + e.getHours()).slice(-2) + ":", t += ("0" + e.getMinutes()).slice(-2) + ":",
155
+ t += ("0" + e.getSeconds()).slice(-2), `Build: ${t}`;
156
+ }
157
+
158
+ function transpile(e, t = {}) {
159
+ t = {
160
+ ...t,
161
+ componentExport: null,
162
+ componentMetadata: "compilerstatic",
163
+ coreImportPath: isString(t.coreImportPath) ? t.coreImportPath : "@rindo/core/internal/testing",
164
+ currentDirectory: t.currentDirectory || process.cwd(),
165
+ module: "cjs",
166
+ proxy: null,
167
+ sourceMap: "inline",
168
+ style: null,
169
+ styleImportData: "queryparams",
170
+ target: "es2015"
171
+ };
172
+ try {
173
+ const e = process.versions.node.split(".");
174
+ parseInt(e[0], 10) >= 10 && (t.target = "es2017");
175
+ } catch (e) {}
176
+ return rindo_js.transpileSync(e, t);
177
+ }
178
+
179
+ function formatDiagnostic(e) {
180
+ let t = "";
181
+ return e.relFilePath && (t += e.relFilePath, "number" == typeof e.lineNumber && (t += ":" + e.lineNumber + 1,
182
+ "number" == typeof e.columnNumber && (t += ":" + e.columnNumber)), t += "\n"), t += e.messageText,
183
+ t;
184
+ }
185
+
186
+ function compareHtml(e, t, r) {
187
+ if (null == e) throw new Error(`expect toEqualHtml() value is "${e}"`);
188
+ if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
189
+ let s;
190
+ if (1 === e.nodeType) {
191
+ const t = function n(e) {
192
+ return e && e.ownerDocument && e.ownerDocument.defaultView && e.ownerDocument.defaultView.__rindo_spec_options || {};
193
+ }(e);
194
+ s = index_cjs.serializeNodeToHtml(e, {
195
+ prettyHtml: !0,
196
+ outerHtml: !0,
197
+ removeHtmlComments: !1 === t.includeAnnotations,
198
+ excludeTags: [ "body" ],
199
+ serializeShadowRoot: r
200
+ });
201
+ } else if (11 === e.nodeType) s = index_cjs.serializeNodeToHtml(e, {
202
+ prettyHtml: !0,
203
+ excludeTags: [ "style" ],
204
+ excludeTagContent: [ "style" ],
205
+ serializeShadowRoot: r
206
+ }); else {
207
+ if ("string" != typeof e) throw new Error("expect toEqualHtml() value should be an element, shadow root or string.");
208
+ {
209
+ const t = index_cjs.parseHtmlToFragment(e);
210
+ s = index_cjs.serializeNodeToHtml(t, {
211
+ prettyHtml: !0,
212
+ serializeShadowRoot: r
213
+ });
214
+ }
215
+ }
216
+ const o = index_cjs.parseHtmlToFragment(t), i = index_cjs.serializeNodeToHtml(o, {
217
+ prettyHtml: !0,
218
+ excludeTags: [ "body" ]
219
+ });
220
+ return s !== i ? (expect(s).toBe(i), {
221
+ message: () => "HTML does not match",
222
+ pass: !1
223
+ }) : {
224
+ message: () => "expect HTML to match",
225
+ pass: !0
226
+ };
227
+ }
228
+
229
+ function toHaveClasses(e, t) {
230
+ if (!e) throw new Error("expect toHaveClasses value is null");
231
+ if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
232
+ if (1 !== e.nodeType) throw new Error("expect toHaveClasses value is not an element");
233
+ const r = t.every((t => e.classList.contains(t)));
234
+ return {
235
+ message: () => `expected to ${r ? "not " : ""}have css classes "${t.join(" ")}", but className is "${e.className}"`,
236
+ pass: r
237
+ };
238
+ }
239
+
240
+ async function globalMockFetch(e) {
241
+ let t;
242
+ if (null == e) throw new Error("missing url input for mock fetch()");
243
+ if ("string" == typeof e) t = e; else {
244
+ if ("string" != typeof e.url) throw new Error("invalid url for mock fetch()");
245
+ t = e.url;
246
+ }
247
+ t = new URL(t, location.href).href;
248
+ let r = mockedResponses.get(t);
249
+ if (null == r) {
250
+ const e = new URL(FETCH_DEFAULT_PATH, location.href);
251
+ r = mockedResponses.get(e.href);
252
+ }
253
+ if (null == r) return new MockResponse404;
254
+ const s = r.response.clone();
255
+ return "number" != typeof s.status && (s.status = 200), "string" != typeof s.statusText && (s.status >= 500 ? s.statusText = "Internal Server Error" : 404 === s.status ? s.statusText = "Not Found" : s.status >= 400 ? s.statusText = "Bad Request" : 302 === s.status ? s.statusText = "Found" : 301 === s.status ? s.statusText = "Moved Permanently" : s.status >= 300 ? s.statusText = "Redirection" : s.statusText = "OK"),
256
+ s.ok = s.status >= 200 && s.status <= 299, "string" != typeof s.type && (s.type = "basic"),
257
+ s;
258
+ }
259
+
260
+ function setMockedResponse(e, t, r) {
261
+ if (!e) throw new Error("MockResponse required");
262
+ "string" == typeof e.url && "" !== e.url || ("string" == typeof t ? e.url = t : t && "string" == typeof t.url ? e.url = t.url : e.url = FETCH_DEFAULT_PATH);
263
+ const s = new URL(e.url, location.href);
264
+ e.url = s.href;
265
+ const n = {
266
+ response: e,
267
+ reject: r
268
+ };
269
+ mockedResponses.set(e.url, n);
270
+ }
271
+
272
+ function resetBuildConditionals(e) {
273
+ Object.keys(e).forEach((t => {
274
+ e[t] = !0;
275
+ })), e.isDev = !0, e.isTesting = !0, e.isDebug = !1, e.lazyLoad = !0, e.member = !0,
276
+ e.reflect = !0, e.scoped = !0, e.shadowDom = !0, e.slotRelocation = !0, e.asyncLoading = !0,
277
+ e.svg = !0, e.updatable = !0, e.vdomAttribute = !0, e.vdomClass = !0, e.vdomFunctional = !0,
278
+ e.vdomKey = !0, e.vdomPropOrAttr = !0, e.vdomRef = !0, e.vdomListener = !0, e.vdomStyle = !0,
279
+ e.vdomText = !0, e.vdomXlink = !0, e.allRenderFn = !1, e.devTools = !1, e.hydrateClientSide = !1,
280
+ e.hydrateServerSide = !1, e.cssAnnotations = !1, e.style = !1, e.hydratedAttribute = !1,
281
+ e.hydratedClass = !0, e.appendChildSlotFix = !1, e.cloneNodeFix = !1, e.dynamicImportShim = !1,
282
+ e.hotModuleReplacement = !1, e.safari10 = !1, e.scriptDataOpts = !1, e.slotChildNodesFix = !1;
283
+ }
284
+
285
+ function assertPath(e) {
286
+ if ("string" != typeof e) throw new TypeError("Path must be a string. Received " + JSON.stringify(e));
287
+ }
288
+
289
+ function normalizeStringPosix(e, t) {
290
+ var r, s, n, o = "", i = 0, a = -1, l = 0;
291
+ for (s = 0; s <= e.length; ++s) {
292
+ if (s < e.length) r = e.charCodeAt(s); else {
293
+ if (47 === r) break;
294
+ r = 47;
295
+ }
296
+ if (47 === r) {
297
+ if (a === s - 1 || 1 === l) ; else if (a !== s - 1 && 2 === l) {
298
+ if (o.length < 2 || 2 !== i || 46 !== o.charCodeAt(o.length - 1) || 46 !== o.charCodeAt(o.length - 2)) if (o.length > 2) {
299
+ if ((n = o.lastIndexOf("/")) !== o.length - 1) {
300
+ -1 === n ? (o = "", i = 0) : i = (o = o.slice(0, n)).length - 1 - o.lastIndexOf("/"),
301
+ a = s, l = 0;
302
+ continue;
303
+ }
304
+ } else if (2 === o.length || 1 === o.length) {
305
+ o = "", i = 0, a = s, l = 0;
306
+ continue;
307
+ }
308
+ t && (o.length > 0 ? o += "/.." : o = "..", i = 2);
309
+ } else o.length > 0 ? o += "/" + e.slice(a + 1, s) : o = e.slice(a + 1, s), i = s - a - 1;
310
+ a = s, l = 0;
311
+ } else 46 === r && -1 !== l ? ++l : l = -1;
312
+ }
313
+ return o;
314
+ }
315
+
316
+ function specifierIncluded$1(e, t) {
317
+ var r, s, n, o = e.split("."), i = t.split(" "), a = i.length > 1 ? i[0] : "=", l = (i.length > 1 ? i[1] : i[0]).split(".");
318
+ for (r = 0; r < 3; ++r) if ((s = parseInt(o[r] || 0, 10)) !== (n = parseInt(l[r] || 0, 10))) return "<" === a ? s < n : ">=" === a && s >= n;
319
+ return ">=" === a;
320
+ }
321
+
322
+ function matchesRange$1(e, t) {
323
+ var r, s = t.split(/ ?&& ?/);
324
+ if (0 === s.length) return !1;
325
+ for (r = 0; r < s.length; ++r) if (!specifierIncluded$1(e, s[r])) return !1;
326
+ return !0;
327
+ }
328
+
329
+ function specifierIncluded(e) {
330
+ var t, r, s, n = e.split(" "), o = n.length > 1 ? n[0] : "=", i = (n.length > 1 ? n[1] : n[0]).split(".");
331
+ for (t = 0; t < 3; ++t) if ((r = parseInt(current[t] || 0, 10)) !== (s = parseInt(i[t] || 0, 10))) return "<" === o ? r < s : ">=" === o && r >= s;
332
+ return ">=" === o;
333
+ }
334
+
335
+ function matchesRange(e) {
336
+ var t, r = e.split(/ ?&& ?/);
337
+ if (0 === r.length) return !1;
338
+ for (t = 0; t < r.length; ++t) if (!specifierIncluded(r[t])) return !1;
339
+ return !0;
340
+ }
341
+
342
+ function versionIncluded(e) {
343
+ if ("boolean" == typeof e) return e;
344
+ if (e && "object" == typeof e) {
345
+ for (var t = 0; t < e.length; ++t) if (matchesRange(e[t])) return !0;
346
+ return !1;
347
+ }
348
+ return matchesRange(e);
349
+ }
350
+
351
+ function mockConfig(e) {
352
+ const t = path__default.default.resolve("/");
353
+ return e || (e = createTestingSystem()), e.getCurrentDirectory = () => t, {
354
+ _isTesting: !0,
355
+ namespace: "Testing",
356
+ rootDir: t,
357
+ globalScript: null,
358
+ devMode: !0,
359
+ enableCache: !1,
360
+ buildAppCore: !1,
361
+ buildDist: !0,
362
+ flags: {},
363
+ bundles: null,
364
+ outputTargets: null,
365
+ buildEs5: !1,
366
+ hashFileNames: !1,
367
+ logger: new TestingLogger,
368
+ maxConcurrentWorkers: 0,
369
+ minifyCss: !1,
370
+ minifyJs: !1,
371
+ sys: e,
372
+ testing: null,
373
+ validateTypes: !1,
374
+ extras: {},
375
+ nodeResolve: {
376
+ customResolveOptions: {}
377
+ }
378
+ };
379
+ }
380
+
381
+ function mockCompilerCtx(e) {
382
+ e || (e = mockConfig());
383
+ const t = {
384
+ version: 1,
385
+ activeBuildId: 0,
386
+ activeDirsAdded: [],
387
+ activeDirsDeleted: [],
388
+ activeFilesAdded: [],
389
+ activeFilesDeleted: [],
390
+ activeFilesUpdated: [],
391
+ addWatchDir: noop,
392
+ addWatchFile: noop,
393
+ cachedGlobalStyle: null,
394
+ changedFiles: new Set,
395
+ changedModules: new Set,
396
+ collections: [],
397
+ compilerOptions: null,
398
+ cache: null,
399
+ cssModuleImports: new Map,
400
+ events: null,
401
+ fs: null,
402
+ hasSuccessfulBuild: !1,
403
+ isActivelyBuilding: !1,
404
+ lastBuildResults: null,
405
+ moduleMap: new Map,
406
+ nodeMap: new WeakMap,
407
+ reset: noop,
408
+ resolvedCollections: new Set,
409
+ rollupCache: new Map,
410
+ rollupCacheHydrate: null,
411
+ rollupCacheLazy: null,
412
+ rollupCacheNative: null,
413
+ styleModeNames: new Set,
414
+ worker: rindo_js.createWorkerContext(e.sys)
415
+ };
416
+ return Object.defineProperty(t, "fs", {
417
+ get() {
418
+ return null == this._fs && (this._fs = (e => {
419
+ const t = new Map, r = new Map, s = async e => {
420
+ const t = b(e);
421
+ if ("boolean" == typeof t.exists) return {
422
+ exists: t.exists,
423
+ isDirectory: t.isDirectory,
424
+ isFile: t.isFile
425
+ };
426
+ const r = {
427
+ exists: !1,
428
+ isDirectory: !1,
429
+ isFile: !1
430
+ }, s = await c(e);
431
+ return s ? (t.exists = s.exists, t.isDirectory = s.isDirectory, t.isFile = s.isFile,
432
+ r.exists = t.exists, r.isDirectory = t.isDirectory, r.isFile = t.isFile) : t.exists = !1,
433
+ r;
434
+ }, n = async (e, r = {}) => {
435
+ e = normalizePath(e);
436
+ const s = [];
437
+ if (!0 === r.inMemoryOnly) {
438
+ let n = e;
439
+ n.endsWith("/") || (n += "/");
440
+ const o = e.split("/");
441
+ t.forEach(((t, n) => {
442
+ if (!n.startsWith(e)) return;
443
+ const a = n.split("/");
444
+ if ((a.length === o.length + 1 || r.recursive && a.length > o.length) && t.exists) {
445
+ const e = {
446
+ absPath: n,
447
+ relPath: a[o.length],
448
+ isDirectory: t.isDirectory,
449
+ isFile: t.isFile
450
+ };
451
+ i(r, e) || s.push(e);
452
+ }
453
+ }));
454
+ } else await o(e, e, r, s);
455
+ return s.sort(((e, t) => e.absPath < t.absPath ? -1 : e.absPath > t.absPath ? 1 : 0));
456
+ }, o = async (t, r, s, n) => {
457
+ const a = await e.readDir(r);
458
+ if (a.length > 0) {
459
+ const e = b(r);
460
+ e.exists = !0, e.isFile = !1, e.isDirectory = !0, await Promise.all(a.map((async e => {
461
+ const r = normalizePath(e), a = normalizePath(path$2.relative(t, r)), l = await c(r), u = {
462
+ absPath: r,
463
+ relPath: a,
464
+ isDirectory: l.isDirectory,
465
+ isFile: l.isFile
466
+ };
467
+ i(s, u) || (n.push(u), !0 === s.recursive && !0 === l.isDirectory && await o(t, r, s, n));
468
+ })));
469
+ }
470
+ }, i = (e, t) => {
471
+ if (t.isDirectory) {
472
+ if (Array.isArray(e.excludeDirNames)) {
473
+ const r = path$2.basename(t.absPath);
474
+ if (e.excludeDirNames.some((e => r === e))) return !0;
475
+ }
476
+ } else if (Array.isArray(e.excludeExtensions)) {
477
+ const r = t.relPath.toLowerCase();
478
+ if (e.excludeExtensions.some((e => r.endsWith(e)))) return !0;
479
+ }
480
+ return !1;
481
+ }, a = async e => {
482
+ const t = b(e);
483
+ t.isFile = !1, t.isDirectory = !0, t.queueWriteToDisk || (t.queueDeleteFromDisk = !0);
484
+ try {
485
+ const t = await n(e, {
486
+ recursive: !0
487
+ });
488
+ await Promise.all(t.map((e => e.relPath.endsWith(".gitkeep") ? null : l(e.absPath))));
489
+ } catch (e) {}
490
+ }, l = async e => {
491
+ const t = b(e);
492
+ t.queueWriteToDisk || (t.queueDeleteFromDisk = !0);
493
+ }, c = async t => {
494
+ const r = b(t);
495
+ if ("boolean" != typeof r.isDirectory || "boolean" != typeof r.isFile) {
496
+ const s = await e.stat(t);
497
+ s.error ? r.exists = !1 : (r.exists = !0, s.isFile ? (r.isFile = !0, r.isDirectory = !1,
498
+ r.size = s.size) : s.isDirectory ? (r.isFile = !1, r.isDirectory = !0, r.size = s.size) : (r.isFile = !1,
499
+ r.isDirectory = !1, r.size = null));
500
+ }
501
+ return {
502
+ exists: !!r.exists,
503
+ isFile: !!r.isFile,
504
+ isDirectory: !!r.isDirectory,
505
+ size: "number" == typeof r.size ? r.size : 0
506
+ };
507
+ }, u = t => {
508
+ const r = b(t);
509
+ if ("boolean" != typeof r.isDirectory || "boolean" != typeof r.isFile) {
510
+ const s = e.statSync(t);
511
+ s.error ? r.exists = !1 : (r.exists = !0, s.isFile ? (r.isFile = !0, r.isDirectory = !1,
512
+ r.size = s.size) : s.isDirectory ? (r.isFile = !1, r.isDirectory = !0, r.size = s.size) : (r.isFile = !1,
513
+ r.isDirectory = !1, r.size = null));
514
+ }
515
+ return {
516
+ exists: !!r.exists,
517
+ isFile: !!r.isFile,
518
+ isDirectory: !!r.isDirectory
519
+ };
520
+ }, d = async (t, s, n) => {
521
+ if ("string" != typeof t) throw new Error(`writeFile, invalid filePath: ${t}`);
522
+ if ("string" != typeof s) throw new Error(`writeFile, invalid content: ${t}`);
523
+ const o = {
524
+ ignored: !1,
525
+ changedContent: !1,
526
+ queuedWrite: !1
527
+ };
528
+ if (!0 === shouldIgnore(t)) return o.ignored = !0, o;
529
+ const i = b(t);
530
+ if (i.exists = !0, i.isFile = !0, i.isDirectory = !1, i.queueDeleteFromDisk = !1,
531
+ "string" == typeof i.fileText ? o.changedContent = i.fileText.replace(/\r/g, "") !== s.replace(/\r/g, "") : o.changedContent = !0,
532
+ i.fileText = s, o.queuedWrite = !1, null != n && ("string" == typeof n.outputTargetType && r.set(t, n.outputTargetType),
533
+ !1 === n.useCache && (i.useCache = !1)), null != n && !0 === n.inMemoryOnly) i.queueWriteToDisk ? o.queuedWrite = !0 : i.queueWriteToDisk = !1,
534
+ await h(t, !0); else if (null != n && !0 === n.immediateWrite) {
535
+ if (o.changedContent || !0 !== n.useCache) {
536
+ const r = await e.readFile(t);
537
+ "string" == typeof r && (o.changedContent = i.fileText.replace(/\r/g, "") !== r.replace(/\r/g, "")),
538
+ o.changedContent && (await h(t, !1), await e.writeFile(t, i.fileText));
539
+ }
540
+ } else i.queueWriteToDisk || !0 !== o.changedContent || (i.queueWriteToDisk = !0,
541
+ o.queuedWrite = !0);
542
+ return o;
543
+ }, h = async (e, t) => {
544
+ const r = [];
545
+ for (;"string" == typeof (e = path$2.dirname(e)) && e.length > 0 && "/" !== e && !1 === e.endsWith(":/") && !1 === e.endsWith(":\\"); ) r.push(e);
546
+ r.reverse(), await p(r, t);
547
+ }, p = async (t, r) => {
548
+ const s = [];
549
+ for (const n of t) {
550
+ const t = b(n);
551
+ if (!0 !== t.exists || !0 !== t.isDirectory) try {
552
+ t.exists = !0, t.isDirectory = !0, t.isFile = !1, r || await e.createDir(n), s.push(n);
553
+ } catch (e) {}
554
+ }
555
+ return s;
556
+ }, f = t => Promise.all(t.map((async t => {
557
+ const r = t[0], s = t[1];
558
+ return await e.copyFile(r, s), [ r, s ];
559
+ }))), m = e => Promise.all(e.map((async e => {
560
+ if ("string" != typeof e) throw new Error("unable to writeFile without filePath");
561
+ return g(e);
562
+ }))), g = async t => {
563
+ const r = b(t);
564
+ if (null == r.fileText) throw new Error(`unable to find item fileText to write: ${t}`);
565
+ return await e.writeFile(t, r.fileText), !1 === r.useCache && v(t), t;
566
+ }, y = async t => await Promise.all(t.map((async t => {
567
+ if ("string" != typeof t) throw new Error("unable to unlink without filePath");
568
+ return await e.removeFile(t), t;
569
+ }))), w = async t => {
570
+ const r = [];
571
+ for (const s of t) await e.removeDir(s), r.push(s);
572
+ return r;
573
+ }, _ = e => {
574
+ e = normalizePath(e), t.forEach(((t, r) => {
575
+ const s = path$2.relative(e, r).split("/")[0];
576
+ s.startsWith(".") || s.startsWith("/") || v(r);
577
+ }));
578
+ }, v = e => {
579
+ e = normalizePath(e);
580
+ const r = t.get(e);
581
+ null == r || r.queueWriteToDisk || t.delete(e);
582
+ }, b = e => {
583
+ e = normalizePath(e);
584
+ let r = t.get(e);
585
+ return null != r || t.set(e, r = {
586
+ exists: null,
587
+ fileText: null,
588
+ size: null,
589
+ mtimeMs: null,
590
+ isDirectory: null,
591
+ isFile: null,
592
+ queueCopyFileToDest: null,
593
+ queueDeleteFromDisk: null,
594
+ queueWriteToDisk: null,
595
+ useCache: null
596
+ }), r;
597
+ }, E = 5242880;
598
+ return {
599
+ access: async e => (await s(e)).exists,
600
+ accessSync: e => {
601
+ const t = b(e);
602
+ if ("boolean" != typeof t.exists) {
603
+ const r = u(e);
604
+ t.exists = r.exists, t.isDirectory = r.isDirectory, t.isFile = r.isFile;
605
+ }
606
+ return t.exists;
607
+ },
608
+ accessData: s,
609
+ cancelDeleteDirectoriesFromDisk: e => {
610
+ for (const t of e) {
611
+ const e = b(t);
612
+ !0 === e.queueDeleteFromDisk && (e.queueDeleteFromDisk = !1);
613
+ }
614
+ },
615
+ cancelDeleteFilesFromDisk: e => {
616
+ for (const t of e) {
617
+ const e = b(t);
618
+ !0 === e.isFile && !0 === e.queueDeleteFromDisk && (e.queueDeleteFromDisk = !1);
619
+ }
620
+ },
621
+ clearCache: () => t.clear(),
622
+ clearDirCache: _,
623
+ clearFileCache: v,
624
+ commit: async () => {
625
+ const e = getCommitInstructions(t), r = await p(e.dirsToEnsure, !1), s = await m(e.filesToWrite), n = await f(e.filesToCopy), o = await y(e.filesToDelete), i = await w(e.dirsToDelete);
626
+ return e.filesToDelete.forEach(v), e.dirsToDelete.forEach(_), {
627
+ filesCopied: n,
628
+ filesWritten: s,
629
+ filesDeleted: o,
630
+ dirsDeleted: i,
631
+ dirsAdded: r
632
+ };
633
+ },
634
+ copyFile: async (e, t) => {
635
+ b(e).queueCopyFileToDest = t;
636
+ },
637
+ emptyDirs: async e => {
638
+ e = e.filter(isString).map(normalizePath).reduce(((e, t) => (e.includes(t) || e.push(t),
639
+ e)), []);
640
+ const t = await Promise.all(e.map((e => n(e, {
641
+ recursive: !0
642
+ })))), r = [];
643
+ for (const e of t) for (const t of e) r.includes(t.absPath) || r.push(t.absPath);
644
+ r.sort(((e, t) => {
645
+ const r = e.split("/").length, s = t.split("/").length;
646
+ return r < s ? 1 : r > s ? -1 : 0;
647
+ })), await Promise.all(r.map(l)), e.forEach((e => {
648
+ const t = b(e);
649
+ t.isFile = !1, t.isDirectory = !0, t.queueWriteToDisk = !0, t.queueDeleteFromDisk = !1;
650
+ }));
651
+ },
652
+ getBuildOutputs: () => {
653
+ const e = [];
654
+ return r.forEach(((t, r) => {
655
+ const s = e.find((e => e.type === t));
656
+ s ? s.files.push(r) : e.push({
657
+ type: t,
658
+ files: [ r ]
659
+ });
660
+ })), e.forEach((e => e.files.sort())), e.sort(((e, t) => e.type < t.type ? -1 : e.type > t.type ? 1 : 0));
661
+ },
662
+ getItem: b,
663
+ getMemoryStats: () => `data length: ${t.size}`,
664
+ keys: () => Array.from(t.keys()).sort(),
665
+ readFile: async (t, r) => {
666
+ if (null == r || !0 === r.useCache || void 0 === r.useCache) {
667
+ const e = b(t);
668
+ if (e.exists && "string" == typeof e.fileText) return e.fileText;
669
+ }
670
+ const s = await e.readFile(t), n = b(t);
671
+ return "string" == typeof s ? s.length < E && (n.exists = !0, n.isFile = !0, n.isDirectory = !1,
672
+ n.fileText = s) : n.exists = !1, s;
673
+ },
674
+ readFileSync: (t, r) => {
675
+ if (null == r || !0 === r.useCache || void 0 === r.useCache) {
676
+ const e = b(t);
677
+ if (e.exists && "string" == typeof e.fileText) return e.fileText;
678
+ }
679
+ const s = e.readFileSync(t), n = b(t);
680
+ return "string" == typeof s ? s.length < E && (n.exists = !0, n.isFile = !0, n.isDirectory = !1,
681
+ n.fileText = s) : n.exists = !1, s;
682
+ },
683
+ readdir: n,
684
+ remove: async e => {
685
+ const t = await c(e);
686
+ !0 === t.isDirectory ? await a(e) : !0 === t.isFile && await l(e);
687
+ },
688
+ stat: c,
689
+ statSync: u,
690
+ sys: e,
691
+ writeFile: d,
692
+ writeFiles: (e, t) => {
693
+ const r = [];
694
+ return isIterable(e) ? e.forEach(((e, s) => {
695
+ r.push(d(s, e, t));
696
+ })) : Object.keys(e).map((s => {
697
+ r.push(d(s, e[s], t));
698
+ })), Promise.all(r);
699
+ }
700
+ };
701
+ })(e.sys)), this._fs;
702
+ }
703
+ }), Object.defineProperty(t, "cache", {
704
+ get() {
705
+ return null == this._cache && (this._cache = function r(e, t) {
706
+ e || (e = mockConfig()), t || (t = mockCompilerCtx(e)), e.enableCache = !0;
707
+ const r = new Cache(e, t.fs);
708
+ return r.initCacheDir(), r;
709
+ }(e, t)), this._cache;
710
+ }
711
+ }), t;
712
+ }
713
+
714
+ function findRootComponent(e, t) {
715
+ if (null != t) {
716
+ const r = t.children, s = r.length;
717
+ for (let t = 0; t < s; t++) {
718
+ const s = r[t];
719
+ if (e.has(s.nodeName.toLowerCase())) return s;
720
+ }
721
+ for (let t = 0; t < s; t++) {
722
+ const s = findRootComponent(e, r[t]);
723
+ if (null != s) return s;
724
+ }
725
+ }
726
+ return null;
727
+ }
728
+
729
+ async function initPageEvents(e) {
730
+ e._e2eEvents = new Map, e._e2eEventIds = 0, e.spyOnEvent = pageSpyOnEvent.bind(e, e),
731
+ await e.exposeFunction("rindoOnEvent", ((t, r) => {
732
+ !function s(e, t, r) {
733
+ const s = e.get(t);
734
+ s && s.callback(r);
735
+ }(e._e2eEvents, t, r);
736
+ })), await e.evaluateOnNewDocument(browserContextEvents);
737
+ }
738
+
739
+ async function pageSpyOnEvent(e, t, r) {
740
+ const s = new EventSpy(t), n = "document" !== r ? () => window : () => document, o = await e.evaluateHandle(n);
741
+ return await addE2EListener(e, o, t, (e => {
742
+ s.push(e);
743
+ })), s;
744
+ }
745
+
746
+ async function waitForEvent(e, t, r) {
747
+ const s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = await e.evaluate(((e, t, r) => new Promise(((s, n) => {
748
+ const o = setTimeout((() => {
749
+ n(new Error(`waitForEvent() timeout, eventName: ${t}`));
750
+ }), r);
751
+ e.addEventListener(t, (e => {
752
+ clearTimeout(o), s(window.rindoSerializeEvent(e));
753
+ }), {
754
+ once: !0
755
+ });
756
+ }))), r, t, s);
757
+ return await e.waitForChanges(), n;
758
+ }
759
+
760
+ async function addE2EListener(e, t, r, s) {
761
+ const n = e._e2eEventIds++;
762
+ e._e2eEvents.set(n, {
763
+ eventName: r,
764
+ callback: s
765
+ });
766
+ const o = t.executionContext();
767
+ await o.evaluate(((e, t, r) => {
768
+ e.addEventListener(r, (e => {
769
+ window.rindoOnEvent(t, window.rindoSerializeEvent(e));
770
+ }));
771
+ }), t, n, r);
772
+ }
773
+
774
+ function browserContextEvents() {
775
+ const e = () => {
776
+ const e = [], t = (e, r) => {
777
+ if (null != r && 1 === r.nodeType) for (let s = 0; s < r.children.length; s++) {
778
+ const n = r.children[s];
779
+ n.tagName.includes("-") && "function" == typeof n.componentOnReady && e.push(n.componentOnReady()),
780
+ t(e, n);
781
+ }
782
+ };
783
+ return t(e, window.document.documentElement), Promise.all(e).catch((e => console.error(e)));
784
+ }, t = () => e().then((() => new Promise((e => {
785
+ requestAnimationFrame(e);
786
+ })))).then((() => e())).then((() => {
787
+ window.rindoAppLoaded = !0;
788
+ }));
789
+ window.rindoSerializeEventTarget = e => e ? e === window ? {
790
+ serializedWindow: !0
791
+ } : e === document ? {
792
+ serializedDocument: !0
793
+ } : null != e.nodeType ? {
794
+ serializedElement: !0,
795
+ nodeName: e.nodeName,
796
+ nodeValue: e.nodeValue,
797
+ nodeType: e.nodeType,
798
+ tagName: e.tagName,
799
+ className: e.className,
800
+ id: e.id
801
+ } : null : null, window.rindoSerializeEvent = e => ({
802
+ bubbles: e.bubbles,
803
+ cancelBubble: e.cancelBubble,
804
+ cancelable: e.cancelable,
805
+ composed: e.composed,
806
+ currentTarget: window.rindoSerializeEventTarget(e.currentTarget),
807
+ defaultPrevented: e.defaultPrevented,
808
+ detail: e.detail,
809
+ eventPhase: e.eventPhase,
810
+ isTrusted: e.isTrusted,
811
+ returnValue: e.returnValue,
812
+ srcElement: window.rindoSerializeEventTarget(e.srcElement),
813
+ target: window.rindoSerializeEventTarget(e.target),
814
+ timeStamp: e.timeStamp,
815
+ type: e.type,
816
+ isSerializedEvent: !0
817
+ }), "complete" === window.document.readyState ? t() : document.addEventListener("readystatechange", (function(e) {
818
+ "complete" == e.target.readyState && t();
819
+ }));
820
+ }
821
+
822
+ async function find(e, t, r) {
823
+ const {lightSelector: s, shadowSelector: n, text: o, contains: i} = getSelector(r);
824
+ let a;
825
+ if (a = "string" == typeof s ? await async function l(e, t, r, s) {
826
+ let n = await t.$(r);
827
+ if (!n) return null;
828
+ if (s) {
829
+ const t = await e.evaluateHandle(((e, t) => {
830
+ if (!e.shadowRoot) throw new Error(`shadow root does not exist for element: ${e.tagName.toLowerCase()}`);
831
+ return e.shadowRoot.querySelector(t);
832
+ }), n, s);
833
+ if (await n.dispose(), !t) return null;
834
+ n = t.asElement();
835
+ }
836
+ return n;
837
+ }(e, t, s, n) : await async function c(e, t, r, s) {
838
+ const n = await e.evaluateHandle(((e, t, r) => {
839
+ let s = null;
840
+ return function e(n) {
841
+ if (n && !s) if (3 === n.nodeType) {
842
+ if ("string" == typeof t && n.textContent.trim() === t) return void (s = n.parentElement);
843
+ if ("string" == typeof r && n.textContent.includes(r)) return void (s = n.parentElement);
844
+ } else {
845
+ if ("SCRIPT" === n.nodeName || "STYLE" === n.nodeName) return;
846
+ if (e(n.shadowRoot), n.childNodes) for (let t = 0; t < n.childNodes.length; t++) e(n.childNodes[t]);
847
+ }
848
+ }(e), s;
849
+ }), t, r, s);
850
+ return n ? n.asElement() : null;
851
+ }(e, t, o, i), !a) return null;
852
+ const u = new E2EElement(e, a);
853
+ return await u.e2eSync(), u;
854
+ }
855
+
856
+ async function findAll(e, t, r) {
857
+ const s = [], {lightSelector: n, shadowSelector: o} = getSelector(r), i = await t.$$(n);
858
+ if (0 === i.length) return s;
859
+ if (o) for (let t = 0; t < i.length; t++) {
860
+ const r = i[t].executionContext(), n = await r.evaluateHandle(((e, t) => {
861
+ if (!e.shadowRoot) throw new Error(`shadow root does not exist for element: ${e.tagName.toLowerCase()}`);
862
+ return e.shadowRoot.querySelectorAll(t);
863
+ }), i[t], o);
864
+ await i[t].dispose();
865
+ const a = await n.getProperties();
866
+ await n.dispose();
867
+ for (const t of a.values()) {
868
+ const r = t.asElement();
869
+ if (r) {
870
+ const t = new E2EElement(e, r);
871
+ await t.e2eSync(), s.push(t);
872
+ }
873
+ }
874
+ } else for (let t = 0; t < i.length; t++) {
875
+ const r = new E2EElement(e, i[t]);
876
+ await r.e2eSync(), s.push(r);
877
+ }
878
+ return s;
879
+ }
880
+
881
+ function getSelector(e) {
882
+ const t = {
883
+ lightSelector: null,
884
+ shadowSelector: null,
885
+ text: null,
886
+ contains: null
887
+ };
888
+ if ("string" == typeof e) {
889
+ const r = e.split(">>>");
890
+ t.lightSelector = r[0].trim(), t.shadowSelector = r.length > 1 ? r[1].trim() : null;
891
+ } else if ("string" == typeof e.text) t.text = e.text.trim(); else {
892
+ if ("string" != typeof e.contains) throw new Error(`invalid find selector: ${e}`);
893
+ t.contains = e.contains.trim();
894
+ }
895
+ return t;
896
+ }
897
+
898
+ async function writeScreenshotData(e, t) {
899
+ const r = function s(e, t) {
900
+ const r = `${t}.json`;
901
+ return path__default.default.join(e, r);
902
+ }(e, t.id), n = JSON.stringify(t, null, 2);
903
+ await writeFile(r, n);
904
+ }
905
+
906
+ function writeFile(e, t) {
907
+ return new Promise(((r, s) => {
908
+ fs__default.default.writeFile(e, t, (e => {
909
+ e ? s(e) : r();
910
+ }));
911
+ }));
912
+ }
913
+
914
+ async function compareScreenshot(e, t, r, s, n, o, i, a) {
915
+ const l = `${crypto$3.createHash("md5").update(r).digest("hex")}.png`, c = path$2.join(t.imagesDir, l);
916
+ await async function u(e, t) {
917
+ await function r(e) {
918
+ return new Promise((t => {
919
+ fs__default.default.access(e, (e => t(!e)));
920
+ }));
921
+ }(e) || await writeFile(e, t);
922
+ }(c, r), r = null, i && (i = normalizePath(path$2.relative(t.rootDir, i)));
923
+ const d = function h(e, t) {
924
+ if ("string" != typeof t || 0 === t.trim().length) throw new Error("invalid test description");
925
+ const r = crypto$3.createHash("md5");
926
+ return r.update(t + ":"), r.update(e.userAgent + ":"), r.update(e.viewport.width + ":"),
927
+ r.update(e.viewport.height + ":"), r.update(e.viewport.deviceScaleFactor + ":"),
928
+ r.update(e.viewport.hasTouch + ":"), r.update(e.viewport.isMobile + ":"), r.digest("hex").substr(0, 8).toLowerCase();
929
+ }(e, s), p = {
930
+ id: d,
931
+ image: l,
932
+ device: e.device,
933
+ userAgent: e.userAgent,
934
+ desc: s,
935
+ testPath: i,
936
+ width: n,
937
+ height: o,
938
+ deviceScaleFactor: e.viewport.deviceScaleFactor,
939
+ hasTouch: e.viewport.hasTouch,
940
+ isLandscape: e.viewport.isLandscape,
941
+ isMobile: e.viewport.isMobile,
942
+ diff: {
943
+ id: d,
944
+ desc: s,
945
+ imageA: l,
946
+ imageB: l,
947
+ mismatchedPixels: 0,
948
+ device: e.device,
949
+ userAgent: e.userAgent,
950
+ width: n,
951
+ height: o,
952
+ deviceScaleFactor: e.viewport.deviceScaleFactor,
953
+ hasTouch: e.viewport.hasTouch,
954
+ isLandscape: e.viewport.isLandscape,
955
+ isMobile: e.viewport.isMobile,
956
+ allowableMismatchedPixels: t.allowableMismatchedPixels,
957
+ allowableMismatchedRatio: t.allowableMismatchedRatio,
958
+ testPath: i
959
+ }
960
+ };
961
+ if (t.updateMaster) return await writeScreenshotData(t.currentBuildDir, p), p.diff;
962
+ const f = t.masterScreenshots[p.id];
963
+ if (!f) return await writeScreenshotData(t.currentBuildDir, p), p.diff;
964
+ if (p.diff.imageA = f, p.diff.imageA !== p.diff.imageB) {
965
+ p.diff.cacheKey = function m(e, t, r) {
966
+ const s = crypto$3.createHash("md5");
967
+ return s.update(`${e}:${t}:${r}`), s.digest("hex").substr(0, 10);
968
+ }(p.diff.imageA, p.diff.imageB, a);
969
+ const r = t.cache[p.diff.cacheKey];
970
+ if ("number" != typeof r || isNaN(r)) {
971
+ const r = Math.round(e.viewport.width * e.viewport.deviceScaleFactor), s = Math.round(e.viewport.height * e.viewport.deviceScaleFactor), n = {
972
+ imageAPath: path$2.join(t.imagesDir, p.diff.imageA),
973
+ imageBPath: path$2.join(t.imagesDir, p.diff.imageB),
974
+ width: r,
975
+ height: s,
976
+ pixelmatchThreshold: a
977
+ };
978
+ p.diff.mismatchedPixels = await async function g(e, t) {
979
+ return new Promise(((r, s) => {
980
+ const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, o = setTimeout((() => {
981
+ s(`getMismatchedPixels timeout: ${n}ms`);
982
+ }), n);
983
+ try {
984
+ const n = {
985
+ execArgv: process.execArgv.filter((e => !/^--(debug|inspect)/.test(e))),
986
+ env: process.env,
987
+ cwd: process.cwd(),
988
+ stdio: [ "pipe", "pipe", "pipe", "ipc" ]
989
+ }, i = child_process$2.fork(e, [], n);
990
+ i.on("message", (e => {
991
+ i.kill(), clearTimeout(o), r(e);
992
+ })), i.on("error", (e => {
993
+ clearTimeout(o), s(e);
994
+ })), i.send(t);
995
+ } catch (e) {
996
+ clearTimeout(o), s(`getMismatchedPixels error: ${e}`);
997
+ }
998
+ }));
999
+ }(t.pixelmatchModulePath, n);
1000
+ } else p.diff.mismatchedPixels = r;
1001
+ }
1002
+ return await writeScreenshotData(t.currentBuildDir, p), p.diff;
1003
+ }
1004
+
1005
+ async function e2eGoTo(e, t, r = {}) {
1006
+ if (e.isClosed()) throw new Error("e2eGoTo unavailable: page already closed");
1007
+ if ("string" != typeof t) throw new Error("invalid gotoTest() url");
1008
+ if (!t.startsWith("/")) throw new Error("gotoTest() url must start with /");
1009
+ const s = env.__RINDO_BROWSER_URL__;
1010
+ if ("string" != typeof s) throw new Error("invalid gotoTest() browser url");
1011
+ const n = s + t.substring(1);
1012
+ r.waitUntil || (r.waitUntil = env.__RINDO_BROWSER_WAIT_UNTIL);
1013
+ const o = await e._e2eGoto(n, r);
1014
+ if (!o.ok()) throw new Error(`Testing unable to load ${t}, HTTP status: ${o.status()}`);
1015
+ return await waitForRindo(e, r), o;
1016
+ }
1017
+
1018
+ async function e2eSetContent(e, t, r = {}) {
1019
+ if (e.isClosed()) throw new Error("e2eSetContent unavailable: page already closed");
1020
+ if ("string" != typeof t) throw new Error("invalid e2eSetContent() html");
1021
+ const s = [], n = env.__RINDO_APP_SCRIPT_URL__;
1022
+ if ("string" != typeof n) throw new Error("invalid e2eSetContent() app script url");
1023
+ s.push("<!doctype html>"), s.push("<html>"), s.push("<head>");
1024
+ const o = env.__RINDO_APP_STYLE_URL__;
1025
+ "string" == typeof o && s.push(`<link rel="stylesheet" href="${o}">`), s.push(`<script type="module" src="${n}"><\/script>`),
1026
+ s.push("</head>"), s.push("<body>"), s.push(t), s.push("</body>"), s.push("</html>");
1027
+ const i = env.__RINDO_BROWSER_URL__;
1028
+ await e.setRequestInterception(!0), e.on("request", (e => {
1029
+ i === e.url() ? e.respond({
1030
+ status: 200,
1031
+ contentType: "text/html",
1032
+ body: s.join("\n")
1033
+ }) : e.continue();
1034
+ })), r.waitUntil || (r.waitUntil = env.__RINDO_BROWSER_WAIT_UNTIL);
1035
+ const a = await e._e2eGoto(i, r);
1036
+ if (!a.ok()) throw new Error("Testing unable to load content");
1037
+ return await waitForRindo(e, r), a;
1038
+ }
1039
+
1040
+ async function waitForRindo(e, t) {
1041
+ try {
1042
+ const r = "number" == typeof t.timeout ? t.timeout : 4750;
1043
+ await e.waitForFunction("window.rindoAppLoaded", {
1044
+ timeout: r
1045
+ });
1046
+ } catch (e) {
1047
+ throw new Error("App did not load in allowed time. Please ensure the content loads a rindo application.");
1048
+ }
1049
+ }
1050
+
1051
+ async function waitForChanges(e) {
1052
+ try {
1053
+ if (e.isClosed()) return;
1054
+ if (await Promise.all(e._e2eElements.map((e => e.e2eRunActions()))), e.isClosed()) return;
1055
+ if (await e.evaluate((() => new Promise((e => {
1056
+ requestAnimationFrame((() => {
1057
+ const t = [], r = (e, t) => {
1058
+ if (null != e) {
1059
+ "shadowRoot" in e && e.shadowRoot instanceof ShadowRoot && r(e.shadowRoot, t);
1060
+ const s = e.children, n = s.length;
1061
+ for (let e = 0; e < n; e++) {
1062
+ const n = s[e];
1063
+ null != n && (n.tagName.includes("-") && "function" == typeof n.componentOnReady && t.push(n.componentOnReady()),
1064
+ r(n, t));
1065
+ }
1066
+ }
1067
+ };
1068
+ r(document.documentElement, t), Promise.all(t).then((() => {
1069
+ e();
1070
+ })).catch((() => {
1071
+ e();
1072
+ }));
1073
+ }));
1074
+ })))), e.isClosed()) return;
1075
+ "function" == typeof e.waitForTimeout ? await e.waitForTimeout(100) : await e.waitFor(100),
1076
+ await Promise.all(e._e2eElements.map((e => e.e2eSync())));
1077
+ } catch (e) {}
1078
+ }
1079
+
1080
+ function serializeConsoleMessage(e) {
1081
+ return `${e.text()} ${function t(e) {
1082
+ let t = "";
1083
+ return e && e.url && (t = `\nLocation: ${e.url}`, e.lineNumber && (t += `:${e.lineNumber}`),
1084
+ e.columnNumber && (t += `:${e.columnNumber}`)), t;
1085
+ }(e.location())}`;
1086
+ }
1087
+
1088
+ var posix, pathBrowserify, caller, pathParse, parse, getNodeModulesDirs, nodeModulesPaths, normalizeOptions, ERROR_MESSAGE, slice, toStr, implementation, functionBind, src, isCoreModule, realpathFS$1, defaultIsFile$1, defaultIsDir$1, defaultRealpath, maybeRealpath, defaultReadPackage, getPackageCandidates$1, async, current, core, mod, core_1, isCore, realpathFS, defaultIsFile, defaultIsDir, defaultRealpathSync, maybeRealpathSync, defaultReadPackageSync, getPackageCandidates, sync, resolve;
1089
+
1090
+ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"), rindo_js = require("../compiler/rindo.js"), appData = _lazyRequire("@rindo/core/internal/app-data"), index_cjs = _lazyRequire("../mock-doc/index.cjs"), testing = _lazyRequire("@rindo/core/internal/testing"), fs$2 = require("fs"), crypto$3 = require("crypto"), child_process$2 = require("child_process"), path__default = _interopDefaultLegacy(path$2), fs__default = _interopDefaultLegacy(fs$2), formatComponentRuntimeMembers = (e, t = !0) => ({
1091
+ ...formatPropertiesRuntimeMember(e.properties),
1092
+ ...formatStatesRuntimeMember(e.states),
1093
+ ...t ? formatMethodsRuntimeMember(e.methods) : {}
1094
+ }), formatPropertiesRuntimeMember = e => {
1095
+ const t = {};
1096
+ return e.forEach((e => {
1097
+ t[e.name] = trimFalsy([ formatFlags(e), formatAttrName(e) ]);
1098
+ })), t;
1099
+ }, formatFlags = e => {
1100
+ let t = formatPropType(e.type);
1101
+ return e.mutable && (t |= 1024), e.reflect && (t |= 512), t;
1102
+ }, formatAttrName = e => {
1103
+ if ("string" == typeof e.attribute) {
1104
+ if (e.name === e.attribute) return;
1105
+ return e.attribute;
1106
+ }
1107
+ }, formatPropType = e => "string" === e ? 1 : "number" === e ? 2 : "boolean" === e ? 4 : "any" === e ? 8 : 16, formatStatesRuntimeMember = e => {
1108
+ const t = {};
1109
+ return e.forEach((e => {
1110
+ t[e.name] = [ 32 ];
1111
+ })), t;
1112
+ }, formatMethodsRuntimeMember = e => {
1113
+ const t = {};
1114
+ return e.forEach((e => {
1115
+ t[e.name] = [ 64 ];
1116
+ })), t;
1117
+ }, formatHostListeners = e => e.listeners.map((e => [ computeListenerFlags(e), e.name, e.method ])), computeListenerFlags = e => {
1118
+ let t = 0;
1119
+ switch (e.capture && (t |= 2), e.passive && (t |= 1), e.target) {
1120
+ case "document":
1121
+ t |= 4;
1122
+ break;
1123
+
1124
+ case "window":
1125
+ t |= 8;
1126
+ break;
1127
+
1128
+ case "body":
1129
+ t |= 16;
1130
+ break;
1131
+
1132
+ case "parent":
1133
+ t |= 32;
1134
+ }
1135
+ return t;
1136
+ }, trimFalsy = e => {
1137
+ const t = e;
1138
+ for (var r = t.length - 1; r >= 0 && !t[r]; r--) t.pop();
1139
+ return t;
1140
+ }, noop = () => {}, isFunction = e => "function" == typeof e, isString = e => "string" == typeof e, isIterable = e => (e => null != e)(e) && isFunction(e[Symbol.iterator]), windowsPathRegex = /^(?:[a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?[\\/]$/, hasError = e => null != e && 0 !== e.length && e.some((e => "error" === e.level && "runtime" !== e.type)), normalizePath = e => {
1141
+ if ("string" != typeof e) throw new Error("invalid path to normalize");
1142
+ e = normalizeSlashes(e.trim());
1143
+ const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1], o = s + r.slice(1).join("/");
1144
+ return "" === o ? "." : "" === s && n && e.includes("/") && !n.startsWith(".") && !n.startsWith("@") ? "./" + o : o;
1145
+ }, normalizeSlashes = e => e.replace(backslashRegExp, "/"), backslashRegExp = /\\/g, reducePathComponents = e => {
1146
+ if (!Array.isArray(e) || 0 === e.length) return [];
1147
+ const t = [ e[0] ];
1148
+ for (let r = 1; r < e.length; r++) {
1149
+ const s = e[r];
1150
+ if (s && "." !== s) {
1151
+ if (".." === s) if (t.length > 1) {
1152
+ if (".." !== t[t.length - 1]) {
1153
+ t.pop();
1154
+ continue;
1155
+ }
1156
+ } else if (t[0]) continue;
1157
+ t.push(s);
1158
+ }
1159
+ }
1160
+ return t;
1161
+ }, getRootLength = e => {
1162
+ const t = getEncodedRootLength(e);
1163
+ return t < 0 ? ~t : t;
1164
+ }, getEncodedRootLength = e => {
1165
+ if (!e) return 0;
1166
+ const t = e.charCodeAt(0);
1167
+ if (47 === t || 92 === t) {
1168
+ if (e.charCodeAt(1) !== t) return 1;
1169
+ const r = e.indexOf(47 === t ? "/" : "\\", 2);
1170
+ return r < 0 ? e.length : r + 1;
1171
+ }
1172
+ if (isVolumeCharacter(t) && 58 === e.charCodeAt(1)) {
1173
+ const t = e.charCodeAt(2);
1174
+ if (47 === t || 92 === t) return 3;
1175
+ if (2 === e.length) return 2;
1176
+ }
1177
+ const r = e.indexOf("://");
1178
+ if (-1 !== r) {
1179
+ const t = r + "://".length, s = e.indexOf("/", t);
1180
+ if (-1 !== s) {
1181
+ const n = e.slice(0, r), o = e.slice(t, s);
1182
+ if ("file" === n && ("" === o || "localhost" === o) && isVolumeCharacter(e.charCodeAt(s + 1))) {
1183
+ const t = getFileUrlVolumeSeparatorEnd(e, s + 2);
1184
+ if (-1 !== t) {
1185
+ if (47 === e.charCodeAt(t)) return ~(t + 1);
1186
+ if (t === e.length) return ~t;
1187
+ }
1188
+ }
1189
+ return ~(s + 1);
1190
+ }
1191
+ return ~e.length;
1192
+ }
1193
+ return 0;
1194
+ }, isVolumeCharacter = e => e >= 97 && e <= 122 || e >= 65 && e <= 90, getFileUrlVolumeSeparatorEnd = (e, t) => {
1195
+ const r = e.charCodeAt(t);
1196
+ if (58 === r) return t + 1;
1197
+ if (37 === r && 51 === e.charCodeAt(t + 1)) {
1198
+ const r = e.charCodeAt(t + 2);
1199
+ if (97 === r || 65 === r) return t + 3;
1200
+ }
1201
+ return -1;
1202
+ }, pathComponents = (e, t) => {
1203
+ const r = e.substring(0, t), s = e.substring(t).split("/"), n = s.length;
1204
+ return n > 0 && !s[n - 1] && s.pop(), [ r, ...s ];
1205
+ }, normalizeFsPath = e => normalizePath(e.split("?")[0].replace(/\0/g, "")), flattenDiagnosticMessageText = (e, t) => {
1206
+ if ("string" == typeof t) return t;
1207
+ if (void 0 === t) return "";
1208
+ const r = [], s = e.file.fileName.includes("rindo.config");
1209
+ s && r.push(2322);
1210
+ let n = "";
1211
+ if (!r.includes(t.code) && (n = t.messageText, isIterable(t.next))) for (const r of t.next) n += flattenDiagnosticMessageText(e, r);
1212
+ return s && (n = n.replace("type 'RindoConfig'", "Rindo Config"), n = n.replace("Object literal may only specify known properties, but ", ""),
1213
+ n = n.replace("Object literal may only specify known properties, and ", "")), n.trim();
1214
+ }, isOutputTargetDistLazy = e => e.type === DIST_LAZY, isOutputTargetWww = e => e.type === WWW, DIST_LAZY = "dist-lazy", WWW = "www", jestPreprocessor = {
1215
+ process(e, t, r) {
1216
+ if (function s(e, t) {
1217
+ const r = e.split(".").pop().toLowerCase().split("?")[0];
1218
+ if ("ts" === r || "tsx" === r || "jsx" === r) return !0;
1219
+ if ("mjs" === r) return !0;
1220
+ if ("js" === r) {
1221
+ if (t.includes("import ") || t.includes("import.") || t.includes("import(")) return !0;
1222
+ if (t.includes("export ")) return !0;
1223
+ }
1224
+ return "css" === r;
1225
+ }(t, e)) {
1226
+ const s = {
1227
+ file: t,
1228
+ currentDirectory: r.rootDir
1229
+ }, n = this.getCompilerOptions(r.rootDir);
1230
+ n && (n.baseUrl && (s.baseUrl = n.baseUrl), n.paths && (s.paths = n.paths));
1231
+ const o = transpile(e, s), i = o.diagnostics.some((e => "error" === e.level));
1232
+ if (o.diagnostics && i) {
1233
+ const e = o.diagnostics.map(formatDiagnostic).join("\n\n");
1234
+ throw new Error(e);
1235
+ }
1236
+ return o.code;
1237
+ }
1238
+ return e;
1239
+ },
1240
+ getCompilerOptions(e) {
1241
+ return this._tsCompilerOptions || (this._tsCompilerOptions = function t(e) {
1242
+ if ("string" != typeof e) return null;
1243
+ e = normalizePath(e);
1244
+ const t = rindo_js.ts.findConfigFile(e, rindo_js.ts.sys.fileExists);
1245
+ if (!t) return null;
1246
+ const r = rindo_js.ts.readConfigFile(t, rindo_js.ts.sys.readFile);
1247
+ if (r.error) throw new Error(formatDiagnostic((e => {
1248
+ const t = {
1249
+ level: "warn",
1250
+ type: "typescript",
1251
+ language: "typescript",
1252
+ header: "TypeScript",
1253
+ code: e.code.toString(),
1254
+ messageText: flattenDiagnosticMessageText(e, e.messageText),
1255
+ relFilePath: null,
1256
+ absFilePath: null,
1257
+ lines: []
1258
+ };
1259
+ if (1 === e.category && (t.level = "error"), e.file) {
1260
+ t.absFilePath = e.file.fileName;
1261
+ const s = "string" != typeof (r = e.file.text) ? [] : (r = r.replace(/\\r/g, "\n")).split("\n"), n = e.file.getLineAndCharacterOfPosition(e.start), o = {
1262
+ lineIndex: n.line,
1263
+ lineNumber: n.line + 1,
1264
+ text: s[n.line],
1265
+ errorCharStart: n.character,
1266
+ errorLength: Math.max(e.length, 1)
1267
+ };
1268
+ if (t.lineNumber = o.lineNumber, t.columnNumber = o.errorCharStart + 1, t.lines.push(o),
1269
+ 0 === o.errorLength && o.errorCharStart > 0 && (o.errorLength = 1, o.errorCharStart--),
1270
+ o.lineIndex > 0) {
1271
+ const e = {
1272
+ lineIndex: o.lineIndex - 1,
1273
+ lineNumber: o.lineNumber - 1,
1274
+ text: s[o.lineIndex - 1],
1275
+ errorCharStart: -1,
1276
+ errorLength: -1
1277
+ };
1278
+ t.lines.unshift(e);
1279
+ }
1280
+ if (o.lineIndex + 1 < s.length) {
1281
+ const e = {
1282
+ lineIndex: o.lineIndex + 1,
1283
+ lineNumber: o.lineNumber + 1,
1284
+ text: s[o.lineIndex + 1],
1285
+ errorCharStart: -1,
1286
+ errorLength: -1
1287
+ };
1288
+ t.lines.push(e);
1289
+ }
1290
+ }
1291
+ var r;
1292
+ return t;
1293
+ })(r.error)));
1294
+ return rindo_js.ts.parseJsonConfigFileContent(r.config, rindo_js.ts.sys, e, void 0, t).options;
1295
+ }(e)), this._tsCompilerOptions;
1296
+ },
1297
+ getCacheKey(e, t, r, s) {
1298
+ if (!this._tsCompilerOptionsKey) {
1299
+ const e = this.getCompilerOptions(s.rootDir);
1300
+ this._tsCompilerOptionsKey = JSON.stringify(e);
1301
+ }
1302
+ return [ process.version, this._tsCompilerOptionsKey, e, t, r, !!s.instrument, 6 ].join(":");
1303
+ }
1304
+ }, deepEqual = function e(t, r) {
1305
+ var s, n, o, i, a, l, c, u, d, h;
1306
+ if (t === r) return !0;
1307
+ if (t && r && "object" == typeof t && "object" == typeof r) {
1308
+ if (s = Array.isArray(t), n = Array.isArray(r), s && n) {
1309
+ if ((i = t.length) != r.length) return !1;
1310
+ for (o = i; 0 != o--; ) if (!e(t[o], r[o])) return !1;
1311
+ return !0;
1312
+ }
1313
+ if (s != n) return !1;
1314
+ if ((l = t instanceof Date) != (c = r instanceof Date)) return !1;
1315
+ if (l && c) return t.getTime() == r.getTime();
1316
+ if ((u = t instanceof RegExp) != (d = r instanceof RegExp)) return !1;
1317
+ if (u && d) return t.toString() == r.toString();
1318
+ if ((i = (h = Object.keys(t)).length) !== Object.keys(r).length) return !1;
1319
+ for (o = i; 0 != o--; ) if (!Object.prototype.hasOwnProperty.call(r, h[o])) return !1;
1320
+ for (o = i; 0 != o--; ) if (!e(t[a = h[o]], r[a])) return !1;
1321
+ return !0;
1322
+ }
1323
+ return t != t && r != r;
1324
+ }, expectExtend = {
1325
+ toEqualAttribute: function toEqualAttribute(e, t, r) {
1326
+ if (!e) throw new Error("expect toMatchAttribute value is null");
1327
+ if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
1328
+ if (1 !== e.nodeType) throw new Error("expect toMatchAttribute value is not an element");
1329
+ let s = e.getAttribute(t);
1330
+ null != r && (r = String(r)), null != s && (s = String(s));
1331
+ const n = r === s;
1332
+ return {
1333
+ message: () => `expected attribute ${t} "${r}" to ${n ? "not " : ""}equal "${s}"`,
1334
+ pass: n
1335
+ };
1336
+ },
1337
+ toEqualAttributes: function toEqualAttributes(e, t) {
1338
+ if (!e) throw new Error("expect toEqualAttributes value is null");
1339
+ if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
1340
+ if (1 !== e.nodeType) throw new Error("expect toEqualAttributes value is not an element");
1341
+ const r = Object.keys(t), s = r.every((r => {
1342
+ let s = t[r];
1343
+ return null != s && (s = String(s)), e.getAttribute(r) === s;
1344
+ }));
1345
+ return {
1346
+ message: () => `expected attributes to ${s ? "not " : ""}equal ${r.map((e => `[${e}="${t[e]}"]`)).join(", ")}`,
1347
+ pass: s
1348
+ };
1349
+ },
1350
+ toEqualHtml: function toEqualHtml(e, t) {
1351
+ return compareHtml(e, t, !0);
1352
+ },
1353
+ toEqualLightHtml: function toEqualLightHtml(e, t) {
1354
+ return compareHtml(e, t, !1);
1355
+ },
1356
+ toEqualText: function toEqualText(e, t) {
1357
+ if (null == e) throw new Error(`expect toEqualText() value is "${e}"`);
1358
+ if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
1359
+ let r;
1360
+ 1 === e.nodeType ? r = e.textContent.replace(/\s\s+/g, " ").trim() : null != e && (r = String(e).replace(/\s\s+/g, " ").trim()),
1361
+ "string" == typeof t && (t = t.replace(/\s\s+/g, " ").trim());
1362
+ const s = r === t;
1363
+ return {
1364
+ message: () => `expected textContent "${t}" to ${s ? "not " : ""}equal "${r}"`,
1365
+ pass: s
1366
+ };
1367
+ },
1368
+ toHaveAttribute: function toHaveAttribute(e, t) {
1369
+ if (!e) throw new Error("expect toHaveAttribute value is null");
1370
+ if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
1371
+ if (1 !== e.nodeType) throw new Error("expect toHaveAttribute value is not an element");
1372
+ const r = e.hasAttribute(t);
1373
+ return {
1374
+ message: () => `expected to ${r ? "not " : ""}have the attribute "${t}"`,
1375
+ pass: r
1376
+ };
1377
+ },
1378
+ toHaveClass: function toHaveClass(e, t) {
1379
+ if (!e) throw new Error("expect toHaveClass value is null");
1380
+ if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
1381
+ if (1 !== e.nodeType) throw new Error("expect toHaveClass value is not an element");
1382
+ const r = e.classList.contains(t);
1383
+ return {
1384
+ message: () => `expected to ${r ? "not " : ""}have css class "${t}"`,
1385
+ pass: r
1386
+ };
1387
+ },
1388
+ toHaveClasses,
1389
+ toMatchClasses: function toMatchClasses(e, t) {
1390
+ let {pass: r} = toHaveClasses(e, t);
1391
+ return r && (r = t.length === e.classList.length), {
1392
+ message: () => `expected to ${r ? "not " : ""}match css classes "${t.join(" ")}", but className is "${e.className}"`,
1393
+ pass: r
1394
+ };
1395
+ },
1396
+ toHaveReceivedEvent: function toHaveReceivedEvent(e) {
1397
+ if (!e) throw new Error("toHaveReceivedEvent event spy is null");
1398
+ if ("function" == typeof e.then) throw new Error("event spy must be a resolved value, not a promise, before it can be tested");
1399
+ if (!e.eventName) throw new Error("toHaveReceivedEvent did not receive an event spy");
1400
+ const t = e.events.length > 0;
1401
+ return {
1402
+ message: () => `expected to have ${t ? "not " : ""}called "${e.eventName}" event`,
1403
+ pass: t
1404
+ };
1405
+ },
1406
+ toHaveReceivedEventDetail: function toHaveReceivedEventDetail(e, t) {
1407
+ if (!e) throw new Error("toHaveReceivedEventDetail event spy is null");
1408
+ if ("function" == typeof e.then) throw new Error("event spy must be a resolved value, not a promise, before it can be tested");
1409
+ if (!e.eventName) throw new Error("toHaveReceivedEventDetail did not receive an event spy");
1410
+ if (!e.lastEvent) throw new Error(`event "${e.eventName}" was not received`);
1411
+ const r = deepEqual(e.lastEvent.detail, t);
1412
+ return expect(e.lastEvent.detail).toEqual(t), {
1413
+ message: () => `expected event "${e.eventName}" detail to ${r ? "not " : ""}equal`,
1414
+ pass: r
1415
+ };
1416
+ },
1417
+ toHaveReceivedEventTimes: function toHaveReceivedEventTimes(e, t) {
1418
+ if (!e) throw new Error("toHaveReceivedEventTimes event spy is null");
1419
+ if ("function" == typeof e.then) throw new Error("event spy must be a resolved value, not a promise, before it can be tested");
1420
+ if (!e.eventName) throw new Error("toHaveReceivedEventTimes did not receive an event spy");
1421
+ return {
1422
+ message: () => `expected event "${e.eventName}" to have been called ${t} times, but was called ${e.events.length} time${e.events.length > 1 ? "s" : ""}`,
1423
+ pass: e.length === t
1424
+ };
1425
+ },
1426
+ toHaveFirstReceivedEventDetail: function toHaveFirstReceivedEventDetail(e, t) {
1427
+ if (!e) throw new Error("toHaveFirstReceivedEventDetail event spy is null");
1428
+ if ("function" == typeof e.then) throw new Error("event spy must be a resolved value, not a promise, before it can be tested");
1429
+ if (!e.eventName) throw new Error("toHaveFirstReceivedEventDetail did not receive an event spy");
1430
+ if (!e.firstEvent) throw new Error(`event "${e.eventName}" was not received`);
1431
+ const r = deepEqual(e.firstEvent.detail, t);
1432
+ return expect(e.lastEvent.detail).toEqual(t), {
1433
+ message: () => `expected event "${e.eventName}" detail to ${r ? "not " : ""}equal`,
1434
+ pass: r
1435
+ };
1436
+ },
1437
+ toHaveNthReceivedEventDetail: function toHaveNthReceivedEventDetail(e, t, r) {
1438
+ if (!e) throw new Error("toHaveNthReceivedEventDetail event spy is null");
1439
+ if ("function" == typeof e.then) throw new Error("event spy must be a resolved value, not a promise, before it can be tested");
1440
+ if (!e.eventName) throw new Error("toHaveNthReceivedEventDetail did not receive an event spy");
1441
+ if (!e.firstEvent) throw new Error(`event "${e.eventName}" was not received`);
1442
+ const s = e.events[t];
1443
+ if (!s) throw new Error(`event at index ${t} was not received`);
1444
+ const n = deepEqual(s.detail, r);
1445
+ return expect(s.detail).toEqual(r), {
1446
+ message: () => `expected event "${e.eventName}" detail to ${n ? "not " : ""}equal`,
1447
+ pass: n
1448
+ };
1449
+ },
1450
+ toMatchScreenshot: function toMatchScreenshot(e, t = {}) {
1451
+ if (!e) throw new Error("expect toMatchScreenshot value is null");
1452
+ if ("function" == typeof e.then) throw new Error("expect(compare).toMatchScreenshot() must be a resolved value, not a promise, before it can be tested");
1453
+ if ("number" != typeof e.mismatchedPixels) throw new Error("expect toMatchScreenshot() value is not a screenshot compare");
1454
+ const r = e.device || e.userAgent;
1455
+ if ("number" == typeof t.allowableMismatchedRatio) {
1456
+ if (t.allowableMismatchedRatio < 0 || t.allowableMismatchedRatio > 1) throw new Error("expect toMatchScreenshot() allowableMismatchedRatio must be a value ranging from 0 to 1");
1457
+ const s = e.mismatchedPixels / (e.width * e.deviceScaleFactor * (e.height * e.deviceScaleFactor));
1458
+ return {
1459
+ message: () => `${r}: screenshot has a mismatch ratio of "${s}" for "${e.desc}", but expected ratio to be less than "${t.allowableMismatchedRatio}"`,
1460
+ pass: s <= t.allowableMismatchedRatio
1461
+ };
1462
+ }
1463
+ if ("number" == typeof t.allowableMismatchedPixels) {
1464
+ if (t.allowableMismatchedPixels < 0) throw new Error("expect toMatchScreenshot() allowableMismatchedPixels value must be a value that is 0 or greater");
1465
+ return {
1466
+ message: () => `${r}: screenshot has "${e.mismatchedPixels}" mismatched pixels for "${e.desc}", but expected less than "${t.allowableMismatchedPixels}" mismatched pixels`,
1467
+ pass: e.mismatchedPixels <= t.allowableMismatchedPixels
1468
+ };
1469
+ }
1470
+ if ("number" == typeof e.allowableMismatchedRatio) {
1471
+ const t = e.mismatchedPixels / (e.width * e.deviceScaleFactor * (e.height * e.deviceScaleFactor));
1472
+ return {
1473
+ message: () => `${r}: screenshot has a mismatch ratio of "${t}" for "${e.desc}", but expected ratio to be less than "${e.allowableMismatchedRatio}"`,
1474
+ pass: t <= e.allowableMismatchedRatio
1475
+ };
1476
+ }
1477
+ if ("number" == typeof e.allowableMismatchedPixels) return {
1478
+ message: () => `${r}: screenshot has "${e.mismatchedPixels}" mismatched pixels for "${e.desc}", but expected less than "${e.allowableMismatchedPixels}" mismatched pixels`,
1479
+ pass: e.mismatchedPixels <= e.allowableMismatchedPixels
1480
+ };
1481
+ throw new Error("expect toMatchScreenshot() missing allowableMismatchedPixels in testing config");
1482
+ }
1483
+ };
1484
+
1485
+ class MockHeaders {
1486
+ constructor(e) {
1487
+ if (this._values = [], "object" == typeof e) if ("function" == typeof e[Symbol.iterator]) {
1488
+ const t = [];
1489
+ for (const r of e) "function" == typeof r[Symbol.iterator] && t.push([ ...r ]);
1490
+ for (const e of t) this.append(e[0], e[1]);
1491
+ } else for (const t in e) this.append(t, e[t]);
1492
+ }
1493
+ append(e, t) {
1494
+ this._values.push([ e, t + "" ]);
1495
+ }
1496
+ delete(e) {
1497
+ e = e.toLowerCase();
1498
+ for (let t = this._values.length - 1; t >= 0; t--) this._values[t][0].toLowerCase() === e && this._values.splice(t, 1);
1499
+ }
1500
+ entries() {
1501
+ const e = [];
1502
+ for (const t of this.keys()) e.push([ t, this.get(t) ]);
1503
+ let t = -1;
1504
+ return {
1505
+ next: () => (t++, {
1506
+ value: e[t],
1507
+ done: !e[t]
1508
+ }),
1509
+ [Symbol.iterator]() {
1510
+ return this;
1511
+ }
1512
+ };
1513
+ }
1514
+ forEach(e) {
1515
+ for (const t of this.entries()) e(t[1], t[0]);
1516
+ }
1517
+ get(e) {
1518
+ const t = [];
1519
+ e = e.toLowerCase();
1520
+ for (const r of this._values) r[0].toLowerCase() === e && t.push(r[1]);
1521
+ return t.length > 0 ? t.join(", ") : null;
1522
+ }
1523
+ has(e) {
1524
+ e = e.toLowerCase();
1525
+ for (const t of this._values) if (t[0].toLowerCase() === e) return !0;
1526
+ return !1;
1527
+ }
1528
+ keys() {
1529
+ const e = [];
1530
+ for (const t of this._values) {
1531
+ const r = t[0].toLowerCase();
1532
+ e.includes(r) || e.push(r);
1533
+ }
1534
+ let t = -1;
1535
+ return {
1536
+ next: () => (t++, {
1537
+ value: e[t],
1538
+ done: !e[t]
1539
+ }),
1540
+ [Symbol.iterator]() {
1541
+ return this;
1542
+ }
1543
+ };
1544
+ }
1545
+ set(e, t) {
1546
+ for (const r of this._values) if (r[0].toLowerCase() === e.toLowerCase()) return void (r[1] = t + "");
1547
+ this.append(e, t);
1548
+ }
1549
+ values() {
1550
+ const e = this._values;
1551
+ let t = -1;
1552
+ return {
1553
+ next() {
1554
+ t++;
1555
+ const r = !e[t];
1556
+ return {
1557
+ value: r ? void 0 : e[t][1],
1558
+ done: r
1559
+ };
1560
+ },
1561
+ [Symbol.iterator]() {
1562
+ return this;
1563
+ }
1564
+ };
1565
+ }
1566
+ [Symbol.iterator]() {
1567
+ return this.entries();
1568
+ }
1569
+ }
1570
+
1571
+ class MockRequest {
1572
+ constructor(e, t = {}) {
1573
+ this._method = "GET", this._url = "/", this.bodyUsed = !1, this.cache = "default",
1574
+ this.credentials = "same-origin", this.integrity = "", this.keepalive = !1, this.mode = "cors",
1575
+ this.redirect = "follow", this.referrer = "about:client", this.referrerPolicy = "",
1576
+ "string" == typeof e ? this.url = e : e && (Object.assign(this, e), this.headers = new MockHeaders(e.headers)),
1577
+ Object.assign(this, t), t.headers && (this.headers = new MockHeaders(t.headers)),
1578
+ this.headers || (this.headers = new MockHeaders);
1579
+ }
1580
+ get url() {
1581
+ return "string" == typeof this._url ? new URL(this._url, location.href).href : new URL("/", location.href).href;
1582
+ }
1583
+ set url(e) {
1584
+ this._url = e;
1585
+ }
1586
+ get method() {
1587
+ return "string" == typeof this._method ? this._method.toUpperCase() : "GET";
1588
+ }
1589
+ set method(e) {
1590
+ this._method = e;
1591
+ }
1592
+ clone() {
1593
+ const e = {
1594
+ ...this
1595
+ };
1596
+ return e.headers = new MockHeaders(this.headers), new MockRequest(e);
1597
+ }
1598
+ }
1599
+
1600
+ class MockResponse {
1601
+ constructor(e, t = {}) {
1602
+ this.ok = !0, this.status = 200, this.statusText = "", this.type = "default", this.url = "",
1603
+ this._body = e, t && Object.assign(this, t), this.headers = new MockHeaders(t.headers);
1604
+ }
1605
+ async json() {
1606
+ return JSON.parse(this._body);
1607
+ }
1608
+ async text() {
1609
+ return this._body;
1610
+ }
1611
+ clone() {
1612
+ const e = {
1613
+ ...this
1614
+ };
1615
+ return e.headers = new MockHeaders(this.headers), new MockResponse(this._body, e);
1616
+ }
1617
+ }
1618
+
1619
+ const mockedResponses = new Map, mockFetch = {
1620
+ json(e, t) {
1621
+ setMockedResponse(new MockResponse(JSON.stringify(e, null, 2), {
1622
+ headers: new MockHeaders({
1623
+ "Content-Type": "application/json"
1624
+ })
1625
+ }), t, !1);
1626
+ },
1627
+ text(e, t) {
1628
+ setMockedResponse(new MockResponse(e, {
1629
+ headers: new MockHeaders({
1630
+ "Content-Type": "text/plain"
1631
+ })
1632
+ }), t, !1);
1633
+ },
1634
+ response(e, t) {
1635
+ setMockedResponse(e, t, !1);
1636
+ },
1637
+ reject(e, t) {
1638
+ setMockedResponse(e, t, !0);
1639
+ },
1640
+ reset: function mockFetchReset() {
1641
+ mockedResponses.clear();
1642
+ }
1643
+ };
1644
+
1645
+ class MockResponse404 extends MockResponse {
1646
+ constructor() {
1647
+ super("", {
1648
+ headers: new MockHeaders({
1649
+ "Content-Type": "text/plain"
1650
+ })
1651
+ }), this.ok = !1, this.status = 404, this.statusText = "Not Found";
1652
+ }
1653
+ async json() {
1654
+ return {
1655
+ status: 404,
1656
+ statusText: "Not Found"
1657
+ };
1658
+ }
1659
+ async text() {
1660
+ return "Not Found";
1661
+ }
1662
+ }
1663
+
1664
+ const FETCH_DEFAULT_PATH = "/mock-fetch-data", HtmlSerializer = {
1665
+ print: e => index_cjs.serializeNodeToHtml(e, {
1666
+ serializeShadowRoot: !0,
1667
+ prettyHtml: !0,
1668
+ outerHtml: !0
1669
+ }),
1670
+ test: e => null != e && (e instanceof HTMLElement || e instanceof index_cjs.MockNode)
1671
+ };
1672
+
1673
+ class BuildContext {
1674
+ constructor(e, t) {
1675
+ this.buildId = -1, this.buildMessages = [], this.buildResults = null, this.bundleBuildCount = 0,
1676
+ this.collections = [], this.completedTasks = [], this.components = [], this.componentGraph = new Map,
1677
+ this.data = {}, this.diagnostics = [], this.dirsAdded = [], this.dirsDeleted = [],
1678
+ this.entryModules = [], this.filesAdded = [], this.filesChanged = [], this.filesDeleted = [],
1679
+ this.filesUpdated = [], this.filesWritten = [], this.globalStyle = void 0, this.hasConfigChanges = !1,
1680
+ this.hasFinished = !1, this.hasHtmlChanges = !1, this.hasPrintedResults = !1, this.hasServiceWorkerChanges = !1,
1681
+ this.hasScriptChanges = !0, this.hasStyleChanges = !0, this.hydrateAppFilePath = null,
1682
+ this.indexBuildCount = 0, this.indexDoc = void 0, this.isRebuild = !1, this.moduleFiles = [],
1683
+ this.outputs = [], this.packageJson = {}, this.packageJsonFilePath = null, this.pendingCopyTasks = [],
1684
+ this.requiresFullBuild = !0, this.scriptsAdded = [], this.scriptsDeleted = [], this.startTime = Date.now(),
1685
+ this.styleBuildCount = 0, this.stylesPromise = null, this.stylesUpdated = [], this.timeSpan = null,
1686
+ this.transpileBuildCount = 0, this.config = e, this.compilerCtx = t, this.buildId = ++this.compilerCtx.activeBuildId,
1687
+ this.debug = e.logger.debug.bind(e.logger);
1688
+ }
1689
+ start() {
1690
+ const e = `${this.isRebuild ? "rebuild" : "build"}, ${this.config.fsNamespace}, ${this.config.devMode ? "dev" : "prod"} mode, started`, t = {
1691
+ buildId: this.buildId,
1692
+ messages: [],
1693
+ progress: 0
1694
+ };
1695
+ this.compilerCtx.events.emit("buildLog", t), this.timeSpan = this.createTimeSpan(e),
1696
+ this.timestamp = getBuildTimestamp(), this.debug(`start build, ${this.timestamp}`);
1697
+ const r = {
1698
+ buildId: this.buildId,
1699
+ timestamp: this.timestamp
1700
+ };
1701
+ this.compilerCtx.events.emit("buildStart", r);
1702
+ }
1703
+ createTimeSpan(e, t) {
1704
+ if (!this.hasFinished || t) {
1705
+ t && this.config.watch && (e = `${this.config.logger.cyan("[" + this.buildId + "]")} ${e}`);
1706
+ const r = this.config.logger.createTimeSpan(e, t, this.buildMessages);
1707
+ if (!t && this.compilerCtx.events) {
1708
+ const e = {
1709
+ buildId: this.buildId,
1710
+ messages: this.buildMessages,
1711
+ progress: getProgress(this.completedTasks)
1712
+ };
1713
+ this.compilerCtx.events.emit("buildLog", e);
1714
+ }
1715
+ return {
1716
+ duration: () => r.duration(),
1717
+ finish: (e, s, n, o) => {
1718
+ if ((!this.hasFinished || t) && (t && this.config.watch && (e = `${this.config.logger.cyan("[" + this.buildId + "]")} ${e}`),
1719
+ r.finish(e, s, n, o), !t)) {
1720
+ const e = {
1721
+ buildId: this.buildId,
1722
+ messages: this.buildMessages.slice(),
1723
+ progress: getProgress(this.completedTasks)
1724
+ };
1725
+ this.compilerCtx.events.emit("buildLog", e);
1726
+ }
1727
+ return r.duration();
1728
+ }
1729
+ };
1730
+ }
1731
+ return {
1732
+ duration: () => 0,
1733
+ finish: () => 0
1734
+ };
1735
+ }
1736
+ debug(e) {
1737
+ this.config.logger.debug(e);
1738
+ }
1739
+ get hasError() {
1740
+ return hasError(this.diagnostics);
1741
+ }
1742
+ get hasWarning() {
1743
+ return null != (e = this.diagnostics) && 0 !== e.length && e.some((e => "warn" === e.level));
1744
+ var e;
1745
+ }
1746
+ progress(e) {
1747
+ this.completedTasks.push(e);
1748
+ }
1749
+ async validateTypesBuild() {
1750
+ this.hasError || this.validateTypesPromise && (this.config.watch || (this.debug("build, non-watch, waiting on validateTypes"),
1751
+ await this.validateTypesPromise, this.debug("build, non-watch, finished waiting on validateTypes")));
1752
+ }
1753
+ }
1754
+
1755
+ const getBuildTimestamp = () => {
1756
+ const e = new Date;
1757
+ let t = e.getUTCFullYear() + "-";
1758
+ return t += ("0" + (e.getUTCMonth() + 1)).slice(-2) + "-", t += ("0" + e.getUTCDate()).slice(-2) + "T",
1759
+ t += ("0" + e.getUTCHours()).slice(-2) + ":", t += ("0" + e.getUTCMinutes()).slice(-2) + ":",
1760
+ t += ("0" + e.getUTCSeconds()).slice(-2), t;
1761
+ }, getProgress = e => {
1762
+ let t = 0;
1763
+ const r = Object.keys(ProgressTask);
1764
+ return r.forEach(((r, s) => {
1765
+ e.includes(ProgressTask[r]) && (t = s);
1766
+ })), (t + 1) / r.length;
1767
+ }, ProgressTask = {
1768
+ emptyOutputTargets: {},
1769
+ transpileApp: {},
1770
+ generateStyles: {},
1771
+ generateOutputTargets: {},
1772
+ validateTypesBuild: {},
1773
+ writeBuildFiles: {}
1774
+ };
1775
+
1776
+ class Cache {
1777
+ constructor(e, t) {
1778
+ this.config = e, this.cacheFs = t, this.failed = 0, this.skip = !1, this.sys = e.sys,
1779
+ this.logger = e.logger;
1780
+ }
1781
+ async initCacheDir() {
1782
+ if (!this.config._isTesting && this.config.cacheDir) {
1783
+ if (!this.config.enableCache || !this.cacheFs) return this.config.logger.info("cache optimizations disabled"),
1784
+ void this.clearDiskCache();
1785
+ this.config.logger.debug(`cache enabled, cacheDir: ${this.config.cacheDir}`);
1786
+ try {
1787
+ const e = path$2.join(this.config.cacheDir, "_README.log");
1788
+ await this.cacheFs.writeFile(e, CACHE_DIR_README);
1789
+ } catch (e) {
1790
+ this.logger.error(`Cache, initCacheDir: ${e}`), this.config.enableCache = !1;
1791
+ }
1792
+ }
1793
+ }
1794
+ async get(e) {
1795
+ if (!this.config.enableCache || this.skip) return null;
1796
+ if (this.failed >= MAX_FAILED) return this.skip || (this.skip = !0, this.logger.debug(`cache had ${this.failed} failed ops, skip disk ops for remander of build`)),
1797
+ null;
1798
+ let t;
1799
+ try {
1800
+ t = await this.cacheFs.readFile(this.getCacheFilePath(e)), this.failed = 0, this.skip = !1;
1801
+ } catch (e) {
1802
+ this.failed++, t = null;
1803
+ }
1804
+ return t;
1805
+ }
1806
+ async put(e, t) {
1807
+ if (!this.config.enableCache) return !1;
1808
+ let r;
1809
+ try {
1810
+ await this.cacheFs.writeFile(this.getCacheFilePath(e), t), r = !0;
1811
+ } catch (e) {
1812
+ this.failed++, r = !1;
1813
+ }
1814
+ return r;
1815
+ }
1816
+ async has(e) {
1817
+ return "string" == typeof await this.get(e);
1818
+ }
1819
+ async createKey(e, ...t) {
1820
+ return this.config.enableCache ? e + "_" + await this.sys.generateContentHash(JSON.stringify(t), 32) : e + 9999999 * Math.random();
1821
+ }
1822
+ async commit() {
1823
+ this.config.enableCache && (this.skip = !1, this.failed = 0, await this.cacheFs.commit(),
1824
+ await this.clearExpiredCache());
1825
+ }
1826
+ clear() {
1827
+ null != this.cacheFs && this.cacheFs.clearCache();
1828
+ }
1829
+ async clearExpiredCache() {
1830
+ if (null == this.cacheFs || null == this.sys.cacheStorage) return;
1831
+ const e = Date.now(), t = await this.sys.cacheStorage.get(EXP_STORAGE_KEY);
1832
+ if (null != t) {
1833
+ if (e - t < ONE_DAY) return;
1834
+ const r = this.cacheFs.sys, s = await r.readDir(this.config.cacheDir), n = s.map((e => path$2.join(this.config.cacheDir, e)));
1835
+ let o = 0;
1836
+ const i = n.map((async t => {
1837
+ const s = (await r.stat(t)).mtimeMs;
1838
+ e - s > ONE_WEEK && (await r.removeFile(t), o++);
1839
+ }));
1840
+ await Promise.all(i), this.logger.debug(`clearExpiredCache, cachedFileNames: ${s.length}, totalCleared: ${o}`);
1841
+ }
1842
+ this.logger.debug("clearExpiredCache, set last clear"), await this.sys.cacheStorage.set(EXP_STORAGE_KEY, e);
1843
+ }
1844
+ async clearDiskCache() {
1845
+ null != this.cacheFs && await this.cacheFs.access(this.config.cacheDir) && (await this.cacheFs.remove(this.config.cacheDir),
1846
+ await this.cacheFs.commit());
1847
+ }
1848
+ getCacheFilePath(e) {
1849
+ return path$2.join(this.config.cacheDir, e) + ".log";
1850
+ }
1851
+ getMemoryStats() {
1852
+ return null != this.cacheFs ? this.cacheFs.getMemoryStats() : null;
1853
+ }
1854
+ }
1855
+
1856
+ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY = "last_clear_expired_cache", CACHE_DIR_README = '# Rindo Cache Directory\n\nThis directory contains files which the compiler has\ncached for faster builds. To disable caching, please set\n"enableCache: false" within the rindo config.\n\nTo change the cache directory, please update the\n"cacheDir" property within the rindo config.\n', getCommitInstructions = e => {
1857
+ const t = {
1858
+ filesToDelete: [],
1859
+ filesToWrite: [],
1860
+ filesToCopy: [],
1861
+ dirsToDelete: [],
1862
+ dirsToEnsure: []
1863
+ };
1864
+ e.forEach(((e, r) => {
1865
+ if (!0 === e.queueWriteToDisk) {
1866
+ if (!0 === e.isFile) {
1867
+ t.filesToWrite.push(r);
1868
+ const e = normalizePath(path$2.dirname(r));
1869
+ t.dirsToEnsure.includes(e) || t.dirsToEnsure.push(e);
1870
+ const s = t.dirsToDelete.indexOf(e);
1871
+ s > -1 && t.dirsToDelete.splice(s, 1);
1872
+ const n = t.filesToDelete.indexOf(r);
1873
+ n > -1 && t.filesToDelete.splice(n, 1);
1874
+ } else if (!0 === e.isDirectory) {
1875
+ t.dirsToEnsure.includes(r) || t.dirsToEnsure.push(r);
1876
+ const e = t.dirsToDelete.indexOf(r);
1877
+ e > -1 && t.dirsToDelete.splice(e, 1);
1878
+ }
1879
+ } else if (!0 === e.queueDeleteFromDisk) e.isDirectory && !t.dirsToEnsure.includes(r) ? t.dirsToDelete.push(r) : e.isFile && !t.filesToWrite.includes(r) && t.filesToDelete.push(r); else if ("string" == typeof e.queueCopyFileToDest) {
1880
+ const s = r, n = e.queueCopyFileToDest;
1881
+ t.filesToCopy.push([ s, n ]);
1882
+ const o = normalizePath(path$2.dirname(n));
1883
+ t.dirsToEnsure.includes(o) || t.dirsToEnsure.push(o);
1884
+ const i = t.dirsToDelete.indexOf(o);
1885
+ i > -1 && t.dirsToDelete.splice(i, 1);
1886
+ const a = t.filesToDelete.indexOf(n);
1887
+ a > -1 && t.filesToDelete.splice(a, 1);
1888
+ }
1889
+ e.queueDeleteFromDisk = !1, e.queueWriteToDisk = !1;
1890
+ }));
1891
+ for (let e = 0, r = t.dirsToEnsure.length; e < r; e++) {
1892
+ const r = t.dirsToEnsure[e].split("/");
1893
+ for (let e = 2; e < r.length; e++) {
1894
+ const s = r.slice(0, e).join("/");
1895
+ !1 === t.dirsToEnsure.includes(s) && t.dirsToEnsure.push(s);
1896
+ }
1897
+ }
1898
+ t.dirsToEnsure.sort(((e, t) => {
1899
+ const r = e.split("/").length, s = t.split("/").length;
1900
+ return r < s ? -1 : r > s ? 1 : e.length < t.length ? -1 : e.length > t.length ? 1 : 0;
1901
+ })), t.dirsToDelete.sort(((e, t) => {
1902
+ const r = e.split("/").length, s = t.split("/").length;
1903
+ return r < s ? 1 : r > s ? -1 : e.length < t.length ? 1 : e.length > t.length ? -1 : 0;
1904
+ }));
1905
+ for (const e of t.dirsToEnsure) {
1906
+ const r = t.dirsToDelete.indexOf(e);
1907
+ r > -1 && t.dirsToDelete.splice(r, 1);
1908
+ }
1909
+ return t.dirsToDelete = t.dirsToDelete.filter((e => "/" !== e && !0 !== e.endsWith(":/"))),
1910
+ t.dirsToEnsure = t.dirsToEnsure.filter((t => {
1911
+ const r = e.get(t);
1912
+ return (null == r || !0 !== r.exists || !0 !== r.isDirectory) && "/" !== t && !t.endsWith(":/");
1913
+ })), t;
1914
+ }, shouldIgnore = e => (e = e.trim().toLowerCase(), IGNORE.some((t => e.endsWith(t)))), IGNORE = [ ".ds_store", ".gitignore", "desktop.ini", "thumbs.db" ];
1915
+
1916
+ (posix = {
1917
+ resolve: function e() {
1918
+ var t, r, s, n = "", o = !1;
1919
+ for (r = arguments.length - 1; r >= -1 && !o; r--) r >= 0 ? s = arguments[r] : (void 0 === t && (t = process.cwd()),
1920
+ s = t), assertPath(s), 0 !== s.length && (n = s + "/" + n, o = 47 === s.charCodeAt(0));
1921
+ return n = normalizeStringPosix(n, !o), o ? n.length > 0 ? "/" + n : "/" : n.length > 0 ? n : ".";
1922
+ },
1923
+ normalize: function e(t) {
1924
+ var r, s;
1925
+ return assertPath(t), 0 === t.length ? "." : (r = 47 === t.charCodeAt(0), s = 47 === t.charCodeAt(t.length - 1),
1926
+ 0 !== (t = normalizeStringPosix(t, !r)).length || r || (t = "."), t.length > 0 && s && (t += "/"),
1927
+ r ? "/" + t : t);
1928
+ },
1929
+ isAbsolute: function e(t) {
1930
+ return assertPath(t), t.length > 0 && 47 === t.charCodeAt(0);
1931
+ },
1932
+ join: function e() {
1933
+ var t, r, s;
1934
+ if (0 === arguments.length) return ".";
1935
+ for (r = 0; r < arguments.length; ++r) assertPath(s = arguments[r]), s.length > 0 && (void 0 === t ? t = s : t += "/" + s);
1936
+ return void 0 === t ? "." : posix.normalize(t);
1937
+ },
1938
+ relative: function e(t, r) {
1939
+ var s, n, o, i, a, l, c, u, d, h;
1940
+ if (assertPath(t), assertPath(r), t === r) return "";
1941
+ if ((t = posix.resolve(t)) === (r = posix.resolve(r))) return "";
1942
+ for (s = 1; s < t.length && 47 === t.charCodeAt(s); ++s) ;
1943
+ for (o = (n = t.length) - s, i = 1; i < r.length && 47 === r.charCodeAt(i); ++i) ;
1944
+ for (l = o < (a = r.length - i) ? o : a, c = -1, u = 0; u <= l; ++u) {
1945
+ if (u === l) {
1946
+ if (a > l) {
1947
+ if (47 === r.charCodeAt(i + u)) return r.slice(i + u + 1);
1948
+ if (0 === u) return r.slice(i + u);
1949
+ } else o > l && (47 === t.charCodeAt(s + u) ? c = u : 0 === u && (c = 0));
1950
+ break;
1951
+ }
1952
+ if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(i + u)) break;
1953
+ 47 === d && (c = u);
1954
+ }
1955
+ for (h = "", u = s + c + 1; u <= n; ++u) u !== n && 47 !== t.charCodeAt(u) || (0 === h.length ? h += ".." : h += "/..");
1956
+ return h.length > 0 ? h + r.slice(i + c) : (i += c, 47 === r.charCodeAt(i) && ++i,
1957
+ r.slice(i));
1958
+ },
1959
+ _makeLong: function e(t) {
1960
+ return t;
1961
+ },
1962
+ dirname: function e(t) {
1963
+ var r, s, n, o;
1964
+ if (assertPath(t), 0 === t.length) return ".";
1965
+ for (r = 47 === t.charCodeAt(0), s = -1, n = !0, o = t.length - 1; o >= 1; --o) if (47 === t.charCodeAt(o)) {
1966
+ if (!n) {
1967
+ s = o;
1968
+ break;
1969
+ }
1970
+ } else n = !1;
1971
+ return -1 === s ? r ? "/" : "." : r && 1 === s ? "//" : t.slice(0, s);
1972
+ },
1973
+ basename: function e(t, r) {
1974
+ var s, n, o, i, a, l, c;
1975
+ if (void 0 !== r && "string" != typeof r) throw new TypeError('"ext" argument must be a string');
1976
+ if (assertPath(t), s = 0, n = -1, o = !0, void 0 !== r && r.length > 0 && r.length <= t.length) {
1977
+ if (r.length === t.length && r === t) return "";
1978
+ for (a = r.length - 1, l = -1, i = t.length - 1; i >= 0; --i) if (47 === (c = t.charCodeAt(i))) {
1979
+ if (!o) {
1980
+ s = i + 1;
1981
+ break;
1982
+ }
1983
+ } else -1 === l && (o = !1, l = i + 1), a >= 0 && (c === r.charCodeAt(a) ? -1 == --a && (n = i) : (a = -1,
1984
+ n = l));
1985
+ return s === n ? n = l : -1 === n && (n = t.length), t.slice(s, n);
1986
+ }
1987
+ for (i = t.length - 1; i >= 0; --i) if (47 === t.charCodeAt(i)) {
1988
+ if (!o) {
1989
+ s = i + 1;
1990
+ break;
1991
+ }
1992
+ } else -1 === n && (o = !1, n = i + 1);
1993
+ return -1 === n ? "" : t.slice(s, n);
1994
+ },
1995
+ extname: function e(t) {
1996
+ var r, s, n, o, i, a, l;
1997
+ for (assertPath(t), r = -1, s = 0, n = -1, o = !0, i = 0, a = t.length - 1; a >= 0; --a) if (47 !== (l = t.charCodeAt(a))) -1 === n && (o = !1,
1998
+ n = a + 1), 46 === l ? -1 === r ? r = a : 1 !== i && (i = 1) : -1 !== r && (i = -1); else if (!o) {
1999
+ s = a + 1;
2000
+ break;
2001
+ }
2002
+ return -1 === r || -1 === n || 0 === i || 1 === i && r === n - 1 && r === s + 1 ? "" : t.slice(r, n);
2003
+ },
2004
+ format: function e(t) {
2005
+ if (null === t || "object" != typeof t) throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t);
2006
+ return function r(e, t) {
2007
+ var r = t.dir || t.root, s = t.base || (t.name || "") + (t.ext || "");
2008
+ return r ? r === t.root ? r + s : r + e + s : s;
2009
+ }("/", t);
2010
+ },
2011
+ parse: function e(t) {
2012
+ var r, s, n, o, i, a, l, c, u, d;
2013
+ if (assertPath(t), r = {
2014
+ root: "",
2015
+ dir: "",
2016
+ base: "",
2017
+ ext: "",
2018
+ name: ""
2019
+ }, 0 === t.length) return r;
2020
+ for ((n = 47 === (s = t.charCodeAt(0))) ? (r.root = "/", o = 1) : o = 0, i = -1,
2021
+ a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >= o; --u) if (47 !== (s = t.charCodeAt(u))) -1 === l && (c = !1,
2022
+ l = u + 1), 46 === s ? -1 === i ? i = u : 1 !== d && (d = 1) : -1 !== i && (d = -1); else if (!c) {
2023
+ a = u + 1;
2024
+ break;
2025
+ }
2026
+ return -1 === i || -1 === l || 0 === d || 1 === d && i === l - 1 && i === a + 1 ? -1 !== l && (r.base = r.name = 0 === a && n ? t.slice(1, l) : t.slice(a, l)) : (0 === a && n ? (r.name = t.slice(1, i),
2027
+ r.base = t.slice(1, l)) : (r.name = t.slice(a, i), r.base = t.slice(a, l)), r.ext = t.slice(i, l)),
2028
+ a > 0 ? r.dir = t.slice(0, a - 1) : n && (r.dir = "/"), r;
2029
+ },
2030
+ sep: "/",
2031
+ delimiter: ":",
2032
+ win32: null,
2033
+ posix: null
2034
+ }).posix = posix, pathBrowserify = posix;
2035
+
2036
+ const IS_DENO_ENV = "undefined" != typeof Deno, IS_NODE_ENV = !(IS_DENO_ENV || "undefined" == typeof global || "function" != typeof require || !global.process || "string" != typeof __filename || global.origin && "string" == typeof global.origin);
2037
+
2038
+ IS_NODE_ENV ? process.platform : IS_DENO_ENV && Deno.build.os;
2039
+
2040
+ const IS_BROWSER_ENV = "undefined" != typeof location && "undefined" != typeof navigator && "undefined" != typeof XMLHttpRequest, IS_WEB_WORKER_ENV = IS_BROWSER_ENV && "undefined" != typeof self && "function" == typeof self.importScripts, HAS_WEB_WORKER = IS_BROWSER_ENV && "function" == typeof Worker, IS_FETCH_ENV = "function" == typeof fetch;
2041
+
2042
+ IS_NODE_ENV && require, IS_NODE_ENV ? process.cwd : IS_DENO_ENV && Deno.cwd;
2043
+
2044
+ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json", ".md" ], COMMON_DIR_FILENAMES = [ "package.json", "index.js", "index.mjs" ], getCommonDirName = (e, t) => e + "/" + t, isCommonDirModuleFile = e => COMMON_DIR_MODULE_EXTS.some((t => e.endsWith(t))), shouldFetchModule = e => IS_FETCH_ENV && IS_BROWSER_ENV && isNodeModulePath(e), isNodeModulePath = e => normalizePath(e).split("/").includes("node_modules"), getPackageDirPath = (e, t) => {
2045
+ const r = normalizePath(e).split("/"), s = (e => {
2046
+ e.startsWith("~") && (e = e.substring(1));
2047
+ const t = e.split("/"), r = {
2048
+ moduleId: null,
2049
+ filePath: null,
2050
+ scope: null,
2051
+ scopeSubModuleId: null
2052
+ };
2053
+ return e.startsWith("@") && t.length > 1 ? (r.moduleId = t.slice(0, 2).join("/"),
2054
+ r.filePath = t.slice(2).join("/"), r.scope = t[0], r.scopeSubModuleId = t[1]) : (r.moduleId = t[0],
2055
+ r.filePath = t.slice(1).join("/")), r;
2056
+ })(t);
2057
+ for (let e = r.length - 1; e >= 1; e--) if ("node_modules" === r[e - 1]) if (s.scope) {
2058
+ if (r[e] === s.scope && r[e + 1] === s.scopeSubModuleId) return r.slice(0, e + 2).join("/");
2059
+ } else if (r[e] === s.moduleId) return r.slice(0, e + 1).join("/");
2060
+ return null;
2061
+ }, packageVersions = new Map, known404Urls = new Set, getCommonDirUrl = (e, t, r, s) => getNodeModuleFetchUrl(e, t, r) + "/" + s, getNodeModuleFetchUrl = (e, t, r) => {
2062
+ let s = (r = normalizePath(r)).split("/").filter((e => e.length));
2063
+ const n = s.lastIndexOf("node_modules");
2064
+ n > -1 && n < s.length - 1 && (s = s.slice(n + 1));
2065
+ let o = s.shift();
2066
+ o.startsWith("@") && (o += "/" + s.shift());
2067
+ const i = s.join("/");
2068
+ if ("@rindo/core" === o) {
2069
+ return ((e, t) => {
2070
+ let r = (t = normalizePath(t)).split("/");
2071
+ const s = r.lastIndexOf("node_modules");
2072
+ return s > -1 && s < r.length - 1 && (r = r.slice(s + 1), r = r[0].startsWith("@") ? r.slice(2) : r.slice(1),
2073
+ t = r.join("/")), new URL("./" + t, (e => new URL("../", e).href)(e)).href;
2074
+ })(e.getCompilerExecutingPath(), i);
2075
+ }
2076
+ return e.getRemoteModuleUrl({
2077
+ moduleId: o,
2078
+ version: t.get(o),
2079
+ path: i
2080
+ });
2081
+ }, knownUrlSkips = [ "/@rindo/core/internal.js", "/@rindo/core/internal.json", "/@rindo/core/internal.mjs", "/@rindo/core/internal/rindo-core.js/index.json", "/@rindo/core/internal/rindo-core.js.json", "/@rindo/core/internal/rindo-core.js/package.json", "/@rindo/core.js", "/@rindo/core.json", "/@rindo/core.mjs", "/@rindo/core.css", "/@rindo/core/index.js", "/@rindo/core/index.json", "/@rindo/core/index.mjs", "/@rindo/core/index.css", "/@rindo/package.json" ], fetchModuleAsync = async (e, t, r, s, n) => {
2082
+ if (!((e => {
2083
+ if (!(e => e.endsWith(".d.ts"))(t = e) && t.endsWith(".ts") || (e => e.endsWith(".tsx"))(e)) return !0;
2084
+ var t;
2085
+ const r = e.split("/"), s = r[r.length - 2], n = r[r.length - 1];
2086
+ return !("node_modules" !== s || !isCommonDirModuleFile(n));
2087
+ })(n) || known404Urls.has(s) || (e => knownUrlSkips.some((t => e.endsWith(t))))(s))) try {
2088
+ const o = await ((e, t, r) => (console.trace(t), e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r)))(e, s);
2089
+ if (o) {
2090
+ if (o.ok) {
2091
+ const i = await o.clone().text();
2092
+ return await (async (e, t, r, s, n, o) => {
2093
+ r.endsWith("package.json") && ((e, t) => {
2094
+ try {
2095
+ const r = JSON.parse(t);
2096
+ r.name && r.version && ((e, t, r) => {
2097
+ e.set(t, r);
2098
+ })(e, r.name, r.version);
2099
+ } catch (e) {}
2100
+ })(o, n);
2101
+ let i = path$2.dirname(s);
2102
+ for (;"/" !== i && "" !== i; ) t ? (t.clearFileCache(i), await t.sys.createDir(i)) : await e.createDir(i),
2103
+ i = path$2.dirname(i);
2104
+ t ? (t.clearFileCache(s), await t.sys.writeFile(s, n)) : await e.writeFile(s, n);
2105
+ })(e, t, s, n, i, r), i;
2106
+ }
2107
+ 404 === o.status && known404Urls.add(s);
2108
+ }
2109
+ } catch (e) {
2110
+ console.error(e);
2111
+ }
2112
+ };
2113
+
2114
+ caller = function() {
2115
+ var e, t = Error.prepareStackTrace;
2116
+ return Error.prepareStackTrace = function(e, t) {
2117
+ return t;
2118
+ }, e = (new Error).stack, Error.prepareStackTrace = t, e[2].getFileName();
2119
+ }, pathParse = function createCommonjsModule(e, t, r) {
2120
+ return e(r = {
2121
+ path: t,
2122
+ exports: {},
2123
+ require: function(e, t) {
2124
+ return function s() {
2125
+ throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
2126
+ }(null == t && r.path);
2127
+ }
2128
+ }, r.exports), r.exports;
2129
+ }((function(e) {
2130
+ var t, r, s = "win32" === process.platform, n = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/, o = /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/, i = {
2131
+ parse: function(e) {
2132
+ if ("string" != typeof e) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof e);
2133
+ var t = function r(e) {
2134
+ var t = n.exec(e), r = (t[1] || "") + (t[2] || ""), s = t[3] || "", i = o.exec(s);
2135
+ return [ r, i[1], i[2], i[3] ];
2136
+ }(e);
2137
+ if (!t || 4 !== t.length) throw new TypeError("Invalid path '" + e + "'");
2138
+ return {
2139
+ root: t[0],
2140
+ dir: t[0] + t[1].slice(0, -1),
2141
+ base: t[2],
2142
+ ext: t[3],
2143
+ name: t[2].slice(0, t[2].length - t[3].length)
2144
+ };
2145
+ }
2146
+ };
2147
+ t = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/, (r = {}).parse = function(e) {
2148
+ if ("string" != typeof e) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof e);
2149
+ var r = function s(e) {
2150
+ return t.exec(e).slice(1);
2151
+ }(e);
2152
+ if (!r || 4 !== r.length) throw new TypeError("Invalid path '" + e + "'");
2153
+ return r[1] = r[1] || "", r[2] = r[2] || "", r[3] = r[3] || "", {
2154
+ root: r[0],
2155
+ dir: r[0] + r[1].slice(0, -1),
2156
+ base: r[2],
2157
+ ext: r[3],
2158
+ name: r[2].slice(0, r[2].length - r[3].length)
2159
+ };
2160
+ }, e.exports = s ? i.parse : r.parse, e.exports.posix = r.parse, e.exports.win32 = i.parse;
2161
+ })), parse = path__default.default.parse || pathParse, getNodeModulesDirs = function e(t, r) {
2162
+ var s, n, o = "/";
2163
+ for (/^([A-Za-z]:)/.test(t) ? o = "" : /^\\\\/.test(t) && (o = "\\\\"), s = [ t ],
2164
+ n = parse(t); n.dir !== s[s.length - 1]; ) s.push(n.dir), n = parse(n.dir);
2165
+ return s.reduce((function(e, t) {
2166
+ return e.concat(r.map((function(e) {
2167
+ return path__default.default.resolve(o, t, e);
2168
+ })));
2169
+ }), []);
2170
+ }, nodeModulesPaths = function e(t, r, s) {
2171
+ var n, o = r && r.moduleDirectory ? [].concat(r.moduleDirectory) : [ "node_modules" ];
2172
+ return r && "function" == typeof r.paths ? r.paths(s, t, (function() {
2173
+ return getNodeModulesDirs(t, o);
2174
+ }), r) : (n = getNodeModulesDirs(t, o), r && r.paths ? n.concat(r.paths) : n);
2175
+ }, normalizeOptions = function(e, t) {
2176
+ return t || {};
2177
+ }, ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", slice = Array.prototype.slice,
2178
+ toStr = Object.prototype.toString, implementation = function e(t) {
2179
+ var r, s, n, o, i, a, l, c = this;
2180
+ if ("function" != typeof c || "[object Function]" !== toStr.call(c)) throw new TypeError(ERROR_MESSAGE + c);
2181
+ for (r = slice.call(arguments, 1), n = function() {
2182
+ if (this instanceof s) {
2183
+ var e = c.apply(this, r.concat(slice.call(arguments)));
2184
+ return Object(e) === e ? e : this;
2185
+ }
2186
+ return c.apply(t, r.concat(slice.call(arguments)));
2187
+ }, o = Math.max(0, c.length - r.length), i = [], a = 0; a < o; a++) i.push("$" + a);
2188
+ return s = Function("binder", "return function (" + i.join(",") + "){ return binder.apply(this,arguments); }")(n),
2189
+ c.prototype && ((l = function e() {}).prototype = c.prototype, s.prototype = new l,
2190
+ l.prototype = null), s;
2191
+ }, functionBind = Function.prototype.bind || implementation, src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
2192
+
2193
+ const data$1 = {
2194
+ assert: !0,
2195
+ "assert/strict": ">= 15",
2196
+ async_hooks: ">= 8",
2197
+ buffer_ieee754: "< 0.9.7",
2198
+ buffer: !0,
2199
+ child_process: !0,
2200
+ cluster: !0,
2201
+ console: !0,
2202
+ constants: !0,
2203
+ crypto: !0,
2204
+ _debug_agent: ">= 1 && < 8",
2205
+ _debugger: "< 8",
2206
+ dgram: !0,
2207
+ diagnostics_channel: ">= 15.1",
2208
+ dns: !0,
2209
+ "dns/promises": ">= 15",
2210
+ domain: ">= 0.7.12",
2211
+ events: !0,
2212
+ freelist: "< 6",
2213
+ fs: !0,
2214
+ "fs/promises": [ ">= 10 && < 10.1", ">= 14" ],
2215
+ _http_agent: ">= 0.11.1",
2216
+ _http_client: ">= 0.11.1",
2217
+ _http_common: ">= 0.11.1",
2218
+ _http_incoming: ">= 0.11.1",
2219
+ _http_outgoing: ">= 0.11.1",
2220
+ _http_server: ">= 0.11.1",
2221
+ http: !0,
2222
+ http2: ">= 8.8",
2223
+ https: !0,
2224
+ inspector: ">= 8.0.0",
2225
+ _linklist: "< 8",
2226
+ module: !0,
2227
+ net: !0,
2228
+ "node-inspect/lib/_inspect": ">= 7.6.0 && < 12",
2229
+ "node-inspect/lib/internal/inspect_client": ">= 7.6.0 && < 12",
2230
+ "node-inspect/lib/internal/inspect_repl": ">= 7.6.0 && < 12",
2231
+ os: !0,
2232
+ path: !0,
2233
+ "path/posix": ">= 15.3",
2234
+ "path/win32": ">= 15.3",
2235
+ perf_hooks: ">= 8.5",
2236
+ process: ">= 1",
2237
+ punycode: !0,
2238
+ querystring: !0,
2239
+ readline: !0,
2240
+ repl: !0,
2241
+ smalloc: ">= 0.11.5 && < 3",
2242
+ _stream_duplex: ">= 0.9.4",
2243
+ _stream_transform: ">= 0.9.4",
2244
+ _stream_wrap: ">= 1.4.1",
2245
+ _stream_passthrough: ">= 0.9.4",
2246
+ _stream_readable: ">= 0.9.4",
2247
+ _stream_writable: ">= 0.9.4",
2248
+ stream: !0,
2249
+ "stream/promises": ">= 15",
2250
+ string_decoder: !0,
2251
+ sys: [ ">= 0.6 && < 0.7", ">= 0.8" ],
2252
+ timers: !0,
2253
+ "timers/promises": ">= 15",
2254
+ _tls_common: ">= 0.11.13",
2255
+ _tls_legacy: ">= 0.11.3 && < 10",
2256
+ _tls_wrap: ">= 0.11.3",
2257
+ tls: !0,
2258
+ trace_events: ">= 10",
2259
+ tty: !0,
2260
+ url: !0,
2261
+ util: !0,
2262
+ "util/types": ">= 15.3",
2263
+ "v8/tools/arguments": ">= 10 && < 12",
2264
+ "v8/tools/codemap": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
2265
+ "v8/tools/consarray": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
2266
+ "v8/tools/csvparser": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
2267
+ "v8/tools/logreader": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
2268
+ "v8/tools/profile_view": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
2269
+ "v8/tools/splaytree": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
2270
+ v8: ">= 1",
2271
+ vm: !0,
2272
+ wasi: ">= 13.4 && < 13.5",
2273
+ worker_threads: ">= 11.7",
2274
+ zlib: !0
2275
+ };
2276
+
2277
+ isCoreModule = function e(t, r) {
2278
+ return src(data$1, t) && function s(e, t) {
2279
+ var r, s;
2280
+ if ("boolean" == typeof t) return t;
2281
+ if ("string" != typeof (r = void 0 === e ? process.versions && process.versions.node && process.versions.node : e)) throw new TypeError(void 0 === e ? "Unable to determine current node version" : "If provided, a valid node version is required");
2282
+ if (t && "object" == typeof t) {
2283
+ for (s = 0; s < t.length; ++s) if (matchesRange$1(r, t[s])) return !0;
2284
+ return !1;
2285
+ }
2286
+ return matchesRange$1(r, t);
2287
+ }(r, data$1[t]);
2288
+ }, realpathFS$1 = fs__default.default.realpath && "function" == typeof fs__default.default.realpath.native ? fs__default.default.realpath.native : fs__default.default.realpath,
2289
+ defaultIsFile$1 = function e(t, r) {
2290
+ fs__default.default.stat(t, (function(e, t) {
2291
+ return e ? "ENOENT" === e.code || "ENOTDIR" === e.code ? r(null, !1) : r(e) : r(null, t.isFile() || t.isFIFO());
2292
+ }));
2293
+ }, defaultIsDir$1 = function e(t, r) {
2294
+ fs__default.default.stat(t, (function(e, t) {
2295
+ return e ? "ENOENT" === e.code || "ENOTDIR" === e.code ? r(null, !1) : r(e) : r(null, t.isDirectory());
2296
+ }));
2297
+ }, defaultRealpath = function e(t, r) {
2298
+ realpathFS$1(t, (function(e, s) {
2299
+ e && "ENOENT" !== e.code ? r(e) : r(null, e ? t : s);
2300
+ }));
2301
+ }, maybeRealpath = function e(t, r, s, n) {
2302
+ s && !1 === s.preserveSymlinks ? t(r, n) : n(null, r);
2303
+ }, defaultReadPackage = function e(t, r, s) {
2304
+ t(r, (function(e, t) {
2305
+ if (e) s(e); else try {
2306
+ var r = JSON.parse(t);
2307
+ s(null, r);
2308
+ } catch (e) {
2309
+ s(null);
2310
+ }
2311
+ }));
2312
+ }, getPackageCandidates$1 = function e(t, r, s) {
2313
+ var n, o = nodeModulesPaths(r, s, t);
2314
+ for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
2315
+ return o;
2316
+ }, async = function e(t, r, s) {
2317
+ function n(e) {
2318
+ if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) D = path__default.default.resolve(e, t),
2319
+ "." !== t && ".." !== t && "/" !== t.slice(-1) || (D += "/"), /\/$/.test(t) && D === e ? l(D, S.package, o) : i(D, S.package, o); else {
2320
+ if (_ && isCoreModule(t)) return T(null, t);
2321
+ !function r(e, t, s) {
2322
+ var n = function() {
2323
+ return getPackageCandidates$1(e, t, S);
2324
+ };
2325
+ c(s, y ? y(e, t, n, S) : n());
2326
+ }(t, e, (function(e, r, s) {
2327
+ if (e) T(e); else {
2328
+ if (r) return maybeRealpath(f, r, S, (function(e, t) {
2329
+ e ? T(e) : T(null, t, s);
2330
+ }));
2331
+ var n = new Error("Cannot find module '" + t + "' from '" + b + "'");
2332
+ n.code = "MODULE_NOT_FOUND", T(n);
2333
+ }
2334
+ }));
2335
+ }
2336
+ }
2337
+ function o(e, r, s) {
2338
+ e ? T(e) : r ? T(null, r, s) : l(D, (function(e, r, s) {
2339
+ if (e) T(e); else if (r) maybeRealpath(f, r, S, (function(e, t) {
2340
+ e ? T(e) : T(null, t, s);
2341
+ })); else {
2342
+ var n = new Error("Cannot find module '" + t + "' from '" + b + "'");
2343
+ n.code = "MODULE_NOT_FOUND", T(n);
2344
+ }
2345
+ }));
2346
+ }
2347
+ function i(e, t, r) {
2348
+ var s = t, n = r;
2349
+ "function" == typeof s && (n = s, s = void 0), function e(t, r, s) {
2350
+ function o(s, o, a) {
2351
+ var u, h, p;
2352
+ return c = o, s ? n(s) : a && c && S.pathFilter && (h = (u = path__default.default.relative(a, l)).slice(0, u.length - t[0].length),
2353
+ p = S.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l, i);
2354
+ }
2355
+ function i(s, o) {
2356
+ return s ? n(s) : o ? n(null, l, c) : void e(t.slice(1), r, c);
2357
+ }
2358
+ var l, c;
2359
+ if (0 === t.length) return n(null, void 0, s);
2360
+ l = r + t[0], (c = s) ? o(null, c) : a(path__default.default.dirname(l), o);
2361
+ }([ "" ].concat(w), e, s);
2362
+ }
2363
+ function a(e, t) {
2364
+ return "" === e || "/" === e || "win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e) ? t(null) : void maybeRealpath(f, e, S, (function(r, s) {
2365
+ if (r) return a(path__default.default.dirname(e), t);
2366
+ var n = path__default.default.join(s, "package.json");
2367
+ d(n, (function(r, s) {
2368
+ if (!s) return a(path__default.default.dirname(e), t);
2369
+ m(p, n, (function(r, s) {
2370
+ r && t(r);
2371
+ var o = s;
2372
+ o && S.packageFilter && (o = S.packageFilter(o, n)), t(null, o, e);
2373
+ }));
2374
+ }));
2375
+ }));
2376
+ }
2377
+ function l(e, t, r) {
2378
+ var s = r, n = t;
2379
+ "function" == typeof n && (s = n, n = S.package), maybeRealpath(f, e, S, (function(t, r) {
2380
+ if (t) return s(t);
2381
+ var o = path__default.default.join(r, "package.json");
2382
+ d(o, (function(t, r) {
2383
+ return t ? s(t) : r ? void m(p, o, (function(t, r) {
2384
+ var n, a;
2385
+ return t ? s(t) : ((n = r) && S.packageFilter && (n = S.packageFilter(n, o)), n && n.main ? "string" != typeof n.main ? ((a = new TypeError("package “" + n.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
2386
+ s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void i(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
2387
+ return t ? s(t) : r ? s(null, r, n) : n ? void l(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
2388
+ return t ? s(t) : r ? s(null, r, n) : void i(path__default.default.join(e, "index"), n, s);
2389
+ })) : i(path__default.default.join(e, "index"), n, s);
2390
+ }))) : void i(path__default.default.join(e, "/index"), n, s));
2391
+ })) : i(path__default.default.join(e, "index"), n, s);
2392
+ }));
2393
+ }));
2394
+ }
2395
+ function c(e, t) {
2396
+ function r(t, r, o) {
2397
+ return t ? e(t) : r ? e(null, r, o) : void l(n, S.package, s);
2398
+ }
2399
+ function s(r, s, n) {
2400
+ return r ? e(r) : s ? e(null, s, n) : void c(e, t.slice(1));
2401
+ }
2402
+ if (0 === t.length) return e(null, void 0);
2403
+ var n = t[0];
2404
+ h(path__default.default.dirname(n), (function o(s, a) {
2405
+ return s ? e(s) : a ? void i(n, S.package, r) : c(e, t.slice(1));
2406
+ }));
2407
+ }
2408
+ var u, d, h, p, f, m, g, y, w, _, v, b, E, D, T = s, S = r;
2409
+ return "function" == typeof r && (T = S, S = {}), "string" != typeof t ? (u = new TypeError("Path must be a string."),
2410
+ process.nextTick((function() {
2411
+ T(u);
2412
+ }))) : (S = normalizeOptions(0, S), d = S.isFile || defaultIsFile$1, h = S.isDirectory || defaultIsDir$1,
2413
+ p = S.readFile || fs__default.default.readFile, f = S.realpath || defaultRealpath,
2414
+ m = S.readPackage || defaultReadPackage, S.readFile && S.readPackage ? (g = new TypeError("`readFile` and `readPackage` are mutually exclusive."),
2415
+ process.nextTick((function() {
2416
+ T(g);
2417
+ }))) : (y = S.packageIterator, w = S.extensions || [ ".js" ], _ = !1 !== S.includeCoreModules,
2418
+ v = S.basedir || path__default.default.dirname(caller()), b = S.filename || v, S.paths = S.paths || [],
2419
+ E = path__default.default.resolve(v), void maybeRealpath(f, E, S, (function(e, t) {
2420
+ e ? T(e) : n(t);
2421
+ }))));
2422
+ };
2423
+
2424
+ const data = {
2425
+ assert: !0,
2426
+ "assert/strict": ">= 15",
2427
+ async_hooks: ">= 8",
2428
+ buffer_ieee754: "< 0.9.7",
2429
+ buffer: !0,
2430
+ child_process: !0,
2431
+ cluster: !0,
2432
+ console: !0,
2433
+ constants: !0,
2434
+ crypto: !0,
2435
+ _debug_agent: ">= 1 && < 8",
2436
+ _debugger: "< 8",
2437
+ dgram: !0,
2438
+ diagnostics_channel: ">= 15.1",
2439
+ dns: !0,
2440
+ "dns/promises": ">= 15",
2441
+ domain: ">= 0.7.12",
2442
+ events: !0,
2443
+ freelist: "< 6",
2444
+ fs: !0,
2445
+ "fs/promises": [ ">= 10 && < 10.1", ">= 14" ],
2446
+ _http_agent: ">= 0.11.1",
2447
+ _http_client: ">= 0.11.1",
2448
+ _http_common: ">= 0.11.1",
2449
+ _http_incoming: ">= 0.11.1",
2450
+ _http_outgoing: ">= 0.11.1",
2451
+ _http_server: ">= 0.11.1",
2452
+ http: !0,
2453
+ http2: ">= 8.8",
2454
+ https: !0,
2455
+ inspector: ">= 8.0.0",
2456
+ _linklist: "< 8",
2457
+ module: !0,
2458
+ net: !0,
2459
+ "node-inspect/lib/_inspect": ">= 7.6.0 && < 12",
2460
+ "node-inspect/lib/internal/inspect_client": ">= 7.6.0 && < 12",
2461
+ "node-inspect/lib/internal/inspect_repl": ">= 7.6.0 && < 12",
2462
+ os: !0,
2463
+ path: !0,
2464
+ "path/posix": ">= 15.3",
2465
+ "path/win32": ">= 15.3",
2466
+ perf_hooks: ">= 8.5",
2467
+ process: ">= 1",
2468
+ punycode: !0,
2469
+ querystring: !0,
2470
+ readline: !0,
2471
+ repl: !0,
2472
+ smalloc: ">= 0.11.5 && < 3",
2473
+ _stream_duplex: ">= 0.9.4",
2474
+ _stream_transform: ">= 0.9.4",
2475
+ _stream_wrap: ">= 1.4.1",
2476
+ _stream_passthrough: ">= 0.9.4",
2477
+ _stream_readable: ">= 0.9.4",
2478
+ _stream_writable: ">= 0.9.4",
2479
+ stream: !0,
2480
+ "stream/promises": ">= 15",
2481
+ string_decoder: !0,
2482
+ sys: [ ">= 0.6 && < 0.7", ">= 0.8" ],
2483
+ timers: !0,
2484
+ "timers/promises": ">= 15",
2485
+ _tls_common: ">= 0.11.13",
2486
+ _tls_legacy: ">= 0.11.3 && < 10",
2487
+ _tls_wrap: ">= 0.11.3",
2488
+ tls: !0,
2489
+ trace_events: ">= 10",
2490
+ tty: !0,
2491
+ url: !0,
2492
+ util: !0,
2493
+ "util/types": ">= 15.3",
2494
+ "v8/tools/arguments": ">= 10 && < 12",
2495
+ "v8/tools/codemap": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
2496
+ "v8/tools/consarray": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
2497
+ "v8/tools/csvparser": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
2498
+ "v8/tools/logreader": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
2499
+ "v8/tools/profile_view": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
2500
+ "v8/tools/splaytree": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
2501
+ v8: ">= 1",
2502
+ vm: !0,
2503
+ wasi: ">= 13.4 && < 13.5",
2504
+ worker_threads: ">= 11.7",
2505
+ zlib: !0
2506
+ };
2507
+
2508
+ for (mod in current = process.versions && process.versions.node && process.versions.node.split(".") || [],
2509
+ core = {}, data) Object.prototype.hasOwnProperty.call(data, mod) && (core[mod] = versionIncluded(data[mod]));
2510
+
2511
+ core_1 = core, isCore = function e(t) {
2512
+ return isCoreModule(t);
2513
+ }, realpathFS = fs__default.default.realpathSync && "function" == typeof fs__default.default.realpathSync.native ? fs__default.default.realpathSync.native : fs__default.default.realpathSync,
2514
+ defaultIsFile = function e(t) {
2515
+ try {
2516
+ var r = fs__default.default.statSync(t);
2517
+ } catch (e) {
2518
+ if (e && ("ENOENT" === e.code || "ENOTDIR" === e.code)) return !1;
2519
+ throw e;
2520
+ }
2521
+ return r.isFile() || r.isFIFO();
2522
+ }, defaultIsDir = function e(t) {
2523
+ try {
2524
+ var r = fs__default.default.statSync(t);
2525
+ } catch (e) {
2526
+ if (e && ("ENOENT" === e.code || "ENOTDIR" === e.code)) return !1;
2527
+ throw e;
2528
+ }
2529
+ return r.isDirectory();
2530
+ }, defaultRealpathSync = function e(t) {
2531
+ try {
2532
+ return realpathFS(t);
2533
+ } catch (e) {
2534
+ if ("ENOENT" !== e.code) throw e;
2535
+ }
2536
+ return t;
2537
+ }, maybeRealpathSync = function e(t, r, s) {
2538
+ return s && !1 === s.preserveSymlinks ? t(r) : r;
2539
+ }, defaultReadPackageSync = function e(t, r) {
2540
+ var s = t(r);
2541
+ try {
2542
+ return JSON.parse(s);
2543
+ } catch (e) {}
2544
+ }, getPackageCandidates = function e(t, r, s) {
2545
+ var n, o = nodeModulesPaths(r, s, t);
2546
+ for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
2547
+ return o;
2548
+ }, sync = function e(t, r) {
2549
+ function s(e) {
2550
+ var t, r, s, o, l = n(path__default.default.dirname(e));
2551
+ if (l && l.dir && l.pkg && i.pathFilter && (t = path__default.default.relative(l.dir, e),
2552
+ (r = i.pathFilter(l.pkg, e, t)) && (e = path__default.default.resolve(l.dir, r))),
2553
+ a(e)) return e;
2554
+ for (s = 0; s < p.length; s++) if (o = e + p[s], a(o)) return o;
2555
+ }
2556
+ function n(e) {
2557
+ var t, r;
2558
+ if ("" !== e && "/" !== e && !("win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e))) return t = path__default.default.join(maybeRealpathSync(u, e, i), "package.json"),
2559
+ a(t) ? ((r = d(l, t)) && i.packageFilter && (r = i.packageFilter(r, e)), {
2560
+ pkg: r,
2561
+ dir: e
2562
+ }) : n(path__default.default.dirname(e));
2563
+ }
2564
+ function o(e) {
2565
+ var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e, i), "/package.json");
2566
+ if (a(h)) {
2567
+ try {
2568
+ t = d(l, h);
2569
+ } catch (e) {}
2570
+ if (t && i.packageFilter && (t = i.packageFilter(t, e)), t && t.main) {
2571
+ if ("string" != typeof t.main) throw (r = new TypeError("package “" + t.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
2572
+ r;
2573
+ "." !== t.main && "./" !== t.main || (t.main = "index");
2574
+ try {
2575
+ if (n = s(path__default.default.resolve(e, t.main))) return n;
2576
+ if (c = o(path__default.default.resolve(e, t.main))) return c;
2577
+ } catch (e) {}
2578
+ }
2579
+ }
2580
+ return s(path__default.default.join(e, "/index"));
2581
+ }
2582
+ var i, a, l, c, u, d, h, p, f, m, g, y, w, _, v, b;
2583
+ if ("string" != typeof t) throw new TypeError("Path must be a string.");
2584
+ if (i = normalizeOptions(0, r), a = i.isFile || defaultIsFile, l = i.readFileSync || fs__default.default.readFileSync,
2585
+ c = i.isDirectory || defaultIsDir, u = i.realpathSync || defaultRealpathSync, d = i.readPackageSync || defaultReadPackageSync,
2586
+ i.readFileSync && i.readPackageSync) throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
2587
+ if (h = i.packageIterator, p = i.extensions || [ ".js" ], f = !1 !== i.includeCoreModules,
2588
+ m = i.basedir || path__default.default.dirname(caller()), g = i.filename || m, i.paths = i.paths || [],
2589
+ y = maybeRealpathSync(u, path__default.default.resolve(m), i), /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) {
2590
+ if (w = path__default.default.resolve(y, t), "." !== t && ".." !== t && "/" !== t.slice(-1) || (w += "/"),
2591
+ _ = s(w) || o(w)) return maybeRealpathSync(u, _, i);
2592
+ } else {
2593
+ if (f && isCoreModule(t)) return t;
2594
+ if (v = function E(e, t) {
2595
+ var r, n, a, l, u = function() {
2596
+ return getPackageCandidates(e, t, i);
2597
+ }, d = h ? h(e, t, u, i) : u();
2598
+ for (r = 0; r < d.length; r++) if (n = d[r], c(path__default.default.dirname(n))) {
2599
+ if (a = s(n)) return a;
2600
+ if (l = o(n)) return l;
2601
+ }
2602
+ }(t, y)) return maybeRealpathSync(u, v, i);
2603
+ }
2604
+ throw (b = new Error("Cannot find module '" + t + "' from '" + g + "'")).code = "MODULE_NOT_FOUND",
2605
+ b;
2606
+ }, async.core = core_1, async.isCore = isCore, async.sync = sync, resolve = async;
2607
+
2608
+ const createSystem = e => {
2609
+ const t = e && e.logger ? e.logger : (() => {
2610
+ let e = IS_BROWSER_ENV, t = "info";
2611
+ return {
2612
+ enableColors: t => e = t,
2613
+ getLevel: () => t,
2614
+ setLevel: e => t = e,
2615
+ emoji: e => e,
2616
+ info: console.log.bind(console),
2617
+ warn: console.warn.bind(console),
2618
+ error: console.error.bind(console),
2619
+ debug: console.debug.bind(console),
2620
+ red: e => e,
2621
+ green: e => e,
2622
+ yellow: e => e,
2623
+ blue: e => e,
2624
+ magenta: e => e,
2625
+ cyan: e => e,
2626
+ gray: e => e,
2627
+ bold: e => e,
2628
+ dim: e => e,
2629
+ bgRed: e => e,
2630
+ createTimeSpan: (e, t = !1) => ({
2631
+ duration: () => 0,
2632
+ finish: () => 0
2633
+ }),
2634
+ printDiagnostics(t) {
2635
+ t.forEach((t => ((e, t) => {
2636
+ let r = BLUE, s = "Build", n = "";
2637
+ "error" === e.level ? (r = RED, s = "Error") : "warn" === e.level && (r = YELLOW,
2638
+ s = "Warning"), e.header && (s = e.header);
2639
+ const o = e.relFilePath || e.absFilePath;
2640
+ if (o && (n += o, "number" == typeof e.lineNumber && e.lineNumber > 0 && (n += ", line " + e.lineNumber,
2641
+ "number" == typeof e.columnNumber && e.columnNumber > 0 && (n += ", column " + e.columnNumber)),
2642
+ n += "\n"), n += e.messageText, e.lines && e.lines.length > 0 && (e.lines.forEach((e => {
2643
+ n += "\n" + e.lineNumber + ": " + e.text;
2644
+ })), n += "\n"), t) {
2645
+ const e = [ "%c" + s, `background: ${r}; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;` ];
2646
+ console.log(...e, n);
2647
+ } else "error" === e.level ? console.error(n) : "warn" === e.level ? console.warn(n) : console.log(n);
2648
+ })(t, e)));
2649
+ }
2650
+ };
2651
+ })(), r = new Map, s = new Set, n = e => s.add(e), o = e => s.delete(e), i = (() => {
2652
+ const e = [], t = t => {
2653
+ const r = e.findIndex((e => e.callback === t));
2654
+ return r > -1 && (e.splice(r, 1), !0);
2655
+ };
2656
+ return {
2657
+ emit: (t, r) => {
2658
+ const s = t.toLowerCase().trim(), n = e.slice();
2659
+ for (const e of n) if (null == e.eventName) try {
2660
+ e.callback(t, r);
2661
+ } catch (e) {
2662
+ console.error(e);
2663
+ } else if (e.eventName === s) try {
2664
+ e.callback(r);
2665
+ } catch (e) {
2666
+ console.error(e);
2667
+ }
2668
+ },
2669
+ on: (r, s) => {
2670
+ if ("function" == typeof r) {
2671
+ const s = null, n = r;
2672
+ return e.push({
2673
+ eventName: s,
2674
+ callback: n
2675
+ }), () => t(n);
2676
+ }
2677
+ if ("string" == typeof r && "function" == typeof s) {
2678
+ const n = r.toLowerCase().trim(), o = s;
2679
+ return e.push({
2680
+ eventName: n,
2681
+ callback: o
2682
+ }), () => t(o);
2683
+ }
2684
+ return () => !1;
2685
+ },
2686
+ unsubscribeAll: () => {
2687
+ e.length = 0;
2688
+ }
2689
+ };
2690
+ })(), a = IS_BROWSER_ENV && navigator.hardwareConcurrency || 1, l = e => {
2691
+ if ("/" === e || "" === e) return "/";
2692
+ const t = path$2.dirname(e), r = path$2.basename(e);
2693
+ return t.endsWith("/") ? normalizePath(`${t}${r}`) : normalizePath(`${t}/${r}`);
2694
+ }, c = e => {
2695
+ const t = r.get(l(e));
2696
+ return !(!t || !(t.isDirectory || t.isFile && "string" == typeof t.data));
2697
+ }, u = (e, t) => {
2698
+ e = l(e);
2699
+ const r = {
2700
+ basename: path$2.basename(e),
2701
+ dirname: path$2.dirname(e),
2702
+ path: e,
2703
+ newDirs: [],
2704
+ error: null
2705
+ };
2706
+ return d(e, t, r), r;
2707
+ }, d = (e, t, s) => {
2708
+ const n = path$2.dirname(e);
2709
+ t && t.recursive && !(e => "/" === e || windowsPathRegex.test(e))(n) && d(n, t, s);
2710
+ const o = r.get(e);
2711
+ o ? (o.isDirectory = !0, o.isFile = !1) : (r.set(e, {
2712
+ basename: path$2.basename(e),
2713
+ dirname: n,
2714
+ isDirectory: !0,
2715
+ isFile: !1,
2716
+ watcherCallbacks: null,
2717
+ data: void 0
2718
+ }), s.newDirs.push(e), v(e, new Set));
2719
+ }, h = e => {
2720
+ e = l(e);
2721
+ const t = [], s = r.get(e);
2722
+ return s && s.isDirectory && r.forEach(((r, s) => {
2723
+ "/" !== s && (r.isDirectory || r.isFile && "string" == typeof r.data) && (e.endsWith("/") && `${e}${r.basename}` === s || `${e}/${r.basename}` === s) && t.push(s);
2724
+ })), t.sort();
2725
+ }, p = e => {
2726
+ e = l(e);
2727
+ const t = r.get(e);
2728
+ if (t && t.isFile) return t.data;
2729
+ }, f = e => ({
2730
+ path: l(e),
2731
+ error: null
2732
+ }), m = (e, t, s) => {
2733
+ const n = w(e);
2734
+ if (!n.error && !s.error) if (n.isFile) {
2735
+ const n = path$2.dirname(t), o = u(n, {
2736
+ recursive: !0
2737
+ }), i = r.get(e).data, a = b(t, i);
2738
+ s.newDirs.push(...o.newDirs), s.renamed.push({
2739
+ oldPath: e,
2740
+ newPath: t,
2741
+ isDirectory: !1,
2742
+ isFile: !0
2743
+ }), a.error ? s.error = a.error : s.newFiles.push(t);
2744
+ } else if (n.isDirectory) {
2745
+ const r = h(e), n = u(t, {
2746
+ recursive: !0
2747
+ });
2748
+ s.newDirs.push(...n.newDirs), s.renamed.push({
2749
+ oldPath: e,
2750
+ newPath: t,
2751
+ isDirectory: !0,
2752
+ isFile: !1
2753
+ });
2754
+ for (const n of r) {
2755
+ const r = n.replace(e, t);
2756
+ m(n, r, s);
2757
+ }
2758
+ }
2759
+ }, g = (e, t = {}) => {
2760
+ const r = {
2761
+ basename: path$2.basename(e),
2762
+ dirname: path$2.dirname(e),
2763
+ path: e,
2764
+ removedDirs: [],
2765
+ removedFiles: [],
2766
+ error: null
2767
+ };
2768
+ return y(e, t, r), r;
2769
+ }, y = (e, t, s) => {
2770
+ if (!s.error) {
2771
+ e = l(e);
2772
+ const n = h(e);
2773
+ if (t && t.recursive) for (const e of n) {
2774
+ const n = r.get(e);
2775
+ if (n) if (n.isDirectory) y(e, t, s); else if (n.isFile) {
2776
+ const t = _(e);
2777
+ t.error ? s.error = t.error : s.removedFiles.push(e);
2778
+ }
2779
+ } else if (n.length > 0) return void (s.error = "cannot delete directory that contains files/subdirectories");
2780
+ r.delete(e), v(e, new Set), s.removedDirs.push(e);
2781
+ }
2782
+ }, w = e => {
2783
+ e = l(e);
2784
+ const t = r.get(e);
2785
+ return t && (t.isDirectory || t.isFile && "string" == typeof t.data) ? {
2786
+ isDirectory: t.isDirectory,
2787
+ isFile: t.isFile,
2788
+ isSymbolicLink: !1,
2789
+ size: t.isFile && t.data ? t.data.length : 0,
2790
+ error: null
2791
+ } : {
2792
+ isDirectory: !1,
2793
+ isFile: !1,
2794
+ isSymbolicLink: !1,
2795
+ size: 0,
2796
+ error: `ENOENT: no such file or directory, statSync '${e}'`
2797
+ };
2798
+ }, _ = e => {
2799
+ e = l(e);
2800
+ const t = {
2801
+ basename: path$2.basename(e),
2802
+ dirname: path$2.dirname(e),
2803
+ path: e,
2804
+ error: null
2805
+ }, s = r.get(e);
2806
+ if (s) {
2807
+ if (s.watcherCallbacks) for (const t of s.watcherCallbacks) t(e, "fileDelete");
2808
+ r.delete(e), v(e, new Set);
2809
+ }
2810
+ return t;
2811
+ }, v = (e, t) => {
2812
+ const s = l(path$2.dirname(e)), n = r.get(s);
2813
+ if (n && n.isDirectory && n.watcherCallbacks) for (const t of n.watcherCallbacks) t(e, null);
2814
+ t.has(s) || (t.add(s), v(s, t));
2815
+ }, b = (e, t) => {
2816
+ const s = {
2817
+ path: e = l(e),
2818
+ error: null
2819
+ }, n = r.get(e);
2820
+ if (n) {
2821
+ const r = n.data !== t;
2822
+ if (n.data = t, r && n.watcherCallbacks) for (const t of n.watcherCallbacks) t(e, "fileUpdate");
2823
+ } else r.set(e, {
2824
+ basename: path$2.basename(e),
2825
+ dirname: path$2.dirname(e),
2826
+ isDirectory: !1,
2827
+ isFile: !0,
2828
+ watcherCallbacks: null,
2829
+ data: t
2830
+ }), v(e, new Set);
2831
+ return s;
2832
+ }, E = Promise.resolve();
2833
+ u("/");
2834
+ const D = {
2835
+ name: "in-memory",
2836
+ version: "2.5.2",
2837
+ events: i,
2838
+ access: async e => c(e),
2839
+ accessSync: c,
2840
+ addDestory: n,
2841
+ copyFile: async (e, t) => (b(t, p(e)), !0),
2842
+ createDir: async (e, t) => u(e, t),
2843
+ createDirSync: u,
2844
+ destroy: async () => {
2845
+ const e = [];
2846
+ s.forEach((r => {
2847
+ try {
2848
+ const t = r();
2849
+ t && t.then && e.push(t);
2850
+ } catch (e) {
2851
+ t.error(`rindo sys destroy: ${e}`);
2852
+ }
2853
+ })), await Promise.all(e), s.clear();
2854
+ },
2855
+ encodeToBase64: e => btoa(unescape(encodeURIComponent(e))),
2856
+ exit: async e => t.warn(`exit ${e}`),
2857
+ getCurrentDirectory: () => "/",
2858
+ getCompilerExecutingPath: () => IS_WEB_WORKER_ENV ? location.href : D.getRemoteModuleUrl({
2859
+ moduleId: "@rindo/core",
2860
+ path: "compiler/rindo.min.js"
2861
+ }),
2862
+ getLocalModulePath: e => path$2.join(e.rootDir, "node_modules", e.moduleId, e.path),
2863
+ getRemoteModuleUrl: e => {
2864
+ const t = `${e.moduleId}${e.version ? "@" + e.version : ""}/${e.path}`;
2865
+ return new URL(t, "https://cdn.jsdelivr.net/npm/").href;
2866
+ },
2867
+ hardwareConcurrency: a,
2868
+ isSymbolicLink: async e => !1,
2869
+ nextTick: e => E.then(e),
2870
+ normalizePath: l,
2871
+ platformPath: pathBrowserify,
2872
+ readDir: async e => h(e),
2873
+ readDirSync: h,
2874
+ readFile: async e => p(e),
2875
+ readFileSync: p,
2876
+ realpath: async e => f(e),
2877
+ realpathSync: f,
2878
+ removeDestory: o,
2879
+ rename: async (e, t) => {
2880
+ const r = {
2881
+ oldPath: e = normalizePath(e),
2882
+ newPath: t = normalizePath(t),
2883
+ renamed: [],
2884
+ oldDirs: [],
2885
+ oldFiles: [],
2886
+ newDirs: [],
2887
+ newFiles: [],
2888
+ isFile: !1,
2889
+ isDirectory: !1,
2890
+ error: null
2891
+ }, s = w(e);
2892
+ if (s.error) r.error = `${e} does not exist`; else if (s.isFile ? r.isFile = !0 : s.isDirectory && (r.isDirectory = !0),
2893
+ m(e, t, r), !r.error) if (r.isDirectory) {
2894
+ const t = g(e, {
2895
+ recursive: !0
2896
+ });
2897
+ t.error ? r.error = t.error : (r.oldDirs.push(...t.removedDirs), r.oldFiles.push(...t.removedFiles));
2898
+ } else if (r.isFile) {
2899
+ const t = _(e);
2900
+ t.error ? r.error = t.error : r.oldFiles.push(e);
2901
+ }
2902
+ return r;
2903
+ },
2904
+ resolvePath: e => l(e),
2905
+ removeDir: async (e, t = {}) => g(e, t),
2906
+ removeDirSync: g,
2907
+ stat: async e => w(e),
2908
+ statSync: w,
2909
+ tmpDirSync: () => "/.tmp",
2910
+ removeFile: async e => _(e),
2911
+ removeFileSync: _,
2912
+ watchDirectory: (e, t) => {
2913
+ e = l(e);
2914
+ const s = r.get(e), i = () => {
2915
+ const s = r.get(e);
2916
+ if (s && s.watcherCallbacks) {
2917
+ const e = s.watcherCallbacks.indexOf(t);
2918
+ e > -1 && s.watcherCallbacks.splice(e, 1);
2919
+ }
2920
+ };
2921
+ return n(i), s ? (s.isDirectory = !0, s.isFile = !1, s.watcherCallbacks = s.watcherCallbacks || [],
2922
+ s.watcherCallbacks.push(t)) : r.set(e, {
2923
+ basename: path$2.basename(e),
2924
+ dirname: path$2.dirname(e),
2925
+ isDirectory: !0,
2926
+ isFile: !1,
2927
+ watcherCallbacks: [ t ],
2928
+ data: void 0
2929
+ }), {
2930
+ close() {
2931
+ o(i), i();
2932
+ }
2933
+ };
2934
+ },
2935
+ watchFile: (e, t) => {
2936
+ e = l(e);
2937
+ const s = r.get(e), i = () => {
2938
+ const s = r.get(e);
2939
+ if (s && s.watcherCallbacks) {
2940
+ const e = s.watcherCallbacks.indexOf(t);
2941
+ e > -1 && s.watcherCallbacks.splice(e, 1);
2942
+ }
2943
+ };
2944
+ return n(i), s ? (s.isDirectory = !1, s.isFile = !0, s.watcherCallbacks = s.watcherCallbacks || [],
2945
+ s.watcherCallbacks.push(t)) : r.set(e, {
2946
+ basename: path$2.basename(e),
2947
+ dirname: path$2.dirname(e),
2948
+ isDirectory: !1,
2949
+ isFile: !0,
2950
+ watcherCallbacks: [ t ],
2951
+ data: void 0
2952
+ }), {
2953
+ close() {
2954
+ o(i), i();
2955
+ }
2956
+ };
2957
+ },
2958
+ watchTimeout: 32,
2959
+ writeFile: async (e, t) => b(e, t),
2960
+ writeFileSync: b,
2961
+ generateContentHash: async (e, t) => {
2962
+ const r = await crypto.subtle.digest("SHA-256", (new TextEncoder).encode(e));
2963
+ let s = Array.from(new Uint8Array(r)).map((e => e.toString(16).padStart(2, "0"))).join("");
2964
+ return "number" == typeof t && (s = s.substr(0, t)), s;
2965
+ },
2966
+ createWorkerController: HAS_WEB_WORKER ? e => ((e, t) => {
2967
+ let r, s = 0, n = !1, o = !1, i = 0;
2968
+ const a = new Map, l = [], c = [], u = Math.max(Math.min(t, e.hardwareConcurrency), 2) - 1, d = Promise.resolve(), h = e => console.error(e), p = () => {
2969
+ let t = null;
2970
+ const s = e.getCompilerExecutingPath(), o = {
2971
+ name: "rindo.worker." + i++
2972
+ };
2973
+ try {
2974
+ t = new Worker(s, o);
2975
+ } catch (e) {
2976
+ null == r && (r = new Blob([ `importScripts('${s}');` ], {
2977
+ type: "application/javascript"
2978
+ })), t = new Worker(URL.createObjectURL(r), o);
2979
+ }
2980
+ const l = {
2981
+ worker: t,
2982
+ activeTasks: 0,
2983
+ sendQueue: []
2984
+ };
2985
+ return t.onerror = h, t.onmessage = e => ((e, t) => {
2986
+ if (!n) {
2987
+ const r = t.data;
2988
+ if (Array.isArray(r)) for (const t of r) if (t) {
2989
+ const r = a.get(t.rindoId);
2990
+ r ? (a.delete(t.rindoId), t.rindoRtnError ? r.reject(t.rindoRtnError) : r.resolve(t.rindoRtnValue),
2991
+ e.activeTasks--, (e.activeTasks < 0 || e.activeTasks > 50) && (e.activeTasks = 0)) : t.rindoRtnError && console.error(t.rindoRtnError);
2992
+ }
2993
+ }
2994
+ })(l, e), l;
2995
+ }, f = e => {
2996
+ e.sendQueue.length > 0 && (e.worker.postMessage(e.sendQueue), e.sendQueue.length = 0);
2997
+ }, m = e => {
2998
+ let t;
2999
+ if (c.length > 0) {
3000
+ if (t = c[0], u > 1) {
3001
+ for (const e of c) e.activeTasks < t.activeTasks && (t = e);
3002
+ t.activeTasks > 0 && c.length < u && (t = p(), c.push(t));
3003
+ }
3004
+ } else t = p(), c.push(t);
3005
+ t.activeTasks++, t.sendQueue.push(e);
3006
+ }, g = () => {
3007
+ o = !1, l.forEach(m), l.length = 0, c.forEach(f);
3008
+ }, y = (...e) => new Promise(((t, r) => {
3009
+ if (n) r("task canceled"); else {
3010
+ const n = {
3011
+ rindoId: s++,
3012
+ args: e
3013
+ };
3014
+ l.push(n), a.set(n.rindoId, {
3015
+ resolve: t,
3016
+ reject: r
3017
+ }), o || (o = !0, d.then(g));
3018
+ }
3019
+ }));
3020
+ return {
3021
+ send: y,
3022
+ destroy: () => {
3023
+ n = !0, a.forEach((e => e.reject("task canceled"))), a.clear(), c.forEach((e => e.worker.terminate())),
3024
+ c.length = 0;
3025
+ },
3026
+ handler: e => function(...t) {
3027
+ return y(e, ...t);
3028
+ },
3029
+ maxWorkers: u
3030
+ };
3031
+ })(D, e) : null,
3032
+ details: {
3033
+ cpuModel: "",
3034
+ freemem: () => 0,
3035
+ platform: "",
3036
+ release: "",
3037
+ totalmem: 0
3038
+ },
3039
+ copy: async (e, r) => (t.info("todo, copy task", e.length, r), {
3040
+ diagnostics: [],
3041
+ dirPaths: [],
3042
+ filePaths: []
3043
+ })
3044
+ };
3045
+ return D.resolveModuleId = e => ((e, t, r) => {
3046
+ const s = ((e, t, r) => ({
3047
+ async isFile(s, n) {
3048
+ const o = normalizeFsPath(s);
3049
+ if ((await t.stat(o)).isFile) n(null, !0); else {
3050
+ if (shouldFetchModule(o) && r.some((e => o.endsWith(e)))) {
3051
+ const r = getNodeModuleFetchUrl(e, packageVersions, o);
3052
+ return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r, o));
3053
+ }
3054
+ n(null, !1);
3055
+ }
3056
+ },
3057
+ async isDirectory(r, s) {
3058
+ const n = normalizeFsPath(r);
3059
+ if ((await t.stat(n)).isDirectory) s(null, !0); else {
3060
+ if (shouldFetchModule(n)) {
3061
+ if ("node_modules" === path$2.basename(n)) return t.sys.createDirSync(n), t.clearFileCache(n),
3062
+ void s(null, !0);
3063
+ if (isCommonDirModuleFile(n)) return void s(null, !1);
3064
+ for (const r of COMMON_DIR_FILENAMES) {
3065
+ const o = getCommonDirUrl(e, packageVersions, n, r), i = getCommonDirName(n, r), a = await fetchModuleAsync(e, t, packageVersions, o, i);
3066
+ if (isString(a)) return void s(null, !0);
3067
+ }
3068
+ }
3069
+ s(null, !1);
3070
+ }
3071
+ },
3072
+ async readFile(e, r) {
3073
+ const s = normalizeFsPath(e), n = await t.readFile(s);
3074
+ return isString(n) ? r(null, n) : r(`readFile not found: ${e}`);
3075
+ },
3076
+ async realpath(t, r) {
3077
+ const s = normalizeFsPath(t), n = await e.realpath(s);
3078
+ n.error && "ENOENT" !== n.error.code ? r(n.error) : r(null, n.error ? s : n.path);
3079
+ },
3080
+ extensions: r
3081
+ }))(e, null, r.exts);
3082
+ return s.basedir = path$2.dirname(normalizeFsPath(r.containingFile)), r.packageFilter ? s.packageFilter = r.packageFilter : null !== r.packageFilter && (s.packageFilter = e => (isString(e.main) && "" !== e.main || (e.main = "package.json"),
3083
+ e)), new Promise(((e, t) => {
3084
+ resolve(r.moduleId, s, ((s, n, o) => {
3085
+ if (s) t(s); else {
3086
+ n = normalizePath(n);
3087
+ const t = {
3088
+ moduleId: r.moduleId,
3089
+ resolveId: n,
3090
+ pkgData: o,
3091
+ pkgDirPath: getPackageDirPath(n, r.moduleId)
3092
+ };
3093
+ e(t);
3094
+ }
3095
+ }));
3096
+ }));
3097
+ })(D, 0, e), D;
3098
+ }, createTestingSystem = () => {
3099
+ let e = 0, t = 0;
3100
+ const r = createSystem();
3101
+ r.platformPath = path__default.default, r.generateContentHash = (e, t) => {
3102
+ let r = crypto$3.createHash("sha1").update(e).digest("hex").toLowerCase();
3103
+ return "number" == typeof t && (r = r.substr(0, t)), Promise.resolve(r);
3104
+ };
3105
+ const s = t => {
3106
+ const r = t;
3107
+ return (...t) => (e++, r.apply(r, t));
3108
+ }, n = e => {
3109
+ const r = e;
3110
+ return (...e) => (t++, r.apply(r, e));
3111
+ };
3112
+ return r.access = s(r.access), r.accessSync = s(r.accessSync), r.readFile = s(r.readFile),
3113
+ r.readFileSync = s(r.readFileSync), r.readDir = s(r.readDir), r.readDirSync = s(r.readDirSync),
3114
+ r.stat = s(r.stat), r.statSync = s(r.statSync), r.copyFile = n(r.copyFile), r.createDir = n(r.createDir),
3115
+ r.createDirSync = n(r.createDirSync), r.removeFile = n(r.removeFile), r.removeFileSync = n(r.removeFileSync),
3116
+ r.writeFile = n(r.writeFile), r.writeFileSync = n(r.writeFileSync), Object.defineProperties(r, {
3117
+ diskReads: {
3118
+ get: () => e,
3119
+ set(t) {
3120
+ e = t;
3121
+ }
3122
+ },
3123
+ diskWrites: {
3124
+ get: () => t,
3125
+ set(e) {
3126
+ t = e;
3127
+ }
3128
+ }
3129
+ });
3130
+ };
3131
+
3132
+ class TestingLogger {
3133
+ constructor() {
3134
+ this.isEnabled = !1;
3135
+ }
3136
+ setLevel(e) {}
3137
+ getLevel() {
3138
+ return "info";
3139
+ }
3140
+ enableColors(e) {}
3141
+ emoji(e) {
3142
+ return "";
3143
+ }
3144
+ info(...e) {
3145
+ this.isEnabled && console.log.apply(console, e);
3146
+ }
3147
+ warn(...e) {
3148
+ this.isEnabled && console.warn.apply(console, e);
3149
+ }
3150
+ error(...e) {
3151
+ this.isEnabled && console.error.apply(console, e);
3152
+ }
3153
+ debug(...e) {
3154
+ this.isEnabled && console.log.apply(console, e);
3155
+ }
3156
+ color(e, t) {}
3157
+ red(e) {
3158
+ return e;
3159
+ }
3160
+ green(e) {
3161
+ return e;
3162
+ }
3163
+ yellow(e) {
3164
+ return e;
3165
+ }
3166
+ blue(e) {
3167
+ return e;
3168
+ }
3169
+ magenta(e) {
3170
+ return e;
3171
+ }
3172
+ cyan(e) {
3173
+ return e;
3174
+ }
3175
+ gray(e) {
3176
+ return e;
3177
+ }
3178
+ bold(e) {
3179
+ return e;
3180
+ }
3181
+ dim(e) {
3182
+ return e;
3183
+ }
3184
+ bgRed(e) {
3185
+ return e;
3186
+ }
3187
+ createTimeSpan(e, t = !1) {
3188
+ return {
3189
+ duration: () => 0,
3190
+ finish: () => 0
3191
+ };
3192
+ }
3193
+ printDiagnostics(e) {}
3194
+ }
3195
+
3196
+ class EventSpy {
3197
+ constructor(e) {
3198
+ this.eventName = e, this.events = [], this.cursor = 0, this.queuedHandler = [];
3199
+ }
3200
+ get length() {
3201
+ return this.events.length;
3202
+ }
3203
+ get firstEvent() {
3204
+ return this.events[0] || null;
3205
+ }
3206
+ get lastEvent() {
3207
+ return this.events[this.events.length - 1] || null;
3208
+ }
3209
+ next() {
3210
+ const e = this.cursor;
3211
+ this.cursor++;
3212
+ const t = this.events[e];
3213
+ if (t) return Promise.resolve({
3214
+ done: !1,
3215
+ value: t
3216
+ });
3217
+ {
3218
+ let t;
3219
+ const r = new Promise((e => t = e));
3220
+ return this.queuedHandler.push(t), r.then((() => ({
3221
+ done: !1,
3222
+ value: this.events[e]
3223
+ })));
3224
+ }
3225
+ }
3226
+ push(e) {
3227
+ this.events.push(e);
3228
+ const t = this.queuedHandler.shift();
3229
+ t && t();
3230
+ }
3231
+ }
3232
+
3233
+ class E2EElement extends index_cjs.MockHTMLElement {
3234
+ constructor(e, t) {
3235
+ super(null, null), this._page = e, this._elmHandle = t, this._queuedActions = [],
3236
+ e._e2eElements.push(this);
3237
+ }
3238
+ _queueAction(e) {
3239
+ this._queuedActions.push(e);
3240
+ }
3241
+ find(e) {
3242
+ return find(this._page, this._elmHandle, e);
3243
+ }
3244
+ findAll(e) {
3245
+ return findAll(this._page, this._elmHandle, e);
3246
+ }
3247
+ callMethod(e, ...t) {
3248
+ return this._queueAction({
3249
+ methodName: e,
3250
+ methodArgs: t
3251
+ }), this.e2eRunActions();
3252
+ }
3253
+ triggerEvent(e, t) {
3254
+ this._queueAction({
3255
+ eventName: e,
3256
+ eventInitDict: t
3257
+ });
3258
+ }
3259
+ async spyOnEvent(e) {
3260
+ const t = new EventSpy(e);
3261
+ return await addE2EListener(this._page, this._elmHandle, e, (e => {
3262
+ t.push(e);
3263
+ })), t;
3264
+ }
3265
+ async click(e) {
3266
+ await this._elmHandle.click(e), await this._page.waitForChanges();
3267
+ }
3268
+ async focus() {
3269
+ await this._elmHandle.focus(), await this._page.waitForChanges();
3270
+ }
3271
+ async hover() {
3272
+ await this._elmHandle.hover(), await this._page.waitForChanges();
3273
+ }
3274
+ async isVisible() {
3275
+ this._validate();
3276
+ let e = !1;
3277
+ try {
3278
+ const t = this._elmHandle.executionContext();
3279
+ e = await t.evaluate((e => new Promise((t => {
3280
+ window.requestAnimationFrame((() => {
3281
+ if (e.isConnected) {
3282
+ const r = window.getComputedStyle(e);
3283
+ r && "none" !== r.display && "hidden" !== r.visibility && "0" !== r.opacity ? window.requestAnimationFrame((() => {
3284
+ e.clientWidth, t(!0);
3285
+ })) : t(!1);
3286
+ } else t(!1);
3287
+ }));
3288
+ }))), this._elmHandle);
3289
+ } catch (e) {}
3290
+ return e;
3291
+ }
3292
+ waitForEvent(e) {
3293
+ return waitForEvent(this._page, e, this._elmHandle);
3294
+ }
3295
+ waitForVisible() {
3296
+ return new Promise(((e, t) => {
3297
+ const r = setInterval((async () => {
3298
+ await this.isVisible() && (clearInterval(r), clearTimeout(o), e());
3299
+ }), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`), o = setTimeout((() => {
3300
+ clearTimeout(r), t(n);
3301
+ }), s);
3302
+ }));
3303
+ }
3304
+ waitForNotVisible() {
3305
+ return new Promise(((e, t) => {
3306
+ const r = setInterval((async () => {
3307
+ await this.isVisible() || (clearInterval(r), clearTimeout(o), e());
3308
+ }), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`), o = setTimeout((() => {
3309
+ clearTimeout(r), t(n);
3310
+ }), s);
3311
+ }));
3312
+ }
3313
+ isIntersectingViewport() {
3314
+ return this._elmHandle.isIntersectingViewport();
3315
+ }
3316
+ async press(e, t) {
3317
+ await this._elmHandle.press(e, t), await this._page.waitForChanges();
3318
+ }
3319
+ async tap() {
3320
+ await this._elmHandle.tap(), await this._page.waitForChanges();
3321
+ }
3322
+ async type(e, t) {
3323
+ await this._elmHandle.type(e, t), await this._page.waitForChanges();
3324
+ }
3325
+ async getProperty(e) {
3326
+ this._validate();
3327
+ const t = this._elmHandle.executionContext();
3328
+ return await t.evaluate(((e, t) => e[t]), this._elmHandle, e);
3329
+ }
3330
+ setProperty(e, t) {
3331
+ this._queueAction({
3332
+ setPropertyName: e,
3333
+ setPropertyValue: t
3334
+ });
3335
+ }
3336
+ getAttribute(e) {
3337
+ return this._validate(), super.getAttribute(e);
3338
+ }
3339
+ setAttribute(e, t) {
3340
+ this._queueAction({
3341
+ setAttributeName: e,
3342
+ setAttributeValue: t
3343
+ });
3344
+ }
3345
+ removeAttribute(e) {
3346
+ this._queueAction({
3347
+ removeAttribute: e
3348
+ });
3349
+ }
3350
+ toggleAttribute(e, t) {
3351
+ this._queueAction({
3352
+ toggleAttributeName: e,
3353
+ toggleAttributeForce: t
3354
+ });
3355
+ }
3356
+ get classList() {
3357
+ return {
3358
+ add: (...e) => {
3359
+ e.forEach((e => {
3360
+ this._queueAction({
3361
+ classAdd: e
3362
+ });
3363
+ }));
3364
+ },
3365
+ remove: (...e) => {
3366
+ e.forEach((e => {
3367
+ this._queueAction({
3368
+ classRemove: e
3369
+ });
3370
+ }));
3371
+ },
3372
+ toggle: e => {
3373
+ this._queueAction({
3374
+ classToggle: e
3375
+ });
3376
+ },
3377
+ contains: e => (this._validate(), super.className.split(" ").includes(e))
3378
+ };
3379
+ }
3380
+ get className() {
3381
+ return this._validate(), super.className;
3382
+ }
3383
+ set className(e) {
3384
+ this._queueAction({
3385
+ setPropertyName: "className",
3386
+ setPropertyValue: e
3387
+ });
3388
+ }
3389
+ get id() {
3390
+ return this._validate(), super.id;
3391
+ }
3392
+ set id(e) {
3393
+ this._queueAction({
3394
+ setPropertyName: "id",
3395
+ setPropertyValue: e
3396
+ });
3397
+ }
3398
+ get innerHTML() {
3399
+ return this._validate(), super.innerHTML;
3400
+ }
3401
+ set innerHTML(e) {
3402
+ this._queueAction({
3403
+ setPropertyName: "innerHTML",
3404
+ setPropertyValue: e
3405
+ });
3406
+ }
3407
+ get innerText() {
3408
+ return this._validate(), super.innerText;
3409
+ }
3410
+ set innerText(e) {
3411
+ this._queueAction({
3412
+ setPropertyName: "innerText",
3413
+ setPropertyValue: e
3414
+ });
3415
+ }
3416
+ get nodeValue() {
3417
+ return this._validate(), super.nodeValue;
3418
+ }
3419
+ set nodeValue(e) {
3420
+ "string" == typeof e && this._queueAction({
3421
+ setPropertyName: "nodeValue",
3422
+ setPropertyValue: e
3423
+ });
3424
+ }
3425
+ get outerHTML() {
3426
+ return this._validate(), super.outerHTML;
3427
+ }
3428
+ set outerHTML(e) {
3429
+ throw new Error("outerHTML is read-only");
3430
+ }
3431
+ get shadowRoot() {
3432
+ return this._validate(), super.shadowRoot;
3433
+ }
3434
+ set shadowRoot(e) {
3435
+ super.shadowRoot = e;
3436
+ }
3437
+ get tabIndex() {
3438
+ return this._validate(), super.tabIndex;
3439
+ }
3440
+ set tabIndex(e) {
3441
+ this._queueAction({
3442
+ setPropertyName: "tabIndex",
3443
+ setPropertyValue: e
3444
+ });
3445
+ }
3446
+ get textContent() {
3447
+ return this._validate(), super.textContent;
3448
+ }
3449
+ set textContent(e) {
3450
+ this._queueAction({
3451
+ setPropertyName: "textContent",
3452
+ setPropertyValue: e
3453
+ });
3454
+ }
3455
+ get title() {
3456
+ return this._validate(), super.title;
3457
+ }
3458
+ set title(e) {
3459
+ this._queueAction({
3460
+ setPropertyName: "title",
3461
+ setPropertyValue: e
3462
+ });
3463
+ }
3464
+ async getComputedStyle(e) {
3465
+ const t = await this._page.evaluate(((e, t) => {
3466
+ const r = {}, s = window.getComputedStyle(e, t);
3467
+ return Object.keys(s).forEach((e => {
3468
+ if (isNaN(e)) {
3469
+ const t = s[e];
3470
+ null != t && (r[e] = t);
3471
+ } else {
3472
+ const t = s[e];
3473
+ if (t.includes("-")) {
3474
+ const e = s.getPropertyValue(t);
3475
+ null != e && (r[t] = e);
3476
+ }
3477
+ }
3478
+ })), r;
3479
+ }), this._elmHandle, e);
3480
+ return t.getPropertyValue = e => t[e], t;
3481
+ }
3482
+ async e2eRunActions() {
3483
+ if (0 === this._queuedActions.length) return;
3484
+ const e = this._elmHandle.executionContext(), t = await e.evaluate(((e, t) => e.componentOnReady().then((() => {
3485
+ let r = null;
3486
+ return t.forEach((t => {
3487
+ if (t.methodName) r = e[t.methodName].apply(e, t.methodArgs); else if (t.setPropertyName) e[t.setPropertyName] = t.setPropertyValue; else if (t.setAttributeName) e.setAttribute(t.setAttributeName, t.setAttributeValue); else if (t.removeAttribute) e.removeAttribute(t.removeAttribute); else if (t.toggleAttributeName) "boolean" == typeof t.toggleAttributeForce ? e.toggleAttribute(t.toggleAttributeName, t.toggleAttributeForce) : e.toggleAttribute(t.toggleAttributeName); else if (t.classAdd) e.classList.add(t.classAdd); else if (t.classRemove) e.classList.remove(t.classRemove); else if (t.classToggle) e.classList.toggle(t.classToggle); else if (t.eventName) {
3488
+ const r = t.eventInitDict || {};
3489
+ "boolean" != typeof r.bubbles && (r.bubbles = !0), "boolean" != typeof r.cancelable && (r.cancelable = !0),
3490
+ "boolean" != typeof r.composed && (r.composed = !0);
3491
+ const s = new CustomEvent(t.eventName, r);
3492
+ e.dispatchEvent(s);
3493
+ }
3494
+ })), r && "function" == typeof r.then ? r.then((e => e)) : r;
3495
+ }))), this._elmHandle, this._queuedActions);
3496
+ return this._queuedActions.length = 0, t;
3497
+ }
3498
+ async e2eSync() {
3499
+ const e = this._elmHandle.executionContext(), {outerHTML: t, shadowRootHTML: r} = await e.evaluate((e => ({
3500
+ outerHTML: e.outerHTML,
3501
+ shadowRootHTML: e.shadowRoot ? e.shadowRoot.innerHTML : null
3502
+ })), this._elmHandle);
3503
+ "string" == typeof r ? (this.shadowRoot = index_cjs.parseHtmlToFragment(r), this.shadowRoot.host = this) : this.shadowRoot = null;
3504
+ const s = index_cjs.parseHtmlToFragment(t).firstElementChild;
3505
+ for (this.nodeName = s.nodeName, this.attributes = index_cjs.cloneAttributes(s.attributes); this.childNodes.length > 0; ) this.removeChild(this.childNodes[0]);
3506
+ for (;s.childNodes.length > 0; ) this.appendChild(s.childNodes[0]);
3507
+ }
3508
+ _validate() {
3509
+ if (this._queuedActions.length > 0) throw new Error("await page.waitForChanges() must be called before reading element information");
3510
+ }
3511
+ async e2eDispose() {
3512
+ this._elmHandle && (await this._elmHandle.dispose(), this._elmHandle = null);
3513
+ const e = this._page._e2eElements.indexOf(this);
3514
+ e > -1 && this._page._e2eElements.splice(e, 1), this._page = null;
3515
+ }
3516
+ }
3517
+
3518
+ const env = process.env;
3519
+
3520
+ exports.MockHeaders = MockHeaders, exports.MockRequest = MockRequest, exports.MockResponse = MockResponse,
3521
+ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment() {
3522
+ const e = require("jest-environment-node");
3523
+ return class extends e {
3524
+ constructor(e) {
3525
+ super(e), this.browser = null, this.pages = [];
3526
+ }
3527
+ async setup() {
3528
+ "true" === process.env.__RINDO_E2E_TESTS__ && (this.global.__NEW_TEST_PAGE__ = this.newPuppeteerPage.bind(this),
3529
+ this.global.__CLOSE_OPEN_PAGES__ = this.closeOpenPages.bind(this));
3530
+ }
3531
+ async newPuppeteerPage() {
3532
+ this.browser || (this.browser = await async function e() {
3533
+ const e = process.env, t = e.__RINDO_BROWSER_WS_ENDPOINT__;
3534
+ if (!t) return null;
3535
+ const r = {
3536
+ browserWSEndpoint: t,
3537
+ ignoreHTTPSErrors: !0
3538
+ }, s = require(e.__RINDO_PUPPETEER_MODULE__);
3539
+ return await s.connect(r);
3540
+ }());
3541
+ const t = await function r(e) {
3542
+ return e.newPage();
3543
+ }(this.browser);
3544
+ this.pages.push(t);
3545
+ const s = process.env;
3546
+ return "string" == typeof s.__RINDO_DEFAULT_TIMEOUT__ && t.setDefaultTimeout(parseInt(s.__RINDO_DEFAULT_TIMEOUT__, 10)),
3547
+ t;
3548
+ }
3549
+ async closeOpenPages() {
3550
+ await Promise.all(this.pages.map((e => e.close()))), this.pages.length = 0;
3551
+ }
3552
+ async teardown() {
3553
+ await super.teardown(), await this.closeOpenPages(), await async function e(t) {
3554
+ if (t) try {
3555
+ t.disconnect();
3556
+ } catch (e) {}
3557
+ }(this.browser), this.browser = null;
3558
+ }
3559
+ };
3560
+ }, exports.createTestRunner = function createTestRunner() {
3561
+ const e = require("jest-runner");
3562
+ return class t extends e {
3563
+ async runTests(e, t, r, s, n, o) {
3564
+ const i = process.env;
3565
+ if (e = e.filter((e => function t(e, r) {
3566
+ const s = (e = e.toLowerCase().replace(/\\/g, "/")).includes(".e2e.") || e.includes("/e2e.");
3567
+ return !("true" !== r.__RINDO_E2E_TESTS__ || !s) || "true" === r.__RINDO_SPEC_TESTS__ && !s;
3568
+ }(e.path, i))), "true" === i.__RINDO_SCREENSHOT__) {
3569
+ const a = JSON.parse(i.__RINDO_EMULATE_CONFIGS__);
3570
+ for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l], i), await super.runTests(e, t, r, s, n, o);
3571
+ } else await super.runTests(e, t, r, s, n, o);
3572
+ }
3573
+ };
3574
+ }, exports.createTesting = async e => {
3575
+ e = function t(e) {
3576
+ return e.buildEs5 = !1, e.devMode = !0, e.minifyCss = !1, e.minifyJs = !1, e.hashFileNames = !1,
3577
+ e.validateTypes = !1, e._isTesting = !0, e.buildDist = !0, e.flags = e.flags || {},
3578
+ e.flags.serve = !1, e.flags.open = !1, e.outputTargets.forEach((e => {
3579
+ "www" === e.type && (e.serviceWorker = null);
3580
+ })), e.flags.args.includes("--watchAll") && (e.watch = !0), e;
3581
+ }(e);
3582
+ const {createCompiler: r} = require("../compiler/rindo.js"), s = await r(e);
3583
+ let n, o;
3584
+ const i = async () => {
3585
+ const t = [];
3586
+ e && (e.sys && e.sys.destroy && t.push(e.sys.destroy()), e = null), n && (n.close && t.push(n.close()),
3587
+ n = null), o && (o.close && t.push(o.close()), o = null), await Promise.all(t);
3588
+ };
3589
+ return {
3590
+ destroy: i,
3591
+ run: async (t = {}) => {
3592
+ let r, a = !1, l = !1, c = null;
3593
+ const u = [];
3594
+ try {
3595
+ if (!t.spec && !t.e2e) return e.logger.error("Testing requires either the --spec or --e2e command line flags, or both. For example, to run unit tests, use the command: rindo test --spec"),
3596
+ !1;
3597
+ if (r = process.env, t.e2e && (u.push("e2e"), r.__RINDO_E2E_TESTS__ = "true"), t.spec && (u.push("spec"),
3598
+ r.__RINDO_SPEC_TESTS__ = "true"), e.logger.info(e.logger.magenta(`testing ${u.join(" and ")} files${e.watch ? " (watch)" : ""}`)),
3599
+ a = !(!t.e2e || !t.screenshot), a && (r.__RINDO_SCREENSHOT__ = "true", t.updateScreenshot ? e.logger.info(e.logger.magenta("updating master screenshots")) : e.logger.info(e.logger.magenta("comparing against master screenshots"))),
3600
+ t.e2e) {
3601
+ let t = null;
3602
+ e.outputTargets.forEach((e => {
3603
+ e.empty = !1;
3604
+ }));
3605
+ const a = !(e.flags && !1 === e.flags.build);
3606
+ a && e.watch && (c = await s.createWatcher()), a && (c ? (t = new Promise((e => {
3607
+ const t = c.on("buildFinish", (r => {
3608
+ t(), e(r);
3609
+ }));
3610
+ })), c.start()) : t = s.build()), e.devServer.openBrowser = !1, e.devServer.gzip = !1,
3611
+ e.devServer.reloadStrategy = null;
3612
+ const l = await Promise.all([ index_js.start(e.devServer, e.logger), startPuppeteerBrowser(e) ]);
3613
+ if (n = l[0], o = l[1], t) {
3614
+ const r = await t;
3615
+ if (!r || !e.watch && hasError(r && r.diagnostics)) return await i(), !1;
3616
+ }
3617
+ n && (r.__RINDO_BROWSER_URL__ = n.browserUrl, e.logger.debug(`e2e dev server url: ${r.__RINDO_BROWSER_URL__}`),
3618
+ r.__RINDO_APP_SCRIPT_URL__ = function d(e, t) {
3619
+ return getAppUrl(e, t, `${e.fsNamespace}.esm.js`);
3620
+ }(e, n.browserUrl), e.logger.debug(`e2e app script url: ${r.__RINDO_APP_SCRIPT_URL__}`),
3621
+ getAppStyleUrl(e, n.browserUrl) && (r.__RINDO_APP_STYLE_URL__ = getAppStyleUrl(e, n.browserUrl),
3622
+ e.logger.debug(`e2e app style url: ${r.__RINDO_APP_STYLE_URL__}`)));
3623
+ }
3624
+ } catch (t) {
3625
+ return e.logger.error(t), !1;
3626
+ }
3627
+ try {
3628
+ l = a ? await async function h(e, t) {
3629
+ e.logger.debug(`screenshot connector: ${e.testing.screenshotConnector}`);
3630
+ const r = new (require(e.testing.screenshotConnector)), s = path$2.join(e.sys.getCompilerExecutingPath(), "..", "..", "screenshot", "pixel-match.js");
3631
+ e.logger.debug(`pixelmatch module: ${s}`);
3632
+ const n = e.logger.createTimeSpan("screenshot, initBuild started", !0);
3633
+ await r.initBuild({
3634
+ buildId: createBuildId(),
3635
+ buildMessage: createBuildMessage(),
3636
+ buildTimestamp: Date.now(),
3637
+ appNamespace: e.namespace,
3638
+ rootDir: e.rootDir,
3639
+ cacheDir: e.cacheDir,
3640
+ packageDir: path$2.join(e.sys.getCompilerExecutingPath(), "..", ".."),
3641
+ updateMaster: e.flags.updateScreenshot,
3642
+ logger: e.logger,
3643
+ allowableMismatchedPixels: e.testing.allowableMismatchedPixels,
3644
+ allowableMismatchedRatio: e.testing.allowableMismatchedRatio,
3645
+ pixelmatchThreshold: e.testing.pixelmatchThreshold,
3646
+ waitBeforeScreenshot: e.testing.waitBeforeScreenshot,
3647
+ pixelmatchModulePath: s
3648
+ }), e.flags.updateScreenshot || await r.pullMasterBuild(), n.finish("screenshot, initBuild finished");
3649
+ const o = await Promise.all([ await r.getMasterBuild(), await r.getScreenshotCache() ]), i = o[0], a = o[1];
3650
+ t.__RINDO_SCREENSHOT_BUILD__ = r.toJson(i, a);
3651
+ const l = e.logger.createTimeSpan("screenshot, tests started", !0), c = await runJest(e, t);
3652
+ l.finish(`screenshot, tests finished, passed: ${c}`);
3653
+ try {
3654
+ const t = e.logger.createTimeSpan("screenshot, completeTimespan started", !0);
3655
+ let s = await r.completeBuild(i);
3656
+ if (t.finish("screenshot, completeTimespan finished"), s) {
3657
+ const t = e.logger.createTimeSpan("screenshot, publishBuild started", !0);
3658
+ if (s = await r.publishBuild(s), t.finish("screenshot, publishBuild finished"),
3659
+ e.flags.updateScreenshot) s.currentBuild && "string" == typeof s.currentBuild.previewUrl && e.logger.info(e.logger.magenta(s.currentBuild.previewUrl)); else if (s.compare) {
3660
+ try {
3661
+ await r.updateScreenshotCache(a, s);
3662
+ } catch (t) {
3663
+ e.logger.error(t);
3664
+ }
3665
+ e.logger.info(`screenshots compared: ${s.compare.diffs.length}`), "string" == typeof s.compare.url && e.logger.info(e.logger.magenta(s.compare.url));
3666
+ }
3667
+ }
3668
+ } catch (t) {
3669
+ e.logger.error(t, t.stack);
3670
+ }
3671
+ return c;
3672
+ }(e, r) : await runJest(e, r), e.logger.info(""), c && await c.close();
3673
+ } catch (t) {
3674
+ e.logger.error(t);
3675
+ }
3676
+ return l;
3677
+ }
3678
+ };
3679
+ }, exports.jestPreprocessor = jestPreprocessor, exports.jestSetupTestFramework = function jestSetupTestFramework() {
3680
+ global.Context = {}, global.resourcesUrl = "/build", expect.extend(expectExtend),
3681
+ expect.addSnapshotSerializer(HtmlSerializer), index_cjs.setupGlobal(global), function e(t) {
3682
+ const r = t.window;
3683
+ "fetch" in r || (r.fetch = function(e) {
3684
+ return globalMockFetch(e);
3685
+ }), "fetch" in t || (t.fetch = function(e) {
3686
+ return globalMockFetch(e);
3687
+ });
3688
+ }(global), beforeEach((() => {
3689
+ testing.resetPlatform(), testing.setErrorHandler(void 0), resetBuildConditionals(appData.BUILD),
3690
+ testing.modeResolutionChain.length = 0;
3691
+ })), afterEach((async () => {
3692
+ global.__CLOSE_OPEN_PAGES__ && await global.__CLOSE_OPEN_PAGES__(), testing.stopAutoApplyChanges(),
3693
+ index_cjs.teardownGlobal(global), global.Context = {}, global.resourcesUrl = "/build";
3694
+ }));
3695
+ const t = jasmine.getEnv();
3696
+ null != t && t.addReporter({
3697
+ specStarted: e => {
3698
+ global.currentSpec = e;
3699
+ }
3700
+ }), global.screenshotDescriptions = new Set;
3701
+ const r = process.env;
3702
+ if ("string" == typeof r.__RINDO_DEFAULT_TIMEOUT__) {
3703
+ const e = parseInt(r.__RINDO_DEFAULT_TIMEOUT__, 10);
3704
+ jest.setTimeout(1.5 * e), jasmine.DEFAULT_TIMEOUT_INTERVAL = e;
3705
+ }
3706
+ if ("string" == typeof r.__RINDO_ENV__) {
3707
+ const e = JSON.parse(r.__RINDO_ENV__);
3708
+ Object.assign(appData.Env, e);
3709
+ }
3710
+ }, exports.mockBuildCtx = function mockBuildCtx(e, t) {
3711
+ return e || (e = mockConfig()), t || (t = mockCompilerCtx(e)), new BuildContext(e, t);
3712
+ }, exports.mockCompilerCtx = mockCompilerCtx, exports.mockConfig = mockConfig, exports.mockDocument = function mockDocument(e = null) {
3713
+ return new index_cjs.MockWindow(e).document;
3714
+ }, exports.mockFetch = mockFetch, exports.mockLogger = function mockLogger() {
3715
+ return new TestingLogger;
3716
+ }, exports.mockRindoSystem = function mockRindoSystem() {
3717
+ return createTestingSystem();
3718
+ }, exports.mockWindow = function mockWindow(e = null) {
3719
+ return new index_cjs.MockWindow(e);
3720
+ }, exports.newE2EPage = async function newE2EPage(e = {}) {
3721
+ if (!global.__NEW_TEST_PAGE__) throw new Error("newE2EPage() is only available from E2E tests, and ran with the --e2e cmd line flag.");
3722
+ const t = await global.__NEW_TEST_PAGE__(), r = [];
3723
+ try {
3724
+ t._e2eElements = [], t._e2eGoto = t.goto, t._e2eClose = t.close, await async function s(e) {
3725
+ if (e.isClosed()) return;
3726
+ const t = env.__RINDO_EMULATE__;
3727
+ if (!t) return;
3728
+ const r = JSON.parse(t), s = {
3729
+ viewport: r.viewport,
3730
+ userAgent: r.userAgent
3731
+ };
3732
+ await e.emulate(s);
3733
+ }(t), await t.setCacheEnabled(!1), await initPageEvents(t), function n(e) {
3734
+ const t = process.env;
3735
+ "true" === t.__RINDO_SCREENSHOT__ ? e.compareScreenshot = (r, s) => {
3736
+ const n = global;
3737
+ let o, i = "", a = "";
3738
+ if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (i = n.currentSpec.fullName),
3739
+ "string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (i.length > 0 ? i += ", " + r : i = r,
3740
+ "object" == typeof s && (o = s)) : "object" == typeof r && (o = r), i = i.trim(),
3741
+ o = o || {}, !i) throw new Error(`Invalid screenshot description in "${a}"`);
3742
+ if (n.screenshotDescriptions.has(i)) throw new Error(`Screenshot description "${i}" found in "${a}" cannot be used for multiple screenshots and must be unique. To make screenshot descriptions unique within the same test, use the first argument to "compareScreenshot", such as "compareScreenshot('more to the description')".`);
3743
+ return n.screenshotDescriptions.add(i), async function l(e, t, r, s, n) {
3744
+ if ("string" != typeof t.__RINDO_EMULATE__) throw new Error("compareScreenshot, missing screenshot emulate env var");
3745
+ if ("string" != typeof t.__RINDO_SCREENSHOT_BUILD__) throw new Error("compareScreenshot, missing screen build env var");
3746
+ const o = JSON.parse(t.__RINDO_EMULATE__), i = JSON.parse(t.__RINDO_SCREENSHOT_BUILD__);
3747
+ await function a(e) {
3748
+ return new Promise((t => setTimeout(t, e)));
3749
+ }(i.timeoutBeforeScreenshot), await e.evaluate((() => new Promise((e => {
3750
+ window.requestAnimationFrame((() => {
3751
+ e();
3752
+ }));
3753
+ }))));
3754
+ const l = function c(e) {
3755
+ const t = {
3756
+ type: "png",
3757
+ fullPage: e.fullPage,
3758
+ omitBackground: e.omitBackground,
3759
+ encoding: "binary"
3760
+ };
3761
+ return e.clip && (t.clip = {
3762
+ x: e.clip.x,
3763
+ y: e.clip.y,
3764
+ width: e.clip.width,
3765
+ height: e.clip.height
3766
+ }), t;
3767
+ }(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold : i.pixelmatchThreshold;
3768
+ let h = o.viewport.width, p = o.viewport.height;
3769
+ return n && n.clip && ("number" == typeof n.clip.width && (h = n.clip.width), "number" == typeof n.clip.height && (p = n.clip.height)),
3770
+ await compareScreenshot(o, i, u, r, h, p, s, d);
3771
+ }(e, t, i, a, o);
3772
+ } : e.compareScreenshot = async () => ({
3773
+ mismatchedPixels: 0,
3774
+ allowableMismatchedPixels: 1,
3775
+ allowableMismatchedRatio: 1,
3776
+ desc: "",
3777
+ width: 1,
3778
+ height: 1,
3779
+ deviceScaleFactor: 1
3780
+ });
3781
+ }(t);
3782
+ let s = null;
3783
+ t.close = async e => {
3784
+ try {
3785
+ if (Array.isArray(t._e2eElements)) {
3786
+ const e = t._e2eElements.map((async e => {
3787
+ "function" == typeof e.e2eDispose && await e.e2eDispose();
3788
+ }));
3789
+ await Promise.all(e);
3790
+ }
3791
+ } catch (e) {}
3792
+ const r = () => {
3793
+ throw new Error("The page was already closed");
3794
+ };
3795
+ t._e2eElements = r, t._e2eEvents = r, t._e2eGoto = r, t.find = r, t.debugger = r,
3796
+ t.findAll = r, t.compareScreenshot = r, t.setContent = r, t.spyOnEvent = r, t.waitForChanges = r,
3797
+ t.waitForEvent = r;
3798
+ try {
3799
+ t.isClosed() || await t._e2eClose(e);
3800
+ } catch (e) {}
3801
+ };
3802
+ const n = async () => (s || (s = t.evaluateHandle((() => document))), (await s).asElement());
3803
+ t.find = async e => {
3804
+ const r = await n();
3805
+ return find(t, r, e);
3806
+ }, t.findAll = async e => {
3807
+ const r = await n();
3808
+ return findAll(t, r, e);
3809
+ }, t.waitForEvent = async e => {
3810
+ const r = await n();
3811
+ return waitForEvent(t, e, r);
3812
+ }, t.getDiagnostics = () => r, t.waitForChanges = waitForChanges.bind(null, t),
3813
+ t.debugger = () => {
3814
+ if ("true" !== env.__RINDO_E2E_DEVTOOLS__) throw new Error("Set the --devtools flag in order to use E2EPage.debugger()");
3815
+ return t.evaluate((() => new Promise((e => {
3816
+ e();
3817
+ }))));
3818
+ };
3819
+ const o = !0 === e.failOnConsoleError, i = !0 === e.failOnNetworkError;
3820
+ t.on("console", (e => {
3821
+ "error" === e.type() && (r.push({
3822
+ type: "error",
3823
+ message: e.text(),
3824
+ location: e.location().url
3825
+ }), o && fail(new Error(serializeConsoleMessage(e)))), function t(e) {
3826
+ const t = serializeConsoleMessage(e), r = e.type(), s = "warning" === r ? "warn" : r;
3827
+ "debug" !== s && ("function" == typeof console[s] ? console[s](t) : console.log(r, t));
3828
+ }(e);
3829
+ })), t.on("pageerror", (e => {
3830
+ r.push({
3831
+ type: "pageerror",
3832
+ message: e.message,
3833
+ location: e.stack
3834
+ }), fail(e);
3835
+ })), t.on("requestfailed", (e => {
3836
+ r.push({
3837
+ type: "requestfailed",
3838
+ message: e.failure().errorText,
3839
+ location: e.url()
3840
+ }), i ? fail(new Error(e.failure().errorText)) : console.error("requestfailed", e.url());
3841
+ })), "string" == typeof e.html ? await e2eSetContent(t, e.html, {
3842
+ waitUntil: e.waitUntil
3843
+ }) : "string" == typeof e.url ? await e2eGoTo(t, e.url, {
3844
+ waitUntil: e.waitUntil
3845
+ }) : (t.goto = e2eGoTo.bind(null, t), t.setContent = e2eSetContent.bind(null, t));
3846
+ } catch (e) {
3847
+ throw t && (t.isClosed() || await t.close()), e;
3848
+ }
3849
+ return t;
3850
+ }, exports.newSpecPage = async function newSpecPage(e) {
3851
+ if (null == e) throw new Error("NewSpecPageOptions required");
3852
+ testing.resetPlatform(), resetBuildConditionals(appData.BUILD), Array.isArray(e.components) && testing.registerComponents(e.components),
3853
+ e.hydrateClientSide && (e.includeAnnotations = !0), e.hydrateServerSide ? (e.includeAnnotations = !0,
3854
+ testing.setSupportsShadowDom(!1)) : (e.includeAnnotations = !!e.includeAnnotations,
3855
+ !1 === e.supportsShadowDom ? testing.setSupportsShadowDom(!1) : testing.setSupportsShadowDom(!0)),
3856
+ appData.BUILD.cssAnnotations = e.includeAnnotations;
3857
+ const t = new Set;
3858
+ testing.win.__rindo_spec_options = e;
3859
+ const r = testing.win.document, s = {
3860
+ win: testing.win,
3861
+ doc: r,
3862
+ body: r.body,
3863
+ build: appData.BUILD,
3864
+ styles: testing.styles,
3865
+ setContent: e => (r.body.innerHTML = e, testing.flushAll()),
3866
+ waitForChanges: testing.flushAll,
3867
+ flushLoadModule: testing.flushLoadModule,
3868
+ flushQueue: testing.flushQueue
3869
+ }, n = e.components.map((e => {
3870
+ if (null == e.COMPILER_META) throw new Error('Invalid component class: Missing static "COMPILER_META" property.');
3871
+ t.add(e.COMPILER_META.tagName), e.isProxied = !1, function r(e) {
3872
+ "function" == typeof e.prototype.__componentWillLoad && (e.prototype.componentWillLoad = e.prototype.__componentWillLoad,
3873
+ e.prototype.__componentWillLoad = null), "function" == typeof e.prototype.__componentWillUpdate && (e.prototype.componentWillUpdate = e.prototype.__componentWillUpdate,
3874
+ e.prototype.__componentWillUpdate = null), "function" == typeof e.prototype.__componentWillRender && (e.prototype.componentWillRender = e.prototype.__componentWillRender,
3875
+ e.prototype.__componentWillRender = null), "function" == typeof e.prototype.componentWillLoad && (e.prototype.__componentWillLoad = e.prototype.componentWillLoad,
3876
+ e.prototype.componentWillLoad = function() {
3877
+ const e = this.__componentWillLoad();
3878
+ return null != e && "function" == typeof e.then ? testing.writeTask((() => e)) : testing.writeTask((() => Promise.resolve())),
3879
+ e;
3880
+ }), "function" == typeof e.prototype.componentWillUpdate && (e.prototype.__componentWillUpdate = e.prototype.componentWillUpdate,
3881
+ e.prototype.componentWillUpdate = function() {
3882
+ const e = this.__componentWillUpdate();
3883
+ return null != e && "function" == typeof e.then ? testing.writeTask((() => e)) : testing.writeTask((() => Promise.resolve())),
3884
+ e;
3885
+ }), "function" == typeof e.prototype.componentWillRender && (e.prototype.__componentWillRender = e.prototype.componentWillRender,
3886
+ e.prototype.componentWillRender = function() {
3887
+ const e = this.__componentWillRender();
3888
+ return null != e && "function" == typeof e.then ? testing.writeTask((() => e)) : testing.writeTask((() => Promise.resolve())),
3889
+ e;
3890
+ });
3891
+ }(e);
3892
+ const s = `${e.COMPILER_META.tagName}.${Math.round(899999 * Math.random()) + 1e5}`, n = e.COMPILER_META.styles;
3893
+ if (Array.isArray(n)) if (n.length > 1) {
3894
+ const t = {};
3895
+ n.forEach((e => {
3896
+ t[e.modeName] = e.styleStr;
3897
+ })), e.style = t;
3898
+ } else 1 === n.length && (e.style = n[0].styleStr);
3899
+ return testing.registerModule(s, e), ((e, t) => [ e, t.map((e => ((e, t) => {
3900
+ let r = 0;
3901
+ "shadow" === e.encapsulation ? (r |= 1, e.shadowDelegatesFocus && (r |= 16)) : "scoped" === e.encapsulation && (r |= 2),
3902
+ "shadow" !== e.encapsulation && e.htmlTagNames.includes("slot") && (r |= 4), e.hasMode && (r |= 32);
3903
+ const s = formatComponentRuntimeMembers(e, t), n = formatHostListeners(e);
3904
+ return trimFalsy([ r, e.tagName, Object.keys(s).length > 0 ? s : void 0, n.length > 0 ? n : void 0 ]);
3905
+ })(e, !0))) ])(s, [ e.COMPILER_META ]);
3906
+ })), o = (e => {
3907
+ const t = e.some((e => e.htmlTagNames.includes("slot"))), r = e.some((e => "shadow" === e.encapsulation)), s = e.some((e => "shadow" !== e.encapsulation && e.htmlTagNames.includes("slot"))), n = {
3908
+ allRenderFn: e.every((e => e.hasRenderFn)),
3909
+ cmpDidLoad: e.some((e => e.hasComponentDidLoadFn)),
3910
+ cmpShouldUpdate: e.some((e => e.hasComponentShouldUpdateFn)),
3911
+ cmpDidUnload: e.some((e => e.hasComponentDidUnloadFn)),
3912
+ cmpDidUpdate: e.some((e => e.hasComponentDidUpdateFn)),
3913
+ cmpDidRender: e.some((e => e.hasComponentDidRenderFn)),
3914
+ cmpWillLoad: e.some((e => e.hasComponentWillLoadFn)),
3915
+ cmpWillUpdate: e.some((e => e.hasComponentWillUpdateFn)),
3916
+ cmpWillRender: e.some((e => e.hasComponentWillRenderFn)),
3917
+ connectedCallback: e.some((e => e.hasConnectedCallbackFn)),
3918
+ disconnectedCallback: e.some((e => e.hasDisconnectedCallbackFn)),
3919
+ element: e.some((e => e.hasElement)),
3920
+ event: e.some((e => e.hasEvent)),
3921
+ hasRenderFn: e.some((e => e.hasRenderFn)),
3922
+ lifecycle: e.some((e => e.hasLifecycle)),
3923
+ asyncLoading: !1,
3924
+ hostListener: e.some((e => e.hasListener)),
3925
+ hostListenerTargetWindow: e.some((e => e.hasListenerTargetWindow)),
3926
+ hostListenerTargetDocument: e.some((e => e.hasListenerTargetDocument)),
3927
+ hostListenerTargetBody: e.some((e => e.hasListenerTargetBody)),
3928
+ hostListenerTargetParent: e.some((e => e.hasListenerTargetParent)),
3929
+ hostListenerTarget: e.some((e => e.hasListenerTarget)),
3930
+ member: e.some((e => e.hasMember)),
3931
+ method: e.some((e => e.hasMethod)),
3932
+ mode: e.some((e => e.hasMode)),
3933
+ observeAttribute: e.some((e => e.hasAttribute)),
3934
+ prop: e.some((e => e.hasProp)),
3935
+ propBoolean: e.some((e => e.hasPropBoolean)),
3936
+ propNumber: e.some((e => e.hasPropNumber)),
3937
+ propString: e.some((e => e.hasPropString)),
3938
+ propMutable: e.some((e => e.hasPropMutable)),
3939
+ reflect: e.some((e => e.hasReflect)),
3940
+ scoped: e.some((e => "scoped" === e.encapsulation)),
3941
+ shadowDom: r,
3942
+ shadowDelegatesFocus: r && e.some((e => e.shadowDelegatesFocus)),
3943
+ slot: t,
3944
+ slotRelocation: s,
3945
+ state: e.some((e => e.hasState)),
3946
+ style: e.some((e => e.hasStyle)),
3947
+ svg: e.some((e => e.htmlTagNames.includes("svg"))),
3948
+ updatable: e.some((e => e.isUpdateable)),
3949
+ vdomAttribute: e.some((e => e.hasVdomAttribute)),
3950
+ vdomXlink: e.some((e => e.hasVdomXlink)),
3951
+ vdomClass: e.some((e => e.hasVdomClass)),
3952
+ vdomFunctional: e.some((e => e.hasVdomFunctional)),
3953
+ vdomKey: e.some((e => e.hasVdomKey)),
3954
+ vdomListener: e.some((e => e.hasVdomListener)),
3955
+ vdomPropOrAttr: e.some((e => e.hasVdomPropOrAttr)),
3956
+ vdomRef: e.some((e => e.hasVdomRef)),
3957
+ vdomRender: e.some((e => e.hasVdomRender)),
3958
+ vdomStyle: e.some((e => e.hasVdomStyle)),
3959
+ vdomText: e.some((e => e.hasVdomText)),
3960
+ watchCallback: e.some((e => e.hasWatchCallback)),
3961
+ taskQueue: !0
3962
+ };
3963
+ return n.asyncLoading = n.cmpWillUpdate || n.cmpWillLoad || n.cmpWillRender, n.vdomAttribute = n.vdomAttribute || n.reflect,
3964
+ n.vdomPropOrAttr = n.vdomPropOrAttr || n.reflect, n;
3965
+ })(e.components.map((e => e.COMPILER_META)));
3966
+ if (e.strictBuild ? Object.assign(appData.BUILD, o) : Object.keys(o).forEach((e => {
3967
+ !0 === o[e] && (appData.BUILD[e] = !0);
3968
+ })), appData.BUILD.asyncLoading = !0, e.hydrateClientSide ? (appData.BUILD.hydrateClientSide = !0,
3969
+ appData.BUILD.hydrateServerSide = !1) : e.hydrateServerSide && (appData.BUILD.hydrateServerSide = !0,
3970
+ appData.BUILD.hydrateClientSide = !1), appData.BUILD.cloneNodeFix = !1, appData.BUILD.shadowDomShim = !1,
3971
+ appData.BUILD.safari10 = !1, appData.BUILD.attachStyles = !!e.attachStyles, "string" == typeof e.url && (s.win.location.href = e.url),
3972
+ "string" == typeof e.direction && s.doc.documentElement.setAttribute("dir", e.direction),
3973
+ "string" == typeof e.language && s.doc.documentElement.setAttribute("lang", e.language),
3974
+ "string" == typeof e.cookie) try {
3975
+ s.doc.cookie = e.cookie;
3976
+ } catch (e) {}
3977
+ if ("string" == typeof e.referrer) try {
3978
+ s.doc.referrer = e.referrer;
3979
+ } catch (e) {}
3980
+ if ("string" == typeof e.userAgent) try {
3981
+ s.win.navigator.userAgent = e.userAgent;
3982
+ } catch (e) {}
3983
+ if (testing.bootstrapLazy(n), "function" == typeof e.template) {
3984
+ const t = {
3985
+ $ancestorComponent$: void 0,
3986
+ $flags$: 0,
3987
+ $modeName$: void 0,
3988
+ $cmpMeta$: {
3989
+ $flags$: 0,
3990
+ $tagName$: "body"
3991
+ },
3992
+ $hostElement$: s.body
3993
+ };
3994
+ testing.renderVdom(t, e.template());
3995
+ } else "string" == typeof e.html && (s.body.innerHTML = e.html);
3996
+ !1 !== e.flushQueue && await s.waitForChanges();
3997
+ let i = null;
3998
+ return Object.defineProperty(s, "root", {
3999
+ get() {
4000
+ if (null == i && (i = findRootComponent(t, s.body)), null != i) return i;
4001
+ const e = s.body.firstElementChild;
4002
+ return null != e ? e : null;
4003
+ }
4004
+ }), Object.defineProperty(s, "rootInstance", {
4005
+ get() {
4006
+ const e = testing.getHostRef(s.root);
4007
+ return null != e ? e.$lazyInstance$ : null;
4008
+ }
4009
+ }), e.hydrateServerSide && testing.insertVdomAnnotations(r, []), e.autoApplyChanges && (testing.startAutoApplyChanges(),
4010
+ s.waitForChanges = () => (console.error('waitForChanges() cannot be used manually if the "startAutoApplyChanges" option is enabled'),
4011
+ Promise.resolve())), s;
4012
+ }, exports.shuffleArray = function shuffleArray(e) {
4013
+ let t, r, s = e.length;
4014
+ for (;0 !== s; ) r = Math.floor(Math.random() * s), s -= 1, t = e[s], e[s] = e[r],
4015
+ e[r] = t;
4016
+ return e;
4017
+ }, exports.transpile = transpile;