rolldown 1.0.0-beta.37 → 1.0.0-beta.38

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.
@@ -1,11 +1,9 @@
1
1
  import { createRequire } from "node:module";
2
2
 
3
3
  //#region rolldown:runtime
4
- var __create = Object.create;
5
4
  var __defProp = Object.defineProperty;
6
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
8
  var __esm = (fn, res) => function() {
11
9
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
@@ -31,15 +29,11 @@ var __copyProps = (to, from, except, desc) => {
31
29
  }
32
30
  return to;
33
31
  };
34
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
35
- value: mod,
36
- enumerable: true
37
- }) : target, mod));
38
32
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
39
33
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
40
34
 
41
35
  //#endregion
42
- //#region ../../node_modules/.pnpm/@emnapi+wasi-threads@1.0.4/node_modules/@emnapi/wasi-threads/dist/wasi-threads.esm-bundler.js
36
+ //#region ../../node_modules/.pnpm/@emnapi+wasi-threads@1.1.0/node_modules/@emnapi/wasi-threads/dist/wasi-threads.esm-bundler.js
43
37
  function getPostMessage(options) {
44
38
  return typeof (options === null || options === void 0 ? void 0 : options.postMessage) === "function" ? options.postMessage : typeof postMessage === "function" ? postMessage : void 0;
45
39
  }
@@ -235,7 +229,7 @@ function notifyPthreadCreateResult(sab, result, error$1) {
235
229
  }
236
230
  }
237
231
  var _WebAssembly$2, ENVIRONMENT_IS_NODE, WASI_THREADS_MAX_TID, nextWorkerID, ThreadManager, kIsProxy, patchedWasiInstances, WASIThreads, ThreadMessageHandler;
238
- var init_wasi_threads_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+wasi-threads@1.0.4/node_modules/@emnapi/wasi-threads/dist/wasi-threads.esm-bundler.js": (() => {
232
+ var init_wasi_threads_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+wasi-threads@1.1.0/node_modules/@emnapi/wasi-threads/dist/wasi-threads.esm-bundler.js": (() => {
239
233
  _WebAssembly$2 = typeof WebAssembly !== "undefined" ? WebAssembly : typeof WXWebAssembly !== "undefined" ? WXWebAssembly : void 0;
240
234
  ENVIRONMENT_IS_NODE = typeof process === "object" && process !== null && typeof process.versions === "object" && process.versions !== null && typeof process.versions.node === "string";
241
235
  WASI_THREADS_MAX_TID = 536870911;
@@ -686,6 +680,9 @@ var init_wasi_threads_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+wa
686
680
  if (typeof postMsg !== "function") throw new TypeError("options.postMessage is not a function");
687
681
  this.postMessage = postMsg;
688
682
  this.onLoad = options === null || options === void 0 ? void 0 : options.onLoad;
683
+ this.onError = typeof (options === null || options === void 0 ? void 0 : options.onError) === "function" ? options.onError : function(_type, err) {
684
+ throw err;
685
+ };
689
686
  this.instance = void 0;
690
687
  this.messagesBeforeLoad = [];
691
688
  }
@@ -701,10 +698,14 @@ var init_wasi_threads_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+wa
701
698
  if ((_a = e === null || e === void 0 ? void 0 : e.data) === null || _a === void 0 ? void 0 : _a.__emnapi__) {
702
699
  var type = e.data.__emnapi__.type;
703
700
  var payload_1 = e.data.__emnapi__.payload;
704
- if (type === "load") this._load(payload_1);
705
- else if (type === "start") this.handleAfterLoad(e, function() {
706
- _this._start(payload_1);
707
- });
701
+ try {
702
+ if (type === "load") this._load(payload_1);
703
+ else if (type === "start") this.handleAfterLoad(e, function() {
704
+ _this._start(payload_1);
705
+ });
706
+ } catch (err) {
707
+ this.onError(err, type);
708
+ }
708
709
  }
709
710
  };
710
711
  ThreadMessageHandler$1.prototype._load = function(payload) {
@@ -736,7 +737,12 @@ var init_wasi_threads_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+wa
736
737
  var tid = payload.tid;
737
738
  var startArg = payload.arg;
738
739
  notifyPthreadCreateResult(payload.sab, 1);
739
- wasi_thread_start(tid, startArg);
740
+ try {
741
+ wasi_thread_start(tid, startArg);
742
+ } catch (err$1) {
743
+ if (err$1 !== "unwind") throw err$1;
744
+ else return;
745
+ }
740
746
  postMessage$1(createMessage("cleanup-thread", { tid }));
741
747
  };
742
748
  ThreadMessageHandler$1.prototype._loaded = function(err, source, payload) {
@@ -783,7 +789,7 @@ function __extends(d, b) {
783
789
  }
784
790
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
785
791
  }
786
- var extendStatics;
792
+ var extendStatics, __assign;
787
793
  var init_tslib_es6 = __esm({ "../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs": (() => {
788
794
  extendStatics = function(d, b) {
789
795
  extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d$1, b$1) {
@@ -793,11 +799,21 @@ var init_tslib_es6 = __esm({ "../../node_modules/.pnpm/tslib@2.8.1/node_modules/
793
799
  };
794
800
  return extendStatics(d, b);
795
801
  };
802
+ __assign = function() {
803
+ __assign = Object.assign || function __assign$1(t) {
804
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
805
+ s = arguments[i];
806
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
807
+ }
808
+ return t;
809
+ };
810
+ return __assign.apply(this, arguments);
811
+ };
796
812
  }) });
797
813
 
798
814
  //#endregion
