@ohos-ports/rspack-core 2.2.2-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 (326) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +15 -0
  3. package/compiled/@rspack/lite-tapable/dist/index.d.ts +176 -0
  4. package/compiled/@rspack/lite-tapable/license +22 -0
  5. package/compiled/@rspack/lite-tapable/package.json +1 -0
  6. package/compiled/@swc/types/index.d.ts +2284 -0
  7. package/compiled/@swc/types/index.js +19 -0
  8. package/compiled/@swc/types/license +201 -0
  9. package/compiled/@swc/types/package.json +1 -0
  10. package/compiled/connect-next/index.d.ts +57 -0
  11. package/compiled/connect-next/license +26 -0
  12. package/compiled/connect-next/package.json +1 -0
  13. package/compiled/http-proxy-middleware/index.d.ts +455 -0
  14. package/compiled/http-proxy-middleware/license +22 -0
  15. package/compiled/http-proxy-middleware/package.json +1 -0
  16. package/compiled/open/index.d.ts +161 -0
  17. package/compiled/open/package.json +1 -0
  18. package/compiled/tinypool/LICENSE +24 -0
  19. package/compiled/tinypool/README.md +214 -0
  20. package/compiled/tinypool/dist/common-Bo3KCGim.js +31 -0
  21. package/compiled/tinypool/dist/entry/process.d.ts +1 -0
  22. package/compiled/tinypool/dist/entry/process.js +72 -0
  23. package/compiled/tinypool/dist/entry/utils.d.ts +7 -0
  24. package/compiled/tinypool/dist/entry/utils.js +3 -0
  25. package/compiled/tinypool/dist/entry/worker.d.ts +1 -0
  26. package/compiled/tinypool/dist/entry/worker.js +76 -0
  27. package/compiled/tinypool/dist/index.d.ts +199 -0
  28. package/compiled/tinypool/dist/index.js +784 -0
  29. package/compiled/tinypool/dist/utils-B--2TaWv.js +38 -0
  30. package/compiled/tinypool/dist/utils-De75vAgL.js +10 -0
  31. package/compiled/tinypool/package.json +55 -0
  32. package/compiled/watchpack/index.d.ts +3 -0
  33. package/compiled/watchpack/index.js +3811 -0
  34. package/compiled/watchpack/license +20 -0
  35. package/compiled/watchpack/package.json +8 -0
  36. package/compiled/watchpack/types/DirectoryWatcher.d.ts +335 -0
  37. package/compiled/watchpack/types/LinkResolver.d.ts +10 -0
  38. package/compiled/watchpack/types/getWatcherManager.d.ts +62 -0
  39. package/compiled/watchpack/types/index.d.ts +269 -0
  40. package/compiled/watchpack/types/reducePlan.d.ts +34 -0
  41. package/compiled/watchpack/types/util/globToRegExp.d.ts +2 -0
  42. package/compiled/watchpack/types/watchEventSource.d.ts +53 -0
  43. package/compiled/watchpack/types/watchpack.d.ts +2 -0
  44. package/compiled/webpack-sources/index.js +5835 -0
  45. package/compiled/webpack-sources/license +21 -0
  46. package/compiled/webpack-sources/package.json +1 -0
  47. package/compiled/webpack-sources/types.d.ts +500 -0
  48. package/dist/612~0.js +32 -0
  49. package/dist/612~3.js +32 -0
  50. package/dist/BuildInfo.d.ts +17 -0
  51. package/dist/Chunk.d.ts +16 -0
  52. package/dist/ChunkGraph.d.ts +9 -0
  53. package/dist/Chunks.d.ts +12 -0
  54. package/dist/CodeGenerationResults.d.ts +1 -0
  55. package/dist/Compilation.d.ts +448 -0
  56. package/dist/Compiler.d.ts +229 -0
  57. package/dist/ConcatenatedModule.d.ts +1 -0
  58. package/dist/ContextModule.d.ts +1 -0
  59. package/dist/ContextModuleFactory.d.ts +13 -0
  60. package/dist/Diagnostics.d.ts +7 -0
  61. package/dist/Entrypoint.d.ts +2 -0
  62. package/dist/ErrorHelpers.d.ts +3 -0
  63. package/dist/ExecuteModulePlugin.d.ts +4 -0
  64. package/dist/ExportsInfo.d.ts +20 -0
  65. package/dist/ExternalModule.d.ts +15 -0
  66. package/dist/FileSystem.d.ts +54 -0
  67. package/dist/FileSystemInfo.d.ts +5 -0
  68. package/dist/Module.d.ts +41 -0
  69. package/dist/ModuleGraph.d.ts +22 -0
  70. package/dist/ModuleGraphConnection.d.ts +10 -0
  71. package/dist/ModuleTypeConstants.d.ts +8 -0
  72. package/dist/MultiCompiler.d.ts +82 -0
  73. package/dist/MultiStats.d.ts +23 -0
  74. package/dist/MultiWatching.d.ts +27 -0
  75. package/dist/NativeWatchFileSystem.d.ts +52 -0
  76. package/dist/NormalModule.d.ts +14 -0
  77. package/dist/NormalModuleFactory.d.ts +23 -0
  78. package/dist/Resolver.d.ts +30 -0
  79. package/dist/ResolverFactory.d.ts +17 -0
  80. package/dist/RspackError.d.ts +12 -0
  81. package/dist/RuleSetCompiler.d.ts +9 -0
  82. package/dist/RuntimeGlobals.d.ts +360 -0
  83. package/dist/RuntimeModule.d.ts +34 -0
  84. package/dist/RuntimeTemplate.d.ts +151 -0
  85. package/dist/Stats.d.ts +17 -0
  86. package/dist/Template.d.ts +77 -0
  87. package/dist/VirtualModulesPlugin.d.ts +12 -0
  88. package/dist/Watching.d.ts +56 -0
  89. package/dist/builtin-loader/lightningcss/index.d.ts +114 -0
  90. package/dist/builtin-loader/lightningcss/target.d.ts +4 -0
  91. package/dist/builtin-loader/swc/collectTypeScriptInfo.d.ts +21 -0
  92. package/dist/builtin-loader/swc/index.d.ts +3 -0
  93. package/dist/builtin-loader/swc/pluginImport.d.ts +33 -0
  94. package/dist/builtin-loader/swc/types.d.ts +60 -0
  95. package/dist/builtin-plugin/APIPlugin.d.ts +9 -0
  96. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +9 -0
  97. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +9 -0
  98. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +9 -0
  99. package/dist/builtin-plugin/BannerPlugin.d.ts +40 -0
  100. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +14 -0
  101. package/dist/builtin-plugin/CaseSensitivePlugin.d.ts +9 -0
  102. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +9 -0
  103. package/dist/builtin-plugin/CircularCheckRspackPlugin.d.ts +33 -0
  104. package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +60 -0
  105. package/dist/builtin-plugin/CircularModulesInfoPlugin.d.ts +7 -0
  106. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +9 -0
  107. package/dist/builtin-plugin/CompactHashedChunkIdsPlugin.d.ts +12 -0
  108. package/dist/builtin-plugin/CompactHashedModuleIdsPlugin.d.ts +12 -0
  109. package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +9 -0
  110. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +14 -0
  111. package/dist/builtin-plugin/CssChunkingPlugin.d.ts +21 -0
  112. package/dist/builtin-plugin/CssHttpExternalsRspackPlugin.d.ts +9 -0
  113. package/dist/builtin-plugin/CssModulesPlugin.d.ts +9 -0
  114. package/dist/builtin-plugin/DataUriPlugin.d.ts +9 -0
  115. package/dist/builtin-plugin/DefinePlugin.d.ts +16 -0
  116. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +7 -0
  117. package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +18 -0
  118. package/dist/builtin-plugin/DllEntryPlugin.d.ts +12 -0
  119. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +11 -0
  120. package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +12 -0
  121. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +9 -0
  122. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +25 -0
  123. package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +11 -0
  124. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +9 -0
  125. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +9 -0
  126. package/dist/builtin-plugin/EntryPlugin.d.ts +32 -0
  127. package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +16 -0
  128. package/dist/builtin-plugin/EsmNodeTargetPlugin.d.ts +9 -0
  129. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +11 -0
  130. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +10 -0
  131. package/dist/builtin-plugin/ExternalsPlugin.d.ts +13 -0
  132. package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +9 -0
  133. package/dist/builtin-plugin/FileUriPlugin.d.ts +9 -0
  134. package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +9 -0
  135. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +9 -0
  136. package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +9 -0
  137. package/dist/builtin-plugin/HashedModuleIdsPlugin.d.ts +10 -0
  138. package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +7 -0
  139. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +9 -0
  140. package/dist/builtin-plugin/HttpUriPlugin.d.ts +36 -0
  141. package/dist/builtin-plugin/IgnorePlugin.d.ts +19 -0
  142. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +9 -0
  143. package/dist/builtin-plugin/InlineExportsPlugin.d.ts +9 -0
  144. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +30 -0
  145. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +10 -0
  146. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +9 -0
  147. package/dist/builtin-plugin/LibManifestPlugin.d.ts +17 -0
  148. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +28 -0
  149. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +14 -0
  150. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +9 -0
  151. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +9 -0
  152. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +9 -0
  153. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +7 -0
  154. package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +9 -0
  155. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +9 -0
  156. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +9 -0
  157. package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +7 -0
  158. package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +7 -0
  159. package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +9 -0
  160. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +9 -0
  161. package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +10 -0
  162. package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +10 -0
  163. package/dist/builtin-plugin/ProgressPlugin.d.ts +12 -0
  164. package/dist/builtin-plugin/ProvidePlugin.d.ts +10 -0
  165. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +20 -0
  166. package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +9 -0
  167. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +9 -0
  168. package/dist/builtin-plugin/RsdoctorPlugin.d.ts +46 -0
  169. package/dist/builtin-plugin/RslibPlugin.d.ts +10 -0
  170. package/dist/builtin-plugin/RstestPlugin.d.ts +10 -0
  171. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +11 -0
  172. package/dist/builtin-plugin/RuntimePlugin.d.ts +25 -0
  173. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +9 -0
  174. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +19 -0
  175. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +11 -0
  176. package/dist/builtin-plugin/SplitChunksPlugin.d.ts +12 -0
  177. package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +39 -0
  178. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +216 -0
  179. package/dist/builtin-plugin/SyncModuleIdsPlugin.d.ts +16 -0
  180. package/dist/builtin-plugin/URLPlugin.d.ts +9 -0
  181. package/dist/builtin-plugin/WorkerPlugin.d.ts +14 -0
  182. package/dist/builtin-plugin/base.d.ts +45 -0
  183. package/dist/builtin-plugin/css-extract/index.d.ts +24 -0
  184. package/dist/builtin-plugin/css-extract/loader.d.ts +21 -0
  185. package/dist/builtin-plugin/css-extract/utils.d.ts +10 -0
  186. package/dist/builtin-plugin/html-plugin/hooks.d.ts +32 -0
  187. package/dist/builtin-plugin/html-plugin/index.d.ts +2 -0
  188. package/dist/builtin-plugin/html-plugin/options.d.ts +77 -0
  189. package/dist/builtin-plugin/html-plugin/plugin.d.ts +20 -0
  190. package/dist/builtin-plugin/html-plugin/taps.d.ts +2 -0
  191. package/dist/builtin-plugin/index.d.ts +92 -0
  192. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +10 -0
  193. package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +12 -0
  194. package/dist/builtin-plugin/rsc/Coordinator.d.ts +8 -0
  195. package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +13 -0
  196. package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +47 -0
  197. package/dist/builtin-plugin/rsc/index.d.ts +24 -0
  198. package/dist/checkNodeVersion.d.ts +1 -0
  199. package/dist/config/adapter.d.ts +8 -0
  200. package/dist/config/adapterRuleUse.d.ts +424 -0
  201. package/dist/config/browserslistTargetHandler.d.ts +15 -0
  202. package/dist/config/defaults.d.ts +15 -0
  203. package/dist/config/devServer.d.ts +179 -0
  204. package/dist/config/index.d.ts +5 -0
  205. package/dist/config/normalization.d.ts +156 -0
  206. package/dist/config/target.d.ts +100 -0
  207. package/dist/config/types.d.ts +2728 -0
  208. package/dist/container/ContainerPlugin.d.ts +41 -0
  209. package/dist/container/ContainerReferencePlugin.d.ts +34 -0
  210. package/dist/container/ModuleFederationManifestPlugin.d.ts +44 -0
  211. package/dist/container/ModuleFederationPlugin.d.ts +34 -0
  212. package/dist/container/ModuleFederationPluginV1.d.ts +22 -0
  213. package/dist/container/ModuleFederationRuntimePlugin.d.ts +16 -0
  214. package/dist/container/options.d.ts +3 -0
  215. package/dist/cssExtractHmr.js +99 -0
  216. package/dist/cssExtractLoader.js +117 -0
  217. package/dist/error/ConcurrentCompilationError.d.ts +14 -0
  218. package/dist/exports.d.ts +192 -0
  219. package/dist/index.d.ts +11 -0
  220. package/dist/index.js +14552 -0
  221. package/dist/lib/AbstractMethodError.d.ts +23 -0
  222. package/dist/lib/Cache.d.ts +65 -0
  223. package/dist/lib/CacheFacade.d.ts +139 -0
  224. package/dist/lib/DllPlugin.d.ts +42 -0
  225. package/dist/lib/DllReferencePlugin.d.ts +119 -0
  226. package/dist/lib/EntryOptionPlugin.d.ts +33 -0
  227. package/dist/lib/EnvironmentPlugin.d.ts +22 -0
  228. package/dist/lib/HookWebpackError.d.ts +39 -0
  229. package/dist/lib/IgnoreWarningsPlugin.d.ts +25 -0
  230. package/dist/lib/LoaderOptionsPlugin.d.ts +28 -0
  231. package/dist/lib/LoaderTargetPlugin.d.ts +24 -0
  232. package/dist/lib/ModuleFilenameHelpers.d.ts +53 -0
  233. package/dist/lib/WebpackError.d.ts +21 -0
  234. package/dist/lib/cache/MemoryCachePlugin.d.ts +5 -0
  235. package/dist/lib/cache/getLazyHashedEtag.d.ts +35 -0
  236. package/dist/lib/cache/mergeEtags.d.ts +16 -0
  237. package/dist/loader-runner/LoaderLoadingError.d.ts +13 -0
  238. package/dist/loader-runner/ModuleError.d.ts +13 -0
  239. package/dist/loader-runner/cache.d.ts +18 -0
  240. package/dist/loader-runner/dependencies.d.ts +22 -0
  241. package/dist/loader-runner/index.d.ts +35 -0
  242. package/dist/loader-runner/loadLoader.d.ts +12 -0
  243. package/dist/loader-runner/service.d.ts +77 -0
  244. package/dist/loader-runner/utils.d.ts +7 -0
  245. package/dist/loader-runner/worker.d.ts +14 -0
  246. package/dist/logging/Logger.d.ts +61 -0
  247. package/dist/logging/createConsoleLogger.d.ts +35 -0
  248. package/dist/logging/truncateArgs.d.ts +16 -0
  249. package/dist/moduleFederationDefaultRuntime.js +1 -0
  250. package/dist/node/NodeEnvironmentPlugin.d.ts +10 -0
  251. package/dist/node/NodeTemplatePlugin.d.ts +18 -0
  252. package/dist/node/NodeWatchFileSystem.d.ts +30 -0
  253. package/dist/node/nodeConsole.d.ts +15 -0
  254. package/dist/rspack.d.ts +24 -0
  255. package/dist/rspackOptionsApply.d.ts +4 -0
  256. package/dist/runtime/cssExtractHmr.d.ts +4 -0
  257. package/dist/runtime/moduleFederationDefaultRuntime.d.ts +1 -0
  258. package/dist/sharing/CollectSharedEntryPlugin.d.ts +22 -0
  259. package/dist/sharing/ConsumeSharedPlugin.d.ts +54 -0
  260. package/dist/sharing/IndependentSharedPlugin.d.ts +37 -0
  261. package/dist/sharing/ProvideSharedPlugin.d.ts +54 -0
  262. package/dist/sharing/SharePlugin.d.ts +89 -0
  263. package/dist/sharing/ShareRuntimePlugin.d.ts +9 -0
  264. package/dist/sharing/SharedContainerPlugin.d.ts +23 -0
  265. package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +14 -0
  266. package/dist/sharing/TreeShakingSharedPlugin.d.ts +19 -0
  267. package/dist/sharing/utils.d.ts +2 -0
  268. package/dist/stats/DefaultStatsFactoryPlugin.d.ts +20 -0
  269. package/dist/stats/DefaultStatsPresetPlugin.d.ts +4 -0
  270. package/dist/stats/DefaultStatsPrinterPlugin.d.ts +13 -0
  271. package/dist/stats/StatsFactory.d.ts +57 -0
  272. package/dist/stats/StatsPrinter.d.ts +57 -0
  273. package/dist/stats/statsFactoryUtils.d.ts +338 -0
  274. package/dist/swc.d.ts +7 -0
  275. package/dist/taps/compilation.d.ts +8 -0
  276. package/dist/taps/compiler.d.ts +2 -0
  277. package/dist/taps/contextModuleFactory.d.ts +2 -0
  278. package/dist/taps/externalModule.d.ts +2 -0
  279. package/dist/taps/index.d.ts +7 -0
  280. package/dist/taps/javascriptModules.d.ts +2 -0
  281. package/dist/taps/normalModuleFactory.d.ts +2 -0
  282. package/dist/taps/types.d.ts +11 -0
  283. package/dist/trace/index.d.ts +47 -0
  284. package/dist/trace/traceHookPlugin.d.ts +5 -0
  285. package/dist/util/ArrayQueue.d.ts +45 -0
  286. package/dist/util/AsyncTask.d.ts +7 -0
  287. package/dist/util/MergeCaller.d.ts +10 -0
  288. package/dist/util/SizeFormatHelpers.d.ts +10 -0
  289. package/dist/util/SplitChunkSize.d.ts +5 -0
  290. package/dist/util/assertNotNil.d.ts +1 -0
  291. package/dist/util/assetCondition.d.ts +2 -0
  292. package/dist/util/asyncLib.d.ts +54 -0
  293. package/dist/util/bindingVersionCheck.d.ts +5 -0
  294. package/dist/util/cleverMerge.d.ts +24 -0
  295. package/dist/util/comparators.d.ts +16 -0
  296. package/dist/util/createHash.d.ts +16 -0
  297. package/dist/util/createReadonlyMap.d.ts +1 -0
  298. package/dist/util/fake.d.ts +11 -0
  299. package/dist/util/fs.d.ts +376 -0
  300. package/dist/util/hash/index.d.ts +26 -0
  301. package/dist/util/hash/md4.d.ts +11 -0
  302. package/dist/util/hash/wasm-hash.d.ts +51 -0
  303. package/dist/util/hash/xxhash64.d.ts +11 -0
  304. package/dist/util/identifier.d.ts +57 -0
  305. package/dist/util/index.d.ts +9 -0
  306. package/dist/util/memoize.d.ts +2 -0
  307. package/dist/util/runtime.d.ts +2 -0
  308. package/dist/util/smartGrouping.d.ts +21 -0
  309. package/dist/util/source.d.ts +6 -0
  310. package/dist/util/supportsColor.d.ts +6 -0
  311. package/dist/util/targetsVersion.d.ts +2 -0
  312. package/dist/util/validateConfig.d.ts +5 -0
  313. package/dist/web/JsonpTemplatePlugin.d.ts +13 -0
  314. package/dist/webworker/WebWorkerTemplatePlugin.d.ts +13 -0
  315. package/dist/worker.js +971 -0
  316. package/hot/dev-server.js +76 -0
  317. package/hot/emitter.js +23 -0
  318. package/hot/lazy-compilation-node.js +109 -0
  319. package/hot/lazy-compilation-web.js +97 -0
  320. package/hot/log-apply-result.js +52 -0
  321. package/hot/log.js +87 -0
  322. package/hot/only-dev-server.js +104 -0
  323. package/hot/poll.js +41 -0
  324. package/hot/signal.js +68 -0
  325. package/module.d.ts +310 -0
  326. package/package.json +79 -0
