@rindo/core 1.8.12 → 1.17.4

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