799
- //#region ../../node_modules/.pnpm/@emnapi+core@1.4.5/node_modules/@emnapi/core/dist/emnapi-core.esm-bundler.js
800
- var emnapi_core_esm_bundler_exports = __export({
815
+ //#region ../../node_modules/.pnpm/@emnapi+core@1.5.0/node_modules/@emnapi/core/dist/emnapi-core.esm-bundler.js
816
+ var emnapi_core_esm_bundler_exports = /* @__PURE__ */ __export({
801
817
  MessageHandler: () => MessageHandler$1,
802
818
  ThreadManager: () => ThreadManager,
803
819
  ThreadMessageHandler: () => ThreadMessageHandler,
@@ -930,6 +946,8 @@ function createNapiModule(options) {
930
946
  var napiValue = napi_register_wasm_v1(_envObject.id, exportsHandle.id);
931
947
  napiModule.exports = !napiValue ? exports$2 : emnapiCtx.handleStore.get(napiValue).value;
932
948
  });
949
+ } catch (e) {
950
+ if (e !== "unwind") throw e;
933
951
  } finally {
934
952
  emnapiCtx.closeScope(envObject, scope_1);
935
953
  }
@@ -1104,6 +1122,30 @@ function createNapiModule(options) {
1104
1122
  function _emnapi_ctx_decrease_waiting_request_counter() {
1105
1123
  emnapiCtx.decreaseWaitingRequestCounter();
1106
1124
  }
1125
+ /**
1126
+ * @__sig i
1127
+ */
1128
+ function _emnapi_is_main_runtime_thread() {
1129
+ return ENVIRONMENT_IS_PTHREAD ? 0 : 1;
1130
+ }
1131
+ /**
1132
+ * @__sig i
1133
+ */
1134
+ function _emnapi_is_main_browser_thread() {
1135
+ return typeof window !== "undefined" && typeof document !== "undefined" && !ENVIRONMENT_IS_NODE$1 ? 1 : 0;
1136
+ }
1137
+ /**
1138
+ * @__sig v
1139
+ */
1140
+ function _emnapi_unwind() {
1141
+ throw "unwind";
1142
+ }
1143
+ /**
1144
+ * @__sig d
1145
+ */
1146
+ function _emnapi_get_now() {
1147
+ return performance.timeOrigin + performance.now();
1148
+ }
1107
1149
  function $emnapiSetValueI64(result, numberValue) {
1108
1150
  var tempDouble;
1109
1151
  var tempI64 = [numberValue >>> 0, (tempDouble = numberValue, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)];
@@ -1111,18 +1153,38 @@ function createNapiModule(options) {
1111
1153
  HEAP_DATA_VIEW.setInt32(result, tempI64[0], true);
1112
1154
  HEAP_DATA_VIEW.setInt32(result + 4, tempI64[1], true);
1113
1155
  }
1156
+ /**
1157
+ * @__deps $emnapiCtx
1158
+ * @__sig p
1159
+ */
1160
+ function _emnapi_open_handle_scope() {
1161
+ return emnapiCtx.openScope().id;
1162
+ }
1163
+ /**
1164
+ * @__deps $emnapiCtx
1165
+ * @__sig vp
1166
+ */
1167
+ function _emnapi_close_handle_scope(_scope) {
1168
+ return emnapiCtx.closeScope();
1169
+ }
1114
1170
  var utilMod = /* @__PURE__ */ Object.freeze({
1115
1171
  __proto__: null,
1116
1172
  $emnapiSetValueI64,
1117
1173
  _emnapi_call_finalizer,
1118
1174
  _emnapi_callback_into_module,
1175
+ _emnapi_close_handle_scope,
1119
1176
  _emnapi_ctx_decrease_waiting_request_counter,
1120
1177
  _emnapi_ctx_increase_waiting_request_counter,
1121
1178
  _emnapi_get_node_version,
1179
+ _emnapi_get_now,
1180
+ _emnapi_is_main_browser_thread,
1181
+ _emnapi_is_main_runtime_thread,
1122
1182
  _emnapi_next_tick,
1183
+ _emnapi_open_handle_scope,
1123
1184
  _emnapi_runtime_keepalive_pop,
1124
1185
  _emnapi_runtime_keepalive_push,
1125
1186
  _emnapi_set_immediate,
1187
+ _emnapi_unwind,
1126
1188
  napi_clear_last_error,
1127
1189
  napi_set_last_error
1128
1190
  });
@@ -1164,10 +1226,6 @@ function createNapiModule(options) {
1164
1226
  };
1165
1227
  });
1166
1228
  uvThreadpoolReady.ready = false;
1167
- /** @__sig i */
1168
- function _emnapi_is_main_browser_thread() {
1169
- return typeof window !== "undefined" && typeof document !== "undefined" && !ENVIRONMENT_IS_NODE$1 ? 1 : 0;
1170
- }
1171
1229
  /** @__sig vppi */
1172
1230
  function _emnapi_after_uvthreadpool_ready(callback, q, type) {
1173
1231
  if (uvThreadpoolReady.ready) wasmTable.get(callback)(q, type);
@@ -1180,7 +1238,7 @@ function createNapiModule(options) {
1180
1238
  var p = [];
1181
1239
  var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
1182
1240
  var _loop_1 = function(i$1) {
1183
- var pthreadPtr = HEAP_DATA_VIEW.getInt32(threads + i$1 * 4, true);
1241
+ var pthreadPtr = HEAP_DATA_VIEW.getUint32(threads + i$1 * 4, true);
1184
1242
  var worker = emnapiGetWorkerByPthreadPtr(pthreadPtr);
1185
1243
  p.push(new Promise(function(resolve$1) {
1186
1244
  var handler = function(e) {
@@ -1213,7 +1271,6 @@ function createNapiModule(options) {
1213
1271
  _emnapi_after_uvthreadpool_ready,
1214
1272
  _emnapi_async_send_js,
1215
1273
  _emnapi_emit_async_thread_ready,
1216
- _emnapi_is_main_browser_thread,
1217
1274
  _emnapi_tell_js_uvthreadpool,
1218
1275
  _emnapi_worker_unref
1219
1276
  });
@@ -1401,7 +1458,7 @@ function createNapiModule(options) {
1401
1458
  var arr = Array(size);
1402
1459
  var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
1403
1460
  for (; i < size; i++) {
1404
- var argVal = HEAP_DATA_VIEW.getInt32(argv + i * 4, true);
1461
+ var argVal = HEAP_DATA_VIEW.getUint32(argv + i * 4, true);
1405
1462
  arr[i] = emnapiCtx.handleStore.get(argVal).value;
1406
1463
  }
1407
1464
  var ret = emnapiNodeBinding.node.makeCallback(resource, callback, arr, {
@@ -1410,7 +1467,7 @@ function createNapiModule(options) {
1410
1467
  });
1411
1468
  if (result) {
1412
1469
  v = emnapiCtx.envStore.get(env).ensureHandleId(ret);
1413
- HEAP_DATA_VIEW.setInt32(result, v, true);
1470
+ HEAP_DATA_VIEW.setUint32(result, v, true);
1414
1471
  }
1415
1472
  }
1416
1473
  /** @__sig ippp */
@@ -1478,7 +1535,7 @@ function createNapiModule(options) {
1478
1535
  argc = argc >>> 0;
1479
1536
  var arr = Array(argc);
1480
1537
  for (; i < argc; i++) {
1481
- var argVal = HEAP_DATA_VIEW.getInt32(argv + i * 4, true);
1538
+ var argVal = HEAP_DATA_VIEW.getUint32(argv + i * 4, true);
1482
1539
  arr[i] = emnapiCtx.handleStore.get(argVal).value;
1483
1540
  }
1484
1541
  var ret = emnapiNodeBinding.napi.makeCallback(ctx, v8recv, v8func, arr);
@@ -1486,7 +1543,7 @@ function createNapiModule(options) {
1486
1543
  if (ret.status !== 0) return envObject.setLastError(ret.status);
1487
1544
  if (result) {
1488
1545
  v = envObject.ensureHandleId(ret.value);
1489
- HEAP_DATA_VIEW.setInt32(result, v, true);
1546
+ HEAP_DATA_VIEW.setUint32(result, v, true);
1490
1547
  }
1491
1548
  return envObject.getReturnStatus();
1492
1549
  } catch (err$1) {
@@ -1997,7 +2054,7 @@ function createNapiModule(options) {
1997
2054
  var resourceRef = emnapiCtx.createReference(envObject, resource, 1, 1);
1998
2055
  var resource_ = resourceRef.id;
1999
2056
  var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
2000
- HEAP_DATA_VIEW.setInt32(tsfn, resource_, true);
2057
+ HEAP_DATA_VIEW.setUint32(tsfn, resource_, true);
2001
2058
  if (!emnapiTSFN.initQueue(tsfn)) {
2002
2059
  _free(tsfn);
2003
2060
  resourceRef.dispose();
@@ -2005,18 +2062,18 @@ function createNapiModule(options) {
2005
2062
  }
2006
2063
  _emnapi_node_emit_async_init(resource, resource_name, -1, tsfn + emnapiTSFN.offset.async_id);
2007
2064
  HEAP_DATA_VIEW.setUint32(tsfn + emnapiTSFN.offset.thread_count, initial_thread_count, true);
2008
- HEAP_DATA_VIEW.setInt32(tsfn + emnapiTSFN.offset.context, context$1, true);
2065
+ HEAP_DATA_VIEW.setUint32(tsfn + emnapiTSFN.offset.context, context$1, true);
2009
2066
  HEAP_DATA_VIEW.setUint32(tsfn + emnapiTSFN.offset.max_queue_size, max_queue_size, true);
2010
- HEAP_DATA_VIEW.setInt32(tsfn + emnapiTSFN.offset.ref, ref, true);
2011
- HEAP_DATA_VIEW.setInt32(tsfn + emnapiTSFN.offset.env, env, true);
2012
- HEAP_DATA_VIEW.setInt32(tsfn + emnapiTSFN.offset.finalize_data, thread_finalize_data, true);
2013
- HEAP_DATA_VIEW.setInt32(tsfn + emnapiTSFN.offset.finalize_cb, thread_finalize_cb, true);
2014
- HEAP_DATA_VIEW.setInt32(tsfn + emnapiTSFN.offset.call_js_cb, call_js_cb, true);
2067
+ HEAP_DATA_VIEW.setUint32(tsfn + emnapiTSFN.offset.ref, ref, true);
2068
+ HEAP_DATA_VIEW.setUint32(tsfn + emnapiTSFN.offset.env, env, true);
2069
+ HEAP_DATA_VIEW.setUint32(tsfn + emnapiTSFN.offset.finalize_data, thread_finalize_data, true);
2070
+ HEAP_DATA_VIEW.setUint32(tsfn + emnapiTSFN.offset.finalize_cb, thread_finalize_cb, true);
2071
+ HEAP_DATA_VIEW.setUint32(tsfn + emnapiTSFN.offset.call_js_cb, call_js_cb, true);
2015
2072
  emnapiCtx.addCleanupHook(envObject, emnapiTSFN.cleanup, tsfn);
2016
2073
  envObject.ref();
2017
2074
  emnapiCtx.increaseWaitingRequestCounter();
2018
2075
  HEAP_DATA_VIEW.setInt32(tsfn + emnapiTSFN.offset.async_ref, 1, true);
2019
- HEAP_DATA_VIEW.setInt32(result, tsfn, true);
2076
+ HEAP_DATA_VIEW.setUint32(result, tsfn, true);
2020
2077
  return envObject.clearLastError();
2021
2078
  }
2022
2079
  /** @__sig ipp */
@@ -2026,7 +2083,7 @@ function createNapiModule(options) {
2026
2083
  return 1;
2027
2084
  }
2028
2085
  var context$1 = emnapiTSFN.getContext(func);
2029
- new DataView(wasmMemory.buffer).setInt32(result, context$1, true);
2086
+ new DataView(wasmMemory.buffer).setUint32(result, context$1, true);
2030
2087
  return 0;
2031
2088
  }
2032
2089
  /** @__sig ippi */
@@ -2307,7 +2364,7 @@ function createNapiModule(options) {
2307
2364
  if (!resource_name) return envObject.setLastError(1);
2308
2365
  var resourceName = String(emnapiCtx.handleStore.get(resource_name).value);
2309
2366
  var id = emnapiAWST.create(env, resourceObject, resourceName, execute, complete, data);
2310
- new DataView(wasmMemory.buffer).setInt32(result, id, true);
2367
+ new DataView(wasmMemory.buffer).setUint32(result, id, true);
2311
2368
  return envObject.clearLastError();
2312
2369
  } : function(env, resource, resource_name, execute, complete, data, result) {
2313
2370
  if (!env) return 1;
@@ -2326,13 +2383,13 @@ function createNapiModule(options) {
2326
2383
  var s = envObject.ensureHandleId(resourceObject);
2327
2384
  var resource_ = emnapiCtx.createReference(envObject, s, 1, 1).id;
2328
2385
  var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
2329
- HEAP_DATA_VIEW.setInt32(aw, resource_, true);
2386
+ HEAP_DATA_VIEW.setUint32(aw, resource_, true);
2330
2387
  _emnapi_node_emit_async_init(s, resource_name, -1, aw + emnapiAWMT.offset.async_id);
2331
- HEAP_DATA_VIEW.setInt32(aw + emnapiAWMT.offset.env, env, true);
2332
- HEAP_DATA_VIEW.setInt32(aw + emnapiAWMT.offset.execute, execute, true);
2333
- HEAP_DATA_VIEW.setInt32(aw + emnapiAWMT.offset.complete, complete, true);
2334
- HEAP_DATA_VIEW.setInt32(aw + emnapiAWMT.offset.data, data, true);
2335
- HEAP_DATA_VIEW.setInt32(result, aw, true);
2388
+ HEAP_DATA_VIEW.setUint32(aw + emnapiAWMT.offset.env, env, true);
2389
+ HEAP_DATA_VIEW.setUint32(aw + emnapiAWMT.offset.execute, execute, true);
2390
+ HEAP_DATA_VIEW.setUint32(aw + emnapiAWMT.offset.complete, complete, true);
2391
+ HEAP_DATA_VIEW.setUint32(aw + emnapiAWMT.offset.data, data, true);
2392
+ HEAP_DATA_VIEW.setUint32(result, aw, true);
2336
2393
  return envObject.clearLastError();
2337
2394
  };
2338
2395
  /** @__sig ipp */
@@ -2716,7 +2773,7 @@ function createNapiModule(options) {
2716
2773
  if (!(autoLength || sizelength <= 2147483647)) return envObject.setLastError(1);
2717
2774
  var strValue = stringMaker(str, autoLength, sizelength);
2718
2775
  var value = emnapiCtx.addToCurrentScope(strValue).id;
2719
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
2776
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
2720
2777
  return envObject.clearLastError();
2721
2778
  },
2722
2779
  newExternalString: function(env, str, length, finalize_callback, finalize_hint, result, copied, createApi, stringMaker) {
@@ -2774,7 +2831,7 @@ function createNapiModule(options) {
2774
2831
  var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
2775
2832
  if (data) {
2776
2833
  var p = emnapiExternalMemory.getArrayBufferPointer(handle.value, true).address;
2777
- HEAP_DATA_VIEW.setInt32(data, p, true);
2834
+ HEAP_DATA_VIEW.setUint32(data, p, true);
2778
2835
  }
2779
2836
  if (byte_length) HEAP_DATA_VIEW.setUint32(byte_length, handle.value.byteLength, true);
2780
2837
  return envObject.clearLastError();
@@ -2801,7 +2858,7 @@ function createNapiModule(options) {
2801
2858
  return envObject.setLastError(2);
2802
2859
  }
2803
2860
  var p = envObject.ensureHandleId(Object.getPrototypeOf(v));
2804
- new DataView(wasmMemory.buffer).setInt32(result, p, true);
2861
+ new DataView(wasmMemory.buffer).setUint32(result, p, true);
2805
2862
  return envObject.getReturnStatus();
2806
2863
  } catch (err$1) {
2807
2864
  envObject.tryCatch.setError(err$1);
@@ -2842,11 +2899,11 @@ function createNapiModule(options) {
2842
2899
  buffer = v.buffer;
2843
2900
  if (data) {
2844
2901
  var p = emnapiExternalMemory.getViewPointer(v, true).address;
2845
- HEAP_DATA_VIEW.setInt32(data, p, true);
2902
+ HEAP_DATA_VIEW.setUint32(data, p, true);
2846
2903
  }
2847
2904
  if (arraybuffer) {
2848
2905
  var ab = envObject.ensureHandleId(buffer);
2849
- HEAP_DATA_VIEW.setInt32(arraybuffer, ab, true);
2906
+ HEAP_DATA_VIEW.setUint32(arraybuffer, ab, true);
2850
2907
  }
2851
2908
  }
2852
2909
  if (byte_offset) HEAP_DATA_VIEW.setUint32(byte_offset, v.byteOffset, true);
@@ -2883,11 +2940,11 @@ function createNapiModule(options) {
2883
2940
  buffer = v.buffer;
2884
2941
  if (data) {
2885
2942
  var p = emnapiExternalMemory.getViewPointer(v, true).address;
2886
- HEAP_DATA_VIEW.setInt32(data, p, true);
2943
+ HEAP_DATA_VIEW.setUint32(data, p, true);
2887
2944
  }
2888
2945
  if (arraybuffer) {
2889
2946
  var ab = envObject.ensureHandleId(buffer);
2890
- HEAP_DATA_VIEW.setInt32(arraybuffer, ab, true);
2947
+ HEAP_DATA_VIEW.setUint32(arraybuffer, ab, true);
2891
2948
  }
2892
2949
  }
2893
2950
  if (byte_offset) HEAP_DATA_VIEW.setUint32(byte_offset, v.byteOffset, true);
@@ -3056,7 +3113,7 @@ function createNapiModule(options) {
3056
3113
  var handle = emnapiCtx.handleStore.get(value);
3057
3114
  if (!handle.isExternal()) return envObject.setLastError(1);
3058
3115
  var p = handle.data();
3059
- new DataView(wasmMemory.buffer).setInt32(result, p, true);
3116
+ new DataView(wasmMemory.buffer).setUint32(result, p, true);
3060
3117
  return envObject.clearLastError();
3061
3118
  }
3062
3119
  /**
@@ -3216,7 +3273,7 @@ function createNapiModule(options) {
3216
3273
  envObject.checkGCAccess();
3217
3274
  if (!result) return envObject.setLastError(1);
3218
3275
  var v = emnapiCtx.addToCurrentScope(value).id;
3219
- new DataView(wasmMemory.buffer).setInt32(result, v, true);
3276
+ new DataView(wasmMemory.buffer).setUint32(result, v, true);
3220
3277
  return envObject.clearLastError();
3221
3278
  }
3222
3279
  /**
@@ -3228,7 +3285,7 @@ function createNapiModule(options) {
3228
3285
  envObject.checkGCAccess();
3229
3286
  if (!result) return envObject.setLastError(1);
3230
3287
  var v = emnapiCtx.addToCurrentScope(value >>> 0).id;
3231
- new DataView(wasmMemory.buffer).setInt32(result, v, true);
3288
+ new DataView(wasmMemory.buffer).setUint32(result, v, true);
3232
3289
  return envObject.clearLastError();
3233
3290
  }
3234
3291
  /**
@@ -3242,7 +3299,7 @@ function createNapiModule(options) {
3242
3299
  if (!high) return envObject.setLastError(1);
3243
3300
  value = Number(low);
3244
3301
  var v1 = emnapiCtx.addToCurrentScope(value).id;
3245
- new DataView(wasmMemory.buffer).setInt32(high, v1, true);
3302
+ new DataView(wasmMemory.buffer).setUint32(high, v1, true);
3246
3303
  return envObject.clearLastError();
3247
3304
  }
3248
3305
  /**
@@ -3254,7 +3311,7 @@ function createNapiModule(options) {
3254
3311
  envObject.checkGCAccess();
3255
3312
  if (!result) return envObject.setLastError(1);
3256
3313
  var v = emnapiCtx.addToCurrentScope(value).id;
3257
- new DataView(wasmMemory.buffer).setInt32(result, v, true);
3314
+ new DataView(wasmMemory.buffer).setUint32(result, v, true);
3258
3315
  return envObject.clearLastError();
3259
3316
  }
3260
3317
  /**
@@ -3339,7 +3396,7 @@ function createNapiModule(options) {
3339
3396
  if (!high) return envObject.setLastError(1);
3340
3397
  value = low;
3341
3398
  var v1 = emnapiCtx.addToCurrentScope(value).id;
3342
- new DataView(wasmMemory.buffer).setInt32(high, v1, true);
3399
+ new DataView(wasmMemory.buffer).setUint32(high, v1, true);
3343
3400
  return envObject.clearLastError();
3344
3401
  }
3345
3402
  /**
@@ -3354,7 +3411,7 @@ function createNapiModule(options) {
3354
3411
  if (!high) return envObject.setLastError(1);
3355
3412
  value = low & (BigInt(1) << BigInt(64)) - BigInt(1);
3356
3413
  var v1 = emnapiCtx.addToCurrentScope(value).id;
3357
- new DataView(wasmMemory.buffer).setInt32(high, v1, true);
3414
+ new DataView(wasmMemory.buffer).setUint32(high, v1, true);
3358
3415
  return envObject.clearLastError();
3359
3416
  }
3360
3417
  /**
@@ -3384,7 +3441,7 @@ function createNapiModule(options) {
3384
3441
  }
3385
3442
  value *= BigInt(sign_bit) % BigInt(2) === BigInt(0) ? BigInt(1) : BigInt(-1);
3386
3443
  v = emnapiCtx.addToCurrentScope(value).id;
3387
- HEAP_DATA_VIEW.setInt32(result, v, true);
3444
+ HEAP_DATA_VIEW.setUint32(result, v, true);
3388
3445
  return envObject.getReturnStatus();
3389
3446
  } catch (err$1) {
3390
3447
  envObject.tryCatch.setError(err$1);
@@ -3530,7 +3587,7 @@ function createNapiModule(options) {
3530
3587
  if (!finalize_cb) return envObject.setLastError(1);
3531
3588
  reference = emnapiCtx.createReferenceWithFinalizer(envObject, handle.id, 0, 1, finalize_cb, native_object, finalize_hint);
3532
3589
  referenceId = reference.id;
3533
- new DataView(wasmMemory.buffer).setInt32(result, referenceId, true);
3590
+ new DataView(wasmMemory.buffer).setUint32(result, referenceId, true);
3534
3591
  } else if (finalize_cb) reference = emnapiCtx.createReferenceWithFinalizer(envObject, handle.id, 0, 0, finalize_cb, native_object, finalize_hint);
3535
3592
  else reference = emnapiCtx.createReferenceWithData(envObject, handle.id, 0, 0, native_object);
3536
3593
  envObject.getObjectBinding(handle.value).wrapped = reference.id;
@@ -3561,7 +3618,7 @@ function createNapiModule(options) {
3561
3618
  if (!ref) return envObject.setLastError(1);
3562
3619
  if (result) {
3563
3620
  data = ref.data();
3564
- new DataView(wasmMemory.buffer).setInt32(result, data, true);
3621
+ new DataView(wasmMemory.buffer).setUint32(result, data, true);
3565
3622
  }
3566
3623
  if (action === 1) {
3567
3624
  binding.wrapped = 0;
@@ -3600,14 +3657,14 @@ function createNapiModule(options) {
3600
3657
  var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
3601
3658
  for (var i = 0; i < property_count; i++) {
3602
3659
  propPtr = properties + i * 32;
3603
- var utf8Name = HEAP_DATA_VIEW.getInt32(propPtr, true);
3604
- var name_1 = HEAP_DATA_VIEW.getInt32(propPtr + 4, true);
3605
- var method = HEAP_DATA_VIEW.getInt32(propPtr + 8, true);
3606
- var getter = HEAP_DATA_VIEW.getInt32(propPtr + 12, true);
3607
- var setter = HEAP_DATA_VIEW.getInt32(propPtr + 16, true);
3608
- var value = HEAP_DATA_VIEW.getInt32(propPtr + 20, true);
3660
+ var utf8Name = HEAP_DATA_VIEW.getUint32(propPtr, true);
3661
+ var name_1 = HEAP_DATA_VIEW.getUint32(propPtr + 4, true);
3662
+ var method = HEAP_DATA_VIEW.getUint32(propPtr + 8, true);
3663
+ var getter = HEAP_DATA_VIEW.getUint32(propPtr + 12, true);
3664
+ var setter = HEAP_DATA_VIEW.getUint32(propPtr + 16, true);
3665
+ var value = HEAP_DATA_VIEW.getUint32(propPtr + 20, true);
3609
3666
  attributes = HEAP_DATA_VIEW.getInt32(propPtr + 24, true);
3610
- var data = HEAP_DATA_VIEW.getInt32(propPtr + 28, true);
3667
+ var data = HEAP_DATA_VIEW.getUint32(propPtr + 28, true);
3611
3668
  if (utf8Name) propertyName = emnapiString.UTF8ToString(utf8Name, -1);
3612
3669
  else {
3613
3670
  if (!name_1) return envObject.setLastError(4);
@@ -3621,7 +3678,7 @@ function createNapiModule(options) {
3621
3678
  emnapiDefineProperty(envObject, F.prototype, propertyName, method, getter, setter, value, attributes, data);
3622
3679
  }
3623
3680
  valueHandleId = emnapiCtx.addToCurrentScope(F).id;
3624
- HEAP_DATA_VIEW.setInt32(result, valueHandleId, true);
3681
+ HEAP_DATA_VIEW.setUint32(result, valueHandleId, true);
3625
3682
  return envObject.getReturnStatus();
3626
3683
  } catch (err$1) {
3627
3684
  envObject.tryCatch.setError(err$1);
@@ -3719,7 +3776,7 @@ function createNapiModule(options) {
3719
3776
  var reference = emnapiCtx.createReferenceWithFinalizer(envObject, handle.id, 0, ownership, finalize_cb, finalize_data, finalize_hint);
3720
3777
  if (result) {
3721
3778
  var referenceId = reference.id;
3722
- new DataView(wasmMemory.buffer).setInt32(result, referenceId, true);
3779
+ new DataView(wasmMemory.buffer).setUint32(result, referenceId, true);
3723
3780
  }
3724
3781
  return envObject.clearLastError();
3725
3782
  }
@@ -3896,7 +3953,7 @@ function createNapiModule(options) {
3896
3953
  } else if (status_1 !== 0) return envObject.setLastError(status_1);
3897
3954
  }
3898
3955
  value = handle.id;
3899
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
3956
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
3900
3957
  return envObject.getReturnStatus();
3901
3958
  } catch (err$2) {
3902
3959
  envObject.tryCatch.setError(err$2);
@@ -3967,13 +4024,13 @@ function createNapiModule(options) {
3967
4024
  try {
3968
4025
  if (!arraybuffer_or_view) return envObject.setLastError(1);
3969
4026
  var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
3970
- var handleId = HEAP_DATA_VIEW.getInt32(arraybuffer_or_view, true);
4027
+ var handleId = HEAP_DATA_VIEW.getUint32(arraybuffer_or_view, true);
3971
4028
  var handle = envObject.ctx.handleStore.get(handleId);
3972
4029
  if (!handle.isArrayBuffer() && !handle.isTypedArray() && !handle.isDataView()) return envObject.setLastError(1);
3973
4030
  var ret = $emnapiSyncMemory(Boolean(js_to_wasm), handle.value, offset, len);
3974
4031
  if (handle.value !== ret) {
3975
4032
  v = envObject.ensureHandleId(ret);
3976
- HEAP_DATA_VIEW.setInt32(arraybuffer_or_view, v, true);
4033
+ HEAP_DATA_VIEW.setUint32(arraybuffer_or_view, v, true);
3977
4034
  }
3978
4035
  return envObject.getReturnStatus();
3979
4036
  } catch (err$1) {
@@ -4013,7 +4070,7 @@ function createNapiModule(options) {
4013
4070
  info = $emnapiGetMemoryAddress(handle.value);
4014
4071
  p = info.address;
4015
4072
  var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
4016
- if (address) HEAP_DATA_VIEW.setInt32(address, p, true);
4073
+ if (address) HEAP_DATA_VIEW.setUint32(address, p, true);
4017
4074
  if (ownership) {
4018
4075
  ownershipOut = info.ownership;
4019
4076
  HEAP_DATA_VIEW.setInt32(ownership, ownershipOut, true);
@@ -4071,7 +4128,7 @@ function createNapiModule(options) {
4071
4128
  envObject.checkGCAccess();
4072
4129
  if (!result) return envObject.setLastError(1);
4073
4130
  var value = emnapiCtx.addToCurrentScope([]).id;
4074
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4131
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4075
4132
  return envObject.clearLastError();
4076
4133
  }
4077
4134
  /**
@@ -4084,7 +4141,7 @@ function createNapiModule(options) {
4084
4141
  if (!result) return envObject.setLastError(1);
4085
4142
  length = length >>> 0;
4086
4143
  var value = emnapiCtx.addToCurrentScope(new Array(length)).id;
4087
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4144
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4088
4145
  return envObject.clearLastError();
4089
4146
  }
4090
4147
  function emnapiCreateArrayBuffer(byte_length, data) {
@@ -4092,7 +4149,7 @@ function createNapiModule(options) {
4092
4149
  var arrayBuffer = new ArrayBuffer(byte_length);
4093
4150
  if (data) {
4094
4151
  var p = emnapiExternalMemory.getArrayBufferPointer(arrayBuffer, true).address;
4095
- new DataView(wasmMemory.buffer).setInt32(data, p, true);
4152
+ new DataView(wasmMemory.buffer).setUint32(data, p, true);
4096
4153
  }
4097
4154
  return arrayBuffer;
4098
4155
  }
@@ -4111,7 +4168,7 @@ function createNapiModule(options) {
4111
4168
  if (!result) return envObject.setLastError(1);
4112
4169
  var arrayBuffer = emnapiCreateArrayBuffer(byte_length, data);
4113
4170
  value = emnapiCtx.addToCurrentScope(arrayBuffer).id;
4114
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4171
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4115
4172
  return envObject.getReturnStatus();
4116
4173
  } catch (err$1) {
4117
4174
  envObject.tryCatch.setError(err$1);
@@ -4132,7 +4189,7 @@ function createNapiModule(options) {
4132
4189
  try {
4133
4190
  if (!result) return envObject.setLastError(1);
4134
4191
  value = emnapiCtx.addToCurrentScope(new Date(time)).id;
4135
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4192
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4136
4193
  return envObject.getReturnStatus();
4137
4194
  } catch (err$1) {
4138
4195
  envObject.tryCatch.setError(err$1);
@@ -4156,7 +4213,7 @@ function createNapiModule(options) {
4156
4213
  var externalHandle = emnapiCtx.getCurrentScope().addExternal(data);
4157
4214
  if (finalize_cb) emnapiCtx.createReferenceWithFinalizer(envObject, externalHandle.id, 0, 0, finalize_cb, data, finalize_hint);
4158
4215
  value = externalHandle.id;
4159
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4216
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4160
4217
  return envObject.clearLastError();
4161
4218
  } catch (err$1) {
4162
4219
  envObject.tryCatch.setError(err$1);
@@ -4203,7 +4260,7 @@ function createNapiModule(options) {
4203
4260
  } else if (status_1 !== 0) return envObject.setLastError(status_1);
4204
4261
  }
4205
4262
  value = handle.id;
4206
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4263
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4207
4264
  return envObject.getReturnStatus();
4208
4265
  } catch (err$2) {
4209
4266
  envObject.tryCatch.setError(err$2);
@@ -4219,7 +4276,7 @@ function createNapiModule(options) {
4219
4276
  envObject.checkGCAccess();
4220
4277
  if (!result) return envObject.setLastError(1);
4221
4278
  var value = emnapiCtx.addToCurrentScope({}).id;
4222
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4279
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4223
4280
  return envObject.clearLastError();
4224
4281
  }
4225
4282
  /**
@@ -4233,12 +4290,12 @@ function createNapiModule(options) {
4233
4290
  var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
4234
4291
  if (!description) {
4235
4292
  var value = emnapiCtx.addToCurrentScope(Symbol()).id;
4236
- HEAP_DATA_VIEW.setInt32(result, value, true);
4293
+ HEAP_DATA_VIEW.setUint32(result, value, true);
4237
4294
  } else {
4238
4295
  var desc = emnapiCtx.handleStore.get(description).value;
4239
4296
  if (typeof desc !== "string") return envObject.setLastError(3);
4240
4297
  var v = emnapiCtx.addToCurrentScope(Symbol(desc)).id;
4241
- HEAP_DATA_VIEW.setInt32(result, v, true);
4298
+ HEAP_DATA_VIEW.setUint32(result, v, true);
4242
4299
  }
4243
4300
  return envObject.clearLastError();
4244
4301
  }
@@ -4288,7 +4345,7 @@ function createNapiModule(options) {
4288
4345
  });
4289
4346
  }
4290
4347
  value = emnapiCtx.addToCurrentScope(out).id;
4291
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4348
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4292
4349
  return envObject$1.getReturnStatus();
4293
4350
  };
4294
4351
  switch (type) {
@@ -4333,7 +4390,7 @@ function createNapiModule(options) {
4333
4390
  if (!data || size === 0) {
4334
4391
  buffer = Buffer$1.alloc(size);
4335
4392
  value = emnapiCtx.addToCurrentScope(buffer).id;
4336
- HEAP_DATA_VIEW.setInt32(result, value, true);
4393
+ HEAP_DATA_VIEW.setUint32(result, value, true);
4337
4394
  } else {
4338
4395
  pointer = _malloc(size);
4339
4396
  if (!pointer) throw new Error("Out of memory");
@@ -4349,8 +4406,8 @@ function createNapiModule(options) {
4349
4406
  emnapiExternalMemory.wasmMemoryViewTable.set(buffer_1, viewDescriptor);
4350
4407
  (_a = emnapiExternalMemory.registry) === null || _a === void 0 || _a.register(viewDescriptor, pointer);
4351
4408
  value = emnapiCtx.addToCurrentScope(buffer_1).id;
4352
- HEAP_DATA_VIEW.setInt32(result, value, true);
4353
- HEAP_DATA_VIEW.setInt32(data, pointer, true);
4409
+ HEAP_DATA_VIEW.setUint32(result, value, true);
4410
+ HEAP_DATA_VIEW.setUint32(data, pointer, true);
4354
4411
  }
4355
4412
  return envObject.getReturnStatus();
4356
4413
  } catch (err$1) {
@@ -4377,7 +4434,7 @@ function createNapiModule(options) {
4377
4434
  var buffer = Buffer$1.from(arrayBuffer);
4378
4435
  buffer.set(new Uint8Array(wasmMemory.buffer).subarray(data, data + length));
4379
4436
  value = emnapiCtx.addToCurrentScope(buffer).id;
4380
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4437
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4381
4438
  return envObject.getReturnStatus();
4382
4439
  } catch (err$1) {
4383
4440
  envObject.tryCatch.setError(err$1);
@@ -4427,7 +4484,7 @@ function createNapiModule(options) {
4427
4484
  });
4428
4485
  }
4429
4486
  value = emnapiCtx.addToCurrentScope(out).id;
4430
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4487
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4431
4488
  return envObject.getReturnStatus();
4432
4489
  } catch (err$2) {
4433
4490
  envObject.tryCatch.setError(err$2);
@@ -4469,7 +4526,7 @@ function createNapiModule(options) {
4469
4526
  });
4470
4527
  }
4471
4528
  value = emnapiCtx.addToCurrentScope(dataview).id;
4472
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4529
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4473
4530
  return envObject.getReturnStatus();
4474
4531
  } catch (err$2) {
4475
4532
  envObject.tryCatch.setError(err$2);
@@ -4492,7 +4549,7 @@ function createNapiModule(options) {
4492
4549
  if (!(autoLength || sizelength <= 2147483647)) return envObject.setLastError(1);
4493
4550
  var descriptionString = emnapiString.UTF8ToString(utf8description, length);
4494
4551
  var value = emnapiCtx.addToCurrentScope(Symbol.for(descriptionString)).id;
4495
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4552
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4496
4553
  return envObject.clearLastError();
4497
4554
  }
4498
4555
  var createMod = /* @__PURE__ */ Object.freeze({
@@ -4520,7 +4577,7 @@ function createNapiModule(options) {
4520
4577
  envObject.checkGCAccess();
4521
4578
  if (!result) return envObject.setLastError(1);
4522
4579
  var v = value === 0 ? 3 : 4;
4523
- new DataView(wasmMemory.buffer).setInt32(result, v, true);
4580
+ new DataView(wasmMemory.buffer).setUint32(result, v, true);
4524
4581
  return envObject.clearLastError();
4525
4582
  }
4526
4583
  /** @__sig ipp */
@@ -4529,7 +4586,7 @@ function createNapiModule(options) {
4529
4586
  var envObject = emnapiCtx.envStore.get(env);
4530
4587
  envObject.checkGCAccess();
4531
4588
  if (!result) return envObject.setLastError(1);
4532
- new DataView(wasmMemory.buffer).setInt32(result, 5, true);
4589
+ new DataView(wasmMemory.buffer).setUint32(result, 5, true);
4533
4590
  return envObject.clearLastError();
4534
4591
  }
4535
4592
  /** @__sig ipp */
@@ -4538,7 +4595,7 @@ function createNapiModule(options) {
4538
4595
  var envObject = emnapiCtx.envStore.get(env);
4539
4596
  envObject.checkGCAccess();
4540
4597
  if (!result) return envObject.setLastError(1);
4541
- new DataView(wasmMemory.buffer).setInt32(result, 2, true);
4598
+ new DataView(wasmMemory.buffer).setUint32(result, 2, true);
4542
4599
  return envObject.clearLastError();
4543
4600
  }
4544
4601
  /** @__sig ipp */
@@ -4547,7 +4604,7 @@ function createNapiModule(options) {
4547
4604
  var envObject = emnapiCtx.envStore.get(env);
4548
4605
  envObject.checkGCAccess();
4549
4606
  if (!result) return envObject.setLastError(1);
4550
- new DataView(wasmMemory.buffer).setInt32(result, 1, true);
4607
+ new DataView(wasmMemory.buffer).setUint32(result, 1, true);
4551
4608
  return envObject.clearLastError();
4552
4609
  }
4553
4610
  var globalMod = /* @__PURE__ */ Object.freeze({
@@ -4570,7 +4627,7 @@ function createNapiModule(options) {
4570
4627
  var envObject = emnapiCtx.envStore.get(env);
4571
4628
  if (!data) return envObject.setLastError(1);
4572
4629
  var value = envObject.getInstanceData();
4573
- new DataView(wasmMemory.buffer).setInt32(data, value, true);
4630
+ new DataView(wasmMemory.buffer).setUint32(data, value, true);
4574
4631
  return envObject.clearLastError();
4575
4632
  }
4576
4633
  var envMod = /* @__PURE__ */ Object.freeze({
@@ -4587,7 +4644,7 @@ function createNapiModule(options) {
4587
4644
  var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
4588
4645
  HEAP_DATA_VIEW.setInt32(error_code, errorCode, true);
4589
4646
  HEAP_DATA_VIEW.setUint32(engine_error_code, engineErrorCode, true);
4590
- HEAP_DATA_VIEW.setInt32(engine_reserved, engineReserved, true);
4647
+ HEAP_DATA_VIEW.setUint32(engine_reserved, engineReserved, true);
4591
4648
  }
4592
4649
  /** @__sig ipp */
4593
4650
  function napi_throw(env, error$1) {
@@ -4708,7 +4765,7 @@ function createNapiModule(options) {
4708
4765
  error$1.code = codeValue;
4709
4766
  }
4710
4767
  var value = emnapiCtx.addToCurrentScope(error$1).id;
4711
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4768
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4712
4769
  return envObject.clearLastError();
4713
4770
  }
4714
4771
  /** @__sig ipppp */
@@ -4727,7 +4784,7 @@ function createNapiModule(options) {
4727
4784
  error$1.code = codeValue;
4728
4785
  }
4729
4786
  var value = emnapiCtx.addToCurrentScope(error$1).id;
4730
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4787
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4731
4788
  return envObject.clearLastError();
4732
4789
  }
4733
4790
  /** @__sig ipppp */
@@ -4746,7 +4803,7 @@ function createNapiModule(options) {
4746
4803
  error$1.code = codeValue;
4747
4804
  }
4748
4805
  var value = emnapiCtx.addToCurrentScope(error$1).id;
4749
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4806
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4750
4807
  return envObject.clearLastError();
4751
4808
  }
4752
4809
  /** @__sig ipppp */
@@ -4765,7 +4822,7 @@ function createNapiModule(options) {
4765
4822
  error$1.code = codeValue;
4766
4823
  }
4767
4824
  var value = emnapiCtx.addToCurrentScope(error$1).id;
4768
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4825
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4769
4826
  return envObject.clearLastError();
4770
4827
  }
4771
4828
  /** @__sig ipp */
@@ -4776,12 +4833,12 @@ function createNapiModule(options) {
4776
4833
  if (!result) return envObject.setLastError(1);
4777
4834
  var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
4778
4835
  if (!envObject.tryCatch.hasCaught()) {
4779
- HEAP_DATA_VIEW.setInt32(result, 1, true);
4836
+ HEAP_DATA_VIEW.setUint32(result, 1, true);
4780
4837
  return envObject.clearLastError();
4781
4838
  } else {
4782
4839
  var err$1 = envObject.tryCatch.exception();
4783
4840
  var value = envObject.ensureHandleId(err$1);
4784
- HEAP_DATA_VIEW.setInt32(result, value, true);
4841
+ HEAP_DATA_VIEW.setUint32(result, value, true);
4785
4842
  envObject.tryCatch.reset();
4786
4843
  }
4787
4844
  return envObject.clearLastError();
@@ -4848,7 +4905,7 @@ function createNapiModule(options) {
4848
4905
  if (fresult.status !== 0) return envObject.setLastError(fresult.status);
4849
4906
  var f = fresult.f;
4850
4907
  value = emnapiCtx.addToCurrentScope(f).id;
4851
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
4908
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4852
4909
  return envObject.getReturnStatus();
4853
4910
  } catch (err$1) {
4854
4911
  envObject.tryCatch.setError(err$1);
@@ -4870,16 +4927,16 @@ function createNapiModule(options) {
4870
4927
  var i = 0;
4871
4928
  for (; i < arrlen; i++) {
4872
4929
  var argVal = envObject.ensureHandleId(cbinfoValue.args[i]);
4873
- HEAP_DATA_VIEW.setInt32(argv + i * 4, argVal, true);
4930
+ HEAP_DATA_VIEW.setUint32(argv + i * 4, argVal, true);
4874
4931
  }
4875
- if (i < argcValue) for (; i < argcValue; i++) HEAP_DATA_VIEW.setInt32(argv + i * 4, 1, true);
4932
+ if (i < argcValue) for (; i < argcValue; i++) HEAP_DATA_VIEW.setUint32(argv + i * 4, 1, true);
4876
4933
  }
4877
4934
  if (argc) HEAP_DATA_VIEW.setUint32(argc, cbinfoValue.args.length, true);
4878
4935
  if (this_arg) {
4879
4936
  var v = envObject.ensureHandleId(cbinfoValue.thiz);
4880
- HEAP_DATA_VIEW.setInt32(this_arg, v, true);
4937
+ HEAP_DATA_VIEW.setUint32(this_arg, v, true);
4881
4938
  }
4882
- if (data) HEAP_DATA_VIEW.setInt32(data, cbinfoValue.data, true);
4939
+ if (data) HEAP_DATA_VIEW.setUint32(data, cbinfoValue.data, true);
4883
4940
  return envObject.clearLastError();
4884
4941
  }
4885
4942
  /** @__sig ipppppp */
@@ -4905,13 +4962,13 @@ function createNapiModule(options) {
4905
4962
  var args = [];
4906
4963
  var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
4907
4964
  for (; i < argc; i++) {
4908
- var argVal = HEAP_DATA_VIEW.getInt32(argv + i * 4, true);
4965
+ var argVal = HEAP_DATA_VIEW.getUint32(argv + i * 4, true);
4909
4966
  args.push(emnapiCtx.handleStore.get(argVal).value);
4910
4967
  }
4911
4968
  var ret = v8func.apply(v8recv, args);
4912
4969
  if (result) {
4913
4970
  v = envObject.ensureHandleId(ret);
4914
- HEAP_DATA_VIEW.setInt32(result, v, true);
4971
+ HEAP_DATA_VIEW.setUint32(result, v, true);
4915
4972
  }
4916
4973
  return envObject.clearLastError();
4917
4974
  } catch (err$1) {
@@ -4943,7 +5000,7 @@ function createNapiModule(options) {
4943
5000
  if (emnapiCtx.feature.supportReflect) {
4944
5001
  var argList = Array(argc);
4945
5002
  for (i = 0; i < argc; i++) {
4946
- var argVal = HEAP_DATA_VIEW.getInt32(argv + i * 4, true);
5003
+ var argVal = HEAP_DATA_VIEW.getUint32(argv + i * 4, true);
4947
5004
  argList[i] = emnapiCtx.handleStore.get(argVal).value;
4948
5005
  }
4949
5006
  ret = Reflect.construct(Ctor, argList, Ctor);
@@ -4951,14 +5008,14 @@ function createNapiModule(options) {
4951
5008
  var args = Array(argc + 1);
4952
5009
  args[0] = void 0;
4953
5010
  for (i = 0; i < argc; i++) {
4954
- var argVal = HEAP_DATA_VIEW.getInt32(argv + i * 4, true);
5011
+ var argVal = HEAP_DATA_VIEW.getUint32(argv + i * 4, true);
4955
5012
  args[i + 1] = emnapiCtx.handleStore.get(argVal).value;
4956
5013
  }
4957
5014
  ret = new (Ctor.bind.apply(Ctor, args))();
4958
5015
  }
4959
5016
  if (result) {
4960
5017
  v = envObject.ensureHandleId(ret);
4961
- HEAP_DATA_VIEW.setInt32(result, v, true);
5018
+ HEAP_DATA_VIEW.setUint32(result, v, true);
4962
5019
  }
4963
5020
  return envObject.getReturnStatus();
4964
5021
  } catch (err$1) {
@@ -4976,7 +5033,7 @@ function createNapiModule(options) {
4976
5033
  var cbinfoValue = emnapiCtx.scopeStore.get(cbinfo).callbackInfo;
4977
5034
  var thiz = cbinfoValue.thiz, fn = cbinfoValue.fn;
4978
5035
  var value = thiz == null || thiz.constructor == null ? 0 : thiz instanceof fn ? envObject.ensureHandleId(thiz.constructor) : 0;
4979
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
5036
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
4980
5037
  return envObject.clearLastError();
4981
5038
  }
4982
5039
  var functionMod = /* @__PURE__ */ Object.freeze({
@@ -4994,7 +5051,7 @@ function createNapiModule(options) {
4994
5051
  envObject.checkGCAccess();
4995
5052
  if (!result) return envObject.setLastError(1);
4996
5053
  var scope = emnapiCtx.openScope(envObject);
4997
- new DataView(wasmMemory.buffer).setInt32(result, scope.id, true);
5054
+ new DataView(wasmMemory.buffer).setUint32(result, scope.id, true);
4998
5055
  return envObject.clearLastError();
4999
5056
  }
5000
5057
  /** @__sig ipp */
@@ -5014,7 +5071,7 @@ function createNapiModule(options) {
5014
5071
  envObject.checkGCAccess();
5015
5072
  if (!result) return envObject.setLastError(1);
5016
5073
  var scope = emnapiCtx.openScope(envObject);
5017
- new DataView(wasmMemory.buffer).setInt32(result, scope.id, true);
5074
+ new DataView(wasmMemory.buffer).setUint32(result, scope.id, true);
5018
5075
  return envObject.clearLastError();
5019
5076
  }
5020
5077
  /** @__sig ipp */
@@ -5039,7 +5096,7 @@ function createNapiModule(options) {
5039
5096
  if (!scopeObject.escapeCalled()) {
5040
5097
  var newHandle = scopeObject.escape(escapee);
5041
5098
  var value = newHandle ? newHandle.id : 0;
5042
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
5099
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
5043
5100
  return envObject.clearLastError();
5044
5101
  }
5045
5102
  return envObject.setLastError(12);
@@ -5056,7 +5113,7 @@ function createNapiModule(options) {
5056
5113
  if (!(handle.isObject() || handle.isFunction() || handle.isSymbol())) return envObject.setLastError(1);
5057
5114
  }
5058
5115
  var ref = emnapiCtx.createReference(envObject, handle.id, initial_refcount >>> 0, 1);
5059
- new DataView(wasmMemory.buffer).setInt32(result, ref.id, true);
5116
+ new DataView(wasmMemory.buffer).setUint32(result, ref.id, true);
5060
5117
  return envObject.clearLastError();
5061
5118
  }
5062
5119
  /** @__sig ipp */
@@ -5097,7 +5154,7 @@ function createNapiModule(options) {
5097
5154
  if (!ref) return envObject.setLastError(1);
5098
5155
  if (!result) return envObject.setLastError(1);
5099
5156
  var handleId = emnapiCtx.refStore.get(ref).get(envObject);
5100
- new DataView(wasmMemory.buffer).setInt32(result, handleId, true);
5157
+ new DataView(wasmMemory.buffer).setUint32(result, handleId, true);
5101
5158
  return envObject.clearLastError();
5102
5159
  }
5103
5160
  /** @__sig ippp */
@@ -5169,10 +5226,10 @@ function createNapiModule(options) {
5169
5226
  resolve: resolve$1,
5170
5227
  reject
5171
5228
  }).id;
5172
- HEAP_DATA_VIEW.setInt32(deferred, deferredObjectId, true);
5229
+ HEAP_DATA_VIEW.setUint32(deferred, deferredObjectId, true);
5173
5230
  });
5174
5231
  value = emnapiCtx.addToCurrentScope(p).id;
5175
- HEAP_DATA_VIEW.setInt32(promise, value, true);
5232
+ HEAP_DATA_VIEW.setUint32(promise, value, true);
5176
5233
  return envObject.getReturnStatus();
5177
5234
  } catch (err$1) {
5178
5235
  envObject.tryCatch.setError(err$1);
@@ -5325,7 +5382,7 @@ function createNapiModule(options) {
5325
5382
  }
5326
5383
  }
5327
5384
  value = emnapiCtx.addToCurrentScope(ret).id;
5328
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
5385
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
5329
5386
  return envObject.getReturnStatus();
5330
5387
  } catch (err$1) {
5331
5388
  envObject.tryCatch.setError(err$1);
@@ -5408,7 +5465,7 @@ function createNapiModule(options) {
5408
5465
  return envObject.setLastError(2);
5409
5466
  }
5410
5467
  value = envObject.ensureHandleId(v[emnapiCtx.handleStore.get(key).value]);
5411
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
5468
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
5412
5469
  return envObject.getReturnStatus();
5413
5470
  } catch (err$1) {
5414
5471
  envObject.tryCatch.setError(err$1);
@@ -5546,7 +5603,7 @@ function createNapiModule(options) {
5546
5603
  return envObject.setLastError(2);
5547
5604
  }
5548
5605
  value = envObject.ensureHandleId(v[emnapiString.UTF8ToString(utf8name, -1)]);
5549
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
5606
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
5550
5607
  return envObject.getReturnStatus();
5551
5608
  } catch (err$1) {
5552
5609
  envObject.tryCatch.setError(err$1);
@@ -5622,7 +5679,7 @@ function createNapiModule(options) {
5622
5679
  return envObject.setLastError(2);
5623
5680
  }
5624
5681
  value = envObject.ensureHandleId(v[index >>> 0]);
5625
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
5682
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
5626
5683
  return envObject.getReturnStatus();
5627
5684
  } catch (err$1) {
5628
5685
  envObject.tryCatch.setError(err$1);
@@ -5677,14 +5734,14 @@ function createNapiModule(options) {
5677
5734
  var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
5678
5735
  for (var i = 0; i < property_count; i++) {
5679
5736
  propPtr = properties + i * 32;
5680
- var utf8Name = HEAP_DATA_VIEW.getInt32(propPtr, true);
5681
- var name_2 = HEAP_DATA_VIEW.getInt32(propPtr + 4, true);
5682
- var method = HEAP_DATA_VIEW.getInt32(propPtr + 8, true);
5683
- var getter = HEAP_DATA_VIEW.getInt32(propPtr + 12, true);
5684
- var setter = HEAP_DATA_VIEW.getInt32(propPtr + 16, true);
5685
- var value = HEAP_DATA_VIEW.getInt32(propPtr + 20, true);
5737
+ var utf8Name = HEAP_DATA_VIEW.getUint32(propPtr, true);
5738
+ var name_2 = HEAP_DATA_VIEW.getUint32(propPtr + 4, true);
5739
+ var method = HEAP_DATA_VIEW.getUint32(propPtr + 8, true);
5740
+ var getter = HEAP_DATA_VIEW.getUint32(propPtr + 12, true);
5741
+ var setter = HEAP_DATA_VIEW.getUint32(propPtr + 16, true);
5742
+ var value = HEAP_DATA_VIEW.getUint32(propPtr + 20, true);
5686
5743
  attributes = HEAP_DATA_VIEW.getInt32(propPtr + 24, true);
5687
- var data = HEAP_DATA_VIEW.getInt32(propPtr + 28, true);
5744
+ var data = HEAP_DATA_VIEW.getUint32(propPtr + 28, true);
5688
5745
  if (utf8Name) propertyName = emnapiString.UTF8ToString(utf8Name, -1);
5689
5746
  else {
5690
5747
  if (!name_2) return envObject.setLastError(4);
@@ -5776,7 +5833,7 @@ function createNapiModule(options) {
5776
5833
  if (!v8Script.isString()) return envObject.setLastError(3);
5777
5834
  var ret = emnapiCtx.handleStore.get(5).value.eval(v8Script.value);
5778
5835
  value = envObject.ensureHandleId(ret);
5779
- new DataView(wasmMemory.buffer).setInt32(result, value, true);
5836
+ new DataView(wasmMemory.buffer).setUint32(result, value, true);
5780
5837
  status = envObject.getReturnStatus();
5781
5838
  } catch (err$1) {
5782
5839
  envObject.tryCatch.setError(err$1);
@@ -5824,7 +5881,7 @@ function createNapiModule(options) {
5824
5881
  if (!value) return envObject.setLastError(1);
5825
5882
  if (!result) return envObject.setLastError(1);
5826
5883
  v = emnapiCtx.handleStore.get(value).value ? 4 : 3;
5827
- new DataView(wasmMemory.buffer).setInt32(result, v, true);
5884
+ new DataView(wasmMemory.buffer).setUint32(result, v, true);
5828
5885
  return envObject.getReturnStatus();
5829
5886
  } catch (err$1) {
5830
5887
  envObject.tryCatch.setError(err$1);
@@ -5846,7 +5903,7 @@ function createNapiModule(options) {
5846
5903
  var handle = emnapiCtx.handleStore.get(value);
5847
5904
  if (handle.isBigInt()) throw new TypeError("Cannot convert a BigInt value to a number");
5848
5905
  v = emnapiCtx.addToCurrentScope(Number(handle.value)).id;
5849
- new DataView(wasmMemory.buffer).setInt32(result, v, true);
5906
+ new DataView(wasmMemory.buffer).setUint32(result, v, true);
5850
5907
  return envObject.getReturnStatus();
5851
5908
  } catch (err$1) {
5852
5909
  envObject.tryCatch.setError(err$1);
@@ -5868,7 +5925,7 @@ function createNapiModule(options) {
5868
5925
  var handle = emnapiCtx.handleStore.get(value);
5869
5926
  if (handle.value == null) throw new TypeError("Cannot convert undefined or null to object");
5870
5927
  v = envObject.ensureHandleId(Object(handle.value));
5871
- new DataView(wasmMemory.buffer).setInt32(result, v, true);
5928
+ new DataView(wasmMemory.buffer).setUint32(result, v, true);
5872
5929
  return envObject.getReturnStatus();
5873
5930
  } catch (err$1) {
5874
5931
  envObject.tryCatch.setError(err$1);
@@ -5890,7 +5947,7 @@ function createNapiModule(options) {
5890
5947
  var handle = emnapiCtx.handleStore.get(value);
5891
5948
  if (handle.isSymbol()) throw new TypeError("Cannot convert a Symbol value to a string");
5892
5949
  v = emnapiCtx.addToCurrentScope(String(handle.value)).id;
5893
- new DataView(wasmMemory.buffer).setInt32(result, v, true);
5950
+ new DataView(wasmMemory.buffer).setUint32(result, v, true);
5894
5951
  return envObject.getReturnStatus();
5895
5952
  } catch (err$1) {
5896
5953
  envObject.tryCatch.setError(err$1);
@@ -6265,7 +6322,7 @@ function instantiateNapiModuleSync$1(wasmInput, options) {
6265
6322
  return loadNapiModuleImpl(loadSyncCallback, void 0, wasmInput, options);
6266
6323
  }
6267
6324
  var _WebAssembly$1, MessageHandler$1, version$2;
6268
- var init_emnapi_core_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+core@1.4.5/node_modules/@emnapi/core/dist/emnapi-core.esm-bundler.js": (() => {
6325
+ var init_emnapi_core_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+core@1.5.0/node_modules/@emnapi/core/dist/emnapi-core.esm-bundler.js": (() => {
6269
6326
  init_wasi_threads_esm_bundler();
6270
6327
  init_wasi_threads_esm_bundler();
6271
6328
  init_tslib_es6();
@@ -6275,7 +6332,14 @@ var init_emnapi_core_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+cor
6275
6332
  function MessageHandler$2(options) {
6276
6333
  var _this = this;
6277
6334
  if (typeof options.onLoad !== "function") throw new TypeError("options.onLoad is not a function");
6278
- _this = _super.call(this, options) || this;
6335
+ var userOnError = options.onError;
6336
+ _this = _super.call(this, __assign(__assign({}, options), { onError: function(err, type) {
6337
+ var _a;
6338
+ var emnapi_thread_crashed = (_a = _this.instance) === null || _a === void 0 ? void 0 : _a.exports.emnapi_thread_crashed;
6339
+ if (typeof emnapi_thread_crashed === "function") emnapi_thread_crashed();
6340
+ if (typeof userOnError === "function") userOnError(err, type);
6341
+ else throw err;
6342
+ } })) || this;
6279
6343
  _this.napiModule = void 0;
6280
6344
  return _this;
6281
6345
  }
@@ -6296,22 +6360,26 @@ var init_emnapi_core_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+cor
6296
6360
  if ((_a = e === null || e === void 0 ? void 0 : e.data) === null || _a === void 0 ? void 0 : _a.__emnapi__) {
6297
6361
  var type = e.data.__emnapi__.type;
6298
6362
  var payload_1 = e.data.__emnapi__.payload;
6299
- if (type === "async-worker-init") this.handleAfterLoad(e, function() {
6300
- _this.napiModule.initWorker(payload_1.arg);
6301
- });
6302
- else if (type === "async-work-execute") this.handleAfterLoad(e, function() {
6303
- _this.napiModule.executeAsyncWork(payload_1.work);
6304
- });
6363
+ try {
6364
+ if (type === "async-worker-init") this.handleAfterLoad(e, function() {
6365
+ _this.napiModule.initWorker(payload_1.arg);
6366
+ });
6367
+ else if (type === "async-work-execute") this.handleAfterLoad(e, function() {
6368
+ _this.napiModule.executeAsyncWork(payload_1.work);
6369
+ });
6370
+ } catch (err) {
6371
+ this.onError(err, type);
6372
+ }
6305
6373
  }
6306
6374
  };
6307
6375
  return MessageHandler$2;
6308
6376
  }(ThreadMessageHandler);
6309
- version$2 = "1.4.5";
6377
+ version$2 = "1.5.0";
6310
6378
  }) });
6311
6379
 
6312
6380
  //#endregion
6313
- //#region ../../node_modules/.pnpm/@emnapi+runtime@1.4.5/node_modules/@emnapi/runtime/dist/emnapi.esm-bundler.js
6314
- var emnapi_esm_bundler_exports = __export({
6381
+ //#region ../../node_modules/.pnpm/@emnapi+runtime@1.5.0/node_modules/@emnapi/runtime/dist/emnapi.esm-bundler.js
6382
+ var emnapi_esm_bundler_exports = /* @__PURE__ */ __export({
6315
6383
  ConstHandle: () => ConstHandle,
6316
6384
  Context: () => Context,
6317
6385
  Deferred: () => Deferred,
@@ -6388,7 +6456,7 @@ function getDefaultContext$1() {
6388
6456
  return defaultContext;
6389
6457
  }
6390
6458
  var externalValue, External, supportNewFunction, _global, TryCatch, canSetFunctionName, supportReflect, supportFinalizer, supportWeakSymbol, supportBigInt, _require, _MessageChannel, _setImmediate, _Buffer, version$1, NODE_API_SUPPORTED_VERSION_MIN, NODE_API_SUPPORTED_VERSION_MAX, NAPI_VERSION_EXPERIMENTAL, NODE_API_DEFAULT_MODULE_API_VERSION, Handle, ConstHandle, HandleStore, HandleScope, ScopeStore, RefTracker, Finalizer, TrackedFinalizer, Env, NodeEnv, EmnapiError, NotSupportWeakRefError, NotSupportBufferError, StrongRef, Persistent, ReferenceOwnership, Reference, ReferenceWithData, ReferenceWithFinalizer, Deferred, Store, CleanupHookCallback, CleanupQueue, NodejsWaitingRequestCounter, Context, defaultContext;
6391
- var init_emnapi_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+runtime@1.4.5/node_modules/@emnapi/runtime/dist/emnapi.esm-bundler.js": (() => {
6459
+ var init_emnapi_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+runtime@1.5.0/node_modules/@emnapi/runtime/dist/emnapi.esm-bundler.js": (() => {
6392
6460
  init_tslib_es6();
6393
6461
  externalValue = /* @__PURE__ */ new WeakMap();
6394
6462
  External = (function() {
@@ -6507,7 +6575,7 @@ var init_emnapi_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+runtime@
6507
6575
  return _require("buffer").Buffer;
6508
6576
  } catch (_) {}
6509
6577
  })();
6510
- version$1 = "1.4.5";
6578
+ version$1 = "1.5.0";
6511
6579
  NODE_API_SUPPORTED_VERSION_MIN = 1;
6512
6580
  NODE_API_SUPPORTED_VERSION_MAX = 10;
6513
6581
  NAPI_VERSION_EXPERIMENTAL = 2147483647;
@@ -6695,25 +6763,22 @@ var init_emnapi_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+runtime@
6695
6763
  ScopeStore$1.prototype.get = function(id) {
6696
6764
  return this._values[id];
6697
6765
  };
6698
- ScopeStore$1.prototype.openScope = function(envObject) {
6766
+ ScopeStore$1.prototype.openScope = function(handleStore) {
6699
6767
  var currentScope = this.currentScope;
6700
6768
  var scope = currentScope.child;
6701
6769
  if (scope !== null) scope.start = scope.end = currentScope.end;
6702
6770
  else {
6703
6771
  var id = currentScope.id + 1;
6704
- scope = new HandleScope(envObject.ctx.handleStore, id, currentScope, currentScope.end);
6772
+ scope = new HandleScope(handleStore, id, currentScope, currentScope.end);
6705
6773
  this._values[id] = scope;
6706
6774
  }
6707
6775
  this.currentScope = scope;
6708
- envObject.openHandleScopes++;
6709
6776
  return scope;
6710
6777
  };
6711
- ScopeStore$1.prototype.closeScope = function(envObject) {
6712
- if (envObject.openHandleScopes === 0) return;
6778
+ ScopeStore$1.prototype.closeScope = function() {
6713
6779
  var scope = this.currentScope;
6714
6780
  this.currentScope = scope.parent;
6715
6781
  scope.dispose();
6716
- envObject.openHandleScopes--;
6717
6782
  };
6718
6783
  ScopeStore$1.prototype.dispose = function() {
6719
6784
  this.currentScope = this._rootScope;
@@ -7517,10 +7582,14 @@ var init_emnapi_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+runtime@
7517
7582
  return this.scopeStore.currentScope.add(value);
7518
7583
  };
7519
7584
  Context$1.prototype.openScope = function(envObject) {
7520
- return this.scopeStore.openScope(envObject);
7585
+ var scope = this.scopeStore.openScope(this.handleStore);
7586
+ if (envObject) envObject.openHandleScopes++;
7587
+ return scope;
7521
7588
  };
7522
7589
  Context$1.prototype.closeScope = function(envObject, _scope) {
7523
- this.scopeStore.closeScope(envObject);
7590
+ if (envObject && envObject.openHandleScopes === 0) return;
7591
+ this.scopeStore.closeScope();
7592
+ if (envObject) envObject.openHandleScopes--;
7524
7593
  };
7525
7594
  Context$1.prototype.ensureHandle = function(value) {
7526
7595
  switch (value) {
@@ -7573,8 +7642,8 @@ var init_emnapi_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+runtime@
7573
7642
  }) });
7574
7643
 
7575
7644
  //#endregion
7576
- //#region ../../node_modules/.pnpm/@tybys+wasm-util@0.10.0/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.js
7577
- var wasm_util_esm_bundler_exports = __export({
7645
+ //#region ../../node_modules/.pnpm/@tybys+wasm-util@0.10.1/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.js
7646
+ var wasm_util_esm_bundler_exports = /* @__PURE__ */ __export({
7578
7647
  Asyncify: () => Asyncify,
7579
7648
  Memory: () => Memory,
7580
7649
  WASI: () => WASI$2,
@@ -8045,22 +8114,34 @@ function defineName(name, f) {
8045
8114
  Object.defineProperty(f, "name", { value: name });
8046
8115
  return f;
8047
8116
  }
8117
+ function tryCall(f, wasi, args) {
8118
+ let r;
8119
+ try {
8120
+ r = f.apply(wasi, args);
8121
+ } catch (err) {
8122
+ return handleError(err);
8123
+ }
8124
+ if (isPromiseLike(r)) return r.then((_) => _, handleError);
8125
+ return r;
8126
+ }
8048
8127
  function syscallWrap(self$1, name, f) {
8049
- return defineName(name, function() {
8050
- if (process.env.NODE_DEBUG_NATIVE === "wasi") {
8051
- const args = Array.prototype.slice.call(arguments);
8052
- let debugArgs = [`${name}(${Array.from({ length: arguments.length }).map(() => "%d").join(", ")})`];
8053
- debugArgs = debugArgs.concat(args);
8054
- console.debug.apply(console, debugArgs);
8055
- }
8056
- let r;
8128
+ let debug = false;
8129
+ const NODE_DEBUG_NATIVE = (() => {
8057
8130
  try {
8058
- r = f.apply(self$1, arguments);
8059
- } catch (err) {
8060
- return handleError(err);
8131
+ return process.env.NODE_DEBUG_NATIVE;
8132
+ } catch (_) {
8133
+ return;
8061
8134
  }
8062
- if (isPromiseLike(r)) return r.then((_) => _, handleError);
8063
- return r;
8135
+ })();
8136
+ if (typeof NODE_DEBUG_NATIVE === "string" && NODE_DEBUG_NATIVE.split(",").includes("wasi")) debug = true;
8137
+ return debug ? defineName(name, function() {
8138
+ const args = Array.prototype.slice.call(arguments);
8139
+ let debugArgs = [`${name}(${Array.from({ length: arguments.length }).map(() => "%d").join(", ")})`];
8140
+ debugArgs = debugArgs.concat(args);
8141
+ console.debug.apply(console, debugArgs);
8142
+ return tryCall(f, self$1, args);
8143
+ }) : defineName(name, function() {
8144
+ return tryCall(f, self$1, arguments);
8064
8145
  });
8065
8146
  }
8066
8147
  function resolvePathSync(fs$1, fileDescriptor, path, flags) {
@@ -8177,7 +8258,7 @@ async function createAsyncWASI(options = kEmptyObject) {
8177
8258
  return _this;
8178
8259
  }
8179
8260
  var _WebAssembly, ignoreNames, Asyncify, CHAR_DOT, CHAR_FORWARD_SLASH, FD_DATASYNC, FD_READ, FD_SEEK, FD_FDSTAT_SET_FLAGS, FD_SYNC, FD_TELL, FD_WRITE, FD_ADVISE, FD_ALLOCATE, PATH_CREATE_DIRECTORY, PATH_CREATE_FILE, PATH_LINK_SOURCE, PATH_LINK_TARGET, PATH_OPEN, FD_READDIR, PATH_READLINK, PATH_RENAME_SOURCE, PATH_RENAME_TARGET, PATH_FILESTAT_GET, PATH_FILESTAT_SET_SIZE, PATH_FILESTAT_SET_TIMES, FD_FILESTAT_GET, FD_FILESTAT_SET_SIZE, FD_FILESTAT_SET_TIMES, PATH_SYMLINK, PATH_REMOVE_DIRECTORY, PATH_UNLINK_FILE, POLL_FD_READWRITE, SOCK_SHUTDOWN, SOCK_ACCEPT, WasiRights, WasiError, RIGHTS_ALL, BLOCK_DEVICE_BASE, BLOCK_DEVICE_INHERITING, CHARACTER_DEVICE_BASE, CHARACTER_DEVICE_INHERITING, REGULAR_FILE_BASE, REGULAR_FILE_INHERITING, DIRECTORY_BASE, DIRECTORY_INHERITING, SOCKET_BASE, SOCKET_INHERITING, TTY_BASE, TTY_INHERITING, FileDescriptor, StandardOutput, FileDescriptorTable, SyncTable, AsyncTable, WebAssemblyMemory, Memory, _memory, _wasi, _fs, encoder, decoder, INT64_MAX, WASI$1, kEmptyObject, kExitCode, kSetMemory, kStarted, kInstance, kBindingName, WASI$2;
8180
- var init_wasm_util_esm_bundler = __esm({ "../../node_modules/.pnpm/@tybys+wasm-util@0.10.0/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.js": (() => {
8261
+ var init_wasm_util_esm_bundler = __esm({ "../../node_modules/.pnpm/@tybys+wasm-util@0.10.1/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.js": (() => {
8181
8262
  _WebAssembly = typeof WebAssembly !== "undefined" ? WebAssembly : typeof WXWebAssembly !== "undefined" ? WXWebAssembly : void 0;
8182
8263
  if (!_WebAssembly) throw new Error("WebAssembly is not supported in this environment");
8183
8264
  ignoreNames = [
@@ -9811,8 +9892,8 @@ var init_wasm_util_esm_bundler = __esm({ "../../node_modules/.pnpm/@tybys+wasm-u
9811
9892
  }) });
9812
9893
 
9813
9894
  //#endregion
9814
- //#region ../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.3/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs
9815
- var require_fs_proxy = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.3/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs": ((exports) => {
9895
+ //#region ../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.5/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs
9896
+ var require_fs_proxy = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.5/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs": ((exports) => {
9816
9897
  /**
9817
9898
  * @param {unknown} value
9818
9899
  */
@@ -10009,8 +10090,8 @@ var require_fs_proxy = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@n
10009
10090
  }) });
10010
10091
 
10011
10092
  //#endregion
10012
- //#region ../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.3/node_modules/@napi-rs/wasm-runtime/runtime.cjs
10013
- var require_runtime = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.3/node_modules/@napi-rs/wasm-runtime/runtime.cjs": ((exports, module) => {
10093
+ //#region ../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.5/node_modules/@napi-rs/wasm-runtime/runtime.cjs
10094
+ var require_runtime = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.5/node_modules/@napi-rs/wasm-runtime/runtime.cjs": ((exports, module) => {
10014
10095
  const { MessageHandler, instantiateNapiModuleSync, instantiateNapiModule } = (init_emnapi_core_esm_bundler(), __toCommonJS(emnapi_core_esm_bundler_exports));
10015
10096
  const { getDefaultContext } = (init_emnapi_esm_bundler(), __toCommonJS(emnapi_esm_bundler_exports));
10016
10097
  const { WASI } = (init_wasm_util_esm_bundler(), __toCommonJS(wasm_util_esm_bundler_exports));
@@ -10218,7 +10299,7 @@ const isMuslFromChildProcess = () => {
10218
10299
  };
10219
10300
  function requireNative() {
10220
10301
  if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) try {
10221
- nativeBinding = __require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
10302
+ return __require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
10222
10303
  } catch (err) {
10223
10304
  loadErrors.push(err);
10224
10305
  }
@@ -10231,7 +10312,7 @@ function requireNative() {
10231
10312
  try {
10232
10313
  const binding = __require("@rolldown/binding-android-arm64");
10233
10314
  const bindingPackageVersion = __require("@rolldown/binding-android-arm64/package.json").version;
10234
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10315
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10235
10316
  return binding;
10236
10317
  } catch (e) {
10237
10318
  loadErrors.push(e);
@@ -10245,7 +10326,7 @@ function requireNative() {
10245
10326
  try {
10246
10327
  const binding = __require("@rolldown/binding-android-arm-eabi");
10247
10328
  const bindingPackageVersion = __require("@rolldown/binding-android-arm-eabi/package.json").version;
10248
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10329
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10249
10330
  return binding;
10250
10331
  } catch (e) {
10251
10332
  loadErrors.push(e);
@@ -10260,7 +10341,7 @@ function requireNative() {
10260
10341
  try {
10261
10342
  const binding = __require("@rolldown/binding-win32-x64-msvc");
10262
10343
  const bindingPackageVersion = __require("@rolldown/binding-win32-x64-msvc/package.json").version;
10263
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10344
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10264
10345
  return binding;
10265
10346
  } catch (e) {
10266
10347
  loadErrors.push(e);
@@ -10274,7 +10355,7 @@ function requireNative() {
10274
10355
  try {
10275
10356
  const binding = __require("@rolldown/binding-win32-ia32-msvc");
10276
10357
  const bindingPackageVersion = __require("@rolldown/binding-win32-ia32-msvc/package.json").version;
10277
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10358
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10278
10359
  return binding;
10279
10360
  } catch (e) {
10280
10361
  loadErrors.push(e);
@@ -10288,7 +10369,7 @@ function requireNative() {
10288
10369
  try {
10289
10370
  const binding = __require("@rolldown/binding-win32-arm64-msvc");
10290
10371
  const bindingPackageVersion = __require("@rolldown/binding-win32-arm64-msvc/package.json").version;
10291
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10372
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10292
10373
  return binding;
10293
10374
  } catch (e) {
10294
10375
  loadErrors.push(e);
@@ -10303,7 +10384,7 @@ function requireNative() {
10303
10384
  try {
10304
10385
  const binding = __require("@rolldown/binding-darwin-universal");
10305
10386
  const bindingPackageVersion = __require("@rolldown/binding-darwin-universal/package.json").version;
10306
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10387
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10307
10388
  return binding;
10308
10389
  } catch (e) {
10309
10390
  loadErrors.push(e);
@@ -10317,7 +10398,7 @@ function requireNative() {
10317
10398
  try {
10318
10399
  const binding = __require("@rolldown/binding-darwin-x64");
10319
10400
  const bindingPackageVersion = __require("@rolldown/binding-darwin-x64/package.json").version;
10320
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10401
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10321
10402
  return binding;
10322
10403
  } catch (e) {
10323
10404
  loadErrors.push(e);
@@ -10331,7 +10412,7 @@ function requireNative() {
10331
10412
  try {
10332
10413
  const binding = __require("@rolldown/binding-darwin-arm64");
10333
10414
  const bindingPackageVersion = __require("@rolldown/binding-darwin-arm64/package.json").version;
10334
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10415
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10335
10416
  return binding;
10336
10417
  } catch (e) {
10337
10418
  loadErrors.push(e);
@@ -10346,7 +10427,7 @@ function requireNative() {
10346
10427
  try {
10347
10428
  const binding = __require("@rolldown/binding-freebsd-x64");
10348
10429
  const bindingPackageVersion = __require("@rolldown/binding-freebsd-x64/package.json").version;
10349
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10430
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10350
10431
  return binding;
10351
10432
  } catch (e) {
10352
10433
  loadErrors.push(e);
@@ -10360,7 +10441,7 @@ function requireNative() {
10360
10441
  try {
10361
10442
  const binding = __require("@rolldown/binding-freebsd-arm64");
10362
10443
  const bindingPackageVersion = __require("@rolldown/binding-freebsd-arm64/package.json").version;
10363
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10444
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10364
10445
  return binding;
10365
10446
  } catch (e) {
10366
10447
  loadErrors.push(e);
@@ -10375,7 +10456,7 @@ function requireNative() {
10375
10456
  try {
10376
10457
  const binding = __require("@rolldown/binding-linux-x64-musl");
10377
10458
  const bindingPackageVersion = __require("@rolldown/binding-linux-x64-musl/package.json").version;
10378
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10459
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10379
10460
  return binding;
10380
10461
  } catch (e) {
10381
10462
  loadErrors.push(e);
@@ -10389,7 +10470,7 @@ function requireNative() {
10389
10470
  try {
10390
10471
  const binding = __require("@rolldown/binding-linux-x64-gnu");
10391
10472
  const bindingPackageVersion = __require("@rolldown/binding-linux-x64-gnu/package.json").version;
10392
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10473
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10393
10474
  return binding;
10394
10475
  } catch (e) {
10395
10476
  loadErrors.push(e);
@@ -10404,7 +10485,7 @@ function requireNative() {
10404
10485
  try {
10405
10486
  const binding = __require("@rolldown/binding-linux-arm64-musl");
10406
10487
  const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-musl/package.json").version;
10407
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10488
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10408
10489
  return binding;
10409
10490
  } catch (e) {
10410
10491
  loadErrors.push(e);
@@ -10418,7 +10499,7 @@ function requireNative() {
10418
10499
  try {
10419
10500
  const binding = __require("@rolldown/binding-linux-arm64-gnu");
10420
10501
  const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-gnu/package.json").version;
10421
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10502
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10422
10503
  return binding;
10423
10504
  } catch (e) {
10424
10505
  loadErrors.push(e);
@@ -10433,7 +10514,7 @@ function requireNative() {
10433
10514
  try {
10434
10515
  const binding = __require("@rolldown/binding-linux-arm-musleabihf");
10435
10516
  const bindingPackageVersion = __require("@rolldown/binding-linux-arm-musleabihf/package.json").version;
10436
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10517
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10437
10518
  return binding;
10438
10519
  } catch (e) {
10439
10520
  loadErrors.push(e);
@@ -10447,7 +10528,36 @@ function requireNative() {
10447
10528
  try {
10448
10529
  const binding = __require("@rolldown/binding-linux-arm-gnueabihf");
10449
10530
  const bindingPackageVersion = __require("@rolldown/binding-linux-arm-gnueabihf/package.json").version;
10450
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10531
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10532
+ return binding;
10533
+ } catch (e) {
10534
+ loadErrors.push(e);
10535
+ }
10536
+ }
10537
+ else if (process.arch === "loong64") if (isMusl()) {
10538
+ try {
10539
+ return __require("../rolldown-binding.linux-loong64-musl.node");
10540
+ } catch (e) {
10541
+ loadErrors.push(e);
10542
+ }
10543
+ try {
10544
+ const binding = __require("@rolldown/binding-linux-loong64-musl");
10545
+ const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-musl/package.json").version;
10546
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10547
+ return binding;
10548
+ } catch (e) {
10549
+ loadErrors.push(e);
10550
+ }
10551
+ } else {
10552
+ try {
10553
+ return __require("../rolldown-binding.linux-loong64-gnu.node");
10554
+ } catch (e) {
10555
+ loadErrors.push(e);
10556
+ }
10557
+ try {
10558
+ const binding = __require("@rolldown/binding-linux-loong64-gnu");
10559
+ const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-gnu/package.json").version;
10560
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10451
10561
  return binding;
10452
10562
  } catch (e) {
10453
10563
  loadErrors.push(e);
@@ -10462,7 +10572,7 @@ function requireNative() {
10462
10572
  try {
10463
10573
  const binding = __require("@rolldown/binding-linux-riscv64-musl");
10464
10574
  const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-musl/package.json").version;
10465
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10575
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10466
10576
  return binding;
10467
10577
  } catch (e) {
10468
10578
  loadErrors.push(e);
@@ -10476,7 +10586,7 @@ function requireNative() {
10476
10586
  try {
10477
10587
  const binding = __require("@rolldown/binding-linux-riscv64-gnu");
10478
10588
  const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-gnu/package.json").version;
10479
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10589
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10480
10590
  return binding;
10481
10591
  } catch (e) {
10482
10592
  loadErrors.push(e);
@@ -10491,7 +10601,7 @@ function requireNative() {
10491
10601
  try {
10492
10602
  const binding = __require("@rolldown/binding-linux-ppc64-gnu");
10493
10603
  const bindingPackageVersion = __require("@rolldown/binding-linux-ppc64-gnu/package.json").version;
10494
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10604
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10495
10605
  return binding;
10496
10606
  } catch (e) {
10497
10607
  loadErrors.push(e);
@@ -10505,7 +10615,7 @@ function requireNative() {
10505
10615
  try {
10506
10616
  const binding = __require("@rolldown/binding-linux-s390x-gnu");
10507
10617
  const bindingPackageVersion = __require("@rolldown/binding-linux-s390x-gnu/package.json").version;
10508
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10618
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10509
10619
  return binding;
10510
10620
  } catch (e) {
10511
10621
  loadErrors.push(e);
@@ -10520,7 +10630,7 @@ function requireNative() {
10520
10630
  try {
10521
10631
  const binding = __require("@rolldown/binding-openharmony-arm64");
10522
10632
  const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm64/package.json").version;
10523
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10633
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10524
10634
  return binding;
10525
10635
  } catch (e) {
10526
10636
  loadErrors.push(e);
@@ -10534,7 +10644,7 @@ function requireNative() {
10534
10644
  try {
10535
10645
  const binding = __require("@rolldown/binding-openharmony-x64");
10536
10646
  const bindingPackageVersion = __require("@rolldown/binding-openharmony-x64/package.json").version;
10537
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10647
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10538
10648
  return binding;
10539
10649
  } catch (e) {
10540
10650
  loadErrors.push(e);
@@ -10548,7 +10658,7 @@ function requireNative() {
10548
10658
  try {
10549
10659
  const binding = __require("@rolldown/binding-openharmony-arm");
10550
10660
  const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm/package.json").version;
10551
- if (bindingPackageVersion !== "1.0.0-beta.37" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.37 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10661
+ if (bindingPackageVersion !== "1.0.0-beta.38" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.38 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
10552
10662
  return binding;
10553
10663
  } catch (e) {
10554
10664
  loadErrors.push(e);
@@ -10558,15 +10668,27 @@ function requireNative() {
10558
10668
  }
10559
10669
  nativeBinding = requireNative();
10560
10670
  if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
10671
+ let wasiBinding = null;
10672
+ let wasiBindingError = null;
10561
10673
  try {
10562
- nativeBinding = require_rolldown_binding_wasi();
10674
+ wasiBinding = require_rolldown_binding_wasi();
10675
+ nativeBinding = wasiBinding;
10563
10676
  } catch (err) {
10564
- if (process.env.NAPI_RS_FORCE_WASI) loadErrors.push(err);
10677
+ if (process.env.NAPI_RS_FORCE_WASI) wasiBindingError = err;
10565
10678
  }
10566
10679
  if (!nativeBinding) try {
10567
- nativeBinding = __require("@rolldown/binding-wasm32-wasi");
10680
+ wasiBinding = __require("@rolldown/binding-wasm32-wasi");
10681
+ nativeBinding = wasiBinding;
10568
10682
  } catch (err) {
10569
- if (process.env.NAPI_RS_FORCE_WASI) loadErrors.push(err);
10683
+ if (process.env.NAPI_RS_FORCE_WASI) {
10684
+ wasiBindingError.cause = err;
10685
+ loadErrors.push(err);
10686
+ }
10687
+ }
10688
+ if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
10689
+ const error$1 = /* @__PURE__ */ new Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
10690
+ error$1.cause = wasiBindingError;
10691
+ throw error$1;
10570
10692
  }
10571
10693
  }
10572
10694
  if (!nativeBinding && globalThis.process?.versions?.["webcontainer"]) try {
@@ -10575,7 +10697,10 @@ if (!nativeBinding && globalThis.process?.versions?.["webcontainer"]) try {
10575
10697
  loadErrors.push(err);
10576
10698
  }
10577
10699
  if (!nativeBinding) {
10578
- if (loadErrors.length > 0) throw new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.", { cause: loadErrors });
10700
+ if (loadErrors.length > 0) throw new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.", { cause: loadErrors.reduce((err, cur) => {
10701
+ cur.cause = err;
10702
+ return cur;
10703
+ }) });
10579
10704
  throw new Error(`Failed to load native binding`);
10580
10705
  }
10581
10706
  const { minify, Severity, ParseResult, ExportExportNameKind, ExportImportNameKind, ExportLocalNameKind, ImportNameKind, parseAsync, parseSync, rawTransferSupported, ResolverFactory, EnforceExtension, ModuleType, sync, HelperMode, isolatedDeclaration, moduleRunnerTransform, transform, BindingBundleEndEventData, BindingBundleErrorEventData, BindingBundler, BindingBundlerImpl, BindingCallableBuiltinPlugin, BindingChunkingContext, BindingDevEngine, BindingHmrOutput, BindingModuleInfo, BindingNormalizedOptions, BindingOutputAsset, BindingOutputChunk, BindingOutputs, BindingPluginContext, BindingRenderedChunk, BindingRenderedChunkMeta, BindingRenderedModule, BindingTransformPluginContext, BindingWatcher, BindingWatcherChangeData, BindingWatcherEvent, ParallelJsPluginRegistry, ScheduledBuild, TraceSubscriberGuard, BindingAttachDebugInfo, BindingBuiltinPluginName, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, FilterTokenKind, initTraceSubscriber, registerPlugins, shutdownAsyncRuntime, startAsyncRuntime, JsWatcher } = nativeBinding;
@@ -10767,7 +10892,7 @@ function augmentCodeLocation(properties, pos, source, id) {
10767
10892
  }
10768
10893
 
10769
10894
  //#endregion
10770
- //#region ../../node_modules/.pnpm/oxc-parser@0.87.0/node_modules/oxc-parser/wrap.mjs
10895
+ //#region ../../node_modules/.pnpm/oxc-parser@0.89.0/node_modules/oxc-parser/wrap.mjs
10771
10896
  function wrap$1(result) {
10772
10897
  let program, module$1, comments, errors;
10773
10898
  return {
@@ -10844,4 +10969,4 @@ async function parseAstAsync(sourceText, options, filename) {
10844
10969
  }
10845
10970
 
10846
10971
  //#endregion
10847
- export { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingDevEngine, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingWatcher, ParallelJsPluginRegistry, ResolverFactory, __commonJS, __toESM, augmentCodeLocation, error, isolatedDeclaration, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, moduleRunnerTransform, parseAst, parseAstAsync, registerPlugins, shutdownAsyncRuntime, startAsyncRuntime, transform };
10972
+ export { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingDevEngine, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingWatcher, ParallelJsPluginRegistry, ResolverFactory, augmentCodeLocation, error, initTraceSubscriber, isolatedDeclaration, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, moduleRunnerTransform, parseAst, parseAstAsync, registerPlugins, shutdownAsyncRuntime, startAsyncRuntime, transform };