package/dist/worker.js ADDED
@@ -0,0 +1,971 @@
1
+ let createMd4, createXxhash64, url;
2
+ import node_fs from "node:fs";
3
+ import node_querystring from "node:querystring";
4
+ import { inspect, promisify } from "node:util";
5
+ import { receiveMessageOnPort } from "node:worker_threads";
6
+ import { createRequire, createRequire as __rspack_createRequire } from "node:module";
7
+ import node_path from "node:path";
8
+ import { __webpack_require__ } from "./612~3.js";
9
+ let __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
10
+ __webpack_require__.add({
11
+ "node:crypto" (module) {
12
+ module.exports = __rspack_createRequire_require("node:crypto");
13
+ },
14
+ "node:os" (module) {
15
+ module.exports = __rspack_createRequire_require("node:os");
16
+ },
17
+ "node:url" (module) {
18
+ module.exports = __rspack_createRequire_require("node:url");
19
+ }
20
+ });
21
+ var swc_namespaceObject = {};
22
+ __webpack_require__.r(swc_namespaceObject), __webpack_require__.d(swc_namespaceObject, {
23
+ minify: ()=>minify,
24
+ minifySync: ()=>minifySync,
25
+ transform: ()=>transform,
26
+ transformSync: ()=>transformSync
27
+ });
28
+ let binding_namespaceObject = __rspack_createRequire_require(process.env.RSPACK_BINDING || "@ohos-ports/rspack-binding");
29
+ var binding_default = __webpack_require__.n(binding_namespaceObject);
30
+ async function minify(source, options) {
31
+ let _options = JSON.stringify(options || {});
32
+ return binding_default().minify(source, _options);
33
+ }
34
+ function minifySync(source, options) {
35
+ let _options = JSON.stringify(options || {});
36
+ return binding_default().minifySync(source, _options);
37
+ }
38
+ async function transform(source, options) {
39
+ let _options = JSON.stringify(options || {});
40
+ return binding_default().transform(source, _options);
41
+ }
42
+ function transformSync(source, options) {
43
+ let _options = JSON.stringify(options || {});
44
+ return binding_default().transformSync(source, _options);
45
+ }
46
+ let decoder = new TextDecoder(), toObject = (input)=>{
47
+ let s;
48
+ if (Buffer.isBuffer(input)) s = input.toString('utf8');
49
+ else if (input instanceof Uint8Array) s = decoder.decode(input);
50
+ else if (input && 'object' == typeof input) return input;
51
+ else if ('string' == typeof input) s = input;
52
+ else throw Error('Buffer or string or object expected');
53
+ return JSON.parse(s);
54
+ }, DYNAMIC_INFO = Symbol('cleverMerge dynamic info'), mergeCache = new WeakMap(), DELETE = Symbol('DELETE'), cachedCleverMerge = (first, second)=>{
55
+ if (void 0 === second) return first;
56
+ if (void 0 === first || 'object' != typeof second || null === second) return second;
57
+ if ('object' != typeof first || null === first) return first;
58
+ let innerCache = mergeCache.get(first);
59
+ void 0 === innerCache && (innerCache = new WeakMap(), mergeCache.set(first, innerCache));
60
+ let prevMerge = innerCache.get(second);
61
+ if (void 0 !== prevMerge) return prevMerge;
62
+ let newMerge = _cleverMerge(first, second, !0);
63
+ return innerCache.set(second, newMerge), newMerge;
64
+ }, parseCache = new WeakMap(), cachedParseObject = (obj)=>{
65
+ let entry = parseCache.get(obj);
66
+ if (void 0 !== entry) return entry;
67
+ let result = parseObject(obj);
68
+ return parseCache.set(obj, result), result;
69
+ }, parseObject = (obj)=>{
70
+ let dynamicInfo, info = new Map(), getInfo = (p)=>{
71
+ let entry = info.get(p);
72
+ if (void 0 !== entry) return entry;
73
+ let newEntry = {
74
+ base: void 0,
75
+ byProperty: void 0,
76
+ byValues: new Map()
77
+ };
78
+ return info.set(p, newEntry), newEntry;
79
+ };
80
+ for (let key of Object.keys(obj))if (key.startsWith('by')) {
81
+ let byObj = obj[key];
82
+ if ('object' == typeof byObj) for (let byValue of Object.keys(byObj)){
83
+ let obj = byObj[byValue];
84
+ for (let key1 of Object.keys(obj)){
85
+ let entry = getInfo(key1);
86
+ if (void 0 === entry.byProperty) entry.byProperty = key;
87
+ else if (entry.byProperty !== key) throw Error(`${key} and ${entry.byProperty} for a single property is not supported`);
88
+ if (entry.byValues.set(byValue, obj[key1]), 'default' === byValue) for (let otherByValue of Object.keys(byObj))entry.byValues.has(otherByValue) || entry.byValues.set(otherByValue, void 0);
89
+ }
90
+ }
91
+ else if ('function' == typeof byObj) if (void 0 === dynamicInfo) dynamicInfo = {
92
+ byProperty: key,
93
+ fn: byObj
94
+ };
95
+ else throw Error(`${key} and ${dynamicInfo.byProperty} when both are functions is not supported`);
96
+ else getInfo(key).base = obj[key];
97
+ } else getInfo(key).base = obj[key];
98
+ return {
99
+ static: info,
100
+ dynamic: dynamicInfo
101
+ };
102
+ }, cleverMerge_serializeObject = (info, dynamicInfo)=>{
103
+ let obj = {};
104
+ for (let entry of info.values())if (void 0 !== entry.byProperty) {
105
+ let byObj = obj[entry.byProperty] = obj[entry.byProperty] || {};
106
+ for (let byValue of entry.byValues.keys())byObj[byValue] = byObj[byValue] || {};
107
+ }
108
+ for (let [key, entry] of info)if (void 0 !== entry.base && (obj[key] = entry.base), void 0 !== entry.byProperty) {
109
+ let byObj = obj[entry.byProperty] = obj[entry.byProperty] || {};
110
+ for (let byValue of Object.keys(byObj)){
111
+ let value = getFromByValues(entry.byValues, byValue);
112
+ void 0 !== value && (byObj[byValue][key] = value);
113
+ }
114
+ }
115
+ return void 0 !== dynamicInfo && (obj[dynamicInfo.byProperty] = dynamicInfo.fn), obj;
116
+ }, getValueType = (value)=>void 0 === value ? 0 : value === DELETE ? 4 : Array.isArray(value) ? -1 !== value.lastIndexOf('...') ? 2 : 1 : 'object' != typeof value || null === value || value.constructor && value.constructor !== Object ? 1 : 3, cleverMerge = (first, second)=>void 0 === second ? first : void 0 === first || 'object' != typeof second || null === second ? second : 'object' != typeof first || null === first ? first : _cleverMerge(first, second, !1), _cleverMerge = (first, second, internalCaching = !1)=>{
117
+ let firstObject = internalCaching ? cachedParseObject(first) : parseObject(first), { static: firstInfo, dynamic: firstDynamicInfo } = firstObject, secondObj = second;
118
+ if (void 0 !== firstDynamicInfo) {
119
+ let { fn } = firstDynamicInfo, { byProperty } = firstDynamicInfo, fnInfo = fn[DYNAMIC_INFO];
120
+ fnInfo && (secondObj = internalCaching ? cachedCleverMerge(fnInfo[1], second) : cleverMerge(fnInfo[1], second), fn = fnInfo[0]);
121
+ let newFn = (...args)=>{
122
+ let fnResult = fn(...args);
123
+ return internalCaching ? cachedCleverMerge(fnResult, secondObj) : cleverMerge(fnResult, secondObj);
124
+ };
125
+ return newFn[DYNAMIC_INFO] = [
126
+ fn,
127
+ secondObj
128
+ ], cleverMerge_serializeObject(firstObject.static, {
129
+ byProperty,
130
+ fn: newFn
131
+ });
132
+ }
133
+ let { static: secondInfo, dynamic: secondDynamicInfo } = internalCaching ? cachedParseObject(second) : parseObject(second), resultInfo = new Map();
134
+ for (let [key, firstEntry] of firstInfo){
135
+ let secondEntry = secondInfo.get(key), entry = void 0 !== secondEntry ? mergeEntries(firstEntry, secondEntry, internalCaching) : firstEntry;
136
+ resultInfo.set(key, entry);
137
+ }
138
+ for (let [key, secondEntry] of secondInfo)firstInfo.has(key) || resultInfo.set(key, secondEntry);
139
+ return cleverMerge_serializeObject(resultInfo, secondDynamicInfo);
140
+ }, mergeEntries = (firstEntry, secondEntry, internalCaching)=>{
141
+ switch(getValueType(secondEntry.base)){
142
+ case 1:
143
+ case 4:
144
+ return secondEntry;
145
+ case 0:
146
+ {
147
+ if (!firstEntry.byProperty) return {
148
+ base: firstEntry.base,
149
+ byProperty: secondEntry.byProperty,
150
+ byValues: secondEntry.byValues
151
+ };
152
+ if (firstEntry.byProperty !== secondEntry.byProperty) throw Error(`${firstEntry.byProperty} and ${secondEntry.byProperty} for a single property is not supported`);
153
+ let newByValues = new Map(firstEntry.byValues);
154
+ for (let [key, value] of secondEntry.byValues){
155
+ let firstValue = getFromByValues(firstEntry.byValues, key);
156
+ newByValues.set(key, mergeSingleValue(firstValue, value, internalCaching));
157
+ }
158
+ return {
159
+ base: firstEntry.base,
160
+ byProperty: firstEntry.byProperty,
161
+ byValues: newByValues
162
+ };
163
+ }
164
+ default:
165
+ {
166
+ let newBase;
167
+ if (!firstEntry.byProperty) return {
168
+ base: mergeSingleValue(firstEntry.base, secondEntry.base, internalCaching),
169
+ byProperty: secondEntry.byProperty,
170
+ byValues: secondEntry.byValues
171
+ };
172
+ let intermediateByValues = new Map(firstEntry.byValues);
173
+ for (let [key, value] of intermediateByValues)intermediateByValues.set(key, mergeSingleValue(value, secondEntry.base, internalCaching));
174
+ if (Array.from(firstEntry.byValues.values()).every((value)=>{
175
+ let type = getValueType(value);
176
+ return 1 === type || 4 === type;
177
+ }) ? newBase = mergeSingleValue(firstEntry.base, secondEntry.base, internalCaching) : (newBase = firstEntry.base, intermediateByValues.has('default') || intermediateByValues.set('default', secondEntry.base)), !secondEntry.byProperty) return {
178
+ base: newBase,
179
+ byProperty: firstEntry.byProperty,
180
+ byValues: intermediateByValues
181
+ };
182
+ if (firstEntry.byProperty !== secondEntry.byProperty) throw Error(`${firstEntry.byProperty} and ${secondEntry.byProperty} for a single property is not supported`);
183
+ let newByValues = new Map(intermediateByValues);
184
+ for (let [key, value] of secondEntry.byValues){
185
+ let firstValue = getFromByValues(intermediateByValues, key);
186
+ newByValues.set(key, mergeSingleValue(firstValue, value, internalCaching));
187
+ }
188
+ return {
189
+ base: newBase,
190
+ byProperty: firstEntry.byProperty,
191
+ byValues: newByValues
192
+ };
193
+ }
194
+ }
195
+ }, getFromByValues = (byValues, key)=>'default' !== key && byValues.has(key) ? byValues.get(key) : byValues.get('default'), mergeSingleValue = (a, b, internalCaching)=>{
196
+ let bType = getValueType(b), aType = getValueType(a);
197
+ switch(bType){
198
+ case 4:
199
+ case 1:
200
+ return b;
201
+ case 3:
202
+ return 3 !== aType ? b : internalCaching ? cachedCleverMerge(a, b) : cleverMerge(a, b);
203
+ case 0:
204
+ return a;
205
+ case 2:
206
+ switch(1 !== aType ? aType : Array.isArray(a) ? 2 : 3){
207
+ case 0:
208
+ return b;
209
+ case 4:
210
+ return b.filter((item)=>'...' !== item);
211
+ case 2:
212
+ {
213
+ let newArray = [];
214
+ for (let item of b)if ('...' === item) for (let item of a)newArray.push(item);
215
+ else newArray.push(item);
216
+ return newArray;
217
+ }
218
+ case 3:
219
+ return b.map((item)=>'...' === item ? a : item);
220
+ default:
221
+ throw Error('Not implemented');
222
+ }
223
+ default:
224
+ throw Error('Not implemented');
225
+ }
226
+ };
227
+ class WebpackError extends Error {
228
+ loc;
229
+ file;
230
+ chunk;
231
+ module;
232
+ details;
233
+ hideStack;
234
+ }
235
+ Object.defineProperty(WebpackError.prototype, inspect.custom, {
236
+ value: function() {
237
+ return this.stack + (this.details ? `\n${this.details}` : '');
238
+ },
239
+ enumerable: !1,
240
+ configurable: !0
241
+ });
242
+ let lib_WebpackError = WebpackError, CURRENT_METHOD_REGEXP = /at ([a-zA-Z0-9_.]*)/;
243
+ function createMessage(method) {
244
+ return `Abstract method${method ? ` ${method}` : ''}. Must be overridden.`;
245
+ }
246
+ class Message extends Error {
247
+ constructor(){
248
+ super(), this.stack = void 0, Error.captureStackTrace(this);
249
+ let match = this.stack.split('\n')[3].match(CURRENT_METHOD_REGEXP);
250
+ this.message = match?.[1] ? createMessage(match[1]) : createMessage();
251
+ }
252
+ }
253
+ class AbstractMethodError extends lib_WebpackError {
254
+ constructor(){
255
+ super(new Message().message), this.name = 'AbstractMethodError';
256
+ }
257
+ }
258
+ class Hash {
259
+ update() {
260
+ throw new AbstractMethodError();
261
+ }
262
+ digest() {
263
+ throw new AbstractMethodError();
264
+ }
265
+ }
266
+ let MAX_SHORT_STRING = -4 & Math.floor(16368);
267
+ class WasmHash {
268
+ exports;
269
+ instancesPool;
270
+ buffered;
271
+ mem;
272
+ chunkSize;
273
+ digestSize;
274
+ constructor(instance, instancesPool, chunkSize, digestSize){
275
+ let exports = instance.exports;
276
+ exports.init(), this.exports = exports, this.mem = Buffer.from(exports.memory.buffer, 0, 65536), this.buffered = 0, this.instancesPool = instancesPool, this.chunkSize = chunkSize, this.digestSize = digestSize;
277
+ }
278
+ reset() {
279
+ this.buffered = 0, this.exports.init();
280
+ }
281
+ update(data, encoding) {
282
+ if ('string' == typeof data) {
283
+ let normalizedData = data;
284
+ for(; normalizedData.length > MAX_SHORT_STRING;)this._updateWithShortString(normalizedData.slice(0, MAX_SHORT_STRING), encoding), normalizedData = normalizedData.slice(MAX_SHORT_STRING);
285
+ return this._updateWithShortString(normalizedData, encoding), this;
286
+ }
287
+ return this._updateWithBuffer(data), this;
288
+ }
289
+ _updateWithShortString(data, encoding) {
290
+ let endPos, { exports, buffered, mem, chunkSize } = this;
291
+ if (data.length < 70) if (encoding && 'utf-8' !== encoding && 'utf8' !== encoding) if ('latin1' === encoding) {
292
+ endPos = buffered;
293
+ for(let i = 0; i < data.length; i++){
294
+ let cc = data.charCodeAt(i);
295
+ mem[endPos++] = cc;
296
+ }
297
+ } else endPos = buffered + mem.write(data, buffered, encoding);
298
+ else {
299
+ endPos = buffered;
300
+ for(let i = 0; i < data.length; i++){
301
+ let cc = data.charCodeAt(i);
302
+ if (cc < 0x80) mem[endPos++] = cc;
303
+ else if (cc < 0x800) mem[endPos] = cc >> 6 | 0xc0, mem[endPos + 1] = 0x3f & cc | 0x80, endPos += 2;
304
+ else {
305
+ endPos += mem.write(data.slice(i), endPos, encoding);
306
+ break;
307
+ }
308
+ }
309
+ }
310
+ else endPos = buffered + mem.write(data, buffered, encoding);
311
+ if (endPos < chunkSize) this.buffered = endPos;
312
+ else {
313
+ let l = endPos & ~(this.chunkSize - 1);
314
+ exports.update(l);
315
+ let newBuffered = endPos - l;
316
+ this.buffered = newBuffered, newBuffered > 0 && mem.copyWithin(0, l, endPos);
317
+ }
318
+ }
319
+ _updateWithBuffer(data) {
320
+ let { exports, buffered, mem } = this, length = data.length;
321
+ if (buffered + length < this.chunkSize) data.copy(mem, buffered, 0, length), this.buffered += length;
322
+ else {
323
+ let l = buffered + length & ~(this.chunkSize - 1);
324
+ if (l > 65536) {
325
+ let i = 65536 - buffered;
326
+ data.copy(mem, buffered, 0, i), exports.update(65536);
327
+ let stop = l - buffered - 65536;
328
+ for(; i < stop;)data.copy(mem, 0, i, i + 65536), exports.update(65536), i += 65536;
329
+ data.copy(mem, 0, i, l - buffered), exports.update(l - buffered - i);
330
+ } else data.copy(mem, buffered, 0, l - buffered), exports.update(l);
331
+ let newBuffered = length + buffered - l;
332
+ this.buffered = newBuffered, newBuffered > 0 && data.copy(mem, 0, length - newBuffered, length);
333
+ }
334
+ }
335
+ digest(type) {
336
+ let { exports, buffered, mem, digestSize } = this;
337
+ exports.final(buffered), this.instancesPool.push(this);
338
+ let hex = mem.toString('latin1', 0, digestSize);
339
+ return 'hex' === type ? hex : 'binary' !== type && type ? Buffer.from(hex, 'hex').toString(type) : Buffer.from(hex, 'hex');
340
+ }
341
+ }
342
+ let wasm_hash = (wasmModule, instancesPool, chunkSize, digestSize)=>{
343
+ if (instancesPool.length > 0) {
344
+ let old = instancesPool.pop();
345
+ return old.reset(), old;
346
+ }
347
+ return new WasmHash(new WebAssembly.Instance(wasmModule), instancesPool, chunkSize, digestSize);
348
+ }, digestCaches = {};
349
+ class BulkUpdateDecorator extends Hash {
350
+ hash;
351
+ hashFactory;
352
+ hashKey;
353
+ buffer;
354
+ constructor(hashOrFactory, hashKey){
355
+ super(), this.hashKey = hashKey, 'function' == typeof hashOrFactory ? (this.hashFactory = hashOrFactory, this.hash = void 0) : (this.hashFactory = void 0, this.hash = hashOrFactory), this.buffer = '';
356
+ }
357
+ update(data, inputEncoding) {
358
+ return void 0 !== inputEncoding || 'string' != typeof data || data.length > 2000 ? (void 0 === this.hash && (this.hash = this.hashFactory()), this.buffer.length > 0 && (this.hash.update(Buffer.from(this.buffer)), this.buffer = ''), Buffer.isBuffer(data) ? this.hash.update(data) : this.hash.update(data, inputEncoding)) : (this.buffer += data, this.buffer.length > 2000 && (void 0 === this.hash && (this.hash = this.hashFactory()), this.hash.update(Buffer.from(this.buffer)), this.buffer = '')), this;
359
+ }
360
+ digest(encoding) {
361
+ let digestCache, buffer = this.buffer;
362
+ if (void 0 === this.hash) {
363
+ let cacheKey = `${this.hashKey}-${encoding}`;
364
+ void 0 === (digestCache = digestCaches[cacheKey]) && (digestCache = digestCaches[cacheKey] = new Map());
365
+ let cacheEntry = digestCache.get(buffer);
366
+ if (void 0 !== cacheEntry) return encoding ? cacheEntry : Buffer.from(cacheEntry, 'hex');
367
+ this.hash = this.hashFactory();
368
+ }
369
+ buffer.length > 0 && this.hash.update(Buffer.from(buffer));
370
+ let result = encoding ? this.hash.digest(encoding) : this.hash.digest();
371
+ return void 0 !== digestCache && 'string' == typeof result && digestCache.set(buffer, result), result;
372
+ }
373
+ }
374
+ class WasmHashAdapter extends Hash {
375
+ wasmHash;
376
+ constructor(wasmHash){
377
+ super(), this.wasmHash = wasmHash;
378
+ }
379
+ update(data, inputEncoding) {
380
+ return Buffer.isBuffer(data) ? this.wasmHash.update(data) : this.wasmHash.update(data, inputEncoding), this;
381
+ }
382
+ digest(encoding) {
383
+ return encoding ? this.wasmHash.digest(encoding) : this.wasmHash.digest();
384
+ }
385
+ }
386
+ let createHash_createHash = (algorithm)=>{
387
+ if ('function' == typeof algorithm) return new BulkUpdateDecorator(()=>new algorithm());
388
+ switch(algorithm){
389
+ case 'xxhash64':
390
+ return new WasmHashAdapter((()=>{
391
+ if (!createXxhash64) {
392
+ let xxhash64 = new WebAssembly.Module(Buffer.from('AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrIIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqAYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEAgAiABNQIAQoeVr6+Ytt6bnn9+hUIXiULP1tO+0ser2UJ+Qvnz3fGZ9pmrFnwhAiABQQRqIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAkIdiCAChUL5893xmfaZqxZ+IgJCIIggAoUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL', 'base64'));
393
+ createXxhash64 = wasm_hash.bind(null, xxhash64, [], 32, 16);
394
+ }
395
+ return createXxhash64();
396
+ })());
397
+ case 'md4':
398
+ return new WasmHashAdapter((()=>{
399
+ if (!createMd4) {
400
+ let md4 = new WebAssembly.Module(Buffer.from('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', 'base64'));
401
+ createMd4 = wasm_hash.bind(null, md4, [], 64, 32);
402
+ }
403
+ return createMd4();
404
+ })());
405
+ case 'native-md4':
406
+ return new BulkUpdateDecorator(()=>{
407
+ let { createHash } = __webpack_require__("node:crypto");
408
+ return createHash('md4');
409
+ }, 'md4');
410
+ default:
411
+ return new BulkUpdateDecorator(()=>{
412
+ let { createHash } = __webpack_require__("node:crypto");
413
+ return createHash(algorithm);
414
+ }, algorithm);
415
+ }
416
+ }, WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/, SEGMENTS_SPLIT_REGEXP = /([|!])/, WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g, relativePathToRequest = (relativePath)=>'' === relativePath ? './.' : '..' === relativePath ? '../.' : relativePath.startsWith('../') ? relativePath : `./${relativePath}`, absoluteToRequest = (context, maybeAbsolutePath)=>{
417
+ if ('/' === maybeAbsolutePath[0]) {
418
+ if (maybeAbsolutePath.length > 1 && '/' === maybeAbsolutePath[maybeAbsolutePath.length - 1]) return maybeAbsolutePath;
419
+ let querySplitPos = maybeAbsolutePath.indexOf('?'), resource = -1 === querySplitPos ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
420
+ return resource = relativePathToRequest(node_path.posix.relative(context, resource)), -1 === querySplitPos ? resource : resource + maybeAbsolutePath.slice(querySplitPos);
421
+ }
422
+ if (WINDOWS_ABS_PATH_REGEXP.test(maybeAbsolutePath)) {
423
+ let querySplitPos = maybeAbsolutePath.indexOf('?'), resource = -1 === querySplitPos ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
424
+ return resource = node_path.win32.relative(context, resource), WINDOWS_ABS_PATH_REGEXP.test(resource) || (resource = relativePathToRequest(resource.replace(WINDOWS_PATH_SEPARATOR_REGEXP, '/'))), -1 === querySplitPos ? resource : resource + maybeAbsolutePath.slice(querySplitPos);
425
+ }
426
+ return maybeAbsolutePath;
427
+ }, makeCacheable = (realFn)=>{
428
+ let cache = new WeakMap(), getCache = (associatedObjectForCache)=>{
429
+ let entry = cache.get(associatedObjectForCache);
430
+ if (void 0 !== entry) return entry;
431
+ let map = new Map();
432
+ return cache.set(associatedObjectForCache, map), map;
433
+ }, fn = (str, associatedObjectForCache)=>{
434
+ if (!associatedObjectForCache) return realFn(str);
435
+ let cache = getCache(associatedObjectForCache), entry = cache.get(str);
436
+ if (void 0 !== entry) return entry;
437
+ let result = realFn(str);
438
+ return cache.set(str, result), result;
439
+ };
440
+ return fn.bindCache = (associatedObjectForCache)=>{
441
+ let cache = getCache(associatedObjectForCache);
442
+ return (str)=>{
443
+ let entry = cache.get(str);
444
+ if (void 0 !== entry) return entry;
445
+ let result = realFn(str);
446
+ return cache.set(str, result), result;
447
+ };
448
+ }, fn;
449
+ }, makeCacheableWithContext = (fn)=>{
450
+ let cache = new WeakMap(), cachedFn = (context, identifier, associatedObjectForCache)=>{
451
+ let cachedResult;
452
+ if (!associatedObjectForCache) return fn(context, identifier);
453
+ let innerCache = cache.get(associatedObjectForCache);
454
+ void 0 === innerCache && (innerCache = new Map(), cache.set(associatedObjectForCache, innerCache));
455
+ let innerSubCache = innerCache.get(context);
456
+ if (void 0 === innerSubCache ? innerCache.set(context, innerSubCache = new Map()) : cachedResult = innerSubCache.get(identifier), void 0 !== cachedResult) return cachedResult;
457
+ let result = fn(context, identifier);
458
+ return innerSubCache.set(identifier, result), result;
459
+ };
460
+ return cachedFn.bindCache = (associatedObjectForCache)=>{
461
+ let innerCache;
462
+ return associatedObjectForCache ? void 0 === (innerCache = cache.get(associatedObjectForCache)) && (innerCache = new Map(), cache.set(associatedObjectForCache, innerCache)) : innerCache = new Map(), (context, identifier)=>{
463
+ let cachedResult, innerSubCache = innerCache?.get(context);
464
+ if (void 0 === innerSubCache ? (innerSubCache = new Map(), innerCache?.set(context, innerSubCache)) : cachedResult = innerSubCache.get(identifier), void 0 !== cachedResult) return cachedResult;
465
+ let result = fn(context, identifier);
466
+ return innerSubCache.set(identifier, result), result;
467
+ };
468
+ }, cachedFn.bindContextCache = (context, associatedObjectForCache)=>{
469
+ let innerSubCache;
470
+ if (associatedObjectForCache) {
471
+ let innerCache = cache.get(associatedObjectForCache);
472
+ void 0 === innerCache && (innerCache = new Map(), cache.set(associatedObjectForCache, innerCache)), void 0 === (innerSubCache = innerCache.get(context)) && innerCache.set(context, innerSubCache = new Map());
473
+ } else innerSubCache = new Map();
474
+ return (identifier)=>{
475
+ let cachedResult = innerSubCache?.get(identifier);
476
+ if (void 0 !== cachedResult) return cachedResult;
477
+ let result = fn(context, identifier);
478
+ return innerSubCache?.set(identifier, result), result;
479
+ };
480
+ }, cachedFn;
481
+ };
482
+ makeCacheableWithContext((context, identifier)=>identifier.split(SEGMENTS_SPLIT_REGEXP).map((str)=>absoluteToRequest(context, str)).join(''));
483
+ let contextify = makeCacheableWithContext((context, request)=>request.split('!').map((r)=>absoluteToRequest(context, r)).join('!')), absolutify = makeCacheableWithContext((context, request)=>request.split('!').map((r)=>r.startsWith('./') || r.startsWith('../') ? node_path.join(context, r) : r).join('!')), PATH_QUERY_FRAGMENT_REGEXP = /^((?:\u200b.|[^?#\u200b])*)(\?(?:\u200b.|[^#\u200b])*)?(#.*)?$/, PATH_QUERY_REGEXP = /^((?:\u200b.|[^?\u200b])*)(\?.*)?$/;
484
+ makeCacheable(function(str) {
485
+ if (!str.includes('?') && !str.includes('#') && !str.includes('\u200b')) return {
486
+ path: str,
487
+ query: '',
488
+ fragment: ''
489
+ };
490
+ let match = PATH_QUERY_FRAGMENT_REGEXP.exec(str);
491
+ return match ? {
492
+ path: match[1].replace(/\u200b(.)/g, '$1'),
493
+ query: match[2] ? match[2].replace(/\u200b(.)/g, '$1') : '',
494
+ fragment: match[3] || ''
495
+ } : {
496
+ path: '',
497
+ query: '',
498
+ fragment: ''
499
+ };
500
+ }), makeCacheable((str)=>{
501
+ let match = PATH_QUERY_REGEXP.exec(str);
502
+ return {
503
+ path: match[1].replace(/\u200b(.)/g, '$1'),
504
+ query: match[2] ? match[2].replace(/\u200b(.)/g, '$1') : ''
505
+ };
506
+ });
507
+ let memoize = (fn)=>{
508
+ let result, cache = !1, callback = fn;
509
+ return ()=>(cache || (result = callback(), cache = !0, callback = void 0), result);
510
+ }, LoaderLoadingError = class extends Error {
511
+ constructor(message){
512
+ super(message), this.name = 'LoaderRunnerError', Error.captureStackTrace(this, this.constructor);
513
+ }
514
+ }, loadLoader_require = createRequire(import.meta.url), moduleCache = new Map(), modulePromiseCache = new Map(), loaderUrlCache = new Map();
515
+ function loadLoader(loader, compiler, callback) {
516
+ let cacheKey = `${loader.type ?? 'commonjs'}\0${loader.path}`, cachedModule = moduleCache.get(cacheKey);
517
+ if (void 0 !== cachedModule) return handleResult(loader, cachedModule, callback);
518
+ if ('module' === loader.type) try {
519
+ let modulePromise = modulePromiseCache.get(cacheKey);
520
+ if (void 0 === modulePromise) {
521
+ void 0 === url && (url = __webpack_require__("node:url"));
522
+ let loaderUrl = loaderUrlCache.get(loader.path);
523
+ void 0 === loaderUrl && (loaderUrl = url.pathToFileURL(loader.path).toString(), loaderUrlCache.set(loader.path, loaderUrl)), modulePromise = import(loaderUrl).then((module)=>(moduleCache.set(cacheKey, module), modulePromiseCache.delete(cacheKey), module), (err)=>{
524
+ throw modulePromiseCache.delete(cacheKey), err;
525
+ }), modulePromiseCache.set(cacheKey, modulePromise);
526
+ }
527
+ modulePromise.then((module)=>{
528
+ handleResult(loader, module, callback);
529
+ }, callback);
530
+ return;
531
+ } catch (e) {
532
+ callback(e);
533
+ }
534
+ else {
535
+ let module;
536
+ try {
537
+ module = loadLoader_require(loader.path);
538
+ } catch (e) {
539
+ if (e instanceof Error && 'EMFILE' === e.code) return void setImmediate(loadLoader.bind(null, loader, compiler, callback));
540
+ return callback(e);
541
+ }
542
+ return handleResult(loader, module, callback);
543
+ }
544
+ }
545
+ function handleResult(loader, module, callback) {
546
+ return 'function' != typeof module && 'object' != typeof module ? callback(new LoaderLoadingError(`Module '${loader.path}' is not a loader (export function or es6 module)`)) : (loader.normal = 'function' == typeof module ? module : module.default, loader.pitch = module.pitch, loader.raw = module.raw, loader.pitch || (loader.noPitch = !0), 'function' != typeof loader.normal && 'function' != typeof loader.pitch) ? callback(new LoaderLoadingError(`Module '${loader.path}' is not a loader (must have normal or pitch function)`)) : void callback();
547
+ }
548
+ function isWorkerResponseMessage(message) {
549
+ return 'response' === message.type;
550
+ }
551
+ function serializeError(error) {
552
+ if (error instanceof Error || error && 'object' == typeof error && 'message' in error) return {
553
+ ...error,
554
+ name: error.name,
555
+ stack: error.stack,
556
+ message: error.message
557
+ };
558
+ if ('string' == typeof error) return {
559
+ name: 'Error',
560
+ message: error
561
+ };
562
+ throw Error('Failed to serialize error, only string, Error instances and objects with a message property are supported');
563
+ }
564
+ let utils_decoder = new TextDecoder();
565
+ promisify(loadLoader);
566
+ let utils_runSyncOrAsync = promisify(function(fn, context, args, callback) {
567
+ let isSync = !0, isDone = !1, isError = !1, reportedError = !1;
568
+ context.async = function() {
569
+ if (isDone) {
570
+ if (reportedError) return;
571
+ throw Error('async(): The callback was already called.');
572
+ }
573
+ return isSync = !1, innerCallback;
574
+ };
575
+ let innerCallback = (err, ...args)=>{
576
+ if (isDone) {
577
+ if (reportedError) return;
578
+ throw Error('callback(): The callback was already called.');
579
+ }
580
+ isDone = !0, isSync = !1;
581
+ try {
582
+ callback(err, args);
583
+ } catch (e) {
584
+ throw isError = !0, e;
585
+ }
586
+ };
587
+ context.callback = innerCallback;
588
+ try {
589
+ let result = fn.apply(context, args);
590
+ if (isSync) {
591
+ if (isDone = !0, void 0 === result) return void callback(null, []);
592
+ if (result && 'object' == typeof result && 'function' == typeof result.then) return void result.then((r)=>{
593
+ callback(null, [
594
+ r
595
+ ]);
596
+ }, callback);
597
+ callback(null, [
598
+ result
599
+ ]);
600
+ return;
601
+ }
602
+ } catch (e) {
603
+ if ('hideStack' in e && e.hideStack && (e.hideStack = 'true'), isError) throw e;
604
+ if (isDone) return void (e instanceof Error ? console.error(e.stack) : console.error(e));
605
+ isDone = !0, reportedError = !0, callback(e, []);
606
+ }
607
+ }), loadLoaderAsync = promisify(loadLoader);
608
+ async function loaderImpl({ args, loaderContext, loaderState }, sendRequest, waitForPendingRequest) {
609
+ let resourcePath = loaderContext.resourcePath, contextDirectory = resourcePath ? function(path) {
610
+ if ('/' === path) return '/';
611
+ let i = path.lastIndexOf('/'), j = path.lastIndexOf('\\'), i2 = path.indexOf('/'), j2 = path.indexOf('\\'), idx = i > j ? i : j, idx2 = i > j ? i2 : j2;
612
+ return idx < 0 ? path : idx === idx2 ? path.slice(0, idx + 1) : path.slice(0, idx);
613
+ }(resourcePath) : null, pendingDependencyRequest = [];
614
+ loaderContext.parallel = !0, loaderContext.dependency = loaderContext.addDependency = function(file) {
615
+ pendingDependencyRequest.push(sendRequest("AddDependency", file));
616
+ }, loaderContext.addContextDependency = function(context) {
617
+ pendingDependencyRequest.push(sendRequest("AddContextDependency", context));
618
+ }, loaderContext.addMissingDependency = function(missing) {
619
+ pendingDependencyRequest.push(sendRequest("AddMissingDependency", missing));
620
+ }, loaderContext.addBuildDependency = function(file) {
621
+ pendingDependencyRequest.push(sendRequest("AddBuildDependency", file));
622
+ }, loaderContext.getDependencies = function() {
623
+ return waitForPendingRequest(pendingDependencyRequest), sendRequest("GetDependencies").wait();
624
+ }, loaderContext.getContextDependencies = function() {
625
+ return waitForPendingRequest(pendingDependencyRequest), sendRequest("GetContextDependencies").wait();
626
+ }, loaderContext.getMissingDependencies = function() {
627
+ return waitForPendingRequest(pendingDependencyRequest), sendRequest("GetMissingDependencies").wait();
628
+ }, loaderContext.clearDependencies = function() {
629
+ pendingDependencyRequest.push(sendRequest("ClearDependencies"));
630
+ };
631
+ let beginDependencyChanges = ()=>sendRequest("BeginDependencyChanges"), mergeDependencyChanges = async ()=>{
632
+ pendingDependencyRequest.length > 0 && (waitForPendingRequest(pendingDependencyRequest), pendingDependencyRequest.length = 0), await sendRequest("MergeDependencyChanges");
633
+ };
634
+ loaderContext.resolve = function(context, request, callback) {
635
+ sendRequest("Resolve", context, request).then(([result, resolveRequest])=>{
636
+ callback(null, result, resolveRequest);
637
+ }, (err)=>{
638
+ callback(err);
639
+ });
640
+ }, loaderContext.getResolve = function(options) {
641
+ return function(context, request, callback) {
642
+ if (!callback) return new Promise((resolve, reject)=>{
643
+ sendRequest("GetResolve", options, context, request).then(([result])=>{
644
+ resolve(result);
645
+ }, (err)=>{
646
+ reject(err);
647
+ });
648
+ });
649
+ sendRequest("GetResolve", options, context, request).then(([result, resolveRequest])=>{
650
+ callback(null, result, resolveRequest);
651
+ }, (err)=>{
652
+ callback(err);
653
+ });
654
+ };
655
+ }, loaderContext.getLogger = function(name) {
656
+ return {
657
+ error (...args) {
658
+ sendRequest("GetLogger", 'error', name, args);
659
+ },
660
+ warn (...args) {
661
+ sendRequest("GetLogger", 'warn', name, args);
662
+ },
663
+ info (...args) {
664
+ sendRequest("GetLogger", 'info', name, args);
665
+ },
666
+ log (...args) {
667
+ sendRequest("GetLogger", 'log', name, args);
668
+ },
669
+ debug (...args) {
670
+ sendRequest("GetLogger", 'debug', name, args);
671
+ },
672
+ assert (assertion, ...args) {
673
+ assertion || sendRequest("GetLogger", 'error', name, args);
674
+ },
675
+ trace () {
676
+ sendRequest("GetLogger", 'trace', name, [
677
+ 'Trace'
678
+ ]);
679
+ },
680
+ clear () {
681
+ sendRequest("GetLogger", 'clear', name, []);
682
+ },
683
+ status (...args) {
684
+ sendRequest("GetLogger", 'status', name, args);
685
+ },
686
+ group (...args) {
687
+ sendRequest("GetLogger", 'group', name, args);
688
+ },
689
+ groupCollapsed (...args) {
690
+ sendRequest("GetLogger", 'groupCollapsed', name, args);
691
+ },
692
+ groupEnd (...args) {
693
+ sendRequest("GetLogger", 'groupEnd', name, args);
694
+ },
695
+ profile (label) {
696
+ sendRequest("GetLogger", 'profile', name, [
697
+ label
698
+ ]);
699
+ },
700
+ profileEnd (label) {
701
+ sendRequest("GetLogger", 'profileEnd', name, [
702
+ label
703
+ ]);
704
+ },
705
+ time (label) {
706
+ sendRequest("GetLogger", 'time', name, [
707
+ label
708
+ ]);
709
+ },
710
+ timeEnd (label) {
711
+ sendRequest("GetLogger", 'timeEnd', name, [
712
+ label
713
+ ]);
714
+ },
715
+ timeLog (label, ...args) {
716
+ sendRequest("GetLogger", 'timeLog', name, [
717
+ label,
718
+ ...args
719
+ ]);
720
+ },
721
+ timeAggregate (label) {
722
+ sendRequest("GetLogger", 'timeAggregate', name, [
723
+ label
724
+ ]);
725
+ },
726
+ timeAggregateEnd (label) {
727
+ sendRequest("GetLogger", 'timeAggregateEnd', name, [
728
+ label
729
+ ]);
730
+ }
731
+ };
732
+ }, loaderContext.emitError = function(err) {
733
+ sendRequest("EmitError", serializeError(err));
734
+ }, loaderContext.emitWarning = function(warning) {
735
+ sendRequest("EmitWarning", serializeError(warning));
736
+ }, loaderContext.emitFile = function(name, content, sourceMap, assetInfo) {
737
+ sendRequest("EmitFile", name, content, sourceMap, assetInfo);
738
+ }, loaderContext.experiments = {
739
+ emitDiagnostic (diagnostic) {
740
+ sendRequest("EmitDiagnostic", diagnostic);
741
+ }
742
+ };
743
+ let getAbsolutify = memoize(()=>absolutify.bindCache({})), getAbsolutifyInContext = memoize(()=>absolutify.bindContextCache(contextDirectory, {})), getContextify = memoize(()=>contextify.bindCache({})), getContextifyInContext = memoize(()=>contextify.bindContextCache(contextDirectory, {}));
744
+ loaderContext.utils = {
745
+ absolutify: (context, request)=>context === contextDirectory ? getAbsolutifyInContext()(request) : getAbsolutify()(context, request),
746
+ contextify: (context, request)=>context === contextDirectory ? getContextifyInContext()(request) : getContextify()(context, request),
747
+ createHash: (type)=>createHash_createHash(type || loaderContext._compilation.outputOptions.hashFunction)
748
+ }, loaderContext._compiler = {
749
+ ...loaderContext._compiler,
750
+ rspack: {
751
+ experiments: {
752
+ swc: swc_namespaceObject
753
+ }
754
+ },
755
+ webpack: {
756
+ util: {
757
+ createHash: createHash_createHash,
758
+ cleverMerge: cleverMerge
759
+ }
760
+ }
761
+ }, loaderContext._compilation = {
762
+ ...loaderContext._compilation,
763
+ getPath: (filename, data = {})=>(data.hash || (data = {
764
+ hash: loaderContext._compilation.hash ?? void 0,
765
+ ...data
766
+ }), sendRequest("CompilationGetPath", 'function' == typeof filename ? filename(data) : filename, data).wait()),
767
+ getPathWithInfo (filename, data = {}) {
768
+ data.hash || (data = {
769
+ hash: loaderContext._compilation.hash ?? void 0,
770
+ ...data
771
+ });
772
+ let info = {}, result = sendRequest("CompilationGetPathWithInfo", 'function' == typeof filename ? filename(data, info) : filename, data, info).wait();
773
+ return Object.assign(info, result.info), {
774
+ path: result.path,
775
+ info
776
+ };
777
+ },
778
+ getAssetPath: (filename, data = {})=>sendRequest("CompilationGetAssetPath", 'function' == typeof filename ? filename(data) : filename, data).wait(),
779
+ getAssetPathWithInfo (filename, data = {}) {
780
+ let info = {}, result = sendRequest("CompilationGetAssetPathWithInfo", 'function' == typeof filename ? filename(data, info) : filename, data, info).wait();
781
+ return Object.assign(info, result.info), {
782
+ path: result.path,
783
+ info
784
+ };
785
+ }
786
+ };
787
+ let _module = loaderContext._module;
788
+ loaderContext._module = {
789
+ type: _module.type,
790
+ identifier: ()=>_module.identifier,
791
+ matchResource: _module.matchResource,
792
+ request: _module.request,
793
+ userRequest: _module.userRequest,
794
+ rawRequest: _module.rawRequest
795
+ }, loaderContext.importModule = function(request, options, callback) {
796
+ if (!callback) return new Promise((resolve, reject)=>{
797
+ sendRequest("ImportModule", request, options).then((result)=>{
798
+ resolve(result);
799
+ }, (err)=>{
800
+ reject(err);
801
+ });
802
+ });
803
+ sendRequest("ImportModule", request, options).then((result)=>{
804
+ callback(null, result);
805
+ }, (err)=>{
806
+ callback(err);
807
+ });
808
+ }, loaderContext.fs = node_fs, Object.defineProperty(loaderContext, 'request', {
809
+ enumerable: !0,
810
+ get: ()=>loaderContext.loaders.map((o)=>o.request).concat(loaderContext.resource || '').join('!')
811
+ }), Object.defineProperty(loaderContext, 'remainingRequest', {
812
+ enumerable: !0,
813
+ get: ()=>loaderContext.loaderIndex >= loaderContext.loaders.length - 1 && !loaderContext.resource ? '' : loaderContext.loaders.slice(loaderContext.loaderIndex + 1).map((o)=>o.request).concat(loaderContext.resource || '').join('!')
814
+ }), Object.defineProperty(loaderContext, 'currentRequest', {
815
+ enumerable: !0,
816
+ get: ()=>loaderContext.loaders.slice(loaderContext.loaderIndex).map((o)=>o.request).concat(loaderContext.resource || '').join('!')
817
+ }), Object.defineProperty(loaderContext, 'previousRequest', {
818
+ enumerable: !0,
819
+ get: ()=>loaderContext.loaders.slice(0, loaderContext.loaderIndex).map((o)=>o.request).join('!')
820
+ }), Object.defineProperty(loaderContext, 'query', {
821
+ enumerable: !0,
822
+ get: ()=>{
823
+ let entry = loaderContext.loaders[loaderContext.loaderIndex];
824
+ return entry.options && 'object' == typeof entry.options ? entry.options : entry.query;
825
+ }
826
+ }), loaderContext.getOptions = function() {
827
+ let loader = function(loaderContext, index = loaderContext.loaderIndex) {
828
+ return loaderContext.loaders?.length && index < loaderContext.loaders.length && index >= 0 && loaderContext.loaders[index] ? loaderContext.loaders[index] : null;
829
+ }(loaderContext), options = loader?.options;
830
+ if ('string' == typeof options) if (options.startsWith('{') && options.endsWith('}')) try {
831
+ options = JSON.parse(options);
832
+ } catch (e) {
833
+ throw Error(`JSON parsing failed for loader's string options: ${e.message}`);
834
+ }
835
+ else options = node_querystring.parse(options);
836
+ return null == options && (options = {}), options;
837
+ }, loaderContext.cacheable = function(flag) {
838
+ !1 === flag && sendRequest("SetCacheable", !1);
839
+ }, Object.defineProperty(loaderContext, 'data', {
840
+ enumerable: !0,
841
+ get: ()=>loaderContext.loaders[loaderContext.loaderIndex].loaderItem.data,
842
+ set: (value)=>{
843
+ loaderContext.loaders[loaderContext.loaderIndex].loaderItem.data = value;
844
+ }
845
+ });
846
+ let shouldYieldToMainThread = (currentLoaderObject)=>!!(!currentLoaderObject?.parallel || currentLoaderObject?.request.startsWith('builtin:'));
847
+ switch(loaderState){
848
+ case binding_namespaceObject.JsLoaderState.Pitching:
849
+ for(; loaderContext.loaderIndex < loaderContext.loaders.length;){
850
+ let currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex];
851
+ if (shouldYieldToMainThread(currentLoaderObject)) break;
852
+ if (currentLoaderObject.pitchExecuted) {
853
+ loaderContext.loaderIndex += 1;
854
+ continue;
855
+ }
856
+ await loadLoaderAsync(currentLoaderObject, loaderContext._compiler);
857
+ let fn = currentLoaderObject.pitch;
858
+ if ((currentLoaderObject.pitchExecuted = !0, fn) && (args = await utils_runSyncOrAsync(fn, loaderContext, [
859
+ loaderContext.remainingRequest,
860
+ loaderContext.previousRequest,
861
+ currentLoaderObject.loaderItem.data
862
+ ]) || []).some((value)=>void 0 !== value)) break;
863
+ }
864
+ break;
865
+ case binding_namespaceObject.JsLoaderState.Normal:
866
+ for(; loaderContext.loaderIndex >= 0;){
867
+ let currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex];
868
+ if (shouldYieldToMainThread(currentLoaderObject)) break;
869
+ if (currentLoaderObject.normalExecuted) {
870
+ loaderContext.loaderIndex--;
871
+ continue;
872
+ }
873
+ let trackDependencies = currentLoaderObject.loaderItem.cache;
874
+ trackDependencies && await beginDependencyChanges();
875
+ try {
876
+ if (currentLoaderObject.loaderItem.cache) {
877
+ waitForPendingRequest(pendingDependencyRequest);
878
+ let hit = await sendRequest("LoaderCacheGet", loaderContext.loaderIndex, args[0], args[2]);
879
+ if (hit) {
880
+ currentLoaderObject.normalExecuted = !0, args = [
881
+ 'string' == typeof hit.content ? hit.content : hit.content && Buffer.from(hit.content),
882
+ hit.sourceMap ? toObject(Buffer.from(hit.sourceMap)) : void 0,
883
+ void 0
884
+ ];
885
+ continue;
886
+ }
887
+ }
888
+ await loadLoaderAsync(currentLoaderObject, loaderContext._compiler);
889
+ let fn = currentLoaderObject.normal;
890
+ if (currentLoaderObject.normalExecuted = !0, !fn) continue;
891
+ !function(args, raw) {
892
+ if (!raw && args[0] instanceof Uint8Array) {
893
+ var buf;
894
+ let isShared, str;
895
+ args[0] = (isShared = (buf = args[0]).buffer instanceof SharedArrayBuffer || buf.buffer.constructor?.name === 'SharedArrayBuffer', str = utils_decoder.decode(isShared ? Buffer.from(buf) : buf), 0xfeff === str.charCodeAt(0) ? str.slice(1) : str);
896
+ } else raw && 'string' == typeof args[0] && (args[0] = Buffer.from(args[0], 'utf-8'));
897
+ raw && args[0] instanceof Uint8Array && !Buffer.isBuffer(args[0]) && (args[0] = Buffer.from(args[0].buffer, args[0].byteOffset, args[0].byteLength));
898
+ }(args, !!currentLoaderObject.raw), args = await utils_runSyncOrAsync(fn, loaderContext, args) || [], currentLoaderObject.loaderItem.cache && (waitForPendingRequest(pendingDependencyRequest), await sendRequest("LoaderCacheStore", loaderContext.loaderIndex, args[0], function(map) {
899
+ if (null != map) return 'string' == typeof map ? map ? Buffer.from(map) : void 0 : Buffer.from(JSON.stringify(map));
900
+ }(args[1]), args[2]));
901
+ } finally{
902
+ trackDependencies && await mergeDependencyChanges();
903
+ }
904
+ }
905
+ }
906
+ return sendRequest("UpdateLoaderObjects", loaderContext.loaders.map((item)=>({
907
+ data: item.loaderItem.data,
908
+ normalExecuted: item.normalExecuted,
909
+ pitchExecuted: item.pitchExecuted
910
+ }))), args;
911
+ }
912
+ let nextId = 0, responseCallbacks = {};
913
+ function handleIncomingResponses(workerMessage) {
914
+ if (isWorkerResponseMessage(workerMessage)) {
915
+ let { id, data } = workerMessage, callback = responseCallbacks[id];
916
+ if (callback) delete responseCallbacks[id], callback(null, data);
917
+ else throw Error(`No callback found for response with id ${id}`);
918
+ } else if ('response-error' === workerMessage.type) {
919
+ let { id, error } = workerMessage, callback = responseCallbacks[id];
920
+ if (callback) delete responseCallbacks[id], callback(error, void 0);
921
+ else throw Error(`No callback found for response with id ${id}`);
922
+ }
923
+ }
924
+ export default function(workerOptions) {
925
+ var workerPort, workerSyncPort, workerPort1, workerSyncPort1;
926
+ let sendRequest, workerData = workerOptions.workerData;
927
+ delete workerOptions.workerData, workerData.workerPort.on('message', handleIncomingResponses);
928
+ let sendRequest1 = (workerPort = workerData.workerPort, workerSyncPort = workerData.workerSyncPort, (sendRequest = (requestType, ...args)=>{
929
+ let id = nextId++;
930
+ workerPort.postMessage({
931
+ type: 'request',
932
+ id,
933
+ requestType,
934
+ data: args
935
+ });
936
+ let result = new Promise((resolve, reject)=>{
937
+ responseCallbacks[id] = (err, data)=>{
938
+ err ? reject(err) : resolve(data);
939
+ };
940
+ });
941
+ return result.wait = ()=>sendRequest.sync("WaitForPendingRequest", id), result.id = id, result;
942
+ }).sync = (workerPort1 = workerPort, workerSyncPort1 = workerSyncPort, (requestType, ...args)=>{
943
+ let id = nextId++, sharedBuffer = new SharedArrayBuffer(8), sharedBufferView = new Int32Array(sharedBuffer);
944
+ workerPort1.postMessage({
945
+ type: 'request-sync',
946
+ id,
947
+ requestType,
948
+ data: args,
949
+ sharedBuffer
950
+ });
951
+ let status = Atomics.wait(sharedBufferView, 0, 0);
952
+ if ('ok' !== status && 'not-equal' !== status) throw Error(`Internal error: Atomics.wait() failed: ${status}`);
953
+ let { message } = receiveMessageOnPort(workerSyncPort1);
954
+ if (id !== message.id) throw Error(`Unexpected response id: ${message.id}, expected: ${id}`);
955
+ if (isWorkerResponseMessage(message)) return message.data;
956
+ throw message.error;
957
+ }), sendRequest), waitFor = (requests)=>sendRequest1.sync("WaitForPendingRequest", (Array.isArray(requests) ? requests : [
958
+ requests
959
+ ]).map((request)=>request.id));
960
+ loaderImpl(workerOptions, sendRequest1, waitFor).then((data)=>{
961
+ workerData.workerPort.postMessage({
962
+ type: 'done',
963
+ data
964
+ });
965
+ }).catch((err)=>{
966
+ workerData.workerPort.postMessage({
967
+ type: 'done-error',
968
+ error: serializeError(err)
969
+ });
970
+ });
971
+ };