@secure-exec/core 0.2.1 → 0.3.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/README.md +5 -5
  2. package/dist/binary.d.ts +4 -0
  3. package/dist/binary.js +25 -0
  4. package/dist/bytes.d.ts +2 -0
  5. package/dist/bytes.js +6 -0
  6. package/dist/callbacks.d.ts +41 -0
  7. package/dist/callbacks.js +94 -0
  8. package/dist/cargo.d.ts +2 -0
  9. package/dist/cargo.js +142 -0
  10. package/dist/correlation.d.ts +10 -0
  11. package/dist/correlation.js +49 -0
  12. package/dist/descriptors.d.ts +34 -0
  13. package/dist/descriptors.js +37 -0
  14. package/dist/event-buffer.d.ts +90 -0
  15. package/dist/event-buffer.js +313 -0
  16. package/dist/ext.d.ts +7 -0
  17. package/dist/ext.js +13 -0
  18. package/dist/filesystem.d.ts +41 -0
  19. package/dist/filesystem.js +70 -0
  20. package/dist/frame-payload-codec.d.ts +8 -0
  21. package/dist/frame-payload-codec.js +14 -0
  22. package/dist/frame-rpc.d.ts +38 -0
  23. package/dist/frame-rpc.js +73 -0
  24. package/dist/frame-stream.d.ts +27 -0
  25. package/dist/frame-stream.js +99 -0
  26. package/dist/framing.d.ts +7 -0
  27. package/dist/framing.js +22 -0
  28. package/dist/generated/AcpLimitsConfig.d.ts +4 -0
  29. package/dist/generated/AcpLimitsConfig.js +2 -0
  30. package/dist/generated/CreateVmConfig.d.ts +19 -0
  31. package/dist/generated/FsPermissionRule.d.ts +6 -0
  32. package/dist/generated/FsPermissionRuleSet.d.ts +6 -0
  33. package/dist/generated/FsPermissionRuleSet.js +1 -0
  34. package/dist/generated/FsPermissionScope.d.ts +3 -0
  35. package/dist/generated/FsPermissionScope.js +1 -0
  36. package/dist/generated/HttpLimitsConfig.d.ts +3 -0
  37. package/dist/generated/HttpLimitsConfig.js +2 -0
  38. package/dist/generated/JsModuleResolution.d.ts +1 -0
  39. package/dist/generated/JsModuleResolution.js +2 -0
  40. package/dist/generated/JsRuntimeConfig.d.ts +26 -0
  41. package/dist/generated/JsRuntimeConfig.js +1 -0
  42. package/dist/generated/JsRuntimeLimitsConfig.d.ts +7 -0
  43. package/dist/generated/JsRuntimeLimitsConfig.js +2 -0
  44. package/dist/generated/JsRuntimePlatform.d.ts +1 -0
  45. package/dist/generated/JsRuntimePlatform.js +2 -0
  46. package/dist/generated/MountPluginDescriptor.d.ts +4 -0
  47. package/dist/generated/MountPluginDescriptor.js +2 -0
  48. package/dist/generated/NativeRootFilesystemConfig.d.ts +5 -0
  49. package/dist/generated/NativeRootFilesystemConfig.js +1 -0
  50. package/dist/generated/PatternPermissionRule.d.ts +6 -0
  51. package/dist/generated/PatternPermissionRule.js +1 -0
  52. package/dist/generated/PatternPermissionRuleSet.d.ts +6 -0
  53. package/dist/generated/PatternPermissionRuleSet.js +1 -0
  54. package/dist/generated/PatternPermissionScope.d.ts +3 -0
  55. package/dist/generated/PatternPermissionScope.js +1 -0
  56. package/dist/generated/PermissionMode.d.ts +1 -0
  57. package/dist/generated/PermissionMode.js +2 -0
  58. package/dist/generated/PermissionsPolicy.d.ts +10 -0
  59. package/dist/generated/PermissionsPolicy.js +1 -0
  60. package/dist/generated/PluginLimitsConfig.d.ts +4 -0
  61. package/dist/generated/PluginLimitsConfig.js +2 -0
  62. package/dist/generated/PythonLimitsConfig.d.ts +5 -0
  63. package/dist/generated/PythonLimitsConfig.js +2 -0
  64. package/dist/generated/ResourceLimitsConfig.d.ts +22 -0
  65. package/dist/generated/ResourceLimitsConfig.js +2 -0
  66. package/dist/generated/RootFilesystemConfig.d.ts +9 -0
  67. package/dist/generated/RootFilesystemConfig.js +1 -0
  68. package/dist/generated/RootFilesystemEntry.d.ts +13 -0
  69. package/dist/generated/RootFilesystemEntry.js +1 -0
  70. package/dist/generated/RootFilesystemEntryEncoding.d.ts +1 -0
  71. package/dist/generated/RootFilesystemEntryEncoding.js +2 -0
  72. package/dist/generated/RootFilesystemEntryKind.d.ts +1 -0
  73. package/dist/generated/RootFilesystemEntryKind.js +2 -0
  74. package/dist/generated/RootFilesystemLowerDescriptor.d.ts +7 -0
  75. package/dist/generated/RootFilesystemLowerDescriptor.js +1 -0
  76. package/dist/generated/RootFilesystemMode.d.ts +1 -0
  77. package/dist/generated/RootFilesystemMode.js +2 -0
  78. package/dist/generated/ToolLimitsConfig.d.ts +10 -0
  79. package/dist/generated/ToolLimitsConfig.js +2 -0
  80. package/dist/generated/VmDnsConfig.d.ts +6 -0
  81. package/dist/generated/VmDnsConfig.js +2 -0
  82. package/dist/generated/VmLimitsConfig.d.ts +18 -0
  83. package/dist/generated/VmLimitsConfig.js +1 -0
  84. package/dist/generated/VmListenPolicyConfig.d.ts +5 -0
  85. package/dist/generated/VmListenPolicyConfig.js +2 -0
  86. package/dist/generated/WasmLimitsConfig.d.ts +5 -0
  87. package/dist/generated/WasmLimitsConfig.js +2 -0
  88. package/dist/generated-protocol.d.ts +1037 -0
  89. package/dist/generated-protocol.js +2887 -0
  90. package/dist/index.d.ts +24 -62
  91. package/dist/index.js +24 -53
  92. package/dist/json.d.ts +2 -0
  93. package/dist/json.js +20 -0
  94. package/dist/kernel-proxy.d.ts +149 -0
  95. package/dist/kernel-proxy.js +1733 -0
  96. package/dist/native-client.d.ts +41 -0
  97. package/dist/native-client.js +124 -0
  98. package/dist/node-runtime.d.ts +490 -0
  99. package/dist/node-runtime.js +585 -0
  100. package/dist/numbers.d.ts +1 -0
  101. package/dist/numbers.js +8 -0
  102. package/dist/ownership.d.ts +18 -0
  103. package/dist/ownership.js +77 -0
  104. package/dist/permissions.d.ts +29 -0
  105. package/dist/permissions.js +68 -0
  106. package/dist/process.d.ts +35 -0
  107. package/dist/process.js +125 -0
  108. package/dist/protocol-client.d.ts +46 -0
  109. package/dist/protocol-client.js +180 -0
  110. package/dist/protocol-frames.d.ts +68 -0
  111. package/dist/protocol-frames.js +139 -0
  112. package/dist/protocol-maps.d.ts +28 -0
  113. package/dist/protocol-maps.js +217 -0
  114. package/dist/protocol-schema.d.ts +10 -0
  115. package/dist/protocol-schema.js +11 -0
  116. package/dist/request-payloads.d.ts +137 -0
  117. package/dist/request-payloads.js +210 -0
  118. package/dist/response-payloads.d.ts +107 -0
  119. package/dist/response-payloads.js +161 -0
  120. package/dist/sidecar-client.d.ts +242 -0
  121. package/dist/sidecar-client.js +797 -0
  122. package/dist/state.d.ts +40 -0
  123. package/dist/state.js +44 -0
  124. package/dist/test-runtime.d.ts +526 -0
  125. package/dist/test-runtime.js +2119 -0
  126. package/dist/vm-config.d.ts +31 -0
  127. package/dist/vm-config.js +1 -0
  128. package/fixtures/alpine-defaults.json +520 -0
  129. package/fixtures/base-filesystem.json +528 -0
  130. package/package.json +193 -115
  131. package/LICENSE +0 -191
  132. package/dist/bridge-setup.d.ts +0 -6
  133. package/dist/bridge-setup.js +0 -9
  134. package/dist/esm-compiler.d.ts +0 -18
  135. package/dist/esm-compiler.js +0 -72
  136. package/dist/fs-helpers.d.ts +0 -23
  137. package/dist/fs-helpers.js +0 -41
  138. package/dist/generated/isolate-runtime.d.ts +0 -19
  139. package/dist/generated/isolate-runtime.js +0 -21
  140. package/dist/generated/polyfills.d.ts +0 -82
  141. package/dist/generated/polyfills.js +0 -82
  142. package/dist/isolate-runtime/apply-custom-global-policy.js +0 -53
  143. package/dist/isolate-runtime/apply-timing-mitigation-freeze.js +0 -130
  144. package/dist/isolate-runtime/apply-timing-mitigation-off.js +0 -14
  145. package/dist/isolate-runtime/bridge-attach.js +0 -29
  146. package/dist/isolate-runtime/bridge-initial-globals.js +0 -385
  147. package/dist/isolate-runtime/eval-script-result.js +0 -8
  148. package/dist/isolate-runtime/global-exposure-helpers.js +0 -36
  149. package/dist/isolate-runtime/init-commonjs-module-globals.js +0 -28
  150. package/dist/isolate-runtime/override-process-cwd.js +0 -8
  151. package/dist/isolate-runtime/override-process-env.js +0 -8
  152. package/dist/isolate-runtime/require-setup.js +0 -4153
  153. package/dist/isolate-runtime/set-commonjs-file-globals.js +0 -36
  154. package/dist/isolate-runtime/set-stdin-data.js +0 -10
  155. package/dist/isolate-runtime/setup-dynamic-import.js +0 -123
  156. package/dist/isolate-runtime/setup-fs-facade.js +0 -87
  157. package/dist/kernel/command-registry.d.ts +0 -44
  158. package/dist/kernel/command-registry.js +0 -114
  159. package/dist/kernel/device-backend.d.ts +0 -14
  160. package/dist/kernel/device-backend.js +0 -251
  161. package/dist/kernel/device-layer.d.ts +0 -12
  162. package/dist/kernel/device-layer.js +0 -271
  163. package/dist/kernel/dns-cache.d.ts +0 -29
  164. package/dist/kernel/dns-cache.js +0 -52
  165. package/dist/kernel/fd-table.d.ts +0 -84
  166. package/dist/kernel/fd-table.js +0 -278
  167. package/dist/kernel/file-lock.d.ts +0 -34
  168. package/dist/kernel/file-lock.js +0 -122
  169. package/dist/kernel/host-adapter.d.ts +0 -50
  170. package/dist/kernel/host-adapter.js +0 -8
  171. package/dist/kernel/index.d.ts +0 -36
  172. package/dist/kernel/index.js +0 -34
  173. package/dist/kernel/kernel.d.ts +0 -9
  174. package/dist/kernel/kernel.js +0 -1415
  175. package/dist/kernel/mount-table.d.ts +0 -75
  176. package/dist/kernel/mount-table.js +0 -353
  177. package/dist/kernel/permissions.d.ts +0 -36
  178. package/dist/kernel/permissions.js +0 -150
  179. package/dist/kernel/pipe-manager.d.ts +0 -64
  180. package/dist/kernel/pipe-manager.js +0 -267
  181. package/dist/kernel/proc-backend.d.ts +0 -30
  182. package/dist/kernel/proc-backend.js +0 -428
  183. package/dist/kernel/proc-layer.d.ts +0 -11
  184. package/dist/kernel/proc-layer.js +0 -507
  185. package/dist/kernel/process-table.d.ts +0 -126
  186. package/dist/kernel/process-table.js +0 -651
  187. package/dist/kernel/pty.d.ts +0 -109
  188. package/dist/kernel/pty.js +0 -552
  189. package/dist/kernel/socket-table.d.ts +0 -312
  190. package/dist/kernel/socket-table.js +0 -1188
  191. package/dist/kernel/timer-table.d.ts +0 -54
  192. package/dist/kernel/timer-table.js +0 -108
  193. package/dist/kernel/types.d.ts +0 -541
  194. package/dist/kernel/types.js +0 -98
  195. package/dist/kernel/user.d.ts +0 -29
  196. package/dist/kernel/user.js +0 -35
  197. package/dist/kernel/vfs.d.ts +0 -82
  198. package/dist/kernel/vfs.js +0 -25
  199. package/dist/kernel/wait.d.ts +0 -45
  200. package/dist/kernel/wait.js +0 -112
  201. package/dist/kernel/wstatus.d.ts +0 -21
  202. package/dist/kernel/wstatus.js +0 -33
  203. package/dist/module-resolver.d.ts +0 -29
  204. package/dist/module-resolver.js +0 -314
  205. package/dist/package-bundler.d.ts +0 -41
  206. package/dist/package-bundler.js +0 -497
  207. package/dist/runtime-driver.d.ts +0 -66
  208. package/dist/shared/api-types.d.ts +0 -83
  209. package/dist/shared/bridge-contract.d.ts +0 -772
  210. package/dist/shared/bridge-contract.js +0 -169
  211. package/dist/shared/console-formatter.d.ts +0 -22
  212. package/dist/shared/console-formatter.js +0 -161
  213. package/dist/shared/constants.d.ts +0 -3
  214. package/dist/shared/constants.js +0 -3
  215. package/dist/shared/errors.d.ts +0 -16
  216. package/dist/shared/errors.js +0 -21
  217. package/dist/shared/esm-utils.d.ts +0 -28
  218. package/dist/shared/esm-utils.js +0 -97
  219. package/dist/shared/global-exposure.d.ts +0 -38
  220. package/dist/shared/global-exposure.js +0 -876
  221. package/dist/shared/in-memory-fs.d.ts +0 -16
  222. package/dist/shared/in-memory-fs.js +0 -115
  223. package/dist/shared/permissions.d.ts +0 -36
  224. package/dist/shared/permissions.js +0 -314
  225. package/dist/shared/require-setup.d.ts +0 -6
  226. package/dist/shared/require-setup.js +0 -9
  227. package/dist/test/block-store-conformance.d.ts +0 -34
  228. package/dist/test/block-store-conformance.js +0 -251
  229. package/dist/test/metadata-store-conformance.d.ts +0 -37
  230. package/dist/test/metadata-store-conformance.js +0 -646
  231. package/dist/test/vfs-conformance.d.ts +0 -65
  232. package/dist/test/vfs-conformance.js +0 -842
  233. package/dist/types.d.ts +0 -98
  234. package/dist/types.js +0 -6
  235. package/dist/vfs/chunked-vfs.d.ts +0 -66
  236. package/dist/vfs/chunked-vfs.js +0 -1290
  237. package/dist/vfs/host-block-store.d.ts +0 -19
  238. package/dist/vfs/host-block-store.js +0 -97
  239. package/dist/vfs/memory-block-store.d.ts +0 -16
  240. package/dist/vfs/memory-block-store.js +0 -45
  241. package/dist/vfs/memory-metadata.d.ts +0 -75
  242. package/dist/vfs/memory-metadata.js +0 -528
  243. package/dist/vfs/sqlite-metadata.d.ts +0 -91
  244. package/dist/vfs/sqlite-metadata.js +0 -582
  245. package/dist/vfs/types.d.ts +0 -210
  246. package/dist/vfs/types.js +0 -8
  247. /package/dist/{runtime-driver.js → generated/CreateVmConfig.js} +0 -0
  248. /package/dist/{shared/api-types.js → generated/FsPermissionRule.js} +0 -0
