@rindo/core 2.16.0-beta.0

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