@@ -1,21 +0,0 @@
1
- // Auto-generated by scripts/build-isolate-runtime.mjs. Do not edit manually.
2
- export const ISOLATE_RUNTIME_SOURCES = {
3
- "applyCustomGlobalPolicy": "\"use strict\";\n(() => {\n // ../core/isolate-runtime/src/common/global-access.ts\n function hasOwnGlobal(name) {\n return Object.prototype.hasOwnProperty.call(globalThis, name);\n }\n function getGlobalValue(name) {\n return Reflect.get(globalThis, name);\n }\n\n // ../core/isolate-runtime/src/common/global-exposure.ts\n function defineRuntimeGlobalBinding(name, value, mutable) {\n Object.defineProperty(globalThis, name, {\n value,\n writable: mutable,\n configurable: mutable,\n enumerable: true\n });\n }\n function createRuntimeGlobalExposer(mutable) {\n return (name, value) => {\n defineRuntimeGlobalBinding(name, value, mutable);\n };\n }\n function getRuntimeExposeCustomGlobal() {\n if (typeof globalThis.__runtimeExposeCustomGlobal === \"function\") {\n return globalThis.__runtimeExposeCustomGlobal;\n }\n return createRuntimeGlobalExposer(false);\n }\n function getRuntimeExposeMutableGlobal() {\n if (typeof globalThis.__runtimeExposeMutableGlobal === \"function\") {\n return globalThis.__runtimeExposeMutableGlobal;\n }\n return createRuntimeGlobalExposer(true);\n }\n\n // ../core/isolate-runtime/src/inject/apply-custom-global-policy.ts\n var __runtimeExposeCustomGlobal = getRuntimeExposeCustomGlobal();\n var __runtimeExposeMutableGlobal = getRuntimeExposeMutableGlobal();\n var __globalPolicy = globalThis.__runtimeCustomGlobalPolicy ?? {};\n var __hardenedGlobals = Array.isArray(__globalPolicy.hardenedGlobals) ? __globalPolicy.hardenedGlobals : [];\n var __mutableGlobals = Array.isArray(__globalPolicy.mutableGlobals) ? __globalPolicy.mutableGlobals : [];\n for (const globalName of __hardenedGlobals) {\n const value = hasOwnGlobal(globalName) ? getGlobalValue(globalName) : void 0;\n __runtimeExposeCustomGlobal(globalName, value);\n }\n for (const globalName of __mutableGlobals) {\n if (hasOwnGlobal(globalName)) {\n __runtimeExposeMutableGlobal(globalName, getGlobalValue(globalName));\n }\n }\n})();\n",
4
- "applyTimingMitigationFreeze": "\"use strict\";\n(() => {\n // ../core/isolate-runtime/src/common/global-access.ts\n function setGlobalValue(name, value) {\n Reflect.set(globalThis, name, value);\n }\n\n // ../core/isolate-runtime/src/inject/apply-timing-mitigation-freeze.ts\n var __timingConfig = globalThis.__runtimeTimingMitigationConfig ?? {};\n var __frozenTimeMs = typeof __timingConfig.frozenTimeMs === \"number\" && Number.isFinite(__timingConfig.frozenTimeMs) ? __timingConfig.frozenTimeMs : Date.now();\n var __frozenDateNow = () => __frozenTimeMs;\n try {\n Object.defineProperty(Date, \"now\", {\n get: () => __frozenDateNow,\n set: () => {\n },\n configurable: false\n });\n } catch {\n Date.now = __frozenDateNow;\n }\n var __OrigDate = Date;\n var __FrozenDate = function Date2(...args) {\n if (new.target) {\n if (args.length === 0) {\n return new __OrigDate(__frozenTimeMs);\n }\n return new __OrigDate(...args);\n }\n return __OrigDate();\n };\n Object.defineProperty(__FrozenDate, \"prototype\", {\n value: __OrigDate.prototype,\n writable: false,\n configurable: false\n });\n __FrozenDate.now = __frozenDateNow;\n __FrozenDate.parse = __OrigDate.parse;\n __FrozenDate.UTC = __OrigDate.UTC;\n Object.defineProperty(__FrozenDate, \"now\", {\n get: () => __frozenDateNow,\n set: () => {\n },\n configurable: false\n });\n try {\n Object.defineProperty(globalThis, \"Date\", {\n value: __FrozenDate,\n configurable: false,\n writable: false\n });\n } catch {\n globalThis.Date = __FrozenDate;\n }\n var __frozenPerformanceNow = () => 0;\n var __origPerf = globalThis.performance;\n var __frozenPerf = /* @__PURE__ */ Object.create(null);\n if (typeof __origPerf !== \"undefined\" && __origPerf !== null) {\n const src = __origPerf;\n for (const key of Object.getOwnPropertyNames(\n Object.getPrototypeOf(__origPerf) ?? __origPerf\n )) {\n if (key !== \"now\") {\n try {\n const val = src[key];\n if (typeof val === \"function\") {\n __frozenPerf[key] = val.bind(__origPerf);\n } else {\n __frozenPerf[key] = val;\n }\n } catch {\n }\n }\n }\n }\n Object.defineProperty(__frozenPerf, \"now\", {\n value: __frozenPerformanceNow,\n configurable: false,\n writable: false\n });\n Object.freeze(__frozenPerf);\n try {\n Object.defineProperty(globalThis, \"performance\", {\n value: __frozenPerf,\n configurable: false,\n writable: false\n });\n } catch {\n globalThis.performance = __frozenPerf;\n }\n var __OrigSAB = globalThis.SharedArrayBuffer;\n if (typeof __OrigSAB === \"function\") {\n try {\n const proto = __OrigSAB.prototype;\n if (proto) {\n for (const key of [\n \"byteLength\",\n \"slice\",\n \"grow\",\n \"maxByteLength\",\n \"growable\"\n ]) {\n try {\n Object.defineProperty(proto, key, {\n get() {\n throw new TypeError(\n \"SharedArrayBuffer is not available in sandbox\"\n );\n },\n configurable: false\n });\n } catch {\n }\n }\n }\n } catch {\n }\n }\n try {\n Object.defineProperty(globalThis, \"SharedArrayBuffer\", {\n value: void 0,\n configurable: false,\n writable: false,\n enumerable: false\n });\n } catch {\n Reflect.deleteProperty(globalThis, \"SharedArrayBuffer\");\n setGlobalValue(\"SharedArrayBuffer\", void 0);\n }\n})();\n",
5
- "applyTimingMitigationOff": "\"use strict\";\n(() => {\n // ../core/isolate-runtime/src/common/global-access.ts\n function setGlobalValue(name, value) {\n Reflect.set(globalThis, name, value);\n }\n\n // ../core/isolate-runtime/src/inject/apply-timing-mitigation-off.ts\n if (typeof globalThis.performance === \"undefined\" || globalThis.performance === null) {\n setGlobalValue(\"performance\", {\n now: () => Date.now()\n });\n }\n})();\n",
6
- "bridgeAttach": "\"use strict\";\n(() => {\n // ../core/isolate-runtime/src/common/global-exposure.ts\n function defineRuntimeGlobalBinding(name, value, mutable) {\n Object.defineProperty(globalThis, name, {\n value,\n writable: mutable,\n configurable: mutable,\n enumerable: true\n });\n }\n function createRuntimeGlobalExposer(mutable) {\n return (name, value) => {\n defineRuntimeGlobalBinding(name, value, mutable);\n };\n }\n function getRuntimeExposeCustomGlobal() {\n if (typeof globalThis.__runtimeExposeCustomGlobal === \"function\") {\n return globalThis.__runtimeExposeCustomGlobal;\n }\n return createRuntimeGlobalExposer(false);\n }\n\n // ../core/isolate-runtime/src/inject/bridge-attach.ts\n var __runtimeExposeCustomGlobal = getRuntimeExposeCustomGlobal();\n if (typeof globalThis.bridge !== \"undefined\") {\n __runtimeExposeCustomGlobal(\"bridge\", globalThis.bridge);\n }\n})();\n",
7
- "bridgeInitialGlobals": "\"use strict\";\n(() => {\n // ../core/isolate-runtime/src/common/global-exposure.ts\n function defineRuntimeGlobalBinding(name, value, mutable) {\n Object.defineProperty(globalThis, name, {\n value,\n writable: mutable,\n configurable: mutable,\n enumerable: true\n });\n }\n function createRuntimeGlobalExposer(mutable) {\n return (name, value) => {\n defineRuntimeGlobalBinding(name, value, mutable);\n };\n }\n function getRuntimeExposeMutableGlobal() {\n if (typeof globalThis.__runtimeExposeMutableGlobal === \"function\") {\n return globalThis.__runtimeExposeMutableGlobal;\n }\n return createRuntimeGlobalExposer(true);\n }\n\n // ../core/isolate-runtime/src/common/global-access.ts\n function setGlobalValue(name, value) {\n Reflect.set(globalThis, name, value);\n }\n\n // ../core/isolate-runtime/src/inject/bridge-initial-globals.ts\n var __runtimeExposeMutableGlobal = getRuntimeExposeMutableGlobal();\n var __bridgeSetupConfig = globalThis.__runtimeBridgeSetupConfig ?? {};\n var __initialCwd = typeof __bridgeSetupConfig.initialCwd === \"string\" ? __bridgeSetupConfig.initialCwd : \"/\";\n globalThis.__runtimeJsonPayloadLimitBytes = typeof __bridgeSetupConfig.jsonPayloadLimitBytes === \"number\" && Number.isFinite(__bridgeSetupConfig.jsonPayloadLimitBytes) ? Math.max(0, Math.floor(__bridgeSetupConfig.jsonPayloadLimitBytes)) : 4 * 1024 * 1024;\n globalThis.__runtimePayloadLimitErrorCode = typeof __bridgeSetupConfig.payloadLimitErrorCode === \"string\" && __bridgeSetupConfig.payloadLimitErrorCode.length > 0 ? __bridgeSetupConfig.payloadLimitErrorCode : \"ERR_SANDBOX_PAYLOAD_TOO_LARGE\";\n function __scEncode(value, seen) {\n if (value === null) return null;\n if (value === void 0) return { t: \"undef\" };\n if (typeof value === \"boolean\") return value;\n if (typeof value === \"string\") return value;\n if (typeof value === \"bigint\") return { t: \"bigint\", v: String(value) };\n if (typeof value === \"number\") {\n if (Object.is(value, -0)) return { t: \"-0\" };\n if (Number.isNaN(value)) return { t: \"nan\" };\n if (value === Infinity) return { t: \"inf\" };\n if (value === -Infinity) return { t: \"-inf\" };\n return value;\n }\n const obj = value;\n if (seen.has(obj)) return { t: \"ref\", i: seen.get(obj) };\n const idx = seen.size;\n seen.set(obj, idx);\n if (value instanceof Date)\n return { t: \"date\", v: value.getTime() };\n if (value instanceof RegExp)\n return { t: \"regexp\", p: value.source, f: value.flags };\n if (value instanceof Map) {\n const entries = [];\n value.forEach((v, k) => {\n entries.push([__scEncode(k, seen), __scEncode(v, seen)]);\n });\n return { t: \"map\", v: entries };\n }\n if (value instanceof Set) {\n const elems = [];\n value.forEach((v) => {\n elems.push(__scEncode(v, seen));\n });\n return { t: \"set\", v: elems };\n }\n if (value instanceof ArrayBuffer) {\n return { t: \"ab\", v: Array.from(new Uint8Array(value)) };\n }\n if (ArrayBuffer.isView(value) && !(value instanceof DataView)) {\n return {\n t: \"ta\",\n k: value.constructor.name,\n v: Array.from(\n new Uint8Array(value.buffer, value.byteOffset, value.byteLength)\n )\n };\n }\n if (Array.isArray(value)) {\n return {\n t: \"arr\",\n v: value.map((v) => __scEncode(v, seen))\n };\n }\n const result = {};\n for (const key of Object.keys(value)) {\n result[key] = __scEncode(\n value[key],\n seen\n );\n }\n return { t: \"obj\", v: result };\n }\n function __scDecode(tagged, refs) {\n if (tagged === null) return null;\n if (typeof tagged === \"boolean\" || typeof tagged === \"string\" || typeof tagged === \"number\")\n return tagged;\n const tag = tagged.t;\n if (tag === void 0) return tagged;\n switch (tag) {\n case \"undef\":\n return void 0;\n case \"nan\":\n return NaN;\n case \"inf\":\n return Infinity;\n case \"-inf\":\n return -Infinity;\n case \"-0\":\n return -0;\n case \"bigint\":\n return BigInt(tagged.v);\n case \"ref\":\n return refs[tagged.i];\n case \"date\": {\n const d = new Date(tagged.v);\n refs.push(d);\n return d;\n }\n case \"regexp\": {\n const r = new RegExp(\n tagged.p,\n tagged.f\n );\n refs.push(r);\n return r;\n }\n case \"map\": {\n const m = /* @__PURE__ */ new Map();\n refs.push(m);\n for (const [k, v] of tagged.v) {\n m.set(__scDecode(k, refs), __scDecode(v, refs));\n }\n return m;\n }\n case \"set\": {\n const s = /* @__PURE__ */ new Set();\n refs.push(s);\n for (const v of tagged.v) {\n s.add(__scDecode(v, refs));\n }\n return s;\n }\n case \"ab\": {\n const bytes = tagged.v;\n const ab = new ArrayBuffer(bytes.length);\n const u8 = new Uint8Array(ab);\n for (let i = 0; i < bytes.length; i++) u8[i] = bytes[i];\n refs.push(ab);\n return ab;\n }\n case \"ta\": {\n const { k, v: bytes } = tagged;\n const ctors = {\n Int8Array,\n Uint8Array,\n Uint8ClampedArray,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array\n };\n const Ctor = ctors[k] ?? Uint8Array;\n const ab = new ArrayBuffer(bytes.length);\n const u8 = new Uint8Array(ab);\n for (let i = 0; i < bytes.length; i++) u8[i] = bytes[i];\n const ta = new Ctor(ab);\n refs.push(ta);\n return ta;\n }\n case \"arr\": {\n const arr = [];\n refs.push(arr);\n for (const v of tagged.v) {\n arr.push(__scDecode(v, refs));\n }\n return arr;\n }\n case \"obj\": {\n const obj = {};\n refs.push(obj);\n const entries = tagged.v;\n for (const key of Object.keys(entries)) {\n obj[key] = __scDecode(entries[key], refs);\n }\n return obj;\n }\n default:\n return tagged;\n }\n }\n __runtimeExposeMutableGlobal(\"_moduleCache\", {});\n globalThis._moduleCache = globalThis._moduleCache ?? {};\n var __moduleCache = globalThis._moduleCache;\n if (__moduleCache) {\n __moduleCache[\"v8\"] = {\n getHeapStatistics: function() {\n return {\n total_heap_size: 67108864,\n total_heap_size_executable: 1048576,\n total_physical_size: 67108864,\n total_available_size: 67108864,\n used_heap_size: 52428800,\n heap_size_limit: 134217728,\n malloced_memory: 8192,\n peak_malloced_memory: 16384,\n does_zap_garbage: 0,\n number_of_native_contexts: 1,\n number_of_detached_contexts: 0,\n external_memory: 0\n };\n },\n getHeapSpaceStatistics: function() {\n return [];\n },\n getHeapCodeStatistics: function() {\n return {};\n },\n setFlagsFromString: function() {\n },\n serialize: function(value) {\n return Buffer.from(\n JSON.stringify({ $v8sc: 1, d: __scEncode(value, /* @__PURE__ */ new Map()) })\n );\n },\n deserialize: function(buffer) {\n const limit = globalThis.__runtimeJsonPayloadLimitBytes ?? 4 * 1024 * 1024;\n const errorCode = globalThis.__runtimePayloadLimitErrorCode ?? \"ERR_SANDBOX_PAYLOAD_TOO_LARGE\";\n if (buffer.length > limit) {\n throw new Error(\n errorCode + \": v8.deserialize exceeds \" + String(limit) + \" bytes\"\n );\n }\n const text = buffer.toString();\n const envelope = JSON.parse(text);\n if (envelope !== null && typeof envelope === \"object\" && envelope.$v8sc === 1) {\n return __scDecode(envelope.d, []);\n }\n return envelope;\n },\n cachedDataVersionTag: function() {\n return 0;\n }\n };\n }\n __runtimeExposeMutableGlobal(\"_pendingModules\", {});\n __runtimeExposeMutableGlobal(\"_currentModule\", { dirname: __initialCwd });\n globalThis.__runtimeApplyConfig = function(config) {\n if (typeof config.payloadLimitBytes === \"number\" && Number.isFinite(config.payloadLimitBytes)) {\n globalThis.__runtimeJsonPayloadLimitBytes = Math.max(\n 0,\n Math.floor(config.payloadLimitBytes)\n );\n }\n if (typeof config.payloadLimitErrorCode === \"string\" && config.payloadLimitErrorCode.length > 0) {\n globalThis.__runtimePayloadLimitErrorCode = config.payloadLimitErrorCode;\n }\n if (config.timingMitigation === \"freeze\") {\n const frozenTimeMs = typeof config.frozenTimeMs === \"number\" && Number.isFinite(config.frozenTimeMs) ? config.frozenTimeMs : Date.now();\n const frozenDateNow = () => frozenTimeMs;\n try {\n Object.defineProperty(Date, \"now\", {\n value: frozenDateNow,\n configurable: false,\n writable: false\n });\n } catch {\n Date.now = frozenDateNow;\n }\n const OrigDate = Date;\n const FrozenDate = function Date2(...args) {\n if (new.target) {\n if (args.length === 0) {\n return new OrigDate(frozenTimeMs);\n }\n return new OrigDate(...args);\n }\n return OrigDate();\n };\n Object.defineProperty(FrozenDate, \"prototype\", {\n value: OrigDate.prototype,\n writable: false,\n configurable: false\n });\n FrozenDate.now = frozenDateNow;\n FrozenDate.parse = OrigDate.parse;\n FrozenDate.UTC = OrigDate.UTC;\n Object.defineProperty(FrozenDate, \"now\", {\n value: frozenDateNow,\n configurable: false,\n writable: false\n });\n try {\n Object.defineProperty(globalThis, \"Date\", {\n value: FrozenDate,\n configurable: false,\n writable: false\n });\n } catch {\n globalThis.Date = FrozenDate;\n }\n const frozenPerformanceNow = () => 0;\n const origPerf = globalThis.performance;\n const frozenPerf = /* @__PURE__ */ Object.create(null);\n if (typeof origPerf !== \"undefined\" && origPerf !== null) {\n const src = origPerf;\n for (const key of Object.getOwnPropertyNames(\n Object.getPrototypeOf(origPerf) ?? origPerf\n )) {\n if (key !== \"now\") {\n try {\n const val = src[key];\n if (typeof val === \"function\") {\n frozenPerf[key] = val.bind(origPerf);\n } else {\n frozenPerf[key] = val;\n }\n } catch {\n }\n }\n }\n }\n Object.defineProperty(frozenPerf, \"now\", {\n value: frozenPerformanceNow,\n configurable: false,\n writable: false\n });\n Object.freeze(frozenPerf);\n try {\n Object.defineProperty(globalThis, \"performance\", {\n value: frozenPerf,\n configurable: false,\n writable: false\n });\n } catch {\n globalThis.performance = frozenPerf;\n }\n const OrigSAB = globalThis.SharedArrayBuffer;\n if (typeof OrigSAB === \"function\") {\n try {\n const proto = OrigSAB.prototype;\n if (proto) {\n for (const key of [\n \"byteLength\",\n \"slice\",\n \"grow\",\n \"maxByteLength\",\n \"growable\"\n ]) {\n try {\n Object.defineProperty(proto, key, {\n get() {\n throw new TypeError(\n \"SharedArrayBuffer is not available in sandbox\"\n );\n },\n configurable: false\n });\n } catch {\n }\n }\n }\n } catch {\n }\n }\n try {\n Object.defineProperty(globalThis, \"SharedArrayBuffer\", {\n value: void 0,\n configurable: false,\n writable: false,\n enumerable: false\n });\n } catch {\n Reflect.deleteProperty(globalThis, \"SharedArrayBuffer\");\n setGlobalValue(\"SharedArrayBuffer\", void 0);\n }\n }\n delete globalThis.__runtimeApplyConfig;\n };\n})();\n",
8
- "evalScriptResult": "\"use strict\";\n(() => {\n // ../core/isolate-runtime/src/inject/eval-script-result.ts\n var __runtimeIndirectEval = globalThis.eval;\n globalThis.__scriptResult__ = __runtimeIndirectEval(\n String(globalThis.__runtimeExecCode)\n );\n})();\n",
9
- "globalExposureHelpers": "\"use strict\";\n(() => {\n // ../core/isolate-runtime/src/common/global-exposure.ts\n function defineRuntimeGlobalBinding(name, value, mutable) {\n Object.defineProperty(globalThis, name, {\n value,\n writable: mutable,\n configurable: mutable,\n enumerable: true\n });\n }\n function createRuntimeGlobalExposer(mutable) {\n return (name, value) => {\n defineRuntimeGlobalBinding(name, value, mutable);\n };\n }\n function ensureRuntimeExposureHelpers() {\n if (typeof globalThis.__runtimeExposeCustomGlobal !== \"function\") {\n defineRuntimeGlobalBinding(\n \"__runtimeExposeCustomGlobal\",\n createRuntimeGlobalExposer(false),\n false\n );\n }\n if (typeof globalThis.__runtimeExposeMutableGlobal !== \"function\") {\n defineRuntimeGlobalBinding(\n \"__runtimeExposeMutableGlobal\",\n createRuntimeGlobalExposer(true),\n false\n );\n }\n }\n\n // ../core/isolate-runtime/src/inject/global-exposure-helpers.ts\n ensureRuntimeExposureHelpers();\n})();\n",
10
- "initCommonjsModuleGlobals": "\"use strict\";\n(() => {\n // ../core/isolate-runtime/src/common/global-exposure.ts\n function defineRuntimeGlobalBinding(name, value, mutable) {\n Object.defineProperty(globalThis, name, {\n value,\n writable: mutable,\n configurable: mutable,\n enumerable: true\n });\n }\n function createRuntimeGlobalExposer(mutable) {\n return (name, value) => {\n defineRuntimeGlobalBinding(name, value, mutable);\n };\n }\n function getRuntimeExposeMutableGlobal() {\n if (typeof globalThis.__runtimeExposeMutableGlobal === \"function\") {\n return globalThis.__runtimeExposeMutableGlobal;\n }\n return createRuntimeGlobalExposer(true);\n }\n\n // ../core/isolate-runtime/src/inject/init-commonjs-module-globals.ts\n var __runtimeExposeMutableGlobal = getRuntimeExposeMutableGlobal();\n __runtimeExposeMutableGlobal(\"module\", { exports: {} });\n __runtimeExposeMutableGlobal(\"exports\", globalThis.module.exports);\n})();\n",
11
- "overrideProcessCwd": "\"use strict\";\n(() => {\n // ../core/isolate-runtime/src/inject/override-process-cwd.ts\n var __cwd = globalThis.__runtimeProcessCwdOverride;\n if (typeof __cwd === \"string\") {\n process.cwd = () => __cwd;\n }\n})();\n",
12
- "overrideProcessEnv": "\"use strict\";\n(() => {\n // ../core/isolate-runtime/src/inject/override-process-env.ts\n var __envPatch = globalThis.__runtimeProcessEnvOverride;\n if (__envPatch && typeof __envPatch === \"object\") {\n Object.assign(process.env, __envPatch);\n }\n})();\n",
13
- "requireSetup": "\"use strict\";\n(() => {\n // ../core/isolate-runtime/src/inject/require-setup.ts\n var REQUIRE_TRANSFORM_MARKER = \"/*__secure_exec_require_esm__*/\";\n var __requireExposeCustomGlobal = typeof globalThis.__runtimeExposeCustomGlobal === \"function\" ? globalThis.__runtimeExposeCustomGlobal : function exposeCustomGlobal(name, value) {\n Object.defineProperty(globalThis, name, {\n value,\n writable: false,\n configurable: false,\n enumerable: true\n });\n };\n if (typeof globalThis.global === \"undefined\") {\n globalThis.global = globalThis;\n }\n if (typeof globalThis.RegExp === \"function\" && !globalThis.RegExp.__secureExecRgiEmojiCompat) {\n const NativeRegExp = globalThis.RegExp;\n const RGI_EMOJI_PATTERN = \"^\\\\p{RGI_Emoji}$\";\n const RGI_EMOJI_BASE_CLASS = \"[\\\\u{00A9}\\\\u{00AE}\\\\u{203C}\\\\u{2049}\\\\u{2122}\\\\u{2139}\\\\u{2194}-\\\\u{21AA}\\\\u{231A}-\\\\u{23FF}\\\\u{24C2}\\\\u{25AA}-\\\\u{27BF}\\\\u{2934}-\\\\u{2935}\\\\u{2B05}-\\\\u{2B55}\\\\u{3030}\\\\u{303D}\\\\u{3297}\\\\u{3299}\\\\u{1F000}-\\\\u{1FAFF}]\";\n const RGI_EMOJI_KEYCAP = \"[#*0-9]\\\\uFE0F?\\\\u20E3\";\n const RGI_EMOJI_FALLBACK_SOURCE = \"^(?:\" + RGI_EMOJI_KEYCAP + \"|\\\\p{Regional_Indicator}{2}|\" + RGI_EMOJI_BASE_CLASS + \"(?:\\\\uFE0F|\\\\u200D(?:\" + RGI_EMOJI_KEYCAP + \"|\" + RGI_EMOJI_BASE_CLASS + \")|[\\\\u{1F3FB}-\\\\u{1F3FF}])*)$\";\n try {\n new NativeRegExp(RGI_EMOJI_PATTERN, \"v\");\n } catch (error) {\n if (String(error && error.message || error).includes(\"RGI_Emoji\")) {\n let CompatRegExp = function(pattern, flags) {\n const normalizedPattern = pattern instanceof NativeRegExp && flags === void 0 ? pattern.source : String(pattern);\n const normalizedFlags = flags === void 0 ? pattern instanceof NativeRegExp ? pattern.flags : \"\" : String(flags);\n try {\n return new NativeRegExp(pattern, flags);\n } catch (innerError) {\n if (normalizedPattern === RGI_EMOJI_PATTERN && normalizedFlags === \"v\") {\n return new NativeRegExp(RGI_EMOJI_FALLBACK_SOURCE, \"u\");\n }\n throw innerError;\n }\n };\n CompatRegExp2 = CompatRegExp;\n Object.setPrototypeOf(CompatRegExp, NativeRegExp);\n CompatRegExp.prototype = NativeRegExp.prototype;\n Object.defineProperty(CompatRegExp.prototype, \"constructor\", {\n value: CompatRegExp,\n writable: true,\n configurable: true\n });\n CompatRegExp.__secureExecRgiEmojiCompat = true;\n globalThis.RegExp = CompatRegExp;\n }\n }\n }\n var CompatRegExp2;\n if (typeof globalThis.AbortController === \"undefined\" || typeof globalThis.AbortSignal === \"undefined\" || typeof globalThis.AbortSignal?.prototype?.addEventListener !== \"function\" || typeof globalThis.AbortSignal?.prototype?.removeEventListener !== \"function\") {\n let getAbortSignalState = function(signal) {\n const state = abortSignalState.get(signal);\n if (!state) {\n throw new Error(\"Invalid AbortSignal\");\n }\n return state;\n };\n getAbortSignalState2 = getAbortSignalState;\n const abortSignalState = /* @__PURE__ */ new WeakMap();\n class AbortSignal {\n constructor() {\n this.onabort = null;\n abortSignalState.set(this, {\n aborted: false,\n reason: void 0,\n listeners: []\n });\n }\n get aborted() {\n return getAbortSignalState(this).aborted;\n }\n get reason() {\n return getAbortSignalState(this).reason;\n }\n get _listeners() {\n return getAbortSignalState(this).listeners.slice();\n }\n getEventListeners(type) {\n if (type !== \"abort\") return [];\n return getAbortSignalState(this).listeners.slice();\n }\n addEventListener(type, listener) {\n if (type !== \"abort\" || typeof listener !== \"function\") return;\n getAbortSignalState(this).listeners.push(listener);\n }\n removeEventListener(type, listener) {\n if (type !== \"abort\" || typeof listener !== \"function\") return;\n const listeners = getAbortSignalState(this).listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n }\n dispatchEvent(event) {\n if (!event || event.type !== \"abort\") return false;\n if (typeof this.onabort === \"function\") {\n try {\n this.onabort.call(this, event);\n } catch {\n }\n }\n const listeners = getAbortSignalState(this).listeners.slice();\n for (const listener of listeners) {\n try {\n listener.call(this, event);\n } catch {\n }\n }\n return true;\n }\n }\n class AbortController {\n constructor() {\n this.signal = new AbortSignal();\n }\n abort(reason) {\n const state = getAbortSignalState(this.signal);\n if (state.aborted) return;\n state.aborted = true;\n state.reason = reason;\n this.signal.dispatchEvent({ type: \"abort\" });\n }\n }\n __requireExposeCustomGlobal(\"AbortSignal\", AbortSignal);\n __requireExposeCustomGlobal(\"AbortController\", AbortController);\n }\n var getAbortSignalState2;\n if (typeof globalThis.AbortSignal === \"function\" && typeof globalThis.AbortController === \"function\" && typeof globalThis.AbortSignal.abort !== \"function\") {\n globalThis.AbortSignal.abort = function abort(reason) {\n const controller = new globalThis.AbortController();\n controller.abort(reason);\n return controller.signal;\n };\n }\n if (typeof globalThis.AbortSignal === \"function\" && typeof globalThis.AbortController === \"function\" && typeof globalThis.AbortSignal.timeout !== \"function\") {\n globalThis.AbortSignal.timeout = function timeout(milliseconds) {\n var delay = Number(milliseconds);\n if (!Number.isFinite(delay) || delay < 0) {\n throw new RangeError('The value of \"milliseconds\" is out of range. It must be a finite, non-negative number.');\n }\n var controller = new globalThis.AbortController();\n var timer = setTimeout(function() {\n controller.abort(\n new globalThis.DOMException(\n \"The operation was aborted due to timeout\",\n \"TimeoutError\"\n )\n );\n }, delay);\n if (timer && typeof timer.unref === \"function\") {\n timer.unref();\n }\n return controller.signal;\n };\n }\n if (typeof globalThis.AbortSignal === \"function\" && typeof globalThis.AbortController === \"function\" && typeof globalThis.AbortSignal.any !== \"function\") {\n globalThis.AbortSignal.any = function any(signals) {\n if (signals === null || signals === void 0 || typeof signals[Symbol.iterator] !== \"function\") {\n throw new TypeError('The \"signals\" argument must be an iterable.');\n }\n var controller = new globalThis.AbortController();\n var cleanup = [];\n var abortFromSignal = function abortFromSignal2(signal) {\n for (var index = 0; index < cleanup.length; index += 1) {\n cleanup[index]();\n }\n cleanup.length = 0;\n controller.abort(signal.reason);\n };\n for (const signal of signals) {\n if (!signal || typeof signal.aborted !== \"boolean\" || typeof signal.addEventListener !== \"function\" || typeof signal.removeEventListener !== \"function\") {\n throw new TypeError('The \"signals\" argument must contain only AbortSignal instances.');\n }\n if (signal.aborted) {\n abortFromSignal(signal);\n break;\n }\n var listener = function() {\n abortFromSignal(signal);\n };\n signal.addEventListener(\"abort\", listener, { once: true });\n cleanup.push(function() {\n signal.removeEventListener(\"abort\", listener);\n });\n }\n return controller.signal;\n };\n }\n if (typeof globalThis.structuredClone !== \"function\") {\n let structuredClonePolyfill = function(value) {\n if (value === null || typeof value !== \"object\") {\n return value;\n }\n if (value instanceof ArrayBuffer) {\n return value.slice(0);\n }\n if (ArrayBuffer.isView(value)) {\n if (value instanceof Uint8Array) {\n return new Uint8Array(value);\n }\n return new value.constructor(value);\n }\n return JSON.parse(JSON.stringify(value));\n };\n structuredClonePolyfill2 = structuredClonePolyfill;\n __requireExposeCustomGlobal(\"structuredClone\", structuredClonePolyfill);\n }\n var structuredClonePolyfill2;\n if (typeof globalThis.SharedArrayBuffer === \"undefined\") {\n globalThis.SharedArrayBuffer = ArrayBuffer;\n __requireExposeCustomGlobal(\"SharedArrayBuffer\", ArrayBuffer);\n }\n if (typeof globalThis.btoa !== \"function\") {\n __requireExposeCustomGlobal(\"btoa\", function btoa(input) {\n return Buffer.from(String(input), \"binary\").toString(\"base64\");\n });\n }\n if (typeof globalThis.atob !== \"function\") {\n __requireExposeCustomGlobal(\"atob\", function atob(input) {\n return Buffer.from(String(input), \"base64\").toString(\"binary\");\n });\n }\n function _dirname(p) {\n const lastSlash = p.lastIndexOf(\"/\");\n if (lastSlash === -1) return \".\";\n if (lastSlash === 0) return \"/\";\n return p.slice(0, lastSlash);\n }\n (function installWhatwgEncodingAndEvents() {\n function _withCode(error, code) {\n error.code = code;\n return error;\n }\n function _trimAsciiWhitespace(value) {\n return value.replace(/^[\\t\\n\\f\\r ]+|[\\t\\n\\f\\r ]+$/g, \"\");\n }\n function _normalizeEncodingLabel(label) {\n var normalized = _trimAsciiWhitespace(\n label === void 0 ? \"utf-8\" : String(label)\n ).toLowerCase();\n switch (normalized) {\n case \"utf-8\":\n case \"utf8\":\n case \"unicode-1-1-utf-8\":\n case \"unicode11utf8\":\n case \"unicode20utf8\":\n case \"x-unicode20utf8\":\n return \"utf-8\";\n case \"utf-16\":\n case \"utf-16le\":\n case \"ucs-2\":\n case \"ucs2\":\n case \"csunicode\":\n case \"iso-10646-ucs-2\":\n case \"unicode\":\n case \"unicodefeff\":\n return \"utf-16le\";\n case \"utf-16be\":\n case \"unicodefffe\":\n return \"utf-16be\";\n default:\n throw _withCode(\n new RangeError('The \"' + normalized + '\" encoding is not supported'),\n \"ERR_ENCODING_NOT_SUPPORTED\"\n );\n }\n }\n function _toUint8Array(input) {\n if (input === void 0) {\n return new Uint8Array(0);\n }\n if (ArrayBuffer.isView(input)) {\n return new Uint8Array(input.buffer, input.byteOffset, input.byteLength);\n }\n if (input instanceof ArrayBuffer) {\n return new Uint8Array(input);\n }\n if (typeof SharedArrayBuffer !== \"undefined\" && input instanceof SharedArrayBuffer) {\n return new Uint8Array(input);\n }\n throw _withCode(\n new TypeError(\n 'The \"input\" argument must be an instance of ArrayBuffer, SharedArrayBuffer, or ArrayBufferView.'\n ),\n \"ERR_INVALID_ARG_TYPE\"\n );\n }\n function _encodeUtf8ScalarValue(codePoint, bytes) {\n if (codePoint <= 127) {\n bytes.push(codePoint);\n return;\n }\n if (codePoint <= 2047) {\n bytes.push(192 | codePoint >> 6, 128 | codePoint & 63);\n return;\n }\n if (codePoint <= 65535) {\n bytes.push(\n 224 | codePoint >> 12,\n 128 | codePoint >> 6 & 63,\n 128 | codePoint & 63\n );\n return;\n }\n bytes.push(\n 240 | codePoint >> 18,\n 128 | codePoint >> 12 & 63,\n 128 | codePoint >> 6 & 63,\n 128 | codePoint & 63\n );\n }\n function _encodeUtf8(input) {\n var value = String(input === void 0 ? \"\" : input);\n var bytes = [];\n for (var index = 0; index < value.length; index += 1) {\n var codeUnit = value.charCodeAt(index);\n if (codeUnit >= 55296 && codeUnit <= 56319) {\n var nextIndex = index + 1;\n if (nextIndex < value.length) {\n var nextCodeUnit = value.charCodeAt(nextIndex);\n if (nextCodeUnit >= 56320 && nextCodeUnit <= 57343) {\n _encodeUtf8ScalarValue(\n 65536 + (codeUnit - 55296 << 10) + (nextCodeUnit - 56320),\n bytes\n );\n index = nextIndex;\n continue;\n }\n }\n _encodeUtf8ScalarValue(65533, bytes);\n continue;\n }\n if (codeUnit >= 56320 && codeUnit <= 57343) {\n _encodeUtf8ScalarValue(65533, bytes);\n continue;\n }\n _encodeUtf8ScalarValue(codeUnit, bytes);\n }\n return new Uint8Array(bytes);\n }\n function _appendCodePoint(output, codePoint) {\n if (codePoint <= 65535) {\n output.push(String.fromCharCode(codePoint));\n return;\n }\n var adjusted = codePoint - 65536;\n output.push(\n String.fromCharCode(55296 + (adjusted >> 10)),\n String.fromCharCode(56320 + (adjusted & 1023))\n );\n }\n function _isContinuationByte(value) {\n return value >= 128 && value <= 191;\n }\n function _createInvalidDataError(encoding) {\n return _withCode(\n new TypeError(\"The encoded data was not valid for encoding \" + encoding),\n \"ERR_ENCODING_INVALID_ENCODED_DATA\"\n );\n }\n function _decodeUtf8(bytes, fatal, stream, encoding) {\n var output = [];\n for (var index = 0; index < bytes.length; ) {\n var first = bytes[index];\n if (first <= 127) {\n output.push(String.fromCharCode(first));\n index += 1;\n continue;\n }\n var needed = 0;\n var codePoint = 0;\n if (first >= 194 && first <= 223) {\n needed = 1;\n codePoint = first & 31;\n } else if (first >= 224 && first <= 239) {\n needed = 2;\n codePoint = first & 15;\n } else if (first >= 240 && first <= 244) {\n needed = 3;\n codePoint = first & 7;\n } else {\n if (fatal) throw _createInvalidDataError(encoding);\n output.push(\"\\uFFFD\");\n index += 1;\n continue;\n }\n if (index + needed >= bytes.length) {\n if (stream) {\n return { text: output.join(\"\"), pending: Array.from(bytes.slice(index)) };\n }\n if (fatal) throw _createInvalidDataError(encoding);\n output.push(\"\\uFFFD\");\n break;\n }\n var second = bytes[index + 1];\n if (!_isContinuationByte(second)) {\n if (fatal) throw _createInvalidDataError(encoding);\n output.push(\"\\uFFFD\");\n index += 1;\n continue;\n }\n if (first === 224 && second < 160 || first === 237 && second > 159 || first === 240 && second < 144 || first === 244 && second > 143) {\n if (fatal) throw _createInvalidDataError(encoding);\n output.push(\"\\uFFFD\");\n index += 1;\n continue;\n }\n codePoint = codePoint << 6 | second & 63;\n if (needed >= 2) {\n var third = bytes[index + 2];\n if (!_isContinuationByte(third)) {\n if (fatal) throw _createInvalidDataError(encoding);\n output.push(\"\\uFFFD\");\n index += 1;\n continue;\n }\n codePoint = codePoint << 6 | third & 63;\n }\n if (needed === 3) {\n var fourth = bytes[index + 3];\n if (!_isContinuationByte(fourth)) {\n if (fatal) throw _createInvalidDataError(encoding);\n output.push(\"\\uFFFD\");\n index += 1;\n continue;\n }\n codePoint = codePoint << 6 | fourth & 63;\n }\n if (codePoint >= 55296 && codePoint <= 57343) {\n if (fatal) throw _createInvalidDataError(encoding);\n output.push(\"\\uFFFD\");\n index += needed + 1;\n continue;\n }\n _appendCodePoint(output, codePoint);\n index += needed + 1;\n }\n return { text: output.join(\"\"), pending: [] };\n }\n function _decodeUtf16(bytes, encoding, fatal, stream, bomSeen) {\n var output = [];\n var endian = encoding === \"utf-16be\" ? \"be\" : \"le\";\n if (!bomSeen && encoding === \"utf-16le\" && bytes.length >= 2) {\n if (bytes[0] === 254 && bytes[1] === 255) {\n endian = \"be\";\n }\n }\n for (var index = 0; index < bytes.length; ) {\n if (index + 1 >= bytes.length) {\n if (stream) {\n return { text: output.join(\"\"), pending: Array.from(bytes.slice(index)) };\n }\n if (fatal) throw _createInvalidDataError(encoding);\n output.push(\"\\uFFFD\");\n break;\n }\n var first = bytes[index];\n var second = bytes[index + 1];\n var codeUnit = endian === \"le\" ? first | second << 8 : first << 8 | second;\n index += 2;\n if (codeUnit >= 55296 && codeUnit <= 56319) {\n if (index + 1 >= bytes.length) {\n if (stream) {\n return { text: output.join(\"\"), pending: Array.from(bytes.slice(index - 2)) };\n }\n if (fatal) throw _createInvalidDataError(encoding);\n output.push(\"\\uFFFD\");\n continue;\n }\n var nextFirst = bytes[index];\n var nextSecond = bytes[index + 1];\n var nextCodeUnit = endian === \"le\" ? nextFirst | nextSecond << 8 : nextFirst << 8 | nextSecond;\n if (nextCodeUnit >= 56320 && nextCodeUnit <= 57343) {\n _appendCodePoint(\n output,\n 65536 + (codeUnit - 55296 << 10) + (nextCodeUnit - 56320)\n );\n index += 2;\n continue;\n }\n if (fatal) throw _createInvalidDataError(encoding);\n output.push(\"\\uFFFD\");\n continue;\n }\n if (codeUnit >= 56320 && codeUnit <= 57343) {\n if (fatal) throw _createInvalidDataError(encoding);\n output.push(\"\\uFFFD\");\n continue;\n }\n output.push(String.fromCharCode(codeUnit));\n }\n return { text: output.join(\"\"), pending: [] };\n }\n function TextEncoder() {\n }\n TextEncoder.prototype.encode = function encode(input) {\n return _encodeUtf8(input === void 0 ? \"\" : input);\n };\n TextEncoder.prototype.encodeInto = function encodeInto(input, destination) {\n var value = String(input);\n var read = 0;\n var written = 0;\n for (var index = 0; index < value.length; index += 1) {\n var codeUnit = value.charCodeAt(index);\n var chunk = value[index] || \"\";\n if (codeUnit >= 55296 && codeUnit <= 56319 && index + 1 < value.length) {\n var nextCodeUnit = value.charCodeAt(index + 1);\n if (nextCodeUnit >= 56320 && nextCodeUnit <= 57343) {\n chunk = value.slice(index, index + 2);\n }\n }\n var encoded = _encodeUtf8(chunk);\n if (written + encoded.length > destination.length) break;\n destination.set(encoded, written);\n written += encoded.length;\n read += chunk.length;\n if (chunk.length === 2) index += 1;\n }\n return { read, written };\n };\n Object.defineProperty(TextEncoder.prototype, \"encoding\", {\n get: function() {\n return \"utf-8\";\n }\n });\n function TextDecoder2(label, options) {\n var normalizedOptions = options == null ? {} : Object(options);\n this._encoding = _normalizeEncodingLabel(label);\n this._fatal = Boolean(normalizedOptions.fatal);\n this._ignoreBOM = Boolean(normalizedOptions.ignoreBOM);\n this._pendingBytes = [];\n this._bomSeen = false;\n }\n Object.defineProperty(TextDecoder2.prototype, \"encoding\", {\n get: function() {\n return this._encoding;\n }\n });\n Object.defineProperty(TextDecoder2.prototype, \"fatal\", {\n get: function() {\n return this._fatal;\n }\n });\n Object.defineProperty(TextDecoder2.prototype, \"ignoreBOM\", {\n get: function() {\n return this._ignoreBOM;\n }\n });\n TextDecoder2.prototype.decode = function decode(input, options) {\n var normalizedOptions = options == null ? {} : Object(options);\n var stream = Boolean(normalizedOptions.stream);\n var incoming = _toUint8Array(input);\n var merged = new Uint8Array(this._pendingBytes.length + incoming.length);\n merged.set(this._pendingBytes, 0);\n merged.set(incoming, this._pendingBytes.length);\n var decoded = this._encoding === \"utf-8\" ? _decodeUtf8(merged, this._fatal, stream, this._encoding) : _decodeUtf16(merged, this._encoding, this._fatal, stream, this._bomSeen);\n this._pendingBytes = decoded.pending;\n var text = decoded.text;\n if (!this._bomSeen && text.length > 0) {\n if (!this._ignoreBOM && text.charCodeAt(0) === 65279) {\n text = text.slice(1);\n }\n this._bomSeen = true;\n }\n if (!stream && this._pendingBytes.length > 0) {\n var pendingLength = this._pendingBytes.length;\n this._pendingBytes = [];\n if (this._fatal) throw _createInvalidDataError(this._encoding);\n return text + \"\\uFFFD\".repeat(Math.ceil(pendingLength / 2));\n }\n return text;\n };\n function _normalizeAddEventListenerOptions(options) {\n if (typeof options === \"boolean\") {\n return { capture: options, once: false, passive: false };\n }\n if (options == null) {\n return { capture: false, once: false, passive: false };\n }\n var normalized = Object(options);\n return {\n capture: Boolean(normalized.capture),\n once: Boolean(normalized.once),\n passive: Boolean(normalized.passive),\n signal: normalized.signal\n };\n }\n function _normalizeRemoveEventListenerOptions(options) {\n if (typeof options === \"boolean\") return options;\n if (options == null) return false;\n return Boolean(Object(options).capture);\n }\n function _isAbortSignalLike(value) {\n return typeof value === \"object\" && value !== null && \"aborted\" in value && typeof value.addEventListener === \"function\" && typeof value.removeEventListener === \"function\";\n }\n function Event(type, init) {\n if (arguments.length === 0) {\n throw new TypeError(\"The event type must be provided\");\n }\n var normalizedInit = init == null ? {} : Object(init);\n this.type = String(type);\n this.bubbles = Boolean(normalizedInit.bubbles);\n this.cancelable = Boolean(normalizedInit.cancelable);\n this.composed = Boolean(normalizedInit.composed);\n this.detail = null;\n this.defaultPrevented = false;\n this.target = null;\n this.currentTarget = null;\n this.eventPhase = 0;\n this.returnValue = true;\n this.cancelBubble = false;\n this.timeStamp = Date.now();\n this.isTrusted = false;\n this.srcElement = null;\n this._inPassiveListener = false;\n this._propagationStopped = false;\n this._immediatePropagationStopped = false;\n }\n Event.NONE = 0;\n Event.CAPTURING_PHASE = 1;\n Event.AT_TARGET = 2;\n Event.BUBBLING_PHASE = 3;\n Event.prototype.preventDefault = function preventDefault() {\n if (this.cancelable && !this._inPassiveListener) {\n this.defaultPrevented = true;\n this.returnValue = false;\n }\n };\n Event.prototype.stopPropagation = function stopPropagation() {\n this._propagationStopped = true;\n this.cancelBubble = true;\n };\n Event.prototype.stopImmediatePropagation = function stopImmediatePropagation() {\n this._propagationStopped = true;\n this._immediatePropagationStopped = true;\n this.cancelBubble = true;\n };\n Event.prototype.composedPath = function composedPath() {\n return this.target ? [this.target] : [];\n };\n function CustomEvent(type, init) {\n Event.call(this, type, init);\n var normalizedInit = init == null ? null : Object(init);\n this.detail = normalizedInit && \"detail\" in normalizedInit ? normalizedInit.detail : null;\n }\n CustomEvent.prototype = Object.create(Event.prototype);\n CustomEvent.prototype.constructor = CustomEvent;\n function EventTarget() {\n this._listeners = /* @__PURE__ */ new Map();\n }\n EventTarget.prototype.addEventListener = function addEventListener(type, listener, options) {\n var normalized = _normalizeAddEventListenerOptions(options);\n if (normalized.signal !== void 0 && !_isAbortSignalLike(normalized.signal)) {\n throw new TypeError('The \"signal\" option must be an instance of AbortSignal.');\n }\n if (listener == null) return void 0;\n if (typeof listener !== \"function\" && (typeof listener !== \"object\" || listener === null)) {\n return void 0;\n }\n if (normalized.signal && normalized.signal.aborted) return void 0;\n var records = this._listeners.get(type) || [];\n for (var i = 0; i < records.length; i += 1) {\n if (records[i].listener === listener && records[i].capture === normalized.capture) {\n return void 0;\n }\n }\n var record = {\n listener,\n capture: normalized.capture,\n once: normalized.once,\n passive: normalized.passive,\n kind: typeof listener === \"function\" ? \"function\" : \"object\",\n signal: normalized.signal,\n abortListener: void 0\n };\n if (normalized.signal) {\n var self = this;\n record.abortListener = function() {\n self.removeEventListener(type, listener, normalized.capture);\n };\n normalized.signal.addEventListener(\"abort\", record.abortListener, { once: true });\n }\n records.push(record);\n this._listeners.set(type, records);\n return void 0;\n };\n EventTarget.prototype.removeEventListener = function removeEventListener(type, listener, options) {\n if (listener == null) return;\n var capture = _normalizeRemoveEventListenerOptions(options);\n var records = this._listeners.get(type);\n if (!records) return;\n var nextRecords = [];\n for (var i = 0; i < records.length; i += 1) {\n var record = records[i];\n var match = record.listener === listener && record.capture === capture;\n if (match) {\n if (record.signal && record.abortListener) {\n record.signal.removeEventListener(\"abort\", record.abortListener);\n }\n } else {\n nextRecords.push(record);\n }\n }\n if (nextRecords.length === 0) {\n this._listeners.delete(type);\n } else {\n this._listeners.set(type, nextRecords);\n }\n };\n EventTarget.prototype.dispatchEvent = function dispatchEvent(event) {\n if (!event || typeof event !== \"object\" || typeof event.type !== \"string\") {\n throw new TypeError(\"Argument 1 must be an Event\");\n }\n var records = (this._listeners.get(event.type) || []).slice();\n event.target = this;\n event.currentTarget = this;\n event.eventPhase = 2;\n for (var i = 0; i < records.length; i += 1) {\n var record = records[i];\n var active = this._listeners.get(event.type);\n if (!active || active.indexOf(record) === -1) continue;\n if (record.once) {\n this.removeEventListener(event.type, record.listener, record.capture);\n }\n event._inPassiveListener = record.passive;\n if (record.kind === \"function\") {\n record.listener.call(this, event);\n } else {\n var handleEvent = record.listener.handleEvent;\n if (typeof handleEvent === \"function\") {\n handleEvent.call(record.listener, event);\n }\n }\n event._inPassiveListener = false;\n if (event._immediatePropagationStopped || event._propagationStopped) {\n break;\n }\n }\n event.currentTarget = null;\n event.eventPhase = 0;\n return !event.defaultPrevented;\n };\n globalThis.TextEncoder = TextEncoder;\n globalThis.TextDecoder = TextDecoder2;\n globalThis.Event = Event;\n globalThis.CustomEvent = CustomEvent;\n globalThis.EventTarget = EventTarget;\n if (typeof globalThis.DOMException === \"undefined\") {\n let DOMException3 = function(message, name) {\n if (!(this instanceof DOMException3)) {\n throw new TypeError(\"Class constructor DOMException cannot be invoked without 'new'\");\n }\n Error.call(this, message);\n this.message = message === void 0 ? \"\" : String(message);\n this.name = name === void 0 ? \"Error\" : String(name);\n this.code = DOM_EXCEPTION_LEGACY_CODES[this.name] || 0;\n if (typeof Error.captureStackTrace === \"function\") {\n Error.captureStackTrace(this, DOMException3);\n }\n };\n var DOMException2 = DOMException3;\n var DOM_EXCEPTION_LEGACY_CODES = {\n IndexSizeError: 1,\n DOMStringSizeError: 2,\n HierarchyRequestError: 3,\n WrongDocumentError: 4,\n InvalidCharacterError: 5,\n NoDataAllowedError: 6,\n NoModificationAllowedError: 7,\n NotFoundError: 8,\n NotSupportedError: 9,\n InUseAttributeError: 10,\n InvalidStateError: 11,\n SyntaxError: 12,\n InvalidModificationError: 13,\n NamespaceError: 14,\n InvalidAccessError: 15,\n ValidationError: 16,\n TypeMismatchError: 17,\n SecurityError: 18,\n NetworkError: 19,\n AbortError: 20,\n URLMismatchError: 21,\n QuotaExceededError: 22,\n TimeoutError: 23,\n InvalidNodeTypeError: 24,\n DataCloneError: 25\n };\n DOMException3.prototype = Object.create(Error.prototype);\n Object.defineProperty(DOMException3.prototype, \"constructor\", {\n value: DOMException3,\n writable: true,\n configurable: true\n });\n Object.defineProperty(DOMException3.prototype, Symbol.toStringTag, {\n value: \"DOMException\",\n writable: false,\n enumerable: false,\n configurable: true\n });\n for (var codeName in DOM_EXCEPTION_LEGACY_CODES) {\n if (!Object.prototype.hasOwnProperty.call(DOM_EXCEPTION_LEGACY_CODES, codeName)) {\n continue;\n }\n var codeValue = DOM_EXCEPTION_LEGACY_CODES[codeName];\n var constantName = codeName.replace(/([a-z0-9])([A-Z])/g, \"$1_$2\").toUpperCase();\n Object.defineProperty(DOMException3, constantName, {\n value: codeValue,\n writable: false,\n enumerable: true,\n configurable: false\n });\n Object.defineProperty(DOMException3.prototype, constantName, {\n value: codeValue,\n writable: false,\n enumerable: true,\n configurable: false\n });\n }\n __requireExposeCustomGlobal(\"DOMException\", DOMException3);\n }\n if (typeof globalThis.Blob === \"undefined\") {\n let Blob2 = function(parts, options) {\n if (!(this instanceof Blob2)) {\n throw new TypeError(\"Class constructor Blob cannot be invoked without 'new'\");\n }\n this._parts = Array.isArray(parts) ? parts.slice() : [];\n this.type = options && options.type ? String(options.type).toLowerCase() : \"\";\n var size = 0;\n for (var index = 0; index < this._parts.length; index += 1) {\n var part = this._parts[index];\n if (typeof part === \"string\") {\n size += part.length;\n } else if (part && typeof part.byteLength === \"number\") {\n size += part.byteLength;\n }\n }\n this.size = size;\n };\n var Blob = Blob2;\n Blob2.prototype.arrayBuffer = function arrayBuffer() {\n return Promise.resolve(new ArrayBuffer(0));\n };\n Blob2.prototype.text = function text() {\n return Promise.resolve(\"\");\n };\n Blob2.prototype.slice = function slice() {\n return new Blob2();\n };\n Blob2.prototype.stream = function stream() {\n throw new Error(\"Blob.stream is not supported in sandbox\");\n };\n Object.defineProperty(Blob2.prototype, Symbol.toStringTag, {\n value: \"Blob\",\n writable: false,\n enumerable: false,\n configurable: true\n });\n __requireExposeCustomGlobal(\"Blob\", Blob2);\n }\n if (typeof globalThis.File === \"undefined\") {\n let File2 = function(parts, name, options) {\n if (!(this instanceof File2)) {\n throw new TypeError(\"Class constructor File cannot be invoked without 'new'\");\n }\n globalThis.Blob.call(this, parts, options);\n this.name = String(name);\n this.lastModified = options && typeof options.lastModified === \"number\" ? options.lastModified : Date.now();\n this.webkitRelativePath = \"\";\n };\n var File = File2;\n File2.prototype = Object.create(globalThis.Blob.prototype);\n Object.defineProperty(File2.prototype, \"constructor\", {\n value: File2,\n writable: true,\n configurable: true\n });\n Object.defineProperty(File2.prototype, Symbol.toStringTag, {\n value: \"File\",\n writable: false,\n enumerable: false,\n configurable: true\n });\n __requireExposeCustomGlobal(\"File\", File2);\n }\n if (typeof globalThis.FormData === \"undefined\") {\n let FormData2 = function() {\n if (!(this instanceof FormData2)) {\n throw new TypeError(\"Class constructor FormData cannot be invoked without 'new'\");\n }\n this._entries = [];\n };\n var FormData = FormData2;\n FormData2.prototype.append = function append(name, value) {\n this._entries.push([String(name), value]);\n };\n FormData2.prototype.get = function get(name) {\n var key = String(name);\n for (var index = 0; index < this._entries.length; index += 1) {\n if (this._entries[index][0] === key) {\n return this._entries[index][1];\n }\n }\n return null;\n };\n FormData2.prototype.getAll = function getAll(name) {\n var key = String(name);\n var values = [];\n for (var index = 0; index < this._entries.length; index += 1) {\n if (this._entries[index][0] === key) {\n values.push(this._entries[index][1]);\n }\n }\n return values;\n };\n FormData2.prototype.has = function has(name) {\n return this.get(name) !== null;\n };\n FormData2.prototype.delete = function del(name) {\n var key = String(name);\n this._entries = this._entries.filter(function(entry) {\n return entry[0] !== key;\n });\n };\n FormData2.prototype.entries = function entries() {\n return this._entries[Symbol.iterator]();\n };\n FormData2.prototype[Symbol.iterator] = function iterator() {\n return this.entries();\n };\n Object.defineProperty(FormData2.prototype, Symbol.toStringTag, {\n value: \"FormData\",\n writable: false,\n enumerable: false,\n configurable: true\n });\n __requireExposeCustomGlobal(\"FormData\", FormData2);\n }\n if (typeof globalThis.MessageEvent === \"undefined\") {\n let MessageEvent2 = function(type, options) {\n if (!(this instanceof MessageEvent2)) {\n throw new TypeError(\"Class constructor MessageEvent cannot be invoked without 'new'\");\n }\n globalThis.Event.call(this, type, options);\n this.data = options && \"data\" in options ? options.data : void 0;\n };\n var MessageEvent = MessageEvent2;\n MessageEvent2.prototype = Object.create(globalThis.Event.prototype);\n Object.defineProperty(MessageEvent2.prototype, \"constructor\", {\n value: MessageEvent2,\n writable: true,\n configurable: true\n });\n globalThis.MessageEvent = MessageEvent2;\n }\n if (typeof globalThis.MessagePort === \"undefined\") {\n let MessagePort2 = function() {\n if (!(this instanceof MessagePort2)) {\n throw new TypeError(\"Class constructor MessagePort cannot be invoked without 'new'\");\n }\n globalThis.EventTarget.call(this);\n this.onmessage = null;\n this._pairedPort = null;\n };\n var MessagePort = MessagePort2;\n MessagePort2.prototype = Object.create(globalThis.EventTarget.prototype);\n Object.defineProperty(MessagePort2.prototype, \"constructor\", {\n value: MessagePort2,\n writable: true,\n configurable: true\n });\n MessagePort2.prototype.postMessage = function postMessage(data) {\n var target = this._pairedPort;\n if (!target) {\n return;\n }\n var event = new globalThis.MessageEvent(\"message\", { data });\n target.dispatchEvent(event);\n if (typeof target.onmessage === \"function\") {\n target.onmessage.call(target, event);\n }\n };\n MessagePort2.prototype.start = function start() {\n };\n MessagePort2.prototype.close = function close() {\n this._pairedPort = null;\n };\n globalThis.MessagePort = MessagePort2;\n }\n if (typeof globalThis.MessageChannel === \"undefined\") {\n let MessageChannel2 = function() {\n if (!(this instanceof MessageChannel2)) {\n throw new TypeError(\"Class constructor MessageChannel cannot be invoked without 'new'\");\n }\n this.port1 = new globalThis.MessagePort();\n this.port2 = new globalThis.MessagePort();\n this.port1._pairedPort = this.port2;\n this.port2._pairedPort = this.port1;\n };\n var MessageChannel = MessageChannel2;\n globalThis.MessageChannel = MessageChannel2;\n }\n })();\n (function installWebStreamsGlobals() {\n if (typeof globalThis.ReadableStream !== \"undefined\") {\n return;\n }\n if (typeof _loadPolyfill === \"undefined\") {\n return;\n }\n const polyfillCode = _loadPolyfill.applySyncPromise(void 0, [\"stream/web\"]);\n if (polyfillCode === null) {\n return;\n }\n const webStreams = Function('\"use strict\"; return (' + polyfillCode + \");\")();\n const names = [\n \"ReadableStream\",\n \"ReadableStreamDefaultReader\",\n \"ReadableStreamBYOBReader\",\n \"ReadableStreamBYOBRequest\",\n \"ReadableByteStreamController\",\n \"ReadableStreamDefaultController\",\n \"TransformStream\",\n \"TransformStreamDefaultController\",\n \"WritableStream\",\n \"WritableStreamDefaultWriter\",\n \"WritableStreamDefaultController\",\n \"ByteLengthQueuingStrategy\",\n \"CountQueuingStrategy\",\n \"TextEncoderStream\",\n \"TextDecoderStream\",\n \"CompressionStream\",\n \"DecompressionStream\"\n ];\n for (const name of names) {\n if (typeof webStreams?.[name] !== \"undefined\") {\n globalThis[name] = webStreams[name];\n }\n }\n })();\n function _patchPolyfill(name, result) {\n if (typeof result !== \"object\" && typeof result !== \"function\" || result === null) {\n return result;\n }\n if (name === \"buffer\") {\n const maxLength = typeof result.kMaxLength === \"number\" ? result.kMaxLength : 2147483647;\n const maxStringLength = typeof result.kStringMaxLength === \"number\" ? result.kStringMaxLength : 536870888;\n if (typeof result.constants !== \"object\" || result.constants === null) {\n result.constants = {};\n }\n if (typeof result.constants.MAX_LENGTH !== \"number\") {\n result.constants.MAX_LENGTH = maxLength;\n }\n if (typeof result.constants.MAX_STRING_LENGTH !== \"number\") {\n result.constants.MAX_STRING_LENGTH = maxStringLength;\n }\n if (typeof result.kMaxLength !== \"number\") {\n result.kMaxLength = maxLength;\n }\n if (typeof result.kStringMaxLength !== \"number\") {\n result.kStringMaxLength = maxStringLength;\n }\n var BufferCtor = result.Buffer;\n if (typeof globalThis.Buffer === \"function\" && globalThis.Buffer !== BufferCtor) {\n BufferCtor = globalThis.Buffer;\n result.Buffer = BufferCtor;\n } else if (typeof globalThis.Buffer !== \"function\" && typeof BufferCtor === \"function\") {\n globalThis.Buffer = BufferCtor;\n }\n if ((typeof BufferCtor === \"function\" || typeof BufferCtor === \"object\") && BufferCtor !== null) {\n if (typeof result.SlowBuffer !== \"function\") {\n result.SlowBuffer = BufferCtor;\n }\n if (typeof BufferCtor.kMaxLength !== \"number\") {\n BufferCtor.kMaxLength = maxLength;\n }\n if (typeof BufferCtor.kStringMaxLength !== \"number\") {\n BufferCtor.kStringMaxLength = maxStringLength;\n }\n if (typeof BufferCtor.constants !== \"object\" || BufferCtor.constants === null) {\n BufferCtor.constants = result.constants;\n }\n var proto = BufferCtor.prototype;\n if (proto && typeof proto.utf8Slice !== \"function\") {\n var encodings = [\"utf8\", \"latin1\", \"ascii\", \"hex\", \"base64\", \"ucs2\", \"utf16le\"];\n for (var ei = 0; ei < encodings.length; ei++) {\n var enc = encodings[ei];\n (function(e) {\n if (typeof proto[e + \"Slice\"] !== \"function\") {\n proto[e + \"Slice\"] = function(start, end) {\n return this.toString(e, start, end);\n };\n }\n if (typeof proto[e + \"Write\"] !== \"function\") {\n proto[e + \"Write\"] = function(string, offset, length) {\n return this.write(string, offset, length, e);\n };\n }\n })(enc);\n }\n }\n if (typeof BufferCtor.allocUnsafe === \"function\" && !BufferCtor.allocUnsafe._secureExecPatched) {\n var _origAllocUnsafe = BufferCtor.allocUnsafe;\n BufferCtor.allocUnsafe = function(size) {\n try {\n return _origAllocUnsafe.apply(this, arguments);\n } catch (error) {\n if (error && error.name === \"RangeError\" && typeof size === \"number\" && size > maxLength) {\n throw new Error(\"Array buffer allocation failed\");\n }\n throw error;\n }\n };\n BufferCtor.allocUnsafe._secureExecPatched = true;\n }\n }\n return result;\n }\n if (name === \"util\" && typeof result.formatWithOptions === \"undefined\" && typeof result.format === \"function\") {\n result.formatWithOptions = function formatWithOptions(inspectOptions, ...args) {\n return result.format.apply(null, args);\n };\n }\n if (name === \"util\") {\n if (typeof result.types === \"undefined\" && typeof _requireFrom === \"function\") {\n try {\n result.types = _requireFrom(\"util/types\", \"/\");\n } catch {\n }\n }\n if ((typeof result.MIMEType === \"undefined\" || typeof result.MIMEParams === \"undefined\") && typeof _requireFrom === \"function\") {\n try {\n const mimeModule = _requireFrom(\"internal/mime\", \"/\");\n if (typeof result.MIMEType === \"undefined\") {\n result.MIMEType = mimeModule.MIMEType;\n }\n if (typeof result.MIMEParams === \"undefined\") {\n result.MIMEParams = mimeModule.MIMEParams;\n }\n } catch {\n }\n }\n if (typeof result.inspect === \"function\" && typeof result.inspect.custom === \"undefined\") {\n result.inspect.custom = /* @__PURE__ */ Symbol.for(\"nodejs.util.inspect.custom\");\n }\n if (typeof result.inspect === \"function\" && !result.inspect._secureExecPatchedCustomInspect) {\n const customInspectSymbol = result.inspect.custom || /* @__PURE__ */ Symbol.for(\"nodejs.util.inspect.custom\");\n const originalInspect = result.inspect;\n const formatObjectKey = function(key) {\n return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key) ? key : originalInspect(key);\n };\n const containsCustomInspectable = function(value, depth, seen) {\n if (value === null) {\n return false;\n }\n if (typeof value !== \"object\" && typeof value !== \"function\") {\n return false;\n }\n if (typeof value[customInspectSymbol] === \"function\") {\n return true;\n }\n if (depth < 0 || seen.has(value)) {\n return false;\n }\n seen.add(value);\n if (Array.isArray(value)) {\n for (const entry of value) {\n if (containsCustomInspectable(entry, depth - 1, seen)) {\n seen.delete(value);\n return true;\n }\n }\n seen.delete(value);\n return false;\n }\n for (const key of Object.keys(value)) {\n if (containsCustomInspectable(value[key], depth - 1, seen)) {\n seen.delete(value);\n return true;\n }\n }\n seen.delete(value);\n return false;\n };\n const inspectWithCustom = function(value, depth, options, seen) {\n if (value === null || typeof value !== \"object\" && typeof value !== \"function\") {\n return originalInspect(value, options);\n }\n if (seen.has(value)) {\n return \"[Circular]\";\n }\n if (typeof value[customInspectSymbol] === \"function\") {\n return value[customInspectSymbol](depth, options, result.inspect);\n }\n if (depth < 0) {\n return originalInspect(value, options);\n }\n seen.add(value);\n if (Array.isArray(value)) {\n const items = value.map((entry) => inspectWithCustom(entry, depth - 1, options, seen));\n seen.delete(value);\n return `[ ${items.join(\", \")} ]`;\n }\n const proto2 = Object.getPrototypeOf(value);\n if (proto2 === Object.prototype || proto2 === null) {\n const entries = Object.keys(value).map(\n (key) => `${formatObjectKey(key)}: ${inspectWithCustom(value[key], depth - 1, options, seen)}`\n );\n seen.delete(value);\n return `{ ${entries.join(\", \")} }`;\n }\n seen.delete(value);\n return originalInspect(value, options);\n };\n result.inspect = function inspect(value, options) {\n const inspectOptions = typeof options === \"object\" && options !== null ? options : {};\n const depth = typeof inspectOptions.depth === \"number\" ? inspectOptions.depth : 2;\n if (typeof value === \"symbol\") {\n return value.toString();\n }\n if (!containsCustomInspectable(value, depth, /* @__PURE__ */ new Set())) {\n return originalInspect.call(this, value, options);\n }\n return inspectWithCustom(value, depth, inspectOptions, /* @__PURE__ */ new Set());\n };\n result.inspect.custom = customInspectSymbol;\n result.inspect._secureExecPatchedCustomInspect = true;\n }\n return result;\n }\n if (name === \"events\") {\n if (typeof result.getEventListeners !== \"function\") {\n result.getEventListeners = function getEventListeners(target, eventName) {\n if (target && typeof target.listeners === \"function\") {\n return target.listeners(eventName);\n }\n if (target && typeof target.getEventListeners === \"function\") {\n return target.getEventListeners(eventName);\n }\n if (target && eventName === \"abort\" && Array.isArray(target._listeners)) {\n return target._listeners.slice();\n }\n return [];\n };\n }\n return result;\n }\n if (name === \"stream\" || name === \"node:stream\") {\n const getWebStreamsState2 = function() {\n return globalThis.__secureExecWebStreams || null;\n };\n const webStreamsState2 = getWebStreamsState2();\n if (typeof result.isReadable !== \"function\") {\n result.isReadable = function(stream) {\n const stateKey = getWebStreamsState2() && getWebStreamsState2().kState;\n return Boolean(stateKey && stream && stream[stateKey] && stream[stateKey].state === \"readable\");\n };\n }\n if (typeof result.isErrored !== \"function\") {\n result.isErrored = function(stream) {\n const stateKey = getWebStreamsState2() && getWebStreamsState2().kState;\n return Boolean(stateKey && stream && stream[stateKey] && stream[stateKey].state === \"errored\");\n };\n }\n if (typeof result.isDisturbed !== \"function\") {\n result.isDisturbed = function(stream) {\n const stateKey = getWebStreamsState2() && getWebStreamsState2().kState;\n return Boolean(stateKey && stream && stream[stateKey] && stream[stateKey].disturbed === true);\n };\n }\n const ReadableCtor = result.Readable;\n const WritableCtor = result.Writable;\n const readableFrom = typeof ReadableCtor === \"function\" ? ReadableCtor.from : void 0;\n const readableFromSource = typeof readableFrom === \"function\" ? Function.prototype.toString.call(readableFrom) : \"\";\n const hasBrowserReadableFromStub = readableFromSource.indexOf(\n \"Readable.from is not available in the browser\"\n ) !== -1 || readableFromSource.indexOf(\"require_from_browser\") !== -1;\n if (typeof ReadableCtor === \"function\" && (typeof readableFrom !== \"function\" || hasBrowserReadableFromStub)) {\n ReadableCtor.from = function from(iterable, options) {\n const readable = new ReadableCtor(Object.assign({ read() {\n } }, options || {}));\n Promise.resolve().then(async function() {\n try {\n if (iterable && typeof iterable[Symbol.asyncIterator] === \"function\") {\n for await (const chunk of iterable) {\n readable.push(chunk);\n }\n } else if (iterable && typeof iterable[Symbol.iterator] === \"function\") {\n for (const chunk of iterable) {\n readable.push(chunk);\n }\n } else {\n readable.push(iterable);\n }\n readable.push(null);\n } catch (error) {\n if (typeof readable.destroy === \"function\") {\n readable.destroy(error);\n } else {\n readable.emit(\"error\", error);\n }\n }\n });\n return readable;\n };\n }\n if (webStreamsState2 && typeof ReadableCtor === \"function\") {\n if (typeof ReadableCtor.fromWeb !== \"function\" && typeof webStreamsState2.newStreamReadableFromReadableStream === \"function\") {\n ReadableCtor.fromWeb = function fromWeb(readableStream, options) {\n return webStreamsState2.newStreamReadableFromReadableStream(readableStream, options);\n };\n }\n if (typeof ReadableCtor.toWeb !== \"function\" && typeof webStreamsState2.newReadableStreamFromStreamReadable === \"function\") {\n ReadableCtor.toWeb = function toWeb(readable) {\n return webStreamsState2.newReadableStreamFromStreamReadable(readable);\n };\n }\n }\n if (webStreamsState2 && typeof WritableCtor === \"function\") {\n if (typeof WritableCtor.fromWeb !== \"function\" && typeof webStreamsState2.newStreamWritableFromWritableStream === \"function\") {\n WritableCtor.fromWeb = function fromWeb(writableStream, options) {\n return webStreamsState2.newStreamWritableFromWritableStream(writableStream, options);\n };\n }\n if (typeof WritableCtor.toWeb !== \"function\" && typeof webStreamsState2.newWritableStreamFromStreamWritable === \"function\") {\n WritableCtor.toWeb = function toWeb(writable) {\n return webStreamsState2.newWritableStreamFromStreamWritable(writable);\n };\n }\n }\n if (webStreamsState2 && typeof result.Duplex === \"function\") {\n if (typeof result.Duplex.fromWeb !== \"function\" && typeof webStreamsState2.newStreamDuplexFromReadableWritablePair === \"function\") {\n result.Duplex.fromWeb = function fromWeb(pair, options) {\n return webStreamsState2.newStreamDuplexFromReadableWritablePair(pair, options);\n };\n }\n if (typeof result.Duplex.toWeb !== \"function\" && typeof webStreamsState2.newReadableWritablePairFromDuplex === \"function\") {\n result.Duplex.toWeb = function toWeb(duplex) {\n return webStreamsState2.newReadableWritablePairFromDuplex(duplex);\n };\n }\n }\n if (typeof ReadableCtor === \"function\" && !Object.getOwnPropertyDescriptor(ReadableCtor.prototype, \"readableObjectMode\")) {\n Object.defineProperty(ReadableCtor.prototype, \"readableObjectMode\", {\n configurable: true,\n enumerable: false,\n get() {\n return Boolean(this?._readableState?.objectMode);\n }\n });\n }\n if (typeof WritableCtor === \"function\" && !Object.getOwnPropertyDescriptor(WritableCtor.prototype, \"writableObjectMode\")) {\n Object.defineProperty(WritableCtor.prototype, \"writableObjectMode\", {\n configurable: true,\n enumerable: false,\n get() {\n return Boolean(this?._writableState?.objectMode);\n }\n });\n }\n return result;\n }\n if (name === \"url\") {\n const OriginalURL = result.URL;\n if (typeof OriginalURL !== \"function\" || OriginalURL._patched) {\n return result;\n }\n const PatchedURL = function PatchedURL2(url, base) {\n if (typeof url === \"string\" && url.startsWith(\"file:\") && !url.startsWith(\"file://\") && base === void 0) {\n if (typeof process !== \"undefined\" && typeof process.cwd === \"function\") {\n const cwd = process.cwd();\n if (cwd) {\n try {\n return new OriginalURL(url, \"file://\" + cwd + \"/\");\n } catch (e) {\n }\n }\n }\n }\n return base !== void 0 ? new OriginalURL(url, base) : new OriginalURL(url);\n };\n Object.keys(OriginalURL).forEach(function(key) {\n try {\n PatchedURL[key] = OriginalURL[key];\n } catch {\n }\n });\n Object.setPrototypeOf(PatchedURL, OriginalURL);\n PatchedURL.prototype = OriginalURL.prototype;\n PatchedURL._patched = true;\n const descriptor = Object.getOwnPropertyDescriptor(result, \"URL\");\n if (descriptor && descriptor.configurable !== true && descriptor.writable !== true && typeof descriptor.set !== \"function\") {\n return result;\n }\n try {\n result.URL = PatchedURL;\n } catch {\n try {\n Object.defineProperty(result, \"URL\", {\n value: PatchedURL,\n writable: true,\n configurable: true,\n enumerable: descriptor?.enumerable ?? true\n });\n } catch {\n }\n }\n return result;\n }\n if (name === \"zlib\") {\n if (typeof result.constants !== \"object\" || result.constants === null) {\n var zlibConstants = {};\n var constKeys = Object.keys(result);\n for (var ci = 0; ci < constKeys.length; ci++) {\n var ck = constKeys[ci];\n if (ck.indexOf(\"Z_\") === 0 && typeof result[ck] === \"number\") {\n zlibConstants[ck] = result[ck];\n }\n }\n if (typeof zlibConstants.DEFLATE !== \"number\") zlibConstants.DEFLATE = 1;\n if (typeof zlibConstants.INFLATE !== \"number\") zlibConstants.INFLATE = 2;\n if (typeof zlibConstants.GZIP !== \"number\") zlibConstants.GZIP = 3;\n if (typeof zlibConstants.DEFLATERAW !== \"number\") zlibConstants.DEFLATERAW = 4;\n if (typeof zlibConstants.INFLATERAW !== \"number\") zlibConstants.INFLATERAW = 5;\n if (typeof zlibConstants.UNZIP !== \"number\") zlibConstants.UNZIP = 6;\n if (typeof zlibConstants.GUNZIP !== \"number\") zlibConstants.GUNZIP = 7;\n result.constants = zlibConstants;\n }\n return result;\n }\n if (name === \"crypto\") {\n let createCryptoRangeError2 = function(name2, message) {\n var error = new RangeError(message);\n error.code = \"ERR_OUT_OF_RANGE\";\n error.name = \"RangeError\";\n return error;\n }, createCryptoError2 = function(code, message) {\n var error = new Error(message);\n error.code = code;\n return error;\n }, encodeCryptoResult2 = function(buffer, encoding) {\n if (!encoding || encoding === \"buffer\") return buffer;\n return buffer.toString(encoding);\n }, isSharedArrayBufferInstance2 = function(value) {\n return typeof SharedArrayBuffer !== \"undefined\" && value instanceof SharedArrayBuffer;\n }, isBinaryLike2 = function(value) {\n return Buffer.isBuffer(value) || ArrayBuffer.isView(value) || value instanceof ArrayBuffer || isSharedArrayBufferInstance2(value);\n }, normalizeByteSource2 = function(value, name2, options) {\n var allowNull = options && options.allowNull;\n if (allowNull && value === null) {\n return null;\n }\n if (typeof value === \"string\") {\n return Buffer.from(value, \"utf8\");\n }\n if (Buffer.isBuffer(value)) {\n return Buffer.from(value);\n }\n if (ArrayBuffer.isView(value)) {\n return Buffer.from(value.buffer, value.byteOffset, value.byteLength);\n }\n if (value instanceof ArrayBuffer || isSharedArrayBufferInstance2(value)) {\n return Buffer.from(value);\n }\n throw createInvalidArgTypeError(\n name2,\n \"of type string or an instance of ArrayBuffer, Buffer, TypedArray, or DataView\",\n value\n );\n }, serializeCipherBridgeOptions2 = function(options) {\n if (!options) {\n return \"\";\n }\n var serialized = {};\n if (options.authTagLength !== void 0) {\n serialized.authTagLength = options.authTagLength;\n }\n if (options.authTag) {\n serialized.authTag = options.authTag.toString(\"base64\");\n }\n if (options.aad) {\n serialized.aad = options.aad.toString(\"base64\");\n }\n if (options.aadOptions !== void 0) {\n serialized.aadOptions = options.aadOptions;\n }\n if (options.autoPadding !== void 0) {\n serialized.autoPadding = options.autoPadding;\n }\n if (options.validateOnly !== void 0) {\n serialized.validateOnly = options.validateOnly;\n }\n return JSON.stringify(serialized);\n };\n var createCryptoRangeError = createCryptoRangeError2, createCryptoError = createCryptoError2, encodeCryptoResult = encodeCryptoResult2, isSharedArrayBufferInstance = isSharedArrayBufferInstance2, isBinaryLike = isBinaryLike2, normalizeByteSource = normalizeByteSource2, serializeCipherBridgeOptions = serializeCipherBridgeOptions2;\n var _runtimeRequire = globalThis.require;\n var _streamModule = _runtimeRequire && _runtimeRequire(\"stream\");\n var _utilModule = _runtimeRequire && _runtimeRequire(\"util\");\n var _Transform = _streamModule && _streamModule.Transform;\n var _inherits = _utilModule && _utilModule.inherits;\n if (typeof _cryptoHashDigest !== \"undefined\") {\n let SandboxHash2 = function(algorithm, options) {\n if (!(this instanceof SandboxHash2)) {\n return new SandboxHash2(algorithm, options);\n }\n if (!_Transform || !_inherits) {\n throw new Error(\"stream.Transform is required for crypto.Hash\");\n }\n if (typeof algorithm !== \"string\") {\n throw createInvalidArgTypeError(\"algorithm\", \"of type string\", algorithm);\n }\n _Transform.call(this, options);\n this._algorithm = algorithm;\n this._chunks = [];\n this._finalized = false;\n this._cachedDigest = null;\n this._allowCachedDigest = false;\n };\n var SandboxHash = SandboxHash2;\n _inherits(SandboxHash2, _Transform);\n SandboxHash2.prototype.update = function update(data, inputEncoding) {\n if (this._finalized) {\n throw createCryptoError2(\"ERR_CRYPTO_HASH_FINALIZED\", \"Digest already called\");\n }\n if (typeof data === \"string\") {\n this._chunks.push(Buffer.from(data, inputEncoding || \"utf8\"));\n } else if (isBinaryLike2(data)) {\n this._chunks.push(Buffer.from(data));\n } else {\n throw createInvalidArgTypeError(\n \"data\",\n \"one of type string, Buffer, TypedArray, or DataView\",\n data\n );\n }\n return this;\n };\n SandboxHash2.prototype._finishDigest = function _finishDigest() {\n if (this._cachedDigest) {\n return this._cachedDigest;\n }\n var combined = Buffer.concat(this._chunks);\n var resultBase64 = _cryptoHashDigest.applySync(void 0, [\n this._algorithm,\n combined.toString(\"base64\")\n ]);\n this._cachedDigest = Buffer.from(resultBase64, \"base64\");\n this._finalized = true;\n return this._cachedDigest;\n };\n SandboxHash2.prototype.digest = function digest(encoding) {\n if (this._finalized && !this._allowCachedDigest) {\n throw createCryptoError2(\"ERR_CRYPTO_HASH_FINALIZED\", \"Digest already called\");\n }\n var resultBuffer = this._finishDigest();\n this._allowCachedDigest = false;\n return encodeCryptoResult2(resultBuffer, encoding);\n };\n SandboxHash2.prototype.copy = function copy() {\n if (this._finalized) {\n throw createCryptoError2(\"ERR_CRYPTO_HASH_FINALIZED\", \"Digest already called\");\n }\n var c = new SandboxHash2(this._algorithm);\n c._chunks = this._chunks.slice();\n return c;\n };\n SandboxHash2.prototype._transform = function _transform(chunk, encoding, callback) {\n try {\n this.update(chunk, encoding === \"buffer\" ? void 0 : encoding);\n callback();\n } catch (error) {\n callback(normalizeCryptoBridgeError(error));\n }\n };\n SandboxHash2.prototype._flush = function _flush(callback) {\n try {\n var output = this._finishDigest();\n this._allowCachedDigest = true;\n this.push(output);\n callback();\n } catch (error) {\n callback(normalizeCryptoBridgeError(error));\n }\n };\n result.createHash = function createHash(algorithm, options) {\n return new SandboxHash2(algorithm, options);\n };\n result.Hash = SandboxHash2;\n }\n if (typeof _cryptoHmacDigest !== \"undefined\") {\n let SandboxHmac2 = function(algorithm, key) {\n this._algorithm = algorithm;\n if (typeof key === \"string\") {\n this._key = Buffer.from(key, \"utf8\");\n } else if (key && typeof key === \"object\" && key._pem !== void 0) {\n this._key = Buffer.from(key._pem, \"utf8\");\n } else {\n this._key = Buffer.from(key);\n }\n this._chunks = [];\n };\n var SandboxHmac = SandboxHmac2;\n SandboxHmac2.prototype.update = function update(data, inputEncoding) {\n if (typeof data === \"string\") {\n this._chunks.push(Buffer.from(data, inputEncoding || \"utf8\"));\n } else {\n this._chunks.push(Buffer.from(data));\n }\n return this;\n };\n SandboxHmac2.prototype.digest = function digest(encoding) {\n var combined = Buffer.concat(this._chunks);\n var resultBase64 = _cryptoHmacDigest.applySync(void 0, [\n this._algorithm,\n this._key.toString(\"base64\"),\n combined.toString(\"base64\")\n ]);\n var resultBuffer = Buffer.from(resultBase64, \"base64\");\n if (!encoding || encoding === \"buffer\") return resultBuffer;\n return resultBuffer.toString(encoding);\n };\n SandboxHmac2.prototype.copy = function copy() {\n var c = new SandboxHmac2(this._algorithm, this._key);\n c._chunks = this._chunks.slice();\n return c;\n };\n SandboxHmac2.prototype.write = function write(data, encoding) {\n this.update(data, encoding);\n return true;\n };\n SandboxHmac2.prototype.end = function end(data, encoding) {\n if (data) this.update(data, encoding);\n };\n result.createHmac = function createHmac(algorithm, key) {\n return new SandboxHmac2(algorithm, key);\n };\n result.Hmac = SandboxHmac2;\n }\n if (typeof _cryptoRandomFill !== \"undefined\") {\n result.randomBytes = function randomBytes(size, callback) {\n if (typeof size !== \"number\" || size < 0 || size !== (size | 0)) {\n var err = new TypeError('The \"size\" argument must be of type number. Received type ' + typeof size);\n if (typeof callback === \"function\") {\n callback(err);\n return;\n }\n throw err;\n }\n if (size > 2147483647) {\n var rangeErr = new RangeError('The value of \"size\" is out of range. It must be >= 0 && <= 2147483647. Received ' + size);\n if (typeof callback === \"function\") {\n callback(rangeErr);\n return;\n }\n throw rangeErr;\n }\n var buf = Buffer.alloc(size);\n var offset = 0;\n while (offset < size) {\n var chunk = Math.min(size - offset, 65536);\n var base64 = _cryptoRandomFill.applySync(void 0, [chunk]);\n var hostBytes = Buffer.from(base64, \"base64\");\n hostBytes.copy(buf, offset);\n offset += chunk;\n }\n if (typeof callback === \"function\") {\n callback(null, buf);\n return;\n }\n return buf;\n };\n result.randomFillSync = function randomFillSync(buffer, offset, size) {\n if (offset === void 0) offset = 0;\n var byteLength = buffer.byteLength !== void 0 ? buffer.byteLength : buffer.length;\n if (size === void 0) size = byteLength - offset;\n if (offset < 0 || size < 0 || offset + size > byteLength) {\n throw new RangeError('The value of \"offset + size\" is out of range.');\n }\n var bytes = new Uint8Array(buffer.buffer || buffer, buffer.byteOffset ? buffer.byteOffset + offset : offset, size);\n var filled = 0;\n while (filled < size) {\n var chunk = Math.min(size - filled, 65536);\n var base64 = _cryptoRandomFill.applySync(void 0, [chunk]);\n var hostBytes = Buffer.from(base64, \"base64\");\n bytes.set(hostBytes, filled);\n filled += chunk;\n }\n return buffer;\n };\n result.randomFill = function randomFill(buffer, offsetOrCb, sizeOrCb, callback) {\n var offset = 0;\n var size;\n var cb;\n if (typeof offsetOrCb === \"function\") {\n cb = offsetOrCb;\n } else if (typeof sizeOrCb === \"function\") {\n offset = offsetOrCb || 0;\n cb = sizeOrCb;\n } else {\n offset = offsetOrCb || 0;\n size = sizeOrCb;\n cb = callback;\n }\n if (typeof cb !== \"function\") {\n throw new TypeError(\"Callback must be a function\");\n }\n try {\n result.randomFillSync(buffer, offset, size);\n cb(null, buffer);\n } catch (e) {\n cb(e);\n }\n };\n result.randomInt = function randomInt(minOrMax, maxOrCb, callback) {\n var min, max, cb;\n if (typeof maxOrCb === \"function\" || maxOrCb === void 0) {\n min = 0;\n max = minOrMax;\n cb = maxOrCb;\n } else {\n min = minOrMax;\n max = maxOrCb;\n cb = callback;\n }\n if (!Number.isSafeInteger(min)) {\n var minErr = new TypeError('The \"min\" argument must be a safe integer');\n if (typeof cb === \"function\") {\n cb(minErr);\n return;\n }\n throw minErr;\n }\n if (!Number.isSafeInteger(max)) {\n var maxErr = new TypeError('The \"max\" argument must be a safe integer');\n if (typeof cb === \"function\") {\n cb(maxErr);\n return;\n }\n throw maxErr;\n }\n if (max <= min) {\n var rangeErr2 = new RangeError('The value of \"max\" is out of range. It must be greater than the value of \"min\" (' + min + \")\");\n if (typeof cb === \"function\") {\n cb(rangeErr2);\n return;\n }\n throw rangeErr2;\n }\n var range = max - min;\n var bytes = 6;\n var maxValid = Math.pow(2, 48) - Math.pow(2, 48) % range;\n var val;\n do {\n var base64 = _cryptoRandomFill.applySync(void 0, [bytes]);\n var buf = Buffer.from(base64, \"base64\");\n val = buf.readUIntBE(0, bytes);\n } while (val >= maxValid);\n var result2 = min + val % range;\n if (typeof cb === \"function\") {\n cb(null, result2);\n return;\n }\n return result2;\n };\n }\n if (typeof _cryptoRandomUUID !== \"undefined\" && typeof result.randomUUID !== \"function\") {\n result.randomUUID = function randomUUID(options) {\n if (options !== void 0) {\n if (options === null || typeof options !== \"object\") {\n throw createInvalidArgTypeError(\"options\", \"of type object\", options);\n }\n if (Object.prototype.hasOwnProperty.call(options, \"disableEntropyCache\") && typeof options.disableEntropyCache !== \"boolean\") {\n throw createInvalidArgTypeError(\n \"options.disableEntropyCache\",\n \"of type boolean\",\n options.disableEntropyCache\n );\n }\n }\n var uuid = _cryptoRandomUUID.applySync(void 0, []);\n if (typeof uuid !== \"string\") {\n throw new Error(\"invalid host uuid\");\n }\n return uuid;\n };\n }\n if (typeof _cryptoPbkdf2 !== \"undefined\") {\n let createPbkdf2ArgTypeError2 = function(name2, value) {\n var received;\n if (value == null) {\n received = \" Received \" + value;\n } else if (typeof value === \"object\") {\n received = value.constructor && value.constructor.name ? \" Received an instance of \" + value.constructor.name : \" Received [object Object]\";\n } else {\n var inspected = typeof value === \"string\" ? \"'\" + value + \"'\" : String(value);\n received = \" Received type \" + typeof value + \" (\" + inspected + \")\";\n }\n var error = new TypeError('The \"' + name2 + '\" argument must be of type number.' + received);\n error.code = \"ERR_INVALID_ARG_TYPE\";\n return error;\n }, validatePbkdf2Args2 = function(password, salt, iterations, keylen, digest) {\n var pwBuf = normalizeByteSource2(password, \"password\");\n var saltBuf = normalizeByteSource2(salt, \"salt\");\n if (typeof iterations !== \"number\") {\n throw createPbkdf2ArgTypeError2(\"iterations\", iterations);\n }\n if (!Number.isInteger(iterations)) {\n throw createCryptoRangeError2(\n \"iterations\",\n 'The value of \"iterations\" is out of range. It must be an integer. Received ' + iterations\n );\n }\n if (iterations < 1 || iterations > 2147483647) {\n throw createCryptoRangeError2(\n \"iterations\",\n 'The value of \"iterations\" is out of range. It must be >= 1 && <= 2147483647. Received ' + iterations\n );\n }\n if (typeof keylen !== \"number\") {\n throw createPbkdf2ArgTypeError2(\"keylen\", keylen);\n }\n if (!Number.isInteger(keylen)) {\n throw createCryptoRangeError2(\n \"keylen\",\n 'The value of \"keylen\" is out of range. It must be an integer. Received ' + keylen\n );\n }\n if (keylen < 0 || keylen > 2147483647) {\n throw createCryptoRangeError2(\n \"keylen\",\n 'The value of \"keylen\" is out of range. It must be >= 0 && <= 2147483647. Received ' + keylen\n );\n }\n if (typeof digest !== \"string\") {\n throw createInvalidArgTypeError(\"digest\", \"of type string\", digest);\n }\n return {\n password: pwBuf,\n salt: saltBuf\n };\n };\n var createPbkdf2ArgTypeError = createPbkdf2ArgTypeError2, validatePbkdf2Args = validatePbkdf2Args2;\n result.pbkdf2Sync = function pbkdf2Sync(password, salt, iterations, keylen, digest) {\n var normalized = validatePbkdf2Args2(password, salt, iterations, keylen, digest);\n try {\n var resultBase64 = _cryptoPbkdf2.applySync(void 0, [\n normalized.password.toString(\"base64\"),\n normalized.salt.toString(\"base64\"),\n iterations,\n keylen,\n digest\n ]);\n return Buffer.from(resultBase64, \"base64\");\n } catch (error) {\n throw normalizeCryptoBridgeError(error);\n }\n };\n result.pbkdf2 = function pbkdf2(password, salt, iterations, keylen, digest, callback) {\n if (typeof digest === \"function\" && callback === void 0) {\n callback = digest;\n digest = void 0;\n }\n if (typeof callback !== \"function\") {\n throw createInvalidArgTypeError(\"callback\", \"of type function\", callback);\n }\n try {\n var derived = result.pbkdf2Sync(password, salt, iterations, keylen, digest);\n scheduleCryptoCallback(callback, [null, derived]);\n } catch (e) {\n throw normalizeCryptoBridgeError(e);\n }\n };\n }\n if (typeof _cryptoScrypt !== \"undefined\") {\n result.scryptSync = function scryptSync(password, salt, keylen, options) {\n var pwBuf = typeof password === \"string\" ? Buffer.from(password, \"utf8\") : Buffer.from(password);\n var saltBuf = typeof salt === \"string\" ? Buffer.from(salt, \"utf8\") : Buffer.from(salt);\n var opts = {};\n if (options) {\n if (options.N !== void 0) opts.N = options.N;\n if (options.r !== void 0) opts.r = options.r;\n if (options.p !== void 0) opts.p = options.p;\n if (options.maxmem !== void 0) opts.maxmem = options.maxmem;\n if (options.cost !== void 0) opts.N = options.cost;\n if (options.blockSize !== void 0) opts.r = options.blockSize;\n if (options.parallelization !== void 0) opts.p = options.parallelization;\n }\n var resultBase64 = _cryptoScrypt.applySync(void 0, [\n pwBuf.toString(\"base64\"),\n saltBuf.toString(\"base64\"),\n keylen,\n JSON.stringify(opts)\n ]);\n return Buffer.from(resultBase64, \"base64\");\n };\n result.scrypt = function scrypt(password, salt, keylen, optionsOrCb, callback) {\n var opts = optionsOrCb;\n var cb = callback;\n if (typeof optionsOrCb === \"function\") {\n opts = void 0;\n cb = optionsOrCb;\n }\n try {\n var derived = result.scryptSync(password, salt, keylen, opts);\n cb(null, derived);\n } catch (e) {\n cb(e);\n }\n };\n }\n if (typeof _cryptoCipheriv !== \"undefined\") {\n let SandboxCipher2 = function(algorithm, key, iv, options) {\n if (!(this instanceof SandboxCipher2)) {\n return new SandboxCipher2(algorithm, key, iv, options);\n }\n if (typeof algorithm !== \"string\") {\n throw createInvalidArgTypeError(\"cipher\", \"of type string\", algorithm);\n }\n _Transform.call(this);\n this._algorithm = algorithm;\n this._key = normalizeByteSource2(key, \"key\");\n this._iv = normalizeByteSource2(iv, \"iv\", { allowNull: true });\n this._options = options || void 0;\n this._authTag = null;\n this._finalized = false;\n this._sessionCreated = false;\n this._sessionId = void 0;\n this._aad = null;\n this._aadOptions = void 0;\n this._autoPadding = void 0;\n this._chunks = [];\n this._bufferedMode = !_useSessionCipher || !!options;\n if (!this._bufferedMode) {\n this._ensureSession();\n } else if (!options) {\n _cryptoCipheriv.applySync(void 0, [\n this._algorithm,\n this._key.toString(\"base64\"),\n this._iv === null ? null : this._iv.toString(\"base64\"),\n \"\",\n serializeCipherBridgeOptions2({ validateOnly: true })\n ]);\n }\n };\n var SandboxCipher = SandboxCipher2;\n var _useSessionCipher = typeof _cryptoCipherivCreate !== \"undefined\";\n _inherits(SandboxCipher2, _Transform);\n SandboxCipher2.prototype._ensureSession = function _ensureSession() {\n if (this._bufferedMode || this._sessionCreated) {\n return;\n }\n this._sessionCreated = true;\n this._sessionId = _cryptoCipherivCreate.applySync(void 0, [\n \"cipher\",\n this._algorithm,\n this._key.toString(\"base64\"),\n this._iv === null ? null : this._iv.toString(\"base64\"),\n serializeCipherBridgeOptions2(this._getBridgeOptions())\n ]);\n };\n SandboxCipher2.prototype._getBridgeOptions = function _getBridgeOptions() {\n var options = {};\n if (this._options && this._options.authTagLength !== void 0) {\n options.authTagLength = this._options.authTagLength;\n }\n if (this._aad) {\n options.aad = this._aad;\n }\n if (this._aadOptions !== void 0) {\n options.aadOptions = this._aadOptions;\n }\n if (this._autoPadding !== void 0) {\n options.autoPadding = this._autoPadding;\n }\n return Object.keys(options).length === 0 ? null : options;\n };\n SandboxCipher2.prototype.update = function update(data, inputEncoding, outputEncoding) {\n if (this._finalized) {\n throw new Error(\"Attempting to call update() after final()\");\n }\n var buf;\n if (typeof data === \"string\") {\n buf = Buffer.from(data, inputEncoding || \"utf8\");\n } else {\n buf = normalizeByteSource2(data, \"data\");\n }\n if (!this._bufferedMode) {\n this._ensureSession();\n var resultBase64 = _cryptoCipherivUpdate.applySync(void 0, [this._sessionId, buf.toString(\"base64\")]);\n var resultBuffer = Buffer.from(resultBase64, \"base64\");\n return encodeCryptoResult2(resultBuffer, outputEncoding);\n }\n this._chunks.push(buf);\n return encodeCryptoResult2(Buffer.alloc(0), outputEncoding);\n };\n SandboxCipher2.prototype.final = function final(outputEncoding) {\n if (this._finalized) throw new Error(\"Attempting to call final() after already finalized\");\n this._finalized = true;\n var parsed;\n if (!this._bufferedMode) {\n this._ensureSession();\n var resultJson = _cryptoCipherivFinal.applySync(void 0, [this._sessionId]);\n parsed = JSON.parse(resultJson);\n } else {\n var combined = Buffer.concat(this._chunks);\n var resultJson2 = _cryptoCipheriv.applySync(void 0, [\n this._algorithm,\n this._key.toString(\"base64\"),\n this._iv === null ? null : this._iv.toString(\"base64\"),\n combined.toString(\"base64\"),\n serializeCipherBridgeOptions2(this._getBridgeOptions())\n ]);\n parsed = JSON.parse(resultJson2);\n }\n if (parsed.authTag) {\n this._authTag = Buffer.from(parsed.authTag, \"base64\");\n }\n var resultBuffer = Buffer.from(parsed.data, \"base64\");\n return encodeCryptoResult2(resultBuffer, outputEncoding);\n };\n SandboxCipher2.prototype.getAuthTag = function getAuthTag() {\n if (!this._finalized) throw new Error(\"Cannot call getAuthTag before final()\");\n if (!this._authTag) throw new Error(\"Auth tag is not available\");\n return this._authTag;\n };\n SandboxCipher2.prototype.setAAD = function setAAD(aad, options) {\n this._bufferedMode = true;\n this._aad = normalizeByteSource2(aad, \"buffer\");\n this._aadOptions = options;\n return this;\n };\n SandboxCipher2.prototype.setAutoPadding = function setAutoPadding(autoPadding) {\n this._bufferedMode = true;\n this._autoPadding = autoPadding !== false;\n return this;\n };\n SandboxCipher2.prototype._transform = function _transform(chunk, encoding, callback) {\n try {\n var output = this.update(chunk, encoding === \"buffer\" ? void 0 : encoding);\n if (output.length) {\n this.push(output);\n }\n callback();\n } catch (error) {\n callback(normalizeCryptoBridgeError(error));\n }\n };\n SandboxCipher2.prototype._flush = function _flush(callback) {\n try {\n var output = this.final();\n if (output.length) {\n this.push(output);\n }\n callback();\n } catch (error) {\n callback(normalizeCryptoBridgeError(error));\n }\n };\n result.createCipheriv = function createCipheriv(algorithm, key, iv, options) {\n return new SandboxCipher2(algorithm, key, iv, options);\n };\n result.Cipheriv = SandboxCipher2;\n }\n if (typeof _cryptoDecipheriv !== \"undefined\") {\n let SandboxDecipher2 = function(algorithm, key, iv, options) {\n if (!(this instanceof SandboxDecipher2)) {\n return new SandboxDecipher2(algorithm, key, iv, options);\n }\n if (typeof algorithm !== \"string\") {\n throw createInvalidArgTypeError(\"cipher\", \"of type string\", algorithm);\n }\n _Transform.call(this);\n this._algorithm = algorithm;\n this._key = normalizeByteSource2(key, \"key\");\n this._iv = normalizeByteSource2(iv, \"iv\", { allowNull: true });\n this._options = options || void 0;\n this._authTag = null;\n this._finalized = false;\n this._sessionCreated = false;\n this._aad = null;\n this._aadOptions = void 0;\n this._autoPadding = void 0;\n this._chunks = [];\n this._bufferedMode = !_useSessionCipher || !!options;\n if (!this._bufferedMode) {\n this._ensureSession();\n } else if (!options) {\n _cryptoDecipheriv.applySync(void 0, [\n this._algorithm,\n this._key.toString(\"base64\"),\n this._iv === null ? null : this._iv.toString(\"base64\"),\n \"\",\n serializeCipherBridgeOptions2({ validateOnly: true })\n ]);\n }\n };\n var SandboxDecipher = SandboxDecipher2;\n _inherits(SandboxDecipher2, _Transform);\n SandboxDecipher2.prototype._ensureSession = function _ensureSession() {\n if (!this._bufferedMode && !this._sessionCreated) {\n this._sessionCreated = true;\n this._sessionId = _cryptoCipherivCreate.applySync(void 0, [\n \"decipher\",\n this._algorithm,\n this._key.toString(\"base64\"),\n this._iv === null ? null : this._iv.toString(\"base64\"),\n serializeCipherBridgeOptions2(this._getBridgeOptions())\n ]);\n }\n };\n SandboxDecipher2.prototype._getBridgeOptions = function _getBridgeOptions() {\n var options = {};\n if (this._options && this._options.authTagLength !== void 0) {\n options.authTagLength = this._options.authTagLength;\n }\n if (this._authTag) {\n options.authTag = this._authTag;\n }\n if (this._aad) {\n options.aad = this._aad;\n }\n if (this._aadOptions !== void 0) {\n options.aadOptions = this._aadOptions;\n }\n if (this._autoPadding !== void 0) {\n options.autoPadding = this._autoPadding;\n }\n return Object.keys(options).length === 0 ? null : options;\n };\n SandboxDecipher2.prototype.update = function update(data, inputEncoding, outputEncoding) {\n if (this._finalized) {\n throw new Error(\"Attempting to call update() after final()\");\n }\n var buf;\n if (typeof data === \"string\") {\n buf = Buffer.from(data, inputEncoding || \"utf8\");\n } else {\n buf = normalizeByteSource2(data, \"data\");\n }\n if (!this._bufferedMode) {\n this._ensureSession();\n var resultBase64 = _cryptoCipherivUpdate.applySync(void 0, [this._sessionId, buf.toString(\"base64\")]);\n var resultBuffer = Buffer.from(resultBase64, \"base64\");\n return encodeCryptoResult2(resultBuffer, outputEncoding);\n }\n this._chunks.push(buf);\n return encodeCryptoResult2(Buffer.alloc(0), outputEncoding);\n };\n SandboxDecipher2.prototype.final = function final(outputEncoding) {\n if (this._finalized) throw new Error(\"Attempting to call final() after already finalized\");\n this._finalized = true;\n var resultBuffer;\n if (!this._bufferedMode) {\n this._ensureSession();\n var resultJson = _cryptoCipherivFinal.applySync(void 0, [this._sessionId]);\n var parsed = JSON.parse(resultJson);\n resultBuffer = Buffer.from(parsed.data, \"base64\");\n } else {\n var combined = Buffer.concat(this._chunks);\n var options = {};\n var resultBase64 = _cryptoDecipheriv.applySync(void 0, [\n this._algorithm,\n this._key.toString(\"base64\"),\n this._iv === null ? null : this._iv.toString(\"base64\"),\n combined.toString(\"base64\"),\n serializeCipherBridgeOptions2(this._getBridgeOptions())\n ]);\n resultBuffer = Buffer.from(resultBase64, \"base64\");\n }\n return encodeCryptoResult2(resultBuffer, outputEncoding);\n };\n SandboxDecipher2.prototype.setAuthTag = function setAuthTag(tag) {\n this._bufferedMode = true;\n this._authTag = typeof tag === \"string\" ? Buffer.from(tag, \"base64\") : normalizeByteSource2(tag, \"buffer\");\n return this;\n };\n SandboxDecipher2.prototype.setAAD = function setAAD(aad, options) {\n this._bufferedMode = true;\n this._aad = normalizeByteSource2(aad, \"buffer\");\n this._aadOptions = options;\n return this;\n };\n SandboxDecipher2.prototype.setAutoPadding = function setAutoPadding(autoPadding) {\n this._bufferedMode = true;\n this._autoPadding = autoPadding !== false;\n return this;\n };\n SandboxDecipher2.prototype._transform = function _transform(chunk, encoding, callback) {\n try {\n var output = this.update(chunk, encoding === \"buffer\" ? void 0 : encoding);\n if (output.length) {\n this.push(output);\n }\n callback();\n } catch (error) {\n callback(normalizeCryptoBridgeError(error));\n }\n };\n SandboxDecipher2.prototype._flush = function _flush(callback) {\n try {\n var output = this.final();\n if (output.length) {\n this.push(output);\n }\n callback();\n } catch (error) {\n callback(normalizeCryptoBridgeError(error));\n }\n };\n result.createDecipheriv = function createDecipheriv(algorithm, key, iv, options) {\n return new SandboxDecipher2(algorithm, key, iv, options);\n };\n result.Decipheriv = SandboxDecipher2;\n }\n if (typeof _cryptoSign !== \"undefined\") {\n result.sign = function sign(algorithm, data, key) {\n var dataBuf = typeof data === \"string\" ? Buffer.from(data, \"utf8\") : Buffer.from(data);\n var sigBase64;\n try {\n sigBase64 = _cryptoSign.applySync(void 0, [\n algorithm === void 0 ? null : algorithm,\n dataBuf.toString(\"base64\"),\n JSON.stringify(serializeBridgeValue(key))\n ]);\n } catch (error) {\n throw normalizeCryptoBridgeError(error);\n }\n return Buffer.from(sigBase64, \"base64\");\n };\n }\n if (typeof _cryptoVerify !== \"undefined\") {\n result.verify = function verify(algorithm, data, key, signature) {\n var dataBuf = typeof data === \"string\" ? Buffer.from(data, \"utf8\") : Buffer.from(data);\n var sigBuf = typeof signature === \"string\" ? Buffer.from(signature, \"base64\") : Buffer.from(signature);\n try {\n return _cryptoVerify.applySync(void 0, [\n algorithm === void 0 ? null : algorithm,\n dataBuf.toString(\"base64\"),\n JSON.stringify(serializeBridgeValue(key)),\n sigBuf.toString(\"base64\")\n ]);\n } catch (error) {\n throw normalizeCryptoBridgeError(error);\n }\n };\n }\n if (typeof _cryptoAsymmetricOp !== \"undefined\") {\n let asymmetricBridgeCall2 = function(operation, key, data) {\n var dataBuf = toRawBuffer(data);\n var resultBase64;\n try {\n resultBase64 = _cryptoAsymmetricOp.applySync(void 0, [\n operation,\n JSON.stringify(serializeBridgeValue(key)),\n dataBuf.toString(\"base64\")\n ]);\n } catch (error) {\n throw normalizeCryptoBridgeError(error);\n }\n return Buffer.from(resultBase64, \"base64\");\n };\n var asymmetricBridgeCall = asymmetricBridgeCall2;\n result.publicEncrypt = function publicEncrypt(key, data) {\n return asymmetricBridgeCall2(\"publicEncrypt\", key, data);\n };\n result.privateDecrypt = function privateDecrypt(key, data) {\n return asymmetricBridgeCall2(\"privateDecrypt\", key, data);\n };\n result.privateEncrypt = function privateEncrypt(key, data) {\n return asymmetricBridgeCall2(\"privateEncrypt\", key, data);\n };\n result.publicDecrypt = function publicDecrypt(key, data) {\n return asymmetricBridgeCall2(\"publicDecrypt\", key, data);\n };\n }\n if (typeof _cryptoDiffieHellmanSessionCreate !== \"undefined\" && typeof _cryptoDiffieHellmanSessionCall !== \"undefined\") {\n let serializeDhKeyObject2 = function(value) {\n if (value.type === \"secret\") {\n return {\n type: \"secret\",\n raw: Buffer.from(value.export()).toString(\"base64\")\n };\n }\n return {\n type: value.type,\n pem: value._pem || value.export({\n type: value.type === \"private\" ? \"pkcs8\" : \"spki\",\n format: \"pem\"\n })\n };\n }, serializeDhValue2 = function(value) {\n if (value === null || typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n return value;\n }\n if (Buffer.isBuffer(value)) {\n return {\n __type: \"buffer\",\n value: Buffer.from(value).toString(\"base64\")\n };\n }\n if (value instanceof ArrayBuffer) {\n return {\n __type: \"buffer\",\n value: Buffer.from(new Uint8Array(value)).toString(\"base64\")\n };\n }\n if (ArrayBuffer.isView(value)) {\n return {\n __type: \"buffer\",\n value: Buffer.from(value.buffer, value.byteOffset, value.byteLength).toString(\"base64\")\n };\n }\n if (typeof value === \"bigint\") {\n return {\n __type: \"bigint\",\n value: value.toString()\n };\n }\n if (value && typeof value === \"object\" && (value.type === \"public\" || value.type === \"private\" || value.type === \"secret\") && typeof value.export === \"function\") {\n return {\n __type: \"keyObject\",\n value: serializeDhKeyObject2(value)\n };\n }\n if (Array.isArray(value)) {\n return value.map(serializeDhValue2);\n }\n if (value && typeof value === \"object\") {\n var output = {};\n var keys = Object.keys(value);\n for (var i = 0; i < keys.length; i++) {\n if (value[keys[i]] !== void 0) {\n output[keys[i]] = serializeDhValue2(value[keys[i]]);\n }\n }\n return output;\n }\n return String(value);\n }, restoreDhValue2 = function(value) {\n if (!value || typeof value !== \"object\") {\n return value;\n }\n if (value.__type === \"buffer\") {\n return Buffer.from(value.value, \"base64\");\n }\n if (value.__type === \"bigint\") {\n return BigInt(value.value);\n }\n if (Array.isArray(value)) {\n return value.map(restoreDhValue2);\n }\n var output = {};\n var keys = Object.keys(value);\n for (var i = 0; i < keys.length; i++) {\n output[keys[i]] = restoreDhValue2(value[keys[i]]);\n }\n return output;\n }, createDhSession2 = function(type, name2, argsLike) {\n var args = [];\n for (var i = 0; i < argsLike.length; i++) {\n args.push(serializeDhValue2(argsLike[i]));\n }\n return _cryptoDiffieHellmanSessionCreate.applySync(void 0, [\n JSON.stringify({\n type,\n name: name2,\n args\n })\n ]);\n }, callDhSession2 = function(sessionId, method, argsLike) {\n var args = [];\n for (var i = 0; i < argsLike.length; i++) {\n args.push(serializeDhValue2(argsLike[i]));\n }\n var response = JSON.parse(_cryptoDiffieHellmanSessionCall.applySync(void 0, [\n sessionId,\n JSON.stringify({\n method,\n args\n })\n ]));\n if (response && response.hasResult === false) {\n return void 0;\n }\n return restoreDhValue2(response && response.result);\n }, SandboxDiffieHellman2 = function(sessionId) {\n this._sessionId = sessionId;\n }, SandboxECDH2 = function(sessionId) {\n SandboxDiffieHellman2.call(this, sessionId);\n };\n var serializeDhKeyObject = serializeDhKeyObject2, serializeDhValue = serializeDhValue2, restoreDhValue = restoreDhValue2, createDhSession = createDhSession2, callDhSession = callDhSession2, SandboxDiffieHellman = SandboxDiffieHellman2, SandboxECDH = SandboxECDH2;\n Object.defineProperty(SandboxDiffieHellman2.prototype, \"verifyError\", {\n get: function getVerifyError() {\n return callDhSession2(this._sessionId, \"verifyError\", []);\n }\n });\n SandboxDiffieHellman2.prototype.generateKeys = function generateKeys(encoding) {\n if (arguments.length === 0) return callDhSession2(this._sessionId, \"generateKeys\", []);\n return callDhSession2(this._sessionId, \"generateKeys\", [encoding]);\n };\n SandboxDiffieHellman2.prototype.computeSecret = function computeSecret(key, inputEncoding, outputEncoding) {\n return callDhSession2(this._sessionId, \"computeSecret\", Array.prototype.slice.call(arguments));\n };\n SandboxDiffieHellman2.prototype.getPrime = function getPrime(encoding) {\n if (arguments.length === 0) return callDhSession2(this._sessionId, \"getPrime\", []);\n return callDhSession2(this._sessionId, \"getPrime\", [encoding]);\n };\n SandboxDiffieHellman2.prototype.getGenerator = function getGenerator(encoding) {\n if (arguments.length === 0) return callDhSession2(this._sessionId, \"getGenerator\", []);\n return callDhSession2(this._sessionId, \"getGenerator\", [encoding]);\n };\n SandboxDiffieHellman2.prototype.getPublicKey = function getPublicKey(encoding) {\n if (arguments.length === 0) return callDhSession2(this._sessionId, \"getPublicKey\", []);\n return callDhSession2(this._sessionId, \"getPublicKey\", [encoding]);\n };\n SandboxDiffieHellman2.prototype.getPrivateKey = function getPrivateKey(encoding) {\n if (arguments.length === 0) return callDhSession2(this._sessionId, \"getPrivateKey\", []);\n return callDhSession2(this._sessionId, \"getPrivateKey\", [encoding]);\n };\n SandboxDiffieHellman2.prototype.setPublicKey = function setPublicKey(key, encoding) {\n return callDhSession2(this._sessionId, \"setPublicKey\", Array.prototype.slice.call(arguments));\n };\n SandboxDiffieHellman2.prototype.setPrivateKey = function setPrivateKey(key, encoding) {\n return callDhSession2(this._sessionId, \"setPrivateKey\", Array.prototype.slice.call(arguments));\n };\n SandboxECDH2.prototype = Object.create(SandboxDiffieHellman2.prototype);\n SandboxECDH2.prototype.constructor = SandboxECDH2;\n SandboxECDH2.prototype.getPublicKey = function getPublicKey(encoding, format) {\n return callDhSession2(this._sessionId, \"getPublicKey\", Array.prototype.slice.call(arguments));\n };\n result.createDiffieHellman = function createDiffieHellman() {\n return new SandboxDiffieHellman2(createDhSession2(\"dh\", void 0, arguments));\n };\n result.getDiffieHellman = function getDiffieHellman(name2) {\n return new SandboxDiffieHellman2(createDhSession2(\"group\", name2, []));\n };\n result.createDiffieHellmanGroup = result.getDiffieHellman;\n result.createECDH = function createECDH(curve) {\n return new SandboxECDH2(createDhSession2(\"ecdh\", curve, []));\n };\n if (typeof _cryptoDiffieHellman !== \"undefined\") {\n result.diffieHellman = function diffieHellman(options) {\n var resultJson = _cryptoDiffieHellman.applySync(void 0, [\n JSON.stringify(serializeDhValue2(options))\n ]);\n return restoreDhValue2(JSON.parse(resultJson));\n };\n }\n result.DiffieHellman = SandboxDiffieHellman2;\n result.DiffieHellmanGroup = SandboxDiffieHellman2;\n result.ECDH = SandboxECDH2;\n }\n if (typeof _cryptoGenerateKeyPairSync !== \"undefined\") {\n let restoreBridgeValue2 = function(value) {\n if (!value || typeof value !== \"object\") {\n return value;\n }\n if (value.__type === \"buffer\") {\n return Buffer.from(value.value, \"base64\");\n }\n if (value.__type === \"bigint\") {\n return BigInt(value.value);\n }\n if (Array.isArray(value)) {\n return value.map(restoreBridgeValue2);\n }\n var output = {};\n var keys = Object.keys(value);\n for (var i = 0; i < keys.length; i++) {\n output[keys[i]] = restoreBridgeValue2(value[keys[i]]);\n }\n return output;\n }, cloneObject2 = function(value) {\n if (!value || typeof value !== \"object\") {\n return value;\n }\n if (Array.isArray(value)) {\n return value.map(cloneObject2);\n }\n var output = {};\n var keys = Object.keys(value);\n for (var i = 0; i < keys.length; i++) {\n output[keys[i]] = cloneObject2(value[keys[i]]);\n }\n return output;\n }, createDomException2 = function(message, name2) {\n if (typeof DOMException === \"function\") {\n return new DOMException(message, name2);\n }\n var error = new Error(message);\n error.name = name2;\n return error;\n }, toRawBuffer2 = function(data, encoding) {\n if (Buffer.isBuffer(data)) {\n return Buffer.from(data);\n }\n if (data instanceof ArrayBuffer) {\n return Buffer.from(new Uint8Array(data));\n }\n if (ArrayBuffer.isView(data)) {\n return Buffer.from(data.buffer, data.byteOffset, data.byteLength);\n }\n if (typeof data === \"string\") {\n return Buffer.from(data, encoding || \"utf8\");\n }\n return Buffer.from(data);\n }, serializeBridgeValue2 = function(value) {\n if (value === null) {\n return null;\n }\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n return value;\n }\n if (typeof value === \"bigint\") {\n return {\n __type: \"bigint\",\n value: value.toString()\n };\n }\n if (Buffer.isBuffer(value)) {\n return {\n __type: \"buffer\",\n value: Buffer.from(value).toString(\"base64\")\n };\n }\n if (value instanceof ArrayBuffer) {\n return {\n __type: \"buffer\",\n value: Buffer.from(new Uint8Array(value)).toString(\"base64\")\n };\n }\n if (ArrayBuffer.isView(value)) {\n return {\n __type: \"buffer\",\n value: Buffer.from(value.buffer, value.byteOffset, value.byteLength).toString(\"base64\")\n };\n }\n if (Array.isArray(value)) {\n return value.map(serializeBridgeValue2);\n }\n if (value && typeof value === \"object\" && (value.type === \"public\" || value.type === \"private\" || value.type === \"secret\") && typeof value.export === \"function\") {\n if (value.type === \"secret\") {\n return {\n __type: \"keyObject\",\n value: {\n type: \"secret\",\n raw: Buffer.from(value.export()).toString(\"base64\")\n }\n };\n }\n return {\n __type: \"keyObject\",\n value: {\n type: value.type,\n pem: value._pem\n }\n };\n }\n if (value && typeof value === \"object\") {\n var output = {};\n var keys = Object.keys(value);\n for (var i = 0; i < keys.length; i++) {\n var entry = value[keys[i]];\n if (entry !== void 0) {\n output[keys[i]] = serializeBridgeValue2(entry);\n }\n }\n return output;\n }\n return String(value);\n }, normalizeCryptoBridgeError2 = function(error) {\n if (!error || typeof error !== \"object\") {\n return error;\n }\n if (error.code === void 0 && error.message === \"error:07880109:common libcrypto routines::interrupted or cancelled\") {\n error.code = \"ERR_OSSL_CRYPTO_INTERRUPTED_OR_CANCELLED\";\n }\n return error;\n }, deserializeGeneratedKeyValue2 = function(value) {\n if (!value || typeof value !== \"object\") {\n return value;\n }\n if (value.kind === \"string\") {\n return value.value;\n }\n if (value.kind === \"buffer\") {\n return Buffer.from(value.value, \"base64\");\n }\n if (value.kind === \"keyObject\") {\n return createGeneratedKeyObject2(value.value);\n }\n if (value.kind === \"object\") {\n return value.value;\n }\n return value;\n }, serializeBridgeOptions2 = function(options) {\n return JSON.stringify({\n hasOptions: options !== void 0,\n options: options === void 0 ? null : serializeBridgeValue2(options)\n });\n }, createInvalidArgTypeError2 = function(name2, expected, value) {\n var received;\n if (value == null) {\n received = \" Received \" + value;\n } else if (typeof value === \"function\") {\n received = \" Received function \" + (value.name || \"anonymous\");\n } else if (typeof value === \"object\") {\n if (value.constructor && value.constructor.name) {\n received = \" Received an instance of \" + value.constructor.name;\n } else {\n received = \" Received [object Object]\";\n }\n } else {\n var inspected = typeof value === \"string\" ? \"'\" + value + \"'\" : String(value);\n if (inspected.length > 28) {\n inspected = inspected.slice(0, 25) + \"...\";\n }\n received = \" Received type \" + typeof value + \" (\" + inspected + \")\";\n }\n var error = new TypeError('The \"' + name2 + '\" argument must be ' + expected + \".\" + received);\n error.code = \"ERR_INVALID_ARG_TYPE\";\n return error;\n }, scheduleCryptoCallback2 = function(callback, args) {\n setTimeout(function() {\n callback.apply(void 0, args);\n }, 0);\n }, shouldThrowCryptoValidationError2 = function(error) {\n if (!error || typeof error !== \"object\") {\n return false;\n }\n if (error.name === \"TypeError\" || error.name === \"RangeError\") {\n return true;\n }\n var code = error.code;\n return code === \"ERR_MISSING_OPTION\" || code === \"ERR_CRYPTO_UNKNOWN_DH_GROUP\" || code === \"ERR_OUT_OF_RANGE\" || typeof code === \"string\" && code.indexOf(\"ERR_INVALID_ARG_\") === 0;\n }, ensureCryptoCallback2 = function(callback, syncValidator) {\n if (typeof callback === \"function\") {\n return callback;\n }\n if (typeof syncValidator === \"function\") {\n syncValidator();\n }\n throw createInvalidArgTypeError2(\"callback\", \"of type function\", callback);\n }, SandboxKeyObject2 = function(type, handle) {\n this.type = type;\n this._pem = handle && handle.pem !== void 0 ? handle.pem : void 0;\n this._raw = handle && handle.raw !== void 0 ? handle.raw : void 0;\n this._jwk = handle && handle.jwk !== void 0 ? cloneObject2(handle.jwk) : void 0;\n this.asymmetricKeyType = handle && handle.asymmetricKeyType !== void 0 ? handle.asymmetricKeyType : void 0;\n this.asymmetricKeyDetails = handle && handle.asymmetricKeyDetails !== void 0 ? restoreBridgeValue2(handle.asymmetricKeyDetails) : void 0;\n this.symmetricKeySize = type === \"secret\" && handle && handle.raw !== void 0 ? Buffer.from(handle.raw, \"base64\").byteLength : void 0;\n }, normalizeNamedCurve2 = function(namedCurve) {\n if (!namedCurve) {\n return namedCurve;\n }\n var upper = String(namedCurve).toUpperCase();\n if (upper === \"PRIME256V1\" || upper === \"SECP256R1\") return \"P-256\";\n if (upper === \"SECP384R1\") return \"P-384\";\n if (upper === \"SECP521R1\") return \"P-521\";\n return namedCurve;\n }, normalizeAlgorithmInput2 = function(algorithm) {\n if (typeof algorithm === \"string\") {\n return { name: algorithm };\n }\n return Object.assign({}, algorithm);\n }, createCompatibleCryptoKey2 = function(keyData) {\n var key;\n if (globalThis.CryptoKey && globalThis.CryptoKey.prototype && globalThis.CryptoKey.prototype !== SandboxCryptoKey.prototype) {\n key = Object.create(globalThis.CryptoKey.prototype);\n key.type = keyData.type;\n key.extractable = keyData.extractable;\n key.algorithm = keyData.algorithm;\n key.usages = keyData.usages;\n key._keyData = keyData;\n key._pem = keyData._pem;\n key._jwk = keyData._jwk;\n key._raw = keyData._raw;\n key._sourceKeyObjectData = keyData._sourceKeyObjectData;\n return key;\n }\n return new SandboxCryptoKey(keyData);\n }, buildCryptoKeyFromKeyObject2 = function(keyObject, algorithm, extractable, usages) {\n var algo = normalizeAlgorithmInput2(algorithm);\n var name2 = algo.name;\n if (keyObject.type === \"secret\") {\n var secretBytes = Buffer.from(keyObject._raw || \"\", \"base64\");\n if (name2 === \"PBKDF2\") {\n if (extractable) {\n throw new SyntaxError(\"PBKDF2 keys are not extractable\");\n }\n if (usages.some(function(usage) {\n return usage !== \"deriveBits\" && usage !== \"deriveKey\";\n })) {\n throw new SyntaxError(\"Unsupported key usage for a PBKDF2 key\");\n }\n return createCompatibleCryptoKey2({\n type: \"secret\",\n extractable,\n algorithm: { name: name2 },\n usages: Array.from(usages),\n _raw: keyObject._raw,\n _sourceKeyObjectData: {\n type: \"secret\",\n raw: keyObject._raw\n }\n });\n }\n if (name2 === \"HMAC\") {\n if (!secretBytes.byteLength || algo.length === 0) {\n throw createDomException2(\"Zero-length key is not supported\", \"DataError\");\n }\n if (!usages.length) {\n throw new SyntaxError(\"Usages cannot be empty when importing a secret key.\");\n }\n return createCompatibleCryptoKey2({\n type: \"secret\",\n extractable,\n algorithm: {\n name: name2,\n hash: typeof algo.hash === \"string\" ? { name: algo.hash } : cloneObject2(algo.hash),\n length: secretBytes.byteLength * 8\n },\n usages: Array.from(usages),\n _raw: keyObject._raw,\n _sourceKeyObjectData: {\n type: \"secret\",\n raw: keyObject._raw\n }\n });\n }\n return createCompatibleCryptoKey2({\n type: \"secret\",\n extractable,\n algorithm: {\n name: name2,\n length: secretBytes.byteLength * 8\n },\n usages: Array.from(usages),\n _raw: keyObject._raw,\n _sourceKeyObjectData: {\n type: \"secret\",\n raw: keyObject._raw\n }\n });\n }\n var keyType = String(keyObject.asymmetricKeyType || \"\").toLowerCase();\n var algorithmName = String(name2 || \"\");\n if ((keyType === \"ed25519\" || keyType === \"ed448\" || keyType === \"x25519\" || keyType === \"x448\") && keyType !== algorithmName.toLowerCase()) {\n throw createDomException2(\"Invalid key type\", \"DataError\");\n }\n if (algorithmName === \"ECDH\") {\n if (keyObject.type === \"private\" && !usages.length) {\n throw new SyntaxError(\"Usages cannot be empty when importing a private key.\");\n }\n var actualCurve = normalizeNamedCurve2(\n keyObject.asymmetricKeyDetails && keyObject.asymmetricKeyDetails.namedCurve\n );\n if (algo.namedCurve && actualCurve && normalizeNamedCurve2(algo.namedCurve) !== actualCurve) {\n throw createDomException2(\"Named curve mismatch\", \"DataError\");\n }\n }\n var normalizedAlgo = cloneObject2(algo);\n if (typeof normalizedAlgo.hash === \"string\") {\n normalizedAlgo.hash = { name: normalizedAlgo.hash };\n }\n return createCompatibleCryptoKey2({\n type: keyObject.type,\n extractable,\n algorithm: normalizedAlgo,\n usages: Array.from(usages),\n _pem: keyObject._pem,\n _jwk: cloneObject2(keyObject._jwk),\n _sourceKeyObjectData: {\n type: keyObject.type,\n pem: keyObject._pem,\n jwk: cloneObject2(keyObject._jwk),\n asymmetricKeyType: keyObject.asymmetricKeyType,\n asymmetricKeyDetails: cloneObject2(keyObject.asymmetricKeyDetails)\n }\n });\n }, createAsymmetricKeyObject2 = function(type, key) {\n if (typeof key === \"string\") {\n if (key.indexOf(\"-----BEGIN\") === -1) {\n throw new TypeError(\"error:0900006e:PEM routines:OPENSSL_internal:NO_START_LINE\");\n }\n return new SandboxKeyObject2(type, { pem: key });\n }\n if (key && typeof key === \"object\" && key._pem) {\n return new SandboxKeyObject2(type, {\n pem: key._pem,\n jwk: key._jwk,\n asymmetricKeyType: key.asymmetricKeyType,\n asymmetricKeyDetails: key.asymmetricKeyDetails\n });\n }\n if (key && typeof key === \"object\" && key.key) {\n var keyData = typeof key.key === \"string\" ? key.key : key.key.toString(\"utf8\");\n return new SandboxKeyObject2(type, { pem: keyData });\n }\n if (Buffer.isBuffer(key)) {\n var keyStr = key.toString(\"utf8\");\n if (keyStr.indexOf(\"-----BEGIN\") === -1) {\n throw new TypeError(\"error:0900006e:PEM routines:OPENSSL_internal:NO_START_LINE\");\n }\n return new SandboxKeyObject2(type, { pem: keyStr });\n }\n return new SandboxKeyObject2(type, { pem: String(key) });\n }, createGeneratedKeyObject2 = function(value) {\n return new SandboxKeyObject2(value.type, {\n pem: value.pem,\n raw: value.raw,\n jwk: value.jwk,\n asymmetricKeyType: value.asymmetricKeyType,\n asymmetricKeyDetails: value.asymmetricKeyDetails\n });\n };\n var restoreBridgeValue = restoreBridgeValue2, cloneObject = cloneObject2, createDomException = createDomException2, toRawBuffer = toRawBuffer2, serializeBridgeValue = serializeBridgeValue2, normalizeCryptoBridgeError = normalizeCryptoBridgeError2, deserializeGeneratedKeyValue = deserializeGeneratedKeyValue2, serializeBridgeOptions = serializeBridgeOptions2, createInvalidArgTypeError = createInvalidArgTypeError2, scheduleCryptoCallback = scheduleCryptoCallback2, shouldThrowCryptoValidationError = shouldThrowCryptoValidationError2, ensureCryptoCallback = ensureCryptoCallback2, SandboxKeyObject = SandboxKeyObject2, normalizeNamedCurve = normalizeNamedCurve2, normalizeAlgorithmInput = normalizeAlgorithmInput2, createCompatibleCryptoKey = createCompatibleCryptoKey2, buildCryptoKeyFromKeyObject = buildCryptoKeyFromKeyObject2, createAsymmetricKeyObject = createAsymmetricKeyObject2, createGeneratedKeyObject = createGeneratedKeyObject2;\n Object.defineProperty(SandboxKeyObject2.prototype, Symbol.toStringTag, {\n value: \"KeyObject\",\n configurable: true\n });\n SandboxKeyObject2.prototype.export = function exportKey(options) {\n if (this.type === \"secret\") {\n return Buffer.from(this._raw || \"\", \"base64\");\n }\n if (!options || typeof options !== \"object\") {\n throw new TypeError('The \"options\" argument must be of type object.');\n }\n if (options.format === \"jwk\") {\n return cloneObject2(this._jwk);\n }\n if (options.format === \"der\") {\n var lines = String(this._pem || \"\").split(\"\\n\").filter(function(l) {\n return l && l.indexOf(\"-----\") !== 0;\n });\n return Buffer.from(lines.join(\"\"), \"base64\");\n }\n return this._pem;\n };\n SandboxKeyObject2.prototype.toString = function() {\n return \"[object KeyObject]\";\n };\n SandboxKeyObject2.prototype.equals = function equals(other) {\n if (!(other instanceof SandboxKeyObject2)) {\n return false;\n }\n if (this.type !== other.type) {\n return false;\n }\n if (this.type === \"secret\") {\n return (this._raw || \"\") === (other._raw || \"\");\n }\n return (this._pem || \"\") === (other._pem || \"\") && this.asymmetricKeyType === other.asymmetricKeyType;\n };\n SandboxKeyObject2.prototype.toCryptoKey = function toCryptoKey(algorithm, extractable, usages) {\n return buildCryptoKeyFromKeyObject2(this, algorithm, extractable, Array.from(usages || []));\n };\n result.generateKeyPairSync = function generateKeyPairSync(type, options) {\n var resultJson = _cryptoGenerateKeyPairSync.applySync(void 0, [\n type,\n serializeBridgeOptions2(options)\n ]);\n var parsed = JSON.parse(resultJson);\n if (parsed.publicKey && parsed.publicKey.kind) {\n return {\n publicKey: deserializeGeneratedKeyValue2(parsed.publicKey),\n privateKey: deserializeGeneratedKeyValue2(parsed.privateKey)\n };\n }\n return {\n publicKey: createGeneratedKeyObject2(parsed.publicKey),\n privateKey: createGeneratedKeyObject2(parsed.privateKey)\n };\n };\n result.generateKeyPair = function generateKeyPair(type, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = void 0;\n }\n callback = ensureCryptoCallback2(callback, function() {\n result.generateKeyPairSync(type, options);\n });\n try {\n var pair = result.generateKeyPairSync(type, options);\n scheduleCryptoCallback2(callback, [null, pair.publicKey, pair.privateKey]);\n } catch (e) {\n if (shouldThrowCryptoValidationError2(e)) {\n throw e;\n }\n scheduleCryptoCallback2(callback, [e]);\n }\n };\n if (typeof _cryptoGenerateKeySync !== \"undefined\") {\n result.generateKeySync = function generateKeySync(type, options) {\n var resultJson;\n try {\n resultJson = _cryptoGenerateKeySync.applySync(void 0, [\n type,\n serializeBridgeOptions2(options)\n ]);\n } catch (error) {\n throw normalizeCryptoBridgeError2(error);\n }\n return createGeneratedKeyObject2(JSON.parse(resultJson));\n };\n result.generateKey = function generateKey(type, options, callback) {\n callback = ensureCryptoCallback2(callback, function() {\n result.generateKeySync(type, options);\n });\n try {\n var key = result.generateKeySync(type, options);\n scheduleCryptoCallback2(callback, [null, key]);\n } catch (e) {\n if (shouldThrowCryptoValidationError2(e)) {\n throw e;\n }\n scheduleCryptoCallback2(callback, [e]);\n }\n };\n }\n if (typeof _cryptoGeneratePrimeSync !== \"undefined\") {\n result.generatePrimeSync = function generatePrimeSync(size, options) {\n var resultJson;\n try {\n resultJson = _cryptoGeneratePrimeSync.applySync(void 0, [\n size,\n serializeBridgeOptions2(options)\n ]);\n } catch (error) {\n throw normalizeCryptoBridgeError2(error);\n }\n return restoreBridgeValue2(JSON.parse(resultJson));\n };\n result.generatePrime = function generatePrime(size, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = void 0;\n }\n callback = ensureCryptoCallback2(callback, function() {\n result.generatePrimeSync(size, options);\n });\n try {\n var prime = result.generatePrimeSync(size, options);\n scheduleCryptoCallback2(callback, [null, prime]);\n } catch (e) {\n if (shouldThrowCryptoValidationError2(e)) {\n throw e;\n }\n scheduleCryptoCallback2(callback, [e]);\n }\n };\n }\n result.createPublicKey = function createPublicKey(key) {\n if (typeof _cryptoCreateKeyObject !== \"undefined\") {\n var resultJson;\n try {\n resultJson = _cryptoCreateKeyObject.applySync(void 0, [\n \"createPublicKey\",\n JSON.stringify(serializeBridgeValue2(key))\n ]);\n } catch (error) {\n throw normalizeCryptoBridgeError2(error);\n }\n return createGeneratedKeyObject2(JSON.parse(resultJson));\n }\n return createAsymmetricKeyObject2(\"public\", key);\n };\n result.createPrivateKey = function createPrivateKey(key) {\n if (typeof _cryptoCreateKeyObject !== \"undefined\") {\n var resultJson;\n try {\n resultJson = _cryptoCreateKeyObject.applySync(void 0, [\n \"createPrivateKey\",\n JSON.stringify(serializeBridgeValue2(key))\n ]);\n } catch (error) {\n throw normalizeCryptoBridgeError2(error);\n }\n return createGeneratedKeyObject2(JSON.parse(resultJson));\n }\n return createAsymmetricKeyObject2(\"private\", key);\n };\n result.createSecretKey = function createSecretKey(key, encoding) {\n return new SandboxKeyObject2(\"secret\", {\n raw: toRawBuffer2(key, encoding).toString(\"base64\")\n });\n };\n SandboxKeyObject2.from = function from(key) {\n if (!key || typeof key !== \"object\" || key[Symbol.toStringTag] !== \"CryptoKey\") {\n throw new TypeError('The \"key\" argument must be an instance of CryptoKey.');\n }\n if (key._sourceKeyObjectData && key._sourceKeyObjectData.type === \"secret\") {\n return new SandboxKeyObject2(\"secret\", {\n raw: key._sourceKeyObjectData.raw\n });\n }\n return new SandboxKeyObject2(key.type, {\n pem: key._pem,\n jwk: key._jwk,\n asymmetricKeyType: key._sourceKeyObjectData && key._sourceKeyObjectData.asymmetricKeyType,\n asymmetricKeyDetails: key._sourceKeyObjectData && key._sourceKeyObjectData.asymmetricKeyDetails\n });\n };\n result.KeyObject = SandboxKeyObject2;\n }\n if (typeof _cryptoSubtle !== \"undefined\") {\n let SandboxCryptoKey2 = function(keyData) {\n this.type = keyData.type;\n this.extractable = keyData.extractable;\n this.algorithm = keyData.algorithm;\n this.usages = keyData.usages;\n this._keyData = keyData;\n this._pem = keyData._pem;\n this._jwk = keyData._jwk;\n this._raw = keyData._raw;\n this._sourceKeyObjectData = keyData._sourceKeyObjectData;\n }, toBase642 = function(data) {\n if (typeof data === \"string\") return Buffer.from(data).toString(\"base64\");\n if (data instanceof ArrayBuffer) return Buffer.from(new Uint8Array(data)).toString(\"base64\");\n if (ArrayBuffer.isView(data)) return Buffer.from(new Uint8Array(data.buffer, data.byteOffset, data.byteLength)).toString(\"base64\");\n return Buffer.from(data).toString(\"base64\");\n }, subtleCall2 = function(reqObj) {\n return _cryptoSubtle.applySync(void 0, [JSON.stringify(reqObj)]);\n }, normalizeAlgo2 = function(algorithm) {\n if (typeof algorithm === \"string\") return { name: algorithm };\n return algorithm;\n };\n var SandboxCryptoKey = SandboxCryptoKey2, toBase64 = toBase642, subtleCall = subtleCall2, normalizeAlgo = normalizeAlgo2;\n Object.defineProperty(SandboxCryptoKey2.prototype, Symbol.toStringTag, {\n value: \"CryptoKey\",\n configurable: true\n });\n Object.defineProperty(SandboxCryptoKey2, Symbol.hasInstance, {\n value: function(candidate) {\n return !!(candidate && typeof candidate === \"object\" && (candidate._keyData || candidate[Symbol.toStringTag] === \"CryptoKey\"));\n },\n configurable: true\n });\n if (globalThis.CryptoKey && globalThis.CryptoKey.prototype && globalThis.CryptoKey.prototype !== SandboxCryptoKey2.prototype) {\n Object.setPrototypeOf(SandboxCryptoKey2.prototype, globalThis.CryptoKey.prototype);\n }\n if (typeof globalThis.CryptoKey === \"undefined\") {\n __requireExposeCustomGlobal(\"CryptoKey\", SandboxCryptoKey2);\n } else if (globalThis.CryptoKey !== SandboxCryptoKey2) {\n globalThis.CryptoKey = SandboxCryptoKey2;\n }\n var SandboxSubtle = {};\n SandboxSubtle.digest = function digest(algorithm, data) {\n return Promise.resolve().then(function() {\n var algo = normalizeAlgo2(algorithm);\n var result2 = JSON.parse(subtleCall2({\n op: \"digest\",\n algorithm: algo.name,\n data: toBase642(data)\n }));\n var buf = Buffer.from(result2.data, \"base64\");\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n });\n };\n SandboxSubtle.generateKey = function generateKey(algorithm, extractable, keyUsages) {\n return Promise.resolve().then(function() {\n var algo = normalizeAlgo2(algorithm);\n var reqAlgo = Object.assign({}, algo);\n if (reqAlgo.hash) reqAlgo.hash = normalizeAlgo2(reqAlgo.hash);\n if (reqAlgo.publicExponent) {\n reqAlgo.publicExponent = Buffer.from(new Uint8Array(reqAlgo.publicExponent.buffer || reqAlgo.publicExponent)).toString(\"base64\");\n }\n var result2 = JSON.parse(subtleCall2({\n op: \"generateKey\",\n algorithm: reqAlgo,\n extractable,\n usages: Array.from(keyUsages)\n }));\n if (result2.publicKey && result2.privateKey) {\n return {\n publicKey: new SandboxCryptoKey2(result2.publicKey),\n privateKey: new SandboxCryptoKey2(result2.privateKey)\n };\n }\n return new SandboxCryptoKey2(result2.key);\n });\n };\n SandboxSubtle.importKey = function importKey(format, keyData, algorithm, extractable, keyUsages) {\n return Promise.resolve().then(function() {\n var algo = normalizeAlgo2(algorithm);\n var reqAlgo = Object.assign({}, algo);\n if (reqAlgo.hash) reqAlgo.hash = normalizeAlgo2(reqAlgo.hash);\n var serializedKeyData;\n if (format === \"jwk\") {\n serializedKeyData = keyData;\n } else if (format === \"raw\") {\n serializedKeyData = toBase642(keyData);\n } else {\n serializedKeyData = toBase642(keyData);\n }\n var result2 = JSON.parse(subtleCall2({\n op: \"importKey\",\n format,\n keyData: serializedKeyData,\n algorithm: reqAlgo,\n extractable,\n usages: Array.from(keyUsages)\n }));\n return new SandboxCryptoKey2(result2.key);\n });\n };\n SandboxSubtle.exportKey = function exportKey(format, key) {\n return Promise.resolve().then(function() {\n var result2 = JSON.parse(subtleCall2({\n op: \"exportKey\",\n format,\n key: key._keyData\n }));\n if (format === \"jwk\") return result2.jwk;\n var buf = Buffer.from(result2.data, \"base64\");\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n });\n };\n SandboxSubtle.encrypt = function encrypt(algorithm, key, data) {\n return Promise.resolve().then(function() {\n var algo = normalizeAlgo2(algorithm);\n var reqAlgo = Object.assign({}, algo);\n if (reqAlgo.iv) reqAlgo.iv = toBase642(reqAlgo.iv);\n if (reqAlgo.additionalData) reqAlgo.additionalData = toBase642(reqAlgo.additionalData);\n var result2 = JSON.parse(subtleCall2({\n op: \"encrypt\",\n algorithm: reqAlgo,\n key: key._keyData,\n data: toBase642(data)\n }));\n var buf = Buffer.from(result2.data, \"base64\");\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n });\n };\n SandboxSubtle.decrypt = function decrypt(algorithm, key, data) {\n return Promise.resolve().then(function() {\n var algo = normalizeAlgo2(algorithm);\n var reqAlgo = Object.assign({}, algo);\n if (reqAlgo.iv) reqAlgo.iv = toBase642(reqAlgo.iv);\n if (reqAlgo.additionalData) reqAlgo.additionalData = toBase642(reqAlgo.additionalData);\n var result2 = JSON.parse(subtleCall2({\n op: \"decrypt\",\n algorithm: reqAlgo,\n key: key._keyData,\n data: toBase642(data)\n }));\n var buf = Buffer.from(result2.data, \"base64\");\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n });\n };\n SandboxSubtle.sign = function sign(algorithm, key, data) {\n return Promise.resolve().then(function() {\n var result2 = JSON.parse(subtleCall2({\n op: \"sign\",\n algorithm: normalizeAlgo2(algorithm),\n key: key._keyData,\n data: toBase642(data)\n }));\n var buf = Buffer.from(result2.data, \"base64\");\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n });\n };\n SandboxSubtle.verify = function verify(algorithm, key, signature, data) {\n return Promise.resolve().then(function() {\n var result2 = JSON.parse(subtleCall2({\n op: \"verify\",\n algorithm: normalizeAlgo2(algorithm),\n key: key._keyData,\n signature: toBase642(signature),\n data: toBase642(data)\n }));\n return result2.result;\n });\n };\n SandboxSubtle.deriveBits = function deriveBits(algorithm, baseKey, length) {\n return Promise.resolve().then(function() {\n var algo = normalizeAlgo2(algorithm);\n var reqAlgo = Object.assign({}, algo);\n if (reqAlgo.salt) reqAlgo.salt = toBase642(reqAlgo.salt);\n if (reqAlgo.info) reqAlgo.info = toBase642(reqAlgo.info);\n var result2 = JSON.parse(subtleCall2({\n op: \"deriveBits\",\n algorithm: reqAlgo,\n baseKey: baseKey._keyData,\n length\n }));\n return Buffer.from(result2.data, \"base64\").buffer;\n });\n };\n SandboxSubtle.deriveKey = function deriveKey(algorithm, baseKey, derivedKeyAlgorithm, extractable, keyUsages) {\n return Promise.resolve().then(function() {\n var algo = normalizeAlgo2(algorithm);\n var reqAlgo = Object.assign({}, algo);\n if (reqAlgo.salt) reqAlgo.salt = toBase642(reqAlgo.salt);\n if (reqAlgo.info) reqAlgo.info = toBase642(reqAlgo.info);\n var result2 = JSON.parse(subtleCall2({\n op: \"deriveKey\",\n algorithm: reqAlgo,\n baseKey: baseKey._keyData,\n derivedKeyAlgorithm: normalizeAlgo2(derivedKeyAlgorithm),\n extractable,\n usages: keyUsages\n }));\n return new SandboxCryptoKey2(result2.key);\n });\n };\n if (globalThis.crypto && globalThis.crypto.subtle && typeof globalThis.crypto.subtle.importKey === \"function\") {\n result.subtle = globalThis.crypto.subtle;\n result.webcrypto = globalThis.crypto;\n } else {\n result.subtle = SandboxSubtle;\n result.webcrypto = { subtle: SandboxSubtle, getRandomValues: result.randomFillSync };\n }\n }\n if (typeof result.getCurves !== \"function\") {\n result.getCurves = function getCurves() {\n return [\n \"prime256v1\",\n \"secp256r1\",\n \"secp384r1\",\n \"secp521r1\",\n \"secp256k1\",\n \"secp224r1\",\n \"secp192k1\"\n ];\n };\n }\n if (typeof result.getCiphers !== \"function\") {\n result.getCiphers = function getCiphers() {\n return [\n \"aes-128-cbc\",\n \"aes-128-gcm\",\n \"aes-192-cbc\",\n \"aes-192-gcm\",\n \"aes-256-cbc\",\n \"aes-256-gcm\",\n \"aes-128-ctr\",\n \"aes-192-ctr\",\n \"aes-256-ctr\"\n ];\n };\n }\n if (typeof result.getHashes !== \"function\") {\n result.getHashes = function getHashes() {\n return [\"md5\", \"sha1\", \"sha256\", \"sha384\", \"sha512\"];\n };\n }\n if (typeof result.timingSafeEqual !== \"function\") {\n result.timingSafeEqual = function timingSafeEqual(a, b) {\n if (a.length !== b.length) {\n throw new RangeError(\"Input buffers must have the same byte length\");\n }\n var out = 0;\n for (var i = 0; i < a.length; i++) {\n out |= a[i] ^ b[i];\n }\n return out === 0;\n };\n }\n if (typeof result.getFips !== \"function\") {\n result.getFips = function getFips() {\n return 0;\n };\n }\n if (typeof result.setFips !== \"function\") {\n result.setFips = function setFips() {\n throw new Error(\"FIPS mode is not supported in sandbox\");\n };\n }\n return result;\n }\n if (name === \"stream\") {\n var getWebStreamsState = function() {\n return globalThis.__secureExecWebStreams || null;\n };\n var webStreamsState = getWebStreamsState();\n if (typeof result.isReadable !== \"function\") {\n result.isReadable = function(stream) {\n var stateKey = getWebStreamsState() && getWebStreamsState().kState;\n return Boolean(stateKey && stream && stream[stateKey] && stream[stateKey].state === \"readable\");\n };\n }\n if (typeof result.isErrored !== \"function\") {\n result.isErrored = function(stream) {\n var stateKey = getWebStreamsState() && getWebStreamsState().kState;\n return Boolean(stateKey && stream && stream[stateKey] && stream[stateKey].state === \"errored\");\n };\n }\n if (typeof result.isDisturbed !== \"function\") {\n result.isDisturbed = function(stream) {\n var stateKey = getWebStreamsState() && getWebStreamsState().kState;\n return Boolean(stateKey && stream && stream[stateKey] && stream[stateKey].disturbed === true);\n };\n }\n if (typeof result === \"function\" && result.prototype && typeof result.Readable === \"function\") {\n var readableProto = result.Readable.prototype;\n var streamProto = result.prototype;\n if (readableProto && streamProto && !(readableProto instanceof result)) {\n var currentParent = Object.getPrototypeOf(readableProto);\n Object.setPrototypeOf(streamProto, currentParent);\n Object.setPrototypeOf(readableProto, streamProto);\n }\n }\n if (typeof result.Readable === \"function\" && !Object.getOwnPropertyDescriptor(result.Readable.prototype, \"readableObjectMode\")) {\n Object.defineProperty(result.Readable.prototype, \"readableObjectMode\", {\n configurable: true,\n enumerable: false,\n get: function() {\n return Boolean(this && this._readableState && this._readableState.objectMode);\n }\n });\n }\n if (typeof result.Writable === \"function\" && !Object.getOwnPropertyDescriptor(result.Writable.prototype, \"writableObjectMode\")) {\n Object.defineProperty(result.Writable.prototype, \"writableObjectMode\", {\n configurable: true,\n enumerable: false,\n get: function() {\n return Boolean(this && this._writableState && this._writableState.objectMode);\n }\n });\n }\n if (webStreamsState && typeof result.Readable === \"function\") {\n if (typeof result.Readable.fromWeb !== \"function\" && typeof webStreamsState.newStreamReadableFromReadableStream === \"function\") {\n result.Readable.fromWeb = function fromWeb(readableStream, options) {\n return webStreamsState.newStreamReadableFromReadableStream(readableStream, options);\n };\n }\n if (typeof result.Readable.toWeb !== \"function\" && typeof webStreamsState.newReadableStreamFromStreamReadable === \"function\") {\n result.Readable.toWeb = function toWeb(readable) {\n return webStreamsState.newReadableStreamFromStreamReadable(readable);\n };\n }\n }\n if (webStreamsState && typeof result.Writable === \"function\") {\n if (typeof result.Writable.fromWeb !== \"function\" && typeof webStreamsState.newStreamWritableFromWritableStream === \"function\") {\n result.Writable.fromWeb = function fromWeb(writableStream, options) {\n return webStreamsState.newStreamWritableFromWritableStream(writableStream, options);\n };\n }\n if (typeof result.Writable.toWeb !== \"function\" && typeof webStreamsState.newWritableStreamFromStreamWritable === \"function\") {\n result.Writable.toWeb = function toWeb(writable) {\n return webStreamsState.newWritableStreamFromStreamWritable(writable);\n };\n }\n }\n if (webStreamsState && typeof result.Duplex === \"function\") {\n if (typeof result.Duplex.fromWeb !== \"function\" && typeof webStreamsState.newStreamDuplexFromReadableWritablePair === \"function\") {\n result.Duplex.fromWeb = function fromWeb(pair, options) {\n return webStreamsState.newStreamDuplexFromReadableWritablePair(pair, options);\n };\n }\n if (typeof result.Duplex.toWeb !== \"function\" && typeof webStreamsState.newReadableWritablePairFromDuplex === \"function\") {\n result.Duplex.toWeb = function toWeb(duplex) {\n return webStreamsState.newReadableWritablePairFromDuplex(duplex);\n };\n }\n }\n return result;\n }\n if (name === \"path\") {\n if (result.win32 === null || result.win32 === void 0) {\n result.win32 = result.posix || result;\n }\n if (result.posix === null || result.posix === void 0) {\n result.posix = result;\n }\n const hasAbsoluteSegment = function(args) {\n return args.some(function(arg) {\n return typeof arg === \"string\" && arg.length > 0 && arg.charAt(0) === \"/\";\n });\n };\n const prependCwd = function(args) {\n if (hasAbsoluteSegment(args)) return;\n if (typeof process !== \"undefined\" && typeof process.cwd === \"function\") {\n const cwd = process.cwd();\n if (cwd && cwd.charAt(0) === \"/\") {\n args.unshift(cwd);\n }\n }\n };\n const originalResolve = result.resolve;\n if (typeof originalResolve === \"function\" && !originalResolve._patchedForCwd) {\n const patchedResolve = function resolve2() {\n const args = Array.from(arguments);\n prependCwd(args);\n return originalResolve.apply(this, args);\n };\n patchedResolve._patchedForCwd = true;\n result.resolve = patchedResolve;\n }\n if (result.posix && typeof result.posix.resolve === \"function\" && !result.posix.resolve._patchedForCwd) {\n const originalPosixResolve = result.posix.resolve;\n const patchedPosixResolve = function resolve2() {\n const args = Array.from(arguments);\n prependCwd(args);\n return originalPosixResolve.apply(this, args);\n };\n patchedPosixResolve._patchedForCwd = true;\n result.posix.resolve = patchedPosixResolve;\n }\n }\n return result;\n }\n var _deferredCoreModules = /* @__PURE__ */ new Set([\n \"readline\",\n \"perf_hooks\",\n \"async_hooks\",\n \"worker_threads\",\n \"diagnostics_channel\"\n ]);\n var _unsupportedCoreModules = /* @__PURE__ */ new Set([\n \"cluster\",\n \"wasi\",\n \"inspector\",\n \"repl\",\n \"trace_events\",\n \"domain\"\n ]);\n function _unsupportedApiError(moduleName, apiName) {\n return new Error(moduleName + \".\" + apiName + \" is not supported in sandbox\");\n }\n function _createDeferredModuleStub(moduleName) {\n const methodCache = {};\n const workerThreadsCompat = {\n markAsUncloneable: function markAsUncloneable(value) {\n return value;\n },\n markAsUntransferable: function markAsUntransferable(value) {\n return value;\n },\n isMarkedAsUntransferable: function isMarkedAsUntransferable() {\n return false;\n },\n MessagePort: globalThis.MessagePort,\n MessageChannel: globalThis.MessageChannel,\n MessageEvent: globalThis.MessageEvent\n };\n const readlineCompat = {\n createInterface: function createInterface(opts) {\n const input = opts && opts.input ? opts.input : typeof process !== \"undefined\" ? process.stdin : null;\n const output = opts && opts.output ? opts.output : typeof process !== \"undefined\" ? process.stdout : null;\n const listeners = {};\n const rl = {\n input,\n output,\n terminal: false,\n closed: false,\n on: function(event, handler) {\n (listeners[event] = listeners[event] || []).push(handler);\n return rl;\n },\n once: function(event, handler) {\n const wrapper = function() {\n rl.off(event, wrapper);\n handler.apply(this, arguments);\n };\n return rl.on(event, wrapper);\n },\n off: function(event, handler) {\n if (listeners[event]) listeners[event] = listeners[event].filter(function(h) {\n return h !== handler;\n });\n return rl;\n },\n removeListener: function(event, handler) {\n return rl.off(event, handler);\n },\n emit: function(event) {\n const args = Array.prototype.slice.call(arguments, 1);\n (listeners[event] || []).forEach(function(h) {\n h.apply(null, args);\n });\n return rl;\n },\n close: function() {\n if (!rl.closed) {\n rl.closed = true;\n rl.emit(\"close\");\n }\n },\n question: function(query, cb) {\n if (output && output.write) output.write(query);\n if (input && input.once) {\n var buf = \"\";\n var onData = function(chunk) {\n buf += typeof chunk === \"string\" ? chunk : new TextDecoder().decode(chunk);\n var idx = buf.indexOf(\"\\n\");\n if (idx !== -1) {\n input.removeListener(\"data\", onData);\n cb(buf.slice(0, idx));\n }\n };\n input.on(\"data\", onData);\n } else {\n cb(\"\");\n }\n },\n prompt: function() {\n if (output && output.write) output.write(\"> \");\n },\n setPrompt: function() {\n },\n pause: function() {\n return rl;\n },\n resume: function() {\n return rl;\n },\n write: function() {\n },\n [Symbol.asyncIterator]: function() {\n return rl._iterState;\n }\n };\n var _lineBuf = \"\";\n var _iterLines = [];\n var _iterResolve = null;\n var _iterDone = false;\n rl._iterState = {\n next: function() {\n if (_iterLines.length > 0) return Promise.resolve({ value: _iterLines.shift(), done: false });\n if (_iterDone) return Promise.resolve({ value: void 0, done: true });\n return new Promise(function(r) {\n _iterResolve = r;\n }).then(function() {\n if (_iterLines.length > 0) return { value: _iterLines.shift(), done: false };\n return { value: void 0, done: true };\n });\n }\n };\n if (input && input.on) {\n input.on(\"data\", function(chunk) {\n _lineBuf += typeof chunk === \"string\" ? chunk : new TextDecoder().decode(chunk);\n var idx;\n while ((idx = _lineBuf.indexOf(\"\\n\")) !== -1) {\n var line = _lineBuf.slice(0, idx);\n _lineBuf = _lineBuf.slice(idx + 1);\n rl.emit(\"line\", line);\n _iterLines.push(line);\n if (_iterResolve) {\n _iterResolve();\n _iterResolve = null;\n }\n }\n });\n input.on(\"end\", function() {\n rl.emit(\"close\");\n _iterDone = true;\n if (_iterResolve) {\n _iterResolve();\n _iterResolve = null;\n }\n });\n if (input.resume) input.resume();\n }\n return rl;\n },\n promises: {\n createInterface: function createInterface(opts) {\n return readlineCompat.createInterface(opts);\n }\n }\n };\n const moduleCompat = {\n worker_threads: workerThreadsCompat,\n \"node:worker_threads\": workerThreadsCompat,\n readline: readlineCompat,\n \"node:readline\": readlineCompat\n };\n let stub = null;\n stub = new Proxy({}, {\n get(_target, prop) {\n if (prop === \"__esModule\") return false;\n if (prop === \"default\") return stub;\n if (prop === Symbol.toStringTag) return \"Module\";\n if (prop === \"then\") return void 0;\n if (typeof prop !== \"string\") return void 0;\n if (moduleCompat[moduleName] && Object.prototype.hasOwnProperty.call(moduleCompat[moduleName], prop)) {\n return moduleCompat[moduleName][prop];\n }\n if (!methodCache[prop]) {\n methodCache[prop] = function deferredApiStub() {\n throw _unsupportedApiError(moduleName, prop);\n };\n }\n return methodCache[prop];\n }\n });\n return stub;\n }\n var __internalModuleCache = _moduleCache;\n var __require = function require2(moduleName) {\n return _requireFrom(moduleName, _currentModule.dirname);\n };\n __requireExposeCustomGlobal(\"require\", __require);\n function _resolveFrom(moduleName, fromDir) {\n var resolved;\n if (typeof _resolveModuleSync !== \"undefined\") {\n resolved = _resolveModuleSync.applySync(void 0, [moduleName, fromDir]);\n }\n if (resolved === null || resolved === void 0) {\n resolved = _resolveModule.applySyncPromise(void 0, [moduleName, fromDir, \"require\"]);\n }\n if (resolved === null) {\n const err = new Error(\"Cannot find module '\" + moduleName + \"'\");\n err.code = \"MODULE_NOT_FOUND\";\n throw err;\n }\n return resolved;\n }\n globalThis.require.resolve = function resolve(moduleName) {\n return _resolveFrom(moduleName, _currentModule.dirname);\n };\n function _debugRequire(phase, moduleName, extra) {\n if (globalThis.__sandboxRequireDebug !== true) {\n return;\n }\n if (moduleName !== \"rivetkit\" && moduleName !== \"@rivetkit/traces\" && moduleName !== \"@rivetkit/on-change\" && moduleName !== \"async_hooks\" && !moduleName.startsWith(\"rivetkit/\") && !moduleName.startsWith(\"@rivetkit/\")) {\n return;\n }\n if (typeof console !== \"undefined\" && typeof console.log === \"function\") {\n console.log(\n \"[sandbox.require] \" + phase + \" \" + moduleName + (extra ? \" \" + extra : \"\")\n );\n }\n }\n function _requireFrom(moduleName, fromDir) {\n _debugRequire(\"start\", moduleName, fromDir);\n const name = moduleName.replace(/^node:/, \"\");\n let cacheKey = name;\n let resolved = null;\n const isRelative = name.startsWith(\"./\") || name.startsWith(\"../\");\n if (!isRelative && __internalModuleCache[name]) {\n _debugRequire(\"cache-hit\", name, name);\n return __internalModuleCache[name];\n }\n if (name === \"fs\") {\n if (__internalModuleCache[\"fs\"]) return __internalModuleCache[\"fs\"];\n const fsModule = globalThis.bridge?.fs || globalThis.bridge?.default || globalThis._fsModule || {};\n __internalModuleCache[\"fs\"] = fsModule;\n _debugRequire(\"loaded\", name, \"fs-special\");\n return fsModule;\n }\n if (name === \"fs/promises\") {\n if (__internalModuleCache[\"fs/promises\"]) return __internalModuleCache[\"fs/promises\"];\n const fsModule = _requireFrom(\"fs\", fromDir);\n __internalModuleCache[\"fs/promises\"] = fsModule.promises;\n _debugRequire(\"loaded\", name, \"fs-promises-special\");\n return fsModule.promises;\n }\n if (name === \"stream/promises\") {\n if (__internalModuleCache[\"stream/promises\"]) return __internalModuleCache[\"stream/promises\"];\n const streamModule = _requireFrom(\"stream\", fromDir);\n const promisesModule = {\n finished(stream, options) {\n return new Promise(function(resolve2, reject) {\n if (typeof streamModule.finished !== \"function\") {\n resolve2();\n return;\n }\n if (options && typeof options === \"object\" && !Array.isArray(options)) {\n streamModule.finished(stream, options, function(error) {\n if (error) {\n reject(error);\n return;\n }\n resolve2();\n });\n return;\n }\n streamModule.finished(stream, function(error) {\n if (error) {\n reject(error);\n return;\n }\n resolve2();\n });\n });\n },\n pipeline() {\n const args = Array.prototype.slice.call(arguments);\n return new Promise(function(resolve2, reject) {\n if (typeof streamModule.pipeline !== \"function\") {\n reject(new Error(\"stream.pipeline is not supported in sandbox\"));\n return;\n }\n args.push(function(error) {\n if (error) {\n reject(error);\n return;\n }\n resolve2();\n });\n streamModule.pipeline.apply(streamModule, args);\n });\n }\n };\n __internalModuleCache[\"stream/promises\"] = promisesModule;\n _debugRequire(\"loaded\", name, \"stream-promises-special\");\n return promisesModule;\n }\n if (name === \"stream/consumers\") {\n if (__internalModuleCache[\"stream/consumers\"]) return __internalModuleCache[\"stream/consumers\"];\n const consumersModule = {};\n consumersModule.buffer = async function buffer(stream) {\n const chunks = [];\n const pushChunk = function(chunk) {\n if (typeof chunk === \"string\") {\n chunks.push(Buffer.from(chunk));\n } else if (Buffer.isBuffer(chunk)) {\n chunks.push(chunk);\n } else if (ArrayBuffer.isView(chunk)) {\n chunks.push(Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength));\n } else if (chunk instanceof ArrayBuffer) {\n chunks.push(Buffer.from(new Uint8Array(chunk)));\n } else {\n chunks.push(Buffer.from(String(chunk)));\n }\n };\n if (stream && typeof stream[Symbol.asyncIterator] === \"function\") {\n for await (const chunk of stream) {\n pushChunk(chunk);\n }\n return Buffer.concat(chunks);\n }\n return new Promise(function(resolve2, reject) {\n stream.on(\"data\", pushChunk);\n stream.on(\"end\", function() {\n resolve2(Buffer.concat(chunks));\n });\n stream.on(\"error\", reject);\n });\n };\n consumersModule.text = async function text(stream) {\n return (await consumersModule.buffer(stream)).toString(\"utf8\");\n };\n consumersModule.json = async function json(stream) {\n return JSON.parse(await consumersModule.text(stream));\n };\n consumersModule.arrayBuffer = async function arrayBuffer(stream) {\n const buffer = await consumersModule.buffer(stream);\n return buffer.buffer.slice(\n buffer.byteOffset,\n buffer.byteOffset + buffer.byteLength\n );\n };\n __internalModuleCache[\"stream/consumers\"] = consumersModule;\n _debugRequire(\"loaded\", name, \"stream-consumers-special\");\n return consumersModule;\n }\n if (name === \"child_process\") {\n if (__internalModuleCache[\"child_process\"]) return __internalModuleCache[\"child_process\"];\n __internalModuleCache[\"child_process\"] = _childProcessModule;\n _debugRequire(\"loaded\", name, \"child-process-special\");\n return _childProcessModule;\n }\n if (name === \"net\") {\n if (__internalModuleCache[\"net\"]) return __internalModuleCache[\"net\"];\n __internalModuleCache[\"net\"] = _netModule;\n _debugRequire(\"loaded\", name, \"net-special\");\n return _netModule;\n }\n if (name === \"tls\") {\n if (__internalModuleCache[\"tls\"]) return __internalModuleCache[\"tls\"];\n __internalModuleCache[\"tls\"] = _tlsModule;\n _debugRequire(\"loaded\", name, \"tls-special\");\n return _tlsModule;\n }\n if (name === \"http\") {\n if (__internalModuleCache[\"http\"]) return __internalModuleCache[\"http\"];\n __internalModuleCache[\"http\"] = _httpModule;\n _debugRequire(\"loaded\", name, \"http-special\");\n return _httpModule;\n }\n if (name === \"_http_agent\") {\n if (__internalModuleCache[\"_http_agent\"]) return __internalModuleCache[\"_http_agent\"];\n const httpAgentModule = {\n Agent: _httpModule.Agent,\n globalAgent: _httpModule.globalAgent\n };\n __internalModuleCache[\"_http_agent\"] = httpAgentModule;\n _debugRequire(\"loaded\", name, \"http-agent-special\");\n return httpAgentModule;\n }\n if (name === \"_http_common\") {\n if (__internalModuleCache[\"_http_common\"]) return __internalModuleCache[\"_http_common\"];\n const httpCommonModule = {\n _checkIsHttpToken: _httpModule._checkIsHttpToken,\n _checkInvalidHeaderChar: _httpModule._checkInvalidHeaderChar\n };\n __internalModuleCache[\"_http_common\"] = httpCommonModule;\n _debugRequire(\"loaded\", name, \"http-common-special\");\n return httpCommonModule;\n }\n if (name === \"https\") {\n if (__internalModuleCache[\"https\"]) return __internalModuleCache[\"https\"];\n __internalModuleCache[\"https\"] = _httpsModule;\n _debugRequire(\"loaded\", name, \"https-special\");\n return _httpsModule;\n }\n if (name === \"http2\") {\n if (__internalModuleCache[\"http2\"]) return __internalModuleCache[\"http2\"];\n __internalModuleCache[\"http2\"] = _http2Module;\n _debugRequire(\"loaded\", name, \"http2-special\");\n return _http2Module;\n }\n if (name === \"internal/http2/util\") {\n if (__internalModuleCache[name]) return __internalModuleCache[name];\n const sharedNghttpError = _http2Module?.NghttpError;\n const NghttpError = typeof sharedNghttpError === \"function\" ? sharedNghttpError : class NghttpError extends Error {\n constructor(message) {\n super(message);\n this.name = \"Error\";\n this.code = \"ERR_HTTP2_ERROR\";\n }\n };\n const utilModule = {\n kSocket: /* @__PURE__ */ Symbol.for(\"secure-exec.http2.kSocket\"),\n NghttpError\n };\n __internalModuleCache[name] = utilModule;\n _debugRequire(\"loaded\", name, \"http2-util-special\");\n return utilModule;\n }\n if (name === \"dns\") {\n if (__internalModuleCache[\"dns\"]) return __internalModuleCache[\"dns\"];\n __internalModuleCache[\"dns\"] = _dnsModule;\n _debugRequire(\"loaded\", name, \"dns-special\");\n return _dnsModule;\n }\n if (name === \"dgram\") {\n if (__internalModuleCache[\"dgram\"]) return __internalModuleCache[\"dgram\"];\n __internalModuleCache[\"dgram\"] = _dgramModule;\n _debugRequire(\"loaded\", name, \"dgram-special\");\n return _dgramModule;\n }\n if (name === \"os\") {\n if (__internalModuleCache[\"os\"]) return __internalModuleCache[\"os\"];\n __internalModuleCache[\"os\"] = _osModule;\n _debugRequire(\"loaded\", name, \"os-special\");\n return _osModule;\n }\n if (name === \"module\") {\n if (__internalModuleCache[\"module\"]) return __internalModuleCache[\"module\"];\n __internalModuleCache[\"module\"] = _moduleModule;\n _debugRequire(\"loaded\", name, \"module-special\");\n return _moduleModule;\n }\n if (name === \"process\") {\n _debugRequire(\"loaded\", name, \"process-special\");\n return globalThis.process;\n }\n if (name === \"v8\") {\n if (__internalModuleCache[\"v8\"]) return __internalModuleCache[\"v8\"];\n const v8Module = globalThis._moduleCache?.v8 || {};\n __internalModuleCache[\"v8\"] = v8Module;\n _debugRequire(\"loaded\", name, \"v8-special\");\n return v8Module;\n }\n if (name === \"async_hooks\") {\n if (__internalModuleCache[\"async_hooks\"]) return __internalModuleCache[\"async_hooks\"];\n class AsyncLocalStorage {\n constructor() {\n this._store = void 0;\n }\n run(store, callback) {\n const previousStore = this._store;\n this._store = store;\n try {\n const args = Array.prototype.slice.call(arguments, 2);\n return callback.apply(void 0, args);\n } finally {\n this._store = previousStore;\n }\n }\n enterWith(store) {\n this._store = store;\n }\n getStore() {\n return this._store;\n }\n disable() {\n this._store = void 0;\n }\n exit(callback) {\n const previousStore = this._store;\n this._store = void 0;\n try {\n const args = Array.prototype.slice.call(arguments, 1);\n return callback.apply(void 0, args);\n } finally {\n this._store = previousStore;\n }\n }\n }\n class AsyncResource {\n constructor(type) {\n this.type = type;\n }\n runInAsyncScope(callback, thisArg) {\n const args = Array.prototype.slice.call(arguments, 2);\n return callback.apply(thisArg, args);\n }\n emitDestroy() {\n }\n }\n const asyncHooksModule = {\n AsyncLocalStorage,\n AsyncResource,\n createHook() {\n return {\n enable() {\n return this;\n },\n disable() {\n return this;\n }\n };\n },\n executionAsyncId() {\n return 1;\n },\n triggerAsyncId() {\n return 0;\n },\n executionAsyncResource() {\n return null;\n }\n };\n __internalModuleCache[\"async_hooks\"] = asyncHooksModule;\n _debugRequire(\"loaded\", name, \"async-hooks-special\");\n return asyncHooksModule;\n }\n if (name === \"diagnostics_channel\") {\n let _createChannel2 = function() {\n return {\n hasSubscribers: false,\n publish: function() {\n },\n subscribe: function() {\n },\n unsubscribe: function() {\n }\n };\n };\n var _createChannel = _createChannel2;\n if (__internalModuleCache[name]) return __internalModuleCache[name];\n const dcModule = {\n channel: function() {\n return _createChannel2();\n },\n hasSubscribers: function() {\n return false;\n },\n tracingChannel: function() {\n return {\n start: _createChannel2(),\n end: _createChannel2(),\n asyncStart: _createChannel2(),\n asyncEnd: _createChannel2(),\n error: _createChannel2(),\n traceSync: function(fn, context, thisArg) {\n var args = Array.prototype.slice.call(arguments, 3);\n return fn.apply(thisArg, args);\n },\n tracePromise: function(fn, context, thisArg) {\n var args = Array.prototype.slice.call(arguments, 3);\n return fn.apply(thisArg, args);\n },\n traceCallback: function(fn, context, thisArg) {\n var args = Array.prototype.slice.call(arguments, 3);\n return fn.apply(thisArg, args);\n }\n };\n },\n Channel: function Channel(name2) {\n this.hasSubscribers = false;\n this.publish = function() {\n };\n this.subscribe = function() {\n };\n this.unsubscribe = function() {\n };\n }\n };\n __internalModuleCache[name] = dcModule;\n _debugRequire(\"loaded\", name, \"diagnostics-channel-special\");\n return dcModule;\n }\n if (name === \"path/win32\") {\n var pathMod = _requireFrom(\"path\", fromDir);\n __internalModuleCache[name] = pathMod.win32 || pathMod;\n return __internalModuleCache[name];\n }\n if (name === \"path/posix\") {\n var pathMod2 = _requireFrom(\"path\", fromDir);\n __internalModuleCache[name] = pathMod2.posix || pathMod2;\n return __internalModuleCache[name];\n }\n if (_deferredCoreModules.has(name)) {\n if (__internalModuleCache[name]) return __internalModuleCache[name];\n const deferredStub = _createDeferredModuleStub(name);\n __internalModuleCache[name] = deferredStub;\n _debugRequire(\"loaded\", name, \"deferred-stub\");\n return deferredStub;\n }\n if (_unsupportedCoreModules.has(name)) {\n throw new Error(name + \" is not supported in sandbox\");\n }\n const polyfillCode = _loadPolyfill.applySyncPromise(void 0, [name]);\n if (polyfillCode !== null) {\n if (__internalModuleCache[name]) return __internalModuleCache[name];\n const moduleObj = { exports: {} };\n _pendingModules[name] = moduleObj;\n let result = Function('\"use strict\"; return (' + polyfillCode + \");\")();\n result = _patchPolyfill(name, result);\n if (typeof result === \"object\" && result !== null) {\n Object.assign(moduleObj.exports, result);\n } else {\n moduleObj.exports = result;\n }\n __internalModuleCache[name] = moduleObj.exports;\n delete _pendingModules[name];\n _debugRequire(\"loaded\", name, \"polyfill\");\n return __internalModuleCache[name];\n }\n resolved = _resolveFrom(name, fromDir);\n cacheKey = resolved;\n if (__internalModuleCache[cacheKey]) {\n _debugRequire(\"cache-hit\", name, cacheKey);\n return __internalModuleCache[cacheKey];\n }\n if (_pendingModules[cacheKey]) {\n _debugRequire(\"pending-hit\", name, cacheKey);\n return _pendingModules[cacheKey].exports;\n }\n var source;\n if (typeof _loadFileSync !== \"undefined\") {\n source = _loadFileSync.applySync(void 0, [resolved]);\n }\n if (source === null || source === void 0) {\n source = _loadFile.applySyncPromise(void 0, [resolved, \"require\"]);\n }\n if (source === null) {\n const err = new Error(\"Cannot find module '\" + resolved + \"'\");\n err.code = \"MODULE_NOT_FOUND\";\n throw err;\n }\n if (resolved.endsWith(\".json\")) {\n const parsed = JSON.parse(source);\n __internalModuleCache[cacheKey] = parsed;\n return parsed;\n }\n const module = {\n exports: {},\n filename: resolved,\n dirname: _dirname(resolved),\n id: resolved,\n loaded: false\n };\n _pendingModules[cacheKey] = module;\n const prevModule = _currentModule;\n _currentModule = module;\n try {\n let wrapper;\n const isRequireTransformedEsm = typeof source === \"string\" && source.startsWith(REQUIRE_TRANSFORM_MARKER);\n const wrapperPrologue = isRequireTransformedEsm ? \"\" : \"var __filename = __secureExecFilename;\\nvar __dirname = __secureExecDirname;\\n\";\n try {\n wrapper = new Function(\n \"exports\",\n \"require\",\n \"module\",\n \"__secureExecFilename\",\n \"__secureExecDirname\",\n \"__dynamicImport\",\n wrapperPrologue + source + \"\\n//# sourceURL=\" + resolved\n );\n } catch (error) {\n const details = error && error.stack ? error.stack : String(error);\n throw new Error(\"failed to compile module \" + resolved + \": \" + details);\n }\n const moduleRequire = function(request) {\n return _requireFrom(request, module.dirname);\n };\n moduleRequire.resolve = function(request) {\n return _resolveFrom(request, module.dirname);\n };\n const moduleDynamicImport = function(specifier) {\n if (typeof globalThis.__dynamicImport === \"function\") {\n return globalThis.__dynamicImport(specifier, module.dirname);\n }\n return Promise.reject(new Error(\"Dynamic import is not initialized\"));\n };\n wrapper(\n module.exports,\n moduleRequire,\n module,\n resolved,\n module.dirname,\n moduleDynamicImport\n );\n module.loaded = true;\n } catch (error) {\n const details = error && error.stack ? error.stack : String(error);\n throw new Error(\"failed to execute module \" + resolved + \": \" + details);\n } finally {\n _currentModule = prevModule;\n }\n __internalModuleCache[cacheKey] = module.exports;\n delete _pendingModules[cacheKey];\n _debugRequire(\"loaded\", name, cacheKey);\n return module.exports;\n }\n __requireExposeCustomGlobal(\"_requireFrom\", _requireFrom);\n var __moduleCacheProxy = new Proxy(__internalModuleCache, {\n get(target, prop, receiver) {\n return Reflect.get(target, prop, receiver);\n },\n set(_target, prop) {\n throw new TypeError(\"Cannot set require.cache['\" + String(prop) + \"']\");\n },\n deleteProperty(_target, prop) {\n throw new TypeError(\"Cannot delete require.cache['\" + String(prop) + \"']\");\n },\n defineProperty(_target, prop) {\n throw new TypeError(\"Cannot define property '\" + String(prop) + \"' on require.cache\");\n },\n has(target, prop) {\n return Reflect.has(target, prop);\n },\n ownKeys(target) {\n return Reflect.ownKeys(target);\n },\n getOwnPropertyDescriptor(target, prop) {\n return Reflect.getOwnPropertyDescriptor(target, prop);\n }\n });\n globalThis.require.cache = __moduleCacheProxy;\n Object.defineProperty(globalThis, \"_moduleCache\", {\n value: __moduleCacheProxy,\n writable: false,\n configurable: true,\n enumerable: false\n });\n if (typeof _moduleModule !== \"undefined\") {\n if (_moduleModule.Module) {\n _moduleModule.Module._cache = __moduleCacheProxy;\n }\n _moduleModule._cache = __moduleCacheProxy;\n }\n})();\n",
14
- "setCommonjsFileGlobals": "\"use strict\";\n(() => {\n // ../core/isolate-runtime/src/common/global-exposure.ts\n function defineRuntimeGlobalBinding(name, value, mutable) {\n Object.defineProperty(globalThis, name, {\n value,\n writable: mutable,\n configurable: mutable,\n enumerable: true\n });\n }\n function createRuntimeGlobalExposer(mutable) {\n return (name, value) => {\n defineRuntimeGlobalBinding(name, value, mutable);\n };\n }\n function getRuntimeExposeMutableGlobal() {\n if (typeof globalThis.__runtimeExposeMutableGlobal === \"function\") {\n return globalThis.__runtimeExposeMutableGlobal;\n }\n return createRuntimeGlobalExposer(true);\n }\n\n // ../core/isolate-runtime/src/inject/set-commonjs-file-globals.ts\n var __runtimeExposeMutableGlobal = getRuntimeExposeMutableGlobal();\n var __commonJsFileConfig = globalThis.__runtimeCommonJsFileConfig ?? {};\n var __filePath = typeof __commonJsFileConfig.filePath === \"string\" ? __commonJsFileConfig.filePath : \"/<entry>.js\";\n var __dirname = typeof __commonJsFileConfig.dirname === \"string\" ? __commonJsFileConfig.dirname : \"/\";\n __runtimeExposeMutableGlobal(\"__filename\", __filePath);\n __runtimeExposeMutableGlobal(\"__dirname\", __dirname);\n var __currentModule = globalThis._currentModule;\n if (__currentModule) {\n __currentModule.dirname = __dirname;\n __currentModule.filename = __filePath;\n }\n})();\n",
15
- "setStdinData": "\"use strict\";\n(() => {\n // ../core/isolate-runtime/src/inject/set-stdin-data.ts\n if (typeof globalThis._stdinData !== \"undefined\") {\n globalThis._stdinData = globalThis.__runtimeStdinData;\n globalThis._stdinPosition = 0;\n globalThis._stdinEnded = false;\n globalThis._stdinFlowMode = false;\n }\n})();\n",
16
- "setupDynamicImport": "\"use strict\";\n(() => {\n // ../core/isolate-runtime/src/common/global-access.ts\n function isObjectLike(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n }\n\n // ../core/isolate-runtime/src/common/global-exposure.ts\n function defineRuntimeGlobalBinding(name, value, mutable) {\n Object.defineProperty(globalThis, name, {\n value,\n writable: mutable,\n configurable: mutable,\n enumerable: true\n });\n }\n function createRuntimeGlobalExposer(mutable) {\n return (name, value) => {\n defineRuntimeGlobalBinding(name, value, mutable);\n };\n }\n function getRuntimeExposeCustomGlobal() {\n if (typeof globalThis.__runtimeExposeCustomGlobal === \"function\") {\n return globalThis.__runtimeExposeCustomGlobal;\n }\n return createRuntimeGlobalExposer(false);\n }\n\n // ../core/isolate-runtime/src/inject/setup-dynamic-import.ts\n var __runtimeExposeCustomGlobal = getRuntimeExposeCustomGlobal();\n var __dynamicImportConfig = globalThis.__runtimeDynamicImportConfig ?? {};\n var __fallbackReferrer = typeof __dynamicImportConfig.referrerPath === \"string\" && __dynamicImportConfig.referrerPath.length > 0 ? __dynamicImportConfig.referrerPath : \"/\";\n var __dynamicImportCache = /* @__PURE__ */ new Map();\n var __pathToFileURL = typeof globalThis.require === \"function\" ? globalThis.require(\"node:url\").pathToFileURL ?? null : null;\n var __resolveDynamicImportPath = function(request, referrer) {\n if (!request.startsWith(\"./\") && !request.startsWith(\"../\") && !request.startsWith(\"/\")) {\n return request;\n }\n const baseDir = referrer.endsWith(\"/\") ? referrer : referrer.slice(0, referrer.lastIndexOf(\"/\")) || \"/\";\n const segments = baseDir.split(\"/\").filter(Boolean);\n for (const part of request.split(\"/\")) {\n if (part === \".\" || part.length === 0) continue;\n if (part === \"..\") {\n segments.pop();\n continue;\n }\n segments.push(part);\n }\n return `/${segments.join(\"/\")}`;\n };\n var __dynamicImportHandler = function(specifier, fromPath) {\n const request = String(specifier);\n const referrer = typeof fromPath === \"string\" && fromPath.length > 0 ? fromPath : __fallbackReferrer;\n let resolved = null;\n if (typeof globalThis._resolveModuleSync !== \"undefined\") {\n resolved = globalThis._resolveModuleSync.applySync(\n void 0,\n [request, referrer, \"import\"]\n );\n }\n const resolvedPath = typeof resolved === \"string\" && resolved.length > 0 ? resolved : __resolveDynamicImportPath(request, referrer);\n const cacheKey = typeof resolved === \"string\" && resolved.length > 0 ? resolved : `${referrer}\\0${request}`;\n const cached = __dynamicImportCache.get(cacheKey);\n if (cached) return Promise.resolve(cached);\n if (typeof globalThis._requireFrom !== \"function\") {\n throw new Error(\"Cannot load module: \" + resolvedPath);\n }\n let mod;\n try {\n mod = globalThis._requireFrom(resolved ?? request, referrer);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n if (error && typeof error === \"object\" && \"code\" in error && error.code === \"MODULE_NOT_FOUND\") {\n throw new Error(\"Cannot load module: \" + resolvedPath);\n }\n if (message.startsWith(\"Cannot find module \")) {\n throw new Error(\"Cannot load module: \" + resolvedPath);\n }\n throw error;\n }\n const namespaceFallback = { default: mod };\n if (isObjectLike(mod)) {\n for (const key of Object.keys(mod)) {\n if (!(key in namespaceFallback)) {\n namespaceFallback[key] = mod[key];\n }\n }\n }\n __dynamicImportCache.set(cacheKey, namespaceFallback);\n return Promise.resolve(namespaceFallback);\n };\n var __importMetaResolveHandler = function(specifier, fromPath) {\n const request = String(specifier);\n const referrer = typeof fromPath === \"string\" && fromPath.length > 0 ? fromPath : __fallbackReferrer;\n let resolved = null;\n if (typeof globalThis._resolveModuleSync !== \"undefined\") {\n resolved = globalThis._resolveModuleSync.applySync(\n void 0,\n [request, referrer, \"import\"]\n );\n }\n if (resolved === null || resolved === void 0) {\n resolved = globalThis._resolveModule.applySyncPromise(\n void 0,\n [request, referrer, \"import\"]\n );\n }\n if (resolved === null) {\n const err = new Error(\"Cannot find module '\" + request + \"'\");\n err.code = \"MODULE_NOT_FOUND\";\n throw err;\n }\n if (resolved.startsWith(\"node:\")) {\n return resolved;\n }\n if (__pathToFileURL && resolved.startsWith(\"/\")) {\n return __pathToFileURL(resolved).href;\n }\n return resolved;\n };\n __runtimeExposeCustomGlobal(\"__dynamicImport\", __dynamicImportHandler);\n __runtimeExposeCustomGlobal(\"__importMetaResolve\", __importMetaResolveHandler);\n})();\n",
17
- "setupFsFacade": "\"use strict\";\n(() => {\n // ../core/isolate-runtime/src/common/global-exposure.ts\n function defineRuntimeGlobalBinding(name, value, mutable) {\n Object.defineProperty(globalThis, name, {\n value,\n writable: mutable,\n configurable: mutable,\n enumerable: true\n });\n }\n function createRuntimeGlobalExposer(mutable) {\n return (name, value) => {\n defineRuntimeGlobalBinding(name, value, mutable);\n };\n }\n function getRuntimeExposeCustomGlobal() {\n if (typeof globalThis.__runtimeExposeCustomGlobal === \"function\") {\n return globalThis.__runtimeExposeCustomGlobal;\n }\n return createRuntimeGlobalExposer(false);\n }\n\n // ../core/isolate-runtime/src/inject/setup-fs-facade.ts\n var __runtimeExposeCustomGlobal = getRuntimeExposeCustomGlobal();\n var __fsFacade = {};\n Object.defineProperties(__fsFacade, {\n readFile: { get() {\n return globalThis._fsReadFile;\n }, enumerable: true },\n writeFile: { get() {\n return globalThis._fsWriteFile;\n }, enumerable: true },\n readFileBinary: { get() {\n return globalThis._fsReadFileBinary;\n }, enumerable: true },\n writeFileBinary: { get() {\n return globalThis._fsWriteFileBinary;\n }, enumerable: true },\n readDir: { get() {\n return globalThis._fsReadDir;\n }, enumerable: true },\n mkdir: { get() {\n return globalThis._fsMkdir;\n }, enumerable: true },\n rmdir: { get() {\n return globalThis._fsRmdir;\n }, enumerable: true },\n exists: { get() {\n return globalThis._fsExists;\n }, enumerable: true },\n stat: { get() {\n return globalThis._fsStat;\n }, enumerable: true },\n unlink: { get() {\n return globalThis._fsUnlink;\n }, enumerable: true },\n rename: { get() {\n return globalThis._fsRename;\n }, enumerable: true },\n chmod: { get() {\n return globalThis._fsChmod;\n }, enumerable: true },\n chown: { get() {\n return globalThis._fsChown;\n }, enumerable: true },\n link: { get() {\n return globalThis._fsLink;\n }, enumerable: true },\n symlink: { get() {\n return globalThis._fsSymlink;\n }, enumerable: true },\n readlink: { get() {\n return globalThis._fsReadlink;\n }, enumerable: true },\n lstat: { get() {\n return globalThis._fsLstat;\n }, enumerable: true },\n truncate: { get() {\n return globalThis._fsTruncate;\n }, enumerable: true },\n utimes: { get() {\n return globalThis._fsUtimes;\n }, enumerable: true }\n });\n __runtimeExposeCustomGlobal(\"_fs\", __fsFacade);\n})();\n",
18
- };
19
- export function getIsolateRuntimeSource(id) {
20
- return ISOLATE_RUNTIME_SOURCES[id];
21
- }